diff --git a/build/out/fullcalendar.js b/build/out/fullcalendar.js index 42dcb83..21cbeae 100644 --- a/build/out/fullcalendar.js +++ b/build/out/fullcalendar.js @@ -4625,7 +4625,7 @@ function ResourceView(element, calendar, viewName) { t.reportDayClick = reportDayClick; // selection mousedown hack t.dragStart = dragStart; t.dragStop = dragStop; - t.getResources = calendar.fetchResources; + t.getResources = calendar.fetchResources; // imports View.call(t, element, calendar, viewName); @@ -4638,7 +4638,6 @@ function ResourceView(element, calendar, viewName) { var clearOverlays = t.clearOverlays; var reportSelection = t.reportSelection; var unselect = t.unselect; - var daySelectionMousedown = t.daySelectionMousedown; var slotSegHtml = t.slotSegHtml; var cellToDate = t.cellToDate; var dateToCell = t.dateToCell; @@ -5118,7 +5117,7 @@ function ResourceView(element, calendar, viewName) { var date = cellToDate(0, 0); var rowMatch = this.parentNode.className.match(/fc-slot(\d+)/); // TODO: maybe use data - ev.data = resources()[col]; + ev.data = resources()[col]; if (rowMatch) { var mins = parseInt(rowMatch[1]) * opt('slotMinutes'); @@ -5139,25 +5138,13 @@ function ResourceView(element, calendar, viewName) { // TODO: should be consolidated with BasicView's methods - function renderDayOverlay(overlayStart, overlayEnd, refreshCoordinateGrid) { // overlayEnd is exclusive - + function renderDayOverlay(overlayStart, overlayEnd, refreshCoordinateGrid, col) { // overlayEnd is exclusive + var allDayRow = 0; if (refreshCoordinateGrid) { coordinateGrid.build(); } - var segments = rangeToSegments(overlayStart, overlayEnd); - - for (var i=0; i").prependTo(n),oe=new a(ne,r),ie=oe.render(),ie&&n.prepend(ie),b(r.defaultView),r.handleWindowResize&&t(window).resize(H),y()||h()}function h(){setTimeout(function(){!ce.start&&y()&&C()},0)}function g(){ce&&(ee("viewDestroy",ce,ce,ce.element),ce.triggerEventDestroy()),t(window).unbind("resize",H),oe.destroy(),se.remove(),n.removeClass("fc fc-rtl ui-widget")}function m(){return n.is(":visible")}function y(){return t("body").is(":visible")}function b(t){ce&&t==ce.name||M(t)}function M(e){ge++,ce&&(ee("viewDestroy",ce,ce,ce.element),Y(),ce.triggerEventDestroy(),$(),ce.element.remove(),oe.deactivateButton(ce.name)),oe.activateButton(e),ce=new we[e](t("
").appendTo(se),ne),C(),Q(),ge--}function C(t){(!ce.start||t||ce.start>pe||pe>=ce.end)&&m()&&S(t)}function S(t){ge++,ce.start&&(ee("viewDestroy",ce,ce,ce.element),Y(),z()),$(),ce.render(pe,t||0),x(),Q(),(ce.afterRender||L)(),q(),j(),ee("viewRender",ce,ce,ce.element),ce.trigger("viewDisplay",ve),ge--,W()}function T(){m()&&(Y(),z(),E(),x(),F())}function E(){fe=r.contentHeight?r.contentHeight:r.height?r.height-(ie?ie.height():0)-N(se):Math.round(se.width()/Math.max(r.aspectRatio,.5))}function x(){fe===e&&E(),ge++,ce.setHeight(fe),ce.setWidth(se.width()),ge--,ue=n.outerWidth()}function H(){if(!ge)if(ce.start){var t=++he;setTimeout(function(){t==he&&!ge&&m()&&ue!=(ue=n.outerWidth())&&(ge++,T(),ce.trigger("windowResize",ve),ge--)},200)}else h()}function R(){z(),O()}function k(t){z(),F(t)}function F(t){m()&&(ce.setEventData(me),ce.renderEvents(me,t),ce.trigger("eventAfterAllRender"))}function z(){ce.triggerEventDestroy(),ce.clearEvents(),ce.clearEventData()}function W(){!r.lazyFetching||re(ce.visStart,ce.visEnd)?O():F()}function O(){ae(ce.visStart,ce.visEnd)}function A(t){me=t,F()}function _(t){k(t)}function q(){oe.updateTitle(ce.title)}function j(){var t=new Date;t>=ce.start&&ce.end>t?oe.disableButton("today"):oe.enableButton("today")}function P(t,n,r){ce.select(t,n,r===e?!0:r)}function Y(){ce&&ce.unselect()}function B(){C(-1)}function I(){C(1)}function X(){s(pe,-1),C()}function J(){s(pe,1),C()}function V(){pe=new Date,C()}function G(t,e,n){t instanceof Date?pe=v(t):p(pe,t,e,n),C()}function U(t,n,r){t!==e&&s(pe,t),n!==e&&l(pe,n),r!==e&&c(pe,r),C()}function Z(){return v(pe)}function $(){se.css({width:"100%",height:se.height(),overflow:"hidden"})}function Q(){se.css({width:"",height:"",overflow:""})}function K(){return ce}function te(t,n){return n===e?r[t]:(("height"==t||"contentHeight"==t||"aspectRatio"==t)&&(r[t]=n,T()),e)}function ee(t,n){return r[t]?r[t].apply(n||ve,Array.prototype.slice.call(arguments,2)):e}var ne=this;ne.options=r,ne.render=f,ne.destroy=g,ne.refetchEvents=R,ne.reportEvents=A,ne.reportEventChange=_,ne.rerenderEvents=k,ne.changeView=b,ne.select=P,ne.unselect=Y,ne.prev=B,ne.next=I,ne.prevYear=X,ne.nextYear=J,ne.today=V,ne.gotoDate=G,ne.incrementDate=U,ne.formatDate=function(t,e){return D(t,e,r)},ne.formatDates=function(t,e,n){return w(t,e,n,r)},ne.getDate=Z,ne.getView=K,ne.option=te,ne.trigger=ee,o.call(ne,r,u);var re=ne.isFetchNeeded,ae=ne.fetchEvents;i.call(ne,r);var oe,ie,se,le,ce,ue,fe,de,ve=n[0],he=0,ge=0,pe=new Date,me=[];p(pe,r.year,r.month,r.date),r.droppable&&t(document).bind("dragstart",function(e,n){var a=e.target,o=t(a);if(!o.parents(".fc").length){var i=r.dropAccept;(t.isFunction(i)?i.call(a,o):o.is(i))&&(de=a,ce.dragStart(de,e,n))}}).bind("dragstop",function(t,e){de&&(ce.dragStop(de,t,e),de=null)})}function a(n,r){function a(){v=r.theme?"ui":"fc";var n=r.header;return n?h=t("").append(t("").append(i("left")).append(i("center")).append(i("right"))):e}function o(){h.remove()}function i(e){var a=t("",fe&&(r+=""),t=0;ne>t;t++)e=Te(0,t),r+="";return r+=""}function f(){var t,e,n,r=ce+"-widget-content",a="";for(a+="",t=0;ee>t;t++){for(a+="",fe&&(n=Te(t,0),a+=""),e=0;ne>e;e++)n=Te(t,e),a+=h(n);a+=""}return a+=""}function h(t){var e=ce+"-widget-content",n=L.start.getMonth(),r=d(new Date),a="",o=["fc-day","fc-"+Se[t.getDay()],e];return t.getMonth()!=n&&o.push("fc-other-month"),+t==+r?o.push("fc-today",ce+"-state-highlight"):r>t?o.push("fc-past"):o.push("fc-future"),a+=""}function g(e){Q=e;var n,r,a,o=Q-_.height();"variable"==be("weekMode")?n=r=Math.floor(o/(1==ee?2:6)):(n=Math.floor(o/ee),r=o-n*(ee-1)),J.each(function(e,o){ee>e&&(a=t(o),a.find("> div").css("min-height",(e==ee-1?r:n)-N(a)))})}function p(t){Z=t,ie.clear(),se.clear(),te=0,fe&&(te=_.find("th.fc-week-number").outerWidth()),K=Math.floor((Z-te)/ne),E(q.slice(0,-1),K)}function m(t){t.click(b).mousedown(Ce)}function b(e){if(!be("selectable")){var n=y(t(this).data("date"));De("dayClick",this,n,!0,e)}}function D(t,e,n){n&&ae.build();for(var r=xe(t,e),a=0;r.length>a;a++){var o=r[a];m(w(o.row,o.leftCol,o.row,o.rightCol))}}function w(t,n,r,a){var o=ae.rect(t,n,r,a,e);return we(o,e)}function M(t){return v(t)}function C(t,e){D(t,c(v(e),1),!0)}function S(){Me()}function T(t,e,n){var r=Ee(t),a=X[r.row*ne+r.col];De("dayClick",a,t,e,n)}function x(t,e){oe.start(function(t){Me(),t&&w(t.row,t.col,t.row,t.col)},e)}function H(t,e,n){var r=oe.stop();if(Me(),r){var a=Te(r);De("drop",t,a,!0,e,n)}}function R(t){return v(t.start)}function k(t){return ie.left(t)}function F(t){return ie.right(t)}function z(t){return se.left(t)}function W(t){return se.right(t)}function O(t){return I.eq(t)}var L=this;L.renderBasic=a,L.setHeight=g,L.setWidth=p,L.renderDayOverlay=D,L.defaultSelectionEnd=M,L.renderSelection=C,L.clearSelection=S,L.reportDayClick=T,L.dragStart=x,L.dragStop=H,L.defaultEventEnd=R,L.getHoverListener=function(){return oe},L.colLeft=k,L.colRight=F,L.colContentLeft=z,L.colContentRight=W,L.getIsCellAllDay=function(){return!0},L.allDayRow=O,L.getRowCnt=function(){return ee},L.getColCnt=function(){return ne},L.getColWidth=function(){return K},L.getDaySegmentContainer=function(){return U},le.call(L,e,n,r),ve.call(L),de.call(L),$.call(L);var A,_,q,j,I,X,J,V,G,U,Z,Q,K,te,ee,ne,re,ae,oe,ie,se,ce,ue,fe,pe,ye,be=L.opt,De=L.trigger,we=L.renderOverlay,Me=L.clearOverlays,Ce=L.daySelectionMousedown,Te=L.cellToDate,Ee=L.dateToCell,xe=L.rangeToSegments,He=n.formatDate;Y(e.addClass("fc-grid")),ae=new he(function(e,n){var r,a,o;q.each(function(e,i){r=t(i),a=r.offset().left,e&&(o[1]=a),o=[a],n[e]=o}),o[1]=a+r.outerWidth(),I.each(function(n,i){ee>n&&(r=t(i),a=r.offset().top,n&&(o[1]=a),o=[a],e[n]=o)}),o[1]=a+r.outerHeight()}),oe=new ge(ae),ie=new me(function(t){return V.eq(t)}),se=new me(function(t){return G.eq(t)})}function $(){function t(t,e){n.renderDayEvents(t,e)}function e(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=t,n.clearEvents=e,ce.call(n)}function Q(t,e){function n(t,e){e&&c(t,7*e);var n=c(v(t),-((t.getDay()-a("firstDay")+7)%7)),u=c(v(n),7),f=v(n);i(f);var d=v(u);i(d,-1,!0);var h=s();r.title=l(f,c(v(d),-1),a("titleFormat")),r.start=n,r.end=u,r.visStart=f,r.visEnd=d,o(h)}var r=this;r.render=n,te.call(r,t,e,"agendaWeek");var a=r.opt,o=r.renderAgenda,i=r.skipHiddenDays,s=r.getCellsPerWeek,l=e.formatDates}function K(t,e){function n(t,e){e&&c(t,e),i(t,0>e?-1:1);var n=v(t,!0),l=c(v(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=l,o(1)}var r=this;r.render=n,te.call(r,t,e,"agendaDay");var a=r.opt,o=r.renderAgenda,i=r.skipHiddenDays,s=e.formatDate}function te(n,r,a){function o(t){Oe=t,i(),K?l():s()}function i(){Pe=Ue("theme")?"ui":"fc",Ye=Ue("isRTL"),Be=b(Ue("minTime")),Ie=b(Ue("maxTime")),Xe=Ue("columnFormat"),Je=Ue("weekNumbers"),Ve=Ue("weekNumberTitle"),Ge="iso"!=Ue("weekNumberCalculation")?"w":"W",Ne=Ue("snapMinutes")||Ue("slotMinutes")}function s(){var e,r,a,o,i,s=Pe+"-widget-header",c=Pe+"-widget-content",u=0==Ue("slotMinutes")%15;for(l(),ue=t("
").appendTo(n),Ue("allDaySlot")?(fe=t("
").appendTo(ue),e="
"),o=r.header[e];return o&&t.each(o.split(" "),function(e){e>0&&a.append("");var o;t.each(this.split(","),function(e,i){if("title"==i)a.append("

 

"),o&&o.addClass(v+"-corner-right"),o=null;else{var s;if(n[i]?s=n[i]:we[i]&&(s=function(){u.removeClass(v+"-state-hover"),n.changeView(i)}),s){var l=r.theme?j(r.buttonIcons,i):null,c=j(r.buttonText,i),u=t(""+(l?""+"":c)+"").click(function(){u.hasClass(v+"-state-disabled")||s()}).mousedown(function(){u.not("."+v+"-state-active").not("."+v+"-state-disabled").addClass(v+"-state-down")}).mouseup(function(){u.removeClass(v+"-state-down")}).hover(function(){u.not("."+v+"-state-active").not("."+v+"-state-disabled").addClass(v+"-state-hover")},function(){u.removeClass(v+"-state-hover").removeClass(v+"-state-down")}).appendTo(a);Y(u),o||u.addClass(v+"-corner-left"),o=u}}}),o&&o.addClass(v+"-corner-right")}),a}function s(t){h.find("h2").html(t)}function l(t){h.find("span.fc-button-"+t).addClass(v+"-state-active")}function c(t){h.find("span.fc-button-"+t).removeClass(v+"-state-active")}function u(t){h.find("span.fc-button-"+t).addClass(v+"-state-disabled")}function f(t){h.find("span.fc-button-"+t).removeClass(v+"-state-disabled")}var d=this;d.render=a,d.destroy=o,d.updateTitle=s,d.activateButton=l,d.deactivateButton=c,d.disableButton=u,d.enableButton=f;var v,h=t([])}function o(n,r){function a(t,e){return!S||S>t||e>T}function o(t,e){S=t,T=e,W=[];var n=++F,r=k.length;N=r;for(var a=0;r>a;a++)i(k[a],n)}function i(e,r){s(e,function(a){if(r==F){if(a){n.eventDataTransform&&(a=t.map(a,n.eventDataTransform)),e.eventDataTransform&&(a=t.map(a,e.eventDataTransform));for(var o=0;a.length>o;o++)a[o].source=e,b(a[o]);W=W.concat(a)}N--,N||H(W)}})}function s(r,a){var o,i,l=De.sourceFetchers;for(o=0;l.length>o;o++){if(i=l[o](r,S,T,a),i===!0)return;if("object"==typeof i)return s(i,a),e}var c=r.events;if(c)t.isFunction(c)?(p(),c(v(S),v(T),function(t){a(t),y()})):t.isArray(c)?a(c):a();else{var u=r.url;if(u){var f,d=r.success,h=r.error,g=r.complete;f=t.isFunction(r.data)?r.data():r.data;var m=t.extend({},f||{}),b=J(r.startParam,n.startParam),D=J(r.endParam,n.endParam);b&&(m[b]=Math.round(+S/1e3)),D&&(m[D]=Math.round(+T/1e3)),p(),t.ajax(t.extend({},Me,r,{data:m,success:function(e){e=e||[];var n=X(d,this,arguments);t.isArray(n)&&(e=n),a(e)},error:function(){X(h,this,arguments),a()},complete:function(){X(g,this,arguments),y()}}))}else a()}}function l(t){t=c(t),t&&(N++,i(t,F))}function c(n){return t.isFunction(n)||t.isArray(n)?n={events:n}:"string"==typeof n&&(n={url:n}),"object"==typeof n?(D(n),k.push(n),n):e}function u(e){k=t.grep(k,function(t){return!w(t,e)}),W=t.grep(W,function(t){return!w(t.source,e)}),H(W)}function f(t){var e,n,r=W.length,a=x().defaultEventEnd,o=t.start-t._start,i=t.end?t.end-(t._end||a(t)):0;for(e=0;r>e;e++)n=W[e],n._id==t._id&&n!=t&&(n.start=new Date(+n.start+o),n.end=t.end?n.end?new Date(+n.end+i):new Date(+a(n)+i):null,n.title=t.title,n.url=t.url,n.allDay=t.allDay,n.className=t.className,n.editable=t.editable,n.color=t.color,n.backgroundColor=t.backgroundColor,n.borderColor=t.borderColor,n.textColor=t.textColor,b(n));b(t),H(W)}function d(t,e){b(t),t.source||(e&&(R.events.push(t),t.source=R),W.push(t)),H(W)}function h(e){if(e){if(!t.isFunction(e)){var n=e+"";e=function(t){return t._id==n}}W=t.grep(W,e,!0);for(var r=0;k.length>r;r++)t.isArray(k[r].events)&&(k[r].events=t.grep(k[r].events,e,!0))}else{W=[];for(var r=0;k.length>r;r++)t.isArray(k[r].events)&&(k[r].events=[])}H(W)}function g(e){return t.isFunction(e)?t.grep(W,e):e?(e+="",t.grep(W,function(t){return t._id==e})):W}function p(){z++||E("loading",null,!0)}function y(){--z||E("loading",null,!1)}function b(t){var r=t.source||{},a=J(r.ignoreTimezone,n.ignoreTimezone);t._id=t._id||(t.id===e?"_fc"+Ce++:t.id+""),t.date&&(t.start||(t.start=t.date),delete t.date),t._start=v(t.start=m(t.start,a)),t.end=m(t.end,a),t.end&&t.end<=t.start&&(t.end=null),t._end=t.end?v(t.end):null,t.allDay===e&&(t.allDay=J(r.allDayDefault,n.allDayDefault)),t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[],t.resources?"string"==typeof t.resources&&(t.resources=t.resources.split(/\s+/)):t.resources=[]}function D(t){t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[];for(var e=De.sourceNormalizers,n=0;e.length>n;n++)e[n](t)}function w(t,e){return t&&e&&M(t)==M(e)}function M(t){return("object"==typeof t?t.events||t.url:"")||t}var C=this;C.isFetchNeeded=a,C.fetchEvents=o,C.addEventSource=l,C.removeEventSource=u,C.updateEvent=f,C.renderEvent=d,C.removeEvents=h,C.clientEvents=g,C.normalizeEvent=b;for(var S,T,E=C.trigger,x=C.getView,H=C.reportEvents,R={events:[]},k=[R],F=0,N=0,z=0,W=[],O=0;r.length>O;O++)c(r[O])}function i(n){function r(n){c=[];var r;if(t.isFunction(n))r={resources:n},c.push(r),l=e;else if("string"==typeof n)r={url:n},c.push(r),l=e;else if("object"==typeof n&&null!=n){for(var a=0;n.length>a;a++){var o=n[a];i(o),r={resources:o},c.push(r)}l=e}}function a(t,n){if(t=t!==e?t:!0,l!=e&&t)return l;l=[];for(var r=c.length,a=0;r>a;a++){var i=o(c[a],n);l=l.concat(i)}return l}function o(e,r){var a=e.resources;if(a){if(t.isFunction(a))return a()}else{var o=e.url;if(o){var i={};if("object"==typeof r){var s=n.startParam,l=n.endParam;s&&(i[s]=Math.round(+r.visStart/1e3)),l&&(i[l]=Math.round(+r.visEnd/1e3))}t.ajax(t.extend({},e,{data:i,dataType:"json",cache:!1,success:function(t){t=t||[],a=t},error:function(){alert("ajax error getting json from "+o)},async:!1}))}}return a}function i(t){t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[];for(var e=De.sourceNormalizers,n=0;e.length>n;n++)e[n](t)}var s=this;s.fetchResources=a,s.setResources=r;var l,c=[];r(n.resources)}function s(t,e,n){return t.setFullYear(t.getFullYear()+e),n||d(t),t}function l(t,e,n){if(+t){var r=t.getMonth()+e,a=v(t);for(a.setDate(1),a.setMonth(r),t.setMonth(r),n||d(t);t.getMonth()!=a.getMonth();)t.setDate(t.getDate()+(a>t?1:-1))}return t}function c(t,e,n){if(+t){var r=t.getDate()+e,a=v(t);a.setHours(9),a.setDate(r),t.setDate(r),n||d(t),u(t,a)}return t}function u(t,e){if(+t)for(;t.getDate()!=e.getDate();)t.setTime(+t+(e>t?1:-1)*Ee)}function f(t,e){return t.setMinutes(t.getMinutes()+e),t}function d(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}function v(t,e){return e?d(new Date(+t)):new Date(+t)}function h(){var t,e=0;do t=new Date(1970,e++,1);while(t.getHours());return t}function g(t,e){return Math.round((v(t,!0)-v(e,!0))/Te)}function p(t,n,r,a){n!==e&&n!=t.getFullYear()&&(t.setDate(1),t.setMonth(0),t.setFullYear(n)),r!==e&&r!=t.getMonth()&&(t.setDate(1),t.setMonth(r)),a!==e&&t.setDate(a)}function m(t,n){return"object"==typeof t?t:"number"==typeof t?new Date(1e3*t):"string"==typeof t?t.match(/^\d+(\.\d+)?$/)?new Date(1e3*parseFloat(t)):(n===e&&(n=!0),y(t,n)||(t?new Date(t):null)):null}function y(t,e){var n=t.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!n)return null;var r=new Date(n[1],0,1);if(e||!n[13]){var a=new Date(n[1],0,1,9,0);n[3]&&(r.setMonth(n[3]-1),a.setMonth(n[3]-1)),n[5]&&(r.setDate(n[5]),a.setDate(n[5])),u(r,a),n[7]&&r.setHours(n[7]),n[8]&&r.setMinutes(n[8]),n[10]&&r.setSeconds(n[10]),n[12]&&r.setMilliseconds(1e3*Number("0."+n[12])),u(r,a)}else if(r.setUTCFullYear(n[1],n[3]?n[3]-1:0,n[5]||1),r.setUTCHours(n[7]||0,n[8]||0,n[10]||0,n[12]?1e3*Number("0."+n[12]):0),n[14]){var o=60*Number(n[16])+(n[18]?Number(n[18]):0);o*="-"==n[15]?1:-1,r=new Date(+r+1e3*60*o)}return r}function b(t){if("number"==typeof t)return 60*t;if("object"==typeof t)return 60*t.getHours()+t.getMinutes();var e=t.match(/(\d+)(?::(\d+))?\s*(\w+)?/);if(e){var n=parseInt(e[1],10);return e[3]&&(n%=12,"p"==e[3].toLowerCase().charAt(0)&&(n+=12)),60*n+(e[2]?parseInt(e[2],10):0)}}function D(t,e,n){return w(t,null,e,n)}function w(t,e,n,r){r=r||ye;var a,o,i,s,l=t,c=e,u=n.length,f="";for(a=0;u>a;a++)if(o=n.charAt(a),"'"==o){for(i=a+1;u>i;i++)if("'"==n.charAt(i)){l&&(f+=i==a+1?"'":n.substring(a+1,i),a=i);break}}else if("("==o){for(i=a+1;u>i;i++)if(")"==n.charAt(i)){var d=D(l,n.substring(a+1,i),r);parseInt(d.replace(/\D/,""),10)&&(f+=d),a=i;break}}else if("["==o){for(i=a+1;u>i;i++)if("]"==n.charAt(i)){var v=n.substring(a+1,i),d=D(l,v,r);d!=D(c,v,r)&&(f+=d),a=i;break}}else if("{"==o)l=e,c=t;else if("}"==o)l=t,c=e;else{for(i=u;i>a;i--)if(s=He[n.substring(a,i)]){l&&(f+=s(l,r)),a=i-1;break}i==a&&l&&(f+=o)}return f}function M(t){var e,n=new Date(t.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1}function C(t){return t.end?S(t.end,t.allDay):c(v(t.start),1)}function S(t,e){return t=v(t),e||t.getHours()||t.getMinutes()?c(t,1):d(t)}function T(n,r,a){n.unbind("mouseover").mouseover(function(n){for(var o,i,s,l=n.target;l!=this;)o=l,l=l.parentNode;(i=o._fci)!==e&&(o._fci=e,s=r[i],a(s.event,s.element,s),t(n.target).trigger(n)),n.stopPropagation()})}function E(e,n,r){for(var a,o=0;e.length>o;o++)a=t(e[o]),a.width(Math.max(0,n-H(a,r)))}function x(e,n,r){for(var a,o=0;e.length>o;o++)a=t(e[o]),a.height(Math.max(0,n-N(a,r)))}function H(t,e){return R(t)+F(t)+(e?k(t):0)}function R(e){return(parseFloat(t.css(e[0],"paddingLeft",!0))||0)+(parseFloat(t.css(e[0],"paddingRight",!0))||0)}function k(e){return(parseFloat(t.css(e[0],"marginLeft",!0))||0)+(parseFloat(t.css(e[0],"marginRight",!0))||0)}function F(e){return(parseFloat(t.css(e[0],"borderLeftWidth",!0))||0)+(parseFloat(t.css(e[0],"borderRightWidth",!0))||0)}function N(t,e){return z(t)+O(t)+(e?W(t):0)}function z(e){return(parseFloat(t.css(e[0],"paddingTop",!0))||0)+(parseFloat(t.css(e[0],"paddingBottom",!0))||0)}function W(e){return(parseFloat(t.css(e[0],"marginTop",!0))||0)+(parseFloat(t.css(e[0],"marginBottom",!0))||0)}function O(e){return(parseFloat(t.css(e[0],"borderTopWidth",!0))||0)+(parseFloat(t.css(e[0],"borderBottomWidth",!0))||0)}function L(){}function A(t,e){return t-e}function _(t){return Math.max.apply(Math,t)}function q(t){return(10>t?"0":"")+t}function j(t,n){if(t[n]!==e)return t[n];for(var r,a=n.split(/(?=[A-Z])/),o=a.length-1;o>=0;o--)if(r=t[a[o].toLowerCase()],r!==e)return r;return t[""]}function P(t){return t.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function Y(t){t.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function B(t){t.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function I(t,e){var n=t.source||{},r=t.color,a=n.color,o=e("eventColor"),i=t.backgroundColor||r||n.backgroundColor||a||e("eventBackgroundColor")||o,s=t.borderColor||r||n.borderColor||a||e("eventBorderColor")||o,l=t.textColor||n.textColor||e("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function X(e,n,r){if(t.isFunction(e)&&(e=[e]),e){var a,o;for(a=0;e.length>a;a++)o=e[a].apply(n,r)||o;return o}}function J(){for(var t=0;arguments.length>t;t++)if(arguments[t]!==e)return arguments[t]}function V(t,e){function n(t,e){e&&(l(t,e),t.setDate(1));var n=a("firstDay"),f=v(t,!0);f.setDate(1);var d=l(v(f),1),h=v(f);c(h,-((h.getDay()-n+7)%7)),i(h);var p=v(d);c(p,(7-p.getDay()+n)%7),i(p,-1,!0);var m=s(),y=Math.round(g(p,h)/7);"fixed"==a("weekMode")&&(c(p,7*(6-y)),y=6),r.title=u(f,a("titleFormat")),r.start=f,r.end=d,r.visStart=h,r.visEnd=p,o(y,m,!0)}var r=this;r.render=n,Z.call(r,t,e,"month");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=r.getCellsPerWeek,u=e.formatDate}function G(t,e){function n(t,e){e&&c(t,7*e);var n=c(v(t),-((t.getDay()-a("firstDay")+7)%7)),u=c(v(n),7),f=v(n);i(f);var d=v(u);i(d,-1,!0);var h=s();r.start=n,r.end=u,r.visStart=f,r.visEnd=d,r.title=l(f,c(v(d),-1),a("titleFormat")),o(1,h,!1)}var r=this;r.render=n,Z.call(r,t,e,"basicWeek");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=r.getCellsPerWeek,l=e.formatDates}function U(t,e){function n(t,e){e&&c(t,e),i(t,0>e?-1:1);var n=v(t,!0),l=c(v(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=l,o(1,1,!1)}var r=this;r.render=n,Z.call(r,t,e,"basicDay");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=e.formatDate}function Z(e,n,r){function a(t,e,n){ee=t,ne=e,re=n,o(),j||i(),s()}function o(){ce=be("theme")?"ui":"fc",ue=be("columnFormat"),fe=be("weekNumbers"),pe=be("weekNumberTitle"),ye="iso"!=be("weekNumberCalculation")?"w":"W"}function i(){U=t("
").appendTo(e)}function s(){var n=l();A&&A.remove(),A=t(n).appendTo(e),_=A.find("thead"),q=_.find(".fc-day-header"),j=A.find("tbody"),I=j.find("tr"),X=j.find(".fc-day"),J=I.find("td:first-child"),V=I.eq(0).find(".fc-day > div"),G=I.eq(0).find(".fc-day-content > div"),B(_.add(_.find("tr"))),B(I),I.eq(0).addClass("fc-first"),I.filter(":last").addClass("fc-last"),X.each(function(e,n){var r=Te(Math.floor(e/ne),e%ne);De("dayRender",L,r,t(n))}),m(X)}function l(){var t=""+u()+f()+"
";return t}function u(){var t,e,n=ce+"-widget-header",r="";for(r+="
"+P(pe)+""+P(He(e,ue))+"
"+"
"+P(He(n,ye))+"
"+"
"+"
",re&&(a+="
"+t.getDate()+"
"),a+="
 
"+""+""+""+"
"+Ue("allDayText")+""+"
"+"
 
",pe=t(e).appendTo(ue),ye=pe.find("tr"),M(ye.find("td")),ue.append("
"+"
"+"
")):fe=t([]),be=t("
").appendTo(ue),De=t("
").appendTo(be),we=t("
").appendTo(De),e="",r=h(),o=f(v(r),Ie),f(r,Be),Le=0,a=0;o>r;a++)i=r.getMinutes(),e+=""+""+""+"",f(r,Ue("slotMinutes")),Le++;e+="
"+(u&&i?" ":sn(r,Ue("axisFormat")))+""+"
 
"+"
",Me=t(e).appendTo(De),Ce=Me.find("div:first"),C(Me.find("td"))}function l(){var e=u();K&&K.remove(),K=t(e).appendTo(n),te=K.find("thead"),ne=te.find("th").slice(1,-1),re=K.find("tbody"),ae=re.find("td").slice(0,-1),oe=ae.find("> div"),ie=ae.find(".fc-day-content > div"),se=ae.eq(0),ce=oe.eq(0),B(te.add(te.find("tr"))),B(re.add(re.find("tr")))}function u(){var t=""+g()+p()+"
";return t}function g(){var t,e,n,r=Pe+"-widget-header",a="";for(a+="",Je?(e=sn(t,Ge),Ye?e+=Ve:e=Ve+e,a+=""+P(e)+""):a+=" ",n=0;Oe>n;n++)t=rn(0,n),a+=""+P(sn(t,Xe))+"";return a+=" "+""+""}function p(){var t,e,n,r,a,o=Pe+"-widget-header",i=Pe+"-widget-content",s=d(new Date),l="";for(l+=" ",n="",e=0;Oe>e;e++)t=rn(0,e),a=["fc-col"+e,"fc-"+Se[t.getDay()],i],+t==+s?a.push(Pe+"-state-highlight","fc-today"):s>t?a.push("fc-past"):a.push("fc-future"),r=""+"
"+"
"+"
 
"+"
"+"
"+"",n+=r;return l+=n,l+=" "+""+""}function m(t){t===e&&(t=xe),xe=t,ln={};var n=re.position().top,r=be.position().top,a=Math.min(t-n,Me.height()+r+1);ce.height(a-N(se)),ue.css("top",n),be.height(a-r-1),Fe=Ce.height()+1,ze=Ue("slotMinutes")/Ne,We=Fe/ze}function y(e){Ee=e,qe.clear(),je.clear();var n=te.find("th:first");pe&&(n=n.add(pe.find("th:first"))),n=n.add(Me.find("th:first")),He=0,E(n.width("").each(function(e,n){He=Math.max(He,t(n).outerWidth())}),He);var r=K.find(".fc-agenda-gutter");pe&&(r=r.add(pe.find("th.fc-agenda-gutter")));var a=be[0].clientWidth;ke=be.width()-a,ke?(E(r,ke),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),Re=Math.floor((a-He)/Oe),E(ne.slice(0,-1),Re)}function D(){function t(){be.scrollTop(r)}var e=h(),n=v(e);n.setHours(Ue("firstHour"));var r=_(e,n)+1;t(),setTimeout(t,0)}function w(){D()}function M(t){t.click(S).mousedown(en)}function C(t){t.click(S).mousedown(G)}function S(t){if(!Ue("selectable")){var e=Math.min(Oe-1,Math.floor((t.pageX-K.offset().left-He)/Re)),n=rn(0,e),r=this.parentNode.className.match(/fc-slot(\d+)/);if(r){var a=parseInt(r[1])*Ue("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+Be),Ze("dayClick",ae[e],n,!1,t)}else Ze("dayClick",ae[e],n,!0,t)}}function T(t,e,n){n&&Ae.build();for(var r=on(t,e),a=0;r.length>a;a++){var o=r[a];M(H(o.row,o.leftCol,o.row,o.rightCol))}}function H(t,e,n,r){var a=Ae.rect(t,e,n,r,ue);return $e(a,ue)}function R(t,e){for(var n=0;Oe>n;n++){var r=rn(0,n),a=c(v(r),1),o=new Date(Math.max(r,t)),i=new Date(Math.min(a,e));if(i>o){var s=Ae.rect(0,n,0,n,De),l=_(r,o),u=_(r,i);s.top=l,s.height=u-l,C($e(s,De))}}}function k(t){return qe.left(t)}function F(t){return je.left(t)}function z(t){return qe.right(t)}function W(t){return je.right(t)}function O(t){return Ue("allDaySlot")&&!t.row}function L(t){var e=rn(0,t.col),n=t.row;return Ue("allDaySlot")&&n--,n>=0&&f(e,Be+n*Ne),e}function _(t,n){if(t=v(t,!0),f(v(t),Be)>n)return 0;if(n>=f(v(t),Ie))return Me.height();var r=Ue("slotMinutes"),a=60*n.getHours()+n.getMinutes()-Be,o=Math.floor(a/r),i=ln[o];return i===e&&(i=ln[o]=Me.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+Fe*(a%r/r)))}function q(){return ye}function j(t){var e=v(t.start);return t.allDay?e:f(e,Ue("defaultEventMinutes"))}function I(t,e){return e?v(t):f(v(t),Ue("slotMinutes"))}function X(t,e,n){n?Ue("allDaySlot")&&T(t,c(v(e),1),!0):J(t,e)}function J(e,n){var r=Ue("selectHelper");if(Ae.build(),r){var a=an(e).col;if(a>=0&&Oe>a){var o=Ae.rect(0,a,0,a,De),i=_(e,e),s=_(e,n);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(r)){var l=r(e,n);l&&(o.position="absolute",Te=t(l).css(o).appendTo(De))}else o.isStart=!0,o.isEnd=!0,Te=t(nn({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o)),Te.css("opacity",Ue("dragOpacity"));Te&&(C(Te),De.append(Te),E(Te,o.width,!0),x(Te,o.height,!0))}}}else R(e,n)}function V(){Qe(),Te&&(Te.remove(),Te=null)}function G(e){if(1==e.which&&Ue("selectable")){tn(e);var n;_e.start(function(t,e){if(V(),t&&t.col==e.col&&!O(t)){var r=L(e),a=L(t);n=[r,f(v(r),Ne),a,f(v(a),Ne)].sort(A),J(n[0],n[3])}else n=null},e),t(document).one("mouseup",function(t){_e.stop(),n&&(+n[0]==+n[1]&&U(n[0],!1,t),Ke(n[0],n[3],!1,t))})}}function U(t,e,n){Ze("dayClick",ae[an(t).col],t,e,n)}function Z(t,e){_e.start(function(t){if(Qe(),t)if(O(t))H(t.row,t.col,t.row,t.col);else{var e=L(t),n=f(v(e),Ue("defaultEventMinutes"));R(e,n)}},e)}function $(t,e,n){var r=_e.stop();Qe(),r&&Ze("drop",t,L(r),O(r),e,n)}var Q=this;Q.renderAgenda=o,Q.setWidth=y,Q.setHeight=m,Q.afterRender=w,Q.defaultEventEnd=j,Q.timePosition=_,Q.getIsCellAllDay=O,Q.allDayRow=q,Q.getCoordinateGrid=function(){return Ae},Q.getHoverListener=function(){return _e},Q.colLeft=k,Q.colRight=z,Q.colContentLeft=F,Q.colContentRight=W,Q.getDaySegmentContainer=function(){return fe},Q.getSlotSegmentContainer=function(){return we},Q.getMinMinute=function(){return Be},Q.getMaxMinute=function(){return Ie},Q.getSlotContainer=function(){return De},Q.getRowCnt=function(){return 1},Q.getColCnt=function(){return Oe},Q.getColWidth=function(){return Re},Q.getSnapHeight=function(){return We},Q.getSnapMinutes=function(){return Ne},Q.defaultSelectionEnd=I,Q.renderDayOverlay=T,Q.renderSelection=X,Q.clearSelection=V,Q.reportDayClick=U,Q.dragStart=Z,Q.dragStop=$,le.call(Q,n,r,a),ve.call(Q),de.call(Q),ee.call(Q);var K,te,ne,re,ae,oe,ie,se,ce,ue,fe,pe,ye,be,De,we,Me,Ce,Te,Ee,xe,He,Re,ke,Fe,Ne,ze,We,Oe,Le,Ae,_e,qe,je,Pe,Ye,Be,Ie,Xe,Je,Ve,Ge,Ue=Q.opt,Ze=Q.trigger,$e=Q.renderOverlay,Qe=Q.clearOverlays,Ke=Q.reportSelection,tn=Q.unselect,en=Q.daySelectionMousedown,nn=Q.slotSegHtml,rn=Q.cellToDate,an=Q.dateToCell,on=Q.rangeToSegments,sn=r.formatDate,ln={};Y(n.addClass("fc-agenda")),Ae=new he(function(e,n){function r(t){return Math.max(l,Math.min(c,t))}var a,o,i;ne.each(function(e,r){a=t(r),o=a.offset().left,e&&(i[1]=o),i=[o],n[e]=i}),i[1]=o+a.outerWidth(),Ue("allDaySlot")&&(a=ye,o=a.offset().top,e[0]=[o,o+a.outerHeight()]);for(var s=De.offset().top,l=be.offset().top,c=l+be.outerHeight(),u=0;Le*ze>u;u++)e.push([r(s+We*u),r(s+We*(u+1))])}),_e=new ge(Ae),qe=new me(function(t){return oe.eq(t)}),je=new me(function(t){return ie.eq(t)})}function ee(){function n(t,e){var n,r=t.length,o=[],i=[];for(n=0;r>n;n++)t[n].allDay?o.push(t[n]):i.push(t[n]);y("allDaySlot")&&(ee(o,e),E()),s(a(i),e)}function r(){R().empty(),k().empty()}function a(e){var n,r,a,s,l,c,u,d=Y(),h=W(),g=z(),p=t.map(e,i),m=[];for(r=0;d>r;r++)for(n=q(0,r),f(n,h),a=ne(o(e,p,n,f(v(n),g-h))),re(a),s=0;a.length>s;s++)for(l=a[s],c=0;l.length>c;c++)u=l[c],u.col=r,u.level=s,m.push(u);return m}function o(t,e,n,r){var a,o,i,s,l,c,u,f,d=[],h=t.length;for(a=0;h>a;a++)o=t[a],i=o.start,s=e[a],s>n&&r>i&&(n>i?(l=v(n),u=!1):(l=i,u=!0),s>r?(c=v(r),f=!1):(c=s,f=!0),d.push({event:o,start:l,end:c,isStart:u,isEnd:f,msLength:c-l}));return d.sort(j)}function i(t){return t.end?v(t.end):f(v(t.start),y("defaultEventMinutes"))}function s(n,r){var a,o,i,s,c,f,d,v,h,g,p,m,D,w,M,C,S,E,x,R=n.length,F="",z=k();for(x=(E=y("isRTL"))?-1:1,a=0;R>a;a++)o=n[a],i=o.event,s=O(o.start,o.start),c=O(o.start,o.end),f=o.col,d=o.level,v=o.forward||0,h=A(f),g=_(f)-h,g=Math.min(g-6,.95*g),p=d?g/(d+v+1):v?2*(g/(v+1)-6):g,m=h+g/(d+v+1)*d*x+(E?g-p:0),o.top=s,o.left=m,o.outerWidth=p,o.outerHeight=c-s,F+=l(i,o);for(z[0].innerHTML=F,D=z.children(),a=0;R>a;a++)o=n[a],i=o.event,w=t(D[a]),M=b("eventRender",i,i,w),M===!1?w.remove():(M&&M!==!0&&(w.remove(),w=t(M).css({position:"absolute",top:o.top,left:o.left}).appendTo(z)),o.element=w,i._id===r?u(i,w,o):w[0]._fci=a,G(i,w));for(T(z,n,u),a=0;R>a;a++)o=n[a],(w=o.element)&&(o.vsides=N(w,!0),o.hsides=H(w,!0),C=w.find(".fc-event-title"),C.length&&(o.contentTop=C[0].offsetTop));for(a=0;R>a;a++)o=n[a],(w=o.element)&&(w[0].style.width=Math.max(0,o.outerWidth-o.hsides)+"px",S=Math.max(0,o.outerHeight-o.vsides),w[0].style.height=S+"px",i=o.event,o.contentTop!==e&&10>S-o.contentTop&&(w.find("div.fc-event-time").text(oe(i.start,y("timeFormat"))+" - "+i.title),w.find("div.fc-event-title").remove()),b("eventAfterRender",i,i,w))}function l(t,e){var n="<",r=t.url,a=I(t,y),o=["fc-event","fc-event-vert"];return D(t)&&o.push("fc-event-draggable"),e.isStart&&o.push("fc-event-start"),e.isEnd&&o.push("fc-event-end"),o=o.concat(t.className),t.source&&(o=o.concat(t.source.className||[])),n+=r?"a href='"+P(t.url)+"'":"div",n+=" class='"+o.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+e.top+"px;"+"left:"+e.left+"px;"+a+"'"+">"+"
"+"
"+P(ie(t.start,t.end,y("timeFormat")))+"
"+"
"+P(t.title||"")+"
"+"
"+"
",e.isEnd&&w(t)&&(n+="
=
"),n+="" -}function u(t,e,n){var r=e.find("div.fc-event-time");D(t)&&h(t,e,r),n.isEnd&&w(t)&&p(t,e,r),S(t,e)}function d(t,e,n){function r(){l||(e.width(a).height("").draggable("option","grid",null),l=!0)}var a,o,i,s=n.isStart,l=!0,u=F(),f=B(),d=X(),h=J(),p=W();e.draggable({opacity:y("dragOpacity","month"),revertDuration:y("dragRevertDuration"),start:function(n,p){b("eventDragStart",e,t,n,p),Z(t,e),a=e.width(),u.start(function(n,a){if(te(),n){o=!1;var u=q(0,a.col),p=q(0,n.col);i=g(p,u),n.row?s?l&&(e.width(f-10),x(e,d*Math.round((t.end?(t.end-t.start)/xe:y("defaultEventMinutes"))/h)),e.draggable("option","grid",[f,1]),l=!1):o=!0:(K(c(v(t.start),i),c(C(t),i)),r()),o=o||l&&!i}else r(),o=!0;e.draggable("option","revert",o)},n,"drag")},stop:function(n,a){if(u.stop(),te(),b("eventDragStop",e,t,n,a),o)r(),e.css("filter",""),U(t,e);else{var s=0;l||(s=Math.round((e.offset().top-V().offset().top)/d)*h+p-(60*t.start.getHours()+t.start.getMinutes())),$(this,t,i,s,l,n,a)}}})}function h(t,e,n){function r(){te(),s&&(u?(n.hide(),e.draggable("option","grid",null),K(c(v(t.start),D),c(C(t),D))):(a(w),n.css("display",""),e.draggable("option","grid",[E,x])))}function a(e){var r,a=f(v(t.start),e);t.end&&(r=f(v(t.end),e)),n.text(ie(a,r,y("timeFormat")))}var o,i,s,l,u,d,h,p,D,w,M,S=m.getCoordinateGrid(),T=Y(),E=B(),x=X(),H=J();e.draggable({scroll:!1,grid:[E,x],axis:1==T?"y":!1,opacity:y("dragOpacity"),revertDuration:y("dragRevertDuration"),start:function(n,r){b("eventDragStart",e,t,n,r),Z(t,e),S.build(),o=e.position(),i=S.cell(n.pageX,n.pageY),s=l=!0,u=d=L(i),h=p=0,D=0,w=M=0},drag:function(t,n){var a=S.cell(t.pageX,t.pageY);if(s=!!a){if(u=L(a),h=Math.round((n.position.left-o.left)/E),h!=p){var c=q(0,i.col),f=i.col+h;f=Math.max(0,f),f=Math.min(T-1,f);var v=q(0,f);D=g(v,c)}u||(w=Math.round((n.position.top-o.top)/x)*H)}(s!=l||u!=d||h!=p||w!=M)&&(r(),l=s,d=u,p=h,M=w),e.draggable("option","revert",!s)},stop:function(n,a){te(),b("eventDragStop",e,t,n,a),s&&(u||D||w)?$(this,t,D,u?0:w,u,n,a):(s=!0,u=!1,h=0,D=0,w=0,r(),e.css("filter",""),e.css(o),U(t,e))}})}function p(t,e,n){var r,a,o=X(),i=J();e.resizable({handles:{s:".ui-resizable-handle"},grid:o,start:function(n,o){r=a=0,Z(t,e),b("eventResizeStart",this,t,n,o)},resize:function(s,l){r=Math.round((Math.max(o,e.height())-l.originalSize.height)/o),r!=a&&(n.text(ie(t.start,r||t.end?f(M(t),i*r):null,y("timeFormat"))),a=r)},stop:function(n,a){b("eventResizeStop",this,t,n,a),r?Q(this,t,0,i*r,n,a):U(t,e)}})}var m=this;m.renderEvents=n,m.clearEvents=r,m.slotSegHtml=l,ce.call(m);var y=m.opt,b=m.trigger,D=m.isEventDraggable,w=m.isEventResizable,M=m.eventEnd,S=m.eventElementHandlers,E=m.setHeight,R=m.getDaySegmentContainer,k=m.getSlotSegmentContainer,F=m.getHoverListener,z=m.getMaxMinute,W=m.getMinMinute,O=m.timePosition,L=m.getIsCellAllDay,A=m.colContentLeft,_=m.colContentRight,q=m.cellToDate,j=m.segmentCompare,Y=m.getColCnt,B=m.getColWidth,X=m.getSnapHeight,J=m.getSnapMinutes,V=m.getSlotContainer,G=m.reportEventElement,U=m.showEvents,Z=m.hideEvents,$=m.eventDrop,Q=m.eventResize,K=m.renderDayOverlay,te=m.clearOverlays,ee=m.renderDayEvents,ae=m.calendar,oe=ae.formatDate,ie=ae.formatDates;m.draggableDayEvent=d}function ne(t){var e,n,r,a,o,i=[],s=t.length;for(e=0;s>e;e++){for(n=t[e],r=0;;){if(a=!1,i[r])for(o=0;i[r].length>o;o++)if(ae(i[r][o],n)){a=!0;break}if(!a)break;r++}i[r]?i[r].push(n):i[r]=[n]}return i}function re(t){var e,n,r,a,o,i;for(e=t.length-1;e>0;e--)for(a=t[e],n=0;a.length>n;n++)for(o=a[n],r=0;t[e-1].length>r;r++)i=t[e-1][r],ae(o,i)&&(i.forward=Math.max(i.forward||0,(o.forward||0)+1))}function ae(t,e){return t.end>e.start&&t.starte?-1:1);var n=v(t,!0),u=c(v(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=u,o(l().length)}var r=this;r.render=n,ie.call(r,t,e,"resourceDay");var a=r.opt,o=r.renderResource,i=r.skipHiddenDays,s=e.formatDate,l=r.getResources}function ie(n,r,a){function o(t){We=t,i(),K?l():s()}function i(){je=Ge("theme")?"ui":"fc",Pe=Ge("isRTL"),Ye=b(Ge("minTime")),Be=b(Ge("maxTime")),Ie=Ge("columnFormat"),Xe=Ge("weekNumbers"),Je=Ge("weekNumberTitle"),Ve="iso"!=Ge("weekNumberCalculation")?"w":"W",Fe=Ge("snapMinutes")||Ge("slotMinutes")}function s(){var e,r,a,o,i,s=je+"-widget-header",c=je+"-widget-content",u=0==Ge("slotMinutes")%15;for(l(),ue=t("
").appendTo(n),Ge("allDaySlot")?(fe=t("
").appendTo(ue),e=""+""+""+""+"
"+Ge("allDayText")+""+"
"+"
 
",pe=t(e).appendTo(ue),ye=pe.find("tr"),M(ye.find("td")),ue.append("
"+"
"+"
")):fe=t([]),be=t("
").appendTo(ue),De=t("
").appendTo(be),we=t("
").appendTo(De),e="",r=h(),o=f(v(r),Be),f(r,Ye),Oe=0,a=0;o>r;a++)i=r.getMinutes(),e+=""+""+""+"",f(r,Ge("slotMinutes")),Oe++;e+="
"+(u&&i?" ":on(r,Ge("axisFormat")))+""+"
 
"+"
",Me=t(e).appendTo(De),Ce=Me.find("div:first"),C(Me.find("td"))}function l(){var e=u();K&&K.remove(),K=t(e).appendTo(n),te=K.find("thead"),ee=te.find("th").slice(1,-1),ne=K.find("tbody"),re=ne.find("td").slice(0,-1),ae=re.find("> div"),oe=re.find(".fc-day-content > div"),ie=re.eq(0),ce=ae.eq(0),B(te.add(te.find("tr"))),B(ne.add(ne.find("tr")))}function u(){var t=""+g()+p()+"
";return t}function g(){var t,e,n,r=je+"-widget-header",a="";for(a+="",Xe?(e=on(t,Ve),Pe?e+=Je:e=Je+e,a+=""+P(e)+""):a+=" ",n=0;We>n;n++){var o=["fc-col"+n,ln()[n].className,r];a+=""+P(ln()[n].name)+""}return a+=" "+""+""}function p(){var t,e,n,r,a,o=je+"-widget-header",i=je+"-widget-content",s=d(new Date),l="";for(l+=" ",n="",e=0;We>e;e++)t=v(Q.visStart),a=["fc-col"+e,ln()[e].className,i],+t==+s?a.push(je+"-state-highlight","fc-today"):s>t?a.push("fc-past"):a.push("fc-future"),r=""+"
"+"
"+"
 
"+"
"+"
"+"",n+=r;return l+=n,l+=" "+""+""}function m(t){t===e&&(t=Ee),Ee=t,sn={};var n=ne.position().top,r=be.position().top,a=Math.min(t-n,Me.height()+r+1);ce.height(a-N(ie)),ue.css("top",n),be.height(a-r-1),ke=Ce.height()+1,Ne=Ge("slotMinutes")/Fe,ze=ke/Ne}function y(e){Te=e,_e.clear(),qe.clear();var n=te.find("th:first");pe&&(n=n.add(pe.find("th:first"))),n=n.add(Me.find("th:first")),xe=0,E(n.width("").each(function(e,n){xe=Math.max(xe,t(n).outerWidth())}),xe);var r=K.find(".fc-agenda-gutter");pe&&(r=r.add(pe.find("th.fc-agenda-gutter")));var a=be[0].clientWidth;Re=be.width()-a,Re?(E(r,Re),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),He=Math.floor((a-xe)/We),E(ee.slice(0,-1),He)}function D(){function t(){be.scrollTop(r)}var e=h(),n=v(e);n.setHours(Ge("firstHour"));var r=_(e,n)+1;t(),setTimeout(t,0)}function w(){D()}function M(t){t.click(S).mousedown(tn)}function C(t){t.click(S).mousedown(G)}function S(t){if(!Ge("selectable")){var e=Math.min(We-1,Math.floor((t.pageX-K.offset().left-xe)/He)),n=nn(0,0),r=this.parentNode.className.match(/fc-slot(\d+)/);if(t.data=ln()[e],r){var a=parseInt(r[1])*Ge("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+Ye),Ue("dayClick",re[e],n,!1,t)}else Ue("dayClick",re[e],n,!0,t)}}function T(t,e,n){n&&Le.build();for(var r=an(t,e),a=0;r.length>a;a++){var o=r[a];M(H(o.row,o.leftCol,o.row,o.rightCol))}}function H(t,e,n,r){var a=Le.rect(t,e,n,r,ue);return Ze(a,ue)}function R(t,e,n){var r=nn(0,0),a=c(v(r),1),o=new Date(Math.max(r,t)),i=new Date(Math.min(a,e));if(i>o){var s=Le.rect(0,n,0,n,De),l=_(r,o),u=_(r,i);s.top=l,s.height=u-l,C(Ze(s,De))}}function k(t){return _e.left(t)}function F(t){return qe.left(t)}function z(t){return _e.right(t)}function W(t){return qe.right(t)}function O(t){return Ge("allDaySlot")&&!t.row}function L(t){var e=nn(0,0),n=t.row;return Ge("allDaySlot")&&n--,n>=0&&f(e,Ye+n*Fe),e}function _(t,n){if(t=v(t,!0),f(v(t),Ye)>n)return 0;if(n>=f(v(t),Be))return Me.height();var r=Ge("slotMinutes"),a=60*n.getHours()+n.getMinutes()-Ye,o=Math.floor(a/r),i=sn[o];return i===e&&(i=sn[o]=Me.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+ke*(a%r/r)))}function q(){return ye}function j(t){var e=v(t.start);return t.allDay?e:f(e,Ge("defaultEventMinutes"))}function I(t,e){return e?v(t):f(v(t),Ge("slotMinutes"))}function X(t,e,n){n?Ge("allDaySlot")&&T(t,c(v(e),1),!0):J(t,e)}function J(e,n,r){var a=Ge("selectHelper");if(Le.build(),a){if(r=r||rn(e).col,r>=0&&We>r){var o=Le.rect(0,r,0,r,De),i=_(e,e),s=_(e,n);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(a)){var l=a(e,n);l&&(o.position="absolute",Se=t(l).css(o).appendTo(De))}else o.isStart=!0,o.isEnd=!0,Se=t(en({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o)),Se.css("opacity",Ge("dragOpacity"));Se&&(C(Se),De.append(Se),E(Se,o.width,!0),x(Se,o.height,!0))}}}else R(e,n,r)}function V(){$e(),Se&&(Se.remove(),Se=null)}function G(e){if(1==e.which&&Ge("selectable")){Ke(e);var n,r;Ae.start(function(t,e){if(V(),t&&t.col==e.col&&!O(t)){r=t.col;var a=L(e),o=L(t);n=[a,f(v(a),Fe),o,f(v(o),Fe)].sort(A),J(n[0],n[3],t.col)}else n=null},e),t(document).one("mouseup",function(t){Ae.stop(),n&&(+n[0]==+n[1]&&U(n[0],!1,t),t.data=ln()[r],Qe(n[0],n[3],!1,t))})}}function U(t,e,n){Ue("dayClick",re[rn(t).col],t,e,n)}function Z(t,e){Ae.start(function(t){if($e(),t)if(O(t))H(t.row,t.col,t.row,t.col);else{var e=L(t),n=f(v(e),Ge("defaultEventMinutes"));R(e,n,t.col)}},e)}function $(t,e,n){var r=Ae.stop();$e(),r&&(e.data=ln()[r.col],Ue("drop",t,L(r),O(r),e,n))}var Q=this;Q.renderResource=o,Q.setWidth=y,Q.setHeight=m,Q.afterRender=w,Q.defaultEventEnd=j,Q.timePosition=_,Q.getIsCellAllDay=O,Q.allDayRow=q,Q.getCoordinateGrid=function(){return Le},Q.getHoverListener=function(){return Ae},Q.colLeft=k,Q.colRight=z,Q.colContentLeft=F,Q.colContentRight=W,Q.getDaySegmentContainer=function(){return fe},Q.getSlotSegmentContainer=function(){return we},Q.getMinMinute=function(){return Ye},Q.getMaxMinute=function(){return Be},Q.getSlotContainer=function(){return De},Q.getRowCnt=function(){return 1},Q.getColCnt=function(){return We},Q.getColWidth=function(){return He},Q.getSnapHeight=function(){return ze},Q.getSnapMinutes=function(){return Fe},Q.defaultSelectionEnd=I,Q.renderDayOverlay=T,Q.renderSelection=X,Q.clearSelection=V,Q.reportDayClick=U,Q.dragStart=Z,Q.dragStop=$,Q.getResources=r.fetchResources,le.call(Q,n,r,a),ve.call(Q),de.call(Q),se.call(Q);var K,te,ee,ne,re,ae,oe,ie,ce,ue,fe,pe,ye,be,De,we,Me,Ce,Se,Te,Ee,xe,He,Re,ke,Fe,Ne,ze,We,Oe,Le,Ae,_e,qe,je,Pe,Ye,Be,Ie,Xe,Je,Ve,Ge=Q.opt,Ue=Q.trigger,Ze=Q.renderOverlay,$e=Q.clearOverlays,Qe=Q.reportSelection,Ke=Q.unselect,tn=Q.daySelectionMousedown,en=Q.slotSegHtml,nn=Q.cellToDate,rn=Q.dateToCell,an=Q.rangeToSegments,on=r.formatDate,sn={},ln=Q.getResources;Y(n.addClass("fc-agenda")),Le=new he(function(e,n){function r(t){return Math.max(l,Math.min(c,t))}var a,o,i;ee.each(function(e,r){a=t(r),o=a.offset().left,e&&(i[1]=o),i=[o],n[e]=i}),i[1]=o+a.outerWidth(),Ge("allDaySlot")&&(a=ye,o=a.offset().top,e[0]=[o,o+a.outerHeight()]);for(var s=De.offset().top,l=be.offset().top,c=l+be.outerHeight(),u=0;Oe*Ne>u;u++)e.push([r(s+ze*u),r(s+ze*(u+1))])}),Ae=new ge(Le),_e=new me(function(t){return ae.eq(t)}),qe=new me(function(t){return oe.eq(t)})}function se(){function n(t,e){var n,r=t.length,o=[],i=[];for(n=0;r>n;n++)t[n].allDay?o.push(t[n]):i.push(t[n]);b("allDaySlot")&&(ae(o,e),R()),l(a(i),e)}function r(){k().empty(),F().empty()}function a(e){var n,r,a,l,c,u,d,h,g=B(),p=O(),m=W(),b=[];for(a=0;g>a;a++){n=v(y.visStart),f(n,p);var D=i(le()[a],e);for(r=t.map(D,s),l=ne(o(D,r,n,f(v(n),m-p))),re(l),c=0;l.length>c;c++)for(u=l[c],d=0;u.length>d;d++)h=u[d],h.col=a,h.level=c,b.push(h)}return b}function o(t,e,n,r){var a,o,i,s,l,c,u,f,d=[],h=t.length;for(a=0;h>a;a++)o=t[a],i=o.start,s=e[a],s>n&&r>i&&(n>i?(l=v(n),u=!1):(l=i,u=!0),s>r?(c=v(r),f=!1):(c=s,f=!0),d.push({event:o,start:l,end:c,isStart:u,isEnd:f,msLength:c-l}));return d.sort(Y)}function i(e,n){for(var r=[],a=0;n.length>a;a++)n[a].resources&&t.inArray(e.id,n[a].resources)>=0&&r.push(n[a]);return r}function s(t){return t.end?v(t.end):f(v(t.start),b("defaultEventMinutes"))}function l(n,r){var a,o,i,s,l,c,f,v,h,g,p,m,y,w,M,C,S,E,x,R=n.length,k="",z=F();for(x=(E=b("isRTL"))?-1:1,a=0;R>a;a++)o=n[a],i=o.event,s=L(o.start,o.start),l=L(o.start,o.end),c=o.col,f=o.level,v=o.forward||0,h=_(c),g=q(c)-h,g=Math.min(g-6,.95*g),p=f?g/(f+v+1):v?2*(g/(v+1)-6):g,m=h+g/(f+v+1)*f*x+(E?g-p:0),o.top=s,o.left=m,o.outerWidth=p,o.outerHeight=l-s,k+=u(i,o);for(z[0].innerHTML=k,y=z.children(),a=0;R>a;a++)o=n[a],i=o.event,w=t(y[a]),M=D("eventRender",i,i,w),M===!1?w.remove():(M&&M!==!0&&(w.remove(),w=t(M).css({position:"absolute",top:o.top,left:o.left}).appendTo(z)),o.element=w,i._id===r?d(i,w,o):w[0]._fci=a,U(i,w));for(T(z,n,d),a=0;R>a;a++)o=n[a],(w=o.element)&&(o.vsides=N(w,!0),o.hsides=H(w,!0),C=w.find(".fc-event-title"),C.length&&(o.contentTop=C[0].offsetTop));for(a=0;R>a;a++)o=n[a],(w=o.element)&&(w[0].style.width=Math.max(0,o.outerWidth-o.hsides)+"px",S=Math.max(0,o.outerHeight-o.vsides),w[0].style.height=S+"px",i=o.event,o.contentTop!==e&&10>S-o.contentTop&&(w.find("div.fc-event-time").text(ie(i.start,b("timeFormat"))+" - "+i.title),w.find("div.fc-event-title").remove()),D("eventAfterRender",i,i,w))}function u(t,e){var n="<",r=t.url,a=I(t,b),o=["fc-event","fc-event-vert"];return w(t)&&o.push("fc-event-draggable"),e.isStart&&o.push("fc-event-start"),e.isEnd&&o.push("fc-event-end"),o=o.concat(t.className),t.source&&(o=o.concat(t.source.className||[])),n+=r?"a href='"+P(t.url)+"'":"div",n+=" class='"+o.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+e.top+"px;"+"left:"+e.left+"px;"+a+"'"+">"+"
"+"
"+P(se(t.start,t.end,b("timeFormat")))+"
"+"
"+P(t.title||"")+"
"+"
"+"
",e.isEnd&&M(t)&&(n+="
=
"),n+=""}function d(t,e,n){var r=e.find("div.fc-event-time");w(t)&&p(t,e,r),n.isEnd&&M(t)&&m(t,e,r),E(t,e)}function h(t,e,n){function r(){l||(e.width(a).height("").draggable("option","grid",null),l=!0)}var a,o,i,s=n.isStart,l=!0,u=z(),f=X(),d=J(),h=V(),p=O();e.draggable({opacity:b("dragOpacity","month"),revertDuration:b("dragRevertDuration"),start:function(n,p){D("eventDragStart",e,t,n,p),$(t,e),a=e.width(),u.start(function(n,a){if(ee(),n){o=!1;var u=j(0,a.col),p=j(0,n.col);i=g(p,u),n.row?s?l&&(e.width(f-10),x(e,d*Math.round((t.end?(t.end-t.start)/xe:b("defaultEventMinutes"))/h)),e.draggable("option","grid",[f,1]),l=!1):o=!0:(te(c(v(t.start),i),c(C(t),i)),r()),o=o||l&&!i}else r(),o=!0;e.draggable("option","revert",o)},n,"drag")},stop:function(n,a){if(u.stop(),ee(),D("eventDragStop",e,t,n,a),o)r(),e.css("filter",""),Z(t,e);else{var s=0;l||(s=Math.round((e.offset().top-G().offset().top)/d)*h+p-(60*t.start.getHours()+t.start.getMinutes())),Q(this,t,i,s,l,n,a)}}})}function p(t,e,n){function r(){ee(),s&&(u?(n.hide(),e.draggable("option","grid",null),te(c(v(t.start),p),c(C(t),p))):(a(w),n.css("display",""),e.draggable("option","grid",[E,x])))}function a(e){var r,a=f(v(t.start),e);t.end&&(r=f(v(t.end),e)),n.text(se(a,r,b("timeFormat")))}var o,i,s,l,u,d,h,g,p,m,w,M,S=y.getCoordinateGrid(),T=B(),E=X(),x=J(),H=V();e.draggable({scroll:!1,grid:[E,x],axis:1==T?"y":!1,opacity:b("dragOpacity"),revertDuration:b("dragRevertDuration"),start:function(n,r){D("eventDragStart",e,t,n,r),$(t,e),S.build(),o=e.position(),i=S.cell(n.pageX,n.pageY),s=l=!0,u=d=A(i),h=g=0,p=0,m=0,w=M=0},drag:function(t,n){var a=S.cell(t.pageX,t.pageY);s=!!a,s&&(u=A(a),h=Math.round((n.position.left-o.left)/E),h!=g&&(m=h),u||(w=Math.round((n.position.top-o.top)/x)*H)),(s!=l||u!=d||h!=g||w!=M)&&(r(),l=s,d=u,g=h,M=w),e.draggable("option","revert",!s)},stop:function(n,a){ee(),D("eventDragStop",e,t,n,a),s&&(u||m||w)?(t.resources=le()[i.col+m].id,Q(this,t,p,u?0:w,u,n,a)):(s=!0,u=!1,h=0,p=0,w=0,r(),e.css("filter",""),e.css(o),Z(t,e))}})}function m(t,e,n){var r,a,o=J(),i=V();e.resizable({handles:{s:".ui-resizable-handle"},grid:o,start:function(n,o){r=a=0,$(t,e),D("eventResizeStart",this,t,n,o)},resize:function(s,l){r=Math.round((Math.max(o,e.height())-l.originalSize.height)/o),r!=a&&(n.text(se(t.start,r||t.end?f(S(t),i*r):null,b("timeFormat"))),a=r)},stop:function(n,a){D("eventResizeStop",this,t,n,a),r?K(this,t,0,i*r,n,a):Z(t,e)}})}var y=this;y.renderEvents=n,y.clearEvents=r,y.slotSegHtml=u,ce.call(y);var b=y.opt,D=y.trigger,w=y.isEventDraggable,M=y.isEventResizable,S=y.eventEnd,E=y.eventElementHandlers,R=y.setHeight,k=y.getDaySegmentContainer,F=y.getSlotSegmentContainer,z=y.getHoverListener,W=y.getMaxMinute,O=y.getMinMinute,L=y.timePosition,A=y.getIsCellAllDay,_=y.colContentLeft,q=y.colContentRight,j=y.cellToDate,Y=y.segmentCompare,B=y.getColCnt,X=y.getColWidth,J=y.getSnapHeight,V=y.getSnapMinutes,G=y.getSlotContainer,U=y.reportEventElement,Z=y.showEvents,$=y.hideEvents,Q=y.eventDrop,K=y.eventResize,te=y.renderDayOverlay,ee=y.clearOverlays,ae=y.renderDayEvents,oe=y.calendar,ie=oe.formatDate,se=oe.formatDates,le=y.getResources;y.draggableDayEvent=h}function ne(t){var e,n,r,a,o,i=[],s=t.length;for(e=0;s>e;e++){for(n=t[e],r=0;;){if(a=!1,i[r])for(o=0;i[r].length>o;o++)if(ae(i[r][o],n)){a=!0;break}if(!a)break;r++}i[r]?i[r].push(n):i[r]=[n]}return i}function re(t){var e,n,r,a,o,i;for(e=t.length-1;e>0;e--)for(a=t[e],n=0;a.length>n;n++)for(o=a[n],r=0;t[e-1].length>r;r++)i=t[e-1][r],ae(o,i)&&(i.forward=Math.max(i.forward||0,(o.forward||0)+1))}function ae(t,e){return t.end>e.start&&t.starte;e++)n=t[e],X[n._id]?X[n._id].push(n):X[n._id]=[n]}function d(){X={},V={},G=[]}function h(t){return t.end?v(t.end):Y(t)}function p(t,e){G.push({event:t,element:e}),V[t._id]?V[t._id].push(e):V[t._id]=[e]}function m(){t.each(G,function(t,e){P.trigger("eventDestroy",e.event,e.event,e.element)})}function y(t,n){n.click(function(r){return n.hasClass("ui-draggable-dragging")||n.hasClass("ui-resizable-resizing")?e:i("eventClick",this,t,r)}).hover(function(e){i("eventMouseover",this,t,e)},function(e){i("eventMouseout",this,t,e)})}function b(t,e){w(t,e,"show")}function D(t,e){w(t,e,"hide")}function w(t,e,n){var r,a=V[t._id],o=a.length;for(r=0;o>r;r++)e&&a[r][0]==e[0]||a[r][n]()}function M(t,e,n,r,a,o,s){var l=e.allDay,c=e._id;S(X[c],n,r,a),i("eventDrop",t,e,n,r,a,function(){S(X[c],-n,-r,l),I(c)},o,s),I(c)}function C(t,e,n,r,a,o){var s=e._id;T(X[s],n,r),i("eventResize",t,e,n,r,function(){T(X[s],-n,-r),I(s)},a,o),I(s)}function S(t,n,r,a){r=r||0;for(var o,i=t.length,s=0;i>s;s++)o=t[s],a!==e&&(o.allDay=a),f(c(o.start,n,!0),r),o.end&&(o.end=f(c(o.end,n,!0),r)),B(o,U)}function T(t,e,n){n=n||0;for(var r,a=t.length,o=0;a>o;o++)r=t[o],r.end=f(c(h(r),e,!0),n),B(r,U)}function E(t){return"object"==typeof t&&(t=t.getDay()),Q[t]}function x(){return Z}function H(t,e,n){for(e=e||1;Q[(t.getDay()+(n?e:0)+7)%7];)c(t,e)}function R(){var t=k.apply(null,arguments),e=F(t),n=N(e);return n}function k(t,e){var n=P.getColCnt(),r=ee?-1:1,a=ee?n-1:0;"object"==typeof t&&(e=t.col,t=t.row);var o=t*n+(e*r+a);return o}function F(t){var e=P.visStart.getDay();return t+=K[e],7*Math.floor(t/Z)+te[(t%Z+Z)%Z]-e}function N(t){var e=v(P.visStart);return c(e,t),e}function z(t){var e=W(t),n=O(e),r=L(n);return r}function W(t){return g(t,P.visStart)}function O(t){var e=P.visStart.getDay();return t+=e,Math.floor(t/7)*Z+K[(t%7+7)%7]-K[e]}function L(t){var e=P.getColCnt(),n=ee?-1:1,r=ee?e-1:0,a=Math.floor(t/e),o=(t%e+e)%e*n+r;return{row:a,col:o}}function A(t,e){for(var n=P.getRowCnt(),r="resourceDay"===P.name?1:P.getColCnt(),a=[],o=W(t),i=W(e),s=O(o),l=O(i)-1,c=0;n>c;c++){var u=c*r,f=u+r-1,d=Math.max(s,u),v=Math.min(l,f);if(v>=d){var h=L(d),g=L(v),p=[h.col,g.col].sort(),m=F(d)==o,y=F(v)+1==i;a.push({row:c,leftCol:p[0],rightCol:p[1],isStart:m,isEnd:y})}}return a}function _(t,e){return q(t,e)||t.event.start-e.event.start||(t.event.title||"").localeCompare(e.event.title)}function q(t,e){return"msLength"in t?e.msLength-t.msLength:e.rightCol-e.leftCol-(t.rightCol-t.leftCol)||e.event.allDay-t.event.allDay}var P=this;P.element=n,P.calendar=r,P.name=a,P.opt=o,P.trigger=i,P.isEventDraggable=s,P.isEventResizable=l,P.setEventData=u,P.clearEventData=d,P.eventEnd=h,P.reportEventElement=p,P.triggerEventDestroy=m,P.eventElementHandlers=y,P.showEvents=b,P.hideEvents=D,P.eventDrop=M,P.eventResize=C;var Y=P.defaultEventEnd,B=r.normalizeEvent,I=r.reportEventChange,X={},V={},G=[],U=r.options;P.isHiddenDay=E,P.skipHiddenDays=H,P.getCellsPerWeek=x,P.dateToCell=z,P.dateToDayOffset=W,P.dayOffsetToCellOffset=O,P.cellOffsetToCell=L,P.cellToDate=R,P.cellToCellOffset=k,P.cellOffsetToDayOffset=F,P.dayOffsetToDate=N,P.rangeToSegments=A,P.segmentCompare=_;var Z,$=o("hiddenDays")||[],Q=[],K=[],te=[],ee=o("isRTL");(function(){o("weekends")===!1&&$.push(0,6);for(var e=0,n=0;7>e;e++)K[e]=n,Q[e]=-1!=t.inArray(e,$),Q[e]||(te[n]=e,n++);if(Z=n,!Z)throw"invalid hiddenDays"})()}function ce(){function n(t,e){var n=a(t,!1,!0);fe(n,function(t,e){O(t.event,e)}),M(n,e),fe(n,function(t,e){F("eventAfterRender",t.event,t.event,e)})}function r(t,e,n){var r=a([t],!0,!1),o=[];return fe(r,function(t,r){t.row===e&&r.css("top",n),o.push(r[0])}),o}function a(e,n,r){var a,i,s=Q(),l=n?t("
"):s,c=o(e);return u(c),a=f(c),l[0].innerHTML=a,i=l.children(),n&&s.append(i),h(c,i),fe(c,function(t,e){t.hsides=H(e,!0)}),fe(c,function(t,e){e.width(Math.max(0,t.outerWidth-t.hsides))}),fe(c,function(t,e){t.outerHeight=e.outerHeight(!0)}),p(c,r),c}function o(t){var n=R.getResources();if(n===e)return s(t);for(var r=[],a=0;n.length>a;a++)for(var o=i(n[a],t),c=0;o.length>c;c++){var u=l(o[c],a);r.push.apply(r,u)}return r}function i(e,n){for(var r=[],a=0;n.length>a;a++)n[a].resources&&t.inArray(e.id,n[a].resources)>=0&&r.push(n[a]);return r}function s(t){for(var e=[],n=0;t.length>n;n++){var r=l(t[n]);e.push.apply(e,r)}return e}function l(t,n){for(var r=t.start,a=C(t),o=ae(r,a),i=0;o.length>i;i++)n!==e&&(o[i].leftCol=n,o[i].rightCol=n),o[i].event=t;return o}function u(t){for(var e=k("isRTL"),n=0;t.length>n;n++){var r=t[n],a=(e?r.isEnd:r.isStart)?Z:G,o=(e?r.isStart:r.isEnd)?$:U,i=a(r.leftCol),s=o(r.rightCol);r.left=i,r.outerWidth=s-i}}function f(t){for(var e="",n=0;t.length>n;n++)e+=d(t[n]);return e}function d(t){var e="",n=k("isRTL"),r=t.event,a=r.url,o=["fc-event","fc-event-hori"];N(r)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(r.className),r.source&&(o=o.concat(r.source.className||[]));var i=I(r,k);return e+=a?""+"
",!r.allDay&&t.isStart&&(e+=""+P(K(r.start,r.end,k("timeFormat")))+""),e+=""+P(r.title||"")+""+"
",t.isEnd&&z(r)&&(e+="
"+"   "+"
"),e+=""}function h(e,n){for(var r=0;e.length>r;r++){var a=e[r],o=a.event,i=n.eq(r),s=F("eventRender",o,o,i);s===!1?i.remove():(s&&s!==!0&&(s=t(s).css({position:"absolute",left:a.left}),i.replaceWith(s),i=s),a.element=i)}}function p(t,e){var n=m(t),r=w(),a=[];if(e)for(var o=0;r.length>o;o++)r[o].height(n[o]);for(var o=0;r.length>o;o++)a.push(r[o].position().top);fe(t,function(t,e){e.css("top",a[t.row]+t.top)})}function m(t){for(var e=X(),n=J(),r=[],a=y(t),o=0;e>o;o++){for(var i=a[o],s=[],l=0;n>l;l++)s.push(0);for(var c=0;i.length>c;c++){var u=i[c];u.top=_(s.slice(u.leftCol,u.rightCol+1));for(var l=u.leftCol;u.rightCol>=l;l++)s[l]=u.top+u.outerHeight}r.push(_(s))}return r}function y(t){var e,n,r,a=X(),o=[];for(e=0;t.length>e;e++)n=t[e],r=n.row,n.element&&(o[r]?o[r].push(n):o[r]=[n]);for(r=0;a>r;r++)o[r]=b(o[r]||[]);return o}function b(t){for(var e=[],n=D(t),r=0;n.length>r;r++)e.push.apply(e,n[r]);return e}function D(t){t.sort(oe);for(var e=[],n=0;t.length>n;n++){for(var r=t[n],a=0;e.length>a&&ue(r,e[a]);a++);e[a]?e[a].push(r):e[a]=[r]}return e}function w(){var t,e=X(),n=[];for(t=0;e>t;t++)n[t]=V(t).find("div.fc-day-content > div");return n}function M(t,e){var n=Q();fe(t,function(t,n,r){var a=t.event;a._id===e?S(a,n,t):n[0]._fci=r}),T(n,t,S)}function S(t,e,n){N(t)&&R.draggableDayEvent(t,e,n),n.isEnd&&z(t)&&R.resizableDayEvent(t,e,n),L(t,e)}function E(t,e){var n,r=re();e.draggable({delay:50,opacity:k("dragOpacity"),revertDuration:k("dragRevertDuration"),start:function(a,o){F("eventDragStart",e,t,a,o),q(t,e),r.start(function(r,a,o,i){if(e.draggable("option","revert",!r||!o&&!i),ee(),r){var s=ie(a),l=ie(r);n=g(l,s),te(c(v(t.start),n),c(C(t),n))}else n=0},a,"drag")},stop:function(a,o){r.stop(),ee(),F("eventDragStop",e,t,a,o),n?j(this,t,n,0,t.allDay,a,o):(e.css("filter",""),A(t,e))}})}function x(e,n,a){var o=k("isRTL"),i=o?"w":"e",s=n.find(".ui-resizable-"+i),l=!1;Y(n),n.mousedown(function(t){t.preventDefault()}).click(function(t){l&&(t.preventDefault(),t.stopImmediatePropagation())}),s.mousedown(function(o){function s(n){F("eventResizeStop",this,e,n),t("body").css("cursor",""),u.stop(),ee(),f&&B(this,e,f,0,n),setTimeout(function(){l=!1},0)}if(1==o.which){l=!0;var u=re();X(),J();var f,d,v=n.css("top"),h=t.extend({},e),g=de(ce(e.start));ne(),t("body").css("cursor",i+"-resize").one("mouseup",s),F("eventResizeStart",this,e,o),u.start(function(n,o){if(n){var s=se(o),l=se(n);if(l=Math.max(l,g),f=le(l)-le(s)){h.end=c(W(e),f,!0);var u=d;d=r(h,a.row,v),d=t(d),d.find("*").css("cursor",i+"-resize"),u&&u.remove(),q(e)}else d&&(A(e),d.remove(),d=null);ee(),te(e.start,c(C(e),f))}},o)}})}var R=this;R.renderDayEvents=n,R.draggableDayEvent=E,R.resizableDayEvent=x;var k=R.opt,F=R.trigger,N=R.isEventDraggable,z=R.isEventResizable,W=R.eventEnd,O=R.reportEventElement,L=R.eventElementHandlers,A=R.showEvents,q=R.hideEvents,j=R.eventDrop,B=R.eventResize,X=R.getRowCnt,J=R.getColCnt;R.getColWidth;var V=R.allDayRow,G=R.colLeft,U=R.colRight,Z=R.colContentLeft,$=R.colContentRight;R.dateToCell;var Q=R.getDaySegmentContainer,K=R.calendar.formatDates,te=R.renderDayOverlay,ee=R.clearOverlays,ne=R.clearSelection,re=R.getHoverListener,ae=R.rangeToSegments,oe=R.segmentCompare,ie=R.cellToDate,se=R.cellToCellOffset,le=R.cellOffsetToDayOffset,ce=R.dateToDayOffset,de=R.dayOffsetToCellOffset}function ue(t,e){for(var n=0;e.length>n;n++){var r=e[n];if(r.leftCol<=t.rightCol&&r.rightCol>=t.leftCol)return!0}return!1}function fe(t,e){for(var n=0;t.length>n;n++){var r=t[n],a=r.element;a&&e(r,a,n)}}function de(){function e(t,e,a){n(),e||(e=l(t,a)),c(t,e,a),r(t,e,a)}function n(t){f&&(f=!1,u(),s("unselect",null,t))}function r(t,e,n,r){f=!0,s("select",null,t,e,n,r)}function a(e){var a=o.cellToDate,s=o.getIsCellAllDay,l=o.getHoverListener(),f=o.reportDayClick;if(1==e.which&&i("selectable")){n(e);var d;l.start(function(t,e){u(),t&&s(t)?(d=[a(e),a(t)].sort(A),c(d[0],d[1],!0)):d=null},e),t(document).one("mouseup",function(t){l.stop(),d&&(+d[0]==+d[1]&&f(d[0],!0,t),r(d[0],d[1],!0,t))})}}var o=this;o.select=e,o.unselect=n,o.reportSelection=r,o.daySelectionMousedown=a;var i=o.opt,s=o.trigger,l=o.defaultSelectionEnd,c=o.renderSelection,u=o.clearSelection,f=!1;i("selectable")&&i("unselectAuto")&&t(document).mousedown(function(e){var r=i("unselectCancel");r&&t(e.target).parents(r).length||n(e)})}function ve(){function e(e,n){var r=o.shift();return r||(r=t("
")),r[0].parentNode!=n[0]&&r.appendTo(n),a.push(r.css(e).show()),r}function n(){for(var t;t=a.shift();)o.push(t.hide().unbind())}var r=this;r.renderOverlay=e,r.clearOverlays=n;var a=[],o=[]}function he(t){var e,n,r=this;r.build=function(){e=[],n=[],t(e,n)},r.cell=function(t,r){var a,o=e.length,i=n.length,s=-1,l=-1;for(a=0;o>a;a++)if(r>=e[a][0]&&e[a][1]>r){s=a;break}for(a=0;i>a;a++)if(t>=n[a][0]&&n[a][1]>t){l=a;break}return s>=0&&l>=0?{row:s,col:l}:null},r.rect=function(t,r,a,o,i){var s=i.offset();return{top:e[t][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:e[a][1]-e[t][0]}}}function ge(e){function n(t){pe(t);var n=e.cell(t.pageX,t.pageY);(!n!=!i||n&&(n.row!=i.row||n.col!=i.col))&&(n?(o||(o=n),a(n,o,n.row-o.row,n.col-o.col)):a(n,o),i=n)}var r,a,o,i,s=this;s.start=function(s,l,c){a=s,o=i=null,e.build(),n(l),r=c||"mousemove",t(document).bind(r,n)},s.stop=function(){return t(document).unbind(r,n),i}}function pe(t){t.pageX===e&&(t.pageX=t.originalEvent.pageX,t.pageY=t.originalEvent.pageY)}function me(t){function n(e){return a[e]=a[e]||t(e)}var r=this,a={},o={},i={};r.left=function(t){return o[t]=o[t]===e?n(t).position().left:o[t]},r.right=function(t){return i[t]=i[t]===e?r.left(t)+n(t).width():i[t]},r.clear=function(){a={},o={},i={}}}var ye={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '—'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"",next:"",prevYear:"«",nextYear:"»",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0},be={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"",next:"",prevYear:"»",nextYear:"«"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},De=t.fullCalendar={version:"1.6.3"},we=De.views={};t.fn.fullCalendar=function(n){if("string"==typeof n){var a,o=Array.prototype.slice.call(arguments,1); -return this.each(function(){var r=t.data(this,"fullCalendar");if(r&&t.isFunction(r[n])){var i=r[n].apply(r,o);a===e&&(a=i),"destroy"==n&&t.removeData(this,"fullCalendar")}}),a!==e?a:this}var i=n.eventSources||[];return delete n.eventSources,n.events&&(i.push(n.events),delete n.events),n=t.extend(!0,{},ye,n.isRTL||n.isRTL===e&&ye.isRTL?be:{},n),this.each(function(e,a){var o=t(a),s=new r(o,n,i);o.data("fullCalendar",s),s.render()}),this},De.sourceNormalizers=[],De.sourceFetchers=[];var Me={dataType:"json",cache:!1},Ce=1;De.addDays=c,De.cloneDate=v,De.parseDate=m,De.parseISO8601=y,De.parseTime=b,De.formatDate=D,De.formatDates=w;var Se=["sun","mon","tue","wed","thu","fri","sat"],Te=864e5,Ee=36e5,xe=6e4,He={s:function(t){return t.getSeconds()},ss:function(t){return q(t.getSeconds())},m:function(t){return t.getMinutes()},mm:function(t){return q(t.getMinutes())},h:function(t){return t.getHours()%12||12},hh:function(t){return q(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return q(t.getHours())},d:function(t){return t.getDate()},dd:function(t){return q(t.getDate())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return q(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},yy:function(t){return(t.getFullYear()+"").substring(2)},yyyy:function(t){return t.getFullYear()},t:function(t){return 12>t.getHours()?"a":"p"},tt:function(t){return 12>t.getHours()?"am":"pm"},T:function(t){return 12>t.getHours()?"A":"P"},TT:function(t){return 12>t.getHours()?"AM":"PM"},u:function(t){return D(t,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(t){var e=t.getDate();return e>10&&20>e?"th":["st","nd","rd"][e%10-1]||"th"},w:function(t,e){return e.weekNumberCalculation(t)},W:function(t){return M(t)}};De.dateFormatters=He,De.applyAll=X,we.month=V,we.basicWeek=G,we.basicDay=U,n({weekMode:"fixed"}),we.agendaWeek=Q,we.agendaDay=K,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24}),we.resourceDay=oe,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24})})(jQuery); \ No newline at end of file +(function(t,e){function n(e){t.extend(!0,ye,e)}function r(n,r,u){function f(t){se?m()&&(E(),S(t)):d()}function d(){le=r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),r.theme&&n.addClass("ui-widget"),se=t("
").prependTo(n),oe=new a(ne,r),ie=oe.render(),ie&&n.prepend(ie),b(r.defaultView),r.handleWindowResize&&t(window).resize(H),y()||h()}function h(){setTimeout(function(){!ce.start&&y()&&C()},0)}function g(){ce&&(ee("viewDestroy",ce,ce,ce.element),ce.triggerEventDestroy()),t(window).unbind("resize",H),oe.destroy(),se.remove(),n.removeClass("fc fc-rtl ui-widget")}function m(){return n.is(":visible")}function y(){return t("body").is(":visible")}function b(t){ce&&t==ce.name||M(t)}function M(e){ge++,ce&&(ee("viewDestroy",ce,ce,ce.element),Y(),ce.triggerEventDestroy(),$(),ce.element.remove(),oe.deactivateButton(ce.name)),oe.activateButton(e),ce=new we[e](t("
").appendTo(se),ne),C(),Q(),ge--}function C(t){(!ce.start||t||ce.start>pe||pe>=ce.end)&&m()&&S(t)}function S(t){ge++,ce.start&&(ee("viewDestroy",ce,ce,ce.element),Y(),z()),$(),ce.render(pe,t||0),x(),Q(),(ce.afterRender||O)(),q(),j(),ee("viewRender",ce,ce,ce.element),ce.trigger("viewDisplay",ve),ge--,W()}function T(){m()&&(Y(),z(),E(),x(),F())}function E(){fe=r.contentHeight?r.contentHeight:r.height?r.height-(ie?ie.height():0)-N(se):Math.round(se.width()/Math.max(r.aspectRatio,.5))}function x(){fe===e&&E(),ge++,ce.setHeight(fe),ce.setWidth(se.width()),ge--,ue=n.outerWidth()}function H(){if(!ge)if(ce.start){var t=++he;setTimeout(function(){t==he&&!ge&&m()&&ue!=(ue=n.outerWidth())&&(ge++,T(),ce.trigger("windowResize",ve),ge--)},200)}else h()}function R(){z(),L()}function k(t){z(),F(t)}function F(t){m()&&(ce.setEventData(me),ce.renderEvents(me,t),ce.trigger("eventAfterAllRender"))}function z(){ce.triggerEventDestroy(),ce.clearEvents(),ce.clearEventData()}function W(){!r.lazyFetching||re(ce.visStart,ce.visEnd)?L():F()}function L(){ae(ce.visStart,ce.visEnd)}function A(t){me=t,F()}function _(t){k(t)}function q(){oe.updateTitle(ce.title)}function j(){var t=new Date;t>=ce.start&&ce.end>t?oe.disableButton("today"):oe.enableButton("today")}function P(t,n,r){ce.select(t,n,r===e?!0:r)}function Y(){ce&&ce.unselect()}function B(){C(-1)}function I(){C(1)}function X(){s(pe,-1),C()}function J(){s(pe,1),C()}function V(){pe=new Date,C()}function G(t,e,n){t instanceof Date?pe=v(t):p(pe,t,e,n),C()}function U(t,n,r){t!==e&&s(pe,t),n!==e&&l(pe,n),r!==e&&c(pe,r),C()}function Z(){return v(pe)}function $(){se.css({width:"100%",height:se.height(),overflow:"hidden"})}function Q(){se.css({width:"",height:"",overflow:""})}function K(){return ce}function te(t,n){return n===e?r[t]:(("height"==t||"contentHeight"==t||"aspectRatio"==t)&&(r[t]=n,T()),e)}function ee(t,n){return r[t]?r[t].apply(n||ve,Array.prototype.slice.call(arguments,2)):e}var ne=this;ne.options=r,ne.render=f,ne.destroy=g,ne.refetchEvents=R,ne.reportEvents=A,ne.reportEventChange=_,ne.rerenderEvents=k,ne.changeView=b,ne.select=P,ne.unselect=Y,ne.prev=B,ne.next=I,ne.prevYear=X,ne.nextYear=J,ne.today=V,ne.gotoDate=G,ne.incrementDate=U,ne.formatDate=function(t,e){return D(t,e,r)},ne.formatDates=function(t,e,n){return w(t,e,n,r)},ne.getDate=Z,ne.getView=K,ne.option=te,ne.trigger=ee,o.call(ne,r,u);var re=ne.isFetchNeeded,ae=ne.fetchEvents;i.call(ne,r);var oe,ie,se,le,ce,ue,fe,de,ve=n[0],he=0,ge=0,pe=new Date,me=[];p(pe,r.year,r.month,r.date),r.droppable&&t(document).bind("dragstart",function(e,n){var a=e.target,o=t(a);if(!o.parents(".fc").length){var i=r.dropAccept;(t.isFunction(i)?i.call(a,o):o.is(i))&&(de=a,ce.dragStart(de,e,n))}}).bind("dragstop",function(t,e){de&&(ce.dragStop(de,t,e),de=null)})}function a(n,r){function a(){v=r.theme?"ui":"fc";var n=r.header;return n?h=t("").append(t("").append(i("left")).append(i("center")).append(i("right"))):e}function o(){h.remove()}function i(e){var a=t("",fe&&(r+=""),t=0;ne>t;t++)e=Te(0,t),r+="";return r+=""}function f(){var t,e,n,r=ce+"-widget-content",a="";for(a+="",t=0;ee>t;t++){for(a+="",fe&&(n=Te(t,0),a+=""),e=0;ne>e;e++)n=Te(t,e),a+=h(n);a+=""}return a+=""}function h(t){var e=ce+"-widget-content",n=O.start.getMonth(),r=d(new Date),a="",o=["fc-day","fc-"+Se[t.getDay()],e];return t.getMonth()!=n&&o.push("fc-other-month"),+t==+r?o.push("fc-today",ce+"-state-highlight"):r>t?o.push("fc-past"):o.push("fc-future"),a+=""}function g(e){Q=e;var n,r,a,o=Q-_.height();"variable"==be("weekMode")?n=r=Math.floor(o/(1==ee?2:6)):(n=Math.floor(o/ee),r=o-n*(ee-1)),J.each(function(e,o){ee>e&&(a=t(o),a.find("> div").css("min-height",(e==ee-1?r:n)-N(a)))})}function p(t){Z=t,ie.clear(),se.clear(),te=0,fe&&(te=_.find("th.fc-week-number").outerWidth()),K=Math.floor((Z-te)/ne),E(q.slice(0,-1),K)}function m(t){t.click(b).mousedown(Ce)}function b(e){if(!be("selectable")){var n=y(t(this).data("date"));De("dayClick",this,n,!0,e)}}function D(t,e,n){n&&ae.build();for(var r=xe(t,e),a=0;r.length>a;a++){var o=r[a];m(w(o.row,o.leftCol,o.row,o.rightCol))}}function w(t,n,r,a){var o=ae.rect(t,n,r,a,e);return we(o,e)}function M(t){return v(t)}function C(t,e){D(t,c(v(e),1),!0)}function S(){Me()}function T(t,e,n){var r=Ee(t),a=X[r.row*ne+r.col];De("dayClick",a,t,e,n)}function x(t,e){oe.start(function(t){Me(),t&&w(t.row,t.col,t.row,t.col)},e)}function H(t,e,n){var r=oe.stop();if(Me(),r){var a=Te(r);De("drop",t,a,!0,e,n)}}function R(t){return v(t.start)}function k(t){return ie.left(t)}function F(t){return ie.right(t)}function z(t){return se.left(t)}function W(t){return se.right(t)}function L(t){return I.eq(t)}var O=this;O.renderBasic=a,O.setHeight=g,O.setWidth=p,O.renderDayOverlay=D,O.defaultSelectionEnd=M,O.renderSelection=C,O.clearSelection=S,O.reportDayClick=T,O.dragStart=x,O.dragStop=H,O.defaultEventEnd=R,O.getHoverListener=function(){return oe},O.colLeft=k,O.colRight=F,O.colContentLeft=z,O.colContentRight=W,O.getIsCellAllDay=function(){return!0},O.allDayRow=L,O.getRowCnt=function(){return ee},O.getColCnt=function(){return ne},O.getColWidth=function(){return K},O.getDaySegmentContainer=function(){return U},le.call(O,e,n,r),ve.call(O),de.call(O),$.call(O);var A,_,q,j,I,X,J,V,G,U,Z,Q,K,te,ee,ne,re,ae,oe,ie,se,ce,ue,fe,pe,ye,be=O.opt,De=O.trigger,we=O.renderOverlay,Me=O.clearOverlays,Ce=O.daySelectionMousedown,Te=O.cellToDate,Ee=O.dateToCell,xe=O.rangeToSegments,He=n.formatDate;Y(e.addClass("fc-grid")),ae=new he(function(e,n){var r,a,o;q.each(function(e,i){r=t(i),a=r.offset().left,e&&(o[1]=a),o=[a],n[e]=o}),o[1]=a+r.outerWidth(),I.each(function(n,i){ee>n&&(r=t(i),a=r.offset().top,n&&(o[1]=a),o=[a],e[n]=o)}),o[1]=a+r.outerHeight()}),oe=new ge(ae),ie=new me(function(t){return V.eq(t)}),se=new me(function(t){return G.eq(t)})}function $(){function t(t,e){n.renderDayEvents(t,e)}function e(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=t,n.clearEvents=e,ce.call(n)}function Q(t,e){function n(t,e){e&&c(t,7*e);var n=c(v(t),-((t.getDay()-a("firstDay")+7)%7)),u=c(v(n),7),f=v(n);i(f);var d=v(u);i(d,-1,!0);var h=s();r.title=l(f,c(v(d),-1),a("titleFormat")),r.start=n,r.end=u,r.visStart=f,r.visEnd=d,o(h)}var r=this;r.render=n,te.call(r,t,e,"agendaWeek");var a=r.opt,o=r.renderAgenda,i=r.skipHiddenDays,s=r.getCellsPerWeek,l=e.formatDates}function K(t,e){function n(t,e){e&&c(t,e),i(t,0>e?-1:1);var n=v(t,!0),l=c(v(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=l,o(1)}var r=this;r.render=n,te.call(r,t,e,"agendaDay");var a=r.opt,o=r.renderAgenda,i=r.skipHiddenDays,s=e.formatDate}function te(n,r,a){function o(t){Le=t,i(),K?l():s()}function i(){Pe=Ue("theme")?"ui":"fc",Ye=Ue("isRTL"),Be=b(Ue("minTime")),Ie=b(Ue("maxTime")),Xe=Ue("columnFormat"),Je=Ue("weekNumbers"),Ve=Ue("weekNumberTitle"),Ge="iso"!=Ue("weekNumberCalculation")?"w":"W",Ne=Ue("snapMinutes")||Ue("slotMinutes")}function s(){var e,r,a,o,i,s=Pe+"-widget-header",c=Pe+"-widget-content",u=0==Ue("slotMinutes")%15;for(l(),ue=t("
").appendTo(n),Ue("allDaySlot")?(fe=t("
").appendTo(ue),e="
"),o=r.header[e];return o&&t.each(o.split(" "),function(e){e>0&&a.append("");var o;t.each(this.split(","),function(e,i){if("title"==i)a.append("

 

"),o&&o.addClass(v+"-corner-right"),o=null;else{var s;if(n[i]?s=n[i]:we[i]&&(s=function(){u.removeClass(v+"-state-hover"),n.changeView(i)}),s){var l=r.theme?j(r.buttonIcons,i):null,c=j(r.buttonText,i),u=t(""+(l?""+"":c)+"").click(function(){u.hasClass(v+"-state-disabled")||s()}).mousedown(function(){u.not("."+v+"-state-active").not("."+v+"-state-disabled").addClass(v+"-state-down")}).mouseup(function(){u.removeClass(v+"-state-down")}).hover(function(){u.not("."+v+"-state-active").not("."+v+"-state-disabled").addClass(v+"-state-hover")},function(){u.removeClass(v+"-state-hover").removeClass(v+"-state-down")}).appendTo(a);Y(u),o||u.addClass(v+"-corner-left"),o=u}}}),o&&o.addClass(v+"-corner-right")}),a}function s(t){h.find("h2").html(t)}function l(t){h.find("span.fc-button-"+t).addClass(v+"-state-active")}function c(t){h.find("span.fc-button-"+t).removeClass(v+"-state-active")}function u(t){h.find("span.fc-button-"+t).addClass(v+"-state-disabled")}function f(t){h.find("span.fc-button-"+t).removeClass(v+"-state-disabled")}var d=this;d.render=a,d.destroy=o,d.updateTitle=s,d.activateButton=l,d.deactivateButton=c,d.disableButton=u,d.enableButton=f;var v,h=t([])}function o(n,r){function a(t,e){return!S||S>t||e>T}function o(t,e){S=t,T=e,W=[];var n=++F,r=k.length;N=r;for(var a=0;r>a;a++)i(k[a],n)}function i(e,r){s(e,function(a){if(r==F){if(a){n.eventDataTransform&&(a=t.map(a,n.eventDataTransform)),e.eventDataTransform&&(a=t.map(a,e.eventDataTransform));for(var o=0;a.length>o;o++)a[o].source=e,b(a[o]);W=W.concat(a)}N--,N||H(W)}})}function s(r,a){var o,i,l=De.sourceFetchers;for(o=0;l.length>o;o++){if(i=l[o](r,S,T,a),i===!0)return;if("object"==typeof i)return s(i,a),e}var c=r.events;if(c)t.isFunction(c)?(p(),c(v(S),v(T),function(t){a(t),y()})):t.isArray(c)?a(c):a();else{var u=r.url;if(u){var f,d=r.success,h=r.error,g=r.complete;f=t.isFunction(r.data)?r.data():r.data;var m=t.extend({},f||{}),b=J(r.startParam,n.startParam),D=J(r.endParam,n.endParam);b&&(m[b]=Math.round(+S/1e3)),D&&(m[D]=Math.round(+T/1e3)),p(),t.ajax(t.extend({},Me,r,{data:m,success:function(e){e=e||[];var n=X(d,this,arguments);t.isArray(n)&&(e=n),a(e)},error:function(){X(h,this,arguments),a()},complete:function(){X(g,this,arguments),y()}}))}else a()}}function l(t){t=c(t),t&&(N++,i(t,F))}function c(n){return t.isFunction(n)||t.isArray(n)?n={events:n}:"string"==typeof n&&(n={url:n}),"object"==typeof n?(D(n),k.push(n),n):e}function u(e){k=t.grep(k,function(t){return!w(t,e)}),W=t.grep(W,function(t){return!w(t.source,e)}),H(W)}function f(t){var e,n,r=W.length,a=x().defaultEventEnd,o=t.start-t._start,i=t.end?t.end-(t._end||a(t)):0;for(e=0;r>e;e++)n=W[e],n._id==t._id&&n!=t&&(n.start=new Date(+n.start+o),n.end=t.end?n.end?new Date(+n.end+i):new Date(+a(n)+i):null,n.title=t.title,n.url=t.url,n.allDay=t.allDay,n.className=t.className,n.editable=t.editable,n.color=t.color,n.backgroundColor=t.backgroundColor,n.borderColor=t.borderColor,n.textColor=t.textColor,b(n));b(t),H(W)}function d(t,e){b(t),t.source||(e&&(R.events.push(t),t.source=R),W.push(t)),H(W)}function h(e){if(e){if(!t.isFunction(e)){var n=e+"";e=function(t){return t._id==n}}W=t.grep(W,e,!0);for(var r=0;k.length>r;r++)t.isArray(k[r].events)&&(k[r].events=t.grep(k[r].events,e,!0))}else{W=[];for(var r=0;k.length>r;r++)t.isArray(k[r].events)&&(k[r].events=[])}H(W)}function g(e){return t.isFunction(e)?t.grep(W,e):e?(e+="",t.grep(W,function(t){return t._id==e})):W}function p(){z++||E("loading",null,!0)}function y(){--z||E("loading",null,!1)}function b(t){var r=t.source||{},a=J(r.ignoreTimezone,n.ignoreTimezone);t._id=t._id||(t.id===e?"_fc"+Ce++:t.id+""),t.date&&(t.start||(t.start=t.date),delete t.date),t._start=v(t.start=m(t.start,a)),t.end=m(t.end,a),t.end&&t.end<=t.start&&(t.end=null),t._end=t.end?v(t.end):null,t.allDay===e&&(t.allDay=J(r.allDayDefault,n.allDayDefault)),t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[],t.resources?"string"==typeof t.resources&&(t.resources=t.resources.split(/\s+/)):t.resources=[]}function D(t){t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[];for(var e=De.sourceNormalizers,n=0;e.length>n;n++)e[n](t)}function w(t,e){return t&&e&&M(t)==M(e)}function M(t){return("object"==typeof t?t.events||t.url:"")||t}var C=this;C.isFetchNeeded=a,C.fetchEvents=o,C.addEventSource=l,C.removeEventSource=u,C.updateEvent=f,C.renderEvent=d,C.removeEvents=h,C.clientEvents=g,C.normalizeEvent=b;for(var S,T,E=C.trigger,x=C.getView,H=C.reportEvents,R={events:[]},k=[R],F=0,N=0,z=0,W=[],L=0;r.length>L;L++)c(r[L])}function i(n){function r(n){c=[];var r;if(t.isFunction(n))r={resources:n},c.push(r),l=e;else if("string"==typeof n)r={url:n},c.push(r),l=e;else if("object"==typeof n&&null!=n){for(var a=0;n.length>a;a++){var o=n[a];i(o),r={resources:o},c.push(r)}l=e}}function a(t,n){if(t=t!==e?t:!0,l!=e&&t)return l;l=[];for(var r=c.length,a=0;r>a;a++){var i=o(c[a],n);l=l.concat(i)}return l}function o(e,r){var a=e.resources;if(a){if(t.isFunction(a))return a()}else{var o=e.url;if(o){var i={};if("object"==typeof r){var s=n.startParam,l=n.endParam;s&&(i[s]=Math.round(+r.visStart/1e3)),l&&(i[l]=Math.round(+r.visEnd/1e3))}t.ajax(t.extend({},e,{data:i,dataType:"json",cache:!1,success:function(t){t=t||[],a=t},error:function(){alert("ajax error getting json from "+o)},async:!1}))}}return a}function i(t){t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[];for(var e=De.sourceNormalizers,n=0;e.length>n;n++)e[n](t)}var s=this;s.fetchResources=a,s.setResources=r;var l,c=[];r(n.resources)}function s(t,e,n){return t.setFullYear(t.getFullYear()+e),n||d(t),t}function l(t,e,n){if(+t){var r=t.getMonth()+e,a=v(t);for(a.setDate(1),a.setMonth(r),t.setMonth(r),n||d(t);t.getMonth()!=a.getMonth();)t.setDate(t.getDate()+(a>t?1:-1))}return t}function c(t,e,n){if(+t){var r=t.getDate()+e,a=v(t);a.setHours(9),a.setDate(r),t.setDate(r),n||d(t),u(t,a)}return t}function u(t,e){if(+t)for(;t.getDate()!=e.getDate();)t.setTime(+t+(e>t?1:-1)*Ee)}function f(t,e){return t.setMinutes(t.getMinutes()+e),t}function d(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}function v(t,e){return e?d(new Date(+t)):new Date(+t)}function h(){var t,e=0;do t=new Date(1970,e++,1);while(t.getHours());return t}function g(t,e){return Math.round((v(t,!0)-v(e,!0))/Te)}function p(t,n,r,a){n!==e&&n!=t.getFullYear()&&(t.setDate(1),t.setMonth(0),t.setFullYear(n)),r!==e&&r!=t.getMonth()&&(t.setDate(1),t.setMonth(r)),a!==e&&t.setDate(a)}function m(t,n){return"object"==typeof t?t:"number"==typeof t?new Date(1e3*t):"string"==typeof t?t.match(/^\d+(\.\d+)?$/)?new Date(1e3*parseFloat(t)):(n===e&&(n=!0),y(t,n)||(t?new Date(t):null)):null}function y(t,e){var n=t.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!n)return null;var r=new Date(n[1],0,1);if(e||!n[13]){var a=new Date(n[1],0,1,9,0);n[3]&&(r.setMonth(n[3]-1),a.setMonth(n[3]-1)),n[5]&&(r.setDate(n[5]),a.setDate(n[5])),u(r,a),n[7]&&r.setHours(n[7]),n[8]&&r.setMinutes(n[8]),n[10]&&r.setSeconds(n[10]),n[12]&&r.setMilliseconds(1e3*Number("0."+n[12])),u(r,a)}else if(r.setUTCFullYear(n[1],n[3]?n[3]-1:0,n[5]||1),r.setUTCHours(n[7]||0,n[8]||0,n[10]||0,n[12]?1e3*Number("0."+n[12]):0),n[14]){var o=60*Number(n[16])+(n[18]?Number(n[18]):0);o*="-"==n[15]?1:-1,r=new Date(+r+1e3*60*o)}return r}function b(t){if("number"==typeof t)return 60*t;if("object"==typeof t)return 60*t.getHours()+t.getMinutes();var e=t.match(/(\d+)(?::(\d+))?\s*(\w+)?/);if(e){var n=parseInt(e[1],10);return e[3]&&(n%=12,"p"==e[3].toLowerCase().charAt(0)&&(n+=12)),60*n+(e[2]?parseInt(e[2],10):0)}}function D(t,e,n){return w(t,null,e,n)}function w(t,e,n,r){r=r||ye;var a,o,i,s,l=t,c=e,u=n.length,f="";for(a=0;u>a;a++)if(o=n.charAt(a),"'"==o){for(i=a+1;u>i;i++)if("'"==n.charAt(i)){l&&(f+=i==a+1?"'":n.substring(a+1,i),a=i);break}}else if("("==o){for(i=a+1;u>i;i++)if(")"==n.charAt(i)){var d=D(l,n.substring(a+1,i),r);parseInt(d.replace(/\D/,""),10)&&(f+=d),a=i;break}}else if("["==o){for(i=a+1;u>i;i++)if("]"==n.charAt(i)){var v=n.substring(a+1,i),d=D(l,v,r);d!=D(c,v,r)&&(f+=d),a=i;break}}else if("{"==o)l=e,c=t;else if("}"==o)l=t,c=e;else{for(i=u;i>a;i--)if(s=He[n.substring(a,i)]){l&&(f+=s(l,r)),a=i-1;break}i==a&&l&&(f+=o)}return f}function M(t){var e,n=new Date(t.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1}function C(t){return t.end?S(t.end,t.allDay):c(v(t.start),1)}function S(t,e){return t=v(t),e||t.getHours()||t.getMinutes()?c(t,1):d(t)}function T(n,r,a){n.unbind("mouseover").mouseover(function(n){for(var o,i,s,l=n.target;l!=this;)o=l,l=l.parentNode;(i=o._fci)!==e&&(o._fci=e,s=r[i],a(s.event,s.element,s),t(n.target).trigger(n)),n.stopPropagation()})}function E(e,n,r){for(var a,o=0;e.length>o;o++)a=t(e[o]),a.width(Math.max(0,n-H(a,r)))}function x(e,n,r){for(var a,o=0;e.length>o;o++)a=t(e[o]),a.height(Math.max(0,n-N(a,r)))}function H(t,e){return R(t)+F(t)+(e?k(t):0)}function R(e){return(parseFloat(t.css(e[0],"paddingLeft",!0))||0)+(parseFloat(t.css(e[0],"paddingRight",!0))||0)}function k(e){return(parseFloat(t.css(e[0],"marginLeft",!0))||0)+(parseFloat(t.css(e[0],"marginRight",!0))||0)}function F(e){return(parseFloat(t.css(e[0],"borderLeftWidth",!0))||0)+(parseFloat(t.css(e[0],"borderRightWidth",!0))||0)}function N(t,e){return z(t)+L(t)+(e?W(t):0)}function z(e){return(parseFloat(t.css(e[0],"paddingTop",!0))||0)+(parseFloat(t.css(e[0],"paddingBottom",!0))||0)}function W(e){return(parseFloat(t.css(e[0],"marginTop",!0))||0)+(parseFloat(t.css(e[0],"marginBottom",!0))||0)}function L(e){return(parseFloat(t.css(e[0],"borderTopWidth",!0))||0)+(parseFloat(t.css(e[0],"borderBottomWidth",!0))||0)}function O(){}function A(t,e){return t-e}function _(t){return Math.max.apply(Math,t)}function q(t){return(10>t?"0":"")+t}function j(t,n){if(t[n]!==e)return t[n];for(var r,a=n.split(/(?=[A-Z])/),o=a.length-1;o>=0;o--)if(r=t[a[o].toLowerCase()],r!==e)return r;return t[""]}function P(t){return t.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function Y(t){t.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function B(t){t.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function I(t,e){var n=t.source||{},r=t.color,a=n.color,o=e("eventColor"),i=t.backgroundColor||r||n.backgroundColor||a||e("eventBackgroundColor")||o,s=t.borderColor||r||n.borderColor||a||e("eventBorderColor")||o,l=t.textColor||n.textColor||e("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function X(e,n,r){if(t.isFunction(e)&&(e=[e]),e){var a,o;for(a=0;e.length>a;a++)o=e[a].apply(n,r)||o;return o}}function J(){for(var t=0;arguments.length>t;t++)if(arguments[t]!==e)return arguments[t]}function V(t,e){function n(t,e){e&&(l(t,e),t.setDate(1));var n=a("firstDay"),f=v(t,!0);f.setDate(1);var d=l(v(f),1),h=v(f);c(h,-((h.getDay()-n+7)%7)),i(h);var p=v(d);c(p,(7-p.getDay()+n)%7),i(p,-1,!0);var m=s(),y=Math.round(g(p,h)/7);"fixed"==a("weekMode")&&(c(p,7*(6-y)),y=6),r.title=u(f,a("titleFormat")),r.start=f,r.end=d,r.visStart=h,r.visEnd=p,o(y,m,!0)}var r=this;r.render=n,Z.call(r,t,e,"month");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=r.getCellsPerWeek,u=e.formatDate}function G(t,e){function n(t,e){e&&c(t,7*e);var n=c(v(t),-((t.getDay()-a("firstDay")+7)%7)),u=c(v(n),7),f=v(n);i(f);var d=v(u);i(d,-1,!0);var h=s();r.start=n,r.end=u,r.visStart=f,r.visEnd=d,r.title=l(f,c(v(d),-1),a("titleFormat")),o(1,h,!1)}var r=this;r.render=n,Z.call(r,t,e,"basicWeek");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=r.getCellsPerWeek,l=e.formatDates}function U(t,e){function n(t,e){e&&c(t,e),i(t,0>e?-1:1);var n=v(t,!0),l=c(v(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=l,o(1,1,!1)}var r=this;r.render=n,Z.call(r,t,e,"basicDay");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=e.formatDate}function Z(e,n,r){function a(t,e,n){ee=t,ne=e,re=n,o(),j||i(),s()}function o(){ce=be("theme")?"ui":"fc",ue=be("columnFormat"),fe=be("weekNumbers"),pe=be("weekNumberTitle"),ye="iso"!=be("weekNumberCalculation")?"w":"W"}function i(){U=t("
").appendTo(e)}function s(){var n=l();A&&A.remove(),A=t(n).appendTo(e),_=A.find("thead"),q=_.find(".fc-day-header"),j=A.find("tbody"),I=j.find("tr"),X=j.find(".fc-day"),J=I.find("td:first-child"),V=I.eq(0).find(".fc-day > div"),G=I.eq(0).find(".fc-day-content > div"),B(_.add(_.find("tr"))),B(I),I.eq(0).addClass("fc-first"),I.filter(":last").addClass("fc-last"),X.each(function(e,n){var r=Te(Math.floor(e/ne),e%ne);De("dayRender",O,r,t(n))}),m(X)}function l(){var t=""+u()+f()+"
";return t}function u(){var t,e,n=ce+"-widget-header",r="";for(r+="
"+P(pe)+""+P(He(e,ue))+"
"+"
"+P(He(n,ye))+"
"+"
"+"
",re&&(a+="
"+t.getDate()+"
"),a+="
 
"+""+""+""+"
"+Ue("allDayText")+""+"
"+"
 
",pe=t(e).appendTo(ue),ye=pe.find("tr"),M(ye.find("td")),ue.append("
"+"
"+"
")):fe=t([]),be=t("
").appendTo(ue),De=t("
").appendTo(be),we=t("
").appendTo(De),e="",r=h(),o=f(v(r),Ie),f(r,Be),Oe=0,a=0;o>r;a++)i=r.getMinutes(),e+=""+""+""+"",f(r,Ue("slotMinutes")),Oe++;e+="
"+(u&&i?" ":sn(r,Ue("axisFormat")))+""+"
 
"+"
",Me=t(e).appendTo(De),Ce=Me.find("div:first"),C(Me.find("td"))}function l(){var e=u();K&&K.remove(),K=t(e).appendTo(n),te=K.find("thead"),ne=te.find("th").slice(1,-1),re=K.find("tbody"),ae=re.find("td").slice(0,-1),oe=ae.find("> div"),ie=ae.find(".fc-day-content > div"),se=ae.eq(0),ce=oe.eq(0),B(te.add(te.find("tr"))),B(re.add(re.find("tr")))}function u(){var t=""+g()+p()+"
";return t}function g(){var t,e,n,r=Pe+"-widget-header",a="";for(a+="",Je?(e=sn(t,Ge),Ye?e+=Ve:e=Ve+e,a+=""+P(e)+""):a+=" ",n=0;Le>n;n++)t=rn(0,n),a+=""+P(sn(t,Xe))+"";return a+=" "+""+""}function p(){var t,e,n,r,a,o=Pe+"-widget-header",i=Pe+"-widget-content",s=d(new Date),l="";for(l+=" ",n="",e=0;Le>e;e++)t=rn(0,e),a=["fc-col"+e,"fc-"+Se[t.getDay()],i],+t==+s?a.push(Pe+"-state-highlight","fc-today"):s>t?a.push("fc-past"):a.push("fc-future"),r=""+"
"+"
"+"
 
"+"
"+"
"+"",n+=r;return l+=n,l+=" "+""+""}function m(t){t===e&&(t=xe),xe=t,ln={};var n=re.position().top,r=be.position().top,a=Math.min(t-n,Me.height()+r+1);ce.height(a-N(se)),ue.css("top",n),be.height(a-r-1),Fe=Ce.height()+1,ze=Ue("slotMinutes")/Ne,We=Fe/ze}function y(e){Ee=e,qe.clear(),je.clear();var n=te.find("th:first");pe&&(n=n.add(pe.find("th:first"))),n=n.add(Me.find("th:first")),He=0,E(n.width("").each(function(e,n){He=Math.max(He,t(n).outerWidth())}),He);var r=K.find(".fc-agenda-gutter");pe&&(r=r.add(pe.find("th.fc-agenda-gutter")));var a=be[0].clientWidth;ke=be.width()-a,ke?(E(r,ke),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),Re=Math.floor((a-He)/Le),E(ne.slice(0,-1),Re)}function D(){function t(){be.scrollTop(r)}var e=h(),n=v(e);n.setHours(Ue("firstHour"));var r=_(e,n)+1;t(),setTimeout(t,0)}function w(){D()}function M(t){t.click(S).mousedown(en)}function C(t){t.click(S).mousedown(G)}function S(t){if(!Ue("selectable")){var e=Math.min(Le-1,Math.floor((t.pageX-K.offset().left-He)/Re)),n=rn(0,e),r=this.parentNode.className.match(/fc-slot(\d+)/);if(r){var a=parseInt(r[1])*Ue("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+Be),Ze("dayClick",ae[e],n,!1,t)}else Ze("dayClick",ae[e],n,!0,t)}}function T(t,e,n){n&&Ae.build();for(var r=on(t,e),a=0;r.length>a;a++){var o=r[a];M(H(o.row,o.leftCol,o.row,o.rightCol))}}function H(t,e,n,r){var a=Ae.rect(t,e,n,r,ue);return $e(a,ue)}function R(t,e){for(var n=0;Le>n;n++){var r=rn(0,n),a=c(v(r),1),o=new Date(Math.max(r,t)),i=new Date(Math.min(a,e));if(i>o){var s=Ae.rect(0,n,0,n,De),l=_(r,o),u=_(r,i);s.top=l,s.height=u-l,C($e(s,De))}}}function k(t){return qe.left(t)}function F(t){return je.left(t)}function z(t){return qe.right(t)}function W(t){return je.right(t)}function L(t){return Ue("allDaySlot")&&!t.row}function O(t){var e=rn(0,t.col),n=t.row;return Ue("allDaySlot")&&n--,n>=0&&f(e,Be+n*Ne),e}function _(t,n){if(t=v(t,!0),f(v(t),Be)>n)return 0;if(n>=f(v(t),Ie))return Me.height();var r=Ue("slotMinutes"),a=60*n.getHours()+n.getMinutes()-Be,o=Math.floor(a/r),i=ln[o];return i===e&&(i=ln[o]=Me.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+Fe*(a%r/r)))}function q(){return ye}function j(t){var e=v(t.start);return t.allDay?e:f(e,Ue("defaultEventMinutes"))}function I(t,e){return e?v(t):f(v(t),Ue("slotMinutes"))}function X(t,e,n){n?Ue("allDaySlot")&&T(t,c(v(e),1),!0):J(t,e)}function J(e,n){var r=Ue("selectHelper");if(Ae.build(),r){var a=an(e).col;if(a>=0&&Le>a){var o=Ae.rect(0,a,0,a,De),i=_(e,e),s=_(e,n);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(r)){var l=r(e,n);l&&(o.position="absolute",Te=t(l).css(o).appendTo(De))}else o.isStart=!0,o.isEnd=!0,Te=t(nn({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o)),Te.css("opacity",Ue("dragOpacity"));Te&&(C(Te),De.append(Te),E(Te,o.width,!0),x(Te,o.height,!0))}}}else R(e,n)}function V(){Qe(),Te&&(Te.remove(),Te=null)}function G(e){if(1==e.which&&Ue("selectable")){tn(e);var n;_e.start(function(t,e){if(V(),t&&t.col==e.col&&!L(t)){var r=O(e),a=O(t);n=[r,f(v(r),Ne),a,f(v(a),Ne)].sort(A),J(n[0],n[3])}else n=null},e),t(document).one("mouseup",function(t){_e.stop(),n&&(+n[0]==+n[1]&&U(n[0],!1,t),Ke(n[0],n[3],!1,t))})}}function U(t,e,n){Ze("dayClick",ae[an(t).col],t,e,n)}function Z(t,e){_e.start(function(t){if(Qe(),t)if(L(t))H(t.row,t.col,t.row,t.col);else{var e=O(t),n=f(v(e),Ue("defaultEventMinutes"));R(e,n)}},e)}function $(t,e,n){var r=_e.stop();Qe(),r&&Ze("drop",t,O(r),L(r),e,n)}var Q=this;Q.renderAgenda=o,Q.setWidth=y,Q.setHeight=m,Q.afterRender=w,Q.defaultEventEnd=j,Q.timePosition=_,Q.getIsCellAllDay=L,Q.allDayRow=q,Q.getCoordinateGrid=function(){return Ae},Q.getHoverListener=function(){return _e},Q.colLeft=k,Q.colRight=z,Q.colContentLeft=F,Q.colContentRight=W,Q.getDaySegmentContainer=function(){return fe},Q.getSlotSegmentContainer=function(){return we},Q.getMinMinute=function(){return Be},Q.getMaxMinute=function(){return Ie},Q.getSlotContainer=function(){return De},Q.getRowCnt=function(){return 1},Q.getColCnt=function(){return Le},Q.getColWidth=function(){return Re},Q.getSnapHeight=function(){return We},Q.getSnapMinutes=function(){return Ne},Q.defaultSelectionEnd=I,Q.renderDayOverlay=T,Q.renderSelection=X,Q.clearSelection=V,Q.reportDayClick=U,Q.dragStart=Z,Q.dragStop=$,le.call(Q,n,r,a),ve.call(Q),de.call(Q),ee.call(Q);var K,te,ne,re,ae,oe,ie,se,ce,ue,fe,pe,ye,be,De,we,Me,Ce,Te,Ee,xe,He,Re,ke,Fe,Ne,ze,We,Le,Oe,Ae,_e,qe,je,Pe,Ye,Be,Ie,Xe,Je,Ve,Ge,Ue=Q.opt,Ze=Q.trigger,$e=Q.renderOverlay,Qe=Q.clearOverlays,Ke=Q.reportSelection,tn=Q.unselect,en=Q.daySelectionMousedown,nn=Q.slotSegHtml,rn=Q.cellToDate,an=Q.dateToCell,on=Q.rangeToSegments,sn=r.formatDate,ln={};Y(n.addClass("fc-agenda")),Ae=new he(function(e,n){function r(t){return Math.max(l,Math.min(c,t))}var a,o,i;ne.each(function(e,r){a=t(r),o=a.offset().left,e&&(i[1]=o),i=[o],n[e]=i}),i[1]=o+a.outerWidth(),Ue("allDaySlot")&&(a=ye,o=a.offset().top,e[0]=[o,o+a.outerHeight()]);for(var s=De.offset().top,l=be.offset().top,c=l+be.outerHeight(),u=0;Oe*ze>u;u++)e.push([r(s+We*u),r(s+We*(u+1))])}),_e=new ge(Ae),qe=new me(function(t){return oe.eq(t)}),je=new me(function(t){return ie.eq(t)})}function ee(){function n(t,e){var n,r=t.length,o=[],i=[];for(n=0;r>n;n++)t[n].allDay?o.push(t[n]):i.push(t[n]);y("allDaySlot")&&(ee(o,e),E()),s(a(i),e)}function r(){R().empty(),k().empty()}function a(e){var n,r,a,s,l,c,u,d=Y(),h=W(),g=z(),p=t.map(e,i),m=[];for(r=0;d>r;r++)for(n=q(0,r),f(n,h),a=ne(o(e,p,n,f(v(n),g-h))),re(a),s=0;a.length>s;s++)for(l=a[s],c=0;l.length>c;c++)u=l[c],u.col=r,u.level=s,m.push(u);return m}function o(t,e,n,r){var a,o,i,s,l,c,u,f,d=[],h=t.length;for(a=0;h>a;a++)o=t[a],i=o.start,s=e[a],s>n&&r>i&&(n>i?(l=v(n),u=!1):(l=i,u=!0),s>r?(c=v(r),f=!1):(c=s,f=!0),d.push({event:o,start:l,end:c,isStart:u,isEnd:f,msLength:c-l}));return d.sort(j)}function i(t){return t.end?v(t.end):f(v(t.start),y("defaultEventMinutes"))}function s(n,r){var a,o,i,s,c,f,d,v,h,g,p,m,D,w,M,C,S,E,x,R=n.length,F="",z=k();for(x=(E=y("isRTL"))?-1:1,a=0;R>a;a++)o=n[a],i=o.event,s=L(o.start,o.start),c=L(o.start,o.end),f=o.col,d=o.level,v=o.forward||0,h=A(f),g=_(f)-h,g=Math.min(g-6,.95*g),p=d?g/(d+v+1):v?2*(g/(v+1)-6):g,m=h+g/(d+v+1)*d*x+(E?g-p:0),o.top=s,o.left=m,o.outerWidth=p,o.outerHeight=c-s,F+=l(i,o);for(z[0].innerHTML=F,D=z.children(),a=0;R>a;a++)o=n[a],i=o.event,w=t(D[a]),M=b("eventRender",i,i,w),M===!1?w.remove():(M&&M!==!0&&(w.remove(),w=t(M).css({position:"absolute",top:o.top,left:o.left}).appendTo(z)),o.element=w,i._id===r?u(i,w,o):w[0]._fci=a,G(i,w));for(T(z,n,u),a=0;R>a;a++)o=n[a],(w=o.element)&&(o.vsides=N(w,!0),o.hsides=H(w,!0),C=w.find(".fc-event-title"),C.length&&(o.contentTop=C[0].offsetTop));for(a=0;R>a;a++)o=n[a],(w=o.element)&&(w[0].style.width=Math.max(0,o.outerWidth-o.hsides)+"px",S=Math.max(0,o.outerHeight-o.vsides),w[0].style.height=S+"px",i=o.event,o.contentTop!==e&&10>S-o.contentTop&&(w.find("div.fc-event-time").text(oe(i.start,y("timeFormat"))+" - "+i.title),w.find("div.fc-event-title").remove()),b("eventAfterRender",i,i,w))}function l(t,e){var n="<",r=t.url,a=I(t,y),o=["fc-event","fc-event-vert"];return D(t)&&o.push("fc-event-draggable"),e.isStart&&o.push("fc-event-start"),e.isEnd&&o.push("fc-event-end"),o=o.concat(t.className),t.source&&(o=o.concat(t.source.className||[])),n+=r?"a href='"+P(t.url)+"'":"div",n+=" class='"+o.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+e.top+"px;"+"left:"+e.left+"px;"+a+"'"+">"+"
"+"
"+P(ie(t.start,t.end,y("timeFormat")))+"
"+"
"+P(t.title||"")+"
"+"
"+"
",e.isEnd&&w(t)&&(n+="
=
"),n+="" +}function u(t,e,n){var r=e.find("div.fc-event-time");D(t)&&h(t,e,r),n.isEnd&&w(t)&&p(t,e,r),S(t,e)}function d(t,e,n){function r(){l||(e.width(a).height("").draggable("option","grid",null),l=!0)}var a,o,i,s=n.isStart,l=!0,u=F(),f=B(),d=X(),h=J(),p=W();e.draggable({opacity:y("dragOpacity","month"),revertDuration:y("dragRevertDuration"),start:function(n,p){b("eventDragStart",e,t,n,p),Z(t,e),a=e.width(),u.start(function(n,a){if(te(),n){o=!1;var u=q(0,a.col),p=q(0,n.col);i=g(p,u),n.row?s?l&&(e.width(f-10),x(e,d*Math.round((t.end?(t.end-t.start)/xe:y("defaultEventMinutes"))/h)),e.draggable("option","grid",[f,1]),l=!1):o=!0:(K(c(v(t.start),i),c(C(t),i)),r()),o=o||l&&!i}else r(),o=!0;e.draggable("option","revert",o)},n,"drag")},stop:function(n,a){if(u.stop(),te(),b("eventDragStop",e,t,n,a),o)r(),e.css("filter",""),U(t,e);else{var s=0;l||(s=Math.round((e.offset().top-V().offset().top)/d)*h+p-(60*t.start.getHours()+t.start.getMinutes())),$(this,t,i,s,l,n,a)}}})}function h(t,e,n){function r(){te(),s&&(u?(n.hide(),e.draggable("option","grid",null),K(c(v(t.start),D),c(C(t),D))):(a(w),n.css("display",""),e.draggable("option","grid",[E,x])))}function a(e){var r,a=f(v(t.start),e);t.end&&(r=f(v(t.end),e)),n.text(ie(a,r,y("timeFormat")))}var o,i,s,l,u,d,h,p,D,w,M,S=m.getCoordinateGrid(),T=Y(),E=B(),x=X(),H=J();e.draggable({scroll:!1,grid:[E,x],axis:1==T?"y":!1,opacity:y("dragOpacity"),revertDuration:y("dragRevertDuration"),start:function(n,r){b("eventDragStart",e,t,n,r),Z(t,e),S.build(),o=e.position(),i=S.cell(n.pageX,n.pageY),s=l=!0,u=d=O(i),h=p=0,D=0,w=M=0},drag:function(t,n){var a=S.cell(t.pageX,t.pageY);if(s=!!a){if(u=O(a),h=Math.round((n.position.left-o.left)/E),h!=p){var c=q(0,i.col),f=i.col+h;f=Math.max(0,f),f=Math.min(T-1,f);var v=q(0,f);D=g(v,c)}u||(w=Math.round((n.position.top-o.top)/x)*H)}(s!=l||u!=d||h!=p||w!=M)&&(r(),l=s,d=u,p=h,M=w),e.draggable("option","revert",!s)},stop:function(n,a){te(),b("eventDragStop",e,t,n,a),s&&(u||D||w)?$(this,t,D,u?0:w,u,n,a):(s=!0,u=!1,h=0,D=0,w=0,r(),e.css("filter",""),e.css(o),U(t,e))}})}function p(t,e,n){var r,a,o=X(),i=J();e.resizable({handles:{s:".ui-resizable-handle"},grid:o,start:function(n,o){r=a=0,Z(t,e),b("eventResizeStart",this,t,n,o)},resize:function(s,l){r=Math.round((Math.max(o,e.height())-l.originalSize.height)/o),r!=a&&(n.text(ie(t.start,r||t.end?f(M(t),i*r):null,y("timeFormat"))),a=r)},stop:function(n,a){b("eventResizeStop",this,t,n,a),r?Q(this,t,0,i*r,n,a):U(t,e)}})}var m=this;m.renderEvents=n,m.clearEvents=r,m.slotSegHtml=l,ce.call(m);var y=m.opt,b=m.trigger,D=m.isEventDraggable,w=m.isEventResizable,M=m.eventEnd,S=m.eventElementHandlers,E=m.setHeight,R=m.getDaySegmentContainer,k=m.getSlotSegmentContainer,F=m.getHoverListener,z=m.getMaxMinute,W=m.getMinMinute,L=m.timePosition,O=m.getIsCellAllDay,A=m.colContentLeft,_=m.colContentRight,q=m.cellToDate,j=m.segmentCompare,Y=m.getColCnt,B=m.getColWidth,X=m.getSnapHeight,J=m.getSnapMinutes,V=m.getSlotContainer,G=m.reportEventElement,U=m.showEvents,Z=m.hideEvents,$=m.eventDrop,Q=m.eventResize,K=m.renderDayOverlay,te=m.clearOverlays,ee=m.renderDayEvents,ae=m.calendar,oe=ae.formatDate,ie=ae.formatDates;m.draggableDayEvent=d}function ne(t){var e,n,r,a,o,i=[],s=t.length;for(e=0;s>e;e++){for(n=t[e],r=0;;){if(a=!1,i[r])for(o=0;i[r].length>o;o++)if(ae(i[r][o],n)){a=!0;break}if(!a)break;r++}i[r]?i[r].push(n):i[r]=[n]}return i}function re(t){var e,n,r,a,o,i;for(e=t.length-1;e>0;e--)for(a=t[e],n=0;a.length>n;n++)for(o=a[n],r=0;t[e-1].length>r;r++)i=t[e-1][r],ae(o,i)&&(i.forward=Math.max(i.forward||0,(o.forward||0)+1))}function ae(t,e){return t.end>e.start&&t.starte?-1:1);var n=v(t,!0),u=c(v(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=u,o(l().length)}var r=this;r.render=n,ie.call(r,t,e,"resourceDay");var a=r.opt,o=r.renderResource,i=r.skipHiddenDays,s=e.formatDate,l=r.getResources}function ie(n,r,a){function o(t){Ie=t,i(),fe?l():s()}function i(){Ze=te("theme")?"ui":"fc",$e=te("isRTL"),Qe=b(te("minTime")),Ke=b(te("maxTime")),tn=te("columnFormat"),en=te("weekNumbers"),nn=te("weekNumberTitle"),rn="iso"!=te("weekNumberCalculation")?"w":"W",Pe=te("snapMinutes")||te("slotMinutes")}function s(){var e,r,a,o,i,s=Ze+"-widget-header",c=Ze+"-widget-content",u=0==te("slotMinutes")%15;for(l(),Te=t("
").appendTo(n),te("allDaySlot")?(Ee=t("
").appendTo(Te),e=""+""+""+""+"
"+te("allDayText")+""+"
"+"
 
",xe=t(e).appendTo(Te),He=xe.find("tr"),M(He.find("td")),Te.append("
"+"
"+"
")):Ee=t([]),Re=t("
").appendTo(Te),ke=t("
").appendTo(Re),Fe=t("
").appendTo(ke),e="",r=h(),o=f(v(r),Ke),f(r,Qe),Xe=0,a=0;o>r;a++)i=r.getMinutes(),e+=""+""+""+"",f(r,te("slotMinutes")),Xe++;e+="
"+(u&&i?" ":an(r,te("axisFormat")))+""+"
 
"+"
",Ne=t(e).appendTo(ke),ze=Ne.find("div:first"),C(Ne.find("td"))}function l(){var e=u();fe&&fe.remove(),fe=t(e).appendTo(n),pe=fe.find("thead"),ye=pe.find("th").slice(1,-1),be=fe.find("tbody"),De=be.find("td").slice(0,-1),we=De.find("> div"),Me=De.find(".fc-day-content > div"),Ce=De.eq(0),Se=we.eq(0),B(pe.add(pe.find("tr"))),B(be.add(be.find("tr")))}function u(){var t=""+g()+p()+"
";return t}function g(){var t,e,n,r=Ze+"-widget-header",a="";for(a+="",en?(e=an(t,rn),$e?e+=nn:e=nn+e,a+=""+P(e)+""):a+=" ",n=0;Ie>n;n++){var o=["fc-col"+n,sn()[n].className,r];a+=""+P(sn()[n].name)+""}return a+=" "+""+""}function p(){var t,e,n,r,a,o=Ze+"-widget-header",i=Ze+"-widget-content",s=d(new Date),l="";for(l+=" ",n="",e=0;Ie>e;e++)t=v(K.visStart),a=["fc-col"+e,sn()[e].className,i],+t==+s?a.push(Ze+"-state-highlight","fc-today"):s>t?a.push("fc-past"):a.push("fc-future"),r=""+"
"+"
"+"
 
"+"
"+"
"+"",n+=r;return l+=n,l+=" "+""+""}function m(t){t===e&&(t=Oe),Oe=t,on={};var n=be.position().top,r=Re.position().top,a=Math.min(t-n,Ne.height()+r+1);Se.height(a-N(Ce)),Te.css("top",n),Re.height(a-r-1),je=ze.height()+1,Ye=te("slotMinutes")/Pe,Be=je/Ye}function y(e){Le=e,Ge.clear(),Ue.clear();var n=pe.find("th:first");xe&&(n=n.add(xe.find("th:first"))),n=n.add(Ne.find("th:first")),Ae=0,E(n.width("").each(function(e,n){Ae=Math.max(Ae,t(n).outerWidth())}),Ae);var r=fe.find(".fc-agenda-gutter");xe&&(r=r.add(xe.find("th.fc-agenda-gutter")));var a=Re[0].clientWidth;qe=Re.width()-a,qe?(E(r,qe),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),_e=Math.floor((a-Ae)/Ie),E(ye.slice(0,-1),_e)}function D(){function t(){Re.scrollTop(r)}var e=h(),n=v(e);n.setHours(te("firstHour"));var r=_(e,n)+1;t(),setTimeout(t,0)}function w(){D()}function M(t){t.click(S).mousedown(G)}function C(t){t.click(S).mousedown(U)}function S(t){if(!te("selectable")){var e=Math.min(Ie-1,Math.floor((t.pageX-fe.offset().left-Ae)/_e)),n=ce(0,0),r=this.parentNode.className.match(/fc-slot(\d+)/);if(t.data=sn()[e],r){var a=parseInt(r[1])*te("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+Qe),ee("dayClick",De[e],n,!1,t)}else ee("dayClick",De[e],n,!0,t)}}function T(t,e,n,r){var a=0;n&&Je.build(),M(H(a,r,a,r))}function H(t,e,n,r){var a=Je.rect(t,e,n,r,Te);return ne(a,Te)}function R(t,e,n){var r=ce(0,0),a=c(v(r),1),o=new Date(Math.max(r,t)),i=new Date(Math.min(a,e));if(i>o){var s=Je.rect(0,n,0,n,ke),l=_(r,o),u=_(r,i);s.top=l,s.height=u-l,C(ne(s,ke))}}function k(t){return Ge.left(t)}function F(t){return Ue.left(t)}function z(t){return Ge.right(t)}function W(t){return Ue.right(t)}function L(t){return te("allDaySlot")&&!t.row}function O(t){var e=ce(0,0),n=t.row;return te("allDaySlot")&&n--,n>=0&&f(e,Qe+n*Pe),e}function _(t,n){if(t=v(t,!0),f(v(t),Qe)>n)return 0;if(n>=f(v(t),Ke))return Ne.height();var r=te("slotMinutes"),a=60*n.getHours()+n.getMinutes()-Qe,o=Math.floor(a/r),i=on[o];return i===e&&(i=on[o]=Ne.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+je*(a%r/r)))}function q(){return He}function j(t){var e=v(t.start);return t.allDay?e:f(e,te("defaultEventMinutes"))}function I(t,e){return e?v(t):f(v(t),te("slotMinutes"))}function X(t,e,n,r){n?te("allDaySlot")&&T(t,e,!0,r):J(t,e)}function J(e,n,r){var a=te("selectHelper");if(Je.build(),a){if(r=r||ue(e).col,r>=0&&Ie>r){var o=Je.rect(0,r,0,r,ke),i=_(e,e),s=_(e,n);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(a)){var l=a(e,n);l&&(o.position="absolute",We=t(l).css(o).appendTo(ke))}else o.isStart=!0,o.isEnd=!0,We=t(ie({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o)),We.css("opacity",te("dragOpacity"));We&&(C(We),ke.append(We),E(We,o.width,!0),x(We,o.height,!0))}}}else R(e,n,r)}function V(){re(),We&&(We.remove(),We=null)}function G(e){K.cellToDate;var n,r=K.getIsCellAllDay,a=K.getHoverListener(),o=K.reportDayClick;if(1==e.which&&te("selectable")){oe(e);var i;a.start(function(t,e){V(),t&&r(t)?(n=t.col,i=[O(e),O(t)].sort(A),X(i[0],i[1],!0,n)):i=null},e),t(document).one("mouseup",function(t){a.stop(),i&&(+i[0]==+i[1]&&o(i[0],!0,t),t.data=sn()[n],ae(i[0],i[1],!0,t))})}}function U(e){if(1==e.which&&te("selectable")){oe(e);var n,r;Ve.start(function(t,e){if(V(),t&&t.col==e.col&&!L(t)){r=t.col;var a=O(e),o=O(t);n=[a,f(v(a),Pe),o,f(v(o),Pe)].sort(A),J(n[0],n[3],t.col)}else n=null},e),t(document).one("mouseup",function(t){Ve.stop(),n&&(+n[0]==+n[1]&&Z(n[0],!1,t),t.data=sn()[r],ae(n[0],n[3],!1,t))})}}function Z(t,e,n){ee("dayClick",De[ue(t).col],t,e,n)}function $(t,e){Ve.start(function(t){if(re(),t)if(L(t))H(t.row,t.col,t.row,t.col);else{var e=O(t),n=f(v(e),te("defaultEventMinutes"));R(e,n,t.col)}},e)}function Q(t,e,n){var r=Ve.stop();re(),r&&(e.data=sn()[r.col],ee("drop",t,O(r),L(r),e,n))}var K=this;K.renderResource=o,K.setWidth=y,K.setHeight=m,K.afterRender=w,K.defaultEventEnd=j,K.timePosition=_,K.getIsCellAllDay=L,K.allDayRow=q,K.getCoordinateGrid=function(){return Je},K.getHoverListener=function(){return Ve},K.colLeft=k,K.colRight=z,K.colContentLeft=F,K.colContentRight=W,K.getDaySegmentContainer=function(){return Ee},K.getSlotSegmentContainer=function(){return Fe},K.getMinMinute=function(){return Qe},K.getMaxMinute=function(){return Ke},K.getSlotContainer=function(){return ke},K.getRowCnt=function(){return 1},K.getColCnt=function(){return Ie},K.getColWidth=function(){return _e},K.getSnapHeight=function(){return Be},K.getSnapMinutes=function(){return Pe},K.defaultSelectionEnd=I,K.renderDayOverlay=T,K.renderSelection=X,K.clearSelection=V,K.reportDayClick=Z,K.dragStart=$,K.dragStop=Q,K.getResources=r.fetchResources,le.call(K,n,r,a),ve.call(K),de.call(K),se.call(K);var te=K.opt,ee=K.trigger,ne=K.renderOverlay,re=K.clearOverlays,ae=K.reportSelection,oe=K.unselect,ie=K.slotSegHtml,ce=K.cellToDate,ue=K.dateToCell;K.rangeToSegments;var fe,pe,ye,be,De,we,Me,Ce,Se,Te,Ee,xe,He,Re,ke,Fe,Ne,ze,We,Le,Oe,Ae,_e,qe,je,Pe,Ye,Be,Ie,Xe,Je,Ve,Ge,Ue,Ze,$e,Qe,Ke,tn,en,nn,rn,an=r.formatDate,on={},sn=K.getResources;Y(n.addClass("fc-agenda")),Je=new he(function(e,n){function r(t){return Math.max(l,Math.min(c,t))}var a,o,i;ye.each(function(e,r){a=t(r),o=a.offset().left,e&&(i[1]=o),i=[o],n[e]=i}),i[1]=o+a.outerWidth(),te("allDaySlot")&&(a=He,o=a.offset().top,e[0]=[o,o+a.outerHeight()]);for(var s=ke.offset().top,l=Re.offset().top,c=l+Re.outerHeight(),u=0;Xe*Ye>u;u++)e.push([r(s+Be*u),r(s+Be*(u+1))])}),Ve=new ge(Je),Ge=new me(function(t){return we.eq(t)}),Ue=new me(function(t){return Me.eq(t)})}function se(){function n(t,e){var n,r=t.length,o=[],i=[];for(n=0;r>n;n++)t[n].allDay?o.push(t[n]):i.push(t[n]);b("allDaySlot")&&(ae(o,e),R()),l(a(i),e)}function r(){k().empty(),F().empty()}function a(e){var n,r,a,l,c,u,d,h,g=B(),p=L(),m=W(),b=[];for(a=0;g>a;a++){n=v(y.visStart),f(n,p);var D=i(le()[a],e);for(r=t.map(D,s),l=ne(o(D,r,n,f(v(n),m-p))),re(l),c=0;l.length>c;c++)for(u=l[c],d=0;u.length>d;d++)h=u[d],h.col=a,h.level=c,b.push(h)}return b}function o(t,e,n,r){var a,o,i,s,l,c,u,f,d=[],h=t.length;for(a=0;h>a;a++)o=t[a],i=o.start,s=e[a],s>n&&r>i&&(n>i?(l=v(n),u=!1):(l=i,u=!0),s>r?(c=v(r),f=!1):(c=s,f=!0),d.push({event:o,start:l,end:c,isStart:u,isEnd:f,msLength:c-l}));return d.sort(Y)}function i(e,n){for(var r=[],a=0;n.length>a;a++)n[a].resources&&t.inArray(e.id,n[a].resources)>=0&&r.push(n[a]);return r}function s(t){return t.end?v(t.end):f(v(t.start),b("defaultEventMinutes"))}function l(n,r){var a,o,i,s,l,c,f,v,h,g,p,m,y,w,M,C,S,E,x,R=n.length,k="",z=F();for(x=(E=b("isRTL"))?-1:1,a=0;R>a;a++)o=n[a],i=o.event,s=O(o.start,o.start),l=O(o.start,o.end),c=o.col,f=o.level,v=o.forward||0,h=_(c),g=q(c)-h,g=Math.min(g-6,.95*g),p=f?g/(f+v+1):v?2*(g/(v+1)-6):g,m=h+g/(f+v+1)*f*x+(E?g-p:0),o.top=s,o.left=m,o.outerWidth=p,o.outerHeight=l-s,k+=u(i,o);for(z[0].innerHTML=k,y=z.children(),a=0;R>a;a++)o=n[a],i=o.event,w=t(y[a]),M=D("eventRender",i,i,w),M===!1?w.remove():(M&&M!==!0&&(w.remove(),w=t(M).css({position:"absolute",top:o.top,left:o.left}).appendTo(z)),o.element=w,i._id===r?d(i,w,o):w[0]._fci=a,U(i,w));for(T(z,n,d),a=0;R>a;a++)o=n[a],(w=o.element)&&(o.vsides=N(w,!0),o.hsides=H(w,!0),C=w.find(".fc-event-title"),C.length&&(o.contentTop=C[0].offsetTop));for(a=0;R>a;a++)o=n[a],(w=o.element)&&(w[0].style.width=Math.max(0,o.outerWidth-o.hsides)+"px",S=Math.max(0,o.outerHeight-o.vsides),w[0].style.height=S+"px",i=o.event,o.contentTop!==e&&10>S-o.contentTop&&(w.find("div.fc-event-time").text(ie(i.start,b("timeFormat"))+" - "+i.title),w.find("div.fc-event-title").remove()),D("eventAfterRender",i,i,w))}function u(t,e){var n="<",r=t.url,a=I(t,b),o=["fc-event","fc-event-vert"];return w(t)&&o.push("fc-event-draggable"),e.isStart&&o.push("fc-event-start"),e.isEnd&&o.push("fc-event-end"),o=o.concat(t.className),t.source&&(o=o.concat(t.source.className||[])),n+=r?"a href='"+P(t.url)+"'":"div",n+=" class='"+o.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+e.top+"px;"+"left:"+e.left+"px;"+a+"'"+">"+"
"+"
"+P(se(t.start,t.end,b("timeFormat")))+"
"+"
"+P(t.title||"")+"
"+"
"+"
",e.isEnd&&M(t)&&(n+="
=
"),n+=""}function d(t,e,n){var r=e.find("div.fc-event-time");w(t)&&p(t,e,r),n.isEnd&&M(t)&&m(t,e,r),E(t,e)}function h(t,e,n){function r(){l||(e.width(a).height("").draggable("option","grid",null),l=!0)}var a,o,i,s=n.isStart,l=!0,u=z(),f=X(),d=J(),h=V(),p=L();e.draggable({opacity:b("dragOpacity","month"),revertDuration:b("dragRevertDuration"),start:function(n,p){D("eventDragStart",e,t,n,p),$(t,e),a=e.width(),u.start(function(n,a){if(ee(),n){o=!1;var u=j(0,a.col),p=j(0,n.col);i=g(p,u),n.row?s?l&&(e.width(f-10),x(e,d*Math.round((t.end?(t.end-t.start)/xe:b("defaultEventMinutes"))/h)),e.draggable("option","grid",[f,1]),l=!1):o=!0:(te(c(v(t.start),i),c(C(t),i)),r()),o=o||l&&!i}else r(),o=!0;e.draggable("option","revert",o)},n,"drag")},stop:function(n,a){if(u.stop(),ee(),D("eventDragStop",e,t,n,a),o)r(),e.css("filter",""),Z(t,e);else{var s=0;l||(s=Math.round((e.offset().top-G().offset().top)/d)*h+p-(60*t.start.getHours()+t.start.getMinutes())),Q(this,t,i,s,l,n,a)}}})}function p(t,e,n){function r(){ee(),s&&(u?(n.hide(),e.draggable("option","grid",null),te(c(v(t.start),p),c(C(t),p))):(a(w),n.css("display",""),e.draggable("option","grid",[E,x])))}function a(e){var r,a=f(v(t.start),e);t.end&&(r=f(v(t.end),e)),n.text(se(a,r,b("timeFormat")))}var o,i,s,l,u,d,h,g,p,m,w,M,S=y.getCoordinateGrid(),T=B(),E=X(),x=J(),H=V();e.draggable({scroll:!1,grid:[E,x],axis:1==T?"y":!1,opacity:b("dragOpacity"),revertDuration:b("dragRevertDuration"),start:function(n,r){D("eventDragStart",e,t,n,r),$(t,e),S.build(),o=e.position(),i=S.cell(n.pageX,n.pageY),s=l=!0,u=d=A(i),h=g=0,p=0,m=0,w=M=0},drag:function(t,n){var a=S.cell(t.pageX,t.pageY);s=!!a,s&&(u=A(a),h=Math.round((n.position.left-o.left)/E),h!=g&&(m=h),u||(w=Math.round((n.position.top-o.top)/x)*H)),(s!=l||u!=d||h!=g||w!=M)&&(r(),l=s,d=u,g=h,M=w),e.draggable("option","revert",!s)},stop:function(n,a){ee(),D("eventDragStop",e,t,n,a),s&&(u||m||w)?(t.resources=le()[i.col+m].id,Q(this,t,p,u?0:w,u,n,a)):(s=!0,u=!1,h=0,p=0,w=0,r(),e.css("filter",""),e.css(o),Z(t,e))}})}function m(t,e,n){var r,a,o=J(),i=V();e.resizable({handles:{s:".ui-resizable-handle"},grid:o,start:function(n,o){r=a=0,$(t,e),D("eventResizeStart",this,t,n,o)},resize:function(s,l){r=Math.round((Math.max(o,e.height())-l.originalSize.height)/o),r!=a&&(n.text(se(t.start,r||t.end?f(S(t),i*r):null,b("timeFormat"))),a=r)},stop:function(n,a){D("eventResizeStop",this,t,n,a),r?K(this,t,0,i*r,n,a):Z(t,e)}})}var y=this;y.renderEvents=n,y.clearEvents=r,y.slotSegHtml=u,ce.call(y);var b=y.opt,D=y.trigger,w=y.isEventDraggable,M=y.isEventResizable,S=y.eventEnd,E=y.eventElementHandlers,R=y.setHeight,k=y.getDaySegmentContainer,F=y.getSlotSegmentContainer,z=y.getHoverListener,W=y.getMaxMinute,L=y.getMinMinute,O=y.timePosition,A=y.getIsCellAllDay,_=y.colContentLeft,q=y.colContentRight,j=y.cellToDate,Y=y.segmentCompare,B=y.getColCnt,X=y.getColWidth,J=y.getSnapHeight,V=y.getSnapMinutes,G=y.getSlotContainer,U=y.reportEventElement,Z=y.showEvents,$=y.hideEvents,Q=y.eventDrop,K=y.eventResize,te=y.renderDayOverlay,ee=y.clearOverlays,ae=y.renderDayEvents,oe=y.calendar,ie=oe.formatDate,se=oe.formatDates,le=y.getResources;y.draggableDayEvent=h}function ne(t){var e,n,r,a,o,i=[],s=t.length;for(e=0;s>e;e++){for(n=t[e],r=0;;){if(a=!1,i[r])for(o=0;i[r].length>o;o++)if(ae(i[r][o],n)){a=!0;break}if(!a)break;r++}i[r]?i[r].push(n):i[r]=[n]}return i}function re(t){var e,n,r,a,o,i;for(e=t.length-1;e>0;e--)for(a=t[e],n=0;a.length>n;n++)for(o=a[n],r=0;t[e-1].length>r;r++)i=t[e-1][r],ae(o,i)&&(i.forward=Math.max(i.forward||0,(o.forward||0)+1))}function ae(t,e){return t.end>e.start&&t.starte;e++)n=t[e],X[n._id]?X[n._id].push(n):X[n._id]=[n]}function d(){X={},V={},G=[]}function h(t){return t.end?v(t.end):Y(t)}function p(t,e){G.push({event:t,element:e}),V[t._id]?V[t._id].push(e):V[t._id]=[e]}function m(){t.each(G,function(t,e){P.trigger("eventDestroy",e.event,e.event,e.element)})}function y(t,n){n.click(function(r){return n.hasClass("ui-draggable-dragging")||n.hasClass("ui-resizable-resizing")?e:i("eventClick",this,t,r)}).hover(function(e){i("eventMouseover",this,t,e)},function(e){i("eventMouseout",this,t,e)})}function b(t,e){w(t,e,"show")}function D(t,e){w(t,e,"hide")}function w(t,e,n){var r,a=V[t._id],o=a.length;for(r=0;o>r;r++)e&&a[r][0]==e[0]||a[r][n]()}function M(t,e,n,r,a,o,s){var l=e.allDay,c=e._id;S(X[c],n,r,a),i("eventDrop",t,e,n,r,a,function(){S(X[c],-n,-r,l),I(c)},o,s),I(c)}function C(t,e,n,r,a,o){var s=e._id;T(X[s],n,r),i("eventResize",t,e,n,r,function(){T(X[s],-n,-r),I(s)},a,o),I(s)}function S(t,n,r,a){r=r||0;for(var o,i=t.length,s=0;i>s;s++)o=t[s],a!==e&&(o.allDay=a),f(c(o.start,n,!0),r),o.end&&(o.end=f(c(o.end,n,!0),r)),B(o,U)}function T(t,e,n){n=n||0;for(var r,a=t.length,o=0;a>o;o++)r=t[o],r.end=f(c(h(r),e,!0),n),B(r,U)}function E(t){return"object"==typeof t&&(t=t.getDay()),Q[t]}function x(){return Z}function H(t,e,n){for(e=e||1;Q[(t.getDay()+(n?e:0)+7)%7];)c(t,e)}function R(){var t=k.apply(null,arguments),e=F(t),n=N(e);return n}function k(t,e){var n=P.getColCnt(),r=ee?-1:1,a=ee?n-1:0;"object"==typeof t&&(e=t.col,t=t.row);var o=t*n+(e*r+a);return o}function F(t){var e=P.visStart.getDay();return t+=K[e],7*Math.floor(t/Z)+te[(t%Z+Z)%Z]-e}function N(t){var e=v(P.visStart);return c(e,t),e}function z(t){var e=W(t),n=L(e),r=O(n);return r}function W(t){return g(t,P.visStart)}function L(t){var e=P.visStart.getDay();return t+=e,Math.floor(t/7)*Z+K[(t%7+7)%7]-K[e]}function O(t){var e=P.getColCnt(),n=ee?-1:1,r=ee?e-1:0,a=Math.floor(t/e),o=(t%e+e)%e*n+r;return{row:a,col:o}}function A(t,e){for(var n=P.getRowCnt(),r="resourceDay"===P.name?1:P.getColCnt(),a=[],o=W(t),i=W(e),s=L(o),l=L(i)-1,c=0;n>c;c++){var u=c*r,f=u+r-1,d=Math.max(s,u),v=Math.min(l,f);if(v>=d){var h=O(d),g=O(v),p=[h.col,g.col].sort(),m=F(d)==o,y=F(v)+1==i;a.push({row:c,leftCol:p[0],rightCol:p[1],isStart:m,isEnd:y})}}return a}function _(t,e){return q(t,e)||t.event.start-e.event.start||(t.event.title||"").localeCompare(e.event.title)}function q(t,e){return"msLength"in t?e.msLength-t.msLength:e.rightCol-e.leftCol-(t.rightCol-t.leftCol)||e.event.allDay-t.event.allDay}var P=this;P.element=n,P.calendar=r,P.name=a,P.opt=o,P.trigger=i,P.isEventDraggable=s,P.isEventResizable=l,P.setEventData=u,P.clearEventData=d,P.eventEnd=h,P.reportEventElement=p,P.triggerEventDestroy=m,P.eventElementHandlers=y,P.showEvents=b,P.hideEvents=D,P.eventDrop=M,P.eventResize=C;var Y=P.defaultEventEnd,B=r.normalizeEvent,I=r.reportEventChange,X={},V={},G=[],U=r.options;P.isHiddenDay=E,P.skipHiddenDays=H,P.getCellsPerWeek=x,P.dateToCell=z,P.dateToDayOffset=W,P.dayOffsetToCellOffset=L,P.cellOffsetToCell=O,P.cellToDate=R,P.cellToCellOffset=k,P.cellOffsetToDayOffset=F,P.dayOffsetToDate=N,P.rangeToSegments=A,P.segmentCompare=_;var Z,$=o("hiddenDays")||[],Q=[],K=[],te=[],ee=o("isRTL");(function(){o("weekends")===!1&&$.push(0,6);for(var e=0,n=0;7>e;e++)K[e]=n,Q[e]=-1!=t.inArray(e,$),Q[e]||(te[n]=e,n++);if(Z=n,!Z)throw"invalid hiddenDays"})()}function ce(){function n(t,e){var n=a(t,!1,!0);fe(n,function(t,e){L(t.event,e)}),M(n,e),fe(n,function(t,e){F("eventAfterRender",t.event,t.event,e)})}function r(t,e,n){var r=a([t],!0,!1),o=[];return fe(r,function(t,r){t.row===e&&r.css("top",n),o.push(r[0])}),o}function a(e,n,r){var a,i,s=Q(),l=n?t("
"):s,c=o(e);return u(c),a=f(c),l[0].innerHTML=a,i=l.children(),n&&s.append(i),h(c,i),fe(c,function(t,e){t.hsides=H(e,!0)}),fe(c,function(t,e){e.width(Math.max(0,t.outerWidth-t.hsides))}),fe(c,function(t,e){t.outerHeight=e.outerHeight(!0)}),p(c,r),c}function o(t){var n=R.getResources();if(n===e)return s(t);for(var r=[],a=0;n.length>a;a++)for(var o=i(n[a],t),c=0;o.length>c;c++){var u=l(o[c],a);r.push.apply(r,u)}return r}function i(e,n){for(var r=[],a=0;n.length>a;a++)n[a].resources&&t.inArray(e.id,n[a].resources)>=0&&r.push(n[a]);return r}function s(t){for(var e=[],n=0;t.length>n;n++){var r=l(t[n]);e.push.apply(e,r)}return e}function l(t,n){for(var r=t.start,a=C(t),o=ae(r,a),i=0;o.length>i;i++)n!==e&&(o[i].leftCol=n,o[i].rightCol=n),o[i].event=t;return o}function u(t){for(var e=k("isRTL"),n=0;t.length>n;n++){var r=t[n],a=(e?r.isEnd:r.isStart)?Z:G,o=(e?r.isStart:r.isEnd)?$:U,i=a(r.leftCol),s=o(r.rightCol);r.left=i,r.outerWidth=s-i}}function f(t){for(var e="",n=0;t.length>n;n++)e+=d(t[n]);return e}function d(t){var e="",n=k("isRTL"),r=t.event,a=r.url,o=["fc-event","fc-event-hori"];N(r)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(r.className),r.source&&(o=o.concat(r.source.className||[]));var i=I(r,k);return e+=a?""+"
",!r.allDay&&t.isStart&&(e+=""+P(K(r.start,r.end,k("timeFormat")))+""),e+=""+P(r.title||"")+""+"
",t.isEnd&&z(r)&&(e+="
"+"   "+"
"),e+=""}function h(e,n){for(var r=0;e.length>r;r++){var a=e[r],o=a.event,i=n.eq(r),s=F("eventRender",o,o,i);s===!1?i.remove():(s&&s!==!0&&(s=t(s).css({position:"absolute",left:a.left}),i.replaceWith(s),i=s),a.element=i)}}function p(t,e){var n=m(t),r=w(),a=[];if(e)for(var o=0;r.length>o;o++)r[o].height(n[o]);for(var o=0;r.length>o;o++)a.push(r[o].position().top);fe(t,function(t,e){e.css("top",a[t.row]+t.top)})}function m(t){for(var e=X(),n=J(),r=[],a=y(t),o=0;e>o;o++){for(var i=a[o],s=[],l=0;n>l;l++)s.push(0);for(var c=0;i.length>c;c++){var u=i[c];u.top=_(s.slice(u.leftCol,u.rightCol+1));for(var l=u.leftCol;u.rightCol>=l;l++)s[l]=u.top+u.outerHeight}r.push(_(s))}return r}function y(t){var e,n,r,a=X(),o=[];for(e=0;t.length>e;e++)n=t[e],r=n.row,n.element&&(o[r]?o[r].push(n):o[r]=[n]);for(r=0;a>r;r++)o[r]=b(o[r]||[]);return o}function b(t){for(var e=[],n=D(t),r=0;n.length>r;r++)e.push.apply(e,n[r]);return e}function D(t){t.sort(oe);for(var e=[],n=0;t.length>n;n++){for(var r=t[n],a=0;e.length>a&&ue(r,e[a]);a++);e[a]?e[a].push(r):e[a]=[r]}return e}function w(){var t,e=X(),n=[];for(t=0;e>t;t++)n[t]=V(t).find("div.fc-day-content > div");return n}function M(t,e){var n=Q();fe(t,function(t,n,r){var a=t.event;a._id===e?S(a,n,t):n[0]._fci=r}),T(n,t,S)}function S(t,e,n){N(t)&&R.draggableDayEvent(t,e,n),n.isEnd&&z(t)&&R.resizableDayEvent(t,e,n),O(t,e)}function E(t,e){var n,r=re();e.draggable({delay:50,opacity:k("dragOpacity"),revertDuration:k("dragRevertDuration"),start:function(a,o){F("eventDragStart",e,t,a,o),q(t,e),r.start(function(r,a,o,i){if(e.draggable("option","revert",!r||!o&&!i),ee(),r){var s=ie(a),l=ie(r);n=g(l,s),te(c(v(t.start),n),c(C(t),n))}else n=0},a,"drag")},stop:function(a,o){r.stop(),ee(),F("eventDragStop",e,t,a,o),n?j(this,t,n,0,t.allDay,a,o):(e.css("filter",""),A(t,e))}})}function x(e,n,a){var o=k("isRTL"),i=o?"w":"e",s=n.find(".ui-resizable-"+i),l=!1;Y(n),n.mousedown(function(t){t.preventDefault()}).click(function(t){l&&(t.preventDefault(),t.stopImmediatePropagation())}),s.mousedown(function(o){function s(n){F("eventResizeStop",this,e,n),t("body").css("cursor",""),u.stop(),ee(),f&&B(this,e,f,0,n),setTimeout(function(){l=!1},0)}if(1==o.which){l=!0;var u=re();X(),J();var f,d,v=n.css("top"),h=t.extend({},e),g=de(ce(e.start));ne(),t("body").css("cursor",i+"-resize").one("mouseup",s),F("eventResizeStart",this,e,o),u.start(function(n,o){if(n){var s=se(o),l=se(n);if(l=Math.max(l,g),f=le(l)-le(s)){h.end=c(W(e),f,!0);var u=d;d=r(h,a.row,v),d=t(d),d.find("*").css("cursor",i+"-resize"),u&&u.remove(),q(e)}else d&&(A(e),d.remove(),d=null);ee(),te(e.start,c(C(e),f))}},o)}})}var R=this;R.renderDayEvents=n,R.draggableDayEvent=E,R.resizableDayEvent=x;var k=R.opt,F=R.trigger,N=R.isEventDraggable,z=R.isEventResizable,W=R.eventEnd,L=R.reportEventElement,O=R.eventElementHandlers,A=R.showEvents,q=R.hideEvents,j=R.eventDrop,B=R.eventResize,X=R.getRowCnt,J=R.getColCnt;R.getColWidth;var V=R.allDayRow,G=R.colLeft,U=R.colRight,Z=R.colContentLeft,$=R.colContentRight;R.dateToCell;var Q=R.getDaySegmentContainer,K=R.calendar.formatDates,te=R.renderDayOverlay,ee=R.clearOverlays,ne=R.clearSelection,re=R.getHoverListener,ae=R.rangeToSegments,oe=R.segmentCompare,ie=R.cellToDate,se=R.cellToCellOffset,le=R.cellOffsetToDayOffset,ce=R.dateToDayOffset,de=R.dayOffsetToCellOffset}function ue(t,e){for(var n=0;e.length>n;n++){var r=e[n];if(r.leftCol<=t.rightCol&&r.rightCol>=t.leftCol)return!0}return!1}function fe(t,e){for(var n=0;t.length>n;n++){var r=t[n],a=r.element;a&&e(r,a,n)}}function de(){function e(t,e,a){n(),e||(e=l(t,a)),c(t,e,a),r(t,e,a)}function n(t){f&&(f=!1,u(),s("unselect",null,t))}function r(t,e,n,r){f=!0,s("select",null,t,e,n,r)}function a(e){var a=o.cellToDate,s=o.getIsCellAllDay,l=o.getHoverListener(),f=o.reportDayClick;if(1==e.which&&i("selectable")){n(e);var d;l.start(function(t,e){u(),t&&s(t)?(d=[a(e),a(t)].sort(A),c(d[0],d[1],!0)):d=null},e),t(document).one("mouseup",function(t){l.stop(),d&&(+d[0]==+d[1]&&f(d[0],!0,t),r(d[0],d[1],!0,t))})}}var o=this;o.select=e,o.unselect=n,o.reportSelection=r,o.daySelectionMousedown=a;var i=o.opt,s=o.trigger,l=o.defaultSelectionEnd,c=o.renderSelection,u=o.clearSelection,f=!1;i("selectable")&&i("unselectAuto")&&t(document).mousedown(function(e){var r=i("unselectCancel");r&&t(e.target).parents(r).length||n(e)})}function ve(){function e(e,n){var r=o.shift();return r||(r=t("
")),r[0].parentNode!=n[0]&&r.appendTo(n),a.push(r.css(e).show()),r}function n(){for(var t;t=a.shift();)o.push(t.hide().unbind())}var r=this;r.renderOverlay=e,r.clearOverlays=n;var a=[],o=[]}function he(t){var e,n,r=this;r.build=function(){e=[],n=[],t(e,n)},r.cell=function(t,r){var a,o=e.length,i=n.length,s=-1,l=-1;for(a=0;o>a;a++)if(r>=e[a][0]&&e[a][1]>r){s=a;break}for(a=0;i>a;a++)if(t>=n[a][0]&&n[a][1]>t){l=a;break}return s>=0&&l>=0?{row:s,col:l}:null},r.rect=function(t,r,a,o,i){var s=i.offset();return{top:e[t][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:e[a][1]-e[t][0]}}}function ge(e){function n(t){pe(t);var n=e.cell(t.pageX,t.pageY);(!n!=!i||n&&(n.row!=i.row||n.col!=i.col))&&(n?(o||(o=n),a(n,o,n.row-o.row,n.col-o.col)):a(n,o),i=n)}var r,a,o,i,s=this;s.start=function(s,l,c){a=s,o=i=null,e.build(),n(l),r=c||"mousemove",t(document).bind(r,n)},s.stop=function(){return t(document).unbind(r,n),i}}function pe(t){t.pageX===e&&(t.pageX=t.originalEvent.pageX,t.pageY=t.originalEvent.pageY)}function me(t){function n(e){return a[e]=a[e]||t(e)}var r=this,a={},o={},i={};r.left=function(t){return o[t]=o[t]===e?n(t).position().left:o[t]},r.right=function(t){return i[t]=i[t]===e?r.left(t)+n(t).width():i[t]},r.clear=function(){a={},o={},i={}}}var ye={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '—'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"",next:"",prevYear:"«",nextYear:"»",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0},be={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"",next:"",prevYear:"»",nextYear:"«"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},De=t.fullCalendar={version:"1.6.3"},we=De.views={}; +t.fn.fullCalendar=function(n){if("string"==typeof n){var a,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var r=t.data(this,"fullCalendar");if(r&&t.isFunction(r[n])){var i=r[n].apply(r,o);a===e&&(a=i),"destroy"==n&&t.removeData(this,"fullCalendar")}}),a!==e?a:this}var i=n.eventSources||[];return delete n.eventSources,n.events&&(i.push(n.events),delete n.events),n=t.extend(!0,{},ye,n.isRTL||n.isRTL===e&&ye.isRTL?be:{},n),this.each(function(e,a){var o=t(a),s=new r(o,n,i);o.data("fullCalendar",s),s.render()}),this},De.sourceNormalizers=[],De.sourceFetchers=[];var Me={dataType:"json",cache:!1},Ce=1;De.addDays=c,De.cloneDate=v,De.parseDate=m,De.parseISO8601=y,De.parseTime=b,De.formatDate=D,De.formatDates=w;var Se=["sun","mon","tue","wed","thu","fri","sat"],Te=864e5,Ee=36e5,xe=6e4,He={s:function(t){return t.getSeconds()},ss:function(t){return q(t.getSeconds())},m:function(t){return t.getMinutes()},mm:function(t){return q(t.getMinutes())},h:function(t){return t.getHours()%12||12},hh:function(t){return q(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return q(t.getHours())},d:function(t){return t.getDate()},dd:function(t){return q(t.getDate())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return q(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},yy:function(t){return(t.getFullYear()+"").substring(2)},yyyy:function(t){return t.getFullYear()},t:function(t){return 12>t.getHours()?"a":"p"},tt:function(t){return 12>t.getHours()?"am":"pm"},T:function(t){return 12>t.getHours()?"A":"P"},TT:function(t){return 12>t.getHours()?"AM":"PM"},u:function(t){return D(t,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(t){var e=t.getDate();return e>10&&20>e?"th":["st","nd","rd"][e%10-1]||"th"},w:function(t,e){return e.weekNumberCalculation(t)},W:function(t){return M(t)}};De.dateFormatters=He,De.applyAll=X,we.month=V,we.basicWeek=G,we.basicDay=U,n({weekMode:"fixed"}),we.agendaWeek=Q,we.agendaDay=K,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24}),we.resourceDay=oe,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24})})(jQuery); \ No newline at end of file