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.27.4
   * @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]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function a(e){e.keys().forEach(e)}n(28);var r=n(1),i={};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(57)),a(n(58)),a(n(59))},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);t=t||{};var n=t.additionalDigits;null==n&&(n=m);var a=r(e),s=i(a.date,n),u=s.year,v=s.restDateString,p=o(v,u);if(p){var w,h=p.getTime(),g=0;return a.time&&(g=l(a.time)),a.timezone?w=d(a.timezone):(w=new Date(h+g).getTimezoneOffset(),w=new Date(h+g+w*f).getTimezoneOffset()),new Date(h+g+w*f)}return new Date(e)}function r(e){var t,n={},a=e.split(v);if(p.test(a[0])?(n.date=null,t=a[0]):(n.date=a[0],t=a[1]),t){var r=k.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=h[t],r=y[t];if(n=g.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 o=n[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}return{year:null}}function o(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=S.exec(e)){a=new Date(0);var o=parseInt(n[1],10);return a.setUTCFullYear(t,0,o),a}if(n=E.exec(e)){a=new Date(0),r=parseInt(n[1],10)-1;var l=parseInt(n[2],10);return a.setUTCFullYear(t,r,l),a}if(n=C.exec(e))return i=parseInt(n[1],10)-1,s(t,i);if(n=x.exec(e)){i=parseInt(n[1],10)-1;var d=parseInt(n[2],10)-1;return s(t,i,d)}return null}function l(e){var t,n,a;if(t=V.exec(e))return n=parseFloat(t[1].replace(",",".")),n%24*u;if(t=M.exec(e))return n=parseInt(t[1],10),a=parseFloat(t[2].replace(",",".")),n%24*u+a*f;if(t=T.exec(e)){n=parseInt(t[1],10),a=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return n%24*u+a*f+1e3*r}return null}function d(e){var t,n;return(t=$.exec(e))?0:(t=b.exec(e))?(n=60*parseInt(t[2],10),"+"===t[1]?-n:n):(t=A.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(22),u=36e5,f=6e4,m=2,v=/[T ]/,p=/:/,w=/^(\d{2})$/,h=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],g=/^(\d{4})/,y=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],D=/^-(\d{2})$/,S=/^-?(\d{3})$/,E=/^-?(\d{2})-?(\d{2})$/,C=/^-?W(\d{2})$/,x=/^-?W(\d{2})-?(\d{1})$/,V=/^(\d{2}([.,]\d*)?)$/,M=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,T=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,k=/([Z+-].*)$/,$=/^(Z)$/,b=/^([+-])(\d{2})$/,A=/^([+-])(\d{2}):?(\d{2})$/;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(2);e.exports=a},function(e,t,n){!function(t,a){e.exports=a(n(12),n(13),n(14),n(17),n(6),n(18),n(7),n(19),n(20),n(21),n(23),n(24),n(8),n(9),n(10),n(3),n(11),n(25),n(27))}(this,function(e,t,n,a,r,i,o,l,d,s,c,u,f,m,v,p,w,h,g){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,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},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=19)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=a},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t){e.exports=o},function(e,t){e.exports=l},function(e,t){e.exports=d},function(e,t){e.exports=s},function(e,t){e.exports=c},function(e,t){e.exports=u},function(e,t){e.exports=f},function(e,t){e.exports=m},function(e,t){e.exports=v},function(e,t){e.exports=p},function(e,t){e.exports=w},function(e,t){e.exports=h},function(e,t){e.exports=g},function(e,t,n){"use strict";var a=n(6),r=n.n(a),i=n(2),o=n.n(i),l=n(3),d=n.n(l),s=n(15),c=n.n(s),u=n(10),f=n.n(u),m=n(9),v=n.n(m),p=n(18),w=n.n(p),h=n(0),g=n.n(h),y=n(8),D=n.n(y),S=n(5),E=n.n(S),C=n(17),x=n.n(C),V=n(7),M=n.n(V),T=n(11),k=n.n(T),$=n(12),b=n.n($),A=n(13),I=n.n(A),O=n(14),R=n.n(O),H=n(16),j=n.n(H),F=n(4),W=n.n(F),N=n(1),Y=n.n(N);n.d(t,"getWeekViewEventOffset",function(){return q}),n.d(t,"getWeekViewHeader",function(){return Z}),n.d(t,"getWeekView",function(){return J}),n.d(t,"getMonthView",function(){return K}),n.d(t,"getDayView",function(){return Q}),n.d(t,"getDayViewHourGrid",function(){return ee});var z=[0,6],U=7,B=24,L=60,G=function(e,t,n){var a=1;if(e.end){var i=e.start<n?n:e.start;a=d()(o()(r()(e.end),1),c()(i)),a>U&&(a=U)}var l=t+a;return l>U&&(a-=l-U),a},q=function(e,t){var n=0;return c()(e.start)>t&&(n=d()(c()(e.start),t)),n},X=function(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||(!(!b()(r,n)&&!b()(r,a))||!(!b()(i,n)&&!b()(i,a)))))},P=function(e){var t=e.events,n=e.periodStart,a=e.periodEnd;return t.filter(function(e){return X({event:e,periodStart:n,periodEnd:a})})},_=function(e){var t=e.date,n=c()(new Date);return{date:t,isPast:t<n,isToday:f()(t,n),isFuture:t>n,isWeekend:z.indexOf(v()(t))>-1}},Z=function(e){for(var t=e.viewDate,n=e.weekStartsOn,a=w()(t,{weekStartsOn:n}),r=[],i=0;i<U;i++){var o=g()(a,i);r.push(_({date:o}))}return r},J=function(e){var t=e.events,n=void 0===t?[]:t,a=e.viewDate,r=e.weekStartsOn,i=w()(a,{weekStartsOn:r}),o=D()(a,{weekStartsOn:r}),l=P({events:n,periodStart:i,periodEnd:o}).map(function(e){var t=q(e,i),n=G(e,t,i);return{event:e,offset:t,span:n,startsBeforeWeek:e.start<i,endsAfterWeek:(e.end||e.start)>o}}).sort(function(e,t){var n=E()(e.event.start,t.event.start);return 0===n?E()(t.event.end||t.event.start,e.event.end||e.event.start):n}),d=[],s=[];return l.forEach(function(e,t){if(s.indexOf(e)===-1){s.push(e);var n=e.span+e.offset,a=l.slice(t+1).filter(function(e){if(e.offset>=n&&n+e.span<=U&&s.indexOf(e)===-1)return e.offset-=n,n+=e.span+e.offset,s.push(e),!0});d.push({row:[e].concat(a)})}}),d},K=function(e){for(var t=e.events,n=void 0===t?[]:t,a=e.viewDate,i=e.weekStartsOn,o=w()(x()(a),{weekStartsOn:i}),l=D()(M()(a),{weekStartsOn:i}),s=P({events:n,periodStart:o,periodEnd:l}),u=[],f=0;f<d()(l,o)+1;f++){var m=g()(o,f),v=_({date:m}),p=P({events:s,periodStart:c()(m),periodEnd:r()(m)});v.inMonth=k()(m,a),v.events=p,v.badgeTotal=p.length,u.push(v)}for(var h=Math.floor(u.length/7),y=[],f=0;f<h;f++)y.push(7*f);return{rowOffsets:y,days:u}},Q=function(e){var t=e.events,n=void 0===t?[]:t,a=e.viewDate,i=e.hourSegments,o=e.dayStart,l=e.dayEnd,d=e.eventWidth,s=e.segmentHeight,u=R()(I()(c()(a),o.hour),o.minute),f=R()(I()(j()(r()(a)),l.hour),l.minute),m=[],v=P({events:n.filter(function(e){return!e.allDay}),periodStart:u,periodEnd:f}).sort(function(e,t){return e.start.valueOf()-t.start.valueOf()}).map(function(e){var t=e.start,n=e.end||t,a=t<u,r=n>f,o=i*s/L,l=0;t>u&&(l+=W()(t,u)),l*=o;var c=a?u:t,v=r?f:n,p=W()(v,c);e.end?p*=o:p=s;for(var w=l+p,h=m.filter(function(e){var t=e.top,n=e.top+e.height;return l<n&&n<w||t<=l&&w<=n}),g=0;h.some(function(e){return e.left===g});)g+=d;var y={event:e,height:p,width:d,top:l,left:g,startsBeforeDay:a,endsAfterDay:r};return p>0&&m.push(y),y}).filter(function(e){return e.height>0}),p=Math.max.apply(Math,v.map(function(e){return e.left+e.width})),w=P({events:n.filter(function(e){return e.allDay}),periodStart:c()(u),periodEnd:r()(f)});return{events:v,width:p,allDayEvents:w}},ee=function(e){for(var t=e.viewDate,n=e.hourSegments,a=e.dayStart,i=e.dayEnd,l=[],d=R()(I()(c()(t),a.hour),a.minute),s=R()(I()(j()(r()(t)),i.hour),i.minute),u=L/n,f=c()(t),m=0;m<B;m++){for(var v=[],p=0;p<n;p++){var w=o()(Y()(f,m),p*u);w>=d&&w<s&&v.push({date:w,isStart:0===p})}v.length>0&&l.push({segments:v})}return l}}])})},function(e,t,n){function a(e,t){var n=r(e),a=r(t);return n.getTime()-a.getTime()}var r=n(2);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){var t=r(e);return t.setHours(23,59,59,999),t}var r=n(2);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(26);e.exports=a},function(e,t,n){function a(e,t){var n=r(e);return n.setHours(t),n}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=r(e);return n.setMinutes(t),n}var r=n(2);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setSeconds(0,0),t}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=r(e);return n.setDate(n.getDate()+t),n}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=r(e);return n.setHours(n.getHours()+t),n}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=r(e);return n.setMinutes(n.getMinutes()+t),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),o=i.getTime();return a<o?-1:a>o?1:0}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=r(t),l=n.getTime()-n.getTimezoneOffset()*i,d=a.getTime()-a.getTimezoneOffset()*i;return Math.round((l-d)/o)}var r=n(3),i=6e4,o=864e5;e.exports=a},function(e,t,n){function a(e,t){var n=r(e),a=r(t),l=o(n,a),d=Math.abs(i(n,a));n.setDate(n.getDate()-l*d);var s=o(n,a)===-l;return l*(d-s)}var r=n(2),i=n(16),o=n(15);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),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=t?t.weekStartsOn||0:0,a=r(e),i=a.getDay(),o=(i<n?-7:0)+6-(i-n);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}var r=n(2);e.exports=a},function(e,t,n){function a(e){var t=r(e),n=t.getDay();return n}var r=n(2);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(2);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(2);e.exports=a},function(e,t,n){function a(e){var t=r(e);return t.setMilliseconds(0),t}var r=n(2);e.exports=a},function(e,t,n){function a(e,t){var n=t?t.weekStartsOn||0:0,a=r(e),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}var r=n(2);e.exports=a},function(e,t){},function(e,t,n){"use strict";var a=n(1),r="Bootstrap calendar:";a.module("mwl.calendar").controller("MwlCalendarCtrl",["$scope","$log","$timeout","$attrs","$locale","moment","calendarTitle","calendarHelper",function(e,t,n,i,o,l,d,s){var c=this;c.changeView=function(e,t){c.view=e,c.viewDate=t},c.dateClicked=function(e){var t=l(e).toDate(),n={year:"month",month:"day",week:"day"};c.onViewChangeClick({calendarDate:t,calendarNextView:n[c.view]})!==!1&&c.changeView(n[c.view],t)},c.$onInit=function(){function u(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),l(e.startsAt).isAfter(l(e.endsAt))&&t.warn(r,"Event cannot start after it finishes",e))}function f(){d[c.view]&&a.isDefined(i.viewTitle)&&(c.viewTitle=d[c.view](c.viewDate)),c.events.forEach(function(e,t){u(e),e.calendarEventId=t});var t=l(c.viewDate),r=!0;m.clone().startOf(c.view).isSame(t.clone().startOf(c.view))&&!m.isSame(t)&&c.view===v&&(r=!1),m=t,v=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||[];var m=l(c.viewDate),v=c.view;s.loadTemplates().then(function(){c.templatesLoaded=!0;var t=!1;e.$watchGroup(["vm.viewDate","vm.view","vm.cellIsOpen",function(){return l.locale()+o.id}],function(){t?f():(t=!0,e.$watch("vm.events",f,!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:"=",columns:"=",reversed:"=",view:"=",viewTitle:"=?",viewDate:"=",cellIsOpen:"=?",cellAutoOpenDisabled:"=?",slideBoxDisabled:"=?",customTemplateUrls:"=?",onEventClick:"&",onEventTimesChanged:"&",onTimespanClick:"&",onDateRangeSelect:"&?",onViewChangeClick:"&",cellModifier:"&",dayViewStart:"@",dayViewEnd:"@",dayViewSplit:"@",dayViewEventChunkSize:"@",dayViewEventWidth:"@",templateScope:"=?"},controller:"MwlCalendarCtrl as vm",bindToController:!0}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlCalendarDayCtrl",["$scope","moment","calendarHelper","calendarEventTitle","$window",function(e,t,n,a,r){function i(){o.dayViewSplit=o.dayViewSplit||30,o.dayViewHeight=n.getDayViewHeight(o.dayViewStart,o.dayViewEnd,o.dayViewSplit);var e=n.getDayView(o.events,o.viewDate,o.dayViewStart,o.dayViewEnd,o.dayViewSplit,o.dayViewEventWidth);o.allDayEvents=e.allDayEvents,o.nonAllDayEvents=e.events,o.viewWidth=e.width+62}var o=this;o.calendarEventTitle=a,o.leftInterval=setInterval(function(){},1e3),o.rightInterval=setInterval(function(){},1e3),e.$on("calendar.refreshView",i),e.$watchGroup(["vm.dayViewStart","vm.dayViewEnd","vm.dayViewSplit"],i),o.eventDragComplete=function(e,n,a){var r=n*o.dayViewSplit;if("undefined"!=typeof o.columns){"undefined"==typeof e.column&&(e.column=0);var i=e.column+Math.round(a);i<0?i=0:i>o.columns.length&&(i=o.columns.length-1)}var l=t(e.startsAt).add(r,"minutes"),d=t(e.endsAt).add(r,"minutes");delete e.tempStartsAt,o.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:l.toDate(),calendarNewEventEnd:e.endsAt?d.toDate():null,calendarNewColumn:i}),clearInterval(o.leftInterval),clearInterval(o.rightInterval)},o.eventDragged=function(e,n){var a=n*o.dayViewSplit;e.tempStartsAt=t(e.startsAt).add(a,"minutes").toDate();var i="undefined"==typeof r.document?"":r.document,l=0,d=r.event;d.pageX||d.pageY?l=d.pageX:(d.clientX||d.clientY)&&(l=d.clientX+i.body.scrollLeft+i.documentElement.scrollLeft),clearInterval(o.leftInterval),clearInterval(o.rightInterval);var s=parseInt(r.getComputedStyle(i.getElementById("calendar")).width)-100;l>=s?o.leftInterval=setInterval(function(){i.getElementById("calendar").scrollLeft=i.getElementById("calendar").scrollLeft+5},20):l<=100&&(o.rightInterval=setInterval(function(){i.getElementById("calendar").scrollLeft=i.getElementById("calendar").scrollLeft-5},20))},o.eventResizeComplete=function(e,n,a){var r=a*o.dayViewSplit,i=t(e.startsAt),l=t(e.endsAt);"start"===n?i.add(r,"minutes"):l.add(r,"minutes"),delete e.tempStartsAt,o.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:i.toDate(),calendarNewEventEnd:l.toDate()})},o.eventResized=function(e,n,a){var r=a*o.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:"=",columns:"=",viewDate:"=",onEventClick:"=",onEventTimesChanged:"=",onTimespanClick:"=",onDateRangeSelect:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayViewEventChunkSize:"=",dayViewEventWidth:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"="},controller:"MwlCalendarDayCtrl as vm",bindToController:!0}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlCalendarDayReversedCtrl",["$scope","moment","calendarHelper","calendarEventTitle","$window",function(e,t,n,a,r){function i(){o.dayViewSplit=o.dayViewSplit||30,o.dayViewHeight=n.getDayViewHeight(o.dayViewStart,o.dayViewEnd,o.dayViewSplit);var e=n.getDayView(o.events,o.viewDate,o.dayViewStart,o.dayViewEnd,o.dayViewSplit,o.dayViewEventWidth);o.allDayEvents=e.allDayEvents,o.nonAllDayEvents=e.events,o.viewWidth=e.width+62,o.events.forEach(function(e){e.actualEnd="",e.left=(60*t(e.startsAt).hours()+t(e.startsAt).minutes())/60})}var o=this;o.calendarEventTitle=a,o.leftInterval=setInterval(function(){},1e3),o.rightInterval=setInterval(function(){},1e3),e.$on("calendar.refreshView",i),e.$watchGroup(["vm.dayViewStart","vm.dayViewEnd","vm.dayViewSplit"],i),o.eventDragComplete=function(e,n,a){var r=Math.floor(a/o.dayViewSplit/3)*o.dayViewSplit;if("undefined"!=typeof o.columns){"undefined"==typeof e.column&&(e.column=0);var i=e.column+Math.round(n/2);i<0?i=0:i>o.columns.length&&(i=o.columns.length-1)}""!==e.actualEnd&&(e.endsAt=e.actualEnd);var l=t(e.startsAt).add(r,"minutes"),d=t(e.endsAt).add(r,"minutes"),s=t(e.endsAt).add(r,"minutes");s.set("hour",o.dayViewEnd.split(":")[0]),s.set("minute",o.dayViewEnd.split(":")[1]),d>s?(e.actualEnd=d.toDate(),d=s):e.actualEnd="",delete e.tempStartsAt,o.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:l.toDate(),calendarNewEventEnd:e.endsAt?d.toDate():null,calendarNewColumn:i}),clearInterval(o.leftInterval),clearInterval(o.rightInterval),e.left=3*(60*l.hours()+l.minutes())},o.eventDragged=function(e,n,a){var i=Math.floor(a/o.dayViewSplit/3)*o.dayViewSplit;e.tempStartsAt=t(e.startsAt).add(i,"minutes").toDate();var l="undefined"==typeof r.document?"":r.document,d=0,s=r.event;s.pageX||s.pageY?d=s.pageX:(s.clientX||s.clientY)&&(d=s.clientX+l.body.scrollLeft+l.documentElement.scrollLeft),clearInterval(o.leftInterval),clearInterval(o.rightInterval);var c=parseInt(r.getComputedStyle(l.getElementById("calendar")).width)-100;d>=c?o.leftInterval=setInterval(function(){l.getElementById("calendar").scrollLeft=l.getElementById("calendar").scrollLeft+5},20):d<=100&&(o.rightInterval=setInterval(function(){l.getElementById("calendar").scrollLeft=l.getElementById("calendar").scrollLeft-5},20))},o.eventResizeComplete=function(e,n,a){var r=a*o.dayViewSplit,i=t(e.startsAt),l=t(e.endsAt);"start"===n?i.add(r,"minutes"):l.add(r,"minutes"),delete e.tempStartsAt,o.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:i.toDate(),calendarNewEventEnd:l.toDate()})},o.eventResized=function(e,n,a){var r=a*o.dayViewSplit;"start"===n&&(e.tempStartsAt=t(e.startsAt).add(r,"minutes").toDate())}}]).directive("mwlCalendarDayReversed",function(){return{template:'<div mwl-dynamic-directive-template name="calendarDayViewReversed" overrides="vm.customTemplateUrls"></div>',restrict:"E",require:"^mwlCalendar",scope:{events:"=",columns:"=",viewDate:"=",onEventClick:"=",onEventTimesChanged:"=",onTimespanClick:"=",onDateRangeSelect:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayViewEventChunkSize:"=",dayViewEventWidth:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"="},controller:"MwlCalendarDayReversedCtrl as vm",bindToController:!0}})},function(e,t,n){"use strict";var a=n(1),r=n(4);a.module("mwl.calendar").controller("MwlCalendarHourListCtrl",["$scope","moment","calendarHelper","calendarConfig",function(e,t,n,a){function i(){o.dayViewSplit=parseInt(o.dayViewSplit);var e=(o.dayViewStart||"00:00").split(":"),n=(o.dayViewEnd||"23:59").split(":");o.hourGrid=r.getDayViewHourGrid({viewDate:a.showTimesOnWeekView?t(o.viewDate).startOf("week").toDate():t(o.viewDate).toDate(),hourSegments:60/o.dayViewSplit,dayStart:{hour:e[0],minute:e[1]},dayEnd:{hour:n[0],minute:n[1]}}),o.hourGrid.forEach(function(e){e.segments.forEach(function(e){if(e.date=t(e.date),e.nextSegmentDate=e.date.clone().add(o.dayViewSplit,"minutes"),a.showTimesOnWeekView){e.days=[];for(var n=0;n<7;n++){var r={date:t(e.date).add(n,"days")};r.nextSegmentDate=r.date.clone().add(o.dayViewSplit,"minutes"),o.cellModifier({calendarCell:r}),e.days.push(r)}}else o.cellModifier({calendarCell:e})})})}var o=this,l=t.locale();e.$on("calendar.refreshView",function(){l!==t.locale()&&(l=t.locale(),i())}),e.$watchGroup(["vm.dayViewStart","vm.dayViewEnd","vm.dayViewSplit","vm.viewDate"],function(){i()}),o.eventDropped=function(e,a){var r=t(a),i=n.adjustEndDateFromStartDiff(e.startsAt,r,e.endsAt);o.onEventTimesChanged({calendarEvent:e,calendarDate:a,calendarNewEventStart:r.toDate(),calendarNewEventEnd:i?i.toDate():null})},o.onDragSelectStart=function(e,t){o.dateRangeSelect||(o.dateRangeSelect={active:!0,startDate:e,endDate:e,dayIndex:t})},o.onDragSelectMove=function(e){o.dateRangeSelect&&(o.dateRangeSelect.endDate=e)},o.onDragSelectEnd=function(e){o.dateRangeSelect&&(o.dateRangeSelect.endDate=e,o.dateRangeSelect.endDate>o.dateRangeSelect.startDate&&o.onDateRangeSelect({calendarRangeStartDate:o.dateRangeSelect.startDate,calendarRangeEndDate:o.dateRangeSelect.endDate}),delete o.dateRangeSelect)}}]).directive("mwlCalendarHourList",function(){return{restrict:"E",template:'<div mwl-dynamic-directive-template name="calendarHourList" overrides="vm.customTemplateUrls"></div>',controller:"MwlCalendarHourListCtrl as vm",scope:{columns:"=",viewDate:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayWidth:"=?",onTimespanClick:"=",onDateRangeSelect:"=",onEventTimesChanged:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"="},bindToController:!0}})},function(e,t,n){"use strict";var a=n(1),r=n(4);a.module("mwl.calendar").controller("MwlCalendarHourListReversedCtrl",["$scope","moment","calendarHelper","calendarConfig",function(e,t,n,a){function i(){o.dayViewSplit=parseInt(o.dayViewSplit),o.columnsCount=0;var e=(o.dayViewStart||"00:00").split(":"),n=(o.dayViewEnd||"23:59").split(":");o.hourGrid=r.getDayViewHourGrid({viewDate:a.showTimesOnWeekView?t(o.viewDate).startOf("week").toDate():t(o.viewDate).toDate(),hourSegments:60/o.dayViewSplit,dayStart:{hour:e[0],minute:e[1]},dayEnd:{hour:n[0],minute:n[1]}}),o.hourGrid.forEach(function(e){o.columnsCount++,e.segments.forEach(function(e){if(e.date=t(e.date),e.nextSegmentDate=e.date.clone().add(o.dayViewSplit,"minutes"),a.showTimesOnWeekView){e.days=[];for(var n=0;n<7;n++){var r={date:t(e.date).add(n,"days")};r.nextSegmentDate=r.date.clone().add(o.dayViewSplit,"minutes"),o.cellModifier({calendarCell:r}),e.days.push(r)}}else o.cellModifier({calendarCell:e})})})}var o=this,l=t.locale();e.$on("calendar.refreshView",function(){l!==t.locale()&&(l=t.locale(),i())}),e.$watchGroup(["vm.dayViewStart","vm.dayViewEnd","vm.dayViewSplit","vm.viewDate"],function(){i()}),o.eventDropped=function(e,a){var r=t(a),i=n.adjustEndDateFromStartDiff(e.startsAt,r,e.endsAt);o.onEventTimesChanged({calendarEvent:e,calendarDate:a,calendarNewEventStart:r.toDate(),calendarNewEventEnd:i?i.toDate():null})},o.onDragSelectStart=function(e,t){o.dateRangeSelect||(o.dateRangeSelect={active:!0,startDate:e,endDate:e,dayIndex:t})},o.onDragSelectMove=function(e){o.dateRangeSelect&&(o.dateRangeSelect.endDate=e)},o.onDragSelectEnd=function(e){o.dateRangeSelect&&(o.dateRangeSelect.endDate=e,o.dateRangeSelect.endDate>o.dateRangeSelect.startDate&&o.onDateRangeSelect({calendarRangeStartDate:o.dateRangeSelect.startDate,calendarRangeEndDate:o.dateRangeSelect.endDate}),delete o.dateRangeSelect)}}]).directive("mwlCalendarHourListReversed",function(){return{restrict:"E",template:'<div mwl-dynamic-directive-template name="calendarHourListReversed" overrides="vm.customTemplateUrls"></div>',controller:"MwlCalendarHourListReversedCtrl as vm",scope:{columns:"=",viewDate:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayWidth:"=?",onTimespanClick:"=",onDateRangeSelect:"=",onEventTimesChanged:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"="},bindToController:!0}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlCalendarMonthCtrl",["$scope","moment","calendarHelper","calendarConfig","calendarEventTitle",function(e,t,n,r,i){function o(){l.openRowIndex=null,l.openDayIndex=null,l.cellIsOpen&&l.view&&l.view.forEach(function(e,n){t(l.viewDate).startOf("day").isSame(e.date)&&(l.openDayIndex=n,l.openRowIndex=Math.floor(n/7))})}var l=this;l.calendarConfig=r,l.calendarEventTitle=i,l.openRowIndex=null,e.$on("calendar.refreshView",function(){l.weekDays=n.getWeekDayNames();var e=n.getMonthView(l.events,l.viewDate,l.cellModifier);l.view=e.days,l.monthOffsets=e.rowOffsets,l.cellAutoOpenDisabled?o():!l.cellAutoOpenDisabled&&l.cellIsOpen&&null===l.openRowIndex&&(l.openDayIndex=null,l.view.forEach(function(e){e.inMonth&&t(l.viewDate).startOf("day").isSame(e.date)&&l.dayClicked(e,!0)}))}),l.dayClicked=function(e,t,n){if((t||(l.onTimespanClick({calendarDate:e.date.toDate(),calendarCell:e,$event:n}),!n||!n.defaultPrevented))&&!l.cellAutoOpenDisabled){l.openRowIndex=null;var a=l.view.indexOf(e);a===l.openDayIndex?(l.openDayIndex=null,l.cellIsOpen=!1):(l.openDayIndex=a,l.openRowIndex=Math.floor(a/7),l.cellIsOpen=!0)}},l.highlightEvent=function(e,t){l.view.forEach(function(n){if(delete n.highlightClass,delete n.backgroundColor,t){var a=n.events.indexOf(e)>-1;a&&(n.backgroundColor=e.color?e.color.secondary:"")}})},l.handleEventDrop=function(e,a,r){var i=t(e.startsAt).date(t(a).date()).month(t(a).month()).year(t(a).year()),o=n.adjustEndDateFromStartDiff(e.startsAt,i,e.endsAt);l.onEventTimesChanged({calendarEvent:e,calendarDate:a,calendarNewEventStart:i.toDate(),calendarNewEventEnd:o?o.toDate():null,calendarDraggedFromDate:r})},l.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)},l.onDragSelectStart=function(e){l.dateRangeSelect||(l.dateRangeSelect={startDate:e.date,endDate:e.date})},l.onDragSelectMove=function(e){l.dateRangeSelect&&(l.dateRangeSelect.endDate=e.date)},l.onDragSelectEnd=function(e){l.dateRangeSelect.endDate=e.date,l.dateRangeSelect.endDate>l.dateRangeSelect.startDate&&l.onDateRangeSelect({calendarRangeStartDate:l.dateRangeSelect.startDate.clone().startOf("day").toDate(),calendarRangeEndDate:l.dateRangeSelect.endDate.clone().endOf("day").toDate()}),delete l.dateRangeSelect},l.$onInit=function(){l.cellAutoOpenDisabled&&e.$watchGroup(["vm.cellIsOpen","vm.viewDate"],o)},a.version.minor<5&&l.$onInit()}]).directive("mwlCalendarMonth",function(){return{template:'<div mwl-dynamic-directive-template name="calendarMonthView" overrides="vm.customTemplateUrls"></div>',restrict:"E",require:"^mwlCalendar",scope:{events:"=",viewDate:"=",onEventClick:"=",onEventTimesChanged:"=",onDateRangeSelect:"=",cellIsOpen:"=",cellAutoOpenDisabled:"=",onTimespanClick:"=",cellModifier:"=",slideBoxDisabled:"=",customTemplateUrls:"=?",templateScope:"="},controller:"MwlCalendarMonthCtrl as vm",link:function(e,t,n,a){e.vm.calendarCtrl=a},bindToController:!0}})},function(e,t,n){"use strict";var a=n(1);a.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:"="},bindToController:!0}})},function(e,t,n){"use strict";var a=n(1);a.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.weekDragged=function(e,n,a){var r=t(e.startsAt).add(n,"days"),o=t(e.endsAt).add(n,"days");if(a){var l=a*i.dayViewSplit;r=r.add(l,"minutes"),o=o.add(l,"minutes")}delete e.tempStartsAt,i.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:r.toDate(),calendarNewEventEnd:e.endsAt?o.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),o=t(e.endsAt);"start"===n?r.add(a,"days"):o.add(a,"days"),i.onEventTimesChanged({calendarEvent:e,calendarNewEventStart:r.toDate(),calendarNewEventEnd:o.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:"=",onEventClick:"=",onEventTimesChanged:"=",dayViewStart:"=",dayViewEnd:"=",dayViewSplit:"=",dayViewEventChunkSize:"=",onTimespanClick:"=",onDateRangeSelect:"=",customTemplateUrls:"=?",cellModifier:"=",templateScope:"="},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(1);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).month(t(a).month()).year(t(a).year()),o=n.adjustEndDateFromStartDiff(e.startsAt,r,e.endsAt);i.onEventTimesChanged({calendarEvent:e,calendarDate:a,calendarNewEventStart:r.toDate(),calendarNewEventEnd:o?o.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";var a=n(1);a.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(1);a.module("mwl.calendar").controller("MwlDateModifierCtrl",["$element","$attrs","$scope","moment",function(e,t,n,r){function i(){a.isDefined(t.setToToday)?o.date=new Date:a.isDefined(t.increment)?o.date=r(o.date).add(1,o.increment).toDate():a.isDefined(t.decrement)&&(o.date=r(o.date).subtract(1,o.decrement).toDate()),n.$apply()}var o=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:"="},bindToController:!0}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlDragSelectCtrl",["$scope","$element","$parse","$attrs",function(e,t,n,a){function r(t){return function(a){t&&(n(t)(e),e.$apply()),a.preventDefault()}}function i(){t.on("mousedown",l),t.on("mousemove",d),t.on("mouseup",s)}function o(){t.off("mousedown",l),t.off("mousemove",d),t.off("mouseup",s)}var l=r(a.onDragSelectStart),d=r(a.onDragSelectMove),s=r(a.onDragSelectEnd);e.$watch(a.mwlDragSelect,function(e){e?i():o()}),e.$on("$destroy",function(){o()})}]).directive("mwlDragSelect",function(){return{restrict:"A",controller:"MwlDragSelectCtrl"}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlDraggableCtrl",["$element","$scope","$window","$parse","$attrs","$timeout","interact",function(e,t,n,r,i,o,l){function d(e,t){return e.css("-ms-transform",t).css("-webkit-transform",t).css("transform",t)}if(l){var s,c;i.snapGrid&&(c=r(i.snapGrid)(t),s={targets:[l.createSnapGrid(c)]}),l(e[0]).draggable({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 o=a.element(e.target),l=(parseFloat(o.attr("data-x"))||0)+(e.dx||0),s=(parseFloat(o.attr("data-y"))||0)+(e.dy||0);switch(r(i.axis)(t)){case"x":s=0;break;case"y":l=0}"static"===n.getComputedStyle(o[0]).position&&o.css("position","relative"),d(o,"translate("+l+"px, "+s+"px)").css("z-index",50).attr("data-x",l).attr("data-y",s),i.onDrag&&(r(i.onDrag)(t,{x:l,y:s}),t.$apply())},onend:function(e){var n=a.element(e.target),l=n.attr("data-x"),s=n.attr("data-y");e.target.style.pointerEvents="auto",i.onDragEnd&&(r(i.onDragEnd)(t,{x:l,y:s}),t.$apply()),o(function(){d(n,"").css("z-index","auto").removeAttr("data-x").removeAttr("data-y").removeClass("dragging-active")})}}),t.$watch(i.mwlDraggable,function(t){l(e[0]).draggable({enabled:t})}),t.$on("$destroy",function(){l(e[0]).unset()})}}]).directive("mwlDraggable",function(){return{restrict:"A",controller:"MwlDraggableCtrl"}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlDroppableCtrl",["$element","$scope","$parse","$attrs","interact",function(e,t,n,r,i){if(i){var o=r.dropActiveClass||"drop-active";i(e[0]).dropzone({ondragenter:function(e){a.element(e.target).addClass(o)},ondragleave:function(e){a.element(e.target).removeClass(o)},ondropdeactivate:function(e){a.element(e.target).removeClass(o)},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(1);a.module("mwl.calendar").controller("MwlDynamicDirectiveTemplateCtrl",["$compile","$scope","$attrs","$element","$templateCache","$log","calendarConfig",function(e,t,n,r,i,o,l){t.$watch(n.overrides,function(d){var s=l.templates[n.name];d&&a.isObject(d)&&d[n.name]&&(i.get(d[n.name])?s=d[n.name]:o.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(1);a.module("mwl.calendar").controller("MwlElementDimensionsCtrl",["$element","$scope","$parse","$attrs","$window",function(e,t,n,r,i){function o(){n(r.mwlElementDimensions).assign(t,{width:e[0].offsetWidth-1,height:e[0].offsetHeight}),t.$applyAsync()}var l=a.element(i);l.bind("resize",o),o(),t.$on("$destroy",function(){l.unbind("resize",o)})}]).directive("mwlElementDimensions",function(){return{restrict:"A",controller:"MwlElementDimensionsCtrl"}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").controller("MwlResizableCtrl",["$element","$scope","$parse","$attrs","$timeout","interact",function(e,t,n,r,i,o){function l(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",""))-u.width,n.y=parseFloat(t.css("height").replace("px",""))-u.height),n}if(o){var d,s;r.snapGrid&&(s=n(r.snapGrid)(t),d={targets:[o.createSnapGrid(s)]});var c,u={},f={};o(e[0]).resizable({edges:n(r.resizeEdges)(t),snap:d,onstart:function(e){c="end";var t=a.element(e.target);u.height=t[0].offsetHeight,u.width=t[0].offsetWidth,f.height=t.css("height"),f.width=t.css("width")},onmove:function(e){if(e.rect.width>0&&e.rect.height>0){var i=a.element(e.target),o=parseFloat(i.data("x")||0),d=parseFloat(i.data("y")||0);i.css({width:e.rect.width+"px",height:e.rect.height+"px"}),o+=e.deltaRect.left,d+=e.deltaRect.top,i.css("transform","translate("+o+"px,"+d+"px)"),i.data("x",o),i.data("y",d),0===e.deltaRect.left&&0===e.deltaRect.top||(c="start"),r.onResize&&(n(r.onResize)(t,l(c,i)),t.$apply())}},onend:function(e){var o=a.element(e.target),d=l(c,o);i(function(){o.data("x",null).data("y",null).css({transform:"",width:f.width,height:f.height})}),r.onResizeEnd&&(n(r.onResizeEnd)(t,d),t.$apply())}}),t.$watch(r.mwlResizable,function(t){o(e[0]).resizable({enabled:t})}),t.$on("$destroy",function(){o(e[0]).unset()})}}]).directive("mwlResizable",function(){return{restrict:"A",controller:"MwlResizableCtrl"}})},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").filter("calendarDate",["calendarHelper","calendarConfig",function(e,t){function n(n,a,r){return r===!0&&(a=t.dateFormats[a]),e.formatDate(n,a)}return n.$stateful=!0,n}])},function(e,t,n){"use strict";var a=n(1);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";var a=n(1);a.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";var a=n(1);a.module("mwl.calendar").filter("calendarTrustAsHtml",["$sce",function(e){return function(t){return e.trustAsHtml(t)}}])},function(e,t,n){"use strict";var a=n(1);a.module("mwl.calendar").constant("calendarConfig",{allDateFormats:{angular:{date:{hour:"ha",day:"d MMM",month:"MMMM",weekDay:"EEE",time:"HH:mm",datetime:"MMM d, h:mm a"},title:{day:"EEE 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";var a=n(1);a.module("mwl.calendar").factory("calendarEventTitle",["calendarDateFilter","calendarTruncateEventTitleFilter",function(e,t){function n(t){return t.title+" ("+e(t.startsAt,"datetime",!0)+" - "+e(t.endsAt,"datetime",!0)+")"}function a(t){return t.title+" ("+e(t.startsAt,"time",!0)+" - "+e(t.endsAt,"time",!0)+")"}function r(t){return e(t.startsAt,"time",!0)+" - "+t.title}function i(e){return e.title}function o(e){return e.title}function l(e){return e.allDay?e.title:t(e.title,20,e.height)}function d(e){return e.tooltip}return{yearView:n,monthView:a,monthViewTooltip:r,weekView:i,weekViewTooltip:o,dayView:l,dayViewTooltip:d}}])},function(e,t,n){"use strict";var a=n(1),r=n(4);a.module("mwl.calendar").factory("calendarHelper",["$q","$templateRequest","dateFilter","moment","calendarConfig","calendarUtil",function(e,t,n,a,i,o){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 d(e,t,n){if(!n)return n;var r=a(t).diff(a(e));return a(n).add(r)}function s(e,t,n){var r=a(e.start),i=a(e.end),o=a(n);if(t){switch(t){case"year":r.set({year:o.year()});break;case"month":r.set({year:o.year(),month:o.month()});break;default:throw new Error("Invalid value ("+t+") given for recurs on. Can only be year or month.")}i=d(e.start,r,i)}return{start:r,end:i}}function c(e,t,n){t=a(t),n=a(n);var r=s({start:e.startsAt,end:e.endsAt||e.startsAt},e.recursOn,t),i=r.start,o=r.end;return i.isAfter(t)&&i.isBefore(n)||o.isAfter(t)&&o.isBefore(n)||i.isBefore(t)&&o.isAfter(n)||i.isSame(t)||o.isSame(n)}function u(e,t,n){return e.filter(function(e){return c(e,t,n)})}function f(e,t,n){var r=a(e).startOf(t),i=a(e).endOf(t);return u(n,r,i)}function m(e){return e.filter(function(e){return e.incrementsBadgeTotal!==!1}).length}function v(){for(var e=[],t=0;t<7;)e.push(l(a().weekday(t++),i.dateFormats.weekDay));return e}function p(e,t,n){for(var r=[],o=f(t,"year",e),d=a(t).startOf("year"),s=0;s<12;){var c=d.clone(),v=c.clone().endOf("month"),p=u(o,c,v),w={label:l(c,i.dateFormats.month),isToday:c.isSame(a().startOf("month")),events:p,date:c,badgeTotal:m(p)};n({calendarCell:w}),r.push(w),d.add(1,"month"),s++}return r}function w(e,t){return e.start=t.start.toDate(),e.endsAt&&(e.end=t.end.toDate()),e}function h(e,t,n){e.forEach(function(e){var n=s({start:a(e.startsAt),end:a(e.endsAt||e.startsAt)},e.recursOn,a(t).startOf("month"));w(e,n)});var o=r.getMonthView({events:e,viewDate:t,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){var n=r.getWeekViewHeader({viewDate:t,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}),o=a(t).startOf("week"),d=a(t).endOf("week"),c=r.getWeekView({viewDate:t,weekStartsOn:a().startOf("week").day(),events:u(e,o,d).map(function(e){var t=a(o).startOf("day"),n=s({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});return{days:n,eventRows:c}}function y(e,t,n,r,i,l){var d=(n||"00:00").split(":"),c=(r||"23:59").split(":"),u=o.getDayViewFork({events:e.map(function(e){var n=s({start:a(e.startsAt),end:a(e.endsAt||e.startsAt)},e.recursOn,a(t).startOf("day"));return w(e,n)}),viewDate:t,hourSegments:60/i,dayStart:{hour:d[0],minute:d[1]},dayEnd:{hour:c[0],minute:c[1]},eventWidth:l?+l:150,segmentHeight:30});return e.forEach(function(e){delete e.start,delete e.end}),u}function D(e,t,n,i,o){var l=g(e,t),d=[],s=[];return l.eventRows.forEach(function(e){e.row.forEach(function(e){s.push(e.event)})}),l.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,o).events;d=d.concat(r)}),l.eventRows=[{row:d.map(function(e){var n=e.event;return{event:n,top:e.top,offset:r.getWeekViewEventOffset({start:n.startsAt,end:n.endsAt},a(t).startOf("week"))}})}],l}function S(e,t,n){var r=a(e||"00:00","HH:mm"),i=a(t||"23:59","HH:mm"),o=60/n*30;return i.diff(r,"minutes")/60*o+3}function E(){var n=Object.keys(i.templates).map(function(e){var n=i.templates[e];return t(n)});return e.all(n)}return{getWeekDayNames:v,getYearView:p,getMonthView:h,getWeekView:g,getDayView:y,getWeekViewWithTimes:D,getDayViewHeight:S,adjustEndDateFromStartDiff:d,formatDate:l,loadTemplates:E,eventIsInPeriod:c}}])},function(e,t,n){"use strict";var a=n(1);a.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("week").format("YYYY"))}function i(e){return n.formatDate(e,t.titleFormats.month)}function o(e){return n.formatDate(e,t.titleFormats.year)}return{day:a,week:r,month:i,year:o}}])},function(e,t,n){"use strict";var a=n(6),r=n(10),i=n(11),o=n(9),l=n(3),d=n(7),s=n(8),c=n(1),u=60;c.module("mwl.calendar").factory("calendarUtil",function(){function e(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||(!(!s(r,n)&&!s(r,a))||!(!s(i,n)&&!s(i,a)))))}function t(t){var n=t.events,a=t.periodStart,r=t.periodEnd;return n.filter(function(t){return e({event:t,periodStart:a,periodEnd:r})})}function n(e){var n=e.events,s=void 0===n?[]:n,c=e.viewDate,f=e.hourSegments,m=e.dayStart,v=e.dayEnd,p=e.segmentHeight,w=60,h=r(o(l(c),m.hour),m.minute),g=r(o(i(d(c)),v.hour),v.minute),y=[],D=t({events:s.filter(function(e){return!e.allDay}),periodStart:h,periodEnd:g}).sort(function(e,t){return e.start.valueOf()-t.start.valueOf()}).map(function(e){var t=e.start,n=e.end||t,r=t<h,i=n>g,o=f*p/u,l=0,d=e.column;t>h&&(l+=a(t,h)),l*=o;var s=r?h:t,c=i?g:n,m=a(c,s);e.end?m*=o:m=p;var v=l+m,D=y.filter(function(e){var t=e.top,n=e.event.column,a=e.top+e.height;return l<a&&a<v&&d===n||(t<=l&&v<=a&&d===n||l===t&&v===a&&d===n)}),S=D.some(function(e){return e.left===w});S===!0?w+=e.width:w=60;var E={event:e,height:m,width:e.width,top:l,left:w,startsBeforeDay:r,endsAfterDay:i};return m>0&&y.push(E),E}).filter(function(e){return e.height>0}),S=Math.max.apply(Math,D.map(function(e){return e.left+e.width})),E=t({events:s.filter(function(e){return e.allDay}),periodStart:l(h),periodEnd:d(g)});return{events:D,width:S,allDayEvents:E}}return{getDayViewFork:n}})},function(e,t,n){"use strict";var a,r=n(1);try{a=n(61)}catch(e){a=null}r.module("mwl.calendar").constant("interact",a)},function(e,t,n){"use strict";var a=n(1),r=n(60);a.module("mwl.calendar").constant("moment",r)},function(e,t,n){function a(e){return n(r(e))}function r(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./mwlCalendar.js":29,"./mwlCalendarDay.js":30,"./mwlCalendarDayReversed.js":31,"./mwlCalendarHourList.js":32,"./mwlCalendarHourListReversed.js":33,"./mwlCalendarMonth.js":34,"./mwlCalendarSlideBox.js":35,"./mwlCalendarWeek.js":36,"./mwlCalendarYear.js":37,"./mwlCollapseFallback.js":38,"./mwlDateModifier.js":39,"./mwlDragSelect.js":40,"./mwlDraggable.js":41,"./mwlDroppable.js":42,"./mwlDynamicDirectiveTemplate.js":43,"./mwlElementDimensions.js":44,"./mwlResizable.js":45};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=57},function(e,t,n){function a(e){return n(r(e))}function r(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./calendarDate.js":46,"./calendarLimitTo.js":47,"./calendarTruncateEventTitle.js":48,"./calendarTrustAsHtml.js":49};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=58},function(e,t,n){function a(e){return n(r(e))}function r(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./calendarConfig.js":50,"./calendarEventTitle.js":51,"./calendarHelper.js":52,"./calendarTitle.js":53,"./calendarUtil.js":54,"./interact.js":55,"./moment.js":56};a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id=59},function(e,n){e.exports=t},function(e,t){if("undefined"==typeof n){var a=new Error('Cannot find module "undefined"');throw a.code="MODULE_NOT_FOUND",a}e.exports=n}])});
  //# sourceMappingURL=angular-bootstrap-calendar.min.js.map