//>>built
(function(){var y=[].slice;var G="undefined"!==typeof module&&null!==module&&null!=module.exports&&"function"===typeof require;var D=function(h){return"[object Array]"===Object.prototype.toString.call(h)};var C=function(h){if(null==h)throw Error("Can't find moment");var u=function(){function d(a,b,c,e){var f;null==e&&(e={});"string"!==typeof c&&(e=null!=c?c:{},c=null);"boolean"===typeof e&&(e={allDay:e});this._oStart=h(a,c,e.parseStrict);this._oEnd=h(b,c,e.parseStrict);this.allDay=null!=(f=e.allDay)?
f:!1;this._mutated()}d._extend=function(){var a,b;var c=arguments[0];var e=2<=arguments.length?y.call(arguments,1):[];var f=0;for(b=e.length;f<b;f++){var g=e[f];for(a in g)"undefined"!==typeof g[a]&&(c[a]=g[a])}return c};d.prototype.start=function(){return this._start.clone()};d.prototype.end=function(){return this._end.clone()};d.prototype.isSame=function(a){return this._start.isSame(this._end,a)};d.prototype.length=function(a,b){null==b&&(b=!1);return this._displayEnd.diff(this._start,a,b)};d.prototype.count=
function(a){var b=this.start().startOf(a);return this.end().startOf(a).diff(b,a)+1};d.prototype.countInner=function(a){var b=this._inner(a);var c=b[0];b=b[1];return c>=b?0:b.diff(c,a)};d.prototype.iterate=function(a,b,c){var e=this._prepIterateInputs(a,b,c);a=e[0];b=e[1];c=e[2];var f=this.start().startOf(b);var g=this.end().startOf(b);this.allDay&&(g=g.add(1,"d"));e=function(l){return function(){return!l.allDay&&f<=g&&(!c||!f.isSame(g)||l._end.hours()>c)||l.allDay&&f<g}}(this);return this._iterateHelper(b,
f,e,a)};d.prototype.iterateInner=function(a,b){b=this._prepIterateInputs(a,b);a=b[0];b=b[1];var c=this._inner(b,a);var e=c[0];var f=c[1];return this._iterateHelper(b,e,function(){return e<f},a)};d.prototype.humanizeLength=function(){return this.allDay?this.isSame("d")?"all day":this._start.from(this.end().add(1,"d"),!0):this._start.from(this._end,!0)};d.prototype.asDuration=function(a){a=this._end.diff(this._start);return h.duration(a)};d.prototype.isPast=function(){return this._lastMilli<h()};d.prototype.isFuture=
function(){return this._start>h()};d.prototype.isCurrent=function(){return!this.isPast()&&!this.isFuture()};d.prototype.contains=function(a){h.isMoment(a)||(a=h(a));return this._start<=a&&this._lastMilli>=a};d.prototype.isEmpty=function(){return this._start.isSame(this._displayEnd)};d.prototype.overlaps=function(a){return this._displayEnd.isAfter(a._start)&&this._start.isBefore(a._displayEnd)};d.prototype.engulfs=function(a){return this._start<=a._start&&this._displayEnd>=a._displayEnd};d.prototype.union=
function(a){var b=this.allDay&&a.allDay;return new d(this._start<a._start?this._start:a._start,this._lastMilli>a._lastMilli?b?this._end:this._displayEnd:b?a._end:a._displayEnd,b)};d.prototype.intersection=function(a){var b=this.allDay&&a.allDay;return new d(this._start>a._start?this._start:a._start,this._lastMilli<a._lastMilli?b?this._end:this._displayEnd:b?a._end:a._displayEnd,b)};d.prototype.xor=function(){var a,b,c;var e=1<=arguments.length?y.call(arguments,0):[];var f=0;var g=null;var l=[];var n=
function(){var z;var w=[];var x=0;for(z=e.length;x<z;x++)c=e[x],c.allDay&&w.push(c);return w}().length===e.length;var q=[];var r=[this].concat(e);var m=b=0;for(a=r.length;b<a;m=++b){var p=r[m];q.push({time:p._start,i:m,type:0});q.push({time:p._displayEnd,i:m,type:1})}q=q.sort(function(z,w){return z.time-w.time});m=0;for(p=q.length;m<p;m++)b=q[m],1===b.type&&--f,f===b.type&&(g=b.time),f===(b.type+1)%2&&(g&&((a=l[l.length-1])&&a._end.isSame(g)?(a._oEnd=b.time,a._mutated()):(a=n?b.time.clone().subtract(1,
"d"):b.time,g=new d(g,a,n),g.isEmpty()||l.push(g))),g=null),0===b.type&&(f+=1);return l};d.prototype.difference=function(){var a;var b=1<=arguments.length?y.call(arguments,0):[];var c=this.xor.apply(this,b).map(function(g){return function(l){return g.intersection(l)}}(this));var e=[];b=0;for(a=c.length;b<a;b++){var f=c[b];!f.isEmpty()&&f.isValid()&&e.push(f)}return e};d.prototype.split=function(){var a,b,c,e,f;var g=1<=arguments.length?y.call(arguments,0):[];var l=c=this.start();h.isDuration(g[0])?
a=g[0]:!h.isMoment(g[0])&&!D(g[0])&&"object"===typeof g[0]||"number"===typeof g[0]&&"string"===typeof g[1]?a=h.duration(g[0],g[1]):f=D(g[0])?g[0]:g;f&&(f=function(){var r;var m=[];var p=0;for(r=f.length;p<r;p++)e=f[p],m.push(h(e));return m}(),f=function(){var r;var m=[];var p=0;for(r=f.length;p<r;p++)b=f[p],b.isValid()&&b>=c&&m.push(b);return m}().sort(function(r,m){return r.valueOf()-m.valueOf()}));if(a&&0===a.asMilliseconds()||f&&0===f.length)return[this];var n=[];var q=0;for(g=this._displayEnd;c<
g&&(null==f||f[q]);)l=a?c.clone().add(a):f[q].clone(),l=h.min(g,l),c.isSame(l)||n.push(h.twix(c,l)),c=l,q+=1;!l.isSame(this._displayEnd)&&f&&n.push(h.twix(l,this._displayEnd));return n};d.prototype.divide=function(a){return this.split(this.length()/a,"ms").slice(0,+(a-1)+1||9E9)};d.prototype.isValid=function(){return this._start.isValid()&&this._end.isValid()&&this._start<=this._displayEnd};d.prototype.equals=function(a){return a instanceof d&&this.allDay===a.allDay&&this._start.valueOf()===a._start.valueOf()&&
this._end.valueOf()===a._end.valueOf()};d.prototype.toString=function(){return"{start: "+this._start.format()+", end: "+this._end.format()+", allDay: "+(this.allDay?"true":"false")+"}"};d.prototype.toArray=function(a,b,c){a=this.iterate(a,b,c);for(b=[];a.hasNext();)b.push(a.next());return b};d.prototype.simpleFormat=function(a,b){var c={allDay:"(all day)",template:d.formatTemplate};d._extend(c,b||{});a=c.template(this._start.format(a),this._end.format(a));this.allDay&&c.allDay&&(a+=" "+c.allDay);
return a};d.prototype.format=function(a){var b;if(this.isEmpty())return"";var c={groupMeridiems:!0,spaceBeforeMeridiem:!0,showDayOfWeek:!1,hideTime:!1,hideYear:!1,implicitMinutes:!0,implicitDate:!1,implicitYear:!0,yearFormat:"YYYY",monthFormat:"MMM",weekdayFormat:"ddd",dayFormat:"D",meridiemFormat:"A",hourFormat:this._start.localeData()._longDateFormat.LT[0],minuteFormat:"mm",allDay:"all day",explicitAllDay:!1,lastNightEndsAt:0,template:d.formatTemplate};d._extend(c,a||{});a=[];var e=c.hourFormat&&
"h"===c.hourFormat[0];var f=this._start.localeData()._longDateFormat.L;var g=f.indexOf("M")<f.indexOf("D");var l=0<c.lastNightEndsAt&&!this.allDay&&this.end().startOf("d").valueOf()===this.start().add(1,"d").startOf("d").valueOf()&&12<this._start.hours()&&this._end.hours()<c.lastNightEndsAt;var n=!c.hideDate&&(!c.implicitDate||this.start().startOf("d").valueOf()!==h().startOf("d").valueOf()||!(this.isSame("d")||l));f=!(this.allDay||c.hideTime);this.allDay&&this.isSame("d")&&(c.implicitDate||c.explicitAllDay)&&
a.push({name:"all day simple",fn:function(){return c.allDay},pre:" ",slot:0});!n||c.hideYear||c.implicitYear&&this._start.year()===h().year()&&this.isSame("y")||a.push({name:"year",fn:function(k){return k.format(c.yearFormat)},pre:g?", ":" ",slot:4});f&&n&&a.push({name:"month-date",fn:function(k){return k.format(g?c.monthFormat+" "+c.dayFormat:c.dayFormat+" "+c.monthFormat)},ignoreEnd:function(){return l},pre:" ",slot:2});!f&&n&&a.push({name:"month",fn:function(k){return k.format(c.monthFormat)},
pre:" ",slot:g?2:3});!f&&n&&a.push({name:"date",fn:function(k){return k.format(c.dayFormat)},pre:" ",slot:g?3:2});n&&c.showDayOfWeek&&a.push({name:"day of week",fn:function(k){return k.format(c.weekdayFormat)},pre:" ",slot:1});c.groupMeridiems&&e&&!this.allDay&&!c.hideTime&&a.push({name:"meridiem",fn:function(k){return k.format(c.meridiemFormat)},slot:6,pre:c.spaceBeforeMeridiem?" ":""});this.allDay||c.hideTime||a.push({name:"time",fn:function(k){var t=0===k.minutes()&&c.implicitMinutes&&e?k.format(c.hourFormat):
k.format(c.hourFormat+":"+c.minuteFormat);!c.groupMeridiems&&e&&(c.spaceBeforeMeridiem&&(t+=" "),t+=k.format(c.meridiemFormat));return t},slot:5,pre:", "});var q=[];var r=[];var m=[];var p=!0;var z=function(k){return function(t){var A=t.fn(k._start);var B=t.ignoreEnd&&t.ignoreEnd()?A:t.fn(k._end);var v={format:t,value:function(){return A}};if(B===A&&p)return m.push(v);p&&(p=!1,m.push({format:{slot:t.slot,pre:""},value:function(){return c.template(x(q),x(r,!0).trim())}}));q.push(v);return r.push({format:t,
value:function(){return B}})}}(this);n=0;for(b=a.length;n<b;n++)f=a[n],z(f);var w=!0;var x=function(k,t){var A;var B=!0;var v="";var E=k.sort(function(H,I){return H.format.slot-I.format.slot});k=0;for(A=E.length;k<A;k++){var F=E[k];w||(v=B&&t?v+" ":v+F.format.pre);v+=F.value();B=w=!1}return v};return x(m)};d.prototype._iterateHelper=function(a,b,c,e){return{next:function(){if(c()){var f=b.clone();b.add(e,a);return f}return null},hasNext:c}};d.prototype._prepIterateInputs=function(){var a,b,c;var e=
1<=arguments.length?y.call(arguments,0):[];if("number"===typeof e[0])return e;if("string"===typeof e[0]){var f=e.shift();var g=null!=(b=e.pop())?b:1;e.length&&(a=null!=(c=e[0])?c:!1)}h.isDuration(e[0])&&(f="ms",g=e[0].as(f));return[g,f,a]};d.prototype._inner=function(a,b){null==a&&(a="ms");null==b&&(b=1);var c=this.start();var e=this._displayEnd.clone();c>c.clone().startOf(a)&&c.startOf(a).add(b,a);e<e.clone().endOf(a)&&e.startOf(a);var f=c.twix(e).asDuration(a).get(a);e.subtract(f%b,a);return[c,
e]};d.prototype._mutated=function(){this._start=this.allDay?this._oStart.clone().startOf("d"):this._oStart;this._lastMilli=this.allDay?this._oEnd.clone().endOf("d"):this._oEnd;this._end=this.allDay?this._oEnd.clone().startOf("d"):this._oEnd;return this._displayEnd=this.allDay?this._end.clone().add(1,"d"):this._end};return d}();u._extend(h.locale(),{_twix:u.defaults});u.formatTemplate=function(d,a){return d+" - "+a};h.twix=function(){return function(d,a,b){b.prototype=d.prototype;b=new b;d=d.apply(b,
a);return Object(d)===d?d:b}(u,arguments,function(){})};h.fn.twix=function(){return function(d,a,b){b.prototype=d.prototype;b=new b;d=d.apply(b,a);return Object(d)===d?d:b}(u,[this].concat(y.call(arguments)),function(){})};h.fn.forDuration=function(d,a){return new u(this,this.clone().add(d),a)};h.duration.fn&&(h.duration.fn.afterMoment=function(d,a){return new u(d,h(d).clone().add(this),a)},h.duration.fn.beforeMoment=function(d,a){return new u(h(d).clone().subtract(this),d,a)});return h.twixClass=
u};if(G)return module.exports=C(require("moment/moment"));this.moment?this.Twix=C(this.moment):"undefined"!==typeof moment&&null!==moment&&(this.Twix=C(moment));this.makeTwix=C}).call(this);