decord/source/modules/guild_scheduled_events/useEventSchedule.tsx

69 lines
2.8 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 8154
2026-07-27 11:26:19 +00:00
// Function ID: 65390
2026-07-20 16:05:17 +00:00
// Name: _getEventSchedule
2026-07-25 08:10:48 +00:00
// Dependencies: [5751, 8148, 8153, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getEventSchedule, useEventScheduleById
2026-07-25 08:10:48 +00:00
// Module 8154 (_getEventSchedule)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
const require = arg1;
2026-07-20 16:05:17 +00:00
function _getEventSchedule(stateFromStores, eventException, nextRecurrenceIdInEvent) {
let endDate;
let startDate;
if (null != stateFromStores.recurrence_rule) {
if (null != nextRecurrenceIdInEvent) {
let toDateResult;
2026-07-25 08:10:48 +00:00
let obj = require(8148) /* getNextBucketedTime */;
2026-07-20 16:05:17 +00:00
const baseScheduleForRecurrence = obj.getBaseScheduleForRecurrence(nextRecurrenceIdInEvent, stateFromStores);
2026-07-25 08:10:48 +00:00
const scheduleForRecurrenceWithException = require(8148) /* getNextBucketedTime */.getScheduleForRecurrenceWithException(baseScheduleForRecurrence, eventException);
2026-07-20 16:05:17 +00:00
({ startDate, endDate } = scheduleForRecurrenceWithException);
obj = { startTime: startDate.toDate() };
if (null != endDate) {
toDateResult = endDate.toDate();
}
obj.endTime = toDateResult;
return obj;
}
}
obj = { startTime: new Date(stateFromStores.scheduled_start_time) };
let date1 = null;
if (null != stateFromStores.scheduled_end_time) {
const _Date = Date;
date1 = new Date(stateFromStores.scheduled_end_time);
}
obj.endTime = date1;
return obj;
}
2026-07-23 10:11:24 +00:00
const result = require("_getEventException").fileFinishedImporting("modules/guild_scheduled_events/useEventSchedule.tsx");
2026-07-20 16:05:17 +00:00
export default function useEventSchedule(id, nextRecurrenceIdInEvent) {
if (null == nextRecurrenceIdInEvent) {
2026-07-25 08:10:48 +00:00
nextRecurrenceIdInEvent = require(8148) /* getNextBucketedTime */.getNextRecurrenceIdInEvent(id);
const obj = require(8148) /* getNextBucketedTime */;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
return _getEventSchedule(id, importDefault(8153)(nextRecurrenceIdInEvent, id.id), nextRecurrenceIdInEvent);
2026-07-20 16:05:17 +00:00
};
export const useEventScheduleById = function useEventScheduleById(guildEventId, recurrenceId) {
let nextRecurrenceIdInEvent = recurrenceId;
2026-07-23 10:11:24 +00:00
const _require = guildEventId;
const items = [_isNativeReflectConstruct];
const stateFromStores = _require(566).useStateFromStores(items, () => outer1_3.getGuildScheduledEvent(closure_0));
2026-07-20 16:05:17 +00:00
if (null == recurrenceId) {
2026-07-25 08:10:48 +00:00
nextRecurrenceIdInEvent = _require(8148).getNextRecurrenceIdInEvent(stateFromStores);
const obj2 = _require(8148);
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
importDefault(8153);
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
const id = stateFromStores.id;
}
let tmp7 = null;
if (null != stateFromStores) {
tmp7 = _getEventSchedule(stateFromStores, tmp6, nextRecurrenceIdInEvent);
}
return tmp7;
};
export const getEventSchedule = function getEventSchedule(guildEvent, recurrenceId) {
2026-07-25 08:10:48 +00:00
return _getEventSchedule(guildEvent, require(8153) /* _getEventException */.getEventException(recurrenceId, guildEvent.id), recurrenceId);
2026-07-20 16:05:17 +00:00
};