@remoteoss/remote-flows 1.4.2 → 1.5.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 (408) hide show
  1. package/README.md +8 -2
  2. package/dist/ButtonDefault-PG2HCSV4.js +2 -0
  3. package/dist/ButtonDefault-PG2HCSV4.js.map +1 -0
  4. package/dist/CheckboxFieldDefault-OBJ4QREK.js +2 -0
  5. package/dist/CheckboxFieldDefault-OBJ4QREK.js.map +1 -0
  6. package/dist/CountryFieldDefault-WPXUWTKB.js +2 -0
  7. package/dist/CountryFieldDefault-WPXUWTKB.js.map +1 -0
  8. package/dist/DatePickerFieldDefault-GHJWMFG2.js +2 -0
  9. package/dist/DatePickerFieldDefault-GHJWMFG2.js.map +1 -0
  10. package/dist/DrawerDefault-FSKTBWTS.js +2 -0
  11. package/dist/DrawerDefault-FSKTBWTS.js.map +1 -0
  12. package/dist/EmailFieldDefault-2TN72RV6.js +2 -0
  13. package/dist/EmailFieldDefault-2TN72RV6.js.map +1 -0
  14. package/dist/FieldsetToggleButtonDefault-NLE2WGVL.js +2 -0
  15. package/dist/FieldsetToggleButtonDefault-NLE2WGVL.js.map +1 -0
  16. package/dist/FileUploadFieldDefault-DDUFS4WG.js +2 -0
  17. package/dist/FileUploadFieldDefault-DDUFS4WG.js.map +1 -0
  18. package/dist/MultiSelectFieldDefault-7VSOLYXI.js +2 -0
  19. package/dist/MultiSelectFieldDefault-7VSOLYXI.js.map +1 -0
  20. package/dist/NumberFieldDefault-N7VHRJZA.js +2 -0
  21. package/dist/NumberFieldDefault-N7VHRJZA.js.map +1 -0
  22. package/dist/RadioGroupFieldDefault-PCQKOUWG.js +2 -0
  23. package/dist/RadioGroupFieldDefault-PCQKOUWG.js.map +1 -0
  24. package/dist/SelectFieldDefault-AT2ZVV4P.js +2 -0
  25. package/dist/SelectFieldDefault-AT2ZVV4P.js.map +1 -0
  26. package/dist/StatementDefault-J7AMNUZ2.js +2 -0
  27. package/dist/StatementDefault-J7AMNUZ2.js.map +1 -0
  28. package/dist/TableFieldDefault-KZXST5VW.js +2 -0
  29. package/dist/TableFieldDefault-KZXST5VW.js.map +1 -0
  30. package/dist/TextAreaFieldDefault-LUX3XPMB.js +2 -0
  31. package/dist/TextAreaFieldDefault-LUX3XPMB.js.map +1 -0
  32. package/dist/TextFieldDefault-ZGWGWYJ6.js +2 -0
  33. package/dist/TextFieldDefault-ZGWGWYJ6.js.map +1 -0
  34. package/dist/WorkScheduleFieldDefault-JEWUBVOO.js +2 -0
  35. package/dist/WorkScheduleFieldDefault-JEWUBVOO.js.map +1 -0
  36. package/dist/ZendeskDrawerDefault-L3QJQNRH.js +2 -0
  37. package/dist/ZendeskDrawerDefault-L3QJQNRH.js.map +1 -0
  38. package/dist/chunk-252BG35G.js +2 -0
  39. package/dist/chunk-252BG35G.js.map +1 -0
  40. package/dist/chunk-2IHUWRL4.js +2 -0
  41. package/dist/chunk-2IHUWRL4.js.map +1 -0
  42. package/dist/{chunk-MD2QFLXC.js → chunk-2L5YJSIF.js} +2 -2
  43. package/dist/{chunk-ARQ2PTEA.js → chunk-2RLH6ZLY.js} +2 -2
  44. package/dist/chunk-37PL5HK2.js +2 -0
  45. package/dist/chunk-37PL5HK2.js.map +1 -0
  46. package/dist/chunk-4LMCHO7V.js +2 -0
  47. package/dist/chunk-4LMCHO7V.js.map +1 -0
  48. package/dist/chunk-4N66FNVP.js +2 -0
  49. package/dist/chunk-4N66FNVP.js.map +1 -0
  50. package/dist/chunk-4O6M7I7Z.js +2 -0
  51. package/dist/chunk-4O6M7I7Z.js.map +1 -0
  52. package/dist/{chunk-2ZCOC6FB.js → chunk-4Z3V5SXU.js} +2 -2
  53. package/dist/chunk-5CDYMEHW.js +2 -0
  54. package/dist/chunk-5CDYMEHW.js.map +1 -0
  55. package/dist/{chunk-K3XVYHGV.js → chunk-5CXPVPOG.js} +2 -2
  56. package/dist/{chunk-MWMX5KTM.js → chunk-5S5YAMYB.js} +2 -2
  57. package/dist/chunk-5XAHIRL6.js +2 -0
  58. package/dist/chunk-5XAHIRL6.js.map +1 -0
  59. package/dist/{chunk-6YRMHTAZ.js → chunk-6ARN2SX2.js} +2 -2
  60. package/dist/chunk-6CASSN2Z.js +2 -0
  61. package/dist/chunk-75H7ASIK.js +2 -0
  62. package/dist/chunk-75H7ASIK.js.map +1 -0
  63. package/dist/chunk-7EHK36JU.js +2 -0
  64. package/dist/chunk-7EHK36JU.js.map +1 -0
  65. package/dist/{chunk-Y75E2FOC.js → chunk-AJADTL33.js} +2 -2
  66. package/dist/{chunk-BNBEIHLD.js → chunk-BAGTZ3NN.js} +2 -2
  67. package/dist/{chunk-ZJAFMNUN.js → chunk-BIC5GBW4.js} +2 -2
  68. package/dist/{chunk-3DGBLO6M.js → chunk-CIUPGLOU.js} +2 -2
  69. package/dist/chunk-D5AR26AI.js +2 -0
  70. package/dist/chunk-D5AR26AI.js.map +1 -0
  71. package/dist/chunk-DA6SLHO4.js +2 -0
  72. package/dist/chunk-DA6SLHO4.js.map +1 -0
  73. package/dist/{chunk-BF3P3CMA.js → chunk-DN6SGTCI.js} +2 -2
  74. package/dist/chunk-FDBLCEFN.js +2 -0
  75. package/dist/chunk-FDBLCEFN.js.map +1 -0
  76. package/dist/{chunk-A5NDO6CQ.js → chunk-FEGY4ZEW.js} +2 -2
  77. package/dist/chunk-FM7K64YV.js +2 -0
  78. package/dist/chunk-FM7K64YV.js.map +1 -0
  79. package/dist/chunk-FNSD4BSK.js +2 -0
  80. package/dist/chunk-FNSD4BSK.js.map +1 -0
  81. package/dist/chunk-GBU46SLB.js +2 -0
  82. package/dist/chunk-GBU46SLB.js.map +1 -0
  83. package/dist/chunk-GDEPTDOR.js +2 -0
  84. package/dist/chunk-GDEPTDOR.js.map +1 -0
  85. package/dist/chunk-GNPHI7PB.js +2 -0
  86. package/dist/chunk-GNPHI7PB.js.map +1 -0
  87. package/dist/chunk-GPRN5IXM.js +2 -0
  88. package/dist/chunk-GPRN5IXM.js.map +1 -0
  89. package/dist/chunk-GWA5DDSK.js +2 -0
  90. package/dist/chunk-GWA5DDSK.js.map +1 -0
  91. package/dist/chunk-HNUWNTPD.js +2 -0
  92. package/dist/chunk-HNUWNTPD.js.map +1 -0
  93. package/dist/{chunk-KABFJTE2.js → chunk-IGLBEWVV.js} +2 -2
  94. package/dist/{chunk-WO33FKK4.js → chunk-IJUB7Z4E.js} +2 -2
  95. package/dist/{chunk-25M7VGZT.js → chunk-IOX27DWA.js} +2 -2
  96. package/dist/chunk-ISSEORVM.js +2 -0
  97. package/dist/chunk-ISSEORVM.js.map +1 -0
  98. package/dist/{chunk-CZ7DTX5L.js → chunk-IVHHMIUY.js} +2 -2
  99. package/dist/{chunk-BZBPPV5B.js → chunk-J2NQBF62.js} +2 -2
  100. package/dist/chunk-JCIUCOEM.js +2 -0
  101. package/dist/chunk-JCIUCOEM.js.map +1 -0
  102. package/dist/chunk-JHIRXRGV.js +2 -0
  103. package/dist/chunk-JHIRXRGV.js.map +1 -0
  104. package/dist/{chunk-QLX4J76Z.js → chunk-K4IKYJ3B.js} +2 -2
  105. package/dist/{chunk-B3TRTHW4.js → chunk-KKKOMF2R.js} +2 -2
  106. package/dist/chunk-KRJETP7I.js +2 -0
  107. package/dist/chunk-KRJETP7I.js.map +1 -0
  108. package/dist/chunk-L2A6WN6O.js +2 -0
  109. package/dist/chunk-L2A6WN6O.js.map +1 -0
  110. package/dist/chunk-L5WJIYHB.js +2 -0
  111. package/dist/chunk-L5WJIYHB.js.map +1 -0
  112. package/dist/chunk-LLP55ZDN.js +2 -0
  113. package/dist/chunk-LLP55ZDN.js.map +1 -0
  114. package/dist/chunk-LXD6EB3B.js +2 -0
  115. package/dist/chunk-LXD6EB3B.js.map +1 -0
  116. package/dist/chunk-M6SSA4VP.js +2 -0
  117. package/dist/chunk-M6SSA4VP.js.map +1 -0
  118. package/dist/chunk-MJQUJZCD.js +2 -0
  119. package/dist/chunk-MJQUJZCD.js.map +1 -0
  120. package/dist/chunk-N6YAIBJR.js +2 -0
  121. package/dist/chunk-N6YAIBJR.js.map +1 -0
  122. package/dist/{chunk-JHSQWGEK.js → chunk-NO6BRWFS.js} +2 -2
  123. package/dist/{chunk-OF66TZF4.js → chunk-OEBMODP7.js} +2 -2
  124. package/dist/{chunk-SCIX6XLQ.js → chunk-OW7BCYPF.js} +2 -2
  125. package/dist/{chunk-YXVNCPUI.js → chunk-P5GY5LLV.js} +2 -2
  126. package/dist/{chunk-ZK27BWOZ.js → chunk-Q2XGTGUQ.js} +2 -2
  127. package/dist/chunk-Q3LH3SPI.js +2 -0
  128. package/dist/chunk-Q3LH3SPI.js.map +1 -0
  129. package/dist/chunk-Q3NPSRTT.js +2 -0
  130. package/dist/chunk-Q3NPSRTT.js.map +1 -0
  131. package/dist/{chunk-3OX2LLXL.js → chunk-QCIOQVSK.js} +2 -2
  132. package/dist/{chunk-AOQ5FJGP.js → chunk-QT43Z24O.js} +2 -2
  133. package/dist/{chunk-LEVFKYRL.js → chunk-QTJ6EDEM.js} +2 -2
  134. package/dist/chunk-R5MQUZSC.js +2 -0
  135. package/dist/chunk-R5MQUZSC.js.map +1 -0
  136. package/dist/chunk-RGAHP6NW.js +2 -0
  137. package/dist/chunk-RGAHP6NW.js.map +1 -0
  138. package/dist/chunk-RVYQJM63.js +2 -0
  139. package/dist/chunk-RVYQJM63.js.map +1 -0
  140. package/dist/{chunk-JDNBIL6Z.js → chunk-RYOXAR7O.js} +2 -2
  141. package/dist/chunk-SHWM6RJC.js +2 -0
  142. package/dist/chunk-SHWM6RJC.js.map +1 -0
  143. package/dist/{chunk-QZ6XHIMS.js → chunk-SO2RPIOT.js} +2 -2
  144. package/dist/chunk-U6LRMWRI.js +2 -0
  145. package/dist/chunk-U6LRMWRI.js.map +1 -0
  146. package/dist/{chunk-N3X274GT.js → chunk-U7CW67TM.js} +2 -2
  147. package/dist/{chunk-TKSW7MGC.js → chunk-V4OZS4QW.js} +2 -2
  148. package/dist/chunk-VAFD5QUX.js +2 -0
  149. package/dist/chunk-VAFD5QUX.js.map +1 -0
  150. package/dist/chunk-VCZDLRTI.js +2 -0
  151. package/dist/chunk-VCZDLRTI.js.map +1 -0
  152. package/dist/{chunk-73BVEZJ6.js → chunk-VD2T75BY.js} +2 -2
  153. package/dist/chunk-VLKGQAEQ.js +2 -0
  154. package/dist/chunk-VLKGQAEQ.js.map +1 -0
  155. package/dist/{chunk-7JL3BFOU.js → chunk-W32TDEQ3.js} +2 -2
  156. package/dist/{chunk-VTX5YWRU.js → chunk-W4G2O5QV.js} +2 -2
  157. package/dist/chunk-W7YC2IO2.js +2 -0
  158. package/dist/chunk-W7YC2IO2.js.map +1 -0
  159. package/dist/{chunk-HLR4BEDV.js → chunk-WAG67DRI.js} +2 -2
  160. package/dist/chunk-WR5DSTKP.js +2 -0
  161. package/dist/chunk-WR5DSTKP.js.map +1 -0
  162. package/dist/chunk-WXZ5B4PT.js +2 -0
  163. package/dist/chunk-WXZ5B4PT.js.map +1 -0
  164. package/dist/{chunk-5HXPBCU6.js → chunk-WYIEW4OC.js} +2 -2
  165. package/dist/{chunk-NFWNYW2E.js → chunk-X3ZIQ7HA.js} +1 -1
  166. package/dist/{chunk-IF42CZJH.js → chunk-XGECMN4V.js} +2 -2
  167. package/dist/{chunk-P5QKSFOE.js → chunk-XXIUJVIY.js} +2 -2
  168. package/dist/chunk-YIMWF5GR.js +2 -0
  169. package/dist/chunk-YIMWF5GR.js.map +1 -0
  170. package/dist/{chunk-J3BK2DEH.js → chunk-YRFNEKBE.js} +2 -2
  171. package/dist/{chunk-7X3WUOTU.js → chunk-ZBLC4GNZ.js} +2 -2
  172. package/dist/chunk-ZDTHQRXJ.js +2 -0
  173. package/dist/chunk-ZDTHQRXJ.js.map +1 -0
  174. package/dist/chunk-ZJSGU543.js +2 -0
  175. package/dist/chunk-ZJSGU543.js.map +1 -0
  176. package/dist/default-components.d.ts +16 -0
  177. package/dist/default-components.js +2 -0
  178. package/dist/default-components.js.map +1 -0
  179. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  180. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  181. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  182. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  183. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  184. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  185. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  186. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  187. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  188. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  189. package/dist/flows/ContractAmendment/hooks.js +1 -1
  190. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  191. package/dist/flows/ContractAmendment/index.js +1 -1
  192. package/dist/flows/ContractAmendment/types.d.ts +2 -2
  193. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  194. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  195. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  196. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  197. package/dist/flows/ContractorOnboarding/api.js +1 -1
  198. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  199. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  200. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  201. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  202. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  203. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  204. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  205. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  206. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  207. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  208. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  209. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  210. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  211. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  212. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  213. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  214. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  215. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  216. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  217. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  218. package/dist/flows/ContractorOnboarding/index.js +1 -1
  219. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  220. package/dist/flows/ContractorOnboarding/utils.d.ts +2 -2
  221. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  222. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  223. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  224. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  225. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  226. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  227. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -2
  228. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  229. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -2
  230. package/dist/flows/CostCalculator/api.d.ts +2 -2
  231. package/dist/flows/CostCalculator/api.js +1 -1
  232. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  233. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  234. package/dist/flows/CostCalculator/context.d.ts +3 -3
  235. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  236. package/dist/flows/CostCalculator/hooks.js +1 -1
  237. package/dist/flows/CostCalculator/index.d.ts +3 -3
  238. package/dist/flows/CostCalculator/index.js +1 -1
  239. package/dist/flows/CostCalculator/types.d.ts +2 -2
  240. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  241. package/dist/flows/CostCalculator/utils.js +1 -1
  242. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  243. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  244. package/dist/flows/Onboarding/api.d.ts +4 -4
  245. package/dist/flows/Onboarding/api.js +1 -1
  246. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  247. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  248. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  249. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  250. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  251. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  252. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  253. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  254. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  255. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  256. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  257. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  258. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  259. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  260. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  261. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  262. package/dist/flows/Onboarding/components/SaveDraftButton.js +1 -1
  263. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  264. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  265. package/dist/flows/Onboarding/context.d.ts +6 -6
  266. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  267. package/dist/flows/Onboarding/hooks.js +1 -1
  268. package/dist/flows/Onboarding/index.d.ts +4 -4
  269. package/dist/flows/Onboarding/index.js +1 -1
  270. package/dist/flows/Onboarding/types.d.ts +4 -4
  271. package/dist/flows/Onboarding/utils.d.ts +4 -4
  272. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  273. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  274. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  275. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  276. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  277. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  278. package/dist/flows/Termination/TerminationBack.js +1 -1
  279. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  280. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  281. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  282. package/dist/flows/Termination/TerminationFlow.js +1 -1
  283. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  284. package/dist/flows/Termination/TerminationForm.js +1 -1
  285. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  286. package/dist/flows/Termination/api.d.ts +5 -5
  287. package/dist/flows/Termination/api.js +1 -1
  288. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  289. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -6
  290. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  291. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -6
  292. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  293. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -6
  294. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  295. package/dist/flows/Termination/context.d.ts +4 -4
  296. package/dist/flows/Termination/hooks.d.ts +4 -4
  297. package/dist/flows/Termination/hooks.js +1 -1
  298. package/dist/flows/Termination/index.d.ts +6 -6
  299. package/dist/flows/Termination/index.js +1 -1
  300. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  301. package/dist/flows/Termination/json-schemas/schema.d.ts +4 -4
  302. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  303. package/dist/flows/Termination/types.d.ts +4 -4
  304. package/dist/flows/Termination/utils.d.ts +4 -4
  305. package/dist/flows/types.d.ts +2 -2
  306. package/dist/index.css +1 -1
  307. package/dist/index.css.map +1 -1
  308. package/dist/index.d.ts +10 -10
  309. package/dist/index.js +2 -2
  310. package/dist/index.js.map +1 -1
  311. package/dist/internals.d.ts +3 -3
  312. package/dist/internals.js +1 -1
  313. package/dist/{mutations-BC52jdwm.d.ts → mutations-_fbChogH.d.ts} +1 -1
  314. package/dist/{remoteFlows-BO4472Up.d.ts → remoteFlows-EO5mIvOd.d.ts} +20 -5
  315. package/dist/styles.css +1 -1
  316. package/dist/styles.css.map +1 -1
  317. package/dist/{types-CqM53tgV.d.ts → types-5HNrr4sn.d.ts} +4 -4
  318. package/dist/{types-B42GAkGo.d.ts → types-BBqw2IyP.d.ts} +4 -4
  319. package/dist/{types-CINXtJqR.d.ts → types-CWrhMXgL.d.ts} +2 -2
  320. package/dist/{types-CBp9UlbO.d.ts → types-DDpMBsb_.d.ts} +1 -1
  321. package/dist/{types.gen-BBpr3-TL.d.ts → types.gen-DNn2UIXs.d.ts} +1 -1
  322. package/dist/{utils-DHJl95Wn.d.ts → utils-Cl7flwLn.d.ts} +1 -1
  323. package/package.json +10 -1
  324. package/dist/chunk-22HZVTR7.js +0 -2
  325. package/dist/chunk-22HZVTR7.js.map +0 -1
  326. package/dist/chunk-2BW2VK5F.js +0 -2
  327. package/dist/chunk-2BW2VK5F.js.map +0 -1
  328. package/dist/chunk-2XVUZH4T.js +0 -2
  329. package/dist/chunk-2XVUZH4T.js.map +0 -1
  330. package/dist/chunk-42R2H2DW.js +0 -2
  331. package/dist/chunk-4OVFMUUJ.js +0 -2
  332. package/dist/chunk-4OVFMUUJ.js.map +0 -1
  333. package/dist/chunk-765OB2K5.js +0 -2
  334. package/dist/chunk-765OB2K5.js.map +0 -1
  335. package/dist/chunk-7FMFSOJ3.js +0 -2
  336. package/dist/chunk-7FMFSOJ3.js.map +0 -1
  337. package/dist/chunk-BPIGB72P.js +0 -2
  338. package/dist/chunk-BPIGB72P.js.map +0 -1
  339. package/dist/chunk-EGSUF7OD.js +0 -2
  340. package/dist/chunk-EGSUF7OD.js.map +0 -1
  341. package/dist/chunk-FUBLGAPH.js +0 -2
  342. package/dist/chunk-FUBLGAPH.js.map +0 -1
  343. package/dist/chunk-GVSAZND2.js +0 -2
  344. package/dist/chunk-GVSAZND2.js.map +0 -1
  345. package/dist/chunk-IJ6325YO.js +0 -2
  346. package/dist/chunk-IJ6325YO.js.map +0 -1
  347. package/dist/chunk-OKMERBJL.js +0 -2
  348. package/dist/chunk-OKMERBJL.js.map +0 -1
  349. package/dist/chunk-PC5JG4TT.js +0 -2
  350. package/dist/chunk-PC5JG4TT.js.map +0 -1
  351. package/dist/chunk-RWYXH6CE.js +0 -2
  352. package/dist/chunk-RWYXH6CE.js.map +0 -1
  353. package/dist/chunk-SPMEMAK5.js +0 -2
  354. package/dist/chunk-SPMEMAK5.js.map +0 -1
  355. package/dist/chunk-TC3CLBCD.js +0 -2
  356. package/dist/chunk-TC3CLBCD.js.map +0 -1
  357. package/dist/chunk-U2HWB5HI.js +0 -2
  358. package/dist/chunk-U2HWB5HI.js.map +0 -1
  359. package/dist/chunk-WINYXC33.js +0 -2
  360. package/dist/chunk-WINYXC33.js.map +0 -1
  361. package/dist/chunk-WMB752CR.js +0 -2
  362. package/dist/chunk-WMB752CR.js.map +0 -1
  363. package/dist/chunk-XXPJHT5A.js +0 -2
  364. package/dist/chunk-XXPJHT5A.js.map +0 -1
  365. package/dist/chunk-ZFKHCC4Z.js +0 -2
  366. package/dist/chunk-ZFKHCC4Z.js.map +0 -1
  367. /package/dist/{chunk-MD2QFLXC.js.map → chunk-2L5YJSIF.js.map} +0 -0
  368. /package/dist/{chunk-ARQ2PTEA.js.map → chunk-2RLH6ZLY.js.map} +0 -0
  369. /package/dist/{chunk-2ZCOC6FB.js.map → chunk-4Z3V5SXU.js.map} +0 -0
  370. /package/dist/{chunk-K3XVYHGV.js.map → chunk-5CXPVPOG.js.map} +0 -0
  371. /package/dist/{chunk-MWMX5KTM.js.map → chunk-5S5YAMYB.js.map} +0 -0
  372. /package/dist/{chunk-6YRMHTAZ.js.map → chunk-6ARN2SX2.js.map} +0 -0
  373. /package/dist/{chunk-42R2H2DW.js.map → chunk-6CASSN2Z.js.map} +0 -0
  374. /package/dist/{chunk-Y75E2FOC.js.map → chunk-AJADTL33.js.map} +0 -0
  375. /package/dist/{chunk-BNBEIHLD.js.map → chunk-BAGTZ3NN.js.map} +0 -0
  376. /package/dist/{chunk-ZJAFMNUN.js.map → chunk-BIC5GBW4.js.map} +0 -0
  377. /package/dist/{chunk-3DGBLO6M.js.map → chunk-CIUPGLOU.js.map} +0 -0
  378. /package/dist/{chunk-BF3P3CMA.js.map → chunk-DN6SGTCI.js.map} +0 -0
  379. /package/dist/{chunk-A5NDO6CQ.js.map → chunk-FEGY4ZEW.js.map} +0 -0
  380. /package/dist/{chunk-KABFJTE2.js.map → chunk-IGLBEWVV.js.map} +0 -0
  381. /package/dist/{chunk-WO33FKK4.js.map → chunk-IJUB7Z4E.js.map} +0 -0
  382. /package/dist/{chunk-25M7VGZT.js.map → chunk-IOX27DWA.js.map} +0 -0
  383. /package/dist/{chunk-CZ7DTX5L.js.map → chunk-IVHHMIUY.js.map} +0 -0
  384. /package/dist/{chunk-BZBPPV5B.js.map → chunk-J2NQBF62.js.map} +0 -0
  385. /package/dist/{chunk-QLX4J76Z.js.map → chunk-K4IKYJ3B.js.map} +0 -0
  386. /package/dist/{chunk-B3TRTHW4.js.map → chunk-KKKOMF2R.js.map} +0 -0
  387. /package/dist/{chunk-JHSQWGEK.js.map → chunk-NO6BRWFS.js.map} +0 -0
  388. /package/dist/{chunk-OF66TZF4.js.map → chunk-OEBMODP7.js.map} +0 -0
  389. /package/dist/{chunk-SCIX6XLQ.js.map → chunk-OW7BCYPF.js.map} +0 -0
  390. /package/dist/{chunk-YXVNCPUI.js.map → chunk-P5GY5LLV.js.map} +0 -0
  391. /package/dist/{chunk-ZK27BWOZ.js.map → chunk-Q2XGTGUQ.js.map} +0 -0
  392. /package/dist/{chunk-3OX2LLXL.js.map → chunk-QCIOQVSK.js.map} +0 -0
  393. /package/dist/{chunk-AOQ5FJGP.js.map → chunk-QT43Z24O.js.map} +0 -0
  394. /package/dist/{chunk-LEVFKYRL.js.map → chunk-QTJ6EDEM.js.map} +0 -0
  395. /package/dist/{chunk-JDNBIL6Z.js.map → chunk-RYOXAR7O.js.map} +0 -0
  396. /package/dist/{chunk-QZ6XHIMS.js.map → chunk-SO2RPIOT.js.map} +0 -0
  397. /package/dist/{chunk-N3X274GT.js.map → chunk-U7CW67TM.js.map} +0 -0
  398. /package/dist/{chunk-TKSW7MGC.js.map → chunk-V4OZS4QW.js.map} +0 -0
  399. /package/dist/{chunk-73BVEZJ6.js.map → chunk-VD2T75BY.js.map} +0 -0
  400. /package/dist/{chunk-7JL3BFOU.js.map → chunk-W32TDEQ3.js.map} +0 -0
  401. /package/dist/{chunk-VTX5YWRU.js.map → chunk-W4G2O5QV.js.map} +0 -0
  402. /package/dist/{chunk-HLR4BEDV.js.map → chunk-WAG67DRI.js.map} +0 -0
  403. /package/dist/{chunk-5HXPBCU6.js.map → chunk-WYIEW4OC.js.map} +0 -0
  404. /package/dist/{chunk-NFWNYW2E.js.map → chunk-X3ZIQ7HA.js.map} +0 -0
  405. /package/dist/{chunk-IF42CZJH.js.map → chunk-XGECMN4V.js.map} +0 -0
  406. /package/dist/{chunk-P5QKSFOE.js.map → chunk-XXIUJVIY.js.map} +0 -0
  407. /package/dist/{chunk-J3BK2DEH.js.map → chunk-YRFNEKBE.js.map} +0 -0
  408. /package/dist/{chunk-7X3WUOTU.js.map → chunk-ZBLC4GNZ.js.map} +0 -0
@@ -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) => acc + (timeoff?.timeoff_days?.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,EAAeH,CAAS,EAAE,mBAAmB,QAAS,CAClE,KAAM,UACN,MAAO,QACP,IAAK,SACP,CAAC,EACKI,EAAMD,EAAeF,CAAO,EAAE,mBAAmB,QAAS,CAC9D,KAAM,UACN,MAAO,QACP,IAAK,SACP,CAAC,EACD,MAAO,GAAGC,CAAK,WAAME,CAAG,EAC1B,EAZwB,mBAiCXC,EAA+BhB,EAAA,CAAC,CAC3C,aAAAC,EACA,QAAAG,CACF,IAMSL,EAA8C,CACnD,aAAAE,EACA,YAAa,gBACb,QAAS,CACP,QA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,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","duration","day","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{b as u}from"./chunk-TOA3JILU.js";import{d as m}from"./chunk-N3X274GT.js";import{a as d}from"./chunk-EAV5VOMZ.js";import{a}from"./chunk-NFWNYW2E.js";import{b as s}from"./chunk-KQPDXXG3.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function k({onSubmit:c,onSuccess:p,onError:n,render:l,...o}){let{components:f}=s(),{contractorOnboardingBag:t}=u(),i=m(),{mutateAsync:y}=d(i),E=e(async()=>{try{if(await c?.(),t.employmentId){let r=await y({employment_id:t.employmentId});if(r.data){await p?.({data:r.data,employmentStatus:"invited"}),t.refetchEmployment();return}r.error&&n?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}}catch(r){n?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),v=f?.button||a;return b(v,{...o,disabled:i.isPending||o.disabled,onClick:r=>{E(),o.onClick?.(r)},children:l({employmentStatus:"invited"})})}e(k,"OnboardingInvite");export{k as a};
2
- //# sourceMappingURL=chunk-2XVUZH4T.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractorOnboarding/components/OnboardingInvite.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { useEmploymentInvite } from '@/src/flows/Onboarding/api';\nimport { FieldError, mutationToPromise } from '@/src/lib/mutations';\nimport { SuccessResponse } from '@/src/client';\nimport { useFormFields } from '@/src/context';\nimport { useContractorOnboardingContext } from '@/src/flows/ContractorOnboarding/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\nexport type OnboardingInviteProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onError'\n> & {\n onSuccess?: ({\n data,\n employmentStatus,\n }: {\n data: SuccessResponse;\n employmentStatus: 'invited';\n }) => void | Promise<void>;\n onError?: ({\n error,\n rawError,\n fieldErrors,\n }: {\n error: Error;\n rawError: Record<string, unknown>;\n fieldErrors: FieldError[];\n }) => void;\n onSubmit?: () => void | Promise<void>;\n render: (props: { employmentStatus: 'invited' }) => ReactNode;\n} & Record<string, unknown>;\n\nexport function OnboardingInvite({\n onSubmit,\n onSuccess,\n onError,\n render,\n ...props\n}: OnboardingInviteProps) {\n const { components } = useFormFields();\n const { contractorOnboardingBag } = useContractorOnboardingContext();\n const employmentInviteMutation = useEmploymentInvite();\n\n const { mutateAsync: employmentInviteMutationAsync } = mutationToPromise(\n employmentInviteMutation,\n );\n\n const handleSubmit = async () => {\n try {\n await onSubmit?.();\n if (contractorOnboardingBag.employmentId) {\n const response = await employmentInviteMutationAsync({\n employment_id: contractorOnboardingBag.employmentId,\n });\n if (response.data) {\n await onSuccess?.({\n data: response.data as SuccessResponse,\n employmentStatus: 'invited',\n });\n contractorOnboardingBag.refetchEmployment();\n return;\n }\n if (response.error) {\n onError?.({\n error: response.error,\n rawError: response.rawError,\n fieldErrors: [],\n });\n }\n }\n } catch (error: unknown) {\n onError?.({\n error: error as Error,\n rawError: error as Record<string, unknown>,\n fieldErrors: [],\n });\n }\n };\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n disabled={employmentInviteMutation.isPending || props.disabled}\n onClick={(evt) => {\n handleSubmit();\n props.onClick?.(evt);\n }}\n >\n {render({\n employmentStatus: 'invited',\n })}\n </CustomButton>\n );\n}\n"],"mappings":"2OAiFI,cAAAA,MAAA,oBAjDG,SAASC,EAAiB,CAC/B,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,OAAAC,EACA,GAAGC,CACL,EAA0B,CACxB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/B,CAAE,wBAAAC,CAAwB,EAAIC,EAA+B,EAC7DC,EAA2BC,EAAoB,EAE/C,CAAE,YAAaC,CAA8B,EAAIC,EACrDH,CACF,EAEMI,EAAeC,EAAA,SAAY,CAC/B,GAAI,CAEF,GADA,MAAMd,IAAW,EACbO,EAAwB,aAAc,CACxC,IAAMQ,EAAW,MAAMJ,EAA8B,CACnD,cAAeJ,EAAwB,YACzC,CAAC,EACD,GAAIQ,EAAS,KAAM,CACjB,MAAMd,IAAY,CAChB,KAAMc,EAAS,KACf,iBAAkB,SACpB,CAAC,EACDR,EAAwB,kBAAkB,EAC1C,MACF,CACIQ,EAAS,OACXb,IAAU,CACR,MAAOa,EAAS,MAChB,SAAUA,EAAS,SACnB,YAAa,CAAC,CAChB,CAAC,CAEL,CACF,OAASC,EAAgB,CACvBd,IAAU,CACR,MAAOc,EACP,SAAUA,EACV,YAAa,CAAC,CAChB,CAAC,CACH,CACF,EA9BqB,gBAgCfC,EAAeZ,GAAY,QAAUa,EAC3C,OACEpB,EAACmB,EAAA,CACE,GAAGb,EACJ,SAAUK,EAAyB,WAAaL,EAAM,SACtD,QAAUe,GAAQ,CAChBN,EAAa,EACbT,EAAM,UAAUe,CAAG,CACrB,EAEC,SAAAhB,EAAO,CACN,iBAAkB,SACpB,CAAC,EACH,CAEJ,CA9DgBW,EAAAf,EAAA","names":["jsx","OnboardingInvite","onSubmit","onSuccess","onError","render","props","components","useFormFields","contractorOnboardingBag","useContractorOnboardingContext","employmentInviteMutation","useEmploymentInvite","employmentInviteMutationAsync","mutationToPromise","handleSubmit","__name","response","error","CustomButton","ButtonDefault","evt"]}
@@ -1,2 +0,0 @@
1
- import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-TC7EQZJK.js";import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
- //# sourceMappingURL=chunk-42R2H2DW.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-NFWNYW2E.js";import{b as n}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";function f({children:e,...t}){let{terminationBag:{back:u}}=r(),{components:m}=n(),s=m?.button||i;return B(s,{...t,onClick:c=>{u(),t.onClick?.(c)},children:e})}o(f,"TerminationBack");export{f as a};
2
- //# sourceMappingURL=chunk-4OVFMUUJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Termination/TerminationBack.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useTerminationContext } from '@/src/flows/Termination/context';\nimport { useFormFields } from '@/src/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\nexport function TerminationBack({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const {\n terminationBag: { back },\n } = useTerminationContext();\n\n const { components } = useFormFields();\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n onClick={(evt) => {\n back();\n props.onClick?.(evt);\n }}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAkBI,cAAAA,MAAA,oBAbG,SAASC,EAAgB,CAC9B,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CACJ,eAAgB,CAAE,KAAAC,CAAK,CACzB,EAAIC,EAAsB,EAEpB,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,QAAUG,EAC3C,OACET,EAACQ,EAAA,CACE,GAAGL,EACJ,QAAUO,GAAQ,CAChBN,EAAK,EACLD,EAAM,UAAUO,CAAG,CACrB,EAEC,SAAAR,EACH,CAEJ,CAvBgBS,EAAAV,EAAA","names":["jsx","TerminationBack","children","props","back","useTerminationContext","components","useFormFields","CustomButton","ButtonDefault","evt","__name"]}
@@ -1,2 +0,0 @@
1
- import{b as s}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-NFWNYW2E.js";import{b as e}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";var g=t(({onSuccess:i,onError:a,className:m,children:u,disabled:d=!1,...l})=>{let{onboardingBag:f,formId:c}=s(),{components:b}=e(),E=t(async()=>{let o=document.getElementById(c);if(o){let r=new Event("submit",{bubbles:!0,cancelable:!0});r.isDraftSubmission=!0,r.draftCallbacks={onSuccess:i,onError:a},o.dispatchEvent(r)}},"handleSaveDraft"),p=b?.button||n;return B(p,{...l,onClick:E,disabled:d||f.isSubmitting,className:m,children:u})},"SaveDraftButton");export{g as a};
2
- //# sourceMappingURL=chunk-765OB2K5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/components/SaveDraftButton.tsx"],"sourcesContent":["import { useFormFields } from '@/src/context';\nimport { useOnboardingContext } from '@/src/flows/Onboarding/context';\nimport { ButtonHTMLAttributes } from 'react';\nimport { NormalizedFieldError } from '@/src/lib/mutations';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\ntype SaveDraftButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onError'\n> & {\n onSuccess?: () => void | Promise<void>;\n onError?: ({\n error,\n rawError,\n fieldErrors,\n }: {\n error: Error;\n rawError: Record<string, unknown>;\n fieldErrors: NormalizedFieldError[];\n }) => void;\n};\n\nexport const SaveDraftButton = ({\n onSuccess,\n onError,\n className,\n children,\n disabled = false,\n ...props\n}: SaveDraftButtonProps) => {\n const { onboardingBag, formId } = useOnboardingContext();\n\n const { components } = useFormFields();\n\n const handleSaveDraft = async () => {\n const form = document.getElementById(formId);\n if (form) {\n const submitEvent = new Event('submit', {\n bubbles: true,\n cancelable: true,\n });\n (submitEvent as $TSFixMe).isDraftSubmission = true;\n (submitEvent as $TSFixMe).draftCallbacks = { onSuccess, onError };\n form.dispatchEvent(submitEvent);\n }\n };\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n onClick={handleSaveDraft}\n disabled={disabled || onboardingBag.isSubmitting}\n className={className}\n >\n {children}\n </CustomButton>\n );\n};\n"],"mappings":"gKAkDI,cAAAA,MAAA,oBA3BG,IAAMC,EAAkBC,EAAA,CAAC,CAC9B,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EAAW,GACX,GAAGC,CACL,IAA4B,CAC1B,GAAM,CAAE,cAAAC,EAAe,OAAAC,CAAO,EAAIC,EAAqB,EAEjD,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAkBZ,EAAA,SAAY,CAClC,IAAMa,EAAO,SAAS,eAAeL,CAAM,EAC3C,GAAIK,EAAM,CACR,IAAMC,EAAc,IAAI,MAAM,SAAU,CACtC,QAAS,GACT,WAAY,EACd,CAAC,EACAA,EAAyB,kBAAoB,GAC7CA,EAAyB,eAAiB,CAAE,UAAAb,EAAW,QAAAC,CAAQ,EAChEW,EAAK,cAAcC,CAAW,CAChC,CACF,EAXwB,mBAalBC,EAAeL,GAAY,QAAUM,EAC3C,OACElB,EAACiB,EAAA,CACE,GAAGT,EACJ,QAASM,EACT,SAAUP,GAAYE,EAAc,aACpC,UAAWJ,EAEV,SAAAC,EACH,CAEJ,EApC+B","names":["jsx","SaveDraftButton","__name","onSuccess","onError","className","children","disabled","props","onboardingBag","formId","useOnboardingContext","components","useFormFields","handleSaveDraft","form","submitEvent","CustomButton","ButtonDefault"]}
@@ -1,2 +0,0 @@
1
- import{l as J}from"./chunk-N3X274GT.js";import{a as L}from"./chunk-ZFKHCC4Z.js";import{a as U}from"./chunk-NFWNYW2E.js";import{b as H}from"./chunk-KQPDXXG3.js";import{c as B,l as G}from"./chunk-CR7AIZKA.js";import{a as A,b as w,c as M}from"./chunk-HRG5MSVG.js";import{a as n,b as l,c as Fe}from"./chunk-P37U34EQ.js";var D=l((Rn,V)=>{"use strict";function Pe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(Pe,"isObject");V.exports=Pe});var z=l((qn,X)=>{"use strict";var ke=typeof global=="object"&&global&&global.Object===Object&&global;X.exports=ke});var _=l((Fn,K)=>{"use strict";var we=z(),Me=typeof self=="object"&&self&&self.Object===Object&&self,Le=we||Me||Function("return this")();K.exports=Le});var Y=l((Pn,Q)=>{"use strict";var De=_(),_e=n(function(){return De.Date.now()},"now");Q.exports=_e});var ee=l((wn,Z)=>{"use strict";var $e=/\s/;function Ne(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}n(Ne,"trimmedEndIndex");Z.exports=Ne});var te=l((Ln,ne)=>{"use strict";var We=ee(),Be=/^\s+/;function Ae(e){return e&&e.slice(0,We(e)+1).replace(Be,"")}n(Ae,"baseTrim");ne.exports=Ae});var $=l((_n,re)=>{"use strict";var He=_(),Ge=He.Symbol;re.exports=Ge});var ae=l(($n,se)=>{"use strict";var oe=$(),ie=Object.prototype,Je=ie.hasOwnProperty,Ue=ie.toString,O=oe?oe.toStringTag:void 0;function Ve(e){var t=Je.call(e,O),r=e[O];try{e[O]=void 0;var i=!0}catch{}var c=Ue.call(e);return i&&(t?e[O]=r:delete e[O]),c}n(Ve,"getRawTag");se.exports=Ve});var ue=l((Wn,ce)=>{"use strict";var Xe=Object.prototype,ze=Xe.toString;function Ke(e){return ze.call(e)}n(Ke,"objectToString");ce.exports=Ke});var me=l((An,de)=>{"use strict";var fe=$(),Qe=ae(),Ye=ue(),Ze="[object Null]",en="[object Undefined]",le=fe?fe.toStringTag:void 0;function nn(e){return e==null?e===void 0?en:Ze:le&&le in Object(e)?Qe(e):Ye(e)}n(nn,"baseGetTag");de.exports=nn});var ge=l((Gn,pe)=>{"use strict";function tn(e){return e!=null&&typeof e=="object"}n(tn,"isObjectLike");pe.exports=tn});var ve=l((Un,be)=>{"use strict";var rn=me(),on=ge(),sn="[object Symbol]";function an(e){return typeof e=="symbol"||on(e)&&rn(e)==sn}n(an,"isSymbol");be.exports=an});var Te=l((Xn,Ce)=>{"use strict";var cn=te(),ye=D(),un=ve(),xe=NaN,fn=/^[-+]0x[0-9a-f]+$/i,ln=/^0b[01]+$/i,dn=/^0o[0-7]+$/i,mn=parseInt;function pn(e){if(typeof e=="number")return e;if(un(e))return xe;if(ye(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ye(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cn(e);var r=ln.test(e);return r||dn.test(e)?mn(e.slice(2),r?2:8):fn.test(e)?xe:+e}n(pn,"toNumber");Ce.exports=pn});var je=l((Kn,Se)=>{"use strict";var gn=D(),N=Y(),he=Te(),bn="Expected a function",vn=Math.max,yn=Math.min;function xn(e,t,r){var i,c,b,d,u,s,p=0,E=!1,f=!1,x=!0;if(typeof e!="function")throw new TypeError(bn);t=he(t)||0,gn(r)&&(E=!!r.leading,f="maxWait"in r,b=f?vn(he(r.maxWait)||0,t):b,x="trailing"in r?!!r.trailing:x);function C(o){var g=i,y=c;return i=c=void 0,p=o,d=e.apply(y,g),d}n(C,"invokeFunc");function R(o){return p=o,u=setTimeout(m,t),E?C(o):d}n(R,"leadingEdge");function q(o){var g=o-s,y=o-p,a=t-g;return f?yn(a,b-y):a}n(q,"remainingWait");function h(o){var g=o-s,y=o-p;return s===void 0||g>=t||g<0||f&&y>=b}n(h,"shouldInvoke");function m(){var o=N();if(h(o))return S(o);u=setTimeout(m,q(o))}n(m,"timerExpired");function S(o){return u=void 0,x&&i?C(o):(i=c=void 0,d)}n(S,"trailingEdge");function I(){u!==void 0&&clearTimeout(u),p=0,i=s=c=u=void 0}n(I,"cancel");function F(){return u===void 0?d:S(N())}n(F,"flush");function j(){var o=N(),g=h(o);if(i=arguments,c=this,s=o,g){if(u===void 0)return R(s);if(f)return clearTimeout(u),u=setTimeout(m,t),C(s)}return u===void 0&&(u=setTimeout(m,t)),d}return n(j,"debounced"),j.cancel=I,j.flush=F,j}n(xn,"debounce");Se.exports=xn});import{useState as hn,useCallback as Sn,useEffect as Re,useRef as jn}from"react";var Ee=Fe(je(),1);import{useCallback as Cn,useEffect as Tn,useRef as Oe}from"react";function W(e,t){let r=Oe(e);Tn(()=>{r.current=e},[e]);let i=Oe((0,Ee.default)(c=>{r.current(c)},t)).current;return Cn(c=>{i(c)},[i])}n(W,"useDebounce");import{Fragment as En,jsx as T,jsxs as Ie}from"react/jsx-runtime";var On=n(({description:e,showConversion:t,targetCurrency:r,className:i,onClick:c})=>{let{components:b}=H(),d=t?`Hide ${r} conversion`:`Show ${r} conversion`,u=b?.button||U;return Ie("span",{className:i,children:[T(G,{as:"span",children:e})," ",T(u,{className:`${i.replace("-description","-button")}`,"data-type":"inline",onClick:c,children:d})]})},"DescriptionWithConversion"),lt=n(({sourceCurrency:e,targetCurrency:t,mainFieldName:r,conversionFieldName:i,conversionProperties:c,classNamePrefix:b,description:d,conversionType:u="spread",...s})=>{let[p,E]=hn(!1),{setValue:f,watch:x}=B(),C=x(r||s.name),R=jn(!0),q=e&&t&&e!==t,{mutateAsync:h}=J({type:u}),m=`${s.name}_converted`;Re(()=>{f(m,r||s.name)},[f,r,s.name,m]),Re(()=>{if(R.current){R.current=!1;return}f(i,"")},[e,i,f]);let S=Sn(async(a,v,P)=>{if(!(!a||isNaN(a)||a<=0))return h({source_currency:v,target_currency:P,amount:a})},[h]),I=W(async a=>{let v=w(a),k=1/((await S(v,t,e))?.data?.data.conversion_data?.exchange_rate??1),qe=A(Number(v)*k);f(i,M(qe))},500),F=W(async a=>{let v=w(a),k=(await S(v,t,e))?.data?.data.conversion_data.target_amount;f(r||s.name,M(k))},500),j=n(a=>{f(m,r||s.name),p&&I(a.target.value)},"handleMainFieldChange"),o=n(a=>{f(m,i),F(a.target.value)},"handleConversionFieldChange"),g=n(a=>{a.preventDefault(),E(v=>!v),!p&&C&&I(C)},"toggleConversion"),y=q?T(On,{targetCurrency:t,description:d,showConversion:p,className:`${b}-description`,onClick:g}):d;return Ie(En,{children:[T(L,{...s,name:r||s.name,additionalProps:{currency:e},description:y,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:j}),p&&T(L,{additionalProps:{currency:t},name:i,label:c?.label||"Conversion",description:c?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:o}),T("input",{type:"hidden",name:m,value:x(m)||r||s.name})]})},"CurrencyConversionField");export{lt as a};
2
- //# sourceMappingURL=chunk-7FMFSOJ3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/now.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/debounce.js","../src/components/form/fields/CurrencyConversionField.tsx","../src/common/hooks.ts"],"sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { ReactNode, useState, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { useConvertCurrency } from '@/src/flows/Onboarding/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormFields } from '@/src/context';\nimport { useDebounce } from '@/src/common/hooks';\nimport { FormDescription } from '@/src/components/ui/form';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\nimport {\n convertFromCents,\n convertToCents,\n round,\n} from '@/src/components/form/utils';\n\ntype DescriptionWithConversionProps = {\n description: ReactNode;\n showConversion: boolean;\n targetCurrency: string;\n className: string;\n onClick: (evt: React.MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst DescriptionWithConversion = ({\n description,\n showConversion,\n targetCurrency,\n className,\n onClick,\n}: DescriptionWithConversionProps) => {\n const { components } = useFormFields();\n const label = showConversion\n ? `Hide ${targetCurrency} conversion`\n : `Show ${targetCurrency} conversion`;\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <span className={className}>\n <FormDescription as='span'>{description}</FormDescription>{' '}\n <CustomButton\n className={`${className.replace('-description', '-button')}`}\n data-type='inline'\n onClick={onClick}\n >\n {label}\n </CustomButton>\n </span>\n );\n};\n\nexport type CurrencyConversionFieldProps = JSFField & {\n sourceCurrency: string;\n targetCurrency: string;\n mainFieldName?: string;\n conversionFieldName: string;\n conversionProperties?: {\n label?: string;\n description?: ReactNode;\n };\n useProxy?: boolean;\n classNamePrefix: string;\n conversionType?: 'spread' | 'no_spread';\n};\n\nexport const CurrencyConversionField = ({\n sourceCurrency,\n targetCurrency,\n mainFieldName,\n conversionFieldName,\n conversionProperties,\n classNamePrefix,\n description,\n conversionType = 'spread',\n ...props\n}: CurrencyConversionFieldProps) => {\n const [showConversion, setShowConversion] = useState(false);\n const { setValue, watch } = useFormContext();\n const fieldValue = watch(mainFieldName || props.name);\n const isFirstRender = useRef(true);\n\n const canShowConversion =\n sourceCurrency && targetCurrency && sourceCurrency !== targetCurrency;\n\n const { mutateAsync: convertCurrency } = useConvertCurrency({\n type: conversionType,\n });\n\n // we keep track of the last input the user used, so we can make sure\n // we keep consistent currency rates\n const lastInputFieldName = `${props.name}_converted`;\n useEffect(() => {\n setValue(lastInputFieldName, mainFieldName || props.name);\n }, [setValue, mainFieldName, props.name, lastInputFieldName]);\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n\n // when source currency changes, reset the conversion field\n setValue(conversionFieldName, '');\n }, [sourceCurrency, conversionFieldName, setValue]);\n\n const convertCurrencyCallback = useCallback(\n async (amount: number | null, fromCurrency: string, toCurrency: string) => {\n if (!amount || isNaN(amount) || amount <= 0) return;\n\n return convertCurrency({\n source_currency: fromCurrency,\n target_currency: toCurrency,\n amount,\n });\n },\n [convertCurrency],\n );\n\n const debouncedConvertCurrency = useDebounce(async (value: string) => {\n // The SDK sets the employer billing currency in the salary field, but internally we don't do it like this, is set based on the employee billing currency\n // That's why we need to do 1 / exchange rate to get the correct amount, if currencies were different, it would be done in the debouncedConvertCurrencyReverse\n // THE BE always transforms from the target currency to the source currency\n const amountInCents = convertToCents(value);\n const conversion = await convertCurrencyCallback(\n amountInCents,\n targetCurrency,\n sourceCurrency,\n );\n\n const exchangeRate =\n 1 / (conversion?.data?.data.conversion_data?.exchange_rate ?? 1);\n\n const amount = round(Number(amountInCents) * exchangeRate);\n\n setValue(conversionFieldName, convertFromCents(amount));\n }, 500);\n\n const debouncedConvertCurrencyReverse = useDebounce(async (value: string) => {\n const amount = convertToCents(value);\n const conversion = await convertCurrencyCallback(\n amount,\n targetCurrency,\n sourceCurrency,\n );\n\n const conversionAmount =\n conversion?.data?.data.conversion_data.target_amount;\n\n setValue(mainFieldName || props.name, convertFromCents(conversionAmount));\n }, 500);\n\n const handleMainFieldChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n setValue(lastInputFieldName, mainFieldName || props.name);\n if (showConversion) {\n debouncedConvertCurrency(evt.target.value);\n }\n };\n\n const handleConversionFieldChange = (\n evt: React.ChangeEvent<HTMLInputElement>,\n ) => {\n setValue(lastInputFieldName, conversionFieldName);\n debouncedConvertCurrencyReverse(evt.target.value);\n };\n\n const toggleConversion = (evt: React.MouseEvent<HTMLButtonElement>) => {\n evt.preventDefault();\n setShowConversion((prev) => !prev);\n\n if (!showConversion && fieldValue) {\n debouncedConvertCurrency(fieldValue);\n }\n };\n\n const extraDescription = canShowConversion ? (\n <DescriptionWithConversion\n targetCurrency={targetCurrency}\n description={description}\n showConversion={showConversion}\n className={`${classNamePrefix}-description`}\n onClick={toggleConversion}\n />\n ) : (\n description\n );\n\n return (\n <>\n <TextField\n {...props}\n name={mainFieldName || props.name}\n additionalProps={{ currency: sourceCurrency }}\n description={extraDescription}\n type='text'\n inputMode='decimal'\n pattern='^[0-9.]*$'\n maxLength={15}\n onChange={handleMainFieldChange}\n />\n {showConversion && (\n <TextField\n additionalProps={{ currency: targetCurrency }}\n name={conversionFieldName}\n label={conversionProperties?.label || 'Conversion'}\n description={conversionProperties?.description}\n type='text'\n inputMode='decimal'\n pattern='^[0-9.]*$'\n maxLength={15}\n onChange={handleConversionFieldChange}\n />\n )}\n <input\n type='hidden'\n name={lastInputFieldName}\n value={watch(lastInputFieldName) || mainFieldName || props.name}\n />\n </>\n );\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport debounce from 'lodash/debounce';\n\nexport function useDebounce(\n callback: (value: string) => Promise<void>,\n delay: number,\n) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n const debouncedFn = useRef(\n debounce((value: string) => {\n callbackRef.current(value);\n }, delay),\n ).current;\n\n return useCallback(\n (value: string) => {\n debouncedFn(value);\n },\n [debouncedFn],\n );\n}\n"],"mappings":"4TAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cAyBA,SAASC,GAASC,EAAO,CACvB,IAAIC,EAAO,OAAOD,EAClB,OAAOA,GAAS,OAASC,GAAQ,UAAYA,GAAQ,WACvD,CAHSC,EAAAH,GAAA,YAKTD,EAAO,QAAUC,KC9BjB,IAAAI,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAa,OAAO,QAAU,UAAY,QAAU,OAAO,SAAW,QAAU,OAEpFD,EAAO,QAAUC,KCHjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAa,IAGbC,GAAW,OAAO,MAAQ,UAAY,MAAQ,KAAK,SAAW,QAAU,KAGxEC,GAAOF,IAAcC,IAAY,SAAS,aAAa,EAAE,EAE7DF,EAAO,QA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C,EACN,MAAOR,EAAMQ,CAAkB,GAAKjB,GAAiBK,EAAM,KAC7D,GACF,CAEJ,EA1JuC","names":["require_isObject","__commonJSMin","exports","module","isObject","value","type","__name","require_freeGlobal","__commonJSMin","exports","module","freeGlobal","require_root","__commonJSMin","exports","module","freeGlobal","freeSelf","root","require_now","__commonJSMin","exports","module","root","now","__name","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","__name","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","__name","require_Symbol","__commonJSMin","exports","module","root","Symbol","require_getRawTag","__commonJSMin","exports","module","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","result","__name","require_objectToString","__commonJSMin","exports","module","objectProto","nativeObjectToString","objectToString","value","__name","require_baseGetTag","__commonJSMin","exports","module","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","value","__name","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","__name","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","__name","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","__name","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","__name","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","useState","useCallback","useEffect","useRef","import_debounce","useCallback","useEffect","useRef","useDebounce","callback","delay","callbackRef","useRef","useEffect","debouncedFn","debounce","value","useCallback","__name","Fragment","jsx","jsxs","DescriptionWithConversion","__name","description","showConversion","targetCurrency","className","onClick","components","useFormFields","label","CustomButton","ButtonDefault","FormDescription","CurrencyConversionField","sourceCurrency","mainFieldName","conversionFieldName","conversionProperties","classNamePrefix","conversionType","props","setShowConversion","useState","setValue","watch","useFormContext","fieldValue","isFirstRender","useRef","canShowConversion","convertCurrency","useConvertCurrency","lastInputFieldName","useEffect","convertCurrencyCallback","useCallback","amount","fromCurrency","toCurrency","debouncedConvertCurrency","useDebounce","value","amountInCents","convertToCents","exchangeRate","round","convertFromCents","debouncedConvertCurrencyReverse","conversionAmount","handleMainFieldChange","evt","handleConversionFieldChange","toggleConversion","prev","extraDescription","TextField"]}
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-NFWNYW2E.js";import{b as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function g({children:e,onClick:i,...s}){let{onboardingBag:{back:u,isEmploymentReadOnly:m}}=r(),{components:a}=o(),c=t(B=>{m||u(),i?.(B)},"onBackHandler"),p=a?.button||n;return d(p,{...s,onClick:c,children:e})}t(g,"OnboardingBack");export{g as a};
2
- //# sourceMappingURL=chunk-BPIGB72P.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/components/OnboardingBack.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useOnboardingContext } from '@/src/flows/Onboarding/context';\nimport { useFormFields } from '@/src/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\ntype OnboardingBackProps = ButtonHTMLAttributes<HTMLButtonElement> &\n Record<string, unknown>;\n\nexport function OnboardingBack({\n children,\n onClick,\n ...props\n}: PropsWithChildren<OnboardingBackProps>) {\n const {\n onboardingBag: { back, isEmploymentReadOnly },\n } = useOnboardingContext();\n\n const { components } = useFormFields();\n\n const onBackHandler = (evt: React.MouseEvent<HTMLButtonElement>) => {\n // TODO: TBD if we want to allow back button to be clicked when employment is readonly\n if (!isEmploymentReadOnly) {\n back();\n }\n onClick?.(evt);\n };\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton {...props} onClick={onBackHandler}>\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKA6BI,cAAAA,MAAA,oBArBG,SAASC,EAAe,CAC7B,SAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAA2C,CACzC,GAAM,CACJ,cAAe,CAAE,KAAAC,EAAM,qBAAAC,CAAqB,CAC9C,EAAIC,EAAqB,EAEnB,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAgBC,EAACC,GAA6C,CAE7DN,GACHD,EAAK,EAEPF,IAAUS,CAAG,CACf,EANsB,iBAQhBC,EAAeL,GAAY,QAAUM,EAC3C,OACEd,EAACa,EAAA,CAAc,GAAGT,EAAO,QAASM,EAC/B,SAAAR,EACH,CAEJ,CAzBgBS,EAAAV,EAAA","names":["jsx","OnboardingBack","children","onClick","props","back","isEmploymentReadOnly","useOnboardingContext","components","useFormFields","onBackHandler","__name","evt","CustomButton","ButtonDefault"]}
@@ -1,2 +0,0 @@
1
- import{h as f}from"./chunk-T6Q7IALZ.js";import{a as b,b as D,c as C,d as h,e as Z,f as y}from"./chunk-GGPEKIIH.js";import{b as g,d as w}from"./chunk-KQPDXXG3.js";import{a as p,f as k}from"./chunk-UQCSN47K.js";import{a as e}from"./chunk-P37U34EQ.js";var H={disclaimerCostCalculator:4668194326797,employeeOnboardingTimeline:4411262104589,extraPayments:4466822781709,internationalPricing:4410698586893,remoteFxRate:33271144977421,terminationEmployeeCommunication:4411585179661,terminationNoticePeriods:5831900985613,involuntaryOffboardingServiceCharge:4406932229133,reconciliationInvoice:17604014808589},m=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL");import{useQuery as L}from"@tanstack/react-query";var v=e((r,n)=>{let{client:i}=w();return L({queryKey:["zendesk-article",r],queryFn:e(async()=>{let o=await f({client:i,path:{id:Number(r)}});if(o.error)throw new Error(o.error.message||"Failed to fetch article");return o},"queryFn"),select:e(o=>{let t=o.data?.data.help_center_article;return t&&{...t,body:k(t.body||"")}},"select"),retry:!1,...n})},"useZendeskArticle");import{jsx as a,jsxs as c}from"react/jsx-runtime";function x({open:r,onClose:n,data:i,isLoading:o,error:t,zendeskURL:d,Trigger:s}){return c(b,{open:r,onOpenChange:l=>!l&&n(),direction:"right",children:[a(D,{asChild:!0,children:s}),a(C,{className:"h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer",children:c("div",{className:"h-full flex flex-col",children:[c(h,{children:[a(Z,{children:i?.title}),c(y,{children:["For more details see our"," ",a("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"help article"})," "]})]}),o&&a("div",{children:"Loading..."}),t&&a("div",{className:"text-sm p-4 text-red-500",children:"Error loading article"}),a("div",{className:"flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content",dangerouslySetInnerHTML:{__html:i?.body||""}})]})})]})}e(x,"ZendeskDrawerDefault");import{jsx as P}from"react/jsx-runtime";var R=e(({Trigger:r,zendeskId:n,open:i,onClose:o})=>{let{components:t}=g(),d=m(n),s=e(()=>{o?.()},"handleClose"),{data:l,isLoading:_,error:N}=v(n,{enabled:i}),F=t?.zendeskDrawer||x;return P(F,{open:i,onClose:s,data:l,isLoading:_,error:N,zendeskURL:d,Trigger:r})},"ZendeskDrawer");import{useState as z}from"react";import{jsx as u}from"react/jsx-runtime";var T="RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block text-xs bg-transparent border-none cursor-pointer p-0";function ne({zendeskId:r,className:n,onClick:i,children:o,external:t=!1}){let[d,s]=z(!1),l=e(()=>{t||s(!0),i?.(r)},"handleClick");return t?u("a",{href:m(r),target:"_blank",rel:"noopener noreferrer",onClick:l,className:p(T,n),children:o}):u(R,{zendeskId:r,open:d,onClose:()=>s(!1),Trigger:u("button",{onClick:l,className:p(T,n),children:o})})}e(ne,"ZendeskTriggerButton");export{H as a,ne as b};
2
- //# sourceMappingURL=chunk-EGSUF7OD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/shared/zendesk-drawer/utils.ts","../src/components/shared/zendesk-drawer/api.ts","../src/components/shared/zendesk-drawer/ZendeskDrawerDefault.tsx","../src/components/shared/zendesk-drawer/ZendeskDrawer.tsx","../src/components/shared/zendesk-drawer/ZendeskTriggerButton.tsx"],"sourcesContent":["export const zendeskArticles = {\n /**\n * Disclaimer for Cost Calculator\n * Access: Private (Need Remote account to access)\n * https://support.remote.com/hc/en-us/articles/4668194326797\n */\n disclaimerCostCalculator: 4668194326797,\n /**\n * Employee Onboarding Timeline\n * Access: Private (Need Remote account to access)\n * https://support.remote.com/hc/en-us/articles/4411262104589\n */\n employeeOnboardingTimeline: 4411262104589,\n /**\n * Extra Payments\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/4466822781709\n */\n extraPayments: 4466822781709,\n /**\n * International Pricing\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/4410698586893\n */\n internationalPricing: 4410698586893,\n /**\n * Remote FX Rate\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/33271144977421\n */\n remoteFxRate: 33271144977421,\n /**\n * Employee Communication for Terminations\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/4411585179661\n */\n terminationEmployeeCommunication: 4411585179661,\n /**\n * Notice Period for Terminations by Country\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/5831900985613\n */\n terminationNoticePeriods: 5831900985613,\n /**\n * Involuntary Offboarding Service Charge\n * Access: Private (Need Remote account to access)\n * https://support.remote.com/hc/en-us/articles/4406932229133\n */\n involuntaryOffboardingServiceCharge: 4406932229133,\n /**\n * Reconciliation Invoice\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/17604014808589\n */\n reconciliationInvoice: 17604014808589,\n};\n\nexport const buildZendeskURL = (zendeskId: number) => {\n return `https://support.remote.com/hc/en-us/articles/${zendeskId}`;\n};\n","import { getShowHelpCenterArticle } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { sanitizeHtmlWithImageErrorHandling } from '@/src/lib/utils';\nimport { Client } from '@/src/client/client';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useZendeskArticle = (\n zendeskId: number | null,\n queryOptions?: { enabled?: boolean },\n) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['zendesk-article', zendeskId],\n queryFn: async () => {\n const response = await getShowHelpCenterArticle({\n client: client as Client,\n path: {\n id: Number(zendeskId),\n },\n });\n\n if (response.error) {\n throw new Error(response.error.message || 'Failed to fetch article');\n }\n\n return response;\n },\n select: (data) => {\n const article = data.data?.data.help_center_article;\n if (article) {\n return {\n ...article,\n body: sanitizeHtmlWithImageErrorHandling(article.body || ''),\n };\n }\n return article;\n },\n retry: false,\n ...queryOptions,\n });\n};\n","import {\n Drawer,\n DrawerContent,\n DrawerDescription,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n} from '@/src/components/ui/drawer';\nimport { ZendeskDrawerComponentProps } from '@/src/types/remoteFlows';\n\nexport function ZendeskDrawerDefault({\n open,\n onClose,\n data,\n isLoading,\n error,\n zendeskURL,\n Trigger,\n}: ZendeskDrawerComponentProps) {\n return (\n <Drawer\n open={open}\n onOpenChange={(open) => !open && onClose()}\n direction='right'\n >\n <DrawerTrigger asChild>{Trigger}</DrawerTrigger>\n <DrawerContent className='h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer'>\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{data?.title}</DrawerTitle>\n <DrawerDescription>\n For more details see our{' '}\n <a href={zendeskURL} target='_blank' rel='noopener noreferrer'>\n help article\n </a>{' '}\n </DrawerDescription>\n </DrawerHeader>\n {isLoading && <div>Loading...</div>}\n {error && (\n <div className='text-sm p-4 text-red-500'>\n Error loading article\n </div>\n )}\n <div\n className='flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content'\n dangerouslySetInnerHTML={{\n __html: data?.body || '',\n }}\n ></div>\n </div>\n </DrawerContent>\n </Drawer>\n );\n}\n","import { useZendeskArticle } from '@/src/components/shared/zendesk-drawer/api';\nimport { useFormFields } from '@/src/context';\nimport { buildZendeskURL } from '@/src/components/shared/zendesk-drawer/utils';\nimport { ZendeskDrawerDefault } from './ZendeskDrawerDefault';\n\nexport type ZendeskDrawerProps = {\n Trigger: React.ReactElement;\n zendeskId: number;\n open: boolean;\n onClose: () => void;\n};\n\nexport const ZendeskDrawer = ({\n Trigger,\n zendeskId,\n open,\n onClose,\n}: ZendeskDrawerProps) => {\n const { components } = useFormFields();\n const zendeskURL = buildZendeskURL(zendeskId);\n\n const handleClose = () => {\n onClose?.();\n };\n\n const { data, isLoading, error } = useZendeskArticle(zendeskId, {\n enabled: open,\n });\n\n const CustomZendeskDrawer = components?.zendeskDrawer || ZendeskDrawerDefault;\n\n return (\n <CustomZendeskDrawer\n open={open}\n onClose={handleClose}\n data={data}\n isLoading={isLoading}\n error={error}\n zendeskURL={zendeskURL}\n Trigger={Trigger}\n />\n );\n};\n","import { cn } from '@/src/lib/utils';\nimport { ZendeskDrawer } from './ZendeskDrawer';\nimport { buildZendeskURL } from './utils';\nimport { useState } from 'react';\n\ninterface ZendeskTriggerButtonProps {\n /**\n * The Zendesk ID for the help article\n */\n zendeskId: number;\n /**\n * The class name for the button\n */\n className?: string;\n /**\n * The callback function to be called when the button is clicked\n */\n onClick?: (zendeskId: number) => void;\n /**\n * The children to be rendered inside the button\n */\n children?: React.ReactNode;\n /**\n * Whether to open the help article in a new tab\n */\n external?: boolean;\n}\n\nconst baseClassName =\n 'RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block text-xs bg-transparent border-none cursor-pointer p-0';\n\nexport function ZendeskTriggerButton({\n zendeskId,\n className,\n onClick,\n children,\n external = false,\n}: ZendeskTriggerButtonProps) {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleClick = () => {\n if (!external) {\n setIsOpen(true);\n }\n onClick?.(zendeskId);\n };\n\n if (external) {\n return (\n <a\n href={buildZendeskURL(zendeskId)}\n target='_blank'\n rel='noopener noreferrer'\n onClick={handleClick}\n className={cn(baseClassName, className)}\n >\n {children}\n </a>\n );\n }\n\n return (\n <ZendeskDrawer\n zendeskId={zendeskId}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n Trigger={\n <button onClick={handleClick} className={cn(baseClassName, className)}>\n {children}\n </button>\n }\n />\n );\n}\n"],"mappings":"yPAAO,IAAMA,EAAkB,CAM7B,yBAA0B,cAM1B,2BAA4B,cAM5B,cAAe,cAMf,qBAAsB,cAMtB,aAAc,eAMd,iCAAkC,cAMlC,yBAA0B,cAM1B,oCAAqC,cAMrC,sBAAuB,cACzB,EAEaC,EAAkBC,EAACC,GACvB,gDAAgDA,CAAS,GADnC,mBCrD/B,OAAS,YAAAC,MAAgB,wBAElB,IAAMC,EAAoBC,EAAA,CAC/BC,EACAC,IACG,CACH,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,kBAAmBJ,CAAS,EACvC,QAASD,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMC,EAAyB,CAC9C,OAAQJ,EACR,KAAM,CACJ,GAAI,OAAOF,CAAS,CACtB,CACF,CAAC,EAED,GAAIK,EAAS,MACX,MAAM,IAAI,MAAMA,EAAS,MAAM,SAAW,yBAAyB,EAGrE,OAAOA,CACT,EAbS,WAcT,OAAQN,EAACQ,GAAS,CAChB,IAAMC,EAAUD,EAAK,MAAM,KAAK,oBAChC,OAAIC,GACK,CACL,GAAGA,EACH,KAAMC,EAAmCD,EAAQ,MAAQ,EAAE,CAC7D,CAGJ,EATQ,UAUR,MAAO,GACP,GAAGP,CACL,CAAC,CACH,EAlCiC,qBCmB3B,cAAAS,EAKM,QAAAC,MALN,oBAfC,SAASC,EAAqB,CACnC,KAAAC,EACA,QAAAC,EACA,KAAAC,EACA,U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EACJ,qIAEK,SAASC,GAAqB,CACnC,UAAAC,EACA,UAAAC,EACA,QAAAC,EACA,SAAAC,EACA,SAAAC,EAAW,EACb,EAA8B,CAC5B,GAAM,CAACC,EAAQC,CAAS,EAAIC,EAAS,EAAK,EAEpCC,EAAcC,EAAA,IAAM,CACnBL,GACHE,EAAU,EAAI,EAEhBJ,IAAUF,CAAS,CACrB,EALoB,eAOpB,OAAII,EAEAP,EAAC,KACC,KAAMa,EAAgBV,CAAS,EAC/B,OAAO,SACP,IAAI,sBACJ,QAASQ,EACT,UAAWG,EAAGb,EAAeG,CAAS,EAErC,SAAAE,EACH,EAKFN,EAACe,EAAA,CACC,UAAWZ,EACX,KAAMK,EACN,QAAS,IAAMC,EAAU,EAAK,EAC9B,QACET,EAAC,UAAO,QAASW,EAAa,UAAWG,EAAGb,EAAeG,CAAS,EACjE,SAAAE,EACH,EAEJ,CAEJ,CA1CgBM,EAAAV,GAAA","names":["zendeskArticles","buildZendeskURL","__name","zendeskId","useQuery","useZendeskArticle","__name","zendeskId","queryOptions","client","useClient","useQuery","response","getShowHelpCenterArticle","data","article","sanitizeHtmlWithImageErrorHandling","jsx","jsxs","ZendeskDrawerDefault","open","onClose","data","isLoading","error","zendeskURL","Trigger","Drawer","DrawerTrigger","DrawerContent","DrawerHeader","DrawerTitle","DrawerDescription","__name","jsx","ZendeskDrawer","__name","Trigger","zendeskId","open","onClose","components","useFormFields","zendeskURL","buildZendeskURL","handleClose","data","isLoading","error","useZendeskArticle","CustomZendeskDrawer","ZendeskDrawerDefault","useState","jsx","baseClassName","ZendeskTriggerButton","zendeskId","className","onClick","children","external","isOpen","setIsOpen","useState","handleClick","__name","buildZendeskURL","cn","ZendeskDrawer"]}
@@ -1,2 +0,0 @@
1
- import{b as i}from"./chunk-PGWKJ6FK.js";import{a as r}from"./chunk-NFWNYW2E.js";import{b as n}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function a({children:u,...t}){let{formId:m,onboardingBag:e}=i(),{components:s}=n(),d=s?.button||r;return b(d,{...t,form:m,disabled:t.disabled||e.isSubmitting,children:u})}o(a,"OnboardingSubmit");export{a};
2
- //# sourceMappingURL=chunk-FUBLGAPH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/components/OnboardingSubmit.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\nimport { useOnboardingContext } from '@/src/flows/Onboarding/context';\nimport { useFormFields } from '@/src/context';\n\nexport function OnboardingSubmit({\n children,\n ...props\n}: PropsWithChildren<\n ButtonHTMLAttributes<HTMLButtonElement> & Record<string, unknown>\n>) {\n const { formId, onboardingBag } = useOnboardingContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n form={formId}\n disabled={props.disabled || onboardingBag.isSubmitting}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAgBI,cAAAA,MAAA,oBAXG,SAASC,EAAiB,CAC/B,SAAAC,EACA,GAAGC,CACL,EAEG,CACD,GAAM,CAAE,OAAAC,EAAQ,cAAAC,CAAc,EAAIC,EAAqB,EACjD,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,QAAUG,EAC3C,OACEV,EAACS,EAAA,CACE,GAAGN,EACJ,KAAMC,EACN,SAAUD,EAAM,UAAYE,EAAc,aAEzC,SAAAH,EACH,CAEJ,CAnBgBS,EAAAV,EAAA","names":["jsx","OnboardingSubmit","children","props","formId","onboardingBag","useOnboardingContext","components","useFormFields","CustomButton","ButtonDefault","__name"]}
@@ -1,2 +0,0 @@
1
- import{b as n}from"./chunk-KSHK3ZPX.js";import{a as m}from"./chunk-NFWNYW2E.js";import{b as u}from"./chunk-KQPDXXG3.js";import{a as r}from"./chunk-UQCSN47K.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function B({children:s,...t}){let{formId:i,costCalculatorBag:e}=n(),{components:l}=u(),a=l?.button||m;return c(a,{...t,type:"submit",className:r("RemoteFlows__CostCalculatorForm__SubmitButton",t.className),form:i,disabled:t.disabled||e?.isSubmitting,children:s})}o(B,"CostCalculatorSubmitButton");export{B as a};
2
- //# sourceMappingURL=chunk-GVSAZND2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/CostCalculatorSubmitButton.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useCostCalculatorContext } from './context';\nimport { cn } from '@/src/lib/utils';\nimport { useFormFields } from '@/src/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\nexport function CostCalculatorSubmitButton({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const { formId, costCalculatorBag } = useCostCalculatorContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n type='submit'\n className={cn(\n 'RemoteFlows__CostCalculatorForm__SubmitButton',\n props.className,\n )}\n form={formId}\n disabled={props.disabled || costCalculatorBag?.isSubmitting}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"wMAgBI,cAAAA,MAAA,oBAVG,SAASC,EAA2B,CACzC,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CAAE,OAAAC,EAAQ,kBAAAC,CAAkB,EAAIC,EAAyB,EACzD,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,QAAUG,EAC3C,OACEV,EAACS,EAAA,CACE,GAAGN,EACJ,KAAK,SACL,UAAWQ,EACT,gDACAR,EAAM,SACR,EACA,KAAMC,EACN,SAAUD,EAAM,UAAYE,GAAmB,aAE9C,SAAAH,EACH,CAEJ,CAvBgBU,EAAAX,EAAA","names":["jsx","CostCalculatorSubmitButton","children","props","formId","costCalculatorBag","useCostCalculatorContext","components","useFormFields","CustomButton","ButtonDefault","cn","__name"]}
@@ -1,2 +0,0 @@
1
- import{b as i}from"./chunk-TOA3JILU.js";import{a as r}from"./chunk-NFWNYW2E.js";import{b as n}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function l({children:u,...t}){let{formId:m,contractorOnboardingBag:e}=i(),{components:s}=n(),d=s?.button||r;return b(d,{...t,form:m,disabled:t.disabled||e.isSubmitting,children:u})}o(l,"OnboardingSubmit");export{l as a};
2
- //# sourceMappingURL=chunk-IJ6325YO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractorOnboarding/components/OnboardingSubmit.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useContractorOnboardingContext } from '@/src/flows/ContractorOnboarding/context';\nimport { useFormFields } from '@/src/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\nexport function OnboardingSubmit({\n children,\n ...props\n}: PropsWithChildren<\n ButtonHTMLAttributes<HTMLButtonElement> & Record<string, unknown>\n>) {\n const { formId, contractorOnboardingBag } = useContractorOnboardingContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button || ButtonDefault;\n\n return (\n <CustomButton\n {...props}\n form={formId}\n disabled={props.disabled || contractorOnboardingBag.isSubmitting}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAiBI,cAAAA,MAAA,oBAZG,SAASC,EAAiB,CAC/B,SAAAC,EACA,GAAGC,CACL,EAEG,CACD,GAAM,CAAE,OAAAC,EAAQ,wBAAAC,CAAwB,EAAIC,EAA+B,EACrE,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,QAAUG,EAE3C,OACEV,EAACS,EAAA,CACE,GAAGN,EACJ,KAAMC,EACN,SAAUD,EAAM,UAAYE,EAAwB,aAEnD,SAAAH,EACH,CAEJ,CApBgBS,EAAAV,EAAA","names":["jsx","OnboardingSubmit","children","props","formId","contractorOnboardingBag","useContractorOnboardingContext","components","useFormFields","CustomButton","ButtonDefault","__name"]}
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-NFWNYW2E.js";import{b as n}from"./chunk-KQPDXXG3.js";import{b as r}from"./chunk-TVZAFTPT.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({children:e,...t}){let{formId:i,contractAmendment:u}=r(),{components:s}=n(),d=s?.button||m;return c(d,{...t,form:i,disabled:t.disabled||u.isSubmitting,children:e})}o(C,"ContractAmendmentSubmit");export{C as a};
2
- //# sourceMappingURL=chunk-OKMERBJL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractAmendment/ContractAmendmentSubmit.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useContractAmendmentContext } from './context';\nimport { useFormFields } from '@/src/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\nexport function ContractAmendmentSubmit({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const { formId, contractAmendment } = useContractAmendmentContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n form={formId}\n disabled={props.disabled || contractAmendment.isSubmitting}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAeI,cAAAA,MAAA,oBAVG,SAASC,EAAwB,CACtC,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CAAE,OAAAC,EAAQ,kBAAAC,CAAkB,EAAIC,EAA4B,EAC5D,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,QAAUG,EAC3C,OACEV,EAACS,EAAA,CACE,GAAGN,EACJ,KAAMC,EACN,SAAUD,EAAM,UAAYE,EAAkB,aAE7C,SAAAH,EACH,CAEJ,CAlBgBS,EAAAV,EAAA","names":["jsx","ContractAmendmentSubmit","children","props","formId","contractAmendment","useContractAmendmentContext","components","useFormFields","CustomButton","ButtonDefault","__name"]}
@@ -1,2 +0,0 @@
1
- import{a as r}from"./chunk-NFWNYW2E.js";import{b as n}from"./chunk-KQPDXXG3.js";import{b as e}from"./chunk-TVZAFTPT.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as C}from"react/jsx-runtime";function f({children:m,...t}){let{contractAmendment:{back:u}}=e(),{components:i}=n(),c=i?.button||r;return C(c,{...t,onClick:s=>{u(),t.onClick?.(s)},children:m})}o(f,"ContractAmendmentBack");export{f as a};
2
- //# sourceMappingURL=chunk-PC5JG4TT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractAmendment/ContractAmendmentBack.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useContractAmendmentContext } from './context';\nimport { useFormFields } from '@/src/context';\nimport { ButtonDefault } from '@/src/components/form/fields/default/ButtonDefault';\n\nexport function ContractAmendmentBack({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const {\n contractAmendment: { back },\n } = useContractAmendmentContext();\n\n const { components } = useFormFields();\n\n const CustomButton = components?.button || ButtonDefault;\n return (\n <CustomButton\n {...props}\n onClick={(evt) => {\n back();\n props.onClick?.(evt);\n }}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAkBI,cAAAA,MAAA,oBAbG,SAASC,EAAsB,CACpC,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CACJ,kBAAmB,CAAE,KAAAC,CAAK,CAC5B,EAAIC,EAA4B,EAE1B,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,QAAUG,EAC3C,OACET,EAACQ,EAAA,CACE,GAAGL,EACJ,QAAUO,GAAQ,CAChBN,EAAK,EACLD,EAAM,UAAUO,CAAG,CACrB,EAEC,SAAAR,EACH,CAEJ,CAvBgBS,EAAAV,EAAA","names":["jsx","ContractAmendmentBack","children","props","back","useContractAmendmentContext","components","useFormFields","CustomButton","ButtonDefault","evt","__name"]}
@@ -1,2 +0,0 @@
1
- import{a as R}from"./chunk-SGE4DLC3.js";import{a as E,b as F,c as L,d as _,e as k}from"./chunk-GGPEKIIH.js";import{b as w}from"./chunk-KQPDXXG3.js";import{b as S}from"./chunk-PJN2YJO4.js";import{a as n}from"./chunk-UQCSN47K.js";import{a as d}from"./chunk-P37U34EQ.js";import{jsx as y,jsxs as B}from"react/jsx-runtime";function O({open:e,onOpenChange:a,direction:t,className:i,title:s,trigger:m,children:l}){return B(E,{open:e,onOpenChange:a,direction:t,children:[y(F,{asChild:!0,children:m}),y(L,{className:n(i,"RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4"),children:B("div",{className:"h-full flex flex-col",children:[y(_,{children:y(k,{children:s})}),y("div",{className:"flex-1 overflow-y-auto",children:l})]})})]})}d(O,"DrawerDefault");import{jsx as q}from"react/jsx-runtime";var A=d(({open:e,onOpenChange:a,title:t,trigger:i,children:s,className:m="",direction:l="right"})=>{let{components:T}=w(),p=T?.drawer||O;return q(p,{open:e,onOpenChange:a,title:t,trigger:i,direction:l,className:m,children:s})},"Drawer");import{forwardRef as W}from"react";import*as b from"react";import{jsx as f}from"react/jsx-runtime";var g=b.forwardRef(({className:e,...a},t)=>f("div",{className:"relative w-full overflow-auto",children:f("table",{ref:t,className:n("w-full caption-bottom text-sm",e),...a})}));g.displayName="Table";var x=b.forwardRef(({className:e,...a},t)=>f("thead",{ref:t,className:n("[&_tr]:border-b",e),...a}));x.displayName="TableHeader";var C=b.forwardRef(({className:e,...a},t)=>f("tbody",{ref:t,className:n("[&_tr:last-child]:border-0",e),...a}));C.displayName="TableBody";var z=b.forwardRef(({className:e,...a},t)=>f("tfoot",{ref:t,className:n("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));z.displayName="TableFooter";var D=b.forwardRef(({className:e,...a},t)=>f("tr",{ref:t,className:n("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));D.displayName="TableRow";var h=b.forwardRef(({className:e,...a},t)=>f("th",{ref:t,className:n("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));h.displayName="TableHead";var v=b.forwardRef(({className:e,...a},t)=>f("td",{ref:t,className:n("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));v.displayName="TableCell";var I=b.forwardRef(({className:e,...a},t)=>f("caption",{ref:t,className:n("mt-4 text-sm text-muted-foreground",e),...a}));I.displayName="TableCaption";import{jsx as u,jsxs as V}from"react/jsx-runtime";var U=d(({data:e,columns:a,className:t,ref:i})=>V(g,{ref:i,className:n("RemoteFlows__Table",t),children:[u(x,{children:u(D,{children:a.map(s=>u(h,{className:n("RemoteFlows__TableHead",s.className),children:s.label},String(s.id)))})}),u(C,{children:e?.map((s,m)=>u(D,{children:a.map(l=>u(v,{className:n("RemoteFlows__TableCell",l.className,l.cellClassName),children:l.render?l.render(s[l.id],s,m):s[l.id]},String(l.id)))},J(s,m)))})]}),"TableFieldDefault");function J(e,a){return String(e.id??a)}d(J,"getRowKey");import{jsx as X}from"react/jsx-runtime";var P=W(({data:e=[],columns:a,className:t=""},i)=>{let{components:s}=w(),m=s?.table||U;return X(m,{ref:i,data:e,columns:a,className:t})});P.displayName="Table";import{Fragment as H,jsx as o,jsxs as r}from"react/jsx-runtime";var Z="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",j="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",c=d(({children:e,withBorder:a=!1,className:t=""})=>o("div",{className:n(Z,a&&j,t),children:e}),"SummaryRow"),ee=d(({usedDays:e,bookedDays:a,approvedDaysBeforeTermination:t,approvedDaysAfterTermination:i,remainingDays:s,proposedTerminationDate:m,isUnlimitedPto:l,currentEntitlementDays:T})=>{let p=new Date(m).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return r("div",{children:[r(c,{withBorder:!0,children:[o("label",{children:"Number of days entitled to per year"}),o("p",{"data-testid":"entitled-days",className:"font-bold",children:l?"Unlimited":T})]}),r(c,{children:[o("label",{children:"Total days booked"}),o("p",{"data-testid":"booked-days",className:"font-bold",children:a})]}),r(c,{children:[o("label",{children:"Number of days already used"}),o("p",{"data-testid":"used-days",className:"font-bold",children:e})]}),r(c,{children:[r("label",{children:["Approved for use before ",p]}),o("p",{"data-testid":"approved-days-before-termination",className:"font-bold",children:t})]}),r(c,{withBorder:!0,children:[r("label",{children:["Approved for use after ",p]}),o("p",{"data-testid":"approved-days-after-termination",className:"font-bold",children:i})]}),r(c,{children:[o("label",{children:"Total days remaining unused"}),o("p",{"data-testid":"remaining-days",className:"font-bold",children:s})]}),o(c,{className:"mb-2 py-0",children:r("p",{className:"text-xs text-[#222E39]",children:["Unused days expire on ",p]})})]})},"SummaryTimeOff"),ae=[{id:"formattedDate",label:"Dates",className:"w-[250px]",cellClassName:"font-medium"},{id:"duration",label:"Duration",render:d(e=>R({number:e,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0}),"render")},{id:"status",label:"Status"}],te=d(({employeeName:e,timeoffQuery:a,entitledDays:t,countryName:i,currentEntitlementDays:s,formattedProposedTerminationDate:m,onOpenChange:l,open:T})=>{let{data:p,isLoading:N}=a;return o(A,{open:T,onOpenChange:l,title:`${e} paid time off breakdown`,trigger:o(S,{variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"}),className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:!N&&o(H,{children:Array.isArray(p?.timeoffs)&&p?.timeoffs?.length>0?r(H,{children:[o("p",{className:"text-[#09090B] font-medium mb-4",children:"This list is for your information only."}),r("p",{className:"text-xs text-[#09090B] mb-1 flex items-center justify-between gap-2",children:[r("span",{children:["Annual entitlement for ",i]}),o("span",{className:"font-bold",children:t})]}),r("p",{className:"text-xs text-[#09090B] mb-6 flex items-center justify-between gap-2",children:[r("span",{children:["Entitlement up to ",m]}),o("span",{className:"font-bold",children:s})]}),o("div",{className:"mb-2",children:o(P,{data:p?.timeoffs,columns:ae})}),r("p",{className:"text-xs",children:["Total of"," ",R({number:p?.bookedDays,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0})," ","booked"]})]}):r(H,{children:[o("p",{className:"font-medium mb-1 text-[#09090B]",children:"No recorded time off"}),r("p",{className:"text-sm text-[#09090B]",children:["According to our records, ",e," has not taken any time off this year."]})]})})})},"DrawerTimeOff"),Ee=d(({employeeName:e,proposedTerminationDate:a,summaryData:t,formattedProposedTerminationDate:i,timeoffQuery:s,employment:m,onOpenChange:l,open:T})=>{let{entitledDays:p,bookedDays:N,usedDays:$,approvedDaysBeforeTermination:Q,approvedDaysAfterTermination:G,remainingDays:K,currentEntitlementDays:M,isUnlimitedPto:Y}=t.data;return r("div",{className:"RemoteFlows__PaidTimeOff__Container py-3",children:[o("h3",{className:"RemoteFlows__PaidTimeOff__Title mb-2",children:"Paid time off"}),r("p",{className:"RemoteFlows__PaidTimeOff__Description text-sm mb-2",children:["The proposed termination date for ",e," is"," ",i,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),r("div",{className:"mb-2",children:[!t?.isLoading&&!t?.isError&&t?.data&&o(ee,{usedDays:$,bookedDays:N,currentEntitlementDays:M,approvedDaysBeforeTermination:Q,approvedDaysAfterTermination:G,remainingDays:K,proposedTerminationDate:a,isUnlimitedPto:Y}),o(te,{employeeName:e,timeoffQuery:s,entitledDays:p,currentEntitlementDays:M,countryName:m?.country?.name??"Unknown",onOpenChange:l,formattedProposedTerminationDate:i,open:T})]})]})},"PaidTimeOff");export{Ee as a};
2
- //# sourceMappingURL=chunk-RWYXH6CE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/shared/drawer/DrawerDefault.tsx","../src/components/shared/drawer/Drawer.tsx","../src/components/shared/table/Table.tsx","../src/components/ui/table.tsx","../src/components/shared/table/TableFieldDefault.tsx","../src/flows/Termination/components/PaidTimeOff/PaidTimeOff.tsx"],"sourcesContent":["import { DrawerComponentProps } from '@/src/types/remoteFlows';\nimport {\n Drawer as DrawerPrimitive,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport { cn } from '@/src/lib/utils';\n\nexport function DrawerDefault({\n open,\n onOpenChange,\n direction,\n className,\n title,\n trigger,\n children,\n}: DrawerComponentProps) {\n return (\n <DrawerPrimitive\n open={open}\n onOpenChange={onOpenChange}\n direction={direction}\n >\n <DrawerTrigger asChild>{trigger}</DrawerTrigger>\n <DrawerContent\n className={cn(\n className,\n 'RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4',\n )}\n >\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{title}</DrawerTitle>\n </DrawerHeader>\n <div className='flex-1 overflow-y-auto'>{children}</div>\n </div>\n </DrawerContent>\n </DrawerPrimitive>\n );\n}\n","import { useFormFields } from '@/src/context';\nimport { DrawerComponentProps } from '@/src/types/remoteFlows';\nimport { DrawerDefault } from './DrawerDefault';\n\nexport type DrawerProps = DrawerComponentProps & {\n className?: string;\n direction?: 'left' | 'right';\n};\n\nexport const Drawer = ({\n open,\n onOpenChange,\n title,\n trigger,\n children,\n className = '',\n direction = 'right',\n}: DrawerProps) => {\n const { components } = useFormFields();\n const CustomDrawer = components?.drawer || DrawerDefault;\n\n return (\n <CustomDrawer\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n trigger={trigger}\n direction={direction}\n className={className}\n >\n {children}\n </CustomDrawer>\n );\n};\n","import { forwardRef } from 'react';\nimport { useFormFields } from '@/src/context';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { TableFieldDefault } from './TableFieldDefault';\n\nexport type ColumnDef<T = $TSFixMe> = {\n id: keyof T;\n label: React.ReactNode;\n className?: string;\n cellClassName?: string;\n render?: (value: $TSFixMe, row: T, index: number) => React.ReactNode;\n};\n\nexport type TableDataProps<T = $TSFixMe> = {\n data: T[] | undefined;\n columns: ColumnDef<T>[];\n className?: string;\n};\n\nexport type TableComponentProps<T = $TSFixMe> = TableDataProps<T>;\n\nexport const Table = forwardRef<HTMLTableElement, TableDataProps<$TSFixMe>>(\n ({ data = [], columns, className = '' }, ref) => {\n const { components } = useFormFields();\n const CustomTable =\n (components?.table as\n | React.ComponentType<TableDataProps<$TSFixMe>>\n | undefined) || TableFieldDefault;\n\n // Pass the same structured data to custom components\n return (\n <CustomTable\n ref={ref}\n data={data}\n columns={columns}\n className={className}\n />\n );\n },\n);\n\nTable.displayName = 'Table';\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className='relative w-full overflow-auto'>\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t bg-muted/50 font-medium [&>tr]:last:border-b-0',\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import {\n Table as TablePrimitive,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/src/components/ui/table';\nimport { cn } from '@/src/lib/utils';\nimport { $TSFixMe, TableComponentProps } from '@/src/types/remoteFlows';\n\nexport const TableFieldDefault = ({\n data,\n columns,\n className,\n ref,\n}: TableComponentProps) => {\n return (\n <TablePrimitive ref={ref} className={cn('RemoteFlows__Table', className)}>\n <TableHeader>\n <TableRow>\n {columns.map((column) => (\n <TableHead\n key={String(column.id)}\n className={cn('RemoteFlows__TableHead', column.className)}\n >\n {column.label}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data?.map((row, rowIndex) => (\n <TableRow key={getRowKey(row, rowIndex)}>\n {columns.map((column) => (\n <TableCell\n key={String(column.id)}\n className={cn(\n 'RemoteFlows__TableCell',\n column.className,\n column.cellClassName,\n )}\n >\n {column.render\n ? column.render(\n row[column.id as keyof typeof row],\n row,\n rowIndex,\n )\n : row[column.id as keyof typeof row]}\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </TablePrimitive>\n );\n};\n\nfunction getRowKey(row: $TSFixMe, index: number): string {\n return String(row.id ?? index);\n}\n","import { PaidTimeoffBreakdownResponse } from '@/src/common/api/timeoff';\nimport { Button } from '@/src/components/ui/button';\nimport { cn } from '@/src/lib/utils';\nimport { Drawer } from '@/src/components/shared/drawer/Drawer';\nimport { Table } from '@/src/components/shared/table/Table';\nimport { UseQueryResult } from '@tanstack/react-query';\nimport { PaidTimeOffRenderProps } from '@/src/flows/Termination/components/PaidTimeOff/types';\nimport { getSingularPluralUnit } from '@/src/lib/i18n';\nimport { ColumnDef } from '@/src/components/shared/table/Table';\n\nconst rowBase =\n 'RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs';\nconst rowBorder =\n 'RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]';\n\nconst SummaryRow = ({\n children,\n withBorder = false,\n className = '',\n}: {\n children: React.ReactNode;\n withBorder?: boolean;\n className?: string;\n}) => {\n return (\n <div className={cn(rowBase, withBorder && rowBorder, className)}>\n {children}\n </div>\n );\n};\n\nconst SummaryTimeOff = ({\n usedDays,\n bookedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n proposedTerminationDate,\n isUnlimitedPto,\n currentEntitlementDays,\n}: {\n usedDays: string;\n bookedDays: string;\n approvedDaysBeforeTermination: string;\n approvedDaysAfterTermination: string;\n remainingDays: string;\n proposedTerminationDate: string;\n isUnlimitedPto: boolean;\n currentEntitlementDays: string;\n}) => {\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n });\n return (\n <div>\n <SummaryRow withBorder>\n <label>Number of days entitled to per year</label>\n <p data-testid='entitled-days' className='font-bold'>\n {isUnlimitedPto ? 'Unlimited' : currentEntitlementDays}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days booked</label>\n <p data-testid='booked-days' className='font-bold'>\n {bookedDays}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Number of days already used</label>\n <p data-testid='used-days' className='font-bold'>\n {usedDays}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>\n Approved for use before {formattedProposedTerminationDate}\n </label>\n <p data-testid='approved-days-before-termination' className='font-bold'>\n {approvedDaysBeforeTermination}\n </p>\n </SummaryRow>\n <SummaryRow withBorder>\n <label>Approved for use after {formattedProposedTerminationDate}</label>\n <p data-testid='approved-days-after-termination' className='font-bold'>\n {approvedDaysAfterTermination}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days remaining unused</label>\n <p data-testid='remaining-days' className='font-bold'>\n {remainingDays}\n </p>\n </SummaryRow>\n <SummaryRow className='mb-2 py-0'>\n <p className='text-xs text-[#222E39]'>\n Unused days expire on {formattedProposedTerminationDate}\n </p>\n </SummaryRow>\n </div>\n );\n};\n\ntype TimeoffRow = {\n formattedDate: string;\n duration: number;\n status: string;\n};\n\nconst TIMEOFF_COLUMNS: ColumnDef<TimeoffRow>[] = [\n {\n id: 'formattedDate',\n label: 'Dates',\n className: 'w-[250px]',\n cellClassName: 'font-medium',\n },\n {\n id: 'duration',\n label: 'Duration',\n render: (value: number) =>\n getSingularPluralUnit({\n number: value,\n singular: 'day',\n plural: 'days',\n followCopyGuidelines: false,\n showNumber: true,\n }),\n },\n {\n id: 'status',\n label: 'Status',\n },\n];\n\nconst DrawerTimeOff = ({\n employeeName,\n timeoffQuery,\n entitledDays,\n countryName,\n currentEntitlementDays,\n formattedProposedTerminationDate,\n onOpenChange,\n open,\n}: {\n employeeName: string;\n timeoffQuery: UseQueryResult<PaidTimeoffBreakdownResponse | undefined, Error>;\n entitledDays: string;\n countryName: string;\n currentEntitlementDays: string;\n onOpenChange: () => void;\n open: boolean;\n formattedProposedTerminationDate: string;\n}) => {\n const { data: timeoff, isLoading } = timeoffQuery;\n\n return (\n <Drawer\n open={open}\n onOpenChange={onOpenChange}\n title={`${employeeName} paid time off breakdown`}\n trigger={\n <Button variant='link' className='text-xs text-[#3B82F6] font-bold p-0'>\n See detailed time off breakdown ↗\n </Button>\n }\n className='h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff'\n >\n {!isLoading && (\n <>\n {Array.isArray(timeoff?.timeoffs) && timeoff?.timeoffs?.length > 0 ? (\n <>\n <p className='text-[#09090B] font-medium mb-4'>\n This list is for your information only.\n </p>\n <p className='text-xs text-[#09090B] mb-1 flex items-center justify-between gap-2'>\n <span>Annual entitlement for {countryName}</span>\n <span className='font-bold'>{entitledDays}</span>\n </p>\n <p className='text-xs text-[#09090B] mb-6 flex items-center justify-between gap-2'>\n <span>\n Entitlement up to {formattedProposedTerminationDate}\n </span>\n <span className='font-bold'>{currentEntitlementDays}</span>\n </p>\n <div className='mb-2'>\n <Table data={timeoff?.timeoffs} columns={TIMEOFF_COLUMNS} />\n </div>\n <p className='text-xs'>\n Total of{' '}\n {getSingularPluralUnit({\n number: timeoff?.bookedDays,\n singular: 'day',\n plural: 'days',\n followCopyGuidelines: false,\n showNumber: true,\n })}{' '}\n booked\n </p>\n </>\n ) : (\n <>\n <p className='font-medium mb-1 text-[#09090B]'>\n No recorded time off\n </p>\n <p className='text-sm text-[#09090B]'>\n According to our records, {employeeName} has not taken any time\n off this year.\n </p>\n </>\n )}\n </>\n )}\n </Drawer>\n );\n};\n\nexport type PaidTimeOffProps = PaidTimeOffRenderProps;\n\n/**\n * PaidTimeOff component\n *\n * This component is used to display the paid time off summary and details.\n * It displays the summary data and a button to open the details drawer.\n * When the details drawer is open, it displays the paid time off breakdown.\n */\nexport const PaidTimeOff = ({\n employeeName,\n proposedTerminationDate,\n summaryData,\n formattedProposedTerminationDate,\n timeoffQuery,\n employment,\n onOpenChange,\n open,\n}: PaidTimeOffProps) => {\n const {\n entitledDays,\n bookedDays,\n usedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n currentEntitlementDays,\n isUnlimitedPto,\n } = summaryData.data;\n return (\n <div className='RemoteFlows__PaidTimeOff__Container py-3'>\n <h3 className='RemoteFlows__PaidTimeOff__Title mb-2'>Paid time off</h3>\n <p className='RemoteFlows__PaidTimeOff__Description text-sm mb-2'>\n The proposed termination date for {employeeName} is{' '}\n {formattedProposedTerminationDate}. You will need to pay them for any\n unused accrued days. Below is a breakdown of their time off entitlement\n and usage for the current annual leave period:\n </p>\n <div className='mb-2'>\n {!summaryData?.isLoading &&\n !summaryData?.isError &&\n summaryData?.data && (\n <SummaryTimeOff\n usedDays={usedDays}\n bookedDays={bookedDays}\n currentEntitlementDays={currentEntitlementDays}\n approvedDaysBeforeTermination={approvedDaysBeforeTermination}\n approvedDaysAfterTermination={approvedDaysAfterTermination}\n remainingDays={remainingDays}\n proposedTerminationDate={proposedTerminationDate}\n isUnlimitedPto={isUnlimitedPto}\n />\n )}\n <DrawerTimeOff\n employeeName={employeeName}\n timeoffQuery={timeoffQuery}\n entitledDays={entitledDays}\n currentEntitlementDays={currentEntitlementDays}\n countryName={employment?.country?.name ?? 'Unknown'}\n onOpenChange={onOpenChange}\n formattedProposedTerminationDate={formattedProposedTerminationDate}\n open={open}\n />\n </div>\n </div>\n );\n};\n"],"mappings":"4QAyBM,cAAAA,EAOE,QAAAC,MAPF,oBAfC,SAASC,EAAc,CAC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ACF,EAEA7B,EAAAF,EAAA,CACE,UAAAC,EAAC,KAAE,UAAU,kCAAkC,gCAE/C,EACAC,EAAC,KAAE,UAAU,yBAAyB,uCACTuB,EAAa,0CAE1C,GACF,EAEJ,EAEJ,CAEJ,EAhFsB,iBA2FTW,GAAc9B,EAAA,CAAC,CAC1B,aAAAmB,EACA,wBAAAR,EACA,YAAAoB,EACA,iCAAAjB,EACA,aAAAM,EACA,WAAAY,EACA,aAAAT,EACA,KAAAC,CACF,IAAwB,CACtB,GAAM,CACJ,aAAAH,EACA,WAAAd,EACA,SAAAD,EACA,8BAAAE,EACA,6BAAAC,EACA,cAAAC,EACA,uBAAAG,EACA,eAAAD,CACF,EAAImB,EAAY,KAChB,OACEnC,EAAC,OAAI,UAAU,2CACb,UAAAD,EAAC,MAAG,UAAU,uCAAuC,yBAAa,EAClEC,EAAC,KAAE,UAAU,qDAAqD,+CAC7BuB,EAAa,MAAI,IACnDL,EAAiC,8JAGpC,EACAlB,EAAC,OAAI,UAAU,OACZ,WAACmC,GAAa,WACb,CAACA,GAAa,SACdA,GAAa,MACXpC,EAACU,GAAA,CACC,SAAUC,EACV,WAAYC,EACZ,uBAAwBM,EACxB,8BAA+BL,EAC/B,6BAA8BC,EAC9B,cAAeC,EACf,wBAAyBC,EACzB,eAAgBC,EAClB,EAEJjB,EAACuB,GAAA,CACC,aAAcC,EACd,aAAcC,EACd,aAAcC,EACd,uBAAwBR,EACxB,YAAamB,GAAY,SAAS,MAAQ,UAC1C,aAAcT,EACd,iCAAkCT,EAClC,KAAMU,EACR,GACF,GACF,CAEJ,EAzD2B","names":["jsx","jsxs","DrawerDefault","open","onOpenChange","direction","className","title","trigger","children","Drawer","DrawerTrigger","DrawerContent","cn","DrawerHeader","DrawerTitle","__name","jsx","Drawer","__name","open","onOpenChange","title","trigger","children","className","direction","components","useFormFields","CustomDrawer","DrawerDefault","forwardRef","React","jsx","Table","className","props","ref","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","jsx","jsxs","TableFieldDefault","__name","data","columns","className","ref","Table","cn","TableHeader","TableRow","column","TableHead","TableBody","row","rowIndex","TableCell","getRowKey","index","jsx","Table","forwardRef","data","columns","className","ref","components","useFormFields","CustomTable","TableFieldDefault","Fragment","jsx","jsxs","rowBase","rowBorder","SummaryRow","__name","children","withBorder","className","cn","SummaryTimeOff","usedDays","bookedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","remainingDays","proposedTerminationDate","isUnlimitedPto","currentEntitlementDays","formattedProposedTerminationDate","TIMEOFF_COLUMNS","value","getSingularPluralUnit","DrawerTimeOff","employeeName","timeoffQuery","entitledDays","countryName","onOpenChange","open","timeoff","isLoading","Drawer","Button","Table","PaidTimeOff","summaryData","employment"]}
@@ -1,2 +0,0 @@
1
- import{b as ee}from"./chunk-EGSUF7OD.js";import{a as L}from"./chunk-ZFKHCC4Z.js";import{a as Se,b as Le,c as Be,d as Oe,e as Ae,f as Ve,g as ze,h as Ge,i as Ue,j as Je,l as qe,m as Ze,n as Ke,o as Ye,p as Xe,r as Qe,t as je,u as eo,v as oo}from"./chunk-TC3CLBCD.js";import{b as x}from"./chunk-KQPDXXG3.js";import{a as ve,b as B}from"./chunk-PJN2YJO4.js";import{a as ie,b as le,c as S,d as Me,e as Ie,f as We,g as He,h as b,i as N,j as P,k as D,l as w,m as T}from"./chunk-CR7AIZKA.js";import{h as Ee}from"./chunk-HRG5MSVG.js";import{a as _,e as j}from"./chunk-UQCSN47K.js";import{a as t}from"./chunk-P37U34EQ.js";import{Fragment as Xt,useEffect as Qt,useRef as it}from"react";import{Fragment as dt,jsx as A,jsxs as se}from"react/jsx-runtime";var to=t(({field:e,fieldState:o,fieldData:r})=>{let{name:n,label:l,description:i,options:m,multiple:a}=r;return se(N,{"data-field":n,className:_(`RemoteFlows__CheckBoxField__Item__${n}`),children:[A(D,{children:se(dt,{children:[m&&a?A(P,{children:l}):null,m&&a?m.map(d=>se("div",{className:"flex space-x-2",children:[A(Se,{id:d.value,onCheckedChange:c=>{e.onChange(c===!0,d.value)},checked:e.value?.includes(d.value),className:"RemoteFlows__CheckBox__Input"}),A(P,{htmlFor:d.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:d.label})]},d.value)):se("div",{className:"flex space-x-2",children:[A(Se,{id:n,onCheckedChange:d=>{e.onChange(d===!0,null)},checked:e.value,className:"RemoteFlows__CheckBox__Input"}),A(P,{htmlFor:n,className:"mb-0 RemoteFlows__CheckBox__Label",children:l})]})]})}),i&&A(w,{children:i}),o.error&&A(T,{})]})},"CheckboxFieldDefault");import{jsx as ro}from"react/jsx-runtime";function me({name:e,defaultValue:o,description:r,label:n,onChange:l,multiple:i,options:m,component:a,...d}){let{components:c}=x(),{control:s}=S(),p=t((u,h,g)=>{if(i&&g){let f=u.value?[...u.value]:[];h?f.includes(g)||u.onChange([...f,g]):u.onChange(f.filter(C=>C!==g))}else u.onChange(h)},"handleCheckboxChange");return ro(b,{control:s,name:e,defaultValue:o,render:({field:u,fieldState:h})=>{let f=a||c?.checkbox||to,C={name:e,description:r,label:n,defaultValue:o,multiple:i,options:m,...d};return ro(f,{field:{...u,onChange:t((v,k)=>{p(u,v,k),l?.(v,k)},"onChange")},fieldState:h,fieldData:C})}})}t(me,"CheckBoxField");import{CalendarIcon as Ft}from"lucide-react";import{format as io}from"date-fns";import*as O from"@radix-ui/react-popover";import{PopoverClose as no}from"@radix-ui/react-popover";import{jsx as de}from"react/jsx-runtime";function ce({...e}){return de(O.Root,{"data-slot":"popover",...e})}t(ce,"Popover");function pe({...e}){return de(O.Trigger,{"data-slot":"popover-trigger",...e})}t(pe,"PopoverTrigger");function ue({className:e,align:o="center",sideOffset:r=4,...n}){return de(O.Portal,{children:de(O.Content,{"data-slot":"popover-content",align:o,sideOffset:r,className:_("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}t(ue,"PopoverContent");import{ChevronLeft as ct,ChevronRight as pt}from"lucide-react";import{DayPicker as ut}from"react-day-picker";import{jsx as xe}from"react/jsx-runtime";function ao({className:e,classNames:o,showOutsideDays:r=!0,...n}){return xe(ut,{showOutsideDays:r,className:_("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:_(ve({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_(ve({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...o},components:{IconLeft:t(({className:l,...i})=>xe(ct,{className:_("size-4",l),...i}),"IconLeft"),IconRight:t(({className:l,...i})=>xe(pt,{className:_("size-4",l),...i}),"IconRight")},...n})}t(ao,"Calendar");import{jsx as ft}from"react/jsx-runtime";function G({helpCenter:e}){return e?ft(ee,{zendeskId:e.id,children:e.callToAction}):null}t(G,"HelpCenter");import{Fragment as gt,jsx as I,jsxs as fe}from"react/jsx-runtime";function lo({field:e,fieldData:o,fieldState:r}){let{name:n,label:l,description:i,minDate:m,maxDate:a}=o,d=m?new Date(m):void 0,c=a?new Date(a):void 0;return fe(N,{"data-field":n,className:`flex flex-col RemoteFlows__DatePickerField__Item__${n}`,children:[I(P,{className:"RemoteFlows__DatePickerField__Label",children:l}),fe(ce,{children:[I(pe,{asChild:!0,children:I(D,{children:I("div",{children:fe(B,{type:"button",variant:"outline",className:_("w-full pl-3 text-left font-normal",!e.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${n}`,children:[e.value&&I(gt,{children:io(e.value,"yyyy-MM-dd")}),I(Ft,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),I(ue,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:I(ao,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:e.value?new Date(e.value):void 0,onSelect:s=>{e.onChange(s?io(s,"yyyy-MM-dd"):null)},defaultMonth:d,components:{DayContent:t(s=>I(no,{children:s.date.getDate()}),"DayContent")},disabled:s=>!!(d&&s<d||c&&s>c)})})]}),i?fe(w,{children:[i," ",I(G,{helpCenter:o.meta?.helpCenter})]}):null,r.error&&I(T,{className:"RemoteFlows__DatePickerField__Error"})]})}t(lo,"DatePickerFieldDefault");import{jsx as so}from"react/jsx-runtime";function mo({description:e,label:o,name:r,minDate:n,maxDate:l,onChange:i,component:m,...a}){let{components:d}=x(),{control:c}=S(),s;a.meta?.mot&&typeof a.meta.mot=="number"?s=Ee(a.meta.mot):n&&(s=new Date(`${n}T00:00:00`));let p;return l&&(p=new Date(`${l}T23:59:59`)),so(b,{control:c,name:r,render:({field:u,fieldState:h})=>{let f=m||d?.date||lo,C={description:e,label:o,name:r,onChange:i,...s&&{minDate:s.toISOString()},...p&&{maxDate:p.toISOString()},...a};return so(f,{field:{...u,onChange:t(v=>{u.onChange(v),i?.(v)},"onChange")},fieldState:h,fieldData:C})}})}t(mo,"DatePickerField");import{jsx as U,jsxs as ht}from"react/jsx-runtime";function co({field:e,fieldState:o,fieldData:r}){let{name:n,label:l,description:i,multiple:m,accept:a}=r;return ht(N,{"data-field":n,className:`RemoteFlows__FileUpload__Item__${n}`,children:[U(P,{className:"RemoteFlows__FileUpload__Label",children:l}),U(D,{children:U(Le,{onChange:e.onChange,multiple:m,className:_("RemoteFlows__FileUpload__Input"),accept:a,files:e.value})}),i&&U("div",{className:"flex items-center justify-between",children:U(w,{className:"RemoteFlows__FileUpload__Description",children:i})}),o.error&&U(T,{className:"RemoteFlows__FileUpload__Error"})]})}t(co,"FileUploadFieldDefault");import{jsx as po}from"react/jsx-runtime";var _t=t((e,o)=>{if(!o)return null;for(let r of e)if(r.size>o){let n=Math.round(o/1048576),l=Math.round(r.size/(1024*1024));return`File "${r.name}" exceeds maximum size of ${n}MB (file is ${l}MB)`}return null},"validateFileSize");function uo({name:e,description:o,label:r,multiple:n,onChange:l,component:i,accept:m,maxSize:a,...d}){let{components:c}=x(),{control:s,setError:p,clearErrors:u}=S(),h=t(async(g,f)=>{let C=_t(g,a);if(C){p(e,{message:C});return}u(e),f.onChange(g),l?.(g)},"handleOnChange");return po(b,{control:s,name:e,render:({field:g,fieldState:f})=>{let v=i||c?.file||co,k={name:e,description:o,label:r,multiple:n,accept:m,maxFileSize:a,...d};return po(v,{field:{...g,value:g.value,onChange:t(async z=>h(z,g),"onChange")},fieldState:f,fieldData:k})}})}t(uo,"FileUploadField");import{jsx as Ct}from"react/jsx-runtime";function fo({field:e,fieldData:o}){return Ct(L,{type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",...e,...o})}t(fo,"NumberFieldDefault");import{jsx as Fo}from"react/jsx-runtime";function Fe(e){let{components:o}=x(),{control:r}=S(),l=e.component||o?.number||fo;return Fo(b,{control:r,name:e.name,render:({field:i,fieldState:m})=>Fo(l,{field:{...i,onChange:t(a=>{i.onChange(a),e.onChange?.(a)},"onChange")},fieldState:m,fieldData:e})})}t(Fe,"NumberField");import{Fragment as yt}from"react";import{jsx as W,jsxs as ge}from"react/jsx-runtime";var go=t(({field:e,fieldData:o,fieldState:r})=>{let{name:n,label:l,description:i,options:m}=o;return W("fieldset",{className:_("space-y-3",`RemoteFlows__RadioGroupField__Item__${n}`),"data-field":n,children:ge(N,{children:[W("legend",{children:l}),i&&ge(w,{children:[i," ",W(G,{helpCenter:o.meta?.helpCenter})]}),W(D,{children:W(Be,{"aria-label":l||n,onValueChange:a=>{e.onChange(a)},value:e.value,className:"flex flex-col space-y-3",children:m?.map(a=>W(yt,{children:ge(N,{"data-field":n,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(D,{children:W(Oe,{value:a.value,className:"RemoteFlows__RadioField__Input",disabled:a.disabled})}),ge("div",{children:[W(P,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:a.label}),a.description&&W(w,{className:"mt-2",children:a.description})]})]})},a.value))})}),r.error&&W(T,{})]})})},"RadioGroupFieldDefault");import{jsx as ho}from"react/jsx-runtime";function _o({name:e,defaultValue:o,description:r,label:n,options:l,onChange:i,component:m,...a}){let{components:d}=x(),{control:c}=S();return ho(b,{control:c,name:e,defaultValue:o,render:({field:s,fieldState:p})=>{let h=m||d?.radio||go,g={name:e,defaultValue:o,description:r,label:n,options:l,...a};return ho(h,{field:{...s,onChange:t(f=>{s.onChange(f),i?.(f)},"onChange")},fieldState:p,fieldData:g})}})}t(_o,"RadioGroupField");import{jsx as E,jsxs as Co}from"react/jsx-runtime";function yo({field:e,fieldState:o,fieldData:r}){let{name:n,label:l,description:i,options:m}=r;return Co(N,{"data-field":n,className:`RemoteFlows__SelectField__Item__${n}`,children:[E(P,{className:"RemoteFlows__SelectField__Label",children:l}),E(D,{children:E("div",{className:"relative",children:Co(Ae,{value:e.value||"",onValueChange:a=>{e.onChange(a)},children:[E(Ge,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!o.error,"aria-label":l,children:E("span",{className:"absolute",children:E(ze,{placeholder:l})})}),E(Ue,{className:"RemoteFlows__SelectField__Content",children:E(Ve,{className:"RemoteFlows__SelectField__Group",children:m?.map(a=>E(Je,{value:a.value,className:"RemoteFlows__SelectField__SelectItem",disabled:a.disabled,children:a.label},a.value))})})]})})}),i&&E(w,{children:i}),o.error&&E(T,{})]})}t(yo,"SelectFieldDefault");import{jsx as vo}from"react/jsx-runtime";function So({label:e,name:o,options:r,defaultValue:n,description:l,onChange:i,component:m,...a}){let{control:d}=S(),{components:c}=x();return vo(b,{defaultValue:n,control:d,name:o,render:({field:s,fieldState:p})=>{let h=m||c?.select||yo,g={label:e,name:o,options:r,defaultValue:n,description:l,onChange:i,...a};return vo(h,{field:{...s,onChange:t(f=>{let C=a.jsonType==="number"?Number(f):f;s.onChange(C),i?.(C)},"onChange")},fieldState:p,fieldData:g})}})}t(So,"SelectField");import{useEffect as Pt,useState as Nt}from"react";import{Fragment as vt,useState as St}from"react";import{Check as xt,ChevronDownIcon as bt,X as kt}from"lucide-react";import{Command as J}from"cmdk";import{SearchIcon as Qn}from"lucide-react";import{jsx as q,jsxs as oa}from"react/jsx-runtime";function xo({className:e,...o}){return q(J,{"data-slot":"command",className:_("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...o})}t(xo,"Command");function bo({className:e,...o}){return q(J.List,{"data-slot":"command-list",className:_("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...o})}t(bo,"CommandList");function ko({...e}){return q(J.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}t(ko,"CommandEmpty");function Po({className:e,...o}){return q(J.Group,{"data-slot":"command-group",className:_("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...o})}t(Po,"CommandGroup");function No({className:e,...o}){return q(J.Separator,{"data-slot":"command-separator",className:_("bg-border -mx-1 h-px",e),...o})}t(No,"CommandSeparator");function Do({className:e,...o}){return q(J.Item,{"data-slot":"command-item",className:_("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}t(Do,"CommandItem");import{jsx as $,jsxs as Z}from"react/jsx-runtime";function he({options:e,selected:o,onChange:r,placeholder:n,...l}){let[i,m]=St(!1),a=t(s=>{r(o.filter(p=>p.value!==s.value))},"handleUnselect"),d=e.some(s=>s.category),c=e.reduce((s,p)=>{let u=p.category||"Uncategorized";return s[u]||(s[u]=[]),s[u].push(p),s},{});return Z(ce,{open:i,onOpenChange:m,...l,children:[$(pe,{children:Z(B,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between font-normal",type:"button",children:[$("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:o.length>0?o.map(s=>Z(qe,{variant:"secondary",className:"mr-1 mb-1",children:[s.label,$("div",{role:"button",tabIndex:0,"aria-label":`remove ${s.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:p=>{p.key==="Enter"&&a(s)},onMouseDown:p=>{p.preventDefault(),p.stopPropagation()},onClick:()=>a(s),children:$(kt,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},s.label)):$("span",{className:"text-foreground",children:n})}),$(bt,{className:"size-4"})]})}),$(ue,{align:"start",className:"w-full p-0",children:$(xo,{children:Z(bo,{children:[$(ko,{children:"No item found."}),Object.entries(c).map(([s,p],u)=>Z(vt,{children:[u>0&&$(No,{}),$(Po,{heading:d?s:void 0,children:p.map(h=>{let g=o.some(f=>f.value===h.value);return Z(Do,{onSelect:()=>{r(g?o.filter(f=>f.value!==h.value):[...o,h])},children:[$(xt,{className:_("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),h.label]},h.label)})})]},s))]})})})]})}t(he,"MultiSelect");import{jsx as oe,jsxs as wo}from"react/jsx-runtime";function To({field:e,fieldState:o,fieldData:r}){let[n,l]=Nt([]),i=t(a=>{let d=a.map(({value:c})=>c);e.onChange(d),l(a)},"handleChange");Pt(()=>{e.value&&r.options&&l(e.value.map(a=>r?.options?.find(d=>d.value===a)))},[e.value,r.options]);let m=[...Object.entries(r.$meta?.regions||{}).map(([a,d])=>({value:d,label:a,category:"Regions"})),...Object.entries(r.$meta?.subregions||{}).map(([a,d])=>({value:d,label:a,category:"Subregions"})),...r.options?.map(a=>({...a,value:a.value,label:a.label,category:"Countries"}))||[]];return wo(N,{"data-field":e.name,className:`RemoteFlows__CountryField__Item__${e.name}`,children:[oe(P,{className:"RemoteFlows__CountryField__Label",children:r.label}),oe(D,{children:oe(he,{options:m,selected:n,onChange:i})}),r.description&&wo(w,{children:[r.description," ",oe(G,{helpCenter:r.meta?.helpCenter})]}),o.error&&oe(T,{})]})}t(To,"CountryFieldDefault");import{jsx as Ro}from"react/jsx-runtime";function $o({label:e,name:o,options:r,defaultValue:n,description:l,onChange:i,$meta:m,component:a,...d}){let{control:c}=S(),{components:s}=x();return Ro(b,{defaultValue:n,control:c,name:o,render:({field:p,fieldState:u})=>{let g=a||s?.countries||To,f={label:e,name:o,options:r,defaultValue:n,description:l,onChange:i,$meta:m,...d};return Ro(g,{field:{...p,onChange:t(C=>{p.onChange(C),i?.(C)},"onChange")},fieldState:u,fieldData:f})}})}t($o,"CountryField");import*as Mo from"react";import{jsx as Dt}from"react/jsx-runtime";var be=Mo.forwardRef(({className:e,...o},r)=>Dt("textarea",{className:_("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...o}));be.displayName="Textarea";import{jsx as te,jsxs as ke}from"react/jsx-runtime";function Io({field:e,fieldState:o,fieldData:r}){let{name:n,label:l,description:i,maxLength:m}=r,a=e.value?.length??0;return ke(N,{"data-field":n,className:`RemoteFlows__TextArea__Item__${n}`,children:[te(P,{className:"RemoteFlows__TextArea__Label",children:l}),te(D,{children:te(be,{...e,value:e.value??"",onChange:d=>{e.onChange(d)},className:_(o.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:l})}),(i||m)&&ke("div",{className:"flex items-center justify-between",children:[i&&te(w,{className:"RemoteFlows__TextArea__Description",children:i}),m&&ke("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[a,"/",m]})]}),o.error&&te(T,{className:"RemoteFlows__TextArea__Error"})]})}t(Io,"TextAreaFieldDefault");import{jsx as Wo}from"react/jsx-runtime";function Eo({name:e,description:o,label:r,onChange:n,maxLength:l,component:i,...m}){let{components:a}=x(),{control:d}=S();return Wo(b,{control:d,name:e,render:({field:c,fieldState:s})=>{let u=i||a?.textarea||Io,h={name:e,description:o,label:r,maxLength:l,...m};return Wo(u,{field:{...c,onChange:t(g=>{c.onChange(g),n?.(g)},"onChange")},fieldState:s,fieldData:h})}})}t(Eo,"TextAreaField");import{jsx as wt}from"react/jsx-runtime";function Ho({field:e,fieldData:o}){return wt(L,{name:e.name,...o,type:"email"})}t(Ho,"EmailFieldDefault");import{jsx as Lo}from"react/jsx-runtime";function Bo(e){let{components:o}=x(),{control:r}=S(),l=e.component||o?.email||Ho;return Lo(b,{control:r,name:e.name,render:({field:i,fieldState:m})=>Lo(l,{field:{...i,onChange:t(a=>{i.onChange(a),e.onChange?.(a)},"onChange")},fieldState:m,fieldData:e})})}t(Bo,"EmailField");import{jsx as Oo}from"react/jsx-runtime";function Ao(e){let{control:o}=S();return Oo(b,{control:o,name:e.name,render:({field:r})=>Oo("input",{...r,type:"hidden"})})}t(Ao,"HiddenField");import{useEffect as At,useState as Vt}from"react";import Vo from"lodash.groupby";import K from"lodash.capitalize";var zo=60,_e=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Tt(e){if(e<60)return`${e}m`;let o=Math.floor(e/zo),r=e%zo;return r>0?`${o}h${r}m`:`${o}h`}t(Tt,"convertBreakDurationToHours");function Go(e){let o=e.reduce((r,n)=>n.hours+r,0);return Number(o.toFixed(2))}t(Go,"calculateTotalWorkHours");function Rt(e,o){let r=o.map(({day:i})=>i.toLowerCase()),n=r.indexOf(e),l=null;for(;n<r.length&&!l;){let i=r[n],m=r[n+1],a=_e.indexOf(i)+1;_e[a]===m||(l=i),n+=1}return l}t(Rt,"findLastConsecutiveDay");function $t(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}t($t,"shouldSummarizeSchedule");function Mt(e){return Number.parseInt(e.break_duration_minutes)>0}t(Mt,"shouldSummarizeBreaks");function Uo(e){let o=e.filter($t),r=Vo(o,a=>`${a.start_time}|${a.end_time}`),n=e.filter(Mt),l=Vo(n,"break_duration_minutes"),i=Object.keys(r).map(a=>{let d=r[a],c=d[0].day,[s,p]=a.split("|"),u=`from <span>${s.replace(":","h")}</span> to <span>${p.replace(":","h")}</span>`,h=Rt(c,d),f=(h?d.findIndex(C=>C.day===h):-1)===d.length-1;return d.length===1?`${K(c)}, ${u}`:!f||!h?d.reduce((C,v,k)=>{let z=K(v.day);return k===d.length-1?`${C}and ${z}, ${u}`:`${C}<span>${z}</span>, `},""):`<span>${K(c)}</span> to <span>${K(h)}</span>, ${u}`}),m=Object.keys(l).reverse().map((a,d)=>{let c=d===0,s=l[a],p=Tt(parseInt(a,10));if(Object.keys(l).length===1)return`With ${p} daily breaks`;if(s.length===1){let u=`${p} break on ${K(s[0].day)}.`;return c?`With ${u}`:u}return s.reduce((u,h,g)=>{let f=K(h.day);return g===0?`${u} ${f}`:g===s.length-1?`${u}, and ${f}.`:`${u}, ${f}`},c?`With ${p} break on`:`${p} break on`)});return{workHoursSummary:i,breakSummary:m}}t(Uo,"buildWorkScheduleSummary");function Pe(e){let{checked:o,start_time:r,end_time:n,break_duration_minutes:l}=e;if(!o)return 0;let[i,m]=r.split(":").map(Number),[a,d]=n.split(":").map(Number),c=i*60+m,u=(a*60+d-c-Number.parseInt(l||"0"))/60;return u===Math.floor(u)?u:Number(u.toFixed(2))}t(Pe,"calculateHours");var It={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function Ce(e){return It[e]}t(Ce,"getShortWeekday");import*as R from"yup";var Jo=t((e,o,r)=>{if(e&&"reportValidity"in e){let n=ie(r,o);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},"r"),Ne=t((e,o)=>{for(let r in o.fields){let n=o.fields[r];n&&n.ref&&"reportValidity"in n.ref?Jo(n.ref,r,e):n&&n.refs&&n.refs.forEach(l=>Jo(l,r,e))}},"o"),Zo=t((e,o)=>{o.shouldUseNativeValidation&&Ne(e,o);let r={};for(let n in e){let l=ie(o.fields,n),i=Object.assign(e[n]||{},{ref:l&&l.ref});if(Wt(o.names||Object.keys(e),n)){let m=Object.assign({},ie(r,n));le(m,"root",i),le(r,n,m)}else le(r,n,i)}return r},"s"),Wt=t((e,o)=>{let r=qo(o);return e.some(n=>qo(n).match(`^${r}\\.\\d+`))},"i");function qo(e){return e.replace(/\]|\[/g,"")}t(qo,"n");function Ko(e,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),function(n,l,i){try{return Promise.resolve((function(m,a){try{var d=(o.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},o,{context:l}))).then(function(c){return i.shouldUseNativeValidation&&Ne({},i),{values:r.raw?Object.assign({},n):c,errors:{}}}))}catch(c){return a(c)}return d&&d.then?d.then(void 0,a):d})(0,function(m){if(!m.inner)throw m;return{values:{},errors:Zo((a=m,d=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(a.inner||[]).reduce(function(c,s){if(c[s.path]||(c[s.path]={message:s.message,type:s.type}),d){var p=c[s.path].types,u=p&&p[s.type];c[s.path]=Me(s.path,d,c,s.type,u?[].concat(u,s.message):s.message)}return c},{})),i)};var a,d}))}catch(m){return Promise.reject(m)}}}t(Ko,"o");import{Fragment as Et,useState as Ht}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";var Lt=R.object({day:R.string().required(),checked:R.boolean().required(),start_time:R.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:t(e=>e.required("Required"),"then"),otherwise:t(e=>e.optional().nullable(),"otherwise")}),end_time:R.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:t(e=>e.required("Required"),"then"),otherwise:t(e=>e.optional().nullable(),"otherwise")}),hours:R.number().default(0),break_duration_minutes:R.string().default("0")}),Bt=R.object({schedule:R.array(Lt)});function Ot({defaultSchedule:e,onSubmit:o}){let[r,n]=Ht(!1),l=_e.map(f=>{let C=e.find(v=>v.day.toLowerCase()===Ce(f).toLowerCase()||v.day.toLowerCase()===f.toLowerCase());return C?{...C,day:Ce(f),checked:!0}:{...e[0],checked:!1,day:Ce(f)}}),i=We({defaultValues:{schedule:l},resolver:Ko(Bt)}),{handleSubmit:m,watch:a,reset:d,control:c,formState:s}=i,{fields:p}=Ie({name:"schedule",control:c}),u=a("schedule");function h(f){let C=f.schedule.filter(({checked:v})=>v).map(v=>({...v,hours:Pe(v)}));o(C),n(!1)}t(h,"handleSubmitWorkingHours");function g(){d(),n(!1)}return t(g,"handleCancel"),y("div",{className:"flex items-center justify-between",children:M(Ze,{open:r,onOpenChange:n,children:[y(Ke,{asChild:!0,children:y(B,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),M(Ye,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(Xe,{children:y(Qe,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(He,{...i,children:M("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[M("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),M("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:p.map((f,C)=>{let v=u[C],k=Pe(v);return M(Et,{children:[M("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(me,{label:f.day,name:`schedule.${C}.checked`})}),y("div",{className:"col-span-3",children:y(L,{name:`schedule.${C}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(L,{name:`schedule.${C}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(k)?"-":`${k} hours`})]}),M("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(L,{name:`schedule.${C}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},f.id)})})]}),Object.keys(s.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),M("div",{className:"flex gap-4 pt-4",children:[y(B,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),y(B,{type:"button",className:"submit-button",onClick:m(h),children:"Save Schedule"})]})]})})]})]})})}t(Ot,"WorkScheduleSelectionForm");var Yo=t(({fieldData:e})=>{let{defaultFormattedValue:o,currentSchedule:r,onSubmit:n}=e,{workHoursSummary:l,breakSummary:i,totalWorkHours:m}=o;return M("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),M("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:l.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),M("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:m})," hours per week"]}),y(Ot,{defaultSchedule:r,onSubmit:n})]})]})},"WorkScheduleFieldDefault");import{jsx as Xo}from"react/jsx-runtime";function Qo(e){let{components:o}=x(),{setValue:r,control:n,watch:l}=S(),i=l(e.name),[m,a]=Vt(i),{workHoursSummary:d,breakSummary:c}=Uo(m),s=Go(m);At(()=>{r(e.name,m)},[m,e.name,r]);function p(f){a(f)}t(p,"onSubmit");let h=e.component||o?.["work-schedule"]||Yo,g={...e,onSubmit:p,currentSchedule:m,defaultFormattedValue:{workHoursSummary:d,breakSummary:c,totalWorkHours:s}};return Xo(b,{control:n,name:e.name,render:({field:f,fieldState:C})=>Xo(h,{field:{...f,onChange:t(v=>{f.onChange(v),e.onChange?.(v)},"onChange")},fieldState:C,fieldData:g})})}t(Qo,"WorkScheduleField");import{useEffect as zt,useState as Gt}from"react";import{jsx as re,jsxs as Ut}from"react/jsx-runtime";var jo=t(({field:e,fieldState:o,fieldData:r})=>{let[n,l]=Gt([]),{name:i,label:m,description:a,options:d}=r,c=n||d?.filter(s=>e.value?.includes(s.value));return zt(()=>{l(d?.filter(s=>e.value?.includes(s.value))||[])},[e.value,d]),Ut(N,{"data-field":i,className:`RemoteFlows__SelectField__Item__${i}`,children:[re(P,{className:"RemoteFlows__SelectField__Label",children:m}),re(D,{children:re(he,{options:d||[],selected:c,onChange:s=>{let p=s.map(({value:u})=>u);e.onChange(p),l(s)}})}),a&&re(w,{children:a}),o.error&&re(T,{})]})},"MultiSelectFieldDefault");import{jsx as et}from"react/jsx-runtime";function ot({label:e,name:o,options:r,defaultValue:n,description:l,onChange:i,component:m,...a}){let{control:d}=S(),{components:c}=x();return et(b,{defaultValue:n,control:d,name:o,render:({field:s,fieldState:p})=>{let h=m||c?.["multi-select"]||jo,g={label:e,name:o,options:r,defaultValue:n,description:l,onChange:i,...a};return et(h,{field:{...s,onChange:t(f=>{s.onChange(f),i?.(f)},"onChange")},fieldState:p,fieldData:g})}})}t(ot,"MultiSelectField");import{jsx as Jt}from"react/jsx-runtime";var tt=t(e=>Jt(Fe,{maxLength:15,...e}),"MoneyField");var De={checkbox:me,text:L,email:Bo,money:tt,select:So,"multi-select":ot,radio:_o,number:Fe,file:uo,date:mo,textarea:Eo,countries:$o,hidden:Ao,"work-schedule":Qo};import{AlertCircle as qt}from"lucide-react";import{jsx as we,jsxs as Zt}from"react/jsx-runtime";function rt({data:e}){let{title:o,description:r,severity:n}=e,i={warning:"warning",error:"destructive",info:"default",success:"warning"}[n]??"warning";return Zt(je,{variant:i,children:[we(qt,{className:"h-4 w-4"}),o&&we(eo,{dangerouslySetInnerHTML:{__html:o}}),r&&we(oo,{dangerouslySetInnerHTML:{__html:r}})]})}t(rt,"StatementDefault");import{jsx as Kt}from"react/jsx-runtime";function nt({title:e,description:o,severity:r}){let{components:n}=x(),l=n?.statement??rt;return Kt(l,{data:{title:e?j(e):void 0,description:j(o),severity:r}})}t(nt,"Statement");import{jsx as Yt}from"react/jsx-runtime";var at=t(({isExpanded:e,onToggle:o,className:r,...n})=>Yt(B,{type:"button",className:_("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",r),variant:"default",onClick:o,...n,children:e?"Remove":"Define"}),"FieldsetToggleButtonDefault");import{Fragment as jt,jsx as H,jsxs as V}from"react/jsx-runtime";function lt({label:e,name:o,fields:r,description:n,components:l,statement:i,isFlatFieldset:m,extra:a,variant:d="outset",features:c,meta:s}){let{helpCenter:p}=s||{},{watch:u,setValue:h,trigger:g,formState:f}=S(),{components:C}=x(),v=c?.toggle?.stateField,k=v?u(v):c?.toggle?.defaultExpanded??!0,z=r.map(({name:F})=>`${o}.${F}`),ne=u(z),Te=it(ne),Y=it(null),st=t(()=>{v&&h(v,!k)},"toggleExpanded");Qt(()=>{let F=ne,X=Te.current,ye=f.isSubmitted||f.submitCount>0,ae=!1;for(let Q=0;Q<F.length;Q++)if(F[Q]!==void 0&&X[Q]!==F[Q]){ae=!0;break}return ae&&ye&&(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{g()},50)),Te.current=[...F],()=>{Y.current&&clearTimeout(Y.current)}},[ne,g,f.isSubmitted,f.submitCount]);let mt=C?.fieldsetToggle||at,Re=`${o}-content`,$e=`${o}-header`;return V("fieldset",{className:_("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${o}`),children:[H("legend",{className:_("text-sm font-semibold px-2",d==="inset"&&"hidden"),children:e}),p?.callToAction&&p?.id&&d==="outset"&&H(ee,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:p.id,children:p.callToAction}),d==="inset"&&V(jt,{children:[V("div",{className:"RemoteFlows__FieldSetField__Header",id:$e,"data-state":k?"expanded":"collapsed","aria-expanded":k,children:[H("h3",{className:_("RemoteFlows__FieldSetField__Title"),children:e}),c?.toggle?.enabled&&H(mt,{isExpanded:k,onToggle:st,"aria-expanded":k,"aria-controls":Re,"aria-label":`${k?"Hide":"Show"} ${e}`,className:_("RemoteFlows__FieldSetField__Toggle",c.toggle?.className),children:k?c.toggle.labels?.collapse??"Remove":c.toggle.labels?.expand??"Define"})]}),p?.callToAction&&p?.id&&H(ee,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:p.id,children:p.callToAction})]}),k&&V("div",{id:Re,"aria-labelledby":$e,role:"region",children:[n?H("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:j(n)}}):null,V("div",{className:"grid gap-4",children:[r.map(F=>{if(F.calculateDynamicProperties&&(F={...F,...F.calculateDynamicProperties(ne,F)||{}}),F.isVisible===!1||F.deprecated)return null;if(F.inputType==="fieldset")return H(lt,{...F,name:`${m?F.name:`${o}.${F.name}`}`,components:l},`${m?F.name:`${o}.${F.name}`}`);if(F.inputType==="fieldset-flat")return H(lt,{...F,name:`${m?F.name:`${o}.${F.name}`}`,components:l,isFlatFieldset:!0},`${m?F.name:`${o}.${F.name}`}`);let X=De[F.inputType];if(F.Component){let{Component:ye}=F;return H(ye,{setValue:ae=>h(m?F.name:`${o}.${F.name}`,ae),...F},F.name)}return X?(F.inputType==="select"&&F.multiple&&(X=De["multi-select"]),V(Xt,{children:[H(X,{...F,name:`${m?F.name:`${o}.${F.name}`}`,component:l?.[F.inputType]}),F.extra?F.extra:null]},`${m?F.name:`${o}.${F.name}`}`)):V("p",{className:"error",children:["Field type ",F.inputType," not supported"]})}),a||null,i?H(nt,{...i}):null]})]})]})}t(lt,"FieldSetField");export{De as a,nt as b,lt as c};
2
- //# sourceMappingURL=chunk-SPMEMAK5.js.map