{"version":3,"file":"validate-event.cjs","names":[],"sources":["../../../src/utils/validate-event/validate-event.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { ScheduleEventData } from '../../types';\n\nexport function validateEvent(eventData: ScheduleEventData) {\n  if (!dayjs(eventData.start).isValid()) {\n    throw new Error(`[@mantine/schedule] Invalid start date for event id: ${eventData.id}`);\n  }\n\n  if (!dayjs(eventData.end).isValid()) {\n    throw new Error(`[@mantine/schedule] Invalid end date for event id: ${eventData.id}`);\n  }\n\n  if (dayjs(eventData.end).isBefore(dayjs(eventData.start))) {\n    throw new Error(\n      `[@mantine/schedule] Event end date is before start date for event id: ${eventData.id}`\n    );\n  }\n\n  return eventData;\n}\n"],"mappings":";;;;;AAGA,SAAgB,cAAc,WAA8B;CAC1D,IAAI,EAAA,GAAA,MAAA,QAAA,CAAO,UAAU,KAAK,CAAC,CAAC,QAAQ,GAClC,MAAM,IAAI,MAAM,wDAAwD,UAAU,IAAI;CAGxF,IAAI,EAAA,GAAA,MAAA,QAAA,CAAO,UAAU,GAAG,CAAC,CAAC,QAAQ,GAChC,MAAM,IAAI,MAAM,sDAAsD,UAAU,IAAI;CAGtF,KAAA,GAAA,MAAA,QAAA,CAAU,UAAU,GAAG,CAAC,CAAC,UAAA,GAAA,MAAA,QAAA,CAAe,UAAU,KAAK,CAAC,GACtD,MAAM,IAAI,MACR,yEAAyE,UAAU,IACrF;CAGF,OAAO;AACT"}