@remoteoss/remote-flows 0.2.2 → 0.4.0-alpha.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 (257) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-EQBNHLR4.js → chunk-2KK5HDYP.js} +2 -2
  3. package/dist/chunk-2PXGLWCY.js +2 -0
  4. package/dist/chunk-2PXGLWCY.js.map +1 -0
  5. package/dist/{chunk-NBD4VOG3.js → chunk-344TN4EG.js} +2 -2
  6. package/dist/{chunk-AD7ZWPEI.js → chunk-3FVI5JIC.js} +2 -2
  7. package/dist/chunk-4HAR3Z2C.js +2 -0
  8. package/dist/chunk-4HAR3Z2C.js.map +1 -0
  9. package/dist/{chunk-FI76EKUS.js → chunk-56BNVYTD.js} +2 -2
  10. package/dist/chunk-5ETXP2QF.js +2 -0
  11. package/dist/chunk-5ETXP2QF.js.map +1 -0
  12. package/dist/{chunk-YVC4OEFJ.js → chunk-6A3F6JG6.js} +2 -2
  13. package/dist/chunk-6CT35VQR.js +2 -0
  14. package/dist/chunk-6CT35VQR.js.map +1 -0
  15. package/dist/{chunk-OCNLZSS7.js → chunk-7CYG2RHP.js} +2 -2
  16. package/dist/chunk-BKBIALOU.js +2 -0
  17. package/dist/chunk-BKBIALOU.js.map +1 -0
  18. package/dist/chunk-BKROCZRD.js +2 -0
  19. package/dist/chunk-BKROCZRD.js.map +1 -0
  20. package/dist/chunk-BL2HRBUQ.js +2 -0
  21. package/dist/chunk-BL2HRBUQ.js.map +1 -0
  22. package/dist/{chunk-RCX4JUI3.js → chunk-D3XENMEM.js} +2 -2
  23. package/dist/{chunk-IJWDAD54.js → chunk-DGPRFQYK.js} +2 -2
  24. package/dist/chunk-DPKJX4NS.js +2 -0
  25. package/dist/chunk-DPKJX4NS.js.map +1 -0
  26. package/dist/{chunk-NZFES56Y.js → chunk-EAAIAMTY.js} +2 -2
  27. package/dist/{chunk-37DREOGC.js → chunk-FMT2OTOL.js} +2 -2
  28. package/dist/chunk-FNMWKUNJ.js +2 -0
  29. package/dist/chunk-FNMWKUNJ.js.map +1 -0
  30. package/dist/chunk-GFBF55NR.js +2 -0
  31. package/dist/chunk-GFBF55NR.js.map +1 -0
  32. package/dist/{chunk-XEQTLVMV.js → chunk-GMGKIQLI.js} +2 -2
  33. package/dist/chunk-GPICG72A.js +2 -0
  34. package/dist/chunk-GPICG72A.js.map +1 -0
  35. package/dist/chunk-GULCZWSK.js +1 -0
  36. package/dist/chunk-GYSK6CY5.js +2 -0
  37. package/dist/chunk-GYSK6CY5.js.map +1 -0
  38. package/dist/{chunk-SEUQNAF6.js → chunk-HSW5HMHH.js} +2 -2
  39. package/dist/{chunk-N5AQSLAU.js → chunk-IDSJI7KQ.js} +2 -2
  40. package/dist/{chunk-4F7PYKUZ.js → chunk-J55S4SEH.js} +2 -2
  41. package/dist/chunk-J6LUE5K7.js +2 -0
  42. package/dist/chunk-J6LUE5K7.js.map +1 -0
  43. package/dist/chunk-JIBRNWD2.js +2 -0
  44. package/dist/chunk-JIBRNWD2.js.map +1 -0
  45. package/dist/chunk-JWIYUQ5X.js +2 -0
  46. package/dist/chunk-JWIYUQ5X.js.map +1 -0
  47. package/dist/{chunk-J2RINDSC.js → chunk-KH6QS5OU.js} +2 -2
  48. package/dist/{chunk-CKGTR44U.js → chunk-KSGPQCSG.js} +2 -2
  49. package/dist/chunk-M22FKNEY.js +1 -0
  50. package/dist/chunk-M22FKNEY.js.map +1 -0
  51. package/dist/chunk-M5VZBMLC.js +2 -0
  52. package/dist/chunk-M5VZBMLC.js.map +1 -0
  53. package/dist/chunk-M7WCW7WD.js +2 -0
  54. package/dist/chunk-M7WCW7WD.js.map +1 -0
  55. package/dist/{chunk-FCRDQVTB.js → chunk-MESREYTZ.js} +2 -2
  56. package/dist/chunk-MHKNAQLP.js +2 -0
  57. package/dist/chunk-MHKNAQLP.js.map +1 -0
  58. package/dist/{chunk-JLUDKN4H.js → chunk-NFEY2YL6.js} +2 -2
  59. package/dist/{chunk-XULIEA44.js → chunk-QEMICBEY.js} +2 -2
  60. package/dist/chunk-RIAYBN32.js +2 -0
  61. package/dist/chunk-RIAYBN32.js.map +1 -0
  62. package/dist/chunk-RLS4PMWA.js +2 -0
  63. package/dist/chunk-RLS4PMWA.js.map +1 -0
  64. package/dist/chunk-RRFSGYAC.js +2 -0
  65. package/dist/chunk-RRFSGYAC.js.map +1 -0
  66. package/dist/chunk-S4FKLPBB.js +2 -0
  67. package/dist/chunk-S4FKLPBB.js.map +1 -0
  68. package/dist/chunk-SSIHUUZY.js +2 -0
  69. package/dist/chunk-SSIHUUZY.js.map +1 -0
  70. package/dist/{chunk-DOA6BAUQ.js → chunk-WQHKB5T7.js} +2 -2
  71. package/dist/chunk-WS3C3WIJ.js +2 -0
  72. package/dist/chunk-WS3C3WIJ.js.map +1 -0
  73. package/dist/{chunk-CTG3DYJR.js → chunk-WWANHPT7.js} +2 -2
  74. package/dist/{chunk-CTG3DYJR.js.map → chunk-WWANHPT7.js.map} +1 -1
  75. package/dist/chunk-XJMVWJZ4.js +2 -0
  76. package/dist/chunk-XJMVWJZ4.js.map +1 -0
  77. package/dist/{chunk-5DQBY2TR.js → chunk-XLFHHYVS.js} +2 -2
  78. package/dist/chunk-XQ6WWP6K.js +2 -0
  79. package/dist/chunk-XQ6WWP6K.js.map +1 -0
  80. package/dist/chunk-XSHHMBMT.js +2 -0
  81. package/dist/chunk-XSHHMBMT.js.map +1 -0
  82. package/dist/chunk-XVOJ4RMC.js +2 -0
  83. package/dist/chunk-XVOJ4RMC.js.map +1 -0
  84. package/dist/chunk-YDUUQU4R.js +2 -0
  85. package/dist/chunk-YDUUQU4R.js.map +1 -0
  86. package/dist/chunk-YH5F6MGK.js +2 -0
  87. package/dist/chunk-YH5F6MGK.js.map +1 -0
  88. package/dist/{chunk-KPSFJ6BN.js → chunk-YOC3VDC7.js} +2 -2
  89. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  90. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  91. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  92. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +6 -4
  93. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  94. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  95. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  96. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  97. package/dist/flows/ContractAmendment/context.d.ts +3 -1
  98. package/dist/flows/ContractAmendment/hooks.d.ts +3 -1
  99. package/dist/flows/ContractAmendment/hooks.js +1 -1
  100. package/dist/flows/ContractAmendment/index.d.ts +5 -3
  101. package/dist/flows/ContractAmendment/index.js +1 -1
  102. package/dist/flows/ContractAmendment/types.d.ts +6 -5
  103. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  104. package/dist/flows/ContractAmendment/utils.js +1 -1
  105. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  106. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
  107. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  108. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
  109. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  110. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  111. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  112. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  113. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  114. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  115. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  116. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  117. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
  118. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
  119. package/dist/flows/CostCalculator/context.d.ts +1 -1
  120. package/dist/flows/CostCalculator/hooks.d.ts +1 -1
  121. package/dist/flows/CostCalculator/hooks.js +1 -1
  122. package/dist/flows/CostCalculator/index.d.ts +1 -1
  123. package/dist/flows/CostCalculator/index.js +1 -1
  124. package/dist/flows/CostCalculator/types.d.ts +1 -1
  125. package/dist/flows/CostCalculator/utils.d.ts +1 -1
  126. package/dist/flows/CostCalculator/utils.js +1 -1
  127. package/dist/flows/Onboarding/BasicInformationStep.d.ts +15 -0
  128. package/dist/flows/Onboarding/BasicInformationStep.js +2 -0
  129. package/dist/flows/Onboarding/BasicInformationStep.js.map +1 -0
  130. package/dist/flows/Onboarding/BenefitsStep.d.ts +34 -0
  131. package/dist/flows/Onboarding/BenefitsStep.js +2 -0
  132. package/dist/flows/Onboarding/BenefitsStep.js.map +1 -0
  133. package/dist/flows/Onboarding/ContractDetailsStep.d.ts +12 -0
  134. package/dist/flows/Onboarding/ContractDetailsStep.js +2 -0
  135. package/dist/flows/Onboarding/ContractDetailsStep.js.map +1 -0
  136. package/dist/flows/Onboarding/OnboardingBack.d.ts +5 -0
  137. package/dist/flows/Onboarding/OnboardingBack.js +2 -0
  138. package/dist/flows/Onboarding/OnboardingBack.js.map +1 -0
  139. package/dist/flows/Onboarding/OnboardingFlow.d.ts +52 -0
  140. package/dist/flows/Onboarding/OnboardingFlow.js +2 -0
  141. package/dist/flows/Onboarding/OnboardingFlow.js.map +1 -0
  142. package/dist/flows/Onboarding/OnboardingForm.d.ts +19 -0
  143. package/dist/flows/Onboarding/OnboardingForm.js +2 -0
  144. package/dist/flows/Onboarding/OnboardingForm.js.map +1 -0
  145. package/dist/flows/Onboarding/OnboardingInvite.d.ts +11 -0
  146. package/dist/flows/Onboarding/OnboardingInvite.js +2 -0
  147. package/dist/flows/Onboarding/OnboardingInvite.js.map +1 -0
  148. package/dist/flows/Onboarding/OnboardingSubmit.d.ts +5 -0
  149. package/dist/flows/Onboarding/OnboardingSubmit.js +2 -0
  150. package/dist/flows/Onboarding/OnboardingSubmit.js.map +1 -0
  151. package/dist/flows/Onboarding/context.d.ts +81 -0
  152. package/dist/flows/Onboarding/context.js +2 -0
  153. package/dist/flows/Onboarding/context.js.map +1 -0
  154. package/dist/flows/Onboarding/hooks.d.ts +136 -0
  155. package/dist/flows/Onboarding/hooks.js +2 -0
  156. package/dist/flows/Onboarding/hooks.js.map +1 -0
  157. package/dist/flows/Onboarding/index.d.ts +20 -0
  158. package/dist/flows/Onboarding/index.js +2 -0
  159. package/dist/flows/Onboarding/index.js.map +1 -0
  160. package/dist/flows/Onboarding/types.d.ts +31 -0
  161. package/dist/flows/Onboarding/types.js +1 -0
  162. package/dist/flows/Onboarding/types.js.map +1 -0
  163. package/dist/flows/Onboarding/utils.d.ts +8 -0
  164. package/dist/flows/Onboarding/utils.js +2 -0
  165. package/dist/flows/Onboarding/utils.js.map +1 -0
  166. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +13 -0
  167. package/dist/flows/Termination/AdditionalDetailsForm.js +2 -0
  168. package/dist/flows/Termination/AdditionalDetailsForm.js.map +1 -0
  169. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +10 -0
  170. package/dist/flows/Termination/EmployeeComunicationForm.js +2 -0
  171. package/dist/flows/Termination/EmployeeComunicationForm.js.map +1 -0
  172. package/dist/flows/Termination/PaidTimeOffForm.d.ts +10 -0
  173. package/dist/flows/Termination/PaidTimeOffForm.js +2 -0
  174. package/dist/flows/Termination/PaidTimeOffForm.js.map +1 -0
  175. package/dist/flows/Termination/TerminationBack.js +1 -1
  176. package/dist/flows/Termination/TerminationDetailsForm.d.ts +10 -0
  177. package/dist/flows/Termination/TerminationDetailsForm.js +2 -0
  178. package/dist/flows/Termination/TerminationDetailsForm.js.map +1 -0
  179. package/dist/flows/Termination/TerminationFlow.d.ts +19 -10
  180. package/dist/flows/Termination/TerminationFlow.js +1 -1
  181. package/dist/flows/Termination/TerminationForm.d.ts +5 -6
  182. package/dist/flows/Termination/TerminationForm.js +1 -1
  183. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  184. package/dist/flows/Termination/TimeOff.d.ts +1 -1
  185. package/dist/flows/Termination/TimeOff.js +1 -1
  186. package/dist/flows/Termination/context.d.ts +3 -1
  187. package/dist/flows/Termination/hooks.d.ts +12 -1
  188. package/dist/flows/Termination/hooks.js +1 -1
  189. package/dist/flows/Termination/index.d.ts +8 -5
  190. package/dist/flows/Termination/index.js +1 -1
  191. package/dist/flows/Termination/json-schemas/additionalInformation.js +1 -1
  192. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  193. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  194. package/dist/flows/Termination/types.d.ts +1 -1
  195. package/dist/flows/types.d.ts +16 -1
  196. package/dist/flows/utils.d.ts +3 -0
  197. package/dist/index.css +1 -1
  198. package/dist/index.css.map +1 -1
  199. package/dist/index.d.ts +23 -121
  200. package/dist/index.js +1 -1
  201. package/dist/index.js.map +1 -1
  202. package/dist/remoteFlows-CswYencu.d.ts +116 -0
  203. package/dist/types.gen-HC04kr7n.d.ts +947 -0
  204. package/package.json +3 -2
  205. package/dist/chunk-2EKC7DK3.js +0 -2
  206. package/dist/chunk-2EKC7DK3.js.map +0 -1
  207. package/dist/chunk-55VACCVZ.js +0 -2
  208. package/dist/chunk-55VACCVZ.js.map +0 -1
  209. package/dist/chunk-6LTJBLSD.js +0 -2
  210. package/dist/chunk-6LTJBLSD.js.map +0 -1
  211. package/dist/chunk-AYFHWLQZ.js +0 -2
  212. package/dist/chunk-AYFHWLQZ.js.map +0 -1
  213. package/dist/chunk-F5QJZKDL.js +0 -2
  214. package/dist/chunk-F5QJZKDL.js.map +0 -1
  215. package/dist/chunk-FZ7FWFJX.js +0 -1
  216. package/dist/chunk-GW7GG5ZW.js +0 -2
  217. package/dist/chunk-GW7GG5ZW.js.map +0 -1
  218. package/dist/chunk-IJPE22L7.js +0 -2
  219. package/dist/chunk-IJPE22L7.js.map +0 -1
  220. package/dist/chunk-IPJORKYJ.js +0 -2
  221. package/dist/chunk-IPJORKYJ.js.map +0 -1
  222. package/dist/chunk-IPZEZMLD.js +0 -2
  223. package/dist/chunk-IPZEZMLD.js.map +0 -1
  224. package/dist/chunk-SJ56GVNV.js +0 -2
  225. package/dist/chunk-SJ56GVNV.js.map +0 -1
  226. package/dist/chunk-TOSGDMB4.js +0 -2
  227. package/dist/chunk-TOSGDMB4.js.map +0 -1
  228. package/dist/chunk-VHL76MEG.js +0 -2
  229. package/dist/chunk-VHL76MEG.js.map +0 -1
  230. package/dist/chunk-YAHWFLDH.js +0 -2
  231. package/dist/chunk-YAHWFLDH.js.map +0 -1
  232. package/dist/chunk-YBACB5A6.js +0 -2
  233. package/dist/chunk-YBACB5A6.js.map +0 -1
  234. package/dist/types.gen-BgLeTAqP.d.ts +0 -10618
  235. /package/dist/{chunk-EQBNHLR4.js.map → chunk-2KK5HDYP.js.map} +0 -0
  236. /package/dist/{chunk-NBD4VOG3.js.map → chunk-344TN4EG.js.map} +0 -0
  237. /package/dist/{chunk-AD7ZWPEI.js.map → chunk-3FVI5JIC.js.map} +0 -0
  238. /package/dist/{chunk-FI76EKUS.js.map → chunk-56BNVYTD.js.map} +0 -0
  239. /package/dist/{chunk-YVC4OEFJ.js.map → chunk-6A3F6JG6.js.map} +0 -0
  240. /package/dist/{chunk-OCNLZSS7.js.map → chunk-7CYG2RHP.js.map} +0 -0
  241. /package/dist/{chunk-RCX4JUI3.js.map → chunk-D3XENMEM.js.map} +0 -0
  242. /package/dist/{chunk-IJWDAD54.js.map → chunk-DGPRFQYK.js.map} +0 -0
  243. /package/dist/{chunk-NZFES56Y.js.map → chunk-EAAIAMTY.js.map} +0 -0
  244. /package/dist/{chunk-37DREOGC.js.map → chunk-FMT2OTOL.js.map} +0 -0
  245. /package/dist/{chunk-XEQTLVMV.js.map → chunk-GMGKIQLI.js.map} +0 -0
  246. /package/dist/{chunk-FZ7FWFJX.js.map → chunk-GULCZWSK.js.map} +0 -0
  247. /package/dist/{chunk-SEUQNAF6.js.map → chunk-HSW5HMHH.js.map} +0 -0
  248. /package/dist/{chunk-N5AQSLAU.js.map → chunk-IDSJI7KQ.js.map} +0 -0
  249. /package/dist/{chunk-4F7PYKUZ.js.map → chunk-J55S4SEH.js.map} +0 -0
  250. /package/dist/{chunk-J2RINDSC.js.map → chunk-KH6QS5OU.js.map} +0 -0
  251. /package/dist/{chunk-CKGTR44U.js.map → chunk-KSGPQCSG.js.map} +0 -0
  252. /package/dist/{chunk-FCRDQVTB.js.map → chunk-MESREYTZ.js.map} +0 -0
  253. /package/dist/{chunk-JLUDKN4H.js.map → chunk-NFEY2YL6.js.map} +0 -0
  254. /package/dist/{chunk-XULIEA44.js.map → chunk-QEMICBEY.js.map} +0 -0
  255. /package/dist/{chunk-DOA6BAUQ.js.map → chunk-WQHKB5T7.js.map} +0 -0
  256. /package/dist/{chunk-5DQBY2TR.js.map → chunk-XLFHHYVS.js.map} +0 -0
  257. /package/dist/{chunk-KPSFJ6BN.js.map → chunk-YOC3VDC7.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/form/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Field } from '@/src/flows/types';\nimport { $TSFixMe, Fields } from '@remoteoss/json-schema-form';\nimport get from 'lodash/get';\n\nconst textInputTypes = {\n TEXT: 'text',\n TEXTAREA: 'textarea',\n NUMBER: 'number',\n SELECT: 'select',\n COUNTRIES: 'countries',\n TEL: 'tel',\n EMAIL: 'email',\n MONEY: 'money',\n DATE: 'date',\n DATE_RANGE: 'date-range',\n CURRENCIES: 'currencies',\n TIME: 'time',\n} as const;\n\nconst checkboxTypes = {\n CHECKBOX: 'checkbox',\n ACK_CHECK: 'ack-check',\n} as const;\n\nconst supportedTypes = {\n FILE: 'file',\n RADIO: 'radio',\n /** @deprecated */\n RADIO_CARD: 'radio-card',\n GROUP_ARRAY: 'group-array',\n EXTRA: 'extra',\n STATEMENT: 'statement',\n HIDDEN: 'hidden',\n FIELDSET: 'fieldset',\n FIELDSET_FLAT: 'fieldset-flat',\n WORK_SCHEDULE: 'work-schedule',\n WORK_WEEK_SCHEDULE: 'work-week-schedule',\n /** @deprecated we still display benefits in read-only contract details view, but never in any form */\n BENEFITS: 'benefits',\n SIGNATURE: 'signature',\n SELECT_MULTIPLE: 'select-multiple',\n ...textInputTypes,\n ...checkboxTypes,\n} as const;\n\nfunction round(value: number): number {\n return Math.round((value + Number.EPSILON) * 100) / 100;\n}\n\nfunction convertToValidCost(value: string) {\n return parseFloat(value.replace(/,/g, ''));\n}\n\nexport function convertToCents(\n amount?: number | string | string[] | null | boolean,\n) {\n if (\n amount == null ||\n amount === '' ||\n Number.isNaN(amount) ||\n Array.isArray(amount) ||\n typeof amount === 'boolean'\n ) {\n return null;\n }\n\n let validAmount: number;\n\n if (typeof amount === 'string') {\n validAmount = convertToValidCost(amount);\n } else {\n validAmount = amount;\n }\n\n return round(validAmount * 100);\n}\n\nexport function convertFromCents(amount?: number | string | null) {\n if (amount == null || Number.isNaN(amount)) return null;\n\n let normalizedValue: number;\n\n if (typeof amount === 'string') {\n normalizedValue = convertToValidCost(amount || '0');\n } else {\n normalizedValue = amount;\n }\n\n return round(normalizedValue / 100);\n}\n\nconst trimStringValues = (values: Record<string, any>) =>\n Object.entries(values || {}).reduce<Record<string, any>>(\n (result, [key, value]) => {\n if (Array.isArray(value)) {\n // If the value is an array, recursively process each element\n result[key] = value.map((item) =>\n typeof item === 'object' && item !== null\n ? trimStringValues(item)\n : typeof item === 'string'\n ? item.trim()\n : item,\n );\n } else if (typeof value === 'object' && value !== null) {\n // If the value is an object, recursively process it\n result[key] = trimStringValues(value);\n } else {\n // Otherwise, trim the string or keep the value as is\n result[key] = typeof value === 'string' ? value.trim() : value;\n }\n return result;\n },\n {},\n );\n\nfunction convertEmptyStringsToNull(values: Record<string, any>) {\n const result: Record<string, any> = {};\n\n Object.entries(values).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n // If the value is an array, recursively process each element\n result[key] = value.map((item) =>\n typeof item === 'object' && item !== null\n ? convertEmptyStringsToNull(item)\n : item === ''\n ? null\n : item,\n );\n } else if (typeof value === 'object' && value !== null) {\n // If the value is an object, recursively process it\n result[key] = convertEmptyStringsToNull(value);\n } else {\n // Otherwise, convert empty strings to null or keep the value as is\n result[key] = value === '' ? null : value;\n }\n });\n\n return result;\n}\n\n/**\n * Given a list of form values, modify the ones that are readOnly,\n * based on their field config, by adding its defaultValue.\n * This is needed to support readOnly fields that are also conditional\n * based on the \"pivotName\" workaround.\n * @param {Object} values - List with form values { name: value }.\n * @param {Array} fields - Respective form fields configuration.\n */\nfunction prefillReadOnlyFields(values: Record<string, any>, fields: any[]) {\n const newValues: Record<string, any> = {};\n\n fields.forEach((field) => {\n const fieldName = field.name;\n\n if (\n !Object.prototype.hasOwnProperty.call(values, fieldName!) &&\n !(field.type === supportedTypes.FIELDSET && field.valueGroupingDisabled)\n )\n return;\n\n if (field.type === supportedTypes.FIELDSET && field.valueGroupingDisabled) {\n Object.assign(newValues, prefillReadOnlyFields(values, field.fields));\n return;\n }\n\n if (field.readOnly && field.defaultValue) {\n newValues[fieldName!] = field.defaultValue;\n } else {\n newValues[fieldName!] = values[fieldName!];\n }\n });\n\n return newValues;\n}\n/**\n * Recursively extracts fieldsets' fields values and maps them to the field name\n * For nested fields that are fieldsets with valueGroupingDisabled, the values\n * are extracted one level up\n *\n * @param {Array} fields - Fieldset fields configuration.\n * @param {Object} formValues - List with form values { name: value }.\n * @return {Object} – Raw form values mapped to the field name\n */\nfunction extractFieldsetFieldsValues(\n fields: any[],\n formValues: Record<string, unknown>,\n) {\n return fields.reduce<Record<string, any>>((nestedAcc, subField) => {\n const isFieldsetValueGroupingDisabled =\n subField.type === supportedTypes.FIELDSET &&\n subField.valueGroupingDisabled;\n\n if (isFieldsetValueGroupingDisabled) {\n Object.assign(\n nestedAcc,\n extractFieldsetFieldsValues(subField.fields, formValues),\n );\n } else if (\n Object.prototype.hasOwnProperty.call(formValues, subField.name!)\n ) {\n nestedAcc[subField.name!] = formValues[subField.name!];\n }\n\n return nestedAcc;\n }, {});\n}\n\nexport const fieldTypesTransformations: Record<string, any> = {\n [supportedTypes.COUNTRIES]: {\n /**\n *\n * @param {Object} field - Field config that must contain field.countries\n * @param {String[]|String} value - Selected country\n * - Current data (multi): an array of country names - eg: ['Peru', 'Germany']\n * - Legacy data (multi): a string of country names - eg: \"Peru,Germany\"\n * @returns {String[]} Eg [{ label: 'PER', name: 'Peru' }]\n */\n transformValueFromAPI: (field: any) => (value: string) => {\n if (!field.multiple) {\n return value ?? '';\n }\n\n let countryNames;\n\n if (typeof value === 'string') {\n // support legacy data (when the fields were open text fields before)\n countryNames = value.split(',');\n } else {\n countryNames = value || [];\n }\n\n const countryValues = countryNames.map(\n // Return { name: countryName } as fallback to legacy data\n // The \"name\" is used at react-select, to connect to the country flag.\n (countryName) =>\n field.countries?.find?.(\n (country: any) => 'name' in country && country.name === countryName,\n ) || {\n name: countryName,\n },\n );\n\n return countryValues;\n },\n /**\n * @param {String[] | { name: String }[]} value\n * - Excepted: array of strings.\n * - Edge cases: array of objects. (when using dangerousTransformValue)\n * @returns {String[]} - List of countries\n * @example expected: ['Peru', 'Germany'] -> ['Peru', 'Germany']\n * @example edge cases: [{name: 'Peru'}, {name: 'Germany'}] -> ['Peru', 'Germany']\n */\n transformValueToAPI:\n (field: any) => (selectedCountries: string[] | { name: string }[]) => {\n if (!field.multiple || typeof selectedCountries === 'string') {\n return selectedCountries;\n }\n // NOTE: The value should be an array of strings, however legacy data can come as\n // an array of country objects. So, we always send an array of strings to normalize\n // the data (eg old form values being modified) until DB migration is done !5667\n return selectedCountries.map((option) =>\n typeof option === 'string' ? option : option.name,\n );\n },\n /**\n * Used for react-select, where the country selected is transformed\n * before saving on Formik state. Supports both solo and multi select\n * @param {Object|Object[]} selectedCountry[] - Current selected options\n * @param {String} selectedCountry[].value\n * @param {String} selectedCountry[].name\n * @param {String} selectedCountry[].label\n * @returns {String[]} - List of countries selected\n * @example\n * [{ value: 'Hungria' }] -> ['Hungria']\n */\n transformValue: (selectedCountry: any | any[]) => {\n // name or label are used in dragon. value is used in json-schema-form\n // TODO: it should be the same everywhere — read more at !5667\n const getCountryValue = (opt: any) =>\n opt?.name || opt?.value || opt?.label;\n return Array.isArray(selectedCountry)\n ? selectedCountry.map(getCountryValue) // support multi countries\n : getCountryValue(selectedCountry) || ''; // Fallback to '' in case user removes all countries\n },\n },\n [supportedTypes.NUMBER]: {\n transformValueToAPI: () => (value: string) => {\n // this prevents values with letters such as \"2r\" from being considered valid\n // if the input is invalid, number().cast will return NaN\n const castValue = Number(value);\n\n if (Number.isNaN(castValue)) {\n return value;\n }\n\n return castValue;\n },\n },\n [supportedTypes.MONEY]: {\n transformValueFromAPI: () => (value: string | number) =>\n convertFromCents(value) ?? '',\n transformValueToAPI: () => convertToCents,\n },\n [supportedTypes.RADIO]: {\n transformValueToAPI: (field: any) => (value: string) => {\n if (field.transformToBool) {\n return value === 'yes';\n }\n return value;\n },\n },\n [supportedTypes.CHECKBOX]: {\n transformValueToAPI: (field: any) => (value: string | boolean) => {\n if (value === undefined) {\n return false;\n }\n\n if (field.const && value === true) {\n return field.const;\n }\n return value;\n },\n },\n [supportedTypes.SELECT]: {\n /**\n * Used for react-select, where the value is transformed\n * before saving on Formik state.\n * @param {Object | Object[]} option - Object structure with options config\n * @param {String} option[].value - Key for the API\n * @param {Array} this.options[].label - Friendly label\n * @example\n * [{ value: '1', label: 'One' }, { value: '2', label: 'Two' }] -> [\"One\", \"Two\"]\n * { value: '1', label: 'One' } -> \"One\"\n * {} -> \"\"\n */\n transformValue: (option: any | any[]) =>\n Array.isArray(option)\n ? option.map((opt) => opt.value) // multi-options\n : (option?.value ?? ''), // Fallback to '' in case user removes all options,\n },\n};\n\nexport function parseFormValuesToAPI(\n formValues: Record<string, any> = {},\n fields: any[],\n) {\n const filteredFields = fields.filter(\n (field) =>\n formValues[field.name!] ||\n (field.type === supportedTypes.FIELDSET && field.valueGroupingDisabled),\n );\n\n const parsedFormValues = filteredFields.reduce(\n (acc, field) => {\n switch (field.type) {\n case supportedTypes.FIELDSET: {\n const fieldset = field;\n if (fieldset.valueGroupingDisabled) {\n const nestedFormValues = extractFieldsetFieldsValues(\n fieldset.fields,\n formValues,\n );\n\n Object.assign(\n acc,\n parseFormValuesToAPI(nestedFormValues, fieldset.fields),\n );\n } else {\n acc[field.name!] = parseFormValuesToAPI(\n formValues[field.name!],\n fieldset.fields,\n );\n }\n break;\n }\n\n case supportedTypes.TEXTAREA:\n case supportedTypes.TEXT: {\n // Attempt to remove null bytes from form values - https://gitlab.com/remote-com/employ-starbase/tracker/-/issues/10670\n acc[field.name] = formValues[field.name].replace(/\\0/g, '');\n break;\n }\n\n case supportedTypes.GROUP_ARRAY: {\n // NOTE: The field `name` in group arrays represents a path, but we only\n // need the last part of it which is represented by `nameKey`.\n\n const transformedFields = field?.fields?.().map((subField: any) => ({\n ...subField,\n name: subField.nameKey || '',\n }));\n\n // Null check necessary for case where no fields are set due to optional check\n const parsedFieldValues = formValues[field.name]?.map(\n (fieldValues: Record<string, any>) =>\n parseFormValuesToAPI(fieldValues, transformedFields),\n );\n\n acc[field.name] = parsedFieldValues;\n break;\n }\n case supportedTypes.EXTRA: {\n const extraField = field;\n if (extraField.includeValueToApi !== false) {\n const formValue = formValues[extraField.name];\n const fieldTransformValueToAPI =\n extraField?.transformValueToAPI ||\n fieldTypesTransformations[extraField.type]?.transformValueToAPI;\n\n // logErrorOnMissingComplimentaryParams(field);\n\n if (fieldTransformValueToAPI) {\n acc[extraField.name] = fieldTransformValueToAPI(field)(formValue);\n break;\n }\n\n acc[extraField.name] = formValue;\n break;\n }\n acc[extraField.name] = undefined;\n break;\n }\n default: {\n const formValue = formValues[field.name];\n const fieldTransformValueToAPI =\n field?.transformValueToAPI ||\n fieldTypesTransformations[field.type]?.transformValueToAPI;\n // logErrorOnMissingComplimentaryParams(field);\n if (fieldTransformValueToAPI) {\n acc[field.name] = fieldTransformValueToAPI(field)(formValue);\n break;\n }\n acc[field.name] = formValue;\n break;\n }\n }\n\n // this occurs when const === default in a JSON Schema for a given field.\n // without this, values such as money types won't use the correct value.\n if (field.forcedValue !== undefined) {\n acc[field.name!] = field.forcedValue;\n }\n\n return acc;\n },\n { ...formValues },\n );\n\n return parsedFormValues;\n}\n\nfunction isFieldVisible(field: any, formValues: Record<string, unknown>) {\n if (field.visibilityCondition) {\n return field.visibilityCondition(formValues);\n }\n\n if (typeof field.isVisible !== 'undefined') {\n return Boolean(field.isVisible);\n }\n\n return true;\n}\n\nfunction applyFieldDynamicProperties(\n field: any,\n values: Record<string, unknown> | Record<string, unknown>[],\n) {\n if (field.calculateDynamicProperties) {\n return {\n ...field,\n ...(field.calculateDynamicProperties(values) || {}),\n };\n }\n\n return field;\n}\n\nfunction excludeValuesInvisible(\n values: any,\n fields: any[],\n keepTruthyInvisibleValues?: boolean,\n parentFieldKeyPath?: string,\n) {\n const valuesAsked: Record<string, any> = {};\n\n fields\n .map((field) => applyFieldDynamicProperties(field, values))\n .forEach((field) => {\n let fieldKeyPath = field.name;\n if (parentFieldKeyPath) {\n fieldKeyPath = fieldKeyPath\n ? `${parentFieldKeyPath}.${field.name}`\n : parentFieldKeyPath;\n }\n\n const valueOfField = get(values, fieldKeyPath!);\n\n // keepTruthyInvisibleValues: false/undefined -> remove invisible field\n // keepTruthyInvisibleValues: true -> keep invisible field if it has a value\n if (\n !isFieldVisible(field, values) &&\n !(keepTruthyInvisibleValues && !!valueOfField)\n ) {\n return;\n }\n\n if (field.meta?.ignoreValue) {\n return;\n }\n\n if (field.type === 'fieldset' && field.valueGroupingDisabled) {\n Object.assign(\n valuesAsked,\n excludeValuesInvisible(\n values,\n field.fields,\n keepTruthyInvisibleValues,\n fieldKeyPath,\n ),\n );\n } else if (Array.isArray(field.fields)) {\n valuesAsked[field.name!] = excludeValuesInvisible(\n values,\n field.fields,\n keepTruthyInvisibleValues,\n fieldKeyPath,\n );\n } else {\n if (valueOfField === undefined) {\n return;\n }\n valuesAsked[field.name!] = valueOfField;\n }\n });\n\n return valuesAsked;\n}\n\nexport function parseSubmitValues(\n formValues: Record<string, any>,\n fields: any[],\n config?: { keepInvisibleValues?: boolean },\n) {\n const visibleFormValues = config?.keepInvisibleValues\n ? formValues\n : excludeValuesInvisible(formValues, fields);\n const convertedFormValues = parseFormValuesToAPI(visibleFormValues, fields);\n const formValuesWithTrimmedStrings = trimStringValues(convertedFormValues);\n const formValuesWithUndefined = convertEmptyStringsToNull(\n formValuesWithTrimmedStrings,\n );\n const valuesWithReadOnly = prefillReadOnlyFields(\n formValuesWithUndefined,\n fields,\n );\n return valuesWithReadOnly;\n}\n\nexport function parseJSFToValidate(\n formValues: Record<string, any>,\n fields: Fields,\n config: { isPartialValidation: boolean } = {\n isPartialValidation: false,\n },\n) {\n const valuesParsed = parseSubmitValues(formValues, fields, {\n /* We cannot exclude invisible fields (excludeValuesInvisible) because\n they are needed for conditional fields validations */\n keepInvisibleValues: config?.isPartialValidation,\n });\n return valuesParsed;\n}\n\nfunction castFieldTo<T>(field: Field) {\n return field as unknown as T;\n}\n\nfunction getDefaultValueForType(type: string) {\n switch (type) {\n case supportedTypes.FILE:\n return undefined; // Allows fallback values in function declarations to be used\n default:\n return '';\n }\n}\n\nfunction getInitialDefaultValue(\n defaultValues: Record<string, any>,\n field: Field,\n) {\n // lodash get is needed because some values could be nested object, like billing address\n // use camelCase to support forms with fields in snake_case or kebab_case.\n const defaultFieldValue = get(defaultValues, field.name);\n const fieldTransformValueFromAPI =\n field?.transformValueFromAPI ||\n fieldTypesTransformations[field.type]?.transformValueFromAPI;\n\n if (fieldTransformValueFromAPI) {\n return fieldTransformValueFromAPI(field)(defaultFieldValue);\n }\n\n // TODO: We need to get rid of value as fn for json-schema. Related !5560\n const generatedValue =\n typeof field.value === 'function'\n ? field.value(defaultFieldValue, defaultValues)\n : null;\n\n // field.value is deprecated. should use \"default\" instead.\n const defaultValueDeprecated =\n typeof field.value !== 'function' ? field.value : null;\n const initialValueForCheckboxAsBool =\n castFieldTo<$TSFixMe>(field).checkboxValue === true\n ? defaultFieldValue || false\n : null;\n\n // nullish coalescing but excluding empty strings. (to support 0 (zero) as valid numbers)\n const excludeString = (val: any) => (val === '' ? undefined : val);\n\n return (\n excludeString(generatedValue) ??\n excludeString(defaultFieldValue) ??\n excludeString(defaultValueDeprecated) ??\n excludeString(field.default) ??\n initialValueForCheckboxAsBool ??\n getDefaultValueForType(field.type)\n );\n}\n\n/**\n * Get initial values for sub fields within fieldsets\n * @param {Object} field The form field\n * @param {Object} defaultValues The form default values\n * @param {String=} parentFieldKeyPath The path to the parent field using dot-notation\n * @returns {Object} The initial values for a fieldset\n */\nfunction getInitialSubFieldValues(\n field: $TSFixMe,\n defaultValues: Record<string, unknown>,\n parentFieldKeyPath?: string,\n) {\n const initialValue: Record<string, Record<string, unknown>> = {};\n\n let fieldKeyPath = field.name;\n\n if (parentFieldKeyPath) {\n fieldKeyPath = fieldKeyPath\n ? `${parentFieldKeyPath}.${fieldKeyPath}`\n : parentFieldKeyPath;\n }\n\n const subFields = field.fields;\n\n if (Array.isArray(subFields)) {\n const subFieldValues = {};\n\n subFields.forEach((subField) => {\n Object.assign(\n subFieldValues,\n getInitialSubFieldValues(subField, defaultValues, fieldKeyPath),\n );\n });\n\n if (field.type === supportedTypes.FIELDSET && field.valueGroupingDisabled) {\n Object.assign(initialValue, subFieldValues);\n } else {\n initialValue[field.name!] = subFieldValues;\n }\n } else {\n initialValue[field.name!] = getInitialDefaultValue(defaultValues, {\n ...field,\n // NOTE: To utilize the `get` function from `lodash` in `getInitialDefaultValue` correctly\n // we need to use the field path instead of just its name.\n name: fieldKeyPath,\n });\n }\n\n return initialValue;\n}\n\nexport function getInitialValues(\n fields: Fields,\n defaultValues: Record<string, unknown>,\n) {\n const initialValues: Record<string, unknown> = {};\n const defaultFieldValues = defaultValues;\n\n // loop over fields array\n // if prop does not exit in the initialValues object,\n // pluck off the name and value props and add it to the initialValues object;\n fields\n .map((field) => applyFieldDynamicProperties(field, defaultFieldValues))\n .forEach((field) => {\n switch (field.type) {\n case supportedTypes.FIELDSET: {\n if (field.valueGroupingDisabled) {\n Object.assign(\n initialValues,\n getInitialValues(field.fields, defaultFieldValues),\n );\n } else {\n const subFieldValues = getInitialSubFieldValues(\n field,\n defaultFieldValues,\n );\n Object.assign(initialValues, subFieldValues);\n }\n break;\n }\n }\n });\n\n return initialValues;\n}\n"],"mappings":"wCAGA,OAAOA,MAAS,aAEhB,IAAMC,EAAiB,CACrB,KAAM,OACN,SAAU,WACV,OAAQ,SACR,OAAQ,SACR,UAAW,YACX,IAAK,MACL,MAAO,QACP,MAAO,QACP,KAAM,OACN,WAAY,aACZ,WAAY,aACZ,KAAM,MACR,EAEMC,EAAgB,CACpB,SAAU,WACV,UAAW,WACb,EAEMC,EAAiB,CACrB,KAAM,OACN,MAAO,QAEP,WAAY,aACZ,YAAa,cACb,MAAO,QACP,UAAW,YACX,OAAQ,SACR,SAAU,WACV,cAAe,gBACf,cAAe,gBACf,mBAAoB,qBAEpB,SAAU,WACV,UAAW,YACX,gBAAiB,kBACjB,GAAGF,EACH,GAAGC,CACL,EAEA,SAASE,EAAMC,EAAuB,CACpC,OAAO,KAAK,OAAOA,EAAQ,OAAO,SAAW,GAAG,EAAI,GACtD,CAFSC,EAAAF,EAAA,SAIT,SAASG,EAAmBF,EAAe,CACzC,OAAO,WAAWA,EAAM,QAAQ,KAAM,EAAE,CAAC,CAC3C,CAFSC,EAAAC,EAAA,sBAIF,SAASC,EACdC,EACA,CACA,GACEA,GAAU,MACVA,IAAW,IACX,OAAO,MAAMA,CAAM,GACnB,MAAM,QAAQA,CAAM,GACpB,OAAOA,GAAW,UAElB,OAAO,KAGT,IAAIC,EAEJ,OAAI,OAAOD,GAAW,SACpBC,EAAcH,EAAmBE,CAAM,EAEvCC,EAAcD,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AiDT,SAASY,EACPV,EACAD,EACAY,EACA,CACA,IAAMC,EAAwD,CAAC,EAE3DC,EAAeb,EAAM,KAErBW,IACFE,EAAeA,EACX,GAAGF,CAAkB,IAAIE,CAAY,GACrCF,GAGN,IAAMG,EAAYd,EAAM,OAExB,GAAI,MAAM,QAAQc,CAAS,EAAG,CAC5B,IAAMC,EAAiB,CAAC,EAExBD,EAAU,QAASE,GAAa,CAC9B,OAAO,OACLD,EACAL,EAAyBM,EAAUjB,EAAec,CAAY,CAChE,CACF,CAAC,EAEGb,EAAM,OAASJ,EAAe,UAAYI,EAAM,sBAClD,OAAO,OAAOY,EAAcG,CAAc,EAE1CH,EAAaZ,EAAM,IAAK,EAAIe,CAEhC,MACEH,EAAaZ,EAAM,IAAK,EAAIF,EAAuBC,EAAe,CAChE,GAAGC,EAGH,KAAMa,CACR,CAAC,EAGH,OAAOD,CACT,CA1CSf,EAAAa,EAAA,4BA4CF,SAASO,EACdC,EACAnB,EACA,CACA,IAAMoB,EAAyC,CAAC,EAC1CC,EAAqBrB,EAK3B,OAAAmB,EACG,IAAKlB,GAAUqB,EAA4BrB,EAAOoB,CAAkB,CAAC,EACrE,QAASpB,GAAU,CAClB,OAAQA,EAAM,KAAM,CAClB,KAAKJ,EAAe,SAAU,CAC5B,GAAII,EAAM,sBACR,OAAO,OACLmB,EACAF,EAAiBjB,EAAM,OAAQoB,CAAkB,CACnD,MACK,CACL,IAAML,EAAiBL,EACrBV,EACAoB,CACF,EACA,OAAO,OAAOD,EAAeJ,CAAc,CAC7C,CACA,KACF,CACF,CACF,CAAC,EAEII,CACT,CAjCgBtB,EAAAoB,EAAA","names":["get","textInputTypes","checkboxTypes","supportedTypes","round","value","__name","convertToValidCost","convertToCents","amount","validAmount","convertFromCents","normalizedValue","trimStringValues","values","result","key","item","convertEmptyStringsToNull","prefillReadOnlyFields","fields","newValues","field","fieldName","extractFieldsetFieldsValues","formValues","nestedAcc","subField","fieldTypesTransformations","countryNames","countryName","country","selectedCountries","option","selectedCountry","getCountryValue","opt","castValue","parseFormValuesToAPI","acc","fieldset","nestedFormValues","transformedFields","parsedFieldValues","fieldValues","extraField","formValue","fieldTransformValueToAPI","isFieldVisible","applyFieldDynamicProperties","excludeValuesInvisible","keepTruthyInvisibleValues","parentFieldKeyPath","valuesAsked","fieldKeyPath","valueOfField","get","parseSubmitValues","config","visibleFormValues","convertedFormValues","formValuesWithTrimmedStrings","formValuesWithUndefined","parseJSFToValidate","getDefaultValueForType","type","supportedTypes","__name","getInitialDefaultValue","defaultValues","field","defaultFieldValue","get","fieldTransformValueFromAPI","fieldTypesTransformations","generatedValue","defaultValueDeprecated","initialValueForCheckboxAsBool","excludeString","val","getInitialSubFieldValues","parentFieldKeyPath","initialValue","fieldKeyPath","subFields","subFieldValues","subField","getInitialValues","fields","initialValues","defaultFieldValues","applyFieldDynamicProperties"]}
@@ -0,0 +1,2 @@
1
+ import{a as n}from"./chunk-YH5F6MGK.js";import{b as i}from"./chunk-DZYFSFZ7.js";import{a as o}from"./chunk-AYDF3IFZ.js";import e from"react";function l({onSubmit:r}){let{terminationBag:m}=i();return e.createElement(n,{onSubmit:o(async t=>{await r?.(m?.parseFormValues(t)),m?.next()},"handleSubmit")})}o(l,"EmployeeCommunicationForm");export{l as a};
2
+ //# sourceMappingURL=chunk-YDUUQU4R.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/EmployeeComunicationForm.tsx"],"sourcesContent":["import React from 'react';\nimport { useTerminationContext } from './context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { TerminationForm } from '@/src/flows/Termination/TerminationForm';\n\ntype EmployeeComunicationProps = {\n /*\n * The function is called when the form is submitted. It receives the form values as an argument.\n */\n onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;\n};\n\nexport function EmployeeCommunicationForm({\n onSubmit,\n}: EmployeeComunicationProps) {\n const { terminationBag } = useTerminationContext();\n const handleSubmit = async (values: TerminationFormValues) => {\n await onSubmit?.(\n terminationBag?.parseFormValues(values) as TerminationFormValues,\n );\n terminationBag?.next();\n };\n\n return <TerminationForm onSubmit={handleSubmit} />;\n}\n"],"mappings":"wHAAA,OAAOA,MAAW,QAYX,SAASC,EAA0B,CACxC,SAAAC,CACF,EAA8B,CAC5B,GAAM,CAAE,eAAAC,CAAe,EAAIC,EAAsB,EAQjD,OAAOC,EAAA,cAACC,EAAA,CAAgB,SAPHC,EAAA,MAAOC,GAAkC,CAC5D,MAAMN,IACJC,GAAgB,gBAAgBK,CAAM,CACxC,EACAL,GAAgB,KAAK,CACvB,EALqB,gBAO2B,CAClD,CAZgBI,EAAAN,EAAA","names":["React","EmployeeCommunicationForm","onSubmit","terminationBag","useTerminationContext","React","TerminationForm","__name","values"]}
@@ -0,0 +1,2 @@
1
+ import{b as f}from"./chunk-DZYFSFZ7.js";import{a as l}from"./chunk-BKROCZRD.js";import{b as s}from"./chunk-A4RX3KRZ.js";import{a}from"./chunk-IDSJI7KQ.js";import{a as t}from"./chunk-AYDF3IFZ.js";import e,{useEffect as y}from"react";import{useForm as T}from"react-hook-form";function w({fields:m,onSubmit:d}){let{formId:u,terminationBag:o}=f(),F=s(o.handleValidation),i=T({resolver:F,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});y(()=>{let p=i?.watch(r=>{Object.keys(r).some(n=>r[n]!==o?.initialValues?.[n])&&o?.checkFieldUpdates(r)});return()=>p?.unsubscribe()},[]);let c=m||(o?.fields??[]);return e.createElement(a,{...i},e.createElement("form",{id:u,onSubmit:i.handleSubmit(d),className:"space-y-4 RemoteFlows__TerminationForm"},e.createElement(l,{fields:c})))}t(w,"TerminationForm");export{w as a};
2
+ //# sourceMappingURL=chunk-YH5F6MGK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/TerminationForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport React, { useEffect } from 'react';\nimport { useTerminationContext } from './context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\n\ntype TerminationFormProps = {\n onSubmit: (payload: TerminationFormValues) => void;\n fields?: Fields;\n};\n\nexport function TerminationForm({ fields, onSubmit }: TerminationFormProps) {\n const { formId, terminationBag } = useTerminationContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n terminationBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues: terminationBag?.initialValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof TerminationFormValues] !==\n terminationBag?.initialValues?.[key as keyof TerminationFormValues],\n );\n if (isAnyFieldDirty) {\n terminationBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const jsonSchemaFields = fields ? fields : (terminationBag?.fields ?? []);\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(onSubmit)}\n className=\"space-y-4 RemoteFlows__TerminationForm\"\n >\n <JSONSchemaFormFields fields={jsonSchemaFields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"mMAEA,OAAOA,GAAS,aAAAC,MAAiB,QAGjC,OAAS,WAAAC,MAAe,kBASjB,SAASC,EAAgB,CAAE,OAAAC,EAAQ,SAAAC,CAAS,EAAyB,CAC1E,GAAM,CAAE,OAAAC,EAAQ,eAAAC,CAAe,EAAIC,EAAsB,EAEnDC,EAAWC,EAEfH,EAAe,gBACjB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAeF,GAAgB,cAC/B,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDM,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAkC,IACzCT,GAAgB,gBAAgBS,CAAkC,CACtE,GAEET,GAAgB,kBAAkBQ,CAAM,CAE5C,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAmBb,IAAmBG,GAAgB,QAAU,CAAC,GAEvE,OACEW,EAAA,cAACC,EAAA,CAAM,GAAGR,GACRO,EAAA,cAAC,QACC,GAAIZ,EACJ,SAAUK,EAAK,aAAaN,CAAQ,EACpC,UAAU,0CAEVa,EAAA,cAACE,EAAA,CAAqB,OAAQH,EAAkB,CAClD,CACF,CAEJ,CA3CgBI,EAAAlB,EAAA","names":["React","useEffect","useForm","TerminationForm","fields","onSubmit","formId","terminationBag","useTerminationContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","jsonSchemaFields","React","Form","JSONSchemaFormFields","__name"]}
@@ -1,2 +1,2 @@
1
- import{b as n}from"./chunk-DZYFSFZ7.js";import{b as o}from"./chunk-FI76EKUS.js";import{a as t}from"./chunk-AYDF3IFZ.js";import m from"react";function c({children:r,...i}){let{terminationBag:{back:e}}=n();return m.createElement(o,{...i,onClick:()=>{e()}},r)}t(c,"TerminationBack");export{c as a};
2
- //# sourceMappingURL=chunk-KPSFJ6BN.js.map
1
+ import{b as n}from"./chunk-DZYFSFZ7.js";import{b as o}from"./chunk-56BNVYTD.js";import{a as t}from"./chunk-AYDF3IFZ.js";import m from"react";function c({children:r,...i}){let{terminationBag:{back:e}}=n();return m.createElement(o,{...i,onClick:()=>{e()}},r)}t(c,"TerminationBack");export{c as a};
2
+ //# sourceMappingURL=chunk-YOC3VDC7.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-37DREOGC.js";import"../../chunk-FI76EKUS.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentBack};
1
+ import{a}from"../../chunk-FMT2OTOL.js";import"../../chunk-56BNVYTD.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentBack};
2
2
  //# sourceMappingURL=ContractAmendmentBack.js.map
@@ -1,4 +1,4 @@
1
- import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-BgLeTAqP.js';
1
+ import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-HC04kr7n.js';
2
2
  import React__default from 'react';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-IJPE22L7.js";import"../../chunk-N5AQSLAU.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentConfirmationForm};
1
+ import{a}from"../../chunk-GYSK6CY5.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentConfirmationForm};
2
2
  //# sourceMappingURL=ContractAmendmentConfirmationForm.js.map
@@ -5,14 +5,16 @@ import { ContractAmendmentForm } from './ContractAmendmentForm.js';
5
5
  import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
6
6
  import { useContractAmendment } from './hooks.js';
7
7
  import { ContractAmendmentParams } from './types.js';
8
- import '../../types.gen-BgLeTAqP.js';
8
+ import '../../types.gen-HC04kr7n.js';
9
9
  import 'react-hook-form';
10
10
  import '../../mutations-v9H353tz.js';
11
11
  import '@remoteoss/json-schema-form';
12
12
  import '../useStepState.js';
13
+ import '../types.js';
14
+ import '../CostCalculator/types.js';
13
15
 
14
16
  type TUseContractAmendment = ReturnType<typeof useContractAmendment>;
15
- type RenderProps = {
17
+ type ContractAmendmentRenderProps = {
16
18
  /**
17
19
  * The contract amendment bag returned by the useContractAmendment hook.
18
20
  * This bag contains all the methods and properties needed to handle the contract amendment flow.
@@ -34,8 +36,8 @@ type RenderProps = {
34
36
  };
35
37
  };
36
38
  type ContractAmendmentFlowProps = ContractAmendmentParams & {
37
- render: ({ contractAmendmentBag, components, }: RenderProps) => React__default.ReactNode;
39
+ render: ({ contractAmendmentBag, components, }: ContractAmendmentRenderProps) => React__default.ReactNode;
38
40
  };
39
41
  declare function ContractAmendmentFlow({ employmentId, countryCode, options, render, }: ContractAmendmentFlowProps): React__default.JSX.Element;
40
42
 
41
- export { ContractAmendmentFlow, type RenderProps };
43
+ export { ContractAmendmentFlow, type ContractAmendmentRenderProps };
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-2EKC7DK3.js";import"../../chunk-5DQBY2TR.js";import"../../chunk-GW7GG5ZW.js";import"../../chunk-JRQSZHUU.js";import"../../chunk-JLUDKN4H.js";import"../../chunk-RCX4JUI3.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-S56EWAS4.js";import"../../chunk-37DREOGC.js";import"../../chunk-IJPE22L7.js";import"../../chunk-6LTJBLSD.js";import"../../chunk-AYFHWLQZ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-FI76EKUS.js";import"../../chunk-N5AQSLAU.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-4HAR3Z2C.js";import"../../chunk-XLFHHYVS.js";import"../../chunk-SSIHUUZY.js";import"../../chunk-NFEY2YL6.js";import"../../chunk-JRQSZHUU.js";import"../../chunk-D3XENMEM.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-S56EWAS4.js";import"../../chunk-FMT2OTOL.js";import"../../chunk-GYSK6CY5.js";import"../../chunk-J6LUE5K7.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentFlow};
2
2
  //# sourceMappingURL=ContractAmendmentFlow.js.map
@@ -1,4 +1,4 @@
1
- import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-BgLeTAqP.js';
1
+ import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-HC04kr7n.js';
2
2
  import React__default from 'react';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-6LTJBLSD.js";import"../../chunk-AYFHWLQZ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-FI76EKUS.js";import"../../chunk-N5AQSLAU.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-J6LUE5K7.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-5DQBY2TR.js";import"../../chunk-FI76EKUS.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentSubmit};
1
+ import{a}from"../../chunk-XLFHHYVS.js";import"../../chunk-56BNVYTD.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentSubmit};
2
2
  //# sourceMappingURL=ContractAmendmentSubmit.js.map
@@ -1,11 +1,13 @@
1
1
  import { S as SuccessResponse, E as ErrorResponse } from '../../mutations-v9H353tz.js';
2
- import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-BgLeTAqP.js';
2
+ import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-HC04kr7n.js';
3
3
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
4
4
  import * as React from 'react';
5
5
  import * as react_hook_form from 'react-hook-form';
6
6
  import { useContractAmendment } from './hooks.js';
7
7
  import { Step } from '../useStepState.js';
8
8
  import './types.js';
9
+ import '../types.js';
10
+ import '../CostCalculator/types.js';
9
11
 
10
12
  declare const ContractAmendmentContext: React.Context<{
11
13
  formId: string | undefined;
@@ -1,10 +1,12 @@
1
1
  import { S as SuccessResponse, E as ErrorResponse } from '../../mutations-v9H353tz.js';
2
- import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-BgLeTAqP.js';
2
+ import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-HC04kr7n.js';
3
3
  import * as React from 'react';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
5
  import { Step } from '../useStepState.js';
6
6
  import { ContractAmendmentParams } from './types.js';
7
7
  import { FieldValues } from 'react-hook-form';
8
+ import '../types.js';
9
+ import '../CostCalculator/types.js';
8
10
 
9
11
  declare const useContractAmendment: ({ employmentId, countryCode, options, }: ContractAmendmentParams) => {
10
12
  /**
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-GW7GG5ZW.js";import"../../chunk-JRQSZHUU.js";import"../../chunk-JLUDKN4H.js";import"../../chunk-RCX4JUI3.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-S56EWAS4.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-AYDF3IFZ.js";export{a as useContractAmendment};
1
+ import{a}from"../../chunk-SSIHUUZY.js";import"../../chunk-NFEY2YL6.js";import"../../chunk-JRQSZHUU.js";import"../../chunk-D3XENMEM.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-S56EWAS4.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-AYDF3IFZ.js";export{a as useContractAmendment};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -1,13 +1,15 @@
1
1
  export { ContractAmendmentConfirmationForm } from './ContractAmendmentConfirmationForm.js';
2
- export { ContractAmendmentFlow, RenderProps } from './ContractAmendmentFlow.js';
2
+ export { ContractAmendmentFlow, ContractAmendmentRenderProps } from './ContractAmendmentFlow.js';
3
3
  export { ContractAmendmentForm } from './ContractAmendmentForm.js';
4
4
  export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
5
5
  export { useContractAmendment } from './hooks.js';
6
- import '../../types.gen-BgLeTAqP.js';
6
+ import '../../types.gen-HC04kr7n.js';
7
7
  import 'react';
8
8
  import 'react-hook-form';
9
9
  import './ContractAmendmentBack.js';
10
10
  import './types.js';
11
- import '../../mutations-v9H353tz.js';
11
+ import '../types.js';
12
+ import '../CostCalculator/types.js';
12
13
  import '@remoteoss/json-schema-form';
14
+ import '../../mutations-v9H353tz.js';
13
15
  import '../useStepState.js';
@@ -1,2 +1,2 @@
1
- import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-2EKC7DK3.js";import{a as c}from"../../chunk-5DQBY2TR.js";import{a as d}from"../../chunk-GW7GG5ZW.js";import"../../chunk-JRQSZHUU.js";import"../../chunk-JLUDKN4H.js";import"../../chunk-RCX4JUI3.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-S56EWAS4.js";import"../../chunk-37DREOGC.js";import{a}from"../../chunk-IJPE22L7.js";import{a as b}from"../../chunk-6LTJBLSD.js";import"../../chunk-AYFHWLQZ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-FI76EKUS.js";import"../../chunk-N5AQSLAU.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
1
+ import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-4HAR3Z2C.js";import{a as c}from"../../chunk-XLFHHYVS.js";import{a as d}from"../../chunk-SSIHUUZY.js";import"../../chunk-NFEY2YL6.js";import"../../chunk-JRQSZHUU.js";import"../../chunk-D3XENMEM.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-S56EWAS4.js";import"../../chunk-FMT2OTOL.js";import{a}from"../../chunk-GYSK6CY5.js";import{a as b}from"../../chunk-J6LUE5K7.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-6HGUGIYJ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,11 +1,12 @@
1
+ import { FlowOptions } from '../types.js';
2
+ import '../CostCalculator/types.js';
3
+ import '../../types.gen-HC04kr7n.js';
4
+ import '@remoteoss/json-schema-form';
5
+
1
6
  type ContractAmendmentParams = {
2
7
  employmentId: string;
3
8
  countryCode: string;
4
- options?: {
5
- jsfModify?: {
6
- [K in 'fields' | 'allFields' | 'create' | 'pick' | 'orderRoot']?: any;
7
- };
8
- };
9
+ options?: FlowOptions;
9
10
  };
10
11
 
11
12
  export type { ContractAmendmentParams };
@@ -1,4 +1,4 @@
1
- import { E as EmploymentShowResponse } from '../../types.gen-BgLeTAqP.js';
1
+ import { E as EmploymentShowResponse } from '../../types.gen-HC04kr7n.js';
2
2
  import { Fields } from '@remoteoss/json-schema-form';
3
3
  import { Step } from '../useStepState.js';
4
4
  import 'react';
@@ -1,2 +1,2 @@
1
- import{a,b}from"../../chunk-RCX4JUI3.js";import"../../chunk-YBACB5A6.js";import"../../chunk-AYDF3IFZ.js";export{a as STEPS,b as buildInitialValues};
1
+ import{a,b}from"../../chunk-D3XENMEM.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-AYDF3IFZ.js";export{a as STEPS,b as buildInitialValues};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-IJWDAD54.js";import"../../chunk-DYB3RWP7.js";import"../../chunk-FI76EKUS.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorDisclaimer};
1
+ import{a}from"../../chunk-DGPRFQYK.js";import"../../chunk-DYB3RWP7.js";import"../../chunk-56BNVYTD.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorDisclaimer};
2
2
  //# sourceMappingURL=CostCalculatorDisclaimer.js.map
@@ -3,7 +3,7 @@ import { CostCalculatorEstimationOptions, JSFModify } from './types.js';
3
3
  import React__default from 'react';
4
4
  import 'yup';
5
5
  import '@tanstack/react-query';
6
- import '../../types.gen-BgLeTAqP.js';
6
+ import '../../types.gen-HC04kr7n.js';
7
7
  import '../types.js';
8
8
  import '@remoteoss/json-schema-form';
9
9
 
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-F5QJZKDL.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-NBD4VOG3.js";import"../../chunk-UPRUP24B.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorFlow};
1
+ import{a}from"../../chunk-M5VZBMLC.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-344TN4EG.js";import"../../chunk-UPRUP24B.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorFlow};
2
2
  //# sourceMappingURL=CostCalculatorFlow.js.map
@@ -1,4 +1,4 @@
1
- import { c as CostCalculatorEstimateResponse } from '../../types.gen-BgLeTAqP.js';
1
+ import { c as CostCalculatorEstimateResponse } from '../../types.gen-HC04kr7n.js';
2
2
  import { EstimationError } from './hooks.js';
3
3
  import { CostCalculatorEstimationFormValues } from './types.js';
4
4
  import React__default from 'react';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-XULIEA44.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-AYFHWLQZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-FI76EKUS.js";import"../../chunk-N5AQSLAU.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorForm};
1
+ import{a}from"../../chunk-QEMICBEY.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorForm};
2
2
  //# sourceMappingURL=CostCalculatorForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-OCNLZSS7.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-FI76EKUS.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorResetButton};
1
+ import{a}from"../../chunk-7CYG2RHP.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-56BNVYTD.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorResetButton};
2
2
  //# sourceMappingURL=CostCalculatorResetButton.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-NZFES56Y.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-FI76EKUS.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorSubmitButton};
1
+ import{a}from"../../chunk-EAAIAMTY.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-56BNVYTD.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorSubmitButton};
2
2
  //# sourceMappingURL=CostCalculatorSubmitButton.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-J2RINDSC.js";import"../../../chunk-AD7ZWPEI.js";import"../../../chunk-FCRDQVTB.js";import"../../../chunk-FI76EKUS.js";import"../../../chunk-SJ56GVNV.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorBenefitsBreakdown};
1
+ import{a}from"../../../chunk-KH6QS5OU.js";import"../../../chunk-3FVI5JIC.js";import"../../../chunk-MESREYTZ.js";import"../../../chunk-56BNVYTD.js";import"../../../chunk-5ETXP2QF.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorBenefitsBreakdown};
2
2
  //# sourceMappingURL=CostCalculatorBenefitsBreakdown.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-4F7PYKUZ.js";import"../../../chunk-AD7ZWPEI.js";import"../../../chunk-FCRDQVTB.js";import"../../../chunk-FI76EKUS.js";import"../../../chunk-SJ56GVNV.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorContributionsBreakdown};
1
+ import{a}from"../../../chunk-J55S4SEH.js";import"../../../chunk-3FVI5JIC.js";import"../../../chunk-MESREYTZ.js";import"../../../chunk-56BNVYTD.js";import"../../../chunk-5ETXP2QF.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorContributionsBreakdown};
2
2
  //# sourceMappingURL=CostCalculatorContributionsBreakdown.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-YVC4OEFJ.js";import"../../../chunk-FCRDQVTB.js";import"../../../chunk-SJ56GVNV.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorGrossSalary};
1
+ import{a}from"../../../chunk-6A3F6JG6.js";import"../../../chunk-MESREYTZ.js";import"../../../chunk-5ETXP2QF.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorGrossSalary};
2
2
  //# sourceMappingURL=CostCalculatorGrossSalary.js.map
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { c as CostCalculatorEstimateResponse } from '../../../types.gen-BgLeTAqP.js';
2
+ import { c as CostCalculatorEstimateResponse } from '../../../types.gen-HC04kr7n.js';
3
3
 
4
4
  interface CostCalculatorResultProps {
5
5
  employmentData: CostCalculatorEstimateResponse['data'];
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-YAHWFLDH.js";import"../../../chunk-XEQTLVMV.js";import"../../../chunk-DOA6BAUQ.js";import"../../../chunk-J2RINDSC.js";import"../../../chunk-4F7PYKUZ.js";import"../../../chunk-AD7ZWPEI.js";import"../../../chunk-YVC4OEFJ.js";import"../../../chunk-FCRDQVTB.js";import"../../../chunk-FI76EKUS.js";import"../../../chunk-SJ56GVNV.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorResults};
1
+ import{a}from"../../../chunk-S4FKLPBB.js";import"../../../chunk-GMGKIQLI.js";import"../../../chunk-WQHKB5T7.js";import"../../../chunk-KH6QS5OU.js";import"../../../chunk-J55S4SEH.js";import"../../../chunk-3FVI5JIC.js";import"../../../chunk-6A3F6JG6.js";import"../../../chunk-MESREYTZ.js";import"../../../chunk-GFBF55NR.js";import"../../../chunk-56BNVYTD.js";import"../../../chunk-5ETXP2QF.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorResults};
2
2
  //# sourceMappingURL=CostCalculatorResults.js.map
@@ -1,2 +1,2 @@
1
- import{a as l,b as n,c as t,e as d}from"../../../chunk-XEQTLVMV.js";import{b as i}from"../../../chunk-SJ56GVNV.js";import{a as s}from"../../../chunk-AYDF3IFZ.js";import r from"react";import{Cell as u,Pie as C,PieChart as p,ResponsiveContainer as f,Tooltip as v}from"recharts";function c({chartData:o,currency:m}){return r.createElement(l,{className:"rounded-lg RemoteFlows__CostCalculatorResults_CostDistribution"},r.createElement(n,{className:"pb-2"},r.createElement(t,null,"Cost Distribution")),r.createElement(d,null,r.createElement("div",{className:"h-[300px] flex items-center justify-center"},r.createElement(f,{width:"100%",height:"100%"},r.createElement(p,null,r.createElement(C,{data:o,cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",labelLine:!1},o.map((e,a)=>r.createElement(u,{key:`cell-${a}`,fill:e.color}))),r.createElement(v,{formatter:e=>i(Number(e),m),contentStyle:{borderRadius:"var(--radius-md)",border:"1px solid var(--color-border)",fontSize:"var(--text-xs)"}})))),r.createElement("div",{className:"mt-4 space-y-2"},o.map((e,a)=>r.createElement("div",{key:a,className:"flex items-center gap-2"},r.createElement("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),r.createElement("span",{className:"text-sm"},e.name))))))}s(c,"CostCalculatorResultsChart");export{c as default};
1
+ import{a as l,b as n,c as t,e as d}from"../../../chunk-GMGKIQLI.js";import{b as i}from"../../../chunk-5ETXP2QF.js";import{a as s}from"../../../chunk-AYDF3IFZ.js";import r from"react";import{Cell as u,Pie as C,PieChart as p,ResponsiveContainer as f,Tooltip as v}from"recharts";function c({chartData:o,currency:m}){return r.createElement(l,{className:"rounded-lg RemoteFlows__CostCalculatorResults_CostDistribution"},r.createElement(n,{className:"pb-2"},r.createElement(t,null,"Cost Distribution")),r.createElement(d,null,r.createElement("div",{className:"h-[300px] flex items-center justify-center"},r.createElement(f,{width:"100%",height:"100%"},r.createElement(p,null,r.createElement(C,{data:o,cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",labelLine:!1},o.map((e,a)=>r.createElement(u,{key:`cell-${a}`,fill:e.color}))),r.createElement(v,{formatter:e=>i(Number(e),m),contentStyle:{borderRadius:"var(--radius-md)",border:"1px solid var(--color-border)",fontSize:"var(--text-xs)"}})))),r.createElement("div",{className:"mt-4 space-y-2"},o.map((e,a)=>r.createElement("div",{key:a,className:"flex items-center gap-2"},r.createElement("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),r.createElement("span",{className:"text-sm"},e.name))))))}s(c,"CostCalculatorResultsChart");export{c as default};
2
2
  //# sourceMappingURL=CostCalculatorResultsChart.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-DOA6BAUQ.js";import"../../../chunk-SJ56GVNV.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorTotalCost};
1
+ import{a}from"../../../chunk-WQHKB5T7.js";import"../../../chunk-5ETXP2QF.js";import"../../../chunk-AYDF3IFZ.js";export{a as CostCalculatorTotalCost};
2
2
  //# sourceMappingURL=CostCalculatorTotalCost.js.map
@@ -2,7 +2,7 @@ import { Result } from '../types.js';
2
2
  import { useCostCalculator, EstimationError } from './hooks.js';
3
3
  import { CostCalculatorEstimationFormValues } from './types.js';
4
4
  import * as React from 'react';
5
- import { c as CostCalculatorEstimateResponse } from '../../types.gen-BgLeTAqP.js';
5
+ import { c as CostCalculatorEstimateResponse } from '../../types.gen-HC04kr7n.js';
6
6
  import { $TSFixMe } from '@remoteoss/json-schema-form';
7
7
  import * as yup from 'yup';
8
8
  import { UseFormReturn } from 'react-hook-form';
@@ -1,7 +1,7 @@
1
1
  import * as yup from 'yup';
2
2
  import { ValidationError } from 'yup';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
- import { c as CostCalculatorEstimateResponse, d as PostCreateEstimationError, e as CostCalculatorEstimatePdfResponse, f as PostCreateEstimationPdfError, g as CostCalculatorEstimateParams } from '../../types.gen-BgLeTAqP.js';
4
+ import { c as CostCalculatorEstimateResponse, d as PostCreateEstimationError, e as CostCalculatorEstimatePdfResponse, f as PostCreateEstimationPdfError, g as CostCalculatorEstimateParams } from '../../types.gen-HC04kr7n.js';
5
5
  import { CostCalculatorEstimationOptions, JSFModify, CostCalculatorEstimationFormValues } from './types.js';
6
6
  import { Result } from '../types.js';
7
7
  import '@remoteoss/json-schema-form';
@@ -1,2 +1,2 @@
1
- import{c as a,d as b,e as c}from"../../chunk-NBD4VOG3.js";import"../../chunk-UPRUP24B.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-AYDF3IFZ.js";export{b as defaultEstimationOptions,c as useCostCalculator,a as useCostCalculatorEstimationPdf};
1
+ import{c as a,d as b,e as c}from"../../chunk-344TN4EG.js";import"../../chunk-UPRUP24B.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-AYDF3IFZ.js";export{b as defaultEstimationOptions,c as useCostCalculator,a as useCostCalculatorEstimationPdf};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -8,7 +8,7 @@ export { disclaimerData } from './disclaimerUtils.js';
8
8
  export { CostCalculatorResults } from './Results/CostCalculatorResults.js';
9
9
  export { buildPayload as buildCostCalculatorEstimationPayload } from './utils.js';
10
10
  import './types.js';
11
- import '../../types.gen-BgLeTAqP.js';
11
+ import '../../types.gen-HC04kr7n.js';
12
12
  import '@remoteoss/json-schema-form';
13
13
  import 'react';
14
14
  import 'yup';
@@ -1,2 +1,2 @@
1
- import"../../chunk-FGBEOUQK.js";import{a as j}from"../../chunk-YAHWFLDH.js";import"../../chunk-XEQTLVMV.js";import"../../chunk-DOA6BAUQ.js";import"../../chunk-J2RINDSC.js";import"../../chunk-4F7PYKUZ.js";import"../../chunk-AD7ZWPEI.js";import"../../chunk-YVC4OEFJ.js";import"../../chunk-FCRDQVTB.js";import{a as e}from"../../chunk-XULIEA44.js";import{a as g}from"../../chunk-OCNLZSS7.js";import{a as f}from"../../chunk-NZFES56Y.js";import{a as i}from"../../chunk-IJWDAD54.js";import{a as h}from"../../chunk-DYB3RWP7.js";import{a as d}from"../../chunk-F5QJZKDL.js";import"../../chunk-OLJ2S6A6.js";import{b as a,c as b,e as c}from"../../chunk-NBD4VOG3.js";import"../../chunk-UPRUP24B.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-AYFHWLQZ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-FI76EKUS.js";import"../../chunk-N5AQSLAU.js";import"../../chunk-SJ56GVNV.js";import"../../chunk-AYDF3IFZ.js";export{i as CostCalculatorDisclaimer,d as CostCalculatorFlow,e as CostCalculatorForm,g as CostCalculatorResetButton,j as CostCalculatorResults,f as CostCalculatorSubmitButton,a as buildCostCalculatorEstimationPayload,h as disclaimerData,c as useCostCalculator,b as useCostCalculatorEstimationPdf};
1
+ import"../../chunk-FGBEOUQK.js";import{a as j}from"../../chunk-S4FKLPBB.js";import"../../chunk-GMGKIQLI.js";import"../../chunk-WQHKB5T7.js";import"../../chunk-KH6QS5OU.js";import"../../chunk-J55S4SEH.js";import"../../chunk-3FVI5JIC.js";import"../../chunk-6A3F6JG6.js";import"../../chunk-MESREYTZ.js";import{a as e}from"../../chunk-QEMICBEY.js";import{a as g}from"../../chunk-7CYG2RHP.js";import{a as f}from"../../chunk-EAAIAMTY.js";import{a as i}from"../../chunk-DGPRFQYK.js";import{a as h}from"../../chunk-DYB3RWP7.js";import{a as d}from"../../chunk-M5VZBMLC.js";import"../../chunk-OLJ2S6A6.js";import{b as a,c as b,e as c}from"../../chunk-344TN4EG.js";import"../../chunk-UPRUP24B.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{i as CostCalculatorDisclaimer,d as CostCalculatorFlow,e as CostCalculatorForm,g as CostCalculatorResetButton,j as CostCalculatorResults,f as CostCalculatorSubmitButton,a as buildCostCalculatorEstimationPayload,h as disclaimerData,c as useCostCalculator,b as useCostCalculatorEstimationPdf};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { i as EmploymentTermType } from '../../types.gen-BgLeTAqP.js';
1
+ import { h as EmploymentTermType } from '../../types.gen-HC04kr7n.js';
2
2
  import { modify } from '@remoteoss/json-schema-form';
3
3
 
4
4
  type CostCalculatorEstimationFormValues = {
@@ -1,4 +1,4 @@
1
- import { g as CostCalculatorEstimateParams } from '../../types.gen-BgLeTAqP.js';
1
+ import { g as CostCalculatorEstimateParams } from '../../types.gen-HC04kr7n.js';
2
2
  import { $TSFixMe } from '@remoteoss/json-schema-form';
3
3
  import { AnyObjectSchema } from 'yup';
4
4
  import { CostCalculatorEstimationFormValues, CostCalculatorEstimationOptions } from './types.js';
@@ -1,2 +1,2 @@
1
- import{a,b}from"../../chunk-NBD4VOG3.js";import"../../chunk-UPRUP24B.js";import"../../chunk-55VACCVZ.js";import"../../chunk-YBACB5A6.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-AYDF3IFZ.js";export{b as buildPayload,a as buildValidationSchema};
1
+ import{a,b}from"../../chunk-344TN4EG.js";import"../../chunk-UPRUP24B.js";import"../../chunk-FNMWKUNJ.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-AYDF3IFZ.js";export{b as buildPayload,a as buildValidationSchema};
2
2
  //# sourceMappingURL=utils.js.map
@@ -0,0 +1,15 @@
1
+ import React__default from 'react';
2
+ import { BasicInformationFormPayload } from './types.js';
3
+ import { j as EmploymentCreationResponse } from '../../types.gen-HC04kr7n.js';
4
+ import '../types.js';
5
+ import '../CostCalculator/types.js';
6
+ import '@remoteoss/json-schema-form';
7
+
8
+ type BasicInformationStepProps = {
9
+ onSubmit?: (payload: BasicInformationFormPayload) => void | Promise<void>;
10
+ onSuccess?: (data: EmploymentCreationResponse) => void;
11
+ onError?: (error: unknown) => void;
12
+ };
13
+ declare function BasicInformationStep({ onSubmit, onSuccess, onError, }: BasicInformationStepProps): React__default.JSX.Element;
14
+
15
+ export { BasicInformationStep };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-6CT35VQR.js";import"../../chunk-RLS4PMWA.js";import"../../chunk-WS3C3WIJ.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as BasicInformationStep};
2
+ //# sourceMappingURL=BasicInformationStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,34 @@
1
+ import React__default from 'react';
2
+ import { C as Components } from '../../remoteFlows-CswYencu.js';
3
+ import { S as SuccessResponse } from '../../types.gen-HC04kr7n.js';
4
+ import 'react-hook-form';
5
+ import 'yup';
6
+
7
+ type BenefitsPayload = Record<string, unknown>;
8
+ type BenefitsStepProps = {
9
+ components: Components;
10
+ /**
11
+ * Callback function to be called when the benefits form is submitted.
12
+ * It can be used to perform any additional validation or processing before
13
+ * the onboarding moves to the last step.
14
+ * @param values
15
+ * @returns
16
+ */
17
+ onSubmit?: (values: BenefitsPayload) => Promise<void>;
18
+ /**
19
+ * Callback function to be called when the submitting benefits form fails.
20
+ * @param error
21
+ * @returns
22
+ */
23
+ onError?: (error: unknown) => void;
24
+ /**
25
+ * Callback function to be called when benefits form is successfully submitted.
26
+ * This function is called after the submitting benefits form is submitted.
27
+ * @param data
28
+ * @returns
29
+ */
30
+ onSuccess?: (data: SuccessResponse) => void;
31
+ };
32
+ declare function BenefitsStep({ components }: BenefitsStepProps): React__default.JSX.Element;
33
+
34
+ export { BenefitsStep };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-RIAYBN32.js";import"../../chunk-RLS4PMWA.js";import"../../chunk-WS3C3WIJ.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-XVOJ4RMC.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as BenefitsStep};
2
+ //# sourceMappingURL=BenefitsStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,12 @@
1
+ import React__default from 'react';
2
+ import { l as EmploymentResponse } from '../../types.gen-HC04kr7n.js';
3
+
4
+ type ContractDetailsPayload = Record<string, unknown>;
5
+ type ContractDetailsStepProps = {
6
+ onSubmit?: (payload: ContractDetailsPayload) => void | Promise<void>;
7
+ onSuccess?: (response: EmploymentResponse) => void | Promise<void>;
8
+ onError?: (error: unknown) => void;
9
+ };
10
+ declare function ContractDetailsStep({ onSubmit, onError, onSuccess, }: ContractDetailsStepProps): React__default.JSX.Element;
11
+
12
+ export { ContractDetailsStep };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-BKBIALOU.js";import"../../chunk-RLS4PMWA.js";import"../../chunk-WS3C3WIJ.js";import"../../chunk-BKROCZRD.js";import"../../chunk-GFBF55NR.js";import"../../chunk-A4RX3KRZ.js";import"../../chunk-WRDKLT4N.js";import"../../chunk-56BNVYTD.js";import"../../chunk-IDSJI7KQ.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as ContractDetailsStep};
2
+ //# sourceMappingURL=ContractDetailsStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,5 @@
1
+ import React__default, { PropsWithChildren, ButtonHTMLAttributes } from 'react';
2
+
3
+ declare function OnboardingBack({ children, ...props }: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>): React__default.JSX.Element;
4
+
5
+ export { OnboardingBack };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-M7WCW7WD.js";import"../../chunk-WS3C3WIJ.js";import"../../chunk-56BNVYTD.js";import"../../chunk-5ETXP2QF.js";import"../../chunk-AYDF3IFZ.js";export{a as OnboardingBack};
2
+ //# sourceMappingURL=OnboardingBack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}