@timardex/cluemart-shared 1.5.704 → 1.5.706
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/{chunk-DW7OU6K3.mjs → chunk-FQVGIFZQ.mjs} +13 -3
- package/dist/{chunk-DW7OU6K3.mjs.map → chunk-FQVGIFZQ.mjs.map} +1 -1
- package/dist/graphql/index.cjs +12 -2
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs +12 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +81 -2027
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -106
- package/dist/index.d.ts +1 -106
- package/dist/index.mjs +81 -2000
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/{auth-Dvp1IEH_.d.mts → post-CswgI5jI.d.mts} +49 -49
- package/dist/{auth-Cp3BRIVM.d.ts → post-NK1XwGmZ.d.ts} +49 -49
package/dist/index.cjs
CHANGED
|
@@ -138,13 +138,6 @@ __export(index_exports, {
|
|
|
138
138
|
contactUsFields: () => contactUsFields,
|
|
139
139
|
darkColors: () => darkColors,
|
|
140
140
|
dateFormat: () => dateFormat,
|
|
141
|
-
defaultEventFormValues: () => defaultEventFormValues,
|
|
142
|
-
defaultEventInfoFormValues: () => defaultEventInfoFormValues,
|
|
143
|
-
defaultLocation: () => defaultLocation,
|
|
144
|
-
defaultPartnerFormValues: () => defaultPartnerFormValues,
|
|
145
|
-
defaultUnregisteredVendorFormValues: () => defaultUnregisteredVendorFormValues,
|
|
146
|
-
defaultVendorFormValues: () => defaultVendorFormValues,
|
|
147
|
-
defaultVendorInfoFormValues: () => defaultVendorInfoFormValues,
|
|
148
141
|
emailField: () => emailField,
|
|
149
142
|
eventBasicInfoFields: () => eventBasicInfoFields,
|
|
150
143
|
eventEndDateFields: () => eventEndDateFields,
|
|
@@ -172,7 +165,6 @@ __export(index_exports, {
|
|
|
172
165
|
gameScreenIdentifierList: () => gameScreenIdentifierList,
|
|
173
166
|
gameTypeToDisplayName: () => gameTypeToDisplayName,
|
|
174
167
|
getCurrentAndFutureDates: () => getCurrentAndFutureDates,
|
|
175
|
-
globalDefaultValues: () => globalDefaultValues,
|
|
176
168
|
iconFiles: () => iconFiles,
|
|
177
169
|
iconIds: () => iconIds,
|
|
178
170
|
icons: () => icons,
|
|
@@ -189,7 +181,6 @@ __export(index_exports, {
|
|
|
189
181
|
logoIds: () => logoIds,
|
|
190
182
|
logos: () => logos,
|
|
191
183
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
192
|
-
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
193
184
|
normalizeShareOgDescription: () => normalizeShareOgDescription,
|
|
194
185
|
normalizeShareRouteId: () => normalizeShareRouteId,
|
|
195
186
|
normalizeShareText: () => normalizeShareText,
|
|
@@ -225,7 +216,6 @@ __export(index_exports, {
|
|
|
225
216
|
timeFormat: () => timeFormat,
|
|
226
217
|
toNZTime: () => toNZTime,
|
|
227
218
|
truncateText: () => truncateText,
|
|
228
|
-
useAdForm: () => useAdForm,
|
|
229
219
|
useAddParticipantToChat: () => useAddParticipantToChat,
|
|
230
220
|
useAddUserFavouriteResource: () => useAddUserFavouriteResource,
|
|
231
221
|
useAddUserGoingResource: () => useAddUserGoingResource,
|
|
@@ -234,10 +224,8 @@ __export(index_exports, {
|
|
|
234
224
|
useAdminPermanentlyDeleteResource: () => useAdminPermanentlyDeleteResource,
|
|
235
225
|
useAdminResendUserVerificationEmail: () => useAdminResendUserVerificationEmail,
|
|
236
226
|
useAdminUpdateResourceType: () => useAdminUpdateResourceType,
|
|
237
|
-
useAppSettingsForm: () => useAppSettingsForm,
|
|
238
227
|
useCancelSubscription: () => useCancelSubscription,
|
|
239
228
|
useContactUs: () => useContactUs,
|
|
240
|
-
useContactUsForm: () => useContactUsForm,
|
|
241
229
|
useCrawlGoogleMarkets: () => useCrawlGoogleMarkets,
|
|
242
230
|
useCreateAd: () => useCreateAd,
|
|
243
231
|
useCreateBulkNotifications: () => useCreateBulkNotifications,
|
|
@@ -269,8 +257,6 @@ __export(index_exports, {
|
|
|
269
257
|
useDeleteUnregisteredVendor: () => useDeleteUnregisteredVendor,
|
|
270
258
|
useDeleteUser: () => useDeleteUser,
|
|
271
259
|
useDeleteVendor: () => useDeleteVendor,
|
|
272
|
-
useEventForm: () => useEventForm,
|
|
273
|
-
useEventInfoForm: () => useEventInfoForm,
|
|
274
260
|
useGetAd: () => useGetAd,
|
|
275
261
|
useGetAds: () => useGetAds,
|
|
276
262
|
useGetAdsByRegion: () => useGetAdsByRegion,
|
|
@@ -324,18 +310,13 @@ __export(index_exports, {
|
|
|
324
310
|
useGetVendors: () => useGetVendors,
|
|
325
311
|
useGetVendorsByRegion: () => useGetVendorsByRegion,
|
|
326
312
|
useLeaveGame: () => useLeaveGame,
|
|
327
|
-
useLocationSearch: () => useLocationSearch,
|
|
328
313
|
useLogin: () => useLogin,
|
|
329
|
-
useLoginForm: () => useLoginForm,
|
|
330
314
|
useLogout: () => useLogout,
|
|
331
315
|
useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
|
|
332
316
|
useMarkChatMessagesSeen: () => useMarkChatMessagesSeen,
|
|
333
317
|
useMarkNotificationRead: () => useMarkNotificationRead,
|
|
334
|
-
usePartnerForm: () => usePartnerForm,
|
|
335
|
-
usePostForm: () => usePostForm,
|
|
336
318
|
useRefreshToken: () => useRefreshToken,
|
|
337
319
|
useRegister: () => useRegister,
|
|
338
|
-
useRegisterForm: () => useRegisterForm,
|
|
339
320
|
useRemoveParticipantFromChat: () => useRemoveParticipantFromChat,
|
|
340
321
|
useRemoveUserFavouriteResource: () => useRemoveUserFavouriteResource,
|
|
341
322
|
useRemoveUserGoingResource: () => useRemoveUserGoingResource,
|
|
@@ -344,10 +325,7 @@ __export(index_exports, {
|
|
|
344
325
|
useReportChatUser: () => useReportChatUser,
|
|
345
326
|
useRequestMarketingMaterial: () => useRequestMarketingMaterial,
|
|
346
327
|
useRequestPasswordReset: () => useRequestPasswordReset,
|
|
347
|
-
useRequestPasswordResetForm: () => useRequestPasswordResetForm,
|
|
348
328
|
useResetPassword: () => useResetPassword,
|
|
349
|
-
useResetPasswordForm: () => useResetPasswordForm,
|
|
350
|
-
useSchoolForm: () => useSchoolForm,
|
|
351
329
|
useSearchEvents: () => useSearchEvents,
|
|
352
330
|
useSearchPartners: () => useSearchPartners,
|
|
353
331
|
useSearchVendors: () => useSearchVendors,
|
|
@@ -357,7 +335,6 @@ __export(index_exports, {
|
|
|
357
335
|
useStartGame: () => useStartGame,
|
|
358
336
|
useToggleChatMessageLike: () => useToggleChatMessageLike,
|
|
359
337
|
useUnlinkUnregisteredVendorByInviterId: () => useUnlinkUnregisteredVendorByInviterId,
|
|
360
|
-
useUnregisteredVendorForm: () => useUnregisteredVendorForm,
|
|
361
338
|
useUpdateAd: () => useUpdateAd,
|
|
362
339
|
useUpdateAppSettings: () => useUpdateAppSettings,
|
|
363
340
|
useUpdateDailyClueGame: () => useUpdateDailyClueGame,
|
|
@@ -374,11 +351,7 @@ __export(index_exports, {
|
|
|
374
351
|
useUpdateUser: () => useUpdateUser,
|
|
375
352
|
useUpdateVendor: () => useUpdateVendor,
|
|
376
353
|
useUpdateVendorInfo: () => useUpdateVendorInfo,
|
|
377
|
-
useUserForm: () => useUserForm,
|
|
378
354
|
useValidateVerificationToken: () => useValidateVerificationToken,
|
|
379
|
-
useValidateVerificationTokenForm: () => useValidateVerificationTokenForm,
|
|
380
|
-
useVendorForm: () => useVendorForm,
|
|
381
|
-
useVendorInfoForm: () => useVendorInfoForm,
|
|
382
355
|
validateVerificationTokenFields: () => validateVerificationTokenFields,
|
|
383
356
|
vendorAvailability: () => vendorAvailability,
|
|
384
357
|
vendorBasicInfoFields: () => vendorBasicInfoFields,
|
|
@@ -433,13 +406,13 @@ var EnumPaymentMethod = /* @__PURE__ */ ((EnumPaymentMethod2) => {
|
|
|
433
406
|
EnumPaymentMethod2["STRIPE"] = "stripe";
|
|
434
407
|
return EnumPaymentMethod2;
|
|
435
408
|
})(EnumPaymentMethod || {});
|
|
436
|
-
var EnumFoodFlavor = /* @__PURE__ */ ((
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return
|
|
409
|
+
var EnumFoodFlavor = /* @__PURE__ */ ((EnumFoodFlavor2) => {
|
|
410
|
+
EnumFoodFlavor2["SALTY"] = "Salty";
|
|
411
|
+
EnumFoodFlavor2["SAVOURY"] = "Savoury";
|
|
412
|
+
EnumFoodFlavor2["SPICY"] = "Spicy";
|
|
413
|
+
EnumFoodFlavor2["SWEET"] = "Sweet";
|
|
414
|
+
EnumFoodFlavor2["OTHER"] = "Not_Applicable";
|
|
415
|
+
return EnumFoodFlavor2;
|
|
443
416
|
})(EnumFoodFlavor || {});
|
|
444
417
|
var EnumFoodType = /* @__PURE__ */ ((EnumFoodType2) => {
|
|
445
418
|
EnumFoodType2["ADDITIVE_FREE"] = "Additive_Free";
|
|
@@ -485,23 +458,23 @@ var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
|
|
|
485
458
|
EnumResourceType2["PARTNER"] = "partner";
|
|
486
459
|
return EnumResourceType2;
|
|
487
460
|
})(EnumResourceType || {});
|
|
488
|
-
var EnumEventType = /* @__PURE__ */ ((
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return
|
|
461
|
+
var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
|
|
462
|
+
EnumEventType2["MARKET"] = "Market";
|
|
463
|
+
EnumEventType2["EXPO"] = "Expo";
|
|
464
|
+
EnumEventType2["FAIR"] = "Fair";
|
|
465
|
+
EnumEventType2["FESTIVAL"] = "Festival";
|
|
466
|
+
return EnumEventType2;
|
|
494
467
|
})(EnumEventType || {});
|
|
495
468
|
var EnumVendorType = /* @__PURE__ */ ((EnumVendorType2) => {
|
|
496
469
|
EnumVendorType2["STALLHOLDER"] = "Stallholder";
|
|
497
470
|
EnumVendorType2["SHOP"] = "Shop";
|
|
498
471
|
return EnumVendorType2;
|
|
499
472
|
})(EnumVendorType || {});
|
|
500
|
-
var EnumPartnerType = /* @__PURE__ */ ((
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return
|
|
473
|
+
var EnumPartnerType = /* @__PURE__ */ ((EnumPartnerType2) => {
|
|
474
|
+
EnumPartnerType2["CHARITY_PARTNER"] = "Charity_Partner";
|
|
475
|
+
EnumPartnerType2["MEDIA_PARTNER"] = "Media_Partner";
|
|
476
|
+
EnumPartnerType2["SUPPORTING_PARTNER"] = "Supporting_Partner";
|
|
477
|
+
return EnumPartnerType2;
|
|
505
478
|
})(EnumPartnerType || {});
|
|
506
479
|
var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform2) => {
|
|
507
480
|
EnumOSPlatform2["ANDROID"] = "android";
|
|
@@ -954,8 +927,8 @@ import_dayjs.default.extend(import_utc.default);
|
|
|
954
927
|
import_dayjs.default.extend(import_timezone.default);
|
|
955
928
|
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
956
929
|
var NZ_TZ = "Pacific/Auckland";
|
|
957
|
-
function toNZTime(
|
|
958
|
-
return
|
|
930
|
+
function toNZTime(date) {
|
|
931
|
+
return date ? (0, import_dayjs.default)(date).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
|
|
959
932
|
}
|
|
960
933
|
function nzStartOfDay(input) {
|
|
961
934
|
if (input == null) {
|
|
@@ -989,10 +962,10 @@ var getCurrentAndFutureDates = (dates) => {
|
|
|
989
962
|
return dateTime.isSameOrAfter(now);
|
|
990
963
|
});
|
|
991
964
|
};
|
|
992
|
-
var isFutureDatesBeforeThreshold = (
|
|
965
|
+
var isFutureDatesBeforeThreshold = (date, minHoursFromNow) => {
|
|
993
966
|
const threshold = minHoursFromNow ? (0, import_dayjs.default)().add(minHoursFromNow, "hour") : (0, import_dayjs.default)().startOf("day");
|
|
994
967
|
const dateTime = (0, import_dayjs.default)(
|
|
995
|
-
`${
|
|
968
|
+
`${date.startDate} ${date.startTime}`,
|
|
996
969
|
`${dateFormat} ${timeFormat}`
|
|
997
970
|
);
|
|
998
971
|
return dateTime.isSameOrAfter(threshold);
|
|
@@ -1035,9 +1008,9 @@ function hashStringToNumber(seed) {
|
|
|
1035
1008
|
}
|
|
1036
1009
|
return hash >>> 0;
|
|
1037
1010
|
}
|
|
1038
|
-
function seededShuffle(
|
|
1011
|
+
function seededShuffle(array, seed) {
|
|
1039
1012
|
const rng = createSeededRng(hashStringToNumber(seed));
|
|
1040
|
-
const result = [...
|
|
1013
|
+
const result = [...array];
|
|
1041
1014
|
for (let i = result.length - 1; i > 0; i--) {
|
|
1042
1015
|
const j = Math.floor(rng() * (i + 1));
|
|
1043
1016
|
[result[i], result[j]] = [result[j], result[i]];
|
|
@@ -6589,8 +6562,18 @@ var LEAVE_GAME_MUTATION = import_client64.gql`
|
|
|
6589
6562
|
}
|
|
6590
6563
|
`;
|
|
6591
6564
|
var UPDATE_DAILY_CLUE_MUTATION = import_client64.gql`
|
|
6592
|
-
mutation updateDailyClueGame(
|
|
6593
|
-
|
|
6565
|
+
mutation updateDailyClueGame(
|
|
6566
|
+
$_id: ID!
|
|
6567
|
+
$foundLetter: String!
|
|
6568
|
+
$gameType: GameTypeEnumType!
|
|
6569
|
+
$gameTypeId: ID!
|
|
6570
|
+
) {
|
|
6571
|
+
updateDailyClueGame(
|
|
6572
|
+
_id: $_id
|
|
6573
|
+
foundLetter: $foundLetter
|
|
6574
|
+
gameType: $gameType
|
|
6575
|
+
gameTypeId: $gameTypeId
|
|
6576
|
+
) {
|
|
6594
6577
|
...GameDocFields
|
|
6595
6578
|
}
|
|
6596
6579
|
}
|
|
@@ -6904,1949 +6887,6 @@ var useGetSchool = (_id) => {
|
|
|
6904
6887
|
};
|
|
6905
6888
|
};
|
|
6906
6889
|
|
|
6907
|
-
// src/hooks/useLocationSearch.ts
|
|
6908
|
-
var handleApiError = (error, message) => {
|
|
6909
|
-
console.error(message, error);
|
|
6910
|
-
};
|
|
6911
|
-
var useLocationSearch = (googleApi) => {
|
|
6912
|
-
const getPredictions = async (text) => {
|
|
6913
|
-
try {
|
|
6914
|
-
const response = await fetch(
|
|
6915
|
-
"https://places.googleapis.com/v1/places:autocomplete",
|
|
6916
|
-
{
|
|
6917
|
-
body: JSON.stringify({
|
|
6918
|
-
input: `${text} New Zealand`,
|
|
6919
|
-
languageCode: "en",
|
|
6920
|
-
regionCode: "nz"
|
|
6921
|
-
}),
|
|
6922
|
-
headers: {
|
|
6923
|
-
"Content-Type": "application/json",
|
|
6924
|
-
"X-Goog-Api-Key": googleApi,
|
|
6925
|
-
"X-Goog-FieldMask": "suggestions.placePrediction.placeId,suggestions.placePrediction.text.text"
|
|
6926
|
-
},
|
|
6927
|
-
method: "POST"
|
|
6928
|
-
}
|
|
6929
|
-
);
|
|
6930
|
-
if (!response.ok) {
|
|
6931
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
6932
|
-
}
|
|
6933
|
-
const data = await response.json();
|
|
6934
|
-
const suggestions = data.suggestions ?? [];
|
|
6935
|
-
const predictions = suggestions.map((suggestion) => suggestion.placePrediction).filter(Boolean).map((prediction) => ({
|
|
6936
|
-
description: prediction?.text?.text || "",
|
|
6937
|
-
place_id: prediction?.placeId || ""
|
|
6938
|
-
})).filter((prediction) => prediction.place_id && prediction.description);
|
|
6939
|
-
return predictions;
|
|
6940
|
-
} catch (error) {
|
|
6941
|
-
console.error("Error fetching predictions:", error);
|
|
6942
|
-
handleApiError(error, "Failed to fetch address predictions.");
|
|
6943
|
-
}
|
|
6944
|
-
};
|
|
6945
|
-
const getPlaceDetails = async (placeId) => {
|
|
6946
|
-
try {
|
|
6947
|
-
const response = await fetch(
|
|
6948
|
-
`https://places.googleapis.com/v1/places/${placeId}`,
|
|
6949
|
-
{
|
|
6950
|
-
headers: {
|
|
6951
|
-
"X-Goog-Api-Key": googleApi,
|
|
6952
|
-
"X-Goog-FieldMask": "addressComponents,formattedAddress,location"
|
|
6953
|
-
}
|
|
6954
|
-
}
|
|
6955
|
-
);
|
|
6956
|
-
if (!response.ok) {
|
|
6957
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
6958
|
-
}
|
|
6959
|
-
const result = await response.json();
|
|
6960
|
-
const { latitude, longitude } = result.location;
|
|
6961
|
-
const { addressComponents, formattedAddress } = result;
|
|
6962
|
-
const address = addressComponents.reduce((acc, item) => {
|
|
6963
|
-
if (!Array.isArray(item.types)) return acc;
|
|
6964
|
-
if (item.types.includes("street_number")) {
|
|
6965
|
-
return { ...acc, streetNumber: item.longText };
|
|
6966
|
-
}
|
|
6967
|
-
if (item.types.includes("route")) {
|
|
6968
|
-
return { ...acc, streetName: item.longText };
|
|
6969
|
-
}
|
|
6970
|
-
if (item.types.includes("locality")) {
|
|
6971
|
-
return { ...acc, city: item.longText };
|
|
6972
|
-
}
|
|
6973
|
-
if (item.types.includes("administrative_area_level_1")) {
|
|
6974
|
-
return { ...acc, region: item.longText };
|
|
6975
|
-
}
|
|
6976
|
-
if (item.types.includes("country")) {
|
|
6977
|
-
return { ...acc, country: item.longText };
|
|
6978
|
-
}
|
|
6979
|
-
return acc;
|
|
6980
|
-
}, {});
|
|
6981
|
-
const newLocation = {
|
|
6982
|
-
city: address.city ? address.city.toLowerCase() : "",
|
|
6983
|
-
country: address.country,
|
|
6984
|
-
fullAddress: formattedAddress,
|
|
6985
|
-
geo: {
|
|
6986
|
-
coordinates: [longitude, latitude],
|
|
6987
|
-
// [longitude, latitude]
|
|
6988
|
-
type: "Point"
|
|
6989
|
-
// Mongoose GeoJSON type
|
|
6990
|
-
},
|
|
6991
|
-
latitude,
|
|
6992
|
-
longitude,
|
|
6993
|
-
region: address.region ? address.region.replace(/ Region$/, "") : ""
|
|
6994
|
-
// Remove " Region" suffix
|
|
6995
|
-
};
|
|
6996
|
-
return newLocation;
|
|
6997
|
-
} catch (error) {
|
|
6998
|
-
handleApiError(error, "Failed to fetch place details.");
|
|
6999
|
-
}
|
|
7000
|
-
};
|
|
7001
|
-
return {
|
|
7002
|
-
getPlaceDetails,
|
|
7003
|
-
getPredictions
|
|
7004
|
-
};
|
|
7005
|
-
};
|
|
7006
|
-
|
|
7007
|
-
// src/hooks/vendor/useVendorForm.ts
|
|
7008
|
-
var import_yup = require("@hookform/resolvers/yup");
|
|
7009
|
-
var React = __toESM(require("react"));
|
|
7010
|
-
var import_react_hook_form = require("react-hook-form");
|
|
7011
|
-
|
|
7012
|
-
// src/yupSchema/global.ts
|
|
7013
|
-
var import_dayjs2 = __toESM(require("dayjs"));
|
|
7014
|
-
var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
7015
|
-
var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
|
7016
|
-
var yup = __toESM(require("yup"));
|
|
7017
|
-
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
7018
|
-
var nzbnRegex = /^94\d{11}$/;
|
|
7019
|
-
var normalizedUrlTransform = () => yup.string().trim().transform(
|
|
7020
|
-
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
7021
|
-
).transform(
|
|
7022
|
-
(value) => typeof value === "string" ? normalizeUrl(value) : value
|
|
7023
|
-
);
|
|
7024
|
-
var noLeadingZeros = (fieldName, options = {}) => {
|
|
7025
|
-
return function(value, context) {
|
|
7026
|
-
const original = context.originalValue;
|
|
7027
|
-
if (typeof original !== "string") {
|
|
7028
|
-
return true;
|
|
7029
|
-
}
|
|
7030
|
-
if (original === "") {
|
|
7031
|
-
return true;
|
|
7032
|
-
}
|
|
7033
|
-
const regex = options.allowDecimal ? /^0\d+(\.\d+)?$/ : /^0\d+$/;
|
|
7034
|
-
if (regex.test(original)) {
|
|
7035
|
-
return context.createError({
|
|
7036
|
-
message: `${fieldName} must not have leading zeros`
|
|
7037
|
-
});
|
|
7038
|
-
}
|
|
7039
|
-
return true;
|
|
7040
|
-
};
|
|
7041
|
-
};
|
|
7042
|
-
var toOptionalNumber = (originalValue) => {
|
|
7043
|
-
if (originalValue === "" || originalValue === null || originalValue === void 0) {
|
|
7044
|
-
return void 0;
|
|
7045
|
-
}
|
|
7046
|
-
let parsed;
|
|
7047
|
-
if (typeof originalValue === "number") {
|
|
7048
|
-
parsed = originalValue;
|
|
7049
|
-
} else if (typeof originalValue === "string") {
|
|
7050
|
-
parsed = Number(originalValue.replace(",", "."));
|
|
7051
|
-
} else {
|
|
7052
|
-
parsed = void 0;
|
|
7053
|
-
}
|
|
7054
|
-
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
7055
|
-
};
|
|
7056
|
-
import_dayjs2.default.extend(import_isSameOrAfter2.default);
|
|
7057
|
-
import_dayjs2.default.extend(import_customParseFormat2.default);
|
|
7058
|
-
var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
7059
|
-
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
7060
|
-
);
|
|
7061
|
-
var emailOptionalSchema = yup.string().nullable().notRequired().transform(
|
|
7062
|
-
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
7063
|
-
).test(
|
|
7064
|
-
"is-valid-email",
|
|
7065
|
-
"Invalid email address",
|
|
7066
|
-
(value) => !value || yup.string().email().isValidSync(value)
|
|
7067
|
-
).label("Email");
|
|
7068
|
-
var mobileRegex = /^02\d{7,9}$/;
|
|
7069
|
-
var landlineRegex = /^0[34679]\d{7}$/;
|
|
7070
|
-
var mobilePhoneSchema = yup.string().label("Mobile Phone").nullable().notRequired().test(
|
|
7071
|
-
"mobile-phone",
|
|
7072
|
-
"Mobile must start with 02 and be 9\u201311 digits",
|
|
7073
|
-
(value) => !value || mobileRegex.test(value)
|
|
7074
|
-
// skip empty values
|
|
7075
|
-
);
|
|
7076
|
-
var landlinePhoneSchema = yup.string().label("Landline Phone").nullable().notRequired().test(
|
|
7077
|
-
"landline-phone",
|
|
7078
|
-
"Landline must start with 03, 04, 06, 07, or 09 (not 090) and have 7 digits after area code",
|
|
7079
|
-
(value) => !value || landlineRegex.test(value)
|
|
7080
|
-
// skip empty values
|
|
7081
|
-
);
|
|
7082
|
-
var contactDetailsSchema = yup.object({
|
|
7083
|
-
email: emailOptionalSchema,
|
|
7084
|
-
mobilePhone: mobilePhoneSchema,
|
|
7085
|
-
landlinePhone: landlinePhoneSchema
|
|
7086
|
-
}).nullable().default(void 0);
|
|
7087
|
-
var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
|
|
7088
|
-
const now = (0, import_dayjs2.default)();
|
|
7089
|
-
return value ? (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
7090
|
-
});
|
|
7091
|
-
var startDateNotInPastTest = yup.string().test("not-in-past", "Start date cannot be in the past", (value) => {
|
|
7092
|
-
const now = (0, import_dayjs2.default)();
|
|
7093
|
-
return value ? (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
7094
|
-
});
|
|
7095
|
-
var endDateAfterStartDateTest = yup.string().test(
|
|
7096
|
-
"end-after-start",
|
|
7097
|
-
"End date cannot be before start date",
|
|
7098
|
-
function(value) {
|
|
7099
|
-
const { startDate } = this.parent;
|
|
7100
|
-
if (!startDate || !value) return false;
|
|
7101
|
-
return (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(
|
|
7102
|
-
(0, import_dayjs2.default)(startDate, dateFormat, true),
|
|
7103
|
-
"day"
|
|
7104
|
-
);
|
|
7105
|
-
}
|
|
7106
|
-
);
|
|
7107
|
-
var endTimeMustBeAfterStartTimeTest = yup.string().test(
|
|
7108
|
-
"valid-end-time",
|
|
7109
|
-
"End time must be after start time",
|
|
7110
|
-
function(value) {
|
|
7111
|
-
const { startDate, endDate, startTime } = this.parent;
|
|
7112
|
-
if (!startDate || !endDate || !startTime || !value) return false;
|
|
7113
|
-
const startDateTime = (0, import_dayjs2.default)(
|
|
7114
|
-
`${startDate} ${startTime}`,
|
|
7115
|
-
`${dateFormat} ${timeFormat}`,
|
|
7116
|
-
true
|
|
7117
|
-
);
|
|
7118
|
-
const endDateTime = (0, import_dayjs2.default)(
|
|
7119
|
-
`${endDate} ${value}`,
|
|
7120
|
-
`${dateFormat} ${timeFormat}`,
|
|
7121
|
-
true
|
|
7122
|
-
);
|
|
7123
|
-
return endDateTime.isAfter(startDateTime);
|
|
7124
|
-
}
|
|
7125
|
-
);
|
|
7126
|
-
var startTimeCannotBeInPastTest = yup.string().test(
|
|
7127
|
-
"valid-start-time",
|
|
7128
|
-
"Start time cannot be in the past",
|
|
7129
|
-
function(value) {
|
|
7130
|
-
const now = (0, import_dayjs2.default)();
|
|
7131
|
-
const { startDate } = this.parent;
|
|
7132
|
-
if (!startDate || !value) return false;
|
|
7133
|
-
const startDateTime = (0, import_dayjs2.default)(
|
|
7134
|
-
`${startDate} ${value}`,
|
|
7135
|
-
`${dateFormat} ${timeFormat}`,
|
|
7136
|
-
true
|
|
7137
|
-
);
|
|
7138
|
-
return startDateTime.isSameOrAfter(now);
|
|
7139
|
-
}
|
|
7140
|
-
);
|
|
7141
|
-
var dateTimeSchema = yup.object().shape({
|
|
7142
|
-
dateStatus: yup.mixed().oneOf(Object.values(EnumEventDateStatus)).required("Date status is required"),
|
|
7143
|
-
endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
7144
|
-
endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
7145
|
-
startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
|
|
7146
|
-
startTime: yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
7147
|
-
});
|
|
7148
|
-
var stallTypesSchema = yup.object({
|
|
7149
|
-
label: yup.string().trim().label("Stall Type").required("Stall type is required"),
|
|
7150
|
-
price: yup.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
|
|
7151
|
-
"no-leading-zeros",
|
|
7152
|
-
"",
|
|
7153
|
-
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
7154
|
-
),
|
|
7155
|
-
stallCapacity: yup.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Stall Capacity").typeError("Stall capacity must be a number").min(0, "Stall capacity cannot be negative").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
|
|
7156
|
-
});
|
|
7157
|
-
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
7158
|
-
stallTypes: yup.array().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
7159
|
-
});
|
|
7160
|
-
var locationSchema = yup.object().shape({
|
|
7161
|
-
city: yup.string().label("City").required("City is required"),
|
|
7162
|
-
country: yup.string().label("Country").required("Country is required"),
|
|
7163
|
-
fullAddress: yup.string().label("Address").required("Address is required"),
|
|
7164
|
-
geo: yup.object().shape({
|
|
7165
|
-
coordinates: yup.array().of(yup.number().required("Coordinates must be numbers")).length(
|
|
7166
|
-
2,
|
|
7167
|
-
"Coordinates must contain exactly two numbers (longitude, latitude)"
|
|
7168
|
-
).required("Coordinates are required"),
|
|
7169
|
-
type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
|
|
7170
|
-
}),
|
|
7171
|
-
latitude: yup.number().label("Latitude").required("Latitude is required"),
|
|
7172
|
-
longitude: yup.number().label("Longitude").required("Longitude is required"),
|
|
7173
|
-
region: yup.string().label("Region").required("Region is required")
|
|
7174
|
-
});
|
|
7175
|
-
var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
7176
|
-
var socialMediaSchema = yup.object({
|
|
7177
|
-
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
|
|
7178
|
-
link: yup.string().when("name", {
|
|
7179
|
-
is: (name) => !!name,
|
|
7180
|
-
// If name has a value
|
|
7181
|
-
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
7182
|
-
otherwise: (schema) => schema.notRequired()
|
|
7183
|
-
})
|
|
7184
|
-
});
|
|
7185
|
-
var globalResourceSchema = yup.object().shape({
|
|
7186
|
-
active: yup.boolean().required("Active is required"),
|
|
7187
|
-
cover: yup.object({
|
|
7188
|
-
source: yup.string().label("Cover").required("Cover Image is required"),
|
|
7189
|
-
title: yup.string().label("Cover Title").required("Cover Title is required")
|
|
7190
|
-
}),
|
|
7191
|
-
contactDetails: contactDetailsSchema,
|
|
7192
|
-
description: yup.string().label("Description").trim().min(50).required("Description is required"),
|
|
7193
|
-
name: yup.string().label("Name").trim().min(3).required("Name is required"),
|
|
7194
|
-
region: yup.string().label("Region").required("Region is required"),
|
|
7195
|
-
socialMedia: yup.array().of(socialMediaSchema).nullable().default(null),
|
|
7196
|
-
associates: yup.array().of(
|
|
7197
|
-
yup.object().shape({
|
|
7198
|
-
email: emailRequiredSchema,
|
|
7199
|
-
resourceId: yup.string().label("Resource ID").required("Resource ID is required"),
|
|
7200
|
-
resourceType: yup.mixed().oneOf(Object.values(EnumResourceType)).label("Resource Type").required("Resource Type is required"),
|
|
7201
|
-
licence: yup.object({
|
|
7202
|
-
expiryDate: yup.date().required("Expiry Date is required"),
|
|
7203
|
-
issuedDate: yup.date().required("Issued Date is required"),
|
|
7204
|
-
licenceType: yup.mixed().oneOf(Object.values(EnumUserLicence)).label("Licence Type").required("Licence Type is required")
|
|
7205
|
-
})
|
|
7206
|
-
})
|
|
7207
|
-
).nullable().default(null)
|
|
7208
|
-
});
|
|
7209
|
-
var categorySchema = yup.array().of(
|
|
7210
|
-
yup.object().shape({
|
|
7211
|
-
id: yup.string().required("Category id is required"),
|
|
7212
|
-
name: yup.string().required("Category name is required"),
|
|
7213
|
-
subcategories: yup.array().of(
|
|
7214
|
-
yup.object().shape({
|
|
7215
|
-
id: yup.string().defined(),
|
|
7216
|
-
items: yup.array().of(
|
|
7217
|
-
yup.object().shape({
|
|
7218
|
-
id: yup.string().defined(),
|
|
7219
|
-
name: yup.string().defined()
|
|
7220
|
-
})
|
|
7221
|
-
).nullable(),
|
|
7222
|
-
name: yup.string().defined()
|
|
7223
|
-
})
|
|
7224
|
-
).min(1, "At least one subcategory is required").required("Subcategories are required")
|
|
7225
|
-
})
|
|
7226
|
-
);
|
|
7227
|
-
|
|
7228
|
-
// src/yupSchema/event.ts
|
|
7229
|
-
var yup2 = __toESM(require("yup"));
|
|
7230
|
-
var eventSchema = globalResourceSchema.shape({
|
|
7231
|
-
dateTime: yup2.array().of(dateTimeSchema).min(1, "At least one Event date required").max(50, "You can only add up to 50 Event dates").required("DateTime is required").test(
|
|
7232
|
-
"unique-start-date-time",
|
|
7233
|
-
"Start Date and Start Time must be unique",
|
|
7234
|
-
function(value) {
|
|
7235
|
-
if (!value) return true;
|
|
7236
|
-
const seen = /* @__PURE__ */ new Set();
|
|
7237
|
-
for (const item of value) {
|
|
7238
|
-
if (!item.startDate || !item.startTime) continue;
|
|
7239
|
-
const key = `${item.startDate}_${item.startTime}`;
|
|
7240
|
-
if (seen.has(key)) {
|
|
7241
|
-
return false;
|
|
7242
|
-
}
|
|
7243
|
-
seen.add(key);
|
|
7244
|
-
}
|
|
7245
|
-
return true;
|
|
7246
|
-
}
|
|
7247
|
-
),
|
|
7248
|
-
eventType: yup2.mixed().oneOf(Object.values(EnumEventType), "Please select a valid Event type").required("Please select an Event type"),
|
|
7249
|
-
location: locationSchema,
|
|
7250
|
-
nzbn: yup2.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
7251
|
-
rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the event is rain or shine"),
|
|
7252
|
-
tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
|
|
7253
|
-
});
|
|
7254
|
-
var paymentInfoSchema = yup2.object({
|
|
7255
|
-
paymentMethod: yup2.mixed().oneOf(
|
|
7256
|
-
Object.values(EnumPaymentMethod),
|
|
7257
|
-
"Please select a valid Payment method"
|
|
7258
|
-
).required("Please select a Payment method"),
|
|
7259
|
-
accountHolderName: yup2.string().when("paymentMethod", {
|
|
7260
|
-
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
7261
|
-
then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
|
|
7262
|
-
otherwise: (schema) => schema.notRequired()
|
|
7263
|
-
}),
|
|
7264
|
-
accountNumber: yup2.string().when("paymentMethod", {
|
|
7265
|
-
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
7266
|
-
then: (schema) => schema.required("Account number is required for bank transfer").matches(
|
|
7267
|
-
nzBankAccountRegex,
|
|
7268
|
-
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
7269
|
-
).trim(),
|
|
7270
|
-
otherwise: (schema) => schema.notRequired()
|
|
7271
|
-
}),
|
|
7272
|
-
link: yup2.string().when("paymentMethod", {
|
|
7273
|
-
is: (val) => val === "paypal" /* PAYPAL */ || val === "stripe" /* STRIPE */,
|
|
7274
|
-
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
7275
|
-
otherwise: (schema) => schema.notRequired()
|
|
7276
|
-
})
|
|
7277
|
-
});
|
|
7278
|
-
var eventInfoSchema = yup2.object().shape({
|
|
7279
|
-
applicationDeadlineHours: yup2.number().label("Application Deadline Hours").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
|
|
7280
|
-
dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
7281
|
-
eventId: yup2.string().trim().required("Event ID is required"),
|
|
7282
|
-
packInTime: yup2.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Pack In Time").typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
|
|
7283
|
-
paymentDueHours: yup2.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Payment Due Hours").typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")).test(
|
|
7284
|
-
"payment-before-deadline",
|
|
7285
|
-
"Payment due hours must be less than application deadline hours",
|
|
7286
|
-
function(value) {
|
|
7287
|
-
const { applicationDeadlineHours } = this.parent;
|
|
7288
|
-
return value < applicationDeadlineHours;
|
|
7289
|
-
}
|
|
7290
|
-
),
|
|
7291
|
-
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required"),
|
|
7292
|
-
refundPolicy: yup2.array().of(
|
|
7293
|
-
yup2.object({
|
|
7294
|
-
category: yup2.mixed().required("Category is required"),
|
|
7295
|
-
label: yup2.string().required("Label is required"),
|
|
7296
|
-
value: yup2.boolean().required("Value is required")
|
|
7297
|
-
})
|
|
7298
|
-
).min(1, "At least one refund policy item is required").test(
|
|
7299
|
-
"at-least-one-true",
|
|
7300
|
-
"At least one refund policy option must be selected",
|
|
7301
|
-
(value) => {
|
|
7302
|
-
if (!value) return false;
|
|
7303
|
-
return value.some((item) => item.value === true);
|
|
7304
|
-
}
|
|
7305
|
-
).required("Refund policy is required")
|
|
7306
|
-
});
|
|
7307
|
-
|
|
7308
|
-
// src/yupSchema/vendor.ts
|
|
7309
|
-
var yup3 = __toESM(require("yup"));
|
|
7310
|
-
var vendorMenuSchema = yup3.object({
|
|
7311
|
-
description: yup3.string().nullable().optional(),
|
|
7312
|
-
name: yup3.string().nullable().required("Product name is required"),
|
|
7313
|
-
price: yup3.number().transform((v, o) => o === "" ? null : v).min(1, "Product price must be greater than 0").required("Product price is required"),
|
|
7314
|
-
priceUnit: yup3.string().required("Product unit is required")
|
|
7315
|
-
});
|
|
7316
|
-
var vendorSchema = globalResourceSchema.shape({
|
|
7317
|
-
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
7318
|
-
foodTruck: yup3.boolean().label("Food Truck").required("Please specify if the vendor is a food truck"),
|
|
7319
|
-
products: yup3.object().shape({
|
|
7320
|
-
active: yup3.boolean().nullable().optional(),
|
|
7321
|
-
productsList: yup3.array().of(vendorMenuSchema).nullable().optional()
|
|
7322
|
-
}).nullable().optional(),
|
|
7323
|
-
vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
7324
|
-
});
|
|
7325
|
-
var unregisteredVendorSchema = yup3.object().shape({
|
|
7326
|
-
categoryIds: yup3.array().of(yup3.string().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
7327
|
-
dateTime: yup3.array().of(dateTimeSchema).min(1, "DateTime list must contain at least one item").required("DateTime is required"),
|
|
7328
|
-
email: emailOptionalSchema,
|
|
7329
|
-
inviterId: yup3.string().required("Inviter ID is required"),
|
|
7330
|
-
name: yup3.string().label("Stallholder Name").trim().min(3, "Name must be at least 3 characters").required("Name is required"),
|
|
7331
|
-
region: yup3.string().label("Region").required("Region is required")
|
|
7332
|
-
});
|
|
7333
|
-
var vendorInfoSchema = yup3.object().shape({
|
|
7334
|
-
product: yup3.object().shape({
|
|
7335
|
-
foodFlavors: yup3.array().of(
|
|
7336
|
-
yup3.mixed().oneOf(Object.values(EnumFoodFlavor), "Invalid flavor selected").required("Flavor is required")
|
|
7337
|
-
).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
|
|
7338
|
-
packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
|
|
7339
|
-
priceRange: yup3.object().shape({
|
|
7340
|
-
max: yup3.string().required("Max price is required").test(
|
|
7341
|
-
"is-number",
|
|
7342
|
-
"Max price must be a valid number",
|
|
7343
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7344
|
-
).test(
|
|
7345
|
-
"is-greater",
|
|
7346
|
-
"Max price must be greater than or equal to Min price",
|
|
7347
|
-
function(max) {
|
|
7348
|
-
const { min } = this.parent;
|
|
7349
|
-
if (!max || !min) return true;
|
|
7350
|
-
const maxNum = Number(max);
|
|
7351
|
-
const minNum = Number(min);
|
|
7352
|
-
if (isNaN(maxNum) || isNaN(minNum)) return true;
|
|
7353
|
-
return maxNum >= minNum;
|
|
7354
|
-
}
|
|
7355
|
-
),
|
|
7356
|
-
min: yup3.string().required("Min price is required").test(
|
|
7357
|
-
"is-number",
|
|
7358
|
-
"Min price must be a valid number",
|
|
7359
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7360
|
-
)
|
|
7361
|
-
}),
|
|
7362
|
-
producedIn: yup3.array().of(yup3.string().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
|
|
7363
|
-
}),
|
|
7364
|
-
requirements: yup3.object().shape({
|
|
7365
|
-
electricity: yup3.object().shape({
|
|
7366
|
-
details: yup3.string().trim().test(
|
|
7367
|
-
"details-required",
|
|
7368
|
-
"Please add electricity details",
|
|
7369
|
-
function(value) {
|
|
7370
|
-
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
7371
|
-
}
|
|
7372
|
-
).nullable(),
|
|
7373
|
-
isRequired: yup3.boolean().required("Electricity requirement is required")
|
|
7374
|
-
}),
|
|
7375
|
-
gazebo: yup3.object().shape({
|
|
7376
|
-
details: yup3.string().trim().test(
|
|
7377
|
-
"details-required",
|
|
7378
|
-
"Please add gazebo details",
|
|
7379
|
-
function(value) {
|
|
7380
|
-
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
7381
|
-
}
|
|
7382
|
-
).nullable(),
|
|
7383
|
-
isRequired: yup3.boolean().required("Gazebo requirement is required")
|
|
7384
|
-
}),
|
|
7385
|
-
table: yup3.object().shape({
|
|
7386
|
-
details: yup3.string().trim().test(
|
|
7387
|
-
"details-required",
|
|
7388
|
-
"Please add table details",
|
|
7389
|
-
function(value) {
|
|
7390
|
-
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
7391
|
-
}
|
|
7392
|
-
).nullable(),
|
|
7393
|
-
isRequired: yup3.boolean().required("Table requirement is required")
|
|
7394
|
-
})
|
|
7395
|
-
}).optional(),
|
|
7396
|
-
stallInfo: yup3.object().shape({
|
|
7397
|
-
size: yup3.object().shape({
|
|
7398
|
-
depth: yup3.string().required("Depth is required").test(
|
|
7399
|
-
"is-number",
|
|
7400
|
-
"Depth must be a valid number",
|
|
7401
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7402
|
-
).test(
|
|
7403
|
-
"is-positive",
|
|
7404
|
-
"Depth must be greater than 0",
|
|
7405
|
-
(value) => value !== void 0 && value !== "" && Number(value) > 0
|
|
7406
|
-
),
|
|
7407
|
-
width: yup3.string().required("Width is required").test(
|
|
7408
|
-
"is-number",
|
|
7409
|
-
"Width must be a valid number",
|
|
7410
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7411
|
-
).test(
|
|
7412
|
-
"is-positive",
|
|
7413
|
-
"Width must be greater than 0",
|
|
7414
|
-
(value) => value !== void 0 && value !== "" && Number(value) > 0
|
|
7415
|
-
)
|
|
7416
|
-
})
|
|
7417
|
-
}),
|
|
7418
|
-
vendorId: yup3.string().trim().required("Vendor ID is required")
|
|
7419
|
-
});
|
|
7420
|
-
|
|
7421
|
-
// src/yupSchema/user.ts
|
|
7422
|
-
var yup4 = __toESM(require("yup"));
|
|
7423
|
-
var userSchema = yup4.object().shape({
|
|
7424
|
-
active: yup4.boolean().required("Active is required"),
|
|
7425
|
-
email: emailRequiredSchema,
|
|
7426
|
-
firstName: yup4.string().label("First Name").trim().required("First name is required"),
|
|
7427
|
-
lastName: yup4.string().label("Last Name").trim().required("Last name is required"),
|
|
7428
|
-
isTester: yup4.boolean().required("Tester status is required"),
|
|
7429
|
-
password: yup4.string().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
|
|
7430
|
-
preferredRegion: yup4.string().label("Preferred Region").required("Preferred region is required"),
|
|
7431
|
-
confirmPassword: yup4.string().nullable().trim().label("Confirm Password").when("password", {
|
|
7432
|
-
is: (val) => !!val,
|
|
7433
|
-
// only necessary if password typed
|
|
7434
|
-
then: (schema) => schema.required("Confirm Password is required").oneOf([yup4.ref("password")], "Passwords must match"),
|
|
7435
|
-
otherwise: (schema) => schema.notRequired()
|
|
7436
|
-
}),
|
|
7437
|
-
role: yup4.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
7438
|
-
});
|
|
7439
|
-
|
|
7440
|
-
// src/yupSchema/auth.ts
|
|
7441
|
-
var yup5 = __toESM(require("yup"));
|
|
7442
|
-
var loginSchema = yup5.object().shape({
|
|
7443
|
-
email: emailRequiredSchema,
|
|
7444
|
-
password: passwordSchema
|
|
7445
|
-
});
|
|
7446
|
-
var registerSchema = yup5.object().shape({
|
|
7447
|
-
email: emailRequiredSchema,
|
|
7448
|
-
firstName: yup5.string().label("First Name").required("First Name is required"),
|
|
7449
|
-
lastName: yup5.string().label("Last Name").required("Last Name is required"),
|
|
7450
|
-
password: passwordSchema,
|
|
7451
|
-
preferredRegion: yup5.string().label("Preferred Region").required("Preferred Region is required")
|
|
7452
|
-
});
|
|
7453
|
-
var requestPasswordResetSchema = yup5.object().shape({
|
|
7454
|
-
email: emailRequiredSchema
|
|
7455
|
-
});
|
|
7456
|
-
var resetPasswordSchema = yup5.object().shape({
|
|
7457
|
-
email: emailRequiredSchema,
|
|
7458
|
-
password: passwordSchema,
|
|
7459
|
-
// eslint-disable-next-line sort-keys
|
|
7460
|
-
confirmPassword: yup5.string().oneOf([yup5.ref("password")], "Passwords must match").required("Confirm Password is required")
|
|
7461
|
-
});
|
|
7462
|
-
var validateVerificationTokenSchema = yup5.object().shape({
|
|
7463
|
-
email: emailRequiredSchema,
|
|
7464
|
-
verificationToken: yup5.string().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
7465
|
-
});
|
|
7466
|
-
|
|
7467
|
-
// src/yupSchema/ad.ts
|
|
7468
|
-
var yup6 = __toESM(require("yup"));
|
|
7469
|
-
|
|
7470
|
-
// src/types/ad.ts
|
|
7471
|
-
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
7472
|
-
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
7473
|
-
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
7474
|
-
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
7475
|
-
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
7476
|
-
return EnumAdShowOn2;
|
|
7477
|
-
})(EnumAdShowOn || {});
|
|
7478
|
-
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
7479
|
-
EnumAdStatus2["ACTIVE"] = "Active";
|
|
7480
|
-
EnumAdStatus2["PAUSED"] = "Paused";
|
|
7481
|
-
EnumAdStatus2["EXPIRED"] = "Expired";
|
|
7482
|
-
return EnumAdStatus2;
|
|
7483
|
-
})(EnumAdStatus || {});
|
|
7484
|
-
var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
|
|
7485
|
-
EnumAdType2["SPONSORED"] = "Sponsored";
|
|
7486
|
-
EnumAdType2["FREE"] = "Free";
|
|
7487
|
-
return EnumAdType2;
|
|
7488
|
-
})(EnumAdType || {});
|
|
7489
|
-
var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
7490
|
-
EnumAdStyle2["BLOOM"] = "Bloom";
|
|
7491
|
-
EnumAdStyle2["RISE"] = "Rise";
|
|
7492
|
-
return EnumAdStyle2;
|
|
7493
|
-
})(EnumAdStyle || {});
|
|
7494
|
-
|
|
7495
|
-
// src/yupSchema/ad.ts
|
|
7496
|
-
var adResourceSchema = yup6.object({
|
|
7497
|
-
adDescription: yup6.string().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
|
|
7498
|
-
adImage: yup6.string().required("Ad image is required"),
|
|
7499
|
-
adStyle: yup6.mixed().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
7500
|
-
adTitle: yup6.string().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
|
|
7501
|
-
adType: yup6.mixed().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
7502
|
-
resourceId: yup6.string().required("Resource ID is required"),
|
|
7503
|
-
resourceName: yup6.string().required("Resource name is required"),
|
|
7504
|
-
resourceRegion: yup6.string().required("Resource region is required"),
|
|
7505
|
-
resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
|
|
7506
|
-
});
|
|
7507
|
-
var adSchema = yup6.object().shape({
|
|
7508
|
-
active: yup6.boolean().required("Active status is required"),
|
|
7509
|
-
end: yup6.date().required("End date is required").test("is-future-date", "End date must be in the future", (value) => {
|
|
7510
|
-
if (!value) return false;
|
|
7511
|
-
const endDate = new Date(value);
|
|
7512
|
-
const now = /* @__PURE__ */ new Date();
|
|
7513
|
-
return endDate > now;
|
|
7514
|
-
}).when("start", {
|
|
7515
|
-
is: (val) => val && val.length > 0,
|
|
7516
|
-
then: (schema) => schema.test(
|
|
7517
|
-
"is-after-start",
|
|
7518
|
-
"End date must be after start date",
|
|
7519
|
-
function(value) {
|
|
7520
|
-
const { start } = this.parent;
|
|
7521
|
-
if (!value || !start) return false;
|
|
7522
|
-
return new Date(value) > new Date(start);
|
|
7523
|
-
}
|
|
7524
|
-
)
|
|
7525
|
-
}),
|
|
7526
|
-
resource: adResourceSchema.required("Resource information is required"),
|
|
7527
|
-
showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(EnumAdShowOn)).required()).min(1, "At least one display location is required").required("Display location is required"),
|
|
7528
|
-
status: yup6.mixed().oneOf(Object.values(EnumAdStatus)).required("Ad status is required"),
|
|
7529
|
-
start: yup6.date().when("status", {
|
|
7530
|
-
is: (status) => status !== "Active" /* ACTIVE */,
|
|
7531
|
-
then: () => yup6.date().required("Start date is required").test("is-future-date", "Start date must be in the future", (value) => {
|
|
7532
|
-
if (!value) return false;
|
|
7533
|
-
return value > /* @__PURE__ */ new Date();
|
|
7534
|
-
}),
|
|
7535
|
-
// Keep `start` optional (not null) when ACTIVE to match TS type `start?: Date`.
|
|
7536
|
-
otherwise: () => yup6.date().notRequired()
|
|
7537
|
-
}),
|
|
7538
|
-
targetRegion: yup6.array().of(yup6.string().required()).min(1, "At least one target region is required").required("Target region is required")
|
|
7539
|
-
});
|
|
7540
|
-
|
|
7541
|
-
// src/yupSchema/partner.ts
|
|
7542
|
-
var yup7 = __toESM(require("yup"));
|
|
7543
|
-
var partnerSchema = globalResourceSchema.shape({
|
|
7544
|
-
location: locationSchema,
|
|
7545
|
-
nzbn: yup7.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
7546
|
-
partnerType: yup7.mixed().oneOf(Object.values(EnumPartnerType), "Please select a valid Partner type").required("Please select a Partner type")
|
|
7547
|
-
});
|
|
7548
|
-
|
|
7549
|
-
// src/yupSchema/post.ts
|
|
7550
|
-
var yup8 = __toESM(require("yup"));
|
|
7551
|
-
|
|
7552
|
-
// src/types/post.ts
|
|
7553
|
-
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
7554
|
-
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
7555
|
-
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
7556
|
-
EnumPostType2["DAILY_GAMES"] = "daily_games";
|
|
7557
|
-
return EnumPostType2;
|
|
7558
|
-
})(EnumPostType || {});
|
|
7559
|
-
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
7560
|
-
EnumPostContentType2["GAME"] = "game";
|
|
7561
|
-
EnumPostContentType2["IMAGE"] = "image";
|
|
7562
|
-
EnumPostContentType2["LIST"] = "list";
|
|
7563
|
-
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
7564
|
-
EnumPostContentType2["VIDEO"] = "video";
|
|
7565
|
-
return EnumPostContentType2;
|
|
7566
|
-
})(EnumPostContentType || {});
|
|
7567
|
-
|
|
7568
|
-
// src/yupSchema/post.ts
|
|
7569
|
-
var postContentSchema = yup8.object().shape({
|
|
7570
|
-
contentData: yup8.mixed().optional().nullable(),
|
|
7571
|
-
contentOrder: yup8.number().nullable(),
|
|
7572
|
-
contentType: yup8.mixed().oneOf(Object.values(EnumPostContentType)).nullable()
|
|
7573
|
-
});
|
|
7574
|
-
var postSchema = yup8.object().shape({
|
|
7575
|
-
active: yup8.boolean().required(),
|
|
7576
|
-
caption: yup8.string().required(),
|
|
7577
|
-
content: yup8.array().of(postContentSchema).required(),
|
|
7578
|
-
postType: yup8.mixed().oneOf(Object.values(EnumPostType)).required(),
|
|
7579
|
-
resource: yup8.object({
|
|
7580
|
-
resourceId: yup8.string().required(),
|
|
7581
|
-
resourceRegion: yup8.string().required(),
|
|
7582
|
-
resourceType: yup8.mixed().oneOf(Object.values(EnumResourceType)).required()
|
|
7583
|
-
}).nullable().optional(),
|
|
7584
|
-
tags: yup8.array().of(yup8.string().required()).nullable().optional(),
|
|
7585
|
-
title: yup8.string().required()
|
|
7586
|
-
});
|
|
7587
|
-
|
|
7588
|
-
// src/yupSchema/appSettings.ts
|
|
7589
|
-
var yup9 = __toESM(require("yup"));
|
|
7590
|
-
var appSettingsSchema = yup9.object({
|
|
7591
|
-
appVersion: yup9.string().trim().label("App Version").matches(
|
|
7592
|
-
/^\d+\.\d+\.\d+$/,
|
|
7593
|
-
"App Version must be in the format X.Y.Z (e.g. 1.12.50)"
|
|
7594
|
-
).required("App Version is required"),
|
|
7595
|
-
isOfflineMode: yup9.boolean().label("Is Offline Mode").required("Is Offline Mode is required")
|
|
7596
|
-
});
|
|
7597
|
-
|
|
7598
|
-
// src/hooks/utils.ts
|
|
7599
|
-
var defaultLocation = {
|
|
7600
|
-
city: "",
|
|
7601
|
-
country: "",
|
|
7602
|
-
fullAddress: "",
|
|
7603
|
-
geo: {
|
|
7604
|
-
coordinates: [0, 0],
|
|
7605
|
-
// [longitude, latitude]
|
|
7606
|
-
type: "Point"
|
|
7607
|
-
},
|
|
7608
|
-
latitude: 0,
|
|
7609
|
-
longitude: 0,
|
|
7610
|
-
region: ""
|
|
7611
|
-
};
|
|
7612
|
-
var globalDefaultValues = {
|
|
7613
|
-
active: false,
|
|
7614
|
-
associates: null,
|
|
7615
|
-
contactDetails: {
|
|
7616
|
-
email: null,
|
|
7617
|
-
landlinePhone: null,
|
|
7618
|
-
mobilePhone: null
|
|
7619
|
-
},
|
|
7620
|
-
cover: {
|
|
7621
|
-
active: true,
|
|
7622
|
-
source: "",
|
|
7623
|
-
title: ""
|
|
7624
|
-
},
|
|
7625
|
-
coverUpload: {
|
|
7626
|
-
active: true,
|
|
7627
|
-
source: "",
|
|
7628
|
-
title: ""
|
|
7629
|
-
},
|
|
7630
|
-
description: "",
|
|
7631
|
-
images: null,
|
|
7632
|
-
imagesUpload: null,
|
|
7633
|
-
logo: null,
|
|
7634
|
-
logoUpload: null,
|
|
7635
|
-
name: "",
|
|
7636
|
-
promoCodes: [],
|
|
7637
|
-
region: "",
|
|
7638
|
-
socialMedia: []
|
|
7639
|
-
};
|
|
7640
|
-
var defaultPartnerFormValues = {
|
|
7641
|
-
...globalDefaultValues,
|
|
7642
|
-
location: defaultLocation,
|
|
7643
|
-
nzbn: "",
|
|
7644
|
-
partnerType: ""
|
|
7645
|
-
};
|
|
7646
|
-
var defaultEventFormValues = {
|
|
7647
|
-
...globalDefaultValues,
|
|
7648
|
-
claimed: true,
|
|
7649
|
-
dateTime: [],
|
|
7650
|
-
eventType: "",
|
|
7651
|
-
googlePlaceId: null,
|
|
7652
|
-
location: defaultLocation,
|
|
7653
|
-
nzbn: "",
|
|
7654
|
-
provider: null,
|
|
7655
|
-
rainOrShine: false,
|
|
7656
|
-
tags: []
|
|
7657
|
-
};
|
|
7658
|
-
var defaultEventInfoFormValues = {
|
|
7659
|
-
applicationDeadlineHours: 24,
|
|
7660
|
-
dateTime: [],
|
|
7661
|
-
eventId: "",
|
|
7662
|
-
packInTime: 2,
|
|
7663
|
-
// e.g., 2 hours before event opens
|
|
7664
|
-
paymentDueHours: 12,
|
|
7665
|
-
paymentInfo: [],
|
|
7666
|
-
refundPolicy: [],
|
|
7667
|
-
requirements: []
|
|
7668
|
-
};
|
|
7669
|
-
var defaultVendorFormValues = {
|
|
7670
|
-
...globalDefaultValues,
|
|
7671
|
-
availability: {
|
|
7672
|
-
corporate: false,
|
|
7673
|
-
private: false,
|
|
7674
|
-
school: false
|
|
7675
|
-
},
|
|
7676
|
-
categories: [],
|
|
7677
|
-
claimed: true,
|
|
7678
|
-
foodTruck: false,
|
|
7679
|
-
products: null,
|
|
7680
|
-
unregisteredVendorId: null,
|
|
7681
|
-
vendorType: "Stallholder" /* STALLHOLDER */
|
|
7682
|
-
};
|
|
7683
|
-
var defaultUnregisteredVendorFormValues = {
|
|
7684
|
-
categoryIds: [],
|
|
7685
|
-
dateTime: [],
|
|
7686
|
-
email: null,
|
|
7687
|
-
inviterId: "",
|
|
7688
|
-
name: "",
|
|
7689
|
-
region: ""
|
|
7690
|
-
};
|
|
7691
|
-
var defaultVendorInfoFormValues = {
|
|
7692
|
-
compliance: { foodBeverageLicense: false, liabilityInsurance: false },
|
|
7693
|
-
documents: null,
|
|
7694
|
-
documentsUpload: null,
|
|
7695
|
-
product: {
|
|
7696
|
-
foodFlavors: [],
|
|
7697
|
-
packaging: [],
|
|
7698
|
-
priceRange: { max: "", min: "" },
|
|
7699
|
-
producedIn: []
|
|
7700
|
-
},
|
|
7701
|
-
requirements: {
|
|
7702
|
-
electricity: { details: null, isRequired: false },
|
|
7703
|
-
gazebo: { details: null, isRequired: false },
|
|
7704
|
-
table: { details: null, isRequired: false }
|
|
7705
|
-
},
|
|
7706
|
-
stallInfo: {
|
|
7707
|
-
size: { depth: "", width: "" }
|
|
7708
|
-
},
|
|
7709
|
-
vendorId: ""
|
|
7710
|
-
};
|
|
7711
|
-
function mapBaseResourceTypeToFormData(data) {
|
|
7712
|
-
return {
|
|
7713
|
-
_id: data._id,
|
|
7714
|
-
active: data.active,
|
|
7715
|
-
associates: data.associates,
|
|
7716
|
-
contactDetails: data.contactDetails,
|
|
7717
|
-
cover: data.cover,
|
|
7718
|
-
coverUpload: data.coverUpload,
|
|
7719
|
-
description: data.description,
|
|
7720
|
-
images: data.images,
|
|
7721
|
-
imagesUpload: data.imagesUpload,
|
|
7722
|
-
logo: data.logo,
|
|
7723
|
-
logoUpload: data.logoUpload,
|
|
7724
|
-
name: data.name,
|
|
7725
|
-
owner: data.owner,
|
|
7726
|
-
promoCodes: data.promoCodes,
|
|
7727
|
-
region: data.region,
|
|
7728
|
-
socialMedia: data.socialMedia,
|
|
7729
|
-
termsAgreement: data.termsAgreement
|
|
7730
|
-
};
|
|
7731
|
-
}
|
|
7732
|
-
|
|
7733
|
-
// src/hooks/vendor/useVendorForm.ts
|
|
7734
|
-
function useVendorForm(data) {
|
|
7735
|
-
const {
|
|
7736
|
-
control,
|
|
7737
|
-
formState,
|
|
7738
|
-
getValues,
|
|
7739
|
-
handleSubmit,
|
|
7740
|
-
reset,
|
|
7741
|
-
setValue,
|
|
7742
|
-
watch
|
|
7743
|
-
} = (0, import_react_hook_form.useForm)({
|
|
7744
|
-
defaultValues: defaultVendorFormValues,
|
|
7745
|
-
resolver: (0, import_yup.yupResolver)(vendorSchema)
|
|
7746
|
-
});
|
|
7747
|
-
React.useEffect(() => {
|
|
7748
|
-
if (data) {
|
|
7749
|
-
reset({
|
|
7750
|
-
...mapBaseResourceTypeToFormData(data),
|
|
7751
|
-
availability: data.availability,
|
|
7752
|
-
calendar: data.calendar,
|
|
7753
|
-
categories: data.categories,
|
|
7754
|
-
claimed: data.claimed ?? false,
|
|
7755
|
-
foodTruck: data.foodTruck,
|
|
7756
|
-
products: data.products,
|
|
7757
|
-
unregisteredVendorId: data.unregisteredVendorId,
|
|
7758
|
-
vendorType: data.vendorType
|
|
7759
|
-
});
|
|
7760
|
-
} else {
|
|
7761
|
-
reset(defaultVendorFormValues);
|
|
7762
|
-
}
|
|
7763
|
-
}, [data]);
|
|
7764
|
-
const {
|
|
7765
|
-
_id,
|
|
7766
|
-
active,
|
|
7767
|
-
associates,
|
|
7768
|
-
availability,
|
|
7769
|
-
calendar,
|
|
7770
|
-
categories,
|
|
7771
|
-
claimed,
|
|
7772
|
-
contactDetails,
|
|
7773
|
-
cover,
|
|
7774
|
-
coverUpload,
|
|
7775
|
-
description,
|
|
7776
|
-
foodTruck,
|
|
7777
|
-
images,
|
|
7778
|
-
imagesUpload,
|
|
7779
|
-
logo,
|
|
7780
|
-
logoUpload,
|
|
7781
|
-
name,
|
|
7782
|
-
owner,
|
|
7783
|
-
products,
|
|
7784
|
-
promoCodes,
|
|
7785
|
-
region,
|
|
7786
|
-
socialMedia: socialMedia2,
|
|
7787
|
-
termsAgreement,
|
|
7788
|
-
unregisteredVendorId,
|
|
7789
|
-
vendorType
|
|
7790
|
-
} = getValues();
|
|
7791
|
-
return {
|
|
7792
|
-
control,
|
|
7793
|
-
fields: {
|
|
7794
|
-
_id,
|
|
7795
|
-
active,
|
|
7796
|
-
associates,
|
|
7797
|
-
availability,
|
|
7798
|
-
calendar,
|
|
7799
|
-
categories,
|
|
7800
|
-
claimed,
|
|
7801
|
-
contactDetails,
|
|
7802
|
-
cover,
|
|
7803
|
-
coverUpload,
|
|
7804
|
-
description,
|
|
7805
|
-
foodTruck,
|
|
7806
|
-
images,
|
|
7807
|
-
imagesUpload,
|
|
7808
|
-
logo,
|
|
7809
|
-
logoUpload,
|
|
7810
|
-
name,
|
|
7811
|
-
owner,
|
|
7812
|
-
products,
|
|
7813
|
-
promoCodes,
|
|
7814
|
-
region,
|
|
7815
|
-
socialMedia: socialMedia2,
|
|
7816
|
-
termsAgreement,
|
|
7817
|
-
unregisteredVendorId,
|
|
7818
|
-
vendorType
|
|
7819
|
-
},
|
|
7820
|
-
formState,
|
|
7821
|
-
getValues,
|
|
7822
|
-
handleSubmit,
|
|
7823
|
-
reset,
|
|
7824
|
-
setValue,
|
|
7825
|
-
watch
|
|
7826
|
-
};
|
|
7827
|
-
}
|
|
7828
|
-
|
|
7829
|
-
// src/hooks/vendor/useVendorInfoForm.ts
|
|
7830
|
-
var import_yup2 = require("@hookform/resolvers/yup");
|
|
7831
|
-
var React2 = __toESM(require("react"));
|
|
7832
|
-
var import_react_hook_form2 = require("react-hook-form");
|
|
7833
|
-
function useVendorInfoForm(data) {
|
|
7834
|
-
const {
|
|
7835
|
-
control,
|
|
7836
|
-
formState,
|
|
7837
|
-
getValues,
|
|
7838
|
-
handleSubmit,
|
|
7839
|
-
reset,
|
|
7840
|
-
setValue,
|
|
7841
|
-
watch
|
|
7842
|
-
} = (0, import_react_hook_form2.useForm)({
|
|
7843
|
-
defaultValues: defaultVendorInfoFormValues,
|
|
7844
|
-
resolver: (0, import_yup2.yupResolver)(vendorInfoSchema)
|
|
7845
|
-
});
|
|
7846
|
-
React2.useEffect(() => {
|
|
7847
|
-
if (data) {
|
|
7848
|
-
reset({
|
|
7849
|
-
_id: data._id,
|
|
7850
|
-
compliance: data.compliance,
|
|
7851
|
-
documents: data.documents,
|
|
7852
|
-
documentsUpload: data.documentsUpload,
|
|
7853
|
-
product: data.product,
|
|
7854
|
-
requirements: data.requirements,
|
|
7855
|
-
stallInfo: data.stallInfo,
|
|
7856
|
-
vendorId: data.vendorId
|
|
7857
|
-
});
|
|
7858
|
-
} else {
|
|
7859
|
-
reset(defaultVendorInfoFormValues);
|
|
7860
|
-
}
|
|
7861
|
-
}, [data]);
|
|
7862
|
-
const {
|
|
7863
|
-
_id,
|
|
7864
|
-
compliance,
|
|
7865
|
-
documents,
|
|
7866
|
-
documentsUpload,
|
|
7867
|
-
product,
|
|
7868
|
-
requirements,
|
|
7869
|
-
stallInfo,
|
|
7870
|
-
vendorId
|
|
7871
|
-
} = getValues();
|
|
7872
|
-
return {
|
|
7873
|
-
control,
|
|
7874
|
-
fields: {
|
|
7875
|
-
_id,
|
|
7876
|
-
compliance,
|
|
7877
|
-
documents,
|
|
7878
|
-
documentsUpload,
|
|
7879
|
-
product,
|
|
7880
|
-
requirements,
|
|
7881
|
-
stallInfo,
|
|
7882
|
-
vendorId
|
|
7883
|
-
},
|
|
7884
|
-
formState,
|
|
7885
|
-
getValues,
|
|
7886
|
-
handleSubmit,
|
|
7887
|
-
reset,
|
|
7888
|
-
setValue,
|
|
7889
|
-
watch
|
|
7890
|
-
};
|
|
7891
|
-
}
|
|
7892
|
-
|
|
7893
|
-
// src/hooks/vendor/useUnregisteredVendorForm.ts
|
|
7894
|
-
var import_yup3 = require("@hookform/resolvers/yup");
|
|
7895
|
-
var React3 = __toESM(require("react"));
|
|
7896
|
-
var import_react_hook_form3 = require("react-hook-form");
|
|
7897
|
-
function useUnregisteredVendorForm(data) {
|
|
7898
|
-
const {
|
|
7899
|
-
control,
|
|
7900
|
-
formState,
|
|
7901
|
-
getValues,
|
|
7902
|
-
handleSubmit,
|
|
7903
|
-
reset,
|
|
7904
|
-
setValue,
|
|
7905
|
-
watch
|
|
7906
|
-
} = (0, import_react_hook_form3.useForm)({
|
|
7907
|
-
defaultValues: defaultUnregisteredVendorFormValues,
|
|
7908
|
-
resolver: (0, import_yup3.yupResolver)(unregisteredVendorSchema)
|
|
7909
|
-
});
|
|
7910
|
-
React3.useEffect(() => {
|
|
7911
|
-
if (data) {
|
|
7912
|
-
reset({
|
|
7913
|
-
categoryIds: data.categoryIds,
|
|
7914
|
-
dateTime: data.dateTime,
|
|
7915
|
-
email: data.email,
|
|
7916
|
-
inviterId: data.inviterId,
|
|
7917
|
-
name: data.name,
|
|
7918
|
-
region: data.region
|
|
7919
|
-
});
|
|
7920
|
-
} else {
|
|
7921
|
-
reset(defaultUnregisteredVendorFormValues);
|
|
7922
|
-
}
|
|
7923
|
-
}, [data]);
|
|
7924
|
-
const { categoryIds, dateTime, email, inviterId, name, region } = getValues();
|
|
7925
|
-
return {
|
|
7926
|
-
control,
|
|
7927
|
-
fields: {
|
|
7928
|
-
categoryIds,
|
|
7929
|
-
dateTime,
|
|
7930
|
-
email,
|
|
7931
|
-
inviterId,
|
|
7932
|
-
name,
|
|
7933
|
-
region
|
|
7934
|
-
},
|
|
7935
|
-
formState,
|
|
7936
|
-
getValues,
|
|
7937
|
-
handleSubmit,
|
|
7938
|
-
reset,
|
|
7939
|
-
setValue,
|
|
7940
|
-
watch
|
|
7941
|
-
};
|
|
7942
|
-
}
|
|
7943
|
-
|
|
7944
|
-
// src/hooks/event/useEventForm.ts
|
|
7945
|
-
var import_yup4 = require("@hookform/resolvers/yup");
|
|
7946
|
-
var React4 = __toESM(require("react"));
|
|
7947
|
-
var import_react_hook_form4 = require("react-hook-form");
|
|
7948
|
-
function useEventForm(data) {
|
|
7949
|
-
const {
|
|
7950
|
-
control,
|
|
7951
|
-
formState,
|
|
7952
|
-
getValues,
|
|
7953
|
-
handleSubmit,
|
|
7954
|
-
reset,
|
|
7955
|
-
setValue,
|
|
7956
|
-
watch
|
|
7957
|
-
} = (0, import_react_hook_form4.useForm)({
|
|
7958
|
-
defaultValues: defaultEventFormValues,
|
|
7959
|
-
resolver: (0, import_yup4.yupResolver)(eventSchema)
|
|
7960
|
-
});
|
|
7961
|
-
React4.useEffect(() => {
|
|
7962
|
-
if (data) {
|
|
7963
|
-
reset({
|
|
7964
|
-
...mapBaseResourceTypeToFormData(data),
|
|
7965
|
-
claimed: data.claimed ?? false,
|
|
7966
|
-
dateTime: data.dateTime,
|
|
7967
|
-
eventType: data.eventType,
|
|
7968
|
-
googlePlaceId: data.googlePlaceId,
|
|
7969
|
-
location: data.location,
|
|
7970
|
-
nzbn: data.nzbn,
|
|
7971
|
-
provider: data.provider,
|
|
7972
|
-
rainOrShine: data.rainOrShine,
|
|
7973
|
-
tags: data.tags
|
|
7974
|
-
});
|
|
7975
|
-
} else {
|
|
7976
|
-
reset(defaultEventFormValues);
|
|
7977
|
-
}
|
|
7978
|
-
}, [data]);
|
|
7979
|
-
const {
|
|
7980
|
-
_id,
|
|
7981
|
-
active,
|
|
7982
|
-
associates,
|
|
7983
|
-
claimed,
|
|
7984
|
-
contactDetails,
|
|
7985
|
-
cover,
|
|
7986
|
-
coverUpload,
|
|
7987
|
-
dateTime,
|
|
7988
|
-
description,
|
|
7989
|
-
eventType,
|
|
7990
|
-
googlePlaceId,
|
|
7991
|
-
images,
|
|
7992
|
-
imagesUpload,
|
|
7993
|
-
location,
|
|
7994
|
-
logo,
|
|
7995
|
-
logoUpload,
|
|
7996
|
-
name,
|
|
7997
|
-
nzbn,
|
|
7998
|
-
owner,
|
|
7999
|
-
promoCodes,
|
|
8000
|
-
provider,
|
|
8001
|
-
rainOrShine,
|
|
8002
|
-
region,
|
|
8003
|
-
socialMedia: socialMedia2,
|
|
8004
|
-
tags,
|
|
8005
|
-
termsAgreement
|
|
8006
|
-
} = getValues();
|
|
8007
|
-
return {
|
|
8008
|
-
control,
|
|
8009
|
-
fields: {
|
|
8010
|
-
_id,
|
|
8011
|
-
active,
|
|
8012
|
-
associates,
|
|
8013
|
-
claimed,
|
|
8014
|
-
contactDetails,
|
|
8015
|
-
cover,
|
|
8016
|
-
coverUpload,
|
|
8017
|
-
dateTime,
|
|
8018
|
-
description,
|
|
8019
|
-
eventType,
|
|
8020
|
-
googlePlaceId,
|
|
8021
|
-
images,
|
|
8022
|
-
imagesUpload,
|
|
8023
|
-
location,
|
|
8024
|
-
logo,
|
|
8025
|
-
logoUpload,
|
|
8026
|
-
name,
|
|
8027
|
-
nzbn,
|
|
8028
|
-
owner,
|
|
8029
|
-
promoCodes,
|
|
8030
|
-
provider,
|
|
8031
|
-
rainOrShine,
|
|
8032
|
-
region,
|
|
8033
|
-
socialMedia: socialMedia2,
|
|
8034
|
-
tags,
|
|
8035
|
-
termsAgreement
|
|
8036
|
-
},
|
|
8037
|
-
formState,
|
|
8038
|
-
getValues,
|
|
8039
|
-
handleSubmit,
|
|
8040
|
-
reset,
|
|
8041
|
-
setValue,
|
|
8042
|
-
watch
|
|
8043
|
-
};
|
|
8044
|
-
}
|
|
8045
|
-
|
|
8046
|
-
// src/hooks/event/useEventInfoForm.ts
|
|
8047
|
-
var import_yup5 = require("@hookform/resolvers/yup");
|
|
8048
|
-
var React5 = __toESM(require("react"));
|
|
8049
|
-
var import_react_hook_form5 = require("react-hook-form");
|
|
8050
|
-
function useEventInfoForm(data) {
|
|
8051
|
-
const {
|
|
8052
|
-
control,
|
|
8053
|
-
formState,
|
|
8054
|
-
getValues,
|
|
8055
|
-
handleSubmit,
|
|
8056
|
-
reset,
|
|
8057
|
-
setValue,
|
|
8058
|
-
watch
|
|
8059
|
-
} = (0, import_react_hook_form5.useForm)({
|
|
8060
|
-
defaultValues: defaultEventInfoFormValues,
|
|
8061
|
-
resolver: (0, import_yup5.yupResolver)(eventInfoSchema)
|
|
8062
|
-
});
|
|
8063
|
-
React5.useEffect(() => {
|
|
8064
|
-
if (data) {
|
|
8065
|
-
reset({
|
|
8066
|
-
_id: data._id,
|
|
8067
|
-
applicationDeadlineHours: data.applicationDeadlineHours,
|
|
8068
|
-
dateTime: data.dateTime,
|
|
8069
|
-
eventId: data.eventId,
|
|
8070
|
-
packInTime: data.packInTime,
|
|
8071
|
-
paymentDueHours: data.paymentDueHours,
|
|
8072
|
-
paymentInfo: data.paymentInfo,
|
|
8073
|
-
refundPolicy: data.refundPolicy,
|
|
8074
|
-
requirements: data.requirements
|
|
8075
|
-
});
|
|
8076
|
-
} else {
|
|
8077
|
-
reset(defaultEventInfoFormValues);
|
|
8078
|
-
}
|
|
8079
|
-
}, [data]);
|
|
8080
|
-
const {
|
|
8081
|
-
_id,
|
|
8082
|
-
applicationDeadlineHours,
|
|
8083
|
-
dateTime,
|
|
8084
|
-
eventId,
|
|
8085
|
-
packInTime,
|
|
8086
|
-
paymentDueHours,
|
|
8087
|
-
paymentInfo,
|
|
8088
|
-
refundPolicy,
|
|
8089
|
-
requirements
|
|
8090
|
-
} = getValues();
|
|
8091
|
-
return {
|
|
8092
|
-
control,
|
|
8093
|
-
fields: {
|
|
8094
|
-
_id,
|
|
8095
|
-
applicationDeadlineHours,
|
|
8096
|
-
dateTime,
|
|
8097
|
-
eventId,
|
|
8098
|
-
packInTime,
|
|
8099
|
-
paymentDueHours,
|
|
8100
|
-
paymentInfo,
|
|
8101
|
-
refundPolicy,
|
|
8102
|
-
requirements
|
|
8103
|
-
},
|
|
8104
|
-
formState,
|
|
8105
|
-
getValues,
|
|
8106
|
-
handleSubmit,
|
|
8107
|
-
reset,
|
|
8108
|
-
setValue,
|
|
8109
|
-
watch
|
|
8110
|
-
};
|
|
8111
|
-
}
|
|
8112
|
-
|
|
8113
|
-
// src/hooks/useUserForm.ts
|
|
8114
|
-
var import_yup6 = require("@hookform/resolvers/yup");
|
|
8115
|
-
var React6 = __toESM(require("react"));
|
|
8116
|
-
var import_react_hook_form6 = require("react-hook-form");
|
|
8117
|
-
var defaultValues = {
|
|
8118
|
-
active: false,
|
|
8119
|
-
avatar: null,
|
|
8120
|
-
avatarUpload: null,
|
|
8121
|
-
confirmPassword: "",
|
|
8122
|
-
email: "",
|
|
8123
|
-
firstName: "",
|
|
8124
|
-
isTester: false,
|
|
8125
|
-
lastName: "",
|
|
8126
|
-
password: null,
|
|
8127
|
-
preferredRegion: "",
|
|
8128
|
-
role: "customer" /* CUSTOMER */
|
|
8129
|
-
};
|
|
8130
|
-
function useUserForm(data) {
|
|
8131
|
-
const {
|
|
8132
|
-
control,
|
|
8133
|
-
formState,
|
|
8134
|
-
getValues,
|
|
8135
|
-
handleSubmit,
|
|
8136
|
-
reset,
|
|
8137
|
-
setValue,
|
|
8138
|
-
watch
|
|
8139
|
-
} = (0, import_react_hook_form6.useForm)({
|
|
8140
|
-
defaultValues,
|
|
8141
|
-
resolver: (0, import_yup6.yupResolver)(userSchema)
|
|
8142
|
-
});
|
|
8143
|
-
React6.useEffect(() => {
|
|
8144
|
-
if (data) {
|
|
8145
|
-
reset({
|
|
8146
|
-
_id: data._id,
|
|
8147
|
-
active: data.active,
|
|
8148
|
-
avatar: data.avatar,
|
|
8149
|
-
avatarUpload: data.avatarUpload,
|
|
8150
|
-
email: data.email,
|
|
8151
|
-
firstName: data.firstName,
|
|
8152
|
-
isTester: data.isTester,
|
|
8153
|
-
lastName: data.lastName,
|
|
8154
|
-
password: data.password,
|
|
8155
|
-
preferredRegion: data.preferredRegion,
|
|
8156
|
-
role: data.role,
|
|
8157
|
-
termsAgreement: data.termsAgreement
|
|
8158
|
-
});
|
|
8159
|
-
} else {
|
|
8160
|
-
reset(defaultValues);
|
|
8161
|
-
}
|
|
8162
|
-
}, [data]);
|
|
8163
|
-
const {
|
|
8164
|
-
_id,
|
|
8165
|
-
active,
|
|
8166
|
-
avatar,
|
|
8167
|
-
avatarUpload,
|
|
8168
|
-
email,
|
|
8169
|
-
firstName,
|
|
8170
|
-
isTester,
|
|
8171
|
-
lastName,
|
|
8172
|
-
password,
|
|
8173
|
-
preferredRegion,
|
|
8174
|
-
role,
|
|
8175
|
-
termsAgreement
|
|
8176
|
-
} = getValues();
|
|
8177
|
-
return {
|
|
8178
|
-
control,
|
|
8179
|
-
fields: {
|
|
8180
|
-
_id,
|
|
8181
|
-
active,
|
|
8182
|
-
avatar,
|
|
8183
|
-
avatarUpload,
|
|
8184
|
-
email,
|
|
8185
|
-
firstName,
|
|
8186
|
-
isTester,
|
|
8187
|
-
lastName,
|
|
8188
|
-
password,
|
|
8189
|
-
preferredRegion,
|
|
8190
|
-
role,
|
|
8191
|
-
termsAgreement
|
|
8192
|
-
},
|
|
8193
|
-
formState,
|
|
8194
|
-
getValues,
|
|
8195
|
-
handleSubmit,
|
|
8196
|
-
reset,
|
|
8197
|
-
setValue,
|
|
8198
|
-
watch
|
|
8199
|
-
};
|
|
8200
|
-
}
|
|
8201
|
-
|
|
8202
|
-
// src/hooks/auth/useLoginForm.ts
|
|
8203
|
-
var import_yup7 = require("@hookform/resolvers/yup");
|
|
8204
|
-
var import_react_hook_form7 = require("react-hook-form");
|
|
8205
|
-
var defaultValues2 = {
|
|
8206
|
-
email: "",
|
|
8207
|
-
password: ""
|
|
8208
|
-
};
|
|
8209
|
-
function useLoginForm() {
|
|
8210
|
-
const {
|
|
8211
|
-
control,
|
|
8212
|
-
formState,
|
|
8213
|
-
getValues,
|
|
8214
|
-
handleSubmit,
|
|
8215
|
-
reset,
|
|
8216
|
-
setValue,
|
|
8217
|
-
watch
|
|
8218
|
-
} = (0, import_react_hook_form7.useForm)({
|
|
8219
|
-
defaultValues: defaultValues2,
|
|
8220
|
-
resolver: (0, import_yup7.yupResolver)(loginSchema)
|
|
8221
|
-
});
|
|
8222
|
-
const { email, password } = getValues();
|
|
8223
|
-
return {
|
|
8224
|
-
control,
|
|
8225
|
-
fields: {
|
|
8226
|
-
email,
|
|
8227
|
-
password
|
|
8228
|
-
},
|
|
8229
|
-
formState,
|
|
8230
|
-
getValues,
|
|
8231
|
-
handleSubmit,
|
|
8232
|
-
reset,
|
|
8233
|
-
setValue,
|
|
8234
|
-
watch
|
|
8235
|
-
};
|
|
8236
|
-
}
|
|
8237
|
-
|
|
8238
|
-
// src/hooks/auth/useRegisterForm.ts
|
|
8239
|
-
var import_yup8 = require("@hookform/resolvers/yup");
|
|
8240
|
-
var import_react_hook_form8 = require("react-hook-form");
|
|
8241
|
-
var defaultValues3 = {
|
|
8242
|
-
email: "",
|
|
8243
|
-
firstName: "",
|
|
8244
|
-
lastName: "",
|
|
8245
|
-
password: "",
|
|
8246
|
-
preferredRegion: "",
|
|
8247
|
-
promoCode: null,
|
|
8248
|
-
termsAgreement: null
|
|
8249
|
-
};
|
|
8250
|
-
function useRegisterForm() {
|
|
8251
|
-
const {
|
|
8252
|
-
control,
|
|
8253
|
-
formState,
|
|
8254
|
-
getValues,
|
|
8255
|
-
handleSubmit,
|
|
8256
|
-
reset,
|
|
8257
|
-
setValue,
|
|
8258
|
-
watch
|
|
8259
|
-
} = (0, import_react_hook_form8.useForm)({
|
|
8260
|
-
defaultValues: defaultValues3,
|
|
8261
|
-
resolver: (0, import_yup8.yupResolver)(registerSchema)
|
|
8262
|
-
});
|
|
8263
|
-
const {
|
|
8264
|
-
email,
|
|
8265
|
-
firstName,
|
|
8266
|
-
lastName,
|
|
8267
|
-
password,
|
|
8268
|
-
preferredRegion,
|
|
8269
|
-
promoCode,
|
|
8270
|
-
termsAgreement
|
|
8271
|
-
} = getValues();
|
|
8272
|
-
return {
|
|
8273
|
-
control,
|
|
8274
|
-
fields: {
|
|
8275
|
-
email,
|
|
8276
|
-
firstName,
|
|
8277
|
-
lastName,
|
|
8278
|
-
password,
|
|
8279
|
-
preferredRegion,
|
|
8280
|
-
promoCode,
|
|
8281
|
-
termsAgreement
|
|
8282
|
-
},
|
|
8283
|
-
formState,
|
|
8284
|
-
getValues,
|
|
8285
|
-
handleSubmit,
|
|
8286
|
-
reset,
|
|
8287
|
-
setValue,
|
|
8288
|
-
watch
|
|
8289
|
-
};
|
|
8290
|
-
}
|
|
8291
|
-
|
|
8292
|
-
// src/hooks/auth/useRequestPasswordResetForm.ts
|
|
8293
|
-
var import_yup9 = require("@hookform/resolvers/yup");
|
|
8294
|
-
var import_react_hook_form9 = require("react-hook-form");
|
|
8295
|
-
var defaultValues4 = {
|
|
8296
|
-
email: ""
|
|
8297
|
-
};
|
|
8298
|
-
function useRequestPasswordResetForm() {
|
|
8299
|
-
const {
|
|
8300
|
-
control,
|
|
8301
|
-
formState,
|
|
8302
|
-
getValues,
|
|
8303
|
-
handleSubmit,
|
|
8304
|
-
reset,
|
|
8305
|
-
setValue,
|
|
8306
|
-
watch
|
|
8307
|
-
} = (0, import_react_hook_form9.useForm)({
|
|
8308
|
-
defaultValues: defaultValues4,
|
|
8309
|
-
resolver: (0, import_yup9.yupResolver)(requestPasswordResetSchema)
|
|
8310
|
-
});
|
|
8311
|
-
const { email } = getValues();
|
|
8312
|
-
return {
|
|
8313
|
-
control,
|
|
8314
|
-
fields: {
|
|
8315
|
-
email
|
|
8316
|
-
},
|
|
8317
|
-
formState,
|
|
8318
|
-
getValues,
|
|
8319
|
-
handleSubmit,
|
|
8320
|
-
reset,
|
|
8321
|
-
setValue,
|
|
8322
|
-
watch
|
|
8323
|
-
};
|
|
8324
|
-
}
|
|
8325
|
-
|
|
8326
|
-
// src/hooks/auth/useValidateVerificationTokenForm.ts
|
|
8327
|
-
var import_yup10 = require("@hookform/resolvers/yup");
|
|
8328
|
-
var import_react_hook_form10 = require("react-hook-form");
|
|
8329
|
-
var defaultValues5 = {
|
|
8330
|
-
email: "",
|
|
8331
|
-
verificationToken: ""
|
|
8332
|
-
};
|
|
8333
|
-
function useValidateVerificationTokenForm() {
|
|
8334
|
-
const {
|
|
8335
|
-
control,
|
|
8336
|
-
formState,
|
|
8337
|
-
getValues,
|
|
8338
|
-
handleSubmit,
|
|
8339
|
-
reset,
|
|
8340
|
-
setValue,
|
|
8341
|
-
watch
|
|
8342
|
-
} = (0, import_react_hook_form10.useForm)({
|
|
8343
|
-
defaultValues: defaultValues5,
|
|
8344
|
-
resolver: (0, import_yup10.yupResolver)(validateVerificationTokenSchema)
|
|
8345
|
-
});
|
|
8346
|
-
const { email, verificationToken } = getValues();
|
|
8347
|
-
return {
|
|
8348
|
-
control,
|
|
8349
|
-
fields: {
|
|
8350
|
-
email,
|
|
8351
|
-
verificationToken
|
|
8352
|
-
},
|
|
8353
|
-
formState,
|
|
8354
|
-
getValues,
|
|
8355
|
-
handleSubmit,
|
|
8356
|
-
reset,
|
|
8357
|
-
setValue,
|
|
8358
|
-
watch
|
|
8359
|
-
};
|
|
8360
|
-
}
|
|
8361
|
-
|
|
8362
|
-
// src/hooks/auth/useResetPasswordForm.ts
|
|
8363
|
-
var import_yup11 = require("@hookform/resolvers/yup");
|
|
8364
|
-
var import_react_hook_form11 = require("react-hook-form");
|
|
8365
|
-
var defaultValues6 = {
|
|
8366
|
-
confirmPassword: "",
|
|
8367
|
-
email: "",
|
|
8368
|
-
password: ""
|
|
8369
|
-
};
|
|
8370
|
-
function useResetPasswordForm() {
|
|
8371
|
-
const {
|
|
8372
|
-
control,
|
|
8373
|
-
formState,
|
|
8374
|
-
getValues,
|
|
8375
|
-
handleSubmit,
|
|
8376
|
-
reset,
|
|
8377
|
-
setValue,
|
|
8378
|
-
watch
|
|
8379
|
-
} = (0, import_react_hook_form11.useForm)({
|
|
8380
|
-
defaultValues: defaultValues6,
|
|
8381
|
-
resolver: (0, import_yup11.yupResolver)(resetPasswordSchema)
|
|
8382
|
-
});
|
|
8383
|
-
const { confirmPassword, email, password } = getValues();
|
|
8384
|
-
return {
|
|
8385
|
-
control,
|
|
8386
|
-
fields: {
|
|
8387
|
-
confirmPassword,
|
|
8388
|
-
email,
|
|
8389
|
-
password
|
|
8390
|
-
},
|
|
8391
|
-
formState,
|
|
8392
|
-
getValues,
|
|
8393
|
-
handleSubmit,
|
|
8394
|
-
reset,
|
|
8395
|
-
setValue,
|
|
8396
|
-
watch
|
|
8397
|
-
};
|
|
8398
|
-
}
|
|
8399
|
-
|
|
8400
|
-
// src/hooks/useContactUsForm.ts
|
|
8401
|
-
var import_yup12 = require("@hookform/resolvers/yup");
|
|
8402
|
-
var import_react = __toESM(require("react"));
|
|
8403
|
-
var import_react_hook_form12 = require("react-hook-form");
|
|
8404
|
-
|
|
8405
|
-
// src/yupSchema/contactUs.ts
|
|
8406
|
-
var yup10 = __toESM(require("yup"));
|
|
8407
|
-
var contactUsSchema = yup10.object().shape({
|
|
8408
|
-
email: emailRequiredSchema,
|
|
8409
|
-
firstName: yup10.string().label("First Name").required("First name is required"),
|
|
8410
|
-
lastName: yup10.string().label("Last Name").required("Last name is required"),
|
|
8411
|
-
message: yup10.string().label("Message").required("Message is required")
|
|
8412
|
-
});
|
|
8413
|
-
|
|
8414
|
-
// src/hooks/useContactUsForm.ts
|
|
8415
|
-
var defaultValues7 = {
|
|
8416
|
-
email: "",
|
|
8417
|
-
firstName: "",
|
|
8418
|
-
lastName: "",
|
|
8419
|
-
message: ""
|
|
8420
|
-
};
|
|
8421
|
-
function useContactUsForm(data) {
|
|
8422
|
-
const {
|
|
8423
|
-
control,
|
|
8424
|
-
formState,
|
|
8425
|
-
getValues,
|
|
8426
|
-
handleSubmit,
|
|
8427
|
-
reset,
|
|
8428
|
-
setValue,
|
|
8429
|
-
watch
|
|
8430
|
-
} = (0, import_react_hook_form12.useForm)({
|
|
8431
|
-
defaultValues: defaultValues7,
|
|
8432
|
-
resolver: (0, import_yup12.yupResolver)(contactUsSchema)
|
|
8433
|
-
});
|
|
8434
|
-
import_react.default.useEffect(() => {
|
|
8435
|
-
if (data) {
|
|
8436
|
-
reset({
|
|
8437
|
-
email: data.email,
|
|
8438
|
-
firstName: data.firstName,
|
|
8439
|
-
lastName: data.lastName,
|
|
8440
|
-
message: data.message
|
|
8441
|
-
});
|
|
8442
|
-
} else {
|
|
8443
|
-
reset(defaultValues7);
|
|
8444
|
-
}
|
|
8445
|
-
}, [data]);
|
|
8446
|
-
const { email, firstName, lastName, message } = getValues();
|
|
8447
|
-
return {
|
|
8448
|
-
control,
|
|
8449
|
-
fields: {
|
|
8450
|
-
email,
|
|
8451
|
-
firstName,
|
|
8452
|
-
lastName,
|
|
8453
|
-
message
|
|
8454
|
-
},
|
|
8455
|
-
formState,
|
|
8456
|
-
getValues,
|
|
8457
|
-
handleSubmit,
|
|
8458
|
-
reset,
|
|
8459
|
-
setValue,
|
|
8460
|
-
watch
|
|
8461
|
-
};
|
|
8462
|
-
}
|
|
8463
|
-
|
|
8464
|
-
// src/hooks/useAdForm.ts
|
|
8465
|
-
var import_yup13 = require("@hookform/resolvers/yup");
|
|
8466
|
-
var import_react2 = __toESM(require("react"));
|
|
8467
|
-
var import_react_hook_form13 = require("react-hook-form");
|
|
8468
|
-
var defaultValues8 = {
|
|
8469
|
-
active: true,
|
|
8470
|
-
// Use a future default so yup "future date" rules pass on first submit.
|
|
8471
|
-
end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3),
|
|
8472
|
-
resource: {
|
|
8473
|
-
adDescription: "",
|
|
8474
|
-
adImage: "",
|
|
8475
|
-
adStyle: "Bloom" /* BLOOM */,
|
|
8476
|
-
adTitle: "",
|
|
8477
|
-
adType: "Sponsored" /* SPONSORED */,
|
|
8478
|
-
resourceId: "",
|
|
8479
|
-
resourceName: "",
|
|
8480
|
-
resourceRegion: "",
|
|
8481
|
-
resourceType: "event" /* EVENT */
|
|
8482
|
-
},
|
|
8483
|
-
showOn: ["Front_page" /* FRONT_PAGE */],
|
|
8484
|
-
// `start` is only required (and must be future) when status !== ACTIVE.
|
|
8485
|
-
start: void 0,
|
|
8486
|
-
status: "Active" /* ACTIVE */,
|
|
8487
|
-
targetRegion: []
|
|
8488
|
-
};
|
|
8489
|
-
function useAdForm(data) {
|
|
8490
|
-
const {
|
|
8491
|
-
control,
|
|
8492
|
-
formState,
|
|
8493
|
-
getValues,
|
|
8494
|
-
handleSubmit,
|
|
8495
|
-
reset,
|
|
8496
|
-
setValue,
|
|
8497
|
-
watch
|
|
8498
|
-
} = (0, import_react_hook_form13.useForm)({
|
|
8499
|
-
defaultValues: defaultValues8,
|
|
8500
|
-
resolver: (0, import_yup13.yupResolver)(adSchema)
|
|
8501
|
-
});
|
|
8502
|
-
import_react2.default.useEffect(() => {
|
|
8503
|
-
if (data) {
|
|
8504
|
-
reset({
|
|
8505
|
-
active: data.active,
|
|
8506
|
-
end: data.end,
|
|
8507
|
-
resource: data.resource,
|
|
8508
|
-
showOn: data.showOn,
|
|
8509
|
-
start: data.start,
|
|
8510
|
-
status: data.status,
|
|
8511
|
-
targetRegion: data.targetRegion
|
|
8512
|
-
});
|
|
8513
|
-
} else {
|
|
8514
|
-
reset(defaultValues8);
|
|
8515
|
-
}
|
|
8516
|
-
}, [data]);
|
|
8517
|
-
const { active, end, resource, showOn, start, status, targetRegion } = getValues();
|
|
8518
|
-
return {
|
|
8519
|
-
control,
|
|
8520
|
-
fields: {
|
|
8521
|
-
active,
|
|
8522
|
-
end,
|
|
8523
|
-
resource,
|
|
8524
|
-
showOn,
|
|
8525
|
-
start,
|
|
8526
|
-
status,
|
|
8527
|
-
targetRegion
|
|
8528
|
-
},
|
|
8529
|
-
formState,
|
|
8530
|
-
getValues,
|
|
8531
|
-
handleSubmit,
|
|
8532
|
-
reset,
|
|
8533
|
-
setValue,
|
|
8534
|
-
watch
|
|
8535
|
-
};
|
|
8536
|
-
}
|
|
8537
|
-
|
|
8538
|
-
// src/hooks/partner/usePartnerForm.ts
|
|
8539
|
-
var import_yup14 = require("@hookform/resolvers/yup");
|
|
8540
|
-
var React9 = __toESM(require("react"));
|
|
8541
|
-
var import_react_hook_form14 = require("react-hook-form");
|
|
8542
|
-
function usePartnerForm(data) {
|
|
8543
|
-
const {
|
|
8544
|
-
control,
|
|
8545
|
-
formState,
|
|
8546
|
-
getValues,
|
|
8547
|
-
handleSubmit,
|
|
8548
|
-
reset,
|
|
8549
|
-
setValue,
|
|
8550
|
-
watch
|
|
8551
|
-
} = (0, import_react_hook_form14.useForm)({
|
|
8552
|
-
defaultValues: defaultPartnerFormValues,
|
|
8553
|
-
resolver: (0, import_yup14.yupResolver)(partnerSchema)
|
|
8554
|
-
});
|
|
8555
|
-
React9.useEffect(() => {
|
|
8556
|
-
if (data) {
|
|
8557
|
-
reset({
|
|
8558
|
-
...mapBaseResourceTypeToFormData(data),
|
|
8559
|
-
location: data.location,
|
|
8560
|
-
nzbn: data.nzbn,
|
|
8561
|
-
partnerType: data.partnerType
|
|
8562
|
-
});
|
|
8563
|
-
} else {
|
|
8564
|
-
reset(defaultPartnerFormValues);
|
|
8565
|
-
}
|
|
8566
|
-
}, [data]);
|
|
8567
|
-
const {
|
|
8568
|
-
_id,
|
|
8569
|
-
active,
|
|
8570
|
-
associates,
|
|
8571
|
-
contactDetails,
|
|
8572
|
-
cover,
|
|
8573
|
-
coverUpload,
|
|
8574
|
-
description,
|
|
8575
|
-
images,
|
|
8576
|
-
imagesUpload,
|
|
8577
|
-
location,
|
|
8578
|
-
logo,
|
|
8579
|
-
logoUpload,
|
|
8580
|
-
name,
|
|
8581
|
-
nzbn,
|
|
8582
|
-
owner,
|
|
8583
|
-
partnerType,
|
|
8584
|
-
promoCodes,
|
|
8585
|
-
region,
|
|
8586
|
-
socialMedia: socialMedia2,
|
|
8587
|
-
termsAgreement
|
|
8588
|
-
} = getValues();
|
|
8589
|
-
return {
|
|
8590
|
-
control,
|
|
8591
|
-
fields: {
|
|
8592
|
-
_id,
|
|
8593
|
-
active,
|
|
8594
|
-
associates,
|
|
8595
|
-
contactDetails,
|
|
8596
|
-
cover,
|
|
8597
|
-
coverUpload,
|
|
8598
|
-
description,
|
|
8599
|
-
images,
|
|
8600
|
-
imagesUpload,
|
|
8601
|
-
location,
|
|
8602
|
-
logo,
|
|
8603
|
-
logoUpload,
|
|
8604
|
-
name,
|
|
8605
|
-
nzbn,
|
|
8606
|
-
owner,
|
|
8607
|
-
partnerType,
|
|
8608
|
-
promoCodes,
|
|
8609
|
-
region,
|
|
8610
|
-
socialMedia: socialMedia2,
|
|
8611
|
-
termsAgreement
|
|
8612
|
-
},
|
|
8613
|
-
formState,
|
|
8614
|
-
getValues,
|
|
8615
|
-
handleSubmit,
|
|
8616
|
-
reset,
|
|
8617
|
-
setValue,
|
|
8618
|
-
watch
|
|
8619
|
-
};
|
|
8620
|
-
}
|
|
8621
|
-
|
|
8622
|
-
// src/hooks/usePostForm.ts
|
|
8623
|
-
var import_yup15 = require("@hookform/resolvers/yup");
|
|
8624
|
-
var import_react3 = __toESM(require("react"));
|
|
8625
|
-
var import_react_hook_form15 = require("react-hook-form");
|
|
8626
|
-
var defaultValues9 = {
|
|
8627
|
-
active: true,
|
|
8628
|
-
caption: "",
|
|
8629
|
-
content: [],
|
|
8630
|
-
cover: null,
|
|
8631
|
-
coverUpload: null,
|
|
8632
|
-
postType: "",
|
|
8633
|
-
resource: null,
|
|
8634
|
-
tags: [],
|
|
8635
|
-
title: ""
|
|
8636
|
-
};
|
|
8637
|
-
function usePostForm(data) {
|
|
8638
|
-
const {
|
|
8639
|
-
control,
|
|
8640
|
-
formState,
|
|
8641
|
-
getValues,
|
|
8642
|
-
handleSubmit,
|
|
8643
|
-
reset,
|
|
8644
|
-
setValue,
|
|
8645
|
-
watch
|
|
8646
|
-
} = (0, import_react_hook_form15.useForm)({
|
|
8647
|
-
defaultValues: defaultValues9,
|
|
8648
|
-
resolver: (0, import_yup15.yupResolver)(postSchema)
|
|
8649
|
-
});
|
|
8650
|
-
import_react3.default.useEffect(() => {
|
|
8651
|
-
if (data) {
|
|
8652
|
-
reset({
|
|
8653
|
-
active: data.active,
|
|
8654
|
-
caption: data.caption,
|
|
8655
|
-
content: data.content,
|
|
8656
|
-
cover: data.cover,
|
|
8657
|
-
coverUpload: data.coverUpload,
|
|
8658
|
-
postType: data.postType,
|
|
8659
|
-
resource: data.resource,
|
|
8660
|
-
tags: data.tags,
|
|
8661
|
-
title: data.title
|
|
8662
|
-
});
|
|
8663
|
-
} else {
|
|
8664
|
-
reset(defaultValues9);
|
|
8665
|
-
}
|
|
8666
|
-
}, [data]);
|
|
8667
|
-
const {
|
|
8668
|
-
active,
|
|
8669
|
-
caption,
|
|
8670
|
-
content,
|
|
8671
|
-
cover,
|
|
8672
|
-
coverUpload,
|
|
8673
|
-
postType,
|
|
8674
|
-
resource,
|
|
8675
|
-
tags,
|
|
8676
|
-
title
|
|
8677
|
-
} = getValues();
|
|
8678
|
-
return {
|
|
8679
|
-
control,
|
|
8680
|
-
fields: {
|
|
8681
|
-
active,
|
|
8682
|
-
caption,
|
|
8683
|
-
content,
|
|
8684
|
-
cover,
|
|
8685
|
-
coverUpload,
|
|
8686
|
-
postType,
|
|
8687
|
-
resource,
|
|
8688
|
-
tags,
|
|
8689
|
-
title
|
|
8690
|
-
},
|
|
8691
|
-
formState,
|
|
8692
|
-
getValues,
|
|
8693
|
-
handleSubmit,
|
|
8694
|
-
reset,
|
|
8695
|
-
setValue,
|
|
8696
|
-
watch
|
|
8697
|
-
};
|
|
8698
|
-
}
|
|
8699
|
-
|
|
8700
|
-
// src/hooks/useAppSettingsForm.ts
|
|
8701
|
-
var import_yup16 = require("@hookform/resolvers/yup");
|
|
8702
|
-
var import_react4 = __toESM(require("react"));
|
|
8703
|
-
var import_react_hook_form16 = require("react-hook-form");
|
|
8704
|
-
var defaultValues10 = {
|
|
8705
|
-
appVersion: "",
|
|
8706
|
-
isOfflineMode: false
|
|
8707
|
-
};
|
|
8708
|
-
function useAppSettingsForm(data) {
|
|
8709
|
-
const {
|
|
8710
|
-
control,
|
|
8711
|
-
formState,
|
|
8712
|
-
getValues,
|
|
8713
|
-
handleSubmit,
|
|
8714
|
-
reset,
|
|
8715
|
-
setValue,
|
|
8716
|
-
watch
|
|
8717
|
-
} = (0, import_react_hook_form16.useForm)({
|
|
8718
|
-
defaultValues: defaultValues10,
|
|
8719
|
-
resolver: (0, import_yup16.yupResolver)(appSettingsSchema)
|
|
8720
|
-
});
|
|
8721
|
-
import_react4.default.useEffect(() => {
|
|
8722
|
-
if (data) {
|
|
8723
|
-
reset({
|
|
8724
|
-
appVersion: data.appVersion,
|
|
8725
|
-
isOfflineMode: data.isOfflineMode
|
|
8726
|
-
});
|
|
8727
|
-
} else {
|
|
8728
|
-
reset(defaultValues10);
|
|
8729
|
-
}
|
|
8730
|
-
}, [data]);
|
|
8731
|
-
const { appVersion, isOfflineMode } = getValues();
|
|
8732
|
-
return {
|
|
8733
|
-
control,
|
|
8734
|
-
fields: {
|
|
8735
|
-
appVersion,
|
|
8736
|
-
isOfflineMode
|
|
8737
|
-
},
|
|
8738
|
-
formState,
|
|
8739
|
-
getValues,
|
|
8740
|
-
handleSubmit,
|
|
8741
|
-
reset,
|
|
8742
|
-
setValue,
|
|
8743
|
-
watch
|
|
8744
|
-
};
|
|
8745
|
-
}
|
|
8746
|
-
|
|
8747
|
-
// src/hooks/useSchoolForm.ts
|
|
8748
|
-
var import_yup17 = require("@hookform/resolvers/yup");
|
|
8749
|
-
var import_react5 = require("react");
|
|
8750
|
-
var import_react_hook_form17 = require("react-hook-form");
|
|
8751
|
-
|
|
8752
|
-
// src/yupSchema/school.ts
|
|
8753
|
-
var yup11 = __toESM(require("yup"));
|
|
8754
|
-
var schoolSchema = yup11.object().shape({
|
|
8755
|
-
active: yup11.boolean().required("Active is required"),
|
|
8756
|
-
contactDetails: contactDetailsSchema,
|
|
8757
|
-
location: locationSchema,
|
|
8758
|
-
name: yup11.string().trim().required("Name is required"),
|
|
8759
|
-
region: yup11.string().trim().required("Region is required"),
|
|
8760
|
-
socialMedia: yup11.array().of(socialMediaSchema).nullable().default(null),
|
|
8761
|
-
studentCount: yup11.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
|
|
8762
|
-
SCHOOL_MIN_STUDENT_COUNT,
|
|
8763
|
-
`Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
|
|
8764
|
-
).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
|
|
8765
|
-
});
|
|
8766
|
-
|
|
8767
|
-
// src/hooks/useSchoolForm.ts
|
|
8768
|
-
var defaultSchoolFormValues = {
|
|
8769
|
-
// New schools are active by default
|
|
8770
|
-
active: true,
|
|
8771
|
-
contactDetails: null,
|
|
8772
|
-
location: defaultLocation,
|
|
8773
|
-
logo: null,
|
|
8774
|
-
logoUpload: null,
|
|
8775
|
-
name: "",
|
|
8776
|
-
region: "",
|
|
8777
|
-
socialMedia: [],
|
|
8778
|
-
studentCount: 0,
|
|
8779
|
-
termsAgreement: null
|
|
8780
|
-
};
|
|
8781
|
-
function useSchoolForm(data) {
|
|
8782
|
-
const {
|
|
8783
|
-
control,
|
|
8784
|
-
formState,
|
|
8785
|
-
getValues,
|
|
8786
|
-
handleSubmit,
|
|
8787
|
-
reset,
|
|
8788
|
-
setValue,
|
|
8789
|
-
watch
|
|
8790
|
-
} = (0, import_react_hook_form17.useForm)({
|
|
8791
|
-
defaultValues: defaultSchoolFormValues,
|
|
8792
|
-
resolver: (0, import_yup17.yupResolver)(schoolSchema)
|
|
8793
|
-
});
|
|
8794
|
-
(0, import_react5.useEffect)(() => {
|
|
8795
|
-
if (data) {
|
|
8796
|
-
reset({
|
|
8797
|
-
_id: data._id,
|
|
8798
|
-
active: data.active,
|
|
8799
|
-
contactDetails: data.contactDetails,
|
|
8800
|
-
location: data.location,
|
|
8801
|
-
logo: data.logo,
|
|
8802
|
-
logoUpload: data.logoUpload,
|
|
8803
|
-
name: data.name,
|
|
8804
|
-
region: data.region,
|
|
8805
|
-
socialMedia: data.socialMedia,
|
|
8806
|
-
studentCount: data.studentCount,
|
|
8807
|
-
termsAgreement: data.termsAgreement
|
|
8808
|
-
});
|
|
8809
|
-
} else {
|
|
8810
|
-
reset(defaultSchoolFormValues);
|
|
8811
|
-
}
|
|
8812
|
-
}, [data]);
|
|
8813
|
-
const {
|
|
8814
|
-
_id,
|
|
8815
|
-
socialMedia: socialMedia2,
|
|
8816
|
-
active,
|
|
8817
|
-
contactDetails,
|
|
8818
|
-
location,
|
|
8819
|
-
logo,
|
|
8820
|
-
logoUpload,
|
|
8821
|
-
name,
|
|
8822
|
-
region,
|
|
8823
|
-
studentCount,
|
|
8824
|
-
termsAgreement
|
|
8825
|
-
} = getValues();
|
|
8826
|
-
return {
|
|
8827
|
-
control,
|
|
8828
|
-
fields: {
|
|
8829
|
-
_id,
|
|
8830
|
-
active,
|
|
8831
|
-
contactDetails,
|
|
8832
|
-
location,
|
|
8833
|
-
logo,
|
|
8834
|
-
logoUpload,
|
|
8835
|
-
name,
|
|
8836
|
-
region,
|
|
8837
|
-
socialMedia: socialMedia2,
|
|
8838
|
-
studentCount,
|
|
8839
|
-
termsAgreement
|
|
8840
|
-
},
|
|
8841
|
-
formState,
|
|
8842
|
-
getValues,
|
|
8843
|
-
handleSubmit,
|
|
8844
|
-
reset,
|
|
8845
|
-
setValue,
|
|
8846
|
-
watch
|
|
8847
|
-
};
|
|
8848
|
-
}
|
|
8849
|
-
|
|
8850
6890
|
// src/images/index.ts
|
|
8851
6891
|
var PKG = "@timardex/cluemart-shared";
|
|
8852
6892
|
var IMAGE_EXTENSION = ".webp";
|
|
@@ -9034,9 +7074,9 @@ function formatShareStallLine(stall) {
|
|
|
9034
7074
|
return ` - ${stall.label} \u2014 $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;
|
|
9035
7075
|
}
|
|
9036
7076
|
function formatShareInvitationMarketDatesSection(dateTime) {
|
|
9037
|
-
const dateBlocks = dateTime.map((
|
|
9038
|
-
const formattedDate = formatShareMarketDate(
|
|
9039
|
-
const stallLines =
|
|
7077
|
+
const dateBlocks = dateTime.map((date) => {
|
|
7078
|
+
const formattedDate = formatShareMarketDate(date.startDate);
|
|
7079
|
+
const stallLines = date.stallTypes.map(formatShareStallLine);
|
|
9040
7080
|
return [`- ${formattedDate}`, ...stallLines].join("\n");
|
|
9041
7081
|
});
|
|
9042
7082
|
return `${SHARE_MARKET_DATES_SECTION_HEADING}
|
|
@@ -9093,7 +7133,7 @@ function formatShareInvitationApplicationDeadlineLine(applicationDeadlineHours)
|
|
|
9093
7133
|
return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;
|
|
9094
7134
|
}
|
|
9095
7135
|
function buildInvitationShareDescription(event, eventInfo2) {
|
|
9096
|
-
const stallTypes2 = eventInfo2?.dateTime?.flatMap((
|
|
7136
|
+
const stallTypes2 = eventInfo2?.dateTime?.flatMap((date) => date.stallTypes) ?? [];
|
|
9097
7137
|
if (!eventInfo2 || stallTypes2.length === 0) {
|
|
9098
7138
|
return event.description?.trim() || "";
|
|
9099
7139
|
}
|
|
@@ -9279,6 +7319,31 @@ var EnumVerificationType = /* @__PURE__ */ ((EnumVerificationType2) => {
|
|
|
9279
7319
|
// src/types/global.ts
|
|
9280
7320
|
var PROMO_CODE_PREFIX = "CM-";
|
|
9281
7321
|
|
|
7322
|
+
// src/types/ad.ts
|
|
7323
|
+
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
7324
|
+
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
7325
|
+
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
7326
|
+
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
7327
|
+
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
7328
|
+
return EnumAdShowOn2;
|
|
7329
|
+
})(EnumAdShowOn || {});
|
|
7330
|
+
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
7331
|
+
EnumAdStatus2["ACTIVE"] = "Active";
|
|
7332
|
+
EnumAdStatus2["PAUSED"] = "Paused";
|
|
7333
|
+
EnumAdStatus2["EXPIRED"] = "Expired";
|
|
7334
|
+
return EnumAdStatus2;
|
|
7335
|
+
})(EnumAdStatus || {});
|
|
7336
|
+
var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
|
|
7337
|
+
EnumAdType2["SPONSORED"] = "Sponsored";
|
|
7338
|
+
EnumAdType2["FREE"] = "Free";
|
|
7339
|
+
return EnumAdType2;
|
|
7340
|
+
})(EnumAdType || {});
|
|
7341
|
+
var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
7342
|
+
EnumAdStyle2["BLOOM"] = "Bloom";
|
|
7343
|
+
EnumAdStyle2["RISE"] = "Rise";
|
|
7344
|
+
return EnumAdStyle2;
|
|
7345
|
+
})(EnumAdStyle || {});
|
|
7346
|
+
|
|
9282
7347
|
// src/types/resourceActivities.ts
|
|
9283
7348
|
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
9284
7349
|
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
@@ -9289,6 +7354,22 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
9289
7354
|
return EnumActivity2;
|
|
9290
7355
|
})(EnumActivity || {});
|
|
9291
7356
|
|
|
7357
|
+
// src/types/post.ts
|
|
7358
|
+
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
7359
|
+
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
7360
|
+
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
7361
|
+
EnumPostType2["DAILY_GAMES"] = "daily_games";
|
|
7362
|
+
return EnumPostType2;
|
|
7363
|
+
})(EnumPostType || {});
|
|
7364
|
+
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
7365
|
+
EnumPostContentType2["GAME"] = "game";
|
|
7366
|
+
EnumPostContentType2["IMAGE"] = "image";
|
|
7367
|
+
EnumPostContentType2["LIST"] = "list";
|
|
7368
|
+
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
7369
|
+
EnumPostContentType2["VIDEO"] = "video";
|
|
7370
|
+
return EnumPostContentType2;
|
|
7371
|
+
})(EnumPostContentType || {});
|
|
7372
|
+
|
|
9292
7373
|
// src/types/game/index.ts
|
|
9293
7374
|
var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
|
|
9294
7375
|
EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
|
|
@@ -9436,13 +7517,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9436
7517
|
contactUsFields,
|
|
9437
7518
|
darkColors,
|
|
9438
7519
|
dateFormat,
|
|
9439
|
-
defaultEventFormValues,
|
|
9440
|
-
defaultEventInfoFormValues,
|
|
9441
|
-
defaultLocation,
|
|
9442
|
-
defaultPartnerFormValues,
|
|
9443
|
-
defaultUnregisteredVendorFormValues,
|
|
9444
|
-
defaultVendorFormValues,
|
|
9445
|
-
defaultVendorInfoFormValues,
|
|
9446
7520
|
emailField,
|
|
9447
7521
|
eventBasicInfoFields,
|
|
9448
7522
|
eventEndDateFields,
|
|
@@ -9470,7 +7544,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9470
7544
|
gameScreenIdentifierList,
|
|
9471
7545
|
gameTypeToDisplayName,
|
|
9472
7546
|
getCurrentAndFutureDates,
|
|
9473
|
-
globalDefaultValues,
|
|
9474
7547
|
iconFiles,
|
|
9475
7548
|
iconIds,
|
|
9476
7549
|
icons,
|
|
@@ -9487,7 +7560,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9487
7560
|
logoIds,
|
|
9488
7561
|
logos,
|
|
9489
7562
|
mapArrayToOptions,
|
|
9490
|
-
mapBaseResourceTypeToFormData,
|
|
9491
7563
|
normalizeShareOgDescription,
|
|
9492
7564
|
normalizeShareRouteId,
|
|
9493
7565
|
normalizeShareText,
|
|
@@ -9523,7 +7595,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9523
7595
|
timeFormat,
|
|
9524
7596
|
toNZTime,
|
|
9525
7597
|
truncateText,
|
|
9526
|
-
useAdForm,
|
|
9527
7598
|
useAddParticipantToChat,
|
|
9528
7599
|
useAddUserFavouriteResource,
|
|
9529
7600
|
useAddUserGoingResource,
|
|
@@ -9532,10 +7603,8 @@ var TIER_FROM_LICENCE = {
|
|
|
9532
7603
|
useAdminPermanentlyDeleteResource,
|
|
9533
7604
|
useAdminResendUserVerificationEmail,
|
|
9534
7605
|
useAdminUpdateResourceType,
|
|
9535
|
-
useAppSettingsForm,
|
|
9536
7606
|
useCancelSubscription,
|
|
9537
7607
|
useContactUs,
|
|
9538
|
-
useContactUsForm,
|
|
9539
7608
|
useCrawlGoogleMarkets,
|
|
9540
7609
|
useCreateAd,
|
|
9541
7610
|
useCreateBulkNotifications,
|
|
@@ -9567,8 +7636,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9567
7636
|
useDeleteUnregisteredVendor,
|
|
9568
7637
|
useDeleteUser,
|
|
9569
7638
|
useDeleteVendor,
|
|
9570
|
-
useEventForm,
|
|
9571
|
-
useEventInfoForm,
|
|
9572
7639
|
useGetAd,
|
|
9573
7640
|
useGetAds,
|
|
9574
7641
|
useGetAdsByRegion,
|
|
@@ -9622,18 +7689,13 @@ var TIER_FROM_LICENCE = {
|
|
|
9622
7689
|
useGetVendors,
|
|
9623
7690
|
useGetVendorsByRegion,
|
|
9624
7691
|
useLeaveGame,
|
|
9625
|
-
useLocationSearch,
|
|
9626
7692
|
useLogin,
|
|
9627
|
-
useLoginForm,
|
|
9628
7693
|
useLogout,
|
|
9629
7694
|
useMarkAllNotificationsRead,
|
|
9630
7695
|
useMarkChatMessagesSeen,
|
|
9631
7696
|
useMarkNotificationRead,
|
|
9632
|
-
usePartnerForm,
|
|
9633
|
-
usePostForm,
|
|
9634
7697
|
useRefreshToken,
|
|
9635
7698
|
useRegister,
|
|
9636
|
-
useRegisterForm,
|
|
9637
7699
|
useRemoveParticipantFromChat,
|
|
9638
7700
|
useRemoveUserFavouriteResource,
|
|
9639
7701
|
useRemoveUserGoingResource,
|
|
@@ -9642,10 +7704,7 @@ var TIER_FROM_LICENCE = {
|
|
|
9642
7704
|
useReportChatUser,
|
|
9643
7705
|
useRequestMarketingMaterial,
|
|
9644
7706
|
useRequestPasswordReset,
|
|
9645
|
-
useRequestPasswordResetForm,
|
|
9646
7707
|
useResetPassword,
|
|
9647
|
-
useResetPasswordForm,
|
|
9648
|
-
useSchoolForm,
|
|
9649
7708
|
useSearchEvents,
|
|
9650
7709
|
useSearchPartners,
|
|
9651
7710
|
useSearchVendors,
|
|
@@ -9655,7 +7714,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9655
7714
|
useStartGame,
|
|
9656
7715
|
useToggleChatMessageLike,
|
|
9657
7716
|
useUnlinkUnregisteredVendorByInviterId,
|
|
9658
|
-
useUnregisteredVendorForm,
|
|
9659
7717
|
useUpdateAd,
|
|
9660
7718
|
useUpdateAppSettings,
|
|
9661
7719
|
useUpdateDailyClueGame,
|
|
@@ -9672,11 +7730,7 @@ var TIER_FROM_LICENCE = {
|
|
|
9672
7730
|
useUpdateUser,
|
|
9673
7731
|
useUpdateVendor,
|
|
9674
7732
|
useUpdateVendorInfo,
|
|
9675
|
-
useUserForm,
|
|
9676
7733
|
useValidateVerificationToken,
|
|
9677
|
-
useValidateVerificationTokenForm,
|
|
9678
|
-
useVendorForm,
|
|
9679
|
-
useVendorInfoForm,
|
|
9680
7734
|
validateVerificationTokenFields,
|
|
9681
7735
|
vendorAvailability,
|
|
9682
7736
|
vendorBasicInfoFields,
|