Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/mod/hvp/editor/libs/
Upload File :
Current File : C:/xampp/htdocs/moodle/mod/hvp/editor/libs/zebra_datepicker.min.js

(function (jQuery) {

!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(Ie){"use strict";Ie.Zebra_DatePicker=function(e,M){var C,F,P,S,Z,Y,x,I,z,u,j,N,H,O,T,L,R,W,B,E,Q,J,G,U,d,V,$,q,X,K,ee,te,se,i,ie,ne,ae,re,oe,de,c,ce,le,ge={always_visible:!(this.version="1.9.11"),container:Ie("body"),custom_classes:!1,days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],days_abbr:!1,default_position:"above",direction:0,disable_time_picker:!1,disabled_dates:!1,enabled_dates:!1,enabled_hours:!1,enabled_minutes:!1,enabled_seconds:!1,first_day_of_week:1,format:"Y-m-d",header_captions:{days:"F, Y",months:"Y",years:"Y1 - Y2"},icon_margin:!1,icon_position:"right",inside:!0,lang_clear_date:"Clear date",months:["January","February","March","April","May","June","July","August","September","October","November","December"],months_abbr:!1,navigation:["&#9664;","&#9654;","&#9650;","&#9660;"],offset:[5,-5],open_icon_only:!1,open_on_focus:!1,pair:!1,readonly_element:!0,select_other_months:!1,show_clear_date:0,show_icon:!0,show_other_months:!0,show_select_today:"Today",show_week_number:!1,start_date:!1,strict:!1,view:"days",weekend_days:[0,6],zero_pad:!1,onChange:null,onClear:null,onOpen:null,onClose:null,onSelect:null},_e={},he=[],pe=[],ue={},fe=!1,me="",be=!1,ye=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),ve=this,we=Ie(e);ve.settings={};var t=function(e){var t,s,i,a,n={days:["d","j","D"],months:["F","m","M","n","t"],years:["o","Y","y"],hours:["G","g","H","h"],minutes:["i"],seconds:["s"],ampm:["A","a"]},r=null;for(i=0;i<3;i++)me+=Math.floor(65536*(1+Math.random())).toString(16);if(!e)for(t in ve.settings=Ie.extend({},ge,Ie.fn.Zebra_DatePicker.defaults,M),ue.readonly=we.attr("readonly"),ue.style=we.attr("style"),ue.padding_left=parseInt(we.css("paddingLeft"),10)||0,ue.padding_right=parseInt(we.css("paddingRight"),10)||0,we.data())0===t.indexOf("zdp_")&&(t=t.replace(/^zdp\_/,""),void 0!==ge[t]&&(ve.settings[t]="pair"===t?Ie(we.data("zdp_"+t)):we.data("zdp_"+t)));for(r in ve.settings.readonly_element?we.attr("readonly","readonly"):we.removeAttr("readonly"),oe=!1,le=[],n)Ie.each(n[r],function(e,t){var s,i;if(-1<ve.settings.format.indexOf(t))if("days"===r)le.push("days");else if("months"===r)le.push("months");else if("years"===r)le.push("years");else if(("hours"===r||"minutes"===r||"seconds"===r||"ampm"===r)&&!ve.settings.disable_time_picker)if(oe||(oe={is12hour:!1},le.push("time")),"hours"===r)for("g"===t||"h"===t?(i=12,oe.is12hour=!0):i=24,oe.hours=[],s=12===i?1:0;s<(12===i?13:i);s++)(!Ie.isArray(ve.settings.enabled_hours)||-1<Ie.inArray(s,ve.settings.enabled_hours))&&oe.hours.push(s);else if("minutes"===r)for(oe.minutes=[],s=0;s<60;s++)(!Ie.isArray(ve.settings.enabled_minutes)||-1<Ie.inArray(s,ve.settings.enabled_minutes))&&oe.minutes.push(s);else if("seconds"===r)for(oe.seconds=[],s=0;s<60;s++)(!Ie.isArray(ve.settings.enabled_seconds)||-1<Ie.inArray(s,ve.settings.enabled_seconds))&&oe.seconds.push(s);else oe.ampm=["am","pm"]});for(i in 0===le.length&&(le=["years","months","days"]),-1===Ie.inArray(ve.settings.view,le)&&(ve.settings.view=le[le.length-1]),x=[],ve.settings.custom_classes)ve.settings.custom_classes.hasOwnProperty(i)&&-1===x.indexOf(i)&&x.push(i);for(a=0;a<2+x.length;a++)s=0===a?ve.settings.disabled_dates:1===a?ve.settings.enabled_dates:ve.settings.custom_classes[x[a-2]],Ie.isArray(s)&&0<s.length&&Ie.each(s,function(){var e,t,s,i,n=this.split(" ");for(e=0;e<4;e++){for(n[e]||(n[e]="*"),n[e]=-1<n[e].indexOf(",")?n[e].split(","):new Array(n[e]),t=0;t<n[e].length;t++)if(-1<n[e][t].indexOf("-")&&null!==(i=n[e][t].match(/^([0-9]+)\-([0-9]+)/))){for(s=Ze(i[1]);s<=Ze(i[2]);s++)-1===Ie.inArray(s,n[e])&&n[e].push(s+"");n[e].splice(t,1)}for(t=0;t<n[e].length;t++)n[e][t]=isNaN(Ze(n[e][t]))?n[e][t]:Ze(n[e][t])}0===a?he.push(n):1===a?pe.push(n):(void 0===_e[x[a-2]]&&(_e[x[a-2]]=[]),_e[x[a-2]].push(n))});var o,d,c=new Date,l=ve.settings.reference_date?ve.settings.reference_date:we.data("zdp_reference_date")&&void 0!==we.data("zdp_reference_date")?we.data("zdp_reference_date"):c;if(O=ne=void 0,L=l.getMonth(),Z=c.getMonth(),R=l.getFullYear(),Y=c.getFullYear(),T=l.getDate(),S=c.getDate(),!0===ve.settings.direction)ne=l;else if(!1===ve.settings.direction)J=(O=l).getMonth(),G=O.getFullYear(),Q=O.getDate();else if(!Ie.isArray(ve.settings.direction)&&Ce(ve.settings.direction)&&0<Ze(ve.settings.direction)||Ie.isArray(ve.settings.direction)&&((o=ke(ve.settings.direction[0]))||!0===ve.settings.direction[0]||Ce(ve.settings.direction[0])&&0<ve.settings.direction[0])&&((d=ke(ve.settings.direction[1]))||!1===ve.settings.direction[1]||Ce(ve.settings.direction[1])&&0<=ve.settings.direction[1]))ne=o||new Date(R,L,T+(Ie.isArray(ve.settings.direction)?Ze(!0===ve.settings.direction[0]?0:ve.settings.direction[0]):Ze(ve.settings.direction))),L=ne.getMonth(),R=ne.getFullYear(),T=ne.getDate(),d&&+ne<=+d?O=d:!d&&!1!==ve.settings.direction[1]&&Ie.isArray(ve.settings.direction)&&(O=new Date(R,L,T+Ze(ve.settings.direction[1]))),O&&(J=O.getMonth(),G=O.getFullYear(),Q=O.getDate());else if(!Ie.isArray(ve.settings.direction)&&Ce(ve.settings.direction)&&Ze(ve.settings.direction)<0||Ie.isArray(ve.settings.direction)&&(!1===ve.settings.direction[0]||Ce(ve.settings.direction[0])&&ve.settings.direction[0]<0)&&((o=ke(ve.settings.direction[1]))||Ce(ve.settings.direction[1])&&0<=ve.settings.direction[1]))O=new Date(R,L,T+(Ie.isArray(ve.settings.direction)?Ze(!1===ve.settings.direction[0]?0:ve.settings.direction[0]):Ze(ve.settings.direction))),J=O.getMonth(),G=O.getFullYear(),Q=O.getDate(),o&&+o<+O?ne=o:!o&&Ie.isArray(ve.settings.direction)&&(ne=new Date(G,J,Q-Ze(ve.settings.direction[1]))),ne&&(L=ne.getMonth(),R=ne.getFullYear(),T=ne.getDate());else if(Ie.isArray(ve.settings.disabled_dates)&&0<ve.settings.disabled_dates.length)for(var g in he)if("*"===he[g][0]&&"*"===he[g][1]&&"*"===he[g][2]&&"*"===he[g][3]){var _=[];if(Ie.each(pe,function(){var e=this;"*"!==e[2][0]&&_.push(parseInt(e[2][0]+("*"===e[1][0]?"12":Se(e[1][0],2))+("*"===e[0][0]?"*"===e[1][0]?"31":new Date(e[2][0],e[1][0],0).getDate():Se(e[0][0],2)),10))}),_.sort(),0<_.length){var h=(_[0]+"").match(/([0-9]{4})([0-9]{2})([0-9]{2})/);R=parseInt(h[1],10),L=parseInt(h[2],10)-1,T=parseInt(h[3],10)}break}if(Me(R,L,T)){for(;Me(R);)L=ne?(R++,0):(R--,11);for(;Me(R,L);)T=ne?(L++,1):(L--,new Date(R,L+1,0).getDate()),11<L?(R++,L=0,T=1):L<0&&(R--,L=11,T=new Date(R,L+1,0).getDate());for(;Me(R,L,T);)ne?T++:T--,c=new Date(R,L,T),R=c.getFullYear(),L=c.getMonth(),T=c.getDate();c=new Date(R,L,T),R=c.getFullYear(),L=c.getMonth(),T=c.getDate()}ve.settings.start_date&&"object"==typeof ve.settings.start_date&&ve.settings.start_date instanceof Date&&(ve.settings.start_date=Ae(ve.settings.start_date));var p=ke(we.val()||(ve.settings.start_date?ve.settings.start_date:""));if(p&&ve.settings.strict&&Me(p.getFullYear(),p.getMonth(),p.getDate())&&we.val(""),e||void 0===ne&&void 0===p||Ye(void 0!==p?p:ne),!(ve.settings.always_visible instanceof jQuery)){if(!e){if(ve.settings.show_icon){"firefox"===xe.name&&we.is('input[type="text"]')&&"inline"===we.css("display")&&we.css("display","inline-block");var u=parseInt(we.css("marginTop"),10)||0,f=parseInt(we.css("marginRight"),10)||0,m=parseInt(we.css("marginBottom"),10)||0,b=parseInt(we.css("marginLeft"),10)||0,y=Ie('<span class="Zebra_DatePicker_Icon_Wrapper"></span>').css({display:we.css("display"),position:"static"===we.css("position")?"relative":we.css("position"),"float":we.css("float"),top:we.css("top"),right:we.css("right"),bottom:we.css("bottom"),left:we.css("left"),marginTop:u<0?u:0,marginRight:f<0?f:0,marginBottom:m<0?m:0,marginLeft:b<0?b:0,paddingTop:u,paddingRight:f,paddingBottom:m,paddingLeft:b});"block"===we.css("display")&&y.css("width",we.outerWidth(!0)),we.wrap(y).css({position:"relative","float":"none",top:"auto",right:"auto",bottom:"auto",left:"auto",marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),E=Ie('<button type="button" class="Zebra_DatePicker_Icon'+("disabled"===we.attr("disabled")?" Zebra_DatePicker_Icon_Disabled":"")+'">Pick a date</button>'),ve.icon=E,F=ve.settings.open_icon_only?E:E.add(we)}else F=we;F.on("click.Zebra_DatePicker_"+me+(ve.settings.open_on_focus?" focus.Zebra_DatePicker_"+me:""),function(){I.hasClass("dp_hidden")&&!we.attr("disabled")&&(!be||ve.settings.readonly_element?ve.show():(clearTimeout(ae),ae=setTimeout(function(){ve.show()},600)))}),F.on("keydown.Zebra_DatePicker_"+me,function(e){9!==e.keyCode||I.hasClass("dp_hidden")||ve.hide()}),!ve.settings.readonly_element&&ve.settings.pair&&we.on("blur.Zebra_DatePicker_"+me,function(){var e;(e=ke(Ie(this).val()))&&!Me(e.getFullYear(),e.getMonth(),e.getDate())&&Ye(e)}),void 0!==E&&E.insertAfter(we)}if(void 0!==E){E.attr("style","");var v=we.outerWidth(),w=we.outerHeight(),k=E.outerWidth(),D=E.outerHeight();E.css("top",(w-D)/2),ve.settings.inside?"right"===ve.settings.icon_position?(E.css("right",!1!==ve.settings.icon_margin?ve.settings.icon_margin:ue.padding_right),we.css("paddingRight",2*(!1!==ve.settings.icon_margin?ve.settings.icon_margin:ue.padding_right)+k)):(E.css("left",!1!==ve.settings.icon_margin?ve.settings.icon_margin:ue.padding_left),we.css("paddingLeft",2*(!1!==ve.settings.icon_margin?ve.settings.icon_margin:ue.padding_left)+k)):E.css("left",v+(!1!==ve.settings.icon_margin?ve.settings.icon_margin:ue.padding_left)),E.removeClass("Zebra_DatePicker_Icon_Disabled"),"disabled"===we.attr("disabled")&&E.addClass("Zebra_DatePicker_Icon_Disabled")}}if(ie=!1!==ve.settings.show_select_today&&-1<Ie.inArray("days",le)&&!Me(Y,Z,S)&&ve.settings.show_select_today,e)return Ie(".dp_previous",I).html(ve.settings.navigation[0]),Ie(".dp_next",I).html(ve.settings.navigation[1]),Ie(".dp_time_controls_increase .dp_time_control",I).html(ve.settings.navigation[2]),Ie(".dp_time_controls_decrease .dp_time_control",I).html(ve.settings.navigation[3]),Ie(".dp_clear",I).html(ve.settings.lang_clear_date),void Ie(".dp_today",I).html(ve.settings.show_select_today);var A='<div class="Zebra_DatePicker"><table class="dp_header dp_actions"><tr><td class="dp_previous">'+ve.settings.navigation[0]+(ye?"&#xFE0E;":"")+'</td><td class="dp_caption"></td><td class="dp_next">'+ve.settings.navigation[1]+(ye?"&#xFE0E;":"")+'</td></tr></table><table class="dp_daypicker'+(ve.settings.show_week_number?" dp_week_numbers":"")+' dp_body"></table><table class="dp_monthpicker dp_body"></table><table class="dp_yearpicker dp_body"></table><table class="dp_timepicker dp_body"></table><table class="dp_footer dp_actions"><tr><td class="dp_today">'+ie+'</td><td class="dp_clear">'+ve.settings.lang_clear_date+'</td><td class="dp_view_toggler dp_icon">&nbsp;&nbsp;&nbsp;&nbsp;</td><td class="dp_confirm dp_icon"></td></tr></table></div>';I=Ie(A),B=Ie("table.dp_header",I),z=Ie("table.dp_daypicker",I),U=Ie("table.dp_monthpicker",I),de=Ie("table.dp_yearpicker",I),re=Ie("table.dp_timepicker",I),W=Ie("table.dp_footer",I),se=Ie("td.dp_today",W),C=Ie("td.dp_clear",W),K=Ie("td.dp_view_toggler",W),P=Ie("td.dp_confirm",W),ve.settings.always_visible instanceof jQuery?we.attr("disabled")||(ve.settings.always_visible.append(I),ve.show()):ve.settings.container.append(I),I.on("mouseover","td:not(.dp_disabled)",function(){Ie(this).addClass("dp_hover")}).on("mouseout","td:not(.dp_disabled)",function(){Ie(this).removeClass("dp_hover")}),De(I),Ie(".dp_previous",B).on("click",function(){"months"===ce?te--:"years"===ce?te-=12:--ee<0&&(ee=11,te--),Fe()}),Ie(".dp_caption",B).on("click",function(){ce="days"===ce?-1<Ie.inArray("months",le)?"months":-1<Ie.inArray("years",le)?"years":"days":"months"===ce?-1<Ie.inArray("years",le)?"years":-1<Ie.inArray("days",le)?"days":"months":-1<Ie.inArray("days",le)?"days":-1<Ie.inArray("months",le)?"months":"years",Fe()}),Ie(".dp_next",B).on("click",function(){"months"===ce?te++:"years"===ce?te+=12:12==++ee&&(ee=0,te++),Fe()}),z.on("click","td:not(.dp_disabled)",function(){var e;ve.settings.select_other_months&&Ie(this).attr("class")&&null!==(e=Ie(this).attr("class").match(/date\_([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])/))?Pe(e[1],e[2]-1,e[3],"days",Ie(this)):Pe(te,ee,Ze(Ie(this).html()),"days",Ie(this))}),U.on("click","td:not(.dp_disabled)",function(){var e=Ie(this).attr("class").match(/dp\_month\_([0-9]+)/);ee=Ze(e[1]),-1===Ie.inArray("days",le)?Pe(te,ee,1,"months",Ie(this)):(ce="days",ve.settings.always_visible&&we.val(""),Fe())}),de.on("click","td:not(.dp_disabled)",function(){te=Ze(Ie(this).html()),-1===Ie.inArray("months",le)?Pe(te,1,1,"years",Ie(this)):(ce="months",ve.settings.always_visible&&we.val(""),Fe())}),se.on("click",function(e){var t=new Date;e.preventDefault(),Pe(t.getFullYear(),t.getMonth(),t.getDate(),"days",Ie(".dp_current",z))}),C.on("click",function(e){e.preventDefault(),we.val(""),H=N=j=null,ve.settings.always_visible?Ie("td.dp_selected",I).removeClass("dp_selected"):te=ee=null,we.focus(),ve.hide(),ve.settings.onClear&&"function"==typeof ve.settings.onClear&&ve.settings.onClear.call(we)}),K.on("click",function(){"time"!==ce?(ce="time",Fe()):Ie(".dp_caption",B).trigger("click")}),P.on("click",function(){if(Ie(".dp_time_controls_increase td",re).trigger("click"),Ie(".dp_time_controls_decrease td",re).trigger("click"),ve.settings.onSelect&&"function"==typeof ve.settings.onSelect){var e=new Date(te,ee,j,oe&&oe.hours?V+(oe.ampm&&("pm"===X&&V<12||"am"===X&&12===V)?12:0):0,oe&&oe.minutes?$:0,oe&&oe.seconds?q:0);ve.settings.onSelect.call(we,Ae(e),te+"-"+Se(ee+1,2)+"-"+Se(j,2)+(oe?" "+Se(e.getHours(),2)+":"+Se(e.getMinutes(),2)+":"+Se(e.getSeconds(),2):""),e)}ve.hide()}),I.on("click",".dp_time_controls_increase td, .dp_time_controls_decrease td",function(){var e,t=0<Ie(this).parent(".dp_time_controls_increase").length,s=Ie(this).attr("class").match(/dp\_time\_([^\s]+)/i),i=Ie(".dp_time_segments .dp_time_"+s[1]+("ampm"!==s[1]?"s":""),re),n=i.text().toLowerCase(),a=oe[s[1]+("ampm"!==s[1]?"s":"")],r=Ie.inArray("ampm"!==s[1]?parseInt(n,10):n,a),o=-1===r?0:t?r+1>=a.length?0:r+1:r-1<0?a.length-1:r-1;"hour"===s[1]?V=a[o]:"minute"===s[1]?$=a[o]:"second"===s[1]?q=a[o]:X=a[o],!j&&ve.settings.start_date&&(e=ke(ve.settings.start_date))&&(j=e.getDate()),j||(j=T),i.text(Se(a[o],2).toUpperCase()),Pe(te,ee,j)}),ve.settings.always_visible instanceof jQuery||(Ie(document).on("touchmove.Zebra_DatePicker_"+me,function(){fe=!0}),Ie(document).on("mousedown.Zebra_DatePicker_"+me+" touchend.Zebra_DatePicker_"+me,function(e){if("touchend"===e.type&&fe)return fe=!(be=!0);fe=!1,I.hasClass("dp_hidden")||(!ve.settings.open_icon_only||!ve.icon||Ie(e.target).get(0)===ve.icon.get(0))&&(ve.settings.open_icon_only||Ie(e.target).get(0)===we.get(0)||ve.icon&&Ie(e.target).get(0)===ve.icon.get(0))||0!==Ie(e.target).parents().filter(".Zebra_DatePicker").length||ve.hide(!0)}),Ie(document).on("keyup.Zebra_DatePicker_"+me,function(e){I.hasClass("dp_hidden")||27!==e.which||ve.hide()})),Fe()};ve.clear_date=function(){Ie(C).trigger("click")},ve.destroy=function(){void 0!==ve.icon&&(ve.icon.off("click.Zebra_DatePicker_"+me),ve.icon.off("focus.Zebra_DatePicker_"+me),ve.icon.off("keydown.Zebra_DatePicker_"+me),ve.icon.remove()),I.off(),I.remove(),!ve.settings.show_icon||ve.settings.always_visible instanceof jQuery||we.unwrap(),we.off("blur.Zebra_DatePicker_"+me),we.off("click.Zebra_DatePicker_"+me),we.off("focus.Zebra_DatePicker_"+me),we.off("keydown.Zebra_DatePicker_"+me),we.off("mousedown.Zebra_DatePicker_"+me),Ie(document).off("keyup.Zebra_DatePicker_"+me),Ie(document).off("mousedown.Zebra_DatePicker_"+me),Ie(document).off("touchend.Zebra_DatePicker_"+me),we.removeData("Zebra_DatePicker"),we.attr("readonly",ue.readonly),we.attr("style",ue.style?ue.style:""),we.css("paddingLeft",ue.padding_left),we.css("paddingRight",ue.padding_right)},ve.hide=function(e){I.hasClass("dp_hidden")||ve.settings.always_visible&&!e||(l("hide"),I.addClass("dp_hidden"),ve.settings.onClose&&"function"==typeof ve.settings.onClose&&ve.settings.onClose.call(we))},ve.set_date=function(e){var t;"object"==typeof e&&e instanceof Date&&(e=Ae(e)),(t=ke(e))&&!Me(t.getFullYear(),t.getMonth(),t.getDate())&&(we.val(e),Ye(t))},ve.show=function(){ce=ve.settings.view;var e,t=ke(we.val()||(ve.settings.start_date?ve.settings.start_date:""));if(t?(N=t.getMonth(),ee=t.getMonth(),H=t.getFullYear(),te=t.getFullYear(),j=t.getDate(),Me(H,N,j)&&(ve.settings.strict&&we.val(""),ee=L,te=R)):(ee=L,te=R),oe&&(e=t||new Date,V=e.getHours(),$=e.getMinutes(),q=e.getSeconds(),X=12<=V?"pm":"am",oe.is12hour&&(V=V%12==0?12:V%12),Ie.isArray(ve.settings.enabled_hours)&&-1===Ie.inArray(V,ve.settings.enabled_hours)&&(V=ve.settings.enabled_hours[0]),Ie.isArray(ve.settings.enabled_minutes)&&-1===Ie.inArray($,ve.settings.enabled_minutes)&&($=ve.settings.enabled_minutes[0]),Ie.isArray(ve.settings.enabled_seconds)&&-1===Ie.inArray(q,ve.settings.enabled_seconds)&&(q=ve.settings.enabled_seconds[0])),Fe(),ve.settings.always_visible instanceof jQuery)I.removeClass("dp_hidden");else{if(ve.settings.container.is("body")){var s=I.outerWidth(),i=I.outerHeight(),n=(void 0!==E?E.offset().left+E.outerWidth(!0):we.offset().left+we.outerWidth(!0))+ve.settings.offset[0],a=(void 0!==E?E.offset().top:we.offset().top)-i+ve.settings.offset[1],r=Ie(window).width(),o=Ie(window).height(),d=Ie(window).scrollTop(),c=Ie(window).scrollLeft();"below"===ve.settings.default_position&&(a=(void 0!==E?E.offset().top:we.offset().top)+ve.settings.offset[1]),c+r<n+s&&(n=c+r-s),n<c&&(n=c),d+o<a+i&&(a=d+o-i),a<d&&(a=d),I.css({left:n,top:a})}else I.css({left:0,top:0});I.removeClass("dp_hidden"),l()}ve.settings.onOpen&&"function"==typeof ve.settings.onOpen&&ve.settings.onOpen.call(we)},ve.update=function(e){ve.original_direction&&(ve.original_direction=ve.direction),ve.settings=Ie.extend(ve.settings,e),t(!0)};var ke=function(e){if(e+="",""!==Ie.trim(e)){for(var s=w(ve.settings.format),t=["d","D","j","l","N","S","w","F","m","M","n","Y","y","G","g","H","h","i","s","a","A"],i=[],n=[],a=null,r=null,o=0;o<t.length;o++)-1<(a=s.indexOf(t[o]))&&i.push({character:t[o],position:a});if(i.sort(function(e,t){return e.position-t.position}),Ie.each(i,function(e,t){switch(t.character){case"d":n.push("0[1-9]|[12][0-9]|3[01]");break;case"D":n.push("[a-z]{3}");break;case"j":n.push("[1-9]|[12][0-9]|3[01]");break;case"l":n.push("[a-zÀ-ɏ]+");break;case"N":n.push("[1-7]");break;case"S":n.push("st|nd|rd|th");break;case"w":n.push("[0-6]");break;case"F":n.push("[a-z]+");break;case"m":n.push("0[1-9]|1[012]");break;case"M":n.push("[a-z]{3}");break;case"n":n.push("[1-9]|1[012]");break;case"Y":n.push("[0-9]{4}");break;case"y":n.push("[0-9]{2}");break;case"G":n.push("[1-9]|1[0-9]|2[0123]");break;case"g":n.push("[0-9]|1[012]");break;case"H":n.push("0[0-9]|1[0-9]|2[0123]");break;case"h":n.push("0[0-9]|1[012]");break;case"i":case"s":n.push("0[0-9]|[12345][0-9]");break;case"a":n.push("am|pm");break;case"A":n.push("AM|PM")}}),n.length&&(i.reverse(),Ie.each(i,function(e,t){s=s.replace(t.character,"("+n[n.length-e-1]+")")}),n=new RegExp("^"+s+"$","ig"),r=n.exec(e))){var d,c,l=new Date,g=1,_=l.getMonth()+1,h=l.getFullYear(),p=l.getHours(),u=l.getMinutes(),f=l.getSeconds(),m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b=["January","February","March","April","May","June","July","August","September","October","November","December"],y=!0;if(i.reverse(),Ie.each(i,function(s,i){if(!y)return!0;switch(i.character){case"m":case"n":_=Ze(r[s+1]);break;case"d":case"j":g=Ze(r[s+1]);break;case"D":case"l":case"F":case"M":c="D"===i.character||"l"===i.character?ve.settings.days:ve.settings.months,y=!1,Ie.each(c,function(e,t){if(y)return!0;if(r[s+1].toLowerCase()===t.substring(0,"D"===i.character||"M"===i.character?3:t.length).toLowerCase()){switch(i.character){case"D":r[s+1]=m[e].substring(0,3);break;case"l":r[s+1]=m[e];break;case"F":r[s+1]=b[e],_=e+1;break;case"M":r[s+1]=b[e].substring(0,3),_=e+1}y=!0}});break;case"Y":h=Ze(r[s+1]);break;case"y":h="19"+Ze(r[s+1]);break;case"G":case"H":case"g":case"h":p=Ze(r[s+1]);break;case"i":u=Ze(r[s+1]);break;case"s":f=Ze(r[s+1]);break;case"a":case"A":d=r[s+1].toLowerCase()}}),y){var v=new Date(h,(_||1)-1,g||1,p+("pm"===d&&12!==p?12:"am"===d&&12===p?-12:0),u,f);if(v.getFullYear()===h&&v.getDate()===(g||1)&&v.getMonth()===(_||1)-1)return v}}return!1}},De=function(e){"firefox"===xe.name?e.css("MozUserSelect","none"):"explorer"===xe.name?Ie(document).on("selectstart",e,function(){return!1}):e.mousedown(function(){return!1})},w=function(e){return e.replace(/([-.,*+?^${}()|[\]\/\\])/g,"\\$1")},Ae=function(e){var t,s,i="",n=e.getDate(),a=e.getDay(),r=ve.settings.days[a],o=e.getMonth()+1,d=ve.settings.months[o-1],c=e.getFullYear()+"",l=e.getHours(),g=l%12==0?12:l%12,_=e.getMinutes(),h=e.getSeconds(),p=12<=l?"pm":"am";for(t=0;t<ve.settings.format.length;t++)switch(s=ve.settings.format.charAt(t)){case"y":c=c.substr(2);case"Y":i+=c;break;case"m":o=Se(o,2);case"n":i+=o;break;case"M":d=Ie.isArray(ve.settings.months_abbr)&&void 0!==ve.settings.months_abbr[o-1]?ve.settings.months_abbr[o-1]:ve.settings.months[o-1].substr(0,3);case"F":i+=d;break;case"d":n=Se(n,2);case"j":i+=n;break;case"D":r=Ie.isArray(ve.settings.days_abbr)&&void 0!==ve.settings.days_abbr[a]?ve.settings.days_abbr[a]:ve.settings.days[a].substr(0,3);case"l":i+=r;break;case"N":a++;case"w":i+=a;break;case"S":i+=n%10==1&&"11"!==n?"st":n%10==2&&"12"!==n?"nd":n%10==3&&"13"!==n?"rd":"th";break;case"g":i+=g;break;case"h":i+=Se(g,2);break;case"G":i+=l;break;case"H":i+=Se(l,2);break;case"i":i+=Se(_,2);break;case"s":i+=Se(h,2);break;case"a":i+=p;break;case"A":i+=p.toUpperCase();break;default:i+=s}return i},n=function(){var e,t,s,i,n,a,r,o,d,c,l,g=new Date(te,ee+1,0).getDate(),_=new Date(te,ee,1).getDay(),h=new Date(te,ee,0).getDate(),p=_-ve.settings.first_day_of_week;for(p=p<0?7+p:p,m(ve.settings.header_captions.days),t="<tr>",ve.settings.show_week_number&&(t+="<th>"+ve.settings.show_week_number+"</th>"),e=0;e<7;e++)t+="<th>"+(Ie.isArray(ve.settings.days_abbr)&&void 0!==ve.settings.days_abbr[(ve.settings.first_day_of_week+e)%7]?ve.settings.days_abbr[(ve.settings.first_day_of_week+e)%7]:ve.settings.days[(ve.settings.first_day_of_week+e)%7].substr(0,2))+"</th>";for(t+="</tr><tr>",e=0;e<42;e++)0<e&&e%7==0&&(t+="</tr><tr>"),e%7==0&&ve.settings.show_week_number&&(t+="<th>"+b(new Date(te,ee,e-p+1))+"</th>"),s=e-p+1,ve.settings.select_other_months&&(e<p||g<s)&&(n=(i=new Date(te,ee,s)).getFullYear(),a=i.getMonth(),r=i.getDate(),i=n+Se(a+1,2)+Se(r,2)),o=(ve.settings.first_day_of_week+e)%7,l=-1<Ie.inArray(o,ve.settings.weekend_days),e<p?t+='<td class="dp_not_in_month '+(l?"dp_weekend ":"")+(ve.settings.select_other_months&&!Me(n,a,r)?"date_"+i:"dp_disabled")+'">'+(ve.settings.select_other_months||ve.settings.show_other_months?Se(h-p+e+1,ve.settings.zero_pad?2:0):"&nbsp;")+"</td>":g<s?t+='<td class="dp_not_in_month '+(l?"dp_weekend ":"")+(ve.settings.select_other_months&&!Me(n,a,r)?"date_"+i:"dp_disabled")+'">'+(ve.settings.select_other_months||ve.settings.show_other_months?Se(s-g,ve.settings.zero_pad?2:0):"&nbsp;")+"</td>":(d="",c=f(te,ee,s),l&&(d=" dp_weekend"),ee===Z&&te===Y&&S===s&&(d+=" dp_current"),""!==c&&(d+=" "+c),ee===N&&te===H&&j===s&&(d+=" dp_selected"),Me(te,ee,s)&&(d+=" dp_disabled"),t+="<td"+(""!==d?' class="'+Ie.trim(d)+'"':"")+">"+((ve.settings.zero_pad?Se(s,2):s)||"&nbsp;")+"</td>");t+="</tr>",z.html(Ie(t)),ve.settings.always_visible&&(u=Ie("td:not(.dp_disabled)",z)),z.show()},f=function(s,i,n){var a,e,r;for(e in void 0!==i&&(i+=1),x)if(a=x[e],r=!1,Ie.isArray(_e[a])&&Ie.each(_e[a],function(){if(!r){var e,t=this;if((-1<Ie.inArray(s,t[2])||-1<Ie.inArray("*",t[2]))&&(void 0!==i&&-1<Ie.inArray(i,t[1])||-1<Ie.inArray("*",t[1]))&&(void 0!==n&&-1<Ie.inArray(n,t[0])||-1<Ie.inArray("*",t[0]))){if(-1<Ie.inArray("*",t[3]))return r=a;if(e=new Date(s,i-1,n).getDay(),-1<Ie.inArray(e,t[3]))return r=a}}}),r)return r;return r||""},l=function(e){var t,s;if("explorer"===xe.name&&6===xe.version)switch(i||(t=Ze(I.css("zIndex"))-1,i=Ie("<iframe>",{src:'javascript:document.write("")',scrolling:"no",frameborder:0,css:{zIndex:t,position:"absolute",top:-1e3,left:-1e3,width:I.outerWidth(),height:I.outerHeight(),filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)",display:"none"}}),Ie("body").append(i)),e){case"hide":i.hide();break;default:s=I.offset(),i.css({top:s.top,left:s.left,display:"block"})}},Me=function(s,i,n){var e,t,a,r;if(!(void 0!==s&&!isNaN(s)||void 0!==i&&!isNaN(i)||void 0!==n&&!isNaN(n)))return!1;if(s<1e3)return!0;if(Ie.isArray(ve.settings.direction)||0!==Ze(ve.settings.direction)){if(8===(t=((e=Ze(o(s,void 0!==i?Se(i,2):"",void 0!==n?Se(n,2):"")))+"").length)&&(void 0!==ne&&e<Ze(o(R,Se(L,2),Se(T,2)))||void 0!==O&&e>Ze(o(G,Se(J,2),Se(Q,2)))))return!0;if(6===t&&(void 0!==ne&&e<Ze(o(R,Se(L,2)))||void 0!==O&&e>Ze(o(G,Se(J,2)))))return!0;if(4===t&&(void 0!==ne&&e<R||void 0!==O&&G<e))return!0}return void 0!==i&&(i+=1),r=a=!1,Ie.isArray(he)&&he.length&&Ie.each(he,function(){if(!a){var e,t=this;if((-1<Ie.inArray(s,t[2])||-1<Ie.inArray("*",t[2]))&&(void 0!==i&&-1<Ie.inArray(i,t[1])||-1<Ie.inArray("*",t[1]))&&(void 0!==n&&-1<Ie.inArray(n,t[0])||-1<Ie.inArray("*",t[0]))){if(-1<Ie.inArray("*",t[3]))return a=!0;if(e=new Date(s,i-1,n).getDay(),-1<Ie.inArray(e,t[3]))return a=!0}}}),pe&&Ie.each(pe,function(){if(!r){var e,t=this;if((-1<Ie.inArray(s,t[2])||-1<Ie.inArray("*",t[2]))&&(r=!0,void 0!==i))if(r=!0,-1<Ie.inArray(i,t[1])||-1<Ie.inArray("*",t[1])){if(void 0!==n)if(r=!0,-1<Ie.inArray(n,t[0])||-1<Ie.inArray("*",t[0])){if(-1<Ie.inArray("*",t[3]))return r=!0;if(e=new Date(s,i-1,n).getDay(),-1<Ie.inArray(e,t[3]))return r=!0;r=!1}else r=!1}else r=!1}}),(!pe||!r)&&!(!he||!a)},Ce=function(e){return(e+"").match(/^\-?[0-9]+$/)},m=function(e){!isNaN(parseFloat(ee))&&isFinite(ee)&&(e=e.replace(/\bm\b|\bn\b|\bF\b|\bM\b/,function(e){switch(e){case"m":return Se(ee+1,2);case"n":return ee+1;case"F":return ve.settings.months[ee];case"M":return Ie.isArray(ve.settings.months_abbr)&&void 0!==ve.settings.months_abbr[ee]?ve.settings.months_abbr[ee]:ve.settings.months[ee].substr(0,3);default:return e}})),!isNaN(parseFloat(te))&&isFinite(te)&&(e=e.replace(/\bY\b/,te).replace(/\by\b/,(te+"").substr(2)).replace(/\bY1\b/i,te-7).replace(/\bY2\b/i,te+4)),Ie(".dp_caption",B).html(e)},Fe=function(){var e,t,s;""===z.text()||"days"===ce?(""===z.text()?(ve.settings.always_visible instanceof jQuery||I.css("left",-1e3),I.removeClass("hidden"),n(),e=void 0!==z[0].getBoundingClientRect&&void 0!==z[0].getBoundingClientRect().height?z[0].getBoundingClientRect().height:z.outerHeight(!0),U.css("height",e),de.css("height",e),re.css("height",e+B.outerHeight(!0)),I.css("width",I.outerWidth()),I.addClass("dp_hidden")):n(),B.show(),U.hide(),de.hide(),re.hide(),K.hide(),P.hide(),oe&&K.show().removeClass("dp_calendar")):"months"===ce?(!function(){m(ve.settings.header_captions.months);var e,t,s="<tr>";for(e=0;e<12;e++)0<e&&e%3==0&&(s+="</tr><tr>"),t="dp_month_"+e,Me(te,e)?t+=" dp_disabled":!1!==N&&N===e&&te===H?t+=" dp_selected":Z===e&&Y===te&&(t+=" dp_current"),s+='<td class="'+Ie.trim(t)+'">'+(Ie.isArray(ve.settings.months_abbr)&&void 0!==ve.settings.months_abbr[e]?ve.settings.months_abbr[e]:ve.settings.months[e].substr(0,3))+"</td>";s+="</tr>",U.html(Ie(s)),ve.settings.always_visible&&(d=Ie("td:not(.dp_disabled)",U)),U.show()}(),z.hide(),de.hide(),re.hide(),K.hide(),P.hide()):"years"===ce?(!function(){m(ve.settings.header_captions.years);var e,t,s="<tr>";for(e=0;e<12;e++)0<e&&e%3==0&&(s+="</tr><tr>"),t="",Me(te-7+e)?t+=" dp_disabled":H&&H===te-7+e?t+=" dp_selected":Y===te-7+e&&(t+=" dp_current"),s+="<td"+(""!==Ie.trim(t)?' class="'+Ie.trim(t)+'"':"")+">"+(te-7+e)+"</td>";s+="</tr>",de.html(Ie(s)),ve.settings.always_visible&&(c=Ie("td:not(.dp_disabled)",de)),de.show()}(),z.hide(),U.hide(),re.hide(),K.hide(),P.hide()):"time"===ce&&(s='<tr class="dp_time_controls_increase">'+(oe.hours?'<td class="dp_time_hour dp_time_control">'+ve.settings.navigation[2]+"</td>":"")+(oe.minutes?'<td class="dp_time_minute dp_time_control">'+ve.settings.navigation[2]+"</td>":"")+(oe.seconds?'<td class="dp_time_second dp_time_control">'+ve.settings.navigation[2]+"</td>":"")+(oe.ampm?'<td class="dp_time_ampm dp_time_control">'+ve.settings.navigation[2]+"</td>":"")+"</tr>",s+='<tr class="dp_time_segments">',oe.hours&&(s+='<td class="dp_time_hours dp_disabled'+(oe.minutes||oe.seconds||oe.ampm?" dp_time_separator":"")+'"><div>'+Se(V,2)+"</div></td>"),oe.minutes&&(s+='<td class="dp_time_minutes dp_disabled'+(oe.seconds||oe.ampm?" dp_time_separator":"")+'"><div>'+Se($,2)+"</div></td>"),oe.seconds&&(s+='<td class="dp_time_seconds dp_disabled'+(oe.ampm?" dp_time_separator":"")+'"><div>'+Se(q,2)+"</div></td>"),oe.ampm&&(s+='<td class="dp_time_ampm dp_disabled">'+X.toUpperCase()+"</td>"),s+="</tr>",s+='<tr class="dp_time_controls_decrease">'+(oe.hours?'<td class="dp_time_hour dp_time_control">'+ve.settings.navigation[3]+"</td>":"")+(oe.minutes?'<td class="dp_time_minute dp_time_control">'+ve.settings.navigation[3]+"</td>":"")+(oe.seconds?'<td class="dp_time_second dp_time_control">'+ve.settings.navigation[3]+"</td>":"")+(oe.ampm?'<td class="dp_time_ampm dp_time_control">'+ve.settings.navigation[3]+"</td>":"")+"</tr>",re.html(Ie(s)),re.show(),1===le.length?(K.hide(),P.show()):(K.show().addClass("dp_calendar"),""===we.val()?P.hide():P.show()),B.hide(),z.hide(),U.hide(),de.hide()),"time"!==ce&&ve.settings.onChange&&"function"==typeof ve.settings.onChange&&void 0!==ce&&((t="days"===ce?z.find("td:not(.dp_disabled)"):"months"===ce?U.find("td:not(.dp_disabled)"):de.find("td:not(.dp_disabled)")).each(function(){var e;"days"===ce?Ie(this).hasClass("dp_not_in_month")&&!Ie(this).hasClass("dp_disabled")?(e=Ie(this).attr("class").match(/date\_([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])/),Ie(this).data("date",e[1]+"-"+e[2]+"-"+e[3])):Ie(this).data("date",te+"-"+Se(ee+1,2)+"-"+Se(Ze(Ie(this).text()),2)):"months"===ce?(e=Ie(this).attr("class").match(/dp\_month\_([0-9]+)/),Ie(this).data("date",te+"-"+Se(Ze(e[1])+1,2))):Ie(this).data("date",Ze(Ie(this).text()))}),ve.settings.onChange.call(we,ce,t)),W.show(),"time"===ce&&1<le.length?(se.hide(),C.hide(),K.css("width",""===we.val()?"100%":"50%")):(se.show(),C.show(),!0===ve.settings.show_clear_date||0===ve.settings.show_clear_date&&""!==we.val()||ve.settings.always_visible&&!1!==ve.settings.show_clear_date?ie?(se.css("width","50%"),C.css("width","50%")):(se.hide(),C.css("width",-1<Ie.inArray(le,"time")?"50%":"100%")):(C.hide(),ie?se.css("width","100%"):(se.hide(),(!oe||"time"!==ce&&"days"!==ce)&&W.hide())))},Pe=function(e,t,s,i,n){var a=new Date(e,t,s,oe&&oe.hours?V+(oe.ampm?"pm"===X&&12!==V?12:"am"===X&&12===V?-12:0:0):12,oe&&oe.minutes?$:0,oe&&oe.seconds?q:0),r="days"===i?u:"months"===i?d:c,o=Ae(a);we.val(o),(ve.settings.always_visible||oe)&&(N=a.getMonth(),ee=a.getMonth(),H=a.getFullYear(),te=a.getFullYear(),j=a.getDate(),n&&r&&(r.removeClass("dp_selected"),n.addClass("dp_selected"),"days"===i&&n.hasClass("dp_not_in_month")&&!n.hasClass("dp_disabled")&&ve.show())),oe?(ce="time",Fe()):(we.focus(),ve.hide()),Ye(a),!oe&&ve.settings.onSelect&&"function"==typeof ve.settings.onSelect&&ve.settings.onSelect.call(we,o,e+"-"+Se(t+1,2)+"-"+Se(s,2),a)},o=function(){var e,t="";for(e=0;e<arguments.length;e++)t+=arguments[e]+"";return t},Se=function(e,t){for(e+="";e.length<t;)e="0"+e;return e},Ze=function(e){return parseInt(e,10)},Ye=function(s){ve.settings.pair&&Ie.each(ve.settings.pair,function(){var e,t=Ie(this);t.data&&t.data("Zebra_DatePicker")?((e=t.data("Zebra_DatePicker")).update({reference_date:s,direction:0===e.settings.direction?1:e.settings.direction}),e.settings.always_visible&&e.show()):t.data("zdp_reference_date",s)})},b=function(e){var t,s,i,n,a,r,o,d=e.getFullYear(),c=e.getMonth()+1,l=e.getDate();return(o=(a=c<3?(i=(s=((t=d-1)/4|0)-(t/100|0)+(t/400|0))-(((t-1)/4|0)-((t-1)/100|0)+((t-1)/400|0)),n=0,l-1+31*(c-1)):(n=(i=(s=((t=d)/4|0)-(t/100|0)+(t/400|0))-(((t-1)/4|0)-((t-1)/100|0)+((t-1)/400|0)))+1,l+((153*(c-3)+2)/5|0)+58+i))+3-(l=(a+(r=(t+s)%7)-n)%7))<0?53-((r-i)/5|0):364+i<o?1:1+(o/7|0)},xe={init:function(){this.name=this.searchString(this.dataBrowser)||"",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||""},searchString:function(e){var t,s,i;for(t=0;t<e.length;t++)if(s=e[t].string,i=e[t].prop,this.versionSearchString=e[t].versionSearch||e[t].identity,s){if(-1!==s.indexOf(e[t].subString))return e[t].identity}else if(i)return e[t].identity},searchVersion:function(e){var t=e.indexOf(this.versionSearchString);if(-1!==t)return parseFloat(e.substring(t+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Firefox",identity:"firefox"},{string:navigator.userAgent,subString:"MSIE",identity:"explorer",versionSearch:"MSIE"}]};xe.init(),t()},Ie.fn.Zebra_DatePicker=function(t){return this.each(function(){void 0!==Ie(this).data("Zebra_DatePicker")&&Ie(this).data("Zebra_DatePicker").destroy();var e=new Ie.Zebra_DatePicker(this,t);Ie(this).data("Zebra_DatePicker",e)})},Ie.fn.Zebra_DatePicker.defaults={}});

}(H5PEditor.$));