@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.
- package/core/datetime/date-helper.js +142 -142
- package/core/timetable/access-leg-helper.js +52 -49
- package/core/timetable/timetable-helper.js +8 -7
- package/custom-elements.json +8 -8
- package/development/core/datetime/date-helper.js +10 -10
- package/development/core/timetable/access-leg-helper.js +15 -12
- package/development/core/timetable/timetable-helper.js +7 -6
- package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-CHSyWiQs.js} +3 -3
- package/development/{format-BQfaa1ZT.js → format-D0-yhzi4.js} +26 -22
- package/development/{isValid-DvieCZVi.js → isValid-Bo4R7iA7.js} +3 -3
- package/development/journey-summary/journey-summary.component.d.ts +5 -3
- package/development/journey-summary/journey-summary.component.d.ts.map +1 -1
- package/development/journey-summary/journey-summary.component.js +9 -5
- package/development/pearl-chain/pearl-chain.component.d.ts +5 -3
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/development/pearl-chain/pearl-chain.component.js +43 -29
- package/development/pearl-chain-time/pearl-chain-time.component.d.ts +5 -3
- package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -1
- package/development/pearl-chain-time/pearl-chain-time.component.js +10 -6
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +16 -14
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
- package/development/seat-reservation/common/svgs.js +1 -1
- package/development/seat-reservation/common/translations/i18n.js +3 -2
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +33 -22
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +7 -6
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +23 -16
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +3 -2
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +8 -7
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +11 -7
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +3 -2
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +5 -4
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.d.ts +5 -3
- package/development/timetable-row/timetable-row.component.d.ts.map +1 -1
- package/development/timetable-row/timetable-row.component.js +93 -59
- package/differenceInMinutes-BMqUZdhj.js +23 -0
- package/{format-lqeCzmzS.js → format-Dg8rkk7h.js} +442 -438
- package/isValid-DJ69OMZJ.js +45 -0
- package/journey-summary/journey-summary.component.d.ts +5 -3
- package/journey-summary/journey-summary.component.d.ts.map +1 -1
- package/journey-summary/journey-summary.component.js +8 -4
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.d.ts +5 -3
- package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/pearl-chain/pearl-chain.component.js +99 -79
- package/pearl-chain-time/pearl-chain-time.component.d.ts +5 -3
- package/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -1
- package/pearl-chain-time/pearl-chain-time.component.js +49 -45
- package/seat-reservation/common/mapper/mapper.js +54 -50
- package/seat-reservation/common/translations/i18n.js +6 -5
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +115 -104
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +41 -40
- package/seat-reservation/seat-reservation/seat-reservation.component.js +87 -78
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +18 -15
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +59 -58
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +75 -71
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +13 -12
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +24 -23
- package/timetable-row/timetable-row.component.d.ts +5 -3
- package/timetable-row/timetable-row.component.d.ts.map +1 -1
- package/timetable-row/timetable-row.component.js +251 -208
- package/differenceInMinutes-CP_C5onR.js +0 -23
- package/isValid-Ceq2O0NQ.js +0 -45
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
import { i18nDurationDay as
|
|
2
|
-
import { t as d, c as
|
|
3
|
-
import { n as I, d as y, i as U } from "../../isValid-
|
|
4
|
-
import { g as C, a as Y, d as F } from "../../differenceInMinutes-
|
|
5
|
-
function x(
|
|
6
|
-
const
|
|
7
|
-
return isNaN(
|
|
8
|
-
}
|
|
9
|
-
function z(
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
function H(
|
|
13
|
-
return z(
|
|
14
|
-
}
|
|
15
|
-
function S(
|
|
16
|
-
const [
|
|
17
|
-
n
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
),
|
|
21
|
-
y(
|
|
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
|
-
|
|
24
|
-
const
|
|
25
|
-
return
|
|
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(
|
|
28
|
-
const n =
|
|
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(
|
|
32
|
-
const [
|
|
33
|
-
n
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
return C(n
|
|
38
|
-
}
|
|
39
|
-
function v(
|
|
40
|
-
return x(
|
|
41
|
-
}
|
|
42
|
-
function O(
|
|
43
|
-
const n = () =>
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
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 (!
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
if (
|
|
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 (
|
|
55
|
-
if (
|
|
54
|
+
if (i.timezone) {
|
|
55
|
+
if (c = E(i.timezone), isNaN(c)) return n();
|
|
56
56
|
} else {
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
),
|
|
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(
|
|
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(
|
|
77
|
-
const
|
|
78
|
-
let
|
|
76
|
+
function k(t) {
|
|
77
|
+
const e = {}, n = t.split(l.dateTimeDelimiter);
|
|
78
|
+
let r;
|
|
79
79
|
if (n.length > 2)
|
|
80
|
-
return
|
|
81
|
-
if (/:/.test(n[0]) ?
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
))),
|
|
85
|
-
const
|
|
86
|
-
|
|
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
|
|
88
|
+
return e;
|
|
89
89
|
}
|
|
90
|
-
function W(
|
|
90
|
+
function W(t, e) {
|
|
91
91
|
const n = new RegExp(
|
|
92
|
-
"^(?:(\\d{4}|[+-]\\d{" + (4 +
|
|
93
|
-
),
|
|
94
|
-
if (!
|
|
95
|
-
const
|
|
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:
|
|
98
|
-
restDateString:
|
|
97
|
+
year: s === null ? i : s * 100,
|
|
98
|
+
restDateString: t.slice((r[1] || r[2]).length)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function j(
|
|
102
|
-
if (
|
|
103
|
-
const n =
|
|
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
|
|
106
|
-
if (
|
|
107
|
-
return G(
|
|
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
|
|
110
|
-
return !q(
|
|
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(
|
|
114
|
-
return
|
|
113
|
+
function f(t) {
|
|
114
|
+
return t ? parseInt(t) : 1;
|
|
115
115
|
}
|
|
116
|
-
function A(
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
const n =
|
|
120
|
-
return K(n,
|
|
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
|
|
123
|
-
return
|
|
122
|
+
function g(t) {
|
|
123
|
+
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
124
124
|
}
|
|
125
|
-
function E(
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
129
|
-
const n =
|
|
130
|
-
return P(
|
|
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(
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
return
|
|
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 $(
|
|
140
|
-
return
|
|
139
|
+
function $(t) {
|
|
140
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
141
141
|
}
|
|
142
|
-
function q(
|
|
143
|
-
return
|
|
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(
|
|
146
|
-
return
|
|
145
|
+
function B(t, e) {
|
|
146
|
+
return e >= 1 && e <= ($(t) ? 366 : 365);
|
|
147
147
|
}
|
|
148
|
-
function G(
|
|
149
|
-
return
|
|
148
|
+
function G(t, e, n) {
|
|
149
|
+
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
|
|
150
150
|
}
|
|
151
|
-
function K(
|
|
152
|
-
return
|
|
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(
|
|
155
|
-
return
|
|
154
|
+
function P(t, e) {
|
|
155
|
+
return e >= 0 && e <= 59;
|
|
156
156
|
}
|
|
157
|
-
function Q(
|
|
158
|
-
return H(
|
|
157
|
+
function Q(t, e, n) {
|
|
158
|
+
return H(t, -e);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
if (!
|
|
160
|
+
function ne(t) {
|
|
161
|
+
if (!t)
|
|
162
162
|
return;
|
|
163
|
-
const
|
|
164
|
-
if (U(
|
|
165
|
-
if (
|
|
166
|
-
return new Date(
|
|
167
|
-
if (
|
|
168
|
-
const n =
|
|
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(
|
|
172
|
+
return new Date(t);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
const n = [],
|
|
177
|
-
let
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
return
|
|
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:
|
|
185
|
+
long: r.join(" ")
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
export {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
re as durationToTime,
|
|
190
|
+
ne as removeTimezoneFromISOTimeString
|
|
191
191
|
};
|
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import { i18nWalkingDistanceDeparture as
|
|
2
|
-
import { nothing as
|
|
3
|
-
import { isRideLeg as
|
|
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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
14
|
-
|
|
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: (
|
|
17
|
-
text:
|
|
18
|
-
icon:
|
|
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
|
|
22
|
-
|
|
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: (
|
|
25
|
-
text:
|
|
26
|
-
icon:
|
|
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
|
|
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--${
|
|
32
|
-
<sbb-icon name=${
|
|
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
|
-
${!
|
|
36
|
-
${
|
|
38
|
+
${!i && e ? e === "departure" ? _[n] : A[n] : b}
|
|
39
|
+
${i ? f`<span>${i}</span>` : b}
|
|
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,
|
|
48
|
+
function p(t, a, n, i) {
|
|
46
49
|
return f`
|
|
47
|
-
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${
|
|
48
|
-
<sbb-icon name=${
|
|
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">${
|
|
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
|
|
58
|
-
const
|
|
59
|
-
text:
|
|
60
|
-
duration:
|
|
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,
|
|
63
|
-
function
|
|
65
|
+
} : null, D = () => l || (u && !s && !l ? u : s || null);
|
|
66
|
+
function L() {
|
|
64
67
|
return f`
|
|
65
|
-
${
|
|
66
|
-
${
|
|
67
|
-
${s ? e ? p(s.duration, s.text, "left", s.icon) :
|
|
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
|
|
71
|
-
text:
|
|
72
|
-
duration:
|
|
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,
|
|
75
|
-
function
|
|
77
|
+
} : null, Y = () => m || (d && !o && !m ? d : o || null);
|
|
78
|
+
function M() {
|
|
76
79
|
return f`
|
|
77
|
-
${
|
|
78
|
-
${
|
|
79
|
-
${
|
|
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:
|
|
84
|
-
renderArrivalTimeAttribute:
|
|
85
|
-
departureTimeAttribute:
|
|
86
|
-
arrivalTimeAttribute:
|
|
86
|
+
renderDepartureTimeAttribute: L,
|
|
87
|
+
renderArrivalTimeAttribute: M,
|
|
88
|
+
departureTimeAttribute: D(),
|
|
89
|
+
arrivalTimeAttribute: Y()
|
|
87
90
|
};
|
|
88
91
|
}
|
|
89
92
|
export {
|
|
90
|
-
|
|
93
|
+
O as getDepartureArrivalTimeAttribute
|
|
91
94
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
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:
|
|
5
|
-
text: t
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
L as extractTimeAndStringFromNoticeText,
|
|
11
|
+
u as isConnectionLeg,
|
|
12
|
+
n as isRideLeg
|
|
12
13
|
};
|
package/custom-elements.json
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
},
|