@mrfylke/contact-form 0.1.31 → 0.1.33
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/README.md +19 -3
- package/lib/components/form/file-input.js +1 -1
- package/lib/components/form/textarea.d.ts +3 -2
- package/lib/components/form/textarea.d.ts.map +1 -1
- package/lib/components/form/textarea.js +6 -4
- package/lib/components/icon/generated-icons.d.ts +6 -6
- package/lib/components/icon/generated-icons.js +16 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/lines/use-lines.d.ts +2 -2
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +14 -21
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/injuryForm.js +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +2 -2
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/types.d.ts +46 -21
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/refund/events.d.ts +1 -1
- package/lib/refund/events.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +2 -2
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +5 -2
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +7 -4
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +17 -9
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +2 -5
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +14 -5
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +2 -7
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +12 -6
- package/lib/refund/refundFormMachine.d.ts +19 -10
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +42 -15
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +5 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +5 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -11
- package/lib/ticketing/index.d.ts.map +1 -1
- package/lib/ticketing/index.js +8 -2
- package/lib/ticketing/ticketingStateMachine.d.ts +6 -4
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
- package/lib/ticketing/ticketingStateMachine.js +4 -1
- package/lib/translations/commons.d.ts +8 -2
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/commons.js +4 -0
- package/lib/translations/index.d.ts +3 -2
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +5 -1
- package/lib/translations/language-context.d.ts +4 -10
- package/lib/translations/language-context.d.ts.map +1 -1
- package/lib/translations/language-context.js +12 -5
- package/lib/translations/lobot.d.ts +9 -0
- package/lib/translations/lobot.d.ts.map +1 -0
- package/lib/translations/lobot.js +6 -0
- package/lib/translations/merge-overrides.d.ts +2 -0
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +2 -0
- package/lib/translations/pages/contact.d.ts +19 -22
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +52 -40
- package/lib/translations/terms/default-terms.d.ts +23 -0
- package/lib/translations/terms/default-terms.d.ts.map +1 -0
- package/lib/translations/terms/default-terms.js +25 -0
- package/lib/translations/terms/index.d.ts +4 -0
- package/lib/translations/terms/index.d.ts.map +1 -0
- package/lib/translations/terms/index.js +9 -0
- package/lib/translations/terms/placeholders.d.ts +16 -0
- package/lib/translations/terms/placeholders.d.ts.map +1 -0
- package/lib/translations/terms/placeholders.js +16 -0
- package/lib/translations/terms/types.d.ts +17 -0
- package/lib/translations/terms/types.d.ts.map +1 -0
- package/lib/translations/terms/types.js +2 -0
- package/lib/translations/translations-context.d.ts +6 -0
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/translations-context.js +25 -0
- package/lib/translations/types.d.ts +12 -5
- package/lib/translations/types.d.ts.map +1 -1
- package/lib/types.d.ts +3 -3
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/rich-text.d.ts +9 -0
- package/lib/utils/rich-text.d.ts.map +1 -0
- package/lib/utils/rich-text.js +33 -0
- package/lib/utils/rich-text.module.css +5 -0
- package/lib/validation/validationRules.d.ts.map +1 -1
- package/lib/validation/validationRules.js +2 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refundCarForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundCarForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"refundCarForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundCarForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiB7D,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,iBAAiB,kBAAkB,gCAodhE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -7,9 +7,11 @@ const components_1 = require("../../../components");
|
|
|
7
7
|
const translations_1 = require("../../../translations");
|
|
8
8
|
const typography_1 = require("../../../components/typography");
|
|
9
9
|
const checkbox_1 = require("../../../components/checkbox");
|
|
10
|
+
const context_1 = require("../../../modules/config/context");
|
|
10
11
|
const RefundCarForm = ({ state, send }) => {
|
|
11
12
|
const { t } = (0, translations_1.useTranslation)();
|
|
12
13
|
const PageText = (0, translations_1.usePageText)();
|
|
14
|
+
const { features } = (0, context_1.useContactFormConfig)();
|
|
13
15
|
const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
|
|
14
16
|
const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
|
|
15
17
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundCar.aboutTheCarTrip.title), children: [t(PageText.Contact.refund.refundCar.info) && ((0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.refundCar.info) })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "kilometersDriven", label: t(PageText.Contact.input.kilometersDriven.label), type: "text", name: "kilometersDriven", value: state.context.kilometersDriven || '', isRequired: true, errorMessage: state.context?.errorMessages['kilometersDriven']?.[0] || undefined, onChange: (e) => send({
|
|
@@ -125,11 +127,12 @@ const RefundCarForm = ({ state, send }) => {
|
|
|
125
127
|
type: 'ON_INPUT_CHANGE',
|
|
126
128
|
inputName: 'bankAccountNumber',
|
|
127
129
|
value: e.target.value,
|
|
128
|
-
}) }),
|
|
130
|
+
}) }), features?.enableInternationalBankAccountInTravelGuarantee !==
|
|
131
|
+
false && ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
|
|
129
132
|
type: 'ON_INPUT_CHANGE',
|
|
130
133
|
inputName: 'hasInternationalBankAccount',
|
|
131
134
|
value: !state.context.hasInternationalBankAccount,
|
|
132
|
-
}) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
|
|
135
|
+
}) })), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
|
|
133
136
|
type: 'ON_INPUT_CHANGE',
|
|
134
137
|
inputName: 'IBAN',
|
|
135
138
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiB7D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,gCA2blE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -6,16 +6,18 @@ const use_lines_1 = require("../../../lines/use-lines");
|
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const translations_1 = require("../../../translations");
|
|
8
8
|
const checkbox_1 = require("../../../components/checkbox");
|
|
9
|
+
const context_1 = require("../../../modules/config/context");
|
|
9
10
|
const RefundTaxiForm = ({ state, send }) => {
|
|
10
11
|
const { t } = (0, translations_1.useTranslation)();
|
|
11
12
|
const PageText = (0, translations_1.usePageText)();
|
|
13
|
+
const { features } = (0, context_1.useContactFormConfig)();
|
|
12
14
|
const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
|
|
13
15
|
const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundTaxi.taxiReceipt.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundTaxi.taxiReceipt.title), children: [state.context.includeAmountInRefundTaxi && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
|
|
15
17
|
type: 'ON_INPUT_CHANGE',
|
|
16
18
|
inputName: 'amount',
|
|
17
19
|
value: e.target.value,
|
|
18
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "receiptAttachments", label: t(PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "receiptAttachments", isRequired: true, onChange: (files) => {
|
|
20
|
+
}) })), (0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "receiptAttachments", label: t(PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "receiptAttachments", isRequired: true, onChange: (files) => {
|
|
19
21
|
send({
|
|
20
22
|
type: 'ON_INPUT_CHANGE',
|
|
21
23
|
inputName: 'receiptAttachments',
|
|
@@ -124,11 +126,12 @@ const RefundTaxiForm = ({ state, send }) => {
|
|
|
124
126
|
type: 'ON_INPUT_CHANGE',
|
|
125
127
|
inputName: 'bankAccountNumber',
|
|
126
128
|
value: e.target.value,
|
|
127
|
-
}) }),
|
|
129
|
+
}) }), features?.enableInternationalBankAccountInTravelGuarantee !==
|
|
130
|
+
false && ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
|
|
128
131
|
type: 'ON_INPUT_CHANGE',
|
|
129
132
|
inputName: 'hasInternationalBankAccount',
|
|
130
133
|
value: !state.context.hasInternationalBankAccount,
|
|
131
|
-
}) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
|
|
134
|
+
}) })), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
|
|
132
135
|
type: 'ON_INPUT_CHANGE',
|
|
133
136
|
inputName: 'IBAN',
|
|
134
137
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAkBhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,gCAqIpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,+BAWtB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AppTicketRefund = void 0;
|
|
4
4
|
exports.default = AppTicketRefundContent;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const refundFormMachine_1 = require("../../refundFormMachine");
|
|
6
7
|
const components_1 = require("../../../components");
|
|
7
8
|
const translations_1 = require("../../../translations");
|
|
8
9
|
const context_1 = require("../../../modules/config/context");
|
|
@@ -10,27 +11,34 @@ const use_lines_1 = require("../../../lines/use-lines");
|
|
|
10
11
|
const AppTicketRefund = ({ state, send }) => {
|
|
11
12
|
const PageText = (0, translations_1.usePageText)();
|
|
12
13
|
const { t } = (0, translations_1.useTranslation)();
|
|
13
|
-
const { features } = (0, context_1.useContactFormConfig)();
|
|
14
|
+
const { features, formSchemaOverrides } = (0, context_1.useContactFormConfig)();
|
|
14
15
|
const includeCustomerNumberAndPurchasePlatform = features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund;
|
|
15
|
-
|
|
16
|
+
const areOrderIdAndCustomerNumberRelevant = (0, refundFormMachine_1.hasOrderIdAndCustomerNumber)(state.context.purchasePlatform);
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.appTicketRefund.label), children: [includeCustomerNumberAndPurchasePlatform && ((0, jsx_runtime_1.jsx)(components_1.Select, { id: "purchasePlatform", label: t(PageText.Contact.input.purchasePlatform.label), value: state.context.purchasePlatform || '', onChange: (value) => send({
|
|
18
|
+
type: 'ON_PURCHASE_PLATFORM_CHANGE',
|
|
19
|
+
value: value,
|
|
20
|
+
}), isRequired: true, error: state.context?.errorMessages['purchasePlatform']?.[0]
|
|
21
|
+
? t(state.context?.errorMessages['purchasePlatform']?.[0])
|
|
22
|
+
: undefined, valueToId: (val) => val, valueToText: (val) => t(PageText.Contact.input.purchasePlatform.platforms[val]), options: formSchemaOverrides?.refund?.enabledPurchasePlatforms ?? [
|
|
23
|
+
'enturApp',
|
|
24
|
+
'enturWeb',
|
|
25
|
+
'framApp',
|
|
26
|
+
'framWeb',
|
|
27
|
+
], placeholder: t(PageText.Contact.input.purchasePlatform.optionLabel) })), areOrderIdAndCustomerNumberRelevant &&
|
|
28
|
+
includeCustomerNumberAndPurchasePlatform && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.label), type: "text", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
|
|
16
29
|
type: 'ON_INPUT_CHANGE',
|
|
17
30
|
inputName: 'customerNumber',
|
|
18
31
|
value: e.target.value,
|
|
19
32
|
}), modalContent: {
|
|
20
33
|
description: t(PageText.Contact.input.customerNumber.description),
|
|
21
|
-
} })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
34
|
+
} })), areOrderIdAndCustomerNumberRelevant && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
22
35
|
type: 'ON_INPUT_CHANGE',
|
|
23
36
|
inputName: 'orderId',
|
|
24
37
|
value: e.target.value,
|
|
25
38
|
}), modalContent: {
|
|
26
39
|
description: t(PageText.Contact.input.orderId.description),
|
|
27
40
|
bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
|
|
28
|
-
} }),
|
|
29
|
-
type: 'ON_PURCHASE_PLATFORM_CHANGE',
|
|
30
|
-
value: value,
|
|
31
|
-
}), isRequired: true, error: state.context?.errorMessages['purchasePlatform']?.[0]
|
|
32
|
-
? t(state.context?.errorMessages['purchasePlatform']?.[0])
|
|
33
|
-
: undefined, valueToId: (val) => val, valueToText: (val) => t(PageText.Contact.input.purchasePlatform.platforms[val]), options: ['enturApp', 'enturWeb', 'framApp', 'framWeb'], placeholder: t(PageText.Contact.input.purchasePlatform.optionLabel) })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
41
|
+
} })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", label: t(PageText.Contact.input.refundReason.question), description: t(PageText.Contact.input.refundReason.description), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
34
42
|
type: 'ON_INPUT_CHANGE',
|
|
35
43
|
inputName: 'refundReason',
|
|
36
44
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AASnC,OAAO,EAAE,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,gCAmHxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -10,13 +10,12 @@ const translations_1 = require("../../../translations");
|
|
|
10
10
|
const typography_1 = require("../../../components/typography");
|
|
11
11
|
const components_1 = require("../../../components");
|
|
12
12
|
const appTicketRefund_1 = __importDefault(require("./appTicketRefund"));
|
|
13
|
-
const link_1 = __importDefault(require("next/link"));
|
|
14
13
|
const refundFormMachine_1 = require("../../refundFormMachine");
|
|
15
14
|
const otherTicketRefund_1 = __importDefault(require("./otherTicketRefund"));
|
|
16
15
|
const checkbox_1 = require("../../../components/checkbox");
|
|
17
16
|
const RefundTicketForms = ({ state, send }) => {
|
|
18
17
|
const PageText = (0, translations_1.usePageText)();
|
|
19
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
18
|
+
const { t, tRich } = (0, translations_1.useTranslation)();
|
|
20
19
|
const { initialAgreement } = PageText.Contact.ticketing.refund;
|
|
21
20
|
const { refundableTicketTypes, nonRefundableTicketTypes } = initialAgreement;
|
|
22
21
|
const displayAppTicketRefund = state.context.isInitialAgreementChecked &&
|
|
@@ -25,9 +24,7 @@ const RefundTicketForms = ({ state, send }) => {
|
|
|
25
24
|
state.context.formType === 'otherTicketRefund';
|
|
26
25
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.initialAgreement
|
|
27
26
|
.ticketRefundAvailability.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: PageText.Contact.ticketing.refund.initialAgreement.ticketRefundAvailability.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.initialAgreement
|
|
28
|
-
.refundableTicketTypes.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: refundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) }), (0, jsx_runtime_1.
|
|
29
|
-
.refundableTicketTypes.info.text), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: '?type=refundAndTravelGuarantee&agreed=true', target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.ticketing.refund.initialAgreement
|
|
30
|
-
.refundableTicketTypes.info.link) })] }), t(refundableTicketTypes.info.note) && ((0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(refundableTicketTypes.info.note) })), nonRefundableTicketTypes.rules.length > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "heading__m", children: t(nonRefundableTicketTypes.title) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: nonRefundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) })] })), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.ticketing.refund.initialAgreement
|
|
27
|
+
.refundableTicketTypes.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: refundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) }), tRich(refundableTicketTypes.info.text), t(refundableTicketTypes.info.note) && ((0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(refundableTicketTypes.info.note) })), nonRefundableTicketTypes.rules.length > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "heading__m", children: t(nonRefundableTicketTypes.title) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: nonRefundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) })] })), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.ticketing.refund.initialAgreement
|
|
31
28
|
.refundableTicketTypes.checkbox), checked: state.context.isInitialAgreementChecked, onChange: () => send({
|
|
32
29
|
type: 'ON_INPUT_CHANGE',
|
|
33
30
|
inputName: 'isInitialAgreementChecked',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;
|
|
1
|
+
{"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAigBF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,gCAWxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -24,7 +24,7 @@ const RefundSection = ({ state, send }) => {
|
|
|
24
24
|
});
|
|
25
25
|
}, placeholder: t(PageText.Contact.input.ticketType.optionLabelRefund), options: PageText.Contact.input.ticketType.options, isRequired: true, error: state.context?.errorMessages['ticketType']?.[0]
|
|
26
26
|
? t(state.context?.errorMessages['ticketType'][0])
|
|
27
|
-
: undefined })), features?.
|
|
27
|
+
: undefined })), features?.includeOrderIdInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
28
28
|
type: 'ON_INPUT_CHANGE',
|
|
29
29
|
inputName: 'orderId',
|
|
30
30
|
value: e.target.value,
|
|
@@ -38,17 +38,17 @@ const RefundSection = ({ state, send }) => {
|
|
|
38
38
|
value: e.target.value,
|
|
39
39
|
}), modalContent: {
|
|
40
40
|
description: t(PageText.Contact.input.travelCardNumber.info),
|
|
41
|
-
} })), features?.
|
|
41
|
+
} })), features?.includeAmountInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
|
|
42
42
|
type: 'ON_INPUT_CHANGE',
|
|
43
43
|
inputName: 'amount',
|
|
44
44
|
value: e.target.value,
|
|
45
|
-
}) })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason",
|
|
45
|
+
}) })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", label: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
46
46
|
type: 'ON_INPUT_CHANGE',
|
|
47
47
|
inputName: 'refundReason',
|
|
48
48
|
value: e.target.value,
|
|
49
49
|
}), error: state.context.errorMessages['refundReason']?.[0]
|
|
50
50
|
? t(state.context.errorMessages['refundReason']?.[0])
|
|
51
|
-
: undefined }), features?.
|
|
51
|
+
: undefined }), features?.enableReceiptAttachmentInOtherTicketRefund !== false && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(PageText.Contact.refund.otherTicketRefund.receipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "attachments", isRequired: features?.enableRequiredReceiptAttachmentInOtherTicketRefund, onChange: (files) => {
|
|
52
52
|
send({
|
|
53
53
|
type: 'ON_INPUT_CHANGE',
|
|
54
54
|
inputName: 'attachments',
|
|
@@ -61,6 +61,7 @@ const RefundSection = ({ state, send }) => {
|
|
|
61
61
|
const AboutYouSection = ({ state, send }) => {
|
|
62
62
|
const PageText = (0, translations_1.usePageText)();
|
|
63
63
|
const { t } = (0, translations_1.useTranslation)();
|
|
64
|
+
const { features } = (0, context_1.useContactFormConfig)();
|
|
64
65
|
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
65
66
|
type: 'ON_INPUT_CHANGE',
|
|
66
67
|
inputName: 'firstName',
|
|
@@ -105,7 +106,15 @@ const AboutYouSection = ({ state, send }) => {
|
|
|
105
106
|
type: 'ON_INPUT_CHANGE',
|
|
106
107
|
inputName: 'SWIFT',
|
|
107
108
|
value: e.target.value,
|
|
108
|
-
}) })] }))
|
|
109
|
+
}) })] })), features?.enableIdentificationAttachmentInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "identificationAttachments", label: t(PageText.Contact.input.identificationAttachments.label), iconLabel: t(PageText.Contact.input.feedback.attachment.generic), name: "identificationAttachments", isRequired: true, onChange: (files) => {
|
|
110
|
+
send({
|
|
111
|
+
type: 'ON_INPUT_CHANGE',
|
|
112
|
+
inputName: 'identificationAttachments',
|
|
113
|
+
value: files,
|
|
114
|
+
});
|
|
115
|
+
}, errorMessage: state.context?.errorMessages['identificationAttachments']?.[0]
|
|
116
|
+
? t(state.context?.errorMessages['identificationAttachments']?.[0])
|
|
117
|
+
: undefined }))] }));
|
|
109
118
|
};
|
|
110
119
|
const DepartureSection = ({ state, send }) => {
|
|
111
120
|
const PageText = (0, translations_1.usePageText)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,GAAI,MAAE,gCAyB3C,CAAC"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.ResidualValueOnTravelCard = void 0;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const link_1 = __importDefault(require("next/link"));
|
|
9
5
|
const typography_1 = require("../../../components/typography");
|
|
10
6
|
const translations_1 = require("../../../translations");
|
|
11
7
|
const components_1 = require("../../../components");
|
|
12
8
|
const ResidualValueOnTravelCard = ({}) => {
|
|
13
9
|
const PageText = (0, translations_1.usePageText)();
|
|
14
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [(
|
|
16
|
-
.monthlyPayoutDetails) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
10
|
+
const { t, tRich } = (0, translations_1.useTranslation)();
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [tRich(PageText.Contact.refund.residualValueOnTravelCard.text), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
17
12
|
.automatedProcessNotice.note) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
18
13
|
.automatedProcessNotice.text) })] })] }));
|
|
19
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,mCAqJlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/lib/refund/index.js
CHANGED
|
@@ -35,9 +35,12 @@ const RefundContent = () => {
|
|
|
35
35
|
includeRefundDepartureInfo: features?.includeRefundDepartureInfo === true,
|
|
36
36
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund: features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund ===
|
|
37
37
|
true,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
includeOrderIdInOtherTicketRefund: features?.includeOrderIdInOtherTicketRefund === true,
|
|
39
|
+
includeAmountInOtherTicketRefund: features?.includeAmountInOtherTicketRefund === true,
|
|
40
|
+
includeAmountInRefundTaxi: features?.includeAmountInRefundTaxi !== false,
|
|
41
|
+
enableReceiptAttachmentInOtherTicketRefund: features?.enableReceiptAttachmentInOtherTicketRefund !== false,
|
|
42
|
+
enableRequiredReceiptAttachmentInOtherTicketRefund: features?.enableRequiredReceiptAttachmentInOtherTicketRefund === true,
|
|
43
|
+
enableIdentificationAttachmentInOtherTicketRefund: features?.enableIdentificationAttachmentInOtherTicketRefund === true,
|
|
41
44
|
}), [
|
|
42
45
|
apiConfig.onSubmit,
|
|
43
46
|
successPath,
|
|
@@ -45,9 +48,12 @@ const RefundContent = () => {
|
|
|
45
48
|
features?.includeOtherTicketTypeSelector,
|
|
46
49
|
features?.includeRefundDepartureInfo,
|
|
47
50
|
features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund,
|
|
48
|
-
features?.
|
|
49
|
-
features?.
|
|
50
|
-
features?.
|
|
51
|
+
features?.includeOrderIdInOtherTicketRefund,
|
|
52
|
+
features?.includeAmountInOtherTicketRefund,
|
|
53
|
+
features?.includeAmountInRefundTaxi,
|
|
54
|
+
features?.enableReceiptAttachmentInOtherTicketRefund,
|
|
55
|
+
features?.enableRequiredReceiptAttachmentInOtherTicketRefund,
|
|
56
|
+
features?.enableIdentificationAttachmentInOtherTicketRefund,
|
|
51
57
|
]);
|
|
52
58
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
53
59
|
const displaySubmitButton = state.context.formType &&
|
|
@@ -41,6 +41,7 @@ type SubmitInput = {
|
|
|
41
41
|
feedback?: string;
|
|
42
42
|
attachments?: File[];
|
|
43
43
|
receiptAttachments?: File[];
|
|
44
|
+
identificationAttachments?: File[];
|
|
44
45
|
feedbackAttachments?: File[];
|
|
45
46
|
transportMode?: string;
|
|
46
47
|
line?: string;
|
|
@@ -77,6 +78,7 @@ export type RefundContextProps = {
|
|
|
77
78
|
feedback?: string;
|
|
78
79
|
attachments?: File[];
|
|
79
80
|
receiptAttachments?: File[];
|
|
81
|
+
identificationAttachments?: File[];
|
|
80
82
|
feedbackAttachments?: File[];
|
|
81
83
|
transportMode?: TransportModeType | undefined;
|
|
82
84
|
line?: Line | undefined;
|
|
@@ -102,26 +104,33 @@ export type RefundContextProps = {
|
|
|
102
104
|
includeOtherTicketTypeSelector: boolean;
|
|
103
105
|
includeRefundDepartureInfo: boolean;
|
|
104
106
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund: boolean;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
includeOrderIdInOtherTicketRefund: boolean;
|
|
108
|
+
includeAmountInOtherTicketRefund: boolean;
|
|
109
|
+
includeAmountInRefundTaxi: boolean;
|
|
110
|
+
enableReceiptAttachmentInOtherTicketRefund: boolean;
|
|
111
|
+
enableRequiredReceiptAttachmentInOtherTicketRefund: boolean;
|
|
112
|
+
enableIdentificationAttachmentInOtherTicketRefund: boolean;
|
|
108
113
|
errorMessages: InputErrorMessages;
|
|
109
114
|
firstIncorrectErrorMessage?: string;
|
|
110
115
|
hasSubmissionError?: boolean;
|
|
111
116
|
};
|
|
117
|
+
export declare const hasOrderIdAndCustomerNumber: (purchasePlatform?: PurchasePlatformType) => purchasePlatform is "framApp" | "enturApp" | "framWeb" | "enturWeb" | undefined;
|
|
112
118
|
export type MachinePaths = {
|
|
113
119
|
successPath: string;
|
|
114
120
|
errorPath: string;
|
|
115
121
|
includeOtherTicketTypeSelector?: boolean;
|
|
116
122
|
includeRefundDepartureInfo?: boolean;
|
|
117
123
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund?: boolean;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
includeOrderIdInOtherTicketRefund?: boolean;
|
|
125
|
+
includeAmountInOtherTicketRefund?: boolean;
|
|
126
|
+
includeAmountInRefundTaxi?: boolean;
|
|
127
|
+
enableReceiptAttachmentInOtherTicketRefund?: boolean;
|
|
128
|
+
enableRequiredReceiptAttachmentInOtherTicketRefund?: boolean;
|
|
129
|
+
enableIdentificationAttachmentInOtherTicketRefund?: boolean;
|
|
121
130
|
};
|
|
122
131
|
export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachinePaths>): import("xstate").StateMachine<RefundContextProps, {
|
|
123
132
|
type: "ON_INPUT_CHANGE";
|
|
124
|
-
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "receiptAttachments" | "feedbackAttachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
133
|
+
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "receiptAttachments" | "identificationAttachments" | "feedbackAttachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
125
134
|
value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
|
|
126
135
|
} | {
|
|
127
136
|
type: "SELECT_FORM_CATEGORY";
|
|
@@ -218,7 +227,7 @@ export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, stat
|
|
|
218
227
|
params: unknown;
|
|
219
228
|
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
|
|
220
229
|
editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
221
|
-
refundOfTicket: "
|
|
230
|
+
refundOfTicket: "otherTicketRefund" | "appTicketRefund" | "selectRefundOfTicketForm";
|
|
222
231
|
} | {
|
|
223
232
|
refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "selectRefundAndTravelGuaranteeForm";
|
|
224
233
|
};
|
|
@@ -281,7 +290,7 @@ export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, stat
|
|
|
281
290
|
}>;
|
|
282
291
|
export declare const refundStateMachine: import("xstate").StateMachine<RefundContextProps, {
|
|
283
292
|
type: "ON_INPUT_CHANGE";
|
|
284
|
-
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "receiptAttachments" | "feedbackAttachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
293
|
+
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "receiptAttachments" | "identificationAttachments" | "feedbackAttachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
285
294
|
value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
|
|
286
295
|
} | {
|
|
287
296
|
type: "SELECT_FORM_CATEGORY";
|
|
@@ -378,7 +387,7 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
378
387
|
params: unknown;
|
|
379
388
|
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
|
|
380
389
|
editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
381
|
-
refundOfTicket: "
|
|
390
|
+
refundOfTicket: "otherTicketRefund" | "appTicketRefund" | "selectRefundOfTicketForm";
|
|
382
391
|
} | {
|
|
383
392
|
refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "selectRefundAndTravelGuaranteeForm";
|
|
384
393
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EAEX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAWzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,gBAAgB;IAC1B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;CAC5C;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,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IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,yBAAyB,EAAE,OAAO,CAAC;IACnC,2BAA2B,EAAE,OAAO,CAAC;IACrC,8BAA8B,EAAE,OAAO,CAAC;IACxC,0BAA0B,EAAE,OAAO,CAAC;IACpC,yDAAyD,EAAE,OAAO,CAAC;IACnE,0CAA0C,EAAE,OAAO,CAAC;IACpD,
|
|
1
|
+
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EAEX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAWzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,gBAAgB;IAC1B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;CAC5C;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC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EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;uEA9UX,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkvBhC;AAED,eAAO,MAAM,kBAAkB;;;uEApvBX,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2vBhC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.refundStateMachine = exports.FormType = exports.RefundAndTravelGuarantee = exports.RefundTicketForm = exports.FormCategory = void 0;
|
|
3
|
+
exports.refundStateMachine = exports.hasOrderIdAndCustomerNumber = exports.FormType = exports.RefundAndTravelGuarantee = exports.RefundTicketForm = exports.FormCategory = void 0;
|
|
4
4
|
exports.createRefundStateMachine = createRefundStateMachine;
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
const xstate_1 = require("xstate");
|
|
@@ -46,8 +46,10 @@ const setInitialAgreementAndFormType = (context, isChecked) => {
|
|
|
46
46
|
errorMessages: {},
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
+
const hasOrderIdAndCustomerNumber = (purchasePlatform) => purchasePlatform !== 'sms';
|
|
50
|
+
exports.hasOrderIdAndCustomerNumber = hasOrderIdAndCustomerNumber;
|
|
49
51
|
const setInputToValidate = (context) => {
|
|
50
|
-
const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, receiptAttachments, orderId, ticketType, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, includeCustomerNumberAndPurchasePlatformInAppTicketRefund, customerNumber, purchasePlatform,
|
|
52
|
+
const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, receiptAttachments, orderId, ticketType, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, includeCustomerNumberAndPurchasePlatformInAppTicketRefund, customerNumber, purchasePlatform, includeOrderIdInOtherTicketRefund, includeAmountInOtherTicketRefund, includeAmountInRefundTaxi, enableReceiptAttachmentInOtherTicketRefund, enableRequiredReceiptAttachmentInOtherTicketRefund, identificationAttachments, enableIdentificationAttachmentInOtherTicketRefund, } = context;
|
|
51
53
|
const commonFields = {
|
|
52
54
|
formType,
|
|
53
55
|
transportMode,
|
|
@@ -68,13 +70,19 @@ const setInputToValidate = (context) => {
|
|
|
68
70
|
};
|
|
69
71
|
switch (formType) {
|
|
70
72
|
case FormType.RefundTaxi:
|
|
71
|
-
return {
|
|
73
|
+
return {
|
|
74
|
+
...commonFields,
|
|
75
|
+
receiptAttachments,
|
|
76
|
+
...(includeAmountInRefundTaxi ? { amount } : {}),
|
|
77
|
+
};
|
|
72
78
|
case FormType.RefundCar:
|
|
73
79
|
return { ...commonFields, kilometersDriven, fromAddress, toAddress };
|
|
74
80
|
case FormType.AppTicketRefund:
|
|
75
81
|
return {
|
|
76
82
|
formType,
|
|
77
|
-
|
|
83
|
+
...((0, exports.hasOrderIdAndCustomerNumber)(purchasePlatform)
|
|
84
|
+
? { referenceNumber: orderId }
|
|
85
|
+
: {}),
|
|
78
86
|
refundReason,
|
|
79
87
|
firstName,
|
|
80
88
|
lastName,
|
|
@@ -84,7 +92,12 @@ const setInputToValidate = (context) => {
|
|
|
84
92
|
email,
|
|
85
93
|
phoneNumber,
|
|
86
94
|
...(includeCustomerNumberAndPurchasePlatformInAppTicketRefund
|
|
87
|
-
? {
|
|
95
|
+
? {
|
|
96
|
+
...((0, exports.hasOrderIdAndCustomerNumber)(purchasePlatform)
|
|
97
|
+
? { customerNumber }
|
|
98
|
+
: {}),
|
|
99
|
+
purchasePlatform,
|
|
100
|
+
}
|
|
88
101
|
: {}),
|
|
89
102
|
...(includeRefundDepartureInfo
|
|
90
103
|
? {
|
|
@@ -100,9 +113,8 @@ const setInputToValidate = (context) => {
|
|
|
100
113
|
case FormType.OtherTicketRefund:
|
|
101
114
|
return {
|
|
102
115
|
formType,
|
|
103
|
-
...(
|
|
104
|
-
|
|
105
|
-
: {}),
|
|
116
|
+
...(includeOrderIdInOtherTicketRefund ? { orderId } : {}),
|
|
117
|
+
...(includeAmountInOtherTicketRefund ? { amount } : {}),
|
|
106
118
|
...(includeOtherTicketTypeSelector ? { ticketType } : {}),
|
|
107
119
|
refundReason,
|
|
108
120
|
firstName,
|
|
@@ -116,9 +128,13 @@ const setInputToValidate = (context) => {
|
|
|
116
128
|
context.ticketType?.id === types_1.TicketTypeId.PeriodTicket
|
|
117
129
|
? { travelCardNumber: context.travelCardNumber }
|
|
118
130
|
: {}),
|
|
119
|
-
...(
|
|
131
|
+
...(enableReceiptAttachmentInOtherTicketRefund &&
|
|
132
|
+
enableRequiredReceiptAttachmentInOtherTicketRefund
|
|
120
133
|
? { attachments }
|
|
121
134
|
: {}),
|
|
135
|
+
...(enableIdentificationAttachmentInOtherTicketRefund
|
|
136
|
+
? { identificationAttachments }
|
|
137
|
+
: {}),
|
|
122
138
|
...(hasInternationalBankAccount
|
|
123
139
|
? { IBAN, SWIFT }
|
|
124
140
|
: { bankAccountNumber }),
|
|
@@ -185,9 +201,12 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
185
201
|
const includeOtherTicketTypeSelector = paths?.includeOtherTicketTypeSelector !== false;
|
|
186
202
|
const includeRefundDepartureInfo = paths?.includeRefundDepartureInfo === true;
|
|
187
203
|
const includeCustomerNumberAndPurchasePlatformInAppTicketRefund = paths?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund === true;
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
const
|
|
204
|
+
const includeOrderIdInOtherTicketRefund = paths?.includeOrderIdInOtherTicketRefund === true;
|
|
205
|
+
const includeAmountInOtherTicketRefund = paths?.includeAmountInOtherTicketRefund === true;
|
|
206
|
+
const includeAmountInRefundTaxi = paths?.includeAmountInRefundTaxi !== false;
|
|
207
|
+
const enableReceiptAttachmentInOtherTicketRefund = paths?.enableReceiptAttachmentInOtherTicketRefund !== false;
|
|
208
|
+
const enableRequiredReceiptAttachmentInOtherTicketRefund = paths?.enableRequiredReceiptAttachmentInOtherTicketRefund === true;
|
|
209
|
+
const enableIdentificationAttachmentInOtherTicketRefund = paths?.enableIdentificationAttachmentInOtherTicketRefund === true;
|
|
191
210
|
return (0, xstate_1.setup)({
|
|
192
211
|
types: { context: {}, events: events_1.RefundFormEvents },
|
|
193
212
|
guards: {
|
|
@@ -310,6 +329,10 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
310
329
|
return {
|
|
311
330
|
...context,
|
|
312
331
|
purchasePlatform: event.value,
|
|
332
|
+
// Drop values from fields that are now hidden.
|
|
333
|
+
...((0, exports.hasOrderIdAndCustomerNumber)(event.value)
|
|
334
|
+
? {}
|
|
335
|
+
: { customerNumber: undefined, orderId: undefined }),
|
|
313
336
|
errorMessages: { ...context.errorMessages },
|
|
314
337
|
};
|
|
315
338
|
return context;
|
|
@@ -337,9 +360,12 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
337
360
|
includeOtherTicketTypeSelector,
|
|
338
361
|
includeRefundDepartureInfo,
|
|
339
362
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
363
|
+
includeOrderIdInOtherTicketRefund,
|
|
364
|
+
includeAmountInOtherTicketRefund,
|
|
365
|
+
includeAmountInRefundTaxi,
|
|
366
|
+
enableReceiptAttachmentInOtherTicketRefund,
|
|
367
|
+
enableRequiredReceiptAttachmentInOtherTicketRefund,
|
|
368
|
+
enableIdentificationAttachmentInOtherTicketRefund,
|
|
343
369
|
errorMessages: {},
|
|
344
370
|
},
|
|
345
371
|
on: {
|
|
@@ -491,6 +517,7 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
491
517
|
additionalInfo: context?.feedback,
|
|
492
518
|
attachments: [
|
|
493
519
|
...(context.receiptAttachments ?? []),
|
|
520
|
+
...(context.identificationAttachments ?? []),
|
|
494
521
|
...(context.feedbackAttachments ?? []),
|
|
495
522
|
...(context.attachments ?? []),
|
|
496
523
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appTravelSuggestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTravelSuggestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"appTravelSuggestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTravelSuggestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,gCA+G9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -36,7 +36,11 @@ const AppTravelSuggestionForm = ({ state, send, }) => {
|
|
|
36
36
|
type: 'ON_INPUT_CHANGE',
|
|
37
37
|
inputName: 'email',
|
|
38
38
|
value: e.target.value,
|
|
39
|
-
}) })
|
|
39
|
+
}) }), state.context.includePhoneNumberInPriceAndTravelSuggestion && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
|
|
40
|
+
type: 'ON_INPUT_CHANGE',
|
|
41
|
+
inputName: 'phoneNumber',
|
|
42
|
+
value: e.target.value,
|
|
43
|
+
}) }))] })] }));
|
|
40
44
|
};
|
|
41
45
|
exports.AppTravelSuggestionForm = AppTravelSuggestionForm;
|
|
42
46
|
exports.default = exports.AppTravelSuggestionForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceAndTicketTypesForm.d.ts","sourceRoot":"","sources":["../../../src/ticketing/forms/priceAndTicketTypesForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"priceAndTicketTypesForm.d.ts","sourceRoot":"","sources":["../../../src/ticketing/forms/priceAndTicketTypesForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,gCA+G9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|