@remoteoss/remote-flows 0.27.0 → 0.28.1

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 (175) hide show
  1. package/dist/{chunk-ZIPHLBX4.js → chunk-2FKEF3OG.js} +2 -2
  2. package/dist/{chunk-UTBVLDKY.js → chunk-2RZ65777.js} +2 -2
  3. package/dist/{chunk-N3EIN72T.js → chunk-53KVZ4BP.js} +2 -2
  4. package/dist/{chunk-PFT7KJ65.js → chunk-57XKXW6I.js} +2 -2
  5. package/dist/{chunk-XP7UEI56.js → chunk-5MYWJJBQ.js} +2 -2
  6. package/dist/{chunk-RINDVT6U.js → chunk-6IZ6XHVO.js} +2 -2
  7. package/dist/{chunk-4ZGIL6OE.js → chunk-6KIQIVKA.js} +2 -2
  8. package/dist/{chunk-WZAWPSKS.js → chunk-6LJRRFK2.js} +2 -2
  9. package/dist/{chunk-HFI2MD3H.js → chunk-7ELDXUJJ.js} +2 -2
  10. package/dist/{chunk-DZ67OJVF.js → chunk-7LZVUOMP.js} +2 -2
  11. package/dist/{chunk-SB3IYODL.js → chunk-AODV6HT2.js} +2 -2
  12. package/dist/{chunk-LRNSFLHR.js → chunk-AUZWLETL.js} +2 -2
  13. package/dist/{chunk-R64X3EJF.js → chunk-AWDGLK2T.js} +2 -2
  14. package/dist/{chunk-YXWBSRKS.js → chunk-C67CG4QZ.js} +2 -2
  15. package/dist/{chunk-UFBTCHEI.js → chunk-C6B3CVSL.js} +2 -2
  16. package/dist/chunk-DB7ITLRX.js +2 -0
  17. package/dist/chunk-DB7ITLRX.js.map +1 -0
  18. package/dist/{chunk-BMDZJNJV.js → chunk-FHHVVAXP.js} +2 -2
  19. package/dist/{chunk-AYLYOLVG.js → chunk-GWLOE7WJ.js} +2 -2
  20. package/dist/{chunk-BO6OKTIG.js → chunk-IEY4QYMK.js} +2 -2
  21. package/dist/{chunk-FEHSJUZJ.js → chunk-IQKZWU7I.js} +2 -2
  22. package/dist/{chunk-L3C4AHZJ.js → chunk-JHAFMU4Z.js} +2 -2
  23. package/dist/{chunk-QLNFHOLH.js → chunk-JO4722R7.js} +2 -2
  24. package/dist/{chunk-VLLLNIMN.js → chunk-MGVP76ZI.js} +2 -2
  25. package/dist/{chunk-7Y46DL2U.js → chunk-MRPXDND2.js} +2 -2
  26. package/dist/{chunk-LDJT7TII.js → chunk-OU4Y73FX.js} +2 -2
  27. package/dist/{chunk-SA74WAVS.js → chunk-PYKEYPGA.js} +2 -2
  28. package/dist/{chunk-TUFTB5UD.js → chunk-QDYWPG2R.js} +2 -2
  29. package/dist/chunk-QS5KOZM4.js +2 -0
  30. package/dist/{chunk-L6FZRTSN.js → chunk-QTYDDIVO.js} +2 -2
  31. package/dist/chunk-R3DJNVHR.js +2 -0
  32. package/dist/chunk-R3DJNVHR.js.map +1 -0
  33. package/dist/{chunk-E3JFQ7PH.js → chunk-SASLKPFS.js} +2 -2
  34. package/dist/{chunk-ZY5U2UNT.js → chunk-SSLB4VJH.js} +2 -2
  35. package/dist/{chunk-746ELT2W.js → chunk-TFKE327J.js} +2 -2
  36. package/dist/{chunk-NRW33IP5.js → chunk-TM7Q7RHH.js} +2 -2
  37. package/dist/{chunk-R3LY6TV5.js → chunk-UQOWSJ2B.js} +2 -2
  38. package/dist/chunk-VDRNNOVA.js +2 -0
  39. package/dist/chunk-VDRNNOVA.js.map +1 -0
  40. package/dist/{chunk-GD5556B2.js → chunk-VWCJQXCL.js} +2 -2
  41. package/dist/{chunk-A2SWQS2N.js → chunk-WCIJHQMP.js} +2 -2
  42. package/dist/chunk-WKANRAQC.js +2 -0
  43. package/dist/chunk-WKANRAQC.js.map +1 -0
  44. package/dist/chunk-XPKVRYIU.js +2 -0
  45. package/dist/chunk-XPKVRYIU.js.map +1 -0
  46. package/dist/{chunk-RAHCZTQ3.js → chunk-YTCUIISL.js} +2 -2
  47. package/dist/{chunk-WNTOQYRY.js → chunk-ZHMQDRBT.js} +2 -2
  48. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  49. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  50. package/dist/flows/ContractAmendment/index.js +1 -1
  51. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +2 -2
  52. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  53. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +1 -1
  54. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  55. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +2 -2
  56. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  57. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +2 -2
  58. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  59. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +2 -2
  60. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  61. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  62. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +2 -2
  63. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  64. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +1 -1
  65. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  66. package/dist/flows/ContractorOnboarding/context.d.ts +4 -4
  67. package/dist/flows/ContractorOnboarding/hooks.d.ts +2 -2
  68. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  69. package/dist/flows/ContractorOnboarding/index.d.ts +2 -2
  70. package/dist/flows/ContractorOnboarding/index.js +1 -1
  71. package/dist/flows/ContractorOnboarding/types.d.ts +2 -2
  72. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  73. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  74. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  75. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  76. package/dist/flows/CostCalculator/hooks.js +1 -1
  77. package/dist/flows/CostCalculator/index.js +1 -1
  78. package/dist/flows/CostCalculator/utils.js +1 -1
  79. package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
  80. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  81. package/dist/flows/Onboarding/api.d.ts +1 -1
  82. package/dist/flows/Onboarding/api.js +1 -1
  83. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  84. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
  85. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  86. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
  87. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  88. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
  89. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  90. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
  91. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  92. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  93. package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
  94. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
  95. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  96. package/dist/flows/Onboarding/context.d.ts +3 -3
  97. package/dist/flows/Onboarding/hooks.d.ts +1 -1
  98. package/dist/flows/Onboarding/hooks.js +1 -1
  99. package/dist/flows/Onboarding/index.d.ts +1 -1
  100. package/dist/flows/Onboarding/index.js +1 -1
  101. package/dist/flows/Onboarding/types.d.ts +1 -1
  102. package/dist/flows/Onboarding/utils.d.ts +1 -1
  103. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  104. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  105. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  106. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  107. package/dist/flows/Termination/TerminationFlow.js +1 -1
  108. package/dist/flows/Termination/TerminationForm.js +1 -1
  109. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +2 -2
  110. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +2 -2
  111. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +2 -2
  112. package/dist/flows/Termination/hooks.js +1 -1
  113. package/dist/flows/Termination/index.d.ts +2 -2
  114. package/dist/flows/Termination/index.js +1 -1
  115. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +2 -0
  116. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  117. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +1 -0
  118. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  119. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  120. package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +1 -0
  121. package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
  122. package/dist/flows/api.js +1 -1
  123. package/dist/index.d.ts +3 -3
  124. package/dist/index.js +1 -1
  125. package/dist/index.js.map +1 -1
  126. package/dist/{types-1tGveWWg.d.ts → types-B48IQTY-.d.ts} +2 -2
  127. package/dist/{types-DegHPy8Q.d.ts → types-C1II2Ikg.d.ts} +3 -3
  128. package/dist/{types-CwUhT-vz.d.ts → types-pdKQ7fMD.d.ts} +1 -1
  129. package/package.json +1 -1
  130. package/dist/chunk-4T6PRR6R.js +0 -2
  131. package/dist/chunk-4T6PRR6R.js.map +0 -1
  132. package/dist/chunk-GC23RRCI.js +0 -2
  133. package/dist/chunk-GC23RRCI.js.map +0 -1
  134. package/dist/chunk-KOIHMAAP.js +0 -2
  135. package/dist/chunk-LRGEEPGK.js +0 -2
  136. package/dist/chunk-LRGEEPGK.js.map +0 -1
  137. package/dist/chunk-OXCEJQFC.js +0 -2
  138. package/dist/chunk-OXCEJQFC.js.map +0 -1
  139. /package/dist/{chunk-ZIPHLBX4.js.map → chunk-2FKEF3OG.js.map} +0 -0
  140. /package/dist/{chunk-UTBVLDKY.js.map → chunk-2RZ65777.js.map} +0 -0
  141. /package/dist/{chunk-N3EIN72T.js.map → chunk-53KVZ4BP.js.map} +0 -0
  142. /package/dist/{chunk-PFT7KJ65.js.map → chunk-57XKXW6I.js.map} +0 -0
  143. /package/dist/{chunk-XP7UEI56.js.map → chunk-5MYWJJBQ.js.map} +0 -0
  144. /package/dist/{chunk-RINDVT6U.js.map → chunk-6IZ6XHVO.js.map} +0 -0
  145. /package/dist/{chunk-4ZGIL6OE.js.map → chunk-6KIQIVKA.js.map} +0 -0
  146. /package/dist/{chunk-WZAWPSKS.js.map → chunk-6LJRRFK2.js.map} +0 -0
  147. /package/dist/{chunk-HFI2MD3H.js.map → chunk-7ELDXUJJ.js.map} +0 -0
  148. /package/dist/{chunk-DZ67OJVF.js.map → chunk-7LZVUOMP.js.map} +0 -0
  149. /package/dist/{chunk-SB3IYODL.js.map → chunk-AODV6HT2.js.map} +0 -0
  150. /package/dist/{chunk-LRNSFLHR.js.map → chunk-AUZWLETL.js.map} +0 -0
  151. /package/dist/{chunk-R64X3EJF.js.map → chunk-AWDGLK2T.js.map} +0 -0
  152. /package/dist/{chunk-YXWBSRKS.js.map → chunk-C67CG4QZ.js.map} +0 -0
  153. /package/dist/{chunk-UFBTCHEI.js.map → chunk-C6B3CVSL.js.map} +0 -0
  154. /package/dist/{chunk-BMDZJNJV.js.map → chunk-FHHVVAXP.js.map} +0 -0
  155. /package/dist/{chunk-AYLYOLVG.js.map → chunk-GWLOE7WJ.js.map} +0 -0
  156. /package/dist/{chunk-BO6OKTIG.js.map → chunk-IEY4QYMK.js.map} +0 -0
  157. /package/dist/{chunk-FEHSJUZJ.js.map → chunk-IQKZWU7I.js.map} +0 -0
  158. /package/dist/{chunk-L3C4AHZJ.js.map → chunk-JHAFMU4Z.js.map} +0 -0
  159. /package/dist/{chunk-QLNFHOLH.js.map → chunk-JO4722R7.js.map} +0 -0
  160. /package/dist/{chunk-VLLLNIMN.js.map → chunk-MGVP76ZI.js.map} +0 -0
  161. /package/dist/{chunk-7Y46DL2U.js.map → chunk-MRPXDND2.js.map} +0 -0
  162. /package/dist/{chunk-LDJT7TII.js.map → chunk-OU4Y73FX.js.map} +0 -0
  163. /package/dist/{chunk-SA74WAVS.js.map → chunk-PYKEYPGA.js.map} +0 -0
  164. /package/dist/{chunk-TUFTB5UD.js.map → chunk-QDYWPG2R.js.map} +0 -0
  165. /package/dist/{chunk-KOIHMAAP.js.map → chunk-QS5KOZM4.js.map} +0 -0
  166. /package/dist/{chunk-L6FZRTSN.js.map → chunk-QTYDDIVO.js.map} +0 -0
  167. /package/dist/{chunk-E3JFQ7PH.js.map → chunk-SASLKPFS.js.map} +0 -0
  168. /package/dist/{chunk-ZY5U2UNT.js.map → chunk-SSLB4VJH.js.map} +0 -0
  169. /package/dist/{chunk-746ELT2W.js.map → chunk-TFKE327J.js.map} +0 -0
  170. /package/dist/{chunk-NRW33IP5.js.map → chunk-TM7Q7RHH.js.map} +0 -0
  171. /package/dist/{chunk-R3LY6TV5.js.map → chunk-UQOWSJ2B.js.map} +0 -0
  172. /package/dist/{chunk-GD5556B2.js.map → chunk-VWCJQXCL.js.map} +0 -0
  173. /package/dist/{chunk-A2SWQS2N.js.map → chunk-WCIJHQMP.js.map} +0 -0
  174. /package/dist/{chunk-RAHCZTQ3.js.map → chunk-YTCUIISL.js.map} +0 -0
  175. /package/dist/{chunk-WNTOQYRY.js.map → chunk-ZHMQDRBT.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{c as X,d as Z}from"./chunk-FB2QGVI2.js";import{a as $,f as K,h as Y,l as z}from"./chunk-LRGEEPGK.js";import{a as tt,b as et,c as nt,d as ot,e as rt}from"./chunk-BDPCUDJB.js";import{a as at,b as it}from"./chunk-U6RM2N4A.js";import{a as T}from"./chunk-2YTBWEC7.js";import{a as Q}from"./chunk-PJBAQZ6G.js";import{c as f,d as E}from"./chunk-PAQW5BFW.js";import{g as w}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Nt,useMemo as m,useRef as qt,useState as k}from"react";var At={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},xt={employment_basic_information:"basic_information"},te=p(({countryCode:ct,externalId:st,employmentId:y,skipSteps:lt,options:d,initialValues:i})=>{let[r,B]=k(ct||null),[a,mt]=k(y),[M,dt]=k(void 0),v=qt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),ut=lt?.includes("select_country")?it:at,{fieldValues:b,stepState:e,setFieldValues:pt,previousStep:ft,nextStep:yt,goToStep:D,setStepValues:J}=Q(ut),{data:c,isLoading:I,refetch:_t}=$(a),{status:_}=c||{},j=_&&X.includes(_),St=_&&!Z.includes(_),gt=m(()=>_==="invited"?"invited":"not_invited",[_]),N=Y(d),q=ot(),A=et(),{mutateAsync:bt}=T(N),{mutateAsync:Ct}=T(q),{mutateAsync:ht}=T(A);y&&c?.country?.code&&!r&&B(c.country.code);let{selectCountryForm:P,isLoading:Ft}=z({jsfModify:d?.jsfModify?.select_country,jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="select_country"}}),Vt=At[e.currentStep.name]||"contractor_basic_information",Et=xt[Vt],wt=c?.[Et]||{},vt=p(({form:t,options:o={},query:S={}})=>{let g=Object.keys(b).length>0?{...i,...e.values?.[e.currentStep.name],...b}:{...i,...wt};return K({countryCode:r,form:t,fieldValues:g,query:S,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),Pt=!!(r&&(e.currentStep.name==="basic_information"||y)),Ot=!!(r&&(e.currentStep.name==="contract_details"||y)),{data:s,isLoading:Tt}=vt({form:"contractor_basic_information",options:{jsfModify:d?.jsfModify?.basic_information,queryOptions:{enabled:Pt},jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:l,isLoading:Mt}=rt({countryCode:r,fieldValues:b,options:{queryOptions:{enabled:Ot},jsfModify:d?.jsfModify?.contract_details,jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:u}=tt({fieldValues:b,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Dt,isLoading:It}=nt({employmentId:a,contractDocumentId:M,options:{queryOptions:{enabled:!!M}}}),n=m(()=>({select_country:P?.fields||[],basic_information:s?.fields||[],pricing_plan:[],contract_details:l?.fields||[],contract_preview:u?.fields||[],review:[]}),[P?.fields,s?.fields,l?.fields,u?.fields]),jt={select_country:null,basic_information:s?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:l?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Rt,basic_information:x={},contract_details:O={}}=c||{},U=Rt?.code,C=m(()=>E(n.select_country,{country:r||U||""}),[n.select_country,r,U]),h=m(()=>{let t={...i,...x};return E(n.basic_information,t)},[n.basic_information,x,i]),F=m(()=>{let t={...i,...O};return E(n.contract_details,t)},[n.contract_details,O,i]),H=m(()=>{let t={...i,...O};return E(n.contract_preview,t)},[n.contract_preview,O,i]),Lt=m(()=>({select_country:C,basic_information:h,contract_details:F,contract_preview:H,pricing_plan:{}}),[C,h,F,H]),G=m(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Nt(()=>{G&&(v.current={select_country:w(C,n.select_country),basic_information:w(h,n.basic_information),contract_details:w(F,n.contract_details),contract_preview:{},pricing_plan:{}},J({select_country:C,basic_information:h,contract_details:F,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[G,D,C,h,F,J,n.select_country,n.basic_information,n.contract_details]);let kt=p(t=>{D(t)},"goTo"),W=p(t=>P&&e.currentStep.name==="select_country"?t:s&&e.currentStep.name==="basic_information"?f(t,s?.fields,{isPartialValidation:!1}):l&&e.currentStep.name==="contract_details"?f(t,l?.fields,{isPartialValidation:!1}):u&&e.currentStep.name==="contract_preview"?f(t,u?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Bt(t){let o=e.currentStep.name;o in v.current&&(v.current[o]=w(t,n[o]));let S=W(t);switch(e.currentStep.name){case"select_country":return B(S.country),Promise.resolve({data:{countryCode:S.country}});case"basic_information":{let R=!a&&r,g=a&&r&&c?.country&&c?.country.code!==r;if(R||g){let L={basic_information:S,type:"contractor",country_code:r,external_id:st};try{let V=await bt(L),Jt=V.data?.data?.employment?.id;return mt(Jt),V}catch(V){throw console.error("Error creating onboarding:",V),V}}else if(a)return Promise.resolve({data:{employmentId:a}});return}case"contract_details":{let g=await Ct({employmentId:a,payload:{contract_document:S}}),L=g.data?.data?.contract_document?.id;return dt(L),g}case"contract_preview":return ht({employmentId:a,contractDocumentId:M,payload:{signature:t.signature}});case"pricing_plan":return Promise.resolve({data:{pricingPlan:t}});default:throw new Error("Invalid step state")}}return p(Bt,"onSubmit"),{isLoading:Ft||Tt||I||Mt||It,fieldValues:b,stepState:e,checkFieldUpdates:pt,back:ft,next:yt,goTo:kt,onSubmit:Bt,fields:n[e.currentStep.name],meta:{fields:v.current,fieldsets:jt[e.currentStep.name]},parseFormValues:W,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return P.handleValidation(t);if(s&&e.currentStep.name==="basic_information"){let o=f(t,s?.fields,{isPartialValidation:!1});return s?.handleValidation(o)}if(l&&e.currentStep.name==="contract_details"){let o=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(u&&e.currentStep.name==="contract_preview"){let o=f(t,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Lt,employmentId:a,refetchEmployment:_t,isSubmitting:N.isPending||q.isPending||A.isPending,documentPreviewPdf:Dt,canInvite:St,isEmploymentReadOnly:j,invitedStatus:gt,employment:c}},"useContractorOnboarding");export{te as a};
2
- //# sourceMappingURL=chunk-ZY5U2UNT.js.map
1
+ import{c as X,d as Z}from"./chunk-FB2QGVI2.js";import{a as $,f as K,h as Y,l as z}from"./chunk-WKANRAQC.js";import{a as tt,b as et,c as nt,d as ot,e as rt}from"./chunk-BDPCUDJB.js";import{a as at,b as it}from"./chunk-U6RM2N4A.js";import{a as T}from"./chunk-2YTBWEC7.js";import{a as Q}from"./chunk-PJBAQZ6G.js";import{c as f,d as E}from"./chunk-PAQW5BFW.js";import{g as w}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Nt,useMemo as m,useRef as qt,useState as k}from"react";var At={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},xt={employment_basic_information:"basic_information"},te=p(({countryCode:ct,externalId:st,employmentId:y,skipSteps:lt,options:d,initialValues:i})=>{let[r,B]=k(ct||null),[a,mt]=k(y),[M,dt]=k(void 0),v=qt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),ut=lt?.includes("select_country")?it:at,{fieldValues:b,stepState:e,setFieldValues:pt,previousStep:ft,nextStep:yt,goToStep:D,setStepValues:J}=Q(ut),{data:c,isLoading:I,refetch:_t}=$(a),{status:_}=c||{},j=_&&X.includes(_),St=_&&!Z.includes(_),gt=m(()=>_==="invited"?"invited":"not_invited",[_]),N=Y(d),q=ot(),A=et(),{mutateAsync:bt}=T(N),{mutateAsync:Ct}=T(q),{mutateAsync:ht}=T(A);y&&c?.country?.code&&!r&&B(c.country.code);let{selectCountryForm:P,isLoading:Ft}=z({jsfModify:d?.jsfModify?.select_country,jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="select_country"}}),Vt=At[e.currentStep.name]||"contractor_basic_information",Et=xt[Vt],wt=c?.[Et]||{},vt=p(({form:t,options:o={},query:S={}})=>{let g=Object.keys(b).length>0?{...i,...e.values?.[e.currentStep.name],...b}:{...i,...wt};return K({countryCode:r,form:t,fieldValues:g,query:S,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),Pt=!!(r&&(e.currentStep.name==="basic_information"||y)),Ot=!!(r&&(e.currentStep.name==="contract_details"||y)),{data:s,isLoading:Tt}=vt({form:"contractor_basic_information",options:{jsfModify:d?.jsfModify?.basic_information,queryOptions:{enabled:Pt},jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:l,isLoading:Mt}=rt({countryCode:r,fieldValues:b,options:{queryOptions:{enabled:Ot},jsfModify:d?.jsfModify?.contract_details,jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:u}=tt({fieldValues:b,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Dt,isLoading:It}=nt({employmentId:a,contractDocumentId:M,options:{queryOptions:{enabled:!!M}}}),n=m(()=>({select_country:P?.fields||[],basic_information:s?.fields||[],pricing_plan:[],contract_details:l?.fields||[],contract_preview:u?.fields||[],review:[]}),[P?.fields,s?.fields,l?.fields,u?.fields]),jt={select_country:null,basic_information:s?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:l?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Rt,basic_information:x={},contract_details:O={}}=c||{},U=Rt?.code,C=m(()=>E(n.select_country,{country:r||U||""}),[n.select_country,r,U]),h=m(()=>{let t={...i,...x};return E(n.basic_information,t)},[n.basic_information,x,i]),F=m(()=>{let t={...i,...O};return E(n.contract_details,t)},[n.contract_details,O,i]),H=m(()=>{let t={...i,...O};return E(n.contract_preview,t)},[n.contract_preview,O,i]),Lt=m(()=>({select_country:C,basic_information:h,contract_details:F,contract_preview:H,pricing_plan:{}}),[C,h,F,H]),G=m(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Nt(()=>{G&&(v.current={select_country:w(C,n.select_country),basic_information:w(h,n.basic_information),contract_details:w(F,n.contract_details),contract_preview:{},pricing_plan:{}},J({select_country:C,basic_information:h,contract_details:F,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[G,D,C,h,F,J,n.select_country,n.basic_information,n.contract_details]);let kt=p(t=>{D(t)},"goTo"),W=p(t=>P&&e.currentStep.name==="select_country"?t:s&&e.currentStep.name==="basic_information"?f(t,s?.fields,{isPartialValidation:!1}):l&&e.currentStep.name==="contract_details"?f(t,l?.fields,{isPartialValidation:!1}):u&&e.currentStep.name==="contract_preview"?f(t,u?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Bt(t){let o=e.currentStep.name;o in v.current&&(v.current[o]=w(t,n[o]));let S=W(t);switch(e.currentStep.name){case"select_country":return B(S.country),Promise.resolve({data:{countryCode:S.country}});case"basic_information":{let R=!a&&r,g=a&&r&&c?.country&&c?.country.code!==r;if(R||g){let L={basic_information:S,type:"contractor",country_code:r,external_id:st};try{let V=await bt(L),Jt=V.data?.data?.employment?.id;return mt(Jt),V}catch(V){throw console.error("Error creating onboarding:",V),V}}else if(a)return Promise.resolve({data:{employmentId:a}});return}case"contract_details":{let g=await Ct({employmentId:a,payload:{contract_document:S}}),L=g.data?.data?.contract_document?.id;return dt(L),g}case"contract_preview":return ht({employmentId:a,contractDocumentId:M,payload:{signature:t.signature}});case"pricing_plan":return Promise.resolve({data:{pricingPlan:t}});default:throw new Error("Invalid step state")}}return p(Bt,"onSubmit"),{isLoading:Ft||Tt||I||Mt||It,fieldValues:b,stepState:e,checkFieldUpdates:pt,back:ft,next:yt,goTo:kt,onSubmit:Bt,fields:n[e.currentStep.name],meta:{fields:v.current,fieldsets:jt[e.currentStep.name]},parseFormValues:W,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return P.handleValidation(t);if(s&&e.currentStep.name==="basic_information"){let o=f(t,s?.fields,{isPartialValidation:!1});return s?.handleValidation(o)}if(l&&e.currentStep.name==="contract_details"){let o=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(u&&e.currentStep.name==="contract_preview"){let o=f(t,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Lt,employmentId:a,refetchEmployment:_t,isSubmitting:N.isPending||q.isPending||A.isPending,documentPreviewPdf:Dt,canInvite:St,isEmploymentReadOnly:j,invitedStatus:gt,employment:c}},"useContractorOnboarding");export{te as a};
2
+ //# sourceMappingURL=chunk-SSLB4VJH.js.map
@@ -1,2 +1,2 @@
1
- import{a as P}from"./chunk-6IL4TB7S.js";import{a as v}from"./chunk-IWA5B4U6.js";import{a as $}from"./chunk-7VOQAVM4.js";import{a as N}from"./chunk-VM2DQCZO.js";import{a as C}from"./chunk-SLMJEZJ7.js";import{a as w}from"./chunk-E3JFQ7PH.js";import{a as x}from"./chunk-S4XU4SE7.js";import{a as k}from"./chunk-KDUM4EZJ.js";import{a as M}from"./chunk-2YTBWEC7.js";import{a as l,b as S}from"./chunk-ANQ4HVVK.js";import{a as V,b as h}from"./chunk-DZ67OJVF.js";import{a as j}from"./chunk-PJBAQZ6G.js";import{a as F}from"./chunk-Z5WMKCRJ.js";import{c as f}from"./chunk-PAQW5BFW.js";import{a as s}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as W}from"@remoteoss/json-schema-form";import G from"lodash.omitby";import X from"lodash.isnull";import{format as Y}from"date-fns";import{useMemo as I}from"react";import ee from"lodash.omit";import{jsx as b,jsxs as U}from"react/jsx-runtime";function y(t,e,_){return{"x-jsf-presentation":{inputType:"hidden",Component:n(()=>U("div",{className:s("RemoteFlows__InformationStatement",_?.className),children:[b("h3",{className:s("RemoteFlows__InformationStatement__Title"),children:t}),b("p",{className:s("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}n(y,"createInformationField");import{Fragment as oe,jsx as r,jsxs as ne}from"react/jsx-runtime";function ie(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}n(ie,"buildInitialValues");var be=n(({employmentId:t,options:e,initialValues:_})=>{let{fieldValues:T,setFieldValues:R,stepState:a,previousStep:D,nextStep:E}=j(x),{data:p}=k({employmentId:t}),c=ie({...a.values?.employee_communication,...a.values?.termination_details,...a.values?.paid_time_off,...a.values?.additional_information,..._}),u=I(()=>({...a.values?.[a.currentStep.name],...c,...T}),[a.values,a.currentStep.name,T,c]),O=I(()=>({fields:{risk_assesment_info:y("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:y("Proposed termination date",ne(oe,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",r(S,{external:!0,zendeskId:l.terminationNoticePeriods,className:s("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:Y(new Date,"yyyy-MM-dd")}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:n(()=>{let o=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return r(P,{employeeName:p?.basic_information?.name,proposedTerminationDate:u.proposed_termination_date,employmentId:t,employment:p,render:i=>o?r(o,{...i}):r(C,{...i})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:n(()=>{let o=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return r(v,{render:i=>o?r(o,{...i}):r($,{...i})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:n(()=>{let o={involuntaryOffboardingServiceChargeZendeskId:l.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:l.reconciliationInvoice},i=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return i?r(i,{...o}):r(N,{...o})},"Component")}}}}),[e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,p,u.proposed_termination_date,t]),{data:m,isLoading:A}=h({formValues:u,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...O?.fields}},step:a.currentStep.name}),d=W(w.data.schema),g=V(),{mutateAsync:z}=M(g);async function J(o){if(!t)throw new Error("Employment id is missing");if(m){let i=f(o,d.fields,{isPartialValidation:!0}),{customer_informed_employee:L}=i,Z=L==="yes"?{employee_awareness:{date:i.customer_informed_employee_date,note:i.customer_informed_employee_description}}:void 0,q=F(i,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),K=ee(q,"customer_informed_employee_date","customer_informed_employee_description"),Q=G({...K,...Z},X);return z({employment_id:t,termination_details:Q,type:"termination"})}}n(J,"onSubmit");function B(){D()}n(B,"back");function H(){E()}return n(H,"next"),{employmentId:t,stepState:a,fields:m?.fields||[],isLoading:A,isSubmitting:g.isPending,initialValues:c,handleValidation:n(o=>{if(m){let i=f(o,m?.fields);return m?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:n(o=>{if(d){let i=f(o,d?.fields,{isPartialValidation:!0});R(i)}},"checkFieldUpdates"),parseFormValues:n(o=>f(o,d.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:J,back:B,next:H}},"useTermination");export{be as a};
2
- //# sourceMappingURL=chunk-746ELT2W.js.map
1
+ import{a as P}from"./chunk-6IL4TB7S.js";import{a as v}from"./chunk-IWA5B4U6.js";import{a as $}from"./chunk-7VOQAVM4.js";import{a as N}from"./chunk-VM2DQCZO.js";import{a as C}from"./chunk-SLMJEZJ7.js";import{a as w}from"./chunk-SASLKPFS.js";import{a as x}from"./chunk-S4XU4SE7.js";import{a as k}from"./chunk-KDUM4EZJ.js";import{a as M}from"./chunk-2YTBWEC7.js";import{a as l,b as S}from"./chunk-ANQ4HVVK.js";import{a as V,b as h}from"./chunk-7LZVUOMP.js";import{a as j}from"./chunk-PJBAQZ6G.js";import{a as F}from"./chunk-Z5WMKCRJ.js";import{c as f}from"./chunk-PAQW5BFW.js";import{a as s}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as W}from"@remoteoss/json-schema-form";import G from"lodash.omitby";import X from"lodash.isnull";import{format as Y}from"date-fns";import{useMemo as I}from"react";import ee from"lodash.omit";import{jsx as b,jsxs as U}from"react/jsx-runtime";function y(t,e,_){return{"x-jsf-presentation":{inputType:"hidden",Component:n(()=>U("div",{className:s("RemoteFlows__InformationStatement",_?.className),children:[b("h3",{className:s("RemoteFlows__InformationStatement__Title"),children:t}),b("p",{className:s("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}n(y,"createInformationField");import{Fragment as oe,jsx as r,jsxs as ne}from"react/jsx-runtime";function ie(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}n(ie,"buildInitialValues");var be=n(({employmentId:t,options:e,initialValues:_})=>{let{fieldValues:T,setFieldValues:R,stepState:a,previousStep:D,nextStep:E}=j(x),{data:p}=k({employmentId:t}),c=ie({...a.values?.employee_communication,...a.values?.termination_details,...a.values?.paid_time_off,...a.values?.additional_information,..._}),u=I(()=>({...a.values?.[a.currentStep.name],...c,...T}),[a.values,a.currentStep.name,T,c]),O=I(()=>({fields:{risk_assesment_info:y("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:y("Proposed termination date",ne(oe,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",r(S,{external:!0,zendeskId:l.terminationNoticePeriods,className:s("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:Y(new Date,"yyyy-MM-dd")}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:n(()=>{let o=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return r(P,{employeeName:p?.basic_information?.name,proposedTerminationDate:u.proposed_termination_date,employmentId:t,employment:p,render:i=>o?r(o,{...i}):r(C,{...i})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:n(()=>{let o=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return r(v,{render:i=>o?r(o,{...i}):r($,{...i})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:n(()=>{let o={involuntaryOffboardingServiceChargeZendeskId:l.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:l.reconciliationInvoice},i=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return i?r(i,{...o}):r(N,{...o})},"Component")}}}}),[e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,p,u.proposed_termination_date,t]),{data:m,isLoading:A}=h({formValues:u,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...O?.fields}},step:a.currentStep.name}),d=W(w.data.schema),g=V(),{mutateAsync:z}=M(g);async function J(o){if(!t)throw new Error("Employment id is missing");if(m){let i=f(o,d.fields,{isPartialValidation:!0}),{customer_informed_employee:L}=i,Z=L==="yes"?{employee_awareness:{date:i.customer_informed_employee_date,note:i.customer_informed_employee_description}}:void 0,q=F(i,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),K=ee(q,"customer_informed_employee_date","customer_informed_employee_description"),Q=G({...K,...Z},X);return z({employment_id:t,termination_details:Q,type:"termination"})}}n(J,"onSubmit");function B(){D()}n(B,"back");function H(){E()}return n(H,"next"),{employmentId:t,stepState:a,fields:m?.fields||[],isLoading:A,isSubmitting:g.isPending,initialValues:c,handleValidation:n(o=>{if(m){let i=f(o,m?.fields);return m?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:n(o=>{if(d){let i=f(o,d?.fields,{isPartialValidation:!0});R(i)}},"checkFieldUpdates"),parseFormValues:n(o=>f(o,d.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:J,back:B,next:H}},"useTermination");export{be as a};
2
+ //# sourceMappingURL=chunk-TFKE327J.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-TOA3JILU.js";import{b as s}from"./chunk-CFIJKJXD.js";import{a as l}from"./chunk-QLNFHOLH.js";import{f as m,g as d}from"./chunk-CNDSIADP.js";import{a as e}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as p}from"react/jsx-runtime";import{createElement as P}from"react";function B({defaultValues:i,onSubmit:F,components:u}){let{formId:y,contractorOnboardingBag:o}=c(),b=s(o.handleValidation),r=m({resolver:b,defaultValues:i,shouldUnregister:!1,mode:"onBlur"});f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),f(()=>{let n=r?.watch(t=>{Object.keys(t).some(a=>t[a]!==i[a])&&o?.checkFieldUpdates(t)});return()=>n?.unsubscribe()},[]);let g=e(async n=>{F(n)},"handleSubmit");return P(d,{...r,key:`form-${o.stepState.currentStep.name}`},p("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:p(l,{components:u,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}e(B,"ContractorOnboardingForm");export{B as a};
2
- //# sourceMappingURL=chunk-NRW33IP5.js.map
1
+ import{b as c}from"./chunk-TOA3JILU.js";import{b as s}from"./chunk-CFIJKJXD.js";import{a as l}from"./chunk-JO4722R7.js";import{f as m,g as d}from"./chunk-CNDSIADP.js";import{a as e}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as p}from"react/jsx-runtime";import{createElement as P}from"react";function B({defaultValues:i,onSubmit:F,components:u}){let{formId:y,contractorOnboardingBag:o}=c(),b=s(o.handleValidation),r=m({resolver:b,defaultValues:i,shouldUnregister:!1,mode:"onBlur"});f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),f(()=>{let n=r?.watch(t=>{Object.keys(t).some(a=>t[a]!==i[a])&&o?.checkFieldUpdates(t)});return()=>n?.unsubscribe()},[]);let g=e(async n=>{F(n)},"handleSubmit");return P(d,{...r,key:`form-${o.stepState.currentStep.name}`},p("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:p(l,{components:u,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}e(B,"ContractorOnboardingForm");export{B as a};
2
+ //# sourceMappingURL=chunk-TM7Q7RHH.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-7Y46DL2U.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function u({onSubmit:m}){let{terminationBag:i}=n();return a(r,{onSubmit:o(async t=>{await m?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
2
- //# sourceMappingURL=chunk-R3LY6TV5.js.map
1
+ import{a as r}from"./chunk-MRPXDND2.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function u({onSubmit:m}){let{terminationBag:i}=n();return a(r,{onSubmit:o(async t=>{await m?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
2
+ //# sourceMappingURL=chunk-UQOWSJ2B.js.map
@@ -0,0 +1,2 @@
1
+ var o={document:".pdf, .doc, .docx, .xls, .xlsx, .csv"};export{o as a};
2
+ //# sourceMappingURL=chunk-VDRNNOVA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/uploadConfig.ts"],"sourcesContent":["/**\n * As we aren't exposing the api/v1/upload-config to the Remote API this is a temporary solution to get the upload config.\n */\n\nexport const MAX_FILE_SIZE = 20 * 1024 * 1024; // 20MB\n\nexport const FILE_TYPES = {\n document: '.pdf, .doc, .docx, .xls, .xlsx, .csv',\n};\n"],"mappings":"AAMO,IAAMA,EAAa,CACxB,SAAU,sCACZ","names":["FILE_TYPES"]}
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-5KHLOGTR.js";import{a as f}from"./chunk-TUFTB5UD.js";import{a as p}from"./chunk-AYLYOLVG.js";import{a as s}from"./chunk-A2SWQS2N.js";import{a as m}from"./chunk-ZQ6MG635.js";import{a}from"./chunk-RINDVT6U.js";import{a as i}from"./chunk-OIN3HGOQ.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as n}from"./chunk-SB3IYODL.js";import{a as e}from"./chunk-L3C4AHZJ.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
2
- //# sourceMappingURL=chunk-GD5556B2.js.map
1
+ import{a as f}from"./chunk-QDYWPG2R.js";import{a as s}from"./chunk-WCIJHQMP.js";import{a as m}from"./chunk-ZQ6MG635.js";import{a}from"./chunk-6IZ6XHVO.js";import{a as i}from"./chunk-OIN3HGOQ.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-5KHLOGTR.js";import{a as n}from"./chunk-AODV6HT2.js";import{a as p}from"./chunk-GWLOE7WJ.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-JHAFMU4Z.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
2
+ //# sourceMappingURL=chunk-VWCJQXCL.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-XP7UEI56.js";import{b as n}from"./chunk-PGWKJ6FK.js";import{b as i}from"./chunk-2YTBWEC7.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function F({onSubmit:l,onError:t,onSuccess:d}){let{onboardingBag:o}=n(),m=e(async a=>{try{await l?.(o.parseFormValues(a));let r=await o.onSubmit(a);if(r?.data){await d?.(r.data),o?.next();return}if(r?.error){let c=i(r?.fieldErrors||[],o.meta?.fields?.contract_details);t?.({error:r.error,rawError:r.rawError,fieldErrors:c})}}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit");return p(s,{defaultValues:o.stepState.values?.contract_details||o.initialValues.contract_details,onSubmit:m})}e(F,"ContractDetailsStep");export{F as a};
2
- //# sourceMappingURL=chunk-A2SWQS2N.js.map
1
+ import{a as s}from"./chunk-5MYWJJBQ.js";import{b as n}from"./chunk-PGWKJ6FK.js";import{b as i}from"./chunk-2YTBWEC7.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function F({onSubmit:l,onError:t,onSuccess:d}){let{onboardingBag:o}=n(),m=e(async a=>{try{await l?.(o.parseFormValues(a));let r=await o.onSubmit(a);if(r?.data){await d?.(r.data),o?.next();return}if(r?.error){let c=i(r?.fieldErrors||[],o.meta?.fields?.contract_details);t?.({error:r.error,rawError:r.rawError,fieldErrors:c})}}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit");return p(s,{defaultValues:o.stepState.values?.contract_details||o.initialValues.contract_details,onSubmit:m})}e(F,"ContractDetailsStep");export{F as a};
2
+ //# sourceMappingURL=chunk-WCIJHQMP.js.map
@@ -0,0 +1,2 @@
1
+ import{a as R}from"./chunk-WVJDCDGZ.js";import{B as M,E as k,d as F,f as C,i as g,j as S,l as j,n as w,o as v,q as E,t as O,u as q,v as P,x,y as V}from"./chunk-3O3Q24JL.js";import{b as U}from"./chunk-Z5WMKCRJ.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-PAQW5BFW.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as p,modify as d}from"@remoteoss/json-schema-form";import{useMutation as c,useQuery as f}from"@tanstack/react-query";var $=n(t=>{let{client:r}=a();return f({queryKey:["employment",t],retry:!1,enabled:!!t,select:n(({data:e})=>e?.data.employment,"select"),queryFn:n(async()=>{let e=await q({client:r,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn")})},"useEmployment"),ee=n(t=>{let{client:r}=a();return f({queryKey:["company",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let e=await v({client:r,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn"),select:n(({data:e})=>e.data.company,"select")})},"useCompany"),te=n(t=>{let{client:r}=a();return f({queryKey:["benefit-offers",t],retry:!1,enabled:!!t,queryFn:n(async()=>g({client:r,path:{employment_id:t}}).then(e=>{if(e.error||!e.data)throw new Error("Failed to fetch benefit offers data");return e}),"queryFn"),select:n(({data:e})=>e?.data?.reduce((o,s)=>({...o,[s.benefit_group.slug]:{value:s.benefit_tier?.slug??"no",...s.benefit_group?.filter?.slug?{filter:s.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),ne=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>k({client:t,headers:{Authorization:""},path:r}),"mutationFn")})},"useEmploymentInvite"),re=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>w({client:t,body:r}),"mutationFn")})},"useCreateReserveInvoice"),oe=n(({countryCode:t,form:r,fieldValues:e,options:o,query:s={}})=>{let{client:i}=a(),m=o?.jsonSchemaVersion?.form_schema?.[r]?{json_schema_version:o.jsonSchemaVersion.form_schema[r]}:{};return f({queryKey:["onboarding-json-schema-form",t,r],retry:!1,queryFn:n(async()=>{let l=await E({client:i,headers:{Authorization:""},path:{country_code:t,form:r},query:{skip_benefits:!0,...s,...m}});if(l.error||!l.data)throw new Error("Failed to fetch onboarding schema");return l},"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:l})=>{let u=l?.data||{};if(o&&o.jsfModify){let{schema:y}=d(u,o.jsfModify);u=y}let z=U(u.properties||{},"money").reduce((y,_)=>(y[_]=b(e[_]),y),{}),A=JSON.parse(JSON.stringify({...e,...z}));return{meta:{"x-jsf-fieldsets":u["x-jsf-fieldsets"]},...p(u,{initialValues:A})}},"select")})},"useJSONSchemaForm"),se=n((t,r,e)=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:s}=a();return f({queryKey:["benefit-offers-schema",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let i=await O({client:s,path:{employment_id:t},query:o});if(i.error||!i.data)throw new Error("Failed to fetch benefit offers schema");return i},"queryFn"),select:n(({data:i})=>{let m=i?.data?.schema||{};if(e&&e.jsfModify?.benefits){let{schema:h}=d(m,e.jsfModify.benefits);m=h}let l=Object.keys(r).length>0;return p(m,{initialValues:l?{...r}:{}})},"select")})},"useBenefitOffersSchema"),ae=n(t=>{let{client:r}=a(),e=t?.jsonSchemaVersion?.form_schema?.employment_basic_information?{json_schema_version:t.jsonSchemaVersion.form_schema.employment_basic_information}:{};return c({mutationFn:n(o=>C({client:r,headers:{Authorization:""},body:o,query:{...e}}),"mutationFn")})},"useCreateEmployment"),ie=n(t=>{let{client:r}=a(),e={employment_basic_information_json_schema_version:t?.jsonSchemaVersion?.form_schema?.employment_basic_information,employment_contract_details_json_schema_version:t?.jsonSchemaVersion?.form_schema?.contract_details},o=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));return c({mutationFn:n(({employmentId:s,...i})=>P({client:r,headers:{Authorization:""},body:i,path:{employment_id:s},query:{skip_benefits:!0,...o}}),"mutationFn")})},"useUpdateEmployment"),ce=n(t=>{let{client:r}=a();return c({mutationFn:n(({employmentId:e,...o})=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{};return S({client:r,body:o,path:{employment_id:e},query:{...s}})},"mutationFn")})},"useUpdateBenefitsOffers"),me=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>j({client:t,headers:{Authorization:""},body:r}),"mutationFn")})},"useMagicLink"),B=n(t=>{let{client:r}=a();return f({...t,queryKey:["countries"],retry:!1,queryFn:n(async()=>{let e=await V({client:r,headers:{Authorization:""}});if(e.error||!e.data)throw new Error("Failed to fetch supported countries");return e},"queryFn"),select:n(({data:e})=>e?.data?.filter(o=>o.eor_onboarding).map(o=>({label:o.name,value:o.code}))||[],"select")})},"useCountries"),le=n(t=>{let{data:r,isLoading:e}=B(t?.queryOptions),{schema:o}=d(R.data.schema,t?.jsfModify||{}),s=p(o);if(r){let i=s.fields.find(m=>m.name==="country");i&&(i.options=r)}return{isLoading:e,selectCountryForm:s}},"useCountriesSchemaField"),ue=n(({type:t="spread"})=>{let{client:r}=a();return c({mutationFn:n(e=>(t==="no_spread"?F:M)({client:r,body:e}),"mutationFn")})},"useConvertCurrency"),fe=n(()=>{let{client:t}=a();return c({mutationFn:n(({employmentId:r,...e})=>x({client:t,path:{employment_id:r},body:e}),"mutationFn")})},"useUpsertContractEligibility");export{$ as a,ee as b,te as c,ne as d,re as e,oe as f,se as g,ae as h,ie as i,ce as j,me as k,le as l,ue as m,fe as n};
2
+ //# sourceMappingURL=chunk-WKANRAQC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/api.ts"],"sourcesContent":["import {\n ConvertCurrencyParams,\n CreateContractEligibilityParams,\n EmploymentCreateParams,\n EmploymentFullParams,\n getIndexBenefitOffer,\n getShowCompany,\n getShowEmployment,\n getShowFormCountry,\n getShowSchema,\n getSupportedCountry,\n MagicLinkParams,\n patchUpdateEmployment2,\n postConvertRawCurrencyConverter,\n postConvertWithSpreadCurrencyConverter,\n postCreateContractEligibility,\n postCreateEmployment2,\n postCreateRiskReserve,\n postGenerateMagicLink,\n postInviteEmploymentInvitation,\n PostInviteEmploymentInvitationData,\n putUpdateBenefitOffer,\n UnifiedEmploymentUpsertBenefitOffersRequest,\n} from '@/src/client';\nimport { convertToCents } from '@/src/components/form/utils';\nimport { useClient } from '@/src/context';\nimport { selectCountryStepSchema } from '@/src/flows/Onboarding/json-schemas/selectCountryStep';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { FlowOptions, JSONSchemaFormType } from '@/src/flows/types';\nimport { findFieldsByType } from '@/src/flows/utils';\nimport { JSFFieldset } from '@/src/types/remoteFlows';\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { FieldValues } from 'react-hook-form';\n\nexport const useEmployment = (employmentId: string | undefined) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n enabled: !!employmentId,\n select: ({ data }) => {\n return data?.data.employment;\n },\n queryFn: async () => {\n const response = await getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n employment_id: employmentId as string,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n });\n};\n\nexport const useCompany = (companyId: string) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['company', companyId],\n retry: false,\n enabled: !!companyId,\n queryFn: async () => {\n const response = await getShowCompany({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n select: ({ data }) => {\n return data.data.company;\n },\n });\n};\n\nexport const useBenefitOffers = (employmentId: string | undefined) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n return getIndexBenefitOffer({\n client: client as Client,\n path: {\n employment_id: employmentId as string,\n },\n }).then((response) => {\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers data');\n }\n\n return response;\n });\n },\n select: ({ data }) =>\n data?.data?.reduce(\n (acc, item) => {\n return {\n ...acc,\n [item.benefit_group.slug]: {\n value: item.benefit_tier?.slug ?? 'no',\n ...(item.benefit_group?.filter?.slug\n ? { filter: item.benefit_group?.filter?.slug }\n : {}),\n },\n };\n },\n {} as Record<string, { value: string }>,\n ),\n });\n};\n/**\n * Use this hook to invite an employee to the onboarding flow\n * @returns\n */\nexport const useEmploymentInvite = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: PostInviteEmploymentInvitationData['path']) => {\n return postInviteEmploymentInvitation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: payload,\n });\n },\n });\n};\n\nexport const useCreateReserveInvoice = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: { employment_slug: string }) => {\n return postCreateRiskReserve({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Use this hook to get the JSON schema form for the onboarding flow\n * @param param0\n * @returns\n */\nexport const useJSONSchemaForm = ({\n countryCode,\n form,\n fieldValues,\n options,\n query = {},\n}: {\n countryCode: string;\n form: JSONSchemaFormType;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n}) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema?.[form]\n ? {\n json_schema_version: options.jsonSchemaVersion.form_schema[form],\n }\n : {};\n return useQuery({\n queryKey: ['onboarding-json-schema-form', countryCode, form],\n retry: false,\n queryFn: async () => {\n const response = await getShowFormCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n country_code: countryCode,\n form: form,\n },\n query: {\n skip_benefits: true,\n ...query,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch onboarding schema');\n }\n\n return response;\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n let jsfSchema = data?.data || {};\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n\n // Contract details contains x-jsf-logic that need to be calculated every time a form value changes\n // In particular there are calculations involving the annual_gross_salary field. However this field value doesn't get\n // here in cents. So we need to convert the money fields to cents, so that the calculations are correct.\n const moneyFields = findFieldsByType(jsfSchema.properties || {}, 'money');\n const moneyFieldsData = moneyFields.reduce<Record<string, number | null>>(\n (acc, field) => {\n acc[field] = convertToCents(fieldValues[field]);\n return acc;\n },\n {},\n );\n\n const initialValues = JSON.parse(\n JSON.stringify({\n ...fieldValues,\n ...moneyFieldsData,\n }),\n );\n\n return {\n meta: {\n 'x-jsf-fieldsets': jsfSchema['x-jsf-fieldsets'] as JSFFieldset,\n },\n ...createHeadlessForm(jsfSchema, {\n initialValues,\n }),\n };\n },\n });\n};\n\nexport const useBenefitOffersSchema = (\n employmentId: string,\n fieldValues: FieldValues,\n options: OnboardingFlowProps['options'],\n) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers-schema', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n const response = await getShowSchema({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n query: jsonSchemaQueryParam,\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers schema');\n }\n\n return response;\n },\n select: ({ data }) => {\n let jsfSchema = data?.data?.schema || {};\n\n if (options && options.jsfModify?.benefits) {\n const { schema } = modify(jsfSchema, options.jsfModify.benefits);\n jsfSchema = schema;\n }\n const hasFieldValues = Object.keys(fieldValues).length > 0;\n const result = createHeadlessForm(jsfSchema, {\n // we need to clone the fieldValues to prevent side effects\n // if we don't do this, the benefits get included in the other steps\n initialValues: hasFieldValues ? { ...fieldValues } : {},\n });\n return result;\n },\n });\n};\n\n/**\n * Use this hook to create an employment\n * @returns\n */\nexport const useCreateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema\n ?.employment_basic_information\n ? {\n json_schema_version:\n options.jsonSchemaVersion.form_schema.employment_basic_information,\n }\n : {};\n return useMutation({\n mutationFn: (payload: EmploymentCreateParams) => {\n return postCreateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useUpdateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParams = {\n employment_basic_information_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.employment_basic_information,\n employment_contract_details_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.contract_details,\n };\n\n const filteredQueryParams = Object.fromEntries(\n Object.entries(jsonSchemaQueryParams).filter(\n ([, value]) => value !== undefined,\n ),\n );\n\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: EmploymentFullParams & { employmentId: string }) => {\n return patchUpdateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n skip_benefits: true,\n ...filteredQueryParams,\n },\n });\n },\n });\n};\n\nexport const useUpdateBenefitsOffers = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: UnifiedEmploymentUpsertBenefitOffersRequest & {\n employmentId: string;\n }) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n return putUpdateBenefitOffer({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useMagicLink = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (params: MagicLinkParams) => {\n return postGenerateMagicLink({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: params,\n });\n },\n });\n};\n\nconst useCountries = (queryOptions?: { enabled?: boolean }) => {\n const { client } = useClient();\n return useQuery({\n ...queryOptions,\n queryKey: ['countries'],\n retry: false,\n queryFn: async () => {\n const response = await getSupportedCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch supported countries');\n }\n\n return response;\n },\n select: ({ data }) => {\n return (\n data?.data\n ?.filter((country) => country.eor_onboarding)\n .map((country) => {\n return {\n label: country.name,\n value: country.code,\n };\n }) || []\n );\n },\n });\n};\n\nexport const useCountriesSchemaField = (\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } },\n) => {\n const { data: countries, isLoading } = useCountries(options?.queryOptions);\n\n const { schema: selectCountrySchema } = modify(\n selectCountryStepSchema.data.schema,\n options?.jsfModify || {},\n );\n\n const selectCountryForm = createHeadlessForm(selectCountrySchema);\n\n if (countries) {\n const countryField = selectCountryForm.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n }\n }\n\n return {\n isLoading,\n selectCountryForm,\n };\n};\n\nexport const useConvertCurrency = ({\n type = 'spread',\n}: {\n type?: 'spread' | 'no_spread';\n}) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: ConvertCurrencyParams) => {\n const apiFn =\n type === 'no_spread'\n ? postConvertRawCurrencyConverter\n : postConvertWithSpreadCurrencyConverter;\n return apiFn({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useUpsertContractEligibility = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: { employmentId: string } & CreateContractEligibilityParams) => {\n return postCreateContractEligibility({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n body: payload,\n });\n },\n });\n};\n"],"mappings":"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","names":["createHeadlessForm","modify","useMutation","useQuery","useEmployment","__name","employmentId","client","useClient","useQuery","data","response","getShowEmployment","useCompany","companyId","getShowCompany","useBenefitOffers","getIndexBenefitOffer","acc","item","useEmploymentInvite","useMutation","payload","postInviteEmploymentInvitation","useCreateReserveInvoice","postCreateRiskReserve","useJSONSchemaForm","countryCode","form","fieldValues","options","query","jsonSchemaQueryParam","getShowFormCountry","jsfSchema","schema","modify","moneyFieldsData","findFieldsByType","field","convertToCents","initialValues","createHeadlessForm","useBenefitOffersSchema","getShowSchema","hasFieldValues","useCreateEmployment","postCreateEmployment2","useUpdateEmployment","jsonSchemaQueryParams","filteredQueryParams","value","patchUpdateEmployment2","useUpdateBenefitsOffers","putUpdateBenefitOffer","useMagicLink","params","postGenerateMagicLink","useCountries","queryOptions","getSupportedCountry","country","useCountriesSchemaField","countries","isLoading","selectCountrySchema","selectCountryStepSchema","selectCountryForm","countryField","useConvertCurrency","type","postConvertRawCurrencyConverter","postConvertWithSpreadCurrencyConverter","useUpsertContractEligibility","postCreateContractEligibility"]}
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-VDRNNOVA.js";var i={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{agrees_to_pto_amount:{const:"no"}},required:["agrees_to_pto_amount"]},then:{properties:{agrees_to_pto_amount_notes:{type:"string"}},required:["agrees_to_pto_amount_notes"]},else:{properties:{agrees_to_pto_amount_notes:!1,timesheet_file:!1}}}],properties:{timeoff_statement:{type:"null",title:"Timeoff statement","x-jsf-presentation":{inputType:"hidden",statement:{title:"Make sure these paid time off records are correct",description:"You must pay the employee for any unused accrued paid time off, so please check these records carefully.",inputType:"statement",severity:"warning"},meta:{ignoreValue:!0}}},paid_time_off_info:{type:"null",title:"Paid time off info","x-jsf-presentation":{inputType:"hidden"},meta:{ignoreValue:!0}},agrees_to_pto_amount:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Are these paid time off records correct?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},agrees_to_pto_amount_notes:{description:"Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.",maxLength:1e3,title:"Provide time off details",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},timesheet_file:{description:"Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.",title:"Timesheet document",type:["string","null"],"x-jsf-presentation":{inputType:"file",accept:e.document,maxSize:20971520}}},required:["agrees_to_pto_amount"],type:"object","x-jsf-order":["timeoff_statement","paid_time_off_info","agrees_to_pto_amount","agrees_to_pto_amount_notes","timesheet_file"]}}};export{i as a};
2
+ //# sourceMappingURL=chunk-XPKVRYIU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/json-schemas/paidTimeOff.ts"],"sourcesContent":["import { FILE_TYPES, MAX_FILE_SIZE } from '@/src/lib/uploadConfig';\n\nexport const paidTimeOffSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n timeoff_statement: {\n type: 'null',\n title: 'Timeoff statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n statement: {\n title: 'Make sure these paid time off records are correct',\n description:\n 'You must pay the employee for any unused accrued paid time off, so please check these records carefully.',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n paid_time_off_info: {\n type: 'null',\n title: 'Paid time off info',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n meta: {\n ignoreValue: true,\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: FILE_TYPES.document,\n maxSize: MAX_FILE_SIZE, // maxFileSize doesn't seem to work for some reason, found that this was fixed in @remoteoss/json-schema-form v1\n },\n },\n },\n required: ['agrees_to_pto_amount'],\n type: 'object',\n 'x-jsf-order': [\n 'timeoff_statement',\n 'paid_time_off_info',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n ],\n },\n },\n};\n"],"mappings":"wCAEO,IAAMA,EAAoB,CAC/B,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,kBAAmB,CACjB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,UAAW,CACT,MAAO,oDACP,YACE,2GACF,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,mBAAoB,CAClB,KAAM,OACN,MAAO,qBACP,qBAAsB,CACpB,UAAW,QACb,EACA,KAAM,CACJ,YAAa,EACf,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQC,EAAW,SACnB,QAAS,QACX,CACF,CACF,EACA,SAAU,CAAC,sBAAsB,EACjC,KAAM,SACN,cAAe,CACb,oBACA,qBACA,uBACA,6BACA,gBACF,CACF,CACF,CACF","names":["paidTimeOffSchema","FILE_TYPES"]}
@@ -1,2 +1,2 @@
1
- import{a as P}from"./chunk-BCXRPHWY.js";import{a as S}from"./chunk-MQWVZSGH.js";import{a as v}from"./chunk-CVIWZYO3.js";import{a as B}from"./chunk-E6OBNWMU.js";import{a as N}from"./chunk-5NPET4ZO.js";import{a as R}from"./chunk-R645TMO5.js";import{a as x,b as k,c as i}from"./chunk-7R347KBY.js";import{a as h,b as p,c as g,d as w,e as T}from"./chunk-AFRA4BIW.js";import{b as f}from"./chunk-HPHWQU34.js";import{a as b}from"./chunk-43WMZDDH.js";import{a as _}from"./chunk-P37U34EQ.js";import{lazy as L,useState as V}from"react";import{Fragment as I,jsx as a,jsxs as r}from"react/jsx-runtime";var z=L(()=>import("./flows/CostCalculator/Results/CostCalculatorResultsChart.js"));function Y({employmentData:D,options:e}){let[o,E]=V("monthly"),n=D.employments?.[0];if(!n)return null;let t=n.employer_currency_costs,s=t.currency.symbol,m=o==="monthly"?t.monthly_gross_salary:t.annual_gross_salary,u=o==="monthly"?t.monthly_benefits_total:t.annual_benefits_total,y=o==="monthly"?t.monthly_contributions_total:t.annual_contributions_total,F=o==="monthly"?t.monthly_total:t.annual_total,l=o==="monthly"?null:t.extra_statutory_payments_breakdown,A=o==="monthly"?null:t.extra_statutory_payments_total,d=o==="monthly"?t.monthly_indirect_tax:t.annual_indirect_tax,c=o==="monthly"?t.monthly_benefits_breakdown:t.annual_benefits_breakdown,H=o==="monthly"?t.monthly_contributions_breakdown:t.annual_contributions_breakdown,C=[{name:"Gross Salary",value:m,color:e?.chartColors?.grossSalary??"#3b82f6"},{name:"Contributions",value:y,color:e?.chartColors?.contributions??"#f59e0b"}];return c&&C.push({name:"Benefits",value:u??0,color:e?.chartColors?.benefits??"#10b981"}),r(I,{children:[r("div",{className:"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults",children:[r("div",{className:"RemoteFlows__CostCalculatorResults__Header",children:[r("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[a("span",{className:"flex items-center gap-1",children:e?.title??"Cost Calculator"}),a(f,{className:"ml-2",children:n.country.name})]}),a("p",{className:"text-primary-foreground font-medium mt-1",children:e?.description??`Total cost of employment in ${n.country.name}`})]}),a(x,{value:o,onValueChange:G=>E(G),className:"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs",children:r(k,{className:"grid w-full md:w-[200px] grid-cols-2",children:[a(i,{value:"monthly",children:"Monthly"}),a(i,{value:"annual",children:"Annual"})]})})]}),r("div",{className:b("grid grid-cols-1 gap-6",e?.showChart?"md:grid-cols-3":"","RemoteFlows__CostCalculatorResults_CostBreakdown"),children:[r(h,{className:"md:col-span-2 rounded-lg",children:[r(p,{className:"pb-2",children:[a(g,{children:"Cost Breakdown"}),a(w,{children:"Detailed breakdown of all employer costs"})]}),a(T,{children:r("div",{className:"space-y-6",children:[a(R,{grossSalary:m,currency:s,hasExtraStatutoryPayment:n.has_extra_statutory_payment}),c?a(v,{benefitsBreakdown:c,benefitsTotal:u,currency:s}):null,a(B,{contributionsBreakdown:H,contributionsTotal:y,currency:s}),Array.isArray(l)&&l.length>0?a(N,{extraStatutoryPaymentsBreakdown:l,extraStatutoryPaymentsTotal:A,currency:s}):null,d?a(P,{indirectTax:d,currency:s}):null,a(S,{totalCost:F,currency:s})]})})]}),e?.showChart&&a(z,{chartData:C,currency:s})]})]})}_(Y,"CostCalculatorResults");export{Y as a};
2
- //# sourceMappingURL=chunk-RAHCZTQ3.js.map
1
+ import{a as R}from"./chunk-R645TMO5.js";import{a as P}from"./chunk-BCXRPHWY.js";import{a as S}from"./chunk-MQWVZSGH.js";import{a as v}from"./chunk-CVIWZYO3.js";import{a as B}from"./chunk-E6OBNWMU.js";import{a as N}from"./chunk-5NPET4ZO.js";import{a as x,b as k,c as i}from"./chunk-7R347KBY.js";import{a as h,b as p,c as g,d as w,e as T}from"./chunk-AFRA4BIW.js";import{b as f}from"./chunk-HPHWQU34.js";import{a as b}from"./chunk-43WMZDDH.js";import{a as _}from"./chunk-P37U34EQ.js";import{lazy as L,useState as V}from"react";import{Fragment as I,jsx as a,jsxs as r}from"react/jsx-runtime";var z=L(()=>import("./flows/CostCalculator/Results/CostCalculatorResultsChart.js"));function Y({employmentData:D,options:e}){let[o,E]=V("monthly"),n=D.employments?.[0];if(!n)return null;let t=n.employer_currency_costs,s=t.currency.symbol,m=o==="monthly"?t.monthly_gross_salary:t.annual_gross_salary,u=o==="monthly"?t.monthly_benefits_total:t.annual_benefits_total,y=o==="monthly"?t.monthly_contributions_total:t.annual_contributions_total,F=o==="monthly"?t.monthly_total:t.annual_total,l=o==="monthly"?null:t.extra_statutory_payments_breakdown,A=o==="monthly"?null:t.extra_statutory_payments_total,d=o==="monthly"?t.monthly_indirect_tax:t.annual_indirect_tax,c=o==="monthly"?t.monthly_benefits_breakdown:t.annual_benefits_breakdown,H=o==="monthly"?t.monthly_contributions_breakdown:t.annual_contributions_breakdown,C=[{name:"Gross Salary",value:m,color:e?.chartColors?.grossSalary??"#3b82f6"},{name:"Contributions",value:y,color:e?.chartColors?.contributions??"#f59e0b"}];return c&&C.push({name:"Benefits",value:u??0,color:e?.chartColors?.benefits??"#10b981"}),r(I,{children:[r("div",{className:"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults",children:[r("div",{className:"RemoteFlows__CostCalculatorResults__Header",children:[r("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[a("span",{className:"flex items-center gap-1",children:e?.title??"Cost Calculator"}),a(f,{className:"ml-2",children:n.country.name})]}),a("p",{className:"text-primary-foreground font-medium mt-1",children:e?.description??`Total cost of employment in ${n.country.name}`})]}),a(x,{value:o,onValueChange:G=>E(G),className:"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs",children:r(k,{className:"grid w-full md:w-[200px] grid-cols-2",children:[a(i,{value:"monthly",children:"Monthly"}),a(i,{value:"annual",children:"Annual"})]})})]}),r("div",{className:b("grid grid-cols-1 gap-6",e?.showChart?"md:grid-cols-3":"","RemoteFlows__CostCalculatorResults_CostBreakdown"),children:[r(h,{className:"md:col-span-2 rounded-lg",children:[r(p,{className:"pb-2",children:[a(g,{children:"Cost Breakdown"}),a(w,{children:"Detailed breakdown of all employer costs"})]}),a(T,{children:r("div",{className:"space-y-6",children:[a(R,{grossSalary:m,currency:s,hasExtraStatutoryPayment:n.has_extra_statutory_payment}),c?a(v,{benefitsBreakdown:c,benefitsTotal:u,currency:s}):null,a(B,{contributionsBreakdown:H,contributionsTotal:y,currency:s}),Array.isArray(l)&&l.length>0?a(N,{extraStatutoryPaymentsBreakdown:l,extraStatutoryPaymentsTotal:A,currency:s}):null,d?a(P,{indirectTax:d,currency:s}):null,a(S,{totalCost:F,currency:s})]})})]}),e?.showChart&&a(z,{chartData:C,currency:s})]})]})}_(Y,"CostCalculatorResults");export{Y as a};
2
+ //# sourceMappingURL=chunk-YTCUIISL.js.map
@@ -1,2 +1,2 @@
1
- import{a as X}from"./chunk-UFBTCHEI.js";import{a as G}from"./chunk-VFRHMNLJ.js";import{a as I,b as z,c as Q,f as W}from"./chunk-RC3XP5WU.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as K}from"./chunk-CFIJKJXD.js";import{c as Y}from"./chunk-OXCEJQFC.js";import{a as Z}from"./chunk-2YTBWEC7.js";import{c as V}from"./chunk-PAQW5BFW.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Te,object as oe}from"yup";import{createHeadlessForm as Ve,modify as je}from"@remoteoss/json-schema-form";import{useCallback as Re,useEffect as ee,useMemo as Pe,useRef as we,useState as j}from"react";import{string as te,ValidationError as ne}from"yup";import{jsx as re}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},xe=o(t=>{let{schema:i}=je(G.data.schema,t?.jsfModify||{});return Ve(i)},"useStaticSchema");function Be(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(Be,"getSalaryTitle");var Qe=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let c=we({fields:{}}),[k,E]=j(t),[R,P]=j(),[m,q]=j(),[H,se]=j(),{data:_,isLoading:le}=I({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=z(),ue=k||R?.value,{data:w,isLoading:me}=W(ue,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=Q(),{mutateAsync:de}=Z(U),b=R?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Re(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,fe=Pe(()=>{let{from:e,to:r,shouldSwapOrder:u}=L(),g=Be(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>re(X,{...y,shouldSwapOrder:u,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>re(Y,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=xe({jsfModify:{fields:{...n?.jsfModify?.fields,...fe?.fields}}});ee(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&P(e)}},[t,_]),ee(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ge(e){return de(ae(e,s,a))}o(ge,"onSubmit");function ye(e){let r=_?.find(({value:u})=>u===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),P(r)}o(ye,"onCountryChange");function pe(e){E(e)}o(pe,"onRegionChange");function Ce(e){se(e.target.value)}o(Ce,"onHiringBudgetChange");function _e(e){let r=d?.find(u=>u.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(_e,"onChangeCurrency");let S=f.fields.find(e=>e.name==="region");if(S){let e=R?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];S.options=e,S.isVisible=e.length>0,S.required=e.length>0,S.onChange=pe,S.schema=e.length>0?te().transform(r=>typeof r=="string"?r:"").required("Region is required"):te()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=_e)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=Ce),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=ye)}let be=o(()=>{P(void 0),E(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...w?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ie(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let u=V(e,D);try{await N.validate(u,{abortEarly:!1}),r={formErrors:{},yupError:new ne([],e)}}catch(h){let B=K(h);r={formErrors:Object.entries(B).reduce((T,[A,M])=>({...T,[A]:M.message}),{}),yupError:h}}let g=w?.handleValidation(u),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new ne(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(e=>{let{country:r,region:u,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:h,management:B,estimation_title:T,...A}=e,M=e.salary;y==="salary_conversion"&&(M=h);let he=V({country:r,region:u,salary:M,salary_converted:y,salary_conversion:h,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Ee=V(A,w?.fields||[]),Fe={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Ee,...Fe}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:le&&ce&&me,onSubmit:ge,resetForm:be,currencies:d,meta:{fields:c.current?.fields}}},"useCostCalculator");function ie(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(c=>c===a.name,"is"),then:o(c=>c.required("Required field"),"then"),otherwise:o(c=>c.optional(),"otherwise")}):a.name==="management"?n[a.name]=oe({management_fee:Te().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return oe(s)}o(ie,"buildValidationSchema");function Ae(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let c={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,c]},[])}o(Ae,"formatBenefits");function Oe(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Ae(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...ke(t,l)}}o(Oe,"mapValueToEmployment");function ke(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(ke,"getSalaryFields");function ae(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Oe(n,i,l))}}o(ae,"buildPayload");export{ie as a,ae as b,O as c,Qe as d};
2
- //# sourceMappingURL=chunk-WNTOQYRY.js.map
1
+ import{a as X}from"./chunk-C6B3CVSL.js";import{a as G}from"./chunk-VFRHMNLJ.js";import{a as I,b as z,c as Q,f as W}from"./chunk-RC3XP5WU.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as K}from"./chunk-CFIJKJXD.js";import{c as Y}from"./chunk-DB7ITLRX.js";import{a as Z}from"./chunk-2YTBWEC7.js";import{c as V}from"./chunk-PAQW5BFW.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Te,object as oe}from"yup";import{createHeadlessForm as Ve,modify as je}from"@remoteoss/json-schema-form";import{useCallback as Re,useEffect as ee,useMemo as Pe,useRef as we,useState as j}from"react";import{string as te,ValidationError as ne}from"yup";import{jsx as re}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},xe=o(t=>{let{schema:i}=je(G.data.schema,t?.jsfModify||{});return Ve(i)},"useStaticSchema");function Be(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(Be,"getSalaryTitle");var Qe=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let c=we({fields:{}}),[k,E]=j(t),[R,P]=j(),[m,q]=j(),[H,se]=j(),{data:_,isLoading:le}=I({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=z(),ue=k||R?.value,{data:w,isLoading:me}=W(ue,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=Q(),{mutateAsync:de}=Z(U),b=R?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Re(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,fe=Pe(()=>{let{from:e,to:r,shouldSwapOrder:u}=L(),g=Be(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>re(X,{...y,shouldSwapOrder:u,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>re(Y,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=xe({jsfModify:{fields:{...n?.jsfModify?.fields,...fe?.fields}}});ee(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&P(e)}},[t,_]),ee(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ge(e){return de(ae(e,s,a))}o(ge,"onSubmit");function ye(e){let r=_?.find(({value:u})=>u===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),P(r)}o(ye,"onCountryChange");function pe(e){E(e)}o(pe,"onRegionChange");function Ce(e){se(e.target.value)}o(Ce,"onHiringBudgetChange");function _e(e){let r=d?.find(u=>u.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(_e,"onChangeCurrency");let S=f.fields.find(e=>e.name==="region");if(S){let e=R?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];S.options=e,S.isVisible=e.length>0,S.required=e.length>0,S.onChange=pe,S.schema=e.length>0?te().transform(r=>typeof r=="string"?r:"").required("Region is required"):te()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=_e)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=Ce),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=ye)}let be=o(()=>{P(void 0),E(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...w?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ie(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let u=V(e,D);try{await N.validate(u,{abortEarly:!1}),r={formErrors:{},yupError:new ne([],e)}}catch(h){let B=K(h);r={formErrors:Object.entries(B).reduce((T,[A,M])=>({...T,[A]:M.message}),{}),yupError:h}}let g=w?.handleValidation(u),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new ne(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(e=>{let{country:r,region:u,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:h,management:B,estimation_title:T,...A}=e,M=e.salary;y==="salary_conversion"&&(M=h);let he=V({country:r,region:u,salary:M,salary_converted:y,salary_conversion:h,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Ee=V(A,w?.fields||[]),Fe={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Ee,...Fe}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:le&&ce&&me,onSubmit:ge,resetForm:be,currencies:d,meta:{fields:c.current?.fields}}},"useCostCalculator");function ie(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(c=>c===a.name,"is"),then:o(c=>c.required("Required field"),"then"),otherwise:o(c=>c.optional(),"otherwise")}):a.name==="management"?n[a.name]=oe({management_fee:Te().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return oe(s)}o(ie,"buildValidationSchema");function Ae(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let c={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,c]},[])}o(Ae,"formatBenefits");function Oe(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Ae(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...ke(t,l)}}o(Oe,"mapValueToEmployment");function ke(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(ke,"getSalaryFields");function ae(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Oe(n,i,l))}}o(ae,"buildPayload");export{ie as a,ae as b,O as c,Qe as d};
2
+ //# sourceMappingURL=chunk-ZHMQDRBT.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-VLLLNIMN.js";import"../../chunk-4ZGIL6OE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-QLNFHOLH.js";import"../../chunk-OXCEJQFC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-OW5QGJD4.js";import"../../chunk-CYPGWEOO.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-MGVP76ZI.js";import"../../chunk-6KIQIVKA.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-OW5QGJD4.js";import"../../chunk-CYPGWEOO.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
2
2
  //# sourceMappingURL=ContractAmendmentFlow.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-4ZGIL6OE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-QLNFHOLH.js";import"../../chunk-OXCEJQFC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-6KIQIVKA.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,2 +1,2 @@
1
- import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-VLLLNIMN.js";import{a as b}from"../../chunk-4ZGIL6OE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-QLNFHOLH.js";import"../../chunk-OXCEJQFC.js";import"../../chunk-BV3PGYSH.js";import{a as c}from"../../chunk-OW5QGJD4.js";import{a as d}from"../../chunk-CYPGWEOO.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import{a}from"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
1
+ import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-MGVP76ZI.js";import{a as b}from"../../chunk-6KIQIVKA.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import{a as c}from"../../chunk-OW5QGJD4.js";import{a as d}from"../../chunk-CYPGWEOO.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import{a}from"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as ContractorOnboardingFlowProps } from '../../types-DegHPy8Q.js';
2
+ import { a as ContractorOnboardingFlowProps } from '../../types-C1II2Ikg.js';
3
3
  import '../../types.gen-B73oMrmZ.js';
4
4
  import './components/OnboardingBack.js';
5
5
  import 'react';
@@ -14,7 +14,7 @@ import '@remoteoss/json-schema-form';
14
14
  import './utils.js';
15
15
  import '../useStepState.js';
16
16
  import './components/BasicInformationStep.js';
17
- import '../../types-1tGveWWg.js';
17
+ import '../../types-B48IQTY-.js';
18
18
  import '../Onboarding/components/OnboardingBack.js';
19
19
  import '../Onboarding/components/OnboardingInvite.js';
20
20
  import '../Onboarding/components/OnboardingSubmit.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-YXWBSRKS.js";import"../../chunk-L6FZRTSN.js";import"../../chunk-LDJT7TII.js";import"../../chunk-LRNSFLHR.js";import"../../chunk-FEHSJUZJ.js";import"../../chunk-R64X3EJF.js";import"../../chunk-NRW33IP5.js";import"../../chunk-5ZR7EFPY.js";import"../../chunk-BMDZJNJV.js";import"../../chunk-DPY77ASH.js";import"../../chunk-TOA3JILU.js";import"../../chunk-ZY5U2UNT.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-LRGEEPGK.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-QLNFHOLH.js";import"../../chunk-OXCEJQFC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
1
+ import{a}from"../../chunk-C67CG4QZ.js";import"../../chunk-QTYDDIVO.js";import"../../chunk-OU4Y73FX.js";import"../../chunk-AUZWLETL.js";import"../../chunk-IQKZWU7I.js";import"../../chunk-AWDGLK2T.js";import"../../chunk-TM7Q7RHH.js";import"../../chunk-5ZR7EFPY.js";import"../../chunk-FHHVVAXP.js";import"../../chunk-DPY77ASH.js";import"../../chunk-TOA3JILU.js";import"../../chunk-SSLB4VJH.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-WKANRAQC.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
2
2
  //# sourceMappingURL=ContractorOnboarding.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { B as BasicInformationFormPayload } from '../../../types-1tGveWWg.js';
2
+ import { B as BasicInformationFormPayload } from '../../../types-B48IQTY-.js';
3
3
  import { t as EmploymentCreationResponse } from '../../../types.gen-B73oMrmZ.js';
4
4
  import { N as NormalizedFieldError } from '../../../mutations-C0KsEf83.js';
5
5
  import '../../Onboarding/components/OnboardingBack.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-LRNSFLHR.js";import"../../../chunk-NRW33IP5.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-QLNFHOLH.js";import"../../../chunk-OXCEJQFC.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as BasicInformationStep};
1
+ import{a}from"../../../chunk-AUZWLETL.js";import"../../../chunk-TM7Q7RHH.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-JO4722R7.js";import"../../../chunk-DB7ITLRX.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as BasicInformationStep};
2
2
  //# sourceMappingURL=BasicInformationStep.js.map
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import '../../../mutations-C0KsEf83.js';
3
- export { h as ContractDetailsStep } from '../../../types-DegHPy8Q.js';
3
+ export { h as ContractDetailsStep } from '../../../types-C1II2Ikg.js';
4
4
  import '../../../remoteFlows-DJcvCgN2.js';
5
5
  import 'react-hook-form';
6
6
  import 'react';
@@ -14,7 +14,7 @@ import '@remoteoss/json-schema-form';
14
14
  import '../utils.js';
15
15
  import '../../useStepState.js';
16
16
  import './BasicInformationStep.js';
17
- import '../../../types-1tGveWWg.js';
17
+ import '../../../types-B48IQTY-.js';
18
18
  import '../../Onboarding/components/OnboardingBack.js';
19
19
  import '../../Onboarding/components/OnboardingInvite.js';
20
20
  import '../../Onboarding/components/OnboardingSubmit.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-FEHSJUZJ.js";import"../../../chunk-NRW33IP5.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-QLNFHOLH.js";import"../../../chunk-OXCEJQFC.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as ContractDetailsStep};
1
+ import{a}from"../../../chunk-IQKZWU7I.js";import"../../../chunk-TM7Q7RHH.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-JO4722R7.js";import"../../../chunk-DB7ITLRX.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as ContractDetailsStep};
2
2
  //# sourceMappingURL=ContractDetailsStep.js.map
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import '../../../mutations-C0KsEf83.js';
3
- export { i as ContractPreviewStep } from '../../../types-DegHPy8Q.js';
3
+ export { i as ContractPreviewStep } from '../../../types-C1II2Ikg.js';
4
4
  import '../../../remoteFlows-DJcvCgN2.js';
5
5
  import 'react-hook-form';
6
6
  import 'react';
@@ -14,7 +14,7 @@ import '@remoteoss/json-schema-form';
14
14
  import '../utils.js';
15
15
  import '../../useStepState.js';
16
16
  import './BasicInformationStep.js';
17
- import '../../../types-1tGveWWg.js';
17
+ import '../../../types-B48IQTY-.js';
18
18
  import '../../Onboarding/components/OnboardingBack.js';
19
19
  import '../../Onboarding/components/OnboardingInvite.js';
20
20
  import '../../Onboarding/components/OnboardingSubmit.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-R64X3EJF.js";import"../../../chunk-NRW33IP5.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-QLNFHOLH.js";import"../../../chunk-OXCEJQFC.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as ContractPreviewStep};
1
+ import{a}from"../../../chunk-AWDGLK2T.js";import"../../../chunk-TM7Q7RHH.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-JO4722R7.js";import"../../../chunk-DB7ITLRX.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as ContractPreviewStep};
2
2
  //# sourceMappingURL=ContractPreviewStep.js.map
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Fields } from '@remoteoss/json-schema-form';
3
- import { B as BasicInformationFormPayload } from '../../../types-1tGveWWg.js';
3
+ import { B as BasicInformationFormPayload } from '../../../types-B48IQTY-.js';
4
4
  import { C as Components } from '../../../remoteFlows-DJcvCgN2.js';
5
- import { P as PricingPlanFormPayload, C as ContractorOnboardingContractDetailsFormPayload } from '../../../types-DegHPy8Q.js';
5
+ import { P as PricingPlanFormPayload, C as ContractorOnboardingContractDetailsFormPayload } from '../../../types-C1II2Ikg.js';
6
6
  import '../../../types.gen-B73oMrmZ.js';
7
7
  import '../../Onboarding/components/OnboardingBack.js';
8
8
  import 'react';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-NRW33IP5.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-QLNFHOLH.js";import"../../../chunk-OXCEJQFC.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as ContractorOnboardingForm};
1
+ import{a}from"../../../chunk-TM7Q7RHH.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-JO4722R7.js";import"../../../chunk-DB7ITLRX.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as ContractorOnboardingForm};
2
2
  //# sourceMappingURL=ContractorOnboardingForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-BMDZJNJV.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-LRGEEPGK.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-Z5WMKCRJ.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as OnboardingInvite};
1
+ import{a}from"../../../chunk-FHHVVAXP.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-WKANRAQC.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-Z5WMKCRJ.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as OnboardingInvite};
2
2
  //# sourceMappingURL=OnboardingInvite.js.map
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import '../../../mutations-C0KsEf83.js';
3
- export { g as PricingPlanStep } from '../../../types-DegHPy8Q.js';
3
+ export { g as PricingPlanStep } from '../../../types-C1II2Ikg.js';
4
4
  import '../../../remoteFlows-DJcvCgN2.js';
5
5
  import 'react-hook-form';
6
6
  import 'react';
@@ -14,7 +14,7 @@ import '@remoteoss/json-schema-form';
14
14
  import '../utils.js';
15
15
  import '../../useStepState.js';
16
16
  import './BasicInformationStep.js';
17
- import '../../../types-1tGveWWg.js';
17
+ import '../../../types-B48IQTY-.js';
18
18
  import '../../Onboarding/components/OnboardingBack.js';
19
19
  import '../../Onboarding/components/OnboardingInvite.js';
20
20
  import '../../Onboarding/components/OnboardingSubmit.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-L6FZRTSN.js";import"../../../chunk-NRW33IP5.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-QLNFHOLH.js";import"../../../chunk-OXCEJQFC.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as PricingPlanStep};
1
+ import{a}from"../../../chunk-QTYDDIVO.js";import"../../../chunk-TM7Q7RHH.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-JO4722R7.js";import"../../../chunk-DB7ITLRX.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as PricingPlanStep};
2
2
  //# sourceMappingURL=PricingPlan.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as SelectCountryFormPayload, b as SelectCountrySuccess } from '../../../types-1tGveWWg.js';
2
+ import { a as SelectCountryFormPayload, b as SelectCountrySuccess } from '../../../types-B48IQTY-.js';
3
3
  import { N as NormalizedFieldError } from '../../../mutations-C0KsEf83.js';
4
4
  import '../../../types.gen-B73oMrmZ.js';
5
5
  import '../../Onboarding/components/OnboardingBack.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-LDJT7TII.js";import"../../../chunk-NRW33IP5.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-QLNFHOLH.js";import"../../../chunk-OXCEJQFC.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as SelectCountryStep};
1
+ import{a}from"../../../chunk-OU4Y73FX.js";import"../../../chunk-TM7Q7RHH.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-JO4722R7.js";import"../../../chunk-DB7ITLRX.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-D6X2WCEG.js";import"../../../chunk-HPHWQU34.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as SelectCountryStep};
2
2
  //# sourceMappingURL=SelectCountryStep.js.map
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
6
6
  import * as react_hook_form from 'react-hook-form';
7
7
  import { Step } from '../useStepState.js';
8
- import { u as useContractorOnboarding } from '../../types-DegHPy8Q.js';
8
+ import { u as useContractorOnboarding } from '../../types-C1II2Ikg.js';
9
9
  import { STEPS } from './utils.js';
10
10
  import 'yup';
11
11
  import '../../types-Zg1n_9wh.js';
@@ -14,7 +14,7 @@ import 'react/jsx-runtime';
14
14
  import './components/OnboardingSubmit.js';
15
15
  import '../../mutations-C0KsEf83.js';
16
16
  import './components/BasicInformationStep.js';
17
- import '../../types-1tGveWWg.js';
17
+ import '../../types-B48IQTY-.js';
18
18
  import '../Onboarding/components/OnboardingBack.js';
19
19
  import '../Onboarding/components/OnboardingInvite.js';
20
20
  import '../Onboarding/components/OnboardingSubmit.js';
@@ -31,12 +31,12 @@ declare const useContractorOnboardingContext: () => {
31
31
  isLoading: boolean;
32
32
  fieldValues: react_hook_form.FieldValues;
33
33
  stepState: {
34
- currentStep: Step<"review" | "basic_information" | "contract_details" | "select_country" | "contract_preview" | "pricing_plan">;
34
+ currentStep: Step<"contract_details" | "review" | "basic_information" | "select_country" | "contract_preview" | "pricing_plan">;
35
35
  totalSteps: number;
36
36
  values: {
37
+ contract_details: react_hook_form.FieldValues;
37
38
  review: react_hook_form.FieldValues;
38
39
  basic_information: react_hook_form.FieldValues;
39
- contract_details: react_hook_form.FieldValues;
40
40
  select_country: react_hook_form.FieldValues;
41
41
  contract_preview: react_hook_form.FieldValues;
42
42
  pricing_plan: react_hook_form.FieldValues;
@@ -2,7 +2,7 @@ import '../../types.gen-B73oMrmZ.js';
2
2
  import '@tanstack/query-core';
3
3
  import '@remoteoss/json-schema-form';
4
4
  import 'react';
5
- export { u as useContractorOnboarding } from '../../types-DegHPy8Q.js';
5
+ export { u as useContractorOnboarding } from '../../types-C1II2Ikg.js';
6
6
  import './utils.js';
7
7
  import '../useStepState.js';
8
8
  import '../../remoteFlows-DJcvCgN2.js';
@@ -12,7 +12,7 @@ import 'react/jsx-runtime';
12
12
  import './components/OnboardingSubmit.js';
13
13
  import '../../mutations-C0KsEf83.js';
14
14
  import './components/BasicInformationStep.js';
15
- import '../../types-1tGveWWg.js';
15
+ import '../../types-B48IQTY-.js';
16
16
  import '../Onboarding/components/OnboardingBack.js';
17
17
  import '../Onboarding/components/OnboardingInvite.js';
18
18
  import 'yup';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-ZY5U2UNT.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-LRGEEPGK.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as useContractorOnboarding};
1
+ import{a}from"../../chunk-SSLB4VJH.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-WKANRAQC.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as useContractorOnboarding};
2
2
  //# sourceMappingURL=hooks.js.map