kupos-ui-components-lib 9.3.2 → 9.3.3
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/anims/service_list/60_percent_anim.json +1 -0
- package/dist/components/ServiceItem/ServiceItemDesktop.js +18 -84
- package/dist/components/ServiceItem/ServiceItemMobile.js +27 -97
- package/dist/components/ServiceItem/types.d.ts +2 -0
- package/dist/styles.css +37 -0
- package/dist/ui/SeatSection/SeatSection.js +17 -2
- package/dist/ui/ServiceBadges/ServiceBadges.d.ts +17 -0
- package/dist/ui/ServiceBadges/ServiceBadges.js +33 -0
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +2 -2
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/SeatSectionMobile.js +8 -4
- package/dist/ui/mobileweb/ServiceBadgesMobile.d.ts +17 -0
- package/dist/ui/mobileweb/ServiceBadgesMobile.js +35 -0
- package/dist/utils/CommonService.d.ts +7 -0
- package/dist/utils/CommonService.js +61 -0
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +35 -131
- package/src/components/ServiceItem/ServiceItemMobile.tsx +57 -165
- package/src/components/ServiceItem/types.ts +2 -0
- package/src/styles.css +10 -0
- package/src/ui/SeatSection/SeatSection.tsx +24 -2
- package/src/ui/ServiceBadges/ServiceBadges.tsx +92 -0
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +3 -0
- package/src/ui/mobileweb/SeatSectionMobile.tsx +12 -3
- package/src/ui/mobileweb/ServiceBadgesMobile.tsx +92 -0
- package/src/utils/CommonService.ts +86 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"nm":"Main Scene","h":100,"w":100,"meta":{"g":"@lottiefiles/creator@1.89.0"},"layers":[{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":150,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[37,9]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100],"t":1},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[109,109],"t":48},{"s":[100,100],"t":89}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[50,50]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","nm":"Group 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.51,0.27],[0.31,0.46],[0.14,0.56],[0,0.59],[-0.31,0.79],[-0.58,0.44],[-0.83,0],[-0.49,-0.27],[-0.26,-0.44],[-0.05,-0.49],[0,0],[0.25,0.2],[0.39,0],[0.27,-0.23],[0.15,-0.45],[0.02,-0.66],[0,-0.02],[0,-0.01],[-0.24,0.18],[-0.3,0.1],[-0.32,0],[-0.47,-0.26],[-0.28,-0.49],[0,-0.65],[0.3,-0.51],[0.52,-0.3],[0.67,0]],"o":[[-0.75,0],[-0.51,-0.28],[-0.31,-0.46],[-0.13,-0.57],[0,-1.1],[0.31,-0.8],[0.59,-0.44],[0.71,0],[0.49,0.27],[0.26,0.44],[0,0],[-0.07,-0.37],[-0.24,-0.21],[-0.37,0],[-0.27,0.22],[-0.15,0.45],[0,0.01],[0,0.02],[0.14,-0.24],[0.24,-0.18],[0.3,-0.1],[0.54,0],[0.47,0.25],[0.29,0.48],[0,0.61],[-0.29,0.5],[-0.51,0.3],[0,0]],"v":[[10.74,14.17],[8.85,13.76],[7.61,12.66],[6.94,11.13],[6.75,9.39],[7.21,6.55],[8.54,4.69],[10.67,4.03],[12.46,4.44],[13.58,5.5],[14.04,6.9],[12.08,6.9],[11.6,6.05],[10.65,5.74],[9.69,6.09],[9.06,7.1],[8.8,8.76],[8.8,8.81],[8.8,8.85],[9.38,8.22],[10.19,7.8],[11.11,7.64],[12.63,8.04],[13.75,9.14],[14.18,10.84],[13.73,12.52],[12.51,13.72],[10.74,14.17]]}}},{"ty":"sh","nm":"Path 2","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.23,0.12],[-0.13,0.22],[0,0.28],[0.14,0.21],[0.24,0.12],[0.31,0],[0.23,-0.12],[0.14,-0.22],[0,-0.29],[-0.14,-0.23],[-0.23,-0.13],[-0.31,0]],"o":[[0.3,0],[0.23,-0.13],[0.14,-0.22],[0,-0.31],[-0.13,-0.22],[-0.23,-0.13],[-0.3,0],[-0.23,0.12],[-0.14,0.22],[0,0.29],[0.14,0.22],[0.24,0.12],[0,0]],"v":[[10.62,12.38],[11.42,12.19],[11.97,11.66],[12.18,10.91],[11.97,10.12],[11.41,9.6],[10.6,9.41],[9.8,9.59],[9.24,10.11],[9.03,10.88],[9.24,11.66],[9.8,12.19],[10.62,12.38]]}}},{"ty":"sh","nm":"Path 3","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.64,0.43],[0.35,0.76],[0,1],[-0.35,0.76],[-0.64,0.43],[-0.91,0],[-0.64,-0.43],[-0.35,-0.77],[0,-1],[0.35,-0.77],[0.64,-0.43],[0.91,0]],"o":[[-0.91,0],[-0.64,-0.43],[-0.35,-0.77],[0,-1],[0.35,-0.77],[0.64,-0.43],[0.91,0],[0.64,0.43],[0.35,0.76],[0,1],[-0.35,0.76],[-0.64,0.43],[0,0]],"v":[[19.93,14.17],[17.61,13.52],[16.11,11.75],[15.59,9.1],[16.11,6.47],[17.61,4.68],[19.93,4.03],[22.25,4.68],[23.74,6.47],[24.27,9.1],[23.74,11.75],[22.25,13.52],[19.93,14.17]]}}},{"ty":"sh","nm":"Path 4","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.33,0.26],[-0.18,0.47],[0,0.65],[0.19,0.47],[0.34,0.25],[0.44,0],[0.34,-0.26],[0.19,-0.48],[0,-0.65],[-0.18,-0.48],[-0.33,-0.26],[-0.44,0]],"o":[[0.44,0],[0.34,-0.26],[0.19,-0.48],[0,-0.65],[-0.18,-0.48],[-0.33,-0.26],[-0.44,0],[-0.33,0.25],[-0.18,0.47],[0,0.65],[0.19,0.47],[0.34,0.26],[0,0]],"v":[[19.93,12.28],[21.08,11.89],[21.85,10.79],[22.13,9.1],[21.85,7.42],[21.08,6.33],[19.93,5.94],[18.77,6.33],[18,7.42],[17.73,9.1],[18,10.79],[18.77,11.89],[19.93,12.28]]}}},{"ty":"sh","nm":"Path 5","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[27.69,14],[33.13,4.2],[35.18,4.2],[29.73,14],[27.69,14]]}}},{"ty":"sh","nm":"Path 6","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.38,0.21],[0.22,0.38],[0,0.52],[-0.22,0.37],[-0.37,0.21],[-0.46,0],[-0.37,-0.21],[-0.21,-0.38],[0,-0.54],[0.22,-0.38],[0.37,-0.21],[0.47,0]],"o":[[-0.47,0],[-0.37,-0.21],[-0.22,-0.38],[0,-0.54],[0.22,-0.38],[0.38,-0.21],[0.48,0],[0.37,0.21],[0.22,0.37],[0,0.52],[-0.22,0.38],[-0.36,0.21],[0,0]],"v":[[34.94,14.17],[33.66,13.86],[32.77,12.98],[32.43,11.62],[32.77,10.25],[33.66,9.37],[34.92,9.06],[36.2,9.37],[37.08,10.25],[37.42,11.62],[37.08,12.98],[36.18,13.86],[34.94,14.17]]}}},{"ty":"sh","nm":"Path 7","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.13,0.08],[-0.07,0.17],[0,0.24],[0.07,0.17],[0.13,0.08],[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.25],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0]],"o":[[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.26],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0],[-0.13,0.08],[-0.07,0.17],[0,0.25],[0.07,0.17],[0.13,0.08],[0,0]],"v":[[34.92,12.75],[35.37,12.63],[35.68,12.24],[35.79,11.62],[35.68,10.98],[35.37,10.6],[34.92,10.46],[34.48,10.6],[34.17,10.98],[34.06,11.61],[34.17,12.24],[34.48,12.63],[34.92,12.75]]}}},{"ty":"sh","nm":"Path 8","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.38,0.21],[0.22,0.38],[0,0.52],[-0.22,0.37],[-0.37,0.21],[-0.47,0],[-0.37,-0.21],[-0.21,-0.38],[0,-0.54],[0.22,-0.38],[0.37,-0.21],[0.47,0]],"o":[[-0.47,0],[-0.37,-0.21],[-0.22,-0.38],[0,-0.54],[0.22,-0.38],[0.38,-0.21],[0.47,0],[0.37,0.21],[0.22,0.37],[0,0.52],[-0.21,0.38],[-0.37,0.21],[0,0]],"v":[[27.99,9.14],[26.72,8.83],[25.82,7.95],[25.49,6.59],[25.82,5.22],[26.72,4.34],[27.99,4.03],[29.25,4.34],[30.14,5.22],[30.47,6.59],[30.14,7.95],[29.25,8.83],[27.99,9.14]]}}},{"ty":"sh","nm":"Path 9","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.13,0.08],[-0.07,0.17],[0,0.24],[0.07,0.17],[0.13,0.08],[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.26],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0]],"o":[[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.26],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0],[-0.13,0.08],[-0.07,0.17],[0,0.24],[0.07,0.17],[0.13,0.08],[0,0]],"v":[[27.98,7.73],[28.43,7.6],[28.74,7.21],[28.85,6.59],[28.74,5.95],[28.43,5.57],[27.98,5.43],[27.53,5.57],[27.22,5.95],[27.11,6.59],[27.22,7.21],[27.53,7.6],[27.98,7.73]]}}},{"ty":"sh","nm":"Path 10","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.73,0.43],[0.42,0.76],[0,1],[-0.41,0.76],[-0.73,0.43],[-0.96,0],[-0.74,-0.43],[-0.4,-0.77],[0,-1],[0.41,-0.77],[0.74,-0.43],[0.96,0]],"o":[[-0.96,0],[-0.73,-0.43],[-0.41,-0.77],[0,-1],[0.42,-0.77],[0.73,-0.43],[0.96,0],[0.74,0.43],[0.41,0.76],[0,1],[-0.4,0.76],[-0.74,0.43],[0,0]],"v":[[46.66,14.17],[44.12,13.52],[42.4,11.75],[41.79,9.1],[42.4,6.47],[44.12,4.68],[46.66,4.03],[49.21,4.68],[50.91,6.47],[51.53,9.1],[50.91,11.75],[49.21,13.52],[46.66,14.17]]}}},{"ty":"sh","nm":"Path 11","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.4,0.26],[-0.22,0.47],[0,0.65],[0.22,0.47],[0.41,0.25],[0.57,0],[0.41,-0.26],[0.22,-0.48],[0,-0.65],[-0.22,-0.48],[-0.41,-0.26],[-0.55,0]],"o":[[0.57,0],[0.41,-0.26],[0.22,-0.48],[0,-0.65],[-0.22,-0.48],[-0.4,-0.26],[-0.55,0],[-0.41,0.25],[-0.22,0.47],[0,0.65],[0.22,0.47],[0.41,0.26],[0,0]],"v":[[46.66,12.28],[48.11,11.89],[49.07,10.79],[49.4,9.1],[49.07,7.42],[48.11,6.33],[46.66,5.94],[45.22,6.33],[44.26,7.42],[43.93,9.1],[44.26,10.79],[45.22,11.89],[46.66,12.28]]}}},{"ty":"sh","nm":"Path 12","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[53.1,14],[53.1,4.2],[59.61,4.2],[59.61,5.89],[55.2,5.89],[55.2,8.27],[58.67,8.27],[58.67,9.91],[55.2,9.91],[55.2,14],[53.1,14]]}}},{"ty":"sh","nm":"Path 13","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[60.99,14],[60.99,4.2],[67.5,4.2],[67.5,5.89],[63.09,5.89],[63.09,8.27],[66.56,8.27],[66.56,9.91],[63.09,9.91],[63.09,14],[60.99,14]]}}},{"ty":"fl","nm":"Fill","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[37.094,9.075]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[37.094,9.075]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 2","it":[{"ty":"sh","nm":"Path 14","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,-3.53],[0,0],[3.53,0],[0,0],[0,3.53],[0,0],[-3.53,0]],"o":[[0,0],[3.53,0],[0,0],[0,3.53],[0,0],[-3.53,0],[0,0],[0,-3.53],[0,0]],"v":[[6.4,0],[67.6,0],[74,6.4],[74,11.6],[67.6,18],[6.4,18],[0,11.6],[0,6.4],[6.4,0]]}}},{"ty":"fl","nm":"Fill","c":{"a":0,"k":[1,0.361,0.38]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[37,9]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[37,9]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":30,"op":89,"ip":0,"assets":[]}
|
|
@@ -30,6 +30,7 @@ import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
|
30
30
|
import BottomAmenities from "../../ui/BottomAmenities/BottomAmenities";
|
|
31
31
|
import SeatSection from "../../ui/SeatSection/SeatSection";
|
|
32
32
|
import DateTimeSection from "../../ui/DateTimeSection/DateTimeSection";
|
|
33
|
+
import ServiceBadges from "../../ui/ServiceBadges/ServiceBadges";
|
|
33
34
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
34
35
|
const ANIMATION_MAP = {
|
|
35
36
|
promoAnim: {
|
|
@@ -66,24 +67,6 @@ const ANIMATION_MAP = {
|
|
|
66
67
|
},
|
|
67
68
|
};
|
|
68
69
|
function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t = (key) => key, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, }) {
|
|
69
|
-
const startViewerCount = (node) => {
|
|
70
|
-
if (!node || !viewersConfig)
|
|
71
|
-
return;
|
|
72
|
-
const prevId = node.dataset.viewerId;
|
|
73
|
-
if (prevId)
|
|
74
|
-
clearInterval(Number(prevId));
|
|
75
|
-
const { min, max, interval = 5000 } = viewersConfig;
|
|
76
|
-
const clamp = (v) => Math.min(max, Math.max(min, v));
|
|
77
|
-
const initialValue = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
78
|
-
node.textContent = String(initialValue);
|
|
79
|
-
const id = setInterval(() => {
|
|
80
|
-
const current = Number(node.textContent) || initialValue;
|
|
81
|
-
const delta = Math.ceil(current * 0.2);
|
|
82
|
-
const next = current + Math.floor(Math.random() * (2 * delta + 1)) - delta;
|
|
83
|
-
node.textContent = String(clamp(Math.round(next)));
|
|
84
|
-
}, interval);
|
|
85
|
-
node.dataset.viewerId = String(id);
|
|
86
|
-
};
|
|
87
70
|
const getAnimationIcon = (icon) => {
|
|
88
71
|
var _a;
|
|
89
72
|
const animation = ANIMATION_MAP[icon];
|
|
@@ -115,17 +98,16 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
115
98
|
busStage[labelId].split("|")[1] === "true" &&
|
|
116
99
|
busStage[labelId].split("|")[0];
|
|
117
100
|
let isSoldOut = serviceItem.available_seats <= 0;
|
|
118
|
-
const showPromo = Math.random() > 0.5;
|
|
119
101
|
const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
|
|
120
102
|
const grayscaleClass = isSoldOut ? "grayscale" : "";
|
|
121
103
|
const hasOfferText = Boolean(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text);
|
|
122
|
-
const offerGradient =
|
|
104
|
+
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
123
105
|
const serviceCardStyle = hasOfferText
|
|
124
106
|
? {
|
|
125
107
|
borderColor: "transparent",
|
|
126
108
|
borderStyle: "solid",
|
|
127
109
|
borderWidth: "6px 6px 0 6px",
|
|
128
|
-
borderRadius: isItemExpanded ? "18px 18px 0 0" : "18px",
|
|
110
|
+
borderRadius: isItemExpanded || coachKey ? "18px 18px 0 0" : "18px",
|
|
129
111
|
background: `linear-gradient(#fff, #fff) padding-box, ${offerGradient} border-box`,
|
|
130
112
|
}
|
|
131
113
|
: {};
|
|
@@ -214,29 +196,6 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
214
196
|
}
|
|
215
197
|
onBookButtonPress();
|
|
216
198
|
};
|
|
217
|
-
const countdownSeconds = 599;
|
|
218
|
-
const startCountdown = (node) => {
|
|
219
|
-
if (!node)
|
|
220
|
-
return;
|
|
221
|
-
const prevId = node.dataset.countdownId;
|
|
222
|
-
if (prevId)
|
|
223
|
-
clearInterval(Number(prevId));
|
|
224
|
-
let remaining = countdownSeconds;
|
|
225
|
-
const formatTime = (totalSecs) => {
|
|
226
|
-
const m = Math.floor(totalSecs / 60);
|
|
227
|
-
const s = totalSecs % 60;
|
|
228
|
-
return `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
229
|
-
};
|
|
230
|
-
node.textContent = formatTime(remaining);
|
|
231
|
-
const id = setInterval(() => {
|
|
232
|
-
remaining -= 1;
|
|
233
|
-
if (remaining <= 0) {
|
|
234
|
-
remaining = countdownSeconds;
|
|
235
|
-
}
|
|
236
|
-
node.textContent = formatTime(remaining);
|
|
237
|
-
}, 1000);
|
|
238
|
-
node.dataset.countdownId = String(id);
|
|
239
|
-
};
|
|
240
199
|
const items = [
|
|
241
200
|
{
|
|
242
201
|
key: "amenities",
|
|
@@ -277,10 +236,9 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
277
236
|
padding: coachKey
|
|
278
237
|
? "15px 15px 20px 15px"
|
|
279
238
|
: "20px 15px 11px 15px",
|
|
239
|
+
marginTop: hasOfferText ? "14px" : "0",
|
|
280
240
|
} },
|
|
281
|
-
React.createElement("div", { className: "grid text-[#464647] w-full [grid-template-columns:22%_28%_2.5%_24%_15.5%] gap-x-[2%] items-center",
|
|
282
|
-
marginTop: showTopLabel || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ? "8px" : "",
|
|
283
|
-
} },
|
|
241
|
+
React.createElement("div", { className: "grid text-[#464647] w-full [grid-template-columns:22%_28%_2.5%_24%_15.5%] gap-x-[2%] items-center" },
|
|
284
242
|
React.createElement("div", { className: "flex flex-col gap-[5px]" },
|
|
285
243
|
React.createElement("div", null,
|
|
286
244
|
React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: `h-[30px] w-[auto] ${isSoldOut ? "grayscale" : ""}` }),
|
|
@@ -295,12 +253,8 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
295
253
|
React.createElement("div", { className: "content-center" },
|
|
296
254
|
React.createElement(SeatSection, { seatTypes: serviceItem.seat_types, serviceItem: serviceItem, availableSeats: serviceItem.available_seats, isSoldOut: isSoldOut, priceColor: colors.priceColor, currencySign: currencySign, removeDuplicateSeats: removeDuplicateSeats, isPeru: isPeru, renderIcon: renderIcon })),
|
|
297
255
|
React.createElement("div", { className: "relative" },
|
|
298
|
-
showLastSeats ? (React.createElement("div", { className: "flex justify-end mr-[11px] w-[100%] right-[0px] absolute", style: {
|
|
299
|
-
top: serviceDetailsLoading ? "-17px" : "-20px",
|
|
300
|
-
} }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
301
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[12px] text-[#464647] mt-1 text-center" }, "\u00A1\u00DAltimos Asientos!")))) : null,
|
|
302
256
|
React.createElement(KuposButton, { isSoldOut: isSoldOut, isLoading: serviceDetailsLoading, buttonColor: colors.kuposButtonColor, buyLabel: translation === null || translation === void 0 ? void 0 : translation.buyButton, soldOutLabel: translation === null || translation === void 0 ? void 0 : translation.soldOutButton, soldOutIcon: renderIcon("soldOutIcon", "14px"), onClick: checkMidnight }),
|
|
303
|
-
showLastSeats ? (React.createElement("div", { className: "flex justify-
|
|
257
|
+
showLastSeats ? (React.createElement("div", { className: "flex justify-center mr-[11px] w-[100%] right-[0px]", style: {
|
|
304
258
|
top: serviceDetailsLoading ? "-17px" : "-20px",
|
|
305
259
|
} }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
306
260
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[12px] text-[#464647] mt-1 text-center" }, "\u00A1\u00DAltimos Asientos!")))) : null)),
|
|
@@ -338,7 +292,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
338
292
|
"\u00A0"),
|
|
339
293
|
" ",
|
|
340
294
|
"| Termina en\u00A0",
|
|
341
|
-
React.createElement("span", { className: "bold-text text-end", ref: startCountdown, style: {
|
|
295
|
+
React.createElement("span", { className: "bold-text text-end", ref: (node) => CommonService.startCountdown(node, 599), style: {
|
|
342
296
|
fontVariantNumeric: "tabular-nums",
|
|
343
297
|
display: "inline-block",
|
|
344
298
|
// minWidth: "70px",
|
|
@@ -346,41 +300,21 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
346
300
|
React.createElement("div", { className: "flex items-center" },
|
|
347
301
|
React.createElement(LottiePlayer, { animationData: getAnimationIcon("dotAnimation"), width: "12px", height: "12px" }),
|
|
348
302
|
React.createElement("span", { className: "ml-[6px]" },
|
|
349
|
-
React.createElement("span", { className: "bold-text", ref: startViewerCount, style: { fontVariantNumeric: "tabular-nums" } }),
|
|
303
|
+
React.createElement("span", { className: "bold-text", ref: (node) => CommonService.startViewerCount(node, viewersConfig), style: { fontVariantNumeric: "tabular-nums" } }),
|
|
350
304
|
" ",
|
|
351
305
|
React.createElement("span", { className: "bold-text" }, "personas"),
|
|
352
306
|
" ",
|
|
353
307
|
React.createElement("span", null,
|
|
354
308
|
" ",
|
|
355
|
-
(viewersConfig === null || viewersConfig === void 0 ? void 0 : viewersConfig.label) || "
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
backgroundColor: "#fff",
|
|
366
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
367
|
-
color: colors.topLabelColor,
|
|
368
|
-
} },
|
|
369
|
-
renderIcon("connectingServiceIcon", "12px"),
|
|
370
|
-
React.createElement("div", null, "Conexión"))),
|
|
371
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-20 `, style: {
|
|
372
|
-
backgroundColor: "#fff",
|
|
373
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
374
|
-
color: colors.topLabelColor,
|
|
375
|
-
} },
|
|
376
|
-
renderIcon("directo", "12px"),
|
|
377
|
-
React.createElement("div", null, translation === null || translation === void 0 ? void 0 : translation.directService))),
|
|
378
|
-
(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] px-[14px] rounded-[38px] text-[12.5px] z-20 `, style: {
|
|
379
|
-
backgroundColor: "#fff",
|
|
380
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
381
|
-
color: colors.topLabelColor,
|
|
382
|
-
} },
|
|
383
|
-
renderIcon("directo", "12px"),
|
|
384
|
-
React.createElement("div", null, "Tren Express"))))))));
|
|
309
|
+
(viewersConfig === null || viewersConfig === void 0 ? void 0 : viewersConfig.label) || " viendo",
|
|
310
|
+
" |",
|
|
311
|
+
" ",
|
|
312
|
+
React.createElement("span", { className: "" },
|
|
313
|
+
"\u26A1 Quedan pocos",
|
|
314
|
+
" ",
|
|
315
|
+
React.createElement("span", { className: "bold-text", ref: (node) => CommonService.startComprandoCount(node, 4, 16), style: { fontVariantNumeric: "tabular-nums" } }),
|
|
316
|
+
" ",
|
|
317
|
+
"comprando"))))))),
|
|
318
|
+
React.createElement(ServiceBadges, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, translation: translation, serviceItem: serviceItem })))));
|
|
385
319
|
}
|
|
386
320
|
export default ServiceItemPB;
|
|
@@ -4,6 +4,7 @@ import commonService from "../../utils/CommonService";
|
|
|
4
4
|
import BottomAmenitiesMobile from "../../ui/mobileweb/BottomAmenitiesMobile";
|
|
5
5
|
import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
|
|
6
6
|
import ExpandedDropdownMobile from "../../ui/mobileweb/ExpandedDropdownMobile";
|
|
7
|
+
import ServiceBadgesMobile from "../../ui/mobileweb/ServiceBadgesMobile";
|
|
7
8
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
8
9
|
const exceptions = [
|
|
9
10
|
"gy",
|
|
@@ -33,47 +34,6 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
33
34
|
background: `linear-gradient(#fff, #fff) padding-box, ${offerGradient} border-box`,
|
|
34
35
|
}
|
|
35
36
|
: {};
|
|
36
|
-
const startViewerCount = (node) => {
|
|
37
|
-
if (!node || !viewersConfig)
|
|
38
|
-
return;
|
|
39
|
-
const prevId = node.dataset.viewerId;
|
|
40
|
-
if (prevId)
|
|
41
|
-
clearInterval(Number(prevId));
|
|
42
|
-
const { min, max, interval = 5000 } = viewersConfig;
|
|
43
|
-
const clamp = (v) => Math.min(max, Math.max(min, v));
|
|
44
|
-
const initialValue = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
45
|
-
node.textContent = String(initialValue);
|
|
46
|
-
const id = setInterval(() => {
|
|
47
|
-
const current = Number(node.textContent) || initialValue;
|
|
48
|
-
const delta = Math.ceil(current * 0.2);
|
|
49
|
-
const next = current + Math.floor(Math.random() * (2 * delta + 1)) - delta;
|
|
50
|
-
node.textContent = String(clamp(Math.round(next)));
|
|
51
|
-
}, interval);
|
|
52
|
-
node.dataset.viewerId = String(id);
|
|
53
|
-
};
|
|
54
|
-
const countdownSeconds = 599;
|
|
55
|
-
const startCountdown = (node) => {
|
|
56
|
-
if (!node)
|
|
57
|
-
return;
|
|
58
|
-
const prevId = node.dataset.countdownId;
|
|
59
|
-
if (prevId)
|
|
60
|
-
clearInterval(Number(prevId));
|
|
61
|
-
let remaining = countdownSeconds;
|
|
62
|
-
const formatTime = (totalSecs) => {
|
|
63
|
-
const m = Math.floor(totalSecs / 60);
|
|
64
|
-
const s = totalSecs % 60;
|
|
65
|
-
return `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
66
|
-
};
|
|
67
|
-
node.textContent = formatTime(remaining);
|
|
68
|
-
const id = setInterval(() => {
|
|
69
|
-
remaining -= 1;
|
|
70
|
-
if (remaining <= 0) {
|
|
71
|
-
remaining = countdownSeconds;
|
|
72
|
-
}
|
|
73
|
-
node.textContent = formatTime(remaining);
|
|
74
|
-
}, 1000);
|
|
75
|
-
node.dataset.countdownId = String(id);
|
|
76
|
-
};
|
|
77
37
|
const labelId = typeof serviceItem.boarding_stages === "string"
|
|
78
38
|
? serviceItem.boarding_stages.split("|")[0]
|
|
79
39
|
: "";
|
|
@@ -132,7 +92,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
132
92
|
: "rounded-[10px] border border-[#ccc]"}`, style: serviceCardStyle },
|
|
133
93
|
React.createElement("div", { style: { padding: "12px 12px 8px 12px" } },
|
|
134
94
|
React.createElement("div", { className: "flex justify-between items-center mb-[10px]" },
|
|
135
|
-
React.createElement("div", { className: "flex items-center justify-between" },
|
|
95
|
+
React.createElement("div", { className: "flex items-center justify-between", style: { marginBottom: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) ? "10px" : "" } },
|
|
136
96
|
React.createElement("div", { className: "w-[120px] overflow-y-hidden" },
|
|
137
97
|
React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: `w-[100px] h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
|
|
138
98
|
isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px] items-center" },
|
|
@@ -144,50 +104,12 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
144
104
|
React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]" }, serviceItem.operator_details[2]))))) : null),
|
|
145
105
|
showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
146
106
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-[#464647] text-center" }, "\u00A1 \u00DAltimos Asientos!")))) : null),
|
|
147
|
-
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.origin, destinationIcon: (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem }),
|
|
107
|
+
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.origin, destinationIcon: (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, tooltipBgColor: colors.tooltipBgColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem }),
|
|
148
108
|
React.createElement("div", { className: "bg-[#E6E6E6] mt-[10px] mb-[10px] h-[1px]" }),
|
|
149
|
-
React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_d = serviceItem.duration) === null || _d === void 0 ? void 0 : _d.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id),
|
|
150
|
-
// onDropdownToggle={() => {
|
|
151
|
-
// setShowDropdown(!showDropdown);
|
|
152
|
-
// setAmenetiesAtomValue({
|
|
153
|
-
// service: serviceItem,
|
|
154
|
-
// showTopLabel: showTopLabel,
|
|
155
|
-
// });
|
|
156
|
-
// }}
|
|
157
|
-
onDropdownToggle: () => {
|
|
109
|
+
React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_d = serviceItem.duration) === null || _d === void 0 ? void 0 : _d.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id), onDropdownToggle: () => {
|
|
158
110
|
setIsExpanded(isItemExpanded ? null : serviceItem.id);
|
|
159
111
|
}, isPeru: isPeru })),
|
|
160
|
-
React.createElement(
|
|
161
|
-
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
162
|
-
backgroundColor: "#fff",
|
|
163
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
164
|
-
color: colors.topLabelColor,
|
|
165
|
-
} },
|
|
166
|
-
React.createElement("div", { className: isSoldOut ? "grayscale" : "" }, renderIcon("specialDeparture", "12px")),
|
|
167
|
-
React.createElement("div", { style: {
|
|
168
|
-
color: colors.topLabelColor,
|
|
169
|
-
} }, showTopLabel))),
|
|
170
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
171
|
-
backgroundColor: "#fff",
|
|
172
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
173
|
-
color: colors.topLabelColor,
|
|
174
|
-
} },
|
|
175
|
-
renderIcon("directo", "12px"),
|
|
176
|
-
React.createElement("div", { className: "ml-[5px]" }, "Directo"))),
|
|
177
|
-
isConexion && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[11px] z-20 `, style: {
|
|
178
|
-
backgroundColor: "#fff",
|
|
179
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
180
|
-
color: colors.topLabelColor,
|
|
181
|
-
} },
|
|
182
|
-
renderIcon("airportIcon", "14px"),
|
|
183
|
-
React.createElement("div", null, "Conexi\u00F3n"))),
|
|
184
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
185
|
-
backgroundColor: "#fff",
|
|
186
|
-
border: `1px solid ${colors.topLabelColor}`,
|
|
187
|
-
color: colors.topLabelColor,
|
|
188
|
-
} },
|
|
189
|
-
renderIcon("directo", "12px"),
|
|
190
|
-
React.createElement("div", null, "Tren Express"))))),
|
|
112
|
+
React.createElement(ServiceBadgesMobile, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, serviceItem: serviceItem, isConexion: isConexion })),
|
|
191
113
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && (React.createElement("div", { className: "px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]", style: {
|
|
192
114
|
background: isSoldOut ? "#ccc" : offerGradient,
|
|
193
115
|
opacity: isSoldOut ? 0.5 : 1,
|
|
@@ -195,34 +117,42 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
195
117
|
zIndex: -1,
|
|
196
118
|
} },
|
|
197
119
|
React.createElement("div", { className: "flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]", style: { lineHeight: 1.6 } },
|
|
198
|
-
React.createElement("div", { className: "flex justify-between items-
|
|
120
|
+
React.createElement("div", { className: "flex justify-between items-start" },
|
|
199
121
|
React.createElement("div", { className: `flex ${isLongOfferText ? "items-start" : "items-center"}` },
|
|
200
122
|
React.createElement("div", { className: isLongOfferText ? "mt-[2px]" : "" },
|
|
201
|
-
React.createElement(LottiePlayer, { animationData: serviceItem.icons.bombAnim, width: "
|
|
123
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.bombAnim, width: "14px", height: "14px" })),
|
|
202
124
|
React.createElement("div", { className: `ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`, style: {
|
|
203
125
|
color: "#fff",
|
|
204
126
|
lineHeight: 1.4,
|
|
205
127
|
} },
|
|
206
128
|
React.createElement("span", { className: "whitespace-nowrap min-[380px]:text-[12px]" },
|
|
207
129
|
"Termina en\u00A0",
|
|
208
|
-
React.createElement("span", { className: "bold-text", ref: startCountdown, style: {
|
|
130
|
+
React.createElement("span", { className: "bold-text", ref: (node) => commonService.startCountdown(node, 599), style: {
|
|
209
131
|
fontVariantNumeric: "tabular-nums",
|
|
210
132
|
display: "inline-block",
|
|
211
133
|
} })))),
|
|
212
|
-
React.createElement("div", { className: "flex items-
|
|
134
|
+
React.createElement("div", { className: "flex flex-col items-end", style: {
|
|
213
135
|
color: "#fff",
|
|
214
136
|
} },
|
|
215
|
-
React.createElement("div", { className: "
|
|
216
|
-
" ",
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
React.createElement("span", { className: "
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
137
|
+
React.createElement("div", { className: "flex items-center" },
|
|
138
|
+
React.createElement("div", { className: "mr-[4px]" },
|
|
139
|
+
" ",
|
|
140
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.dotAnimation, width: "12px", height: "12px" })),
|
|
141
|
+
React.createElement("span", { className: "flex-1", style: { lineHeight: 1.4 } },
|
|
142
|
+
React.createElement("span", { className: "bold-text", ref: (node) => commonService.startViewerCount(node, viewersConfig), style: { fontVariantNumeric: "tabular-nums" } }),
|
|
143
|
+
" ",
|
|
144
|
+
React.createElement("span", { className: "bold-text" }, "personas"),
|
|
145
|
+
" ",
|
|
146
|
+
React.createElement("span", null,
|
|
147
|
+
" ",
|
|
148
|
+
"viendo"))),
|
|
149
|
+
React.createElement("div", { className: "flex items-center" },
|
|
150
|
+
React.createElement("span", { className: "whitespace-nowrap" },
|
|
151
|
+
"\u26A1 Quedan pocos",
|
|
152
|
+
" ",
|
|
153
|
+
React.createElement("span", { className: "bold-text", ref: (node) => commonService.startComprandoCount(node, 4, 16), style: { fontVariantNumeric: "tabular-nums" } }),
|
|
224
154
|
" ",
|
|
225
|
-
"
|
|
155
|
+
"comprando"))))))),
|
|
226
156
|
React.createElement("div", { style: {
|
|
227
157
|
display: "grid",
|
|
228
158
|
gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
|
package/dist/styles.css
CHANGED
|
@@ -433,6 +433,9 @@
|
|
|
433
433
|
.rotate-180 {
|
|
434
434
|
rotate: 180deg;
|
|
435
435
|
}
|
|
436
|
+
.transform {
|
|
437
|
+
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
438
|
+
}
|
|
436
439
|
.cursor-default {
|
|
437
440
|
cursor: default;
|
|
438
441
|
}
|
|
@@ -1081,6 +1084,15 @@
|
|
|
1081
1084
|
transform: translateY(0);
|
|
1082
1085
|
}
|
|
1083
1086
|
}
|
|
1087
|
+
@keyframes pulse-zoom {
|
|
1088
|
+
0%,
|
|
1089
|
+
100% {
|
|
1090
|
+
transform: scale(1);
|
|
1091
|
+
}
|
|
1092
|
+
50% {
|
|
1093
|
+
transform: scale(1.05);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1084
1096
|
.hide-scrollbar::-webkit-scrollbar {
|
|
1085
1097
|
display: none;
|
|
1086
1098
|
}
|
|
@@ -1103,6 +1115,26 @@
|
|
|
1103
1115
|
inherits: false;
|
|
1104
1116
|
initial-value: 0;
|
|
1105
1117
|
}
|
|
1118
|
+
@property --tw-rotate-x {
|
|
1119
|
+
syntax: "*";
|
|
1120
|
+
inherits: false;
|
|
1121
|
+
}
|
|
1122
|
+
@property --tw-rotate-y {
|
|
1123
|
+
syntax: "*";
|
|
1124
|
+
inherits: false;
|
|
1125
|
+
}
|
|
1126
|
+
@property --tw-rotate-z {
|
|
1127
|
+
syntax: "*";
|
|
1128
|
+
inherits: false;
|
|
1129
|
+
}
|
|
1130
|
+
@property --tw-skew-x {
|
|
1131
|
+
syntax: "*";
|
|
1132
|
+
inherits: false;
|
|
1133
|
+
}
|
|
1134
|
+
@property --tw-skew-y {
|
|
1135
|
+
syntax: "*";
|
|
1136
|
+
inherits: false;
|
|
1137
|
+
}
|
|
1106
1138
|
@property --tw-border-style {
|
|
1107
1139
|
syntax: "*";
|
|
1108
1140
|
inherits: false;
|
|
@@ -1214,6 +1246,11 @@
|
|
|
1214
1246
|
--tw-translate-x: 0;
|
|
1215
1247
|
--tw-translate-y: 0;
|
|
1216
1248
|
--tw-translate-z: 0;
|
|
1249
|
+
--tw-rotate-x: initial;
|
|
1250
|
+
--tw-rotate-y: initial;
|
|
1251
|
+
--tw-rotate-z: initial;
|
|
1252
|
+
--tw-skew-x: initial;
|
|
1253
|
+
--tw-skew-y: initial;
|
|
1217
1254
|
--tw-border-style: solid;
|
|
1218
1255
|
--tw-leading: initial;
|
|
1219
1256
|
--tw-font-weight: initial;
|
|
@@ -122,11 +122,26 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
|
|
|
122
122
|
React.createElement("span", { className: "text-[13.33px] font-normal leading-[22px] text-[#c2c2c2]" }, "Antes")),
|
|
123
123
|
React.createElement("div", { className: "col-start-1 row-start-3 flex h-[30px] items-end" },
|
|
124
124
|
React.createElement("span", { className: "text-[13.33px] font-normal leading-[24px] text-[#464647]" }, "Desde")),
|
|
125
|
-
React.createElement("div", { className: "col-start-2 row-start-1 flex items-center justify-center absolute", style: { top: "-22px", right: "30px" } }, discountValue != null && (React.createElement("span", { className: "rounded-[100px] bg-[#ff5964] px-[6px] text-[12px] bold-text leading-[20px] text-white"
|
|
125
|
+
React.createElement("div", { className: "col-start-2 row-start-1 flex items-center justify-center absolute", style: { top: "-22px", right: "30px" } }, discountValue != null && (React.createElement("span", { className: "rounded-[100px] bg-[#ff5964] px-[6px] text-[12px] bold-text leading-[20px] text-white", style: {
|
|
126
|
+
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
127
|
+
} },
|
|
126
128
|
discountValue,
|
|
127
129
|
"% OFF"))),
|
|
128
130
|
React.createElement("div", { className: "col-start-2 row-start-2 flex items-center justify-center ", style: { textAlign: "center" } },
|
|
129
|
-
React.createElement("span", { className: "text-[13.33px] font-normal leading-[20px] text-[#9f9f9f]
|
|
131
|
+
React.createElement("span", { className: "text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative", style: {
|
|
132
|
+
position: "relative",
|
|
133
|
+
} },
|
|
134
|
+
formatPrice(discountSeat.originalPrice),
|
|
135
|
+
React.createElement("span", { style: {
|
|
136
|
+
position: "absolute",
|
|
137
|
+
left: "-2px",
|
|
138
|
+
top: "50%",
|
|
139
|
+
width: "calc(100% + 4px)",
|
|
140
|
+
height: "1px",
|
|
141
|
+
backgroundColor: "#9f9f9f",
|
|
142
|
+
transform: "rotate(-10deg)",
|
|
143
|
+
transformOrigin: "center",
|
|
144
|
+
} }))),
|
|
130
145
|
React.createElement("div", { className: "col-start-2 row-start-3 flex h-[30px] items-end justify-start" },
|
|
131
146
|
React.createElement("span", { className: "flex items-center gap-[6px] text-[22px] bold-text leading-[30px]", style: { color: isSoldOut ? "#c0c0c0" : "#ff5964" } },
|
|
132
147
|
renderIcon("fireIcon", "16px"),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ServiceBadgesProps {
|
|
3
|
+
showTopLabel?: string;
|
|
4
|
+
isSoldOut: boolean;
|
|
5
|
+
colors: any;
|
|
6
|
+
renderIcon: (iconKey: string, size?: string) => React.ReactNode;
|
|
7
|
+
translation?: {
|
|
8
|
+
directService?: string;
|
|
9
|
+
};
|
|
10
|
+
serviceItem: {
|
|
11
|
+
is_transpordo?: boolean;
|
|
12
|
+
is_direct_trip?: boolean;
|
|
13
|
+
train_type_label?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const ServiceBadges: React.FC<ServiceBadgesProps>;
|
|
17
|
+
export default ServiceBadges;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
const ServiceBadges = ({ showTopLabel, isSoldOut, colors, renderIcon, translation, serviceItem, }) => {
|
|
3
|
+
return (React.createElement("div", { className: "absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[22px] z-10" },
|
|
4
|
+
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-10`, style: {
|
|
5
|
+
backgroundColor: "#fff",
|
|
6
|
+
border: `1px solid ${colors.topLabelColor}`,
|
|
7
|
+
color: colors.topLabelColor,
|
|
8
|
+
} },
|
|
9
|
+
React.createElement("div", { className: isSoldOut ? "grayscale" : "" }, renderIcon("specialDeparture", "12px")),
|
|
10
|
+
React.createElement("div", { className: isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]` }, showTopLabel))),
|
|
11
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
|
|
12
|
+
backgroundColor: "#fff",
|
|
13
|
+
border: `1px solid ${colors.topLabelColor}`,
|
|
14
|
+
color: colors.topLabelColor,
|
|
15
|
+
} },
|
|
16
|
+
renderIcon("connectingServiceIcon", "12px"),
|
|
17
|
+
React.createElement("div", null, "Conexión"))),
|
|
18
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
|
|
19
|
+
backgroundColor: "#fff",
|
|
20
|
+
border: `1px solid ${colors.topLabelColor}`,
|
|
21
|
+
color: colors.topLabelColor,
|
|
22
|
+
} },
|
|
23
|
+
renderIcon("directo", "12px"),
|
|
24
|
+
React.createElement("div", null, translation === null || translation === void 0 ? void 0 : translation.directService))),
|
|
25
|
+
(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] px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
|
|
26
|
+
backgroundColor: "#fff",
|
|
27
|
+
border: `1px solid ${colors.topLabelColor}`,
|
|
28
|
+
color: colors.topLabelColor,
|
|
29
|
+
} },
|
|
30
|
+
renderIcon("directo", "12px"),
|
|
31
|
+
React.createElement("div", null, "Tren Express")))));
|
|
32
|
+
};
|
|
33
|
+
export default ServiceBadges;
|
|
@@ -19,6 +19,7 @@ interface DateTimeSectionMobileProps {
|
|
|
19
19
|
availableSeats: number;
|
|
20
20
|
removeDuplicateSeats?: boolean;
|
|
21
21
|
serviceItem?: any;
|
|
22
|
+
tooltipBgColor?: string;
|
|
22
23
|
}
|
|
23
|
-
declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, }: DateTimeSectionMobileProps): React.ReactElement;
|
|
24
|
+
declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, }: DateTimeSectionMobileProps): React.ReactElement;
|
|
24
25
|
export default DateTimeSectionMobile;
|
|
@@ -31,7 +31,7 @@ const TimeRow = ({ label, icon, alt, date, timeContent, isSoldOut, }) => (React.
|
|
|
31
31
|
React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(date)),
|
|
32
32
|
React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
|
|
33
33
|
React.createElement("div", { className: "font-[900] relative black-text" }, timeContent)))));
|
|
34
|
-
function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, }) {
|
|
34
|
+
function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, }) {
|
|
35
35
|
const { cleaned: cleanedDepTime, hasAM, hasPM } = getCleanedDepTime(depTime);
|
|
36
36
|
const depTimeContent = isLinatal ? (React.createElement("div", null,
|
|
37
37
|
React.createElement("span", null,
|
|
@@ -52,6 +52,6 @@ function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal
|
|
|
52
52
|
backgroundColor: "#ccc",
|
|
53
53
|
margin: "auto",
|
|
54
54
|
} })),
|
|
55
|
-
React.createElement(SeatSectionMobile, { seatTypes: seatTypes, isSoldOut: isSoldOut, isPeru: isPeru, seatPriceColor: seatPriceColor, currencySign: currencySign, availableSeats: availableSeats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem })));
|
|
55
|
+
React.createElement(SeatSectionMobile, { seatTypes: seatTypes, isSoldOut: isSoldOut, isPeru: isPeru, seatPriceColor: seatPriceColor, currencySign: currencySign, availableSeats: availableSeats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, tooltipBgColor: tooltipBgColor })));
|
|
56
56
|
}
|
|
57
57
|
export default DateTimeSectionMobile;
|
|
@@ -13,6 +13,7 @@ interface SeatSectionMobileProps {
|
|
|
13
13
|
availableSeats: number;
|
|
14
14
|
removeDuplicateSeats?: boolean;
|
|
15
15
|
serviceItem?: any;
|
|
16
|
+
tooltipBgColor?: string;
|
|
16
17
|
}
|
|
17
|
-
declare function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, }: SeatSectionMobileProps): React.ReactElement;
|
|
18
|
+
declare function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, }: SeatSectionMobileProps): React.ReactElement;
|
|
18
19
|
export default SeatSectionMobile;
|
|
@@ -42,7 +42,7 @@ const getUniqueSeats = (data, limit) => {
|
|
|
42
42
|
.sort((a, b) => a.fare - b.fare)
|
|
43
43
|
.slice(0, limit);
|
|
44
44
|
};
|
|
45
|
-
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, }) {
|
|
45
|
+
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, }) {
|
|
46
46
|
var _a, _b, _c, _d, _e;
|
|
47
47
|
const hasMultipleTypes = ((_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.length) !== null && _a !== void 0 ? _a : 0) > 2;
|
|
48
48
|
const getFare = (fare) => {
|
|
@@ -94,9 +94,13 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
94
94
|
typeof (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) === "number"
|
|
95
95
|
? Math.round(serviceItem.discount_value)
|
|
96
96
|
: null;
|
|
97
|
-
return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, hasDiscount && discountSeat ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px]" },
|
|
98
|
-
discountValue != null && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]"
|
|
99
|
-
|
|
97
|
+
return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, hasDiscount && discountSeat ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
|
|
98
|
+
discountValue != null && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]", style: {
|
|
99
|
+
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
100
|
+
} },
|
|
101
|
+
React.createElement("span", { className: "rounded-[100px] px-[8px] text-[12px] bold-text leading-[20px] text-[#fff]", style: {
|
|
102
|
+
backgroundColor: tooltipBgColor,
|
|
103
|
+
} },
|
|
100
104
|
discountValue,
|
|
101
105
|
"% OFF"))),
|
|
102
106
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[20px] text-[#c2c2c2]" }, "Antes"),
|