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

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 (199) hide show
  1. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +65 -76
  2. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +72 -52
  3. package/autocomplete-grid/autocomplete-grid-button.js +3 -6
  4. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -17
  5. package/autocomplete-grid/autocomplete-grid-cell.js +4 -7
  6. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +20 -21
  7. package/autocomplete-grid/autocomplete-grid-optgroup.js +3 -6
  8. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -33
  9. package/autocomplete-grid/autocomplete-grid-option.js +4 -9
  10. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -22
  11. package/autocomplete-grid/autocomplete-grid-row.js +4 -7
  12. package/autocomplete-grid/autocomplete-grid.js +3 -6
  13. package/autocomplete-grid-cell.component-Dak9wlBr.js +24 -0
  14. package/autocomplete-grid-option.component-DNRFHOwc.js +37 -0
  15. package/autocomplete-grid-row.component-DBHZQ0GQ.js +27 -0
  16. package/autocomplete-grid.js +9 -21
  17. package/autocomplete-grid.pure.js +7 -15
  18. package/core/datetime/date-helper.js +2 -191
  19. package/core/datetime.js +2 -5
  20. package/core/timetable/access-leg-helper.js +76 -71
  21. package/core/timetable/timetable-helper.js +9 -11
  22. package/core/timetable/timetable-properties.js +0 -1
  23. package/core/timetable.js +3 -7
  24. package/date-helper-CGproP5d.js +185 -0
  25. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +114 -122
  26. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +92 -70
  27. package/development/autocomplete-grid/autocomplete-grid-button.js +6 -4
  28. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -29
  29. package/development/autocomplete-grid/autocomplete-grid-cell.js +7 -5
  30. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +27 -22
  31. package/development/autocomplete-grid/autocomplete-grid-optgroup.js +6 -4
  32. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -109
  33. package/development/autocomplete-grid/autocomplete-grid-option.js +7 -7
  34. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -91
  35. package/development/autocomplete-grid/autocomplete-grid-row.js +7 -5
  36. package/development/autocomplete-grid/autocomplete-grid.js +6 -4
  37. package/development/autocomplete-grid-cell.component-BBvM4o2H.js +42 -0
  38. package/development/autocomplete-grid-option.component-QzfM5eIE.js +123 -0
  39. package/development/autocomplete-grid-row.component-H8sCTCkT.js +104 -0
  40. package/development/autocomplete-grid.js +10 -14
  41. package/development/autocomplete-grid.pure.js +4 -13
  42. package/development/core/datetime/date-helper.js +2 -285
  43. package/development/core/datetime.js +2 -6
  44. package/development/core/timetable/access-leg-helper.js +104 -82
  45. package/development/core/timetable/timetable-helper.js +16 -17
  46. package/development/core/timetable/timetable-properties.js +0 -2
  47. package/development/core/timetable.js +3 -8
  48. package/development/date-helper-8_Y-PuHh.js +520 -0
  49. package/development/differenceInMinutes-DN_1Rk3O.js +110 -0
  50. package/development/format-Bbrn2bgo.js +1848 -0
  51. package/development/isValid-C-HzKv4v.js +178 -0
  52. package/development/journey-summary/journey-summary.component.js +2 -288
  53. package/development/journey-summary.component-uGhZvA4p.js +385 -0
  54. package/development/journey-summary.js +8 -5
  55. package/development/journey-summary.pure.js +2 -5
  56. package/development/pearl-chain/pearl-chain.component.js +2 -634
  57. package/development/pearl-chain-time/pearl-chain-time.component.js +2 -306
  58. package/development/pearl-chain-time.component-B8mayTWD.js +415 -0
  59. package/development/pearl-chain-time.js +8 -5
  60. package/development/pearl-chain-time.pure.js +2 -5
  61. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -28
  62. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -393
  63. package/development/pearl-chain-vertical-item.component-BDzbcIaf.js +435 -0
  64. package/development/pearl-chain-vertical-item.js +8 -5
  65. package/development/pearl-chain-vertical-item.pure.js +2 -5
  66. package/development/pearl-chain-vertical.component-CswE7b3M.js +39 -0
  67. package/development/pearl-chain-vertical.js +8 -5
  68. package/development/pearl-chain-vertical.pure.js +2 -5
  69. package/development/pearl-chain.component-wpsTvoSe.js +704 -0
  70. package/development/pearl-chain.js +8 -5
  71. package/development/pearl-chain.pure.js +2 -5
  72. package/development/seat-reservation/common/mapper/icon-mapper.js +168 -71
  73. package/development/seat-reservation/common/mapper/mapper.js +153 -122
  74. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +570 -559
  75. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +992 -972
  76. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20334 -20367
  77. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1731 -1738
  78. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9741 -9782
  79. package/development/seat-reservation/common/mapper.js +1 -8
  80. package/development/seat-reservation/common/svgs.js +2 -46
  81. package/development/seat-reservation/common/translations/i18n.js +1118 -900
  82. package/development/seat-reservation/common/translations.js +1 -4
  83. package/development/seat-reservation/common/types.js +0 -2
  84. package/development/seat-reservation/common.js +7 -11
  85. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1305 -1230
  86. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +2 -859
  87. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -106
  88. package/development/seat-reservation/seat-reservation-area.js +7 -5
  89. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +35 -34
  90. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -162
  91. package/development/seat-reservation/seat-reservation-graphic.js +7 -5
  92. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -713
  93. package/development/seat-reservation/seat-reservation-navigation-coach.js +7 -5
  94. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -131
  95. package/development/seat-reservation/seat-reservation-navigation-services.js +7 -5
  96. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -601
  97. package/development/seat-reservation/seat-reservation-place-control.js +7 -5
  98. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -22
  99. package/development/seat-reservation/seat-reservation-scoped.js +7 -5
  100. package/development/seat-reservation/seat-reservation.js +7 -6
  101. package/development/seat-reservation-area.component-BK92ZtFo.js +138 -0
  102. package/development/seat-reservation-graphic.component-cUnsHh5x.js +193 -0
  103. package/development/seat-reservation-navigation-coach.component-D6Bglus8.js +828 -0
  104. package/development/seat-reservation-navigation-services.component-DYJ6Ddkg.js +179 -0
  105. package/development/seat-reservation-place-control.component-Bg9evKBW.js +726 -0
  106. package/development/seat-reservation-scoped.component-DRQ_I702.js +31 -0
  107. package/development/seat-reservation.component-Cq_aJKR0.js +818 -0
  108. package/development/seat-reservation.js +15 -28
  109. package/development/seat-reservation.pure.js +10 -28
  110. package/development/svgs-C3JMWR26.js +28 -0
  111. package/development/timetable-duration/timetable-duration.component.js +2 -108
  112. package/development/timetable-duration.component-DI0lET17.js +125 -0
  113. package/development/timetable-duration.js +8 -5
  114. package/development/timetable-duration.pure.js +2 -5
  115. package/development/timetable-row/timetable-row.component.js +2 -781
  116. package/development/timetable-row.component-CAED6Zwc.js +932 -0
  117. package/development/timetable-row.js +8 -13
  118. package/development/timetable-row.pure.js +2 -12
  119. package/development/toDate-Biiv3kyf.js +150 -0
  120. package/differenceInMinutes-Dr9gRqtu.js +27 -0
  121. package/format-CM5exOsN.js +1103 -0
  122. package/isValid-B9oVW3lA.js +36 -0
  123. package/journey-summary/journey-summary.component.js +2 -194
  124. package/journey-summary.component-Cq_4kaOp.js +264 -0
  125. package/journey-summary.js +5 -4
  126. package/journey-summary.pure.js +2 -4
  127. package/package.json +2 -2
  128. package/pearl-chain/pearl-chain.component.js +2 -165
  129. package/pearl-chain-time/pearl-chain-time.component.js +2 -157
  130. package/pearl-chain-time.component-DGDW5S1c.js +239 -0
  131. package/pearl-chain-time.js +5 -4
  132. package/pearl-chain-time.pure.js +2 -4
  133. package/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -17
  134. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -77
  135. package/pearl-chain-vertical-item.component-G22bWhLU.js +108 -0
  136. package/pearl-chain-vertical-item.js +5 -4
  137. package/pearl-chain-vertical-item.pure.js +2 -4
  138. package/pearl-chain-vertical.component-CXIDT5RD.js +21 -0
  139. package/pearl-chain-vertical.js +5 -4
  140. package/pearl-chain-vertical.pure.js +2 -4
  141. package/pearl-chain.component-DmjkVIva.js +194 -0
  142. package/pearl-chain.js +5 -4
  143. package/pearl-chain.pure.js +2 -4
  144. package/seat-reservation/common/mapper/icon-mapper.js +71 -71
  145. package/seat-reservation/common/mapper/mapper.js +95 -89
  146. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +568 -558
  147. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +989 -970
  148. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20332 -20366
  149. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1729 -1737
  150. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9739 -9781
  151. package/seat-reservation/common/mapper.js +3 -9
  152. package/seat-reservation/common/svgs.js +2 -243
  153. package/seat-reservation/common/translations/i18n.js +1084 -891
  154. package/seat-reservation/common/translations.js +2 -4
  155. package/seat-reservation/common/types.js +0 -1
  156. package/seat-reservation/common.js +9 -15
  157. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +832 -810
  158. package/seat-reservation/seat-reservation/seat-reservation.component.js +2 -420
  159. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -51
  160. package/seat-reservation/seat-reservation-area.js +4 -7
  161. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +68 -71
  162. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -75
  163. package/seat-reservation/seat-reservation-graphic.js +4 -7
  164. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -234
  165. package/seat-reservation/seat-reservation-navigation-coach.js +4 -7
  166. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -85
  167. package/seat-reservation/seat-reservation-navigation-services.js +4 -7
  168. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -203
  169. package/seat-reservation/seat-reservation-place-control.js +4 -7
  170. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -13
  171. package/seat-reservation/seat-reservation-scoped.js +4 -7
  172. package/seat-reservation/seat-reservation.js +5 -9
  173. package/seat-reservation-area.component-n-9rGn_y.js +75 -0
  174. package/seat-reservation-graphic.component-YTXRmKt0.js +102 -0
  175. package/seat-reservation-navigation-coach.component-YJ0vaYmO.js +333 -0
  176. package/seat-reservation-navigation-services.component-C3xnLJg2.js +127 -0
  177. package/seat-reservation-place-control.component-DmBAfM6K.js +322 -0
  178. package/seat-reservation-scoped.component-DPkz6u17.js +17 -0
  179. package/seat-reservation.component-C_anMkgw.js +364 -0
  180. package/seat-reservation.js +17 -39
  181. package/seat-reservation.pure.js +15 -32
  182. package/svgs-D9arBcqr.js +26 -0
  183. package/timetable-duration/timetable-duration.component.js +2 -57
  184. package/timetable-duration.component-DCu8Phts.js +65 -0
  185. package/timetable-duration.js +5 -4
  186. package/timetable-duration.pure.js +2 -4
  187. package/timetable-row/timetable-row.component.js +2 -427
  188. package/timetable-row.component-BVRCB3xK.js +559 -0
  189. package/timetable-row.js +6 -13
  190. package/timetable-row.pure.js +2 -11
  191. package/toDate-p-Tpkb7t.js +16 -0
  192. package/development/differenceInMinutes-B0dawX-5.js +0 -26
  193. package/development/format-BMkeaqaF.js +0 -1433
  194. package/development/isValid-BYRch7pV.js +0 -53
  195. package/development/toDate-BWb6Z1JD.js +0 -24
  196. package/differenceInMinutes-COvvdYsJ.js +0 -23
  197. package/format-CmKROkbc.js +0 -1186
  198. package/isValid-m3_OsPaB.js +0 -45
  199. package/toDate-Bw2KTWeq.js +0 -15
@@ -1,427 +1,2 @@
1
- var Te = (t) => {
2
- throw TypeError(t);
3
- };
4
- var Ae = (t, i, s) => i.has(t) || Te("Cannot " + s);
5
- var _ = (t, i, s) => (Ae(t, i, "read from private field"), s ? s.call(t) : i.get(t)), f = (t, i, s) => i.has(t) ? Te("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, s), n = (t, i, s, d) => (Ae(t, i, "write to private field"), d ? d.call(t, s) : i.set(t, s), s);
6
- import { __runInitializers as o, __esDecorate as y } from "tslib";
7
- import { SbbElement as at } from "@sbb-esta/lyne-elements/core/base-elements.js";
8
- import { SbbLanguageController as it } from "@sbb-esta/lyne-elements/core/controllers.js";
9
- import { defaultDateAdapter as Ce } from "@sbb-esta/lyne-elements/core/datetime.js";
10
- import { forceType as S } from "@sbb-esta/lyne-elements/core/decorators.js";
11
- import { setOrRemoveAttribute as st } from "@sbb-esta/lyne-elements/core/dom.js";
12
- import { i18nFromPlatform as rt, i18nDeparture as ke, i18nMeansOfTransport as J, i18nDirection as Ne, i18nRealTimeInfo as Se, i18nSupersaver as Ie, i18nTransferProcedures as nt, i18nTransferProcedure as ot, i18nArrival as lt, i18nClass as ze, i18nOccupancy as Le, i18nTravelhints as ct, i18nTripDuration as Me, i18nNew as Oe, i18nTripQuayChange as dt } from "@sbb-esta/lyne-elements/core/i18n.js";
13
- import { boxSizingStyles as bt } from "@sbb-esta/lyne-elements/core/styles.js";
14
- import { css as gt, nothing as g, html as l } from "lit";
15
- import { property as v } from "lit/decorators.js";
16
- import { removeTimezoneFromISOTimeString as Pe, durationToTime as Fe } from "../core/datetime.js";
17
- import { isRideLeg as Ee, getDepartureArrivalTimeAttribute as pt } from "../core/timetable.js";
18
- import "@sbb-esta/lyne-elements/card.js";
19
- import "@sbb-esta/lyne-elements/icon.js";
20
- import "@sbb-esta/lyne-elements/timetable-occupancy.js";
21
- import "../pearl-chain-time.js";
22
- import { f as Re } from "../format-CmKROkbc.js";
23
- const ht = gt`:host{--sbb-timetable-row-gap: var(--sbb-spacing-fixed-2x);--sbb-timetable-row-height: 1.5625rem;--sbb-timetable-row-height-header: 1.25rem;--sbb-timetable-row-height-footer: 1rem;--sbb-timetable-row-skeleton-pulse-duration: 1.8s;display:block}:host([disable-animation]){--sbb-timetable-row-skeleton-pulse-duration: 0}.sbb-timetable__row-transport-icon{--sbb-icon-svg-width: 1.25rem;--sbb-icon-svg-height: 1.25rem}.sbb-travel-hints__item{--sbb-icon-svg-height: .875rem}.sbb-screen-reader-only{border:0;clip-path:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.sbb-timetable__row--quay{margin-inline-end:var(--sbb-spacing-fixed-1x)}.sbb-timetable__row--quay-type{float:left}ul{list-style:none;margin:0;padding:0;font-size:inherit;display:inline-flex}li,.sbb-timetable__row-transport{display:inline-flex;align-self:center}.sbb-timetable__row-transportnumber,.sbb-timetable__row-time{--sbb-text-font-size: var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);font-weight:700;line-height:unset;white-space:nowrap;align-self:center}.sbb-timetable__row{--sbb-text-font-size: var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);display:flex;flex-direction:column;gap:var(--sbb-timetable-row-gap)}.sbb-timetable__row-header,.sbb-timetable__row-footer{animation:none}.sbb-timetable__row-header{display:flex;gap:var(--sbb-spacing-fixed-2x);align-items:center;line-height:var(--sbb-timetable-row-height-header)}.sbb-timetable__row-details,.sbb-timetable__row-hints{display:inline-flex;gap:var(--sbb-spacing-fixed-1x);align-items:center}.sbb-timetable__row-header p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;align-self:center}.sbb-timetable__row-footer{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:var(--sbb-spacing-fixed-2x);line-height:var(--sbb-timetable-row-height-footer)}.sbb-timetable__row-footer>span{align-self:center}.sbb-timetable__row-footer :only-child{margin-inline-start:auto}.sbb-timetable__row-quay--changed{color:var(--sbb-color-primary)}.sbb-timetable__row-transport-wrapper,.sbb-timetable__row-warning{display:inline-flex}.sbb-loading{pointer-events:none}.sbb-loading__wrapper{display:flex;flex-direction:column;gap:var(--sbb-spacing-fixed-2x)}.sbb-loading__row{width:100%;border-radius:var(--sbb-border-radius-1x);height:var(--sbb-timetable-row-height)}@media(min-width:64rem){.sbb-loading__row{height:1.75rem}}@media(forced-colors:active){.sbb-loading__row{border:var(--sbb-border-width-1x) solid ButtonBorder!important}}.sbb-loading__row,.sbb-loading__badge{background:var(--sbb-background-color-4);animation:skeleton-pulse var(--sbb-timetable-row-skeleton-pulse-duration) ease-out infinite}.sbb-loading__row:first-of-type{height:var(--sbb-timetable-row-height-header);width:50%}.sbb-loading__row:last-of-type{height:var(--sbb-timetable-row-height-footer)}.sbb-loading__badge{margin-inline:auto calc(var(--sbb-spacing-fixed-3x) * -1);padding-inline-end:var(--sbb-spacing-fixed-6x);border-end-start-radius:var(--sbb-card-badge-border-radius);transform:var(--sbb-card-badge-skew);width:7.1875rem;height:1.25rem}@keyframes skeleton-pulse{0%{background:var(--sbb-background-color-4)}17%{background:var(--sbb-background-color-4)}50%{background:var(--sbb-background-color-3)}67%{background:var(--sbb-background-color-3)}to{background:var(--sbb-background-color-4)}}`, ut = (t, i) => l`<span class="sbb-timetable__row-transport">
24
- <sbb-icon name=${t}></sbb-icon>
25
- <span class="sbb-screen-reader-only">${i}</span>
26
- </span>`, mt = (t, i) => {
27
- const s = ["M", "B", "T"].includes(t) ? " " : "";
28
- return l`<span class="sbb-timetable__row-transportnumber">
29
- ${i !== null ? t + s + i : t}
30
- </span>`;
31
- }, qe = (t) => t?.find((i) => i.serviceJourney?.serviceAlteration?.reachableText)?.serviceJourney?.serviceAlteration?.reachableText, _t = (t) => t?.find((i) => i.serviceJourney?.serviceAlteration?.delayText)?.serviceJourney?.serviceAlteration?.delayText, De = (t) => t?.find((i) => !!i.serviceJourney?.serviceAlteration?.redirectedText)?.serviceJourney?.serviceAlteration?.redirectedText, Be = (t) => t?.find((i) => !!i.serviceJourney?.serviceAlteration?.unplannedStopPointsText)?.serviceJourney?.serviceAlteration?.unplannedStopPointsText, ft = (t) => {
32
- const i = {
33
- DISTURBANCE: 0,
34
- INFORMATION: 1,
35
- DELAY: 2,
36
- TRAIN_REPLACEMENT_BY_BUS: 3,
37
- CONSTRUCTION_SITE: 4,
38
- END_MESSAGE: 5
39
- };
40
- return [...t].sort((s, d) => i[s.cause] - i[d.cause]);
41
- }, yt = (t) => {
42
- switch (t?.cause) {
43
- case "DISTURBANCE":
44
- return {
45
- name: "disruption",
46
- text: t?.broadcastMessages?.length ? t?.broadcastMessages[0].title : ""
47
- };
48
- case "INFORMATION":
49
- return {
50
- name: "info",
51
- text: t?.broadcastMessages.length ? t?.broadcastMessages[0].title : ""
52
- };
53
- case "DELAY":
54
- return {
55
- name: "delay",
56
- text: t?.broadcastMessages.length ? t?.broadcastMessages[0].title : ""
57
- };
58
- case "TRAIN_REPLACEMENT_BY_BUS":
59
- return {
60
- name: "replacementbus",
61
- text: t?.broadcastMessages.length ? t?.broadcastMessages[0].title : ""
62
- };
63
- case "CONSTRUCTION_SITE":
64
- return {
65
- name: "construction",
66
- text: t?.broadcastMessages.length ? t?.broadcastMessages[0].title : ""
67
- };
68
- default:
69
- return {
70
- name: "info",
71
- text: t?.broadcastMessages.length ? t?.broadcastMessages[0].title : ""
72
- };
73
- }
74
- }, vt = (t, i) => {
75
- const { summary: s, legs: d } = t || {}, p = d?.filter((C) => Ee(C)), { tripStatus: u } = s || {};
76
- if (u?.cancelled || u?.partiallyCancelled)
77
- return { name: "cancellation", text: u?.cancelledText };
78
- if (qe(p))
79
- return { name: "missed-connection", text: qe(p) };
80
- if (u?.alternative)
81
- return { name: "alternative", text: u.alternativeText };
82
- if (De(p))
83
- return { name: "reroute", text: De(p) };
84
- if (Be(p))
85
- return { name: "add-stop", text: Be(p) };
86
- if (u?.delayed || u?.delayedUnknown)
87
- return { name: "delay", text: _t(p) };
88
- if (u?.quayChanged) {
89
- const C = p[0].departure;
90
- return {
91
- name: "platform-change",
92
- text: C.quayChanged ? C.quayChangedText : dt[i]
93
- };
94
- }
95
- return {};
96
- }, xt = (t) => {
97
- const i = ["RR", "RK", "RC", "RL", "RM", "RS", "RU", "XP", "XR", "XT"];
98
- return t.reduce((s, d) => {
99
- if (s)
100
- return s;
101
- if (i.includes(d.name))
102
- return { ...d, name: "RR" };
103
- }, void 0);
104
- }, wt = (t) => {
105
- const i = ["Z", "SB", "SZ", "VR", "TG"];
106
- return t.filter((d, p) => t.findIndex((u) => u.name === d.name) === p).filter((d) => i.includes(d.name)).sort((d, p) => i.indexOf(d.name) - i.indexOf(p.name));
107
- }, Y = (t) => {
108
- const i = xt(t), s = wt(t);
109
- return i === void 0 ? s : s.length ? s[0].name === "Z" && s[1] ? [s[0], i, s[1]].concat(s.slice(2)) : [i, ...s] : [i];
110
- };
111
- let Ut = (() => {
112
- var I, z, L, M, O, P, F, R, q, D, c;
113
- let t = at, i = [], s, d = [], p = [], u, C = [], X = [], Z, G = [], V = [], ee, te = [], ae = [], ie, se = [], re = [], ne, oe = [], le = [], ce, de = [], be = [], ge, pe = [], he = [], ue, me = [], _e = [], fe, ye = [], ve = [], xe;
114
- return c = class extends t {
115
- constructor() {
116
- super(...arguments);
117
- f(this, I);
118
- f(this, z);
119
- f(this, L);
120
- f(this, M);
121
- f(this, O);
122
- f(this, P);
123
- f(this, F);
124
- f(this, R);
125
- f(this, q);
126
- f(this, D);
127
- n(this, I, (o(this, i), o(this, d, null))), n(this, z, (o(this, p), o(this, C, null))), n(this, L, (o(this, X), o(this, G, !1))), n(this, M, (o(this, V), o(this, te, null))), n(this, O, (o(this, ae), o(this, se, !1))), n(this, P, (o(this, re), o(this, oe, !1))), n(this, F, (o(this, le), o(this, de, !1))), n(this, R, (o(this, be), o(this, pe, ""))), n(this, q, (o(this, he), o(this, me, !1))), n(this, D, (o(this, _e), o(this, ye, !1))), this._now = (o(this, ve), null), this._language = new it(this);
128
- }
129
- /** The trip Prop. */
130
- get trip() {
131
- return _(this, I);
132
- }
133
- set trip(a) {
134
- n(this, I, a);
135
- }
136
- /** The price Prop, which consists of the data for the badge. */
137
- get price() {
138
- return _(this, z);
139
- }
140
- set price(a) {
141
- n(this, z, a);
142
- }
143
- /** This will be forwarded to the sbb-pearl-chain component - if true the position won't be animated. */
144
- get disableAnimation() {
145
- return _(this, L);
146
- }
147
- set disableAnimation(a) {
148
- n(this, L, a);
149
- }
150
- /** This will be forwarded to the notices section */
151
- get boarding() {
152
- return _(this, M);
153
- }
154
- set boarding(a) {
155
- n(this, M, a);
156
- }
157
- /**
158
- * The loading state -
159
- * when this is true it will be render skeleton with an idling animation
160
- */
161
- get loadingTrip() {
162
- return _(this, O);
163
- }
164
- set loadingTrip(a) {
165
- n(this, O, a);
166
- }
167
- /**
168
- * The Footpath attribute for rendering different icons
169
- * true: render a11y-icon
170
- * false: render walk-icon
171
- * default: render walk-icon
172
- */
173
- get a11yFootpath() {
174
- return _(this, P);
175
- }
176
- set a11yFootpath(a) {
177
- n(this, P, a);
178
- }
179
- /**
180
- * The loading state -
181
- * when this is true it will be render skeleton with an idling animation
182
- */
183
- get loadingPrice() {
184
- return _(this, F);
185
- }
186
- set loadingPrice(a) {
187
- n(this, F, a);
188
- }
189
- /**
190
- * Hidden label for the card action. It overrides the automatically generated accessibility text for the component. Use this prop to provide custom accessibility information for the component.
191
- */
192
- get cardActionLabel() {
193
- return _(this, R);
194
- }
195
- set cardActionLabel(a) {
196
- n(this, R, a);
197
- }
198
- /** This will be forwarded to the sbb-card component as aria-expanded. */
199
- get accessibilityExpanded() {
200
- return _(this, q);
201
- }
202
- set accessibilityExpanded(a) {
203
- n(this, q, a);
204
- }
205
- /** When this prop is true the sbb-card will be in the active state. */
206
- get active() {
207
- return _(this, D);
208
- }
209
- set active(a) {
210
- n(this, D, a);
211
- }
212
- /**
213
- * A configured date which acts as the current date instead of the real current date.
214
- * Only recommended for testing purposes.
215
- */
216
- set now(a) {
217
- this._now = Ce.getValidDateOrNull(Ce.deserialize(a));
218
- }
219
- get now() {
220
- return this._now ?? /* @__PURE__ */ new Date();
221
- }
222
- willUpdate(a) {
223
- super.willUpdate(a), a.has("loadingTrip") && st(this, "role", this.loadingTrip ? null : "rowgroup");
224
- }
225
- /** The skeleton render function for the loading state */
226
- _renderSkeleton() {
227
- return l`
228
- <sbb-card class="sbb-loading sbb-card-spacing-4x-xxs">
229
- ${this.loadingPrice ? l`<div class="sbb-loading__badge" slot="badge"></div>` : g}
230
- <div class="sbb-loading__wrapper">
231
- <div class="sbb-loading__row"></div>
232
- <div class="sbb-loading__row"></div>
233
- <div class="sbb-loading__row"></div>
234
- </div>
235
- </sbb-card>
236
- `;
237
- }
238
- _getRideLegs() {
239
- return this.trip?.legs?.filter((a) => Ee(a)) ?? [];
240
- }
241
- _getQuayTypeStrings() {
242
- if (!this.trip.summary?.product)
243
- return null;
244
- const a = this._getRideLegs(), r = this.trip.summary.product?.vehicleMode === "TRAIN" ? a[0].serviceJourney.quayTypeShortName || "" : a[0].serviceJourney.quayTypeName || "";
245
- return {
246
- long: rt[this._language.current] + " " + r,
247
- short: r
248
- };
249
- }
250
- /** map Quay */
251
- _renderQuayType() {
252
- if (!this.trip.summary?.product)
253
- return;
254
- const a = this._getQuayTypeStrings();
255
- return l`
256
- <span class="sbb-timetable__row--quay">
257
- <span class="sbb-screen-reader-only">${a?.long}&nbsp;</span>
258
- <span class="sbb-timetable__row--quay-type" aria-hidden="true"
259
- >${a?.short}</span
260
- >
261
- </span>
262
- `;
263
- }
264
- _handleHimCus(a) {
265
- const { situations: e } = a || {}, r = e && ft(e), w = vt(a, this._language.current);
266
- return {
267
- cus: Object.keys(w)?.length ? w : null,
268
- him: e?.length ? yt(r[0]) : null
269
- };
270
- }
271
- _getAccessibilityText(a) {
272
- const { summary: e, legs: r, notices: w } = a || {}, { departureWalk: b, arrivalWalk: W, departure: k, arrival: $, product: x, direction: H, occupancy: h, duration: T } = e || {}, { departureTimeAttribute: m, arrivalTimeAttribute: B } = pt(r, b || 0, W || 0, this._language.current, this.a11yFootpath), A = this._getRideLegs(), E = k?.time ? Pe(k.time) : void 0, U = $?.time ? Pe($.time) : void 0, Q = m ? `${m.text} ${m.duration}, ` : "", Ue = B ? `${B.text} ${B.duration}, ` : "", We = E ? `${ke[this._language.current]}: ${Re(E, "HH:mm")}, ` : "", je = () => k?.quayFormatted ? `${k?.quayChanged ? `${Oe[this._language.current]} ` : ""}${this._getQuayTypeStrings()?.long} ${k?.quayFormatted}, ` : "", Je = x && x.vehicleMode ? J[x.vehicleMode.toLowerCase()] && `${J[x.vehicleMode.toLowerCase()][this._language.current]}, ` : "", He = x?.vehicleSubModeShortName ? `${x.vehicleSubModeShortName} ${x.line || ""}, ` : "", Qe = `${Ne[this._language.current]} ${H}, `, j = this._handleHimCus(a), we = j?.cus?.text ? `${Se[this._language.current]}: ${j?.cus?.text}, ` : "", Ke = j?.him?.text ? `${Se[this._language.current]}: ${j?.him?.text}, ` : "", Ye = this.boarding ? `${this.boarding.text}, ` : "", Xe = `${this.price?.isDiscount ? Ie[this._language.current] : ""} ${this.price?.text && this.price?.price ? (this.price?.text || "") + " " + (this.price?.price || "") + ", " : ""}`, Ze = A.length > 2 ? `${A.length - 1} ${nt[this._language.current]}, ` : A.length > 1 ? `${A.length - 1} ${ot[this._language.current]}, ` : "", Ge = U ? `${lt[this._language.current]}: ${Re(U, "HH:mm")}, ` : "";
273
- let K = "";
274
- h && (h.firstClass && h.firstClass !== "UNKNOWN" && (K += `${ze.first[this._language.current]} ${Le[h.firstClass.toLowerCase()]?.[this._language.current]}.`), h.secondClass && h.secondClass !== "UNKNOWN" && (K += ` ${ze.second[this._language.current]} ${Le[h.secondClass.toLowerCase()]?.[this._language.current]}.`));
275
- const $e = w && Y(w).length && Y(w)?.map((N, tt) => tt < 4 && N.text?.template).join(", ") + ", ", Ve = $e ? `${ct[this._language.current]}: ${$e}` : "", et = T && T > 0 ? `${Me[this._language.current]} ${Fe(T, this._language.current).long}, ` : "";
276
- return [
277
- Q,
278
- We,
279
- je(),
280
- Je,
281
- He,
282
- Qe,
283
- we,
284
- Ye,
285
- Xe,
286
- we ? "" : Ke,
287
- Ge,
288
- Ue,
289
- et,
290
- Ze,
291
- K,
292
- Ve
293
- ].map((N) => N?.trim()).filter((N) => N && N.length > 0).join(" ");
294
- }
295
- render() {
296
- if (this.loadingTrip)
297
- return this._renderSkeleton();
298
- const { legs: a, id: e, notices: r, summary: w } = this.trip || {}, { product: b, direction: W, departureWalk: k, departure: $, arrival: x, arrivalWalk: H, occupancy: h, duration: T } = w || {}, m = this._handleHimCus(this.trip), B = !!m.cus || !!m.him, A = r && Y(r), E = T ? Fe(T, this._language.current) : null;
299
- return l`
300
- <sbb-card class="sbb-card-spacing-4x-xxs" id=${e}>
301
- <sbb-card-button
302
- ?active=${this.active}
303
- aria-expanded=${this.accessibilityExpanded ? "true" : g}
304
- >
305
- ${this.cardActionLabel ? this.cardActionLabel : this._getAccessibilityText(this.trip)}
306
- </sbb-card-button>
307
- ${this.loadingPrice ? l`<div class="sbb-loading__badge" slot="badge"></div>` : g}
308
- ${this.price && !this.loadingPrice ? l`<sbb-card-badge color=${this.price.isDiscount ? "charcoal" : "white"}>
309
- ${this.price.isDiscount ? l`<span aria-hidden="true">
310
- %<span class="sbb-screen-reader-only"
311
- >${Ie[this._language.current]}</span
312
- >
313
- </span>` : g}
314
- ${this.price.text ? l`<span>${this.price.text}</span>` : g}
315
- ${this.price.price ? l`<span>${this.price.price}</span>` : g}
316
- </sbb-card-badge>` : g}
317
- <div class="sbb-timetable__row" role="row">
318
- <div class="sbb-timetable__row-header" role="gridcell">
319
- <div class="sbb-timetable__row-details">
320
- ${b?.corporateIdentityPictogram && l`<span class="sbb-timetable__row-transport-wrapper">
321
- <sbb-icon
322
- class="sbb-timetable__row-transport-icon"
323
- name="picto:${b.corporateIdentityPictogram}"
324
- ></sbb-icon>
325
- <span class="sbb-screen-reader-only">
326
- ${b && b.vehicleMode && J[b.vehicleMode.toLowerCase()] && J[b.vehicleMode.toLowerCase()][this._language.current]}
327
- &nbsp;
328
- </span>
329
- </span>`}
330
- ${b && (b.corporateIdentityIcon ? ut(b.corporateIdentityIcon, b.name) : b.vehicleSubModeShortName && mt(b.vehicleSubModeShortName, b?.line))}
331
- </div>
332
- ${W ? l`<p>${`${Ne[this._language.current]} ${W}`}</p>` : g}
333
- </div>
334
- <sbb-pearl-chain-time
335
- role="gridcell"
336
- .legs=${a}
337
- .departureTime=${$?.time}
338
- .arrivalTime=${x?.time}
339
- .departureWalk=${k}
340
- .arrivalWalk=${H}
341
- ?disable-animation=${this.disableAnimation}
342
- ?a11y-footpath=${this.a11yFootpath}
343
- .now=${this.now}
344
- ></sbb-pearl-chain-time>
345
- <div class="sbb-timetable__row-footer" role="gridcell">
346
- ${b && $?.quayFormatted ? l`<span
347
- class=${$?.quayChanged ? "sbb-timetable__row-quay--changed" : g}
348
- >
349
- <span class="sbb-screen-reader-only">
350
- ${`${ke[this._language.current]} ${$?.quayChanged ? Oe[this._language.current] : ""}`}
351
- &nbsp;
352
- </span>
353
- ${this._renderQuayType()} ${$?.quayFormatted}
354
- </span>` : g}
355
- ${h?.firstClass && h?.firstClass !== "UNKNOWN" || h?.secondClass && h.secondClass !== "UNKNOWN" ? l`<sbb-timetable-occupancy
356
- .firstClassOccupancy=${h?.firstClass?.toLowerCase()}
357
- .secondClassOccupancy=${h?.secondClass?.toLowerCase()}
358
- ></sbb-timetable-occupancy>` : g}
359
- ${A && A.length || this.boarding ? l`<ul class="sbb-timetable__row-hints" role="list">
360
- ${A?.map((U, Q) => Q < 4 ? l`<li>
361
- <sbb-icon
362
- class="sbb-travel-hints__item"
363
- name=${"sa-" + U.name?.toLowerCase()}
364
- ></sbb-icon>
365
- <span class="sbb-screen-reader-only">${U.text?.template}</span>
366
- </li>` : g)}
367
- ${this.boarding ? l`<li>
368
- <sbb-icon
369
- class="sbb-travel-hints__item"
370
- name=${this.boarding?.name}
371
- aria-label=${this.boarding?.text}
372
- aria-hidden="false"
373
- ></sbb-icon>
374
- </li>` : g}
375
- </ul>` : g}
376
- ${T && T > 0 ? l`<time>
377
- <span class="sbb-screen-reader-only">
378
- ${`${Me[this._language.current]} ${E.long}`}
379
- </span>
380
- <span aria-hidden="true">${E.short}</span>
381
- </time>` : g}
382
- ${B && (m.cus || m.him) ? l`<span class="sbb-timetable__row-warning">
383
- <sbb-icon name=${(m.cus || m.him).name}></sbb-icon>
384
- <span class="sbb-screen-reader-only">${(m.cus || m.him).text}</span>
385
- </span>` : g}
386
- </div>
387
- </div>
388
- </sbb-card>
389
- `;
390
- }
391
- }, I = new WeakMap(), z = new WeakMap(), L = new WeakMap(), M = new WeakMap(), O = new WeakMap(), P = new WeakMap(), F = new WeakMap(), R = new WeakMap(), q = new WeakMap(), D = new WeakMap(), (() => {
392
- const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(t[Symbol.metadata] ?? null) : void 0;
393
- s = [v({ type: Object })], u = [v({ type: Object })], Z = [S(), v({ attribute: "disable-animation", reflect: !0, type: Boolean })], ee = [v({ type: Object })], ie = [S(), v({ attribute: "loading-trip", type: Boolean })], ne = [S(), v({ attribute: "a11y-footpath", type: Boolean })], ce = [S(), v({ attribute: "loading-price", type: Boolean })], ge = [S(), v({ attribute: "card-action-label" })], ue = [S(), v({ attribute: "accessibility-expanded", type: Boolean })], fe = [S(), v({ type: Boolean })], xe = [v()], y(c, null, s, { kind: "accessor", name: "trip", static: !1, private: !1, access: { has: (e) => "trip" in e, get: (e) => e.trip, set: (e, r) => {
394
- e.trip = r;
395
- } }, metadata: a }, d, p), y(c, null, u, { kind: "accessor", name: "price", static: !1, private: !1, access: { has: (e) => "price" in e, get: (e) => e.price, set: (e, r) => {
396
- e.price = r;
397
- } }, metadata: a }, C, X), y(c, null, Z, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, r) => {
398
- e.disableAnimation = r;
399
- } }, metadata: a }, G, V), y(c, null, ee, { kind: "accessor", name: "boarding", static: !1, private: !1, access: { has: (e) => "boarding" in e, get: (e) => e.boarding, set: (e, r) => {
400
- e.boarding = r;
401
- } }, metadata: a }, te, ae), y(c, null, ie, { kind: "accessor", name: "loadingTrip", static: !1, private: !1, access: { has: (e) => "loadingTrip" in e, get: (e) => e.loadingTrip, set: (e, r) => {
402
- e.loadingTrip = r;
403
- } }, metadata: a }, se, re), y(c, null, ne, { kind: "accessor", name: "a11yFootpath", static: !1, private: !1, access: { has: (e) => "a11yFootpath" in e, get: (e) => e.a11yFootpath, set: (e, r) => {
404
- e.a11yFootpath = r;
405
- } }, metadata: a }, oe, le), y(c, null, ce, { kind: "accessor", name: "loadingPrice", static: !1, private: !1, access: { has: (e) => "loadingPrice" in e, get: (e) => e.loadingPrice, set: (e, r) => {
406
- e.loadingPrice = r;
407
- } }, metadata: a }, de, be), y(c, null, ge, { kind: "accessor", name: "cardActionLabel", static: !1, private: !1, access: { has: (e) => "cardActionLabel" in e, get: (e) => e.cardActionLabel, set: (e, r) => {
408
- e.cardActionLabel = r;
409
- } }, metadata: a }, pe, he), y(c, null, ue, { kind: "accessor", name: "accessibilityExpanded", static: !1, private: !1, access: { has: (e) => "accessibilityExpanded" in e, get: (e) => e.accessibilityExpanded, set: (e, r) => {
410
- e.accessibilityExpanded = r;
411
- } }, metadata: a }, me, _e), y(c, null, fe, { kind: "accessor", name: "active", static: !1, private: !1, access: { has: (e) => "active" in e, get: (e) => e.active, set: (e, r) => {
412
- e.active = r;
413
- } }, metadata: a }, ye, ve), y(c, null, xe, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, r) => {
414
- e.now = r;
415
- } }, metadata: a }, null, i), a && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
416
- })(), c.elementName = "sbb-timetable-row", c.styles = [bt, ht], c;
417
- })();
418
- export {
419
- Ut as SbbTimetableRowElement,
420
- wt as filterNotices,
421
- vt as getCus,
422
- yt as getHimIcon,
423
- Y as handleNotices,
424
- ut as renderIconProduct,
425
- mt as renderStringProduct,
426
- ft as sortSituation
427
- };
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../timetable-row.component-BVRCB3xK.js";
2
+ export { s as SbbTimetableRowElement, r as filterNotices, a as getCus, n as getHimIcon, e as handleNotices, i as renderIconProduct, o as renderStringProduct, t as sortSituation };