You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
128 KiB
6 lines
128 KiB
/*!
|
|
* FullCalendar v3.1.0
|
|
* Docs & License: http://fullcalendar.io/
|
|
* (c) 2016 Adam Shaw
|
|
*/
|
|
(function(n){typeof define=="function"&&define.amd?define(["jquery","moment"],n):typeof exports=="object"?module.exports=n(require("jquery"),require("moment")):n(jQuery,moment)})(function(n,t){function tt(n){return fi(n,ki)}function di(n,t){t.left&&n.css({"border-left-width":1,"margin-left":t.left-1});t.right&&n.css({"border-right-width":1,"margin-right":t.right-1})}function gi(n){n.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function ot(){n("body").addClass("fc-not-allowed")}function st(){n("body").removeClass("fc-not-allowed")}function nr(t,i,r){var u=Math.floor(i/t.length),e=Math.floor(i-u*(t.length-1)),f=[],o=[],s=[],h=0;tr(t);t.each(function(i,r){var l=i===t.length-1?e:u,c=n(r).outerHeight(!0);c<l?(f.push(r),o.push(c),s.push(n(r).height())):h+=c});r&&(i-=h,u=Math.floor(i/f.length),e=Math.floor(i-u*(f.length-1)));n(f).each(function(t,i){var r=t===f.length-1?e:u,h=o[t],c=s[t],l=r-(h-c);h<r&&n(i).height(l)})}function tr(n){n.height("")}function ir(t){var i=0;return t.find("> *").each(function(t,r){var u=n(r).outerWidth();u>i&&(i=u)}),i++,t.width(i),i}function dt(n,t){var i=n.add(t),r;return i.css({position:"relative",left:-1}),r=n.outerHeight()-t.outerHeight(),i.css({position:"",left:""}),r}function gt(t){var r=t.css("position"),i=t.parents().filter(function(){var t=n(this);return/(auto|scroll)/.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return r==="fixed"||!i.length?n(t[0].ownerDocument||document):i}function ni(n,t){var i=n.offset(),r=i.left-(t?t.left:0),u=i.top-(t?t.top:0);return{left:r,right:r+n.outerWidth(),top:u,bottom:u+n.outerHeight()}}function rr(n,t){var i=n.offset(),r=ti(n),u=i.left+nt(n,"border-left-width")+r.left-(t?t.left:0),f=i.top+nt(n,"border-top-width")+r.top-(t?t.top:0);return{left:u,right:u+n[0].clientWidth,top:f,bottom:f+n[0].clientHeight}}function tf(n,t){var i=n.offset(),r=i.left+nt(n,"border-left-width")+nt(n,"padding-left")-(t?t.left:0),u=i.top+nt(n,"border-top-width")+nt(n,"padding-top")-(t?t.top:0);return{left:r,right:r+n.width(),top:u,bottom:u+n.height()}}function ti(n){var i=n.innerWidth()-n[0].clientWidth,t={left:0,right:0,top:0,bottom:n.innerHeight()-n[0].clientHeight};return rf()&&n.css("direction")=="rtl"?t.left=i:t.right=i,t}function rf(){return ht===null&&(ht=uf()),ht}function uf(){var t=n("<div><div/><\/div>").css({position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}).appendTo("body"),i=t.children(),r=i.offset().left>t.offset().left;return t.remove(),r}function nt(n,t){return parseFloat(n.css(t))||0}function ur(n){return n.which==1&&!n.ctrlKey}function a(n){if(n.pageX!==undefined)return n.pageX;var t=n.originalEvent.touches;if(t)return t[0].pageX}function v(n){if(n.pageY!==undefined)return n.pageY;var t=n.originalEvent.touches;if(t)return t[0].pageY}function fr(n){return/^touch/.test(n.type)}function ff(n){n.addClass("fc-unselectable").on("selectstart",ct)}function ct(n){n.preventDefault()}function ef(n){return window.addEventListener?(window.addEventListener("scroll",n,!0),!0):!1}function of(n){return window.removeEventListener?(window.removeEventListener("scroll",n,!0),!0):!1}function er(n,t){var i={left:Math.max(n.left,t.left),right:Math.min(n.right,t.right),top:Math.max(n.top,t.top),bottom:Math.min(n.bottom,t.bottom)};return i.left<i.right&&i.top<i.bottom?i:!1}function sf(n,t){return{left:Math.min(Math.max(n.left,t.left),t.right),top:Math.min(Math.max(n.top,t.top),t.bottom)}}function hf(n){return{left:(n.left+n.right)/2,top:(n.top+n.bottom)/2}}function cf(n,t){return{left:n.left-t.left,top:n.top-t.top}}function or(t){var f=[],r=[],u,i;for(typeof t=="string"?r=t.split(/\s*,\s*/):typeof t=="function"?r=[t]:n.isArray(t)&&(r=t),u=0;u<r.length;u++)i=r[u],typeof i=="string"?f.push(i.charAt(0)=="-"?{field:i.substring(1),order:-1}:{field:i,order:1}):typeof i=="function"&&f.push({func:i});return f}function sr(n,t,i){for(var u,r=0;r<i.length;r++)if(u=hr(n,t,i[r]),u)return u;return 0}function hr(n,t,i){return i.func?i.func(n,t):cr(n[i.field],t[i.field])*(i.order||1)}function cr(t,i){return!t&&!i?0:i==null?-1:t==null?1:n.type(t)==="string"||n.type(i)==="string"?String(t).localeCompare(String(i)):t-i}function lt(n,t){var i=n.start,r=n.end,u=t.start,f=t.end,e,o,s,h;if(r>u&&i<f)return i>=u?(e=i.clone(),s=!0):(e=u.clone(),s=!1),r<=f?(o=r.clone(),h=!0):(o=f.clone(),h=!1),{start:e,end:o,isStart:s,isEnd:h}}function lr(n,i){return t.duration({days:n.clone().stripTime().diff(i.clone().stripTime(),"days"),ms:n.time()-i.time()})}function lf(n,i){return t.duration({days:n.clone().stripTime().diff(i.clone().stripTime(),"days")})}function ar(n,i,r){return t.duration(Math.round(n.diff(i,r,!0)),r)}function ri(n,t){for(var r,u,i=0;i<at.length;i++)if(r=at[i],u=af(r,n,t),u>=1&&w(u))break;return r}function af(n,i,r){return r!=null?r.diff(i,n,!0):t.isDuration(i)?i.as(n):i.end.diff(i.start,n,!0)}function vf(n,t,i){var r;return d(i)?(t-n)/i:(r=i.asMonths(),Math.abs(r)>=1&&w(r))?t.diff(n,"months",!0)/r:t.diff(n,"days",!0)/i.asDays()}function ui(n,t){var i,r;return d(n)||d(t)?n/t:(i=n.asMonths(),r=t.asMonths(),Math.abs(i)>=1&&w(i)&&Math.abs(r)>=1&&w(r))?i/r:n.asDays()/t.asDays()}function yf(n,i){var r;return d(n)?t.duration(n*i):(r=n.asMonths(),Math.abs(r)>=1&&w(r))?t.duration({months:r*i}):t.duration({days:n.asDays()*i})}function d(n){return Boolean(n.hours()||n.minutes()||n.seconds()||n.milliseconds())}function pf(n){return Object.prototype.toString.call(n)==="[object Date]"||n instanceof Date}function vr(n){return/^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(n)}function fi(n,t){var u={},i,r,e,o,f,s;if(t)for(i=0;i<t.length;i++){for(r=t[i],e=[],o=n.length-1;o>=0;o--)if(f=n[o][r],typeof f=="object")e.unshift(f);else if(f!==undefined){u[r]=f;break}e.length&&(u[r]=fi(e))}for(i=n.length-1;i>=0;i--){s=n[i];for(r in s)r in u||(u[r]=s[r])}return u}function it(n){var t=function(){};return t.prototype=n,new t}function ei(n,t){for(var i in n)pr(n,i)&&(t[i]=n[i])}function pr(n,t){return yr.call(n,t)}function wf(t){return/undefined|null|boolean|number|string/.test(n.type(t))}function vt(t,i,r){if(n.isFunction(t)&&(t=[t]),t){for(var f,u=0;u<t.length;u++)f=t[u].apply(i,r)||f;return f}}function e(){for(var n=0;n<arguments.length;n++)if(arguments[n]!==undefined)return arguments[n]}function r(n){return(n+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function oi(n){return n.replace(/&.*?;/g,"")}function yt(t){var i=[];return n.each(t,function(n,t){t!=null&&i.push(n+":"+t)}),i.join(";")}function bf(t){var i=[];return n.each(t,function(n,t){t!=null&&i.push(n+'="'+r(t)+'"')}),i.join(" ")}function wr(n){return n.charAt(0).toUpperCase()+n.slice(1)}function kf(n,t){return n-t}function w(n){return n%1==0}function g(n,t){var i=n[t];return function(){return i.apply(n,arguments)}}function rt(n,t,i){var r,u,f,o,e,s=function(){var h=+new Date-o;h<t?r=setTimeout(s,t-h):(r=null,i||(e=n.apply(f,u),f=u=null))};return function(){f=this;u=arguments;o=+new Date;var h=i&&!r;return r||(r=setTimeout(s,t)),h&&(e=n.apply(f,u),f=u=null),e}}function hi(i,r,u){var f=i[0],h=i.length==1&&typeof f=="string",o,s,c,e;return t.isMoment(f)||pf(f)||f===undefined?e=t.apply(null,i):(o=!1,s=!1,h?df.test(f)?(f+="-01",i=[f],o=!0,s=!0):(c=gf.exec(f))&&(o=!c[5],s=!0):n.isArray(f)&&(s=!0),e=r||o?t.utc.apply(t,i):t.apply(null,i),o?(e._ambigTime=!0,e._ambigZone=!0):u&&(s?e._ambigZone=!0:h&&e.utcOffset(f))),e._fullCalendar=!0,e}function b(n,t){return y.format.call(n,t)}function ne(n,t){return br(n,ai(t))}function br(n,t){for(var r="",i=0;i<t.length;i++)r+=li(n,t[i]);return r}function li(n,t){var i,r;return typeof t=="string"?t:(i=t.token)?ci[i]?ci[i](n):b(n,i):t.maybe&&(r=br(n,t.maybe),r.match(/[1-9]/))?r:""}function kr(n,t,r,u,f){var e;return n=i.moment.parseZone(n),t=i.moment.parseZone(t),e=n.localeData(),r=e.longDateFormat(r)||r,u=u||" - ",te(n,t,ai(r),u,f)}function te(n,t,i,r,u){for(var a=n.clone().stripZone(),v=t.clone().stripZone(),f,y="",o,l="",s,h="",c="",p="",e=0;e<i.length;e++){if(f=gr(n,t,a,v,i[e]),f===!1)break;y+=f}for(o=i.length-1;o>e;o--){if(f=gr(n,t,a,v,i[o]),f===!1)break;l=f+l}for(s=e;s<=o;s++)h+=li(n,i[s]),c+=li(t,i[s]);return(h||c)&&(p=u?c+r+h:h+r+c),y+p+l}function gr(n,t,i,r,u){var f,e;return typeof u=="string"?u:(f=u.token)&&(e=dr[f.charAt(0)],e&&i.isSame(r,e))?b(n,f):!1}function ai(n){return n in pt?pt[n]:pt[n]=nu(n)}function nu(n){for(var i=[],r=/\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g,t;t=r.exec(n);)t[1]?i.push(t[1]):t[2]?i.push({maybe:nu(t[2])}):t[3]?i.push({token:t[3]}):t[5]&&i.push(t[5]);return i}function h(){}function ie(n,t){var i;return pr(t,"constructor")&&(i=t.constructor),typeof i!="function"&&(i=t.constructor=function(){n.apply(this,arguments)}),i.prototype=it(n.prototype),ei(t,i.prototype),ei(n,i),i}function iu(n,t){ei(t,n.prototype)}function f(t){var r=n.Deferred(),i=r.promise(),u;return typeof t=="function"&&t(function(n){f.immediate&&(i._value=n);r.resolve(n)},function(){r.reject()}),f.immediate&&(u=i.then,i.then=function(n,t){var r=i.state();if(r==="resolved"){if(typeof n=="function")return f.resolve(n(i._value))}else if(r==="rejected"&&typeof t=="function")return t(),i;return u.call(i,n,t)}),i}function vi(n){function i(n){return new f(function(i){var r=function(){f.resolve(n()).then(i).then(function(){t.shift();t.length&&t[0]()})};t.push(r);t.length===1&&r()})}var t=[];this.add=typeof n=="number"?rt(i,n):i;this.addQuickly=i}function fu(n,t){return!n&&!t?!0:n&&t?n.component===t.component&&eu(n,t)&&eu(t,n):!1}function eu(n,t){for(var i in n)if(!/^(component|left|right|top|bottom)$/.test(i)&&n[i]!==t[i])return!1;return!0}function su(n){return{start:n.start.clone(),end:n.end?n.end.clone():null,allDay:n.allDay}}function hu(n){var t=cu(n);return t==="background"||t==="inverse-background"}function ue(n){return cu(n)==="inverse-background"}function cu(n){return e((n.source||{}).rendering,n.rendering)}function fe(n){for(var r={},i,t=0;t<n.length;t++)i=n[t],(r[i._id]||(r[i._id]=[])).push(i);return r}function ee(n,t){return n.start-t.start}function oe(r){var e=i.dataAttrPrefix,u,f,o,s;return e&&(e+="-"),u=r.data(e+"event")||null,u&&(u=typeof u=="object"?n.extend({},u):{},f=u.start,f==null&&(f=u.time),o=u.duration,s=u.stick,delete u.start,delete u.time,delete u.duration,delete u.stick),f==null&&(f=r.data(e+"start")),f==null&&(f=r.data(e+"time")),o==null&&(o=r.data(e+"duration")),s==null&&(s=r.data(e+"stick")),f=f!=null?t.duration(f):null,o=o!=null?t.duration(o):null,s=Boolean(s),{eventProps:u,startTime:f,duration:o,stick:s}}function se(n,t){for(var r,i=0;i<t.length;i++)if(r=t[i],r.leftCol<=n.rightCol&&r.rightCol>=n.leftCol)return!0;return!1}function he(n,t){return n.leftCol-t.leftCol}function ce(n){for(var i=[],u,t,r=0;r<n.length;r++){for(u=n[r],t=0;t<i.length;t++)if(!au(u,i[t]).length)break;u.level=t;(i[t]||(i[t]=[])).push(u)}return i}function le(n){for(var f,i,r,u,t=0;t<n.length;t++)for(f=n[t],i=0;i<f.length;i++)for(r=f[i],r.forwardSegs=[],u=t+1;u<n.length;u++)au(r,n[u],r.forwardSegs)}function lu(n){var u=n.forwardSegs,i=0,t,r;if(n.forwardPressure===undefined){for(t=0;t<u.length;t++)r=u[t],lu(r),i=Math.max(i,1+r.forwardPressure);n.forwardPressure=i}}function au(n,t,i){i=i||[];for(var r=0;r<t.length;r++)ae(n,t[r])&&i.push(t[r]);return i}function ae(n,t){return n.bottom>t.top&&n.top<t.bottom}function vu(n){this.items=n||[]}function yu(t,i){function c(n){i=n}function l(){var r=i.layout;u=t.options.theme?"ui":"fc";r?(f?f.empty():f=this.el=n("<div class='fc-toolbar "+i.extraClasses+"'/>"),f.append(s("left")).append(s("right")).append(s("center")).append('<div class="fc-clear"/>')):h()}function h(){f&&(f.remove(),f=e.el=null)}function s(f){var e=n('<div class="fc-'+f+'"/>'),s=i.layout[f];return s&&n.each(s.split(" "),function(){var i=n(),s=!0,f;n.each(this.split(","),function(f,e){var c,y,l,a,v,p,w,b,k,h;e=="title"?(i=i.add(n("<h2> <\/h2>")),s=!1):((c=(t.options.customButtons||{})[e])?(l=function(n){c.click&&c.click.call(h[0],n)},a="",v=c.text):(y=t.getViewSpec(e))?(l=function(){t.changeView(e)},o.push(e),a=y.buttonTextOverride,v=y.buttonTextDefault):t[e]&&(l=function(){t[e]()},a=(t.overrides.buttonText||{})[e],v=t.options.buttonText[e]),l&&(p=c?c.themeIcon:t.options.themeButtonIcons[e],w=c?c.icon:t.options.buttonIcons[e],b=a?r(a):p&&t.options.theme?"<span class='ui-icon ui-icon-"+p+"'><\/span>":w&&!t.options.theme?"<span class='fc-icon fc-icon-"+w+"'><\/span>":r(v),k=["fc-"+e+"-button",u+"-button",u+"-state-default"],h=n('<button type="button" data-id="'+(e||"")+'" class="'+k.join(" ")+'">'+b+"<\/button>").click(function(n){h.hasClass(u+"-state-disabled")||(l(n),(h.hasClass(u+"-state-active")||h.hasClass(u+"-state-disabled"))&&h.removeClass(u+"-state-hover"))}).mousedown(function(){h.not("."+u+"-state-active").not("."+u+"-state-disabled").addClass(u+"-state-down")}).mouseup(function(){h.removeClass(u+"-state-down")}).hover(function(){h.not("."+u+"-state-active").not("."+u+"-state-disabled").addClass(u+"-state-hover")},function(){h.removeClass(u+"-state-hover").removeClass(u+"-state-down")}),i=i.add(h)))});s&&i.first().addClass(u+"-corner-left").end().last().addClass(u+"-corner-right").end();i.length>1?(f=n("<div/>"),s&&f.addClass("fc-button-group"),f.append(i),e.append(f)):e.append(i)}),e}function a(n){f&&f.find("h2").text(n)}function v(n){f&&f.find(".fc-"+n+"-button").addClass(u+"-state-active")}function y(n){f&&f.find(".fc-"+n+"-button").removeClass(u+"-state-active")}function p(n){f&&f.find(".fc-"+n+"-button").prop("disabled",!0).addClass(u+"-state-disabled")}function w(n){f&&f.find(".fc-"+n+"-button").prop("disabled",!1).removeClass(u+"-state-disabled")}function b(){return o}var e=this,f,o,u;e.setToolbarOptions=c;e.render=l;e.removeElement=h;e.updateTitle=a;e.activateButton=v;e.deactivateButton=y;e.disableButton=p;e.enableButton=w;e.getViewsWithButtons=b;e.el=null;o=[]}function ve(r,u){function k(n){n._locale=h}function bt(){l?w()&&(g(),s()):kt()}function kt(){r.addClass("fc");r.on("click.fc","a[data-goto]",function(t){var s=n(this),u=s.data("goto"),o=f.moment(u.date),r=u.type,i=e.opt("navLink"+wr(r)+"Click");typeof i=="function"?i(o,t):(typeof i=="string"&&(r=i),yt(o,r))});f.bindOption("theme",function(n){wt=n?"ui":"fc";r.toggleClass("ui-widget",n);r.toggleClass("fc-unthemed",!n)});f.bindOptions(["isRTL","locale"],function(n){r.toggleClass("fc-ltr",!n);r.toggleClass("fc-rtl",n)});l=n("<div class='fc-view-container'/>").prependTo(r);var t=ii();c=new vu(t);y=f.header=t[0];p=f.footer=t[1];at();vt();s(f.options.defaultView);f.options.handleWindowResize&&(b=rt(ni,f.options.windowResizeDelay),n(window).resize(b))}function dt(){e&&e.removeElement();c.proxyCall("removeElement");l.remove();r.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget");r.off(".fc");b&&n(window).unbind("resize",b)}function w(){return r.is(":visible")}function s(t,i){v++;var r=e&&t&&e.type!==t;r&&(ut(),ot());!e&&t&&(e=f.view=d[t]||(d[t]=f.instantiateView(t)),e.setElement(n("<div class='fc-view fc-"+t+"-view' />").appendTo(l)),c.proxyCall("activateButton",t));e&&(o=e.massageCurrentDate(o),e.isDateSet&&o>=e.intervalStart&&o<e.intervalEnd||w()&&(i&&e.captureInitialScroll(i),e.setDate(o,i),i&&e.releaseScroll(),ri()));r&&ft();v--}function ot(){c.proxyCall("deactivateButton",e.type);e.removeElement();e=f.view=null}function gt(){v++;ut();var n=e.type,t=e.queryScroll();ot();g();s(n,t);ft();v--}function st(n){if(w())return n&&ht(),v++,e.updateSize(!0),v--,!0}function g(){w()&&ht()}function ht(){var t=f.options.contentHeight,n=f.options.height;a=typeof t=="number"?t:typeof t=="function"?t():typeof n=="number"?n-nt():typeof n=="function"?n()-nt():n==="parent"?r.parent().height()-nt():Math.round(l.width()/Math.max(f.options.aspectRatio,.5))}function nt(){return c.items.reduce(function(n,t){var i=t.el?t.el.outerHeight(!0):0;return n+i},0)}function ni(n){!v&&n.target===window&&e.start&&st(!0)&&e.publiclyTrigger("windowResize",et)}function ti(){w()&&f.reportEventChange()}function ii(){return[new yu(f,ct()),new yu(f,lt())]}function ct(){return{extraClasses:"fc-header-toolbar",layout:f.options.header}}function lt(){return{extraClasses:"fc-footer-toolbar",layout:f.options.footer}}function at(){y.setToolbarOptions(ct());y.render();y.el&&r.prepend(y.el)}function vt(){p.setToolbarOptions(lt());p.render();p.el&&r.append(p.el)}function ri(){var n=f.getNow();n>=e.intervalStart&&n<e.intervalEnd?c.proxyCall("disableButton","today"):c.proxyCall("enableButton","today")}function ui(){e.select(f.buildSelectSpan.apply(f,arguments))}function fi(){e&&e.unselect()}function ei(){o=e.computePrevDate(o);s()}function oi(){o=e.computeNextDate(o);s()}function si(){o.add(-1,"years");s()}function hi(){o.add(1,"years");s()}function ci(){o=f.getNow();s()}function li(n){o=f.moment(n).stripZone();s()}function ai(n){o.add(t.duration(n));s()}function yt(n,t){var i;t=t||"day";i=f.getViewSpec(t)||f.getUnitViewSpec(t);o=n.clone();s(i?i.type:null)}function vi(){return f.applyTimezone(o)}function ut(){tt++||l.css({width:"100%",height:l.height(),overflow:"hidden"})}function ft(){--tt||l.css({width:"",height:"",overflow:""})}function yi(){return f}function pi(){return e}function wi(n,t){var i;if(typeof n=="string"){if(t===undefined)return f.options[n];i={};i[n]=t;pt(i)}else typeof n=="object"&&pt(n)}function pt(n){var i=0;for(var t in n)f.dynamicOverrides[t]=n[t];f.viewSpecCache={};f.populateOptionsHash();for(t in n)f.triggerOptionHandlers(t),i++;if(i===1){if(t==="height"||t==="contentHeight"||t==="aspectRatio"){st(!0);return}if(t==="defaultDate")return;if(t==="businessHours"){e&&(e.unrenderBusinessHours(),e.renderBusinessHours());return}if(t==="timezone"){f.rezoneArrayEventSources();f.refetchEvents();return}}at();vt();d={};gt()}function bi(n,t){var i=Array.prototype.slice.call(arguments,2);return t=t||et,this.triggerWith(n,t,i),f.options[n]?f.options[n].apply(t,i):void 0}var f=this,h,tt;f.render=bt;f.destroy=dt;f.rerenderEvents=ti;f.changeView=s;f.select=ui;f.unselect=fi;f.prev=ei;f.next=oi;f.prevYear=si;f.nextYear=hi;f.today=ci;f.gotoDate=li;f.incrementDate=ai;f.zoomTo=yt;f.getDate=vi;f.getCalendar=yi;f.getView=pi;f.option=wi;f.publiclyTrigger=bi;f.dynamicOverrides={};f.viewSpecCache={};f.optionHandlers={};f.overrides=n.extend({},u);f.populateOptionsHash();f.bindOptions(["locale","monthNames","monthNamesShort","dayNames","dayNamesShort","firstDay","weekNumberCalculation"],function(n,t,i,r,u,f,e){if(e==="iso"&&(e="ISO"),h=it(wu(n)),t&&(h._months=t),i&&(h._monthsShort=i),r&&(h._weekdays=r),u&&(h._weekdaysShort=u),f==null&&e==="ISO"&&(f=1),f!=null){var s=it(h._week);s.dow=f;h._week=s}(e==="ISO"||e==="local"||typeof e=="function")&&(h._fullCalendar_weekCalc=e);o&&k(o)});f.defaultAllDayEventDuration=t.duration(f.options.defaultAllDayEventDuration);f.defaultTimedEventDuration=t.duration(f.options.defaultTimedEventDuration);f.moment=function(){var n;return f.options.timezone==="local"?(n=i.moment.apply(null,arguments),n.hasTime()&&n.local()):n=f.options.timezone==="UTC"?i.moment.utc.apply(null,arguments):i.moment.parseZone.apply(null,arguments),k(n),n};f.localizeMoment=k;f.getIsAmbigTimezone=function(){return f.options.timezone!=="local"&&f.options.timezone!=="UTC"};f.applyTimezone=function(n){if(!n.hasTime())return n.clone();var t=f.moment(n.toArray()),r=n.time()-t.time(),i;return r&&(i=t.clone().add(r),n.time()-i.time()==0&&(t=i)),t};f.getNow=function(){var n=f.options.now;return typeof n=="function"&&(n=n()),f.moment(n).stripZone()};f.getEventEnd=function(n){return n.end?n.end.clone():f.getDefaultEventEnd(n.allDay,n.start)};f.getDefaultEventEnd=function(n,t){var i=t.clone();return n?i.stripTime().add(f.defaultAllDayEventDuration):i.add(f.defaultTimedEventDuration),f.getIsAmbigTimezone()&&i.stripZone(),i};f.humanizeDuration=function(n){return n.locale(f.options.locale).humanize()};be.call(f);var et=r[0],c,y,p,l,wt,e,d={},a,b,v=0,o;o=f.options.defaultDate!=null?f.moment(f.options.defaultDate).stripZone():f.getNow();f.getSuggestedViewHeight=function(){return a===undefined&&g(),a};f.isHeightAuto=function(){return f.options.contentHeight==="auto"||f.options.height==="auto"};f.setToolbarsTitle=function(n){c.proxyCall("updateTitle",n)};f.freezeContentHeight=ut;f.thawContentHeight=ft;tt=0;f.initialize()}function pu(t){n.each(we,function(n,i){t[n]==null&&(t[n]=i(t))})}function wu(n){return t.localeData(n)||t.localeData("en")}function be(){function bt(n,t){return!r.options.lazyFetching||d(n,t)?g(n,t):f.resolve(c)}function l(){c=dt(o);r.trigger("eventsReset",c)}function dt(n){for(var u=[],i,t=0;t<n.length;t++)i=n[t],i.start.clone().stripZone()<h&&r.getEventEnd(i).stripZone()>s&&u.push(i);return u}function d(n,t){return!s||n<s||t>h}function g(n,t){return s=n,h=t,nt()}function nt(){return y(u,"reset")}function gt(n){return y(ft(n))}function y(n,t){var i,u;for(t==="reset"?o=[]:t!=="add"&&(o=st(o,n)),i=0;i<n.length;i++)u=n[i],u._status!=="pending"&&v++,u._fetchId=(u._fetchId||0)+1,u._status="pending";for(i=0;i<n.length;i++)u=n[i],ni(u,u._fetchId);return v?new f(function(n){r.one("eventsReceived",n)}):f.resolve(c)}function ni(t,i){it(t,function(r){var s=n.isArray(t.events),u,f,e;if(i===t._fetchId&&t._status!=="rejected"){if(t._status="resolved",r)for(u=0;u<r.length;u++)f=r[u],e=s?f:p(f,t),e&&o.push.apply(o,k(e));tt()}})}function ti(n){var t=n._status==="pending";n._status="rejected";t&&tt()}function tt(){v--;v||(l(o),r.trigger("eventsReceived",c))}function it(t,u){for(var a=i.sourceFetchers,c,f,v,o=0;o<a.length;o++){if(c=a[o].call(r,t,s.clone(),h.clone(),r.options.timezone,u),c===!0)return;if(typeof c=="object"){it(c,u);return}}if(f=t.events,f)n.isFunction(f)?(r.pushLoading(),f.call(r,s.clone(),h.clone(),r.options.timezone,function(n){u(n);r.popLoading()})):n.isArray(f)?u(f):u();else if(v=t.url,v){var w=t.success,b=t.error,k=t.complete,d=n.isFunction(t.data)?t.data():t.data;var l=n.extend({},d||{}),y=e(t.startParam,r.options.startParam),p=e(t.endParam,r.options.endParam),g=e(t.timezoneParam,r.options.timezoneParam);y&&(l[y]=s.format());p&&(l[p]=h.format());r.options.timezone&&r.options.timezone!="local"&&(l[g]=r.options.timezone);r.pushLoading();n.ajax(n.extend({},bu,t,{data:l,success:function(t){t=t||[];var i=vt(w,this,arguments);n.isArray(i)&&(t=i);u(t)},error:function(){vt(b,this,arguments);u()},complete:function(){vt(k,this,arguments);r.popLoading()}}))}else u()}function ii(n){var t=rt(n);t&&(u.push(t),y([t],"add"))}function rt(t){var e=i.sourceNormalizers,u,f;if(n.isFunction(t)||n.isArray(t)?u={events:t}:typeof t=="string"?u={url:t}:typeof t=="object"&&(u=n.extend({},t)),u){for(u.className?typeof u.className=="string"&&(u.className=u.className.split(/\s+/)):u.className=[],n.isArray(u.events)&&(u.origArray=u.events,u.events=n.map(u.events,function(n){return p(n,u)})),f=0;f<e.length;f++)e[f].call(r,u);return u}}function ri(n){b(et(n))}function ui(n){n==null?b(u,!0):b(ft(n))}function b(t,i){for(var r=0;r<t.length;r++)ti(t[r]);i?(u=[],o=[]):(u=n.grep(u,function(n){for(r=0;r<t.length;r++)if(n===t[r])return!1;return!0}),o=st(o,t));l()}function fi(){return u.slice(1)}function ut(t){return n.grep(u,function(n){return n.id&&n.id===t})[0]}function ft(t){t?n.isArray(t)||(t=[t]):t=[];for(var r=[],i=0;i<t.length;i++)r.push.apply(r,et(t[i]));return r}function et(t){for(var i,r=0;r<u.length;r++)if(i=u[r],i===t)return[i];return(i=ut(t),i)?[i]:n.grep(u,function(n){return ei(t,n)})}function ei(n,t){return n&&t&&ot(n)==ot(t)}function ot(n){return(typeof n=="object"?n.origArray||n.googleCalendarId||n.url||n.events:null)||n}function st(t,i){return n.grep(t,function(n){for(var t=0;t<i.length;t++)if(n.source===i[t])return!1;return!0})}function oi(n){ht([n])}function ht(n){for(var t,i=0;i<n.length;i++)t=n[i],t.start=r.moment(t.start),t.end=t.end?r.moment(t.end):null,wt(t,si(t));l()}function si(t){var i={};return n.each(t,function(n,t){ct(n)&&t!==undefined&&wf(t)&&(i[n]=t)}),i}function ct(n){return!/^_|^(id|allDay|start|end)$/.test(n)}function hi(n,t){return lt([n],t)}function lt(n,t){for(var r=[],u,s,e,i,f=0;f<n.length;f++)if(s=p(n[f]),s){for(u=k(s),e=0;e<u.length;e++)i=u[e],i.source||(t&&(w.events.push(i),i.source=w),o.push(i));r=r.concat(u)}return r.length&&l(),r}function ci(t){var r,i;for(t==null?t=function(){return!0}:n.isFunction(t)||(r=t+"",t=function(n){return n._id==r}),o=n.grep(o,t,!0),i=0;i<u.length;i++)n.isArray(u[i].events)&&(u[i].events=n.grep(u[i].events,t,!0));l()}function at(t){return n.isFunction(t)?n.grep(o,t):t!=null?(t+="",n.grep(o,function(n){return n._id==t})):o}function li(n){n.start=r.moment(n.start);n.end&&(n.end=r.moment(n.end));kt(n)}function p(i,u){var s={},o,f,h;if(r.options.eventDataTransform&&(i=r.options.eventDataTransform(i)),u&&u.eventDataTransform&&(i=u.eventDataTransform(i)),n.extend(s,i),u&&(s.source=u),s._id=i._id||(i.id===undefined?"_fc"+ku++:i.id+""),s.className=i.className?typeof i.className=="string"?i.className.split(/\s+/):i.className:[],o=i.start||i.date,f=i.end,vr(o)&&(o=t.duration(o)),vr(f)&&(f=t.duration(f)),i.dow||t.isDuration(o)||t.isDuration(f))s.start=o?t.duration(o):null,s.end=f?t.duration(f):null,s._recurring=!0;else{if(o&&(o=r.moment(o),!o.isValid()))return!1;f&&(f=r.moment(f),f.isValid()||(f=null));h=i.allDay;h===undefined&&(h=e(u?u.allDayDefault:undefined,r.options.allDayDefault));yt(o,f,h,s)}return r.normalizeEvent(s),s}function yt(n,t,i,r){r.start=n;r.end=t;r.allDay=i;a(r);kt(r)}function a(n){pt(n);n.end&&!n.end.isAfter(n.start)&&(n.end=null);n.end||(n.end=r.options.forceEventDuration?r.getDefaultEventEnd(n.allDay,n.start):null)}function pt(n){n.allDay==null&&(n.allDay=!(n.start.hasTime()||n.end&&n.end.hasTime()));n.allDay?(n.start.stripTime(),n.end&&n.end.stripTime()):(n.start.hasTime()||(n.start=r.applyTimezone(n.start.time(0))),n.end&&!n.end.hasTime()&&(n.end=r.applyTimezone(n.end.time(0))))}function k(t,i,r){var a=[],f,v,e,u,o,c,l,y,p;if(i=i||s,r=r||h,t)if(t._recurring){if(v=t.dow)for(f={},e=0;e<v.length;e++)f[v[e]]=!0;for(u=i.clone().stripTime();u.isBefore(r);)(!f||f[u.day()])&&(o=t.start,c=t.end,l=u.clone(),y=null,o&&(l=l.time(o)),c&&(y=u.clone().time(c)),p=n.extend({},t),yt(l,y,!o&&!c,p),a.push(p)),u.add(1,"days")}else a.push(t);return a}function wt(t,i,u){function v(n,t){return u?ar(n,t,u):i.allDay?lf(n,t):lr(n,t)}var s={},f,h,e,c,o,l;return i=i||{},i.start||(i.start=t.start.clone()),i.end===undefined&&(i.end=t.end?t.end.clone():null),i.allDay==null&&(i.allDay=t.allDay),a(i),f={start:t._start.clone(),end:t._end?t._end.clone():r.getDefaultEventEnd(t._allDay,t._start),allDay:i.allDay},a(f),h=t._end!==null&&i.end===null,e=v(i.start,f.start),i.end?(c=v(i.end,f.end),o=c.subtract(e)):o=null,n.each(i,function(n,t){ct(n)&&t!==undefined&&(s[n]=t)}),l=ai(at(t._id),h,i.allDay,e,o,s),{dateDelta:e,durationDelta:o,undo:l}}function ai(t,i,u,f,e,o){var h=r.getIsAmbigTimezone(),s=[];return f&&!f.valueOf()&&(f=null),e&&!e.valueOf()&&(e=null),n.each(t,function(t,c){var v,l;v={start:c.start.clone(),end:c.end?c.end.clone():null,allDay:c.allDay};n.each(o,function(n){v[n]=c[n]});l={start:c._start,end:c._end,allDay:u};a(l);i?l.end=null:e&&!l.end&&(l.end=r.getDefaultEventEnd(l.allDay,l.start));f&&(l.start.add(f),l.end&&l.end.add(f));e&&l.end.add(e);h&&!l.allDay&&(f||e)&&(l.start.stripZone(),l.end&&l.end.stripZone());n.extend(c,o,l);kt(c);s.push(function(){n.extend(c,v);kt(c)})}),function(){for(var n=0;n<s.length;n++)s[n]()}}var r=this;r.requestEvents=bt;r.reportEventChange=l;r.isFetchNeeded=d;r.fetchEvents=g;r.fetchEventSources=y;r.refetchEvents=nt;r.refetchEventSources=gt;r.getEventSources=fi;r.getEventSourceById=ut;r.addEventSource=ii;r.removeEventSource=ri;r.removeEventSources=ui;r.updateEvent=oi;r.updateEvents=ht;r.renderEvent=hi;r.renderEvents=lt;r.removeEvents=ci;r.clientEvents=at;r.mutateEvent=wt;r.normalizeEventDates=a;r.normalizeEventTimes=pt;var w={events:[]},u=[w],s,h,v=0,o=[],c;n.each((r.options.events?[r.options.events]:[]).concat(r.options.eventSources||[]),function(n,t){var i=rt(t);i&&u.push(i)});r.getEventCache=function(){return o};r.getPrunedEventCache=function(){return c};r.rezoneArrayEventSources=function(){for(var i,r,t=0;t<u.length;t++)if(i=u[t].events,n.isArray(i))for(r=0;r<i.length;r++)li(i[r])};r.buildEventFromInput=p;r.expandEvent=k}function kt(n){n._allDay=n.allDay;n._start=n.start.clone();n._end=n.end?n.end.clone():null}var i=n.fullCalendar={version:"3.1.0",internalApiVersion:7},o=i.views={},ki,ht,ii,at,yr,ci,dr,pt,tu,ft,ou,l,yi,et,pi,p,bt,u,k,bu,ku,wi,gu,nf;n.fn.fullCalendar=function(t){var r=Array.prototype.slice.call(arguments,1),i=this;return this.each(function(f,e){var s=n(e),o=s.data("fullCalendar"),h;typeof t=="string"?o&&n.isFunction(o[t])&&(h=o[t].apply(o,r),f||(i=h),t==="destroy"&&s.removeData("fullCalendar")):o||(o=new u(s,t),s.data("fullCalendar",o),o.render())}),i};ki=["header","footer","buttonText","buttonIcons","themeButtonIcons"];i.intersectRanges=lt;i.applyAll=vt;i.debounce=rt;i.isInt=w;i.htmlEscape=r;i.cssToStr=yt;i.proxy=g;i.capitaliseFirstLetter=wr;i.getOuterRect=ni;i.getClientRect=rr;i.getContentRect=tf;i.getScrollbarWidths=ti;ht=null;i.preventDefault=ct;i.intersectRects=er;i.parseFieldSpecs=or;i.compareByFieldSpecs=sr;i.compareByFieldSpec=hr;i.flexibleCompare=cr;i.computeIntervalUnit=ri;i.divideRangeByDuration=vf;i.divideDurationByDuration=ui;i.multiplyDuration=yf;i.durationHasTime=d;ii=["sun","mon","tue","wed","thu","fri","sat"];at=["year","month","week","day","hour","minute","second","millisecond"];i.log=function(){var n=window.console;if(n&&n.log)return n.log.apply(n,arguments)};i.warn=function(){var n=window.console;return n&&n.warn?n.warn.apply(n,arguments):i.log.apply(i,arguments)};yr={}.hasOwnProperty;i.createObject=it;var df=/^\s*\d{4}-\d\d$/,gf=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/,s=t.fn,y=n.extend({},s),si=t.momentProperties;si.push("_fullCalendar");si.push("_ambigTime");si.push("_ambigZone");i.moment=function(){return hi(arguments)};i.moment.utc=function(){var n=hi(arguments,!0);return n.hasTime()&&n.utc(),n};i.moment.parseZone=function(){return hi(arguments,!0,!0)};s.week=s.weeks=function(n){var t=this._locale._fullCalendar_weekCalc;return n==null&&typeof t=="function"?t(this):t==="ISO"?y.isoWeek.apply(this,arguments):y.week.apply(this,arguments)};s.time=function(n){if(!this._fullCalendar)return y.time.apply(this,arguments);if(n==null)return t.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});this._ambigTime=!1;t.isDuration(n)||t.isMoment(n)||(n=t.duration(n));var i=0;return t.isDuration(n)&&(i=Math.floor(n.asDays())*24),this.hours(i+n.hours()).minutes(n.minutes()).seconds(n.seconds()).milliseconds(n.milliseconds())};s.stripTime=function(){return this._ambigTime||(this.utc(!0),this.set({hours:0,minutes:0,seconds:0,ms:0}),this._ambigTime=!0,this._ambigZone=!0),this};s.hasTime=function(){return!this._ambigTime};s.stripZone=function(){var n;return this._ambigZone||(n=this._ambigTime,this.utc(!0),this._ambigTime=n||!1,this._ambigZone=!0),this};s.hasZone=function(){return!this._ambigZone};s.local=function(n){return y.local.call(this,this._ambigZone||n),this._ambigTime=!1,this._ambigZone=!1,this};s.utc=function(n){return y.utc.call(this,n),this._ambigTime=!1,this._ambigZone=!1,this};s.utcOffset=function(n){return n!=null&&(this._ambigTime=!1,this._ambigZone=!1),y.utcOffset.apply(this,arguments)};s.format=function(){return this._fullCalendar&&arguments[0]?ne(this,arguments[0]):this._ambigTime?b(this,"YYYY-MM-DD"):this._ambigZone?b(this,"YYYY-MM-DD[T]HH:mm:ss"):y.format.apply(this,arguments)};s.toISOString=function(){return this._ambigTime?b(this,"YYYY-MM-DD"):this._ambigZone?b(this,"YYYY-MM-DD[T]HH:mm:ss"):y.toISOString.apply(this,arguments)};ci={t:function(n){return b(n,"a").charAt(0)},T:function(n){return b(n,"A").charAt(0)}};i.formatRange=kr;dr={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"};pt={};tu={Y:{value:1,unit:"year"},M:{value:2,unit:"month"},W:{value:3,unit:"week"},w:{value:3,unit:"week"},D:{value:4,unit:"day"},d:{value:4,unit:"day"}};i.queryMostGranularFormatUnit=function(n){for(var f=ai(n),u,r,t,i=0;i<f.length;i++)u=f[i],u.token&&(r=tu[u.token.charAt(0)],r&&(!t||r.value>t.value)&&(t=r));return t?t.unit:null};i.Class=h;h.extend=function(){for(var i=arguments.length,t,n=0;n<i;n++)t=arguments[n],n<i-1&&iu(this,t);return ie(this,t||{})};h.mixin=function(n){iu(this,n)};i.Promise=f;f.immediate=!0;f.resolve=function(t){var r,i,u;return t&&typeof t.resolve=="function"?t.promise():t&&typeof t.then=="function"?t:(r=n.Deferred().resolve(t),i=r.promise(),f.immediate&&(u=i.then,i._value=t,i.then=function(n,r){return typeof n=="function"?f.resolve(n(t)):u.call(i,n,r)}),i)};f.reject=function(){return n.Deferred().reject().promise()};f.all=function(t){var e=!1,r,u,i;if(f.immediate)for(e=!0,r=[],u=0;u<t.length;u++)if(i=t[u],i&&typeof i.state=="function"&&i.state()==="resolved"&&"_value"in i)r.push(i._value);else if(i&&typeof i.then=="function"){e=!1;break}else r.push(i);return e?f.resolve(r):n.when.apply(n.when,t).then(function(){return n.when(n.makeArray(arguments))})};i.TaskQueue=vi;var ru=i.EmitterMixin={on:function(t,i){n(this).on(t,this._prepareIntercept(i));return this},one:function(t,i){n(this).one(t,this._prepareIntercept(i));return this},_prepareIntercept:function(t){var i=function(n,i){return t.apply(i.context||this,i.args||[])};return t.guid||(t.guid=n.guid++),i.guid=t.guid,i},off:function(t,i){return n(this).off(t,i),this},trigger:function(t){var i=Array.prototype.slice.call(arguments,1);return n(this).triggerHandler(t,{args:i}),this},triggerWith:function(t,i,r){return n(this).triggerHandler(t,{context:i,args:r}),this}},ut=i.ListenerMixin=function(){var t=0;return{listenerId:null,listenTo:function(t,i,r){if(typeof i=="object")for(var u in i)i.hasOwnProperty(u)&&this.listenTo(t,u,i[u]);else if(typeof i=="string")t.on(i+"."+this.getListenerNamespace(),n.proxy(r,this))},stopListeningTo:function(n,t){n.off((t||"")+"."+this.getListenerNamespace())},getListenerNamespace:function(){return this.listenerId==null&&(this.listenerId=t++),"_listener"+this.listenerId}}}(),uu={isIgnoringMouse:!1,delayUnignoreMouse:null,initMouseIgnoring:function(n){this.delayUnignoreMouse=rt(g(this,"unignoreMouse"),n||1e3)},tempIgnoreMouse:function(){this.isIgnoringMouse=!0;this.delayUnignoreMouse()},unignoreMouse:function(){this.isIgnoringMouse=!1}},re=h.extend(ut,{isHidden:!0,options:null,el:null,margin:10,constructor:function(n){this.options=n||{}},show:function(){this.isHidden&&(this.el||this.render(),this.el.show(),this.position(),this.isHidden=!1,this.trigger("show"))},hide:function(){this.isHidden||(this.el.hide(),this.isHidden=!0,this.trigger("hide"))},render:function(){var i=this,t=this.options;this.el=n('<div class="fc-popover"/>').addClass(t.className||"").css({top:0,left:0}).append(t.content).appendTo(t.parentEl);this.el.on("click",".fc-close",function(){i.hide()});t.autoHide&&this.listenTo(n(document),"mousedown",this.documentMousedown)},documentMousedown:function(t){this.el&&!n(t.target).closest(this.el).length&&this.hide()},removeElement:function(){this.hide();this.el&&(this.el.remove(),this.el=null);this.stopListeningTo(n(document),"mousedown")},position:function(){var t=this.options,h=this.el.offsetParent().offset(),c=this.el.outerWidth(),l=this.el.outerHeight(),o=n(window),i=gt(this.el),f,e,s,r,u;r=t.top||0;u=t.left!==undefined?t.left:t.right!==undefined?t.right-c:0;i.is(window)||i.is(document)?(i=o,f=0,e=0):(s=i.offset(),f=s.top,e=s.left);f+=o.scrollTop();e+=o.scrollLeft();t.viewportConstrain!==!1&&(r=Math.min(r,f+i.outerHeight()-l-this.margin),r=Math.max(r,f+this.margin),u=Math.min(u,e+i.outerWidth()-c-this.margin),u=Math.max(u,e+this.margin));this.el.css({top:r-h.top,left:u-h.left})},trigger:function(n){this.options[n]&&this.options[n].apply(this,Array.prototype.slice.call(arguments,1))}}),wt=i.CoordCache=h.extend({els:null,forcedOffsetParentEl:null,origin:null,boundingRect:null,isHorizontal:!1,isVertical:!1,lefts:null,rights:null,tops:null,bottoms:null,constructor:function(t){this.els=n(t.els);this.isHorizontal=t.isHorizontal;this.isVertical=t.isVertical;this.forcedOffsetParentEl=t.offsetParent?n(t.offsetParent):null},build:function(){var n=this.forcedOffsetParentEl;!n&&this.els.length>0&&(n=this.els.eq(0).offsetParent());this.origin=n?n.offset():null;this.boundingRect=this.queryBoundingRect();this.isHorizontal&&this.buildElHorizontals();this.isVertical&&this.buildElVerticals()},clear:function(){this.origin=null;this.boundingRect=null;this.lefts=null;this.rights=null;this.tops=null;this.bottoms=null},ensureBuilt:function(){this.origin||this.build()},buildElHorizontals:function(){var t=[],i=[];this.els.each(function(r,u){var f=n(u),e=f.offset().left,o=f.outerWidth();t.push(e);i.push(e+o)});this.lefts=t;this.rights=i},buildElVerticals:function(){var t=[],i=[];this.els.each(function(r,u){var f=n(u),e=f.offset().top,o=f.outerHeight();t.push(e);i.push(e+o)});this.tops=t;this.bottoms=i},getHorizontalIndex:function(n){this.ensureBuilt();for(var i=this.lefts,r=this.rights,u=i.length,t=0;t<u;t++)if(n>=i[t]&&n<r[t])return t},getVerticalIndex:function(n){this.ensureBuilt();for(var i=this.tops,r=this.bottoms,u=i.length,t=0;t<u;t++)if(n>=i[t]&&n<r[t])return t},getLeftOffset:function(n){return this.ensureBuilt(),this.lefts[n]},getLeftPosition:function(n){return this.ensureBuilt(),this.lefts[n]-this.origin.left},getRightOffset:function(n){return this.ensureBuilt(),this.rights[n]},getRightPosition:function(n){return this.ensureBuilt(),this.rights[n]-this.origin.left},getWidth:function(n){return this.ensureBuilt(),this.rights[n]-this.lefts[n]},getTopOffset:function(n){return this.ensureBuilt(),this.tops[n]},getTopPosition:function(n){return this.ensureBuilt(),this.tops[n]-this.origin.top},getBottomOffset:function(n){return this.ensureBuilt(),this.bottoms[n]},getBottomPosition:function(n){return this.ensureBuilt(),this.bottoms[n]-this.origin.top},getHeight:function(n){return this.ensureBuilt(),this.bottoms[n]-this.tops[n]},queryBoundingRect:function(){var n;return this.els.length>0&&(n=gt(this.els.eq(0)),!n.is(document))?rr(n):null},isPointInBounds:function(n,t){return this.isLeftInBounds(n)&&this.isTopInBounds(t)},isLeftInBounds:function(n){return!this.boundingRect||n>=this.boundingRect.left&&n<this.boundingRect.right},isTopInBounds:function(n){return!this.boundingRect||n>=this.boundingRect.top&&n<this.boundingRect.bottom}}),c=i.DragListener=h.extend(ut,uu,{options:null,subjectEl:null,originX:null,originY:null,scrollEl:null,isInteracting:!1,isDistanceSurpassed:!1,isDelayEnded:!1,isDragging:!1,isTouch:!1,delay:null,delayTimeoutId:null,minDistance:null,handleTouchScrollProxy:null,constructor:function(n){this.options=n||{};this.handleTouchScrollProxy=g(this,"handleTouchScroll");this.initMouseIgnoring(500)},startInteraction:function(t,i){var r=fr(t);if(t.type==="mousedown"){if(this.isIgnoringMouse)return;if(ur(t))t.preventDefault();else return}this.isInteracting||(i=i||{},this.delay=e(i.delay,this.options.delay,0),this.minDistance=e(i.distance,this.options.distance,0),this.subjectEl=this.options.subjectEl,this.isInteracting=!0,this.isTouch=r,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.originX=a(t),this.originY=v(t),this.scrollEl=gt(n(t.target)),this.bindHandlers(),this.initAutoScroll(),this.handleInteractionStart(t),this.startDelay(t),this.minDistance||this.handleDistanceSurpassed(t))},handleInteractionStart:function(n){this.trigger("interactionStart",n)},endInteraction:function(n,t){this.isInteracting&&(this.endDrag(n),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null),this.destroyAutoScroll(),this.unbindHandlers(),this.isInteracting=!1,this.handleInteractionEnd(n,t),this.isTouch&&this.tempIgnoreMouse())},handleInteractionEnd:function(n,t){this.trigger("interactionEnd",n,t||!1)},bindHandlers:function(){var i=this,t=1;this.isTouch?(this.listenTo(n(document),{touchmove:this.handleTouchMove,touchend:this.endInteraction,touchcancel:this.endInteraction,touchstart:function(n){t?t--:i.endInteraction(n,!0)}}),!ef(this.handleTouchScrollProxy)&&this.scrollEl&&this.listenTo(this.scrollEl,"scroll",this.handleTouchScroll)):this.listenTo(n(document),{mousemove:this.handleMouseMove,mouseup:this.endInteraction});this.listenTo(n(document),{selectstart:ct,contextmenu:ct})},unbindHandlers:function(){this.stopListeningTo(n(document));of(this.handleTouchScrollProxy);this.scrollEl&&this.stopListeningTo(this.scrollEl,"scroll")},startDrag:function(n,t){this.startInteraction(n,t);this.isDragging||(this.isDragging=!0,this.handleDragStart(n))},handleDragStart:function(n){this.trigger("dragStart",n)},handleMove:function(n){var t=a(n)-this.originX,i=v(n)-this.originY,r=this.minDistance,u;this.isDistanceSurpassed||(u=t*t+i*i,u>=r*r&&this.handleDistanceSurpassed(n));this.isDragging&&this.handleDrag(t,i,n)},handleDrag:function(n,t,i){this.trigger("drag",n,t,i);this.updateAutoScroll(i)},endDrag:function(n){this.isDragging&&(this.isDragging=!1,this.handleDragEnd(n))},handleDragEnd:function(n){this.trigger("dragEnd",n)},startDelay:function(n){var t=this;this.delay?this.delayTimeoutId=setTimeout(function(){t.handleDelayEnd(n)},this.delay):this.handleDelayEnd(n)},handleDelayEnd:function(n){this.isDelayEnded=!0;this.isDistanceSurpassed&&this.startDrag(n)},handleDistanceSurpassed:function(n){this.isDistanceSurpassed=!0;this.isDelayEnded&&this.startDrag(n)},handleTouchMove:function(n){this.isDragging&&n.preventDefault();this.handleMove(n)},handleMouseMove:function(n){this.handleMove(n)},handleTouchScroll:function(n){this.isDragging||this.endInteraction(n,!0)},trigger:function(n){this.options[n]&&this.options[n].apply(this,Array.prototype.slice.call(arguments,1));this["_"+n]&&this["_"+n].apply(this,Array.prototype.slice.call(arguments,1))}});c.mixin({isAutoScroll:!1,scrollBounds:null,scrollTopVel:null,scrollLeftVel:null,scrollIntervalId:null,scrollSensitivity:30,scrollSpeed:200,scrollIntervalMs:50,initAutoScroll:function(){var n=this.scrollEl;this.isAutoScroll=this.options.scroll&&n&&!n.is(window)&&!n.is(document);this.isAutoScroll&&this.listenTo(n,"scroll",rt(this.handleDebouncedScroll,100))},destroyAutoScroll:function(){this.endAutoScroll();this.isAutoScroll&&this.stopListeningTo(this.scrollEl,"scroll")},computeScrollBounds:function(){this.isAutoScroll&&(this.scrollBounds=ni(this.scrollEl))},updateAutoScroll:function(n){var t=this.scrollSensitivity,i=this.scrollBounds,r,u,f,e,o=0,s=0;i&&(r=(t-(v(n)-i.top))/t,u=(t-(i.bottom-v(n)))/t,f=(t-(a(n)-i.left))/t,e=(t-(i.right-a(n)))/t,r>=0&&r<=1?o=r*this.scrollSpeed*-1:u>=0&&u<=1&&(o=u*this.scrollSpeed),f>=0&&f<=1?s=f*this.scrollSpeed*-1:e>=0&&e<=1&&(s=e*this.scrollSpeed));this.setScrollVel(o,s)},setScrollVel:function(n,t){this.scrollTopVel=n;this.scrollLeftVel=t;this.constrainScrollVel();(this.scrollTopVel||this.scrollLeftVel)&&!this.scrollIntervalId&&(this.scrollIntervalId=setInterval(g(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var n=this.scrollEl;this.scrollTopVel<0?n.scrollTop()<=0&&(this.scrollTopVel=0):this.scrollTopVel>0&&n.scrollTop()+n[0].clientHeight>=n[0].scrollHeight&&(this.scrollTopVel=0);this.scrollLeftVel<0?n.scrollLeft()<=0&&(this.scrollLeftVel=0):this.scrollLeftVel>0&&n.scrollLeft()+n[0].clientWidth>=n[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var n=this.scrollEl,t=this.scrollIntervalMs/1e3;this.scrollTopVel&&n.scrollTop(n.scrollTop()+this.scrollTopVel*t);this.scrollLeftVel&&n.scrollLeft(n.scrollLeft()+this.scrollLeftVel*t);this.constrainScrollVel();this.scrollTopVel||this.scrollLeftVel||this.endAutoScroll()},endAutoScroll:function(){this.scrollIntervalId&&(clearInterval(this.scrollIntervalId),this.scrollIntervalId=null,this.handleScrollEnd())},handleDebouncedScroll:function(){this.scrollIntervalId||this.handleScrollEnd()},handleScrollEnd:function(){}});ft=c.extend({component:null,origHit:null,hit:null,coordAdjust:null,constructor:function(n,t){c.call(this,t);this.component=n},handleInteractionStart:function(n){var r=this.subjectEl,i,u,t;this.computeCoords();n?(u={left:a(n),top:v(n)},t=u,r&&(i=ni(r),t=sf(t,i)),this.origHit=this.queryHit(t.left,t.top),r&&this.options.subjectCenter&&(this.origHit&&(i=er(this.origHit,i)||i),t=hf(i)),this.coordAdjust=cf(t,u)):(this.origHit=null,this.coordAdjust=null);c.prototype.handleInteractionStart.apply(this,arguments)},computeCoords:function(){this.component.prepareHits();this.computeScrollBounds()},handleDragStart:function(n){var t;c.prototype.handleDragStart.apply(this,arguments);t=this.queryHit(a(n),v(n));t&&this.handleHitOver(t)},handleDrag:function(n,t,i){var r;c.prototype.handleDrag.apply(this,arguments);r=this.queryHit(a(i),v(i));fu(r,this.hit)||(this.hit&&this.handleHitOut(),r&&this.handleHitOver(r))},handleDragEnd:function(){this.handleHitDone();c.prototype.handleDragEnd.apply(this,arguments)},handleHitOver:function(n){var t=fu(n,this.origHit);this.hit=n;this.trigger("hitOver",this.hit,t,this.origHit)},handleHitOut:function(){this.hit&&(this.trigger("hitOut",this.hit),this.handleHitDone(),this.hit=null)},handleHitDone:function(){this.hit&&this.trigger("hitDone",this.hit)},handleInteractionEnd:function(){c.prototype.handleInteractionEnd.apply(this,arguments);this.origHit=null;this.hit=null;this.component.releaseHits()},handleScrollEnd:function(){c.prototype.handleScrollEnd.apply(this,arguments);this.computeCoords()},queryHit:function(n,t){return this.coordAdjust&&(n+=this.coordAdjust.left,t+=this.coordAdjust.top),this.component.queryHit(n,t)}});ou=h.extend(ut,{options:null,sourceEl:null,el:null,parentEl:null,top0:null,left0:null,y0:null,x0:null,topDelta:null,leftDelta:null,isFollowing:!1,isHidden:!1,isAnimating:!1,constructor:function(t,i){this.options=i=i||{};this.sourceEl=t;this.parentEl=i.parentEl?n(i.parentEl):t.parent()},start:function(t){this.isFollowing||(this.isFollowing=!0,this.y0=v(t),this.x0=a(t),this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),fr(t)?this.listenTo(n(document),"touchmove",this.handleMove):this.listenTo(n(document),"mousemove",this.handleMove))},stop:function(t,i){function f(){r.isAnimating=!1;r.removeElement();r.top0=r.left0=null;i&&i()}var r=this,u=this.options.revertDuration;this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,this.stopListeningTo(n(document)),t&&u&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:u,complete:f})):f())},getEl:function(){var n=this.el;return n||(n=this.el=this.sourceEl.clone().addClass(this.options.additionalClass||"").css({position:"absolute",visibility:"",display:this.isHidden?"none":"",margin:0,right:"auto",bottom:"auto",width:this.sourceEl.width(),height:this.sourceEl.height(),opacity:this.options.opacity||"",zIndex:this.options.zIndex}),n.addClass("fc-unselectable"),n.appendTo(this.parentEl)),n},removeElement:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var n,t;this.getEl();this.top0===null&&(n=this.sourceEl.offset(),t=this.el.offsetParent().offset(),this.top0=n.top-t.top,this.left0=n.left-t.left);this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},handleMove:function(n){this.topDelta=v(n)-this.y0;this.leftDelta=a(n)-this.x0;this.isHidden||this.updatePosition()},hide:function(){this.isHidden||(this.isHidden=!0,this.el&&this.el.hide())},show:function(){this.isHidden&&(this.isHidden=!1,this.updatePosition(),this.getEl().show())}});l=i.Grid=h.extend(ut,uu,{hasDayInteractions:!0,view:null,isRTL:null,start:null,end:null,el:null,elsByFill:null,eventTimeFormat:null,displayEventTime:null,displayEventEnd:null,minResizeDuration:null,largeUnit:null,dayDragListener:null,segDragListener:null,segResizeListener:null,externalDragListener:null,constructor:function(n){this.view=n;this.isRTL=n.opt("isRTL");this.elsByFill={};this.dayDragListener=this.buildDayDragListener();this.initMouseIgnoring()},computeEventTimeFormat:function(){return this.view.opt("smallTimeFormat")},computeDisplayEventTime:function(){return!0},computeDisplayEventEnd:function(){return!0},setRange:function(n){this.start=n.start.clone();this.end=n.end.clone();this.rangeUpdated();this.processRangeOptions()},rangeUpdated:function(){},processRangeOptions:function(){var n=this.view,t,i;this.eventTimeFormat=n.opt("eventTimeFormat")||n.opt("timeFormat")||this.computeEventTimeFormat();t=n.opt("displayEventTime");t==null&&(t=this.computeDisplayEventTime());i=n.opt("displayEventEnd");i==null&&(i=this.computeDisplayEventEnd());this.displayEventTime=t;this.displayEventEnd=i},spanToSegs:function(){},diffDates:function(n,t){return this.largeUnit?ar(n,t,this.largeUnit):lr(n,t)},prepareHits:function(){},releaseHits:function(){},queryHit:function(){},getHitSpan:function(){},getHitEl:function(){},setElement:function(n){this.el=n;this.hasDayInteractions&&(ff(n),this.bindDayHandler("touchstart",this.dayTouchStart),this.bindDayHandler("mousedown",this.dayMousedown));this.bindSegHandlers();this.bindGlobalHandlers()},bindDayHandler:function(t,i){var r=this;this.el.on(t,function(t){if(!n(t.target).is(r.segSelector+","+r.segSelector+" *,.fc-more,a[data-goto]"))return i.call(r,t)})},removeElement:function(){this.unbindGlobalHandlers();this.clearDragListeners();this.el.remove()},renderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},bindGlobalHandlers:function(){this.listenTo(n(document),{dragstart:this.externalDragStart,sortstart:this.externalDragStart})},unbindGlobalHandlers:function(){this.stopListeningTo(n(document))},dayMousedown:function(n){this.isIgnoringMouse||this.dayDragListener.startInteraction(n,{})},dayTouchStart:function(n){var t=this.view,i=t.opt("selectLongPressDelay");(t.isSelected||t.selectedEvent)&&this.tempIgnoreMouse();i==null&&(i=t.opt("longPressDelay"));this.dayDragListener.startInteraction(n,{delay:i})},buildDayDragListener:function(){var n=this,r=this.view,f=r.opt("selectable"),i,t,u=new ft(this,{scroll:r.opt("dragScroll"),interactionStart:function(){i=u.origHit;t=null},dragStart:function(){r.unselect()},hitOver:function(r,u,e){e&&(u||(i=null),f&&(t=n.computeSelection(n.getHitSpan(e),n.getHitSpan(r)),t?n.renderSelection(t):t===!1&&ot()))},hitOut:function(){i=null;t=null;n.unrenderSelection()},hitDone:function(){st()},interactionEnd:function(u,f){f||(i&&!n.isIgnoringMouse&&r.triggerDayClick(n.getHitSpan(i),n.getHitEl(i),u),t&&r.reportSelection(t,u))}});return u},clearDragListeners:function(){this.dayDragListener.endInteraction();this.segDragListener&&this.segDragListener.endInteraction();this.segResizeListener&&this.segResizeListener.endInteraction();this.externalDragListener&&this.externalDragListener.endInteraction()},renderEventLocationHelper:function(n,t){var i=this.fabricateHelperEvent(n,t);return this.renderHelper(i,t)},fabricateHelperEvent:function(n,t){var i=t?it(t.event):{};return i.start=n.start.clone(),i.end=n.end?n.end.clone():null,i.allDay=null,this.view.calendar.normalizeEventDates(i),i.className=(i.className||[]).concat("fc-helper"),t||(i.editable=!1),i},renderHelper:function(){},unrenderHelper:function(){},renderSelection:function(n){this.renderHighlight(n)},unrenderSelection:function(){this.unrenderHighlight()},computeSelection:function(n,t){var i=this.computeSelectionSpan(n,t);return i&&!this.view.calendar.isSelectionSpanAllowed(i)?!1:i},computeSelectionSpan:function(n,t){var i=[n.start,n.end,t.start,t.end];return i.sort(kf),{start:i[0].clone(),end:i[3].clone()}},renderHighlight:function(n){this.renderFill("highlight",this.spanToSegs(n))},unrenderHighlight:function(){this.unrenderFill("highlight")},highlightSegClasses:function(){return["fc-highlight"]},renderBusinessHours:function(){},unrenderBusinessHours:function(){},getNowIndicatorUnit:function(){},renderNowIndicator:function(){},unrenderNowIndicator:function(){},renderFill:function(){},unrenderFill:function(n){var t=this.elsByFill[n];t&&(t.remove(),delete this.elsByFill[n])},renderFillSegEls:function(t,i){var u=this,f=this[t+"SegEl"],e="",o=[],r;if(i.length){for(r=0;r<i.length;r++)e+=this.fillSegHtml(t,i[r]);n(e).each(function(t,r){var s=i[t],e=n(r);f&&(e=f.call(u,s,e));e&&(e=n(e),e.is(u.fillSegTag)&&(s.el=e,o.push(s)))})}return o},fillSegTag:"div",fillSegHtml:function(n,t){var i=this[n+"SegClasses"],r=this[n+"SegCss"],u=i?i.call(this,t):[],f=yt(r?r.call(this,t):{});return"<"+this.fillSegTag+(u.length?' class="'+u.join(" ")+'"':"")+(f?' style="'+f+'"':"")+" />"},getDayClasses:function(n,t){var r=this.view,u=r.calendar.getNow(),i=["fc-"+ii[n.day()]];return r.intervalDuration.as("months")==1&&n.month()!=r.intervalStart.month()&&i.push("fc-other-month"),n.isSame(u,"day")?(i.push("fc-today"),t!==!0&&i.push(r.highlightStateClass)):n<u?i.push("fc-past"):i.push("fc-future"),i}});l.mixin({segSelector:".fc-event-container > *",mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,isDraggingExternal:!1,segs:null,renderEvents:function(n){for(var i=[],r=[],t=0;t<n.length;t++)(hu(n[t])?i:r).push(n[t]);this.segs=[].concat(this.renderBgEvents(i),this.renderFgEvents(r))},renderBgEvents:function(n){var t=this.eventsToSegs(n);return this.renderBgSegs(t)||t},renderFgEvents:function(n){var t=this.eventsToSegs(n);return this.renderFgSegs(t)||t},unrenderEvents:function(){this.handleSegMouseout();this.clearDragListeners();this.unrenderFgSegs();this.unrenderBgSegs();this.segs=null},getEventSegs:function(){return this.segs||[]},renderFgSegs:function(){},unrenderFgSegs:function(){},renderFgSegEls:function(t,i){var e=this.view,u="",f=[],r;if(t.length){for(r=0;r<t.length;r++)u+=this.fgSegHtml(t[r],i);n(u).each(function(i,r){var u=t[i],o=e.resolveEventEl(u.event,n(r));o&&(o.data("fc-seg",u),u.el=o,f.push(u))})}return f},fgSegHtml:function(){},renderBgSegs:function(n){return this.renderFill("bgEvent",n)},unrenderBgSegs:function(){this.unrenderFill("bgEvent")},bgEventSegEl:function(n,t){return this.view.resolveEventEl(n.event,t)},bgEventSegClasses:function(n){var t=n.event,i=t.source||{};return["fc-bgevent"].concat(t.className,i.className||[])},bgEventSegCss:function(n){return{"background-color":this.getSegSkinCss(n)["background-color"]}},businessHoursSegClasses:function(){return["fc-nonbusiness","fc-bgevent"]},buildBusinessHourSegs:function(n,t){return this.eventsToSegs(this.buildBusinessHourEvents(n,t))},buildBusinessHourEvents:function(t,i){var u=this.view.calendar,r;return i==null&&(i=u.options.businessHours),r=u.computeBusinessHourEvents(t,i),!r.length&&i&&(r=[n.extend({},wi,{start:this.view.end,end:this.view.end,dow:null})]),r},bindSegHandlers:function(){this.bindSegHandlersToEl(this.el)},bindSegHandlersToEl:function(n){this.bindSegHandlerToEl(n,"touchstart",this.handleSegTouchStart);this.bindSegHandlerToEl(n,"touchend",this.handleSegTouchEnd);this.bindSegHandlerToEl(n,"mouseenter",this.handleSegMouseover);this.bindSegHandlerToEl(n,"mouseleave",this.handleSegMouseout);this.bindSegHandlerToEl(n,"mousedown",this.handleSegMousedown);this.bindSegHandlerToEl(n,"click",this.handleSegClick)},bindSegHandlerToEl:function(t,i,r){var u=this;t.on(i,this.segSelector,function(t){var i=n(this).data("fc-seg");if(i&&!u.isDraggingSeg&&!u.isResizingSeg)return r.call(u,i,t)})},handleSegClick:function(n,t){var i=this.view.publiclyTrigger("eventClick",n.el[0],n.event,t);i===!1&&t.preventDefault()},handleSegMouseover:function(n,t){this.isIgnoringMouse||this.mousedOverSeg||(this.mousedOverSeg=n,this.view.isEventResizable(n.event)&&n.el.addClass("fc-allow-mouse-resize"),this.view.publiclyTrigger("eventMouseover",n.el[0],n.event,t))},handleSegMouseout:function(n,t){t=t||{};this.mousedOverSeg&&(n=n||this.mousedOverSeg,this.mousedOverSeg=null,this.view.isEventResizable(n.event)&&n.el.removeClass("fc-allow-mouse-resize"),this.view.publiclyTrigger("eventMouseout",n.el[0],n.event,t))},handleSegMousedown:function(n,t){var i=this.startSegResize(n,t,{distance:5});!i&&this.view.isEventDraggable(n.event)&&this.buildSegDragListener(n).startInteraction(t,{distance:5})},handleSegTouchStart:function(n,t){var i=this.view,u=n.event,f=i.isEventSelected(u),e=i.isEventDraggable(u),o=i.isEventResizable(u),s=!1,h,r;f&&o&&(s=this.startSegResize(n,t));!s&&(e||o)&&(r=i.opt("eventLongPressDelay"),r==null&&(r=i.opt("longPressDelay")),h=e?this.buildSegDragListener(n):this.buildSegSelectListener(n),h.startInteraction(t,{delay:f?0:r}));this.tempIgnoreMouse()},handleSegTouchEnd:function(){this.tempIgnoreMouse()},startSegResize:function(t,i,r){return n(i.target).is(".fc-resizer")?(this.buildSegResizeListener(t,n(i.target).is(".fc-start-resizer")).startInteraction(i,r),!0):!1},buildSegDragListener:function(n){var r=this,t=this.view,h=t.calendar,s=n.el,u=n.event,o,f,i,e;return this.segDragListener?this.segDragListener:e=this.segDragListener=new ft(t,{scroll:t.opt("dragScroll"),subjectEl:s,subjectCenter:!0,interactionStart:function(i){n.component=r;o=!1;f=new ou(n.el,{additionalClass:"fc-dragging",parentEl:t.el,opacity:e.isTouch?null:t.opt("dragOpacity"),revertDuration:t.opt("dragRevertDuration"),zIndex:2});f.hide();f.start(i)},dragStart:function(i){e.isTouch&&!t.isEventSelected(u)&&t.selectEvent(u);o=!0;r.handleSegMouseout(n,i);r.segDragStart(n,i);t.hideEvent(u)},hitOver:function(o,s,c){var l;n.hit&&(c=n.hit);i=r.computeEventDrop(c.component.getHitSpan(c),o.component.getHitSpan(o),u);i&&!h.isEventSpanAllowed(r.eventToSpan(i),u)&&(ot(),i=null);i&&(l=t.renderDrag(i,n))?(l.addClass("fc-dragging"),e.isTouch||r.applyDragOpacity(l),f.hide()):f.show();s&&(i=null)},hitOut:function(){t.unrenderDrag();f.show();i=null},hitDone:function(){st()},interactionEnd:function(e){delete n.component;f.stop(!i,function(){o&&(t.unrenderDrag(),r.segDragStop(n,e));i?t.reportEventDrop(u,i,r.largeUnit,s,e):t.showEvent(u)});r.segDragListener=null}})},buildSegSelectListener:function(n){var u=this,t=this.view,i=n.event,r;return this.segDragListener?this.segDragListener:r=this.segDragListener=new c({dragStart:function(){r.isTouch&&!t.isEventSelected(i)&&t.selectEvent(i)},interactionEnd:function(){u.segDragListener=null}})},segDragStart:function(n,t){this.isDraggingSeg=!0;this.view.publiclyTrigger("eventDragStart",n.el[0],n.event,t,{})},segDragStop:function(n,t){this.isDraggingSeg=!1;this.view.publiclyTrigger("eventDragStop",n.el[0],n.event,t,{})},computeEventDrop:function(n,t,i){var e=this.view.calendar,o=n.start,u=t.start,f,r;return o.hasTime()===u.hasTime()?(f=this.diffDates(u,o),i.allDay&&d(f)?(r={start:i.start.clone(),end:e.getEventEnd(i),allDay:!1},e.normalizeEventTimes(r)):r=su(i),r.start.add(f),r.end&&r.end.add(f)):r={start:u.clone(),end:null,allDay:!u.hasTime()},r},applyDragOpacity:function(n){var t=this.view.opt("dragOpacity");t!=null&&n.css("opacity",t)},externalDragStart:function(t,i){var f=this.view,r,u;f.opt("droppable")&&(r=n((i?i.item:null)||t.target),u=f.opt("dropAccept"),(n.isFunction(u)?u.call(r[0],r):r.is(u))&&(this.isDraggingExternal||this.listenToExternalDrag(r,t,i)))},listenToExternalDrag:function(n,t,i){var u=this,e=this.view.calendar,f=oe(n),r,o=u.externalDragListener=new ft(this,{interactionStart:function(){u.isDraggingExternal=!0},hitOver:function(n){r=u.computeExternalDrop(n.component.getHitSpan(n),f);r&&!e.isExternalSpanAllowed(u.eventToSpan(r),r,f.eventProps)&&(ot(),r=null);r&&u.renderDrag(r)},hitOut:function(){r=null},hitDone:function(){st();u.unrenderDrag()},interactionEnd:function(t){r&&u.view.reportExternalDrop(f,r,n,t,i);u.isDraggingExternal=!1;u.externalDragListener=null}});o.startDrag(t)},computeExternalDrop:function(n,t){var r=this.view.calendar,i={start:r.applyTimezone(n.start),end:null};return t.startTime&&!i.start.hasTime()&&i.start.time(t.startTime),t.duration&&(i.end=i.start.clone().add(t.duration)),i},renderDrag:function(){},unrenderDrag:function(){},buildSegResizeListener:function(n,t){var i=this,f=this.view,o=f.calendar,s=n.el,u=n.event,h=o.getEventEnd(u),e,r;return this.segResizeListener=new ft(this,{scroll:f.opt("dragScroll"),subjectEl:s,interactionStart:function(){e=!1},dragStart:function(t){e=!0;i.handleSegMouseout(n,t);i.segResizeStart(n,t)},hitOver:function(e,s,c){var l=i.getHitSpan(c),a=i.getHitSpan(e);r=t?i.computeEventStartResize(l,a,u):i.computeEventEndResize(l,a,u);r&&(o.isEventSpanAllowed(i.eventToSpan(r),u)?r.start.isSame(u.start.clone().stripZone())&&r.end.isSame(h.clone().stripZone())&&(r=null):(ot(),r=null));r&&(f.hideEvent(u),i.renderEventResize(r,n))},hitOut:function(){r=null;f.showEvent(u)},hitDone:function(){i.unrenderEventResize();st()},interactionEnd:function(t){e&&i.segResizeStop(n,t);r?f.reportEventResize(u,r,i.largeUnit,s,t):f.showEvent(u);i.segResizeListener=null}})},segResizeStart:function(n,t){this.isResizingSeg=!0;this.view.publiclyTrigger("eventResizeStart",n.el[0],n.event,t,{})},segResizeStop:function(n,t){this.isResizingSeg=!1;this.view.publiclyTrigger("eventResizeStop",n.el[0],n.event,t,{})},computeEventStartResize:function(n,t,i){return this.computeEventResize("start",n,t,i)},computeEventEndResize:function(n,t,i){return this.computeEventResize("end",n,t,i)},computeEventResize:function(n,t,i,r){var f=this.view.calendar,o=this.diffDates(i[n],t[n]),u,e;return u={start:r.start.clone(),end:f.getEventEnd(r),allDay:r.allDay},u.allDay&&d(o)&&(u.allDay=!1,f.normalizeEventTimes(u)),u[n].add(o),u.start.isBefore(u.end)||(e=this.minResizeDuration||(r.allDay?f.defaultAllDayEventDuration:f.defaultTimedEventDuration),n=="start"?u.start=u.end.clone().subtract(e):u.end=u.start.clone().add(e)),u},renderEventResize:function(){},unrenderEventResize:function(){},getEventTimeText:function(n,t,i){return(t==null&&(t=this.eventTimeFormat),i==null&&(i=this.displayEventEnd),this.displayEventTime&&n.start.hasTime())?i&&n.end?this.view.formatRange(n,t):n.start.format(t):""},getSegClasses:function(n,t,i){var u=this.view,r=["fc-event",n.isStart?"fc-start":"fc-not-start",n.isEnd?"fc-end":"fc-not-end"].concat(this.getSegCustomClasses(n));return t&&r.push("fc-draggable"),i&&r.push("fc-resizable"),u.isEventSelected(n.event)&&r.push("fc-selected"),r},getSegCustomClasses:function(n){var t=n.event;return[].concat(t.className,t.source?t.source.className:[])},getSegSkinCss:function(n){return{"background-color":this.getSegBackgroundColor(n),"border-color":this.getSegBorderColor(n),color:this.getSegTextColor(n)}},getSegBackgroundColor:function(n){return n.event.backgroundColor||n.event.color||this.getSegDefaultBackgroundColor(n)},getSegDefaultBackgroundColor:function(n){var t=n.event.source||{};return t.backgroundColor||t.color||this.view.opt("eventBackgroundColor")||this.view.opt("eventColor")},getSegBorderColor:function(n){return n.event.borderColor||n.event.color||this.getSegDefaultBorderColor(n)},getSegDefaultBorderColor:function(n){var t=n.event.source||{};return t.borderColor||t.color||this.view.opt("eventBorderColor")||this.view.opt("eventColor")},getSegTextColor:function(n){return n.event.textColor||this.getSegDefaultTextColor(n)},getSegDefaultTextColor:function(n){var t=n.event.source||{};return t.textColor||this.view.opt("eventTextColor")},eventToSegs:function(n){return this.eventsToSegs([n])},eventToSpan:function(n){return this.eventToSpans(n)[0]},eventToSpans:function(n){var t=this.eventToRange(n);return this.eventRangeToSpans(t,n)},eventsToSegs:function(t,i){var u=this,f=fe(t),r=[];return n.each(f,function(n,t){for(var e=[],f=0;f<t.length;f++)e.push(u.eventToRange(t[f]));if(ue(t[0]))for(e=u.invertRanges(e),f=0;f<e.length;f++)r.push.apply(r,u.eventRangeToSegs(e[f],t[0],i));else for(f=0;f<e.length;f++)r.push.apply(r,u.eventRangeToSegs(e[f],t[f],i))}),r},eventToRange:function(n){var t=this.view.calendar,i=n.start.clone().stripZone(),r=(n.end?n.end.clone():t.getDefaultEventEnd(n.allDay!=null?n.allDay:!n.start.hasTime(),n.start)).stripZone();return t.localizeMoment(i),t.localizeMoment(r),{start:i,end:r}},eventRangeToSegs:function(n,t,i){for(var f=this.eventRangeToSpans(n,t),u=[],r=0;r<f.length;r++)u.push.apply(u,this.eventSpanToSegs(f[r],t,i));return u},eventRangeToSpans:function(t){return[n.extend({},t)]},eventSpanToSegs:function(n,t,i){for(var f=i?i(n):this.spanToSegs(n),u,r=0;r<f.length;r++)u=f[r],u.event=t,u.eventStartMS=+n.start,u.eventDurationMS=n.end-n.start;return f},invertRanges:function(n){var f=this.view,o=f.start.clone(),e=f.end.clone(),u=[],t=o,i,r;for(n.sort(ee),i=0;i<n.length;i++)r=n[i],r.start>t&&u.push({start:t,end:r.start}),t=r.end;return t<e&&u.push({start:t,end:e}),u},sortEventSegs:function(n){n.sort(g(this,"compareEventSegs"))},compareEventSegs:function(n,t){return n.eventStartMS-t.eventStartMS||t.eventDurationMS-n.eventDurationMS||t.event.allDay-n.event.allDay||sr(n.event,t.event,this.view.eventOrderSpecs)}});i.pluckEventDateProps=su;i.isBgEvent=hu;i.dataAttrPrefix="";yi=i.DayTableMixin={breakOnWeeks:!1,dayDates:null,dayIndices:null,daysPerRow:null,rowCnt:null,colCnt:null,colHeadFormat:null,updateDayTable:function(){for(var o=this.view,i=this.start.clone(),r=-1,u=[],n=[],t,e,f;i.isBefore(this.end);)o.isHiddenDay(i)?u.push(r+.5):(r++,u.push(r),n.push(i.clone())),i.add(1,"days");if(this.breakOnWeeks){for(e=n[0].day(),t=1;t<n.length;t++)if(n[t].day()==e)break;f=Math.ceil(n.length/t)}else f=1,t=n.length;this.dayDates=n;this.dayIndices=u;this.daysPerRow=t;this.rowCnt=f;this.updateDayTableCols()},updateDayTableCols:function(){this.colCnt=this.computeColCnt();this.colHeadFormat=this.view.opt("columnFormat")||this.computeColHeadFormat()},computeColCnt:function(){return this.daysPerRow},getCellDate:function(n,t){return this.dayDates[this.getCellDayIndex(n,t)].clone()},getCellRange:function(n,t){var i=this.getCellDate(n,t),r=i.clone().add(1,"days");return{start:i,end:r}},getCellDayIndex:function(n,t){return n*this.daysPerRow+this.getColDayIndex(t)},getColDayIndex:function(n){return this.isRTL?this.colCnt-1-n:n},getDateDayIndex:function(n){var t=this.dayIndices,i=n.diff(this.start,"days");return i<0?t[0]-1:i>=t.length?t[t.length-1]+1:t[i]},computeColHeadFormat:function(){return this.rowCnt>1||this.colCnt>10?"ddd":this.colCnt>1?this.view.opt("dayOfMonthFormat"):"dddd"},sliceRangeByRow:function(n){for(var f=this.daysPerRow,e=this.view.computeDayRange(n),o=this.getDateDayIndex(e.start),s=this.getDateDayIndex(e.end.clone().subtract(1,"days")),h=[],u,c,t,i,r=0;r<this.rowCnt;r++)u=r*f,c=u+f-1,t=Math.max(o,u),i=Math.min(s,c),t=Math.ceil(t),i=Math.floor(i),t<=i&&h.push({row:r,firstRowDayIndex:t-u,lastRowDayIndex:i-u,isStart:t===o,isEnd:i===s});return h},sliceRangeByDay:function(n){for(var e=this.daysPerRow,o=this.view.computeDayRange(n),s=this.getDateDayIndex(o.start),h=this.getDateDayIndex(o.end.clone().subtract(1,"days")),c=[],u,l,f,t,i,r=0;r<this.rowCnt;r++)for(u=r*e,l=u+e-1,f=u;f<=l;f++)t=Math.max(s,f),i=Math.min(h,f),t=Math.ceil(t),i=Math.floor(i),t<=i&&c.push({row:r,firstRowDayIndex:t-u,lastRowDayIndex:i-u,isStart:t===s,isEnd:i===h});return c},renderHeadHtml:function(){var n=this.view;return'<div class="fc-row '+n.widgetHeaderClass+'"><table><thead>'+this.renderHeadTrHtml()+"<\/thead><\/table><\/div>"},renderHeadIntroHtml:function(){return this.renderIntroHtml()},renderHeadTrHtml:function(){return"<tr>"+(this.isRTL?"":this.renderHeadIntroHtml())+this.renderHeadDateCellsHtml()+(this.isRTL?this.renderHeadIntroHtml():"")+"<\/tr>"},renderHeadDateCellsHtml:function(){for(var t=[],i,n=0;n<this.colCnt;n++)i=this.getCellDate(0,n),t.push(this.renderHeadDateCellHtml(i));return t.join("")},renderHeadDateCellHtml:function(n,t,i){var f=this.view,u=["fc-day-header",f.widgetHeaderClass];return this.rowCnt===1?u=u.concat(this.getDayClasses(n,!0)):u.push("fc-"+ii[n.day()]),'<th class="'+u.join(" ")+'"'+(this.rowCnt===1?' data-date="'+n.format("YYYY-MM-DD")+'"':"")+(t>1?' colspan="'+t+'"':"")+(i?" "+i:"")+">"+f.buildGotoAnchorHtml({date:n,forceOff:this.rowCnt>1||this.colCnt===1},r(n.format(this.colHeadFormat)))+"<\/th>"},renderBgTrHtml:function(n){return"<tr>"+(this.isRTL?"":this.renderBgIntroHtml(n))+this.renderBgCellsHtml(n)+(this.isRTL?this.renderBgIntroHtml(n):"")+"<\/tr>"},renderBgIntroHtml:function(){return this.renderIntroHtml()},renderBgCellsHtml:function(n){for(var i=[],r,t=0;t<this.colCnt;t++)r=this.getCellDate(n,t),i.push(this.renderBgCellHtml(r));return i.join("")},renderBgCellHtml:function(n,t){var r=this.view,i=this.getDayClasses(n);return i.unshift("fc-day",r.widgetContentClass),'<td class="'+i.join(" ")+'" data-date="'+n.format("YYYY-MM-DD")+'"'+(t?" "+t:"")+"><\/td>"},renderIntroHtml:function(){},bookendCells:function(n){var t=this.renderIntroHtml();t&&(this.isRTL?n.append(t):n.prepend(t))}};et=i.DayGrid=l.extend(yi,{numbersVisible:!1,bottomCoordPadding:0,rowEls:null,cellEls:null,helperEls:null,rowCoordCache:null,colCoordCache:null,renderDates:function(n){for(var f=this.view,r=this.rowCnt,e=this.colCnt,u="",i,t=0;t<r;t++)u+=this.renderDayRowHtml(t,n);for(this.el.html(u),this.rowEls=this.el.find(".fc-row"),this.cellEls=this.el.find(".fc-day"),this.rowCoordCache=new wt({els:this.rowEls,isVertical:!0}),this.colCoordCache=new wt({els:this.cellEls.slice(0,this.colCnt),isHorizontal:!0}),t=0;t<r;t++)for(i=0;i<e;i++)f.publiclyTrigger("dayRender",null,this.getCellDate(t,i),this.getCellEl(t,i))},unrenderDates:function(){this.removeSegPopover()},renderBusinessHours:function(){var n=this.buildBusinessHourSegs(!0);this.renderFill("businessHours",n,"bgevent")},unrenderBusinessHours:function(){this.unrenderFill("businessHours")},renderDayRowHtml:function(n,t){var r=this.view,i=["fc-row","fc-week",r.widgetContentClass];return t&&i.push("fc-rigid"),'<div class="'+i.join(" ")+'"><div class="fc-bg"><table>'+this.renderBgTrHtml(n)+'<\/table><\/div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.renderNumberTrHtml(n)+"<\/thead>":"")+"<\/table><\/div><\/div>"},renderNumberTrHtml:function(n){return"<tr>"+(this.isRTL?"":this.renderNumberIntroHtml(n))+this.renderNumberCellsHtml(n)+(this.isRTL?this.renderNumberIntroHtml(n):"")+"<\/tr>"},renderNumberIntroHtml:function(){return this.renderIntroHtml()},renderNumberCellsHtml:function(n){for(var i=[],r,t=0;t<this.colCnt;t++)r=this.getCellDate(n,t),i.push(this.renderNumberCellHtml(r));return i.join("")},renderNumberCellHtml:function(n){var t="",i,r;return!this.view.dayNumbersVisible&&!this.view.cellWeekNumbersVisible?"<td/>":(i=this.getDayClasses(n),i.unshift("fc-day-top"),this.view.cellWeekNumbersVisible&&(r=n._locale._fullCalendar_weekCalc==="ISO"?1:n._locale.firstDayOfWeek()),t+='<td class="'+i.join(" ")+'" data-date="'+n.format()+'">',this.view.cellWeekNumbersVisible&&n.day()==r&&(t+=this.view.buildGotoAnchorHtml({date:n,type:"week"},{"class":"fc-week-number"},n.format("w"))),this.view.dayNumbersVisible&&(t+=this.view.buildGotoAnchorHtml(n,{"class":"fc-day-number"},n.date())),t+"<\/td>")},computeEventTimeFormat:function(){return this.view.opt("extraSmallTimeFormat")},computeDisplayEventEnd:function(){return this.colCnt==1},rangeUpdated:function(){this.updateDayTable()},spanToSegs:function(n){for(var r=this.sliceRangeByRow(n),t,i=0;i<r.length;i++)t=r[i],this.isRTL?(t.leftCol=this.daysPerRow-1-t.lastRowDayIndex,t.rightCol=this.daysPerRow-1-t.firstRowDayIndex):(t.leftCol=t.firstRowDayIndex,t.rightCol=t.lastRowDayIndex);return r},prepareHits:function(){this.colCoordCache.build();this.rowCoordCache.build();this.rowCoordCache.bottoms[this.rowCnt-1]+=this.bottomCoordPadding},releaseHits:function(){this.colCoordCache.clear();this.rowCoordCache.clear()},queryHit:function(n,t){if(this.colCoordCache.isLeftInBounds(n)&&this.rowCoordCache.isTopInBounds(t)){var i=this.colCoordCache.getHorizontalIndex(n),r=this.rowCoordCache.getVerticalIndex(t);if(r!=null&&i!=null)return this.getCellHit(r,i)}},getHitSpan:function(n){return this.getCellRange(n.row,n.col)},getHitEl:function(n){return this.getCellEl(n.row,n.col)},getCellHit:function(n,t){return{row:n,col:t,component:this,left:this.colCoordCache.getLeftOffset(t),right:this.colCoordCache.getRightOffset(t),top:this.rowCoordCache.getTopOffset(n),bottom:this.rowCoordCache.getBottomOffset(n)}},getCellEl:function(n,t){return this.cellEls.eq(n*this.colCnt+t)},renderDrag:function(n,t){return this.renderHighlight(this.eventToSpan(n)),t&&t.component!==this?this.renderEventLocationHelper(n,t):void 0},unrenderDrag:function(){this.unrenderHighlight();this.unrenderHelper()},renderEventResize:function(n,t){return this.renderHighlight(this.eventToSpan(n)),this.renderEventLocationHelper(n,t)},unrenderEventResize:function(){this.unrenderHighlight();this.unrenderHelper()},renderHelper:function(t,i){var u=[],r=this.eventToSegs(t),f;return r=this.renderFgSegEls(r),f=this.renderSegRows(r),this.rowEls.each(function(t,r){var o=n(r),e=n('<div class="fc-helper-skeleton"><table/><\/div>'),s;s=i&&i.row===t?i.el.position().top:o.find(".fc-content-skeleton tbody").position().top;e.css("top",s).find("table").append(f[t].tbodyEl);o.append(e);u.push(e[0])}),this.helperEls=n(u)},unrenderHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},fillSegTag:"td",renderFill:function(t,i,r){var o=[],u,f,e;for(i=this.renderFillSegEls(t,i),u=0;u<i.length;u++)f=i[u],e=this.renderFillRow(t,f,r),this.rowEls.eq(f.row).append(e),o.push(e[0]);return this.elsByFill[t]=n(o),i},renderFillRow:function(t,i,r){var s=this.colCnt,f=i.leftCol,e=i.rightCol+1,o,u;return r=r||t.toLowerCase(),o=n('<div class="fc-'+r+'-skeleton"><table><tr/><\/table><\/div>'),u=o.find("tr"),f>0&&u.append('<td colspan="'+f+'"/>'),u.append(i.el.attr("colspan",e-f)),e<s&&u.append('<td colspan="'+(s-e)+'"/>'),this.bookendCells(u),o}});et.mixin({rowStructs:null,unrenderEvents:function(){this.removeSegPopover();l.prototype.unrenderEvents.apply(this,arguments)},getEventSegs:function(){return l.prototype.getEventSegs.call(this).concat(this.popoverSegs||[])},renderBgSegs:function(t){var i=n.grep(t,function(n){return n.event.allDay});return l.prototype.renderBgSegs.call(this,i)},renderFgSegs:function(t){var i;return t=this.renderFgSegEls(t),i=this.rowStructs=this.renderSegRows(t),this.rowEls.each(function(t,r){n(r).find(".fc-content-skeleton > table").append(i[t].tbodyEl)}),t},unrenderFgSegs:function(){for(var t=this.rowStructs||[],n;n=t.pop();)n.tbodyEl.remove();this.rowStructs=null},renderSegRows:function(n){for(var r=[],i=this.groupSegRows(n),t=0;t<i.length;t++)r.push(this.renderSegRow(t,i[t]));return r},fgSegHtml:function(n,t){var u=this.view,i=n.event,a=u.isEventDraggable(i),s=!t&&i.allDay&&n.isStart&&u.isEventResizableFromStart(i),h=!t&&i.allDay&&n.isEnd&&u.isEventResizableFromEnd(i),c=this.getSegClasses(n,a,s||h),l=yt(this.getSegSkinCss(n)),f="",e,o;return c.unshift("fc-day-grid-event","fc-h-event"),n.isStart&&(e=this.getEventTimeText(i),e&&(f='<span class="fc-time">'+r(e)+"<\/span>")),o='<span class="fc-title">'+(r(i.title||"")||" ")+"<\/span>",'<a tooltips class="'+c.join(" ")+'"'+(i.url?' href="'+r(i.url)+'"':"")+(l?' style="'+l+'"':"")+(i.content?' title="'+r(i.content)+'"':"")+'><div class="fc-content">'+(this.isRTL?o+" "+f:f+" "+o)+"<\/div>"+(s?'<div class="fc-resizer fc-start-resizer" />':"")+(h?'<div class="fc-resizer fc-end-resizer" />':"")+"<\/a>"},renderSegRow:function(t,i){function p(t){while(u<t)r=(h[f-1]||[])[u],r?r.attr("rowspan",parseInt(r.attr("rowspan")||1,10)+1):(r=n("<td/>"),o.append(r)),s[f][u]=r,h[f][u]=r,u++}for(var w=this.colCnt,a=this.buildSegLevels(i),b=Math.max(1,a.length),y=n("<tbody/>"),v=[],s=[],h=[],c,u,o,l,e,r,f=0;f<b;f++){if(c=a[f],u=0,o=n("<tr/>"),v.push([]),s.push([]),h.push([]),c)for(l=0;l<c.length;l++){for(e=c[l],p(e.leftCol),r=n('<td class="fc-event-container"/>').append(e.el),e.leftCol!=e.rightCol?r.attr("colspan",e.rightCol-e.leftCol+1):h[f][u]=r;u<=e.rightCol;)s[f][u]=r,v[f][u]=e,u++;o.append(r)}p(w);this.bookendCells(o);y.append(o)}return{row:t,tbodyEl:y,cellMatrix:s,segMatrix:v,segLevels:a,segs:i}},buildSegLevels:function(n){var i=[],r,u,t;for(this.sortEventSegs(n),r=0;r<n.length;r++){for(u=n[r],t=0;t<i.length;t++)if(!se(u,i[t]))break;u.level=t;(i[t]||(i[t]=[])).push(u)}for(t=0;t<i.length;t++)i[t].sort(he);return i},groupSegRows:function(n){for(var i=[],t=0;t<this.rowCnt;t++)i.push([]);for(t=0;t<n.length;t++)i[n[t].row].push(n[t]);return i}});et.mixin({segPopover:null,popoverSegs:null,removeSegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(n){for(var r=this.rowStructs||[],i,t=0;t<r.length;t++)this.unlimitRow(t),i=n?typeof n=="number"?n:this.computeRowLevelLimit(t):!1,i!==!1&&this.limitRow(t,i)},computeRowLevelLimit:function(t){function s(t,i){r=Math.max(r,n(i).outerHeight())}for(var e=this.rowEls.eq(t),o=e.height(),f=this.rowStructs[t].tbodyEl.children(),u,r,i=0;i<f.length;i++)if(u=f.eq(i).removeClass("fc-limited"),r=0,u.find("> td > :first-child").each(s),u.position().top+r>o)return i;return!1},limitRow:function(t,i){function tt(f){while(r<f)u=g.getCellSegs(t,r,i),u.length&&(o=w[i-1][r],v=g.renderMoreLink(t,r,u),h=n("<div/>").append(v),o.append(h),y.push(h[0])),r++}var g=this,f=this.rowStructs[t],y=[],r=0,p,w,b,c,e,u,k,l,o,nt,d,s,a,h,v;if(i&&i<f.segLevels.length){for(p=f.segLevels[i-1],w=f.cellMatrix,b=f.tbodyEl.children().slice(i).addClass("fc-limited").get(),c=0;c<p.length;c++){for(e=p[c],tt(e.leftCol),l=[],k=0;r<=e.rightCol;)u=this.getCellSegs(t,r,i),l.push(u),k+=u.length,r++;if(k){for(o=w[i-1][e.leftCol],nt=o.attr("rowspan")||1,d=[],s=0;s<l.length;s++)a=n('<td class="fc-more-cell"/>').attr("rowspan",nt),u=l[s],v=this.renderMoreLink(t,e.leftCol+s,[e].concat(u)),h=n("<div/>").append(v),a.append(h),d.push(a[0]),y.push(a[0]);o.addClass("fc-limited").after(n(d));b.push(o[0])}}tt(this.colCnt);f.moreEls=n(y);f.limitedEls=n(b)}},unlimitRow:function(n){var t=this.rowStructs[n];t.moreEls&&(t.moreEls.remove(),t.moreEls=null);t.limitedEls&&(t.limitedEls.removeClass("fc-limited"),t.limitedEls=null)},renderMoreLink:function(t,i,r){var u=this,f=this.view;return n('<a class="fc-more"/>').text(this.getMoreLinkText(r.length)).on("click",function(e){var o=f.opt("eventLimitClick"),s=u.getCellDate(t,i),h=n(this),l=u.getCellEl(t,i),a=u.getCellSegs(t,i),c=u.resliceDaySegs(a,s),v=u.resliceDaySegs(r,s);typeof o=="function"&&(o=f.publiclyTrigger("eventLimitClick",null,{date:s,dayEl:l,moreEl:h,segs:c,hiddenSegs:v},e));o==="popover"?u.showSegPopover(t,i,h,c):typeof o=="string"&&f.calendar.zoomTo(s,o)})},showSegPopover:function(n,t,i,r){var u=this,e=this.view,o=i.parent(),s,f;s=this.rowCnt==1?e.el:this.rowEls.eq(n);f={className:"fc-more-popover",content:this.renderSegPopoverContent(n,t,r),parentEl:this.view.el,top:s.offset().top,autoHide:!0,viewportConstrain:e.opt("popoverViewportConstrain"),hide:function(){var n,t;if(u.popoverSegs)for(t=0;t<u.popoverSegs.length;++t)n=u.popoverSegs[t],e.publiclyTrigger("eventDestroy",n.event,n.event,n.el);u.segPopover.removeElement();u.segPopover=null;u.popoverSegs=null}};this.isRTL?f.right=o.offset().left+o.outerWidth()+1:f.left=o.offset().left-1;this.segPopover=new re(f);this.segPopover.show();this.bindSegHandlersToEl(this.segPopover.el)},renderSegPopoverContent:function(t,i,u){var e=this.view,s=e.opt("theme"),h=this.getCellDate(t,i).format(e.opt("dayPopoverFormat")),o=n('<div class="fc-header '+e.widgetHeaderClass+'"><span class="fc-close '+(s?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"><\/span><span class="fc-title">'+r(h)+'<\/span><div class="fc-clear"/><\/div><div class="fc-body '+e.widgetContentClass+'"><div class="fc-event-container"><\/div><\/div>'),c=o.find(".fc-event-container"),f;for(u=this.renderFgSegEls(u,!0),this.popoverSegs=u,f=0;f<u.length;f++)this.prepareHits(),u[f].hit=this.getCellHit(t,i),this.releaseHits(),c.append(u[f].el);return o},resliceDaySegs:function(t,i){var u=n.map(t,function(n){return n.event}),r=i.clone(),f=r.clone().add(1,"days"),e={start:r,end:f};return t=this.eventsToSegs(u,function(n){var t=lt(n,e);return t?[t]:[]}),this.sortEventSegs(t),t},getMoreLinkText:function(n){var t=this.view.opt("eventLimitText");return typeof t=="function"?t(n):"+"+n+" "+t},getCellSegs:function(n,t,i){for(var f=this.rowStructs[n].segMatrix,r=i||0,e=[],u;r<f.length;)u=f[r][t],u&&e.push(u),r++;return e}});pi=i.TimeGrid=l.extend(yi,{slotDuration:null,snapDuration:null,snapsPerSlot:null,minTime:null,maxTime:null,labelFormat:null,labelInterval:null,colEls:null,slatContainerEl:null,slatEls:null,nowIndicatorEls:null,colCoordCache:null,slatCoordCache:null,constructor:function(){l.apply(this,arguments);this.processOptions()},renderDates:function(){this.el.html(this.renderHtml());this.colEls=this.el.find(".fc-day");this.slatContainerEl=this.el.find(".fc-slats");this.slatEls=this.slatContainerEl.find("tr");this.colCoordCache=new wt({els:this.colEls,isHorizontal:!0});this.slatCoordCache=new wt({els:this.slatEls,isVertical:!0});this.renderContentSkeleton()},renderHtml:function(){return'<div class="fc-bg"><table>'+this.renderBgTrHtml(0)+'<\/table><\/div><div class="fc-slats"><table>'+this.renderSlatRowHtml()+"<\/table><\/div>"},renderSlatRowHtml:function(){for(var i=this.view,o=this.isRTL,s="",n=t.duration(+this.minTime),u,f,e;n<this.maxTime;)u=this.start.clone().time(n),f=w(ui(n,this.labelInterval)),e='<td class="fc-axis fc-time '+i.widgetContentClass+'" '+i.axisStyleAttr()+">"+(f?"<span>"+r(u.format(this.labelFormat))+"<\/span>":"")+"<\/td>",s+='<tr data-time="'+u.format("HH:mm:ss")+'"'+(f?"":' class="fc-minor"')+">"+(o?"":e)+'<td class="'+i.widgetContentClass+'"/>'+(o?e:"")+"<\/tr>",n.add(this.slotDuration);return s},processOptions:function(){var r=this.view,u=r.opt("slotDuration"),f=r.opt("snapDuration"),i;u=t.duration(u);f=f?t.duration(f):u;this.slotDuration=u;this.snapDuration=f;this.snapsPerSlot=u/f;this.minResizeDuration=f;this.minTime=t.duration(r.opt("minTime"));this.maxTime=t.duration(r.opt("maxTime"));i=r.opt("slotLabelFormat");n.isArray(i)&&(i=i[i.length-1]);this.labelFormat=i||r.opt("smallTimeFormat");i=r.opt("slotLabelInterval");this.labelInterval=i?t.duration(i):this.computeLabelInterval(u)},computeLabelInterval:function(n){for(var r,u,i=du.length-1;i>=0;i--)if(r=t.duration(du[i]),u=ui(r,n),w(u)&&u>1)return r;return t.duration(n)},computeEventTimeFormat:function(){return this.view.opt("noMeridiemTimeFormat")},computeDisplayEventEnd:function(){return!0},prepareHits:function(){this.colCoordCache.build();this.slatCoordCache.build()},releaseHits:function(){this.colCoordCache.clear()},queryHit:function(n,t){var u=this.snapsPerSlot,f=this.colCoordCache,e=this.slatCoordCache,i,r;if(f.isLeftInBounds(n)&&e.isTopInBounds(t)&&(i=f.getHorizontalIndex(n),r=e.getVerticalIndex(t),i!=null&&r!=null)){var o=e.getTopOffset(r),s=e.getHeight(r),c=(t-o)/s,h=Math.floor(c*u),l=r*u+h,a=o+h/u*s,v=o+(h+1)/u*s;return{col:i,snap:l,component:this,left:f.getLeftOffset(i),right:f.getRightOffset(i),top:a,bottom:v}}},getHitSpan:function(n){var t=this.getCellDate(0,n.col),r=this.computeSnapTime(n.snap),i;return t.time(r),i=t.clone().add(this.snapDuration),{start:t,end:i}},getHitEl:function(n){return this.colEls.eq(n.col)},rangeUpdated:function(){this.updateDayTable()},computeSnapTime:function(n){return t.duration(this.minTime+this.snapDuration*n)},spanToSegs:function(n){for(var i=this.sliceRangeByTimes(n),t=0;t<i.length;t++)i[t].col=this.isRTL?this.daysPerRow-1-i[t].dayIndex:i[t].dayIndex;return i},sliceRangeByTimes:function(n){for(var u=[],i,r,f,t=0;t<this.daysPerRow;t++)r=this.dayDates[t].clone(),f={start:r.clone().time(this.minTime),end:r.clone().time(this.maxTime)},i=lt(n,f),i&&(i.dayIndex=t,u.push(i));return u},updateSize:function(n){this.slatCoordCache.build();n&&this.updateSegVerticals([].concat(this.fgSegs||[],this.bgSegs||[],this.businessSegs||[]))},getTotalSlatHeight:function(){return this.slatContainerEl.outerHeight()},computeDateTop:function(n,i){return this.computeTimeTop(t.duration(n-i.clone().stripTime()))},computeTimeTop:function(n){var r=this.slatEls.length,t=(n-this.minTime)/this.slotDuration,i,u;return t=Math.max(0,t),t=Math.min(r,t),i=Math.floor(t),i=Math.min(i,r-1),u=t-i,this.slatCoordCache.getTopPosition(i)+this.slatCoordCache.getHeight(i)*u},renderDrag:function(n,t){if(t)return this.renderEventLocationHelper(n,t);this.renderHighlight(this.eventToSpan(n))},unrenderDrag:function(){this.unrenderHelper();this.unrenderHighlight()},renderEventResize:function(n,t){return this.renderEventLocationHelper(n,t)},unrenderEventResize:function(){this.unrenderHelper()},renderHelper:function(n,t){return this.renderHelperSegs(this.eventToSegs(n),t)},unrenderHelper:function(){this.unrenderHelperSegs()},renderBusinessHours:function(){this.renderBusinessSegs(this.buildBusinessHourSegs())},unrenderBusinessHours:function(){this.unrenderBusinessSegs()},getNowIndicatorUnit:function(){return"minute"},renderNowIndicator:function(t){for(var r=this.spanToSegs({start:t,end:t}),f=this.computeDateTop(t,t),u=[],i=0;i<r.length;i++)u.push(n('<div class="fc-now-indicator fc-now-indicator-line"><\/div>').css("top",f).appendTo(this.colContainerEls.eq(r[i].col))[0]);r.length>0&&u.push(n('<div class="fc-now-indicator fc-now-indicator-arrow"><\/div>').css("top",f).appendTo(this.el.find(".fc-content-skeleton"))[0]);this.nowIndicatorEls=n(u)},unrenderNowIndicator:function(){this.nowIndicatorEls&&(this.nowIndicatorEls.remove(),this.nowIndicatorEls=null)},renderSelection:function(n){this.view.opt("selectHelper")?this.renderEventLocationHelper(n):this.renderHighlight(n)},unrenderSelection:function(){this.unrenderHelper();this.unrenderHighlight()},renderHighlight:function(n){this.renderHighlightSegs(this.spanToSegs(n))},unrenderHighlight:function(){this.unrenderHighlightSegs()}});pi.mixin({colContainerEls:null,fgContainerEls:null,bgContainerEls:null,helperContainerEls:null,highlightContainerEls:null,businessContainerEls:null,fgSegs:null,bgSegs:null,helperSegs:null,highlightSegs:null,businessSegs:null,renderContentSkeleton:function(){for(var r="",t,i=0;i<this.colCnt;i++)r+='<td><div class="fc-content-col"><div class="fc-event-container fc-helper-container"><\/div><div class="fc-event-container"><\/div><div class="fc-highlight-container"><\/div><div class="fc-bgevent-container"><\/div><div class="fc-business-container"><\/div><\/div><\/td>';t=n('<div class="fc-content-skeleton"><table><tr>'+r+"<\/tr><\/table><\/div>");this.colContainerEls=t.find(".fc-content-col");this.helperContainerEls=t.find(".fc-helper-container");this.fgContainerEls=t.find(".fc-event-container:not(.fc-helper-container)");this.bgContainerEls=t.find(".fc-bgevent-container");this.highlightContainerEls=t.find(".fc-highlight-container");this.businessContainerEls=t.find(".fc-business-container");this.bookendCells(t.find("tr"));this.el.append(t)},renderFgSegs:function(n){return n=this.renderFgSegsIntoContainers(n,this.fgContainerEls),this.fgSegs=n,n},unrenderFgSegs:function(){this.unrenderNamedSegs("fgSegs")},renderHelperSegs:function(t,i){var e=[],u,f,r;for(t=this.renderFgSegsIntoContainers(t,this.helperContainerEls),u=0;u<t.length;u++)f=t[u],i&&i.col===f.col&&(r=i.el,f.el.css({left:r.css("left"),right:r.css("right"),"margin-left":r.css("margin-left"),"margin-right":r.css("margin-right")})),e.push(f.el[0]);return this.helperSegs=t,n(e)},unrenderHelperSegs:function(){this.unrenderNamedSegs("helperSegs")},renderBgSegs:function(n){return n=this.renderFillSegEls("bgEvent",n),this.updateSegVerticals(n),this.attachSegsByCol(this.groupSegsByCol(n),this.bgContainerEls),this.bgSegs=n,n},unrenderBgSegs:function(){this.unrenderNamedSegs("bgSegs")},renderHighlightSegs:function(n){n=this.renderFillSegEls("highlight",n);this.updateSegVerticals(n);this.attachSegsByCol(this.groupSegsByCol(n),this.highlightContainerEls);this.highlightSegs=n},unrenderHighlightSegs:function(){this.unrenderNamedSegs("highlightSegs")},renderBusinessSegs:function(n){n=this.renderFillSegEls("businessHours",n);this.updateSegVerticals(n);this.attachSegsByCol(this.groupSegsByCol(n),this.businessContainerEls);this.businessSegs=n},unrenderBusinessSegs:function(){this.unrenderNamedSegs("businessSegs")},groupSegsByCol:function(n){for(var i=[],t=0;t<this.colCnt;t++)i.push([]);for(t=0;t<n.length;t++)i[n[t].col].push(n[t]);return i},attachSegsByCol:function(n,t){for(var u,r,i=0;i<this.colCnt;i++)for(u=n[i],r=0;r<u.length;r++)t.eq(i).append(u[r].el)},unrenderNamedSegs:function(n){var i=this[n],t;if(i){for(t=0;t<i.length;t++)i[t].el.remove();this[n]=null}},renderFgSegsIntoContainers:function(n,t){var r,i;for(n=this.renderFgSegEls(n),r=this.groupSegsByCol(n),i=0;i<this.colCnt;i++)this.updateFgSegCoords(r[i]);return this.attachSegsByCol(r,t),n},fgSegHtml:function(n,t){var u=this.view,i=n.event,l=u.isEventDraggable(i),a=!t&&n.isStart&&u.isEventResizableFromStart(i),s=!t&&n.isEnd&&u.isEventResizableFromEnd(i),h=this.getSegClasses(n,l,a||s),c=yt(this.getSegSkinCss(n)),f,e,o;return h.unshift("fc-time-grid-event","fc-v-event"),u.isMultiDayEvent(i)?(n.isStart||n.isEnd)&&(f=this.getEventTimeText(n),e=this.getEventTimeText(n,"LT"),o=this.getEventTimeText(n,null,!1)):(f=this.getEventTimeText(i),e=this.getEventTimeText(i,"LT"),o=this.getEventTimeText(i,null,!1)),'<a tooltips class="'+h.join(" ")+'"'+(i.url?' href="'+r(i.url)+'"':"")+(c?' style="'+c+'"':"")+(i.content?' title="'+r(i.content)+'"':"")+'><div class="fc-content">'+(f?'<div class="fc-time" data-start="'+r(o)+'" data-full="'+r(e)+'"><span>'+r(f)+"<\/span><\/div>":"")+(i.title?'<div class="fc-title">'+r(i.title)+"<\/div>":"")+(i.content?'<div class="fc-content">'+r(i.content)+"<\/div>":"")+'<\/div><div class="fc-bg"/>'+(s?'<div class="fc-resizer fc-end-resizer" />':"")+"<\/a>"},updateSegVerticals:function(n){this.computeSegVerticals(n);this.assignSegVerticals(n)},computeSegVerticals:function(n){for(var t,i=0;i<n.length;i++)t=n[i],t.top=this.computeDateTop(t.start,t.start),t.bottom=this.computeDateTop(t.end,t.start)},assignSegVerticals:function(n){for(var i,t=0;t<n.length;t++)i=n[t],i.el.css(this.generateSegVerticalCss(i))},generateSegVerticalCss:function(n){return{top:n.top,bottom:-n.bottom}},updateFgSegCoords:function(n){this.computeSegVerticals(n);this.computeFgSegHorizontals(n);this.assignSegVerticals(n);this.assignFgSegHorizontals(n)},computeFgSegHorizontals:function(n){var r,i,t;if(this.sortEventSegs(n),r=ce(n),le(r),i=r[0]){for(t=0;t<i.length;t++)lu(i[t]);for(t=0;t<i.length;t++)this.computeFgSegForwardBack(i[t],0,0)}},computeFgSegForwardBack:function(n,t,i){var r=n.forwardSegs,u;if(n.forwardCoord===undefined)for(r.length?(this.sortForwardSegs(r),this.computeFgSegForwardBack(r[0],t+1,i),n.forwardCoord=r[0].backwardCoord):n.forwardCoord=1,n.backwardCoord=n.forwardCoord-(n.forwardCoord-i)/(t+1),u=0;u<r.length;u++)this.computeFgSegForwardBack(r[u],0,n.forwardCoord)},sortForwardSegs:function(n){n.sort(g(this,"compareForwardSegs"))},compareForwardSegs:function(n,t){return t.forwardPressure-n.forwardPressure||(n.backwardCoord||0)-(t.backwardCoord||0)||this.compareEventSegs(n,t)},assignFgSegHorizontals:function(n){for(var t,i=0;i<n.length;i++)t=n[i],t.el.css(this.generateFgSegHorizontalCss(t)),t.bottom-t.top<30&&t.el.addClass("fc-short")},generateFgSegHorizontalCss:function(n){var e=this.view.opt("slotEventOverlap"),i=n.backwardCoord,r=n.forwardCoord,t=this.generateSegVerticalCss(n),u,f;return e&&(r=Math.min(1,i+(r-i)*2)),this.isRTL?(u=1-r,f=i):(u=i,f=1-r),t.zIndex=n.level+1,t.left=u*100+"%",t.right=f*100+"%",e&&n.forwardPressure&&(t[this.isRTL?"marginLeft":"marginRight"]=20),t}});p=i.View=h.extend(ru,ut,{type:null,name:null,title:null,calendar:null,options:null,el:null,isDateSet:!1,isDateRendered:!1,dateRenderQueue:null,isEventsBound:!1,isEventsSet:!1,isEventsRendered:!1,eventRenderQueue:null,start:null,end:null,intervalStart:null,intervalEnd:null,intervalDuration:null,intervalUnit:null,isRTL:!1,isSelected:!1,selectedEvent:null,eventOrderSpecs:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,nextDayThreshold:null,isHiddenDayHash:null,isNowIndicatorRendered:null,initialNowDate:null,initialNowQueriedMs:null,nowIndicatorTimeoutID:null,nowIndicatorIntervalID:null,constructor:function(n,i,r,u){this.calendar=n;this.type=this.name=i;this.options=r;this.intervalDuration=u||t.duration(1,"day");this.nextDayThreshold=t.duration(this.opt("nextDayThreshold"));this.initThemingProps();this.initHiddenDays();this.isRTL=this.opt("isRTL");this.eventOrderSpecs=or(this.opt("eventOrder"));this.dateRenderQueue=new vi;this.eventRenderQueue=new vi(this.opt("eventRenderWait"));this.initialize()},initialize:function(){},opt:function(n){return this.options[n]},publiclyTrigger:function(n,t){var i=this.calendar;return i.publiclyTrigger.apply(i,[n,t||this].concat(Array.prototype.slice.call(arguments,2),[this]))},rejectOn:function(n,t){var i=this;return new f(function(r,u){function f(){i.off(n,u)}i.one(n,u);t.then(function(n){f();r(n)},function(){f();u()})})},setRange:function(t){n.extend(this,t);this.updateTitle()},computeRange:function(n){var f=ri(this.intervalDuration),t=n.clone().startOf(f),i=t.clone().add(this.intervalDuration),r,u;return/year|month|week|day/.test(f)?(t.stripTime(),i.stripTime()):(t.hasTime()||(t=this.calendar.time(0)),i.hasTime()||(i=this.calendar.time(0))),r=t.clone(),r=this.skipHiddenDays(r),u=i.clone(),u=this.skipHiddenDays(u,-1,!0),{intervalUnit:f,intervalStart:t,intervalEnd:i,start:r,end:u}},computePrevDate:function(n){return this.massageCurrentDate(n.clone().startOf(this.intervalUnit).subtract(this.intervalDuration),-1)},computeNextDate:function(n){return this.massageCurrentDate(n.clone().startOf(this.intervalUnit).add(this.intervalDuration))},massageCurrentDate:function(n,t){return this.intervalDuration.as("days")<=1&&this.isHiddenDay(n)&&(n=this.skipHiddenDays(n,t),n.startOf("day")),n},updateTitle:function(){this.title=this.computeTitle();this.calendar.setToolbarsTitle(this.title)},computeTitle:function(){return this.formatRange({start:this.calendar.applyTimezone(this.intervalStart),end:this.calendar.applyTimezone(this.intervalEnd)},this.opt("titleFormat")||this.computeTitleFormat(),this.opt("titleRangeSeparator"))},computeTitleFormat:function(){return this.intervalUnit=="year"?"YYYY":this.intervalUnit=="month"?this.opt("monthYearFormat"):this.intervalDuration.as("days")>1?"ll":"LL"},formatRange:function(n,t,i){var r=n.end;return r.hasTime()||(r=r.clone().subtract(1)),kr(n.start,r,t,i,this.opt("isRTL"))},getAllDayHtml:function(){return this.opt("allDayHtml")||r(this.opt("allDayText"))},buildGotoAnchorHtml:function(t,u,f){var e,o,s,h;return n.isPlainObject(t)?(e=t.date,o=t.type,s=t.forceOff):e=t,e=i.moment(e),h={date:e.format("YYYY-MM-DD"),type:o||"day"},typeof u=="string"&&(f=u,u=null),u=u?" "+bf(u):"",f=f||"",!s&&this.opt("navLinks")?"<a"+u+' data-goto="'+r(JSON.stringify(h))+'">'+f+"<\/a>":"<span"+u+">"+f+"<\/span>"},setElement:function(n){this.el=n;this.bindGlobalHandlers();this.renderSkeleton()},removeElement:function(){this.unsetDate();this.unrenderSkeleton();this.unbindGlobalHandlers();this.el.remove()},renderSkeleton:function(){},unrenderSkeleton:function(){},setDate:function(n){var t=this.isDateSet;this.isDateSet=!0;this.handleDate(n,t);this.trigger(t?"dateReset":"dateSet",n)},unsetDate:function(){this.isDateSet&&(this.isDateSet=!1,this.handleDateUnset(),this.trigger("dateUnset"))},handleDate:function(n){var t=this;this.unbindEvents();this.requestDateRender(n).then(function(){t.bindEvents()})},handleDateUnset:function(){this.unbindEvents();this.requestDateUnrender()},requestDateRender:function(n){var t=this;return this.dateRenderQueue.add(function(){return t.executeDateRender(n)})},requestDateUnrender:function(){var n=this;return this.dateRenderQueue.add(function(){return n.executeDateUnrender()})},executeDateRender:function(n){var t=this;return n?this.captureInitialScroll():this.captureScroll(),this.freezeHeight(),this.executeDateUnrender().then(function(){n&&t.setRange(t.computeRange(n));t.render&&t.render();t.renderDates();t.updateSize();t.renderBusinessHours();t.startNowIndicator();t.thawHeight();t.releaseScroll();t.isDateRendered=!0;t.onDateRender();t.trigger("dateRender")})},executeDateUnrender:function(){var n=this;return n.isDateRendered?this.requestEventsUnrender().then(function(){n.unselect();n.stopNowIndicator();n.triggerUnrender();n.unrenderBusinessHours();n.unrenderDates();n.destroy&&n.destroy();n.isDateRendered=!1;n.trigger("dateUnrender")}):f.resolve()},onDateRender:function(){this.triggerRender()},renderDates:function(){},unrenderDates:function(){},triggerRender:function(){this.publiclyTrigger("viewRender",this,this,this.el)},triggerUnrender:function(){this.publiclyTrigger("viewDestroy",this,this,this.el)},bindGlobalHandlers:function(){this.listenTo(n(document),"mousedown",this.handleDocumentMousedown);this.listenTo(n(document),"touchstart",this.processUnselect)},unbindGlobalHandlers:function(){this.stopListeningTo(n(document))},initThemingProps:function(){var n=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=n+"-widget-header";this.widgetContentClass=n+"-widget-content";this.highlightStateClass=n+"-state-highlight"},renderBusinessHours:function(){},unrenderBusinessHours:function(){},startNowIndicator:function(){var u=this,i,r,n;this.opt("nowIndicator")&&(i=this.getNowIndicatorUnit(),i&&(r=g(this,"updateNowIndicator"),this.initialNowDate=this.calendar.getNow(),this.initialNowQueriedMs=+new Date,this.renderNowIndicator(this.initialNowDate),this.isNowIndicatorRendered=!0,n=this.initialNowDate.clone().startOf(i).add(1,i)-this.initialNowDate,this.nowIndicatorTimeoutID=setTimeout(function(){u.nowIndicatorTimeoutID=null;r();n=+t.duration(1,i);n=Math.max(100,n);u.nowIndicatorIntervalID=setInterval(r,n)},n)))},updateNowIndicator:function(){this.isNowIndicatorRendered&&(this.unrenderNowIndicator(),this.renderNowIndicator(this.initialNowDate.clone().add(new Date-this.initialNowQueriedMs)))},stopNowIndicator:function(){this.isNowIndicatorRendered&&(this.nowIndicatorTimeoutID&&(clearTimeout(this.nowIndicatorTimeoutID),this.nowIndicatorTimeoutID=null),this.nowIndicatorIntervalID&&(clearTimeout(this.nowIndicatorIntervalID),this.nowIndicatorIntervalID=null),this.unrenderNowIndicator(),this.isNowIndicatorRendered=!1)},getNowIndicatorUnit:function(){},renderNowIndicator:function(){},unrenderNowIndicator:function(){},updateSize:function(n){n&&this.captureScroll();this.updateHeight(n);this.updateWidth(n);this.updateNowIndicator();n&&this.releaseScroll()},updateWidth:function(){},updateHeight:function(){var n=this.calendar;this.setHeight(n.getSuggestedViewHeight(),n.isHeightAuto())},setHeight:function(){},capturedScroll:null,capturedScrollDepth:0,captureScroll:function(){return this.capturedScrollDepth++?!1:(this.capturedScroll=this.isDateRendered?this.queryScroll():{},!0)},captureInitialScroll:function(t){this.captureScroll()&&(this.capturedScroll.isInitial=!0,t?n.extend(this.capturedScroll,t):this.capturedScroll.isComputed=!0)},releaseScroll:function(){var t=this.capturedScroll,i=this.discardScroll();t.isComputed&&(i?n.extend(t,this.computeInitialScroll()):t=null);t&&(t.isInitial?this.hardSetScroll(t):this.setScroll(t))},discardScroll:function(){return--this.capturedScrollDepth?!1:(this.capturedScroll=null,!0)},computeInitialScroll:function(){return{}},queryScroll:function(){return{}},hardSetScroll:function(n){var i=this,t=function(){i.setScroll(n)};t();setTimeout(t,0)},setScroll:function(){},freezeHeight:function(){this.calendar.freezeContentHeight()},thawHeight:function(){this.calendar.thawContentHeight()},bindEvents:function(){var n=this;this.isEventsBound||(this.isEventsBound=!0,this.rejectOn("eventsUnbind",this.requestEvents()).then(function(t){n.listenTo(n.calendar,"eventsReset",n.setEvents);n.setEvents(t)}))},unbindEvents:function(){this.isEventsBound&&(this.isEventsBound=!1,this.stopListeningTo(this.calendar,"eventsReset"),this.unsetEvents(),this.trigger("eventsUnbind"))},setEvents:function(n){var t=this.isEventSet;this.isEventsSet=!0;this.handleEvents(n,t);this.trigger(t?"eventsReset":"eventsSet",n)},unsetEvents:function(){this.isEventsSet&&(this.isEventsSet=!1,this.handleEventsUnset(),this.trigger("eventsUnset"))},whenEventsSet:function(){var n=this;return this.isEventsSet?f.resolve(this.getCurrentEvents()):new f(function(t){n.one("eventsSet",t)})},handleEvents:function(n){this.requestEventsRender(n)},handleEventsUnset:function(){this.requestEventsUnrender()},requestEventsRender:function(n){var t=this;return this.eventRenderQueue.add(function(){return t.executeEventsRender(n)})},requestEventsUnrender:function(){var n=this;return this.isEventsRendered?this.eventRenderQueue.addQuickly(function(){return n.executeEventsUnrender()}):f.resolve()},requestCurrentEventsRender:function(){if(this.isEventsSet)this.requestEventsRender(this.getCurrentEvents());else return f.reject()},executeEventsRender:function(n){var t=this;return this.captureScroll(),this.freezeHeight(),this.executeEventsUnrender().then(function(){t.renderEvents(n);t.thawHeight();t.releaseScroll();t.isEventsRendered=!0;t.onEventsRender();t.trigger("eventsRender")})},executeEventsUnrender:function(){return this.isEventsRendered&&(this.onBeforeEventsUnrender(),this.captureScroll(),this.freezeHeight(),this.destroyEvents&&this.destroyEvents(),this.unrenderEvents(),this.thawHeight(),this.releaseScroll(),this.isEventsRendered=!1,this.trigger("eventsUnrender")),f.resolve()},onEventsRender:function(){this.renderedEventSegEach(function(n){this.publiclyTrigger("eventAfterRender",n.event,n.event,n.el)});this.publiclyTrigger("eventAfterAllRender")},onBeforeEventsUnrender:function(){this.renderedEventSegEach(function(n){this.publiclyTrigger("eventDestroy",n.event,n.event,n.el)})},renderEvents:function(){},unrenderEvents:function(){},requestEvents:function(){return this.calendar.requestEvents(this.start,this.end)},getCurrentEvents:function(){return this.calendar.getPrunedEventCache()},resolveEventEl:function(t,i){var r=this.publiclyTrigger("eventRender",t,t,i);return r===!1?i=null:r&&r!==!0&&(i=n(r)),i},showEvent:function(n){this.renderedEventSegEach(function(n){n.el.css("visibility","")},n)},hideEvent:function(n){this.renderedEventSegEach(function(n){n.el.css("visibility","hidden")},n)},renderedEventSegEach:function(n,t){for(var r=this.getEventSegs(),i=0;i<r.length;i++)t&&r[i].event._id!==t._id||r[i].el&&n.call(this,r[i])},getEventSegs:function(){return[]},isEventDraggable:function(n){return this.isEventStartEditable(n)},isEventStartEditable:function(n){return e(n.startEditable,(n.source||{}).startEditable,this.opt("eventStartEditable"),this.isEventGenerallyEditable(n))},isEventGenerallyEditable:function(n){return e(n.editable,(n.source||{}).editable,this.opt("editable"))},reportEventDrop:function(n,t,i,r,u){var f=this.calendar,e=f.mutateEvent(n,t,i),o=function(){e.undo();f.reportEventChange()};this.triggerEventDrop(n,e.dateDelta,o,r,u);f.reportEventChange()},triggerEventDrop:function(n,t,i,r,u){this.publiclyTrigger("eventDrop",r[0],n,t,i,u,{})},reportExternalDrop:function(t,i,r,u,f){var e=t.eventProps,o,s;e&&(o=n.extend({},e,i),s=this.calendar.renderEvent(o,t.stick)[0]);this.triggerExternalDrop(s,i,r,u,f)},triggerExternalDrop:function(n,t,i,r,u){this.publiclyTrigger("drop",i[0],t.start,r,u);n&&this.publiclyTrigger("eventReceive",null,n)},renderDrag:function(){},unrenderDrag:function(){},isEventResizableFromStart:function(n){return this.opt("eventResizableFromStart")&&this.isEventResizable(n)},isEventResizableFromEnd:function(n){return this.isEventResizable(n)},isEventResizable:function(n){var t=n.source||{};return e(n.durationEditable,t.durationEditable,this.opt("eventDurationEditable"),n.editable,t.editable,this.opt("editable"))},reportEventResize:function(n,t,i,r,u){var f=this.calendar,e=f.mutateEvent(n,t,i),o=function(){e.undo();f.reportEventChange()};this.triggerEventResize(n,e.durationDelta,o,r,u);f.reportEventChange()},triggerEventResize:function(n,t,i,r,u){this.publiclyTrigger("eventResize",r[0],n,t,i,u,{})},select:function(n,t){this.unselect(t);this.renderSelection(n);this.reportSelection(n,t)},renderSelection:function(){},reportSelection:function(n,t){this.isSelected=!0;this.triggerSelect(n,t)},triggerSelect:function(n,t){this.publiclyTrigger("select",null,this.calendar.applyTimezone(n.start),this.calendar.applyTimezone(n.end),t)},unselect:function(n){this.isSelected&&(this.isSelected=!1,this.destroySelection&&this.destroySelection(),this.unrenderSelection(),this.publiclyTrigger("unselect",null,n))},unrenderSelection:function(){},selectEvent:function(n){this.selectedEvent&&this.selectedEvent===n||(this.unselectEvent(),this.renderedEventSegEach(function(n){n.el.addClass("fc-selected")},n),this.selectedEvent=n)},unselectEvent:function(){this.selectedEvent&&(this.renderedEventSegEach(function(n){n.el.removeClass("fc-selected")},this.selectedEvent),this.selectedEvent=null)},isEventSelected:function(n){return this.selectedEvent&&this.selectedEvent._id===n._id},handleDocumentMousedown:function(n){ur(n)&&this.processUnselect(n)},processUnselect:function(n){this.processRangeUnselect(n);this.processEventUnselect(n)},processRangeUnselect:function(t){var i;this.isSelected&&this.opt("unselectAuto")&&(i=this.opt("unselectCancel"),i&&n(t.target).closest(i).length||this.unselect(t))},processEventUnselect:function(t){this.selectedEvent&&(n(t.target).closest(".fc-selected").length||this.unselectEvent())},triggerDayClick:function(n,t,i){this.publiclyTrigger("dayClick",t,this.calendar.applyTimezone(n.start),i)},initHiddenDays:function(){var i=this.opt("hiddenDays")||[],r=[],u=0,t;for(this.opt("weekends")===!1&&i.push(0,6),t=0;t<7;t++)(r[t]=n.inArray(t,i)!==-1)||u++;if(!u)throw"invalid hiddenDays";this.isHiddenDayHash=r},isHiddenDay:function(n){return t.isMoment(n)&&(n=n.day()),this.isHiddenDayHash[n]},skipHiddenDays:function(n,t,i){var r=n.clone();for(t=t||1;this.isHiddenDayHash[(r.day()+(i?t:0)+7)%7];)r.add(t,"days");return r},computeDayRange:function(n){var r=n.start.clone().stripTime(),i=n.end,t=null,u;return i&&(t=i.clone().stripTime(),u=+i.time(),u&&u>=this.nextDayThreshold&&t.add(1,"days")),(!i||t<=r)&&(t=r.clone().add(1,"days")),{start:r,end:t}},isMultiDayEvent:function(n){var t=this.computeDayRange(n);return t.end.diff(t.start,"days")>1}});bt=i.Scroller=h.extend({el:null,scrollEl:null,overflowX:null,overflowY:null,constructor:function(n){n=n||{};this.overflowX=n.overflowX||n.overflow||"auto";this.overflowY=n.overflowY||n.overflow||"auto"},render:function(){this.el=this.renderEl();this.applyOverflow()},renderEl:function(){return this.scrollEl=n('<div class="fc-scroller"><\/div>')},clear:function(){this.setHeight("auto");this.applyOverflow()},destroy:function(){this.el.remove()},applyOverflow:function(){this.scrollEl.css({"overflow-x":this.overflowX,"overflow-y":this.overflowY})},lockOverflow:function(n){var t=this.overflowX,i=this.overflowY;n=n||this.getScrollbarWidths();t==="auto"&&(t=n.top||n.bottom||this.scrollEl[0].scrollWidth-1>this.scrollEl[0].clientWidth?"scroll":"hidden");i==="auto"&&(i=n.left||n.right||this.scrollEl[0].scrollHeight-1>this.scrollEl[0].clientHeight?"scroll":"hidden");this.scrollEl.css({"overflow-x":t,"overflow-y":i})},setHeight:function(n){this.scrollEl.height(n)},getScrollTop:function(){return this.scrollEl.scrollTop()},setScrollTop:function(n){this.scrollEl.scrollTop(n)},getClientWidth:function(){return this.scrollEl[0].clientWidth},getClientHeight:function(){return this.scrollEl[0].clientHeight},getScrollbarWidths:function(){return ti(this.scrollEl)}});vu.prototype.proxyCall=function(n){var i=Array.prototype.slice.call(arguments,1),t=[];return this.items.forEach(function(r){t.push(r[n].apply(r,i))}),t};u=i.Calendar=h.extend({dirDefaults:null,localeDefaults:null,overrides:null,dynamicOverrides:null,options:null,viewSpecCache:null,view:null,header:null,footer:null,loadingLevel:0,constructor:ve,initialize:function(){},populateOptionsHash:function(){var t,n,r,i;t=e(this.dynamicOverrides.locale,this.overrides.locale);n=k[t];n||(t=u.defaults.locale,n=k[t]||{});r=e(this.dynamicOverrides.isRTL,this.overrides.isRTL,n.isRTL,u.defaults.isRTL);i=r?u.rtlDefaults:{};this.dirDefaults=i;this.localeDefaults=n;this.options=tt([u.defaults,i,n,this.overrides,this.dynamicOverrides]);pu(this.options)},getViewSpec:function(n){var t=this.viewSpecCache;return t[n]||(t[n]=this.buildViewSpec(n))},getUnitViewSpec:function(t){var r,u,f;if(n.inArray(t,at)!=-1)for(r=this.header.getViewsWithButtons(),n.each(i.views,function(n){r.push(n)}),u=0;u<r.length;u++)if(f=this.getViewSpec(r[u]),f&&f.singleUnit==t)return f},buildViewSpec:function(n){for(var h=this.overrides.views||{},c=[],l=[],s=[],u=n,i,f,r,e;u;)i=o[u],f=h[u],u=null,typeof i=="function"&&(i={"class":i}),i&&(c.unshift(i),l.unshift(i.defaults||{}),r=r||i.duration,u=u||i.type),f&&(s.unshift(f),r=r||f.duration,u=u||f.type);return(i=fi(c),i.type=n,!i["class"])?!1:(r&&(r=t.duration(r),r.valueOf()&&(i.duration=r,e=ri(r),r.as(e)===1&&(i.singleUnit=e,s.unshift(h[e]||{})))),i.defaults=tt(l),i.overrides=tt(s),this.buildViewSpecOptions(i),this.buildViewSpecButtonText(i,n),i)},buildViewSpecOptions:function(n){n.options=tt([u.defaults,n.defaults,this.dirDefaults,this.localeDefaults,this.overrides,n.overrides,this.dynamicOverrides]);pu(n.options)},buildViewSpecButtonText:function(n,t){function i(i){var r=i.buttonText||{};return r[t]||(n.buttonTextKey?r[n.buttonTextKey]:null)||(n.singleUnit?r[n.singleUnit]:null)}n.buttonTextOverride=i(this.dynamicOverrides)||i(this.overrides)||n.overrides.buttonText;n.buttonTextDefault=i(this.localeDefaults)||i(this.dirDefaults)||n.defaults.buttonText||i(u.defaults)||(n.duration?this.humanizeDuration(n.duration):null)||t},instantiateView:function(n){var t=this.getViewSpec(n);return new t["class"](this,n,t.options,t.duration)},isValidViewType:function(n){return Boolean(this.getViewSpec(n))},pushLoading:function(){this.loadingLevel++||this.publiclyTrigger("loading",null,!0,this.view)},popLoading:function(){--this.loadingLevel||this.publiclyTrigger("loading",null,!1,this.view)},buildSelectSpan:function(n,t){var i=this.moment(n).stripZone(),r;return r=t?this.moment(t).stripZone():i.hasTime()?i.clone().add(this.defaultTimedEventDuration):i.clone().add(this.defaultAllDayEventDuration),{start:i,end:r}}});u.mixin(ru);u.mixin({optionHandlers:null,bindOption:function(n,t){this.bindOptions([n],t)},bindOptions:function(n,t){for(var r={func:t,names:n},i=0;i<n.length;i++)this.registerOptionHandlerObj(n[i],r);this.triggerOptionHandlerObj(r)},registerOptionHandlerObj:function(n,t){(this.optionHandlers[n]||(this.optionHandlers[n]=[])).push(t)},triggerOptionHandlers:function(n){for(var i=this.optionHandlers[n]||[],t=0;t<i.length;t++)this.triggerOptionHandlerObj(i[t])},triggerOptionHandlerObj:function(n){for(var i=n.names,r=[],t=0;t<i.length;t++)r.push(this.options[i[t]]);n.func.apply(this,r)}});u.defaults={titleRangeSeparator:" – ",monthYearFormat:"MMMM YYYY",defaultTimedEventDuration:"02:00:00",defaultAllDayEventDuration:{days:1},forceEventDuration:!1,nextDayThreshold:"09:00:00",defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberTitle:"W",weekNumberCalculation:"local",scrollTime:"06:00:00",lazyFetching:!0,startParam:"start",endParam:"end",timezoneParam:"timezone",timezone:!1,isRTL:!1,buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day"},buttonIcons:{prev:"left-single-arrow",next:"right-single-arrow",prevYear:"left-double-arrow",nextYear:"right-double-arrow"},allDayText:"all-day",theme:!1,themeButtonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e",prevYear:"seek-prev",nextYear:"seek-next"},dragOpacity:.75,dragRevertDuration:500,dragScroll:!0,unselectAuto:!0,dropAccept:"*",eventOrder:"title",eventLimit:!1,eventLimitText:"more",eventLimitClick:"popover",dayPopoverFormat:"LL",handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3};u.englishDefaults={dayPopoverFormat:"dddd, MMMM D"};u.rtlDefaults={header:{left:"next,prev today",center:"",right:"title"},buttonIcons:{prev:"right-single-arrow",next:"left-single-arrow",prevYear:"right-double-arrow",nextYear:"left-double-arrow"},themeButtonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w",nextYear:"seek-prev",prevYear:"seek-next"}};k=i.locales={};i.datepickerLocale=function(t,i,r){var u=k[t]||(k[t]={});u.isRTL=r.isRTL;u.weekNumberTitle=r.weekHeader;n.each(ye,function(n,t){u[n]=t(r)});n.datepicker&&(n.datepicker.regional[i]=n.datepicker.regional[t]=r,n.datepicker.regional.en=n.datepicker.regional[""],n.datepicker.setDefaults(r))};i.locale=function(t,i){var r,f;r=k[t]||(k[t]={});i&&(r=k[t]=tt([r,i]));f=wu(t);n.each(pe,function(n,t){r[n]==null&&(r[n]=t(f,r))});u.defaults.locale=t};var ye={buttonText:function(n){return{prev:oi(n.prevText),next:oi(n.nextText),today:oi(n.currentText)}},monthYearFormat:function(n){return n.showMonthAfterYear?"YYYY["+n.yearSuffix+"] MMMM":"MMMM YYYY["+n.yearSuffix+"]"}},pe={dayOfMonthFormat:function(n,t){var i=n.longDateFormat("l");return i=i.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),t.isRTL?i+=" ddd":i="ddd "+i,i},mediumTimeFormat:function(n){return n.longDateFormat("LT").replace(/\s*a$/i,"a")},smallTimeFormat:function(n){return n.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")},extraSmallTimeFormat:function(n){return n.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")},hourFormat:function(n){return n.longDateFormat("LT").replace(":mm","").replace(/(\Wmm)$/,"").replace(/\s*a$/i,"a")},noMeridiemTimeFormat:function(n){return n.longDateFormat("LT").replace(/\s*a$/i,"")}},we={smallDayDateFormat:function(n){return n.isRTL?"D dd":"dd D"},weekFormat:function(n){return n.isRTL?"w[ "+n.weekNumberTitle+"]":"["+n.weekNumberTitle+" ]w"},smallWeekFormat:function(n){return n.isRTL?"w["+n.weekNumberTitle+"]":"["+n.weekNumberTitle+"]w"}};i.locale("en",u.englishDefaults);i.sourceNormalizers=[];i.sourceFetchers=[];bu={dataType:"json",cache:!1};ku=1;u.prototype.normalizeEvent=function(){};u.prototype.spanContainsSpan=function(n,t){var i=n.start.clone().stripZone(),r=this.getEventEnd(n).stripZone();return t.start>=i&&t.end<=r};u.prototype.getPeerEvents=function(n,t){for(var u=this.getEventCache(),f=[],r,i=0;i<u.length;i++)r=u[i],t&&t._id===r._id||f.push(r);return f};u.prototype.isEventSpanAllowed=function(n,t){var i=t.source||{},r=e(t.constraint,i.constraint,this.options.eventConstraint),u=e(t.overlap,i.overlap,this.options.eventOverlap);return this.isSpanAllowed(n,r,u,t)&&(!this.options.eventAllow||this.options.eventAllow(n,t)!==!1)};u.prototype.isExternalSpanAllowed=function(t,i,r){var f,u;return r&&(f=n.extend({},r,i),u=this.expandEvent(this.buildEventFromInput(f))[0]),u?this.isEventSpanAllowed(t,u):this.isSelectionSpanAllowed(t)};u.prototype.isSelectionSpanAllowed=function(n){return this.isSpanAllowed(n,this.options.selectConstraint,this.options.selectOverlap)&&(!this.options.selectAllow||this.options.selectAllow(n)!==!1)};u.prototype.isSpanAllowed=function(n,t,i,r){var o,h,c,u,f,s;if(t!=null&&(o=this.constraintToEvents(t),o)){for(h=!1,u=0;u<o.length;u++)if(this.spanContainsSpan(o[u],n)){h=!0;break}if(!h)return!1}for(c=this.getPeerEvents(n,r),u=0;u<c.length;u++)if(f=c[u],this.eventIntersectsRange(f,n)&&(i===!1||typeof i=="function"&&!i(f,r)||r&&((s=e(f.overlap,(f.source||{}).overlap),s===!1)||typeof s=="function"&&!s(r,f))))return!1;return!0};u.prototype.constraintToEvents=function(n){return n==="businessHours"?this.getCurrentBusinessHourEvents():typeof n=="object"?n.start!=null?this.expandEvent(this.buildEventFromInput(n)):null:this.clientEvents(n)};u.prototype.eventIntersectsRange=function(n,t){var i=n.start.clone().stripZone(),r=this.getEventEnd(n).stripZone();return t.start<r&&t.end>i};wi={id:"_fcBusinessHours",start:"09:00",end:"17:00",dow:[1,2,3,4,5],rendering:"inverse-background"};u.prototype.getCurrentBusinessHourEvents=function(n){return this.computeBusinessHourEvents(n,this.options.businessHours)};u.prototype.computeBusinessHourEvents=function(t,i){return i===!0?this.expandBusinessHourEvents(t,[{}]):n.isPlainObject(i)?this.expandBusinessHourEvents(t,[i]):n.isArray(i)?this.expandBusinessHourEvents(t,i,!0):[]};u.prototype.expandBusinessHourEvents=function(t,i,r){for(var o=this.getView(),e=[],u,f=0;f<i.length;f++)(u=i[f],!r||u.dow)&&(u=n.extend({},wi,u),t&&(u.start=null,u.end=null),e.push.apply(e,this.expandEvent(this.buildEventFromInput(u),o.start,o.end)));return e};var bi=i.BasicView=p.extend({scroller:null,dayGridClass:et,dayGrid:null,dayNumbersVisible:!1,colWeekNumbersVisible:!1,cellWeekNumbersVisible:!1,weekNumberWidth:null,headContainerEl:null,headRowEl:null,initialize:function(){this.dayGrid=this.instantiateDayGrid();this.scroller=new bt({overflowX:"hidden",overflowY:"auto"})},instantiateDayGrid:function(){var n=this.dayGridClass.extend(ke);return new n(this)},setRange:function(n){p.prototype.setRange.call(this,n);this.dayGrid.breakOnWeeks=/year|month|week/.test(this.intervalUnit);this.dayGrid.setRange(n)},computeRange:function(n){var t=p.prototype.computeRange.call(this,n);return/year|month/.test(t.intervalUnit)&&(t.start.startOf("week"),t.start=this.skipHiddenDays(t.start),t.end.weekday()&&(t.end.add(1,"week").startOf("week"),t.end=this.skipHiddenDays(t.end,-1,!0))),t},renderDates:function(){this.dayNumbersVisible=this.dayGrid.rowCnt>1;this.opt("weekNumbers")&&(this.opt("weekNumbersWithinDays")?(this.cellWeekNumbersVisible=!0,this.colWeekNumbersVisible=!1):(this.cellWeekNumbersVisible=!1,this.colWeekNumbersVisible=!0));this.dayGrid.numbersVisible=this.dayNumbersVisible||this.cellWeekNumbersVisible||this.colWeekNumbersVisible;this.el.addClass("fc-basic-view").html(this.renderSkeletonHtml());this.renderHead();this.scroller.render();var t=this.scroller.el.addClass("fc-day-grid-container"),i=n('<div class="fc-day-grid" />').appendTo(t);this.el.find(".fc-body > tr > td").append(t);this.dayGrid.setElement(i);this.dayGrid.renderDates(this.hasRigidRows())},renderHead:function(){this.headContainerEl=this.el.find(".fc-head-container").html(this.dayGrid.renderHeadHtml());this.headRowEl=this.headContainerEl.find(".fc-row")},unrenderDates:function(){this.dayGrid.unrenderDates();this.dayGrid.removeElement();this.scroller.destroy()},renderBusinessHours:function(){this.dayGrid.renderBusinessHours()},unrenderBusinessHours:function(){this.dayGrid.unrenderBusinessHours()},renderSkeletonHtml:function(){return'<table><thead class="fc-head"><tr><td class="fc-head-container '+this.widgetHeaderClass+'"><\/td><\/tr><\/thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'"><\/td><\/tr><\/tbody><\/table>'},weekNumberStyleAttr:function(){return this.weekNumberWidth!==null?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var n=this.opt("eventLimit");return n&&typeof n!="number"},updateWidth:function(){this.colWeekNumbersVisible&&(this.weekNumberWidth=ir(this.el.find(".fc-week-number")))},setHeight:function(n,t){var i=this.opt("eventLimit"),r,u;this.scroller.clear();gi(this.headRowEl);this.dayGrid.removeSegPopover();i&&typeof i=="number"&&this.dayGrid.limitRows(i);r=this.computeScrollerHeight(n);this.setGridHeight(r,t);i&&typeof i!="number"&&this.dayGrid.limitRows(i);t||(this.scroller.setHeight(r),u=this.scroller.getScrollbarWidths(),(u.left||u.right)&&(di(this.headRowEl,u),r=this.computeScrollerHeight(n),this.scroller.setHeight(r)),this.scroller.lockOverflow(u))},computeScrollerHeight:function(n){return n-dt(this.el,this.scroller.el)},setGridHeight:function(n,t){t?tr(this.dayGrid.rowEls):nr(this.dayGrid.rowEls,n,!0)},computeInitialScroll:function(){return{top:0}},queryScroll:function(){return{top:this.scroller.getScrollTop()}},setScroll:function(n){this.scroller.setScrollTop(n.top)},prepareHits:function(){this.dayGrid.prepareHits()},releaseHits:function(){this.dayGrid.releaseHits()},queryHit:function(n,t){return this.dayGrid.queryHit(n,t)},getHitSpan:function(n){return this.dayGrid.getHitSpan(n)},getHitEl:function(n){return this.dayGrid.getHitEl(n)},renderEvents:function(n){this.dayGrid.renderEvents(n);this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},unrenderEvents:function(){this.dayGrid.unrenderEvents()},renderDrag:function(n,t){return this.dayGrid.renderDrag(n,t)},unrenderDrag:function(){this.dayGrid.unrenderDrag()},renderSelection:function(n){this.dayGrid.renderSelection(n)},unrenderSelection:function(){this.dayGrid.unrenderSelection()}}),ke={renderHeadIntroHtml:function(){var n=this.view;return n.colWeekNumbersVisible?'<th class="fc-week-number '+n.widgetHeaderClass+'" '+n.weekNumberStyleAttr()+"><span>"+r(n.opt("weekNumberTitle"))+"<\/span><\/th>":""},renderNumberIntroHtml:function(n){var t=this.view,i=this.getCellDate(n,0);return t.colWeekNumbersVisible?'<td class="fc-week-number" '+t.weekNumberStyleAttr()+">"+t.buildGotoAnchorHtml({date:i,type:"week",forceOff:this.colCnt===1},i.format("w"))+"<\/td>":""},renderBgIntroHtml:function(){var n=this.view;return n.colWeekNumbersVisible?'<td class="fc-week-number '+n.widgetContentClass+'" '+n.weekNumberStyleAttr()+"><\/td>":""},renderIntroHtml:function(){var n=this.view;return n.colWeekNumbersVisible?'<td class="fc-week-number" '+n.weekNumberStyleAttr()+"><\/td>":""}},de=i.MonthView=bi.extend({computeRange:function(n){var t=bi.prototype.computeRange.call(this,n),i;return this.isFixedWeeks()&&(i=Math.ceil(t.end.diff(t.start,"weeks",!0)),t.end.add(6-i,"weeks")),t},setGridHeight:function(n,t){t&&(n*=this.rowCnt/6);nr(this.dayGrid.rowEls,n,!t)},isFixedWeeks:function(){return this.opt("fixedWeekCount")}});o.basic={"class":bi};o.basicDay={type:"basic",duration:{days:1}};o.basicWeek={type:"basic",duration:{weeks:1}};o.month={"class":de,duration:{months:1},defaults:{fixedWeekCount:!0}};var ge=i.AgendaView=p.extend({scroller:null,timeGridClass:pi,timeGrid:null,dayGridClass:et,dayGrid:null,axisWidth:null,headContainerEl:null,noScrollRowEls:null,bottomRuleEl:null,initialize:function(){this.timeGrid=this.instantiateTimeGrid();this.opt("allDaySlot")&&(this.dayGrid=this.instantiateDayGrid());this.scroller=new bt({overflowX:"hidden",overflowY:"auto"})},instantiateTimeGrid:function(){var n=this.timeGridClass.extend(no);return new n(this)},instantiateDayGrid:function(){var n=this.dayGridClass.extend(to);return new n(this)},setRange:function(n){p.prototype.setRange.call(this,n);this.timeGrid.setRange(n);this.dayGrid&&this.dayGrid.setRange(n)},renderDates:function(){this.el.addClass("fc-agenda-view").html(this.renderSkeletonHtml());this.renderHead();this.scroller.render();var t=this.scroller.el.addClass("fc-time-grid-container"),i=n('<div class="fc-time-grid" />').appendTo(t);this.el.find(".fc-body > tr > td").append(t);this.timeGrid.setElement(i);this.timeGrid.renderDates();this.bottomRuleEl=n('<hr class="fc-divider '+this.widgetHeaderClass+'"/>').appendTo(this.timeGrid.el);this.dayGrid&&(this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(),this.dayGrid.bottomCoordPadding=this.dayGrid.el.next("hr").outerHeight());this.noScrollRowEls=this.el.find(".fc-row:not(.fc-scroller *)")},renderHead:function(){this.headContainerEl=this.el.find(".fc-head-container").html(this.timeGrid.renderHeadHtml())},unrenderDates:function(){this.timeGrid.unrenderDates();this.timeGrid.removeElement();this.dayGrid&&(this.dayGrid.unrenderDates(),this.dayGrid.removeElement());this.scroller.destroy()},renderSkeletonHtml:function(){return'<table><thead class="fc-head"><tr><td class="fc-head-container '+this.widgetHeaderClass+'"><\/td><\/tr><\/thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'">'+(this.dayGrid?'<div class="fc-day-grid"/><hr class="fc-divider '+this.widgetHeaderClass+'"/>':"")+"<\/td><\/tr><\/tbody><\/table>"},axisStyleAttr:function(){return this.axisWidth!==null?'style="width:'+this.axisWidth+'px"':""},renderBusinessHours:function(){this.timeGrid.renderBusinessHours();this.dayGrid&&this.dayGrid.renderBusinessHours()},unrenderBusinessHours:function(){this.timeGrid.unrenderBusinessHours();this.dayGrid&&this.dayGrid.unrenderBusinessHours()},getNowIndicatorUnit:function(){return this.timeGrid.getNowIndicatorUnit()},renderNowIndicator:function(n){this.timeGrid.renderNowIndicator(n)},unrenderNowIndicator:function(){this.timeGrid.unrenderNowIndicator()},updateSize:function(n){this.timeGrid.updateSize(n);p.prototype.updateSize.call(this,n)},updateWidth:function(){this.axisWidth=ir(this.el.find(".fc-axis"))},setHeight:function(n,t){var i,r,u;this.bottomRuleEl.hide();this.scroller.clear();gi(this.noScrollRowEls);this.dayGrid&&(this.dayGrid.removeSegPopover(),i=this.opt("eventLimit"),i&&typeof i!="number"&&(i=io),i&&this.dayGrid.limitRows(i));t||(r=this.computeScrollerHeight(n),this.scroller.setHeight(r),u=this.scroller.getScrollbarWidths(),(u.left||u.right)&&(di(this.noScrollRowEls,u),r=this.computeScrollerHeight(n),this.scroller.setHeight(r)),this.scroller.lockOverflow(u),this.timeGrid.getTotalSlatHeight()<r&&this.bottomRuleEl.show())},computeScrollerHeight:function(n){return n-dt(this.el,this.scroller.el)},computeInitialScroll:function(){var i=t.duration(this.opt("scrollTime")),n=this.timeGrid.computeTimeTop(i);return n=Math.ceil(n),n&&n++,{top:n}},queryScroll:function(){return{top:this.scroller.getScrollTop()}},setScroll:function(n){this.scroller.setScrollTop(n.top)},prepareHits:function(){this.timeGrid.prepareHits();this.dayGrid&&this.dayGrid.prepareHits()},releaseHits:function(){this.timeGrid.releaseHits();this.dayGrid&&this.dayGrid.releaseHits()},queryHit:function(n,t){var i=this.timeGrid.queryHit(n,t);return!i&&this.dayGrid&&(i=this.dayGrid.queryHit(n,t)),i},getHitSpan:function(n){return n.component.getHitSpan(n)},getHitEl:function(n){return n.component.getHitEl(n)},renderEvents:function(n){for(var i=[],r=[],u=[],f,t=0;t<n.length;t++)n[t].allDay?i.push(n[t]):r.push(n[t]);f=this.timeGrid.renderEvents(r);this.dayGrid&&(u=this.dayGrid.renderEvents(i));this.updateHeight()},getEventSegs:function(){return this.timeGrid.getEventSegs().concat(this.dayGrid?this.dayGrid.getEventSegs():[])},unrenderEvents:function(){this.timeGrid.unrenderEvents();this.dayGrid&&this.dayGrid.unrenderEvents()},renderDrag:function(n,t){return n.start.hasTime()?this.timeGrid.renderDrag(n,t):this.dayGrid?this.dayGrid.renderDrag(n,t):void 0},unrenderDrag:function(){this.timeGrid.unrenderDrag();this.dayGrid&&this.dayGrid.unrenderDrag()},renderSelection:function(n){n.start.hasTime()||n.end.hasTime()?this.timeGrid.renderSelection(n):this.dayGrid&&this.dayGrid.renderSelection(n)},unrenderSelection:function(){this.timeGrid.unrenderSelection();this.dayGrid&&this.dayGrid.unrenderSelection()}}),no={renderHeadIntroHtml:function(){var n=this.view,t;return n.opt("weekNumbers")?(t=this.start.format(n.opt("smallWeekFormat")),'<th class="fc-axis fc-week-number '+n.widgetHeaderClass+'" '+n.axisStyleAttr()+">"+n.buildGotoAnchorHtml({date:this.start,type:"week",forceOff:this.colCnt>1},r(t))+"<\/th>"):'<th class="fc-axis '+n.widgetHeaderClass+'" '+n.axisStyleAttr()+"><\/th>"},renderBgIntroHtml:function(){var n=this.view;return'<td class="fc-axis '+n.widgetContentClass+'" '+n.axisStyleAttr()+"><\/td>"},renderIntroHtml:function(){var n=this.view;return'<td class="fc-axis" '+n.axisStyleAttr()+"><\/td>"}},to={renderBgIntroHtml:function(){var n=this.view;return'<td class="fc-axis '+n.widgetContentClass+'" '+n.axisStyleAttr()+"><span>"+n.getAllDayHtml()+"<\/span><\/td>"},renderIntroHtml:function(){var n=this.view;return'<td class="fc-axis" '+n.axisStyleAttr()+"><\/td>"}},io=5,du=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];return o.agenda={"class":ge,defaults:{allDaySlot:!0,slotDuration:"00:30:00",minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0}},o.agendaDay={type:"agenda",duration:{days:1}},o.agendaWeek={type:"agenda",duration:{weeks:1}},gu=p.extend({grid:null,scroller:null,initialize:function(){this.grid=new nf(this);this.scroller=new bt({overflowX:"hidden",overflowY:"auto"})},setRange:function(n){p.prototype.setRange.call(this,n);this.grid.setRange(n)},renderSkeleton:function(){this.el.addClass("fc-list-view "+this.widgetContentClass);this.scroller.render();this.scroller.el.appendTo(this.el);this.grid.setElement(this.scroller.scrollEl)},unrenderSkeleton:function(){this.scroller.destroy()},setHeight:function(n){this.scroller.setHeight(this.computeScrollerHeight(n))},computeScrollerHeight:function(n){return n-dt(this.el,this.scroller.el)},renderEvents:function(n){this.grid.renderEvents(n)},unrenderEvents:function(){this.grid.unrenderEvents()},isEventResizable:function(){return!1},isEventDraggable:function(){return!1}}),nf=l.extend({segSelector:".fc-list-item",hasDayInteractions:!1,spanToSegs:function(n){for(var r=this.view,i=r.start.clone().time(0),u=0,t,f=[];i<r.end;)if(t=lt(n,{start:i,end:i.clone().add(1,"day")}),t&&(t.dayIndex=u,f.push(t)),i.add(1,"day"),u++,t&&!t.isEnd&&n.end.hasTime()&&n.end<i.clone().add(this.view.nextDayThreshold)){t.end=n.end.clone();t.isEnd=!0;break}return f},computeEventTimeFormat:function(){return this.view.opt("mediumTimeFormat")},handleSegClick:function(t,i){var r;l.prototype.handleSegClick.apply(this,arguments);n(i.target).closest("a[href]").length||(r=t.event.url,r&&!i.isDefaultPrevented()&&(window.location.href=r))},renderFgSegs:function(n){return n=this.renderFgSegEls(n),n.length?this.renderSegList(n):this.renderEmptyMessage(),n},renderEmptyMessage:function(){this.el.html('<div class="fc-list-empty-wrap2"><div class="fc-list-empty-wrap1"><div class="fc-list-empty">'+r(this.view.opt("noEventsMessage"))+"<\/div><\/div><\/div>")},renderSegList:function(t){for(var f=this.groupSegsByDay(t),r,u,e=n('<table class="fc-list-table"><tbody/><\/table>'),o=e.find("tbody"),i=0;i<f.length;i++)if(r=f[i],r)for(o.append(this.dayHeaderHtml(this.view.start.clone().add(i,"days"))),this.sortEventSegs(r),u=0;u<r.length;u++)o.append(r[u].el);this.el.empty().append(e)},groupSegsByDay:function(n){for(var r=[],i,t=0;t<n.length;t++)i=n[t],(r[i.dayIndex]||(r[i.dayIndex]=[])).push(i);return r},dayHeaderHtml:function(n){var t=this.view,i=t.opt("listDayFormat"),u=t.opt("listDayAltFormat");return'<tr class="fc-list-heading" data-date="'+n.format("YYYY-MM-DD")+'"><td class="'+t.widgetHeaderClass+'" colspan="3">'+(i?t.buildGotoAnchorHtml(n,{"class":"fc-list-heading-main"},r(n.format(i))):"")+(u?t.buildGotoAnchorHtml(n,{"class":"fc-list-heading-alt"},r(n.format(u))):"")+"<\/td><\/tr>"},fgSegHtml:function(n){var i=this.view,f=["fc-list-item"].concat(this.getSegCustomClasses(n)),e=this.getSegBackgroundColor(n),t=n.event,u=t.url,o;return o=t.allDay?i.getAllDayHtml():i.isMultiDayEvent(t)?n.isStart||n.isEnd?r(this.getEventTimeText(n)):i.getAllDayHtml():r(this.getEventTimeText(t)),u&&f.push("fc-has-url"),'<tr class="'+f.join(" ")+'">'+(this.displayEventTime?'<td class="fc-list-item-time '+i.widgetContentClass+'">'+(o||"")+"<\/td>":"")+'<td class="fc-list-item-marker '+i.widgetContentClass+'"><span class="fc-event-dot"'+(e?' style="background-color:'+e+'"':"")+'><\/span><\/td><td class="fc-list-item-title '+i.widgetContentClass+'"><a tooltips'+(u?' href="'+r(u)+'"':"")+">title: "+r(t.title||"")+(t.content?": "+r(t.content):"")+"<\/a><\/td><\/tr>"}}),o.list={"class":gu,buttonTextKey:"list",defaults:{buttonText:"list",listDayFormat:"LL",noEventsMessage:"No events to display"}},o.listDay={type:"list",duration:{days:1},defaults:{listDayFormat:"dddd"}},o.listWeek={type:"list",duration:{weeks:1},defaults:{listDayFormat:"dddd",listDayAltFormat:"LL"}},o.listMonth={type:"list",duration:{month:1},defaults:{listDayAltFormat:"dddd"}},o.listYear={type:"list",duration:{year:1},defaults:{listDayAltFormat:"dddd"}},i});
|