@sbb-esta/lyne-elements-experimental-dev 4.7.0-dev.1773388997 → 4.7.0-dev.1773393170

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 (200) hide show
  1. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +76 -65
  2. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +52 -72
  3. package/autocomplete-grid/autocomplete-grid-button.js +6 -3
  4. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +17 -2
  5. package/autocomplete-grid/autocomplete-grid-cell.js +7 -4
  6. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +21 -20
  7. package/autocomplete-grid/autocomplete-grid-optgroup.js +6 -3
  8. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +33 -2
  9. package/autocomplete-grid/autocomplete-grid-option.js +9 -4
  10. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +22 -2
  11. package/autocomplete-grid/autocomplete-grid-row.js +7 -4
  12. package/autocomplete-grid/autocomplete-grid.js +6 -3
  13. package/autocomplete-grid.js +21 -9
  14. package/autocomplete-grid.pure.js +15 -7
  15. package/core/datetime/date-helper.js +191 -2
  16. package/core/datetime.js +5 -2
  17. package/core/timetable/access-leg-helper.js +71 -76
  18. package/core/timetable/timetable-helper.js +11 -9
  19. package/core/timetable/timetable-properties.js +1 -0
  20. package/core/timetable.js +7 -3
  21. package/custom-elements.json +84 -84
  22. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +122 -114
  23. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +70 -92
  24. package/development/autocomplete-grid/autocomplete-grid-button.js +4 -6
  25. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +29 -2
  26. package/development/autocomplete-grid/autocomplete-grid-cell.js +5 -7
  27. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +22 -27
  28. package/development/autocomplete-grid/autocomplete-grid-optgroup.js +4 -6
  29. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +109 -2
  30. package/development/autocomplete-grid/autocomplete-grid-option.js +7 -7
  31. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +91 -2
  32. package/development/autocomplete-grid/autocomplete-grid-row.js +5 -7
  33. package/development/autocomplete-grid/autocomplete-grid.js +4 -6
  34. package/development/autocomplete-grid.js +14 -10
  35. package/development/autocomplete-grid.pure.js +13 -4
  36. package/development/core/datetime/date-helper.js +285 -2
  37. package/development/core/datetime.js +6 -2
  38. package/development/core/timetable/access-leg-helper.js +82 -104
  39. package/development/core/timetable/timetable-helper.js +17 -16
  40. package/development/core/timetable/timetable-properties.js +2 -0
  41. package/development/core/timetable.js +8 -3
  42. package/development/differenceInMinutes-B0dawX-5.js +26 -0
  43. package/development/format-BMkeaqaF.js +1433 -0
  44. package/development/isValid-BYRch7pV.js +53 -0
  45. package/development/journey-summary/journey-summary.component.js +288 -2
  46. package/development/journey-summary.js +5 -8
  47. package/development/journey-summary.pure.js +5 -2
  48. package/development/pearl-chain/pearl-chain.component.js +634 -2
  49. package/development/pearl-chain-time/pearl-chain-time.component.js +306 -2
  50. package/development/pearl-chain-time.js +5 -8
  51. package/development/pearl-chain-time.pure.js +5 -2
  52. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +28 -2
  53. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +393 -2
  54. package/development/pearl-chain-vertical-item.js +5 -8
  55. package/development/pearl-chain-vertical-item.pure.js +5 -2
  56. package/development/pearl-chain-vertical.js +5 -8
  57. package/development/pearl-chain-vertical.pure.js +5 -2
  58. package/development/pearl-chain.js +5 -8
  59. package/development/pearl-chain.pure.js +5 -2
  60. package/development/seat-reservation/common/mapper/icon-mapper.js +71 -168
  61. package/development/seat-reservation/common/mapper/mapper.js +122 -153
  62. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +559 -570
  63. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +972 -992
  64. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20367 -20334
  65. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1738 -1731
  66. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9782 -9741
  67. package/development/seat-reservation/common/mapper.js +8 -1
  68. package/development/seat-reservation/common/svgs.js +46 -2
  69. package/development/seat-reservation/common/translations/i18n.js +900 -1118
  70. package/development/seat-reservation/common/translations.js +4 -1
  71. package/development/seat-reservation/common/types.js +2 -0
  72. package/development/seat-reservation/common.js +11 -7
  73. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1230 -1305
  74. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +859 -2
  75. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +106 -2
  76. package/development/seat-reservation/seat-reservation-area.js +5 -7
  77. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +34 -35
  78. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +162 -2
  79. package/development/seat-reservation/seat-reservation-graphic.js +5 -7
  80. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +713 -2
  81. package/development/seat-reservation/seat-reservation-navigation-coach.js +5 -7
  82. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +131 -2
  83. package/development/seat-reservation/seat-reservation-navigation-services.js +5 -7
  84. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +601 -2
  85. package/development/seat-reservation/seat-reservation-place-control.js +5 -7
  86. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +22 -2
  87. package/development/seat-reservation/seat-reservation-scoped.js +5 -7
  88. package/development/seat-reservation/seat-reservation.js +6 -7
  89. package/development/seat-reservation.js +28 -15
  90. package/development/seat-reservation.pure.js +28 -10
  91. package/development/timetable-duration/timetable-duration.component.js +108 -2
  92. package/development/timetable-duration.js +5 -8
  93. package/development/timetable-duration.pure.js +5 -2
  94. package/development/timetable-row/timetable-row.component.js +781 -2
  95. package/development/timetable-row.js +13 -8
  96. package/development/timetable-row.pure.js +12 -2
  97. package/development/toDate-BWb6Z1JD.js +24 -0
  98. package/differenceInMinutes-COvvdYsJ.js +23 -0
  99. package/format-CmKROkbc.js +1186 -0
  100. package/isValid-m3_OsPaB.js +45 -0
  101. package/journey-summary/journey-summary.component.js +194 -2
  102. package/journey-summary.js +4 -5
  103. package/journey-summary.pure.js +4 -2
  104. package/package.json +2 -2
  105. package/pearl-chain/pearl-chain.component.js +165 -2
  106. package/pearl-chain-time/pearl-chain-time.component.js +157 -2
  107. package/pearl-chain-time.js +4 -5
  108. package/pearl-chain-time.pure.js +4 -2
  109. package/pearl-chain-vertical/pearl-chain-vertical.component.js +17 -2
  110. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +77 -2
  111. package/pearl-chain-vertical-item.js +4 -5
  112. package/pearl-chain-vertical-item.pure.js +4 -2
  113. package/pearl-chain-vertical.js +4 -5
  114. package/pearl-chain-vertical.pure.js +4 -2
  115. package/pearl-chain.js +4 -5
  116. package/pearl-chain.pure.js +4 -2
  117. package/seat-reservation/common/mapper/icon-mapper.js +71 -71
  118. package/seat-reservation/common/mapper/mapper.js +89 -95
  119. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +558 -568
  120. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +970 -989
  121. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20366 -20332
  122. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1737 -1729
  123. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9781 -9739
  124. package/seat-reservation/common/mapper.js +9 -3
  125. package/seat-reservation/common/svgs.js +243 -2
  126. package/seat-reservation/common/translations/i18n.js +891 -1084
  127. package/seat-reservation/common/translations.js +4 -2
  128. package/seat-reservation/common/types.js +1 -0
  129. package/seat-reservation/common.js +15 -9
  130. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +810 -832
  131. package/seat-reservation/seat-reservation/seat-reservation.component.js +420 -2
  132. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +51 -2
  133. package/seat-reservation/seat-reservation-area.js +7 -4
  134. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +71 -68
  135. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +75 -2
  136. package/seat-reservation/seat-reservation-graphic.js +7 -4
  137. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +234 -2
  138. package/seat-reservation/seat-reservation-navigation-coach.js +7 -4
  139. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +85 -2
  140. package/seat-reservation/seat-reservation-navigation-services.js +7 -4
  141. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +203 -2
  142. package/seat-reservation/seat-reservation-place-control.js +7 -4
  143. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +13 -2
  144. package/seat-reservation/seat-reservation-scoped.js +7 -4
  145. package/seat-reservation/seat-reservation.js +9 -5
  146. package/seat-reservation.js +39 -17
  147. package/seat-reservation.pure.js +32 -15
  148. package/timetable-duration/timetable-duration.component.js +57 -2
  149. package/timetable-duration.js +4 -5
  150. package/timetable-duration.pure.js +4 -2
  151. package/timetable-row/timetable-row.component.js +427 -2
  152. package/timetable-row.js +13 -6
  153. package/timetable-row.pure.js +11 -2
  154. package/toDate-Bw2KTWeq.js +15 -0
  155. package/autocomplete-grid-cell.component-Dak9wlBr.js +0 -24
  156. package/autocomplete-grid-option.component-DNRFHOwc.js +0 -37
  157. package/autocomplete-grid-row.component-DBHZQ0GQ.js +0 -27
  158. package/date-helper-CGproP5d.js +0 -185
  159. package/development/autocomplete-grid-cell.component-BBvM4o2H.js +0 -42
  160. package/development/autocomplete-grid-option.component-QzfM5eIE.js +0 -123
  161. package/development/autocomplete-grid-row.component-H8sCTCkT.js +0 -104
  162. package/development/date-helper-8_Y-PuHh.js +0 -520
  163. package/development/differenceInMinutes-DN_1Rk3O.js +0 -110
  164. package/development/format-Bbrn2bgo.js +0 -1848
  165. package/development/isValid-C-HzKv4v.js +0 -178
  166. package/development/journey-summary.component-uGhZvA4p.js +0 -385
  167. package/development/pearl-chain-time.component-B8mayTWD.js +0 -415
  168. package/development/pearl-chain-vertical-item.component-BDzbcIaf.js +0 -435
  169. package/development/pearl-chain-vertical.component-CswE7b3M.js +0 -39
  170. package/development/pearl-chain.component-wpsTvoSe.js +0 -704
  171. package/development/seat-reservation-area.component-BK92ZtFo.js +0 -138
  172. package/development/seat-reservation-graphic.component-cUnsHh5x.js +0 -193
  173. package/development/seat-reservation-navigation-coach.component-D6Bglus8.js +0 -828
  174. package/development/seat-reservation-navigation-services.component-DYJ6Ddkg.js +0 -179
  175. package/development/seat-reservation-place-control.component-Bg9evKBW.js +0 -726
  176. package/development/seat-reservation-scoped.component-DRQ_I702.js +0 -31
  177. package/development/seat-reservation.component-Cq_aJKR0.js +0 -818
  178. package/development/svgs-C3JMWR26.js +0 -28
  179. package/development/timetable-duration.component-DI0lET17.js +0 -125
  180. package/development/timetable-row.component-CAED6Zwc.js +0 -932
  181. package/development/toDate-Biiv3kyf.js +0 -150
  182. package/differenceInMinutes-Dr9gRqtu.js +0 -27
  183. package/format-CM5exOsN.js +0 -1103
  184. package/isValid-B9oVW3lA.js +0 -36
  185. package/journey-summary.component-Cq_4kaOp.js +0 -264
  186. package/pearl-chain-time.component-DGDW5S1c.js +0 -239
  187. package/pearl-chain-vertical-item.component-G22bWhLU.js +0 -108
  188. package/pearl-chain-vertical.component-CXIDT5RD.js +0 -21
  189. package/pearl-chain.component-DmjkVIva.js +0 -194
  190. package/seat-reservation-area.component-n-9rGn_y.js +0 -75
  191. package/seat-reservation-graphic.component-YTXRmKt0.js +0 -102
  192. package/seat-reservation-navigation-coach.component-YJ0vaYmO.js +0 -333
  193. package/seat-reservation-navigation-services.component-C3xnLJg2.js +0 -127
  194. package/seat-reservation-place-control.component-DmBAfM6K.js +0 -322
  195. package/seat-reservation-scoped.component-DPkz6u17.js +0 -17
  196. package/seat-reservation.component-C_anMkgw.js +0 -364
  197. package/svgs-D9arBcqr.js +0 -26
  198. package/timetable-duration.component-DCu8Phts.js +0 -65
  199. package/timetable-row.component-BVRCB3xK.js +0 -559
  200. package/toDate-p-Tpkb7t.js +0 -16
@@ -1,2 +1,191 @@
1
- import { n as e, t } from "../../date-helper-CGproP5d.js";
2
- export { t as durationToTime, e as removeTimezoneFromISOTimeString };
1
+ import { i18nDurationDay as N, i18nDurationHour as h, i18nDurationMinute as T } from "@sbb-esta/lyne-elements/core/i18n.js";
2
+ import { n as w, d as y, i as U } from "../../isValid-m3_OsPaB.js";
3
+ import { t as d, c as g, b as m, m as I } from "../../toDate-Bw2KTWeq.js";
4
+ import { g as C, a as Y, d as F } from "../../differenceInMinutes-COvvdYsJ.js";
5
+ function x(e, t, n) {
6
+ const i = d(e, n?.in);
7
+ return isNaN(t) ? g(e, NaN) : (t && i.setDate(i.getDate() + t), i);
8
+ }
9
+ function z(e, t, n) {
10
+ return g(e, +d(e) + t);
11
+ }
12
+ function H(e, t, n) {
13
+ return z(e, t * m);
14
+ }
15
+ function S(e, t, n) {
16
+ const [i, s] = w(
17
+ n?.in,
18
+ e,
19
+ t
20
+ ), r = M(i, s), a = Math.abs(
21
+ y(i, s)
22
+ );
23
+ i.setDate(i.getDate() - r * a);
24
+ const o = +(M(i, s) === -r), u = r * (a - o);
25
+ return u === 0 ? 0 : u;
26
+ }
27
+ function M(e, t) {
28
+ const n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
29
+ return n < 0 ? -1 : n > 0 ? 1 : n;
30
+ }
31
+ function Z(e, t, n) {
32
+ const [i, s] = w(
33
+ n?.in,
34
+ e,
35
+ t
36
+ ), r = (+i - +s) / m;
37
+ return C(n?.roundingMethod)(r);
38
+ }
39
+ function v(e, t, n) {
40
+ return x(e, -t, n);
41
+ }
42
+ function O(e, t) {
43
+ const n = () => g(t?.in, NaN), s = k(e);
44
+ let r;
45
+ if (s.date) {
46
+ const c = W(s.date, 2);
47
+ r = j(c.restDateString, c.year);
48
+ }
49
+ if (!r || isNaN(+r)) return n();
50
+ const a = +r;
51
+ let o = 0, u;
52
+ if (s.time && (o = A(s.time), isNaN(o)))
53
+ return n();
54
+ if (s.timezone) {
55
+ if (u = E(s.timezone), isNaN(u)) return n();
56
+ } else {
57
+ const c = new Date(a + o), p = d(0, t?.in);
58
+ return p.setFullYear(
59
+ c.getUTCFullYear(),
60
+ c.getUTCMonth(),
61
+ c.getUTCDate()
62
+ ), p.setHours(
63
+ c.getUTCHours(),
64
+ c.getUTCMinutes(),
65
+ c.getUTCSeconds(),
66
+ c.getUTCMilliseconds()
67
+ ), p;
68
+ }
69
+ return d(a + o + u, t?.in);
70
+ }
71
+ const l = {
72
+ dateTimeDelimiter: /[T ]/,
73
+ timeZoneDelimiter: /[Z ]/i,
74
+ timezone: /([Z+-].*)$/
75
+ }, _ = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, b = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, R = /^([+-])(\d{2})(?::?(\d{2}))?$/;
76
+ function k(e) {
77
+ const t = {}, n = e.split(l.dateTimeDelimiter);
78
+ let i;
79
+ if (n.length > 2)
80
+ return t;
81
+ if (/:/.test(n[0]) ? i = n[0] : (t.date = n[0], i = n[1], l.timeZoneDelimiter.test(t.date) && (t.date = e.split(l.timeZoneDelimiter)[0], i = e.substr(
82
+ t.date.length,
83
+ e.length
84
+ ))), i) {
85
+ const s = l.timezone.exec(i);
86
+ s ? (t.time = i.replace(s[1], ""), t.timezone = s[1]) : t.time = i;
87
+ }
88
+ return t;
89
+ }
90
+ function W(e, t) {
91
+ const n = new RegExp(
92
+ "^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
93
+ ), i = e.match(n);
94
+ if (!i) return { year: NaN, restDateString: "" };
95
+ const s = i[1] ? parseInt(i[1]) : null, r = i[2] ? parseInt(i[2]) : null;
96
+ return {
97
+ year: r === null ? s : r * 100,
98
+ restDateString: e.slice((i[1] || i[2]).length)
99
+ };
100
+ }
101
+ function j(e, t) {
102
+ if (t === null) return /* @__PURE__ */ new Date(NaN);
103
+ const n = e.match(_);
104
+ if (!n) return /* @__PURE__ */ new Date(NaN);
105
+ const i = !!n[4], s = f(n[1]), r = f(n[2]) - 1, a = f(n[3]), o = f(n[4]), u = f(n[5]) - 1;
106
+ if (i)
107
+ return G(t, o, u) ? J(t, o, u) : /* @__PURE__ */ new Date(NaN);
108
+ {
109
+ const c = /* @__PURE__ */ new Date(0);
110
+ return !q(t, r, a) || !B(t, s) ? /* @__PURE__ */ new Date(NaN) : (c.setUTCFullYear(t, r, Math.max(s, a)), c);
111
+ }
112
+ }
113
+ function f(e) {
114
+ return e ? parseInt(e) : 1;
115
+ }
116
+ function A(e) {
117
+ const t = e.match(b);
118
+ if (!t) return NaN;
119
+ const n = D(t[1]), i = D(t[2]), s = D(t[3]);
120
+ return K(n, i, s) ? n * m + i * I + s * 1e3 : NaN;
121
+ }
122
+ function D(e) {
123
+ return e && parseFloat(e.replace(",", ".")) || 0;
124
+ }
125
+ function E(e) {
126
+ if (e === "Z") return 0;
127
+ const t = e.match(R);
128
+ if (!t) return 0;
129
+ const n = t[1] === "+" ? -1 : 1, i = parseInt(t[2]), s = t[3] && parseInt(t[3]) || 0;
130
+ return P(i, s) ? n * (i * m + s * I) : NaN;
131
+ }
132
+ function J(e, t, n) {
133
+ const i = /* @__PURE__ */ new Date(0);
134
+ i.setUTCFullYear(e, 0, 4);
135
+ const s = i.getUTCDay() || 7, r = (t - 1) * 7 + n + 1 - s;
136
+ return i.setUTCDate(i.getUTCDate() + r), i;
137
+ }
138
+ const V = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
139
+ function $(e) {
140
+ return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
141
+ }
142
+ function q(e, t, n) {
143
+ return t >= 0 && t <= 11 && n >= 1 && n <= (V[t] || ($(e) ? 29 : 28));
144
+ }
145
+ function B(e, t) {
146
+ return t >= 1 && t <= ($(e) ? 366 : 365);
147
+ }
148
+ function G(e, t, n) {
149
+ return t >= 1 && t <= 53 && n >= 0 && n <= 6;
150
+ }
151
+ function K(e, t, n) {
152
+ return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
153
+ }
154
+ function P(e, t) {
155
+ return t >= 0 && t <= 59;
156
+ }
157
+ function Q(e, t, n) {
158
+ return H(e, -t);
159
+ }
160
+ function nt(e) {
161
+ if (!e)
162
+ return;
163
+ const t = O(e);
164
+ if (U(t)) {
165
+ if (e.includes("Z"))
166
+ return new Date(e.replace("Z", ""));
167
+ if (e.includes("T")) {
168
+ const n = e.split("T");
169
+ if (n[1] && (n[1].includes("+") || n[1].includes("-")))
170
+ return /* @__PURE__ */ new Date(`${n[0]}T${n[1].split(/[+-]/)[0]}`);
171
+ }
172
+ return new Date(e);
173
+ }
174
+ }
175
+ const it = (e, t) => {
176
+ const n = [], i = [];
177
+ let r = Y(0, e);
178
+ const a = S(r, 0);
179
+ a > 0 && (n.push(`${a} d`), t && i.push(`${a} ${a > 1 ? N.multiple.long[t] : N.single.long[t]}`), r = v(r, a));
180
+ const o = Z(r, 0);
181
+ o > 0 && (n.push(`${o} h`), t && i.push(`${o} ${o > 1 ? h.multiple.long[t] : h.single.long[t]}`), r = Q(r, o));
182
+ const u = F(r, 0);
183
+ return u > 0 && (n.push(`${u} min`), t && i.push(`${u} ${u > 1 ? T.multiple.long[t] : T.single.long[t]}`)), {
184
+ short: n.join(" "),
185
+ long: i.join(" ")
186
+ };
187
+ };
188
+ export {
189
+ it as durationToTime,
190
+ nt as removeTimezoneFromISOTimeString
191
+ };
package/core/datetime.js CHANGED
@@ -1,2 +1,5 @@
1
- import { n as e, t } from "../date-helper-CGproP5d.js";
2
- export { t as durationToTime, e as removeTimezoneFromISOTimeString };
1
+ import { durationToTime as m, removeTimezoneFromISOTimeString as r } from "./datetime/date-helper.js";
2
+ export {
3
+ m as durationToTime,
4
+ r as removeTimezoneFromISOTimeString
5
+ };
@@ -1,96 +1,91 @@
1
- import { extractTimeAndStringFromNoticeText as e, isConnectionLeg as t, isRideLeg as n } from "./timetable-helper.js";
1
+ import { i18nWalkingDistanceDeparture as T, i18nWalkingDistanceArrival as h } from "@sbb-esta/lyne-elements/core/i18n.js";
2
+ import { nothing as u, html as f } from "lit";
3
+ import { isRideLeg as $, isConnectionLeg as L, extractTimeAndStringFromNoticeText as k } from "./timetable-helper.js";
2
4
  import "@sbb-esta/lyne-elements/icon.js";
3
- import { html as r, nothing as i } from "lit";
4
- import { i18nWalkingDistanceArrival as a, i18nWalkingDistanceDeparture as o } from "@sbb-esta/lyne-elements/core/i18n.js";
5
- //#region src/elements-experimental/core/timetable/access-leg-helper.ts
6
- function s(e, n) {
7
- let r = t(e) ? e : null, i = r ? r?.notices?.filter((e) => n.includes(e.name))[0] : null;
8
- return i ? {
9
- duration: r?.duration || 0,
10
- text: i?.text?.template || "",
11
- icon: "walk-small"
12
- } : null;
5
+ function g(t, r) {
6
+ const i = L(t) ? t : null, n = i ? i?.notices?.filter((e) => r.includes(e.name))[0] : null;
7
+ return n ? {
8
+ duration: i?.duration || 0,
9
+ text: n?.text?.template || "",
10
+ icon: "walk-small"
11
+ } : null;
13
12
  }
14
- function c(t, r, i, a) {
15
- let s = n(t) ? t?.serviceJourney?.notices?.filter((e) => ["CI"].includes(e.name))[0] : null, c = s && e(s);
16
- return s ? {
17
- duration: (c?.duration || 0) + (r || 0),
18
- text: i ? o[a] : c?.text || "",
19
- icon: i ? "wheelchair-small" : `sa-${s?.name?.toLowerCase()}`
20
- } : null;
13
+ function M(t, r, i, n) {
14
+ const e = $(t) ? t?.serviceJourney?.notices?.filter((m) => ["CI"].includes(m.name))[0] : null, c = e && k(e);
15
+ return e ? {
16
+ duration: (c?.duration || 0) + (r || 0),
17
+ text: i ? T[n] : c?.text || "",
18
+ icon: i ? "wheelchair-small" : `sa-${e?.name?.toLowerCase()}`
19
+ } : null;
21
20
  }
22
- function l(t, r, i, o) {
23
- let s = n(t) ? t?.serviceJourney?.notices?.filter((e) => ["CO"].includes(e.name))[0] : null, c = s && e(s);
24
- return s ? {
25
- duration: (c?.duration || 0) + (r || 0),
26
- text: i ? a[o] : c?.text || "",
27
- icon: i ? "wheelchair-small" : `sa-${s?.name?.toLowerCase()}`
28
- } : null;
21
+ function N(t, r, i, n) {
22
+ const e = $(t) ? t?.serviceJourney?.notices?.filter((m) => ["CO"].includes(m.name))[0] : null, c = e && k(e);
23
+ return e ? {
24
+ duration: (c?.duration || 0) + (r || 0),
25
+ text: i ? h[n] : c?.text || "",
26
+ icon: i ? "wheelchair-small" : `sa-${e?.name?.toLowerCase()}`
27
+ } : null;
29
28
  }
30
- function u(e, t, n, s, c) {
31
- return r`
32
- <span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${t}-${c}">
33
- <sbb-icon name=${t}></sbb-icon>
34
- <time datetime=${e + "M"}>
29
+ function _(t, r, i, n, e) {
30
+ return f`
31
+ <span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${r}-${e}">
32
+ <sbb-icon name=${r}></sbb-icon>
33
+ <time datetime=${t + "M"}>
35
34
  <span class="sbb-screen-reader-only">
36
- ${!s && c ? c === "departure" ? o[n] : a[n] : i}
37
- ${s ? r`<span>${s}</span>` : i}&nbsp;
35
+ ${!n && e ? e === "departure" ? T[i] : h[i] : u}
36
+ ${n ? f`<span>${n}</span>` : u}&nbsp;
38
37
  </span>
39
- ${e}
38
+ ${t}
40
39
  <span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
41
40
  <span class="sbb-screen-reader-only">min</span>
42
41
  </time>
43
42
  </span>
44
43
  `;
45
44
  }
46
- function d(e, t, n, i) {
47
- return r`
48
- <span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${i}-${n}">
49
- <sbb-icon name=${i}></sbb-icon>
50
- <time datetime=${e + "M"}>
51
- <span class="sbb-screen-reader-only">${t}</span>
52
- ${e}
45
+ function p(t, r, i, n) {
46
+ return f`
47
+ <span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${n}-${i}">
48
+ <sbb-icon name=${n}></sbb-icon>
49
+ <time datetime=${t + "M"}>
50
+ <span class="sbb-screen-reader-only">${r}</span>
51
+ ${t}
53
52
  <span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
54
53
  </time>
55
54
  </span>
56
55
  `;
57
56
  }
58
- function f(e, f, p, m, h) {
59
- let g = e && e.filter((e) => n(e) || t(e))[0], _ = [
60
- "YM",
61
- "YB",
62
- "Y",
63
- "YT"
64
- ], v = s(g, _), y = c(g, f, h, m), b = f ? {
65
- text: o[m],
66
- duration: f,
67
- icon: h ? "wheelchair-small" : "walk-small"
68
- } : null, x = () => v || (b && !y && !v ? b : y || null);
69
- function S() {
70
- return r`
71
- ${v ? d(v.duration, v.text, "left", v.icon) : i}
72
- ${b && !y && !v ? d(b.duration, b.text, "left", b.icon) : i}
73
- ${y ? h ? d(y.duration, y.text, "left", y.icon) : u(y.duration, y.icon, m, y.text, "departure") : i}
57
+ function B(t, r, i, n, e) {
58
+ const c = t && t.filter((w) => $(w) || L(w))[0], m = ["YM", "YB", "Y", "YT"], o = g(c, m), s = M(c, r, e, n), d = r ? {
59
+ text: T[n],
60
+ duration: r,
61
+ icon: e ? "wheelchair-small" : "walk-small"
62
+ } : null, v = () => o || (d && !s && !o ? d : s || null);
63
+ function C() {
64
+ return f`
65
+ ${o ? p(o.duration, o.text, "left", o.icon) : u}
66
+ ${d && !s && !o ? p(d.duration, d.text, "left", d.icon) : u}
67
+ ${s ? e ? p(s.duration, s.text, "left", s.icon) : _(s.duration, s.icon, n, s.text, "departure") : u}
74
68
  `;
75
- }
76
- let C = e && e[e.length - 1], w = (t(C) || n(C)) && C, T = w && s(w, _), E = w && l(w, p, h, m), D = p ? {
77
- text: a[m],
78
- duration: p,
79
- icon: h ? "wheelchair-small" : "walk-small"
80
- } : null, O = () => T || (D && !E && !T ? D : E || null);
81
- function k() {
82
- return r`
83
- ${T ? d(T.duration, T.text, "right", T.icon) : i}
84
- ${D && !E && !T ? d(D.duration, D.text, "right", D.icon) : i}
85
- ${E ? h ? d(E.duration, E.text, "right", E.icon) : u(E.duration, E.icon, m, E.text, "arrival") : i}
69
+ }
70
+ const A = t && t[t.length - 1], x = (L(A) || $(A)) && A, l = x && g(x, m), a = x && N(x, i, e, n), b = i ? {
71
+ text: h[n],
72
+ duration: i,
73
+ icon: e ? "wheelchair-small" : "walk-small"
74
+ } : null, D = () => l || (b && !a && !l ? b : a || null);
75
+ function Y() {
76
+ return f`
77
+ ${l ? p(l.duration, l.text, "right", l.icon) : u}
78
+ ${b && !a && !l ? p(b.duration, b.text, "right", b.icon) : u}
79
+ ${a ? e ? p(a.duration, a.text, "right", a.icon) : _(a.duration, a.icon, n, a.text, "arrival") : u}
86
80
  `;
87
- }
88
- return {
89
- renderDepartureTimeAttribute: S,
90
- renderArrivalTimeAttribute: k,
91
- departureTimeAttribute: x(),
92
- arrivalTimeAttribute: O()
93
- };
81
+ }
82
+ return {
83
+ renderDepartureTimeAttribute: C,
84
+ renderArrivalTimeAttribute: Y,
85
+ departureTimeAttribute: v(),
86
+ arrivalTimeAttribute: D()
87
+ };
94
88
  }
95
- //#endregion
96
- export { f as getDepartureArrivalTimeAttribute };
89
+ export {
90
+ B as getDepartureArrivalTimeAttribute
91
+ };
@@ -1,10 +1,12 @@
1
- //#region src/elements-experimental/core/timetable/timetable-helper.ts
2
- var e = (e) => e?.__typename === "PTRideLeg", t = (e) => e?.__typename === "PTConnectionLeg", n = (e) => {
3
- let t = e?.text?.template && e.text.template.indexOf("(") + 1, n = e?.text?.template?.substring(t || 0, e?.text?.template.indexOf(")"));
4
- return {
5
- duration: n && +n.substring(0, n.length - 1) || 0,
6
- text: e?.text?.template?.split("(")[0] || ""
7
- };
1
+ const r = (t) => t?.__typename === "PTRideLeg", i = (t) => t?.__typename === "PTConnectionLeg", s = (t) => {
2
+ const n = t?.text?.template && t.text.template.indexOf("(") + 1, e = t?.text?.template?.substring(n || 0, t?.text?.template.indexOf(")"));
3
+ return {
4
+ duration: e && +e.substring(0, e.length - 1) || 0,
5
+ text: t?.text?.template?.split("(")[0] || ""
6
+ };
7
+ };
8
+ export {
9
+ s as extractTimeAndStringFromNoticeText,
10
+ i as isConnectionLeg,
11
+ r as isRideLeg
8
12
  };
9
- //#endregion
10
- export { n as extractTimeAndStringFromNoticeText, t as isConnectionLeg, e as isRideLeg };
package/core/timetable.js CHANGED
@@ -1,4 +1,8 @@
1
- import { extractTimeAndStringFromNoticeText as e, isConnectionLeg as t, isRideLeg as n } from "./timetable/timetable-helper.js";
2
1
  import { getDepartureArrivalTimeAttribute as r } from "./timetable/access-leg-helper.js";
3
- import "./timetable/timetable-properties.js";
4
- export { e as extractTimeAndStringFromNoticeText, r as getDepartureArrivalTimeAttribute, t as isConnectionLeg, n as isRideLeg };
2
+ import { extractTimeAndStringFromNoticeText as o, isConnectionLeg as m, isRideLeg as n } from "./timetable/timetable-helper.js";
3
+ export {
4
+ o as extractTimeAndStringFromNoticeText,
5
+ r as getDepartureArrivalTimeAttribute,
6
+ m as isConnectionLeg,
7
+ n as isRideLeg
8
+ };
@@ -3124,6 +3124,90 @@
3124
3124
  "declarations": [],
3125
3125
  "exports": []
3126
3126
  },
3127
+ {
3128
+ "kind": "javascript-module",
3129
+ "path": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js",
3130
+ "declarations": [
3131
+ {
3132
+ "kind": "class",
3133
+ "description": "Visualize an area with a special meaning within a wagon.",
3134
+ "name": "SbbSeatReservationAreaElement",
3135
+ "members": [
3136
+ {
3137
+ "kind": "field",
3138
+ "name": "elementName",
3139
+ "type": {
3140
+ "text": "string"
3141
+ },
3142
+ "privacy": "public",
3143
+ "static": true,
3144
+ "readonly": true,
3145
+ "default": "'sbb-seat-reservation-area'"
3146
+ },
3147
+ {
3148
+ "kind": "field",
3149
+ "name": "mounting",
3150
+ "type": {
3151
+ "text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
3152
+ },
3153
+ "privacy": "public",
3154
+ "default": "'free'",
3155
+ "description": "Mounting Prop",
3156
+ "attribute": "mounting",
3157
+ "reflects": true
3158
+ },
3159
+ {
3160
+ "kind": "field",
3161
+ "name": "background",
3162
+ "type": {
3163
+ "text": "'light' | 'dark'"
3164
+ },
3165
+ "privacy": "public",
3166
+ "default": "'light'",
3167
+ "description": "the background of the area",
3168
+ "attribute": "background",
3169
+ "reflects": true
3170
+ }
3171
+ ],
3172
+ "attributes": [
3173
+ {
3174
+ "name": "mounting",
3175
+ "type": {
3176
+ "text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
3177
+ },
3178
+ "default": "'free'",
3179
+ "description": "Mounting Prop",
3180
+ "fieldName": "mounting"
3181
+ },
3182
+ {
3183
+ "name": "background",
3184
+ "type": {
3185
+ "text": "'light' | 'dark'"
3186
+ },
3187
+ "default": "'light'",
3188
+ "description": "the background of the area",
3189
+ "fieldName": "background"
3190
+ }
3191
+ ],
3192
+ "superclass": {
3193
+ "name": "SbbElement",
3194
+ "package": "@sbb-esta/lyne-elements/core/base-elements.js"
3195
+ },
3196
+ "tagName": "sbb-seat-reservation-area",
3197
+ "customElement": true
3198
+ }
3199
+ ],
3200
+ "exports": [
3201
+ {
3202
+ "kind": "js",
3203
+ "name": "SbbSeatReservationAreaElement",
3204
+ "declaration": {
3205
+ "name": "SbbSeatReservationAreaElement",
3206
+ "module": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js"
3207
+ }
3208
+ }
3209
+ ]
3210
+ },
3127
3211
  {
3128
3212
  "kind": "javascript-module",
3129
3213
  "path": "seat-reservation/seat-reservation/seat-reservation-base-element.js",
@@ -7225,90 +7309,6 @@
7225
7309
  }
7226
7310
  ]
7227
7311
  },
7228
- {
7229
- "kind": "javascript-module",
7230
- "path": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js",
7231
- "declarations": [
7232
- {
7233
- "kind": "class",
7234
- "description": "Visualize an area with a special meaning within a wagon.",
7235
- "name": "SbbSeatReservationAreaElement",
7236
- "members": [
7237
- {
7238
- "kind": "field",
7239
- "name": "elementName",
7240
- "type": {
7241
- "text": "string"
7242
- },
7243
- "privacy": "public",
7244
- "static": true,
7245
- "readonly": true,
7246
- "default": "'sbb-seat-reservation-area'"
7247
- },
7248
- {
7249
- "kind": "field",
7250
- "name": "mounting",
7251
- "type": {
7252
- "text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
7253
- },
7254
- "privacy": "public",
7255
- "default": "'free'",
7256
- "description": "Mounting Prop",
7257
- "attribute": "mounting",
7258
- "reflects": true
7259
- },
7260
- {
7261
- "kind": "field",
7262
- "name": "background",
7263
- "type": {
7264
- "text": "'light' | 'dark'"
7265
- },
7266
- "privacy": "public",
7267
- "default": "'light'",
7268
- "description": "the background of the area",
7269
- "attribute": "background",
7270
- "reflects": true
7271
- }
7272
- ],
7273
- "attributes": [
7274
- {
7275
- "name": "mounting",
7276
- "type": {
7277
- "text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
7278
- },
7279
- "default": "'free'",
7280
- "description": "Mounting Prop",
7281
- "fieldName": "mounting"
7282
- },
7283
- {
7284
- "name": "background",
7285
- "type": {
7286
- "text": "'light' | 'dark'"
7287
- },
7288
- "default": "'light'",
7289
- "description": "the background of the area",
7290
- "fieldName": "background"
7291
- }
7292
- ],
7293
- "superclass": {
7294
- "name": "SbbElement",
7295
- "package": "@sbb-esta/lyne-elements/core/base-elements.js"
7296
- },
7297
- "tagName": "sbb-seat-reservation-area",
7298
- "customElement": true
7299
- }
7300
- ],
7301
- "exports": [
7302
- {
7303
- "kind": "js",
7304
- "name": "SbbSeatReservationAreaElement",
7305
- "declaration": {
7306
- "name": "SbbSeatReservationAreaElement",
7307
- "module": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js"
7308
- }
7309
- }
7310
- ]
7311
- },
7312
7312
  {
7313
7313
  "kind": "javascript-module",
7314
7314
  "path": "seat-reservation/seat-reservation-graphic/seat-reservation-assets.js",