import{defineProperty as r}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{isBefore as o,isSameDay as t,isAfter as f}from"date-fns";function n(r,n,e){var i=n.from,u=n.to;if(!i&&!u)return"from"===e?{from:r,to:void 0}:{from:void 0,to:r};if(!i)return o(r,u)?{from:r,to:u}:{from:u,to:r};if(!u)return o(r,i)?{from:r,to:i}:{from:i,to:r};if("to"===e){if(t(r,i)&&t(r,u))return{from:void 0};if(t(r,i))return{from:void 0};if(o(r,i))return{from:r,to:u};if(f(r,i)&&o(r,u))return{from:i,to:r};if(f(r,u)||t(r,u))return{from:i,to:r}}else{if(t(r,i)&&t(r,u))return{from:void 0};if(t(r,u))return{from:r,to:r};if(f(r,u))return{from:i,to:r};if(o(r,u)&&f(r,i))return{from:r,to:u};if(o(r,i))return{from:r,to:u};if(t(r,u))return{from:r}}return{from:i,to:r}}var e=function(r,n){return!(!n.from||!n.to)&&((f(r,n.from)||t(r,n.from))&&(o(r,n.to)||t(r,n.to)))},i="addToRangeMiddle",u="addToRangeStart",m="addToRangeEnd",d="removeFromRange",a="HoveredDayExists",v="HalfRangeSelected";function c(r,o,f,a){if(o){var v=n(o,f,a);if(e(r,v)||e(r,f)){if(t(r,v.to)&&!t(r,f.to))return m;if(t(r,v.from)&&!t(r,f.from))return u;if(e(r,v)){if(e(r,f))return;return t(r,v.from)?u:t(r,v.to)?m:e(o,f)?void 0:i}return e(o,f)?d:void 0}}}function l(o,t,f){return r(r(r(r(r(r({},a,(function(){return!!o})),v,(function(){return!(!t||!(!t.from&&t.to||t.from&&!t.to))})),i,(function(r){return c(r,o,t,f)===i})),u,(function(r){return c(r,o,t,f)===u})),m,(function(r){return c(r,o,t,f)===m})),d,(function(r){return c(r,o,t,f)===d}))}export{m as AddToRangeEnd,i as AddToRangeMiddle,u as AddToRangeStart,v as HalfRangeSelected,a as HoveredDayExists,d as RemoveFromRange,n as addToRange,l as addToRangeModifiers,c as addToRangeNextState};
//# sourceMappingURL=utils.js.map
