/**
 * Copyright (c) 2022 Visa, Inc.
 *
 * This source code is licensed under the MIT license
 * https://github.com/visa/visa-chart-components/blob/master/LICENSE
 *
 **/
var n=new Date,t=new Date;function u(r,e,i,f){function o(n){return r(n=0===arguments.length?new Date:new Date(+n)),n}return o.floor=function(n){return r(n=new Date(+n)),n},o.ceil=function(n){return r(n=new Date(n-1)),e(n,1),r(n),n},o.round=function(n){var t=o(n),u=o.ceil(n);return n-t<u-n?t:u},o.offset=function(n,t){return e(n=new Date(+n),null==t?1:Math.floor(t)),n},o.range=function(n,t,u){var i,f=[];if(n=o.ceil(n),u=null==u?1:Math.floor(u),!(n<t&&u>0))return f;do{f.push(i=new Date(+n)),e(n,u),r(n)}while(i<n&&n<t);return f},o.filter=function(n){return u((function(t){if(t>=t)for(;r(t),!n(t);)t.setTime(t-1)}),(function(t,u){if(t>=t)if(u<0)for(;++u<=0;)for(;e(t,-1),!n(t););else for(;--u>=0;)for(;e(t,1),!n(t););}))},i&&(o.count=function(u,e){return n.setTime(+u),t.setTime(+e),r(n),r(t),Math.floor(i(n,t))},o.every=function(n){return n=Math.floor(n),isFinite(n)&&n>0?n>1?o.filter(f?function(t){return f(t)%n==0}:function(t){return o.count(0,t)%n==0}):o:null}),o}var r=1e3,e=6e4,i=36e5,f=864e5,o=6048e5,c=u((function(n){n.setTime(n-n.getMilliseconds()-1e3*n.getSeconds()-n.getMinutes()*e)}),(function(n,t){n.setTime(+n+t*i)}),(function(n,t){return(t-n)/i}),(function(n){return n.getHours()})),a=u((function(n){n.setHours(0,0,0,0)}),(function(n,t){n.setDate(n.getDate()+t)}),(function(n,t){return(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*e)/f}),(function(n){return n.getDate()-1}));function s(n){return u((function(t){t.setDate(t.getDate()-(t.getDay()+7-n)%7),t.setHours(0,0,0,0)}),(function(n,t){n.setDate(n.getDate()+7*t)}),(function(n,t){return(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*e)/o}))}var l=s(0),w=s(1);s(2),s(3);var h=s(4);s(5),s(6);var D=u((function(n){n.setDate(1),n.setHours(0,0,0,0)}),(function(n,t){n.setMonth(n.getMonth()+t)}),(function(n,t){return t.getMonth()-n.getMonth()+12*(t.getFullYear()-n.getFullYear())}),(function(n){return n.getMonth()})),v=u((function(n){n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,t){n.setFullYear(n.getFullYear()+t)}),(function(n,t){return t.getFullYear()-n.getFullYear()}),(function(n){return n.getFullYear()}));v.every=function(n){return isFinite(n=Math.floor(n))&&n>0?u((function(t){t.setFullYear(Math.floor(t.getFullYear()/n)*n),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,u){t.setFullYear(t.getFullYear()+u*n)})):null};export{r as a,e as b,f as c,a as d,o as e,w as f,c as h,D as m,u as n,l as s,h as t,v as y}