kupos-ui-components-lib 10.4.11 → 10.4.13
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/dist/assets/images/filter/bus.svg +19 -0
- package/dist/assets/images/filter/clock.svg +4 -0
- package/dist/assets/images/filter/filter.svg +3 -0
- package/dist/assets/images/filter/money.svg +12 -0
- package/dist/assets/images/filter/night.svg +5 -0
- package/dist/assets/images/filter/rise.svg +20 -0
- package/dist/assets/images/filter/search.svg +4 -0
- package/dist/assets/images/filter/seat.svg +4 -0
- package/dist/assets/images/filter/star.svg +10 -0
- package/dist/assets/images/filter/sun.svg +20 -0
- package/dist/assets/images/filter/sunset.svg +15 -0
- package/dist/assets/images/filter/track.svg +4 -0
- package/dist/components/FilterSortBar/FilterChip.d.ts +21 -0
- package/dist/components/FilterSortBar/FilterChip.js +42 -0
- package/dist/components/FilterSortBar/FilterSortBarMobile.d.ts +10 -0
- package/dist/components/FilterSortBar/FilterSortBarMobile.js +121 -0
- package/dist/components/FilterSortBar/FiltersMasterSheet.d.ts +16 -0
- package/dist/components/FilterSortBar/FiltersMasterSheet.js +111 -0
- package/dist/components/FilterSortBar/OptionCheckboxList.d.ts +13 -0
- package/dist/components/FilterSortBar/OptionCheckboxList.js +30 -0
- package/dist/components/FilterSortBar/PriceRangeSlider.d.ts +12 -0
- package/dist/components/FilterSortBar/PriceRangeSlider.js +113 -0
- package/dist/components/FilterSortBar/SheetFooter.d.ts +9 -0
- package/dist/components/FilterSortBar/SheetFooter.js +36 -0
- package/dist/components/FilterSortBar/SingleFilterSheet.d.ts +15 -0
- package/dist/components/FilterSortBar/SingleFilterSheet.js +21 -0
- package/dist/components/FilterSortBar/defaultIcons.d.ts +2 -0
- package/dist/components/FilterSortBar/defaultIcons.js +18 -0
- package/dist/components/FilterSortBar/icons.d.ts +50 -0
- package/dist/components/FilterSortBar/icons.js +67 -0
- package/dist/components/FilterSortBar/index.d.ts +4 -0
- package/dist/components/FilterSortBar/index.js +3 -0
- package/dist/components/FilterSortBar/types.d.ts +57 -0
- package/dist/components/FilterSortBar/types.js +8 -0
- package/dist/components/PaymentSideBar/PaymentSideBarMobile.js +15 -8
- package/dist/components/PaymentSideBar/types.d.ts +3 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -0
- package/dist/styles.css +64 -0
- package/dist/ui/BottomSheet/BottomSheet.d.ts +2 -1
- package/dist/ui/BottomSheet/BottomSheet.js +2 -1
- package/package.json +1 -1
- package/patch.py +35 -0
- package/src/assets/images/filter/bus.svg +19 -0
- package/src/assets/images/filter/clock.svg +4 -0
- package/src/assets/images/filter/filter.svg +3 -0
- package/src/assets/images/filter/money.svg +12 -0
- package/src/assets/images/filter/night.svg +5 -0
- package/src/assets/images/filter/rise.svg +20 -0
- package/src/assets/images/filter/search.svg +4 -0
- package/src/assets/images/filter/seat.svg +4 -0
- package/src/assets/images/filter/star.svg +10 -0
- package/src/assets/images/filter/sun.svg +20 -0
- package/src/assets/images/filter/sunset.svg +15 -0
- package/src/assets/images/filter/track.svg +4 -0
- package/src/components/FilterSortBar/FilterChip.tsx +113 -0
- package/src/components/FilterSortBar/FilterSortBarMobile.tsx +236 -0
- package/src/components/FilterSortBar/FiltersMasterSheet.tsx +208 -0
- package/src/components/FilterSortBar/OptionCheckboxList.tsx +86 -0
- package/src/components/FilterSortBar/PriceRangeSlider.tsx +184 -0
- package/src/components/FilterSortBar/SheetFooter.tsx +61 -0
- package/src/components/FilterSortBar/SingleFilterSheet.tsx +82 -0
- package/src/components/FilterSortBar/defaultIcons.ts +29 -0
- package/src/components/FilterSortBar/icons.tsx +237 -0
- package/src/components/FilterSortBar/index.ts +15 -0
- package/src/components/FilterSortBar/types.ts +79 -0
- package/src/components/PaymentSideBar/PaymentSideBarMobile.tsx +553 -526
- package/src/components/PaymentSideBar/types.ts +3 -0
- package/src/index.ts +18 -0
- package/src/ui/BottomSheet/BottomSheet.tsx +4 -1
- package/src/ui/PaymentCardMobile/PaymentCardMobile.tsx +982 -0
- package/src/ui/PaymentCardMobile/index.ts +1 -0
- package/src/ui/SlidingModal/SlidingModal.tsx +145 -0
- package/src/ui/SlidingModal/index.ts +2 -0
- package/dist/assets/images/anims/service_list/60_percent_anim.json +0 -1
- package/dist/components/PaymentOptions/PaymentOptionsDesktop.d.ts +0 -4
- package/dist/components/PaymentOptions/PaymentOptionsDesktop.js +0 -5
- package/dist/components/PaymentOptions/PaymentOptionsMobile.d.ts +0 -4
- package/dist/components/PaymentOptions/PaymentOptionsMobile.js +0 -5
- package/dist/components/PaymentOptions/ResponsivePaymentOptions.d.ts +0 -3
- package/dist/components/PaymentOptions/ResponsivePaymentOptions.js +0 -10
- package/dist/components/PaymentOptions/index.d.ts +0 -5
- package/dist/components/PaymentOptions/index.js +0 -4
- package/dist/components/PaymentOptions/mobileTypes.d.ts +0 -0
- package/dist/components/PaymentOptions/mobileTypes.js +0 -0
- package/dist/components/PaymentOptions/type.d.ts +0 -4
- package/dist/components/PaymentOptions/type.js +0 -1
- package/dist/components/ServiceItem/ExpandedDropdown.d.ts +0 -19
- package/dist/components/ServiceItem/ExpandedDropdown.js +0 -28
- package/dist/components/ServiceItem/ServiceItemDesktopPeru.d.ts +0 -6
- package/dist/components/ServiceItem/ServiceItemDesktopPeru.js +0 -612
- package/dist/ui/TopAmenities/PromoCountdown.d.ts +0 -18
- package/dist/ui/TopAmenities/PromoCountdown.js +0 -55
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import DateService from "../../utils/DateService";
|
|
3
|
-
import CommonService from "../../utils/CommonService";
|
|
4
|
-
import RatingHover from "./RatingHover";
|
|
5
|
-
import ModalEventManager from "../../utils/ModalEventManager";
|
|
6
|
-
import InternationalServicePopupBody from "../InternationalServicePopupBody";
|
|
7
|
-
import LottiePlayer from "../../assets/LottiePlayer";
|
|
8
|
-
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
9
|
-
function ServiceItemDesktopPeru({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, originIconStyle, showAvailableSeats, isSeatIcon, isTurbus, t = (key) => key, }) {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
11
|
-
console.log("🚀 ~ ServiceItemPB ~ isSeatIcon:", serviceItem);
|
|
12
|
-
const SvgAmenities = ({ moreAnemities, name, color, }) => {
|
|
13
|
-
var _a;
|
|
14
|
-
const amenityKey = (_a = name === null || name === void 0 ? void 0 : name.toLowerCase()) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, "_");
|
|
15
|
-
const getIconPath = () => {
|
|
16
|
-
const amenityFileName = `${amenityKey}.png`;
|
|
17
|
-
const imagePath = getAmenitiesImage(amenityFileName);
|
|
18
|
-
if (!imagePath) {
|
|
19
|
-
return `/public/images/amenities/${amenityKey}.svg`;
|
|
20
|
-
}
|
|
21
|
-
return imagePath;
|
|
22
|
-
};
|
|
23
|
-
const iconPath = getIconPath();
|
|
24
|
-
return (React.createElement("img", { src: iconPath, alt: name, style: {
|
|
25
|
-
filter: color === "white" ? "brightness(0) invert(1)" : "",
|
|
26
|
-
}, className: `object-contain ${moreAnemities ? "w-[16px] h-[16px]" : "w-[16px] h-[16px]"}` }));
|
|
27
|
-
};
|
|
28
|
-
const getAmenitiesImage = (name) => {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
30
|
-
switch (name) {
|
|
31
|
-
case "air_condtion.png": {
|
|
32
|
-
return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
|
|
33
|
-
}
|
|
34
|
-
case "baggage.png": {
|
|
35
|
-
return (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.baggageIcon;
|
|
36
|
-
}
|
|
37
|
-
case "charging_plug.png": {
|
|
38
|
-
return (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _c === void 0 ? void 0 : _c.chargingIcon;
|
|
39
|
-
}
|
|
40
|
-
case "coffee.png": {
|
|
41
|
-
return (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.coffeeIcon;
|
|
42
|
-
}
|
|
43
|
-
case "food_new_icon.png": {
|
|
44
|
-
return (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.foodIcon;
|
|
45
|
-
}
|
|
46
|
-
case "gaming.png": {
|
|
47
|
-
return (_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _f === void 0 ? void 0 : _f.gamingIcon;
|
|
48
|
-
}
|
|
49
|
-
case "handicap.png": {
|
|
50
|
-
return (_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _g === void 0 ? void 0 : _g.handicapIcon;
|
|
51
|
-
}
|
|
52
|
-
case "mobile_ticket.png": {
|
|
53
|
-
return (_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.mobileTicketIcon;
|
|
54
|
-
}
|
|
55
|
-
case "movie.png": {
|
|
56
|
-
return (_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.movieIcon;
|
|
57
|
-
}
|
|
58
|
-
case "restrooms.png": {
|
|
59
|
-
return (_k = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _k === void 0 ? void 0 : _k.restroomsIcon;
|
|
60
|
-
}
|
|
61
|
-
case "snacks_new.png": {
|
|
62
|
-
return (_l = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _l === void 0 ? void 0 : _l.snackIcon;
|
|
63
|
-
}
|
|
64
|
-
case "wifi.png": {
|
|
65
|
-
return (_m = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _m === void 0 ? void 0 : _m.wifiIcon;
|
|
66
|
-
}
|
|
67
|
-
case "cortina_divisoria.png": {
|
|
68
|
-
return (_o = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _o === void 0 ? void 0 : _o.cortinaIcon;
|
|
69
|
-
}
|
|
70
|
-
case "frazada.png": {
|
|
71
|
-
return (_p = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _p === void 0 ? void 0 : _p.frazaIcon;
|
|
72
|
-
}
|
|
73
|
-
case "blanket.png": {
|
|
74
|
-
return (_q = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _q === void 0 ? void 0 : _q.blankketIcon;
|
|
75
|
-
}
|
|
76
|
-
case "cctv.png": {
|
|
77
|
-
return (_r = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _r === void 0 ? void 0 : _r.cctvIcon;
|
|
78
|
-
}
|
|
79
|
-
case "cup_holder.png": {
|
|
80
|
-
return (_s = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _s === void 0 ? void 0 : _s.cupHolderIcon;
|
|
81
|
-
}
|
|
82
|
-
case "emergency_contact.png": {
|
|
83
|
-
return (_t = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _t === void 0 ? void 0 : _t.emergencyContactIcon;
|
|
84
|
-
}
|
|
85
|
-
case "emergency_exit.png": {
|
|
86
|
-
return (_u = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _u === void 0 ? void 0 : _u.emergencyExitIcon;
|
|
87
|
-
}
|
|
88
|
-
case "fire_extinguisher.png": {
|
|
89
|
-
return (_v = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _v === void 0 ? void 0 : _v.fireExtinguisherIcon;
|
|
90
|
-
}
|
|
91
|
-
case "reading_light.png": {
|
|
92
|
-
return (_w = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _w === void 0 ? void 0 : _w.readingLIghtIcon;
|
|
93
|
-
}
|
|
94
|
-
case "seat_belt.png": {
|
|
95
|
-
return (_x = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _x === void 0 ? void 0 : _x.sercurityBeltIcon;
|
|
96
|
-
}
|
|
97
|
-
case "service_on_board.png": {
|
|
98
|
-
return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
|
|
99
|
-
}
|
|
100
|
-
case "personal_tv.png": {
|
|
101
|
-
return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
|
|
102
|
-
}
|
|
103
|
-
case "pet_admission.png": {
|
|
104
|
-
return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
|
|
105
|
-
}
|
|
106
|
-
case "music.png": {
|
|
107
|
-
return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
|
|
108
|
-
}
|
|
109
|
-
default: {
|
|
110
|
-
return "";
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
const getAmenityName = (rawAmenity) => {
|
|
115
|
-
switch (rawAmenity) {
|
|
116
|
-
case "mobile ticket":
|
|
117
|
-
return "Ticket móvil";
|
|
118
|
-
case "charging plug":
|
|
119
|
-
return "Cargador";
|
|
120
|
-
case "wifi":
|
|
121
|
-
return "WiFi";
|
|
122
|
-
case "movie":
|
|
123
|
-
return "Entretenimiento";
|
|
124
|
-
case "baggage":
|
|
125
|
-
return "Equipaje";
|
|
126
|
-
case "Restrooms":
|
|
127
|
-
return "Baños";
|
|
128
|
-
case "air condtion":
|
|
129
|
-
return "Aire acondicionado";
|
|
130
|
-
case "snacks new":
|
|
131
|
-
return "Snacks";
|
|
132
|
-
case "coffee":
|
|
133
|
-
return "Café";
|
|
134
|
-
case "cortina divisoria":
|
|
135
|
-
return "Cortina Divisoria";
|
|
136
|
-
case "frazada":
|
|
137
|
-
return "Frazada";
|
|
138
|
-
case "blanket":
|
|
139
|
-
return "Mantas";
|
|
140
|
-
case "cctv":
|
|
141
|
-
return "Cámara de seguridad";
|
|
142
|
-
case "cup holder":
|
|
143
|
-
return "Portavasos";
|
|
144
|
-
case "emergency contact":
|
|
145
|
-
return "Contacto de emergencia";
|
|
146
|
-
case "emergency exit":
|
|
147
|
-
return "Salida de emergencia";
|
|
148
|
-
case "fire extinguisher":
|
|
149
|
-
return "Extintor de incendio";
|
|
150
|
-
case "reading light":
|
|
151
|
-
return "Luz de lectura";
|
|
152
|
-
case "seat belt":
|
|
153
|
-
return "Cinturón de seguridad";
|
|
154
|
-
case "service on board":
|
|
155
|
-
return "Servicio a bordo";
|
|
156
|
-
case "personal tv":
|
|
157
|
-
return "TV personal";
|
|
158
|
-
case "pet admission":
|
|
159
|
-
return "Admisión de mascotas";
|
|
160
|
-
case "music":
|
|
161
|
-
return "Música";
|
|
162
|
-
default:
|
|
163
|
-
return rawAmenity;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
const labelId = typeof serviceItem.boarding_stages === "string"
|
|
167
|
-
? serviceItem.boarding_stages.split("|")[0]
|
|
168
|
-
: "";
|
|
169
|
-
const showTopLabel = "";
|
|
170
|
-
// busStage &&
|
|
171
|
-
// busStage[labelId] &&
|
|
172
|
-
// busStage[labelId].split("|")[1] === "true" &&
|
|
173
|
-
// busStage[labelId].split("|")[0];
|
|
174
|
-
const showTopLabelTurbus = busStage && busStage[labelId] && busStage[labelId][1]
|
|
175
|
-
? busStage[labelId][0]
|
|
176
|
-
: null;
|
|
177
|
-
const hideBoardingTime = (serviceItemApiType) => {
|
|
178
|
-
var _a;
|
|
179
|
-
let exceptions = (_a = metaData === null || metaData === void 0 ? void 0 : metaData.sibus_stage_api_types) !== null && _a !== void 0 ? _a : [];
|
|
180
|
-
let found = false;
|
|
181
|
-
if (exceptions && exceptions.length) {
|
|
182
|
-
found = exceptions.includes(serviceItemApiType);
|
|
183
|
-
}
|
|
184
|
-
return found;
|
|
185
|
-
};
|
|
186
|
-
const renderStages = (stageData, direction = 1, terminals = null, hideTime = false) => {
|
|
187
|
-
if (typeof stageData === "string") {
|
|
188
|
-
const arr = direction === 1 ? stageData.split(",") : stageData.split(",");
|
|
189
|
-
const formattedStages = [];
|
|
190
|
-
for (let i = 0; i < arr.length; i++) {
|
|
191
|
-
let terminal = arr[i].split("||")[1];
|
|
192
|
-
let locationName = terminals[arr[i].split("||")[0].split("|")[0]] || "";
|
|
193
|
-
let time = arr[i].split("||")[0].split("|")[1];
|
|
194
|
-
if (direction !== 1 && i > 0) {
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
formattedStages.push(`${locationName} ${time}`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
const extractTiming = (location) => {
|
|
201
|
-
const timingIndex = location.lastIndexOf(" ") + 1;
|
|
202
|
-
return location.substring(timingIndex);
|
|
203
|
-
};
|
|
204
|
-
const compareTimings = (locationA, locationB) => {
|
|
205
|
-
const timingA = extractTiming(locationA);
|
|
206
|
-
const timingB = extractTiming(locationB);
|
|
207
|
-
return timingA.localeCompare(timingB);
|
|
208
|
-
};
|
|
209
|
-
const sortedStages = hideTime
|
|
210
|
-
? [...formattedStages].sort()
|
|
211
|
-
: [...formattedStages].sort(compareTimings);
|
|
212
|
-
return (React.createElement("div", { className: "flex flex-col space-y-3 text-justify gap-[4px]" }, sortedStages.map((item, key) => (React.createElement("div", { key: key, className: "font-normal", style: { fontWeight: 400 } }, hideTime
|
|
213
|
-
? item === null || item === void 0 ? void 0 : item.split("|")[0]
|
|
214
|
-
: item
|
|
215
|
-
.replace(/false/g, "")
|
|
216
|
-
.replace("true", "")
|
|
217
|
-
.replace("|", " |")
|
|
218
|
-
.replace("||", " |"))))));
|
|
219
|
-
}
|
|
220
|
-
return null;
|
|
221
|
-
};
|
|
222
|
-
let isSoldOut = serviceItem.available_seats <= 0;
|
|
223
|
-
const renderIcon = (iconKey, size = "14px") => {
|
|
224
|
-
var _a;
|
|
225
|
-
const iconValue = (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a[iconKey];
|
|
226
|
-
if (iconValue) {
|
|
227
|
-
if (typeof iconValue === "string") {
|
|
228
|
-
return (React.createElement("img", { src: iconValue, alt: iconKey, className: `${`w-[${size}] h-[${size}]`} mr-[5px]` }));
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return null;
|
|
232
|
-
};
|
|
233
|
-
const getAllSeatTypes = () => {
|
|
234
|
-
var _a;
|
|
235
|
-
if (!((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
236
|
-
return [{ label: "Salon cama", price: 0 }];
|
|
237
|
-
}
|
|
238
|
-
let seatTypesWithPrices = serviceItem.seat_types
|
|
239
|
-
.filter((item) => getFilteredSeats(item))
|
|
240
|
-
.map((val) => ({
|
|
241
|
-
label: val === null || val === void 0 ? void 0 : val.label,
|
|
242
|
-
price: val === null || val === void 0 ? void 0 : val.fare,
|
|
243
|
-
}));
|
|
244
|
-
seatTypesWithPrices.sort((a, b) => a.price - b.price);
|
|
245
|
-
return seatTypesWithPrices;
|
|
246
|
-
};
|
|
247
|
-
const getSortedSeatTypes = () => {
|
|
248
|
-
var _a;
|
|
249
|
-
if (!((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
250
|
-
return [{ label: "Salon cama", price: 0 }];
|
|
251
|
-
}
|
|
252
|
-
let seatTypesWithPrices = getAllSeatTypes();
|
|
253
|
-
const premiumIndex = seatTypesWithPrices.findIndex((item) => item.label === "Premium");
|
|
254
|
-
if (premiumIndex >= 3) {
|
|
255
|
-
seatTypesWithPrices[2] = seatTypesWithPrices[premiumIndex];
|
|
256
|
-
}
|
|
257
|
-
seatTypesWithPrices = seatTypesWithPrices.slice(0, 2);
|
|
258
|
-
return seatTypesWithPrices;
|
|
259
|
-
};
|
|
260
|
-
const getUniqueSeats = () => {
|
|
261
|
-
const allSeatTypes = getAllSeatTypes();
|
|
262
|
-
const seatMap = new Map();
|
|
263
|
-
allSeatTypes.forEach((seat) => {
|
|
264
|
-
if (SEAT_EXCEPTIONS.includes(seat.label))
|
|
265
|
-
return;
|
|
266
|
-
// Only check if the label already exists in the map, don't compare prices
|
|
267
|
-
if (!seatMap.has(seat.label)) {
|
|
268
|
-
seatMap.set(seat.label, seat);
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
return Array.from(seatMap.values());
|
|
272
|
-
};
|
|
273
|
-
const getNumberOfSeats = () => {
|
|
274
|
-
return serviceItem.seat_types.filter((val) => !SEAT_EXCEPTIONS.includes(val.label)).length;
|
|
275
|
-
};
|
|
276
|
-
const getSeatTypeIcon = (seatLabel) => {
|
|
277
|
-
var _a, _b, _c, _d;
|
|
278
|
-
// Default icons
|
|
279
|
-
if (seatLabel.includes("180°"))
|
|
280
|
-
return (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.seat180Icon;
|
|
281
|
-
if (seatLabel.includes("160°"))
|
|
282
|
-
return (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.seat160Icon;
|
|
283
|
-
if (seatLabel.includes("140°"))
|
|
284
|
-
return (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.seat140Icon;
|
|
285
|
-
return (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.seatFallBackIcon;
|
|
286
|
-
};
|
|
287
|
-
const getSeatNames = () => {
|
|
288
|
-
const uniqueSeats = getUniqueSeats();
|
|
289
|
-
const sortedSeatTypes = getSortedSeatTypes();
|
|
290
|
-
if (removeDuplicateSeats) {
|
|
291
|
-
return uniqueSeats.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
|
|
292
|
-
isSeatIcon && (React.createElement("img", { src: getSeatTypeIcon(val.label), alt: val.label, className: "w-[18px] h-[18px] mr-[6px]" })),
|
|
293
|
-
typeof val.label === "string" || typeof val.label === "number"
|
|
294
|
-
? val.label
|
|
295
|
-
: null)));
|
|
296
|
-
}
|
|
297
|
-
return sortedSeatTypes.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
|
|
298
|
-
isSeatIcon && (React.createElement("img", { src: getSeatTypeIcon(val.label), alt: val.label, className: "w-[18px] h-[18px] mr-[6px]" })),
|
|
299
|
-
typeof val.label === "string" || typeof val.label === "number"
|
|
300
|
-
? val.label
|
|
301
|
-
: null)));
|
|
302
|
-
};
|
|
303
|
-
const getSeatPrice = () => {
|
|
304
|
-
const sortedSeatTypes = getSortedSeatTypes();
|
|
305
|
-
const uniqueSeats = getUniqueSeats();
|
|
306
|
-
if (removeDuplicateSeats) {
|
|
307
|
-
return uniqueSeats.map((val, key) => (React.createElement("span", { key: key }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0
|
|
308
|
-
? CommonService.currency(0, currencySign)
|
|
309
|
-
: CommonService.currency(val.price, currencySign))));
|
|
310
|
-
}
|
|
311
|
-
return sortedSeatTypes.map((val, key) => {
|
|
312
|
-
return SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: "flex items-center text-[13.33px] bold-text" }, typeof val.price === "string"
|
|
313
|
-
? (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0
|
|
314
|
-
? CommonService.currency(0, currencySign)
|
|
315
|
-
: CommonService.currency(val.price, currencySign)
|
|
316
|
-
: typeof val.price === "number"
|
|
317
|
-
? (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0
|
|
318
|
-
? CommonService.currency(0, currencySign)
|
|
319
|
-
: CommonService.currency(val.price, currencySign)
|
|
320
|
-
: null));
|
|
321
|
-
});
|
|
322
|
-
};
|
|
323
|
-
const getFilteredSeats = (item) => {
|
|
324
|
-
return item;
|
|
325
|
-
};
|
|
326
|
-
const checkMidnight = () => {
|
|
327
|
-
var _a, _b;
|
|
328
|
-
if ((cityOrigin === null || cityOrigin === void 0 ? void 0 : cityOrigin.label) &&
|
|
329
|
-
(cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.label) &&
|
|
330
|
-
((cityOrigin.label.toLowerCase().includes("argentina") &&
|
|
331
|
-
!cityDestination.label.toLowerCase().includes("argentina")) ||
|
|
332
|
-
(!cityOrigin.label.toLowerCase().includes("argentina") &&
|
|
333
|
-
cityDestination.label.toLowerCase().includes("argentina")))) {
|
|
334
|
-
ModalEventManager.showPopup({
|
|
335
|
-
modalIcon: (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.warningIcon,
|
|
336
|
-
title: translation === null || translation === void 0 ? void 0 : translation.title,
|
|
337
|
-
showPrimaryButton: false,
|
|
338
|
-
primaryButtonText: translation === null || translation === void 0 ? void 0 : translation.continueButton,
|
|
339
|
-
onSecondaryButtonClick: () => {
|
|
340
|
-
onBookButtonPress && onBookButtonPress();
|
|
341
|
-
},
|
|
342
|
-
secondaryButtonText: translation === null || translation === void 0 ? void 0 : translation.okContinueButton,
|
|
343
|
-
primaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.kuposButtonColor,
|
|
344
|
-
primaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.primaryButtonTextColor,
|
|
345
|
-
secondaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.secondaryBgColor,
|
|
346
|
-
secondaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
|
|
347
|
-
children: React.createElement(InternationalServicePopupBody, null),
|
|
348
|
-
});
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
if (serviceItem.dep_validation_text) {
|
|
352
|
-
ModalEventManager.showPopup({
|
|
353
|
-
body: serviceItem.dep_validation_text,
|
|
354
|
-
primaryButtonText: translation === null || translation === void 0 ? void 0 : translation.continueButton,
|
|
355
|
-
secondaryButtonText: translation === null || translation === void 0 ? void 0 : translation.chooseAnotherTripButton,
|
|
356
|
-
onPrimaryButtonClick: () => {
|
|
357
|
-
onBookButtonPress && onBookButtonPress();
|
|
358
|
-
},
|
|
359
|
-
primaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.kuposButtonColor,
|
|
360
|
-
primaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.primaryButtonTextColor,
|
|
361
|
-
secondaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.secondaryBgColor,
|
|
362
|
-
secondaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
|
|
363
|
-
});
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
if (serviceItem.operator_service_name === "Classe Reale " &&
|
|
367
|
-
cityOrigin.label.toLowerCase() === "santiago,chile" &&
|
|
368
|
-
cityDestination.label.toLowerCase() === "portillo,chile") {
|
|
369
|
-
ModalEventManager.showPopup({
|
|
370
|
-
modalIcon: (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.warningIcon,
|
|
371
|
-
title: translation === null || translation === void 0 ? void 0 : translation.title,
|
|
372
|
-
primaryButtonText: translation === null || translation === void 0 ? void 0 : translation.okContinueButton,
|
|
373
|
-
secondaryButtonText: translation === null || translation === void 0 ? void 0 : translation.chooseAnotherTripButton,
|
|
374
|
-
onPrimaryButtonClick: () => {
|
|
375
|
-
onBookButtonPress && onBookButtonPress();
|
|
376
|
-
},
|
|
377
|
-
showSecondaryButton: false,
|
|
378
|
-
primaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.kuposButtonColor,
|
|
379
|
-
primaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.primaryButtonTextColor,
|
|
380
|
-
children: (React.createElement(React.Fragment, null,
|
|
381
|
-
React.createElement("p", { className: "mt-[5px] text-justify" },
|
|
382
|
-
translation.classeNormalText,
|
|
383
|
-
React.createElement("span", { className: "bold-text" },
|
|
384
|
-
"\u00A0",
|
|
385
|
-
translation.classeBoldText),
|
|
386
|
-
translation.classeNormalText1),
|
|
387
|
-
React.createElement("p", { className: "mt-[10px] text-justify" },
|
|
388
|
-
translation.classeNormalText2,
|
|
389
|
-
"\u00A0",
|
|
390
|
-
React.createElement("span", { className: "bold-text" },
|
|
391
|
-
"\u00A0",
|
|
392
|
-
translation.classeBoldText1),
|
|
393
|
-
" ",
|
|
394
|
-
translation.classeNormalText3))),
|
|
395
|
-
});
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
onBookButtonPressHandler();
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
const onBookButtonPressHandler = () => {
|
|
403
|
-
onBookButtonPress();
|
|
404
|
-
};
|
|
405
|
-
return (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
|
|
406
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
|
|
407
|
-
showTopLabel
|
|
408
|
-
? "mt-[24px]"
|
|
409
|
-
: "mt-[14px]"} ` },
|
|
410
|
-
React.createElement("div", { className: "bg-white rounded-[20px] shadow-service mx-auto relative" },
|
|
411
|
-
React.createElement("div", { className: "p-[15px] pt-[20px]" },
|
|
412
|
-
React.createElement("div", { className: "grid text-[#464647] w-full [grid-template-columns:14%_32%_0.5%_24%_13.5%] gap-x-[4%] items-center", style: { marginTop: showTopLabel ? "8px" : "" } },
|
|
413
|
-
React.createElement("div", { className: "flex items-center justify-center m-[auto]" },
|
|
414
|
-
React.createElement("div", { className: " " },
|
|
415
|
-
React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: ` h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
|
|
416
|
-
isCiva ? (React.createElement("div", { className: "text-[13.33px] black-text ml-2" }, serviceItem.operator_details[2])) : null),
|
|
417
|
-
React.createElement("div", { className: `min-h-[2.5rem] grid grid-cols-[26px_auto_26%_1fr] gap-x-4 items-center text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: {
|
|
418
|
-
// gridTemplateRows: isCiva ? "1fr" : "1fr 1fr",
|
|
419
|
-
gridTemplateRows: "1fr",
|
|
420
|
-
// gap: isCiva ? "0" : "10px 16px"
|
|
421
|
-
} },
|
|
422
|
-
React.createElement("div", { className: "flex flex-col gap-[10px]" },
|
|
423
|
-
orignLabel ? (React.createElement("div", { className: "w-[60px] h-[20px] flex items-center mr-[50px]" }, orignLabel)) : (React.createElement("div", { className: "h-[20px] flex items-center" },
|
|
424
|
-
React.createElement("img", { src: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, alt: "origin", className: `w-[18px] h-auto mr-[8px] ${isSoldOut ? "grayscale" : ""}` }))),
|
|
425
|
-
!isCiva &&
|
|
426
|
-
(destinationLabel ? (React.createElement("div", { className: "w-[60px] h-[20px] flex items-center" }, destinationLabel)) : (React.createElement("div", { className: "h-[20px] flex items-center" },
|
|
427
|
-
React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, className: `w-[18px] h-auto mr-[8px] ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }))))),
|
|
428
|
-
React.createElement("div", { className: "flex flex-col gap-[10px]" },
|
|
429
|
-
React.createElement("div", { className: "h-[20px] flex items-center group relative" },
|
|
430
|
-
React.createElement("span", { className: "cursor-pointer bold-text capitalize" }, DateService.getServiceItemDate(serviceItem.travel_date)),
|
|
431
|
-
serviceItem.boarding_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
|
|
432
|
-
React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: { borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
|
|
433
|
-
React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.boarding_stages, 1, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType))))))),
|
|
434
|
-
!isCiva && (React.createElement("div", { className: "h-[20px] flex items-center group relative" },
|
|
435
|
-
React.createElement("span", { className: "cursor-pointer bold-text capitalize" }, DateService.getServiceItemDate(serviceItem.arrival_date)),
|
|
436
|
-
serviceItem.dropoff_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
|
|
437
|
-
React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: {
|
|
438
|
-
borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor,
|
|
439
|
-
} }),
|
|
440
|
-
React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.dropoff_stages, 2, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType))))))))),
|
|
441
|
-
React.createElement("div", { className: "flex flex-col gap-[10px] items-center" },
|
|
442
|
-
React.createElement("div", { className: "h-[20px] flex items-center justify-center" },
|
|
443
|
-
React.createElement("div", null, "\u2022")),
|
|
444
|
-
!isCiva && (React.createElement("div", { className: "h-[20px] flex items-center justify-center" }, removeArrivalTime ? null : serviceItem.arr_time ? (React.createElement("div", null, "\u2022")) : null))),
|
|
445
|
-
React.createElement("div", { className: "flex flex-col gap-[10px]" },
|
|
446
|
-
React.createElement("div", { className: "h-[20px] flex items-center group relative" },
|
|
447
|
-
React.createElement("div", { className: "font-[900] bold-text" }, DateService.formatTime(serviceItem.dep_time)),
|
|
448
|
-
serviceItem.boarding_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
|
|
449
|
-
React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: { borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
|
|
450
|
-
React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.boarding_stages, 1, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType))))))),
|
|
451
|
-
!isCiva && (React.createElement("div", { className: "h-[20px] flex items-center group relative" },
|
|
452
|
-
React.createElement("div", { className: "font-[900] bold-text" }, removeArrivalTime
|
|
453
|
-
? null
|
|
454
|
-
: serviceItem.arr_time
|
|
455
|
-
? DateService.formatTime(serviceItem.arr_time)
|
|
456
|
-
: null),
|
|
457
|
-
serviceItem.dropoff_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
|
|
458
|
-
React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: {
|
|
459
|
-
borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor,
|
|
460
|
-
} }),
|
|
461
|
-
React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.dropoff_stages, 2, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType)))))))))),
|
|
462
|
-
React.createElement("div", { style: {
|
|
463
|
-
width: "1px",
|
|
464
|
-
height: "2.5rem",
|
|
465
|
-
backgroundColor: "#ccc",
|
|
466
|
-
margin: "auto",
|
|
467
|
-
} }),
|
|
468
|
-
React.createElement("div", { className: "content-center" },
|
|
469
|
-
React.createElement("div", { className: `relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.5rem] ${getNumberOfSeats() < 3 ? "" : ""}`, style: getNumberOfSeats() < 2 ? { alignItems: "center" } : {} },
|
|
470
|
-
React.createElement("div", { className: "flex flex-col justify-between" }, getSeatNames()),
|
|
471
|
-
React.createElement("div", { className: "flex flex-col justify-between absolute inset-y-0 right-0 left-1/2 h-full", style: {
|
|
472
|
-
color: isSoldOut ? "#c0c0c0" : colors.priceColor,
|
|
473
|
-
top: 0,
|
|
474
|
-
bottom: 0,
|
|
475
|
-
left: "68%",
|
|
476
|
-
right: 0,
|
|
477
|
-
justifyContent: getNumberOfSeats() < 2 ? "center" : "",
|
|
478
|
-
} }, getSeatPrice()))),
|
|
479
|
-
React.createElement("div", null,
|
|
480
|
-
React.createElement("button", { onClick: () => (!isSoldOut ? checkMidnight() : null), disabled: serviceDetailsLoading, className: `w-full ${serviceDetailsLoading || isSoldOut ? "py-[12px]" : "py-[12px]"} text-[13.33px] font-bold text-white rounded-[10px] border-none px-[20px] flex items-center justify-center`, style: {
|
|
481
|
-
backgroundColor: serviceDetailsLoading || isSoldOut
|
|
482
|
-
? "lightgray"
|
|
483
|
-
: colors.kuposButtonColor,
|
|
484
|
-
cursor: serviceDetailsLoading || isSoldOut
|
|
485
|
-
? "not-allowed"
|
|
486
|
-
: "pointer",
|
|
487
|
-
} },
|
|
488
|
-
React.createElement("span", { className: "min-w-[75px] flex justify-center items-center bold-text uppercase" },
|
|
489
|
-
isSoldOut ? renderIcon("soldOutIcon", "14px") : null,
|
|
490
|
-
serviceDetailsLoading ? (React.createElement("span", { className: "loader-circle" })) : !isSoldOut ? (translation === null || translation === void 0 ? void 0 : translation.buyButton) : (translation === null || translation === void 0 ? void 0 : translation.soldOutButton))))),
|
|
491
|
-
showLastSeats ? (React.createElement("div", { className: "flex justify-end mr-[11px]" }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
492
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[12px] text-[red] mt-1 text-center" }, "\u00A1 \u00DAltimos Asientos!")))) : null,
|
|
493
|
-
React.createElement("div", { className: `${"flex justify-between items-center mt-[15px] items-center border-t border-[#eee] mt-[15px] pt-[10px]"}` },
|
|
494
|
-
showAvailableSeats ? (React.createElement("div", { className: "text-[#464647] text-[13.33px]" }, serviceItem === null || serviceItem === void 0 ? void 0 :
|
|
495
|
-
serviceItem.available_seats,
|
|
496
|
-
" ",
|
|
497
|
-
"Asientos restantes")) : (React.createElement("div", { className: "flex items-center " },
|
|
498
|
-
React.createElement("div", { className: `flex items-center ${isSoldOut ? "grayscale" : ""} ${showRating ? "cursor-pointer" : ""}`, style: { color: isSoldOut ? "#c0c0c0" : "" } },
|
|
499
|
-
showRating ? (React.createElement(RatingHover, { serviceItem: serviceItem, isSoldOut: isSoldOut, colors: colors, t: t, translation: translation })) : null,
|
|
500
|
-
React.createElement("span", { className: "ml-[10px] text-[#464647] text-[13.33px]", style: { marginLeft: showRating ? "10px" : "0" } }, serviceItem.operator_details[2])))),
|
|
501
|
-
serviceItem.duration && (React.createElement("div", { className: "flex items-baseline relative text-[#464647]" },
|
|
502
|
-
React.createElement("div", { className: `w-[18px] h-auto mr-[4px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("hours", "14px")),
|
|
503
|
-
React.createElement("div", { className: `cursor-default group text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
|
|
504
|
-
serviceItem.duration,
|
|
505
|
-
" ",
|
|
506
|
-
translation.hours,
|
|
507
|
-
React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[188px] text-center break-normal shadow-service text-[12px]", style: { backgroundColor: colors.tooltipColor } },
|
|
508
|
-
React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: colors.tooltipColor } }),
|
|
509
|
-
"Duraci\u00F3n estimada del viaje")))),
|
|
510
|
-
serviceItem.pet_seat_info &&
|
|
511
|
-
Object.keys(serviceItem.pet_seat_info).length > 0 ? (React.createElement("div", { className: "flex items-center text-[13.33px]" },
|
|
512
|
-
React.createElement("div", { className: `relative group cursor-default ` },
|
|
513
|
-
React.createElement("div", { className: "flex items-center" },
|
|
514
|
-
React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
|
|
515
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.petFriendlyAnim, width: "20px", height: "20px" })),
|
|
516
|
-
React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647]" },
|
|
517
|
-
React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly))),
|
|
518
|
-
React.createElement("div", { className: " hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[230px] text-center break-normal shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
|
|
519
|
-
React.createElement("div", { className: "tooltip-arrow absolute text-[13.33px] -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
|
|
520
|
-
"Este servicio incluye asientos para mascotas.")))) : null,
|
|
521
|
-
serviceItem.is_change_ticket && (React.createElement("div", { className: "flex items-center" },
|
|
522
|
-
React.createElement("div", { className: "relative group cursor-default" },
|
|
523
|
-
React.createElement("div", { className: "flex items-center" },
|
|
524
|
-
React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
|
|
525
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.flexibleAnim, width: "20px", height: "20px" })),
|
|
526
|
-
React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647]" },
|
|
527
|
-
React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.flexible))),
|
|
528
|
-
React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[230px] text-center break-normal shadow-service text-[12px]", style: {
|
|
529
|
-
backgroundColor: colors.tooltipColor,
|
|
530
|
-
lineHeight: "1.5",
|
|
531
|
-
} },
|
|
532
|
-
React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent ", style: { borderBottomColor: colors.tooltipColor } }),
|
|
533
|
-
"Esta empresa permite cambios sin costo hasta (", (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.change_ticket_hours) !== null && _c !== void 0 ? _c : 6,
|
|
534
|
-
") horas antes del viaje.")))),
|
|
535
|
-
React.createElement("div", { className: "flex items-center" },
|
|
536
|
-
React.createElement("div", null, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: "flex items-center mr-[10px]" },
|
|
537
|
-
React.createElement("div", { className: `h-auto mr-[4px] text-[13px] text-[#464647] ${isSoldOut ? "grayscale" : ""}` },
|
|
538
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.locationAnim, width: "20px", height: "20px" }))))),
|
|
539
|
-
React.createElement("div", null, metaData && serviceItem.operator_details[4] && (React.createElement("div", { className: "flex items-center gap-[6px]" },
|
|
540
|
-
(((_d = serviceItem.operator_details[3]) === null || _d === void 0 ? void 0 : _d.includes("18"))
|
|
541
|
-
? [...serviceItem.operator_details[4], "18"]
|
|
542
|
-
: serviceItem.operator_details[4]).map((val, key) => {
|
|
543
|
-
var _a, _b, _c, _d;
|
|
544
|
-
return (key < 3 &&
|
|
545
|
-
((_b = (_a = metaData === null || metaData === void 0 ? void 0 : metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== "WATER") ||
|
|
546
|
-
val === "18" ? (React.createElement("div", { key: key, className: "relative mr-2 cursor-pointer" },
|
|
547
|
-
React.createElement("div", { className: "group" },
|
|
548
|
-
React.createElement("div", { className: `${isSoldOut ? "grayscale" : ""}` },
|
|
549
|
-
React.createElement(SvgAmenities, { moreAnemities: false, name: (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0].toLowerCase() })),
|
|
550
|
-
React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-nowrap mt-2.5 text-center shadow-service text-[13.33px]", style: {
|
|
551
|
-
backgroundColor: colors.tooltipColor,
|
|
552
|
-
zIndex: 21,
|
|
553
|
-
} },
|
|
554
|
-
React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: {
|
|
555
|
-
borderBottomColor: colors.tooltipColor,
|
|
556
|
-
} }),
|
|
557
|
-
getAmenityName((_d = metaData.amenities[val]) === null || _d === void 0 ? void 0 : _d.split(".")[0].split("_").join(" ")))))) : null;
|
|
558
|
-
}),
|
|
559
|
-
((_e = serviceItem.operator_details[4]) === null || _e === void 0 ? void 0 : _e.length) > 3 && (React.createElement("div", { className: "relative ml-1 cursor-pointer" },
|
|
560
|
-
React.createElement("div", { className: "w-[16px] h-[16px] bg-gray-200 rounded-full flex justify-center text-sm font-bold group", style: { alignItems: "flex-end", marginTop: "3px" } },
|
|
561
|
-
React.createElement("img", { src: ((_f = serviceItem.icons) === null || _f === void 0 ? void 0 : _f.plus) ||
|
|
562
|
-
"/images/icons/amenities/icon_plus.svg", className: "w-[16px] h-[16px]", alt: "plus" }),
|
|
563
|
-
React.createElement("div", { className: "hidden group-hover:block absolute -top-[13px] left-[40px] z-20 pl-[10px]" },
|
|
564
|
-
React.createElement("div", { className: "flex flex-col gap-[10px] p-3 rounded-[8px] shadow-md animate-fadeIn relative", style: { backgroundColor: colors.tooltipColor } },
|
|
565
|
-
metaData &&
|
|
566
|
-
((_g = serviceItem.operator_details[4]) === null || _g === void 0 ? void 0 : _g.map((val, key) => {
|
|
567
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
568
|
-
const exceptions = [
|
|
569
|
-
1, 2, 5, 7, 8, 9, 12, 13, 14, 15,
|
|
570
|
-
];
|
|
571
|
-
return exceptions.includes(key) ? null : key >= 3 &&
|
|
572
|
-
((_b = (_a = metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== "WATER" ? (React.createElement("div", { key: key, className: "flex items-center gap-[5px] whitespace-nowrap text-[13.33px]" },
|
|
573
|
-
React.createElement("div", { className: `${isSoldOut ? "grayscale" : ""}` },
|
|
574
|
-
React.createElement(SvgAmenities, { moreAnemities: true, name: (_d = (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase(), color: "white" })),
|
|
575
|
-
React.createElement("span", { className: "text-white text-xs" }, getAmenityName((_g = (_f = (_e = metaData.amenities[val]) === null || _e === void 0 ? void 0 : _e.split(".")[0]) === null || _f === void 0 ? void 0 : _f.split("_")) === null || _g === void 0 ? void 0 : _g.join(" "))))) : null;
|
|
576
|
-
})),
|
|
577
|
-
React.createElement("div", { className: "tooltip-arrow absolute -left-[6px] top-[15px] w-0 h-0 border-t-8 border-b-8 border-r-8 border-t-transparent border-b-transparent ", style: {
|
|
578
|
-
borderRightColor: colors.tooltipColor,
|
|
579
|
-
} }))))))))))))),
|
|
580
|
-
children,
|
|
581
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && (React.createElement("div", { className: ` text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[36px] pt-[50px] -z-10 rounded-b-[14px] text-[14px]`, style: {
|
|
582
|
-
backgroundColor: isSoldOut
|
|
583
|
-
? colors === null || colors === void 0 ? void 0 : colors.bottomStripColor
|
|
584
|
-
: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
|
|
585
|
-
opacity: isSoldOut ? 0.5 : 1,
|
|
586
|
-
} },
|
|
587
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
|
|
588
|
-
React.createElement("span", { className: "ml-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
|
|
589
|
-
React.createElement("div", { className: "absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 " },
|
|
590
|
-
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
|
|
591
|
-
backgroundColor: isSoldOut ? "#ddd" : colors.ratingBottomColor,
|
|
592
|
-
} },
|
|
593
|
-
React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
|
|
594
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.priorityStageAnim, width: "14px", height: "14px" })),
|
|
595
|
-
React.createElement("div", { className: isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]` }, showTopLabel))),
|
|
596
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] text-white px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
|
|
597
|
-
backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
|
|
598
|
-
} },
|
|
599
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.connectingServiceIcon, width: "14px", height: "14px" }),
|
|
600
|
-
React.createElement("div", null, "Conexión"))),
|
|
601
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] text-white px-[14px] rounded-[38px] text-[12.5px] z-20 `, style: {
|
|
602
|
-
backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
|
|
603
|
-
} },
|
|
604
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "14px", height: "14px" }),
|
|
605
|
-
React.createElement("div", null, translation === null || translation === void 0 ? void 0 : translation.directService))),
|
|
606
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] text-white px-[14px] rounded-[38px] text-[12.5px] z-20 `, style: {
|
|
607
|
-
backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
|
|
608
|
-
} },
|
|
609
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "14px", height: "14px" }),
|
|
610
|
-
React.createElement("div", null, "Tren Express"))))));
|
|
611
|
-
}
|
|
612
|
-
export default ServiceItemDesktopPeru;
|