{"version":3,"file":"index-Bl3tkd0V.js","sources":["../../Client/webkit/validation/rules/before/index.ts"],"sourcesContent":["import { Rule } from '@webkit/validation/value';\r\nimport dayjs from 'dayjs';\r\n\r\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore';\r\n\r\ndayjs.extend(isSameOrBefore);\r\n\r\nexport const before = (date: dayjs.Dayjs, inclusive: boolean = false, error?: string) =>\r\n    ({\r\n        id: 'before',\r\n        validator: value => !value || (inclusive ? value.isSameOrBefore(date) : value.isBefore(date)),\r\n        error: (name: string) =>\r\n            error || `Please enter a date ${inclusive ? 'on or ' : ''}before ${date.format('M/D/YYYY')} for ${name}.`,\r\n    } as Rule<dayjs.Dayjs | null>);\r\n"],"names":["dayjs","isSameOrBefore","before","date","inclusive","error","value","name"],"mappings":"uFAKAA,EAAM,OAAOC,CAAc,EAEpB,MAAMC,EAAS,CAACC,EAAmBC,EAAqB,GAAOC,KACjE,CACG,GAAI,SACJ,UAAoBC,GAAA,CAACA,IAAUF,EAAYE,EAAM,eAAeH,CAAI,EAAIG,EAAM,SAASH,CAAI,GAC3F,MAAQI,GACJF,GAAS,uBAAuBD,EAAY,SAAW,EAAE,UAAUD,EAAK,OAAO,UAAU,CAAC,QAAQI,CAAI,GAC9G"}