@sbb-esta/lyne-elements-experimental 4.0.1 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
  2. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +15 -16
  3. package/core/datetime/date-helper.js +3 -3
  4. package/custom-elements.json +241 -53
  5. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
  6. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +17 -19
  7. package/development/core/datetime/date-helper.js +3 -3
  8. package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-B0dawX-5.js} +2 -2
  9. package/development/{format-BQfaa1ZT.js → format-BMkeaqaF.js} +3 -3
  10. package/development/{isValid-DvieCZVi.js → isValid-BYRch7pV.js} +2 -2
  11. package/development/journey-summary/journey-summary.component.js +2 -2
  12. package/development/pearl-chain/pearl-chain.component.js +3 -5
  13. package/development/pearl-chain-time/pearl-chain-time.component.js +1 -1
  14. package/development/seat-reservation/common/mapper/mapper.d.ts +2 -2
  15. package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  16. package/development/seat-reservation/common/mapper/mapper.js +19 -6
  17. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
  18. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  19. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +970 -1
  20. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +11 -5
  21. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  22. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +118 -56
  23. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  24. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +170 -282
  25. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
  26. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +11 -8
  27. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
  28. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +153 -45
  29. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -2
  30. package/development/timetable-row/timetable-row.component.js +1 -1
  31. package/development/{toDate-D_Vjps95.js → toDate-BWb6Z1JD.js} +2 -2
  32. package/{differenceInMinutes-CP_C5onR.js → differenceInMinutes-COvvdYsJ.js} +1 -1
  33. package/{format-lqeCzmzS.js → format-CmKROkbc.js} +2 -41
  34. package/{isValid-Ceq2O0NQ.js → isValid-m3_OsPaB.js} +1 -1
  35. package/journey-summary/journey-summary.component.js +2 -2
  36. package/package.json +2 -2
  37. package/pearl-chain/pearl-chain.component.js +3 -3
  38. package/pearl-chain-time/pearl-chain-time.component.js +1 -1
  39. package/seat-reservation/common/mapper/mapper.d.ts +2 -2
  40. package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  41. package/seat-reservation/common/mapper/mapper.js +41 -38
  42. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
  43. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  44. package/seat-reservation/common/mapper/seat-reservation-sample-data.js +968 -1
  45. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +11 -5
  46. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  47. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +99 -73
  48. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  49. package/seat-reservation/seat-reservation/seat-reservation.component.js +210 -213
  50. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
  51. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +31 -28
  52. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
  53. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +143 -142
  54. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +1 -1
  55. package/timetable-row/timetable-row.component.js +1 -1
  56. package/{toDate-BCXKL_wM.js → toDate-Bw2KTWeq.js} +1 -1
@@ -33,7 +33,7 @@ export declare class SeatReservationBaseElement extends LitElement {
33
33
  accessor preselectCoachIndex: number;
34
34
  protected accessor selectedCoachIndex: number;
35
35
  protected accessor focusedCoachIndex: number;
36
- protected accessor hoveredScrollCoachIndex: number;
36
+ protected accessor hoveredCoachIndex: number;
37
37
  protected coachBorderPadding: number;
38
38
  protected gapBetweenCoaches: number;
39
39
  protected coachBorderOffset: number;
@@ -45,8 +45,6 @@ export declare class SeatReservationBaseElement extends LitElement {
45
45
  protected scrollCoachsAreaWidth: number;
46
46
  protected scrollNavigationAreaDim: number;
47
47
  protected triggerCoachPositionsCollection: CoachScrollTriggerPoint[];
48
- protected firstTabElement: HTMLElement;
49
- protected lastTabElement: HTMLElement;
50
48
  protected navigationScrollArea: HTMLElement;
51
49
  protected coachScrollArea: HTMLElement;
52
50
  protected currSelectedPlace: Place | null;
@@ -69,7 +67,9 @@ export declare class SeatReservationBaseElement extends LitElement {
69
67
  readonly Tab: "Tab";
70
68
  readonly Enter: "Enter";
71
69
  };
70
+ private _isRunningInitPreselectCoachIndex;
72
71
  private _scrollTimeout;
72
+ private _lastStartScrollPos;
73
73
  protected willUpdate(changedProperties: PropertyValues<this>): void;
74
74
  protected navigateByDirectionBtn(btnDirection: string): void;
75
75
  /**
@@ -93,11 +93,17 @@ export declare class SeatReservationBaseElement extends LitElement {
93
93
  * @param focusCoachIndex
94
94
  */
95
95
  protected onFocusTableCoachAndPreselectPlace(focusCoachIndex: number): void;
96
+ /** Will be triggerd by focus navigation direction */
97
+ protected onFocusNavDirectionButton(): void;
98
+ /** TAB Key Event handling for Coach Navigation */
99
+ protected onKeyNavigationNavCoachButton(event: KeyboardEvent, currNavCoachButtonIndex: number): void;
100
+ /** General TAB Key Event handling for tab navigation inside the coach navigation area and the seatmap area */
101
+ private _handleTabKeyNavigation;
96
102
  /**
97
- * Initialisation of Keyboard event handling to navigation between each places inside a selected coach by using [arrow] keys.
103
+ * Initialisation of Keyboard Seatmap event handling to navigation between each places inside a selected coach by using [arrow] keys.
98
104
  * With the [TAB] key the user navigation goes to the next coach navigation element and the currently selected place is automatically reset.
99
105
  */
100
- protected handleKeyboardEvent(event: KeyboardEvent): void;
106
+ protected keyboardSeatmapEventHadling(event: KeyboardEvent): void;
101
107
  /**
102
108
  * Selects a place inside the coach if navigated via keyboard,
103
109
  * otherwise the coach grid is selected (necessary for ScreenReader)
@@ -1 +1 @@
1
- {"version":3,"file":"seat-reservation-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation-base-element.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAShE,OAAO,KAAK,EACV,WAAW,EAEX,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,KAAK,EACL,cAAc,EAEd,eAAe,EAGf,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AAGtB,aAAK,eAAe;IAClB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAaD,qBAAa,0BAA2B,SAAQ,UAAU;IACxD,gBAAuB,MAAM;;;MAGlB;IAEX,kEAAkE;IAClE,SACgB,gBAAgB,EAAE,eAAe,EAAE,CAAS;IAE5D,sEAAsE;IACtE,SAEgB,aAAa,EAAE,OAAO,CAAQ;IAE9C,sDA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AAE,cAAc,GAAG,IAAI;IA+BjF,SAAS,CAAC,0BAA0B,IAAI,IAAI;IAmB5C,SAAS,CAAC,iBAAiB,CACzB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,MAAM;IAMT;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IA+BlC;;;OAGG;IACH,OAAO,CAAC,kCAAkC;IA4B1C;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,iCAAiC;IAoBzC,OAAO,CAAC,gCAAgC;IAUxC,OAAO,CAAC,8BAA8B;IAUtC;;;SAGK;IACL,OAAO,CAAC,sBAAsB;IAS9B;;;;;;;SAOK;IACL,OAAO,CAAC,2BAA2B;IA+BnC,OAAO,CAAC,6BAA6B;IAMrC,OAAO,CAAC,gCAAgC;IAsBxC,OAAO,CAAC,8BAA8B,CA4BpC;IAEF;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,kBAAkB;IAO1B;;;;;;;;;OASG;IACH,OAAO,CAAC,0BAA0B;IAkBlC;;;;;OAKG;IACH,OAAO,CAAC,+BAA+B;CAKxC"}
1
+ {"version":3,"file":"seat-reservation-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation-base-element.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAShE,OAAO,KAAK,EACV,WAAW,EAEX,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,KAAK,EACL,cAAc,EAEd,eAAe,EAGf,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AAGtB,aAAK,eAAe;IAClB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;I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@@
1
1
  var fe = (n) => {
2
2
  throw TypeError(n);
3
3
  };
4
- var Se = (n, d, u) => d.has(n) || fe("Cannot " + u);
5
- var g = (n, d, u) => (Se(n, d, "read from private field"), u ? u.call(n) : d.get(n)), v = (n, d, u) => d.has(n) ? fe("Cannot add the same private member more than once") : d instanceof WeakSet ? d.add(n) : d.set(n, u), r = (n, d, u, D) => (Se(n, d, "write to private field"), D ? D.call(n, u) : d.set(n, u), u);
4
+ var Ce = (n, d, u) => d.has(n) || fe("Cannot " + u);
5
+ var g = (n, d, u) => (Ce(n, d, "read from private field"), u ? u.call(n) : d.get(n)), v = (n, d, u) => d.has(n) ? fe("Cannot add the same private member more than once") : d instanceof WeakSet ? d.add(n) : d.set(n, u), r = (n, d, u, D) => (Ce(n, d, "write to private field"), D ? D.call(n, u) : d.set(n, u), u);
6
6
  import { __runInitializers as l, __esDecorate as f } from "tslib";
7
- import { isArrowKeyOrPageKeysPressed as Ie } from "@sbb-esta/lyne-elements/core/a11y.js";
8
- import { forceType as C } from "@sbb-esta/lyne-elements/core/decorators.js";
7
+ import { isArrowKeyOrPageKeysPressed as Se } from "@sbb-esta/lyne-elements/core/a11y.js";
8
+ import { forceType as S } from "@sbb-esta/lyne-elements/core/decorators.js";
9
9
  import { LitElement as xe, isServer as pe } from "lit";
10
- import { property as S, state as T, eventOptions as me } from "lit/decorators.js";
11
- import { mapIconToSvg as Ce, mapPlaceInfosToPlaceSelection as _e, mapPlaceAndCoachToSeatReservationPlaceSelection as ye, mapCoachInfosToCoachSelection as be } from "../common/mapper.js";
10
+ import { property as C, state as T, eventOptions as _e } from "lit/decorators.js";
11
+ import { mapIconToSvg as Ie, mapPlaceInfosToPlaceSelection as me, mapPlaceAndCoachToSeatReservationPlaceSelection as ye, mapCoachInfosToCoachSelection as be } from "../common/mapper.js";
12
12
  var I;
13
13
  (function(n) {
14
14
  n.right = "right", n.left = "left";
15
15
  })(I || (I = {}));
16
- const Pe = 3, Ae = [
16
+ const Pe = 3, Ne = [
17
17
  "sa-vo",
18
18
  "sa-rs",
19
19
  "sa-abteilkinderwagen",
@@ -23,24 +23,24 @@ const Pe = 3, Ae = [
23
23
  "sa-rz"
24
24
  ];
25
25
  let ze = (() => {
26
- var x, p, m, _, y, b, P, A, R, k, N, E, h;
27
- let n = xe, d = [], u, D = [], B = [], z, F = [], V = [], O, G = [], L = [], W, X = [], K = [], H, U = [], q = [], M, $ = [], j = [], Y, J = [], Q = [], Z, ee = [], te = [], se, ie = [], ae = [], ce, oe = [], re = [], le, ne = [], he = [], de, ue = [], ge = [], ve;
26
+ var x, p, _, m, y, b, P, N, R, A, k, E, h;
27
+ let n = xe, d = [], u, D = [], B = [], z, F = [], V = [], G, O = [], L = [], K, W = [], X = [], H, U = [], M = [], q, $ = [], j = [], Y, J = [], Q = [], Z, ee = [], te = [], se, ie = [], ae = [], ce, oe = [], re = [], le, ne = [], he = [], de, ue = [], ge = [], ve;
28
28
  return h = class extends n {
29
29
  constructor() {
30
30
  super(...arguments);
31
31
  v(this, x);
32
32
  v(this, p);
33
- v(this, m);
34
33
  v(this, _);
34
+ v(this, m);
35
35
  v(this, y);
36
36
  v(this, b);
37
37
  v(this, P);
38
- v(this, A);
38
+ v(this, N);
39
39
  v(this, R);
40
+ v(this, A);
40
41
  v(this, k);
41
- v(this, N);
42
42
  v(this, E);
43
- r(this, x, (l(this, d), l(this, D, null))), r(this, p, (l(this, B), l(this, F, !0))), r(this, m, (l(this, V), l(this, G, !1))), r(this, _, (l(this, L), l(this, X, 16))), r(this, y, (l(this, K), l(this, U, null))), r(this, b, (l(this, q), l(this, $, -1))), r(this, P, (l(this, j), l(this, J, -1))), r(this, A, (l(this, Q), l(this, ee, !1))), r(this, R, (l(this, te), l(this, ie, -1))), r(this, k, (l(this, ae), l(this, oe, -1))), r(this, N, (l(this, re), l(this, ne, -1))), r(this, E, (l(this, he), l(this, ue, -1))), this.coachBorderPadding = (l(this, ge), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.coachNavData = [], this.currScrollDirection = I.right, this.maxCalcCoachsWidth = 0, this.scrollCoachsAreaWidth = 0, this.scrollNavigationAreaDim = 0, this.triggerCoachPositionsCollection = [], this.firstTabElement = null, this.lastTabElement = null, this.navigationScrollArea = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.currSelectedDeckIndex = 0, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = {
43
+ r(this, x, (l(this, d), l(this, D, null))), r(this, p, (l(this, B), l(this, F, !0))), r(this, _, (l(this, V), l(this, O, !1))), r(this, m, (l(this, L), l(this, W, 16))), r(this, y, (l(this, X), l(this, U, null))), r(this, b, (l(this, M), l(this, $, -1))), r(this, P, (l(this, j), l(this, J, -1))), r(this, N, (l(this, Q), l(this, ee, !1))), r(this, R, (l(this, te), l(this, ie, -1))), r(this, A, (l(this, ae), l(this, oe, -1))), r(this, k, (l(this, re), l(this, ne, -1))), r(this, E, (l(this, he), l(this, ue, -1))), this.coachBorderPadding = (l(this, ge), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.coachNavData = [], this.currScrollDirection = I.right, this.maxCalcCoachsWidth = 0, this.scrollCoachsAreaWidth = 0, this.scrollNavigationAreaDim = 0, this.triggerCoachPositionsCollection = [], this.navigationScrollArea = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.currSelectedDeckIndex = 0, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = {
44
44
  seats: [],
45
45
  bicycles: []
46
46
  }, this.seatReservationWithoutNavigationHasFocus = !1, this.isCoachGridFocusable = !1, this.isAutoScrolling = !1, this.isKeyboardNavigation = !1, this.hasMultipleDecks = !1, this.hasSeatReservationNativeFocus = !1, this.keyboardNavigationEvents = {
@@ -50,15 +50,15 @@ let ze = (() => {
50
50
  ArrowDown: "ArrowDown",
51
51
  Tab: "Tab",
52
52
  Enter: "Enter"
53
- }, this._prepareServiceIconsNavigation = (e) => {
53
+ }, this._isRunningInitPreselectCoachIndex = !1, this._lastStartScrollPos = -1, this._prepareServiceIconsNavigation = (e) => {
54
54
  if (!e)
55
55
  return [];
56
56
  const t = e?.map(function(s) {
57
57
  return {
58
58
  pId: s,
59
- svgName: Ce[s]?.svgName ? Ce[s]?.svgName : ""
59
+ svgName: Ie[s]?.svgName ? Ie[s]?.svgName : ""
60
60
  };
61
- }).filter((s) => Ae.indexOf(s.svgName) !== -1).filter((s, i, a) => a.map((o) => o.svgName).indexOf(s.svgName) === i).map((s) => s.pId).slice(0, Pe);
61
+ }).filter((s) => Ne.indexOf(s.svgName) !== -1).filter((s, i, a) => a.map((o) => o.svgName).indexOf(s.svgName) === i).map((s) => s.pId).slice(0, Pe);
62
62
  return t || [];
63
63
  };
64
64
  }
@@ -78,17 +78,17 @@ let ze = (() => {
78
78
  }
79
79
  /** The seat reservation area is aligned vertically */
80
80
  get alignVertical() {
81
- return g(this, m);
81
+ return g(this, _);
82
82
  }
83
83
  set alignVertical(e) {
84
- r(this, m, e);
84
+ r(this, _, e);
85
85
  }
86
86
  /** The seat reservation area's base grid size */
87
87
  get baseGridSize() {
88
- return g(this, _);
88
+ return g(this, m);
89
89
  }
90
90
  set baseGridSize(e) {
91
- r(this, _, e);
91
+ r(this, m, e);
92
92
  }
93
93
  /** The seat reservation area's width */
94
94
  get height() {
@@ -113,10 +113,10 @@ let ze = (() => {
113
113
  }
114
114
  /** Any click functionality is prevented */
115
115
  get preventPlaceClick() {
116
- return g(this, A);
116
+ return g(this, N);
117
117
  }
118
118
  set preventPlaceClick(e) {
119
- r(this, A, e);
119
+ r(this, N, e);
120
120
  }
121
121
  get preselectCoachIndex() {
122
122
  return g(this, R);
@@ -125,22 +125,21 @@ let ze = (() => {
125
125
  r(this, R, e);
126
126
  }
127
127
  get selectedCoachIndex() {
128
- return g(this, k);
128
+ return g(this, A);
129
129
  }
130
130
  set selectedCoachIndex(e) {
131
- r(this, k, e);
131
+ r(this, A, e);
132
132
  }
133
133
  get focusedCoachIndex() {
134
- return g(this, N);
134
+ return g(this, k);
135
135
  }
136
136
  set focusedCoachIndex(e) {
137
- r(this, N, e);
137
+ r(this, k, e);
138
138
  }
139
- //Sets the hover style when scrolling to a coach
140
- get hoveredScrollCoachIndex() {
139
+ get hoveredCoachIndex() {
141
140
  return g(this, E);
142
141
  }
143
- set hoveredScrollCoachIndex(e) {
142
+ set hoveredCoachIndex(e) {
144
143
  r(this, E, e);
145
144
  }
146
145
  willUpdate(e) {
@@ -148,7 +147,7 @@ let ze = (() => {
148
147
  const t = this.seatReservations[this.currSelectedDeckIndex] || null;
149
148
  t?.coachItems.length && (this.baseGridSize = this.height / t.coachItems[0].dimension.h, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this.initNavigationSelectionByScrollEvent());
150
149
  }
151
- e.has("alignVertical") && this.alignVertical && this.initNavigationSelectionByScrollEvent(), e.has("preselectCoachIndex") && setTimeout(() => this.scrollToSelectedNavCoach(this.preselectCoachIndex), 1);
150
+ e.has("alignVertical") && this.alignVertical && this.initNavigationSelectionByScrollEvent(), e.has("preselectCoachIndex") && (this._isRunningInitPreselectCoachIndex = !0, setTimeout(() => this.scrollToSelectedNavCoach(this.preselectCoachIndex), 1));
152
151
  }
153
152
  navigateByDirectionBtn(e) {
154
153
  this.unfocusPlaceElement();
@@ -164,7 +163,7 @@ let ze = (() => {
164
163
  }
165
164
  /** Init scroll event handling for coach navigation */
166
165
  initNavigationSelectionByScrollEvent() {
167
- this.firstTabElement = this.shadowRoot?.querySelector("#first-tab-element"), this.lastTabElement = this.shadowRoot?.querySelector("#last-tab-element"), this.coachScrollArea = this.shadowRoot?.querySelector("#sbb-sr__wrapper-scrollarea"), this.navigationScrollArea = this.shadowRoot?.querySelector("#sbb-sr-navigation");
166
+ this.coachScrollArea = this.shadowRoot?.querySelector("#sbb-sr__wrapper-scrollarea"), this.navigationScrollArea = this.shadowRoot?.querySelector("#sbb-sr__navigation-list-coaches");
168
167
  const e = this.seatReservations ? this.seatReservations[this.currSelectedDeckIndex] : null;
169
168
  if (e && e.coachItems.length > 0) {
170
169
  const t = e.coachItems[0].dimension.h * this.baseGridSize + this.coachBorderPadding, s = (this.seatReservations.length - 1) * this.gapBetweenCoachDecks;
@@ -208,23 +207,34 @@ let ze = (() => {
208
207
  onFocusTableCoachAndPreselectPlace(e) {
209
208
  !this.seatReservationWithoutNavigationHasFocus && !this.hasNavigation && (this.seatReservationWithoutNavigationHasFocus = !0, this.currSelectedCoachIndex = e === 0 ? this.getNextAvailableCoachIndex(-1) : this.getPrevAvailableCoachIndex(e), this.preselectPlaceInCoach());
210
209
  }
210
+ /** Will be triggerd by focus navigation direction */
211
+ onFocusNavDirectionButton() {
212
+ this.focusedCoachIndex = -1;
213
+ }
214
+ /** TAB Key Event handling for Coach Navigation */
215
+ onKeyNavigationNavCoachButton(e, t) {
216
+ if (e.key === this.keyboardNavigationEvents.Tab) {
217
+ this._handleTabKeyNavigation(e, "navigation", t);
218
+ return;
219
+ }
220
+ Se(e) && this.keyboardSeatmapEventHadling(e);
221
+ }
222
+ /** General TAB Key Event handling for tab navigation inside the coach navigation area and the seatmap area */
223
+ _handleTabKeyNavigation(e, t, s) {
224
+ const i = e.key, a = e.shiftKey;
225
+ i === this.keyboardNavigationEvents.Tab && (t == "navigation" ? (s == this.currSelectedCoachIndex ? !this.currSelectedPlace || !a || this.coachNavData[s].isDriverArea || this.focusedCoachIndex == -1 ? this.focusedCoachIndex = s : a && this.currSelectedPlace && (this.focusedCoachIndex = -1, this.focusPlaceElement(this.currSelectedPlace)) : this.focusedCoachIndex = s, this._scrollToSelectedNavigationButton(s)) : t == "seatmap" && (e.preventDefault(), a ? this._navigateCoachNavigationByKeyboard("PREV_TAB") : this._navigateCoachNavigationByKeyboard("NEXT_TAB")));
226
+ }
211
227
  /**
212
- * Initialisation of Keyboard event handling to navigation between each places inside a selected coach by using [arrow] keys.
228
+ * Initialisation of Keyboard Seatmap event handling to navigation between each places inside a selected coach by using [arrow] keys.
213
229
  * With the [TAB] key the user navigation goes to the next coach navigation element and the currently selected place is automatically reset.
214
230
  */
215
- handleKeyboardEvent(e) {
231
+ keyboardSeatmapEventHadling(e) {
216
232
  const t = e.key;
217
- if (this.preventCoachScrollByPlaceClick = !1, !this.hasSeatReservationNativeFocus && (e.shiftKey && e.keyCode === 9 || t === this.keyboardNavigationEvents.Tab) && (this.hasSeatReservationNativeFocus = !0), this.currSelectedPlace) {
218
- if (e.shiftKey && e.keyCode === 9) {
219
- this._navigateCoachNavigationByKeyboard("PREV_TAB"), e.preventDefault();
220
- return;
221
- }
222
- if (t === this.keyboardNavigationEvents.Tab) {
223
- this._navigateCoachNavigationByKeyboard("NEXT_TAB"), e.preventDefault();
224
- return;
225
- }
233
+ if (this.preventCoachScrollByPlaceClick = !1, !this.hasSeatReservationNativeFocus && (e.shiftKey && t === this.keyboardNavigationEvents.Tab || t === this.keyboardNavigationEvents.Tab) && (this.hasSeatReservationNativeFocus = !0), t == this.keyboardNavigationEvents.Tab) {
234
+ this._handleTabKeyNavigation(e, "seatmap");
235
+ return;
226
236
  }
227
- if (this.currSelectedCoachIndex !== -1 && Ie(e))
237
+ if (this.currSelectedCoachIndex !== -1 && Se(e))
228
238
  switch (e.preventDefault(), t) {
229
239
  case this.keyboardNavigationEvents.ArrowLeft:
230
240
  {
@@ -257,25 +267,44 @@ let ze = (() => {
257
267
  * otherwise the coach grid is selected (necessary for ScreenReader)
258
268
  */
259
269
  preselectPlaceInCoach() {
260
- const e = this._getClosestPlaceByKeyDirection();
261
- e && this.unfocusPlaceElement(), this.isKeyboardNavigation && this.isAutoScrolling ? e && this.focusPlaceElement(e) : (this.currSelectedPlace = e, this._setFocusToSelectedCoachGrid());
270
+ if (this.isAutoScrolling) {
271
+ if (this._isRunningInitPreselectCoachIndex) {
272
+ this._isRunningInitPreselectCoachIndex = !1;
273
+ return;
274
+ }
275
+ if (this.coachNavData[this.currSelectedCoachIndex] && this.coachNavData[this.currSelectedCoachIndex].isDriverArea) {
276
+ this._setFocusToSelectedCoachGrid();
277
+ return;
278
+ }
279
+ if (this.isKeyboardNavigation && this.isAutoScrolling) {
280
+ const e = this._getClosestPlaceByKeyDirection();
281
+ e ? (this.unfocusPlaceElement(), this.focusPlaceElement(e), this.focusedCoachIndex = -1) : this._setFocusToSelectedCoachGrid();
282
+ } else
283
+ this.unfocusPlaceElement(), this.isCoachGridFocusable = !0, this._setFocusToSelectedCoachGrid();
284
+ }
262
285
  }
263
286
  scrollToSelectedNavCoach(e) {
264
287
  if (this._isValidCoachIndex(e) && e !== this.currSelectedCoachIndex) {
265
- this.isAutoScrolling = !0, this.isCoachGridFocusable = !0, this.currSelectedCoachIndex = e, this.currSelectedDeckIndex = this._getExistingCoachDeckIndex(), this._setScrollDirectionByCoachIndex();
288
+ this.hoveredCoachIndex = e, this.isAutoScrolling = !0, this.isCoachGridFocusable = !0, this.currSelectedCoachIndex = e, this.currSelectedDeckIndex = this._getExistingCoachDeckIndex(), this._setScrollDirectionByCoachIndex();
266
289
  const t = this._getCoachScrollPositionX();
267
- (this.selectedCoachIndex !== -1 || this.currSelectedCoachIndex > 0) && this._isScrollableToSelectedCoach() ? this.coachScrollArea.scrollTo({
290
+ (this.selectedCoachIndex !== -1 || this.currSelectedCoachIndex > 0) && this._isScrollableToSelectedCoach() ? (this._lastStartScrollPos = this.coachScrollArea.scrollLeft, this.coachScrollArea.scrollTo({
268
291
  top: this.alignVertical ? t : 0,
269
292
  left: this.alignVertical ? 0 : t,
270
293
  behavior: "smooth"
271
- }) : this.updateCurrentSelectedCoach(), this._scrollToSelectedNavigationButton(e);
294
+ })) : this.updateCurrentSelectedCoach(), this._scrollToSelectedNavigationButton(e);
272
295
  }
273
296
  }
274
297
  focusPlaceElement(e) {
275
298
  if (this.unfocusPlaceElement(), e) {
276
299
  this.currSelectedPlace = e, this._setCurrSelectedPlaceElementId(e);
277
300
  const t = this._getPlaceHtmlElement();
278
- t && t.setAttribute("keyfocus", "focus");
301
+ if (t) {
302
+ t.setAttribute("keyfocus", "focus");
303
+ const s = setTimeout(() => {
304
+ const i = this.getPlaceElementId(this.currSelectedDeckIndex, this.currSelectedCoachIndex, e.number);
305
+ this._scrollPlaceIntoNearestViewport(i), clearTimeout(s);
306
+ }, 0);
307
+ }
279
308
  }
280
309
  }
281
310
  unfocusPlaceElement() {
@@ -323,12 +352,12 @@ let ze = (() => {
323
352
  * the reached coach is marked as selected
324
353
  */
325
354
  _handleCoachAreaScrollendEvent() {
355
+ const e = this.isAutoScrolling ? this.currSelectedCoachIndex : this._getCoachIndexByScrollTriggerPosition();
326
356
  if (this.preventCoachScrollByPlaceClick) {
327
- this.preventCoachScrollByPlaceClick = !1;
357
+ Math.abs(this._lastStartScrollPos - this.coachScrollArea.scrollLeft) > this.baseGridSize * 2 && (this.selectedCoachIndex = e), this.preventCoachScrollByPlaceClick = !1;
328
358
  return;
329
359
  }
330
- const e = this.isAutoScrolling ? this.currSelectedCoachIndex : this._getCoachIndexByScrollTriggerPosition();
331
- this.hoveredScrollCoachIndex = -1, this.currSelectedCoachIndex === -1 && (this.currSelectedCoachIndex = e), this._isScrollableToSelectedCoach() ? this.currSelectedCoachIndex = e : this.currSelectedCoachIndex = e < this.currSelectedCoachIndex ? this.currSelectedCoachIndex : e, this.isAutoScrolling || this._scrollToSelectedNavigationButton(e), this.preventCoachScrollByPlaceClick = !1, this.updateCurrentSelectedCoach(), this.hasNavigation || (this.preselectPlaceInCoach(), this.isAutoScrolling = !1);
360
+ this._lastStartScrollPos = this.coachScrollArea.scrollLeft, this.hoveredCoachIndex = -1, this.currSelectedCoachIndex === -1 && (this.currSelectedCoachIndex = e), this._isScrollableToSelectedCoach() ? this.currSelectedCoachIndex = e : this.currSelectedCoachIndex = e < this.currSelectedCoachIndex ? this.currSelectedCoachIndex : e, this.isAutoScrolling || this._scrollToSelectedNavigationButton(e), this.preventCoachScrollByPlaceClick = !1, this.updateCurrentSelectedCoach(), this.hasNavigation || (this.preselectPlaceInCoach(), this.isAutoScrolling = !1);
332
361
  }
333
362
  /**
334
363
  * Performs an automatic main navigation scroll to the specified selectedNavCoachIndex.
@@ -337,7 +366,7 @@ let ze = (() => {
337
366
  */
338
367
  _scrollToSelectedNavigationButton(e) {
339
368
  setTimeout(() => {
340
- if (this.hoveredScrollCoachIndex = e, this.hasNavigation && this.navigationScrollArea) {
369
+ if (this.hasNavigation && this.navigationScrollArea) {
341
370
  const t = this.scrollNavigationAreaDim / 2, i = e * this.coachNavButtonDim - t + this.coachNavButtonDim;
342
371
  this.navigationScrollArea.scrollTo({
343
372
  top: this.alignVertical ? i : 0,
@@ -427,19 +456,14 @@ let ze = (() => {
427
456
  // This controls the focused coach from the current selected coach.
428
457
  _navigateCoachNavigationByKeyboard(e) {
429
458
  const t = this.focusedCoachIndex === -1 ? this.currSelectedCoachIndex === -1 ? 0 : this.currSelectedCoachIndex : this.focusedCoachIndex, s = e === "NEXT_TAB" ? this.getNextAvailableCoachIndex(t) : this.getPrevAvailableCoachIndex(t);
430
- if (t === s) {
431
- this.unfocusPlaceElement(), this.seatReservationWithoutNavigationHasFocus = !1, e === "NEXT_TAB" ? this.lastTabElement.focus() : this.firstTabElement.focus();
432
- return;
433
- }
434
459
  if (this.hasNavigation) {
435
460
  const i = this._getPlaceHtmlElement(), a = i ? i.getAttribute("keyfocus") === "focus" : !1;
436
461
  if (e === "PREV_TAB" && this.selectedCoachIndex === t)
437
- if (a) {
462
+ if (a || this.currSelectedPlace !== null) {
438
463
  this.focusedCoachIndex = t, this.unfocusPlaceElement();
439
464
  return;
440
- } else
441
- this.focusedCoachIndex = s;
442
- else s !== this.currSelectedCoachIndex ? this.focusedCoachIndex = s : (this.focusedCoachIndex = -1, this.selectedCoachIndex = s, a ? this.focusPlaceElement(this.currSelectedPlace) : (this.isCoachGridFocusable = !0, this._setFocusToSelectedCoachGrid()));
465
+ } else t == 0 ? (this.unfocusPlaceElement(), this.currSelectedPlace = null, this.focusedCoachIndex = -1, (this.shadowRoot?.getElementById("sbb-sr-navigation__wrapper-button-direction--left")).focus()) : this.focusedCoachIndex = s;
466
+ else s !== this.currSelectedCoachIndex ? this.focusedCoachIndex = s : e === "NEXT_TAB" && s === this.coachNavData.length - 1 ? (this.unfocusPlaceElement(), this.focusedCoachIndex = -1, (this.shadowRoot?.getElementById("sbb-sr-navigation__wrapper-button-direction--right")).focus()) : (this.focusedCoachIndex = -1, this.selectedCoachIndex = s, a ? this.focusPlaceElement(this.currSelectedPlace) : (this.isCoachGridFocusable = !0, this._setFocusToSelectedCoachGrid()));
443
467
  this._scrollToSelectedNavigationButton(s);
444
468
  } else
445
469
  this.scrollToSelectedNavCoach(s);
@@ -490,13 +514,15 @@ let ze = (() => {
490
514
  const i = this.seatReservations[t].coachItems[s].places?.find((o) => o.number == e.number);
491
515
  if (!i)
492
516
  return;
493
- this.unfocusPlaceElement(), this.currSelectedDeckIndex = t, this.currSelectedCoachIndex = s, this.currSelectedPlace = i, this.currSelectedCoachIndex !== this.selectedCoachIndex && this.updateCurrentSelectedCoach(), this._setCurrSelectedPlaceElementId(i);
517
+ this.currSelectedDeckIndex = t, this.currSelectedCoachIndex = s, this.currSelectedPlace = i, this.currSelectedCoachIndex !== this.selectedCoachIndex && this.updateCurrentSelectedCoach(), this._setCurrSelectedPlaceElementId(i);
494
518
  const a = setTimeout(() => {
495
519
  this._scrollPlaceIntoNearestViewport(e.id), clearTimeout(a);
496
520
  }, 0);
497
521
  }
498
522
  updateCurrentSelectedCoach() {
499
- this.selectedCoachIndex = this.currSelectedCoachIndex, this.focusedCoachIndex = -1;
523
+ if (this.currSelectedCoachIndex == this.selectedCoachIndex)
524
+ return;
525
+ this.focusedCoachIndex != -1 && (this.focusedCoachIndex = this.currSelectedCoachIndex), this.selectedCoachIndex = this.currSelectedCoachIndex;
500
526
  const e = this._getSeatReservationSelectedCoach(this.selectedCoachIndex);
501
527
  e && this.dispatchEvent(new CustomEvent("selectedcoach", {
502
528
  bubbles: !0,
@@ -540,9 +566,9 @@ let ze = (() => {
540
566
  * that have the state SELECTED within the seatReservation object
541
567
  */
542
568
  _initSeatReservationPlaceSelection() {
543
- this.seatReservations?.forEach((e, t) => e.coachItems.map((s, i) => {
569
+ this.selectedSeatReservationPlaces.seats = [], this.selectedSeatReservationPlaces.bicycles = [], this.seatReservations?.forEach((e, t) => e.coachItems.map((s, i) => {
544
570
  s.places?.filter((a) => a.state === "SELECTED")?.forEach((a) => {
545
- const o = this.getPlaceElementId(t, i, a.number), c = _e(a, o, e.deckCoachIndex, i), w = this._getSeatReservationPlaceSelection(c, t);
571
+ const o = this.getPlaceElementId(t, i, a.number), c = me(a, o, e.deckCoachIndex, i), w = this._getSeatReservationPlaceSelection(c, t);
546
572
  w && (w.placeType === "SEAT" ? this.selectedSeatReservationPlaces.seats.push(w) : this.selectedSeatReservationPlaces.bicycles.push(w));
547
573
  });
548
574
  }));
@@ -665,19 +691,19 @@ let ze = (() => {
665
691
  _scrollPlaceIntoNearestViewport(e) {
666
692
  this.shadowRoot?.getElementById(e)?.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
667
693
  }
668
- }, x = new WeakMap(), p = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), y = new WeakMap(), b = new WeakMap(), P = new WeakMap(), A = new WeakMap(), R = new WeakMap(), k = new WeakMap(), N = new WeakMap(), E = new WeakMap(), (() => {
694
+ }, x = new WeakMap(), p = new WeakMap(), _ = new WeakMap(), m = new WeakMap(), y = new WeakMap(), b = new WeakMap(), P = new WeakMap(), N = new WeakMap(), R = new WeakMap(), A = new WeakMap(), k = new WeakMap(), E = new WeakMap(), (() => {
669
695
  const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(n[Symbol.metadata] ?? null) : void 0;
670
- u = [S({ attribute: "seat-reservations", type: Array })], z = [C(), S({ attribute: "has-navigation", type: Boolean })], O = [C(), S({ attribute: "align-vertical", type: Boolean, reflect: !0, useDefault: !0 })], W = [C(), S({ attribute: "base-grid-size", type: Number })], H = [C(), S({ attribute: "height", type: Number })], M = [C(), S({ attribute: "max-seat-reservations", type: Number })], Y = [C(), S({ attribute: "max-bicycle-reservations", type: Number })], Z = [C(), S({ attribute: "prevent-place-click", type: Boolean })], se = [C(), S({ attribute: "preselect-coach-index", type: Number })], ce = [T()], le = [T()], de = [T()], ve = [me({ passive: !0 })], f(h, null, u, { kind: "accessor", name: "seatReservations", static: !1, private: !1, access: { has: (t) => "seatReservations" in t, get: (t) => t.seatReservations, set: (t, s) => {
696
+ u = [C({ attribute: "seat-reservations", type: Array })], z = [S(), C({ attribute: "has-navigation", type: Boolean })], G = [S(), C({ attribute: "align-vertical", type: Boolean, reflect: !0, useDefault: !0 })], K = [S(), C({ attribute: "base-grid-size", type: Number })], H = [S(), C({ attribute: "height", type: Number })], q = [S(), C({ attribute: "max-seat-reservations", type: Number })], Y = [S(), C({ attribute: "max-bicycle-reservations", type: Number })], Z = [S(), C({ attribute: "prevent-place-click", type: Boolean })], se = [S(), C({ attribute: "preselect-coach-index", type: Number })], ce = [T()], le = [T()], de = [T()], ve = [_e({ passive: !0 })], f(h, null, u, { kind: "accessor", name: "seatReservations", static: !1, private: !1, access: { has: (t) => "seatReservations" in t, get: (t) => t.seatReservations, set: (t, s) => {
671
697
  t.seatReservations = s;
672
698
  } }, metadata: e }, D, B), f(h, null, z, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, s) => {
673
699
  t.hasNavigation = s;
674
- } }, metadata: e }, F, V), f(h, null, O, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, s) => {
700
+ } }, metadata: e }, F, V), f(h, null, G, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, s) => {
675
701
  t.alignVertical = s;
676
- } }, metadata: e }, G, L), f(h, null, W, { kind: "accessor", name: "baseGridSize", static: !1, private: !1, access: { has: (t) => "baseGridSize" in t, get: (t) => t.baseGridSize, set: (t, s) => {
702
+ } }, metadata: e }, O, L), f(h, null, K, { kind: "accessor", name: "baseGridSize", static: !1, private: !1, access: { has: (t) => "baseGridSize" in t, get: (t) => t.baseGridSize, set: (t, s) => {
677
703
  t.baseGridSize = s;
678
- } }, metadata: e }, X, K), f(h, null, H, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, s) => {
704
+ } }, metadata: e }, W, X), f(h, null, H, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, s) => {
679
705
  t.height = s;
680
- } }, metadata: e }, U, q), f(h, null, M, { kind: "accessor", name: "maxSeatReservations", static: !1, private: !1, access: { has: (t) => "maxSeatReservations" in t, get: (t) => t.maxSeatReservations, set: (t, s) => {
706
+ } }, metadata: e }, U, M), f(h, null, q, { kind: "accessor", name: "maxSeatReservations", static: !1, private: !1, access: { has: (t) => "maxSeatReservations" in t, get: (t) => t.maxSeatReservations, set: (t, s) => {
681
707
  t.maxSeatReservations = s;
682
708
  } }, metadata: e }, $, j), f(h, null, Y, { kind: "accessor", name: "maxBicycleReservations", static: !1, private: !1, access: { has: (t) => "maxBicycleReservations" in t, get: (t) => t.maxBicycleReservations, set: (t, s) => {
683
709
  t.maxBicycleReservations = s;
@@ -689,8 +715,8 @@ let ze = (() => {
689
715
  t.selectedCoachIndex = s;
690
716
  } }, metadata: e }, oe, re), f(h, null, le, { kind: "accessor", name: "focusedCoachIndex", static: !1, private: !1, access: { has: (t) => "focusedCoachIndex" in t, get: (t) => t.focusedCoachIndex, set: (t, s) => {
691
717
  t.focusedCoachIndex = s;
692
- } }, metadata: e }, ne, he), f(h, null, de, { kind: "accessor", name: "hoveredScrollCoachIndex", static: !1, private: !1, access: { has: (t) => "hoveredScrollCoachIndex" in t, get: (t) => t.hoveredScrollCoachIndex, set: (t, s) => {
693
- t.hoveredScrollCoachIndex = s;
718
+ } }, metadata: e }, ne, he), f(h, null, de, { kind: "accessor", name: "hoveredCoachIndex", static: !1, private: !1, access: { has: (t) => "hoveredCoachIndex" in t, get: (t) => t.hoveredCoachIndex, set: (t, s) => {
719
+ t.hoveredCoachIndex = s;
694
720
  } }, metadata: e }, ue, ge), f(h, null, ve, { kind: "method", name: "coachAreaScrollend", static: !1, private: !1, access: { has: (t) => "coachAreaScrollend" in t, get: (t) => t.coachAreaScrollend }, metadata: e }, null, d), e && Object.defineProperty(h, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
695
721
  })(), h.events = {
696
722
  selectedplaces: "selectedplaces",
@@ -1 +1 @@
1
- {"version":3,"file":"seat-reservation.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAgB1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,OAAO,mCAAmC,CAAC;AAC3C,OAAO,+CAA+C,CAAC;AACvD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,6BAA6B,CAAC;AACrC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,qBAEM,yBAA0B,SAAQ,0BAA0B;IAChE,OAAuB,MAAM,EAAE,cAAc,CAA4B;IAEzE,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,gBAAgB,CAQtB;IAGF,OAAO,CAAC,2BAA2B,CAAkB;cAElC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAgBzD,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAS3D,MAAM,IAAI,cAAc,GAAG,IAAI;IAKlD,OAAO,CAAC,uCAAuC;IAoD/C,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,8BAA8B;IAmCtC,OAAO,CAAC,iBAAiB;IAsCzB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,mBAAmB;IAsC3B;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IA8BhC,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,wBAAwB;IAsDhC,OAAO,CAAC,6BAA6B;IAgCrC;;;;;;;;OAQG;IACH,OAAO,CAAC,yBAAyB;IAgFjC,OAAO,CAAC,4BAA4B;IAuCpC,OAAO,CAAC,2BAA2B;IAwCnC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,gBAAgB;IASxB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAWhB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,yBAAyB;IAkCjC,OAAO,CAAC,8BAA8B;CAyBvC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,sBAAsB,EAAE,yBAAyB,CAAC;KACnD;CACF"}
1
+ {"version":3,"file":"seat-reservation.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAiB1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,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