import{DECADE_UNIT_DIFF as M}from"../panels/DecadePanel/index.mjs";const S=7;function n(t,r){if(!t&&!r)return!0;if(!t||!r)return!1}function i(t,r,u){const o=n(r,u);if(typeof o=="boolean")return o;const c=Math.floor(t.getYear(r)/10),e=Math.floor(t.getYear(u)/10);return c===e}function Y(t,r,u){const o=n(r,u);return typeof o=="boolean"?o:t.getYear(r)===t.getYear(u)}function D(t,r){return Math.floor(t.getMonth(r)/3)+1}function m(t,r,u){const o=n(r,u);return typeof o=="boolean"?o:Y(t,r,u)&&D(t,r)===D(t,u)}function q(t,r,u){const o=n(r,u);return typeof o=="boolean"?o:Y(t,r,u)&&t.getMonth(r)===t.getMonth(u)}function y(t,r,u){const o=n(r,u);return typeof o=="boolean"?o:t.getYear(r)===t.getYear(u)&&t.getMonth(r)===t.getMonth(u)&&t.getDate(r)===t.getDate(u)}function p(t,r,u){const o=n(r,u);return typeof o=="boolean"?o:t.getHour(r)===t.getHour(u)&&t.getMinute(r)===t.getMinute(u)&&t.getSecond(r)===t.getSecond(u)}function b(t,r,u,o){const c=n(u,o);return typeof c=="boolean"?c:t.locale.getWeek(r,u)===t.locale.getWeek(r,o)}function W(t,r,u){return y(t,r,u)&&p(t,r,u)}function d(t,r,u,o){return!r||!u||!o?!1:!y(t,r,o)&&!y(t,u,o)&&t.isAfter(o,r)&&t.isAfter(u,o)}function E(t,r,u){const o=r.locale.getWeekFirstDay(t),c=r.setDate(u,1),e=r.getWeekDay(c);let s=r.addDate(c,o-e);return r.getMonth(s)===r.getMonth(u)&&r.getDate(s)>1&&(s=r.addDate(s,-7)),s}function w(t,r,u,o=1){switch(r){case"year":return u.addYear(t,o*10);case"quarter":case"month":return u.addYear(t,o);default:return u.addMonth(t,o)}}function F(t,{generateConfig:r,locale:u,format:o}){return typeof o=="function"?o(t):r.locale.format(u.locale,t,o)}function A(t,{generateConfig:r,locale:u,formatList:o}){return!t||typeof o[0]=="function"?null:r.locale.parse(u.locale,t,o)}function f({cellDate:t,mode:r,disabledDate:u,generateConfig:o}){if(!u)return!1;const c=(e,s,h)=>{let l=s;for(;l<=h;){let a;switch(e){case"date":{if(a=o.setDate(t,l),!u(a))return!1;break}case"month":{if(a=o.setMonth(t,l),!f({cellDate:a,mode:"month",generateConfig:o,disabledDate:u}))return!1;break}case"year":{if(a=o.setYear(t,l),!f({cellDate:a,mode:"year",generateConfig:o,disabledDate:u}))return!1;break}}l+=1}return!0};switch(r){case"date":case"week":return u(t);case"month":{const s=o.getDate(o.getEndDate(t));return c("date",1,s)}case"quarter":{const e=Math.floor(o.getMonth(t)/3)*3,s=e+2;return c("month",e,s)}case"year":return c("month",0,11);case"decade":{const e=o.getYear(t),s=Math.floor(e/M)*M,h=s+M-1;return c("year",s,h)}}}export{S as WEEK_DAY_COUNT,F as formatValue,f as getCellDateDisabled,w as getClosingViewDate,D as getQuarter,E as getWeekStartDate,W as isEqual,d as isInRange,n as isNullEqual,y as isSameDate,i as isSameDecade,q as isSameMonth,m as isSameQuarter,p as isSameTime,b as isSameWeek,Y as isSameYear,A as parseValue};
