",{"class":k+"controls "+k+"repad"}),i.useSetButton&&c.append(h._stdBtn.close.apply(h,[h.__("setDateButtonLabel")])),i.useTodayButton&&c.append(h._stdBtn.today.apply(h)),i.useTomorrowButton&&c.append(h._stdBtn.tomorrow.apply(h)),i.useClearButton&&c.append(h._stdBtn.clear.apply(h)),i.useCancelButton&&c.append(h._stdBtn.cancel.apply(h)),h._controlGroup(c).appendTo(h.d.intHTML)),h.wheelExists&&h.d.intHTML.on("mousewheel",".ui-datebox-sliderow-int",function(b,c){b.preventDefault(),h._offset(a(this).data("rowtype"),(0>c?-1:1)*("i"===a(this).data("rowtype")?i.minuteStep:1))}),h.d.intHTML.on(i.clickEvent,".ui-datebox-sliderow-int>div",function(b){b.preventDefault(),h._offset(a(this).parent().data("rowtype"),parseInt(a(this).data("offset"),10))}),h.d.intHTML.on(j.eStart,".ui-datebox-sliderow-int",function(b){j.move||(j.move=!0,j.target=a(this),j.pos=parseInt(j.target.css("marginLeft").replace(/px/i,""),10),j.start="touch"===b.type.substr(0,5)?b.originalEvent.changedTouches[0].pageX:b.pageX,j.end=!1,j.velocity=0,j.time=Date.now(),b.stopPropagation(),b.preventDefault())})}},_drag:{"default":function(){return!1},timeflipbox:function(){this._drag.flipbox.apply(this)},durationflipbox:function(){this._drag.flipbox.apply(this)},flipbox:function(){var b=this,c=this.options,d=this.drag;a(document).on(d.eMove,function(a){return d.move&&"flipbox"===c.mode.slice(-7)?(d.end="touch"===a.type.substr(0,5)?a.originalEvent.changedTouches[0].pageY:a.pageY,d.target.css("marginTop",d.pos+d.end-d.start+"px"),d.elapsed=Date.now()-d.time,d.velocity=.8*(100*(d.end-d.start)/(1+d.elapsed))+.2*d.velocity,a.preventDefault(),a.stopPropagation(),!1):void 0}),a(document).on(d.eEnd,function(a){var e,f,g,h,i,j,k;d.move&&"flipbox"===c.mode.slice(-7)&&(d.velocity<15&&d.velocity>-15||!c.useKinetic?(d.move=!1,d.end!==!1&&(a.preventDefault(),a.stopPropagation(),d.tmp=d.target.parent().parent(),b._offset(d.tmp.data("field"),parseInt((d.start-d.end)/(d.target.outerHeight()-2),10)*d.tmp.data("amount")*d.direc)),d.start=!1,d.end=!1):(d.move=!1,d.start=!1,d.end=!1,d.tmp=d.target.parent().parent(),e=d.target.outerHeight(),f=-(.8*d.velocity)*Math.exp(-d.elapsed/325)*8*-1,g=parseInt(d.target.css("marginTop").replace(/px/i,""),10),h=parseInt(g+f,10),i=d.pos-h,j=Math.round(i/e),k=j*d.tmp.data("amount")*d.direc,d.target.animate({marginTop:h},parseInt(1e4/d.velocity)+1e3,function(){b._offset(d.tmp.data("field"),k)}),a.preventDefault(),a.stopPropagation()))})},slidebox:function(){var b=this,c=this.options,d=this.drag;a(document).on(d.eMove,function(a){return d.move&&"slidebox"===c.mode?(d.end="touch"===a.type.substr(0,5)?a.originalEvent.changedTouches[0].pageX:a.pageX,d.target.css("marginLeft",d.pos+d.end-d.start+"px"),d.elapsed=Date.now()-d.time,d.velocity=.8*(100*(d.end-d.start)/(1+d.elapsed))+.2*d.velocity,a.preventDefault(),a.stopPropagation(),!1):void 0}),a(document).on(d.eEnd,function(a){var e,f,g,h,i,j,k;d.move&&"slidebox"===c.mode&&(d.velocity<15&&d.velocity>-15||!c.useKinetic?(d.move=!1,d.end!==!1&&(a.preventDefault(),a.stopPropagation(),d.tmp=d.target.find("div").first(),b._offset(d.target.data("rowtype"),(b.__("isRTL")?-1:1)*parseInt((d.start-d.end)/d.tmp.innerWidth(),10)*("i"===d.target.data("rowtype")?c.minuteStep:1))),d.start=!1,d.end=!1):(d.move=!1,d.start=!1,d.end=!1,d.tmp=d.target.find("div").first(),e=d.tmp.innerWidth(),f=-(.8*d.velocity)*Math.exp(-d.elapsed/325)*8*-1,g=parseInt(d.target.css("marginLeft").replace(/px/i,""),10),h=parseInt(g+f,10),i=d.pos-h,j=Math.round(i/e),k=j*("i"===d.target.data("rowtype")?c.minuteStep:1),d.target.animate({marginLeft:h},parseInt(1e4/d.velocity)+1e3,function(){b._offset(d.target.data("rowtype"),k)}),a.preventDefault(),a.stopPropagation()))})}},_offset:function(b,c,d){var e,f=this,g=this.options,h=this.theDate,i=!1,j=!1,k=32-f.theDate.copy([0],[0,0,32,13]).getDate(),l=!1;if(b=(b||"").toLowerCase(),l=a.inArray(b,["y","m","d","h","i","s"]),"undefined"==typeof d&&(d=!0),"a"===b||"undefined"!=typeof g.rolloverMode[b]&&g.rolloverMode[b]!==!0)switch(b){case"y":i=0;break;case"m":f._btwn(h.get(1)+c,-1,12)?i=1:(e=h.get(1)+c,j=0>e?[1,12+e]:[1,e%12]);break;case"d":f._btwn(h.get(2)+c,0,k+1)?i=2:(e=h.get(2)+c,j=1>e?[2,k+e]:[2,e%k]);break;case"h":f._btwn(h.get(3)+c,-1,24)?i=3:(e=h.get(3)+c,j=0>e?[3,24+e]:[3,e%24]);break;case"i":f._btwn(h.get(4)+c,-1,60)?i=4:(e=h.get(4)+c,j=0>e?[4,59+e]:[4,e%60]);break;case"s":f._btwn(h.get(5)+c,-1,60)&&(i=5);break;case"a":f._offset("h",12*(c>0?1:-1),!1)}else i=l;i!==!1?f.theDate.adj(i,c):f.theDate.setD(j[0],j[1]),d===!0&&f.refresh(),g.useImmediate&&f._t({method:"doset"}),f.calBackDate!==!1&&f._t({method:"displayChange",selectedDate:f.calBackDate,shownDate:f.theDate,thisChange:b,thisChangeAmount:c}),f._t({method:"offset",type:b,amount:c,newDate:f.theDate})},_startOffset:function(a){var b=this.options;return b.startOffsetYears!==!1&&a.adj(0,b.startOffsetYears),b.startOffsetMonths!==!1&&a.adj(1,b.startOffsetMonths),b.startOffsetDays!==!1&&a.adj(2,b.startOffsetDays),a},getTheDate:function(){return this.calBackDate!==!1?this.calBackDate:this.theDate},getLastDur:function(){return this.lastDuration},dateVisible:function(){return this.calDateVisible},setTheDate:function(a){"object"==typeof a?this.theDate=a:this.theDate=this._makeDate(a),this.refresh(),this._t({method:"doset"})},parseDate:function(a,b){var c,d=this;return d.fmtOver=a,c=d._makeDate(b),d.fmtOver=!1,c},callFormat:function(a,b,c){return"undefined"==typeof c&&(c=!1),this._formatter(a,b,c)},refresh:function(){var a=this,b=this.options;"undefined"==typeof a._build[b.mode]?a._build["default"].apply(a,[]):a._build[b.mode].apply(a,[]),a.__("useArabicIndic")===!0&&a._doIndic(),a.d.mainWrap.append(a.d.intHTML),a._t({method:"postrefresh"})},applyMinMax:function(a,b){var c,d,e,f,g=this,h=this.options,i=new this._date,j=864e5;c=g._pa([0,0,0],i),"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!0),b!==!0&&h.minDays!==!1||"undefined"==typeof g.d.input.attr("min")||(d=g.d.input.attr("min").split("-"),e=new g._date(d[0],d[1]-1,d[2],0,0,0,0),f=(e.getTime()-c.getTime())/j,h.minDays=parseInt(-1*f,10)),b!==!0&&h.maxDays!==!1||"undefined"==typeof g.d.input.attr("max")||(d=g.d.input.attr("max").split("-"),e=new g._date(d[0],d[1]-1,d[2],0,0,0,0),f=(e.getTime()-c.getTime())/j,h.maxDays=parseInt(f,10)),a===!0&&g._t({method:"refresh"})},_dur:function(b){var c=[b/864e5,b/36e5%24,b/6e4%60,b/1e3%60];return a.each(c,function(a,b){0>b?c[a]=0:c[a]=Math.floor(b)}),c},__:function(a){var b=this.options,c=b.lang[b.useLang],d=b[b.mode+"lang"],e="override"+a.charAt(0).toUpperCase()+a.slice(1);return"undefined"!=typeof b[e]?b[e]:"undefined"!=typeof c&&"undefined"!=typeof c[a]?c[a]:"undefined"!=typeof d&&"undefined"!=typeof d[a]?d[a]:"undefined"!=typeof b.lang["default"][a]?b.lang["default"][a]:"Err:NotFound"},__fmt:function(){var a=this,b=this.options;if("undefined"!=typeof a.fmtOver&&a.fmtOver!==!1)return a.fmtOver;switch(b.mode){case"timebox":case"timeflipbox":return a.__("timeOutput");case"durationbox":case"durationflipbox":return a.__("durationFormat");default:return a.__("dateFormat")}},_zPad:function(a,b){return"undefined"!=typeof b&&"-"===b?String(a):(10>a?"0":"")+String(a)},_dRep:function(a,b){var c,d,e=48,f=57,g=1584,h="";for(-1===b&&(e+=g,f+=g,g=-1584),d=0;d
=e&&f>=c?String.fromCharCode(c+g):String.fromCharCode(c);return h},_doIndic:function(){var b=this;b.d.intHTML.find("*").each(function(){a(this).children().length<1?a(this).text(b._dRep(a(this).text())):a(this).hasClass("ui-datebox-slideday")&&a(this).html(b._dRep(a(this).html()))}),b.d.intHTML.find("input").each(function(){a(this).val(b._dRep(a(this).val()))})},_n:function(a,b){return 0>a?b:a},_pa:function(a,b){return"boolean"==typeof b?new this._date(a[0],a[1],a[2],0,0,0,0):new this._date(b.get(0),b.get(1),b.get(2),a[0],a[1],a[2],0)},_btwn:function(a,b,c){return a>b&&c>a},_grabLabel:function(){var b,c,d=this,e=this.options,f=!1;return"undefined"==typeof e.overrideDialogLabel?(b=d.d.input.attr("placeholder"),c=d.d.input.attr("title"),"undefined"!=typeof b?b:"undefined"!=typeof c?c:(f=a(document).find("label[for='"+d.d.input.attr("id")+"']").text(),""===f?!1:f)):e.overrideDialogLabel},_t:function(a){this.d.input.trigger("datebox",a)},_spf:function(b,c){return a.isArray(c)||a.isPlainObject(c)?b.replace(/{(.+?)}/g,function(a,b){return c[b]}):b},_cal_gen:function(a,b,c,d,e){var f=0,g=0,h=1,i=1,j=[],k=[],l=!1;for(f=0;5>=f;f++)if(l===!1){for(k=[],g=0;6>=g;g++)0===f&&a>g?d===!0?k.push([b+(g-a)+1,e-1]):k.push(" "):f>3&&h>c?(d===!0?(k.push([i,e+1]),i++):k.push(" "),l=!0):(k.push([h,e]),h++,h>c&&(l=!0));j.push(k)}return j},_cal_check:function(b,c,d,e,f){var g,h=this,i=this.options,j=f.x,k=f.i,l=f.t,m=f.p,n=new this._date(c,d,e,12,0,0,0).getDay(),o=i.blackDatesRec,p=i.highDatesRec,q={ok:!0,iso:c+"-"+h._zPad(d+1)+"-"+h._zPad(e),theme:i.themeDate,force:!1,recok:!0,rectheme:!1};if(12===d&&(q.iso=c+1+"-01-"+h._zPad(e)),-1===d&&(q.iso=c-1+"-12-"+h._zPad(e)),q.comp=parseInt(q.iso.replace(/-/g,""),10),o!==!1)for(g=0;gq.comp||i.beforeToday&&l.comp()q.comp||a.isArray(i.blackDays)&&a.inArray(n,i.blackDays)>-1||a.isArray(i.blackDates)&&a.inArray(q.iso,i.blackDates)>-1)&&(q.ok=!1),a.isArray(i.whiteDates)&&a.inArray(q.iso,i.whiteDates)>-1&&(q.ok=!0),q.ok){if(p!==!1)for(g=0;g-1?q.theme=i.themeDateHighAlt:a.isArray(i.highDates)&&a.inArray(q.iso,i.highDates)>-1?q.theme=i.themeDateHigh:a.isArray(i.highDays)&&a.inArray(n,i.highDays)>-1?q.theme=i.themeDayHigh:a.isArray(i.highDatesRec)&&q.rectheme===!0&&(q.theme=i.themeDateHighRec):q.theme=i.themeDatePick}else q.theme=i.disabledState;return q},_cal_prev_next:function(b){var c=this,d=this.options,e="ui-datebox-";a(c._spf("",{"class":e+"gridplus"+(c.__("isRTL")?"-rtl":""),name:c._spf(d.s.cal.nextMonth,{text:c.__("nextMonth"),icon:d.calNextMonthIcon})})).prependTo(b).find("a").addClass(function(){switch(c.baseMode){case"jqm":return d.btnCls+d.themeDate+d.icnCls+d.calNextMonthIcon;case"bootstrap":case"bootstrap4":return d.btnCls+d.themeDate+" pull-"+(c.__("isRTL")?"left":"right");default:return null}}).on(d.clickEventAlt,function(a){return a.preventDefault(),a.stopPropagation(),c.calNext&&(c.calBackDate===!1&&(c.calBackDate=new Date(c.theDate.getTime())),c.theDate.getDate()>28&&c.theDate.setDate(1),c._offset("m",1)),!1}),a(c._spf("",{"class":e+"gridminus"+(c.__("isRTL")?"-rtl":""),name:c._spf(d.s.cal.prevMonth,{text:c.__("prevMonth"),icon:d.calPrevMonthIcon})})).prependTo(b).find("a").addClass(function(){switch(c.baseMode){case"jqm":return d.btnCls+d.themeDate+d.icnCls+d.calPrevMonthIcon;case"bootstrap":case"bootstrap4":return d.btnCls+d.themeDate+" pull-"+(c.__("isRTL")?"right":"left");default:return null}}).on(d.clickEventAlt,function(a){return a.preventDefault(),a.stopPropagation(),c.calPrev&&(c.calBackDate===!1&&(c.calBackDate=new Date(c.theDate.getTime())),c.theDate.getDate()>28&&c.theDate.setDate(1),c._offset("m",-1)),!1})},_cal_pickers:function(b,c,d){var e,f,g,h=this,i=this.options,j="ui-datebox-",k=a("").addClass("ui-datebox-cal-pickers");for(i.calNoHeader&&i.calUsePickersIcons&&k.addClass("ui-datebox-pickicon"),k.i=a("