@sbb-esta/lyne-elements-experimental 2.11.2 → 3.0.0-next.1

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 (67) hide show
  1. package/core/datetime/date-helper.js +142 -142
  2. package/core/timetable/access-leg-helper.js +52 -49
  3. package/core/timetable/timetable-helper.js +8 -7
  4. package/custom-elements.json +8 -8
  5. package/development/core/datetime/date-helper.js +10 -10
  6. package/development/core/timetable/access-leg-helper.js +15 -12
  7. package/development/core/timetable/timetable-helper.js +7 -6
  8. package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-CHSyWiQs.js} +3 -3
  9. package/development/{format-BQfaa1ZT.js → format-D0-yhzi4.js} +26 -22
  10. package/development/{isValid-DvieCZVi.js → isValid-Bo4R7iA7.js} +3 -3
  11. package/development/journey-summary/journey-summary.component.d.ts +5 -3
  12. package/development/journey-summary/journey-summary.component.d.ts.map +1 -1
  13. package/development/journey-summary/journey-summary.component.js +9 -5
  14. package/development/pearl-chain/pearl-chain.component.d.ts +5 -3
  15. package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
  16. package/development/pearl-chain/pearl-chain.component.js +43 -29
  17. package/development/pearl-chain-time/pearl-chain-time.component.d.ts +5 -3
  18. package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -1
  19. package/development/pearl-chain-time/pearl-chain-time.component.js +10 -6
  20. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
  21. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
  22. package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
  23. package/development/seat-reservation/common/mapper/mapper.js +16 -14
  24. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
  25. package/development/seat-reservation/common/svgs.js +1 -1
  26. package/development/seat-reservation/common/translations/i18n.js +3 -2
  27. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +33 -22
  28. package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +7 -6
  29. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +23 -16
  30. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
  31. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +3 -2
  32. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +8 -7
  33. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +11 -7
  34. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +3 -2
  35. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +5 -4
  36. package/development/timetable-duration/timetable-duration.component.js +1 -1
  37. package/development/timetable-row/timetable-row.component.d.ts +5 -3
  38. package/development/timetable-row/timetable-row.component.d.ts.map +1 -1
  39. package/development/timetable-row/timetable-row.component.js +93 -59
  40. package/differenceInMinutes-BMqUZdhj.js +23 -0
  41. package/{format-lqeCzmzS.js → format-Dg8rkk7h.js} +442 -438
  42. package/isValid-DJ69OMZJ.js +45 -0
  43. package/journey-summary/journey-summary.component.d.ts +5 -3
  44. package/journey-summary/journey-summary.component.d.ts.map +1 -1
  45. package/journey-summary/journey-summary.component.js +8 -4
  46. package/package.json +2 -2
  47. package/pearl-chain/pearl-chain.component.d.ts +5 -3
  48. package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
  49. package/pearl-chain/pearl-chain.component.js +99 -79
  50. package/pearl-chain-time/pearl-chain-time.component.d.ts +5 -3
  51. package/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -1
  52. package/pearl-chain-time/pearl-chain-time.component.js +49 -45
  53. package/seat-reservation/common/mapper/mapper.js +54 -50
  54. package/seat-reservation/common/translations/i18n.js +6 -5
  55. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +115 -104
  56. package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +41 -40
  57. package/seat-reservation/seat-reservation/seat-reservation.component.js +87 -78
  58. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +18 -15
  59. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +59 -58
  60. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +75 -71
  61. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +13 -12
  62. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +24 -23
  63. package/timetable-row/timetable-row.component.d.ts +5 -3
  64. package/timetable-row/timetable-row.component.d.ts.map +1 -1
  65. package/timetable-row/timetable-row.component.js +251 -208
  66. package/differenceInMinutes-CP_C5onR.js +0 -23
  67. package/isValid-Ceq2O0NQ.js +0 -45
@@ -1,191 +1,191 @@
1
- import { i18nDurationDay as N, i18nDurationHour as h, i18nDurationMinute as T } from "@sbb-esta/lyne-elements/core/i18n.js";
2
- import { t as d, c as g, b as m, m as w } from "../../toDate-BCXKL_wM.js";
3
- import { n as I, d as y, i as U } from "../../isValid-Ceq2O0NQ.js";
4
- import { g as C, a as Y, d as F } from "../../differenceInMinutes-CP_C5onR.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] = I(
17
- n?.in,
18
- e,
19
- t
20
- ), r = M(i, s), a = Math.abs(
21
- y(i, s)
1
+ import { i18nDurationDay as h, i18nDurationHour as T, i18nDurationMinute as p } from "@sbb-esta/lyne-elements/core/i18n.js";
2
+ import { t as d, c as N, b as m, m as w } from "../../toDate-BCXKL_wM.js";
3
+ import { n as I, d as y, i as U } from "../../isValid-DJ69OMZJ.js";
4
+ import { g as C, a as Y, d as F } from "../../differenceInMinutes-BMqUZdhj.js";
5
+ function x(t, e, n) {
6
+ const r = d(t, n == null ? void 0 : n.in);
7
+ return isNaN(e) ? N(t, NaN) : (e && r.setDate(r.getDate() + e), r);
8
+ }
9
+ function z(t, e, n) {
10
+ return N(t, +d(t) + e);
11
+ }
12
+ function H(t, e, n) {
13
+ return z(t, e * m);
14
+ }
15
+ function S(t, e, n) {
16
+ const [r, i] = I(
17
+ n == null ? void 0 : n.in,
18
+ t,
19
+ e
20
+ ), s = M(r, i), u = Math.abs(
21
+ y(r, i)
22
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;
23
+ r.setDate(r.getDate() - s * u);
24
+ const a = +(M(r, i) === -s), c = s * (u - a);
25
+ return c === 0 ? 0 : c;
26
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();
27
+ function M(t, e) {
28
+ const n = t.getFullYear() - e.getFullYear() || t.getMonth() - e.getMonth() || t.getDate() - e.getDate() || t.getHours() - e.getHours() || t.getMinutes() - e.getMinutes() || t.getSeconds() - e.getSeconds() || t.getMilliseconds() - e.getMilliseconds();
29
29
  return n < 0 ? -1 : n > 0 ? 1 : n;
30
30
  }
31
- function Z(e, t, n) {
32
- const [i, s] = I(
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);
31
+ function Z(t, e, n) {
32
+ const [r, i] = I(
33
+ n == null ? void 0 : n.in,
34
+ t,
35
+ e
36
+ ), s = (+r - +i) / m;
37
+ return C(n == null ? void 0 : n.roundingMethod)(s);
38
+ }
39
+ function v(t, e, n) {
40
+ return x(t, -e, n);
41
+ }
42
+ function O(t, e) {
43
+ const n = () => N(e == null ? void 0 : e.in, NaN), i = k(t);
44
+ let s;
45
+ if (i.date) {
46
+ const o = W(i.date, 2);
47
+ s = j(o.restDateString, o.year);
48
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)))
49
+ if (!s || isNaN(+s)) return n();
50
+ const u = +s;
51
+ let a = 0, c;
52
+ if (i.time && (a = A(i.time), isNaN(a)))
53
53
  return n();
54
- if (s.timezone) {
55
- if (u = E(s.timezone), isNaN(u)) return n();
54
+ if (i.timezone) {
55
+ if (c = E(i.timezone), isNaN(c)) return n();
56
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;
57
+ const o = new Date(u + a), D = d(0, e == null ? void 0 : e.in);
58
+ return D.setFullYear(
59
+ o.getUTCFullYear(),
60
+ o.getUTCMonth(),
61
+ o.getUTCDate()
62
+ ), D.setHours(
63
+ o.getUTCHours(),
64
+ o.getUTCMinutes(),
65
+ o.getUTCSeconds(),
66
+ o.getUTCMilliseconds()
67
+ ), D;
68
68
  }
69
- return d(a + o + u, t?.in);
69
+ return d(u + a + c, e == null ? void 0 : e.in);
70
70
  }
71
71
  const l = {
72
72
  dateTimeDelimiter: /[T ]/,
73
73
  timeZoneDelimiter: /[Z ]/i,
74
74
  timezone: /([Z+-].*)$/
75
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;
76
+ function k(t) {
77
+ const e = {}, n = t.split(l.dateTimeDelimiter);
78
+ let r;
79
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;
80
+ return e;
81
+ if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], l.timeZoneDelimiter.test(e.date) && (e.date = t.split(l.timeZoneDelimiter)[0], r = t.substr(
82
+ e.date.length,
83
+ t.length
84
+ ))), r) {
85
+ const i = l.timezone.exec(r);
86
+ i ? (e.time = r.replace(i[1], ""), e.timezone = i[1]) : e.time = r;
87
87
  }
88
- return t;
88
+ return e;
89
89
  }
90
- function W(e, t) {
90
+ function W(t, e) {
91
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;
92
+ "^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
93
+ ), r = t.match(n);
94
+ if (!r) return { year: NaN, restDateString: "" };
95
+ const i = r[1] ? parseInt(r[1]) : null, s = r[2] ? parseInt(r[2]) : null;
96
96
  return {
97
- year: r === null ? s : r * 100,
98
- restDateString: e.slice((i[1] || i[2]).length)
97
+ year: s === null ? i : s * 100,
98
+ restDateString: t.slice((r[1] || r[2]).length)
99
99
  };
100
100
  }
101
- function j(e, t) {
102
- if (t === null) return /* @__PURE__ */ new Date(NaN);
103
- const n = e.match(_);
101
+ function j(t, e) {
102
+ if (e === null) return /* @__PURE__ */ new Date(NaN);
103
+ const n = t.match(_);
104
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);
105
+ const r = !!n[4], i = f(n[1]), s = f(n[2]) - 1, u = f(n[3]), a = f(n[4]), c = f(n[5]) - 1;
106
+ if (r)
107
+ return G(e, a, c) ? J(e, a, c) : /* @__PURE__ */ new Date(NaN);
108
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);
109
+ const o = /* @__PURE__ */ new Date(0);
110
+ return !q(e, s, u) || !B(e, i) ? /* @__PURE__ */ new Date(NaN) : (o.setUTCFullYear(e, s, Math.max(i, u)), o);
111
111
  }
112
112
  }
113
- function f(e) {
114
- return e ? parseInt(e) : 1;
113
+ function f(t) {
114
+ return t ? parseInt(t) : 1;
115
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 * w + s * 1e3 : NaN;
116
+ function A(t) {
117
+ const e = t.match(b);
118
+ if (!e) return NaN;
119
+ const n = g(e[1]), r = g(e[2]), i = g(e[3]);
120
+ return K(n, r, i) ? n * m + r * w + i * 1e3 : NaN;
121
121
  }
122
- function D(e) {
123
- return e && parseFloat(e.replace(",", ".")) || 0;
122
+ function g(t) {
123
+ return t && parseFloat(t.replace(",", ".")) || 0;
124
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 * w) : NaN;
125
+ function E(t) {
126
+ if (t === "Z") return 0;
127
+ const e = t.match(R);
128
+ if (!e) return 0;
129
+ const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), i = e[3] && parseInt(e[3]) || 0;
130
+ return P(r, i) ? n * (r * m + i * w) : NaN;
131
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;
132
+ function J(t, e, n) {
133
+ const r = /* @__PURE__ */ new Date(0);
134
+ r.setUTCFullYear(t, 0, 4);
135
+ const i = r.getUTCDay() || 7, s = (e - 1) * 7 + n + 1 - i;
136
+ return r.setUTCDate(r.getUTCDate() + s), r;
137
137
  }
138
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;
139
+ function $(t) {
140
+ return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
141
141
  }
142
- function q(e, t, n) {
143
- return t >= 0 && t <= 11 && n >= 1 && n <= (V[t] || ($(e) ? 29 : 28));
142
+ function q(t, e, n) {
143
+ return e >= 0 && e <= 11 && n >= 1 && n <= (V[e] || ($(t) ? 29 : 28));
144
144
  }
145
- function B(e, t) {
146
- return t >= 1 && t <= ($(e) ? 366 : 365);
145
+ function B(t, e) {
146
+ return e >= 1 && e <= ($(t) ? 366 : 365);
147
147
  }
148
- function G(e, t, n) {
149
- return t >= 1 && t <= 53 && n >= 0 && n <= 6;
148
+ function G(t, e, n) {
149
+ return e >= 1 && e <= 53 && n >= 0 && n <= 6;
150
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;
151
+ function K(t, e, n) {
152
+ return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
153
153
  }
154
- function P(e, t) {
155
- return t >= 0 && t <= 59;
154
+ function P(t, e) {
155
+ return e >= 0 && e <= 59;
156
156
  }
157
- function Q(e, t, n) {
158
- return H(e, -t);
157
+ function Q(t, e, n) {
158
+ return H(t, -e);
159
159
  }
160
- function nt(e) {
161
- if (!e)
160
+ function ne(t) {
161
+ if (!t)
162
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");
163
+ const e = O(t);
164
+ if (U(e)) {
165
+ if (t.includes("Z"))
166
+ return new Date(t.replace("Z", ""));
167
+ if (t.includes("T")) {
168
+ const n = t.split("T");
169
169
  if (n[1] && (n[1].includes("+") || n[1].includes("-")))
170
170
  return /* @__PURE__ */ new Date(`${n[0]}T${n[1].split(/[+-]/)[0]}`);
171
171
  }
172
- return new Date(e);
172
+ return new Date(t);
173
173
  }
174
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]}`)), {
175
+ const re = (t, e) => {
176
+ const n = [], r = [];
177
+ let s = Y(0, t);
178
+ const u = S(s, 0);
179
+ u > 0 && (n.push(`${u} d`), e && r.push(`${u} ${u > 1 ? h.multiple.long[e] : h.single.long[e]}`), s = v(s, u));
180
+ const a = Z(s, 0);
181
+ a > 0 && (n.push(`${a} h`), e && r.push(`${a} ${a > 1 ? T.multiple.long[e] : T.single.long[e]}`), s = Q(s, a));
182
+ const c = F(s, 0);
183
+ return c > 0 && (n.push(`${c} min`), e && r.push(`${c} ${c > 1 ? p.multiple.long[e] : p.single.long[e]}`)), {
184
184
  short: n.join(" "),
185
- long: i.join(" ")
185
+ long: r.join(" ")
186
186
  };
187
187
  };
188
188
  export {
189
- it as durationToTime,
190
- nt as removeTimezoneFromISOTimeString
189
+ re as durationToTime,
190
+ ne as removeTimezoneFromISOTimeString
191
191
  };
@@ -1,39 +1,42 @@
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";
1
+ import { i18nWalkingDistanceDeparture as _, i18nWalkingDistanceArrival as A } from "@sbb-esta/lyne-elements/core/i18n.js";
2
+ import { nothing as b, html as f } from "lit";
3
+ import { isRideLeg as h, isConnectionLeg as w, extractTimeAndStringFromNoticeText as C } from "./timetable-helper.js";
4
4
  import "@sbb-esta/lyne-elements/icon.js";
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 || "",
5
+ function T(t, a) {
6
+ var e, r;
7
+ const n = w(t) ? t : null, i = n ? (e = n == null ? void 0 : n.notices) == null ? void 0 : e.filter((c) => a.includes(c.name))[0] : null;
8
+ return i ? {
9
+ duration: (n == null ? void 0 : n.duration) || 0,
10
+ text: ((r = i == null ? void 0 : i.text) == null ? void 0 : r.template) || "",
10
11
  icon: "walk-small"
11
12
  } : null;
12
13
  }
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);
14
+ function R(t, a, n, i) {
15
+ var c, l, s;
16
+ const e = h(t) ? (l = (c = t == null ? void 0 : t.serviceJourney) == null ? void 0 : c.notices) == null ? void 0 : l.filter((u) => ["CI"].includes(u.name))[0] : null, r = e && C(e);
15
17
  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()}`
18
+ duration: ((r == null ? void 0 : r.duration) || 0) + (a || 0),
19
+ text: n ? _[i] : (r == null ? void 0 : r.text) || "",
20
+ icon: n ? "wheelchair-small" : `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
19
21
  } : null;
20
22
  }
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
+ function E(t, a, n, i) {
24
+ var c, l, s;
25
+ const e = h(t) ? (l = (c = t == null ? void 0 : t.serviceJourney) == null ? void 0 : c.notices) == null ? void 0 : l.filter((u) => ["CO"].includes(u.name))[0] : null, r = e && C(e);
23
26
  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
+ duration: ((r == null ? void 0 : r.duration) || 0) + (a || 0),
28
+ text: n ? A[i] : (r == null ? void 0 : r.text) || "",
29
+ icon: n ? "wheelchair-small" : `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
27
30
  } : null;
28
31
  }
29
- function _(t, r, i, n, e) {
32
+ function v(t, a, n, i, e) {
30
33
  return f`
31
- <span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${r}-${e}">
32
- <sbb-icon name=${r}></sbb-icon>
34
+ <span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${a}-${e}">
35
+ <sbb-icon name=${a}></sbb-icon>
33
36
  <time datetime=${t + "M"}>
34
37
  <span class="sbb-screen-reader-only">
35
- ${!n && e ? e === "departure" ? T[i] : h[i] : u}
36
- ${n ? f`<span>${n}</span>` : u}&nbsp;
38
+ ${!i && e ? e === "departure" ? _[n] : A[n] : b}
39
+ ${i ? f`<span>${i}</span>` : b}&nbsp;
37
40
  </span>
38
41
  ${t}
39
42
  <span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
@@ -42,50 +45,50 @@ function _(t, r, i, n, e) {
42
45
  </span>
43
46
  `;
44
47
  }
45
- function p(t, r, i, n) {
48
+ function p(t, a, n, i) {
46
49
  return f`
47
- <span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${n}-${i}">
48
- <sbb-icon name=${n}></sbb-icon>
50
+ <span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${i}-${n}">
51
+ <sbb-icon name=${i}></sbb-icon>
49
52
  <time datetime=${t + "M"}>
50
- <span class="sbb-screen-reader-only">${r}</span>
53
+ <span class="sbb-screen-reader-only">${a}</span>
51
54
  ${t}
52
55
  <span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
53
56
  </time>
54
57
  </span>
55
58
  `;
56
59
  }
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,
60
+ function O(t, a, n, i, e) {
61
+ const r = t && t.filter((k) => h(k) || w(k))[0], c = ["YM", "YB", "Y", "YT"], l = T(r, c), s = R(r, a, e, i), u = a ? {
62
+ text: _[i],
63
+ duration: a,
61
64
  icon: e ? "wheelchair-small" : "walk-small"
62
- } : null, v = () => o || (d && !s && !o ? d : s || null);
63
- function C() {
65
+ } : null, D = () => l || (u && !s && !l ? u : s || null);
66
+ function L() {
64
67
  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}
68
+ ${l ? p(l.duration, l.text, "left", l.icon) : b}
69
+ ${u && !s && !l ? p(u.duration, u.text, "left", u.icon) : b}
70
+ ${s ? e ? p(s.duration, s.text, "left", s.icon) : v(s.duration, s.icon, i, s.text, "departure") : b}
68
71
  `;
69
72
  }
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
+ const x = t && t[t.length - 1], $ = (w(x) || h(x)) && x, m = $ && T($, c), o = $ && E($, n, e, i), d = n ? {
74
+ text: A[i],
75
+ duration: n,
73
76
  icon: e ? "wheelchair-small" : "walk-small"
74
- } : null, D = () => l || (b && !a && !l ? b : a || null);
75
- function Y() {
77
+ } : null, Y = () => m || (d && !o && !m ? d : o || null);
78
+ function M() {
76
79
  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}
80
+ ${m ? p(m.duration, m.text, "right", m.icon) : b}
81
+ ${d && !o && !m ? p(d.duration, d.text, "right", d.icon) : b}
82
+ ${o ? e ? p(o.duration, o.text, "right", o.icon) : v(o.duration, o.icon, i, o.text, "arrival") : b}
80
83
  `;
81
84
  }
82
85
  return {
83
- renderDepartureTimeAttribute: C,
84
- renderArrivalTimeAttribute: Y,
85
- departureTimeAttribute: v(),
86
- arrivalTimeAttribute: D()
86
+ renderDepartureTimeAttribute: L,
87
+ renderArrivalTimeAttribute: M,
88
+ departureTimeAttribute: D(),
89
+ arrivalTimeAttribute: Y()
87
90
  };
88
91
  }
89
92
  export {
90
- B as getDepartureArrivalTimeAttribute
93
+ O as getDepartureArrivalTimeAttribute
91
94
  };
@@ -1,12 +1,13 @@
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(")"));
1
+ const n = (t) => (t == null ? void 0 : t.__typename) === "PTRideLeg", u = (t) => (t == null ? void 0 : t.__typename) === "PTConnectionLeg", L = (t) => {
2
+ var e, s, x, a, m, p;
3
+ const d = ((e = t == null ? void 0 : t.text) == null ? void 0 : e.template) && t.text.template.indexOf("(") + 1, r = (a = (s = t == null ? void 0 : t.text) == null ? void 0 : s.template) == null ? void 0 : a.substring(d || 0, (x = t == null ? void 0 : t.text) == null ? void 0 : x.template.indexOf(")"));
3
4
  return {
4
- duration: e && +e.substring(0, e.length - 1) || 0,
5
- text: t?.text?.template?.split("(")[0] || ""
5
+ duration: r && +r.substring(0, r.length - 1) || 0,
6
+ text: ((p = (m = t == null ? void 0 : t.text) == null ? void 0 : m.template) == null ? void 0 : p.split("(")[0]) || ""
6
7
  };
7
8
  };
8
9
  export {
9
- s as extractTimeAndStringFromNoticeText,
10
- i as isConnectionLeg,
11
- r as isRideLeg
10
+ L as extractTimeAndStringFromNoticeText,
11
+ u as isConnectionLeg,
12
+ n as isRideLeg
12
13
  };
@@ -293,7 +293,7 @@
293
293
  "kind": "field",
294
294
  "name": "now",
295
295
  "privacy": "public",
296
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
296
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
297
297
  "type": {
298
298
  "text": "Date"
299
299
  },
@@ -443,7 +443,7 @@
443
443
  },
444
444
  {
445
445
  "name": "now",
446
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
446
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
447
447
  "type": {
448
448
  "text": "Date"
449
449
  },
@@ -512,7 +512,7 @@
512
512
  "kind": "field",
513
513
  "name": "now",
514
514
  "privacy": "public",
515
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
515
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
516
516
  "type": {
517
517
  "text": "Date | null"
518
518
  },
@@ -706,7 +706,7 @@
706
706
  },
707
707
  {
708
708
  "name": "now",
709
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
709
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
710
710
  "type": {
711
711
  "text": "Date | null"
712
712
  },
@@ -830,7 +830,7 @@
830
830
  "kind": "field",
831
831
  "name": "now",
832
832
  "privacy": "public",
833
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
833
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
834
834
  "type": {
835
835
  "text": "Date"
836
836
  },
@@ -919,7 +919,7 @@
919
919
  },
920
920
  {
921
921
  "name": "now",
922
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
922
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
923
923
  "type": {
924
924
  "text": "Date"
925
925
  },
@@ -1550,7 +1550,7 @@
1550
1550
  "kind": "field",
1551
1551
  "name": "now",
1552
1552
  "privacy": "public",
1553
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
1553
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
1554
1554
  "type": {
1555
1555
  "text": "Date"
1556
1556
  },
@@ -1744,7 +1744,7 @@
1744
1744
  },
1745
1745
  {
1746
1746
  "name": "now",
1747
- "description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
1747
+ "description": "A configured date which acts as the current date instead of the real current date.\nOnly recommended for testing purposes.",
1748
1748
  "type": {
1749
1749
  "text": "Date"
1750
1750
  },