@timardex/cluemart-shared 2.2.0 → 2.2.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.
Files changed (95) hide show
  1. package/dist/{ad-rrCulESo.d.ts → ad-C4L_-r-4.d.ts} +12 -3
  2. package/dist/{ad-D0xWGTAB.d.mts → ad-XtBAH4rD.d.mts} +12 -3
  3. package/dist/{affiliate-C9eTAxEj.d.ts → affiliate-CxZHVZb2.d.ts} +2 -2
  4. package/dist/{affiliate-CGe0hR-U.d.mts → affiliate-D-L_UtL8.d.mts} +2 -2
  5. package/dist/apollo/index.cjs +12 -7
  6. package/dist/apollo/index.cjs.map +1 -1
  7. package/dist/apollo/index.d.mts +11 -0
  8. package/dist/apollo/index.d.ts +11 -0
  9. package/dist/apollo/index.mjs +12 -7
  10. package/dist/apollo/index.mjs.map +1 -1
  11. package/dist/auth/index.cjs +42 -3
  12. package/dist/auth/index.cjs.map +1 -1
  13. package/dist/auth/index.d.mts +5 -4
  14. package/dist/auth/index.d.ts +5 -4
  15. package/dist/auth/index.mjs +7 -5
  16. package/dist/auth/index.mjs.map +1 -1
  17. package/dist/{chunk-OSSBKFNH.mjs → chunk-BR4XNXE7.mjs} +52 -1
  18. package/dist/chunk-BR4XNXE7.mjs.map +1 -0
  19. package/dist/{chunk-PIEXGXTD.mjs → chunk-FWKZZMQR.mjs} +1 -1
  20. package/dist/chunk-FWKZZMQR.mjs.map +1 -0
  21. package/dist/{chunk-KT65YYOB.mjs → chunk-KHC57ZNS.mjs} +16 -12
  22. package/dist/chunk-KHC57ZNS.mjs.map +1 -0
  23. package/dist/{chunk-T7A7ZG55.mjs → chunk-MTBH5LMV.mjs} +111 -22
  24. package/dist/chunk-MTBH5LMV.mjs.map +1 -0
  25. package/dist/{chunk-OK3BPZYA.mjs → chunk-PUX53EZX.mjs} +3 -3
  26. package/dist/{chunk-YPWBK4WU.mjs → chunk-Q2WLLXTA.mjs} +2 -1
  27. package/dist/chunk-Q2WLLXTA.mjs.map +1 -0
  28. package/dist/{chunk-GOWIY4NZ.mjs → chunk-TCV735VY.mjs} +10 -2
  29. package/dist/chunk-TCV735VY.mjs.map +1 -0
  30. package/dist/{chunk-BTZIWVSF.mjs → chunk-YKJAOTF7.mjs} +3 -3
  31. package/dist/chunk-YKJAOTF7.mjs.map +1 -0
  32. package/dist/{contactUs-Be0zqd9Q.d.ts → contactUs-CR-nghbk.d.ts} +1 -1
  33. package/dist/{contactUs-CQXyz40A.d.mts → contactUs-CwHKoGEt.d.mts} +1 -1
  34. package/dist/enums/index.cjs +1 -0
  35. package/dist/enums/index.cjs.map +1 -1
  36. package/dist/enums/index.d.mts +1 -0
  37. package/dist/enums/index.d.ts +1 -0
  38. package/dist/enums/index.mjs +1 -1
  39. package/dist/formFields/index.cjs +16 -7
  40. package/dist/formFields/index.cjs.map +1 -1
  41. package/dist/formFields/index.d.mts +1 -1
  42. package/dist/formFields/index.d.ts +1 -1
  43. package/dist/formFields/index.mjs +5 -5
  44. package/dist/{global-CAf04GRC.d.ts → global-B4mmQo6R.d.ts} +25 -7
  45. package/dist/{global-d8RFwoYS.d.mts → global-D1r5ZuQO.d.mts} +25 -7
  46. package/dist/graphql/index.cjs +62 -0
  47. package/dist/graphql/index.cjs.map +1 -1
  48. package/dist/graphql/index.d.mts +33 -6
  49. package/dist/graphql/index.d.ts +33 -6
  50. package/dist/graphql/index.mjs +9 -3
  51. package/dist/hooks/index.cjs +84 -37
  52. package/dist/hooks/index.cjs.map +1 -1
  53. package/dist/hooks/index.d.mts +5 -5
  54. package/dist/hooks/index.d.ts +5 -5
  55. package/dist/hooks/index.mjs +20 -20
  56. package/dist/hooks/index.mjs.map +1 -1
  57. package/dist/index.cjs +190 -32
  58. package/dist/index.cjs.map +1 -1
  59. package/dist/index.d.mts +90 -15
  60. package/dist/index.d.ts +90 -15
  61. package/dist/index.mjs +185 -32
  62. package/dist/index.mjs.map +1 -1
  63. package/dist/map/index.d.mts +1 -1
  64. package/dist/map/index.d.ts +1 -1
  65. package/dist/region/index.cjs.map +1 -1
  66. package/dist/region/index.d.mts +1 -1
  67. package/dist/region/index.d.ts +1 -1
  68. package/dist/region/index.mjs +1 -1
  69. package/dist/{resourceActivities-DO_PjmMN.d.mts → resourceActivities-DUReu_jD.d.mts} +1 -1
  70. package/dist/{resourceActivities-ByCZO0rJ.d.ts → resourceActivities-Uz9uavhK.d.ts} +1 -1
  71. package/dist/sharing/index.cjs +21 -10
  72. package/dist/sharing/index.cjs.map +1 -1
  73. package/dist/sharing/index.d.mts +1 -1
  74. package/dist/sharing/index.d.ts +1 -1
  75. package/dist/sharing/index.mjs +3 -3
  76. package/dist/types/index.cjs.map +1 -1
  77. package/dist/types/index.d.mts +7 -7
  78. package/dist/types/index.d.ts +7 -7
  79. package/dist/types/index.mjs +2 -2
  80. package/dist/{user-BHYl7drL.d.mts → user-BpR-FTW2.d.mts} +1 -1
  81. package/dist/{user-DCqDbTLd.d.ts → user-IR0bHKFb.d.ts} +1 -1
  82. package/dist/utils/index.cjs +126 -31
  83. package/dist/utils/index.cjs.map +1 -1
  84. package/dist/utils/index.d.mts +32 -12
  85. package/dist/utils/index.d.ts +32 -12
  86. package/dist/utils/index.mjs +9 -5
  87. package/package.json +1 -1
  88. package/dist/chunk-BTZIWVSF.mjs.map +0 -1
  89. package/dist/chunk-GOWIY4NZ.mjs.map +0 -1
  90. package/dist/chunk-KT65YYOB.mjs.map +0 -1
  91. package/dist/chunk-OSSBKFNH.mjs.map +0 -1
  92. package/dist/chunk-PIEXGXTD.mjs.map +0 -1
  93. package/dist/chunk-T7A7ZG55.mjs.map +0 -1
  94. package/dist/chunk-YPWBK4WU.mjs.map +0 -1
  95. /package/dist/{chunk-OK3BPZYA.mjs.map → chunk-PUX53EZX.mjs.map} +0 -0
package/dist/index.cjs CHANGED
@@ -271,6 +271,7 @@ __export(index_exports, {
271
271
  getEventScheduleStatusPresentation: () => getEventScheduleStatusPresentation,
272
272
  getEventScheduleStatusTone: () => getEventScheduleStatusTone,
273
273
  getEventStallholderEmptyMessage: () => getEventStallholderEmptyMessage,
274
+ getFutureEventStatus: () => getFutureEventStatus,
274
275
  getPermissionsForRoles: () => getPermissionsForRoles,
275
276
  getRegisteredVendorCategoryNames: () => getRegisteredVendorCategoryNames,
276
277
  getRegisteredVendorStartDates: () => getRegisteredVendorStartDates,
@@ -361,6 +362,7 @@ __export(index_exports, {
361
362
  toShareSocialImageCacheVersion: () => toShareSocialImageCacheVersion,
362
363
  toUserFacingErrorMessage: () => toUserFacingErrorMessage,
363
364
  truncateText: () => truncateText,
365
+ updateSingleDateTimeStatus: () => updateSingleDateTimeStatus,
364
366
  useActivateVendorClaim: () => useActivateVendorClaim,
365
367
  useAddParticipantToChat: () => useAddParticipantToChat,
366
368
  useAddUserFavouriteResource: () => useAddUserFavouriteResource,
@@ -410,6 +412,7 @@ __export(index_exports, {
410
412
  useDeleteUnregisteredVendor: () => useDeleteUnregisteredVendor,
411
413
  useDeleteUser: () => useDeleteUser,
412
414
  useDeleteVendor: () => useDeleteVendor,
415
+ useEndImpersonation: () => useEndImpersonation,
413
416
  useGetAd: () => useGetAd,
414
417
  useGetAds: () => useGetAds,
415
418
  useGetAdsByRegion: () => useGetAdsByRegion,
@@ -473,6 +476,7 @@ __export(index_exports, {
473
476
  usePaginatedList: () => usePaginatedList,
474
477
  useRedeemAffiliateReward: () => useRedeemAffiliateReward,
475
478
  useRedeemReward: () => useRedeemReward,
479
+ useRefreshImpersonation: () => useRefreshImpersonation,
476
480
  useRefreshToken: () => useRefreshToken,
477
481
  useRegister: () => useRegister,
478
482
  useRemoveParticipantFromChat: () => useRemoveParticipantFromChat,
@@ -492,6 +496,7 @@ __export(index_exports, {
492
496
  useSelectStandardPackage: () => useSelectStandardPackage,
493
497
  useSendChatMessage: () => useSendChatMessage,
494
498
  useStartGame: () => useStartGame,
499
+ useStartImpersonation: () => useStartImpersonation,
495
500
  useSyncBillingCatalogPrice: () => useSyncBillingCatalogPrice,
496
501
  useToggleChatMessageLike: () => useToggleChatMessageLike,
497
502
  useUnlinkUnregisteredVendorByInviterId: () => useUnlinkUnregisteredVendorByInviterId,
@@ -668,6 +673,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
668
673
  EnumNotificationResourceType2["CREATED_EVENT"] = "created_event";
669
674
  EnumNotificationResourceType2["CREATED_PARTNER"] = "created_partner";
670
675
  EnumNotificationResourceType2["CREATED_VENDOR"] = "created_vendor";
676
+ EnumNotificationResourceType2["CREATED_COUPON"] = "created_coupon";
671
677
  EnumNotificationResourceType2["DAILY_CLUE_GAME"] = "daily_clue_game";
672
678
  EnumNotificationResourceType2["DEACTIVATED_EVENT"] = "deactivated_event";
673
679
  EnumNotificationResourceType2["DEACTIVATED_PARTNER"] = "deactivated_partner";
@@ -1125,13 +1131,22 @@ var gameScreenIdentifierList = [
1125
1131
  ];
1126
1132
 
1127
1133
  // src/utils/date.ts
1128
- var import_dayjs = __toESM(require("dayjs"));
1129
- var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
1134
+ var import_dayjs2 = __toESM(require("dayjs"));
1135
+ var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"));
1130
1136
  var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
1131
1137
  var import_timezone = __toESM(require("dayjs/plugin/timezone.js"));
1132
1138
  var import_utc = __toESM(require("dayjs/plugin/utc.js"));
1133
1139
 
1140
+ // src/utils/dateFormats.ts
1141
+ var dateFormat = "DD-MM-YYYY";
1142
+ var timeFormat = "HH:mm";
1143
+
1134
1144
  // src/utils/eventDateStatus.ts
1145
+ var import_dayjs = __toESM(require("dayjs"));
1146
+ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
1147
+ var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek.js"));
1148
+ import_dayjs.default.extend(import_customParseFormat.default);
1149
+ import_dayjs.default.extend(import_isoWeek.default);
1135
1150
  var EVENT_DATE_STATUS_PERIOD_MAP = {
1136
1151
  ["Today" /* TODAY */]: [
1137
1152
  "Started" /* STARTED */,
@@ -1172,27 +1187,90 @@ function isFutureEventDateStatus(dateStatus) {
1172
1187
  function filterDatesByFutureStatus(dates) {
1173
1188
  return dates.filter((date) => isFutureEventDateStatus(date.dateStatus));
1174
1189
  }
1190
+ var MANUAL_DATE_STATUSES = /* @__PURE__ */ new Set([
1191
+ "Canceled" /* CANCELED */,
1192
+ "Rescheduled" /* RE_SCHEDULED */
1193
+ ]);
1194
+ function getFutureEventStatus(startDateTime, now) {
1195
+ const hoursUntilStart = startDateTime.diff(now, "hour", true);
1196
+ if (hoursUntilStart > 0 && hoursUntilStart <= 4) {
1197
+ return "Starting_Soon" /* STARTING_SOON */;
1198
+ }
1199
+ if (startDateTime.isSame(now, "day")) {
1200
+ return "Today" /* TODAY */;
1201
+ }
1202
+ if (startDateTime.isSame(now.add(1, "day"), "day")) {
1203
+ return "Tomorrow" /* TOMORROW */;
1204
+ }
1205
+ if (startDateTime.isSame(now, "isoWeek")) {
1206
+ return "This_Week" /* THIS_WEEK */;
1207
+ }
1208
+ if (startDateTime.isSame(now.add(1, "week"), "isoWeek")) {
1209
+ return "Next_Week" /* NEXT_WEEK */;
1210
+ }
1211
+ return "Upcoming" /* UPCOMING */;
1212
+ }
1213
+ function updateSingleDateTimeStatus(dateTime, now = (0, import_dayjs.default)()) {
1214
+ if (MANUAL_DATE_STATUSES.has(dateTime.dateStatus)) {
1215
+ return dateTime;
1216
+ }
1217
+ const dateTimeFormat = `${dateFormat} ${timeFormat}`;
1218
+ const startDateTime = (0, import_dayjs.default)(
1219
+ `${dateTime.startDate} ${dateTime.startTime}`,
1220
+ dateTimeFormat,
1221
+ true
1222
+ );
1223
+ const endDateTime = (0, import_dayjs.default)(
1224
+ `${dateTime.endDate} ${dateTime.endTime}`,
1225
+ dateTimeFormat,
1226
+ true
1227
+ );
1228
+ if (!startDateTime.isValid() || !endDateTime.isValid()) {
1229
+ return {
1230
+ ...dateTime,
1231
+ dateStatus: "Invalid" /* INVALID */
1232
+ };
1233
+ }
1234
+ if (endDateTime.isBefore(startDateTime)) {
1235
+ return {
1236
+ ...dateTime,
1237
+ dateStatus: "Invalid" /* INVALID */
1238
+ };
1239
+ }
1240
+ let dateStatus;
1241
+ if (endDateTime.isAfter(now)) {
1242
+ if (startDateTime.isAfter(now)) {
1243
+ dateStatus = getFutureEventStatus(startDateTime, now);
1244
+ } else {
1245
+ dateStatus = "Started" /* STARTED */;
1246
+ }
1247
+ } else {
1248
+ dateStatus = "Ended" /* ENDED */;
1249
+ }
1250
+ return {
1251
+ ...dateTime,
1252
+ dateStatus
1253
+ };
1254
+ }
1175
1255
 
1176
1256
  // src/utils/date.ts
1177
- var dateFormat = "DD-MM-YYYY";
1178
- var timeFormat = "HH:mm";
1179
- import_dayjs.default.extend(import_customParseFormat.default);
1180
- import_dayjs.default.extend(import_utc.default);
1181
- import_dayjs.default.extend(import_timezone.default);
1182
- import_dayjs.default.extend(import_isSameOrAfter.default);
1257
+ import_dayjs2.default.extend(import_customParseFormat2.default);
1258
+ import_dayjs2.default.extend(import_utc.default);
1259
+ import_dayjs2.default.extend(import_timezone.default);
1260
+ import_dayjs2.default.extend(import_isSameOrAfter.default);
1183
1261
  var NZ_TZ = "Pacific/Auckland";
1184
1262
  function toNZTime(date) {
1185
- return date ? (0, import_dayjs.default)(date).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
1263
+ return date ? (0, import_dayjs2.default)(date).tz(NZ_TZ) : (0, import_dayjs2.default)().tz(NZ_TZ);
1186
1264
  }
1187
1265
  function nzStartOfDay(input) {
1188
1266
  if (input == null) {
1189
- return (0, import_dayjs.default)().tz(NZ_TZ).startOf("day");
1267
+ return (0, import_dayjs2.default)().tz(NZ_TZ).startOf("day");
1190
1268
  }
1191
- return import_dayjs.default.tz(input, NZ_TZ).startOf("day");
1269
+ return import_dayjs2.default.tz(input, NZ_TZ).startOf("day");
1192
1270
  }
1193
1271
  var formatDate = (dateStr, display = "datetime", timeStr) => {
1194
1272
  const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
1195
- const dateTime = timeStr ? (0, import_dayjs.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs.default)(dateStr, dateFormat);
1273
+ const dateTime = timeStr ? (0, import_dayjs2.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs2.default)(dateStr, dateFormat);
1196
1274
  const formattedDate = dateTime.format("dddd, D MMMM, YYYY");
1197
1275
  const formattedTime = dateTime.format("h:mm a");
1198
1276
  switch (display) {
@@ -1207,9 +1285,12 @@ var formatDate = (dateStr, display = "datetime", timeStr) => {
1207
1285
  }
1208
1286
  };
1209
1287
  var getCurrentAndFutureDates = (dates) => {
1210
- const now = (0, import_dayjs.default)();
1288
+ const now = (0, import_dayjs2.default)();
1211
1289
  return dates.filter((dateObj) => {
1212
- const dateTime = (0, import_dayjs.default)(
1290
+ if (!dateObj.startDate || !dateObj.startTime) {
1291
+ return false;
1292
+ }
1293
+ const dateTime = (0, import_dayjs2.default)(
1213
1294
  `${dateObj.startDate} ${dateObj.startTime}`,
1214
1295
  `${dateFormat} ${timeFormat}`
1215
1296
  );
@@ -1217,8 +1298,11 @@ var getCurrentAndFutureDates = (dates) => {
1217
1298
  });
1218
1299
  };
1219
1300
  var isFutureDatesBeforeThreshold = (date, minHoursFromNow) => {
1220
- const threshold = minHoursFromNow ? (0, import_dayjs.default)().add(minHoursFromNow, "hour") : (0, import_dayjs.default)().startOf("day");
1221
- const dateTime = (0, import_dayjs.default)(
1301
+ if (!date.startDate || !date.startTime) {
1302
+ return false;
1303
+ }
1304
+ const threshold = minHoursFromNow ? (0, import_dayjs2.default)().add(minHoursFromNow, "hour") : (0, import_dayjs2.default)().startOf("day");
1305
+ const dateTime = (0, import_dayjs2.default)(
1222
1306
  `${date.startDate} ${date.startTime}`,
1223
1307
  `${dateFormat} ${timeFormat}`
1224
1308
  );
@@ -1237,9 +1321,18 @@ function sortDatesChronologically(dates) {
1237
1321
  }
1238
1322
  return [...dates].sort((a, b) => {
1239
1323
  const dateTimeFormat = `${dateFormat} ${timeFormat}`;
1240
- const dateA = (0, import_dayjs.default)(`${a.startDate} ${a.startTime}`, dateTimeFormat);
1241
- const dateB = (0, import_dayjs.default)(`${b.startDate} ${b.startTime}`, dateTimeFormat);
1242
- return dateA.valueOf() - dateB.valueOf();
1324
+ const dateA = a.startDate && a.startTime ? (0, import_dayjs2.default)(`${a.startDate} ${a.startTime}`, dateTimeFormat) : null;
1325
+ const dateB = b.startDate && b.startTime ? (0, import_dayjs2.default)(`${b.startDate} ${b.startTime}`, dateTimeFormat) : null;
1326
+ if (dateA && dateB) {
1327
+ return dateA.valueOf() - dateB.valueOf();
1328
+ }
1329
+ if (dateA) {
1330
+ return -1;
1331
+ }
1332
+ if (dateB) {
1333
+ return 1;
1334
+ }
1335
+ return 0;
1243
1336
  });
1244
1337
  }
1245
1338
  var futureTimePeriods = FUTURE_EVENT_DATE_STATUSES.filter(
@@ -1858,16 +1951,18 @@ var SCHOOL_MIN_STUDENT_COUNT = 300;
1858
1951
  var SCHOOL_MAX_STUDENT_COUNT = 0;
1859
1952
 
1860
1953
  // src/calendar/eventCalendar.ts
1861
- var import_dayjs2 = __toESM(require("dayjs"));
1954
+ var import_dayjs3 = __toESM(require("dayjs"));
1862
1955
  function toCalendarIsoDate(startDate) {
1863
- const formatted = (0, import_dayjs2.default)(startDate, dateFormat).format("YYYY-MM-DD");
1864
- return (0, import_dayjs2.default)(formatted, "YYYY-MM-DD", true).isValid() ? formatted : null;
1956
+ const formatted = (0, import_dayjs3.default)(startDate, dateFormat).format("YYYY-MM-DD");
1957
+ return (0, import_dayjs3.default)(formatted, "YYYY-MM-DD", true).isValid() ? formatted : null;
1865
1958
  }
1866
1959
  function fromCalendarIsoDate(isoDate) {
1867
- return (0, import_dayjs2.default)(isoDate, "YYYY-MM-DD").format(dateFormat);
1960
+ return (0, import_dayjs3.default)(isoDate, "YYYY-MM-DD").format(dateFormat);
1868
1961
  }
1869
1962
  function getEventCalendarIsoDates(dateTimes) {
1870
- return dateTimes?.map((dateTime) => toCalendarIsoDate(dateTime.startDate)).filter((date) => Boolean(date)) ?? [];
1963
+ return dateTimes?.map(
1964
+ (dateTime) => dateTime.startDate ? toCalendarIsoDate(dateTime.startDate) : null
1965
+ ).filter((date) => Boolean(date)) ?? [];
1871
1966
  }
1872
1967
  function findEventDateTimeByIsoDate(dateTimes, isoDate) {
1873
1968
  const selected = fromCalendarIsoDate(isoDate);
@@ -2956,7 +3051,9 @@ var availableCategories = assignColorToCategories([
2956
3051
 
2957
3052
  // src/eventStallholders/eventStallholderFilters.ts
2958
3053
  function eventStartDatesSet(dateTime) {
2959
- return new Set((dateTime ?? []).map((date) => date.startDate));
3054
+ return new Set(
3055
+ (dateTime ?? []).map((date) => date.startDate).filter((date) => Boolean(date))
3056
+ );
2960
3057
  }
2961
3058
  function hasMatchingEventDate(vendorStartDates, eventStartDates) {
2962
3059
  return vendorStartDates.some((startDate) => eventStartDates.has(startDate));
@@ -2976,9 +3073,7 @@ function matchesCategory(categoryNames, selectedCategory) {
2976
3073
  function getRegisteredVendorStartDates(vendor) {
2977
3074
  const relations = vendor.relations ?? [];
2978
3075
  return relations.flatMap(
2979
- (relation) => (relation.relationDates ?? []).map(
2980
- (relationDate) => relationDate.dateTime.startDate
2981
- )
3076
+ (relation) => (relation.relationDates ?? []).map((relationDate) => relationDate.dateTime.startDate).filter((date) => Boolean(date))
2982
3077
  );
2983
3078
  }
2984
3079
  function getRegisteredVendorCategoryNames(vendor) {
@@ -2986,7 +3081,7 @@ function getRegisteredVendorCategoryNames(vendor) {
2986
3081
  }
2987
3082
  function getUnregisteredVendorStartDates(vendor) {
2988
3083
  return (vendor.invitations ?? []).flatMap(
2989
- (invitation) => invitation.dateTime.map((date) => date.startDate)
3084
+ (invitation) => invitation.dateTime.map((date) => date.startDate).filter((date) => Boolean(date))
2990
3085
  );
2991
3086
  }
2992
3087
  function getUnregisteredVendorCategoryNames(vendor) {
@@ -3046,7 +3141,9 @@ function getEventDatesWithStallholders(eventDateTime, stallholderStartDates) {
3046
3141
  }
3047
3142
  const startDates = new Set(stallholderStartDates);
3048
3143
  return sortDatesChronologically(
3049
- eventDateTime.filter((date) => startDates.has(date.startDate))
3144
+ eventDateTime.filter(
3145
+ (date) => Boolean(date.startDate) && startDates.has(date.startDate)
3146
+ )
3050
3147
  );
3051
3148
  }
3052
3149
  function getStallholderCategoryNames(registeredVendors, unregisteredVendors = []) {
@@ -3107,7 +3204,7 @@ function getVendorEventRelationStartDates(events) {
3107
3204
  );
3108
3205
  const uniqueStartDates = [];
3109
3206
  for (const dateTime of sortedDates) {
3110
- if (!uniqueStartDates.includes(dateTime.startDate)) {
3207
+ if (dateTime.startDate && !uniqueStartDates.includes(dateTime.startDate)) {
3111
3208
  uniqueStartDates.push(dateTime.startDate);
3112
3209
  }
3113
3210
  }
@@ -5695,6 +5792,42 @@ var REFRESH_TOKEN_MUTATION = import_client14.gql`
5695
5792
  }
5696
5793
  }
5697
5794
  `;
5795
+ var START_IMPERSONATION_MUTATION = import_client14.gql`
5796
+ mutation startImpersonation($input: StartImpersonationInputType!) {
5797
+ startImpersonation(input: $input) {
5798
+ data {
5799
+ expiresAt
5800
+ refreshToken
5801
+ sessionId
5802
+ token
5803
+ user {
5804
+ ...UserFields
5805
+ }
5806
+ }
5807
+ message
5808
+ }
5809
+ }
5810
+ ${USER_FIELDS_FRAGMENT}
5811
+ `;
5812
+ var REFRESH_IMPERSONATION_MUTATION = import_client14.gql`
5813
+ mutation refreshImpersonation($input: RefreshImpersonationInputType!) {
5814
+ refreshImpersonation(input: $input) {
5815
+ data {
5816
+ refreshToken
5817
+ token
5818
+ }
5819
+ message
5820
+ }
5821
+ }
5822
+ `;
5823
+ var END_IMPERSONATION_MUTATION = import_client14.gql`
5824
+ mutation endImpersonation {
5825
+ endImpersonation {
5826
+ data
5827
+ message
5828
+ }
5829
+ }
5830
+ `;
5698
5831
  var RESET_PASSWORD_MUTATION = import_client14.gql`
5699
5832
  mutation resetPassword($input: ResetPasswordInputType!) {
5700
5833
  resetPassword(input: $input) {
@@ -5739,6 +5872,18 @@ var useRefreshToken = () => {
5739
5872
  const [refreshToken, { loading, error }] = (0, import_client15.useMutation)(REFRESH_TOKEN_MUTATION);
5740
5873
  return { error, loading, refreshToken };
5741
5874
  };
5875
+ var useStartImpersonation = () => {
5876
+ const [startImpersonation, { loading, error }] = (0, import_client15.useMutation)(START_IMPERSONATION_MUTATION);
5877
+ return { error, loading, startImpersonation };
5878
+ };
5879
+ var useRefreshImpersonation = () => {
5880
+ const [refreshImpersonation, { loading, error }] = (0, import_client15.useMutation)(REFRESH_IMPERSONATION_MUTATION);
5881
+ return { error, loading, refreshImpersonation };
5882
+ };
5883
+ var useEndImpersonation = () => {
5884
+ const [endImpersonation, { loading, error }] = (0, import_client15.useMutation)(END_IMPERSONATION_MUTATION);
5885
+ return { endImpersonation, error, loading };
5886
+ };
5742
5887
  var useRequestPasswordReset = () => {
5743
5888
  const [requestPasswordReset, { loading, error }] = (0, import_client15.useMutation)(REQUEST_PASSWORD_RESET_MUTATION);
5744
5889
  return { error, loading, requestPasswordReset };
@@ -6183,14 +6328,22 @@ var UPDATE_EVENT_INFO_MUTATION = import_client23.gql`
6183
6328
  // src/graphql/hooks/event/hooksMutation.ts
6184
6329
  var useCreateEvent = () => {
6185
6330
  const [createEvent, { loading, error }] = (0, import_client24.useMutation)(CREATE_EVENT_MUTATION, {
6331
+ // The mutation response is a live-only view of EventType. Don't write it
6332
+ // into the normalized EventType cache, where it would overwrite the full
6333
+ // (live + archived) `dateTime` that `getEvent` fetches for the detail page.
6186
6334
  awaitRefetchQueries: true,
6335
+ fetchPolicy: "no-cache",
6187
6336
  refetchQueries: [{ query: GET_USER_EVENTS }]
6188
6337
  });
6189
6338
  return { createEvent, error, loading };
6190
6339
  };
6191
6340
  var useUpdateEvent = () => {
6192
6341
  const [updateEvent, { loading, error }] = (0, import_client24.useMutation)(UPDATE_EVENT_MUTATION, {
6342
+ // See useCreateEvent: the update response only carries the live schedule,
6343
+ // so keep it out of the normalized EventType cache to avoid clobbering the
6344
+ // archived dates merged by `getEvent`.
6193
6345
  awaitRefetchQueries: true,
6346
+ fetchPolicy: "no-cache",
6194
6347
  refetchQueries: (mutationResult) => {
6195
6348
  const eventId = mutationResult?.data?.updateEvent?.data?._id;
6196
6349
  if (!eventId) return [];
@@ -9552,7 +9705,7 @@ function formatShareStallLine(stall) {
9552
9705
  }
9553
9706
  function formatShareInvitationMarketDatesSection(dateTime) {
9554
9707
  const dateBlocks = dateTime.map((date) => {
9555
- const formattedDate = formatShareMarketDate(date.startDate);
9708
+ const formattedDate = date.startDate ? formatShareMarketDate(date.startDate) : "Unknown date";
9556
9709
  const stallLines = date.stallTypes.map(formatShareStallLine);
9557
9710
  return [`- ${formattedDate}`, ...stallLines].join("\n");
9558
9711
  });
@@ -10240,6 +10393,7 @@ function canAccessAdminPath(roles, pathname) {
10240
10393
  getEventScheduleStatusPresentation,
10241
10394
  getEventScheduleStatusTone,
10242
10395
  getEventStallholderEmptyMessage,
10396
+ getFutureEventStatus,
10243
10397
  getPermissionsForRoles,
10244
10398
  getRegisteredVendorCategoryNames,
10245
10399
  getRegisteredVendorStartDates,
@@ -10330,6 +10484,7 @@ function canAccessAdminPath(roles, pathname) {
10330
10484
  toShareSocialImageCacheVersion,
10331
10485
  toUserFacingErrorMessage,
10332
10486
  truncateText,
10487
+ updateSingleDateTimeStatus,
10333
10488
  useActivateVendorClaim,
10334
10489
  useAddParticipantToChat,
10335
10490
  useAddUserFavouriteResource,
@@ -10379,6 +10534,7 @@ function canAccessAdminPath(roles, pathname) {
10379
10534
  useDeleteUnregisteredVendor,
10380
10535
  useDeleteUser,
10381
10536
  useDeleteVendor,
10537
+ useEndImpersonation,
10382
10538
  useGetAd,
10383
10539
  useGetAds,
10384
10540
  useGetAdsByRegion,
@@ -10442,6 +10598,7 @@ function canAccessAdminPath(roles, pathname) {
10442
10598
  usePaginatedList,
10443
10599
  useRedeemAffiliateReward,
10444
10600
  useRedeemReward,
10601
+ useRefreshImpersonation,
10445
10602
  useRefreshToken,
10446
10603
  useRegister,
10447
10604
  useRemoveParticipantFromChat,
@@ -10461,6 +10618,7 @@ function canAccessAdminPath(roles, pathname) {
10461
10618
  useSelectStandardPackage,
10462
10619
  useSendChatMessage,
10463
10620
  useStartGame,
10621
+ useStartImpersonation,
10464
10622
  useSyncBillingCatalogPrice,
10465
10623
  useToggleChatMessageLike,
10466
10624
  useUnlinkUnregisteredVendorByInviterId,