@timardex/cluemart-shared 1.5.503 → 1.5.504

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/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FieldValues, Control, FormState, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
2
2
  import * as _apollo_client from '@apollo/client';
3
+ import dayjs from 'dayjs';
3
4
 
4
5
  declare enum EnumInviteStatus {
5
6
  ACCEPTED = "Accepted",
@@ -2444,7 +2445,7 @@ declare function computeDailyClueState(dailyClue: DailyClueGameData): {
2444
2445
 
2445
2446
  declare const dateFormat = "DD-MM-YYYY";
2446
2447
  declare const timeFormat = "HH:mm";
2447
- declare function toNZTime(date: Date | string): string;
2448
+ declare function toNZTime(date?: Date | string): dayjs.Dayjs;
2448
2449
  type DateFormat = "date" | "time" | "datetime";
2449
2450
  /**
2450
2451
  * Format a date string to a more readable format.
@@ -2463,6 +2464,17 @@ declare const isFutureDatesBeforeThreshold: (date: {
2463
2464
  startTime: string;
2464
2465
  }, minHoursFromNow: number) => boolean;
2465
2466
  declare const formatTimestamp: (timestamp: string) => string;
2467
+ declare const isIsoDateString: (value: unknown) => value is string;
2468
+ /**
2469
+ * Sort an array of date strings by their proximity to the current date.
2470
+ * @param dates - The array of date strings to sort.
2471
+ * @returns - The sorted array of date strings.
2472
+ */
2473
+ declare function sortDatesChronologically<T extends {
2474
+ startDate: string;
2475
+ startTime: string;
2476
+ }>(dates: T[]): T[];
2477
+
2466
2478
  declare const removeTypename: (obj: any) => any;
2467
2479
  /**
2468
2480
  * Truncate text to a specified length and append ellipsis if necessary.
@@ -2482,15 +2494,6 @@ declare const statusOptions: {
2482
2494
  label: EnumInviteStatus;
2483
2495
  value: EnumInviteStatus;
2484
2496
  }[];
2485
- /**
2486
- * Sort an array of date strings by their proximity to the current date.
2487
- * @param dates - The array of date strings to sort.
2488
- * @returns - The sorted array of date strings.
2489
- */
2490
- declare function sortDatesChronologically<T extends {
2491
- startDate: string;
2492
- startTime: string;
2493
- }>(dates: T[]): T[];
2494
2497
  declare const availableRegionTypes: EnumRegions[];
2495
2498
  declare const availableRegionOptions: OptionItem[];
2496
2499
  declare const paymentMethodOptions: OptionItem[];
@@ -2500,4 +2503,4 @@ declare const cluemartSocialMedia: SocialMediaType[];
2500
2503
  declare const IOS_URL = "https://apps.apple.com/nz/app/cluemart/id6747251008";
2501
2504
  declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.timardex.cluemart";
2502
2505
 
2503
- export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BaseGame, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameData, type GameDate, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GoogleAddressComponent, type GoogleImportedMarket, IOS_URL, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostType, type PosterInputType, type PosterUsageType, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, licenseNiceNames, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
2506
+ export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BaseGame, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameData, type GameDate, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GoogleAddressComponent, type GoogleImportedMarket, IOS_URL, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostType, type PosterInputType, type PosterUsageType, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, isIsoDateString, licenseNiceNames, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FieldValues, Control, FormState, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
2
2
  import * as _apollo_client from '@apollo/client';
3
+ import dayjs from 'dayjs';
3
4
 
4
5
  declare enum EnumInviteStatus {
5
6
  ACCEPTED = "Accepted",
@@ -2444,7 +2445,7 @@ declare function computeDailyClueState(dailyClue: DailyClueGameData): {
2444
2445
 
2445
2446
  declare const dateFormat = "DD-MM-YYYY";
2446
2447
  declare const timeFormat = "HH:mm";
2447
- declare function toNZTime(date: Date | string): string;
2448
+ declare function toNZTime(date?: Date | string): dayjs.Dayjs;
2448
2449
  type DateFormat = "date" | "time" | "datetime";
2449
2450
  /**
2450
2451
  * Format a date string to a more readable format.
@@ -2463,6 +2464,17 @@ declare const isFutureDatesBeforeThreshold: (date: {
2463
2464
  startTime: string;
2464
2465
  }, minHoursFromNow: number) => boolean;
2465
2466
  declare const formatTimestamp: (timestamp: string) => string;
2467
+ declare const isIsoDateString: (value: unknown) => value is string;
2468
+ /**
2469
+ * Sort an array of date strings by their proximity to the current date.
2470
+ * @param dates - The array of date strings to sort.
2471
+ * @returns - The sorted array of date strings.
2472
+ */
2473
+ declare function sortDatesChronologically<T extends {
2474
+ startDate: string;
2475
+ startTime: string;
2476
+ }>(dates: T[]): T[];
2477
+
2466
2478
  declare const removeTypename: (obj: any) => any;
2467
2479
  /**
2468
2480
  * Truncate text to a specified length and append ellipsis if necessary.
@@ -2482,15 +2494,6 @@ declare const statusOptions: {
2482
2494
  label: EnumInviteStatus;
2483
2495
  value: EnumInviteStatus;
2484
2496
  }[];
2485
- /**
2486
- * Sort an array of date strings by their proximity to the current date.
2487
- * @param dates - The array of date strings to sort.
2488
- * @returns - The sorted array of date strings.
2489
- */
2490
- declare function sortDatesChronologically<T extends {
2491
- startDate: string;
2492
- startTime: string;
2493
- }>(dates: T[]): T[];
2494
2497
  declare const availableRegionTypes: EnumRegions[];
2495
2498
  declare const availableRegionOptions: OptionItem[];
2496
2499
  declare const paymentMethodOptions: OptionItem[];
@@ -2500,4 +2503,4 @@ declare const cluemartSocialMedia: SocialMediaType[];
2500
2503
  declare const IOS_URL = "https://apps.apple.com/nz/app/cluemart/id6747251008";
2501
2504
  declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.timardex.cluemart";
2502
2505
 
2503
- export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BaseGame, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameData, type GameDate, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GoogleAddressComponent, type GoogleImportedMarket, IOS_URL, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostType, type PosterInputType, type PosterUsageType, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, licenseNiceNames, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
2506
+ export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BaseGame, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameData, type GameDate, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GoogleAddressComponent, type GoogleImportedMarket, IOS_URL, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostType, type PosterInputType, type PosterUsageType, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, isIsoDateString, licenseNiceNames, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
package/dist/index.mjs CHANGED
@@ -433,9 +433,6 @@ var priceUnits = [
433
433
  { label: "Half dozen", value: "HALF_DOZEN" }
434
434
  ];
435
435
 
436
- // src/utils/dailyClueGame.ts
437
- import dayjs from "dayjs";
438
-
439
436
  // src/types/game.ts
440
437
  var gameScreenIdentifierList = [
441
438
  {
@@ -548,6 +545,75 @@ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
548
545
  return EnumGameStatus2;
549
546
  })(EnumGameStatus || {});
550
547
 
548
+ // src/utils/date.ts
549
+ import dayjs from "dayjs";
550
+ import customParseFormat from "dayjs/plugin/customParseFormat.js";
551
+ import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
552
+ import timezone from "dayjs/plugin/timezone.js";
553
+ import utc from "dayjs/plugin/utc.js";
554
+ var dateFormat = "DD-MM-YYYY";
555
+ var timeFormat = "HH:mm";
556
+ dayjs.extend(customParseFormat);
557
+ dayjs.extend(utc);
558
+ dayjs.extend(timezone);
559
+ dayjs.extend(isSameOrAfter);
560
+ var NZ_TZ = "Pacific/Auckland";
561
+ function toNZTime(date3) {
562
+ return date3 ? dayjs(date3).tz(NZ_TZ) : dayjs().tz(NZ_TZ);
563
+ }
564
+ var formatDate = (dateStr, display = "datetime", timeStr) => {
565
+ const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
566
+ const dateTime = timeStr ? dayjs(dateTimeStr, `${dateFormat} ${timeFormat}`) : dayjs(dateStr, dateFormat);
567
+ const formattedDate = dateTime.format("dddd, D MMMM, YYYY");
568
+ const formattedTime = dateTime.format("h:mm a");
569
+ switch (display) {
570
+ case "date":
571
+ return formattedDate;
572
+ case "time":
573
+ return formattedTime;
574
+ case "datetime":
575
+ return `${formattedDate} at ${formattedTime}`;
576
+ default:
577
+ return formattedDate;
578
+ }
579
+ };
580
+ var getCurrentAndFutureDates = (dates) => {
581
+ const now = dayjs();
582
+ return dates.filter((dateObj) => {
583
+ const dateTime = dayjs(
584
+ `${dateObj.startDate} ${dateObj.startTime}`,
585
+ `${dateFormat} ${timeFormat}`
586
+ );
587
+ return dateTime.isSameOrAfter(now);
588
+ });
589
+ };
590
+ var isFutureDatesBeforeThreshold = (date3, minHoursFromNow) => {
591
+ const threshold = minHoursFromNow ? dayjs().add(minHoursFromNow, "hour") : dayjs().startOf("day");
592
+ const dateTime = dayjs(
593
+ `${date3.startDate} ${date3.startTime}`,
594
+ `${dateFormat} ${timeFormat}`
595
+ );
596
+ return dateTime.isSameOrAfter(threshold);
597
+ };
598
+ var formatTimestamp = (timestamp) => {
599
+ const formattedDate = toNZTime(timestamp).format(dateFormat);
600
+ return formatDate(formattedDate, "date");
601
+ };
602
+ var isIsoDateString = (value) => {
603
+ return typeof value === "string" && !isNaN(Date.parse(value));
604
+ };
605
+ function sortDatesChronologically(dates) {
606
+ if (!dates || !dates.length) {
607
+ return [];
608
+ }
609
+ return [...dates].sort((a, b) => {
610
+ const dateTimeFormat = `${dateFormat} ${timeFormat}`;
611
+ const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);
612
+ const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);
613
+ return dateA.valueOf() - dateB.valueOf();
614
+ });
615
+ }
616
+
551
617
  // src/utils/dailyClueGame.ts
552
618
  function createSeededRng(seed) {
553
619
  let t = seed >>> 0;
@@ -582,9 +648,9 @@ function getDayIndex(start, today) {
582
648
  function computeDailyClueState(dailyClue) {
583
649
  const { startDate, endDate } = dailyClue.gameFields.gameDate;
584
650
  const { shuffled, collected } = dailyClue.letterInfo;
585
- const today = dayjs().startOf("day");
586
- const start = dayjs(startDate).startOf("day");
587
- const end = dayjs(endDate).startOf("day");
651
+ const today = toNZTime().startOf("day");
652
+ const start = toNZTime(startDate).startOf("day");
653
+ const end = toNZTime(endDate).startOf("day");
588
654
  const shuffledPlacements = seededShuffle(
589
655
  gameScreenIdentifierList,
590
656
  start.toISOString()
@@ -618,63 +684,7 @@ function computeDailyClueState(dailyClue) {
618
684
  };
619
685
  }
620
686
 
621
- // src/utils/index.ts
622
- import dayjs2 from "dayjs";
623
- import customParseFormat from "dayjs/plugin/customParseFormat.js";
624
- import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
625
- import timezone from "dayjs/plugin/timezone.js";
626
- import utc from "dayjs/plugin/utc.js";
627
- var dateFormat = "DD-MM-YYYY";
628
- var timeFormat = "HH:mm";
629
- dayjs2.extend(customParseFormat);
630
- dayjs2.extend(utc);
631
- dayjs2.extend(timezone);
632
- dayjs2.extend(isSameOrAfter);
633
- var NZ_TZ = "Pacific/Auckland";
634
- function toNZTime(date3) {
635
- return dayjs2(date3).tz(NZ_TZ).format();
636
- }
637
- var formatDate = (dateStr, display = "datetime", timeStr) => {
638
- const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
639
- const dateTime = timeStr ? dayjs2(dateTimeStr, `${dateFormat} ${timeFormat}`) : dayjs2(dateStr, dateFormat);
640
- const formattedDate = dateTime.format("dddd, D MMMM, YYYY");
641
- const formattedTime = dateTime.format("h:mm a");
642
- switch (display) {
643
- case "date":
644
- return formattedDate;
645
- case "time":
646
- return formattedTime;
647
- case "datetime":
648
- return `${formattedDate} at ${formattedTime}`;
649
- default:
650
- return formattedDate;
651
- }
652
- };
653
- var getCurrentAndFutureDates = (dates) => {
654
- const now = dayjs2();
655
- return dates.filter((dateObj) => {
656
- const dateTime = dayjs2(
657
- `${dateObj.startDate} ${dateObj.startTime}`,
658
- `${dateFormat} ${timeFormat}`
659
- );
660
- return dateTime.isSameOrAfter(now);
661
- });
662
- };
663
- var isFutureDatesBeforeThreshold = (date3, minHoursFromNow) => {
664
- const threshold = minHoursFromNow ? dayjs2().add(minHoursFromNow, "hour") : dayjs2().startOf("day");
665
- const dateTime = dayjs2(
666
- `${date3.startDate} ${date3.startTime}`,
667
- `${dateFormat} ${timeFormat}`
668
- );
669
- return dateTime.isSameOrAfter(threshold);
670
- };
671
- var formatTimestamp = (timestamp) => {
672
- const formattedDate = dayjs2(timestamp).tz("Pacific/Auckland").format(dateFormat);
673
- return formatDate(formattedDate, "date");
674
- };
675
- var isIsoDateString = (value) => {
676
- return typeof value === "string" && !isNaN(Date.parse(value));
677
- };
687
+ // src/utils/utils.ts
678
688
  var removeTypename = (obj) => {
679
689
  if (obj instanceof Date) {
680
690
  return obj;
@@ -714,17 +724,6 @@ var statusOptions = [
714
724
  })).sort((a, b) => a.label.localeCompare(b.label))
715
725
  // Sort the options alphabetically
716
726
  ];
717
- function sortDatesChronologically(dates) {
718
- if (!dates || !dates.length) {
719
- return [];
720
- }
721
- return [...dates].sort((a, b) => {
722
- const dateTimeFormat = `${dateFormat} ${timeFormat}`;
723
- const dateA = dayjs2(`${a.startDate} ${a.startTime}`, dateTimeFormat);
724
- const dateB = dayjs2(`${b.startDate} ${b.startTime}`, dateTimeFormat);
725
- return dateA.valueOf() - dateB.valueOf();
726
- });
727
- }
728
727
  var availableRegionTypes = Object.values(EnumRegions);
729
728
  var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
730
729
  var paymentMethodOptions = mapArrayToOptions(
@@ -6208,7 +6207,7 @@ import * as React from "react";
6208
6207
  import { useForm } from "react-hook-form";
6209
6208
 
6210
6209
  // src/yupSchema/global.ts
6211
- import dayjs3 from "dayjs";
6210
+ import dayjs2 from "dayjs";
6212
6211
  import customParseFormat2 from "dayjs/plugin/customParseFormat.js";
6213
6212
  import isSameOrAfter2 from "dayjs/plugin/isSameOrAfter.js";
6214
6213
  import * as yup from "yup";
@@ -6237,8 +6236,8 @@ var noLeadingZeros = (fieldName, options = {}) => {
6237
6236
  return true;
6238
6237
  };
6239
6238
  };
6240
- dayjs3.extend(isSameOrAfter2);
6241
- dayjs3.extend(customParseFormat2);
6239
+ dayjs2.extend(isSameOrAfter2);
6240
+ dayjs2.extend(customParseFormat2);
6242
6241
  var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
6243
6242
  (value) => typeof value === "string" ? value.trim().toLowerCase() : value
6244
6243
  );
@@ -6269,12 +6268,12 @@ var contactDetailsSchema = yup.object({
6269
6268
  landlinePhone: landlinePhoneSchema
6270
6269
  }).nullable().default(void 0);
6271
6270
  var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
6272
- const now = dayjs3();
6273
- return value ? dayjs3(value, dateFormat, true).isSameOrAfter(now, "day") : false;
6271
+ const now = dayjs2();
6272
+ return value ? dayjs2(value, dateFormat, true).isSameOrAfter(now, "day") : false;
6274
6273
  });
6275
6274
  var startDateNotInPastTest = yup.string().test("not-in-past", "Start date cannot be in the past", (value) => {
6276
- const now = dayjs3();
6277
- return value ? dayjs3(value, dateFormat, true).isSameOrAfter(now, "day") : false;
6275
+ const now = dayjs2();
6276
+ return value ? dayjs2(value, dateFormat, true).isSameOrAfter(now, "day") : false;
6278
6277
  });
6279
6278
  var endDateAfterStartDateTest = yup.string().test(
6280
6279
  "end-after-start",
@@ -6282,8 +6281,8 @@ var endDateAfterStartDateTest = yup.string().test(
6282
6281
  function(value) {
6283
6282
  const { startDate } = this.parent;
6284
6283
  if (!startDate || !value) return false;
6285
- return dayjs3(value, dateFormat, true).isSameOrAfter(
6286
- dayjs3(startDate, dateFormat, true),
6284
+ return dayjs2(value, dateFormat, true).isSameOrAfter(
6285
+ dayjs2(startDate, dateFormat, true),
6287
6286
  "day"
6288
6287
  );
6289
6288
  }
@@ -6294,12 +6293,12 @@ var endTimeMustBeAfterStartTimeTest = yup.string().test(
6294
6293
  function(value) {
6295
6294
  const { startDate, endDate, startTime } = this.parent;
6296
6295
  if (!startDate || !endDate || !startTime || !value) return false;
6297
- const startDateTime = dayjs3(
6296
+ const startDateTime = dayjs2(
6298
6297
  `${startDate} ${startTime}`,
6299
6298
  `${dateFormat} ${timeFormat}`,
6300
6299
  true
6301
6300
  );
6302
- const endDateTime = dayjs3(
6301
+ const endDateTime = dayjs2(
6303
6302
  `${endDate} ${value}`,
6304
6303
  `${dateFormat} ${timeFormat}`,
6305
6304
  true
@@ -6311,10 +6310,10 @@ var startTimeCannotBeInPastTest = yup.string().test(
6311
6310
  "valid-start-time",
6312
6311
  "Start time cannot be in the past",
6313
6312
  function(value) {
6314
- const now = dayjs3();
6313
+ const now = dayjs2();
6315
6314
  const { startDate } = this.parent;
6316
6315
  if (!startDate || !value) return false;
6317
- const startDateTime = dayjs3(
6316
+ const startDateTime = dayjs2(
6318
6317
  `${startDate} ${value}`,
6319
6318
  `${dateFormat} ${timeFormat}`,
6320
6319
  true
@@ -7993,6 +7992,7 @@ export {
7993
7992
  getCurrentAndFutureDates,
7994
7993
  globalDefaultValues,
7995
7994
  isFutureDatesBeforeThreshold,
7995
+ isIsoDateString,
7996
7996
  licenseNiceNames,
7997
7997
  lightColors,
7998
7998
  loginFields,