text: !function($){function UTCDate(){return new Date(Date.UTC.apply(Date,arguments))}function UTCToday(){var today=new Date;return UTCDate(today.getFullYear(),today.getMonth(),today.getDate())}var Datepicker=function(element,options){if(this.element=$(element),this._process_options(options),!this.o.pickDate&&!this.o.pickTime)return!1;var timeIcon,pickDate,pickTime,is12Hours,showSeconds,collapse,keyboardNavigation;this.picker=$((timeIcon=this.o.timeIcon,pickDate=this.o.pickDate,pickTime=this.o.pickTime,is12Hours=this.o.pick12HourFormat,showSeconds=this.o.pickSeconds,collapse=this.o.collapse,keyboardNavigation=this.o.keyboardNavigation,pickDate&&pickTime?'<div class="bootstrap-datetimepicker-widget dropdown-menu"><ul><li class="'+(collapse?"collapse in":"")+(keyboardNavigation?" active":"")+'"><div class="datepicker">'+DPGlobal.template+'</div></li><li class="picker-switch accordion-toggle"><a><i class="'+timeIcon+'"></i></a></li><li'+(collapse?' class="collapse"':"")+'><div class="timepicker">'+TPGlobal.getTemplate(is12Hours,showSeconds)+"</div></li></ul></div>":pickTime?'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker '+(keyboardNavigation?" active":"")+'">'+TPGlobal.getTemplate(is12Hours,showSeconds)+"</div></div>":'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker '+(keyboardNavigation?" active":"")+'">'+DPGlobal.template+"</div></div>")).appendTo("body"),this.o.pickTime&&this.o.keyboardNavigation&&this.picker.find(".timepicker-picker [data-time-component]:eq(0)").addClass("focused"),this._buildEvents(),this._attachEvents(),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today, tfoot th.clear").attr("colspan",function(i,val){return parseInt(val)+1}),this._allow_update=!1,this.setStartDate(this.o.startDate),this.setEndDate(this.o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this.fillHours(),this.fillMinutes(),this.fillSeconds(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};Datepicker.prototype={constructor:Datepicker,_process_options:function(opts){this._o=$.extend({},this._o,opts);var icon,o=this.o=$.extend({},this._o);this.isInline=!1,this.isInput=this.element.is("input"),this.component=!1,(this.element.find(".input-append")||this.element.find(".input-prepend"))&&(this.component=this.element.find(".add-on")),this.hasInput=this.component&&this.element.find("input").length,this.o.format||(this.isInput?this.o.format=this.element.data("format"):this.o.format=this.element.find("input").data("format"),this.o.format||(this.o.format="MM/dd/yyyy")),this._compileFormat(),this.component&&0===this.component.length&&(this.component=!1),this.component&&(icon=this.component.find("i")),this.o.pickTime&&(icon&&icon.length&&(this.o.timeIcon=icon.data("time-icon")),this.timeIcon||(this.o.timeIcon="icon-time"),icon&&icon.addClass(this.o.timeIcon)),this.o.pickDate&&(icon&&icon.length&&(this.o.dateIcon=icon.data("date-icon")),this.dateIcon||(this.o.dateIcon="icon-calendar"),icon&&icon.removeClass(this.o.timeIcon),icon&&icon.addClass(this.o.dateIcon));var lang=o.language;switch(dates[lang]||(lang=lang.split("-")[0],dates[lang]||(lang=$.fn.datepicker.defaults.language)),o.language=lang,o.startView){case 2:case"decade":o.startView=2;break;case 1:case"year":o.startView=1;break;default:o.startView=0}switch(o.minViewMode){case 1:case"months":o.minViewMode=1;break;case 2:case"years":o.minViewMode=2;break;default:o.minViewMode=0}o.startView=Math.max(o.startView,o.minViewMode),o.weekStart%=7,o.weekEnd=(o.weekStart+6)%7,o.startDate!==-1/0&&(o.startDate=this.parseDate(o.startDate)),o.endDate!==1/0&&(o.endDate=this.parseDate(o.endDate)),o.daysOfWeekDisabled=o.daysOfWeekDisabled||[],$.isArray(o.daysOfWeekDisabled)||(o.daysOfWeekDisabled=o.daysOfWeekDisabled.split(/[,\s]*/)),o.daysOfWeekDisabled=$.map(o.daysOfWeekDisabled,function(d){return parseInt(d,10)})},_events:[],_secondaryEvents:[],_applyEvents:function(evs){for(var el,ev,i=0;i<evs.length;i++)el=evs[i][0],ev=evs[i][1],el.on(ev)},_unapplyEvents:function(evs){for(var el,ev,i=0;i<evs.length;i++)el=evs[i][0],ev=evs[i][1],el.off(ev)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:$.proxy(function(){this.update(),this.show()},this),click:$.proxy(function(){this.update(),this.show()},this),keyup:$.proxy(this.update,this),keydown:$.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:$.proxy(function(){this.update(),this.show(),this.element.toggleClass("active")},this),click:$.proxy(function(){this.update(),this.show(),this.element.is(".active")||this.element.addClass("active")},this),keyup:$.proxy(this.update,this),keydown:$.proxy(this.keydown,this),blur:$.proxy(function(){this.element.toggleClass("active")},this)}],[this.component,{click:$.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:$.proxy(this.show,this)}]],this._secondaryEvents=[[this.picker,{click:$.proxy(this.click,this)}],[$(window),{resize:$.proxy(this.place,this)}],[$(document),{mousedown:$.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).size()||this.picker.is(e.target)||this.picker.find(e.target).size()||(this.hide(),this._trigger("dateblur"))},this)}],[this.picker.find(".accordion-toggle"),{"click.togglePicker":$.proxy(this.togglePicker,this)}],[this.picker.find("[data-action]"),{click:$.proxy(this.doAction,this)}]],this._passiveEvents=[[this.isInput?this.element:this.element.find("input"),{blur:$.proxy(function(e){""!==(this.isInput?this.element:this.element.find("input")).val()&&this.setValue(),this.picker.is(":visible")||this._trigger("dateblur")},this)}]]},togglePicker:function(e){if(e.stopPropagation(),this.o.collapse){var expanded=this.picker.find(".collapse.in"),closed=this.picker.find(".collapse:not(.in)");if(expanded&&expanded.length){var collapseData=expanded.data("collapse");if(collapseData&&collapseData.transitioning)return;expanded.collapse("hide"),closed.collapse("show"),this.element.find("> .add-on > i").toggleClass(this.o.timeIcon+" "+this.o.dateIcon)}}this.o.keyboardNavigation&&this.picker.find("> ul > li:not(.picker-switch)").toggleClass("active")},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_attachPassiveEvents:function(){this._detachPassiveEvents(),this._applyEvents(this._passiveEvents)},_detachPassiveEvents:function(){this._unapplyEvents(this._passiveEvents)},_trigger:function(event,altdate){var date=altdate||this.date,local_date=new Date;date&&(local_date=new Date(date.getTime()+6e4*date.getTimezoneOffset())),this.element.trigger({type:event,date:local_date,DatePicker:this,format:$.proxy(function(altformat){var format=altformat||this.o.format;return this.formatDate(date,this.o.language,format)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.updateNavArrows(),this.picker.show(),this.o.pickTime&&this.actions.showPicker.call(this),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),e&&e.preventDefault(),this._trigger("show")},hide:function(e){if(!this.isInline&&this.picker.is(":visible")){var that=this;setTimeout(function(){that.picker.hide().detach()},100),this._detachSecondaryEvents(),this._attachPassiveEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")}},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this._detachPassiveEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},getDate:function(){var d=this.getUTCDate();return new Date(d.getTime()+6e4*d.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(d){this.setUTCDate(new Date(d.getTime()-6e4*d.getTimezoneOffset()))},setUTCDate:function(d){this.date=d,this.setValue()},setValue:function(){var formatted=this.getFormattedDate();this.isInput?this.element.val(formatted):this.component&&this.element.find("input").val(formatted)},getFormattedDate:function(format){return void 0===format&&(format=this.o.format),this.formatDate(this.date,this.o.language,format)},setStartDate:function(startDate){this._process_options({startDate:startDate}),this.update(),this.updateNavArrows()},setEndDate:function(endDate){this._process_options({endDate:endDate}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(daysOfWeekDisabled){this._process_options({daysOfWeekDisabled:daysOfWeekDisabled}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var zIndex=parseInt(this.element.parents().filter(function(){return"auto"!=$(this).css("z-index")}).first().css("z-index"))+10,offset=this.component?this.component.parent().offset():this.element.offset(),height=this.component?this.component.outerHeight(!0):this.element.outerHeight(!0);this.picker.css({top:offset.top+height,left:offset.left,zIndex:zIndex})}},_allow_update:!0,update:function(){if(this._allow_update){var date,fromArgs=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(date=arguments[0],fromArgs=!0):(date=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date),this.date=this.parseDate(date)||this.date,this.date||(this.date=UTCToday()),fromArgs&&this.setValue(),this.date<this.o.startDate?(this.viewDate=new Date(this.o.startDate),this.date=new Date(this.o.startDate)):this.date>this.o.endDate?(this.viewDate=new Date(this.o.endDate),this.date=new Date(this.o.endDate)):this.viewDate=new Date(this.date),this.fillDate(),this.fillTime()}},fillDow:function(){var dowCnt=this.o.weekStart,html="<tr>";if(this.o.calendarWeeks){var cell='<th class="cw">&nbsp;</th>';html+=cell,this.picker.find(".datepicker-days thead tr:first-child").prepend(cell)}for(;dowCnt<this.o.weekStart+7;)html+='<th class="dow">'+dates[this.o.language].daysMin[dowCnt++%7]+"</th>";html+="</tr>",this.picker.find(".datepicker-days thead").append(html)},fillMonths:function(){for(var html="",i=0;i<12;)html+='<span class="month">'+dates[this.o.language].monthsShort[i++]+"</span>";this.picker.find(".datepicker-months td").html(html)},setRange:function(range){range&&range.length?this.range=$.map(range,function(d){return d.valueOf()}):delete this.range,this.fillDate(),this.fillTime()},getClassNames:function(date){var cls=[],year=this.viewDate.getUTCFullYear(),month=this.viewDate.getUTCMonth(),currentDate=this.date,today=new Date;return date.getUTCFullYear()<year||date.getUTCFullYear()==year&&date.getUTCMonth()<month?cls.push("old"):(date.getUTCFullYear()>year||date.getUTCFullYear()==year&&date.getUTCMonth()>month)&&cls.push("new"),this.o.todayHighlight&&date.getUTCFullYear()==today.getFullYear()&&date.getUTCMonth()==today.getMonth()&&date.getUTCDate()==today.getDate()&&cls.push("today"),currentDate&&date.getUTCFullYear()==currentDate.getUTCFullYear()&&date.getUTCMonth()==currentDate.getUTCMonth()&&date.getUTCDate()==currentDate.getUTCDate()&&cls.push("active"),(date.valueOf()<this.o.startDate||date.valueOf()>this.o.endDate||-1!==$.inArray(date.getUTCDay(),this.o.daysOfWeekDisabled))&&cls.push("disabled"),this.range&&(date>this.range[0]&&date<this.range[this.range.length-1]&&cls.push("range"),-1!=$.inArray(date.valueOf(),this.range)&&cls.push("selected")),cls},fillDate:function(){var tooltip,year=this.viewDate.getUTCFullYear(),month=this.viewDate.getUTCMonth(),startYear="object"==typeof this.o.startDate?this.o.startDate.getUTCFullYear():-1/0,startMonth="object"==typeof this.o.startDate?this.o.startDate.getUTCMonth():-1,endYear="object"==typeof this.o.endDate?this.o.endDate.getUTCFullYear():1/0,endMonth="object"==typeof this.o.endDate?this.o.endDate.getUTCMonth():12;this.picker.find(".datepicker-days").find(".disabled").removeClass("disabled"),this.picker.find(".datepicker-months").find(".disabled").removeClass("disabled"),this.picker.find(".datepicker-years").find(".disabled").removeClass("disabled"),this.picker.find(".datepicker-days th.datepicker-switch").text(dates[this.o.language].months[month]+" "+year),this.picker.find("tfoot th.today").text(dates[this.o.language].today).toggle(!1!==this.o.todayBtn),this.picker.find("tfoot th.clear").text(dates[this.o.language].clear).toggle(!1!==this.o.clearBtn);var prevMonth=UTCDate(year,month-1,28,0,0,0,0),day=DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(),prevMonth.getUTCMonth());prevMonth.setUTCDate(day),prevMonth.setUTCDate(day-(prevMonth.getUTCDay()-this.o.weekStart+7)%7),(year==startYear&&month<=startMonth||year<startYear)&&this.picker.find(".datepicker-days th:eq(0)").addClass("disabled"),(year==endYear&&endMonth<=month||endYear<year)&&this.picker.find(".datepicker-days th:eq(2)").addClass("disabled");var nextMonth=new Date(prevMonth.valueOf());nextMonth.setUTCDate(nextMonth.getUTCDate()+42),nextMonth=nextMonth.valueOf();for(var clsName,html=[];prevMonth.valueOf()<nextMonth;){if(prevMonth.getUTCDay()===this.o.weekStart&&(html.push("<tr>"),this.o.calendarWeeks)){var ws=new Date(+prevMonth+(this.o.weekStart-prevMonth.getUTCDay()-7)%7*864e5),th=new Date(+ws+(11-ws.getUTCDay())%7*864e5),yth=new Date(+(yth=UTCDate(th.getUTCFullYear(),0,1))+(11-yth.getUTCDay())%7*864e5),calWeek=(th-yth)/864e5/7+1;html.push('<td class="cw">'+calWeek+"</td>")}(clsName=this.getClassNames(prevMonth)).push("day");var before=this.o.beforeShowDay(prevMonth);void 0===before?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1===before.enabled&&clsName.push("disabled"),before.classes&&(clsName=clsName.concat(before.classes.split(/\s+/))),before.tooltip&&(tooltip=before.tooltip),clsName=$.unique(clsName),html.push('<td class="'+clsName.join(" ")+'"'+(tooltip?' title="'+tooltip+'"':"")+">"+prevMonth.getUTCDate()+"</td>"),prevMonth.getUTCDay()==this.o.weekEnd&&html.push("</tr>"),prevMonth.setUTCDate(prevMonth.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(html.join(""));var currentYear=this.date.getUTCFullYear(),months=this.picker.find(".datepicker-months").find("th:eq(1)").text(year).end().find("span").removeClass("active");currentYear===year&&months.eq(this.date.getUTCMonth()).addClass("active"),currentYear-1<startYear&&this.picker.find(".datepicker-months th:eq(0)").addClass("disabled"),endYear<currentYear+1&&this.picker.find(".datepicker-months th:eq(2)").addClass("disabled");for(var i=0;i<12;i++)year==startYear&&i<startMonth||year<startYear?$(months[i]).addClass("disabled"):(year==endYear&&endMonth<i||endYear<year)&&$(months[i]).addClass("disabled");html="",year=10*parseInt(year/10,10);var yearCont=this.picker.find(".datepicker-years").find("th:eq(1)").text(year+"-"+(year+9)).end().find("td");this.picker.find(".datepicker-years").find("th").removeClass("disabled"),year<startYear&&this.picker.find(".datepicker-years").find("th:eq(0)").addClass("disabled"),endYear<year+9&&this.picker.find(".datepicker-years").find("th:eq(2)").addClass("disabled"),year-=1;for(i=-1;i<11;i++)html+='<span class="year'+(-1===i||10===i?" old":"")+(currentYear===year?" active":"")+(year<startYear||endYear<year?" disabled":"")+'">'+year+"</span>",year+=1;yearCont.html(html)},fillHours:function(){var table=this.picker.find(".timepicker .timepicker-hours table");table.parent().hide();var html="";if(this.o.pick12HourFormat)for(var current=1,i=0;i<3;i+=1){html+="<tr>";for(var j=0;j<4;j+=1){html+='<td class="hour">'+padLeft(current.toString(),2,"0")+"</td>",current++}html+="</tr>"}else for(current=0,i=0;i<6;i+=1){html+="<tr>";for(j=0;j<4;j+=1){html+='<td class="hour">'+padLeft(current.toString(),2,"0")+"</td>",current++}html+="</tr>"}table.html(html)},fillMinutes:function(){var table=this.picker.find(".timepicker .timepicker-minutes table");table.parent().hide();for(var html="",current=0,i=0;i<3;i++){html+="<tr>";for(var j=0;j<4;j+=1){html+='<td class="minute">'+padLeft(current.toString(),2,"0")+"</td>",current+=5}html+="</tr>"}table.html(html)},fillSeconds:function(){var table=this.picker.find(".timepicker .timepicker-seconds table");table.parent().hide();for(var html="",current=0,i=0;i<3;i++){html+="<tr>";for(var j=0;j<4;j+=1){html+='<td class="second">'+padLeft(current.toString(),2,"0")+"</td>",current+=5}html+="</tr>"}table.html(html)},fillTime:function(){if(this.date){var timeComponents=this.picker.find(".timepicker span[data-time-component]"),is12HourFormat=this.o.pick12HourFormat,hour=this.date.getUTCHours(),period="AM";is12HourFormat&&(12<=hour&&(period="PM"),0===hour?hour=12:12!=hour&&(hour%=12),this.picker.find(".timepicker [data-action=togglePeriod]").text(period)),hour=padLeft(hour.toString(),2,"0");var minute=padLeft(this.date.getUTCMinutes().toString(),2,"0"),second=padLeft(this.date.getUTCSeconds().toString(),2,"0");timeComponents.filter("[data-time-component=hours]").text(hour),timeComponents.filter("[data-time-component=minutes]").text(minute),timeComponents.filter("[data-time-component=seconds]").text(second);var $table=this.picker.find(".timepicker-picker > table");null==$table.data("selectionIndex")&&$table.data("selectionIndex",0),$table.data("keydown",function(e){if(this.o.keyboardNavigation){var dir,newDate,newViewDate,dateChanged=!1;switch(e.keyCode){case 13:this.o.pickDate?this.togglePicker(e):this.hide(),e.preventDefault();break;case 27:case 9:this.hide(),9!=e.keyCode&&e.preventDefault();break;case 37:case 39:dir=37==e.keyCode?-1:1;var selectionIndex=$table.data("selectionIndex");selectionIndex=(selectionIndex+dir+timeComponents.length)%timeComponents.length,timeComponents.removeClass("focused"),$(timeComponents[selectionIndex]).addClass("focused"),$table.data("selectionIndex",selectionIndex),e.preventDefault();break;case 38:case 40:switch(dir=38==e.keyCode?1:-1,$table.data("selectionIndex")){case 0:newDate=this.moveHour(this.date,dir),newViewDate=this.moveHour(this.viewDate,dir);break;case 1:newDate=this.moveMinutes(this.date,dir),newViewDate=this.moveMinutes(this.viewDate,dir);break;case 2:newDate=this.moveSeconds(this.date,dir),newViewDate=this.moveSeconds(this.viewDate,dir)}e.preventDefault();break;case 77:newDate=this.switchMeridian(this.date),viewDate=this.switchMeridian(this.viewDate),e.preventDefault()}return this.dateWithinRange(newDate)&&(this.date=newDate,this.viewDate=newViewDate,this.setValue(),this.update(),e.preventDefault(),dateChanged=!0),dateChanged}})}},updateNavArrows:function(){if(this._allow_update){var d=new Date(this.viewDate),year=d.getUTCFullYear(),month=d.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&year<=this.o.startDate.getUTCFullYear()&&month<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&year>=this.o.endDate.getUTCFullYear()&&month>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&year<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&year>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(e){e.preventDefault();var target=$(e.target).closest("span, td, th");if(1==target.length)switch(target[0].nodeName.toLowerCase()){case"th":switch(target[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var dir=DPGlobal.modes[this.viewMode].navStep*("prev"==target[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,dir);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,dir)}this.fillDate(),this.fillTime(),this.updateNavArrows();break;case"today":this.showMode(-2);var which="linked"==this.o.todayBtn?null:"view";this._setDate(UTCToday(),which);break;case"clear":this.isInput?this.element.val(""):this.element.find("input").val(""),this.update(),this.o.autoclose&&this.hide()}break;case"span":if(!target.is(".disabled")){if(this.viewDate.setUTCDate(1),target.is(".month")){var day=1,month=target.parent().find("span").index(target),year=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(month),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(UTCDate(year,month,day,0,0,0,0))}else{year=parseInt(target.text(),10)||0,day=1,month=0;this.viewDate.setUTCFullYear(year),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(UTCDate(year,month,day,0,0,0,0))}this.showMode(-1),this.fillDate(),this.fillTime()}break;case"td":if(target.is(".day")&&!target.is(".disabled")){day=parseInt(target.text(),10)||1,year=this.viewDate.getUTCFullYear(),month=this.viewDate.getUTCMonth();target.is(".old")?0===month?(month=11,year-=1):month-=1:target.is(".new")&&(11==month?(month=0,year+=1):month+=1),this._setDate(UTCDate(year,month,day,0,0,0,0)),this.o.pickTime||(this.isInput?this.element.focus():this.component&&this.element.find("input").focus(),this.hide())}}},_setDate:function(date,which){var element;which&&"date"!=which||(this.date=new Date(date)),which&&"view"!=which||(this.viewDate=new Date(date)),this.fillDate(),this.fillTime(),this.setValue(),this._trigger("changeDate"),this.isInput?element=this.element:this.component&&(element=this.element.find("input")),element&&(element.change(),!this.o.autoclose||which&&"date"!=which||this.o.pickTime||this.hide())},switchMeridian:function(date){var newDate=new Date(date);return newDate.setUTCHours((date.getUTCHours()+12)%24),newDate},moveHour:function(date,dir){var newDate=new Date(date);return newDate.setUTCHours((date.getUTCHours()+48+dir)%24),newDate},moveMinutes:function(date,dir){var newDate=new Date(date);return newDate.setUTCMinutes((date.getUTCMinutes()+120+dir)%60),newDate},moveSeconds:function(date,dir){var newDate=new Date(date);return newDate.setUTCSeconds((date.getUTCSeconds()+120+dir)%60),newDate},moveMonth:function(date,dir){if(!dir)return date;var new_month,test,new_date=new Date(date.valueOf()),day=new_date.getUTCDate(),month=new_date.getUTCMonth(),mag=Math.abs(dir);if(dir=0<dir?1:-1,1==mag)test=-1==dir?function(){return new_date.getUTCMonth()==month}:function(){return new_date.getUTCMonth()!=new_month},new_month=month+dir,new_date.setUTCMonth(new_month),(new_month<0||11<new_month)&&(new_month=(new_month+12)%12);else{for(var i=0;i<mag;i++)new_date=this.moveMonth(new_date,dir);new_month=new_date.getUTCMonth(),new_date.setUTCDate(day),test=function(){return new_month!=new_date.getUTCMonth()}}for(;test();)new_date.setUTCDate(--day),new_date.setUTCMonth(new_month);return new_date},moveYear:function(date,dir){return this.moveMonth(date,12*dir)},actions:{incrementHours:function(e){this.date.setUTCHours(this.date.getUTCHours()+1)},incrementMinutes:function(e){this.date.setUTCMinutes(this.date.getUTCMinutes()+1)},incrementSeconds:function(e){this.date.setUTCSeconds(this.date.getUTCSeconds()+1)},decrementHours:function(e){this.date.setUTCHours(this.date.getUTCHours()-1)},decrementMinutes:function(e){this.date.setUTCMinutes(this.date.getUTCMinutes()-1)},decrementSeconds:function(e){this.date.setUTCSeconds(this.date.getUTCSeconds()-1)},togglePeriod:function(e){var hour=this.date.getUTCHours();12<=hour?hour-=12:hour+=12,this.date.setUTCHours(hour)},showPicker:function(){this.picker.find(".timepicker > div:not(.timepicker-picker)").hide(),this.picker.find(".timepicker .timepicker-picker").show()},showHours:function(){this.picker.find(".timepicker .timepicker-picker").hide(),this.picker.find(".timepicker .timepicker-hours").show()},showMinutes:function(){this.picker.find(".timepicker .timepicker-picker").hide(),this.picker.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){this.picker.find(".timepicker .timepicker-picker").hide(),this.picker.find(".timepicker .timepicker-seconds").show()},selectHour:function(e){var tgt=$(e.target),value=parseInt(tgt.text(),10);this.o.pick12HourFormat&&(12<=this.date.getUTCHours()?12!=value&&(value=(value+12)%24):12===value?value=0:value%=12);this.date.setUTCHours(value),this.actions.showPicker.call(this)},selectMinute:function(e){var tgt=$(e.target),value=parseInt(tgt.text(),10);this.date.setUTCMinutes(value),this.actions.showPicker.call(this)},selectSecond:function(e){var tgt=$(e.target),value=parseInt(tgt.text(),10);this.date.setUTCSeconds(value),this.actions.showPicker.call(this)}},doAction:function(e){e.stopPropagation(),e.preventDefault(),this.date||(this.date=UTCDate(1970,0,0,0,0,0,0));var action=$(e.currentTarget).data("action"),rv=this.actions[action].apply(this,arguments);return this.setValue(),this.fillTime(),this._trigger("changeDate"),rv},dateWithinRange:function(date){return date>=this.o.startDate&&date<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)"))27==e.keyCode&&this.show();else{var dir,newDate,newViewDate,element,dateChanged=!1,keydownDelegate=this.picker.find("> ul > li.active div:visible > table, > div.active > div:visible > table").data("keydown");if(keydownDelegate)dateChanged=keydownDelegate.call(this,e);else{switch(e.keyCode){case 27:this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;dir=37==e.keyCode?-1:1,e.ctrlKey?(newDate=this.moveYear(this.date,dir),newViewDate=this.moveYear(this.viewDate,dir)):e.shiftKey?(newDate=this.moveMonth(this.date,dir),newViewDate=this.moveMonth(this.viewDate,dir)):((newDate=new Date(this.date)).setUTCDate(this.date.getUTCDate()+dir),(newViewDate=new Date(this.viewDate)).setUTCDate(this.viewDate.getUTCDate()+dir)),this.dateWithinRange(newDate)&&(this.date=newDate,this.viewDate=newViewDate,this.setValue(),this.update(),e.preventDefault(),dateChanged=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;dir=38==e.keyCode?-1:1,e.ctrlKey?(newDate=this.moveYear(this.date,dir),newViewDate=this.moveYear(this.viewDate,dir)):e.shiftKey?(newDate=this.moveMonth(this.date,dir),newViewDate=this.moveMonth(this.viewDate,dir)):((newDate=new Date(this.date)).setUTCDate(this.date.getUTCDate()+7*dir),(newViewDate=new Date(this.viewDate)).setUTCDate(this.viewDate.getUTCDate()+7*dir)),this.dateWithinRange(newDate)&&(this.date=newDate,this.viewDate=newViewDate,this.setValue(),this.update(),e.preventDefault(),dateChanged=!0);break;case 13:this.o.pickTime?this.togglePicker(e):this.hide(),e.preventDefault();break;case 9:this.hide()}this.updateNavArrows()}if(dateChanged)this._trigger("changeDate"),this.isInput?element=this.element:this.component&&(element=this.element.find("input")),element&&element.change()}},showMode:function(dir){dir&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+dir))),this.picker.find(".datepicker > div").hide().filter(".datepicker-"+DPGlobal.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},formatDate:function(d,language){return this.o.format.replace(formatReplacer,function(match){var methodName,getValue,property,rv,len=match.length;return"ms"===match&&(len=1),property=dateFormatComponents[match].property,null!=(getValue=dateFormatComponents[match].getValue)?getValue(d,language):(rv=d[methodName="get"+property](),"getUTCMonth"===methodName&&(rv+=1),padLeft(rv.toString(),len,"0"))})},parseDate:function(str){if(str instanceof Date)return str;var match,property,value,parsed={};if(!(match=this._formatPattern.exec(str))){if(/^[\-+]\d+[dmMhswy]([\s,]+[\-+]\d+[dmMhswy])*$/.test(str)){for(var part,dir,part_re=/([\-+]\d+)([dmMhswy])/,parts=str.match(/([\-+]\d+)([dmMhswy])/g),date=new Date,i=0;i<parts.length;i++)switch(part=part_re.exec(parts[i]),dir=parseInt(part[1]),part[2]){case"d":date.setUTCDate(date.getUTCDate()+dir);break;case"M":date=Datepicker.prototype.moveMonth.call(Datepicker.prototype,date,dir);break;case"w":date.setUTCDate(date.getUTCDate()+7*dir);break;case"y":date=Datepicker.prototype.moveYear.call(Datepicker.prototype,date,dir);break;case"h":date=Datepicker.prototype.moveHour.call(Datepicker.prototype,date,dir);break;case"m":date=Datepicker.prototype.moveMinutes.call(Datepicker.prototype,date,dir);break;case"s":date=Datepicker.prototype.moveSeconds.call(Datepicker.prototype,date,dir)}return this.o.pickTime?UTCDate(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds()):UTCDate(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),0,0,0)}return null}for(i=1;i<match.length;i++)(property=this._propertiesByIndex[i])&&(value=match[i],dateFormatComponents[property].parseValue?value=dateFormatComponents[property].parseValue(value,this.o.language):/^\d+$/.test(value)&&(value=parseInt(value,10)),parsed[dateFormatComponents[property].property]=value);return this._finishParsingDate(parsed)},_finishParsingDate:function(parsed){var year,month,date,hours;return(year=parsed.UTCFullYear)||(year=1970),month=parsed.UTCMonth||0,date=parsed.UTCDate||1,hours=parsed.UTCHours||0,parsed.Period&&(hours%=12,"PM"==parsed.Period&&(hours+=12)),UTCDate(year,month,date,hours,parsed.UTCMinutes||0,parsed.UTCSeconds||0,parsed.UTCMilliseconds||0)},_compileFormat:function(){for(var match,component,components=[],mask=[],str=this.o.format,propertiesByIndex={},i=0,pos=0;match=formatComponent.exec(str);)(component=match[0])in dateFormatComponents?(propertiesByIndex[++i]=component,components.push("\\s*"+dateFormatComponents[component].getPattern(this)+"\\s*"),mask.push({pattern:new RegExp(dateFormatComponents[component].getPattern(this)),property:dateFormatComponents[component].property,start:pos,end:pos+=component.length})):(components.push(escapeRegExp(component)),mask.push({pattern:new RegExp(escapeRegExp(component)),character:component,start:pos,end:++pos})),str=str.slice(component.length);this._mask=mask,this._maskPos=0,this._formatPattern=new RegExp("^\\s*"+components.join("")+"\\s*$"),this._propertiesByIndex=propertiesByIndex}};var DateRangePicker=function(element,options){this.element=$(element),this.inputs=$.map(options.inputs,function(i){return i.jquery?i[0]:i}),delete options.inputs,$(this.inputs).datepicker(options).bind("changeDate",$.proxy(this.dateUpdated,this)),this.pickers=$.map(this.inputs,function(i){return $(i).data("datepicker")}),this.updateDates()};DateRangePicker.prototype={updateDates:function(){this.dates=$.map(this.pickers,function(i){return i.date}),this.updateRanges()},updateRanges:function(){var range=$.map(this.dates,function(d){return d.valueOf()});$.each(this.pickers,function(i,p){p.setRange(range)})},dateUpdated:function(e){var new_date=$(e.target).data("datepicker").getUTCDate(),i=$.inArray(e.target,this.inputs),l=this.inputs.length;if(-1!=i){if(new_date<this.dates[i])for(;0<=i&&new_date<this.dates[i];)this.pickers[i--].setUTCDate(new_date);else if(new_date>this.dates[i])for(;i<l&&new_date>this.dates[i];)this.pickers[i++].setUTCDate(new_date);this.updateDates()}},remove:function(){$.map(this.pickers,function(p){p.remove()}),delete this.element.data().datepicker}};var old=$.fn.datepicker;$.fn.datepicker=function(option){var internal_return,args=Array.apply(null,arguments);return args.shift(),this.each(function(){var $this=$(this),data=$this.data("datepicker"),options="object"==typeof option&&option;if(!data){var elopts=function(el,prefix){var data=$(el).data(),out={},replace=new RegExp("^"+prefix.toLowerCase()+"([A-Z])");for(var key in prefix=new RegExp("^"+prefix.toLowerCase()),data)prefix.test(key)&&(out[key.replace(replace,function(_,a){return a.toLowerCase()})]=data[key]);return out}(this,"date"),locopts=function(lang){var out={};if(dates[lang]||(lang=lang.split("-")[0],dates[lang])){var d=dates[lang];return $.each($.fn.datepicker.locale_opts,function(i,k){k in d&&(out[k]=d[k])}),out}}($.extend({},$.fn.datepicker.defaults,elopts,options).language),opts=$.extend({},$.fn.datepicker.defaults,locopts,elopts,options);if($this.is(".input-daterange")||opts.inputs){var ropts={inputs:opts.inputs||$this.find("input").toArray()};$this.data("datepicker",data=new DateRangePicker(this,$.extend(opts,ropts)))}else $this.data("datepicker",data=new Datepicker(this,opts))}if("string"==typeof option&&"function"==typeof data[option]&&void 0!==(internal_return=data[option].apply(data,args)))return!1}),void 0!==internal_return?internal_return:this},$.fn.datepicker.defaults={autoclose:!1,beforeShowDay:$.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,keyboardNavigation:!0,language:"en",minViewMode:0,rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,collapse:!0,pickDate:!0,pickTime:!0,pick12HourFormat:!1,pickSeconds:!0},$.fn.datepicker.locale_opts=["format","rtl","weekStart"],$.fn.datepicker.Constructor=Datepicker;var dates=$.fn.datepicker.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"],meridian:["AM","PM"],today:"Today",clear:"Clear"}},dateFormatComponents={d:{property:"UTCDate",getPattern:function(){return"([1-9]|[1-2][0-9]|3[0-1])\\b"}},dd:{property:"UTCDate",getPattern:function(){return"(0?[1-9]|[1-2][0-9]|3[0-1])\\b"}},ddd:{property:"UTCDayShort",getPattern:function(that){return"("+dates[that.o.language].daysShort.join("|")+")\\b"},getValue:function(d,language){return dates[language].daysShort[d.getUTCDay()]},parseValue:function(str,language){return dates[language].daysShort.indexOf(str)}},dddd:{property:"UTCDayLong",getPattern:function(that){return"("+dates[that.o.language].days.join("|")+")\\b"},getValue:function(d,language){return dates[language].days[d.getUTCDay()]},parseValue:function(str,language){return dates[language].days.indexOf(str)}},yy:{property:"UTCFullYear",getPattern:function(){return"(\\d{2})\\b"},getValue:function(d){return d.getUTCFullYear()%100},parseValue:function(val){return 2e3+parseInt(val,10)}},yyyy:{property:"UTCFullYear",getPattern:function(){return"(\\d{4})\\b"}},H:{property:"UTCHours",getPattern:function(){return"([0-9]|1[0-9]|2[0-3])\\b"}},HH:{property:"UTCHours",getPattern:function(){return"(0?[0-9]|1[0-9]|2[0-3])\\b"}},h:{property:"UTCHours",getPattern:function(){return"([0-9]|1[0-2])\\b"},getValue:function(d){var h=d.getUTCHours();return 0===h||12===h?12:h%12}},hh:{property:"UTCHours",getPattern:function(){return"(0?[1-9]|1[0-2])\\b"},getValue:function(d){var h=d.getUTCHours();return 0===h||12===h?"12":padLeft((h%12).toString(),2,"0")}},m:{property:"UTCMinutes",getPattern:function(){return"([0-9]|[1-5][0-9])\\b"}},mm:{property:"UTCMinutes",getPattern:function(){return"(0?[0-9]|[1-5][0-9])\\b"}},M:{property:"UTCMonth",getPattern:function(){return"([1-9]|1[0-2])\\b"},parseValue:function(val){return parseInt(val,10)-1}},MM:{property:"UTCMonth",getPattern:function(){return"(0?[1-9]|1[0-2])\\b"},parseValue:function(val){return parseInt(val,10)-1}},MMM:{property:"UTCMonth",getPattern:function(that){return"("+dates[that.o.language].monthsShort.join("|")+")\\b"},getValue:function(d,language){return dates[language].monthsShort[d.getUTCMonth()]},parseValue:function(str,language){return dates[language].monthsShort.indexOf(str)}},MMMM:{property:"UTCMonth",getPattern:function(that){return"("+dates[that.o.language].months.join("|")+")\\b"},getValue:function(d,language){return dates[language].months[d.getUTCMonth()]},parseValue:function(str,language){return dates[language].months.indexOf(str)}},ss:{property:"UTCSeconds",getPattern:function(){return"(0?[0-9]|[1-5][0-9])\\b"}},ms:{property:"UTCMilliseconds",getPattern:function(){return"([0-9]{1,3})\\b"}},t:{property:"Period",getPattern:function(that){var meridianLetters=[];for(i=0;i<dates[that.o.language].meridian.length;i++)meridianLetters.push(dates[that.o.language].meridian[i].charAt(0));return"("+meridianLetters.join("|")+")\\b"},getValue:function(d,language){var h=d.getUTCHours();return dates[language].meridian[12<=h?1:0].charAt(0)}},tt:{property:"Period",getPattern:function(that){return"("+dates[that.o.language].meridian.join("|")+")\\b"},getValue:function(d,language){var h=d.getUTCHours();return dates[language].meridian[12<=h?1:0]}}},keys=[];for(var k in dateFormatComponents)keys.push(k);keys[keys.length-1]+="\\b",keys.push(".");var formatComponent=new RegExp(keys.join("\\b|"));keys.pop();var formatReplacer=new RegExp(keys.join("\\b|"),"g");function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function padLeft(s,l,c){return l<s.length?s:Array(l-s.length+1).join(c||" ")+s}var DPGlobal={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(year){return year%4==0&&year%100!=0||year%400==0},getDaysInMonth:function(year,month){return[31,DPGlobal.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(format){var separators=format.replace(this.validParts,"\0").split("\0"),parts=format.match(this.validParts);if(!separators||!separators.length||!parts||0===parts.length)throw new Error("Invalid date format.");return{separators:separators,parts:parts}},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="datepicker-switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};DPGlobal.template='<div class="datepicker-days"><table class=" table-condensed">'+DPGlobal.headTemplate+"<tbody></tbody>"+DPGlobal.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+"</table></div>";var TPGlobal={hourTemplate:'<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>',getTemplate:function(is12Hours,showSeconds){return'<div class="timepicker-picker"><table class="table-condensed"'+(is12Hours?' data-hour-format="12"':"")+'><tr><td><a href="#" class="btn" data-action="incrementHours"><i class="icon-chevron-up"></i></a></td><td class="separator"></td><td><a href="#" class="btn" data-action="incrementMinutes"><i class="icon-chevron-up"></i></a></td>'+(showSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><i class="icon-chevron-up"></i></a></td>':"")+(is12Hours?'<td class="separator"></td>':"")+"</tr><tr><td>"+TPGlobal.hourTemplate+'</td> <td class="separator">:</td><td>'+TPGlobal.minuteTemplate+"</td> "+(showSeconds?'<td class="separator">:</td><td>'+TPGlobal.secondTemplate+"</td>":"")+(is12Hours?'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>':"")+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><i class="icon-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" class="btn" data-action="decrementMinutes"><i class="icon-chevron-down"></i></a></td>'+(showSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><i class="icon-chevron-down"></i></a></td>':"")+(is12Hours?'<td class="separator"></td>':"")+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(showSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':"")}};$.fn.datepicker.DPGlobal=DPGlobal,$.fn.datepicker.TPGlobal=TPGlobal,$.fn.datepicker.noConflict=function(){return $.fn.datepicker=old,this},$(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var $this=$(this);$this.data("datepicker")||(e.preventDefault(),$this.datepicker("show"))}),$(function(){$('[data-provide="datepicker-inline"]').datepicker()})}(jQuery),Array.prototype.indexOf||(Array.prototype.indexOf=function(searchElement,fromIndex){if(null==this)throw new TypeError('"this" is null or not defined');var length=this.length>>>0;for(fromIndex=+fromIndex||0,Math.abs(fromIndex)===1/0&&(fromIndex=0),fromIndex<0&&(fromIndex+=length)<0&&(fromIndex=0);fromIndex<length;fromIndex++)if(this[fromIndex]===searchElement)return fromIndex;return-1});