!function(){for(var t,s=function(){},e=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],i=e.length,n=window.console=window.console||{};i--;)t=e[i],n[t]||(n[t]=s)}(),function(t,s,e,i){"use strict";function n(s,e){this.element=t(s),this.options=t.extend({},o,e),this._defaults=o,this._name=a,this.init()}var a="countDown",o={css_class:"countdown",always_show_days:!1,with_labels:!0,with_seconds:!0,with_separators:!0,with_hh_leading_zero:!0,with_mm_leading_zero:!0,with_ss_leading_zero:!0,label_dd:"days",label_hh:"hours",label_mm:"minutes",label_ss:"seconds",separator:":",separator_days:","};t.extend(n.prototype,{init:function(){this.element.children().length||(this.element.attr("datetime")&&(this.endDate=this.parseEndDate(this.element.attr("datetime"))),this.endDate===i&&(this.endDate=this.parseEndDate(this.element.text())),this.endDate!==i&&(this.element.is("time")?this.timeElement=this.element:(this.timeElement=t(""),this.element.html(this.timeElement)),this.markup(),this.setTimeoutDelay=this.sToMs(1),this.daysVisible=!0,this.timeElement.on("time.elapsed",this.options.onTimeElapsed),this.timeElement.on("time.tick",this.options.onTick),this.doCountDown()))},parseEndDate:function(t){var s;return s=this.parseDuration(t),s instanceof Date?s:(s=this.parseDateTime(t),s instanceof Date?s:(s=this.parseHumanReadableDuration(t),s instanceof Date?s:(s=Date.parse(t),isNaN(s)?void 0:new Date(s))))},parseDuration:function(t){var s=t.match(/^P(?:(\d+)D)?T?(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)(?:\.(\d{1,3}))?S)?$/);if(s){var e,i,n,a,o,h;return i=s[1]?this.dToMs(s[1]):0,n=s[2]?this.hToMs(s[2]):0,a=s[3]?this.mToMs(s[3]):0,o=s[4]?this.sToMs(s[4]):0,h=s[5]?parseInt(s[5],10):0,e=new Date,e.setTime(e.getTime()+i+n+a+o+h),e}},parseDateTime:function(t){var s=t.match(/^(\d{4,})-(\d{2})-(\d{2})[T\s](\d{2}):(\d{2})(?:\:(\d{2}))?(?:\.(\d{1,3}))?([Z\+\-\:\d]+)?$/);if(s){var e=s[8]?s[8].match(/^([\+\-])?(\d{2}):?(\d{2})$/):i,n=0;e&&(n=this.hToMs(e[2])+this.mToMs(e[3]),n="-"===e[1]?n:-n);var a,o,h,m,r,d,l,p;return o=s[1],h=s[2]-1,m=s[3],r=s[4]||0,d=s[5]||0,l=s[6]||0,p=s[7]||0,a=new Date(Date.UTC(o,h,m,r,d,l,p)),a.setTime(a.getTime()+n),a}},parseHumanReadableDuration:function(t){var s=t.match(/^(?:(\d+).+\s)?(\d+)[h:]\s?(\d+)[m:]?\s?(\d+)?[s]?(?:\.(\d{1,3}))?$/);if(s){var e,i,n,a,o,h;return e=new Date,i=s[1]?this.dToMs(s[1]):0,n=s[2]?this.hToMs(s[2]):0,a=s[3]?this.mToMs(s[3]):0,o=s[4]?this.sToMs(s[4]):0,h=s[5]?parseInt(s[5],10):0,e.setTime(e.getTime()+i+n+a+o+h),e}},sToMs:function(t){return 1e3*parseInt(t,10)},mToMs:function(t){return 60*parseInt(t,10)*1e3},hToMs:function(t){return 60*parseInt(t,10)*60*1e3},dToMs:function(t){return 24*parseInt(t,10)*60*60*1e3},msToS:function(t){return parseInt(t/1e3%60,10)},msToM:function(t){return parseInt(t/1e3/60%60,10)},msToH:function(t){return parseInt(t/1e3/60/60%24,10)},msToD:function(t){return parseInt(t/1e3/60/60/24,10)},markup:function(){var t=['','','',this.options.label_dd,"","",'',this.options.separator_days,"",'','','','',this.options.label_hh,"","",'',this.options.separator,"",'','','','',this.options.label_mm,"","",'',this.options.separator,"",'','','','',this.options.label_ss,"",""];this.timeElement.html(t.join("")),this.options.with_labels||this.timeElement.find(".label").remove(),this.options.with_separators||this.timeElement.find(".separator").remove(),this.options.with_seconds||(this.timeElement.find(".item-ss").remove(),this.timeElement.find(".separator").last().remove()),this.item_dd=this.timeElement.find(".item-dd"),this.separator_dd=this.timeElement.find(".separator-dd"),this.remaining_dd=this.timeElement.find(".dd"),this.remaining_hh1=this.timeElement.find(".hh-1"),this.remaining_hh2=this.timeElement.find(".hh-2"),this.remaining_mm1=this.timeElement.find(".mm-1"),this.remaining_mm2=this.timeElement.find(".mm-2"),this.remaining_ss1=this.timeElement.find(".ss-1"),this.remaining_ss2=this.timeElement.find(".ss-2"),this.timeElement.addClass(this.options.css_class)},doCountDown:function(){var t=this.endDate.getTime()-(new Date).getTime(),e=this.msToS(t),i=this.msToM(t),n=this.msToH(t),a=this.msToD(t);if(t<=0&&(e=i=n=a=0),this.displayRemainingTime({ss:e<10?(this.options.with_ss_leading_zero?"0":" ")+e.toString():e.toString(),mm:i<10?(this.options.with_mm_leading_zero?"0":" ")+i.toString():i.toString(),hh:n<10?(this.options.with_hh_leading_zero?"0":" ")+n.toString():n.toString(),dd:a.toString()}),this.options.with_seconds||0!==a||0!==i||0!==n||(e=0),0===a&&0===i&&0===n&&0===e)return this.timeElement.trigger("time.elapsed");var o=this;return s.setTimeout(function(){o.doCountDown()},o.setTimeoutDelay),this.timeElement.trigger("time.tick",t)},displayRemainingTime:function(t){var s=[];s.push("P"),"0"!==t.dd&&s.push(t.dd,"D"),s.push("T",t.hh,"H",t.mm,"M"),this.options.with_seconds&&s.push(t.ss,"S"),this.timeElement.attr("datetime",s.join("")),this.daysVisible&&!this.options.always_show_days&&"0"===t.dd&&(this.item_dd.remove(),this.separator_dd.remove(),this.daysVisible=!1),this.remaining_dd.text(t.dd),this.remaining_hh1.text(t.hh[0].trim()),this.remaining_hh2.text(t.hh[1]),this.remaining_mm1.text(t.mm[0].trim()),this.remaining_mm2.text(t.mm[1]),this.remaining_ss1.text(t.ss[0].trim()),this.remaining_ss2.text(t.ss[1])}}),t.fn[a]=function(s){var e=arguments;if(s===i||"object"==typeof s)return this.each(function(){t.data(this,"plugin_"+a)||t.data(this,"plugin_"+a,new n(this,s))});if("string"==typeof s&&"_"!==s[0]&&"init"!==s){var o;return this.each(function(){var i=t.data(this,"plugin_"+a);i instanceof n&&"function"==typeof i[s]&&(o=i[s].apply(i,Array.prototype.slice.call(e,1))),"destroy"===s&&t.data(this,"plugin_"+a,null)}),o!==i?o:this}}}(window.jQuery,window,document);