nvis-fe-cms-libs 1.0.1 → 1.0.2

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.
@@ -1,7 +1,27 @@
1
1
  (function(global, factory) {
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react")) : typeof define === "function" && define.amd ? define(["exports", "react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.AsaCmsSections = {}, global.React));
3
3
  })(this, (function(exports2, require$$0) {
4
- "use strict";
4
+ "use strict";var __async = (__this, __arguments, generator) => {
5
+ return new Promise((resolve, reject) => {
6
+ var fulfilled = (value) => {
7
+ try {
8
+ step(generator.next(value));
9
+ } catch (e) {
10
+ reject(e);
11
+ }
12
+ };
13
+ var rejected = (value) => {
14
+ try {
15
+ step(generator.throw(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ };
20
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
21
+ step((generator = generator.apply(__this, __arguments)).next());
22
+ });
23
+ };
24
+
5
25
  var jsxRuntime = { exports: {} };
6
26
  var reactJsxRuntime_production = {};
7
27
  /**
@@ -906,7 +926,7 @@
906
926
  }
907
927
  );
908
928
  };
909
- function useWindowSize() {
929
+ function useWindowSize$1() {
910
930
  const [width, setWidth] = require$$0.useState(
911
931
  typeof window !== "undefined" ? window.innerWidth : 1200
912
932
  );
@@ -924,7 +944,7 @@
924
944
  const [currentPartnerSlide, setCurrentPartnerSlide] = require$$0.useState(0);
925
945
  const [partnersVisible, setPartnersVisible] = require$$0.useState(false);
926
946
  const partnersRef = require$$0.useRef(null);
927
- const windowWidth = useWindowSize();
947
+ const windowWidth = useWindowSize$1();
928
948
  const getLogoUrl = (logoUrl) => {
929
949
  if (!logoUrl) return null;
930
950
  if (logoUrl.startsWith("http")) return logoUrl;
@@ -1032,17 +1052,578 @@
1032
1052
  }
1033
1053
  );
1034
1054
  };
1055
+ const MilestoneSection = ({ data, t, isDarkMode, getMilestoneTimeline }) => {
1056
+ const [milestones, setMilestones] = require$$0.useState([]);
1057
+ const [loading, setLoading] = require$$0.useState(true);
1058
+ const [timelineVisible, setTimelineVisible] = require$$0.useState([]);
1059
+ const timelineRefs = require$$0.useRef([]);
1060
+ require$$0.useEffect(() => {
1061
+ const fetchMilestones = () => __async(null, null, function* () {
1062
+ var _a;
1063
+ if (getMilestoneTimeline) {
1064
+ try {
1065
+ setLoading(true);
1066
+ const res = yield getMilestoneTimeline();
1067
+ if (res.success) {
1068
+ setMilestones(res.data || []);
1069
+ } else {
1070
+ setMilestones([]);
1071
+ }
1072
+ } catch (error) {
1073
+ setMilestones([]);
1074
+ } finally {
1075
+ setLoading(false);
1076
+ }
1077
+ } else {
1078
+ const milestonesData = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data)) || [];
1079
+ setMilestones(milestonesData);
1080
+ setLoading(false);
1081
+ }
1082
+ });
1083
+ fetchMilestones();
1084
+ }, []);
1085
+ require$$0.useEffect(() => {
1086
+ setTimelineVisible(new Array(milestones.length).fill(false));
1087
+ }, [milestones.length]);
1088
+ require$$0.useEffect(() => {
1089
+ const observer = new IntersectionObserver(
1090
+ (entries) => {
1091
+ entries.forEach((entry) => {
1092
+ if (entry.isIntersecting) {
1093
+ const index2 = timelineRefs.current.findIndex(
1094
+ (el) => el === entry.target
1095
+ );
1096
+ if (index2 !== -1) {
1097
+ setTimelineVisible((prev) => {
1098
+ const newVisible = [...prev];
1099
+ newVisible[index2] = true;
1100
+ return newVisible;
1101
+ });
1102
+ }
1103
+ observer.unobserve(entry.target);
1104
+ }
1105
+ });
1106
+ },
1107
+ { threshold: 0.1 }
1108
+ );
1109
+ timelineRefs.current.forEach((el) => el && observer.observe(el));
1110
+ return () => {
1111
+ timelineRefs.current.forEach((el) => el && observer.unobserve(el));
1112
+ };
1113
+ }, [milestones.length]);
1114
+ if (loading) {
1115
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: isDarkMode ? "text-white" : "text-gray-800", children: t("milestone.status.loadingData") }) });
1116
+ }
1117
+ if (!milestones.length) {
1118
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1119
+ "section",
1120
+ {
1121
+ className: `py-20 ${isDarkMode ? "bg-gray-900/50" : "bg-white"}`,
1122
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 text-center", children: [
1123
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1124
+ "h3",
1125
+ {
1126
+ className: `text-lg font-semibold mb-2 ${isDarkMode ? "text-white" : "text-gray-900"}`,
1127
+ children: t("milestone.status.noData")
1128
+ }
1129
+ ),
1130
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1131
+ "p",
1132
+ {
1133
+ className: `${isDarkMode ? "text-gray-300" : "text-gray-600"}`,
1134
+ children: t("milestone.noDataDescription")
1135
+ }
1136
+ )
1137
+ ] })
1138
+ }
1139
+ );
1140
+ }
1141
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1142
+ "section",
1143
+ {
1144
+ className: `py-20 ${isDarkMode ? "bg-gray-800" : "bg-white"}`,
1145
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
1146
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-12", children: [
1147
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1148
+ "div",
1149
+ {
1150
+ className: `relative inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 border transition-all duration-300 transform hover:scale-105 shadow-md hover:shadow-lg overflow-hidden ${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 text-emerald-300 border-blue-800" : "bg-white text-emerald-800 border-gray-200"}`,
1151
+ children: [
1152
+ "📈 ",
1153
+ t("milestone.header.badge")
1154
+ ]
1155
+ }
1156
+ ),
1157
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1158
+ "h2",
1159
+ {
1160
+ className: `text-3xl lg:text-4xl font-bold mb-4 ${isDarkMode ? "text-white" : "text-gray-900"}`,
1161
+ children: [
1162
+ t("milestone.header.title"),
1163
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-emerald-600 to-teal-600 bg-clip-text text-transparent", children: t("milestone.header.subtitle") })
1164
+ ]
1165
+ }
1166
+ )
1167
+ ] }),
1168
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
1169
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-1/2 transform -translate-x-1/2 w-1 h-full bg-gradient-to-b from-blue-500 to-purple-600 rounded-full" }),
1170
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-8", children: milestones.map((milestone, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
1171
+ "div",
1172
+ {
1173
+ ref: (el) => timelineRefs.current[index2] = el,
1174
+ className: `flex items-center transition-all duration-700 ease-out ${index2 % 2 === 0 ? "flex-row" : "flex-row-reverse"} ${timelineVisible[index2] ? "opacity-100 scale-100" : "opacity-0 scale-75"}`,
1175
+ style: { transitionDelay: `${index2 * 200}ms` },
1176
+ children: [
1177
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 px-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1178
+ "div",
1179
+ {
1180
+ className: `relative p-5 rounded-xl shadow-lg transition-all duration-300 hover:shadow-xl overflow-hidden ${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 border border-blue-800 hover:border-blue-600" : "bg-gray-50 hover:shadow-2xl"}`,
1181
+ children: [
1182
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-blue-600 font-bold text-xl mb-2", children: milestone.time }),
1183
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1184
+ "h3",
1185
+ {
1186
+ className: `text-lg font-bold mb-2 ${isDarkMode ? "text-white" : "text-gray-900"}`,
1187
+ children: milestone.title
1188
+ }
1189
+ ),
1190
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1191
+ "p",
1192
+ {
1193
+ className: `${isDarkMode ? "text-gray-300" : "text-gray-600"}`,
1194
+ children: milestone.description
1195
+ }
1196
+ )
1197
+ ]
1198
+ }
1199
+ ) }),
1200
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1201
+ "div",
1202
+ {
1203
+ className: `w-6 h-6 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full border-4 ${isDarkMode ? "border-gray-800" : "border-white"} shadow-[0_0_10px_5px_rgba(59,130,246,0.5)] flex-shrink-0 z-10 animate-pulse`
1204
+ }
1205
+ ),
1206
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1" })
1207
+ ]
1208
+ },
1209
+ milestone.id
1210
+ )) })
1211
+ ] })
1212
+ ] })
1213
+ }
1214
+ );
1215
+ };
1216
+ const TestimonialsSection = ({ data, t, isDarkMode }) => {
1217
+ var _a;
1218
+ const [currentIndex, setCurrentIndex] = require$$0.useState(0);
1219
+ const testimonials = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => ({
1220
+ quote: item.data.content,
1221
+ author: item.data.customerName,
1222
+ position: item.data.customerTitle || t("testimonials.fallback.defaultPosition"),
1223
+ company: item.data.customerCompany || ""
1224
+ }))) || [];
1225
+ const fallbackTestimonials = [
1226
+ {
1227
+ quote: t("testimonials.fallback.testimonial1.quote"),
1228
+ author: t("testimonials.fallback.testimonial1.author"),
1229
+ position: t("testimonials.fallback.testimonial1.position"),
1230
+ company: t("testimonials.fallback.testimonial1.company")
1231
+ },
1232
+ {
1233
+ quote: t("testimonials.fallback.testimonial2.quote"),
1234
+ author: t("testimonials.fallback.testimonial2.author"),
1235
+ position: t("testimonials.fallback.testimonial2.position"),
1236
+ company: t("testimonials.fallback.testimonial2.company")
1237
+ },
1238
+ {
1239
+ quote: t("testimonials.fallback.testimonial3.quote"),
1240
+ author: t("testimonials.fallback.testimonial3.author"),
1241
+ position: t("testimonials.fallback.testimonial3.position"),
1242
+ company: t("testimonials.fallback.testimonial3.company")
1243
+ }
1244
+ ];
1245
+ const displayTestimonials = testimonials.length > 0 ? testimonials : fallbackTestimonials;
1246
+ require$$0.useEffect(() => {
1247
+ if (displayTestimonials.length > 1) {
1248
+ const interval = setInterval(() => {
1249
+ setCurrentIndex((prev) => (prev + 1) % displayTestimonials.length);
1250
+ }, 5e3);
1251
+ return () => clearInterval(interval);
1252
+ }
1253
+ }, [displayTestimonials.length]);
1254
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1255
+ "section",
1256
+ {
1257
+ className: `py-20 transition-colors duration-200 ${isDarkMode ? "bg-gray-700" : "bg-gray-50"}`,
1258
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
1259
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1260
+ "div",
1261
+ {
1262
+ className: `inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 ${isDarkMode ? "bg-indigo-900/50 text-indigo-300 border border-indigo-800" : "bg-indigo-100 text-indigo-800"}`,
1263
+ children: [
1264
+ "💬 ",
1265
+ t("testimonials.header.badge")
1266
+ ]
1267
+ }
1268
+ ),
1269
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1270
+ "h2",
1271
+ {
1272
+ className: `text-3xl lg:text-4xl font-bold mb-8 transition-colors duration-200 ${isDarkMode ? "text-white" : "text-gray-900"}`,
1273
+ children: [
1274
+ t("testimonials.header.title"),
1275
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-indigo-600 to-purple-600 bg-clip-text text-transparent", children: t("testimonials.header.subtitle") })
1276
+ ]
1277
+ }
1278
+ ),
1279
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
1280
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1281
+ "div",
1282
+ {
1283
+ className: `p-6 rounded-2xl transition-all duration-500 transform ${isDarkMode ? "bg-gray-800/80 backdrop-blur-sm border border-gray-700" : "bg-white"}`,
1284
+ children: [
1285
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1286
+ "blockquote",
1287
+ {
1288
+ className: `text-lg lg:text-xl italic mb-6 animate-fadeIn transition-colors duration-200 ${isDarkMode ? "text-gray-300" : "text-gray-700"}`,
1289
+ children: [
1290
+ '"',
1291
+ displayTestimonials[currentIndex].quote,
1292
+ '"'
1293
+ ]
1294
+ }
1295
+ ),
1296
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center space-x-4 animate-fadeIn", children: [
1297
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl", children: "👤" }),
1298
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-left", children: [
1299
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1300
+ "div",
1301
+ {
1302
+ className: `font-bold text-base transition-colors duration-200 ${isDarkMode ? "text-white" : "text-gray-900"}`,
1303
+ children: displayTestimonials[currentIndex].author
1304
+ }
1305
+ ),
1306
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-blue-600 font-medium text-sm", children: displayTestimonials[currentIndex].position }),
1307
+ displayTestimonials[currentIndex].company && /* @__PURE__ */ jsxRuntimeExports.jsx(
1308
+ "div",
1309
+ {
1310
+ className: `text-xs transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-gray-600"}`,
1311
+ children: displayTestimonials[currentIndex].company
1312
+ }
1313
+ )
1314
+ ] })
1315
+ ] })
1316
+ ]
1317
+ },
1318
+ currentIndex
1319
+ ),
1320
+ displayTestimonials.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center space-x-2 mt-4", children: displayTestimonials.map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1321
+ "button",
1322
+ {
1323
+ onClick: () => setCurrentIndex(index2),
1324
+ className: `w-2.5 h-2.5 rounded-full transition-all duration-300 ${index2 === currentIndex ? "bg-blue-600" : isDarkMode ? "bg-gray-600 hover:bg-gray-500" : "bg-gray-300 hover:bg-gray-400"}`
1325
+ },
1326
+ index2
1327
+ )) })
1328
+ ] })
1329
+ ] })
1330
+ }
1331
+ );
1332
+ };
1333
+ const PartnerListCard = ({ partner, idx = 0, t, isDarkMode, getLogoUrl }) => {
1334
+ const itemRef = require$$0.useRef(null);
1335
+ const [visible, setVisible] = require$$0.useState(false);
1336
+ const [isHovered, setIsHovered] = require$$0.useState(false);
1337
+ if (!partner) return null;
1338
+ require$$0.useEffect(() => {
1339
+ const observer = new IntersectionObserver(
1340
+ (entries) => {
1341
+ entries.forEach((entry) => {
1342
+ if (entry.isIntersecting) {
1343
+ setVisible(true);
1344
+ observer.unobserve(entry.target);
1345
+ }
1346
+ });
1347
+ },
1348
+ { threshold: 0.2 }
1349
+ );
1350
+ if (itemRef.current) observer.observe(itemRef.current);
1351
+ return () => itemRef.current && observer.unobserve(itemRef.current);
1352
+ }, []);
1353
+ const logoSrc = getLogoUrl ? getLogoUrl(partner.logoUrl) : null;
1354
+ const handleImageError = (e) => {
1355
+ e.target.style.display = "none";
1356
+ e.target.nextSibling.style.display = "flex";
1357
+ };
1358
+ const handleClick = () => {
1359
+ if (partner.websiteUrl) {
1360
+ window.open(partner.websiteUrl, "_blank", "noopener,noreferrer");
1361
+ }
1362
+ };
1363
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1364
+ "div",
1365
+ {
1366
+ ref: itemRef,
1367
+ className: `relative flex flex-col items-center justify-center p-4 rounded-xl shadow-sm transition-all duration-700 ease-out cursor-pointer overflow-hidden min-h-[180px]
1368
+ ${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 border border-blue-800" : "bg-white border border-gray-200"}
1369
+ ${visible ? "opacity-100 scale-100" : "opacity-0 scale-75"}
1370
+ ${isHovered ? isDarkMode ? "border-blue-500 shadow-lg shadow-blue-500/20 -translate-y-1" : "border-blue-300 shadow-lg shadow-blue-500/20 -translate-y-1" : ""}`,
1371
+ style: {
1372
+ transitionDelay: `${idx * 150}ms`,
1373
+ transform: `translateY(${isHovered ? "-4px" : "0px"}) scale(${visible ? "1" : "0.75"})`
1374
+ },
1375
+ onMouseEnter: () => setIsHovered(true),
1376
+ onMouseLeave: () => setIsHovered(false),
1377
+ onClick: handleClick,
1378
+ children: [
1379
+ isDarkMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1380
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute w-12 h-12 bg-white/5 rounded-full", style: { left: "10%", top: "20%" } }),
1381
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute w-10 h-10 bg-white/5 rounded-full", style: { right: "30%", bottom: "10%" } }),
1382
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute w-14 h-14 bg-white/5 rounded-md", style: { left: "20%", bottom: "30%" } }),
1383
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 opacity-20", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1384
+ "div",
1385
+ {
1386
+ style: {
1387
+ backgroundImage: `url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,
1388
+ backgroundSize: "60px 60px"
1389
+ },
1390
+ className: "w-full h-full"
1391
+ }
1392
+ ) })
1393
+ ] }),
1394
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1395
+ "div",
1396
+ {
1397
+ className: `w-20 h-14 flex items-center justify-center mb-4 rounded-lg overflow-hidden border transition-all duration-300
1398
+ ${isDarkMode ? "border-gray-600" : "border-gray-200"}
1399
+ ${isHovered ? "border-blue-500" : ""}
1400
+ `,
1401
+ style: {
1402
+ background: isDarkMode ? isHovered ? "linear-gradient(135deg, #4b5563 0%, #374151 100%)" : "linear-gradient(135deg, #374151 0%, #1f2937 100%)" : isHovered ? "linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)" : "linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%)"
1403
+ },
1404
+ children: logoSrc ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1405
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1406
+ "img",
1407
+ {
1408
+ src: logoSrc,
1409
+ alt: partner.name || t("partners.logoAlt") || "Partner logo",
1410
+ className: "max-w-full max-h-full object-contain transition-all duration-300",
1411
+ style: {
1412
+ filter: isDarkMode ? isHovered ? "grayscale(0) opacity(1)" : "grayscale(0.3) opacity(0.8)" : isHovered ? "grayscale(0) opacity(1)" : "grayscale(0.2) opacity(0.9)",
1413
+ transform: isHovered ? "scale(1.05)" : "scale(1)"
1414
+ },
1415
+ onError: handleImageError,
1416
+ loading: "lazy"
1417
+ }
1418
+ ),
1419
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full h-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center", style: { display: "none" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-center text-sm px-1", children: partner.name }) })
1420
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full h-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-center text-sm px-1", children: partner.name }) })
1421
+ }
1422
+ ),
1423
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `font-bold text-center mb-2 text-sm leading-tight ${isDarkMode ? "text-white" : "text-gray-900"}`, children: partner.name }),
1424
+ partner.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs text-center mb-3 line-clamp-2 px-1 ${isDarkMode ? "text-gray-300" : "text-gray-600"}`, children: partner.description }),
1425
+ partner.websiteUrl && /* @__PURE__ */ jsxRuntimeExports.jsx(
1426
+ "div",
1427
+ {
1428
+ className: "transition-all duration-300",
1429
+ style: {
1430
+ opacity: isHovered ? 1 : 0,
1431
+ transform: `translateY(${isHovered ? "0px" : "4px"})`
1432
+ },
1433
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-blue-600 font-medium", children: [
1434
+ t("partners.viewDetails") || "Xem chi tiết",
1435
+ " →"
1436
+ ] })
1437
+ }
1438
+ )
1439
+ ]
1440
+ }
1441
+ );
1442
+ };
1443
+ function useWindowSize() {
1444
+ const [width, setWidth] = require$$0.useState(
1445
+ typeof window !== "undefined" ? window.innerWidth : 1200
1446
+ );
1447
+ require$$0.useEffect(() => {
1448
+ const handleResize = () => setWidth(window.innerWidth);
1449
+ window.addEventListener("resize", handleResize);
1450
+ return () => window.removeEventListener("resize", handleResize);
1451
+ }, []);
1452
+ return width;
1453
+ }
1454
+ const PartnerListSection = ({ t, isDarkMode, getPartnerList, imageBaseUrl = "" }) => {
1455
+ const [partnersData, setPartnersData] = require$$0.useState([]);
1456
+ const [error, setError] = require$$0.useState(null);
1457
+ const [loading, setLoading] = require$$0.useState(true);
1458
+ const [currentPartnerSlide, setCurrentPartnerSlide] = require$$0.useState(0);
1459
+ const [partnersVisible, setPartnersVisible] = require$$0.useState(false);
1460
+ const partnersRef = require$$0.useRef(null);
1461
+ const windowWidth = useWindowSize();
1462
+ const getLogoUrl = (logoUrl) => {
1463
+ if (!logoUrl) return null;
1464
+ if (logoUrl.startsWith("http")) return logoUrl;
1465
+ return `${imageBaseUrl}${logoUrl}`;
1466
+ };
1467
+ require$$0.useEffect(() => {
1468
+ const fetchData = () => __async(null, null, function* () {
1469
+ try {
1470
+ const res = yield getPartnerList();
1471
+ if (res.success) {
1472
+ setPartnersData(res.data || []);
1473
+ } else {
1474
+ setError(res.error || "Error fetching partners");
1475
+ }
1476
+ } catch (err) {
1477
+ setError(err.message);
1478
+ } finally {
1479
+ setLoading(false);
1480
+ }
1481
+ });
1482
+ fetchData();
1483
+ }, []);
1484
+ const partners = require$$0.useMemo(() => {
1485
+ const getPerSlide = () => {
1486
+ if (windowWidth < 640) return 2;
1487
+ if (windowWidth < 1024) return 3;
1488
+ return 4;
1489
+ };
1490
+ const grouped = [];
1491
+ const perSlide = getPerSlide();
1492
+ for (let i = 0; i < partnersData.length; i += perSlide) {
1493
+ grouped.push(partnersData.slice(i, i + perSlide));
1494
+ }
1495
+ return grouped;
1496
+ }, [partnersData, windowWidth]);
1497
+ require$$0.useEffect(() => {
1498
+ if (partners.length > 1) {
1499
+ const interval = setInterval(() => {
1500
+ setCurrentPartnerSlide((prev) => (prev + 1) % partners.length);
1501
+ }, 5e3);
1502
+ return () => clearInterval(interval);
1503
+ }
1504
+ }, [partners.length]);
1505
+ require$$0.useEffect(() => {
1506
+ const fallbackTimer = setTimeout(() => {
1507
+ setPartnersVisible(true);
1508
+ }, 500);
1509
+ const observer = new IntersectionObserver(
1510
+ (entries) => {
1511
+ entries.forEach((entry) => {
1512
+ if (entry.isIntersecting) {
1513
+ clearTimeout(fallbackTimer);
1514
+ setPartnersVisible(true);
1515
+ observer.unobserve(entry.target);
1516
+ }
1517
+ });
1518
+ },
1519
+ { threshold: 0.1, rootMargin: "50px" }
1520
+ );
1521
+ if (partnersRef.current) {
1522
+ observer.observe(partnersRef.current);
1523
+ } else {
1524
+ clearTimeout(fallbackTimer);
1525
+ setPartnersVisible(true);
1526
+ }
1527
+ return () => {
1528
+ clearTimeout(fallbackTimer);
1529
+ if (partnersRef.current) {
1530
+ observer.unobserve(partnersRef.current);
1531
+ }
1532
+ };
1533
+ }, []);
1534
+ if (loading) {
1535
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: isDarkMode ? "text-white" : "text-gray-800", children: t("partners.loading") || "Đang tải danh sách đối tác..." }) });
1536
+ }
1537
+ if (error) {
1538
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500", children: t("partners.error") || error }) });
1539
+ }
1540
+ if (!partnersData.length) return null;
1541
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1542
+ "section",
1543
+ {
1544
+ className: `py-12 lg:py-20 transition-colors duration-300 ${isDarkMode ? "bg-gradient-to-b from-gray-950 via-gray-900 to-gray-800" : "bg-gradient-to-b from-white via-gray-50 to-gray-100"}`,
1545
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
1546
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-12", children: [
1547
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1548
+ "div",
1549
+ {
1550
+ className: `inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 border shadow-sm ${isDarkMode ? "bg-blue-900/30 text-blue-300 border-blue-800" : "bg-blue-100 text-blue-800 border-blue-200"}`,
1551
+ children: [
1552
+ "🤝 ",
1553
+ t("partners.badge") || "ĐỐI TÁC CHIẾN LƯỢC"
1554
+ ]
1555
+ }
1556
+ ),
1557
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1558
+ "h2",
1559
+ {
1560
+ className: `text-3xl lg:text-5xl font-bold leading-tight ${isDarkMode ? "text-white" : "text-gray-800"}`,
1561
+ children: [
1562
+ t("partners.title.part1") || "Đồng hành cùng",
1563
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-blue-500 to-purple-500 bg-clip-text text-transparent mt-2", children: t("partners.title.part2") || "Những thương hiệu hàng đầu" })
1564
+ ]
1565
+ }
1566
+ )
1567
+ ] }),
1568
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: partnersRef, className: "relative", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1569
+ "div",
1570
+ {
1571
+ className: `transition-all duration-1000 ease-out ${partnersVisible ? "opacity-100 scale-100" : "opacity-0 scale-95"}`,
1572
+ children: [
1573
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative overflow-hidden mb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-[220px]", children: partners.map((group, slideIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1574
+ "div",
1575
+ {
1576
+ className: `absolute inset-0 w-full transition-all duration-1000 ease-in-out ${slideIndex === currentPartnerSlide ? "opacity-100 translate-x-0" : slideIndex < currentPartnerSlide ? "opacity-0 -translate-x-full" : "opacity-0 translate-x-full"}`,
1577
+ style: { zIndex: slideIndex === currentPartnerSlide ? 10 : 1 },
1578
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-6 px-2", children: group.map((partner, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1579
+ PartnerListCard,
1580
+ {
1581
+ partner,
1582
+ idx,
1583
+ t,
1584
+ isDarkMode,
1585
+ getLogoUrl
1586
+ },
1587
+ partner.id || `${slideIndex}-${idx}`
1588
+ )) })
1589
+ },
1590
+ slideIndex
1591
+ )) }) }),
1592
+ partners.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center space-x-2", style: { zIndex: 50 }, children: partners.map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1593
+ "button",
1594
+ {
1595
+ onClick: () => setCurrentPartnerSlide(index2),
1596
+ className: `w-3 h-3 rounded-full transition-all duration-300 ${index2 === currentPartnerSlide ? "bg-blue-500 scale-125 shadow-lg" : isDarkMode ? "bg-gray-600 hover:bg-blue-400" : "bg-gray-300 hover:bg-blue-500"}`,
1597
+ "aria-label": `Slide ${index2 + 1}`
1598
+ },
1599
+ index2
1600
+ )) })
1601
+ ]
1602
+ }
1603
+ ) })
1604
+ ] })
1605
+ }
1606
+ );
1607
+ };
1035
1608
  const index = {
1036
1609
  AboutCompanySection,
1037
1610
  CompanyValues,
1038
1611
  TimelineSection,
1039
1612
  PartnerCard,
1040
- PartnersSection
1613
+ PartnersSection,
1614
+ MilestoneSection,
1615
+ TestimonialsSection,
1616
+ PartnerListCard,
1617
+ PartnerListSection
1041
1618
  };
1042
1619
  exports2.AboutCompanySection = AboutCompanySection;
1043
1620
  exports2.CompanyValues = CompanyValues;
1621
+ exports2.MilestoneSection = MilestoneSection;
1044
1622
  exports2.PartnerCard = PartnerCard;
1623
+ exports2.PartnerListCard = PartnerListCard;
1624
+ exports2.PartnerListSection = PartnerListSection;
1045
1625
  exports2.PartnersSection = PartnersSection;
1626
+ exports2.TestimonialsSection = TestimonialsSection;
1046
1627
  exports2.TimelineSection = TimelineSection;
1047
1628
  exports2.default = index;
1048
1629
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });