Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`),require(`./datepicker-constants.cjs`);let e=require(`date-fns`);var t=e=>e?new Date(e):new Date,n=(n,r,i,a=null,o=null)=>{let s=t(JSON.parse(JSON.stringify(n))),c=a?(0,e.startOfDay)(a):null,l=o?(0,e.startOfDay)(o):null,u=[];for(let t=0;t<7;t++){let n=(0,e.addDays)(s,t),a=(0,e.getMonth)(n)!==r,o=a||c&&(0,e.startOfDay)(n)<c||l&&(0,e.startOfDay)(n)>l;u.push({text:n.getDate(),value:n,currentMonth:!a,disabled:!!o,isFirstDayOfMonth:n.getDate()===1&&!a,selected:i?n.getDate()===i&&!o:!1})}return u},r=(t,n)=>!t||!n?!1:(0,e.isEqual)(t,n),i=(i,a,o,s=null,c=null,l=0)=>{let u=[],d=t(new Date(a,i)),f=t(new Date(a,i+1,0)),p=(0,e.startOfWeek)(d,{weekStartsOn:l}),m=t=>{let a=n(t,i,o,s,c);u.push({days:a}),u[u.length-1].days.some(e=>r(e.value,f))||m((0,e.addDays)(t,7))};return m(p),u},a=(e,t)=>{let n=[1,2,3,4,5,6,7].map(t=>new Intl.DateTimeFormat(e,{weekday:`short`,timeZone:`UTC`}).format(new Date(`2017-01-0${t}T00:00:00+00:00`)).slice(0,2)),r=n.slice(0,t),i=n.slice(t+1,n.length);return[n[t]].concat(...i,...r)},o=(e,t,n)=>new Intl.DateTimeFormat(n,{month:t}).format(new Date(2e3,e,1)),s=(e,t,n)=>new Intl.DateTimeFormat(n,{dateStyle:t}).format(new Date(e)),c=t=>{let n=new Date(t),r=(0,e.getDay)(n),i=(0,e.startOfMonth)((0,e.addMonths)(n,1));return(0,e.getDate)((0,e.addDays)(i,(r-(0,e.getDay)(i)+7)%7))},l=t=>{let n=new Date(t),r=(0,e.getDay)(n),i=(0,e.endOfMonth)((0,e.subMonths)(n,1));for(;(0,e.getDay)(i)!==r;)i=(0,e.addDays)(i,-1);return(0,e.getDate)(i)};exports.calculateNextFocusDate=c,exports.calculatePrevFocusDate=l,exports.formatDate=s,exports.formatMonth=o,exports.getCalendarDays=i,exports.getWeekDayNames=a;
//# sourceMappingURL=utils.cjs.map