var utility,allIssues;!function(n){function r(){return new Date(Date.UTC.apply(Date,arguments))}var u=function(r,u){var f=this;this.element=n(r);this.autoShow=u.autoShow||!0;this.appendTo=u.appendTo||"body";this.closeButton=u.closeButton;this.language=u.language||this.element.data("date-language")||"en";this.language=this.language in i?this.language:this.language.split("-")[0];this.language=this.language in i?this.language:"en";this.isRTL=i[this.language].rtl||!1;this.format=t.parseFormat(u.format||this.element.data("date-format")||i[this.language].format||"mm/dd/yyyy");this.isInline=!1;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".prefix, .postfix"):!1;this.hasInput=this.component&&this.element.find("input").length;this.disableDblClickSelection=u.disableDblClickSelection;this.onRender=u.onRender||function(){};this.component&&this.component.length===0&&(this.component=!1);this.linkField=u.linkField||this.element.data("link-field")||!1;this.linkFormat=t.parseFormat(u.linkFormat||this.element.data("link-format")||"yyyy-mm-dd hh:ii:ss");this.minuteStep=u.minuteStep||this.element.data("minute-step")||5;this.pickerPosition=u.pickerPosition||this.element.data("picker-position")||"bottom-right";this.initialDate=u.initialDate||null;this._attachEvents();this.minView=0;"minView"in u?this.minView=u.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view"));this.minView=t.convertViewMode(this.minView);this.maxView=t.modes.length-1;"maxView"in u?this.maxView=u.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view"));this.maxView=t.convertViewMode(this.maxView);this.startViewMode="month";"startView"in u?this.startViewMode=u.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view"));this.startViewMode=t.convertViewMode(this.startViewMode);this.viewMode=this.startViewMode;"minView"in u||"maxView"in u||this.element.data("min-view")&&!this.element.data("max-view")||(this.pickTime=!1,"pickTime"in u&&(this.pickTime=u.pickTime),this.pickTime==!0?(this.minView=0,this.maxView=4):(this.minView=2,this.maxView=4));this.forceParse=!0;"forceParse"in u?this.forceParse=u.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse"));this.picker=n(t.template).appendTo(this.isInline?this.element:this.appendTo).on({click:n.proxy(this.click,this),mousedown:n.proxy(this.mousedown,this)});this.closeButton?this.picker.find("a.datepicker-close").show():this.picker.find("a.datepicker-close").hide();this.isInline?this.picker.addClass("datepicker-inline"):this.picker.addClass("datepicker-dropdown dropdown-menu");this.isRTL&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("fa-chevron-left fa-chevron-right"));n(document).on("mousedown",function(t){n(t.target).closest(".datepicker.datepicker-inline, .datepicker.datepicker-dropdown").length===0&&f.hide()});this.autoclose=!0;"autoclose"in u?this.autoclose=u.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose"));this.keyboardNavigation=!0;"keyboardNavigation"in u?this.keyboardNavigation=u.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation"));this.todayBtn=u.todayBtn||this.element.data("date-today-btn")||!1;this.todayHighlight=u.todayHighlight||this.element.data("date-today-highlight")||!1;this.calendarWeeks=!1;"calendarWeeks"in u?this.calendarWeeks=u.calendarWeeks:"dateCalendarWeeks"in this.element.data()&&(this.calendarWeeks=this.element.data("date-calendar-weeks"));this.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(n,t){return parseInt(t)+1});this.weekStart=(u.weekStart||this.element.data("date-weekstart")||i[this.language].weekStart||0)%7;this.weekEnd=(this.weekStart+6)%7;this.startDate=-Infinity;this.endDate=Infinity;this.daysOfWeekDisabled=[];this.setStartDate(u.startDate||this.element.data("date-startdate"));this.setEndDate(u.endDate||this.element.data("date-enddate"));this.setDaysOfWeekDisabled(u.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled"));this.fillDow();this.fillMonths();this.update();this.showMode();this.isInline&&this.show()},i,t;u.prototype={constructor:u,_events:[],_attachEvents:function(){this._detachEvents();this.isInput?this._events=[[this.element,{focus:this.autoShow?n.proxy(this.show,this):function(){},keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:this.autoShow?n.proxy(this.show,this):function(){},keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}],[this.component,{click:n.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];this.disableDblClickSelection&&(this._events[this._events.length]=[this.element,{dblclick:function(t){t.preventDefault();t.stopPropagation();n(this).blur()}}]);for(var t=0,i,r;t<this._events.length;t++){i=this._events[t][0];r=this._events[t][1];i.on(r)}},_detachEvents:function(){for(var n=0,t,i;n<this._events.length;n++)t=this._events[n][0],i=this._events[n][1],t.off(i);this._events=[]},show:function(t){this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.update();this.place();n(window).on("resize",n.proxy(this.place,this));t&&(t.stopPropagation(),t.preventDefault());this.element.trigger({type:"show",date:this.date})},hide:function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide(),n(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||n(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.element.trigger({type:"hide",date:this.date}))},remove:function(){this._detachEvents();this.picker.remove();delete this.element.data().datepicker},getDate:function(){var n=this.getUTCDate();return new Date(n.getTime()+n.getTimezoneOffset()*6e4)},getUTCDate:function(){return this.date},setDate:function(n){this.setUTCDate(new Date(n.getTime()-n.getTimezoneOffset()*6e4))},setUTCDate:function(n){this.date=n;this.setValue()},setValue:function(){var n=this.getFormattedDate();this.isInput?this.element.val(n):(this.component&&this.element.find("input").val(n),this.element.data("date",n))},getFormattedDate:function(n){return n===undefined&&(n=this.format),t.formatDate(this.date,n,this.language)},setStartDate:function(n){this.startDate=n||-Infinity;this.startDate!==-Infinity&&(this.startDate=t.parseDate(this.startDate,this.format,this.language));this.update();this.updateNavArrows()},setEndDate:function(n){this.endDate=n||Infinity;this.endDate!==Infinity&&(this.endDate=t.parseDate(this.endDate,this.format,this.language));this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this.daysOfWeekDisabled=t||[];n.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/));this.daysOfWeekDisabled=n.map(this.daysOfWeekDisabled,function(n){return parseInt(n,10)});this.update();this.updateNavArrows()},place:function(){if(!this.isInline){var f=parseInt(this.element.parents().filter(function(){return n(this).css("z-index")!="auto"}).first().css("z-index"))+10,t=this.component?this.component:this.element,i=t.offset(),e=t.outerHeight()+parseInt(t.css("margin-top")),o=t.outerWidth()+parseInt(t.css("margin-left")),r=i.top+e,u=i.left;r+this.picker.outerHeight()>=n(window).scrollTop()+n(window).height()&&(r=i.top-this.picker.outerHeight());i.left+this.picker.width()>=n(window).width()&&(u=i.left+o-this.picker.width());this.picker.css({top:r,left:u,zIndex:f})}},update:function(){var n,i=!1,r=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val();arguments&&arguments.length&&(typeof arguments[0]=="string"||arguments[0]instanceof Date)?(n=arguments[0],i=!0):n=r||this.initialDate==null?this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val():this.initialDate;this.date=t.parseDate(n,this.format,this.language);(i||this.initialDate!=null)&&this.setValue();this.viewDate=this.date<this.startDate?new Date(this.startDate.valueOf()):this.date>this.endDate?new Date(this.endDate.valueOf()):new Date(this.date.valueOf());this.fill()},fillDow:function(){var r=this.weekStart,n="<tr>",t;for(this.calendarWeeks&&(t='<th class="cw">&nbsp;<\/th>',n+=t,this.picker.find(".datepicker-days thead tr:first-child").prepend(t));r<this.weekStart+7;)n+='<th class="dow">'+i[this.language].daysMin[r++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var n="",t=0;t<12;)n+='<span class="month">'+i[this.language].monthsShort[t++]+"<\/span>";this.picker.find(".datepicker-months td").html(n)},fill:function(){var u,g,l,o,s,c,p,v,it,e;if(this.date!=null&&this.viewDate!=null){var a=new Date(this.viewDate.valueOf()),f=a.getUTCFullYear(),h=a.getUTCMonth(),y=a.getUTCDate(),w=a.getUTCHours(),rt=a.getUTCMinutes(),b=this.startDate!==-Infinity?this.startDate.getUTCFullYear():-Infinity,ut=this.startDate!==-Infinity?this.startDate.getUTCMonth():-Infinity,k=this.endDate!==Infinity?this.endDate.getUTCFullYear():Infinity,ft=this.endDate!==Infinity?this.endDate.getUTCMonth():Infinity,nt=this.date&&this.date.valueOf(),d=new Date,st=i[this.language].titleFormat||i.en.titleFormat;for(this.picker.find(".datepicker-days thead th:eq(1)").text(i[this.language].months[h]+" "+f),this.picker.find(".datepicker-hours thead th:eq(1)").text(y+" "+i[this.language].months[h]+" "+f),this.picker.find(".datepicker-minutes thead th:eq(1)").text(y+" "+i[this.language].months[h]+" "+f),this.picker.find("tfoot th.today").text(i[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths(),u=r(f,h-1,28,0,0,0,0),g=t.getDaysInMonth(u.getUTCFullYear(),u.getUTCMonth()),u.setUTCDate(g),u.setUTCDate(g-(u.getUTCDay()-this.weekStart+7)%7),l=new Date(u.valueOf()),l.setUTCDate(l.getUTCDate()+42),l=l.valueOf(),o=[];u.valueOf()<l;){if(u.getUTCDay()==this.weekStart&&(o.push("<tr>"),this.calendarWeeks)){var tt=new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()-u.getDay()+10-(this.weekStart&&this.weekStart%7<5&&7)),et=new Date(tt.getFullYear(),0,4),ot=~~((tt-et)/6048e5+1.5);o.push('<td class="cw">'+ot+"<\/td>")}s=" "+this.onRender(u)+" ";u.getUTCFullYear()<f||u.getUTCFullYear()==f&&u.getUTCMonth()<h?s+=" old":(u.getUTCFullYear()>f||u.getUTCFullYear()==f&&u.getUTCMonth()>h)&&(s+=" new");this.todayHighlight&&u.getUTCFullYear()==d.getFullYear()&&u.getUTCMonth()==d.getMonth()&&u.getUTCDate()==d.getDate()&&(s+=" today");nt&&u.valueOf()==nt&&(s+=" active");(u.valueOf()<this.startDate||u.valueOf()>this.endDate||n.inArray(u.getUTCDay(),this.daysOfWeekDisabled)!==-1)&&(s+=" disabled");o.push('<td class="day'+s+'">'+u.getUTCDate()+"<\/td>");u.getUTCDay()==this.weekEnd&&o.push("<\/tr>");u.setUTCDate(u.getUTCDate()+1)}for(this.picker.find(".datepicker-days tbody").empty().append(o.join("")),o=[],e=0;e<24;e++)c=r(f,h,y,e),s="",c.valueOf()+36e5<this.startDate||c.valueOf()>this.endDate?s+=" disabled":w==e&&(s+=" active"),o.push('<span class="hour'+s+'">'+e+":00<\/span>");for(this.picker.find(".datepicker-hours td").html(o.join("")),o=[],e=0;e<60;e+=this.minuteStep)c=r(f,h,y,w,e),s="",c.valueOf()<this.startDate||c.valueOf()>this.endDate?s+=" disabled":Math.floor(rt/this.minuteStep)==Math.floor(e/this.minuteStep)&&(s+=" active"),o.push('<span class="minute'+s+'">'+w+":"+(e<10?"0"+e:e)+"<\/span>");for(this.picker.find(".datepicker-minutes td").html(o.join("")),p=this.date&&this.date.getUTCFullYear(),v=this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active"),p&&p==f&&v.eq(this.date.getUTCMonth()).addClass("active"),(f<b||f>k)&&v.addClass("disabled"),f==b&&v.slice(0,ut).addClass("disabled"),f==k&&v.slice(ft+1).addClass("disabled"),o="",f=parseInt(f/10,10)*10,it=this.picker.find(".datepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td"),f-=1,e=-1;e<11;e++)o+='<span class="year'+(e==-1||e==10?" old":"")+(p==f?" active":"")+(f<b||f>k?" disabled":"")+'">'+f+"<\/span>",f+=1;it.html(o)}},updateNavArrows:function(){var i=new Date(this.viewDate),n=i.getUTCFullYear(),t=i.getUTCMonth(),r=i.getUTCDate(),u=i.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()&&t<=this.startDate.getUTCMonth()&&r<=this.startDate.getUTCDate()&&u<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()&&t>=this.endDate.getUTCMonth()&&r>=this.endDate.getUTCDate()&&u>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()&&t<=this.startDate.getUTCMonth()&&r<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()&&t>=this.endDate.getUTCMonth()&&r>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()&&t<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()&&t>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(i){var u,a,o,f,e,v;if(i.stopPropagation(),i.preventDefault(),(n(i.target).hasClass("datepicker-close")||n(i.target).parent().hasClass("datepicker-close"))&&this.hide(),u=n(i.target).closest("span, td, th"),u.length==1){if(u.is(".disabled")){this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});return}switch(u[0].nodeName.toLowerCase()){case"th":switch(u[0].className){case"date-switch":this.showMode(1);break;case"prev":case"next":a=t.modes[this.viewMode].navStep*(u[0].className=="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,a);break;case 1:this.viewDate=this.moveDate(this.viewDate,a);break;case 2:this.viewDate=this.moveMonth(this.viewDate,a);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,a)}this.fill();break;case"today":o=new Date;o=r(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds());this.viewMode=this.startViewMode;this.showMode(0);this._setDate(o)}break;case"span":if(!u.is(".disabled")){if(u.is(".month"))if(this.minView===3){var f=u.parent().find("span").index(u)||0,e=this.viewDate.getUTCFullYear(),s=1,h=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),l=this.viewDate.getUTCSeconds();this._setDate(r(e,f,s,h,c,l,0))}else this.viewDate.setUTCDate(1),f=u.parent().find("span").index(u),this.viewDate.setUTCMonth(f),this.element.trigger({type:"changeMonth",date:this.viewDate});else if(u.is(".year"))if(this.minView===4){var e=parseInt(u.text(),10)||0,f=0,s=1,h=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),l=this.viewDate.getUTCSeconds();this._setDate(r(e,f,s,h,c,l,0))}else this.viewDate.setUTCDate(1),e=parseInt(u.text(),10)||0,this.viewDate.setUTCFullYear(e),this.element.trigger({type:"changeYear",date:this.viewDate});else if(u.is(".hour")){var h=parseInt(u.text(),10)||0,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),s=this.viewDate.getUTCDate(),c=this.viewDate.getUTCMinutes(),l=this.viewDate.getUTCSeconds();this._setDate(r(e,f,s,h,c,l,0))}else if(u.is(".minute")){var c=parseInt(u.text().substr(u.text().indexOf(":")+1),10)||0,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),s=this.viewDate.getUTCDate(),h=this.viewDate.getUTCHours(),l=this.viewDate.getUTCSeconds();this._setDate(r(e,f,s,h,c,l,0))}this.viewMode!=0?(v=this.viewMode,this.showMode(-1),this.fill(),v==this.viewMode&&this.autoclose&&this.hide()):(this.fill(),this.autoclose&&this.hide())}break;case"td":if(u.is(".day")&&!u.is(".disabled")){var s=parseInt(u.text(),10)||1,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),h=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),l=this.viewDate.getUTCSeconds();u.is(".old")?f===0?(f=11,e-=1):f-=1:u.is(".new")&&(f==11?(f=0,e+=1):f+=1);this._setDate(r(e,f,s,h,c,l,0))}v=this.viewMode;this.showMode(-1);this.fill();v==this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(n,t){t&&t!="date"||(this.date=n);t&&t!="view"||(this.viewDate=n);this.fill();this.setValue();this.element.trigger({type:"changeDate",date:this.date});var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&(i.change(),this.autoclose&&(!t||t=="date"))},moveHour:function(n,t){if(!t)return n;var i=new Date(n.valueOf());return t=t>0?1:-1,i.setUTCHours(i.getUTCHours()+t),i},moveDate:function(n,t){if(!t)return n;var i=new Date(n.valueOf());return t=t>0?1:-1,i.setUTCDate(i.getUTCDate()+t),i},moveMonth:function(n,t){var f;if(!t)return n;var i=new Date(n.valueOf()),e=i.getUTCDate(),o=i.getUTCMonth(),s=Math.abs(t),r,u;if(t=t>0?1:-1,s==1)u=t==-1?function(){return i.getUTCMonth()==o}:function(){return i.getUTCMonth()!=r},r=o+t,i.setUTCMonth(r),(r<0||r>11)&&(r=(r+12)%12);else{for(f=0;f<s;f++)i=this.moveMonth(i,t);r=i.getUTCMonth();i.setUTCDate(e);u=function(){return r!=i.getUTCMonth()}}while(u())i.setUTCDate(--e),i.setUTCMonth(r);return i},moveYear:function(n,t){return this.moveMonth(n,t*12)},dateWithinRange:function(n){return n>=this.startDate&&n<=this.endDate},keydown:function(n){var u,t,i,r,f;if(this.picker.is(":not(:visible)")){n.keyCode==27&&this.show();return}u=!1;switch(n.keyCode){case 27:this.hide();n.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;t=n.keyCode==37?-1:1;n.ctrlKey?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t)):n.shiftKey?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t)):(i=new Date(this.date.valueOf()),i.setUTCDate(this.date.getUTCDate()+t),r=new Date(this.viewDate.valueOf()),r.setUTCDate(this.viewDate.getUTCDate()+t));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;t=n.keyCode==38?-1:1;n.ctrlKey?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t)):n.shiftKey?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t)):(i=new Date(this.date.valueOf()),i.setUTCDate(this.date.getUTCDate()+t*7),r=new Date(this.viewDate.valueOf()),r.setUTCDate(this.viewDate.getUTCDate()+t*7));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 13:this.hide();n.preventDefault();break;case 9:this.hide()}u&&(this.element.trigger({type:"changeDate",date:this.date}),this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change())},showMode:function(n){if(n){var i=Math.max(0,Math.min(t.modes.length-1,this.viewMode+n));i>=this.minView&&i<=this.maxView&&(this.viewMode=i)}this.picker.find(">div").hide().filter(".datepicker-"+t.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()},reset:function(){this._setDate(null,"date")}};n.fn.fdatepicker=function(t){var i=Array.apply(null,arguments);return i.shift(),this.each(function(){var f=n(this),r=f.data("datepicker"),e=typeof t=="object"&&t;r||f.data("datepicker",r=new u(this,n.extend({},n.fn.fdatepicker.defaults,e)));typeof t=="string"&&typeof r[t]=="function"&&r[t].apply(r,i)})};n.fn.fdatepicker.defaults={onRender:function(){return""}};n.fn.fdatepicker.Constructor=u;i=n.fn.fdatepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",titleFormat:"MM yyyy"}};t={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,i){return[31,t.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][i]},validParts:/hh?|ii?|ss?|dd?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(n){var t=n.replace(this.validParts,'\0').split('\0'),i=n.match(this.validParts);if(!t||!t.length||!i||i.length===0)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(t,u,f){var p,o,h,c,b,e,a;if(t instanceof Date)return new Date(t.valueOf()-t.getTimezoneOffset()*6e4);if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(t)&&(u=this.parseFormat("yyyy-mm-dd")),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(t)&&(u=this.parseFormat("yyyy-mm-dd hh:ii")),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(t)&&(u=this.parseFormat("yyyy-mm-dd hh:ii:ss")),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(t)){for(p=/([-+]\d+)([dmwy])/,o=t.match(/([-+]\d+)([dmwy])/g),t=new Date,e=0;e<o.length;e++){h=p.exec(o[e]);c=parseInt(h[1]);switch(h[2]){case"d":t.setUTCDate(t.getUTCDate()+c);break;case"m":t=Datetimepicker.prototype.moveMonth.call(Datetimepicker.prototype,t,c);break;case"w":t.setUTCDate(t.getUTCDate()+c*7);break;case"y":t=Datetimepicker.prototype.moveYear.call(Datetimepicker.prototype,t,c)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,v={},w=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","d","dd"],s={hh:function(n,t){return n.setUTCHours(t)},h:function(n,t){return n.setUTCHours(t)},ii:function(n,t){return n.setUTCMinutes(t)},i:function(n,t){return n.setUTCMinutes(t)},ss:function(n,t){return n.setUTCSeconds(t)},s:function(n,t){return n.setUTCSeconds(t)},yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!=t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}},l,y,h;if(s.M=s.MM=s.mm=s.m,s.dd=s.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),o.length==u.parts.length){for(e=0,b=u.parts.length;e<b;e++){if(l=parseInt(o[e],10),h=u.parts[e],isNaN(l))switch(h){case"MM":y=n(i[f].months).filter(function(){var n=this.slice(0,o[e].length),t=o[e].slice(0,n.length);return n==t});l=n.inArray(y[0],i[f].months)+1;break;case"M":y=n(i[f].monthsShort).filter(function(){var n=this.slice(0,o[e].length),t=o[e].slice(0,n.length);return n==t});l=n.inArray(y[0],i[f].monthsShort)+1}v[h]=l}for(e=0;e<w.length;e++)a=w[e],a in v&&!isNaN(v[a])&&s[a](t,v[a])}return t},formatDate:function(t,r,u){var f,t,o,e,s;if(t==null)return"";for(f={h:t.getUTCHours(),i:t.getUTCMinutes(),s:t.getUTCSeconds(),d:t.getUTCDate(),m:t.getUTCMonth()+1,M:i[u].monthsShort[t.getUTCMonth()],MM:i[u].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()},f.hh=(f.h<10?"0":"")+f.h,f.ii=(f.i<10?"0":"")+f.i,f.ss=(f.s<10?"0":"")+f.s,f.dd=(f.d<10?"0":"")+f.d,f.mm=(f.m<10?"0":"")+f.m,t=[],o=n.extend([],r.separators),e=0,s=r.parts.length;e<s;e++)o.length&&t.push(o.shift()),t.push(f[r.parts[e]]);return t.join("")},convertViewMode:function(n){switch(n){case 4:case"decade":n=4;break;case 3:case"year":n=3;break;case 2:case"month":n=2;break;case 1:case"day":n=1;break;case 0:case"hour":n=0}return n},headTemplate:'<thead><tr><th class="prev"><i class="fa fa-chevron-left fi-arrow-left"/><\/th><th colspan="5" class="date-switch"><\/th><th class="next"><i class="fa fa-chevron-right fi-arrow-right"/><\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><\/tfoot>'};t.template='<div class="datepicker"><div class="datepicker-minutes"><table class=" table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datepicker-hours"><table class=" table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datepicker-days"><table class=" table-condensed">'+t.headTemplate+"<tbody><\/tbody>"+t.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><a class="button datepicker-close tiny alert right" style="width:auto;"><i class="fa fa-remove fa-times fi-x"><\/i><\/a><\/div>';n.fn.fdatepicker.DPGlobal=t}(window.jQuery),function(n){n.jscroll={defaults:{debug:!1,autoTrigger:!0,autoTriggerUntil:!1,loadingHtml:"<small>Loading...<\/small>",padding:0,nextSelector:"a:last",contentSelector:"",pagingSelector:"",callback:!1}};var t=function(t,i){function d(){var t=n(r.loadingHtml).filter("img").attr("src"),i;t&&(i=new Image,i.src=t)}function c(){t.find(".jscroll-inner").length||t.contents().wrapAll('<div class="jscroll-inner" />')}function l(n){var t;r.pagingSelector?t=n.closest(r.pagingSelector).hide():(t=n.parent().not(".jscroll-inner,.jscroll-added").addClass("jscroll-next-parent").hide(),t.length||n.wrap('<div class="jscroll-next-parent" />').parent().hide())}function f(){return u.unbind(".jscroll").removeData("jscroll").find(".jscroll-inner").children().unwrap().filter(".jscroll-added").children().unwrap()}function a(){c();var n=t.find("div.jscroll-inner").first(),o=t.data("jscroll"),i=parseInt(t.css("borderTopWidth")),h=isNaN(i)?0:i,l=parseInt(t.css("paddingTop"))+h,a=s?u.scrollTop():t.offset().top,v=n.length?n.offset().top:0,f=Math.ceil(a-v+u.height()+l);if(!o.waiting&&f+r.padding>=n.outerHeight())return e("info","jScroll:",n.outerHeight()-f,"from bottom. Loading next request..."),y()}function g(n){return n=n||t.data("jscroll"),n&&n.nextHref?(v(),!0):(e("warn","jScroll: nextSelector not found - destroying"),f(),!1)}function v(){var n=t.find(r.nextSelector).first();r.autoTrigger&&(r.autoTriggerUntil===!1||r.autoTriggerUntil>0)?(l(n),b.height()<=h.height()&&a(),u.unbind(".jscroll").bind("scroll.jscroll",function(){return a()}),r.autoTriggerUntil>0&&r.autoTriggerUntil--):(u.unbind(".jscroll"),n.bind("click.jscroll",function(){return l(n),y(),!1}))}function y(){var u=t.find("div.jscroll-inner").first(),i=t.data("jscroll");return i.waiting=!0,u.append('<div class="jscroll-added" />').children(".jscroll-added").last().html('<div class="jscroll-loading">'+r.loadingHtml+"<\/div>"),t.animate({scrollTop:u.outerHeight()},0,function(){u.find("div.jscroll-added").last().load(i.nextHref,function(u,o){if(o==="error")return f();var s=n(this).find(r.nextSelector).first();i.waiting=!1;i.nextHref=s.attr("href")?n.trim(s.attr("href")+" "+r.contentSelector):!1;n(".jscroll-next-parent",t).remove();g();r.callback&&r.callback.call(this);e("dir",i)})})}function e(n){var i,t;if(r.debug&&typeof console=="object"&&(typeof n=="object"||typeof console[n]=="function"))if(typeof n=="object"){i=[];for(t in n)typeof console[t]=="function"?(i=n[t].length?n[t]:[n[t]],console[t].apply(console,i)):console.log.apply(console,i)}else console[n].apply(console,Array.prototype.slice.call(arguments,1))}var o=t.data("jscroll"),p=typeof i=="function"?{callback:i}:i,r=n.extend({},n.jscroll.defaults,p,o||{}),s=t.css("overflow-y")==="visible",w=t.find(r.nextSelector).first(),h=n(window),b=n("body"),u=s?h:t,k=n.trim(w.attr("href")+" "+r.contentSelector);return t.data("jscroll",n.extend({},o,{initialized:!0,waiting:!1,nextHref:k})),c(),d(),v(),n.extend(t.jscroll,{destroy:f}),t};n.fn.jscroll=function(i){return this.each(function(){var r=n(this),u=r.data("jscroll"),f;u&&u.initialized||(f=new t(r,i))})}}(jQuery);utility=utility||{};utility.ellipsis=function(n,t){var i=n.trim(),r;return!i||i.length<t?n:(r=i.substring(0,t).lastIndexOf(" "),r>0)?i.substring(0,r)+"...":i.substring(0,t)};utility.showDialog=function(n,t,i,r,u,f,e){$("#modal").foundation("reveal","close");var o="#modal > #modalOK",s="#modal > #modalCancel";if($("#modal > #modalTitle").text(n),$("#modal > #modalMessage").text(t),i?$(o).show():$(o).hide(),r?$(s).show():$(s).hide(),$(o).unbind("click"),u)$(o).one("click",u);f?$(o).text(f):$(o).text("OK");e?$(s).text(e):$(s).text("Cancel");$("#modal").foundation("reveal","open")};utility.createWarningBoxWithClose=function(n,t){return $('<div class="warningBox '+t+'"><p>'+n+'<span class="closeBox ui-icon"><\/span><\/p><\/div>')};utility.displayLicenceExpiryMessage=function(n){if($.cookie("licenceExpiry")!==undefined&&$.cookie("licenceExpiry")!=="NoExpiry"&&$.cookie("licenceExpiry")<31&&$.cookie("licenceExpirySeen")===undefined){var t=$("#globalMessageContainer"),r=$.cookie("licenceExpiry")<0?0:utility.htmlEncode($.cookie("licenceExpiry")),u="Please note that your subscription will be expiring in <span class='licenceExpiryDays'>"+r+"<\/span> days. To renew your subscription, please contact your account administrator.",i=utility.createWarningBoxWithClose(u,"licenceExpiryClass");i.hide();t.length?t.append(i):(t=$($(".row")[0]),t.prepend(i));i.slideDown("slow");$(".licenceExpiryClass .closeBox").click(function(){var t=new Date;t.setHours(0,0,0,0);t.setDate(t.getDate()+1);$.cookie("licenceExpirySeen","True",{domain:n,expires:t,path:"/"})})}};utility.animate=function(n){$(n).html("<img src='/news-assets/content/images/ajax-loader.gif' class='load-more-ajax' />")};utility.diAnimate=function(n){$(n).html("More")};utility.reload=function(){location.reload()};utility.browserIsIe=function(){var n=window.navigator.userAgent;return n.indexOf("MSIE ")>0||!!navigator.userAgent.match(/Trident.*rv\:11\./)};utility.htmlEncode=function(n){return $("<div/>").text(n).html()};$.fn.ignore=function(n){return this.clone().children(n).remove().end()};$.fn.serializeObject=function(){var n={},t=this.serializeArray();return $.each(t,function(){n[this.name]?(n[this.name].push||(n[this.name]=[n[this.name]]),n[this.name].push(this.value||"")):n[this.name]=this.value||""}),n};allIssues=allIssues||{};allIssues.issueTemplate='<div class="issue-item filterable notranslate" issue-id="${Id}" issue-date="${PublicationDateString}"><div><span class="details" date="${PublicationDateString}"><a href="/subscriber/icb/issue/?volume=${Volume}&number=${Number}">${ShortPublicationDateString} <\/a> Volume ${Volume}, Issue ${Number}<\/span><a href = "/subscriber/icb/issue/?volume=${Volume}&number=${Number}"><div class="issue-image column small-6" style="background-image: url(/subscriber/icb/assets/${AssetId}); filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/subscriber/icb/assets/${AssetId}\', sizingMethod=\'scale\')">&nbsp;<\/div><\/a><\/div><span class="issue-button-container"><a target="_blank" href="${DownloadLink}" class="button download-pdf">Download<\/a>';allIssues.listElement=$(".icb-issue-cover #issues-list");allIssues.itemCount=0;allIssues.isDesktop=$(window).width()>1025;allIssues.numIssuesInFirstRowForDesktop;allIssues.numIssues=$("#numIssues");allIssues.issuesCountInitiallyLoaded=$("#numIssues").val();allIssues.displayResults=function(n){$.template("issueTemplate",allIssues.issueTemplate);for(let t=0;t<n.issues.length;t++){const i=n.issues[t];i.DownloadLink=i.ExternalDownloadLink!==null?i.ExternalDownloadLink:"/subscriber/icb/assets/"+i.DocumentAsset;$.tmpl("issueTemplate",i).appendTo(allIssues.listElement);allIssues.itemCount++}allIssues.disableDownloadWhenNoDownloadAssetAvailable()};allIssues.disableDownloadWhenNoDownloadAssetAvailable=function(){$("a[href$='/0']").remove()};allIssues.changeDateFormat=function(n){var t=n.split("/");return new Date(t[1]+"-"+t[0])};allIssues.validateDateSearch=function(n){var t=allIssues.changeDateFormat(n.find(".from-date input").val()),i=allIssues.changeDateFormat(n.find(".to-date input").val());return t>i?(utility.showDialog("Alert","From Date cannot be before To Date.",!0),!1):!0};allIssues.clearSearchResults=function(){var n=$(".to-date"),t=$(".from-date");n.fdatepicker("update",new Date);t.fdatepicker("update",new Date);$(".from-date input").val("");$(".to-date input").val("");$(".clear-date").attr("disabled",!0);allIssues.numIssues.val()!==allIssues.issuesCountInitiallyLoaded&&allIssues.loadIssues("01/2007","")};allIssues.onChangeDate=function(n){allIssues.validateDateSearch(n)&&allIssues.loadIssues(n.find(".from-date input").val(),n.find(".to-date input").val())};allIssues.loadIssues=function(n,t){$.post("/subscriber/icb/issues?json=true&from="+n+"&to="+t,function(n){allIssues.itemCount=0;$(".number-of-results").text(n.numberOfIssues);allIssues.numIssues.val(n.numberOfIssues);$(allIssues.listElement).find(".filterable").remove();n.currentIssue===null?($("#latest-issue").hide(),allIssues.numIssuesInFirstRowForDesktop=5,allIssues.listElement.addClass("current-issue-hidden")):($("#latest-issue").show(),allIssues.numIssuesInFirstRowForDesktop=3,allIssues.listElement.removeClass("current-issue-hidden"));allIssues.displayResults(n,!0,allIssues.numIssuesInFirstRowForDesktop)})};allIssues.getCurrentDate=function(){return(new Date).toJSON().slice(0,10)};allIssues.initialize=function(){allIssues.disableDownloadWhenNoDownloadAssetAvailable();$(".from-date").fdatepicker({startDate:new Date(2006,12,31),endDate:allIssues.getCurrentDate()});$(".to-date").fdatepicker({startDate:new Date(2006,12,31),endDate:allIssues.getCurrentDate()});$(".refine-date").on("click",function(){allIssues.onChangeDate($(this).closest(".calendar-container"))});$(".clear-date").on("click",function(){allIssues.clearSearchResults()});$(".from-date input").change(function(){$(".clear-date").attr("disabled",!1);$(".from-date input").val($(this).val())});$(".to-date input").change(function(){$(".clear-date").attr("disabled",!1);$(".to-date input").val($(this).val())});$(".prefix").click(function(){$(".datepicker").removeClass("notranslate");$(".datepicker").addClass("notranslate")});allIssues.contentLoadTriggered=!1;$(window).scroll(function(){if(allIssues.numIssuesInFirstRowForDesktop=3,$(window).scrollTop()>=$(".icb-wrapper").height()-$(window).height()&&allIssues.contentLoadTriggered===!1&&allIssues.numIssues.val()>allIssues.itemCount+allIssues.numIssuesInFirstRowForDesktop){allIssues.contentLoadTriggered=!0;var t=$(allIssues.listElement).find(".issue-item:last .details").attr("date"),n="/subscriber/icb/IssuesOlderThan?date="+t;$(".from-date input").val()!==""&&(n+="&from="+$(".from-date input").val());$.post(n,function(n){allIssues.displayResults(n,!1,allIssues.numIssuesInFirstRowForDesktop);allIssues.contentLoadTriggered=!1})}})}