text: /**
   * angular-bootstrap-calendar - A pure AngularJS bootstrap themed responsive calendar that can display events and has views for year, month, week and day
   * @version v0.30.0
   * @link https://github.com/mattlewis92/angular-bootstrap-calendar
   * @license MIT
   */
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("angular"),require("moment"),function(){try{return require("interactjs")}catch(e){}}()):"function"==typeof define&&define.amd?define(["angular","moment","interact"],t):"object"==typeof exports?exports.angularBootstrapCalendarModuleName=t(require("angular"),require("moment"),function(){try{return require("interactjs")}catch(e){}}()):e.angularBootstrapCalendarModuleName=t(e.angular,e.moment,e.interact)}(this,function(e,t,n){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=60)}([function(t,n){t.exports=e},function(e,t,n){function a(e,t){if(c(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var n=t||{},a=n.additionalDigits;a=null==a?u:Number(a);var s=r(e),v=i(s.date,a),p=v.year,f=v.restDateString,w=l(f,p);if(w){var g,y=w.getTime(),h=0;return s.time&&(h=o(s.time)),s.timezone?g=d(s.timezone):(g=new Date(y+h).getTimezoneOffset(),g=new Date(y+h+g*m).getTimezoneOffset()),new Date(y+h+g*m)}return new Date(e)}function r(e){var t,n={},a=e.split(p);if(f.test(a[0])?(n.date=null,t=a[0]):(n.date=a[0],t=a[1]),t){var r=M.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function i(e,t){var n,a=g[t],r=h[t];if(n=y.exec(e)||r.exec(e)){var i=n[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(n=w.exec(e)||a.exec(e)){var l=n[1];return{year:100*parseInt(l,10),restDateString:e.slice(l.length)}}return{year:null}}function l(e,t){if(null===t)return null;var n,a,r,i;if(0===e.length)return a=new Date(0),a.setUTCFullYear(t),a;if(n=D.exec(e))return a=new Date(0),r=parseInt(n[1],10)-1,a.setUTCFullYear(t,r),a;if(n=b.exec(e)){a=new Date(0);var l=parseInt(n[1],10);return a.setUTCFullYear(t,0,l),a}if(n=x.exec(e)){a=new Date(0),r=parseInt(n[1],10)-1;var o=parseInt(n[2],10);return a.setUTCFullYear(t,r,o),a}if(n=C.exec(e))return i=parseInt(n[1],10)-1,s(t,i);if(n=E.exec(e)){i=parseInt(n[1],10)-1;return s(t,i,parseInt(n[2],10)-1)}return null}function o(e){var t,n,a;if(t=k.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*v;if(t=S.exec(e))return n=parseInt(t[1],10),a=parseFloat(t[2].replace(",",".")),n%24*v+a*m;if(t=T.exec(e)){n=parseInt(t[1],10),a=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return n%24*v+a*m+1e3*r}return null}function d(e){var t,n;return(t=V.exec(e))?0:(t=A.exec(e))?(n=60*parseInt(t[2],10),"+"===t[1]?-n:n):(t=$.exec(e),t?(n=60*parseInt(t[2],10)+parseInt(t[3],10),"+"===t[1]?-n:n):0)}function s(e,t,n){t=t||0,n=n||0;var a=new Date(0);a.setUTCFullYear(e,0,4);var r=a.getUTCDay()||7,i=7*t+n+1-r;return a.setUTCDate(a.getUTCDate()+i),a}var c=n(24),v=36e5,m=6e4,u=2,p=/[T ]/,f=/:/,w=/^(\d{2})$/,g=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],y=/^(\d{4})/,h=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],D=/^-(\d{2})$/,b=/^-?(\d{3})$/,x=/^-?(\d{2})-?(\d{2})$/,C=/^-?W(\d{2})$/,E=/^-?W(\d{2})-?(\d{1})$/,k=/^(\d{2}([.,]\d*)?)$/,S=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,T=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,M=/([Z+-].*)$/,V=/^(Z)$/,A=/^([+-])(\d{2})$/,$=/^([+-])(\d{2}):?(\d{2})$/;e.exports=a},function(e,t,n){function a(e,t){var n=r(e).getTime(),a=Number(t);return new Date(n+a)}var r=n(1);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setHours(0,0,0,0),t}var r=n(1);e.exports=a},function(e,t,n){"use strict";function a(e){var t=e.startDate,n=e.seconds,a=e.excluded,r=e.precision,i=void 0===r?"days":r;if(a.length<1)return 0;var l,o,d,s=0;switch(i){case"minutes":l=X()(t,n-1),o=k()(t),d=k()(X()(l,0)),a.forEach(function(e){e===o?s+=R()(f()(t),t)+1:e===d?s+=R()(l,b()(l))+1:e>o&&e<d&&(s+=de)});break;case"days":l=X()(b()(t),n-1),o=k()(b()(t)),d=k()(l),s+=a.filter(function(e){return e>=o&&e<=d}).length*de}return s}function r(e){var t=e.event,n=e.offset,r=e.startOfWeekDate,i=e.excluded,l=e.precision,o=void 0===l?"days":l,d=e.weekStartsOn;n=Math.round(n*de);var s=de,c=ae()(t.start,r),v=$()(r,{weekStartsOn:d});if(t.end)switch(o){case"days":s=(h()(te()(b()(t.end),b()(v)),b()(c))+1)*de;break;case"minutes":s=R()(te()(t.end,X()(v,1)),c)}return(s-=a({startDate:c,seconds:s,excluded:i,precision:o}))/de}function i(e){var t=e.event,n=e.startOfWeek,r=e.excluded,i=void 0===r?[]:r,l=e.precision,o=void 0===l?"days":l;if(t.start<n)return 0;var d;switch(o){case"days":d=h()(b()(t.start),n)*de;break;case"minutes":d=R()(t.start,n)}return(d-=a({startDate:n,seconds:d,excluded:i,precision:o}))/de}function l(e){var t=e.event,n=e.periodStart,a=e.periodEnd,r=t.start,i=t.end||t.start;return r>n&&r<a||(i>n&&i<a||(r<n&&i>a||(!(!Y()(r,n)&&!Y()(r,a))||!(!Y()(i,n)&&!Y()(i,a)))))}function o(e){var t=e.events,n=e.periodStart,a=e.periodEnd;return t.filter(function(e){return l({event:e,periodStart:n,periodEnd:a})})}function d(e){var t=e.date,n=b()(new Date);return{date:t,isPast:t<n,isToday:C()(t,n),isFuture:t>n,isWeekend:re.indexOf(k()(t))>-1}}function s(e){for(var t=e.viewDate,n=e.weekStartsOn,a=e.excluded,r=void 0===a?[]:a,i=T()(t,{weekStartsOn:n}),l=[],o=0;o<ie;o++)!function(e){var t=V()(i,e);r.some(function(e){return t.getDay()===e})||l.push(d({date:t}))}(o);return l}function c(e){var t=e.events,n=void 0===t?[]:t,a=e.viewDate,l=e.weekStartsOn,d=e.excluded,s=void 0===d?[]:d,c=e.precision,v=void 0===c?"days":c,m=e.absolutePositionedEvents,u=void 0!==m&&m;n||(n=[]);var p=T()(a,{weekStartsOn:l}),f=$()(a,{weekStartsOn:l}),w=ie-s.length,g=o({events:n,periodStart:p,periodEnd:f}).map(function(e){var t=i({event:e,startOfWeek:p,excluded:s,precision:v});return{event:e,offset:t,span:r({event:e,offset:t,startOfWeekDate:p,excluded:s,precision:v,weekStartsOn:l})}}).filter(function(e){return e.offset<w}).filter(function(e){return e.span>0}).map(function(e){return{event:e.event,offset:e.offset,span:e.span,startsBeforeWeek:e.event.start<p,endsAfterWeek:(e.event.end||e.event.start)>f}}).sort(function(e,t){var n=R()(e.event.start,t.event.start);return 0===n?R()(t.event.end||t.event.start,e.event.end||e.event.start):n}),y=[],h=[];return g.forEach(function(e,t){if(-1===h.indexOf(e)){h.push(e);var n=e.span+e.offset,a=g.slice(t+1).filter(function(e){if(e.offset>=n&&n+e.span<=ie&&-1===h.indexOf(e)){var t=e.offset-n;return u||(e.offset=t),n+=e.span+t,h.push(e),!0}});y.push({row:[e].concat(a)})}}),y}function v(e){var t=e.events,n=void 0===t?[]:t,a=e.viewDate,r=e.weekStartsOn,i=e.excluded,l=void 0===i?[]:i,s=e.viewStart,c=void 0===s?H()(a):s,v=e.viewEnd,m=void 0===v?j()(a):v;n||(n=[]);for(var u,p=T()(c,{weekStartsOn:r}),w=$()(m,{weekStartsOn:r}),g=o({events:n,periodStart:p,periodEnd:w}),y=[],D=0;D<h()(w,p)+1;D++)!function(e){var t;if(u?(t=b()(K()(u,le)),u.getTime()===t.getTime()&&(t=b()(K()(u,le+1))),u=t):t=u=p,!l.some(function(e){return t.getDay()===e})){var n=d({date:t}),r=o({events:g,periodStart:b()(t),periodEnd:f()(t)});n.inMonth=N()(t,a),n.events=r,n.badgeTotal=r.length,y.push(n)}}();for(var x=ie-l.length,C=Math.floor(y.length/x),E=[],D=0;D<C;D++)E.push(D*x);return{rowOffsets:E,totalDaysVisibleInWeek:x,days:y}}function m(e){var t=e.events,n=void 0===t?[]:t,a=e.viewDate,r=e.hourSegments,i=e.dayStart,l=e.dayEnd,d=e.eventWidth,s=e.segmentHeight;n||(n=[]);var c=L()(B()(b()(a),i.hour),i.minute),v=L()(B()(q()(f()(a)),l.hour),l.minute),m=[],u=o({events:n.filter(function(e){return!e.allDay}),periodStart:c,periodEnd:v}).sort(function(e,t){return e.start.valueOf()-t.start.valueOf()}).map(function(e){var t=e.start,n=e.end||t,a=t<c,i=n>v,l=r*s/oe,o=0;t>c&&(o+=Z()(t,c)),o*=l;var u=a?c:t,p=i?v:n,f=Z()(p,u);e.end?f*=l:f=s;for(var w=o+f,g=m.filter(function(e){var t=e.top,n=e.top+e.height;return o<n&&n<w||t<=o&&w<=n}),y=0;g.some(function(e){return e.left===y});)y+=d;var h={event:e,height:f,width:d,top:o,left:y,startsBeforeDay:a,endsAfterDay:i};return f>0&&m.push(h),h}).filter(function(e){return e.height>0});return{events:u,width:Math.max.apply(Math,u.map(function(e){return e.left+e.width})),allDayEvents:o({events:n.filter(function(e){return e.allDay}),periodStart:b()(c),periodEnd:f()(v)})}}function u(e){for(var t=e.viewDate,n=e.hourSegments,a=e.dayStart,r=e.dayEnd,i=[],l=L()(B()(b()(t),a.hour),a.minute),o=L()(B()(q()(f()(t)),r.hour),r.minute),d=oe/n,s=b()(t),c=0;c<le;c++){for(var v=[],m=0;m<n;m++){var u=g()(K()(s,c),m*d);u>=l&&u<o&&v.push({date:u,isStart:0===m})}v.length>0&&i.push({segments:v})}return i}Object.defineProperty(t,"__esModule",{value:!0});var p=n(20),f=n.n(p),w=n(13),g=n.n(w),y=n(17),h=n.n(y),D=n(3),b=n.n(D),x=n(25),C=n.n(x),E=n(23),k=n.n(E),S=n(35),T=n.n(S),M=n(11),V=n.n(M),A=n(22),$=n.n(A),O=n(19),R=n.n(O),I=n(33),H=n.n(I),W=n(21),j=n.n(W),F=n(26),N=n.n(F),z=n(27),Y=n.n(z),U=n(30),B=n.n(U),P=n(31),L=n.n(P),G=n(32),q=n.n(G),_=n(18),Z=n.n(_),J=n(12),K=n.n(J),Q=n(14),X=n.n(Q),ee=n(29),te=n.n(ee),ne=n(28),ae=n.n(ne);n.d(t,"SECONDS_IN_DAY",function(){return de}),t.getWeekViewEventOffset=i,t.getWeekViewHeader=s,t.getWeekView=c,t.getMonthView=v,t.getDayView=m,t.getDayViewHourGrid=u;var re=[0,6],ie=7,le=24,oe=60,de=86400},function(e,t,n){function a(e,t){var n=r(e),a=r(t);return n.getTime()-a.getTime()}var r=n(1);e.exports=a},function(e,t){},function(e,t,n){function a(e){return n(r(e))}function r(e){var t=i[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var i={"./mwlCalendar.js":45,"./mwlCalendarDay.js":46,"./mwlCalendarHourList.js":47,"./mwlCalendarMonth.js":48,"./mwlCalendarSlideBox.js":49,"./mwlCalendarWeek.js":50,"./mwlCalendarYear.js":51,"./mwlCollapseFallback.js":52,"./mwlDateModifier.js":53,"./mwlDragSelect.js":54,"./mwlDraggable.js":55,"./mwlDroppable.js":56,"./mwlDynamicDirectiveTemplate.js":57,"./mwlElementDimensions.js":58,"./mwlResizable.js":59};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=7},function(e,t,n){function a(e){return n(r(e))}function r(e){var t=i[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var i={"./calendarDate.js":61,"./calendarLimitTo.js":62,"./calendarTruncateEventTitle.js":63,"./calendarTrustAsHtml.js":64};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=8},function(e,t,n){function a(e){return n(r(e))}function r(e){var t=i[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var i={"./calendarConfig.js":65,"./calendarEventTitle.js":66,"./calendarHelper.js":67,"./calendarTitle.js":68,"./interact.js":69,"./moment.js":70};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=9},function(e,t,n){function a(e){return n(r(e))}function r(e){var t=i[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var i={"./calendar.html":36,"./calendarDayView.html":37,"./calendarHourList.html":38,"./calendarMonthCell.html":39,"./calendarMonthCellEvents.html":40,"./calendarMonthView.html":41,"./calendarSlideBox.html":42,"./calendarWeekView.html":43,"./calendarYearView.html":44};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=10},function(e,t,n){function a(e,t){var n=r(e),a=Number(t);return n.setDate(n.getDate()+a),n}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=Number(t);return r(e,n*i)}var r=n(2),i=36e5;e.exports=a},function(e,t,n){function a(e,t){var n=Number(t);return r(e,n*i)}var r=n(2),i=6e4;e.exports=a},function(e,t,n){function a(e,t){var n=Number(t);return r(e,1e3*n)}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=n.getTime(),i=r(t),l=i.getTime();return a<l?-1:a>l?1:0}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=r(t),o=n.getTime()-n.getTimezoneOffset()*i,d=a.getTime()-a.getTimezoneOffset()*i;return Math.round((o-d)/l)}var r=n(3),i=6e4,l=864e5;e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=r(t),o=l(n,a),d=Math.abs(i(n,a));return n.setDate(n.getDate()-o*d),o*(d-(l(n,a)===-o))}var r=n(1),i=n(16),l=n(15);e.exports=a},function(e,t,n){function a(e,t){var n=r(e,t)/i;return n>0?Math.floor(n):Math.ceil(n)}var r=n(5),i=6e4;e.exports=a},function(e,t,n){function a(e,t){var n=r(e,t)/1e3;return n>0?Math.floor(n):Math.ceil(n)}var r=n(5);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setHours(23,59,59,999),t}var r=n(1);e.exports=a},function(e,t,n){function a(e){var t=r(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=t?Number(t.weekStartsOn)||0:0,a=r(e),i=a.getDay(),l=6+(i<n?-7:0)-(i-n);return a.setDate(a.getDate()+l),a.setHours(23,59,59,999),a}var r=n(1);e.exports=a},function(e,t,n){function a(e){return r(e).getDay()}var r=n(1);e.exports=a},function(e,t){function n(e){return e instanceof Date}e.exports=n},function(e,t,n){function a(e,t){var n=r(e),a=r(t);return n.getTime()===a.getTime()}var r=n(3);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=r(t);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=r(t);return n.getTime()===a.getTime()}var r=n(34);e.exports=a},function(e,t,n){function a(){var e=Array.prototype.slice.call(arguments),t=e.map(function(e){return r(e)}),n=Math.max.apply(null,t);return new Date(n)}var r=n(1);e.exports=a},function(e,t,n){function a(){var e=Array.prototype.slice.call(arguments),t=e.map(function(e){return r(e)}),n=Math.min.apply(null,t);return new Date(n)}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=Number(t);return n.setHours(a),n}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=Number(t);return n.setMinutes(a),n}var r=n(1);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setSeconds(0,0),t}var r=n(1);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setDate(1),t.setHours(0,0,0,0),t}var r=n(1);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setMilliseconds(0),t}var r=n(1);e.exports=a},function(e,t,n){function a(e,t){var n=t?Number(t.weekStartsOn)||0:0,a=r(e),i=a.getDay(),l=(i<n?7:0)+i-n;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}var r=n(1);e.exports=a},function(e,t){e.exports="<div class=cal-context ng-switch=vm.view ng-if=vm.templatesLoaded> <div class=\"alert alert-danger\" ng-switch-default>The value passed to the view attribute of the calendar is not set</div> <div class=\"alert alert-danger\" ng-hide=vm.viewDate>The value passed to view-date attribute of the calendar is not set</div> <mwl-calendar-year events=vm.events view-date=vm.viewDate on-event-click=vm.onEventClick on-event-times-changed=vm.onEventTimesChanged on-timespan-click=vm.onTimespanClick cell-is-open=vm.cellIsOpen cell-modifier=vm.cellModifier slide-box-disabled=vm.slideBoxDisabled custom-template-urls=vm.customTemplateUrls template-scope=vm.templateScope cell-auto-open-disabled=vm.cellAutoOpenDisabled ng-switch-when=year> </mwl-calendar-year> <mwl-calendar-month events=vm.events view-date=vm.viewDate excluded-days=vm.excludedDays on-event-click=vm.onEventClick on-event-times-changed=vm.onEventTimesChanged on-timespan-click=vm.onTimespanClick on-date-range-select=vm.onDateRangeSelect cell-is-open=vm.cellIsOpen cell-modifier=vm.cellModifier slide-box-disabled=vm.slideBoxDisabled custom-template-urls=vm.customTemplateUrls template-scope=vm.templateScope cell-auto-open-disabled=vm.cellAutoOpenDisabled draggable-auto-scroll=vm.draggableAutoScroll ng-switch-when=month> </mwl-calendar-month> <mwl-calendar-week events=vm.events view-date=vm.viewDate excluded-days=vm.excludedDays on-event-click=vm.onEventClick on-event-times-changed=vm.onEventTimesChanged day-view-start=vm.dayViewStart day-view-end=vm.dayViewEnd day-view-split=vm.dayViewSplit day-view-event-chunk-size=vm.dayViewEventChunkSize on-timespan-click=vm.onTimespanClick on-date-range-select=vm.onDateRangeSelect custom-template-urls=vm.customTemplateUrls cell-modifier=vm.cellModifier template-scope=vm.templateScope draggable-auto-scroll=vm.draggableAutoScroll ng-switch-when=week> </mwl-calendar-week> <mwl-calendar-day events=vm.events view-date=vm.viewDate on-event-click=vm.onEventClick on-event-times-changed=vm.onEventTimesChanged on-timespan-click=vm.onTimespanClick on-date-range-select=vm.onDateRangeSelect day-view-start=vm.dayViewStart day-view-end=vm.dayViewEnd day-view-split=vm.dayViewSplit day-view-event-chunk-size=vm.dayViewEventChunkSize day-view-event-width=vm.dayViewEventWidth custom-template-urls=vm.customTemplateUrls cell-modifier=vm.cellModifier template-scope=vm.templateScope day-view-time-position=\"vm.dayViewTimePosition || 'default'\" draggable-auto-scroll=vm.draggableAutoScroll ng-class=\"{\n      'time-on-side' : vm.dayViewTimePosition === 'side',\n      'time-hidden' : vm.dayViewTimePosition === 'hidden'\n    }\" ng-switch-when=day> </mwl-calendar-day> </div> "},function(e,t){e.exports='<div class="cal-week-box cal-all-day-events-box" ng-if="vm.allDayEvents.length > 0"> <div class="cal-day-panel clearfix"> <div class=row> <div class=col-xs-12> <div class=cal-row-fluid> <div class="cal-cell-6 day-highlight" ng-style="{backgroundColor: event.color.secondary}" data-event-class ng-repeat="event in vm.allDayEvents track by event.calendarEventId"> <strong> <span ng-bind="event.startsAt | calendarDate:\'datetime\':true"></span> <span ng-if=event.endsAt> - <span ng-bind="event.endsAt | calendarDate:\'datetime\':true"></span> </span> </strong> <a href=javascript:; class=event-item ng-bind-html="vm.calendarEventTitle.dayView(event) | calendarTrustAsHtml"> </a> </div> </div> </div> </div> </div> </div> <div class=cal-day-box> <div class="cal-day-panel clearfix" ng-style="{height: vm.dayViewHeight + \'px\', minWidth: vm.viewWidth + \'px\'}"> <mwl-calendar-hour-list day-view-start=vm.dayViewStart day-view-end=vm.dayViewEnd day-view-split=vm.dayViewSplit on-timespan-click=vm.onTimespanClick on-date-range-select=vm.onDateRangeSelect on-event-times-changed=vm.onEventTimesChanged view-date=vm.viewDate custom-template-urls=vm.customTemplateUrls template-scope=vm.templateScope cell-modifier=vm.cellModifier view=day> </mwl-calendar-hour-list> <div class="pull-left day-event day-highlight" ng-repeat="dayEvent in vm.nonAllDayEvents track by dayEvent.event.calendarEventId" ng-class=dayEvent.event.cssClass ng-style="{\n        top: dayEvent.top - 1 + \'px\',\n        left: dayEvent.left +  vm.dayViewTimePositionOffset + \'px\',\n        height: dayEvent.height + \'px\',\n        width: dayEvent.width + \'px\',\n        backgroundColor: dayEvent.event.color.secondary,\n        borderColor: dayEvent.event.color.primary\n      }" mwl-draggable="dayEvent.event.draggable === true" axis="\'xy\'" snap-grid="{y: vm.dayViewEventChunkSize || 30, x: 50}" on-drag="vm.eventDragged(dayEvent.event, y / 30)" on-drag-end="vm.eventDragComplete(dayEvent.event, y / 30)" auto-scroll=vm.draggableAutoScroll mwl-resizable="dayEvent.event.resizable === true && dayEvent.event.endsAt" resize-edges="{top: true, bottom: true}" on-resize="vm.eventResized(dayEvent.event, edge, y / 30)" on-resize-end="vm.eventResizeComplete(dayEvent.event, edge, y / 30)" uib-tooltip-html="vm.calendarEventTitle.dayViewTooltip(dayEvent.event) | calendarTrustAsHtml" tooltip-append-to-body=true> <span class=cal-hours> <span ng-show="dayEvent.top == 0"><span ng-bind="(dayEvent.event.tempStartsAt || dayEvent.event.startsAt) | calendarDate:\'day\':true"></span>, </span> <span ng-bind="(dayEvent.event.tempStartsAt || dayEvent.event.startsAt) | calendarDate:\'time\':true"></span> </span> <a href=javascript:; class=event-item ng-click="vm.onEventClick({calendarEvent: dayEvent.event})"> <span ng-bind-html="vm.calendarEventTitle.dayView(dayEvent.event) | calendarTrustAsHtml"></span> </a> <a href=javascript:; class=event-item-action ng-repeat="action in dayEvent.event.actions track by $index" ng-class=action.cssClass ng-bind-html="action.label | calendarTrustAsHtml" ng-click="action.onClick({calendarEvent: dayEvent.event})"> </a> </div> </div> </div> '},function(e,t){e.exports='<div class=cal-day-panel-hour> <div class=cal-day-hour ng-repeat="hour in vm.hourGrid track by $index"> <div class=cal-day-hour-part ng-repeat="segment in hour.segments track by $index" ng-class="[{ \'cal-day-hour-part-selected\': vm.dateRangeSelect &&\n                vm.dateRangeSelect.startDate <= segment.date &&\n                segment.date < vm.dateRangeSelect.endDate }, segment.cssClass]" ng-click="vm.onTimespanClick({calendarDate: segment.date})" mwl-droppable on-drop="vm.eventDropped(dropData.event, segment.date)" mwl-drag-select=!!vm.onDateRangeSelect on-drag-select-start=vm.onDragSelectStart(segment.date) on-drag-select-move=vm.onDragSelectMove(segment.nextSegmentDate) on-drag-select-end=vm.onDragSelectEnd(segment.nextSegmentDate) ng-if=!vm.dayWidth> <div class=cal-day-hour-part-time> <strong ng-bind="segment.date | calendarDate:\'hour\':true" ng-show=segment.isStart></strong> </div> </div> <div class=cal-day-hour-part ng-repeat="segment in hour.segments track by $index" ng-if=vm.dayWidth> <div class=cal-day-hour-part-time> <strong ng-bind="segment.date | calendarDate:\'hour\':true" ng-show=segment.isStart></strong> &nbsp; </div> <div class=cal-day-hour-part-spacer ng-repeat="day in segment.days track by $index" ng-style="{width: (vm.dayWidth - ($last ? vm.scrollBarWidth : 0)) + \'px\'}" ng-class="[{ \'cal-day-hour-part-selected\': vm.dateRangeSelect &&\n                vm.dateRangeSelect.startDate <= day.date &&\n                day.date < vm.dateRangeSelect.endDate }, day.cssClass]" ng-click="vm.onTimespanClick({calendarDate: day.date})" mwl-droppable on-drop="vm.eventDropped(dropData.event, day.date)" mwl-drag-select=!!vm.onDateRangeSelect on-drag-select-start=vm.onDragSelectStart(day.date) on-drag-select-move=vm.onDragSelectMove(day.nextSegmentDate) on-drag-select-end=vm.onDragSelectEnd(day.nextSegmentDate)> </div> </div> </div> </div> '},function(e,t){e.exports='<div mwl-droppable on-drop="vm.handleEventDrop(dropData.event, day.date, dropData.draggedFromDate)" mwl-drag-select=!!vm.onDateRangeSelect on-drag-select-start=vm.onDragSelectStart(day) on-drag-select-move=vm.onDragSelectMove(day) on-drag-select-end=vm.onDragSelectEnd(day) class="cal-month-day {{ day.cssClass }}" ng-class="{\n    \'cal-day-outmonth\': !day.inMonth,\n    \'cal-day-inmonth\': day.inMonth,\n    \'cal-day-weekend\': day.isWeekend,\n    \'cal-day-past\': day.isPast,\n    \'cal-day-today\': day.isToday,\n    \'cal-day-future\': day.isFuture,\n    \'cal-day-selected\': vm.dateRangeSelect && vm.dateRangeSelect.startDate <= day.date && day.date <= vm.dateRangeSelect.endDate,\n    \'cal-day-open\': dayIndex === vm.openDayIndex\n  }"> <small class="cal-events-num badge badge-important pull-left" ng-show="day.badgeTotal > 0 && (vm.calendarConfig.displayAllMonthEvents || day.inMonth)" ng-bind=day.badgeTotal> </small> <span class=pull-right data-cal-date ng-click=vm.calendarCtrl.dateClicked(day.date) ng-bind=day.label> </span> <div class=cal-day-tick ng-show="dayIndex === vm.openDayIndex && (vm.cellAutoOpenDisabled || vm.view[vm.openDayIndex].events.length > 0) && !vm.slideBoxDisabled"> <i class="glyphicon glyphicon-chevron-up"></i> <i class="fa fa-chevron-up"></i> </div> <ng-include src="vm.customTemplateUrls.calendarMonthCellEvents || vm.calendarConfig.templates.calendarMonthCellEvents"></ng-include> <div class=cal-week-box-cell ng-if="$first && rowHovered"> <span ng-bind=vm.getWeekNumberLabel(day)></span> </div> </div> '},function(e,t){e.exports='<div class=events-list ng-show="day.events.length > 0"> <a ng-repeat="event in day.events | orderBy:\'startsAt\' track by event.calendarEventId" href=javascript:; ng-click="$event.stopPropagation(); vm.onEventClick({calendarEvent: event})" class="pull-left event" ng-class=event.cssClass ng-style="{backgroundColor: event.color.primary}" ng-mousedown=$event.stopPropagation() ng-mouseenter="vm.highlightEvent(event, true)" ng-mouseleave="vm.highlightEvent(event, false)" tooltip-append-to-body=true uib-tooltip-html="vm.calendarEventTitle.monthViewTooltip(event) | calendarTrustAsHtml" mwl-draggable="event.draggable === true" drop-data="{event: event, draggedFromDate: day.date.toDate()}" auto-scroll=vm.draggableAutoScroll> </a> </div> '},function(e,t){e.exports='<div class=cal-month-box ng-class="[\'cal-grid-\' + vm.weekDays.length]"> <div class="cal-row-fluid cal-row-head"> <div class=cal-cell1 ng-repeat="day in vm.weekDays track by $index" ng-bind=day></div> </div> <div ng-repeat="rowOffset in vm.monthOffsets track by rowOffset" ng-mouseenter="rowHovered = true" ng-mouseleave="rowHovered = false"> <div class="cal-row-fluid cal-before-eventlist"> <div ng-repeat="day in vm.view | calendarLimitTo:vm.weekDays.length:rowOffset track by $index" ng-init="dayIndex = vm.view.indexOf(day)" class="cal-cell1 cal-cell {{ day.highlightClass }}" ng-style="{backgroundColor: day.backgroundColor}" ng-click="vm.dayClicked(day, false, $event)" ng-class="{pointer: day.events.length > 0}"> <ng-include src="vm.customTemplateUrls.calendarMonthCell || vm.calendarConfig.templates.calendarMonthCell"></ng-include> </div> </div> <mwl-calendar-slide-box is-open="vm.openRowIndex === $index && (vm.cellAutoOpenDisabled || vm.view[vm.openDayIndex].events.length > 0) && !vm.slideBoxDisabled" events=vm.view[vm.openDayIndex].events on-event-click=vm.onEventClick cell=vm.view[vm.openDayIndex] custom-template-urls=vm.customTemplateUrls template-scope=vm.templateScope draggable-auto-scroll=vm.draggableAutoScroll> </mwl-calendar-slide-box> </div> </div> '},function(e,t){e.exports='<div class=cal-slide-box uib-collapse=vm.isCollapsed mwl-collapse-fallback=vm.isCollapsed> <div class="cal-slide-content cal-event-list"> <ul class="unstyled list-unstyled"> <li ng-repeat="event in vm.events | orderBy:\'startsAt\' track by event.calendarEventId" ng-class=event.cssClass ng-mousedown=$event.stopPropagation() mwl-draggable="event.draggable === true" drop-data="{event: event}" auto-scroll=vm.draggableAutoScroll> <span class="pull-left event" ng-style="{backgroundColor: event.color.primary}"></span> &nbsp; <a href=javascript:; class=event-item ng-click="vm.onEventClick({calendarEvent: event})"> <span ng-bind-html="isMonthView ? vm.calendarEventTitle.monthView(event) : vm.calendarEventTitle.yearView(event) | calendarTrustAsHtml"></span> </a> <a href=javascript:; class=event-item-action ng-class=action.cssClass ng-repeat="action in event.actions track by $index" ng-bind-html="action.label | calendarTrustAsHtml" ng-click="action.onClick({calendarEvent: event})"> </a> </li> </ul> </div> </div> '},function(e,t){e.exports='<div class=cal-week-box ng-class="[{\'cal-day-box\': vm.showTimes}, \'cal-grid-\' + vm.view.days.length]"> <div class="cal-row-fluid cal-row-head" mwl-element-dimensions=vm.dayColumnDimensions> <div class=cal-cell1 ng-repeat="day in vm.view.days track by $index" ng-class="{\n        \'cal-day-weekend\': day.isWeekend,\n        \'cal-day-past\': day.isPast,\n        \'cal-day-today\': day.isToday,\n        \'cal-day-future\': day.isFuture}" mwl-droppable on-drop="vm.eventDropped(dropData.event, day.date)"> <span ng-bind=day.weekDayLabel></span> <br> <small> <span data-cal-date ng-click=vm.calendarCtrl.dateClicked(day.date) class=pointer ng-bind=day.dayLabel> </span> </small> </div> </div> <div class="cal-day-panel clearfix" ng-style="{height: vm.showTimes ? (vm.dayViewHeight + \'px\') : \'auto\'}"> <mwl-calendar-hour-list day-view-start=vm.dayViewStart day-view-end=vm.dayViewEnd day-view-split=vm.dayViewSplit day-width="(vm.dayColumnDimensions.width - 60) / vm.view.days.length" view-date=vm.viewDate on-timespan-click=vm.onTimespanClick on-date-range-select=vm.onDateRangeSelect custom-template-urls=vm.customTemplateUrls cell-modifier=vm.cellModifier template-scope=vm.templateScope view=week ng-if=vm.showTimes> </mwl-calendar-hour-list> <div class=row ng-repeat="row in vm.view.eventRows track by $index"> <div class=col-xs-12> <div class=cal-row-fluid> <div ng-repeat="eventRow in row.row track by eventRow.event.calendarEventId" ng-class="\'cal-cell\' + (vm.showTimes ? 1 : eventRow.span) + (vm.showTimes ? \'\' : \' cal-offset\' + eventRow.offset)" ng-style="{\n              top: vm.showTimes ? ((eventRow.top) + \'px\') : \'auto\',\n              position: vm.showTimes ? \'absolute\' : \'inherit\',\n              width: vm.showTimes ? ((vm.dayColumnDimensions.width - 60) / vm.view.days.length + \'px\') : \'\',\n              left: vm.showTimes ? (((vm.dayColumnDimensions.width - 60) / vm.view.days.length) * eventRow.offset) + 15 + \'px\' : \'\'\n            }"> <div class=day-highlight ng-class="[eventRow.event.cssClass, !vm.showTimes && eventRow.startsBeforeWeek ? \'\' : \'border-left-rounded\', !vm.showTimes && eventRow.endsAfterWeek ? \'\' : \'border-right-rounded\']" ng-style="{backgroundColor: eventRow.event.color.secondary}" data-event-class mwl-draggable="eventRow.event.draggable === true" axis="vm.showTimes ? \'xy\' : \'x\'" snap-grid="vm.showTimes ? {x: (vm.dayColumnDimensions.width - 60) / vm.view.days.length, y: vm.dayViewEventChunkSize || 30} : {x: vm.dayColumnDimensions.width / vm.view.days.length}" auto-scroll=vm.draggableAutoScroll on-drag="vm.tempTimeChanged(eventRow.event, y / 30)" on-drag-end="vm.weekDragged(eventRow.event, x / ((vm.dayColumnDimensions.width - (vm.showTimes ? 60 : 0)) / vm.view.days.length), y / 30)" mwl-resizable="eventRow.event.resizable === true && eventRow.event.endsAt && !vm.showTimes" resize-edges="{left: true, right: true}" on-resize-end="vm.weekResized(eventRow.event, edge, x / ((vm.dayColumnDimensions.width - (vm.showTimes ? 60 : 0)) / vm.view.days.length))"> <strong ng-bind="(eventRow.event.tempStartsAt || eventRow.event.startsAt) | calendarDate:\'time\':true" ng-show=vm.showTimes></strong> <a href=javascript:; ng-click="vm.onEventClick({calendarEvent: eventRow.event})" class=event-item ng-bind-html="vm.calendarEventTitle.weekView(eventRow.event) | calendarTrustAsHtml" uib-tooltip-html="vm.calendarEventTitle.weekViewTooltip(eventRow.event) | calendarTrustAsHtml" tooltip-placement=left tooltip-append-to-body=true> </a> <a href=javascript:; class=event-item-action ng-class=action.cssClass ng-repeat="action in eventRow.event.actions track by $index" ng-bind-html="action.label | calendarTrustAsHtml" ng-click="action.onClick({calendarEvent: eventRow.event})"> </a> </div> </div> </div> </div> </div> </div> </div> '},function(e,t){e.exports='<div class=cal-year-box> <div ng-repeat="rowOffset in [0, 4, 8] track by rowOffset"> <div class="row cal-before-eventlist"> <div class="span3 col-md-3 col-xs-6 cal-cell {{ day.cssClass }}" ng-repeat="month in vm.view | calendarLimitTo:4:rowOffset track by $index" ng-init="monthIndex = vm.view.indexOf(month)" ng-click="vm.monthClicked(month, false, $event)" ng-class="{pointer: month.events.length > 0, \'cal-day-today\': month.isToday}" mwl-droppable on-drop="vm.handleEventDrop(dropData.event, month.date)"> <span class=pull-right data-cal-date ng-click=vm.calendarCtrl.dateClicked(month.date) ng-bind=month.label> </span> <small class="cal-events-num badge badge-important pull-left" ng-show="month.badgeTotal > 0" ng-bind=month.badgeTotal> </small> <div class=cal-day-tick ng-show="monthIndex === vm.openMonthIndex && (vm.cellAutoOpenDisabled || vm.view[vm.openMonthIndex].events.length > 0) && !vm.slideBoxDisabled"> <i class="glyphicon glyphicon-chevron-up"></i> <i class="fa fa-chevron-up"></i> </div> </div> </div> <mwl-calendar-slide-box is-open="vm.openRowIndex === $index && (vm.cellAutoOpenDisabled || vm.view[vm.openMonthIndex].events.length > 0) && !vm.slideBoxDisabled" events=vm.view[vm.openMonthIndex].events on-event-click=vm.onEventClick cell=vm.view[vm.openMonthIndex] custom-template-urls=vm.customTemplateUrls template-scope=vm.templateScope> </mwl-calendar-slide-box> </div> </div> '},function(e,t,n){"use strict";var a=n(0),r="Bootstrap calendar:";a.module("mwl.calendar").controller("MwlCalendarCtrl",["$scope","$log","$timeout","$attrs","$locale","moment","calendarTitle","calendarHelper",function(e,t,n,i,l,o,d,s){var c=this;c.changeView=function(e,t){c.view=e,c.viewDate=t},c.dateClicked=function(e){var t=o(e).toDate(),n={year:"month",month:"day",week:"day"};!1!==c.onViewChangeClick({calendarDate:t,calendarNextView:n[c.view]})&&c.changeView(n[c.view],t)},c.$onInit=function(){function v(e){e.startsAt?a.isDate(e.startsAt)||t.warn(r,"Event startsAt should be a javascript date object. Do `new Date(event.startsAt)` to fix it.",e):t.warn(r,"Event is missing the startsAt field",e),e.endsAt&&(a.isDate(e.endsAt)||t.warn(r,"Event endsAt should be a javascript date object. Do `new Date(event.endsAt)` to fix it.",e),o(e.startsAt).isAfter(o(e.endsAt))&&t.warn(r,"Event cannot start after it finishes",e))}function m(){d[c.view]&&a.isDefined(i.viewTitle)&&(c.viewTitle=d[c.view](c.viewDate)),c.events.forEach(function(e,t){v(e),e.calendarEventId=t});var t=o(c.viewDate),r=!0;u.clone().startOf(c.view).isSame(t.clone().startOf(c.view))&&!u.isSame(t)&&c.view===p&&(r=!1),u=t,p=c.view,r&&n(function(){e.$broadcast("calendar.refreshView")})}c.slideBoxDisabled&&t.warn(r,"The `slide-box-disabled` option is deprecated and will be removed in the next release. Instead set `cell-auto-open-disabled` to true"),c.events=c.events||[],c.excludedDays=c.excludedDays||[];var u=o(c.viewDate),p=c.view;s.loadTemplates().then(function(){c.templatesLoaded=!0;var t=!1;e.$watchGroup(["vm.viewDate","vm.view","vm.cellIsOpen",function(){return o.locale()+l.id}],function(){t?m():(t=!0,e.$watch("vm.events",m,!0))})}).catch(function(e){t.error("Could not load all calendar templates",e)})},a.version.minor<5&&c.$onInit()}]).directive("mwlCalendar",function(){return{template:'<div mwl-dynamic-directive-template name="calendar" overrides="vm.customTemplateUrls"></div>',restrict:"E",scope:{events:"=",view:"=",viewTitle:"=?",viewDate:"=",cellIsOpen:"=?",cellAutoOpenDisabled:"=?",excludedDays:"=?",slideBoxDisabled:"=?",customTemplateUrls:"=?",draggableAutoScroll:"=?",onEventClick:"&",onEventTimesChanged:"&",onTimespanClick:"&",onDateRangeSelect:"&?",onViewChangeClick:"&",cellModifier:"&",dayViewStart:"@",dayViewEnd:"@",dayViewSplit:"@",dayViewEventChunkSize:"@",dayViewEventWidth:"@",templateScope:"=?",dayViewTimePosition:"@"},controller:"MwlCalendarCtrl as vm",bindToController:!0}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").controller("MwlCalendarDayCtrl",["$scope","moment","calendarHelper","calendarEventTitle",function(e,t,n,a){function r(){i.timeHidden="hidden"===i.dayViewTimePosition,i.dayViewTimePositionOffset="default"!==i.dayViewTimePosition?0:60,i.dayViewSplit=i.dayViewSplit||30,i.dayViewHeight=n.getDayViewHeight(i.dayViewStart,i.dayViewEnd,i.dayViewSplit);var e=n.getDayView(i.events,i.viewDate,i.dayViewStart,i.dayViewEnd,i.dayViewSplit,i.dayViewEventWidth);i.allDayEvents=e.allDayEvents,i.nonAllDayEvents=e.events,i.viewWidth=e.width+62}var i=this;i.calendarEventTitle=a,e.$on("calendar.refreshView",r),e.$watchGroup(["vm.dayViewStart","vm.dayViewEnd","vm.dayViewSplit"],r),i.eventDragComplete=function(e,n){var a=n*i.dayViewSplit,r=t(e.startsAt).add(a,"minutes"),l=t(e.endsAt).add(a,"minutes");delete e.tempStartsAt,i.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:r.toDate(),calendarNewEventEnd:e.endsAt?l.toDate():null})},i.eventDragged=function(e,n){var a=n*i.dayViewSplit;e.tempStartsAt=t(e.startsAt).add(a,"minutes").toDate()},i.eventResizeComplete=function(e,n,a){var r=a*i.dayViewSplit,l=t(e.startsAt),o=t(e.endsAt);"start"===n?l.add(r,"minutes"):o.add(r,"minutes"),delete e.tempStartsAt,i.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:l.toDate(),calendarNewEventEnd:o.toDate()})},i.eventResized=function(e,n,a){var r=a*i.dayViewSplit;"start"===n&&(e.tempStartsAt=t(e.startsAt).add(r,"minutes").toDate())}}]).directive("mwlCalendarDay",function(){return{template:'<div mwl-dynamic-directive-template name="calendarDayView" overrides="vm.customTemplateUrls"></div>',restrict:"E",require:"^mwlCalendar",scope:{events:"=",viewDate:"=",onEventClick:"=",onEventTimesChanged:"=",onTimespanClick:"=",onDateRangeSelect:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayViewEventChunkSize:"=",dayViewEventWidth:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"=",dayViewTimePosition:"=",draggableAutoScroll:"="},controller:"MwlCalendarDayCtrl as vm",bindToController:!0}})},function(e,t,n){"use strict";var a=n(0),r=n(4);a.module("mwl.calendar").controller("MwlCalendarHourListCtrl",["$scope","$document","moment","calendarHelper",function(e,t,n,a){function i(){l.dayViewSplit=parseInt(l.dayViewSplit);var e=(l.dayViewStart||"00:00").split(":"),t=(l.dayViewEnd||"23:59").split(":");l.hourGrid=r.getDayViewHourGrid({viewDate:"week"===l.view?n(l.viewDate).startOf("week").toDate():n(l.viewDate).toDate(),hourSegments:60/l.dayViewSplit,dayStart:{hour:e[0],minute:e[1]},dayEnd:{hour:t[0],minute:t[1]}}),l.hourGrid.forEach(function(e){e.segments.forEach(function(e){if(e.date=n(e.date),e.nextSegmentDate=e.date.clone().add(l.dayViewSplit,"minutes"),"week"===l.view){e.days=[];for(var t=0;t<7;t++){var a={date:n(e.date).add(t,"days")};a.nextSegmentDate=a.date.clone().add(l.dayViewSplit,"minutes"),l.cellModifier({calendarCell:a}),e.days.push(a)}}else l.cellModifier({calendarCell:e})})})}var l=this;l.scrollBarWidth=function(){var e=t[0].createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",t[0].body.appendChild(e);var n=e.offsetWidth;e.style.overflow="scroll";var a=t[0].createElement("div");a.style.width="100%",e.appendChild(a);var r=a.offsetWidth;return e.parentNode.removeChild(e),n-r}();var o=n.locale();e.$on("calendar.refreshView",function(){o!==n.locale()&&(o=n.locale(),i())}),e.$watchGroup(["vm.dayViewStart","vm.dayViewEnd","vm.dayViewSplit","vm.viewDate"],function(){i()}),l.eventDropped=function(e,t){var r=n(t),i=a.adjustEndDateFromStartDiff(e.startsAt,r,e.endsAt);l.onEventTimesChanged({calendarEvent:e,calendarDate:t,calendarNewEventStart:r.toDate(),calendarNewEventEnd:i?i.toDate():null})},l.onDragSelectStart=function(e,t){l.dateRangeSelect||(l.dateRangeSelect={active:!0,startDate:e,endDate:e,dayIndex:t})},l.onDragSelectMove=function(e){l.dateRangeSelect&&(l.dateRangeSelect.endDate=e)},l.onDragSelectEnd=function(e){l.dateRangeSelect&&(l.dateRangeSelect.endDate=e,l.dateRangeSelect.endDate>l.dateRangeSelect.startDate&&l.onDateRangeSelect({calendarRangeStartDate:l.dateRangeSelect.startDate.toDate(),calendarRangeEndDate:l.dateRangeSelect.endDate.toDate()}),delete l.dateRangeSelect)}}]).directive("mwlCalendarHourList",function(){return{restrict:"E",template:'<div mwl-dynamic-directive-template name="calendarHourList" overrides="vm.customTemplateUrls"></div>',controller:"MwlCalendarHourListCtrl as vm",scope:{viewDate:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayWidth:"=?",onTimespanClick:"=",onDateRangeSelect:"=",onEventTimesChanged:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"=",view:"@"},bindToController:!0}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlCalendarMonthCtrl",["$scope","moment","calendarHelper","calendarConfig","calendarEventTitle",function(e,t,n,r,i){function l(){o.openRowIndex=null,o.openDayIndex=null,o.cellIsOpen&&o.view&&o.weekDays&&o.view.forEach(function(e,n){t(o.viewDate).startOf("day").isSame(e.date)&&(o.openDayIndex=n,o.openRowIndex=Math.floor(n/o.weekDays.length))})}var o=this;o.calendarConfig=r,o.calendarEventTitle=i,o.openRowIndex=null,e.$on("calendar.refreshView",function(){o.weekDays=n.getWeekDayNames(o.excludedDays);var e=n.getMonthView(o.events,o.viewDate,o.cellModifier,o.excludedDays);o.view=e.days,o.monthOffsets=e.rowOffsets,o.cellAutoOpenDisabled?l():!o.cellAutoOpenDisabled&&o.cellIsOpen&&null===o.openRowIndex&&(o.openDayIndex=null,o.view.forEach(function(e){e.inMonth&&t(o.viewDate).startOf("day").isSame(e.date)&&o.dayClicked(e,!0)}))}),o.dayClicked=function(e,t,n){if((t||(o.onTimespanClick({calendarDate:e.date.toDate(),calendarCell:e,$event:n}),!n||!n.defaultPrevented))&&!o.cellAutoOpenDisabled){o.openRowIndex=null;var a=o.view.indexOf(e);a===o.openDayIndex?(o.openDayIndex=null,o.cellIsOpen=!1):(o.openDayIndex=a,o.openRowIndex=Math.floor(a/o.weekDays.length),o.cellIsOpen=!0)}},o.highlightEvent=function(e,t){o.view.forEach(function(n){if(delete n.highlightClass,delete n.backgroundColor,t){n.events.indexOf(e)>-1&&(n.backgroundColor=e.color?e.color.secondary:"")}})},o.handleEventDrop=function(e,a,r){var i=t(e.startsAt).year(t(a).year()).month(t(a).month()).date(t(a).date()),l=n.adjustEndDateFromStartDiff(e.startsAt,i,e.endsAt);o.onEventTimesChanged({calendarEvent:e,calendarDate:a,calendarNewEventStart:i.toDate(),calendarNewEventEnd:l?l.toDate():null,calendarDraggedFromDate:r})},o.getWeekNumberLabel=function(e){var t=e.date.clone().add(1,"day").isoWeek();return"function"==typeof r.i18nStrings.weekNumber?r.i18nStrings.weekNumber({weekNumber:t}):r.i18nStrings.weekNumber.replace("{week}",t)},o.onDragSelectStart=function(e){o.dateRangeSelect||(o.dateRangeSelect={startDate:e.date,endDate:e.date})},o.onDragSelectMove=function(e){o.dateRangeSelect&&(o.dateRangeSelect.endDate=e.date)},o.onDragSelectEnd=function(e){o.dateRangeSelect&&(o.dateRangeSelect.endDate=e.date,o.dateRangeSelect.endDate>o.dateRangeSelect.startDate&&o.onDateRangeSelect({calendarRangeStartDate:o.dateRangeSelect.startDate.clone().startOf("day").toDate(),calendarRangeEndDate:o.dateRangeSelect.endDate.clone().endOf("day").toDate()}),delete o.dateRangeSelect)},o.$onInit=function(){o.cellAutoOpenDisabled&&e.$watchGroup(["vm.cellIsOpen","vm.viewDate"],l)},a.version.minor<5&&o.$onInit()}]).directive("mwlCalendarMonth",function(){return{template:'<div mwl-dynamic-directive-template name="calendarMonthView" overrides="vm.customTemplateUrls"></div>',restrict:"E",require:"^mwlCalendar",scope:{events:"=",viewDate:"=",excludedDays:"=",onEventClick:"=",onEventTimesChanged:"=",onDateRangeSelect:"=",cellIsOpen:"=",cellAutoOpenDisabled:"=",onTimespanClick:"=",cellModifier:"=",slideBoxDisabled:"=",customTemplateUrls:"=?",templateScope:"=",draggableAutoScroll:"="},controller:"MwlCalendarMonthCtrl as vm",link:function(e,t,n,a){e.vm.calendarCtrl=a},bindToController:!0}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").controller("MwlCalendarSlideBoxCtrl",["$scope","$timeout","calendarConfig","calendarEventTitle",function(e,t,n,a){var r=this;r.calendarConfig=n,r.calendarEventTitle=a,r.isCollapsed=!0,e.$watch("vm.isOpen",function(e){t(function(){r.isCollapsed=!e})})}]).directive("mwlCalendarSlideBox",function(){return{restrict:"E",template:'<div mwl-dynamic-directive-template name="calendarSlideBox" overrides="vm.customTemplateUrls"></div>',replace:!0,controller:"MwlCalendarSlideBoxCtrl as vm",require:["^?mwlCalendarMonth","^?mwlCalendarYear"],link:function(e,t,n,a){e.isMonthView=!!a[0],e.isYearView=!!a[1]},scope:{isOpen:"=",events:"=",onEventClick:"=",cell:"=",customTemplateUrls:"=?",templateScope:"=",draggableAutoScroll:"="},bindToController:!0}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").controller("MwlCalendarWeekCtrl",["$scope","moment","calendarHelper","calendarConfig","calendarEventTitle",function(e,t,n,a,r){var i=this;i.showTimes=a.showTimesOnWeekView,i.calendarEventTitle=r,e.$on("calendar.refreshView",function(){i.dayViewSplit=i.dayViewSplit||30,i.dayViewHeight=n.getDayViewHeight(i.dayViewStart,i.dayViewEnd,i.dayViewSplit),i.showTimes?i.view=n.getWeekViewWithTimes(i.events,i.viewDate,i.dayViewStart,i.dayViewEnd,i.dayViewSplit):i.view=n.getWeekView(i.events,i.viewDate,i.excludedDays)}),i.weekDragged=function(e,n,a){var r=t(e.startsAt).add(n,"days"),l=t(e.endsAt).add(n,"days");if(a){var o=a*i.dayViewSplit;r=r.add(o,"minutes"),l=l.add(o,"minutes")}delete e.tempStartsAt,i.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:r.toDate(),calendarNewEventEnd:e.endsAt?l.toDate():null})},i.eventDropped=function(e,n){var a=t(n).diff(t(e.startsAt),"days");i.weekDragged(e,a)},i.weekResized=function(e,n,a){var r=t(e.startsAt),l=t(e.endsAt);"start"===n?r.add(a,"days"):l.add(a,"days"),i.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:r.toDate(),calendarNewEventEnd:l.toDate()})},i.tempTimeChanged=function(e,n){var a=n*i.dayViewSplit;e.tempStartsAt=t(e.startsAt).add(a,"minutes").toDate()}}]).directive("mwlCalendarWeek",function(){return{template:'<div mwl-dynamic-directive-template name="calendarWeekView" overrides="vm.customTemplateUrls"></div>',restrict:"E",require:"^mwlCalendar",scope:{events:"=",viewDate:"=",excludedDays:"=",onEventClick:"=",onEventTimesChanged:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayViewEventChunkSize:"=",onTimespanClick:"=",onDateRangeSelect:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"=",draggableAutoScroll:"="},controller:"MwlCalendarWeekCtrl as vm",link:function(e,t,n,a){e.vm.calendarCtrl=a},bindToController:!0}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlCalendarYearCtrl",["$scope","moment","calendarHelper",function(e,t,n){function r(){i.openRowIndex=null,i.openMonthIndex=null,i.cellIsOpen&&i.view&&i.view.forEach(function(e,n){t(i.viewDate).startOf("month").isSame(e.date)&&(i.openMonthIndex=n,i.openRowIndex=Math.floor(n/4))})}var i=this;i.openMonthIndex=null,e.$on("calendar.refreshView",function(){i.view=n.getYearView(i.events,i.viewDate,i.cellModifier),i.cellAutoOpenDisabled?r():!i.cellAutoOpenDisabled&&i.cellIsOpen&&null===i.openMonthIndex&&(i.openMonthIndex=null,i.view.forEach(function(e){t(i.viewDate).startOf("month").isSame(e.date)&&i.monthClicked(e,!0)}))}),i.monthClicked=function(e,t,n){if((t||(i.onTimespanClick({calendarDate:e.date.toDate(),calendarCell:e,$event:n}),!n||!n.defaultPrevented))&&!i.cellAutoOpenDisabled){i.openRowIndex=null;var a=i.view.indexOf(e);a===i.openMonthIndex?(i.openMonthIndex=null,i.cellIsOpen=!1):(i.openMonthIndex=a,i.openRowIndex=Math.floor(a/4),i.cellIsOpen=!0)}},i.handleEventDrop=function(e,a){var r=t(e.startsAt).year(t(a).year()).month(t(a).month()),l=n.adjustEndDateFromStartDiff(e.startsAt,r,e.endsAt);i.onEventTimesChanged({calendarEvent:e,calendarDate:a,calendarNewEventStart:r.toDate(),calendarNewEventEnd:l?l.toDate():null})},i.$onInit=function(){i.cellAutoOpenDisabled&&e.$watchGroup(["vm.cellIsOpen","vm.viewDate"],r)},a.version.minor<5&&i.$onInit()}]).directive("mwlCalendarYear",function(){return{template:'<div mwl-dynamic-directive-template name="calendarYearView" overrides="vm.customTemplateUrls"></div>',restrict:"E",require:"^mwlCalendar",scope:{events:"=",viewDate:"=",onEventClick:"=",onEventTimesChanged:"=",cellIsOpen:"=",cellAutoOpenDisabled:"=",onTimespanClick:"=",cellModifier:"=",slideBoxDisabled:"=",customTemplateUrls:"=?",templateScope:"="},controller:"MwlCalendarYearCtrl as vm",link:function(e,t,n,a){e.vm.calendarCtrl=a},bindToController:!0}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").controller("MwlCollapseFallbackCtrl",["$scope","$attrs","$element",function(e,t,n){e.$watch(t.mwlCollapseFallback,function(e){e?n.addClass("ng-hide"):n.removeClass("ng-hide")})}]).directive("mwlCollapseFallback",["$injector",function(e){return e.has("uibCollapseDirective")?{}:{restrict:"A",controller:"MwlCollapseFallbackCtrl"}}])},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlDateModifierCtrl",["$element","$attrs","$scope","moment",function(e,t,n,r){function i(){if(a.isDefined(t.setToToday))l.date=new Date;else if(a.isDefined(t.increment)){if(l.date=r(l.date).add(1,l.increment),l.excludedDays&&l.increment.indexOf("day")>-1)for(;l.excludedDays.indexOf(l.date.day())>-1;)l.date.add(1,l.increment);l.date=l.date.toDate()}else if(a.isDefined(t.decrement)){if(l.date=r(l.date).subtract(1,l.decrement),l.excludedDays&&l.decrement.indexOf("day")>-1)for(;l.excludedDays.indexOf(l.date.day())>-1;)l.date.subtract(1,l.decrement);l.date=l.date.toDate()}n.$apply()}var l=this;e.bind("click",i),n.$on("$destroy",function(){e.unbind("click",i)})}]).directive("mwlDateModifier",function(){return{restrict:"A",controller:"MwlDateModifierCtrl as vm",scope:{date:"=",increment:"=",decrement:"=",excludedDays:"=?"},bindToController:!0}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").controller("MwlDragSelectCtrl",["$scope","$element","$parse","$attrs",function(e,t,n,a){function r(t){return function(a){t&&2!==a.button&&(n(t)(e),e.$apply()),a.preventDefault()}}function i(){t.on("mousedown",o),t.on("mousemove",d),t.on("mouseup",s)}function l(){t.off("mousedown",o),t.off("mousemove",d),t.off("mouseup",s)}var o=r(a.onDragSelectStart),d=r(a.onDragSelectMove),s=r(a.onDragSelectEnd);e.$watch(a.mwlDragSelect,function(e){e?i():l()}),e.$on("$destroy",function(){l()})}]).directive("mwlDragSelect",function(){return{restrict:"A",controller:"MwlDragSelectCtrl"}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlDraggableCtrl",["$element","$scope","$window","$parse","$attrs","$timeout","interact",function(e,t,n,r,i,l,o){function d(e,t){return e.css("-ms-transform",t).css("-webkit-transform",t).css("transform",t)}if(o){var s,c;i.snapGrid&&(c=r(i.snapGrid)(t),s={targets:[o.createSnapGrid(c)]});var v=r(i.autoScroll)(t);void 0===v&&(v=!0),o(e[0]).draggable({autoScroll:v,snap:s,onstart:function(e){a.element(e.target).addClass("dragging-active"),e.target.dropData=r(i.dropData)(t),e.target.style.pointerEvents="none",i.onDragStart&&(r(i.onDragStart)(t),t.$apply())},onmove:function(e){var l=a.element(e.target),o=(parseFloat(l.attr("data-x"))||0)+(e.dx||0),s=(parseFloat(l.attr("data-y"))||0)+(e.dy||0);switch(r(i.axis)(t)){case"x":s=0;break;case"y":o=0}"static"===n.getComputedStyle(l[0]).position&&l.css("position","relative"),d(l,"translate("+o+"px, "+s+"px)").css("z-index",50).attr("data-x",o).attr("data-y",s),i.onDrag&&(r(i.onDrag)(t,{x:o,y:s}),t.$apply())},onend:function(e){var n=a.element(e.target),o=n.attr("data-x"),s=n.attr("data-y");e.target.style.pointerEvents="auto",i.onDragEnd&&(r(i.onDragEnd)(t,{x:o,y:s}),t.$apply()),l(function(){d(n,"").css("z-index","auto").removeAttr("data-x").removeAttr("data-y").removeClass("dragging-active")})}}),t.$watch(i.mwlDraggable,function(t){o(e[0]).draggable({enabled:t})}),t.$on("$destroy",function(){o(e[0]).unset()})}}]).directive("mwlDraggable",function(){return{restrict:"A",controller:"MwlDraggableCtrl"}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlDroppableCtrl",["$element","$scope","$parse","$attrs","interact",function(e,t,n,r,i){if(i){var l=r.dropActiveClass||"drop-active";i(e[0]).dropzone({ondragenter:function(e){a.element(e.target).addClass(l)},ondragleave:function(e){a.element(e.target).removeClass(l)},ondropdeactivate:function(e){a.element(e.target).removeClass(l)},ondrop:function(e){e.relatedTarget.dropData&&(n(r.onDrop)(t,{dropData:e.relatedTarget.dropData}),t.$apply())}}),t.$on("$destroy",function(){i(e[0]).unset()})}}]).directive("mwlDroppable",function(){return{restrict:"A",controller:"MwlDroppableCtrl"}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlDynamicDirectiveTemplateCtrl",["$compile","$scope","$attrs","$element","$templateCache","$log","calendarConfig",function(e,t,n,r,i,l,o){t.$watch(n.overrides,function(d){var s=o.templates[n.name];d&&a.isObject(d)&&d[n.name]&&(i.get(d[n.name])?s=d[n.name]:l.warn("Bootstrap Calendar","The custom template for "+d[n.name]+' was not found in the template cache. Please ensure it is pre-loaded via a script tag <script type="text/ng-template" id="'+d[n.name]+'">Custom template content<\/script> or via a tool such as https://www.npmjs.com/package/gulp-angular-templatecache'));var c=i.get(s);r.html(c),e(r.contents())(t)})}]).directive("mwlDynamicDirectiveTemplate",function(){return{restrict:"A",controller:"MwlDynamicDirectiveTemplateCtrl"}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlElementDimensionsCtrl",["$element","$scope","$parse","$attrs","$window",function(e,t,n,r,i){function l(){n(r.mwlElementDimensions).assign(t,{width:e[0].offsetWidth-1,height:e[0].offsetHeight}),t.$applyAsync()}var o=a.element(i);o.bind("resize",l),l(),t.$on("$destroy",function(){o.unbind("resize",l)})}]).directive("mwlElementDimensions",function(){return{restrict:"A",controller:"MwlElementDimensionsCtrl"}})},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").controller("MwlResizableCtrl",["$element","$scope","$parse","$attrs","$timeout","interact",function(e,t,n,r,i,l){function o(e,t){var n={};return n.edge=e,"start"===e?(n.x=t.data("x"),n.y=t.data("y")):"end"===e&&(n.x=parseFloat(t.css("width").replace("px",""))-v.width,n.y=parseFloat(t.css("height").replace("px",""))-v.height),n}if(l){var d,s;r.snapGrid&&(s=n(r.snapGrid)(t),d={targets:[l.createSnapGrid(s)]});var c,v={},m={};l(e[0]).resizable({edges:n(r.resizeEdges)(t),snap:d,onstart:function(e){c="end";var t=a.element(e.target);v.height=t[0].offsetHeight,v.width=t[0].offsetWidth,m.height=t.css("height"),m.width=t.css("width")},onmove:function(e){if(e.rect.width>0&&e.rect.height>0){var i=a.element(e.target),l=parseFloat(i.data("x")||0),d=parseFloat(i.data("y")||0);i.css({width:e.rect.width+"px",height:e.rect.height+"px"}),l+=e.deltaRect.left,d+=e.deltaRect.top,i.css("transform","translate("+l+"px,"+d+"px)"),i.data("x",l),i.data("y",d),0===e.deltaRect.left&&0===e.deltaRect.top||(c="start"),r.onResize&&(n(r.onResize)(t,o(c,i)),t.$apply())}},onend:function(e){var l=a.element(e.target),d=o(c,l);i(function(){l.data("x",null).data("y",null).css({transform:"",width:m.width,height:m.height})}),r.onResizeEnd&&(n(r.onResizeEnd)(t,d),t.$apply())}}),t.$watch(r.mwlResizable,function(t){l(e[0]).resizable({enabled:t})}),t.$on("$destroy",function(){l(e[0]).unset()})}}]).directive("mwlResizable",function(){return{restrict:"A",controller:"MwlResizableCtrl"}})},function(e,t,n){"use strict";function a(e){e.keys().forEach(e)}n(6);var r=n(0),i={},l=n(10);l.keys().forEach(function(e){var t=e.replace("./",""),n="mwl/"+t,a=t.replace(".html","");i[a]={cacheTemplateName:n,template:l(e)}}),e.exports=r.module("mwl.calendar",[]).config(["calendarConfig",function(e){r.forEach(i,function(t,n){e.templates[n]||(e.templates[n]=t.cacheTemplateName)})}]).run(["$templateCache","$interpolate",function(e,t){r.forEach(i,function(n){if(!e.get(n.cacheTemplateName)){var a=n.template.replace("{{",t.startSymbol()).replace("}}",t.endSymbol());e.put(n.cacheTemplateName,a)}})}]).name,a(n(7)),a(n(8)),a(n(9))},function(e,t,n){"use strict";n(0).module("mwl.calendar").filter("calendarDate",["calendarHelper","calendarConfig",function(e,t){function n(n,a,r){return!0===r&&(a=t.dateFormats[a]),e.formatDate(n,a)}return n.$stateful=!0,n}])},function(e,t,n){"use strict";var a=n(0);a.module("mwl.calendar").filter("calendarLimitTo",["limitToFilter",function(e){return a.version.minor>=4?e:function(e,t,n){return t=Math.abs(Number(t))===1/0?Number(t):parseInt(t),isNaN(t)?e:(a.isNumber(e)&&(e=e.toString()),a.isArray(e)||a.isString(e)?(n=!n||isNaN(n)?0:parseInt(n),n=n<0&&n>=-e.length?e.length+n:n,t>=0?e.slice(n,n+t):0===n?e.slice(t,e.length):e.slice(Math.max(0,n+t),n)):e)}}])},function(e,t,n){"use strict";n(0).module("mwl.calendar").filter("calendarTruncateEventTitle",function(){return function(e,t,n){return e?e.length>=t&&e.length/20>n/30?e.substr(0,t)+"...":e:""}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").filter("calendarTrustAsHtml",["$sce",function(e){return function(t){return e.trustAsHtml(t)}}])},function(e,t,n){"use strict";n(0).module("mwl.calendar").constant("calendarConfig",{allDateFormats:{angular:{date:{hour:"ha",day:"d MMM",month:"MMMM",weekDay:"EEEE",time:"HH:mm",datetime:"MMM d, h:mm a"},title:{day:"EEEE d MMMM, yyyy",week:"Week {week} of {year}",month:"MMMM yyyy",year:"yyyy"}},moment:{date:{hour:"ha",day:"D MMM",month:"MMMM",weekDay:"dddd",time:"HH:mm",datetime:"MMM D, h:mm a"},title:{day:"dddd D MMMM, YYYY",week:"Week {week} of {year}",month:"MMMM YYYY",year:"YYYY"}}},get dateFormats(){return this.allDateFormats[this.dateFormatter].date},get titleFormats(){return this.allDateFormats[this.dateFormatter].title},dateFormatter:"angular",showTimesOnWeekView:!1,displayAllMonthEvents:!1,i18nStrings:{weekNumber:"Week {week}"},templates:{},colorTypes:{info:{primary:"#1e90ff",secondary:"#d1e8ff"},important:{primary:"#ad2121",secondary:"#fae3e3"},warning:{primary:"#e3bc08",secondary:"#fdf1ba"},inverse:{primary:"#1b1b1b",secondary:"#c1c1c1"},special:{primary:"#800080",secondary:"#ffe6ff"},success:{primary:"#006400",secondary:"#caffca"}}})},function(e,t,n){"use strict";n(0).module("mwl.calendar").factory("calendarEventTitle",["calendarDateFilter","calendarTruncateEventTitleFilter",function(e,t){function n(t){return t.title+" ("+e(t.startsAt,"datetime",!0)+")"}function a(t){return t.title+" ("+e(t.startsAt,"time",!0)+")"}function r(t){return e(t.startsAt,"time",!0)+" - "+t.title}function i(e){return e.title}function l(e){return e.title}function o(e){return e.allDay?e.title:t(e.title,20,e.height)}function d(e){return e.title}return{yearView:n,monthView:a,monthViewTooltip:r,weekView:i,weekViewTooltip:l,dayView:o,dayViewTooltip:d}}])},function(e,t,n){"use strict";var a=n(0),r=n(4);a.module("mwl.calendar").factory("calendarHelper",["$q","$templateRequest","dateFilter","moment","calendarConfig",function(e,t,n,a,i){function l(e,t){if("angular"===i.dateFormatter)return n(a(e).toDate(),t);if("moment"===i.dateFormatter)return a(e).format(t);throw new Error("Unknown date formatter: "+i.dateFormatter)}function o(e,t,n){if(!n)return n;var r=a(t).diff(a(e));return a(n).add(r)}function d(e,t,n){var r=a(e.start),i=a(e.end),l=a(n);if(t){switch(t){case"year":r.set({year:l.year()});break;case"month":r.set({year:l.year(),month:l.month()});break;default:throw new Error("Invalid value ("+t+") given for recurs on. Can only be year or month.")}i=o(e.start,r,i)}return{start:r,end:i}}function s(e,t,n){t=a(t),n=a(n);var r=d({start:e.startsAt,end:e.endsAt||e.startsAt},e.recursOn,t),i=r.start,l=r.end;return i.isAfter(t)&&i.isBefore(n)||l.isAfter(t)&&l.isBefore(n)||i.isBefore(t)&&l.isAfter(n)||i.isSame(t)||l.isSame(n)}function c(e,t,n){return e.filter(function(e){return s(e,t,n)})}function v(e,t,n){return c(n,a(e).startOf(t),a(e).endOf(t))}function m(e){return e.filter(function(e){return!1!==e.incrementsBadgeTotal}).length}function u(e){return[0,1,2,3,4,5,6].filter(function(t){return!(e||[]).some(function(e){return e===t})}).map(function(e){return l(a().weekday(e),i.dateFormats.weekDay)})}function p(e,t,n){for(var r=[],o=v(t,"year",e),d=a(t).startOf("year"),s=0;s<12;){var u=d.clone(),p=u.clone().endOf("month"),f=c(o,u,p),w={label:l(u,i.dateFormats.month),isToday:u.isSame(a().startOf("month")),events:f,date:u,badgeTotal:m(f)};n({calendarCell:w}),r.push(w),d.add(1,"month"),s++}return r}function f(e,t){return e.start=t.start.toDate(),e.endsAt&&(e.end=t.end.toDate()),e}function w(e,t,n,l){e.forEach(function(e){f(e,d({start:a(e.startsAt),end:a(e.endsAt||e.startsAt)},e.recursOn,a(t).startOf("month")))});var o=r.getMonthView({events:e,viewDate:t,excluded:l,weekStartsOn:a().startOf("week").day()});return o.days=o.days.map(function(e){return e.date=a(e.date),e.label=e.date.date(),e.badgeTotal=m(e.events),i.displayAllMonthEvents||e.inMonth||(e.events=[]),n({calendarCell:e}),e}),e.forEach(function(e){delete e.start,delete e.end}),o}function g(e,t,n){var o=r.getWeekViewHeader({viewDate:t,excluded:n,weekStartsOn:a().startOf("week").day()}).map(function(e){return e.date=a(e.date),e.weekDayLabel=l(e.date,i.dateFormats.weekDay),e.dayLabel=l(e.date,i.dateFormats.day),e}),s=a(t).startOf("week"),v=a(t).endOf("week");return{days:o,eventRows:r.getWeekView({viewDate:t,weekStartsOn:a().startOf("week").day(),excluded:n,events:c(e,s,v).map(function(e){var t=a(s).startOf("day"),n=d({start:a(e.startsAt),end:a(e.endsAt||e.startsAt)},e.recursOn,t),r={originalEvent:e,start:n.start.toDate()};return e.endsAt&&(r.end=n.end.toDate()),r})}).map(function(e){return e.row=e.row.map(function(e){return e.event=e.event.originalEvent,e}),e})}}function y(e,t,n,i,l,o){var s=(n||"00:00").split(":"),c=(i||"23:59").split(":"),v=r.getDayView({events:e.map(function(e){return f(e,d({start:a(e.startsAt),end:a(e.endsAt||e.startsAt)},e.recursOn,a(t).startOf("day")))}),viewDate:t,hourSegments:60/l,dayStart:{hour:s[0],minute:s[1]},dayEnd:{hour:c[0],minute:c[1]},eventWidth:o?+o:150,segmentHeight:30});return e.forEach(function(e){delete e.start,delete e.end}),v}function h(e,t,n,i,l){var o=g(e,t),d=[],s=[];return o.eventRows.forEach(function(e){e.row.forEach(function(e){s.push(e.event)})}),o.days.forEach(function(e){var t=s.filter(function(t){return a(t.startsAt).startOf("day").isSame(a(e.date).startOf("day"))}),r=y(t,e.date,n,i,l).events;d=d.concat(r)}),o.eventRows=[{row:d.map(function(e){var n=e.event;return{event:n,top:e.top,offset:r.getWeekViewEventOffset({event:{start:n.startsAt,end:n.endsAt},startOfWeek:a(t).startOf("week").toDate()})}})}],o}function D(e,t,n){var r=a(e||"00:00","HH:mm"),i=a(t||"23:59","HH:mm"),l=60/n*30;return i.diff(r,"minutes")/60*l+3}function b(){var n=Object.keys(i.templates).map(function(e){var n=i.templates[e];return t(n)});return e.all(n)}return{getWeekDayNames:u,getYearView:p,getMonthView:w,getWeekView:g,getDayView:y,getWeekViewWithTimes:h,getDayViewHeight:D,adjustEndDateFromStartDiff:o,formatDate:l,loadTemplates:b,eventIsInPeriod:s}}])},function(e,t,n){"use strict";n(0).module("mwl.calendar").factory("calendarTitle",["moment","calendarConfig","calendarHelper",function(e,t,n){function a(e){return n.formatDate(e,t.titleFormats.day)}function r(n){return t.titleFormats.week.replace("{week}",e(n).isoWeek()).replace("{year}",e(n).startOf("isoweek").format("YYYY"))}function i(e){return n.formatDate(e,t.titleFormats.month)}function l(e){return n.formatDate(e,t.titleFormats.year)}return{day:a,week:r,month:i,year:l}}])},function(e,t,n){"use strict";var a,r=n(0);try{a=n(72)}catch(e){a=null}r.module("mwl.calendar").constant("interact",a)},function(e,t,n){"use strict";var a=n(0),r=n(71);a.module("mwl.calendar").constant("moment",r)},function(e,n){e.exports=t},function(e,t){if(void 0===n){var a=new Error('Cannot find module "undefined"');throw a.code="MODULE_NOT_FOUND",a}e.exports=n}])});
  //# sourceMappingURL=angular-bootstrap-calendar-tpls.min.js.map