@mrfylke/contact-form 0.1.32 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +0 -22
  2. package/lib/commoneEvents.d.ts +1 -1
  3. package/lib/commoneEvents.d.ts.map +1 -1
  4. package/lib/components/form/date-selector.d.ts +4 -1
  5. package/lib/components/form/date-selector.d.ts.map +1 -1
  6. package/lib/components/form/date-selector.js +2 -2
  7. package/lib/components/form/file-input.js +1 -1
  8. package/lib/components/form/form.module.css +0 -74
  9. package/lib/components/form/input.d.ts +2 -6
  10. package/lib/components/form/input.d.ts.map +1 -1
  11. package/lib/components/form/input.js +7 -22
  12. package/lib/components/form/textarea.d.ts +3 -2
  13. package/lib/components/form/textarea.d.ts.map +1 -1
  14. package/lib/components/form/textarea.js +6 -4
  15. package/lib/components/form/time-selector.d.ts.map +1 -1
  16. package/lib/components/form/time-selector.js +1 -1
  17. package/lib/index.d.ts +1 -1
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
  20. package/lib/layouts/contact-pages.d.ts.map +1 -1
  21. package/lib/layouts/contact-pages.js +7 -2
  22. package/lib/lines/use-lines.d.ts +1 -0
  23. package/lib/lines/use-lines.d.ts.map +1 -1
  24. package/lib/lines/use-lines.js +1 -0
  25. package/lib/lost-property/LostPropertyForm.d.ts +6 -0
  26. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -1
  27. package/lib/lost-property/LostPropertyForm.js +54 -12
  28. package/lib/lost-property/LostPropertyMachine.d.ts +5 -4
  29. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
  30. package/lib/lost-property/LostPropertyMachine.js +5 -1
  31. package/lib/lost-property/index.d.ts.map +1 -1
  32. package/lib/lost-property/index.js +40 -3
  33. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  34. package/lib/means-of-transport/forms/injuryForm.js +1 -1
  35. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +2 -2
  36. package/lib/modules/api-browser/index.d.ts +1 -1
  37. package/lib/modules/api-browser/index.d.ts.map +1 -1
  38. package/lib/modules/api-browser/index.js +5 -1
  39. package/lib/modules/config/context.d.ts.map +1 -1
  40. package/lib/modules/config/context.js +1 -4
  41. package/lib/modules/config/theme-adapter.d.ts.map +1 -1
  42. package/lib/modules/config/theme-adapter.js +2 -0
  43. package/lib/modules/config/types.d.ts +53 -8
  44. package/lib/modules/config/types.d.ts.map +1 -1
  45. package/lib/modules/transport-mode/utils.d.ts +2 -2
  46. package/lib/modules/transport-mode/utils.d.ts.map +1 -1
  47. package/lib/refund/events.d.ts +3 -3
  48. package/lib/refund/events.d.ts.map +1 -1
  49. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  50. package/lib/refund/forms/refund-and-travel-guarantee/index.js +10 -3
  51. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts +11 -0
  52. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts.map +1 -0
  53. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.js +159 -0
  54. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/pre-purchased-ticket-refund-form.module.css +73 -0
  55. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  56. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +2 -2
  57. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  58. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +2 -2
  59. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  60. package/lib/refund/forms/refund-ticket/appTicketRefund.js +13 -15
  61. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  62. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +16 -13
  63. package/lib/refund/index.d.ts.map +1 -1
  64. package/lib/refund/index.js +6 -4
  65. package/lib/refund/refundFormMachine.d.ts +49 -13
  66. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  67. package/lib/refund/refundFormMachine.js +75 -9
  68. package/lib/server/journey-planner/entur-client.d.ts +2 -1
  69. package/lib/server/journey-planner/entur-client.d.ts.map +1 -1
  70. package/lib/ticket-control/forms/feeComplaintForm.js +4 -10
  71. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  72. package/lib/ticket-control/forms/postponePayment.js +2 -6
  73. package/lib/ticket-control/ticket-control-form-machine.d.ts +2 -2
  74. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  75. package/lib/ticketing/forms/app/appAccountForm.js +1 -3
  76. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  77. package/lib/ticketing/forms/app/appTicketingForm.js +2 -8
  78. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  79. package/lib/ticketing/forms/app/appTravelSuggestionForm.js +5 -1
  80. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  81. package/lib/ticketing/forms/priceAndTicketTypesForm.js +5 -1
  82. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  83. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +5 -8
  84. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  85. package/lib/ticketing/forms/webshop/webshopAccountForm.js +1 -3
  86. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  87. package/lib/ticketing/forms/webshop/webshopTicketingForm.js +2 -7
  88. package/lib/ticketing/index.d.ts.map +1 -1
  89. package/lib/ticketing/index.js +8 -2
  90. package/lib/ticketing/ticketingStateMachine.d.ts +4 -2
  91. package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
  92. package/lib/ticketing/ticketingStateMachine.js +4 -1
  93. package/lib/translations/commons.d.ts +1 -1
  94. package/lib/translations/commons.d.ts.map +1 -1
  95. package/lib/translations/commons.js +3 -1
  96. package/lib/translations/language-context.d.ts +2 -2
  97. package/lib/translations/language-context.d.ts.map +1 -1
  98. package/lib/translations/language-context.js +1 -1
  99. package/lib/translations/pages/contact.d.ts +46 -18
  100. package/lib/translations/pages/contact.d.ts.map +1 -1
  101. package/lib/translations/pages/contact.js +53 -26
  102. package/lib/translations/translations-context.d.ts +11 -4
  103. package/lib/translations/translations-context.d.ts.map +1 -1
  104. package/lib/translations/translations-context.js +18 -11
  105. package/lib/translations/types.d.ts +10 -5
  106. package/lib/translations/types.d.ts.map +1 -1
  107. package/lib/types/submit-payloads.d.ts +12 -0
  108. package/lib/types/submit-payloads.d.ts.map +1 -1
  109. package/lib/types.d.ts +1 -1
  110. package/lib/types.d.ts.map +1 -1
  111. package/lib/utils/rich-text.d.ts +2 -2
  112. package/lib/utils/rich-text.js +8 -3
  113. package/lib/utils.d.ts +56 -3
  114. package/lib/utils.d.ts.map +1 -1
  115. package/lib/validation/commonInputValidator.d.ts +1 -1
  116. package/lib/validation/commonInputValidator.d.ts.map +1 -1
  117. package/lib/validation/commonInputValidator.js +3 -3
  118. package/lib/validation/validationRules.d.ts +2 -0
  119. package/lib/validation/validationRules.d.ts.map +1 -1
  120. package/lib/validation/validationRules.js +28 -2
  121. package/package.json +12 -6
  122. package/lib/components/form/description-modal.d.ts +0 -13
  123. package/lib/components/form/description-modal.d.ts.map +0 -1
  124. package/lib/components/form/description-modal.js +0 -44
@@ -14,11 +14,21 @@ export declare enum RefundTicketForm {
14
14
  }
15
15
  export declare enum RefundAndTravelGuarantee {
16
16
  RefundTaxi = "refundTaxi",
17
- RefundCar = "refundCar"
17
+ RefundCar = "refundCar",
18
+ PrePurchasedTicketRefund = "prePurchasedTicketRefund"
18
19
  }
20
+ export type DelayedDeparture = {
21
+ line: Line;
22
+ fromStop: Line['quays'][0];
23
+ toStop: Line['quays'][0];
24
+ date: string;
25
+ plannedDepartureTime: string;
26
+ tripId?: string;
27
+ };
19
28
  export declare enum FormType {
20
29
  RefundTaxi = "refundTaxi",
21
30
  RefundCar = "refundCar",
31
+ PrePurchasedTicketRefund = "prePurchasedTicketRefund",
22
32
  AppTicketRefund = "appTicketRefund",
23
33
  OtherTicketRefund = "otherTicketRefund",
24
34
  ResidualValueOnTravelCard = "residualValueOnTravelCard",
@@ -41,6 +51,7 @@ type SubmitInput = {
41
51
  feedback?: string;
42
52
  attachments?: File[];
43
53
  receiptAttachments?: File[];
54
+ identificationAttachments?: File[];
44
55
  feedbackAttachments?: File[];
45
56
  transportMode?: string;
46
57
  line?: string;
@@ -61,6 +72,14 @@ type SubmitInput = {
61
72
  refundReason?: string;
62
73
  purchasePlatform?: string;
63
74
  bankCardDetails?: string;
75
+ delayedDepartures?: {
76
+ line?: string;
77
+ fromStop: string;
78
+ toStop: string;
79
+ date: string;
80
+ plannedDepartureTime: string;
81
+ tripId?: string;
82
+ }[];
64
83
  };
65
84
  export type RefundContextProps = {
66
85
  formType?: FormType;
@@ -77,6 +96,7 @@ export type RefundContextProps = {
77
96
  feedback?: string;
78
97
  attachments?: File[];
79
98
  receiptAttachments?: File[];
99
+ identificationAttachments?: File[];
80
100
  feedbackAttachments?: File[];
81
101
  transportMode?: TransportModeType | undefined;
82
102
  line?: Line | undefined;
@@ -97,6 +117,7 @@ export type RefundContextProps = {
97
117
  refundReason?: string;
98
118
  purchasePlatform?: PurchasePlatformType | undefined;
99
119
  bankCardDetails?: string;
120
+ prePurchasedTicketDelayedDepartures?: DelayedDeparture[];
100
121
  isInitialAgreementChecked: boolean;
101
122
  hasInternationalBankAccount: boolean;
102
123
  includeOtherTicketTypeSelector: boolean;
@@ -105,12 +126,14 @@ export type RefundContextProps = {
105
126
  includeOrderIdInOtherTicketRefund: boolean;
106
127
  includeAmountInOtherTicketRefund: boolean;
107
128
  includeAmountInRefundTaxi: boolean;
108
- enableFileUploads: boolean;
109
- enableRequiredAttachmentInOtherTicketRefund: boolean;
129
+ enableReceiptAttachmentInOtherTicketRefund: boolean;
130
+ enableRequiredReceiptAttachmentInOtherTicketRefund: boolean;
131
+ enableIdentificationAttachmentInOtherTicketRefund: boolean;
110
132
  errorMessages: InputErrorMessages;
111
133
  firstIncorrectErrorMessage?: string;
112
134
  hasSubmissionError?: boolean;
113
135
  };
136
+ export declare const hasOrderIdAndCustomerNumber: (purchasePlatform?: PurchasePlatformType) => purchasePlatform is "framApp" | "enturApp" | "framWeb" | "enturWeb" | undefined;
114
137
  export type MachinePaths = {
115
138
  successPath: string;
116
139
  errorPath: string;
@@ -120,13 +143,14 @@ export type MachinePaths = {
120
143
  includeOrderIdInOtherTicketRefund?: boolean;
121
144
  includeAmountInOtherTicketRefund?: boolean;
122
145
  includeAmountInRefundTaxi?: boolean;
123
- enableFileUploads?: boolean;
124
- enableRequiredAttachmentInOtherTicketRefund?: boolean;
146
+ enableReceiptAttachmentInOtherTicketRefund?: boolean;
147
+ enableRequiredReceiptAttachmentInOtherTicketRefund?: boolean;
148
+ enableIdentificationAttachmentInOtherTicketRefund?: boolean;
125
149
  };
126
150
  export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachinePaths>): import("xstate").StateMachine<RefundContextProps, {
127
151
  type: "ON_INPUT_CHANGE";
128
- 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";
129
- value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
152
+ 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" | "prePurchasedTicketDelayedDepartures";
153
+ value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | DelayedDeparture[] | undefined;
130
154
  } | {
131
155
  type: "SELECT_FORM_CATEGORY";
132
156
  formCategory: FormCategory;
@@ -220,11 +244,14 @@ export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, stat
220
244
  } | {
221
245
  type: "isRefundTaxi";
222
246
  params: unknown;
247
+ } | {
248
+ type: "isPrePurchasedTicketRefund";
249
+ params: unknown;
223
250
  }, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
224
251
  editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
225
- refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
252
+ refundOfTicket: "otherTicketRefund" | "appTicketRefund" | "selectRefundOfTicketForm";
226
253
  } | {
227
- refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "selectRefundAndTravelGuaranteeForm";
254
+ refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "prePurchasedTicketRefund" | "selectRefundAndTravelGuaranteeForm";
228
255
  };
229
256
  }, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
230
257
  id: "refundStateMachine";
@@ -263,6 +290,9 @@ export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, stat
263
290
  readonly refundTaxi: {
264
291
  id: "refundTaxi";
265
292
  };
293
+ readonly prePurchasedTicketRefund: {
294
+ id: "prePurchasedTicketRefund";
295
+ };
266
296
  };
267
297
  };
268
298
  readonly residualValueOnTravelCard: {
@@ -285,8 +315,8 @@ export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, stat
285
315
  }>;
286
316
  export declare const refundStateMachine: import("xstate").StateMachine<RefundContextProps, {
287
317
  type: "ON_INPUT_CHANGE";
288
- 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";
289
- value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
318
+ 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" | "prePurchasedTicketDelayedDepartures";
319
+ value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | DelayedDeparture[] | undefined;
290
320
  } | {
291
321
  type: "SELECT_FORM_CATEGORY";
292
322
  formCategory: FormCategory;
@@ -380,11 +410,14 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
380
410
  } | {
381
411
  type: "isRefundTaxi";
382
412
  params: unknown;
413
+ } | {
414
+ type: "isPrePurchasedTicketRefund";
415
+ params: unknown;
383
416
  }, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
384
417
  editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
385
- refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
418
+ refundOfTicket: "otherTicketRefund" | "appTicketRefund" | "selectRefundOfTicketForm";
386
419
  } | {
387
- refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "selectRefundAndTravelGuaranteeForm";
420
+ refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "prePurchasedTicketRefund" | "selectRefundAndTravelGuaranteeForm";
388
421
  };
389
422
  }, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
390
423
  id: "refundStateMachine";
@@ -423,6 +456,9 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
423
456
  readonly refundTaxi: {
424
457
  id: "refundTaxi";
425
458
  };
459
+ readonly prePurchasedTicketRefund: {
460
+ id: "prePurchasedTicketRefund";
461
+ };
426
462
  };
427
463
  };
428
464
  readonly residualValueOnTravelCard: {
@@ -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;IAC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;IACrD,kDAAkD,CAAC,EAAE,OAAO,CAAC;IAC7D,iDAAiD,CAAC,EAAE,OAAO,CAAC;CAC7D,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,CACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;uEA/WT,aACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgzBR;AAED,eAAO,MAAM,kBAAkB;;;uEAnzBT,aACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyzBR,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");
@@ -23,11 +23,13 @@ var RefundAndTravelGuarantee;
23
23
  (function (RefundAndTravelGuarantee) {
24
24
  RefundAndTravelGuarantee["RefundTaxi"] = "refundTaxi";
25
25
  RefundAndTravelGuarantee["RefundCar"] = "refundCar";
26
+ RefundAndTravelGuarantee["PrePurchasedTicketRefund"] = "prePurchasedTicketRefund";
26
27
  })(RefundAndTravelGuarantee || (exports.RefundAndTravelGuarantee = RefundAndTravelGuarantee = {}));
27
28
  var FormType;
28
29
  (function (FormType) {
29
30
  FormType["RefundTaxi"] = "refundTaxi";
30
31
  FormType["RefundCar"] = "refundCar";
32
+ FormType["PrePurchasedTicketRefund"] = "prePurchasedTicketRefund";
31
33
  FormType["AppTicketRefund"] = "appTicketRefund";
32
34
  FormType["OtherTicketRefund"] = "otherTicketRefund";
33
35
  FormType["ResidualValueOnTravelCard"] = "residualValueOnTravelCard";
@@ -46,8 +48,10 @@ const setInitialAgreementAndFormType = (context, isChecked) => {
46
48
  errorMessages: {},
47
49
  };
48
50
  };
51
+ const hasOrderIdAndCustomerNumber = (purchasePlatform) => purchasePlatform !== 'sms';
52
+ exports.hasOrderIdAndCustomerNumber = hasOrderIdAndCustomerNumber;
49
53
  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, includeOrderIdInOtherTicketRefund, includeAmountInOtherTicketRefund, includeAmountInRefundTaxi, enableFileUploads, enableRequiredAttachmentInOtherTicketRefund, } = context;
54
+ 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
55
  const commonFields = {
52
56
  formType,
53
57
  transportMode,
@@ -75,10 +79,29 @@ const setInputToValidate = (context) => {
75
79
  };
76
80
  case FormType.RefundCar:
77
81
  return { ...commonFields, kilometersDriven, fromAddress, toAddress };
82
+ case FormType.PrePurchasedTicketRefund:
83
+ return {
84
+ formType,
85
+ orderId,
86
+ refundReason,
87
+ prePurchasedTicketDelayedDepartures: context.prePurchasedTicketDelayedDepartures,
88
+ firstName,
89
+ lastName,
90
+ email,
91
+ address,
92
+ postalCode,
93
+ city,
94
+ phoneNumber,
95
+ ...(hasInternationalBankAccount
96
+ ? { IBAN, SWIFT }
97
+ : { bankAccountNumber }),
98
+ };
78
99
  case FormType.AppTicketRefund:
79
100
  return {
80
101
  formType,
81
- referenceNumber: orderId,
102
+ ...((0, exports.hasOrderIdAndCustomerNumber)(purchasePlatform)
103
+ ? { referenceNumber: orderId }
104
+ : {}),
82
105
  refundReason,
83
106
  firstName,
84
107
  lastName,
@@ -88,7 +111,12 @@ const setInputToValidate = (context) => {
88
111
  email,
89
112
  phoneNumber,
90
113
  ...(includeCustomerNumberAndPurchasePlatformInAppTicketRefund
91
- ? { customerNumber, purchasePlatform }
114
+ ? {
115
+ ...((0, exports.hasOrderIdAndCustomerNumber)(purchasePlatform)
116
+ ? { customerNumber }
117
+ : {}),
118
+ purchasePlatform,
119
+ }
92
120
  : {}),
93
121
  ...(includeRefundDepartureInfo
94
122
  ? {
@@ -119,9 +147,13 @@ const setInputToValidate = (context) => {
119
147
  context.ticketType?.id === types_1.TicketTypeId.PeriodTicket
120
148
  ? { travelCardNumber: context.travelCardNumber }
121
149
  : {}),
122
- ...(enableFileUploads && enableRequiredAttachmentInOtherTicketRefund
150
+ ...(enableReceiptAttachmentInOtherTicketRefund &&
151
+ enableRequiredReceiptAttachmentInOtherTicketRefund
123
152
  ? { attachments }
124
153
  : {}),
154
+ ...(enableIdentificationAttachmentInOtherTicketRefund
155
+ ? { identificationAttachments }
156
+ : {}),
125
157
  ...(hasInternationalBankAccount
126
158
  ? { IBAN, SWIFT }
127
159
  : { bankAccountNumber }),
@@ -191,8 +223,9 @@ function createRefundStateMachine(onSubmit, paths) {
191
223
  const includeOrderIdInOtherTicketRefund = paths?.includeOrderIdInOtherTicketRefund === true;
192
224
  const includeAmountInOtherTicketRefund = paths?.includeAmountInOtherTicketRefund === true;
193
225
  const includeAmountInRefundTaxi = paths?.includeAmountInRefundTaxi !== false;
194
- const enableFileUploads = paths?.enableFileUploads === true;
195
- const enableRequiredAttachmentInOtherTicketRefund = paths?.enableRequiredAttachmentInOtherTicketRefund === true;
226
+ const enableReceiptAttachmentInOtherTicketRefund = paths?.enableReceiptAttachmentInOtherTicketRefund !== false;
227
+ const enableRequiredReceiptAttachmentInOtherTicketRefund = paths?.enableRequiredReceiptAttachmentInOtherTicketRefund === true;
228
+ const enableIdentificationAttachmentInOtherTicketRefund = paths?.enableIdentificationAttachmentInOtherTicketRefund === true;
196
229
  return (0, xstate_1.setup)({
197
230
  types: { context: {}, events: events_1.RefundFormEvents },
198
231
  guards: {
@@ -217,6 +250,9 @@ function createRefundStateMachine(onSubmit, paths) {
217
250
  event.refundAndTravelGuarantee === RefundAndTravelGuarantee.RefundCar,
218
251
  isRefundTaxi: ({ event }) => event.type === 'SELECT_REFUND_AND_TRAVEL_GUARANTEE_FORM' &&
219
252
  event.refundAndTravelGuarantee === RefundAndTravelGuarantee.RefundTaxi,
253
+ isPrePurchasedTicketRefund: ({ event }) => event.type === 'SELECT_REFUND_AND_TRAVEL_GUARANTEE_FORM' &&
254
+ event.refundAndTravelGuarantee ===
255
+ RefundAndTravelGuarantee.PrePurchasedTicketRefund,
220
256
  },
221
257
  actions: {
222
258
  navigateToErrorPage: () => {
@@ -315,6 +351,10 @@ function createRefundStateMachine(onSubmit, paths) {
315
351
  return {
316
352
  ...context,
317
353
  purchasePlatform: event.value,
354
+ // Drop values from fields that are now hidden.
355
+ ...((0, exports.hasOrderIdAndCustomerNumber)(event.value)
356
+ ? {}
357
+ : { customerNumber: undefined, orderId: undefined }),
318
358
  errorMessages: { ...context.errorMessages },
319
359
  };
320
360
  return context;
@@ -345,8 +385,9 @@ function createRefundStateMachine(onSubmit, paths) {
345
385
  includeOrderIdInOtherTicketRefund,
346
386
  includeAmountInOtherTicketRefund,
347
387
  includeAmountInRefundTaxi,
348
- enableFileUploads,
349
- enableRequiredAttachmentInOtherTicketRefund,
388
+ enableReceiptAttachmentInOtherTicketRefund,
389
+ enableRequiredReceiptAttachmentInOtherTicketRefund,
390
+ enableIdentificationAttachmentInOtherTicketRefund,
350
391
  errorMessages: {},
351
392
  },
352
393
  on: {
@@ -408,6 +449,17 @@ function createRefundStateMachine(onSubmit, paths) {
408
449
  guard: 'isRefundTaxi',
409
450
  target: `#${RefundAndTravelGuarantee.RefundTaxi}`,
410
451
  },
452
+ {
453
+ guard: 'isPrePurchasedTicketRefund',
454
+ target: `#${RefundAndTravelGuarantee.PrePurchasedTicketRefund}`,
455
+ // Reset here, not on entry: entry re-runs when a failed submit
456
+ // returns via editing.history.
457
+ actions: (0, xstate_1.assign)({
458
+ transportMode: () => 'expressboat',
459
+ line: () => undefined,
460
+ prePurchasedTicketDelayedDepartures: () => [],
461
+ }),
462
+ },
411
463
  ],
412
464
  },
413
465
  editing: {
@@ -450,6 +502,13 @@ function createRefundStateMachine(onSubmit, paths) {
450
502
  entry: (0, xstate_1.assign)({ formType: () => FormType.RefundTaxi }),
451
503
  exit: 'clearValidationErrors',
452
504
  },
505
+ prePurchasedTicketRefund: {
506
+ id: 'prePurchasedTicketRefund',
507
+ entry: (0, xstate_1.assign)({
508
+ formType: () => FormType.PrePurchasedTicketRefund,
509
+ }),
510
+ exit: 'clearValidationErrors',
511
+ },
453
512
  },
454
513
  },
455
514
  residualValueOnTravelCard: {
@@ -498,6 +557,7 @@ function createRefundStateMachine(onSubmit, paths) {
498
557
  additionalInfo: context?.feedback,
499
558
  attachments: [
500
559
  ...(context.receiptAttachments ?? []),
560
+ ...(context.identificationAttachments ?? []),
501
561
  ...(context.feedbackAttachments ?? []),
502
562
  ...(context.attachments ?? []),
503
563
  ],
@@ -519,6 +579,12 @@ function createRefundStateMachine(onSubmit, paths) {
519
579
  refundReason: context?.refundReason,
520
580
  purchasePlatform: context?.purchasePlatform,
521
581
  bankCardDetails: context?.bankCardDetails,
582
+ delayedDepartures: context.prePurchasedTicketDelayedDepartures?.map((d) => ({
583
+ ...d,
584
+ line: (0, utils_1.getLineName)(d.line),
585
+ fromStop: d.fromStop.name,
586
+ toStop: d.toStop.name,
587
+ })),
522
588
  }),
523
589
  onDone: { target: 'success' },
524
590
  onError: {
@@ -1,7 +1,8 @@
1
+ import { NormalizedCacheObject } from '@apollo/client/cache';
1
2
  import { ApolloClient } from '@apollo/client/core';
2
3
  /**
3
4
  * Get or create the Entur GraphQL client instance.
4
5
  * This is a singleton that can be reused across requests.
5
6
  */
6
- export declare function getEnturClient(): ApolloClient<any>;
7
+ export declare function getEnturClient(): ApolloClient<NormalizedCacheObject>;
7
8
  //# sourceMappingURL=entur-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entur-client.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/entur-client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAIb,MAAM,qBAAqB,CAAC;AAmB7B;;;GAGG;AACH,wBAAgB,cAAc,IAAI,YAAY,CAAC,GAAG,CAAC,CA2BlD"}
1
+ {"version":3,"file":"entur-client.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/entur-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACL,YAAY,EAIb,MAAM,qBAAqB,CAAC;AAmB7B;;;GAGG;AACH,wBAAgB,cAAc,IAAI,YAAY,CAAC,qBAAqB,CAAC,CA2BpE"}
@@ -36,9 +36,7 @@ const FormContent = ({ state, send }) => {
36
36
  type: 'ON_INPUT_CHANGE',
37
37
  inputName: 'feeNumber',
38
38
  value: e.target.value,
39
- }), modalContent: {
40
- description: t(PageText.Contact.input.feeNumber.description),
41
- } }), state.context.includeFeeDateInTicketControl && ((0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
39
+ }), description: t(PageText.Contact.input.feeNumber.description) }), state.context.includeFeeDateInTicketControl && ((0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
42
40
  type: 'ON_INPUT_CHANGE',
43
41
  inputName: 'feeDate',
44
42
  value: feeDate,
@@ -59,11 +57,7 @@ const FormContent = ({ state, send }) => {
59
57
  type: 'ON_INPUT_CHANGE',
60
58
  inputName: 'customerNumber',
61
59
  value: e.target.value,
62
- }), modalContent: {
63
- description: t(PageText.Contact.input.customerNumber.description),
64
- } }))] })), !state.context.isAppTicketStorageMode && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
65
- description: t(PageText.Contact.input.travelCardNumber.info),
66
- }, isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
60
+ }), description: t(PageText.Contact.input.customerNumber.description) }))] })), !state.context.isAppTicketStorageMode && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', description: t(PageText.Contact.input.travelCardNumber.info), isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
67
61
  type: 'ON_INPUT_CHANGE',
68
62
  inputName: 'travelCardNumber',
69
63
  value: e.target.value,
@@ -120,11 +114,11 @@ const FormContent = ({ state, send }) => {
120
114
  type: 'ON_INPUT_CHANGE',
121
115
  inputName: 'hasInternationalBankAccount',
122
116
  value: !state.context.hasInternationalBankAccount,
123
- }) }), 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({
117
+ }) }), 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), description: t(PageText.Contact.input.bankInformation.IBAN.description), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
124
118
  type: 'ON_INPUT_CHANGE',
125
119
  inputName: 'IBAN',
126
120
  value: e.target.value,
127
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
121
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), description: t(PageText.Contact.input.bankInformation.SWIFT.description), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
128
122
  type: 'ON_INPUT_CHANGE',
129
123
  inputName: 'SWIFT',
130
124
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"postponePayment.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/postponePayment.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kBAGjC,wBAAwB,gCA0H1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"postponePayment.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/postponePayment.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kBAGjC,wBAAwB,gCAsH1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -12,9 +12,7 @@ const PostponePaymentForm = ({ state, send, }) => {
12
12
  type: 'ON_INPUT_CHANGE',
13
13
  inputName: 'feeNumber',
14
14
  value: e.target.value,
15
- }), modalContent: {
16
- description: t(PageText.Contact.input.feeNumber.description),
17
- } }), state.context.includeFeeDateInTicketControl && ((0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
15
+ }), description: t(PageText.Contact.input.feeNumber.description) }), state.context.includeFeeDateInTicketControl && ((0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
18
16
  type: 'ON_INPUT_CHANGE',
19
17
  inputName: 'feeDate',
20
18
  value: feeDate,
@@ -22,9 +20,7 @@ const PostponePaymentForm = ({ state, send, }) => {
22
20
  type: 'ON_INPUT_CHANGE',
23
21
  inputName: 'invoiceNumber',
24
22
  value: e.target.value,
25
- }), modalContent: {
26
- description: t(PageText.Contact.input.invoiceNumber.description),
27
- } })] }), (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({
23
+ }), description: t(PageText.Contact.input.invoiceNumber.description) })] }), (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({
28
24
  type: 'ON_INPUT_CHANGE',
29
25
  inputName: 'firstName',
30
26
  value: e.target.value,
@@ -97,7 +97,7 @@ export declare function createTicketControlFormMachine(onSubmit: (slug: FormSlug
97
97
  } | {
98
98
  type: "ON_INPUT_CHANGE";
99
99
  inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
100
- value: any;
100
+ value: unknown;
101
101
  } | {
102
102
  type: "ON_TRANSPORTMODE_CHANGE";
103
103
  value: TransportModeType;
@@ -199,7 +199,7 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
199
199
  } | {
200
200
  type: "ON_INPUT_CHANGE";
201
201
  inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
202
- value: any;
202
+ value: unknown;
203
203
  } | {
204
204
  type: "ON_TRANSPORTMODE_CHANGE";
205
205
  value: TransportModeType;
@@ -1 +1 @@
1
- {"version":3,"file":"appAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,mBAAmB,GAAG;IACzB,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,cAAc,GAAI,iBAAiB,mBAAmB,gCAgIlE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"appAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,mBAAmB,GAAG;IACzB,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,cAAc,GAAI,iBAAiB,mBAAmB,gCA8HlE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -28,9 +28,7 @@ const AppAccountForm = ({ state, send }) => {
28
28
  type: 'ON_INPUT_CHANGE',
29
29
  inputName: 'customerNumber',
30
30
  value: e.target.value,
31
- }), modalContent: {
32
- description: t(PageText.Contact.input.customerNumber.description),
33
- } }), (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({
31
+ }), description: t(PageText.Contact.input.customerNumber.description) }), (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({
34
32
  type: 'ON_INPUT_CHANGE',
35
33
  inputName: 'firstName',
36
34
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"appTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,qBAAqB,GAAG;IAC3B,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,gBAAgB,GAAI,iBAAiB,qBAAqB,gCAyJtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"appTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,qBAAqB,GAAG;IAC3B,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,gBAAgB,GAAI,iBAAiB,qBAAqB,gCAgJtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -11,11 +11,7 @@ const AppTicketingForm = ({ state, send }) => {
11
11
  type: 'ON_INPUT_CHANGE',
12
12
  inputName: 'orderId',
13
13
  value: e.target.value,
14
- }), modalContent: {
15
- description: t(PageText.Contact.input.orderId.description),
16
- instruction: t(PageText.Contact.input.orderId.instruction),
17
- bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletpoint) => t(bulletpoint)),
18
- } }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
14
+ }), description: t(PageText.Contact.input.orderId.description) }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
19
15
  type: 'ON_INPUT_CHANGE',
20
16
  inputName: 'question',
21
17
  value: e.target.value,
@@ -36,9 +32,7 @@ const AppTicketingForm = ({ state, send }) => {
36
32
  type: 'ON_INPUT_CHANGE',
37
33
  inputName: 'customerNumber',
38
34
  value: e.target.value,
39
- }), modalContent: {
40
- description: t(PageText.Contact.input.customerNumber.description),
41
- } }), (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({
35
+ }), description: t(PageText.Contact.input.customerNumber.description) }), (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({
42
36
  type: 'ON_INPUT_CHANGE',
43
37
  inputName: 'firstName',
44
38
  value: e.target.value,
@@ -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,gCA6F9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
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,gCA6F9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
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"}
@@ -36,7 +36,11 @@ const PriceAndTicketTypesForm = ({ 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.PriceAndTicketTypesForm = PriceAndTicketTypesForm;
42
46
  exports.default = exports.PriceAndTicketTypesForm;
@@ -1 +1 @@
1
- {"version":3,"file":"travelCardQuestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/travelCardQuestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAInE,KAAK,2BAA2B,GAAG;IACjC,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,sBAAsB,GAAI,kBAGpC,2BAA2B,gCAyI7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"travelCardQuestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/travelCardQuestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,2BAA2B,GAAG;IACjC,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,sBAAsB,GAAI,kBAGpC,2BAA2B,gCAoI7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -3,18 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TravelCardQuestionForm = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const translations_1 = require("../../../translations");
6
- const typography_1 = require("../../../components/typography");
7
6
  const components_1 = require("../../../components");
8
7
  const TravelCardQuestionForm = ({ state, send, }) => {
9
8
  const PageText = (0, translations_1.usePageText)();
10
9
  const { t } = (0, translations_1.useTranslation)();
11
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.travelCardQuestion.label), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.input.travelCardNumber.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
12
- description: t(PageText.Contact.input.travelCardNumber.info),
13
- }, isRequired: true, errorMessage: state.context?.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
14
- type: 'ON_INPUT_CHANGE',
15
- inputName: 'travelCardNumber',
16
- value: e.target.value,
17
- }) })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
10
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.travelCardQuestion.label), children: (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', description: t(PageText.Contact.input.travelCardNumber.info), isRequired: true, errorMessage: state.context?.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
11
+ type: 'ON_INPUT_CHANGE',
12
+ inputName: 'travelCardNumber',
13
+ value: e.target.value,
14
+ }) }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
18
15
  type: 'ON_INPUT_CHANGE',
19
16
  inputName: 'question',
20
17
  value: e.target.value,