@remoteoss/remote-flows 1.1.2 → 1.1.3
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.
- package/dist/{chunk-RHFPRVJN.js → chunk-2D5I4RIF.js} +2 -2
- package/dist/{chunk-AVMBXERH.js → chunk-2DYRPCHC.js} +2 -2
- package/dist/{chunk-7OTI6JXY.js → chunk-2LR4VZUK.js} +2 -2
- package/dist/chunk-3JVRFY6F.js +2 -0
- package/dist/chunk-3JVRFY6F.js.map +1 -0
- package/dist/{chunk-QGGFY3DW.js → chunk-3TVKDZSP.js} +2 -2
- package/dist/{chunk-WPPOKYOE.js → chunk-3XOY4F3D.js} +2 -2
- package/dist/{chunk-J6QOM4P4.js → chunk-4C7Y76IS.js} +2 -2
- package/dist/{chunk-I5ZXDJAN.js → chunk-4Y3PH3Z7.js} +2 -2
- package/dist/chunk-7NCYKLRU.js +2 -0
- package/dist/chunk-7NCYKLRU.js.map +1 -0
- package/dist/{chunk-O3IPCXFD.js → chunk-AW7XS7Z5.js} +2 -2
- package/dist/{chunk-3JKQNLJQ.js → chunk-BGNCB335.js} +2 -2
- package/dist/{chunk-7ZP6I6HO.js → chunk-EOV62SUU.js} +2 -2
- package/dist/{chunk-HAPPSY4M.js → chunk-GTP4CHJD.js} +2 -2
- package/dist/{chunk-LCVAJK7F.js → chunk-I4S5X7NU.js} +2 -2
- package/dist/{chunk-43JVUULE.js → chunk-ITIZBBRW.js} +2 -2
- package/dist/{chunk-UXQVACXI.js → chunk-J667C5G4.js} +2 -2
- package/dist/{chunk-OMRLBAVD.js → chunk-KG63T7OU.js} +2 -2
- package/dist/{chunk-3S3JPGGN.js → chunk-LPAKW2MR.js} +2 -2
- package/dist/{chunk-75QLYO7Q.js → chunk-LXLQKYFW.js} +2 -2
- package/dist/{chunk-S57MEMTM.js → chunk-PA7PBUX6.js} +2 -2
- package/dist/{chunk-7OHYERFX.js → chunk-PHWZOEDE.js} +2 -2
- package/dist/{chunk-XJGMRPGR.js → chunk-R36C4F5D.js} +2 -2
- package/dist/{chunk-H2KQYDBI.js → chunk-S5PJSCJF.js} +2 -2
- package/dist/{chunk-KIFLAWFQ.js → chunk-S7X4AB7C.js} +2 -2
- package/dist/{chunk-AFYLN24W.js → chunk-SGTUQ7OX.js} +2 -2
- package/dist/{chunk-VXZN2TCG.js → chunk-SWI3KDSQ.js} +2 -2
- package/dist/chunk-U2AUFXNA.js +2 -0
- package/dist/chunk-U2AUFXNA.js.map +1 -0
- package/dist/{chunk-3KYIP6FF.js → chunk-U2DDV6SE.js} +2 -2
- package/dist/{chunk-H5ALF54Z.js → chunk-U2PJLKXO.js} +2 -2
- package/dist/{chunk-LDMTOUJT.js → chunk-UIBYZKGO.js} +2 -2
- package/dist/{chunk-FF3CQXEL.js → chunk-VC66HET6.js} +2 -2
- package/dist/chunk-VC66HET6.js.map +1 -0
- package/dist/{chunk-CE4VVNUZ.js → chunk-WDH34P74.js} +2 -2
- package/dist/{chunk-QGLNP2MO.js → chunk-WK5QE22Y.js} +2 -2
- package/dist/{chunk-3E3A3LIN.js → chunk-XDYSADZN.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
- package/dist/flows/ContractAmendment/index.d.ts +3 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/types.d.ts +3 -3
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +4 -4
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +4 -4
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +3 -3
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +3 -3
- package/dist/flows/CostCalculator/api.d.ts +3 -3
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +3 -3
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.d.ts +4 -4
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +4 -4
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +3 -3
- package/dist/flows/CostCalculator/utils.d.ts +4 -4
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +5 -5
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +4 -4
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +3 -3
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +5 -5
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +5 -5
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +5 -5
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +5 -5
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +4 -4
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +5 -5
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +4 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +5 -5
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +5 -5
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +5 -5
- package/dist/flows/Onboarding/utils.d.ts +5 -5
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +5 -5
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +5 -5
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +5 -5
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +5 -5
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +5 -5
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +5 -5
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/api.d.ts +6 -6
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +7 -7
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +7 -7
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +7 -7
- package/dist/flows/Termination/context.d.ts +5 -5
- package/dist/flows/Termination/hooks.d.ts +5 -5
- package/dist/flows/Termination/index.d.ts +7 -7
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.d.ts +5 -5
- package/dist/flows/Termination/types.d.ts +5 -5
- package/dist/flows/Termination/utils.d.ts +4 -4
- package/dist/flows/types.d.ts +3 -3
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/{mutations-CxBW1zxv.d.ts → mutations-_Z53Nfn7.d.ts} +1 -1
- package/dist/{remoteFlows-CY58Msdt.d.ts → remoteFlows-DnerqDfR.d.ts} +56 -48
- package/dist/{types-B9DYionD.d.ts → types-B8fU-HTM.d.ts} +3 -3
- package/dist/{types-C9ltj_p9.d.ts → types-BZAPCDYn.d.ts} +2 -2
- package/dist/{types-QAgBmZlN.d.ts → types-BkENRs0g.d.ts} +1 -1
- package/dist/{types-BoBuxeV0.d.ts → types-D_HXGY21.d.ts} +4 -4
- package/dist/{types.gen-D7WEgMDJ.d.ts → types.gen-CSWntXSp.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2TCLBL2U.js +0 -2
- package/dist/chunk-2TCLBL2U.js.map +0 -1
- package/dist/chunk-67MPL47V.js +0 -2
- package/dist/chunk-67MPL47V.js.map +0 -1
- package/dist/chunk-FF3CQXEL.js.map +0 -1
- package/dist/chunk-IKS3YZ7X.js +0 -2
- package/dist/chunk-IKS3YZ7X.js.map +0 -1
- /package/dist/{chunk-RHFPRVJN.js.map → chunk-2D5I4RIF.js.map} +0 -0
- /package/dist/{chunk-AVMBXERH.js.map → chunk-2DYRPCHC.js.map} +0 -0
- /package/dist/{chunk-7OTI6JXY.js.map → chunk-2LR4VZUK.js.map} +0 -0
- /package/dist/{chunk-QGGFY3DW.js.map → chunk-3TVKDZSP.js.map} +0 -0
- /package/dist/{chunk-WPPOKYOE.js.map → chunk-3XOY4F3D.js.map} +0 -0
- /package/dist/{chunk-J6QOM4P4.js.map → chunk-4C7Y76IS.js.map} +0 -0
- /package/dist/{chunk-I5ZXDJAN.js.map → chunk-4Y3PH3Z7.js.map} +0 -0
- /package/dist/{chunk-O3IPCXFD.js.map → chunk-AW7XS7Z5.js.map} +0 -0
- /package/dist/{chunk-3JKQNLJQ.js.map → chunk-BGNCB335.js.map} +0 -0
- /package/dist/{chunk-7ZP6I6HO.js.map → chunk-EOV62SUU.js.map} +0 -0
- /package/dist/{chunk-HAPPSY4M.js.map → chunk-GTP4CHJD.js.map} +0 -0
- /package/dist/{chunk-LCVAJK7F.js.map → chunk-I4S5X7NU.js.map} +0 -0
- /package/dist/{chunk-43JVUULE.js.map → chunk-ITIZBBRW.js.map} +0 -0
- /package/dist/{chunk-UXQVACXI.js.map → chunk-J667C5G4.js.map} +0 -0
- /package/dist/{chunk-OMRLBAVD.js.map → chunk-KG63T7OU.js.map} +0 -0
- /package/dist/{chunk-3S3JPGGN.js.map → chunk-LPAKW2MR.js.map} +0 -0
- /package/dist/{chunk-75QLYO7Q.js.map → chunk-LXLQKYFW.js.map} +0 -0
- /package/dist/{chunk-S57MEMTM.js.map → chunk-PA7PBUX6.js.map} +0 -0
- /package/dist/{chunk-7OHYERFX.js.map → chunk-PHWZOEDE.js.map} +0 -0
- /package/dist/{chunk-XJGMRPGR.js.map → chunk-R36C4F5D.js.map} +0 -0
- /package/dist/{chunk-H2KQYDBI.js.map → chunk-S5PJSCJF.js.map} +0 -0
- /package/dist/{chunk-KIFLAWFQ.js.map → chunk-S7X4AB7C.js.map} +0 -0
- /package/dist/{chunk-AFYLN24W.js.map → chunk-SGTUQ7OX.js.map} +0 -0
- /package/dist/{chunk-VXZN2TCG.js.map → chunk-SWI3KDSQ.js.map} +0 -0
- /package/dist/{chunk-3KYIP6FF.js.map → chunk-U2DDV6SE.js.map} +0 -0
- /package/dist/{chunk-H5ALF54Z.js.map → chunk-U2PJLKXO.js.map} +0 -0
- /package/dist/{chunk-LDMTOUJT.js.map → chunk-UIBYZKGO.js.map} +0 -0
- /package/dist/{chunk-CE4VVNUZ.js.map → chunk-WDH34P74.js.map} +0 -0
- /package/dist/{chunk-QGLNP2MO.js.map → chunk-WK5QE22Y.js.map} +0 -0
- /package/dist/{chunk-3E3A3LIN.js.map → chunk-XDYSADZN.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -16,26 +16,26 @@ export { useContractAmendment } from './flows/ContractAmendment/hooks.js';
|
|
|
16
16
|
export { TerminationFlow } from './flows/Termination/TerminationFlow.js';
|
|
17
17
|
export { TerminationReasonsDetailContent } from './flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js';
|
|
18
18
|
export { TerminationDialogInfoContent } from './flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js';
|
|
19
|
-
export { A as AdditionalDetailsFormValues, E as EmployeeCommunicationFormValues, P as PaidTimeOffFormValues, c as TerminationDetailsFormValues, a as TerminationFlowProps, T as TerminationFormValues, b as TerminationRenderProps } from './types-
|
|
19
|
+
export { A as AdditionalDetailsFormValues, E as EmployeeCommunicationFormValues, P as PaidTimeOffFormValues, c as TerminationDetailsFormValues, a as TerminationFlowProps, T as TerminationFormValues, b as TerminationRenderProps } from './types-BZAPCDYn.js';
|
|
20
20
|
export { PaidTimeOffProps } from './flows/Termination/components/PaidTimeOff/PaidTimeOff.js';
|
|
21
21
|
export { AcknowledgeInformationFeesProps } from './flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js';
|
|
22
22
|
export { AcknowledgeInformationProps } from './flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js';
|
|
23
23
|
export { OnboardingFlow } from './flows/Onboarding/OnboardingFlow.js';
|
|
24
24
|
export { OnboardingInviteProps } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
25
|
-
export { B as BasicInformationFormPayload, c as BenefitsFormPayload, C as ContractDetailsFormPayload, e as CreditRiskState, d as CreditRiskStatus, E as Employment, f as OnboardingRenderProps, a as SelectCountryFormPayload, b as SelectCountrySuccess } from './types-
|
|
25
|
+
export { B as BasicInformationFormPayload, c as BenefitsFormPayload, C as ContractDetailsFormPayload, e as CreditRiskState, d as CreditRiskStatus, E as Employment, f as OnboardingRenderProps, a as SelectCountryFormPayload, b as SelectCountrySuccess } from './types-B8fU-HTM.js';
|
|
26
26
|
export { ContractorOnboardingFlow } from './flows/ContractorOnboarding/ContractorOnboarding.js';
|
|
27
|
-
export { e as ContractPreviewFormPayload, f as ContractPreviewResponse, C as ContractorOnboardingContractDetailsFormPayload, d as ContractorOnboardingContractDetailsResponse, a as ContractorOnboardingFlowProps, b as ContractorOnboardingRenderProps, P as PricingPlanFormPayload, c as PricingPlanResponse } from './types-
|
|
28
|
-
export { c as PaidTimeoffBreakdownResponse, u as useEmploymentQuery, f as useMagicLink, d as usePaidTimeoffBreakdownQuery, e as useTimeOffLeavePoliciesSummaryQuery, b as useTimeOffQuery } from './types-
|
|
27
|
+
export { e as ContractPreviewFormPayload, f as ContractPreviewResponse, C as ContractorOnboardingContractDetailsFormPayload, d as ContractorOnboardingContractDetailsResponse, a as ContractorOnboardingFlowProps, b as ContractorOnboardingRenderProps, P as PricingPlanFormPayload, c as PricingPlanResponse } from './types-D_HXGY21.js';
|
|
28
|
+
export { c as PaidTimeoffBreakdownResponse, u as useEmploymentQuery, f as useMagicLink, d as usePaidTimeoffBreakdownQuery, e as useTimeOffLeavePoliciesSummaryQuery, b as useTimeOffQuery } from './types-BkENRs0g.js';
|
|
29
29
|
export { t as transformYupErrorsIntoObject } from './utils-CjDMg_Yr.js';
|
|
30
30
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
31
31
|
import { PropsWithChildren } from 'react';
|
|
32
|
-
import { R as RemoteFlowsSDKProps } from './remoteFlows-
|
|
33
|
-
export { $ as $TSFixMe, B as ButtonComponentProps, C as Components, D as DrawerComponentProps,
|
|
34
|
-
export { s as Company, C as ContractAmendmentAutomatableResponse, p as CostCalculatorEmployment,
|
|
35
|
-
export { F as FieldError, N as NormalizedFieldError } from './mutations-
|
|
36
|
-
import 'react-hook-form';
|
|
32
|
+
import { R as RemoteFlowsSDKProps } from './remoteFlows-DnerqDfR.js';
|
|
33
|
+
export { $ as $TSFixMe, B as ButtonComponentProps, C as Components, d as CountryComponentProps, D as DrawerComponentProps, b as FieldComponentProps, F as FieldSetToggleComponentProps, c as FileComponentProps, M as Meta, S as StatementComponentProps, Z as ZendeskDrawerComponentProps } from './remoteFlows-DnerqDfR.js';
|
|
34
|
+
export { s as Company, C as ContractAmendmentAutomatableResponse, p as CostCalculatorEmployment, d as CostCalculatorEstimateResponse, W as Currency, r as EmploymentCreationResponse, v as EmploymentResponse, O as OffboardingResponse, S as SuccessResponse } from './types.gen-CSWntXSp.js';
|
|
35
|
+
export { F as FieldError, N as NormalizedFieldError } from './mutations-_Z53Nfn7.js';
|
|
37
36
|
import 'yup';
|
|
38
37
|
import './types-Zg1n_9wh.js';
|
|
38
|
+
import 'react-hook-form';
|
|
39
39
|
import './flows/CostCalculator/constants.js';
|
|
40
40
|
import './flows/types.js';
|
|
41
41
|
import '@remoteoss/json-schema-form-old';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-FZ7FWFJX.js";import{a as ur}from"./chunk-77EBKLW6.js";import{a as vr}from"./chunk-4GDEWYZC.js";import{a as gr}from"./chunk-
|
|
1
|
+
import"./chunk-FZ7FWFJX.js";import{a as ur}from"./chunk-77EBKLW6.js";import{a as vr}from"./chunk-4GDEWYZC.js";import{a as gr}from"./chunk-UIBYZKGO.js";import"./chunk-QP3VWGCS.js";import"./chunk-L23UIJDU.js";import"./chunk-NS4FRCEH.js";import"./chunk-IWA5B4U6.js";import"./chunk-AT7VHJMW.js";import"./chunk-3SAV2OEE.js";import"./chunk-EHAZWZ3O.js";import"./chunk-MKE27NUF.js";import"./chunk-I4XJ764Y.js";import"./chunk-2TILNBMK.js";import"./chunk-XOA7GG4P.js";import"./chunk-XFD3ULUF.js";import"./chunk-ZXGAFQXW.js";import"./chunk-LMYJ6V44.js";import"./chunk-RR55GUDT.js";import"./chunk-NX7MM6XR.js";import"./chunk-VDRNNOVA.js";import"./chunk-QUQLW5YW.js";import"./chunk-DFJNVGK4.js";import"./chunk-SGE4DLC3.js";import"./chunk-S5PJSCJF.js";import"./chunk-PA7PBUX6.js";import"./chunk-3XOY4F3D.js";import"./chunk-STPJXT2A.js";import"./chunk-J667C5G4.js";import"./chunk-GTP4CHJD.js";import"./chunk-MRYRNB7Y.js";import"./chunk-DKFUZO5P.js";import"./chunk-GULCZWSK.js";import{a as hr}from"./chunk-R36C4F5D.js";import"./chunk-RPTB2HUM.js";import"./chunk-EOV62SUU.js";import"./chunk-2LR4VZUK.js";import"./chunk-2DYRPCHC.js";import"./chunk-MDDI5GLL.js";import"./chunk-BGNCB335.js";import"./chunk-YWZI5KJN.js";import"./chunk-Z7WBY27D.js";import"./chunk-LPAKW2MR.js";import"./chunk-I4S5X7NU.js";import"./chunk-PGWKJ6FK.js";import"./chunk-SGTUQ7OX.js";import"./chunk-VAIBLWOY.js";import"./chunk-4C7Y76IS.js";import{a as mr}from"./chunk-LXLQKYFW.js";import"./chunk-KG63T7OU.js";import"./chunk-BFMUZP2O.js";import"./chunk-2D5I4RIF.js";import"./chunk-ITIZBBRW.js";import"./chunk-WK5QE22Y.js";import"./chunk-AW7XS7Z5.js";import"./chunk-S7X4AB7C.js";import"./chunk-PHWZOEDE.js";import"./chunk-QP5V46OP.js";import"./chunk-TOA3JILU.js";import"./chunk-SWI3KDSQ.js";import"./chunk-ZOTFS35J.js";import"./chunk-ELXVVBRD.js";import"./chunk-OAPK6TR7.js";import"./chunk-AP56UUME.js";import"./chunk-R2MHAPWD.js";import"./chunk-3UDG4IJO.js";import"./chunk-FGBEOUQK.js";import{a as j}from"./chunk-NVZHJOA3.js";import{a as A}from"./chunk-FZDQ7EEI.js";import"./chunk-EC7QVRRX.js";import{a as S}from"./chunk-WDH34P74.js";import{a as I}from"./chunk-K3PHODKN.js";import{a as N}from"./chunk-6YXSWOKH.js";import"./chunk-A7ZJQCNU.js";import{a as _}from"./chunk-U2PJLKXO.js";import"./chunk-KSHK3ZPX.js";import{b as F,d as T}from"./chunk-U2DDV6SE.js";import"./chunk-3TVKDZSP.js";import"./chunk-7NCYKLRU.js";import"./chunk-VFRHMNLJ.js";import"./chunk-3JVRFY6F.js";import"./chunk-WVJDCDGZ.js";import{d as R,e as P}from"./chunk-XQL5I2GC.js";import"./chunk-HN5HLFTB.js";import"./chunk-BVDT43OO.js";import"./chunk-MXLQEDRJ.js";import"./chunk-Z5WMKCRJ.js";import{a as pr}from"./chunk-XDYSADZN.js";import{a as er}from"./chunk-4Y3PH3Z7.js";import"./chunk-VC66HET6.js";import{a as or}from"./chunk-QH4EGUER.js";import{a as dr}from"./chunk-CDCKGIF5.js";import{a as ir,b as nr,c as sr,d as cr,e as lr}from"./chunk-JA7UP6GN.js";import"./chunk-ZPN5N6BA.js";import"./chunk-LNV36S6D.js";import"./chunk-U2AUFXNA.js";import{a as z,b as B}from"./chunk-7FMR3EIX.js";import"./chunk-ND4FAALX.js";import"./chunk-2YTBWEC7.js";import{a as v,b as u}from"./chunk-NFUP6BFU.js";import"./chunk-ZIN2OWTH.js";import"./chunk-UOOUV52J.js";import"./chunk-72OH7PSF.js";import"./chunk-PJBAQZ6G.js";import"./chunk-ZKINPHYU.js";import{a as h,c as m}from"./chunk-KQPDXXG3.js";import"./chunk-LJGCFFAT.js";import{a as tr}from"./chunk-FUMA5UUB.js";import"./chunk-66N57DKF.js";import{b as C}from"./chunk-2SO4LW7V.js";import"./chunk-PMTKQME6.js";import"./chunk-TVZAFTPT.js";import{c as E,d as w}from"./chunk-L3Z2G32A.js";import{a as t}from"./chunk-P37U34EQ.js";import{QueryClient as Y,QueryClientProvider as Z}from"@tanstack/react-query";import{useMemo as $}from"react";function l(r){let a=document.documentElement;Object.keys(r).forEach(e=>{let n=r[e];n&&a.style.setProperty(e,n)})}t(l,"setCssProperties");function O(r){let a={};return Object.keys(r).forEach(e=>{a[`--${e}`]=r[e]}),a}t(O,"mapThemeColors");function D(r){return{"--spacing":r}}t(D,"mapThemeSpacing");function V(r){return{"--radius":r}}t(V,"mapThemeBorderRadius");function M(r){return{"--fontSizeBase":r.fontSizeBase}}t(M,"mapThemeFont");function f(r){r?.colors&&l(O(r.colors)),r?.spacing&&l(D(r.spacing)),r?.borderRadius&&l(V(r.borderRadius)),r?.font&&l(M(r.font))}t(f,"applyTheme");import{createContext as U,useEffect as W,useMemo as L}from"react";import{jsx as Q}from"react/jsx-runtime";var K=U({theme:{}});function b(r){W(()=>{r.theme&&Object.keys(r.theme).length>0&&f(r.theme)},[r.theme]);let a=L(()=>({theme:r.theme}),[r.theme]);return Q(K.Provider,{value:a,children:r.children})}t(b,"ThemeProvider");var x={local:"http://localhost:4000/api/eor",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};var g="1.1.3";function q(r){try{return new URL(r),!0}catch{return!1}}t(q,"isValidUrl");function y(r,a){let e={current:null},n=a?.environment?x[a?.environment]:"https://gateway.remote.com",c=u.getConfig();a?.environment&&a?.environment!=="production"&&w(g);let s=!!a?.proxy&&q(a.proxy.url);return a?.proxy&&!s&&console.error("Invalid proxy URL provided. Using default base URL."),v({...c,headers:{...c.headers,...s?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":g},baseUrl:s?a.proxy?.url:n,auth:t(async()=>{function p(o){return!o||Date.now()+6e4>o}if(t(p,"hasTokenExpired"),!e.current||p(e.current.expiresAt))try{let o=await r();e.current={accessToken:o.accessToken,expiresAt:Date.now()+o.expiresIn*1e3}}catch(o){console.error("Failed to fetch auth token:",o);return}return e.current?.accessToken},"auth")})}t(y,"createClient");import{Component as H}from"react";import{jsx as k}from"react/jsx-runtime";var X=t(()=>k("div",{style:{padding:"20px",border:"1px solid #dc2626",borderRadius:"4px",backgroundColor:"#fef2f2",color:"#991b1b"},children:"Something went wrong in RemoteFlows. Please refresh the page."}),"FallbackErrorBoundary"),d=class extends H{static{t(this,"RemoteFlowsErrorBoundary")}constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,e){if(console.error("[RemoteFlows] Error caught:",a,e),this.props.errorBoundary?.useParentErrorBoundary)throw a}render(){return this.state.hasError&&this.state.error?this.props.errorBoundary?.fallback?typeof this.props.errorBoundary?.fallback=="function"?this.props.errorBoundary?.fallback(this.state.error):this.props.errorBoundary?.fallback:k(X,{}):this.props.children}};import{jsx as i}from"react/jsx-runtime";var G=new Y;function J({children:r,client:a}){return i(m.Provider,{value:{client:a},children:r})}t(J,"RemoteFlowContextWrapper");function rr({children:r,components:a}){return i(h.Provider,{value:a?{components:a}:{components:{}},children:r})}t(rr,"FormFieldsProvider");function ar({auth:r,children:a,components:e,theme:n,proxy:c,environment:s,errorBoundary:p={useParentErrorBoundary:!0}}){let o=$(()=>y(r,{environment:s,proxy:c}),[r,s,c]);return i(d,{errorBoundary:p,children:i(Z,{client:G,children:i(rr,{components:e,children:i(J,{client:o,children:i(b,{theme:n,children:a})})})})})}t(ar,"RemoteFlows");export{tr as ContractAmendmentConfirmationForm,pr as ContractAmendmentFlow,er as ContractAmendmentForm,or as ContractAmendmentSubmit,mr as ContractorOnboardingFlow,_ as CostCalculatorFlow,S as CostCalculatorForm,I as CostCalculatorResetButton,N as CostCalculatorSubmitButton,j as EstimationResults,hr as OnboardingFlow,ar as RemoteFlows,A as SummaryResults,ur as TerminationDialogInfoContent,gr as TerminationFlow,vr as TerminationReasonsDetailContent,B as ZendeskTriggerButton,F as buildCostCalculatorEstimationPayload,C as convertFromCents,E as transformYupErrorsIntoObject,dr as useContractAmendment,T as useCostCalculator,P as useCostCalculatorEstimationCsv,R as useCostCalculatorEstimationPdf,ir as useEmploymentQuery,lr as useMagicLink,sr as usePaidTimeoffBreakdownQuery,cr as useTimeOffLeavePoliciesSummaryQuery,nr as useTimeOffQuery,z as zendeskArticles};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
2
1
|
import React__default, { PropsWithChildren, ReactNode } from 'react';
|
|
3
2
|
import { AnySchema } from 'yup';
|
|
4
|
-
import {
|
|
3
|
+
import { X as HelpCenterArticle } from './types.gen-CSWntXSp.js';
|
|
5
4
|
import { S as SupportedTypes } from './types-Zg1n_9wh.js';
|
|
5
|
+
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
6
6
|
|
|
7
7
|
type ThemeProviderProps = PropsWithChildren<{
|
|
8
8
|
theme?: Partial<{
|
|
@@ -26,12 +26,6 @@ type ThemeFont = {
|
|
|
26
26
|
fontSizeBase: string;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
type StatementProps = {
|
|
30
|
-
title?: string;
|
|
31
|
-
description: string;
|
|
32
|
-
severity: 'warning' | 'error' | 'success' | 'info' | 'neutral' | 'time';
|
|
33
|
-
};
|
|
34
|
-
|
|
35
29
|
declare const ENVIRONMENTS: {
|
|
36
30
|
local: string;
|
|
37
31
|
partners: string;
|
|
@@ -48,6 +42,36 @@ type ColumnDef<T = $TSFixMe> = {
|
|
|
48
42
|
render?: (value: $TSFixMe, row: T, index: number) => React__default.ReactNode;
|
|
49
43
|
};
|
|
50
44
|
|
|
45
|
+
type FieldFileDataProps = FieldDataProps & {
|
|
46
|
+
accept?: string;
|
|
47
|
+
multiple?: boolean;
|
|
48
|
+
maxFileSize?: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Props for custom field components.
|
|
53
|
+
* All custom field components receive these three props from React Hook Form's Controller.
|
|
54
|
+
*/
|
|
55
|
+
type FieldComponentProps = {
|
|
56
|
+
/**
|
|
57
|
+
* Field prop from React Hook Form's Controller component.
|
|
58
|
+
* Contains field state and methods for registration.
|
|
59
|
+
* You must bind these props to your HTML elements to ensure proper form state management.
|
|
60
|
+
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
61
|
+
*/
|
|
62
|
+
field: ControllerRenderProps<FieldValues, string>;
|
|
63
|
+
/**
|
|
64
|
+
* Field state prop from React Hook Form's Controller component.
|
|
65
|
+
* Contains information about the field's state, such as errors, touched status, etc.
|
|
66
|
+
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
67
|
+
*/
|
|
68
|
+
fieldState: ControllerFieldState;
|
|
69
|
+
/**
|
|
70
|
+
* Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
|
|
71
|
+
* Contains properties defined in the original JSON schema such as type, format, constraints, etc.
|
|
72
|
+
*/
|
|
73
|
+
fieldData: FieldDataProps;
|
|
74
|
+
};
|
|
51
75
|
/**
|
|
52
76
|
* Base type for field metadata passed to custom field components.
|
|
53
77
|
* Extends JSFField with optional metadata for extensibility.
|
|
@@ -55,11 +79,27 @@ type ColumnDef<T = $TSFixMe> = {
|
|
|
55
79
|
type FieldDataProps = Partial<JSFField> & {
|
|
56
80
|
metadata?: Record<string, unknown>;
|
|
57
81
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
type FileComponentProps = FieldComponentProps & {
|
|
83
|
+
fieldData: FieldFileDataProps;
|
|
84
|
+
};
|
|
85
|
+
type FieldCountryDataProps = FieldDataProps & {
|
|
86
|
+
$meta: {
|
|
87
|
+
regions: Record<string, string[]>;
|
|
88
|
+
subregions: Record<string, string[]>;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
type CountryComponentProps = FieldComponentProps & {
|
|
92
|
+
fieldData: FieldCountryDataProps;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Props for custom statement components.
|
|
96
|
+
*/
|
|
97
|
+
type StatementComponentProps = {
|
|
98
|
+
data: {
|
|
99
|
+
title?: string;
|
|
100
|
+
description: string;
|
|
101
|
+
severity: 'warning' | 'error' | 'success' | 'info' | undefined;
|
|
102
|
+
};
|
|
63
103
|
};
|
|
64
104
|
|
|
65
105
|
type AuthResponse = {
|
|
@@ -105,30 +145,6 @@ type TableComponentProps<T = $TSFixMe> = {
|
|
|
105
145
|
headerRowClassName?: string;
|
|
106
146
|
bodyRowClassName?: string | ((row: T, index: number) => string);
|
|
107
147
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Props for custom field components.
|
|
110
|
-
* All custom field components receive these three props from React Hook Form's Controller.
|
|
111
|
-
*/
|
|
112
|
-
type FieldComponentProps = {
|
|
113
|
-
/**
|
|
114
|
-
* Field prop from React Hook Form's Controller component.
|
|
115
|
-
* Contains field state and methods for registration.
|
|
116
|
-
* You must bind these props to your HTML elements to ensure proper form state management.
|
|
117
|
-
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
118
|
-
*/
|
|
119
|
-
field: ControllerRenderProps<FieldValues, string>;
|
|
120
|
-
/**
|
|
121
|
-
* Field state prop from React Hook Form's Controller component.
|
|
122
|
-
* Contains information about the field's state, such as errors, touched status, etc.
|
|
123
|
-
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
124
|
-
*/
|
|
125
|
-
fieldState: ControllerFieldState;
|
|
126
|
-
/**
|
|
127
|
-
* Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
|
|
128
|
-
* Contains properties defined in the original JSON schema such as type, format, constraints, etc.
|
|
129
|
-
*/
|
|
130
|
-
fieldData: FieldDataProps;
|
|
131
|
-
};
|
|
132
148
|
/**
|
|
133
149
|
* Props for custom button components.
|
|
134
150
|
*/
|
|
@@ -151,12 +167,6 @@ type ZendeskDrawerComponentProps = {
|
|
|
151
167
|
zendeskURL: string;
|
|
152
168
|
Trigger: React.ReactElement;
|
|
153
169
|
};
|
|
154
|
-
/**
|
|
155
|
-
* Props for custom statement components.
|
|
156
|
-
*/
|
|
157
|
-
type StatementComponentProps = {
|
|
158
|
-
data: StatementProps;
|
|
159
|
-
};
|
|
160
170
|
type DrawerComponentProps = {
|
|
161
171
|
open: boolean;
|
|
162
172
|
onOpenChange: (open: boolean) => void;
|
|
@@ -174,14 +184,12 @@ type FieldSetToggleComponentProps = {
|
|
|
174
184
|
className?: string;
|
|
175
185
|
children?: React.ReactNode;
|
|
176
186
|
};
|
|
177
|
-
type TypesWithoutFile = Exclude<SupportedTypes, 'file'>;
|
|
178
|
-
type FileComponentProps = FieldComponentProps & {
|
|
179
|
-
fieldData: FieldFileDataProps;
|
|
180
|
-
};
|
|
187
|
+
type TypesWithoutFile = Exclude<SupportedTypes, 'file' | 'countries'>;
|
|
181
188
|
type Components = {
|
|
182
189
|
[K in TypesWithoutFile]?: React.ComponentType<FieldComponentProps>;
|
|
183
190
|
} & {
|
|
184
191
|
file?: React.ComponentType<FileComponentProps>;
|
|
192
|
+
countries?: React.ComponentType<CountryComponentProps>;
|
|
185
193
|
statement?: React.ComponentType<StatementComponentProps>;
|
|
186
194
|
button?: React.ComponentType<ButtonComponentProps>;
|
|
187
195
|
fieldsetToggle?: React.ComponentType<FieldSetToggleComponentProps>;
|
|
@@ -250,4 +258,4 @@ type MetaValues = {
|
|
|
250
258
|
};
|
|
251
259
|
type Meta = Record<string, MetaValues>;
|
|
252
260
|
|
|
253
|
-
export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, DrawerComponentProps as D,
|
|
261
|
+
export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, DrawerComponentProps as D, FieldSetToggleComponentProps as F, JSFFieldset as J, Meta as M, RemoteFlowsSDKProps as R, StatementComponentProps as S, ZendeskDrawerComponentProps as Z, JSFField as a, FieldComponentProps as b, FileComponentProps as c, CountryComponentProps as d };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as EmploymentCreationResponse, v as EmploymentResponse, S as SuccessResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, T as TooManyRequestsResponse, B as BadRequestResponse, a as UnauthorizedResponse, t as ConflictResponse, F as ForbiddenResponse, E as Employment$1, u as EmploymentCreateParams } from './types.gen-
|
|
1
|
+
import { r as EmploymentCreationResponse, v as EmploymentResponse, S as SuccessResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, T as TooManyRequestsResponse, B as BadRequestResponse, a as UnauthorizedResponse, t as ConflictResponse, F as ForbiddenResponse, E as Employment$1, u as EmploymentCreateParams } from './types.gen-CSWntXSp.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { OnboardingBack } from './flows/Onboarding/components/OnboardingBack.js';
|
|
4
4
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
5
|
-
import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-
|
|
5
|
+
import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-_Z53Nfn7.js';
|
|
6
6
|
import { OnboardingSubmit } from './flows/Onboarding/components/OnboardingSubmit.js';
|
|
7
|
-
import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-
|
|
7
|
+
import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-DnerqDfR.js';
|
|
8
8
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
9
9
|
import * as React$1 from 'react';
|
|
10
10
|
import { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OffboardingResponse,
|
|
1
|
+
import { O as OffboardingResponse, Y as PayrollCalendarEor, E as Employment, D as TerminationDetailsParams, N as NotFoundResponse, U as UnprocessableEntityResponse, T as TooManyRequestsResponse, B as BadRequestResponse, a as UnauthorizedResponse, R as RequestError } from './types.gen-CSWntXSp.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { E as ErrorResponse, S as SuccessResponse } from './mutations-
|
|
3
|
+
import { E as ErrorResponse, S as SuccessResponse } from './mutations-_Z53Nfn7.js';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import * as _remoteoss_json_schema_form_old from '@remoteoss/json-schema-form-old';
|
|
6
6
|
import { $TSFixMe } from '@remoteoss/json-schema-form-old';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Employment, L as ListTimeoffResponse, G as TimeoffStatus, H as TimeoffType, I as ListLeavePoliciesSummaryResponse, J as MagicLinkResponse, U as UnprocessableEntityResponse, K as MagicLinkParams } from './types.gen-
|
|
1
|
+
import { E as Employment, L as ListTimeoffResponse, G as TimeoffStatus, H as TimeoffType, I as ListLeavePoliciesSummaryResponse, J as MagicLinkResponse, U as UnprocessableEntityResponse, K as MagicLinkParams } from './types.gen-CSWntXSp.js';
|
|
2
2
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { E as Employment,
|
|
1
|
+
import { E as Employment, i as File, l as CreateContractDocumentResponse, h as SignContractDocument, S as SuccessResponse } from './types.gen-CSWntXSp.js';
|
|
2
2
|
import { OnboardingBack } from './flows/ContractorOnboarding/components/OnboardingBack.js';
|
|
3
3
|
import { OnboardingSubmit } from './flows/ContractorOnboarding/components/OnboardingSubmit.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { N as NormalizedFieldError } from './mutations-
|
|
5
|
+
import { N as NormalizedFieldError } from './mutations-_Z53Nfn7.js';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
import * as React$1 from 'react';
|
|
8
8
|
import { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';
|
|
9
9
|
import { STEPS } from './flows/ContractorOnboarding/utils.js';
|
|
10
10
|
import { Step } from './flows/useStepState.js';
|
|
11
|
-
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-
|
|
11
|
+
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-DnerqDfR.js';
|
|
12
12
|
import { Fields } from '@remoteoss/json-schema-form-old';
|
|
13
13
|
import { FieldValues } from 'react-hook-form';
|
|
14
14
|
import { BasicInformationStep } from './flows/ContractorOnboarding/components/BasicInformationStep.js';
|
|
15
|
-
import { g as SelectCountryStep } from './types-
|
|
15
|
+
import { g as SelectCountryStep } from './types-B8fU-HTM.js';
|
|
16
16
|
import { FlowOptions, JSFModifyNext } from './flows/types.js';
|
|
17
17
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
18
18
|
|
|
@@ -1688,4 +1688,4 @@ type PostAutomatableContractAmendmentErrors = {
|
|
|
1688
1688
|
};
|
|
1689
1689
|
type PostAutomatableContractAmendmentError = PostAutomatableContractAmendmentErrors[keyof PostAutomatableContractAmendmentErrors];
|
|
1690
1690
|
|
|
1691
|
-
export type { CreateContractEligibilityParams as A, BadRequestResponse as B, ContractAmendmentAutomatableResponse as C, TerminationDetailsParams as D, Employment as E, ForbiddenResponse as F, TimeoffStatus as G, TimeoffType as H, ListLeavePoliciesSummaryResponse as I, MagicLinkResponse as J, MagicLinkParams as K, ListTimeoffResponse as L,
|
|
1691
|
+
export type { CreateContractEligibilityParams as A, BadRequestResponse as B, ContractAmendmentAutomatableResponse as C, TerminationDetailsParams as D, Employment as E, ForbiddenResponse as F, TimeoffStatus as G, TimeoffType as H, ListLeavePoliciesSummaryResponse as I, MagicLinkResponse as J, MagicLinkParams as K, ListTimeoffResponse as L, MinimalRegion as M, NotFoundResponse as N, OffboardingResponse as O, PostCreateContractAmendmentError as P, CreateOffboardingParams as Q, RequestError as R, SuccessResponse as S, TooManyRequestsResponse as T, UnprocessableEntityResponse as U, ValidationError as V, Currency as W, HelpCenterArticle as X, PayrollCalendarEor as Y, UnauthorizedResponse as a, ContractAmendmentResponse as b, PostAutomatableContractAmendmentError as c, CostCalculatorEstimateResponse as d, CostCalculatorEstimatePdfResponse as e, CostCalculatorEstimateParams as f, CostCalculatorEstimateCsvResponse as g, SignContractDocument as h, File as i, ContractorSubscriptionsSummary as j, ManageContractorPlusSubscriptionOperationsParams as k, CreateContractDocumentResponse as l, CreateContractDocument as m, MinimalCountry as n, EmploymentTermType as o, CostCalculatorEmployment as p, PostCreateEstimationError as q, EmploymentCreationResponse as r, Company as s, ConflictResponse as t, EmploymentCreateParams as u, EmploymentResponse as v, EmploymentFullParams as w, UnifiedEmploymentUpsertBenefitOffersRequest as x, ConvertCurrencyResponse as y, ConvertCurrencyParams as z };
|
package/package.json
CHANGED
package/dist/chunk-2TCLBL2U.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{l as U}from"./chunk-IKS3YZ7X.js";import{a as w}from"./chunk-ND4FAALX.js";import{b as J}from"./chunk-KQPDXXG3.js";import{c as G,l as K}from"./chunk-66N57DKF.js";import{a as t,b as d,c as Pe}from"./chunk-P37U34EQ.js";var F=d((Rt,V)=>{"use strict";function _e(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}t(_e,"isObject");V.exports=_e});var z=d((qt,X)=>{"use strict";var ke=typeof global=="object"&&global&&global.Object===Object&&global;X.exports=ke});var L=d((It,Q)=>{"use strict";var we=z(),Fe=typeof self=="object"&&self&&self.Object===Object&&self,Le=we||Fe||Function("return this")();Q.exports=Le});var Z=d((Mt,Y)=>{"use strict";var De=L(),Ae=t(function(){return De.Date.now()},"now");Y.exports=Ae});var te=d((_t,ee)=>{"use strict";var We=/\s/;function Be(e){for(var n=e.length;n--&&We.test(e.charAt(n)););return n}t(Be,"trimmedEndIndex");ee.exports=Be});var re=d((wt,ne)=>{"use strict";var Ne=te(),He=/^\s+/;function Ge(e){return e&&e.slice(0,Ne(e)+1).replace(He,"")}t(Ge,"baseTrim");ne.exports=Ge});var D=d((Lt,oe)=>{"use strict";var Je=L(),Ke=Je.Symbol;oe.exports=Ke});var ce=d((Dt,ae)=>{"use strict";var ie=D(),se=Object.prototype,Ue=se.hasOwnProperty,Ve=se.toString,O=ie?ie.toStringTag:void 0;function Xe(e){var n=Ue.call(e,O),r=e[O];try{e[O]=void 0;var o=!0}catch{}var s=Ve.call(e);return o&&(n?e[O]=r:delete e[O]),s}t(Xe,"getRawTag");ae.exports=Xe});var fe=d((Wt,ue)=>{"use strict";var ze=Object.prototype,Qe=ze.toString;function Ye(e){return Qe.call(e)}t(Ye,"objectToString");ue.exports=Ye});var ge=d((Nt,me)=>{"use strict";var de=D(),Ze=ce(),et=fe(),tt="[object Null]",nt="[object Undefined]",le=de?de.toStringTag:void 0;function rt(e){return e==null?e===void 0?nt:tt:le&&le in Object(e)?Ze(e):et(e)}t(rt,"baseGetTag");me.exports=rt});var be=d((Gt,pe)=>{"use strict";function ot(e){return e!=null&&typeof e=="object"}t(ot,"isObjectLike");pe.exports=ot});var ye=d((Kt,ve)=>{"use strict";var it=ge(),st=be(),at="[object Symbol]";function ct(e){return typeof e=="symbol"||st(e)&&it(e)==at}t(ct,"isSymbol");ve.exports=ct});var Ce=d((Vt,Te)=>{"use strict";var ut=re(),he=F(),ft=ye(),xe=NaN,dt=/^[-+]0x[0-9a-f]+$/i,lt=/^0b[01]+$/i,mt=/^0o[0-7]+$/i,gt=parseInt;function pt(e){if(typeof e=="number")return e;if(ft(e))return xe;if(he(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=he(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ut(e);var r=lt.test(e);return r||mt.test(e)?gt(e.slice(2),r?2:8):dt.test(e)?xe:+e}t(pt,"toNumber");Te.exports=pt});var Oe=d((zt,je)=>{"use strict";var bt=F(),A=Z(),Se=Ce(),vt="Expected a function",yt=Math.max,ht=Math.min;function xt(e,n,r){var o,s,p,l,a,c,m=0,E=!1,u=!1,x=!0;if(typeof e!="function")throw new TypeError(vt);n=Se(n)||0,bt(r)&&(E=!!r.leading,u="maxWait"in r,p=u?yt(Se(r.maxWait)||0,n):p,x="trailing"in r?!!r.trailing:x);function T(i){var g=o,y=s;return o=s=void 0,m=i,l=e.apply(y,g),l}t(T,"invokeFunc");function R(i){return m=i,a=setTimeout(v,n),E?T(i):l}t(R,"leadingEdge");function C(i){var g=i-c,y=i-m,M=n-g;return u?ht(M,p-y):M}t(C,"remainingWait");function $(i){var g=i-c,y=i-m;return c===void 0||g>=n||g<0||u&&y>=p}t($,"shouldInvoke");function v(){var i=A();if($(i))return b(i);a=setTimeout(v,C(i))}t(v,"timerExpired");function b(i){return a=void 0,x&&o?T(i):(o=s=void 0,l)}t(b,"trailingEdge");function q(){a!==void 0&&clearTimeout(a),m=0,o=c=s=a=void 0}t(q,"cancel");function I(){return a===void 0?l:b(A())}t(I,"flush");function S(){var i=A(),g=$(i);if(o=arguments,s=this,c=i,g){if(a===void 0)return R(c);if(u)return clearTimeout(a),a=setTimeout(v,n),T(c)}return a===void 0&&(a=setTimeout(v,n)),l}return t(S,"debounced"),S.cancel=q,S.flush=I,S}t(xt,"debounce");je.exports=xt});import{useState as St,useCallback as jt,useEffect as $e,useRef as qe}from"react";var Re=Pe(Oe(),1);import{useCallback as Tt,useEffect as Ct,useRef as Ee}from"react";function W(e,n){let r=Ee(e);Ct(()=>{r.current=e},[e]);let o=Ee((0,Re.default)(s=>{r.current(s)},n)).current;return Tt(s=>{o(s)},[o])}t(W,"useDebounce");import{Fragment as Et,jsx as h,jsxs as Ie}from"react/jsx-runtime";var Ot=t(({description:e,showConversion:n,targetCurrency:r,className:o,onClick:s})=>{let{components:p}=J(),l=n?`Hide ${r} conversion`:`Show ${r} conversion`,a=p?.button;return Ie("span",{className:o,children:[h(K,{as:"span",children:e})," ",a?h(a,{className:`${o.replace("-description","-button")}`,"data-type":"inline",onClick:s,children:l}):h("button",{className:`${o.replace("-description","-button")}`,onClick:s,children:l})]})},"DescriptionWithConversion"),fn=t(({sourceCurrency:e,targetCurrency:n,mainFieldName:r,conversionFieldName:o,conversionProperties:s,classNamePrefix:p,description:l,conversionType:a="spread",...c})=>{let[m,E]=St(!1),{setValue:u,watch:x}=G(),T=x(r||c.name),R=qe(!0),C=qe(new Map),$=e&&n&&e!==n,{mutateAsync:v}=U({type:a}),b=`${c.name}_converted`;$e(()=>{u(b,r||c.name)},[u,r,c.name,b]),$e(()=>{if(R.current){R.current=!1;return}u(o,"")},[e,o,u]);let q=jt(async(f,j,k,B)=>{if(!f)return;let N=`${j}_${k}_${f}`,H=C.current.get(N);if(H){u(B,H.targetAmount);return}try{let P=await v({source_currency:j,target_currency:k,amount:Number(f)});if(P.data?.data?.conversion_data?.target_amount){let _=P.data.data.conversion_data.target_amount;if(_){u(B,_?.toString()),C.current.set(N,{targetAmount:_.toString()});let Me=`${k}_${j}_${_}`;C.current.set(Me,{targetAmount:f.toString()})}}}catch(P){console.error("Error converting currency:",P)}},[v,u]),I=W(f=>q(f,e,n,o),500),S=W(f=>q(f,n,e,r||c.name),500),i=t(f=>{u(b,r||c.name),m&&I(f.target.value)},"handleMainFieldChange"),g=t(f=>{u(b,o),S(f.target.value)},"handleConversionFieldChange"),y=t(f=>{f.preventDefault(),E(j=>!j),!m&&T&&I(T)},"toggleConversion"),M=$?h(Ot,{targetCurrency:n,description:l,showConversion:m,className:`${p}-description`,onClick:y}):l;return Ie(Et,{children:[h(w,{...c,name:r||c.name,additionalProps:{currency:e},description:M,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:i}),m&&h(w,{additionalProps:{currency:n},name:o,label:s?.label||"Conversion",description:s?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:g}),h("input",{type:"hidden",name:b,value:x(b)||r||c.name})]})},"CurrencyConversionField");export{fn as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2TCLBL2U.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/now.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/debounce.js","../src/components/form/fields/CurrencyConversionField.tsx","../src/common/hooks.ts"],"sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { ReactNode, useState, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { useConvertCurrency } from '@/src/flows/Onboarding/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormFields } from '@/src/context';\nimport { useDebounce } from '@/src/common/hooks';\nimport { FormDescription } from '@/src/components/ui/form';\n\ntype DescriptionWithConversionProps = {\n description: ReactNode;\n showConversion: boolean;\n targetCurrency: string;\n className: string;\n onClick: (evt: React.MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst DescriptionWithConversion = ({\n description,\n showConversion,\n targetCurrency,\n className,\n onClick,\n}: DescriptionWithConversionProps) => {\n const { components } = useFormFields();\n const label = showConversion\n ? `Hide ${targetCurrency} conversion`\n : `Show ${targetCurrency} conversion`;\n\n const CustomButton = components?.button;\n return (\n <span className={className}>\n <FormDescription as='span'>{description}</FormDescription>{' '}\n {CustomButton ? (\n <CustomButton\n className={`${className.replace('-description', '-button')}`}\n data-type='inline'\n onClick={onClick}\n >\n {label}\n </CustomButton>\n ) : (\n <button\n className={`${className.replace('-description', '-button')}`}\n onClick={onClick}\n >\n {label}\n </button>\n )}\n </span>\n );\n};\n\nexport type CurrencyConversionFieldProps = JSFField & {\n sourceCurrency: string;\n targetCurrency: string;\n mainFieldName?: string;\n conversionFieldName: string;\n conversionProperties?: {\n label?: string;\n description?: ReactNode;\n };\n useProxy?: boolean;\n classNamePrefix: string;\n conversionType?: 'spread' | 'no_spread';\n};\n\nexport const CurrencyConversionField = ({\n sourceCurrency,\n targetCurrency,\n mainFieldName,\n conversionFieldName,\n conversionProperties,\n classNamePrefix,\n description,\n conversionType = 'spread',\n ...props\n}: CurrencyConversionFieldProps) => {\n const [showConversion, setShowConversion] = useState(false);\n const { setValue, watch } = useFormContext();\n const fieldValue = watch(mainFieldName || props.name);\n const isFirstRender = useRef(true);\n\n const conversionCache = useRef<Map<string, { targetAmount: string }>>(\n new Map(),\n );\n\n const canShowConversion =\n sourceCurrency && targetCurrency && sourceCurrency !== targetCurrency;\n\n const { mutateAsync: convertCurrency } = useConvertCurrency({\n type: conversionType,\n });\n\n // we keep track of the last input the user used, so we can make sure\n // we keep consistent currency rates\n const lastInputFieldName = `${props.name}_converted`;\n useEffect(() => {\n setValue(lastInputFieldName, mainFieldName || props.name);\n }, [setValue, mainFieldName, props.name, lastInputFieldName]);\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n\n // when source currency changes, reset the conversion field\n setValue(conversionFieldName, '');\n }, [sourceCurrency, conversionFieldName, setValue]);\n\n const convertCurrencyCallback = useCallback(\n async (\n value: string,\n fromCurrency: string,\n toCurrency: string,\n targetField: string,\n ) => {\n if (!value) return;\n\n const cacheKey = `${fromCurrency}_${toCurrency}_${value}`;\n const cached = conversionCache.current.get(cacheKey);\n\n if (cached) {\n setValue(targetField, cached.targetAmount);\n return;\n }\n\n try {\n const response = await convertCurrency({\n source_currency: fromCurrency,\n target_currency: toCurrency,\n amount: Number(value),\n });\n if (response.data?.data?.conversion_data?.target_amount) {\n const amount = response.data.data.conversion_data.target_amount;\n if (amount) {\n setValue(targetField, amount?.toString());\n // Cache both directions\n conversionCache.current.set(cacheKey, {\n targetAmount: amount.toString(),\n });\n const reverseKey = `${toCurrency}_${fromCurrency}_${amount}`;\n conversionCache.current.set(reverseKey, {\n targetAmount: value.toString(),\n });\n }\n }\n } catch (error) {\n console.error('Error converting currency:', error);\n }\n },\n [convertCurrency, setValue],\n );\n\n const debouncedConvertCurrency = useDebounce(\n (value: string) =>\n convertCurrencyCallback(\n value,\n sourceCurrency,\n targetCurrency,\n conversionFieldName,\n ),\n 500,\n );\n const debouncedConvertCurrencyReverse = useDebounce(\n (value: string) =>\n convertCurrencyCallback(\n value,\n targetCurrency,\n sourceCurrency,\n mainFieldName || props.name,\n ),\n 500,\n );\n\n const handleMainFieldChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n setValue(lastInputFieldName, mainFieldName || props.name);\n if (showConversion) {\n debouncedConvertCurrency(evt.target.value);\n }\n };\n\n const handleConversionFieldChange = (\n evt: React.ChangeEvent<HTMLInputElement>,\n ) => {\n setValue(lastInputFieldName, conversionFieldName);\n debouncedConvertCurrencyReverse(evt.target.value);\n };\n\n const toggleConversion = (evt: React.MouseEvent<HTMLButtonElement>) => {\n evt.preventDefault();\n setShowConversion((prev) => !prev);\n\n if (!showConversion && fieldValue) {\n debouncedConvertCurrency(fieldValue);\n }\n };\n\n const extraDescription = canShowConversion ? (\n <DescriptionWithConversion\n targetCurrency={targetCurrency}\n description={description}\n showConversion={showConversion}\n className={`${classNamePrefix}-description`}\n onClick={toggleConversion}\n />\n ) : (\n description\n );\n\n return (\n <>\n <TextField\n {...props}\n name={mainFieldName || props.name}\n additionalProps={{ currency: sourceCurrency }}\n description={extraDescription}\n type='text'\n inputMode='decimal'\n pattern='^[0-9.]*$'\n maxLength={15}\n onChange={handleMainFieldChange}\n />\n {showConversion && (\n <TextField\n additionalProps={{ currency: targetCurrency }}\n name={conversionFieldName}\n label={conversionProperties?.label || 'Conversion'}\n description={conversionProperties?.description}\n type='text'\n inputMode='decimal'\n pattern='^[0-9.]*$'\n maxLength={15}\n onChange={handleConversionFieldChange}\n />\n )}\n <input\n type='hidden'\n name={lastInputFieldName}\n value={watch(lastInputFieldName) || mainFieldName || props.name}\n />\n </>\n );\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport debounce from 'lodash/debounce';\n\nexport function useDebounce(\n callback: (value: string) => Promise<void>,\n delay: number,\n) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n const debouncedFn = useRef(\n debounce((value: string) => {\n callbackRef.current(value);\n }, delay),\n ).current;\n\n return useCallback(\n (value: string) => {\n debouncedFn(value);\n },\n [debouncedFn],\n );\n}\n"],"mappings":"8NAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cAyBA,SAASC,GAASC,EAAO,CACvB,IAAIC,EAAO,OAAOD,EAClB,OAA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AClCiD,GACG,CACH5B,EAASU,EAAoBjB,CAAmB,EAChDiC,EAAgCE,EAAI,OAAO,KAAK,CAClD,EALoC,+BAO9BE,EAAmBnD,EAACiD,GAA6C,CACrEA,EAAI,eAAe,EACnB9B,EAAmBiC,GAAS,CAACA,CAAI,EAE7B,CAAClD,GAAkBsB,GACrBqB,EAAyBrB,CAAU,CAEvC,EAPyB,oBASnB6B,EAAmBzB,EACvB/B,EAACE,GAAA,CACC,eAAgBI,EAChB,YAAaF,EACb,eAAgBC,EAChB,UAAW,GAAGc,CAAe,eAC7B,QAASmC,EACX,EAEAlD,EAGF,OACEH,GAAAF,GAAA,CACE,UAAAC,EAACyD,EAAA,CACE,GAAGpC,EACJ,KAAML,GAAiBK,EAAM,KAC7B,gBAAiB,CAAE,SAAUN,CAAe,EAC5C,YAAayC,EACb,KAAK,OACL,UAAU,UACV,QAAQ,YACR,UAAW,GACX,SAAUL,EACZ,EACC9C,GACCL,EAACyD,EAAA,CACC,gBAAiB,CAAE,SAAUnD,CAAe,EAC5C,KAAMW,EACN,MAAOC,GAAsB,OAAS,aACtC,YAAaA,GAAsB,YACnC,KAAK,OACL,UAAU,UACV,QAAQ,YACR,UAAW,GACX,SAAUmC,EACZ,EAEFrD,EAAC,SACC,KAAK,SACL,KAAMkC,EACN,MAAOT,EAAMS,CAAkB,GAAKlB,GAAiBK,EAAM,KAC7D,GACF,CAEJ,EAjLuC","names":["require_isObject","__commonJSMin","exports","module","isObject","value","type","__name","require_freeGlobal","__commonJSMin","exports","module","freeGlobal","require_root","__commonJSMin","exports","module","freeGlobal","freeSelf","root","require_now","__commonJSMin","exports","module","root","now","__name","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","__name","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","__name","require_Symbol","__commonJSMin","exports","module","root","Symbol","require_getRawTag","__commonJSMin","exports","module","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","result","__name","require_objectToString","__commonJSMin","exports","module","objectProto","nativeObjectToString","objectToString","value","__name","require_baseGetTag","__commonJSMin","exports","module","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","value","__name","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","__name","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","__name","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","__name","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","__name","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","useState","useCallback","useEffect","useRef","import_debounce","useCallback","useEffect","useRef","useDebounce","callback","delay","callbackRef","useRef","useEffect","debouncedFn","debounce","value","useCallback","__name","Fragment","jsx","jsxs","DescriptionWithConversion","__name","description","showConversion","targetCurrency","className","onClick","components","useFormFields","label","CustomButton","FormDescription","CurrencyConversionField","sourceCurrency","mainFieldName","conversionFieldName","conversionProperties","classNamePrefix","conversionType","props","setShowConversion","useState","setValue","watch","useFormContext","fieldValue","isFirstRender","useRef","conversionCache","canShowConversion","convertCurrency","useConvertCurrency","lastInputFieldName","useEffect","convertCurrencyCallback","useCallback","value","fromCurrency","toCurrency","targetField","cacheKey","cached","response","amount","reverseKey","error","debouncedConvertCurrency","useDebounce","debouncedConvertCurrencyReverse","handleMainFieldChange","evt","handleConversionFieldChange","toggleConversion","prev","extraDescription","TextField"]}
|
package/dist/chunk-67MPL47V.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as _e}from"./chunk-7FMR3EIX.js";import{a as B}from"./chunk-ND4FAALX.js";import{a as he,b as Ve,c as Ue,d as Ge,e as Je,f as qe,g as je,h as Ke,i as Ye,j as Ze,l as Xe,m as ve,n as Qe,o as Ce,p as xe,r as be,t as et,u as tt,v as ot}from"./chunk-ZIN2OWTH.js";import{b as S}from"./chunk-KQPDXXG3.js";import{a as ye,b as O}from"./chunk-LJGCFFAT.js";import{a as re,b as ne,c as b,d as He,e as Be,f as Oe,g as ze,h as k,i as w,j as N,k as P,l as R,m as D}from"./chunk-66N57DKF.js";import{g as Ae}from"./chunk-2SO4LW7V.js";import{a as v,e as oe}from"./chunk-L3Z2G32A.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as vo,useEffect as Co,useRef as Wt}from"react";import{Fragment as Bt,jsx as A,jsxs as ae}from"react/jsx-runtime";function se({name:e,defaultValue:t,description:o,label:n,onChange:i,multiple:d,options:u,component:f,...g}){let{components:p}=S(),{control:a}=b(),c=r((s,m,F)=>{if(d&&F){let l=s.value?[...s.value]:[];m?l.includes(F)||s.onChange([...l,F]):s.onChange(l.filter(_=>_!==F))}else s.onChange(m)},"handleCheckboxChange");return A(k,{control:a,name:e,defaultValue:t,render:({field:s,fieldState:m})=>{let F=f||p?.checkbox;if(F){let l={name:e,description:o,label:n,defaultValue:t,multiple:d,options:u,...g};return A(F,{field:{...s,onChange:r((_,C)=>{c(s,_.target.checked,C),i?.(_.target.checked===!0,C)},"onChange")},fieldState:m,fieldData:l})}return ae(w,{"data-field":e,className:v(`RemoteFlows__CheckBoxField__Item__${e}`),children:[A(P,{children:ae(Bt,{children:[u&&d?A(N,{children:n}):null,u&&d?u.map(l=>ae("div",{className:"flex space-x-2",children:[A(he,{id:l.value,onCheckedChange:_=>{c(s,_===!0,l.value),i?.(_===!0,l.value)},checked:s.value?.includes(l.value),className:"RemoteFlows__CheckBox__Input"}),A(N,{htmlFor:l.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:l.label})]},l.value)):ae("div",{className:"flex space-x-2",children:[A(he,{id:e,onCheckedChange:l=>{c(s,l===!0,e),i?.(l===!0,e)},checked:s.value,className:"RemoteFlows__CheckBox__Input"}),A(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:n})]})]})}),o&&A(R,{children:o}),m.error&&A(D,{})]})}})}r(se,"CheckBoxField");import{CalendarIcon as Vt}from"lucide-react";import{PopoverClose as Ut}from"@radix-ui/react-popover";import{ChevronLeft as Ot,ChevronRight as At}from"lucide-react";import{DayPicker as zt}from"react-day-picker";import{jsx as Se}from"react/jsx-runtime";function rt({className:e,classNames:t,showOutsideDays:o=!0,...n}){return Se(zt,{showOutsideDays:o,className:v("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:v(ye({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:v("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:v(ye({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:i,...d})=>Se(Ot,{className:v("size-4",i),...d}),"IconLeft"),IconRight:r(({className:i,...d})=>Se(At,{className:v("size-4",i),...d}),"IconRight")},...n})}r(rt,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as ie}from"react/jsx-runtime";function le({...e}){return ie(z.Root,{"data-slot":"popover",...e})}r(le,"Popover");function me({...e}){return ie(z.Trigger,{"data-slot":"popover-trigger",...e})}r(me,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:o=4,...n}){return ie(z.Portal,{children:ie(z.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:v("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}r(de,"PopoverContent");import{format as nt}from"date-fns";import{Fragment as Gt,jsx as I,jsxs as ke}from"react/jsx-runtime";function at({description:e,label:t,name:o,minDate:n,maxDate:i,onChange:d,component:u,...f}){let{components:g}=S(),{control:p}=b(),a;f.meta?.mot&&typeof f.meta.mot=="number"?a=Ae(f.meta.mot):n&&(a=new Date(`${n}T00:00:00`));let c;return i&&(c=new Date(`${i}T23:59:59`)),I(k,{control:p,name:o,render:({field:s,fieldState:m})=>{let F=u||g?.date;if(F){let l={description:e,label:t,name:o,onChange:d,...a&&{minDate:a.toISOString()},...c&&{maxDate:c.toISOString()},...f};return I(F,{field:{...s,onChange:r(_=>{s.onChange(_),d?.(_)},"onChange")},fieldState:m,fieldData:l})}return ke(w,{"data-field":o,className:`flex flex-col RemoteFlows__DatePickerField__Item__${o}`,children:[I(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),ke(le,{children:[I(me,{asChild:!0,children:I(P,{children:I("div",{children:ke(O,{type:"button",variant:"outline",className:v("w-full pl-3 text-left font-normal",!s.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${o}`,children:[s.value&&I(Gt,{children:nt(s.value,"yyyy-MM-dd")}),I(Vt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),I(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:I(rt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:s.value?new Date(s.value):void 0,onSelect:l=>{s.onChange(l?nt(l,"yyyy-MM-dd"):null),d?.(l)},defaultMonth:a,components:{DayContent:r(l=>I(Ut,{children:l.date.getDate()}),"DayContent")},disabled:l=>!!(a&&l<a||c&&l>c)})})]}),e?I(R,{children:e}):null,m.error&&I(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(at,"DatePickerField");import{jsx as V,jsxs as qt}from"react/jsx-runtime";var Jt=r((e,t)=>{if(!t)return null;for(let o of e)if(o.size>t){let n=Math.round(t/1048576),i=Math.round(o.size/(1024*1024));return`File "${o.name}" exceeds maximum size of ${n}MB (file is ${i}MB)`}return null},"validateFileSize");function st({name:e,description:t,label:o,multiple:n,onChange:i,component:d,accept:u,maxSize:f,...g}){let{components:p}=S(),{control:a,setError:c,clearErrors:s}=b(),m=r(async(F,l)=>{let _=Jt(F,f);if(_){c(e,{message:_});return}s(e),l.onChange(F),i?.(F)},"handleOnChange");return V(k,{control:a,name:e,render:({field:F,fieldState:l})=>{let _=d||p?.file;if(_){let C={name:e,description:t,label:o,multiple:n,accept:u,maxFileSize:f,...g};return V(_,{field:{...F,value:F.value,onChange:r(async x=>m(x,F),"onChange")},fieldState:l,fieldData:C})}return qt(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[V(N,{className:"RemoteFlows__FileUpload__Label",children:o}),V(P,{children:V(Ve,{onChange:C=>m(C,F),multiple:n,className:v("RemoteFlows__FileUpload__Input"),accept:u,files:F.value})}),t&&V("div",{className:"flex items-center justify-between",children:V(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),l.error&&V(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(st,"FileUploadField");import{jsx as Ne}from"react/jsx-runtime";function ce(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.number;return n?Ne(k,{control:o,name:e.name,render:({field:i,fieldState:d})=>Ne(n,{field:{...i,onChange:r(u=>{i.onChange(u),e.onChange?.(u)},"onChange")},fieldState:d,fieldData:e})}):Ne(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ce,"NumberField");import{Fragment as jt}from"react";import{jsx as M,jsxs as we}from"react/jsx-runtime";function it({name:e,defaultValue:t,description:o,label:n,options:i,onChange:d,component:u,...f}){let{components:g}=S(),{control:p}=b();return M(k,{control:p,name:e,defaultValue:t,render:({field:a,fieldState:c})=>{let s=u||g?.radio;if(s){let m={name:e,defaultValue:t,description:o,label:n,options:i,...f};return M(s,{field:{...a,onChange:r(F=>{a.onChange(F),d?.(F)},"onChange")},fieldState:c,fieldData:m})}return M("fieldset",{"data-field":e,className:v("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),children:we(w,{children:[M("legend",{children:n}),o&&M(R,{children:o}),M(P,{children:M(Ue,{"aria-label":n||e,onValueChange:m=>{a.onChange(m),d?.(m)},value:a.value,className:"flex flex-col space-y-3",children:i?.map(m=>M(jt,{children:we(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[M(P,{children:M(Ge,{value:m.value,className:"RemoteFlows__RadioField__Input",disabled:m.disabled})}),we("div",{children:[M(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:m.label}),m.description&&M(R,{className:"mt-2",children:m.description})]})]})},m.value))})}),c.error&&M(D,{})]})})}})}r(it,"RadioGroupField");import{jsx as W,jsxs as lt}from"react/jsx-runtime";function mt({label:e,name:t,options:o,defaultValue:n,description:i,onChange:d,component:u,...f}){let{control:g}=b(),{components:p}=S();return W(k,{defaultValue:n,control:g,name:t,render:({field:a,fieldState:c})=>{let s=u||p?.select;if(s){let m={label:e,name:t,options:o,defaultValue:n,description:i,onChange:d,...f};return W(s,{field:{...a,onChange:r(F=>{let l=f.jsonType==="number"?Number(F):F;a.onChange(l),d?.(l)},"onChange")},fieldState:c,fieldData:m})}return lt(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[W(N,{className:"RemoteFlows__SelectField__Label",children:e}),W(P,{children:W("div",{className:"relative",children:lt(Je,{value:a.value||"",onValueChange:m=>{let F=f.jsonType==="number"?Number(m):m;a.onChange(F),d?.(F)},children:[W(Ke,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!c.error,"aria-label":e,children:W("span",{className:"absolute",children:W(je,{placeholder:e})})}),W(Ye,{className:"RemoteFlows__SelectField__Content",children:W(qe,{className:"RemoteFlows__SelectField__Group",children:o.map(m=>W(Ze,{value:m.value,className:"RemoteFlows__SelectField__SelectItem",disabled:m.disabled,children:m.label},m.value))})})]})})}),i&&W(R,{children:i}),c.error&&W(D,{})]})}})}r(mt,"SelectField");import{useState as eo}from"react";import{Fragment as Kt,useState as Yt}from"react";import{Check as Zt,ChevronDownIcon as Xt,X as Qt}from"lucide-react";import{Command as K}from"cmdk";import{SearchIcon as zr}from"lucide-react";import{jsx as Y,jsxs as Jr}from"react/jsx-runtime";function dt({className:e,...t}){return Y(K,{"data-slot":"command",className:v("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(dt,"Command");function ct({className:e,...t}){return Y(K.List,{"data-slot":"command-list",className:v("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ct,"CommandList");function ut({...e}){return Y(K.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ut,"CommandEmpty");function pt({className:e,...t}){return Y(K.Group,{"data-slot":"command-group",className:v("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(pt,"CommandGroup");function Ft({className:e,...t}){return Y(K.Separator,{"data-slot":"command-separator",className:v("bg-border -mx-1 h-px",e),...t})}r(Ft,"CommandSeparator");function ft({className:e,...t}){return Y(K.Item,{"data-slot":"command-item",className:v("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(ft,"CommandItem");import{jsx as E,jsxs as Z}from"react/jsx-runtime";function ue({options:e,selected:t,onChange:o,placeholder:n,...i}){let[d,u]=Yt(!1),f=r(a=>{o(t.filter(c=>c.value!==a.value))},"handleUnselect"),g=e.some(a=>a.category),p=e.reduce((a,c)=>{let s=c.category||"Uncategorized";return a[s]||(a[s]=[]),a[s].push(c),a},{});return Z(le,{open:d,onOpenChange:u,...i,children:[E(me,{children:Z(O,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",type:"button",children:[E("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(a=>Z(Xe,{variant:"secondary",className:"mr-1 mb-1",children:[a.label,E("div",{role:"button",tabIndex:0,"aria-label":`remove ${a.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:c=>{c.key==="Enter"&&f(a)},onMouseDown:c=>{c.preventDefault(),c.stopPropagation()},onClick:()=>f(a),children:E(Qt,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},a.label)):E("span",{className:"text-foreground",children:n})}),E(Xt,{className:"size-4"})]})}),E(de,{align:"start",className:"w-full p-0",children:E(dt,{children:Z(ct,{children:[E(ut,{children:"No item found."}),Object.entries(p).map(([a,c],s)=>Z(Kt,{children:[s>0&&E(Ft,{}),E(pt,{heading:g?a:void 0,children:c.map(m=>{let F=t.some(l=>l.value===m.value);return Z(ft,{onSelect:()=>{o(F?t.filter(l=>l.value!==m.value):[...t,m])},children:[E(Zt,{className:v("mr-2 h-4 w-4",F?"opacity-100":"opacity-0")}),m.label]},m.label)})})]},a))]})})})]})}r(ue,"MultiSelect");import{jsx as U,jsxs as to}from"react/jsx-runtime";function gt({label:e,name:t,options:o,defaultValue:n,description:i,onChange:d,$meta:u,component:f,...g}){let{control:p}=b(),{components:a}=S(),[c,s]=eo([]);return U(k,{defaultValue:n,control:p,name:t,render:({field:m,fieldState:F})=>{let l=f||a?.countries;if(l){let x={label:e,name:t,options:o,defaultValue:n,description:i,onChange:d,$meta:u,...g};return U(l,{field:{...m,onChange:r(T=>{m.onChange(T),d?.(T)},"onChange")},fieldState:F,fieldData:x})}let _=[...Object.entries(u?.regions||{}).map(([x,T])=>({value:T,label:x,category:"Regions"})),...Object.entries(u?.subregions||{}).map(([x,T])=>({value:T,label:x,category:"Subregions"})),...o.map(x=>({...x,value:x.value,label:x.label,category:"Countries"}))],C=r(x=>{let T=x.map(({value:j})=>j);m.onChange(T),d?.(T),s(x)},"handleChange");return to(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[U(N,{className:"RemoteFlows__CountryField__Label",children:e}),U(P,{children:U(ue,{options:_,selected:c,onChange:C,...g})}),i&&U(R,{children:i}),F.error&&U(D,{})]})}})}r(gt,"CountryField");import*as _t from"react";import{jsx as oo}from"react/jsx-runtime";var Pe=_t.forwardRef(({className:e,...t},o)=>oo("textarea",{className:v("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));Pe.displayName="Textarea";import{jsx as G,jsxs as Re}from"react/jsx-runtime";function ht({name:e,description:t,label:o,onChange:n,maxLength:i,component:d,...u}){let{components:f}=S(),{control:g}=b();return G(k,{control:g,name:e,render:({field:p,fieldState:a})=>{let c=d||f?.textarea;if(c){let m={name:e,description:t,label:o,maxLength:i,...u};return G(c,{field:{...p,onChange:r(F=>{p.onChange(F),n?.(F)},"onChange")},fieldState:a,fieldData:m})}let s=p.value?.length??0;return Re(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[G(N,{className:"RemoteFlows__TextArea__Label",children:o}),G(P,{children:G(Pe,{...p,value:p.value??"",onChange:m=>{p.onChange(m),n?.(m)},className:v(a.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:o})}),(t||i)&&Re("div",{className:"flex items-center justify-between",children:[t&&G(R,{className:"RemoteFlows__TextArea__Description",children:t}),i&&Re("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[s,"/",i]})]}),a.error&&G(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(ht,"TextAreaField");import{jsx as De}from"react/jsx-runtime";function yt(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.email;return n?De(k,{control:o,name:e.name,render:({field:i,fieldState:d})=>De(n,{field:{...i,onChange:r(u=>{i.onChange(u),e.onChange?.(u)},"onChange")},fieldState:d,fieldData:e})}):De(B,{...e,type:"email"})}r(yt,"EmailField");import{jsx as vt}from"react/jsx-runtime";function Ct(e){let{control:t}=b();return vt(k,{control:t,name:e.name,render:({field:o})=>vt("input",{...o,type:"hidden"})})}r(Ct,"HiddenField");import mo,{useEffect as co,useState as Dt}from"react";var xt=r((e,t,o)=>{if(e&&"reportValidity"in e){let n=re(o,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},"r"),Te=r((e,t)=>{for(let o in t.fields){let n=t.fields[o];n&&n.ref&&"reportValidity"in n.ref?xt(n.ref,o,e):n&&n.refs&&n.refs.forEach(i=>xt(i,o,e))}},"o"),St=r((e,t)=>{t.shouldUseNativeValidation&&Te(e,t);let o={};for(let n in e){let i=re(t.fields,n),d=Object.assign(e[n]||{},{ref:i&&i.ref});if(ro(t.names||Object.keys(e),n)){let u=Object.assign({},re(o,n));ne(u,"root",d),ne(o,n,u)}else ne(o,n,d)}return o},"s"),ro=r((e,t)=>{let o=bt(t);return e.some(n=>bt(n).match(`^${o}\\.\\d+`))},"i");function bt(e){return e.replace(/\]|\[/g,"")}r(bt,"n");function kt(e,t,o){return t===void 0&&(t={}),o===void 0&&(o={}),function(n,i,d){try{return Promise.resolve((function(u,f){try{var g=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[o.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:i}))).then(function(p){return d.shouldUseNativeValidation&&Te({},d),{values:o.raw?Object.assign({},n):p,errors:{}}}))}catch(p){return f(p)}return g&&g.then?g.then(void 0,f):g})(0,function(u){if(!u.inner)throw u;return{values:{},errors:St((f=u,g=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(f.inner||[]).reduce(function(p,a){if(p[a.path]||(p[a.path]={message:a.message,type:a.type}),g){var c=p[a.path].types,s=c&&c[a.type];p[a.path]=He(a.path,g,p,a.type,s?[].concat(s,a.message):a.message)}return p},{})),d)};var f,g}))}catch(u){return Promise.reject(u)}}}r(kt,"o");import*as $ from"yup";import Nt from"lodash.groupby";import X from"lodash.capitalize";var wt=60,pe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function no(e){if(e<60)return`${e}m`;let t=Math.floor(e/wt),o=e%wt;return o>0?`${t}h${o}m`:`${t}h`}r(no,"convertBreakDurationToHours");function Pt(e){let t=e.reduce((o,n)=>n.hours+o,0);return Number(t.toFixed(2))}r(Pt,"calculateTotalWorkHours");function ao(e,t){let o=t.map(({day:d})=>d.toLowerCase()),n=o.indexOf(e),i=null;for(;n<o.length&&!i;){let d=o[n],u=o[n+1],f=pe.indexOf(d)+1;pe[f]===u||(i=d),n+=1}return i}r(ao,"findLastConsecutiveDay");function so(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(so,"shouldSummarizeSchedule");function io(e){return Number.parseInt(e.break_duration_minutes)>0}r(io,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(so),o=Nt(t,f=>`${f.start_time}|${f.end_time}`),n=e.filter(io),i=Nt(n,"break_duration_minutes"),d=Object.keys(o).map(f=>{let g=o[f],p=g[0].day,[a,c]=f.split("|"),s=`from <span>${a.replace(":","h")}</span> to <span>${c.replace(":","h")}</span>`,m=ao(p,g),l=(m?g.findIndex(_=>_.day===m):-1)===g.length-1;return g.length===1?`${X(p)}, ${s}`:!l||!m?g.reduce((_,C,x)=>{let T=X(C.day);return x===g.length-1?`${_}and ${T}, ${s}`:`${_}<span>${T}</span>, `},""):`<span>${X(p)}</span> to <span>${X(m)}</span>, ${s}`}),u=Object.keys(i).reverse().map((f,g)=>{let p=g===0,a=i[f],c=no(parseInt(f,10));if(Object.keys(i).length===1)return`With ${c} daily breaks`;if(a.length===1){let s=`${c} break on ${X(a[0].day)}.`;return p?`With ${s}`:s}return a.reduce((s,m,F)=>{let l=X(m.day);return F===0?`${s} ${l}`:F===a.length-1?`${s}, and ${l}.`:`${s}, ${l}`},p?`With ${c} break on`:`${c} break on`)});return{workHoursSummary:d,breakSummary:u}}r(Rt,"buildWorkScheduleSummary");function $e(e){let{checked:t,start_time:o,end_time:n,break_duration_minutes:i}=e;if(!t)return 0;let[d,u]=o.split(":").map(Number),[f,g]=n.split(":").map(Number),p=d*60+u,s=(f*60+g-p-Number.parseInt(i||"0"))/60;return s===Math.floor(s)?s:Number(s.toFixed(2))}r($e,"calculateHours");var lo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function Fe(e){return lo[e]}r(Fe,"getShortWeekday");import{jsx as y,jsxs as L}from"react/jsx-runtime";var uo=$.object({day:$.string().required(),checked:$.boolean().required(),start_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:$.number().default(0),break_duration_minutes:$.string().default("0")}),po=$.object({schedule:$.array(uo)});function Fo({defaultSchedule:e,onSubmit:t}){let[o,n]=Dt(!1),i=pe.map(l=>{let _=e.find(C=>C.day.toLowerCase()===Fe(l).toLowerCase()||C.day.toLowerCase()===l.toLowerCase());return _?{..._,day:Fe(l),checked:!0}:{...e[0],checked:!1,day:Fe(l)}}),d=Oe({defaultValues:{schedule:i},resolver:kt(po)}),{handleSubmit:u,watch:f,reset:g,control:p,formState:a}=d,{fields:c}=Be({name:"schedule",control:p}),s=f("schedule");function m(l){let _=l.schedule.filter(({checked:C})=>C).map(C=>({...C,hours:$e(C)}));t(_),n(!1)}r(m,"handleSubmitWorkingHours");function F(){g(),n(!1)}return r(F,"handleCancel"),y("div",{className:"flex items-center justify-between",children:L(ve,{open:o,onOpenChange:n,children:[y(Qe,{asChild:!0,children:y(O,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),L(Ce,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(xe,{children:y(be,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(ze,{...d,children:L("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[L("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),L("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:c.map((l,_)=>{let C=s[_],x=$e(C);return L(mo.Fragment,{children:[L("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(se,{label:l.day,name:`schedule.${_}.checked`})}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${_}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${_}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(x)?"-":`${x} hours`})]}),L("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(B,{name:`schedule.${_}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},l.id)})})]}),Object.keys(a.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),L("div",{className:"flex gap-4 pt-4",children:[y(O,{type:"button",className:"reset-button",variant:"outline",onClick:F,children:"Cancel"}),y(O,{type:"button",className:"submit-button",onClick:u(m),children:"Save Schedule"})]})]})})]})]})})}r(Fo,"WorkScheduleSelectionForm");function Tt(e){let{components:t}=S(),{setValue:o,control:n,watch:i}=b(),d=i(e.name),[u,f]=Dt(d),{workHoursSummary:g,breakSummary:p}=Rt(u),a=Pt(u);co(()=>{o(e.name,u)},[u,e.name,o]);function c(m){f(m)}r(c,"onSubmit");let s=e.component||t?.["work-schedule"];return s?y(k,{control:n,name:e.name,render:({field:m,fieldState:F})=>y(s,{field:{...m,onChange:r(l=>{m.onChange(l),e.onChange?.(l)},"onChange")},fieldState:F,fieldData:{...e,defaultFormattedValue:{workHoursSummary:g,breakSummary:p,totalWorkHours:a}}})}):L("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),L("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:g.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:p.join()}),L("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:a})," hours per week"]}),y(Fo,{defaultSchedule:u,onSubmit:c})]})]})}r(Tt,"WorkScheduleField");import{useState as fo}from"react";import{jsx as J,jsxs as go}from"react/jsx-runtime";function $t({label:e,name:t,options:o,defaultValue:n,description:i,onChange:d,component:u,...f}){let{control:g}=b(),{components:p}=S(),[a,c]=fo();return J(k,{defaultValue:n,control:g,name:t,render:({field:s,fieldState:m})=>{let F=u||p?.["multi-select"];if(F){let _={label:e,name:t,options:o,defaultValue:n,description:i,onChange:d,...f};return J(F,{field:{...s,onChange:r(C=>{s.onChange(C),d?.(C)},"onChange")},fieldState:m,fieldData:_})}let l=a||o.filter(_=>s.value.includes(_.value));return go(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[J(N,{className:"RemoteFlows__SelectField__Label",children:e}),J(P,{children:J(ue,{options:o,selected:l,onChange:_=>{let C=_.map(({value:x})=>x);s.onChange(C),d?.(C),c(_)},...f})}),i&&J(R,{children:i}),m.error&&J(D,{})]})}})}r($t,"MultiSelectField");import{jsx as _o}from"react/jsx-runtime";var It=r(e=>_o(ce,{maxLength:15,...e}),"MoneyField");var Ie={checkbox:se,text:B,email:yt,money:It,select:mt,"multi-select":$t,radio:it,number:ce,file:st,date:at,textarea:ht,countries:gt,hidden:Ct,"work-schedule":Tt};import{AlertCircle as ho}from"lucide-react";import{jsx as fe,jsxs as yo}from"react/jsx-runtime";function Mt({title:e,description:t,severity:o}){let{components:n}=S();if(n?.statement){let i=n?.statement;return fe(i,{data:{title:e,description:oe(t),severity:o}})}return yo(et,{variant:"warning",children:[fe(ho,{className:"h-4 w-4"}),e&&fe(tt,{children:e}),t&&fe(ot,{dangerouslySetInnerHTML:{__html:oe(t)}})]})}r(Mt,"Statement");import{Fragment as bo,jsx as H,jsxs as q}from"react/jsx-runtime";var xo=r(({isExpanded:e,onToggle:t,className:o,...n})=>H(O,{type:"button",className:v("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",o),variant:"default",onClick:t,...n,children:e?"Remove":"Define"}),"DefaultToggleButton");function Et({label:e,name:t,fields:o,description:n,components:i,statement:d,isFlatFieldset:u,extra:f,variant:g="outset",features:p,meta:a}){let{helpCenter:c}=a||{},{watch:s,setValue:m,trigger:F,formState:l}=b(),{components:_}=S(),C=p?.toggle?.stateField,x=C?s(C):p?.toggle?.defaultExpanded??!0,T=o.map(({name:h})=>`${t}.${h}`),j=s(T),Me=Wt(j),Q=Wt(null),Lt=r(()=>{C&&m(C,!x)},"toggleExpanded");Co(()=>{let h=j,ee=Me.current,ge=l.isSubmitted||l.submitCount>0,Le=!1;for(let te=0;te<h.length;te++)if(h[te]!==void 0&&ee[te]!==h[te]){Le=!0;break}return Le&&ge&&(Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{F()},50)),Me.current=[...h],()=>{Q.current&&clearTimeout(Q.current)}},[j,F,l.isSubmitted,l.submitCount]);let Ht=_?.fieldsetToggle||xo,We=`${t}-content`,Ee=`${t}-header`;return q("fieldset",{className:v("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[H("legend",{className:v("text-sm font-semibold px-2",g==="inset"&&"hidden"),children:e}),c?.callToAction&&c?.id&&g==="outset"&&H(_e,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:c.id,children:c.callToAction}),g==="inset"&&q(bo,{children:[q("div",{className:"RemoteFlows__FieldSetField__Header",id:Ee,"data-state":x?"expanded":"collapsed","aria-expanded":x,children:[H("h3",{className:v("RemoteFlows__FieldSetField__Title"),children:e}),p?.toggle?.enabled&&H(Ht,{isExpanded:x,onToggle:Lt,"aria-expanded":x,"aria-controls":We,"aria-label":`${x?"Hide":"Show"} ${e}`,className:v("RemoteFlows__FieldSetField__Toggle",p.toggle?.className),children:x?p.toggle.labels?.collapse??"Remove":p.toggle.labels?.expand??"Define"})]}),c?.callToAction&&c?.id&&H(_e,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:c.id,children:c.callToAction})]}),x&&q("div",{id:We,"aria-labelledby":Ee,role:"region",children:[n?H("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:oe(n)}}):null,q("div",{className:"grid gap-4",children:[o.map(h=>{if(h.calculateDynamicProperties&&(h={...h,...h.calculateDynamicProperties(j,h)||{}}),h.isVisible===!1||h.deprecated)return null;if(h.inputType==="fieldset")return H(Et,{...h,name:`${u?h.name:`${t}.${h.name}`}`,components:i},`${u?h.name:`${t}.${h.name}`}`);if(h.inputType==="fieldset-flat")return H(Et,{...h,name:`${u?h.name:`${t}.${h.name}`}`,components:i,isFlatFieldset:!0},`${u?h.name:`${t}.${h.name}`}`);let ee=Ie[h.inputType];if(h.Component){let{Component:ge}=h;return H(ge,{...h},h.name)}return ee?(h.inputType==="select"&&h.multiple&&(ee=Ie["multi-select"]),q(vo,{children:[H(ee,{...h,name:`${u?h.name:`${t}.${h.name}`}`,component:i?.[h.inputType]}),h.extra?h.extra:null]},`${u?h.name:`${t}.${h.name}`}`)):q("p",{className:"error",children:["Field type ",h.inputType," not supported"]})}),f||null,d?H(Mt,{...d}):null]})]})]})}r(Et,"FieldSetField");export{Ie as a,Mt as b,Et as c};
|
|
2
|
-
//# sourceMappingURL=chunk-67MPL47V.js.map
|