import{c2 as f,c1 as u}from"./index-BSPIaiZU.js";import{s as c}from"./date-range-picker-BB0TgAn8.js";const p=/^\d{4}-\d{2}-\d{2}$/;function m(e){if(!p.test(e))return!1;const t=new Date(`${e}T00:00:00`);if(Number.isNaN(t.getTime()))return!1;const[n,r,s]=e.split("-").map(Number);return t.getFullYear()!==n||t.getMonth()+1!==r||t.getDate()!==s?!1:e>=f&&e<=u}const g=`Enter a date between ${f.slice(0,4)} and ${u.slice(0,4)}`;function E(e="Date is required"){return c().min(1,e).refine(m,{message:g})}function D(){return c().optional().refine(e=>!e||m(e),{message:g})}function b(){return D().refine(e=>!e||e<=new Date().toISOString().slice(0,10),{message:"Date cannot be in the future"})}function A(e,t,n,r){return e.refine(s=>{const o=s,a=o[t],i=o[n];return typeof a!="string"||typeof i!="string"||!a||!i?!0:i>=a},{message:r??"End date cannot be before start date",path:[n]})}export{D as a,b,E as i,A as w};
