PageSourceSearch

https://calvertcountymd.gov/-981222267.js

js calvertcountymd.gov collected 2026-09-24 19:46:29 UTC 63,943 bytes, 747 lines download raw bytes

1/*
2The following errors were found when attempting to minify this file:
3- Line 32: Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.
4- Line 135: Parse error. syntax error
5- Line 136: Parse error. syntax error
6- Line 139: Parse error. missing ) after argument list
7- Line 139: Parse error. syntax error
8- Line 158: Parse error. syntax error
9- Line 159: Parse error. syntax error
10- Line 163: Parse error. missing ) after argument list
11- Line 163: Parse error. syntax error
12- Line 372: Parse error. syntax error
13- Line 373: Parse error. syntax error
14- Line 410: Parse error. syntax error
15- Line 555: Parse error. syntax error
16- Line 556: Parse error. syntax error
17- Line 560: Parse error. syntax error
18- Line 578: Parse error. missing ) in parenthetical
19- Line 578: Parse error. missing ; before statement
20- Line 579: Parse error. missing ; before statement
21- Line 580: Parse error. syntax error
22- Line 581: Parse error. syntax error
23- Line 583: Parse error. syntax error
24- Line 585: Parse error. missing ; before statement
25- Line 595: Parse error. invalid return
26- Line 597: Parse error. invalid return
27- Line 641: Parse error. invalid return
28- Line 642: Parse error. syntax error
29- Line 644: Parse error. syntax error
30- Line 654: Parse error. syntax error
31- Line 659: Parse error. illegal character
32- Line 659: Parse error. missing } in compound statement
33- Line 659: Parse error. missing ; before statement
34- Line 659: Parse error. illegal character
35- Line 660: Parse error. syntax error
36- Line 661: Parse error. syntax error
37- Line 663: Parse error. invalid return
38- Line 663: Parse error. syntax error
39- Line 668: Parse error. invalid return
40- Line 668: Parse error. illegal character
41- Line 668: Parse error. missing } in compound statement
42- Line 668: Parse error. missing ; before statement
43- Line 668: Parse error. illegal character
44- Line 669: Parse error. syntax error
45- Line 670: Parse error. syntax error
46- Line 672: Parse error. invalid return
47- Line 672: Parse error. syntax error
48- Line 674: Parse error. TypeError: redeclaration of const formattedHour.
49- Line 675: Parse error. TypeError: redeclaration of const formattedMinute.
50- Line 676: Parse error. TypeError: redeclaration of const formattedPeriod.
51- Line 677: Parse error. invalid return
52- Line 677: Parse error. illegal character
53- Line 677: Parse error. missing } in compound statement
54- Line 677: Parse error. missing ; before statement
55- Line 677: Parse error. illegal character
56- Line 678: Parse error. syntax error
57- Line 679: Parse error. syntax error
58- Line 681: Parse error. invalid return
59- Line 683: Parse error. syntax error
60- Line 684: Parse error. syntax error
61*/
62/*!
63 * pickadate.js v3.6.4, 2019/05/25
64 * By Amsul, http://amsul.ca
65 * Hosted on http://amsul.github.io/pickadate.js
66 * Licensed under MIT
67 */
68(function(n){typeof define=="function"&&define.amd?define("picker",["jquery"],n):typeof exports=="object"?module.exports=n(require("jquery")):typeof window=="object"?window.Picker=n(jQuery):this.Picker=n(jQuery)})(function(n){function t(e,s,h,a){function g(){return t._.node("div",t._.node("div",t._.node("div",t._.node("div",v.component.nodes(y.open),w.box),w.wrap),w.frame),w.holder,'tabindex="-1"')}function rt(){b.data(s,v).addClass(w.input).val(b.data("value")?v.get("select",p.format):e.value).on("focus."+y.id+" click."+y.id,function(n){n.preventDefault();v.open()}).on("mousedown",function(){y.handlingOpen=!0;var t=function(){setTimeout(function(){n(document).off("mouseup",t);y.handlingOpen=!1},0)};n(document).on("mouseup",t)});if(!p.editable)b.on("keydown."+y.id,it);i(e,{haspopup:!0,readonly:!1,owns:e.id+"_root"})}function ut(){i(v.$root[0],"hidden",!0)}function nt(){v.$holder.on({keydown:it,"focus.toOpen":tt,blur:function(){b.removeClass(w.target)},focusin:function(n){v.$root.removeClass(w.focused);n.stopPropagation()},"mousedown click":function(t){var i=r(t,e);i!=v.$holder[0]&&(t.stopPropagation(),t.type!="mousedown"||n(i).is("input, select, textarea, button, option")||(t.preventDefault(),v.$holder.eq(0).focus()))}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var r=n(this),i=r.data(),u=r.hasClass(w.navDisabled)||r.hasClass(w.disabled),t=o();
68t=t&&(t.type||t.href?t:null);(u||t&&!n.contains(v.$root[0],t))&&v.$holder.eq(0).focus();!u&&i.nav?v.set("highlight",v.component.item.highlight,{nav:i.nav}):!u&&"pick"in i?(v.set("select",i.pick),p.closeOnSelect&&v.close(!0)):i.clear?(v.clear(),p.closeOnClear&&v.close(!0)):i.close&&v.close(!0)})}function ft(){var t;p.hiddenName===!0?(t=e.name,e.name=""):(t=[typeof p.hiddenPrefix=="string"?p.hiddenPrefix:"",typeof p.hiddenSuffix=="string"?p.hiddenSuffix:"_submit"],t=t[0]+e.name+t[1]);v._hidden=n("<input>",{type:"hidden",name:t,value:b.data("value")||e.value?v.get("select",p.formatSubmit):""})[0];b.on("change."+y.id,function(){v._hidden.value=e.value?v.get("select",p.formatSubmit):""})}function et(){if(k&&c)v.$holder.find("."+w.frame).one("transitionend",function(){v.$holder.eq(0).focus()});else setTimeout(function(){v.$holder.eq(0).focus()},0)}function tt(n){n.stopPropagation();b.addClass(w.target);v.$root.addClass(w.focused);v.open()}function it(n){var t=n.keyCode,i=/^(8|46)$/.test(t);if(t==27)return v.close(!0),!1;(t==32||i||!y.open&&v.component.key[t])&&(n.preventDefault(),n.stopPropagation(),i?v.clear().close():v.open())}if(!e)return t;var k=!1,y={id:e.id||"P"+Math.abs(~~(Math.random()*new Date)),handlingOpen:!1},p=h?n.extend(!0,{},h.defaults,a):a||{},w=n.extend({},t.klasses(),p.klass),b=n(e),d=function(){return this.start()},v=d.prototype={constructor:d,$node:b,start:function(){if(y&&y.start)return v;y.methods={};y.start=!0;y.open=!1;y.type=e.type;e.autofocus=e==o();e.readOnly=!p.editable;p.id=e.id=e.id||y.id;e.type!="text"&&(e.type="text");v.component=new h(v,p);v.$root=n('<div class="'+w.picker+'" id="'+e.id+'_root" />');ut();v.$holder=n(g()).appendTo(v.$root);nt();p.formatSubmit&&ft();rt();p.containerHidden?n(p.containerHidden).append(v._hidden):b.after(v._hidden);p.container?n(p.container).append(v.$root):b.after(v.$root);v.on({start:v.component.onStart,render:v.component.onRender,stop:v.component.onStop,open:v.component.onOpen,close:v.component.onClose,set:v.component.onSet}).on({start:p.onStart,render:p.onRender,stop:p.onStop,open:p.onOpen,close:p.onClose,set:p.onSet});return k=l(v.$holder[0]),e.autofocus&&v.open(),v.trigger("start").trigger("render")},render:function(t){return t?(v.$holder=n(g()),nt(),v.$root.html(v.$holder)):v.$root.find("."+w.box).html(v.component.nodes(y.open)),v.trigger("render")},stop:function(){return y.start?(v.close(),v._hidden&&v._hidden.parentNode.removeChild(v._hidden),v.$root.remove(),b.removeClass(w.input).removeData(s),setTimeout(function(){b.off("."+y.id)},0),e.type=y.type,e.readOnly=!1,v.trigger("stop"),y.methods={},y.start=!1,v):v},open:function(o){if(y.open)return v;if(b.addClass(w.active),setTimeout(function(){v.$root.addClass(w.opened);i(v.$root[0],"hidden",!1)},0),o!==!1){y.open=!0;k&&n("body").css("overflow","hidden").css("padding-right","+="+f());et();u.on("click."+y.id+" focusin."+y.id,function(n){if(!y.handlingOpen){var t=r(n,e);n.isSimulated||t==e||t==document||n.which==3||v.close(t===v.$holder[0])}}).on("keydown."+y.id,function(i){var u=i.keyCode,f=v.component.key[u],o=r(i,e);u==27?v.close(!0):o==v.$holder[0]&&(f||u==13)?(i.preventDefault(),f?t._.trigger(v.component.key.go,v,[t._.trigger(f)]):v.$root.find("."+w.highlighted).hasClass(w.disabled)||(v.set("select",v.component.item.highlight),p.closeOnSelect&&v.close(!0))):n.contains(v.$root[0],o)&&u==13&&(i.preventDefault(),o.click())})}return v.trigger("open")},close:function(t){return(t&&(p.editable?e.focus():(v.$holder.off("focus.toOpen").focus(),setTimeout(function(){v.$holder.on("focus.toOpen",tt)},0))),b.removeClass(w.active),setTimeout(function(){v.$root.removeClass(w.opened+" "+w.focused);i(v.$root[0],"hidden",!0)},0),!y.open)?v:(y.open=!1,k&&n("body").css("overflow","").css("padding-right","-="+f()),u.off("."+y.id),v.trigger("close"))},clear:function(n){return v.set("clear",null,n)},set:function(t,i,r){var u,f,o=n.isPlainObject(t),e=o?t:{};if(r=o&&n.isPlainObject(i)?i:r||{},t){o||(e[t]=i);for(u in e)f=e[u],u in v.component.item&&(f===undefined&&(f=null),v.component.set(u,f,r)),(u=="select"||u=="clear")&&p.updateInput&&b.val(u=="clear"?"":v.get(u,p.format)).trigger("change");v.render()}return r.muted?v:v.trigger("set",e)}
68,get:function(n,i){if(n=n||"value",y[n]!=null)return y[n];if(n=="valueSubmit"){if(v._hidden)return v._hidden.value;n="value"}if(n=="value")return e.value;if(n in v.component.item){if(typeof i=="string"){var r=v.component.get(n);return r?t._.trigger(v.component.formats.toString,v.component,[i,r]):""}return v.component.get(n)}},on:function(t,i,r){var u,e,o=n.isPlainObject(t),f=o?t:{};if(t){o||(f[t]=i);for(u in f)e=f[u],r&&(u="_"+u),y.methods[u]=y.methods[u]||[],y.methods[u].push(e)}return v},off:function(){var n,t,i=arguments;for(n=0,namesCount=i.length;n<namesCount;n+=1)t=i[n],t in y.methods&&delete y.methods[t];return v},trigger:function(n,i){var r=function(n){var r=y.methods[n];r&&r.map(function(n){t._.trigger(n,v,[i])})};return r("_"+n),r(n),v}};return new d}function l(n){var t,i="position";return n.currentStyle?t=n.currentStyle[i]:window.getComputedStyle&&(t=getComputedStyle(n)[i]),t=="fixed"}function f(){var t,i,r,u;return h.height()<=s.height()?0:(t=n('<div style="visibility:hidden;width:100px" />').appendTo("body"),i=t[0].offsetWidth,t.css("overflow","scroll"),r=n('<div style="width:100%" />').appendTo(t),u=r[0].offsetWidth,t.remove(),i-u)}function r(n,t){var i=[];return(n.path&&(i=n.path),n.originalEvent&&n.originalEvent.path&&(i=n.originalEvent.path),i&&i.length>0)?t&&i.indexOf(t)>=0?t:i[0]:n.target}function i(t,i,r){if(n.isPlainObject(i))for(var u in i)e(t,u,i[u]);else e(t,i,r)}function e(n,t,i){n.setAttribute((t=="role"?"":"aria-")+t,i)}function a(t,i){var r,u,f;n.isPlainObject(t)||(t={attribute:i});i="";for(r in t)u=(r=="role"?"":"aria-")+r,f=t[r],i+=f==null?"":u+'="'+t[r]+'"';return i}function o(){try{return document.activeElement}catch(n){}}var s=n(window),u=n(document),h=n(document.documentElement),c=document.documentElement.style.transition!=null;return t.klasses=function(n){return n=n||"picker",{picker:n,opened:n+"--opened",focused:n+"--focused",input:n+"__input",active:n+"__input--active",target:n+"__input--target",holder:n+"__holder",frame:n+"__frame",wrap:n+"__wrap",box:n+"__box"}},t._={group:function(n){for(var i,u="",r=t._.trigger(n.min,n);r<=t._.trigger(n.max,n,[r]);r+=n.i)i=t._.trigger(n.item,n,[r]),u+=t._.node(n.node,i[0],i[1],i[2]);return u},node:function(t,i,r,u){return i?(i=n.isArray(i)?i.join(""):i,r=r?' class="'+r+'"':"",u=u?" "+u:"","<"+t+r+u+">"+i+"<\/"+t+">"):""},lead:function(n){return(n<10?"0":"")+n},trigger:function(n,t,i){return typeof n=="function"?n.apply(t,i||[]):n},digits:function(n){return/\d/.test(n[1])?2:1},isDate:function(n){return{}.toString.call(n).indexOf("Date")>-1&&this.isInteger(n.getDate())},isInteger:function(n){return{}.toString.call(n).indexOf("Number")>-1&&n%1==0},ariaAttr:a},t.extend=function(i,r){n.fn[i]=function(u,f){var e=this.data(i);return u=="picker"?e:e&&typeof u=="string"?t._.trigger(e[u],e,[f]):this.each(function(){var f=n(this);f.data(i)||new t(this,i,r,u)})};n.fn[i].defaults=r.defaults},t});
69/*!
70 * Date picker for pickadate.js v3.6.4
71 * http://amsul.github.io/pickadate.js/date.htm
72 */
73(function(n){typeof define=="function"&&define.amd?define(["./picker","jquery"],n):typeof exports=="object"?module.exports=n(require("./picker.js"),require("jquery")):n(Picker,jQuery)})(function(n,t){function r(n,t){var i=this,r=n.$node[0],o=r.value,u=n.$node.data("value"),f=u||o,s=u?t.formatSubmit:t.format,e=function(){return r.currentStyle?r.currentStyle.direction=="rtl":getComputedStyle(n.$root[0]).direction=="rtl"};i.settings=t;i.$node=n.$node;i.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"};i.item={};i.item.clear=null;i.item.disable=(t.disable||[]).slice(0);i.item.enable=-function(n){return n[0]===!0?n.shift():-1}(i.item.disable);i.set("min",t.min).set("max",t.max).set("now");f?i.set("select",f,{format:s,defaultValue:!0}):i.set("select",null).set("highlight",i.item.now);i.key={40:7,38:-7,39:function(){return e()?-1:1},37:function(){return e()?1:-1},go:function(n){var t=i.item.highlight,r=new Date(t.year,t.month,t.date+n);i.set("highlight",r,{interval:n});this.render()}};n.on("render",function(){n.$root.find("."+t.klass.selectMonth).on("change",function(){var i=this.value;i&&(n.set("highlight",[n.get("view").year,i,n.get("highlight").date]),n.$root.find("."+t.klass.selectMonth).trigger("focus"))});n.$root.find("."+t.klass.selectYear).on("change",function(){var i=this.value;i&&(n.set("highlight",[i,n.get("view").month,n.get("highlight").date]),n.$root.find("."+t.klass.selectYear).trigger("focus"))})},1).on("open",function(){var r="";i.disabled(i.get("now"))&&(r=":not(."+t.klass.buttonToday+")");n.$root.find("button"+r+", select").attr("disabled",!1)},1).on("close",function(){n.$root.find("button, select").attr("disabled",!0)},1)}var u=7,f=6,i=n._;r.prototype.set=function(n,t,i){var r=this,u=r.item;return t===null?(n=="clear"&&(n="select"),u[n]=t,r):(u[n=="enable"?"disable":n=="flip"?"enable":n]=r.queue[n].split(" ").map(function(u){return t=r[u](n,t,i)}).pop(),n=="select"?r.set("highlight",u.select,i):n=="highlight"?r.set("view",u.highlight,i):n.match(/^(flip|min|max|disable|enable)$/)&&(u.select&&r.disabled(u.select)&&r.set("select",u.select,i),u.highlight&&r.disabled(u.highlight)&&r.set("highlight",u.highlight,i)),r)};r.prototype.get=function(n){return this.item[n]};r.prototype.create=function(n,r,u){var f,e=this;return r=r===undefined?n:r,r==-Infinity||r==Infinity?f=r:t.isPlainObject(r)&&i.isInteger(r.pick)?r=r.obj:t.isArray(r)?(r=new Date(r[0],r[1],r[2]),r=i.isDate(r)?r:e.create().obj):r=i.isInteger(r)||i.isDate(r)?e.normalize(new Date(r),u):e.now(n,r,u),{year:f||r.getFullYear(),month:f||r.getMonth(),date:f||r.getDate(),day:f||r.getDay(),obj:f||r,pick:f||r.getTime()}};r.prototype.createRange=function(n,r){var f=this,u=function(n){return n===!0||t.isArray(n)||i.isDate(n)?f.create(n):n};return i.isInteger(n)||(n=u(n)),i.isInteger(r)||(r=u(r)),i.isInteger(n)&&t.isPlainObject(r)?n=[r.year,r.month,r.date+n]:i.isInteger(r)&&t.isPlainObject(n)&&(r=[n.year,n.month,n.date+r]),{from:u(n),to:u(r)}};r.prototype.withinRange=function(n,t){return n=this.createRange(n.from,n.to),t.pick>=n.from.pick&&t.pick<=n.to.pick};r.prototype.overlapRanges=function(n,t){var i=this;return n=i.createRange(n.from,n.to),t=i.createRange(t.from,t.to),i.withinRange(n,t.from)||i.withinRange(n,t.to)||i.withinRange(t,n.from)||i.withinRange(t,n.to)};r.prototype.now=function(n,t,i){return t=new Date,i&&i.rel&&t.setDate(t.getDate()+i.rel),this.normalize(t,i)};r.prototype.navigate=function(n,i,r){var s,f,u,e,c=t.isArray(i),h=t.isPlainObject(i),o=this.item.view;if(c||h){for(h?(f=i.year,u=i.month,e=i.date):(f=+i[0],u=+i[1],e=+i[2]),r&&r.nav&&o&&o.month!==u&&(f=o.year,u=o.month),s=new Date(f,u+(r&&r.nav?r.nav:0),1),f=s.getFullYear(),u=s.getMonth();new Date(f,u,e).getMonth()!==u;)e-=1;i=[f,u,e]}return i};r.prototype.normalize=function(n){return n.setHours(0,0,0,0),n};r.prototype.measure=function(n,t){var r=this;return i.isInteger(t)?t=r.now(n,t,{rel:t}):t?typeof t=="string"&&(t=r.parse(n,t)):t=n=="min"?-Infinity:Infinity,t};r.prototype.viewset=function(n,t){return this.create([t.year,t.month,1])};r.prototype.validate=function(n,r,u){var f=this,c=r,e=u&&u.interval?u.interval:1,h=f.item.enable===-1,l,a,o=f.item.min,s=f.item.max,v,y,p=h&&f.item.disable.filter(function(n){if(t.isArray(n)){var u=f.create(n).pick;u<r.pick?l=!0:u>r.pick&&(a=!0)}return i.isInteger(n)}).length;if((!u||!u.nav&&!u.defaultValue)&&(!h&&f.disabled(r)||h&&f.disabled(r)&&(p||l||a)||!h&&(r.pick<=o.pick||r.pick>=s.pick)))for(h&&!p&&(!a&&e>0||!l&&e<0)&&(e*=-1);f.disabled(r);
73){if(Math.abs(e)>1&&(r.month<c.month||r.month>c.month)&&(r=c,e=e>0?1:-1),r.pick<=o.pick?(v=!0,e=1,r=f.create([o.year,o.month,o.date+(r.pick===o.pick?0:-1)])):r.pick>=s.pick&&(y=!0,e=-1,r=f.create([s.year,s.month,s.date+(r.pick===s.pick?0:1)])),v&&y)break;r=f.create([r.year,r.month,r.date+e])}return r};r.prototype.disabled=function(n){var r=this,u=r.item.disable.filter(function(u){return i.isInteger(u)?n.day===(r.settings.firstDay?u:u-1)%7:t.isArray(u)||i.isDate(u)?n.pick===r.create(u).pick:t.isPlainObject(u)?r.withinRange(u,n):void 0});return u=u.length&&!u.filter(function(n){return t.isArray(n)&&n[3]=="inverted"||t.isPlainObject(n)&&n.inverted}).length,r.item.enable===-1?!u:u||n.pick<r.item.min.pick||n.pick>r.item.max.pick};r.prototype.parse=function(n,t,r){var f=this,u={};return!t||typeof t!="string"?t:(r&&r.format||(r=r||{},r.format=f.settings.format),f.formats.toArray(r.format).map(function(n){var r=f.formats[n],e=r?i.trigger(r,f,[t,u]):n.replace(/^!/,"").length;r&&(u[n]=t.substr(0,e));t=t.substr(e)}),[u.yyyy||u.yy,+(u.mm||u.m)-1,u.dd||u.d])};r.prototype.formats=function(){function n(n,t,i){var r=n.match(/[^\x00-\x7F]+|[a-zA-Z0-9_\u0080-\u00FF]+/)[0];return i.mm||i.m||(i.m=t.indexOf(r)+1),r.length}function t(n){return n.match(/[a-zA-Z0-9_\u0080-\u00FF]+/)[0].length}return{d:function(n,t){return n?i.digits(n):t.date},dd:function(n,t){return n?2:i.lead(t.date)},ddd:function(n,i){return n?t(n):this.settings.weekdaysShort[i.day]},dddd:function(n,i){return n?t(n):this.settings.weekdaysFull[i.day]},m:function(n,t){return n?i.digits(n):t.month+1},mm:function(n,t){return n?2:i.lead(t.month+1)},mmm:function(t,i){var r=this.settings.monthsShort;return t?n(t,r,i):r[i.month]},mmmm:function(t,i){var r=this.settings.monthsFull;return t?n(t,r,i):r[i.month]},yy:function(n,t){return n?2:(""+t.year).slice(2)},yyyy:function(n,t){return n?4:t.year},toArray:function(n){return n.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(n,t){var r=this;return r.formats.toArray(n).map(function(n){return i.trigger(r.formats[n],r,[0,t])||n.replace(/^!/,"")}).join("")}}}();r.prototype.isDateExact=function(n,r){var u=this;return i.isInteger(n)&&i.isInteger(r)||typeof n=="boolean"&&typeof r=="boolean"?n===r:(i.isDate(n)||t.isArray(n))&&(i.isDate(r)||t.isArray(r))?u.create(n).pick===u.create(r).pick:t.isPlainObject(n)&&t.isPlainObject(r)?u.isDateExact(n.from,r.from)&&u.isDateExact(n.to,r.to):!1};r.prototype.isDateOverlap=function(n,r){var u=this,f=u.settings.firstDay?1:0;return i.isInteger(n)&&(i.isDate(r)||t.isArray(r))?(n=n%7+f,n===u.create(r).day+1):i.isInteger(r)&&(i.isDate(n)||t.isArray(n))?(r=r%7+f,r===u.create(n).day+1):t.isPlainObject(n)&&t.isPlainObject(r)?u.overlapRanges(n,r):!1};r.prototype.flipEnable=function(n){var t=this.item;t.enable=n||(t.enable==-1?1:-1)};r.prototype.deactivate=function(n,r){var f=this,u=f.item.disable.slice(0);return r=="flip"?f.flipEnable():r===!1?(f.flipEnable(1),u=[]):r===!0?(f.flipEnable(-1),u=[]):r.map(function(n){for(var e,r=0;r<u.length;r+=1)if(f.isDateExact(n,u[r])){e=!0;break}e||(i.isInteger(n)||i.isDate(n)||t.isArray(n)||t.isPlainObject(n)&&n.from&&n.to)&&u.push(n)}),u};r.prototype.activate=function(n,r){var f=this,u=f.item.disable,e=u.length;return r=="flip"?f.flipEnable():r===!0?(f.flipEnable(1),u=[]):r===!1?(f.flipEnable(-1),u=[]):r.map(function(n){for(var o,s,h,r=0;r<e;r+=1)if(s=u[r],f.isDateExact(s,n)){o=u[r]=null;h=!0;break}else if(f.isDateOverlap(s,n)){t.isPlainObject(n)?(n.inverted=!0,o=n):t.isArray(n)?(o=n,o[3]||o.push("inverted")):i.isDate(n)&&(o=[n.getFullYear(),n.getMonth(),n.getDate(),"inverted"]);break}if(o)for(r=0;r<e;r+=1)if(f.isDateExact(u[r],n)){u[r]=null;break}if(h)for(r=0;r<e;r+=1)if(f.isDateOverlap(u[r],n)){u[r]=null;break}o&&u.push(o)}),u.filter(function(n){return n!=null})};r.prototype.nodes=function(n){var r=this,t=r.settings,o=r.item,c=o.now,l=o.select,a=o.highlight,e=o.view,w=o.disable,s=o.min,h=o.max,b=function(n,r){return t.firstDay&&(n.push(n.shift()),r.push(r.shift())),i.node("thead",i.node("tr",i.group({min:0,max:u-1,i:1,node:"th",item:function(i){return[n[i],t.klass.weekdays,'scope=col title="'+r[i]+'"']}})))}((t.showWeekdaysFull?t.weekdaysFull:t.weekdaysShort).slice(0),t.weekdaysFull.slice(0)),v=function(n){return i.node("div"," ",t.klass["nav"+(n?"Next":"Prev")]+(n&&e.year>=h.year&&e.month>=h.month||!n&&e.year<=s.year&&e.month<=s.month?" "+t.klass.navDisabled:""),"data-nav="+(n||-1)+' tabindex="0" '+i.ariaAttr({role:"button",controls:r.$node[0].id+"_table"})+' title="'+(n?t.labelMonthNext:t.labelMonthPrev)+'"')},y=function(){var u=t.showMonthsShort?t.monthsShort:t.monthsFull;return t.selectMonths?i.node("select",i.group({min:0,max:11,i:1,node:"option",item:function(n){return[u[n],0,"value="+n+(e.month==n?" selected":"")+(e.year==s.year&&n<s.month||e.year==h.year&&n>h.month?" disabled":"")]}}),t.klass.selectMonth,(n?"":"disabled")+" "+i.ariaAttr({controls:r.$node[0].id+"_table"})+' title="'+t.labelMonthSelect+'"'):i.node("div",u[e.month],t.klass.month)},p=function(){var o=e.year,l=t.selectYears===!0?5:~~(t.selectYears/2),v,y;if(l){var c=s.year,a=h.year,u=o-l,f=o+l;return c>u&&(f+=c-u,u=c),a<f&&(v=u-c,y=f-a,u-=v>y?y:v,f=a),i.node("select",i.group({min:u,max:f,i:1,node:"option",item:function(n){return[n,0,"value="+n+(o==n?" selected":"")]}}),t.klass.selectYear,(n?"":"disabled")+" "+i.ariaAttr({controls:r.$node[0].id+"_table"})+' title="'+t.labelYearSelect+'"')}return i.node("div",o,t.klass.year)};return i.node("div",(t.selectYears?p()+y():y()+p())+v()+v(1),t.klass.header)+i.node("table",b+i.node("tbody",i.group({min:0,max:f-1,i:1,node:"tr",item:function(n){var f=t.firstDay&&r.create([e.year,e.month,1]).day===0?-7:0;return[i.group({min:u*n-e.day+f+1,max:function(){return this.min+u-1},i:1,node:"td",item:function(n){n=r.create([e.year,e.month,n+(t.firstDay?1:0)]);var u=l&&l.pick==n.pick,f=a&&a.pick==n.pick,o=w&&r.disabled(n)||n.pick<s.pick||n.pick>h.pick,v=i.trigger(r.formats.toString,r,[t.format,n]),y=t.id+"_"+n.pick;return[i.node("div",n.date,function(i){return i.push(e.month==n.month?t.klass.infocus:t.klass.outfocus),c.pick==n.pick&&i.push(t.klass.now),u&&i.push(t.klass.selected),f&&i.push(t.klass.highlighted),o&&i.push(t.klass.disabled),i.join(" ")}([t.klass.day]),"data-pick="+n.pick+" id="+y+' tabindex="0" '+i.ariaAttr({role:"gridcell",label:v,selected:u&&r.$node.val()===v?!0:null,activedescendant:f?n.pick:null,disabled:o?!0:null})),""]}})]}})),t.klass.table,'id="'+r.$node[0].id+'_table" '+i.ariaAttr({role:"grid",controls:r.$node[0].id,readonly:!0}))+i.node("div",i.node("button",t.today,t.klass.buttonToday,"type=button data-
73pick="+c.pick+(n&&!r.disabled(c)?"":" disabled")+" "+i.ariaAttr({controls:r.$node[0].id}))+i.node("button",t.clear,t.klass.buttonClear,"type=button data-clear=1"+(n?"":" disabled")+" "+i.ariaAttr({controls:r.$node[0].id}))+i.node("button",t.close,t.klass.buttonClose,"type=button data-close=true "+(n?"":" disabled")+" "+i.ariaAttr({controls:r.$node[0].id})),t.klass.footer)};r.defaults=function(n){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["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"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,updateInput:!0,format:"d mmmm, yyyy",klass:{table:n+"table",header:n+"header",navPrev:n+"nav--prev",navNext:n+"nav--next",navDisabled:n+"nav--disabled",month:n+"month",year:n+"year",selectMonth:n+"select--month",selectYear:n+"select--year",weekdays:n+"weekday",day:n+"day",disabled:n+"day--disabled",selected:n+"day--selected",highlighted:n+"day--highlighted",now:n+"day--today",infocus:n+"day--infocus",outfocus:n+"day--outfocus",footer:n+"footer",buttonClear:n+"button--clear",buttonToday:n+"button--today",buttonClose:n+"button--close"}}}(n.klasses().picker+"__");n.extend("pickadate",r)});
74/*!
75 * Time picker for pickadate.js v3.6.4
76 * http://amsul.github.io/pickadate.js/time.htm
77 */
78(function(n){typeof define=="function"&&define.amd?define(["./picker","jquery"],n):typeof exports=="object"?module.exports=n(require("./picker.js"),require("jquery")):n(Picker,jQuery)})(function(n,t){function r(n,t){var i=this,f=n.$node[0].value,r=n.$node.data("value"),u=r||f,e=r?t.formatSubmit:t.format;i.settings=t;i.$node=n.$node;i.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"};i.item={};i.item.clear=null;i.item.interval=t.interval||30;i.item.disable=(t.disable||[]).slice(0);i.item.enable=-function(n){return n[0]===!0?n.shift():-1}(i.item.disable);i.set("min",t.min).set("max",t.max).set("now");u?i.set("select",u,{format:e}):i.set("select",null).set("highlight",i.item.now);i.key={40:1,38:-1,39:1,37:-1,go:function(n){i.set("highlight",i.item.highlight.pick+n*i.item.interval,{interval:n*i.item.interval});this.render()}};n.on("render",function(){var i=n.$root.children(),r=i.find("."+t.klass.viewset),u=function(n){return["webkit","moz","ms","o",""].map(function(t){return(t?"-"+t+"-":"")+n})},f=function(n,t){u("transform").map(function(i){n.css(i,t)});u("transition").map(function(i){n.css(i,t)})};r.length&&(f(i,"none"),i[0].scrollTop=~~r.position().top-r[0].clientHeight*2,f(i,""))},1).on("open",function(){n.$root.find("button").attr("disabled",!1)},1).on("close",function(){n.$root.find("button").attr("disabled",!0)},1)}var e=24,u=60,o=12,f=e*u,i=n._;r.prototype.set=function(n,t,i){var r=this,u=r.item;return t===null?(n=="clear"&&(n="select"),u[n]=t,r):(u[n=="enable"?"disable":n=="flip"?"enable":n]=r.queue[n].split(" ").map(function(u){return t=r[u](n,t,i)}).pop(),n=="select"?r.set("highlight",u.select,i):n=="highlight"?r.set("view",u.highlight,i):n=="interval"?r.set("min",u.min,i).set("max",u.max,i):n.match(/^(flip|min|max|disable|enable)$/)&&(u.select&&r.disabled(u.select)&&r.set("select",t,i),u.highlight&&r.disabled(u.highlight)&&r.set("highlight",t,i),n=="min"&&r.set("max",u.max,i)),r)};r.prototype.get=function(n){return this.item[n]};r.prototype.create=function(n,r,o){var s=this;return r=r===undefined?n:r,i.isDate(r)&&(r=[r.getHours(),r.getMinutes()]),t.isPlainObject(r)&&i.isInteger(r.pick)?r=r.pick:t.isArray(r)?r=+r[0]*u+ +r[1]:i.isInteger(r)||(r=s.now(n,r,o)),n=="max"&&r<s.item.min.pick&&(r+=f),n!="min"&&n!="max"&&(r-s.item.min.pick)%s.item.interval!=0&&(r+=s.item.interval),r=s.normalize(n,r,o),{hour:~~(e+r/u)%e,mins:(u+r%u)%u,time:(f+r)%f,pick:r%f}};r.prototype.createRange=function(n,r){var f=this,u=function(n){return n===!0||t.isArray(n)||i.isDate(n)?f.create(n):n};return i.isInteger(n)||(n=u(n)),i.isInteger(r)||(r=u(r)),i.isInteger(n)&&t.isPlainObject(r)?n=[r.hour,r.mins+n*f.settings.interval]:i.isInteger(r)&&t.isPlainObject(n)&&(r=[n.hour,n.mins+r*f.settings.interval]),{from:u(n),to:u(r)}};r.prototype.withinRange=function(n,t){return n=this.createRange(n.from,n.to),t.pick>=n.from.pick&&t.pick<=n.to.pick};r.prototype.overlapRanges=function(n,t){var i=this;return n=i.createRange(n.from,n.to),t=i.createRange(t.from,t.to),i.withinRange(n,t.from)||i.withinRange(n,t.to)||i.withinRange(t,n.from)||i.withinRange(t,n.to)};r.prototype.now=function(n,t){var f=this.item.interval,o=new Date,r=o.getHours()*u+o.getMinutes(),s=i.isInteger(t),e;return r-=r%f,e=t<0&&f*t+r<=-f,r+=n=="min"&&e?0:f,s&&(r+=f*(e&&n!="max"?t+1:t)),r};r.prototype.normalize=function(n,t){var i=this.item.interval,r=this.item.min&&this.item.min.pick||0;return t-(n=="min"?0:(t-r)%i)};r.prototype.measure=function(n,r,f){var o=this;return r||(r=n=="min"?[0,0]:[e-1,u-1]),typeof r=="string"?r=o.parse(n,r):r===!0||i.isInteger(r)?r=o.now(n,r,f):t.isPlainObject(r)&&i.isInteger(r.pick)&&(r=o.normalize(n,r.pick,f)),r};r.prototype.validate=function(n,t,i){var r=this,u=i&&i.interval?i.interval:r.item.interval;return r.disabled(t)&&(t=r.shift(t,u)),t=r.scope(t),r.disabled(t)&&(t=r.shift(t,u*-1)),t};r.prototype.disabled=function(n){var r=this,u=r.item.disable.filter(function(u){return i.isInteger(u)?n.hour==u:t.isArray(u)||i.isDate(u)?n.pick==r.create(u).pick:t.isPlainObject(u)?r.withinRange(u,n):void 0});return u=u.length&&!u.filter(function(n){return t.isArray(n)&&n[2]=="inverted"||t.isPlainObject(n)&&n.inverted}).length,r.item.enable===-1?!u:u||n.pick<r.item.min.pick||n.pick>r.item.max.pick};r.prototype.shift=function(n,t){var i=this,r=i.item.min.pick,u=i.item.max.pick;for(t=t||i.item.interval;i.disabled(n);)if(n=i.create(n.pick+=t),n.pick<=r||n.pick>=u)break;return n};r.prototype.scope=function(n){var t=this.item.min.pick,i=this.item.max.pick;return this.create(n.pick>i?i:n.pick<t?t:n)};r.prototype.parse=function(n,t,r){var s,c,l,f,o,h=this,e={};if(!t||typeof t!="string")return t;r&&r.format||(r=r||{},r.format=h.settings.format);h.formats.toArray(r.format).map(function(n){var r,u=h.formats[n],f=u?i.trigger(u,h,[t,e]):n.replace(/^!/,"").length;u&&(r=t.substr(0,f),e[n]=r.match(/^\d+$/)?+r:r);t=t.substr(f)});for(f in e)o=e[f],i.isInteger(o)?f.match(/^(h|hh)$/i)?(s=o,(f=="h"||f=="hh")&&(s%=12)):f=="i"&&(c=o):f.match(/^a$/i)&&o.match(/^p/i)&&("h"in e||"hh"in e)&&(l=!0);return(l?s+12:s)*u+c};r.prototype.formats={h:function(n,t){return n?i.digits(n):t.hour%o||o},hh:function(n,t){return n?2:i.lead(t.hour%o||o)},H:function(n,t){return n?i.digits(n):""+t.hour%24},HH:function(n,t){return n?i.digits(n):i.lead(t.hour%24)},i:function(n,t){return n?2:i.lead(t.mins)},a:function(n,t){return n?4:f/2>t.time%f?"a.m.":"p.m."},A:function(n,t){return n?2:f/2>t.time%f?"AM":"PM"},toArray:function(n){return n.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(n,t){var r=this;return r.formats.toArray(n).map(function(n){return i.trigger(r.formats[n],r,[0,t])||n.replace(/^!/,"")}).join("")}};r.prototype.isTimeExact=function(n,r){var u=this;return i.isInteger(n)&&i.isInteger(r)||typeof n=="boolean"&&typeof r=="boolean"?n===r:(i.isDate(n)||t.isArray(n))&&(i.isDate(r)||t.isArray(r))?u.create(n).pick===u.create(r).pick:t.isPlainObject(n)&&t.isPlainObject(r)?u.isTimeExact(n.from,r.from)&&u.isTimeExact(n.to,r.to):!1};r.prototype.isTimeOverlap=function(n,r){var u=this;return i.isInteger(n)&&(i.isDate(r)||t.isArray(r))?n===u.create(r).hour:i.isInteger(r)&&(i.isDate(n)||t.isArray(n))?r===u.create(n).hour:t.isPlainObject(n)&&t.isPlainObject(r)?u.overlapRanges(n,r):!1}
78;r.prototype.flipEnable=function(n){var t=this.item;t.enable=n||(t.enable==-1?1:-1)};r.prototype.deactivate=function(n,r){var f=this,u=f.item.disable.slice(0);return r=="flip"?f.flipEnable():r===!1?(f.flipEnable(1),u=[]):r===!0?(f.flipEnable(-1),u=[]):r.map(function(n){for(var e,r=0;r<u.length;r+=1)if(f.isTimeExact(n,u[r])){e=!0;break}e||(i.isInteger(n)||i.isDate(n)||t.isArray(n)||t.isPlainObject(n)&&n.from&&n.to)&&u.push(n)}),u};r.prototype.activate=function(n,r){var f=this,u=f.item.disable,e=u.length;return r=="flip"?f.flipEnable():r===!0?(f.flipEnable(1),u=[]):r===!1?(f.flipEnable(-1),u=[]):r.map(function(n){for(var o,s,h,r=0;r<e;r+=1)if(s=u[r],f.isTimeExact(s,n)){o=u[r]=null;h=!0;break}else if(f.isTimeOverlap(s,n)){t.isPlainObject(n)?(n.inverted=!0,o=n):t.isArray(n)?(o=n,o[2]||o.push("inverted")):i.isDate(n)&&(o=[n.getFullYear(),n.getMonth(),n.getDate(),"inverted"]);break}if(o)for(r=0;r<e;r+=1)if(f.isTimeExact(u[r],n)){u[r]=null;break}if(h)for(r=0;r<e;r+=1)if(f.isTimeOverlap(u[r],n)){u[r]=null;break}o&&u.push(o)}),u.filter(function(n){return n!=null})};r.prototype.i=function(n,t){return i.isInteger(t)&&t>0?t:this.item.interval};r.prototype.nodes=function(n){var t=this,r=t.settings,u=t.item.select,f=t.item.highlight,e=t.item.view,o=t.item.disable;return i.node("ul",i.group({min:t.item.min.pick,max:t.item.max.pick,i:t.item.interval,node:"li",item:function(n){n=t.create(n);var s=n.pick,h=u&&u.pick==s,c=f&&f.pick==s,l=o&&t.disabled(n),a=i.trigger(t.formats.toString,t,[r.format,n]);return[i.trigger(t.formats.toString,t,[i.trigger(r.formatLabel,t,[n])||r.format,n]),function(n){return h&&n.push(r.klass.selected),c&&n.push(r.klass.highlighted),e&&e.pick==s&&n.push(r.klass.viewset),l&&n.push(r.klass.disabled),n.join(" ")}([r.klass.listItem]),"data-pick="+n.pick+" "+i.ariaAttr({role:"option",label:a,selected:h&&t.$node.val()===a?!0:null,activedescendant:c?!0:null,disabled:l?!0:null})]}})+i.node("li",i.node("button",r.clear,r.klass.buttonClear,"type=button data-clear=1"+(n?"":" disabled")+" "+i.ariaAttr({controls:t.$node[0].id})),"",i.ariaAttr({role:"presentation"})),r.klass.list,i.ariaAttr({role:"listbox",controls:t.$node[0].id}))};r.defaults=function(n){return{clear:"Clear",format:"h:i A",interval:30,closeOnSelect:!0,closeOnClear:!0,updateInput:!0,klass:{picker:n+" "+n+"--time",holder:n+"__holder",list:n+"__list",listItem:n+"__list-item",disabled:n+"__list-item--disabled",selected:n+"__list-item--selected",highlighted:n+"__list-item--highlighted",viewset:n+"__list-item--viewset",now:n+"__list-item--now",buttonClear:n+"__button--clear"}}}(n.klasses().picker);n.extend("pickatime",r)});
79/**
80    cp.datepicker.js provides an JavaScript Date picker control.
81 */
82var cp = cp || {};
83
84cp.datetimepicker = (function ($) {
85    var keyCodes = {
86        tab: 9,
87        downArrow: 40
88    };
89
90    // These are the publicly-accessible methods
91    if (!$) { return; }
92    return {
93        createTimePicker: createTimePicker,
94        createDatePicker: createDatePicker,
95    };
96
97
98    // getOptionsFromHtmlAttributes parses through any attribute in the user-specific HTML date or time picker and
99    // overwrites the values in "options" with values corresponding to "data-cp-datetimepicker-{optionName}".  The
100    // "optionName" portion of the attribute should correspond to a property of the pickadate or pickatime
101    // options element.
102    function getOptionsFromHtmlAttributes($inputElement, originalOptions) {
103        $($inputElement[0].attributes).each(function () {
104            if (this.name.match('^data-cp-datetimepicker-')) {
105                var optionName = this.name.replace('data-cp-datetimepicker-', '');
106                var originalValue = originalOptions[optionName];
107                if (!originalValue) {
108                    // We only want to set the option value if it was not already set in the JavaScript options.
109                    // That is, the JavaScript options should always win over the HTML5 options.
110
111                    var optionVal = this.value;
112                    if (parseInt(optionVal)) {
113                        optionVal = parseInt(optionVal);
114                    }
115
116                    originalOptions[optionName] = optionVal;
117                }
118            }
119        });
120        return originalOptions;
121    }
122
123    // createTimePicker creates a new time picker object out of the DOM object specified by timeTextboxSelector.
124    // The timeTextboxSelector object must be an HTML INPUT element.
125    function createTimePicker(timeTextboxSelector, options) {
126
127        // The actualy Input Time component will be a hidden field.  The DOM object in the source HTML
128        // will be the editable text field for the user.
129
130        options = options || {};
131
132        var $inputTextBox = $(timeTextboxSelector);
133
134        if (!($inputTextBox) || $inputTextBox.length === 0) {
135            // We got passed a bad selector
136            console.log('ERR: cp.datetimepicker :: Could not find element: ' + timeTextboxSelector);
137            return;
138        }
139
140        // Set any options that were specified directly from within the HTML tag.
141        options = getOptionsFromHtmlAttributes($inputTextBox, options);
142
143        //Wrap fieldSetSelector inside div if wrapInsideDiv is true
144        var fieldSetSelector = '<fieldset class="fieldset__datetimepicker__wrapper">';
145
146        if (options.wrapInsideDiv) {
147            fieldSetSelector = '<div class="t-widget t-timepicker">' + fieldSetSelector + '</div>';
148        }
149
150        $fieldset = $(fieldSetSelector);
151        $inputTextBox.wrap($fieldset);
152
153        var $hiddenTimeInput = $('<input type="text" class="cp_input_datetime" tabindex="-1"/>');
154        $hiddenTimeInput.attr('data-cp-time-textbox-selector', timeTextboxSelector);
155
156        $hiddenTimeInput.attr('aria-hidden', true);
157
158        $hiddenTimeInput.insertAfter($inputTextBox);
159
160        // We need to force "editable" in the options, otherwise things start to break.
161        options.editable = true;
162        $hiddenTimeInput.pickatime(options);
163
164        var pickerObject = $hiddenTimeInput.pickatime('picker');	// reference to the pickatime object
165        $inputTextBox.attr("role", "combobox");
166        $inputTextBox.attr("aria-haspopup", "listbox");
167        $inputTextBox.attr("aria-expanded", "false");
168        $inputTextBox.attr("aria-controls", pickerObject.$root.attr("id"));
169
170        // Bugfix - https://civicplus.tpondemand.com/entity/182182-2
17011-agenda-center-module-main-page
171        // Move aria-owns from the hidden <input> to the interactive one
172        $inputTextBox.attr("aria-owns", pickerObject.$node.attr("aria-owns"));
173        pickerObject.$node.removeAttr("aria-owns");
174
175        $inputTextBox.on({
176            change: function () {
177                var inputTime = this.value;
178                pickerObject.set('customSelect', insertColonIfOverFourChars(inputTime), options);
179            },
180            keydown: function (e) {
181                if (e.keyCode === keyCodes.downArrow) {
182                    e.preventDefault();
183                    pickerObject.open(true);
184                }
185            },
186            focus: function (e) {
187                if (e.relatedTarget !== pickerObject.$holder[0]) {
188                    // If the previously focused control was the picker object, don't open it again after closing it
189                    pickerObject.open(false);
190                }
191                // We have to set the tab-index of the "clear" button, so tabbing through fields works properly.
192                $('.picker__button--clear').attr('tabindex', -1);
193            },
194            blur: function (e) {
195                // If user shifts focus from the input element to its datepicker, then we do not want to close the datepicker.
196                if (!e.relatedTarget?.closest(".picker")) {
197                    pickerObject.close(true);
198                }
199            }
200        });
201
202        pickerObject.on({
203            open: function () {
204                $inputTextBox.attr("aria-expanded", "true");
205            },
206            close: function () {
207                $inputTextBox.attr("aria-expanded", "false");
208                $inputTextBox.focus();
209            },
210            set: function (e) {
211                var inputVal = $inputTextBox.val();
212                var selectedVal = autoTimeFormat(inputVal);
213                if (typeof e.clear === "object" || (typeof e.select !== "undefined" && (!isNaN(e.select) || !isNaN(e.select.pick))) || (e.customSelect && !selectedVal.match(/^([1-9]|1[012])(:[0-5]\d) [APap][mM]$/))) {
214                    selectedVal = this.get('value') === '' ? '12:00 AM' : this.get('value');
215                }
216                $inputTextBox.val(selectedVal);
217                $inputTextBox.attr('value', selectedVal);
218                // closing the selection area if the user had picked a time.
219                if (!e.relatedTarget?.closest(".picker")) {
220                    pickerObject.close(true);
221                    $inputTextBox.attr("aria-expanded", "false");
222                }
223            }
224        });
225
226        // Priming initialization if there was a value specified for the input
227        if ($inputTextBox.val() !== '') {
228            pickerObject.set('select', $inputTextBox.val(), options);
229        }
230
231        $(pickerObject.$root).find('.picker__list').attr('aria-label', 'Time List');
232
233        return pickerObject;
234    }
235
236    // createDatePicker creates a new date picker object using the element specified by "dateTextboxSelector".
237    // The dateTextboxSelector object must be an HTML INPUT element.
238    function createDatePicker(dateTextboxSelector, options) {
239        // The actualy Input Date component will be a hidden field.  The DOM object in the source HTML
240        // will be the editable text field for the user.
241        options = options || {};
242
243        var $inputTextBox = $(dateTextboxSelector);
244
245        if (!($inputTextBox) || $inputTextBox.length === 0) {
246            // We got passed a bad selector
247            console.log('ERR: cp.datetimepicker :: Could not find element: ' + dateTextboxSelector);
248            return;
249        }
250
251        // Set any options that were specified directly from within the HTML tag.
252        options = getOptionsFromHtmlAttributes($inputTextBox, options);
253        var dateAsString = $inputTextBox.val();
254        if (options.format == 'dd/mm/yyyy' && dateAsString.length > 0) {
255            var splitDate = autoCompleteDate(dateAsString, options.format).split('/');
256            $inputTextBox.val(splitDate[1] + '/' + splitDate[0] + '/' + splitDate[2]);
257        }
258
259        if (options.useNativeControls) {
260            $inputTextBox.prop('type', 'date');
261            return;
262        }
263
264        var $hiddenDateInput = $('<input type="text" class="cp_input_datetime" tabindex="-1"/>');
265        $hiddenDateInput.attr('data-cp-date-textbox-selector', dateTextboxSelector);
266
267        $hiddenDateInput.attr('aria-hidden', true);
268        var fieldsetSelector = '<fieldset class="fieldset__datetimepicker__wrapper"></fieldset>';
269        if (options.wrapInsideDiv)
270            fieldsetSelector = '<div class="t-widget t-datepicker">' + fieldsetSelector + '</div>';
271
272        $fieldset = $(fieldsetSelector);
273        $fieldset.attr("data-cp-datetimepicker-selector", dateTextboxSelector);
274        $inputTextBox.wrap($fieldset);
275        $hiddenDateInput.insertAfter($inputTextBox);
276
277        // We have to force the editable option, otherwise things start to break.
278        options.editable = true;
279
280        $hiddenDateInput.pickadate(options);
281
282        var pickerObject = $hiddenDateInput.pickadate('picker');	// reference to the pickadate object
283        $inputTextBox.attr("role", "combobox");
284        $inputTextBox.attr("aria-haspopup", "dialog");
285        $inputTextBox.attr("aria-expanded", "false");
286        $inputTextBox.attr("aria-controls", pickerObject.$root.attr("id"));
287
288        // Bugfix - https://civicplus.tpondemand.com/entity/182182-2
28811-agenda-center-module-main-page
289        // Move aria-owns from the hidden <input> to the interactive one
290        $inputTextBox.attr("aria-owns", pickerObject.$node.attr("aria-owns"));
291        pickerObject.$node.removeAttr("aria-owns");
292
293        var allowDatePickerFocus = false;
294        var isTabbingAwayFromDatePicker = false;
295
296        // Keep only the visible picker action controls in the keyboard path; date cells are tracked through aria-activedescendant.
297        function getPickerControls($holder) {
298            return $holder.find('.picker__nav--prev, .picker__nav--next, .picker__button--today, .picker__button--clear, .picker__button--close').filter(function () {
299                return !$(this).hasClass('picker__nav--disabled') && $(this).attr('aria-hidden') !== 'true';
300            });
301        }
302
303        function enablePickerControlTabbing() {
304            getPickerControls(pickerObject.$holder).attr('tabindex', '0');
305        }
306
307        function restorePickerControlFocus(selector) {
308            setTimeout(function () {
309                updateActiveDescendant();
310                enablePickerControlTabbing();
311                pickerObject.$holder.find(selector).first().focus();
312            }, 0);
313        }
314
315        function getNextTabbableElement() {
316            const $focusableElements = $('a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable=true]').filter(function () {
317                const $element = $(this);
318                const tabindex = $element.attr('tabindex');
319
320                return $element.is(':visible') && tabindex !== '-1' && $element.attr('aria-hidden') !== 'true' && this !== pickerObject.$holder[0] && !$.contains(pickerObject.$holder[0], this);
321            });
322
323            const currentInputIndex = $focusableElements.index($inputTextBox);
324            if (currentInputIndex !== -1 && currentInputIndex < $focusableElements.length - 1) {
325                return $focusableElements.eq(currentInputIndex + 1);
326            }
327
328            return $();
329        }
330
331        // Add handler to make sure datepicker is visible when shown
332        pickerObject && pickerObject.on('open', function () {
333            $inputTextBox.attr("aria-expanded", "true");
334            $inputTextBox.attr('aria-live', 'off');
335            $inputTextBox.attr('aria-atomic', 'false');
336            $inputTextBox.attr('role', 'textbox');
337
338            const selected = pickerObject.get('select');
339            if (!selected) {
340                pickerObject.set('highlight', new Date(), { muted: true });
341            }
342
343            const $holder = pickerObject.$holder;
344            const inputId = $inputTextBox.attr('id');
345
346            const inputLabel = ($('label[for="' + inputId + '"]').text() || '').trim();
347
348            const labelText = inputLabel || $inputTextBox.attr('aria-label') || $inputTextBox.attr('title') || 'Date picker calendar';
349
350            //Use the application role so screen readers pass arrow keys to the custom keyboard interaction.
351            $holder.attr({
352                'tabindex': allowDatePickerFocus ? '0' : '-1',
353                'role': 'application',
354                'aria-label': labelText
355            });
356
357            $holder.find('.picker__nav--prev, .picker__nav--next, .picker__button--today, .picker__button--clear, .picker__button--close').attr('tabindex', '-1');
358
359            //Only ONE focusable element
360            $holder.find('.picker__day').attr('tabindex', '-1');
361            $holder.find('.picker__day').attr('aria-hidden', 'true');
362
363            //Set aria-selected
364            $holder.find('.picker__day').each(function () {
365                const $day = $(this);
366                $day.attr('aria-selected', $day.hasClass('picker__day--selected') ? 'true' : 'false');
367            });
368
369            //Set active descendant
370            setTimeout(updateActiveDescendant, 0);
371
372            $holder.off('keydown.grid').on('keydown.grid', function (e) {
373                if (e.keyCode === keyCodes.tab) {
374                    const $controls = getPickerControls($holder);
375                    const currentIndex = $controls.index(e.target);
376
377                    if (currentIndex !== -1) {
378                        if (e.shiftKey && currentIndex === 0) {
379                            e.preventDefault();
380                            $holder.focus();
381                            return;
382                        }
383
384                        if (!e.shiftKey && currentIndex < $controls.length - 1) {
385                            e.preventDefault();
386                            $controls.eq(currentIndex + 1).focus();
387                        }
388
389                        if (!e.shiftKey && currentIndex === $controls.length - 1) {
390                            e.preventDefault();
391                            // Capture the next real page control before closing because picker DOM removal can disrupt native Tab focus.
392                            const $nextTabbableElement = getNextTabbableElement();
393                            isTabbingAwayFromDatePicker = true;
394                            allowDatePickerFocus = false;
395                            setTimeout(function () {
396                                pickerObject.close(true);
397                                setTimeout(function () {
398                                    $nextTabbableElement.focus();
399                                }, 0);
400                            }, 0);
401                        }
402
403                        return;
404                    }
405
406                    if ($holder.is(e.target) || $holder.has(e.target).length) {
407                        e.preventDefault();
408                        enablePickerControlTabbing();
409                        (e.shiftKey ? $controls.last() : $controls.first()).focus();
410                    }
411
412                    return;
413                }
414
415                if ($holder.is(e.target) && e.keyCode === 32) {
416                    e.preventDefault();
417                    $holder.find('.picker__day--highlighted:not(.picker__day--disabled)').click();
418                    return;
419                }
420
421                const $target = $(e.target);
422                if ($target.is('.picker__nav--prev, .picker__nav--next') && (e.keyCode === keyCodes.downArrow || e.which === keyCodes.downArrow || e.key === 'ArrowDown' || e.key === 'Down')) {
423                    e.preventDefault();
424                    $holder.focus();
425                    return;
426                }
427
428                if ($target.is('.picker__nav--prev, .picker__nav--next') && e.keyCode === 32) {
429                    e.preventDefault();
430                    $target.click();
431                }
432
433                setTimeout(() => {
434                    updateActiveDescendant();
435
436                    $holder.find('.picker__day').attr('aria-selected', 'false');
437
438                    const $selected = $holder.find('.picker__day--selected');
439                    if ($selected.length) {
440                        $selected.attr('aria-selected', 'true');
441                    }
442                }, 0);
443            });
444
445            $holder.off('click.grid', '.picker__nav--prev, .picker__nav--next').on('click.grid', '.picker__nav--prev, .picker__nav--next', function () {
446                const $target = $(this);
447                if (!$target.hasClass('picker__nav--disabled')) {
448                    restorePickerControlFocus($target.hasClass('picker__nav--prev') ? '.picker__nav--prev' : '.picker__nav--next');
449                }
450            });
451
452            // Add a slight delay to ensure that the flyout has been added to the dom and the flyoutHeight is nonzero
453            setTimeout(function () {
454                // Get the position of the datepicker flyout relative to the top of the document
455                var flyoutTop = pickerObject.$holder[0].getBoundingClientRect().top;
456
457                // Get the height of the datepicker flyout
458                var flyoutHeight = pickerObject.$holder[0].offsetHeight;
459
460                // Get the height of the viewport
461                var viewportHeight = window.innerHeight;
462
463                // Calculate the amount of scrolling needed to make the entire datepicker flyout visible
464                var scrollAmount = flyoutTop + flyoutHeight - viewportHeight;
465
466                // If the datepicker flyout is not fully visible, scroll the viewport down to make it visible
467                if (scrollAmount > 0) {
468                    window.scrollTo(0, scrollAmount + window.scrollY);
469                }
470            }, 50);
471        });
472
473        function focusInput() {
474            $inputTextBox.off("focus", openPicker);
475            $inputTextBox.focus();
476            setTimeout(function () {
477                $inputTextBox.on("focus", openPicker);
478            }, 0);
479        }
480
481        pickerObject.on('close', function () {
482            //Trigger the change event on the picker object's element.
483            window.parent.$(dateTextboxSelector).change();
484            $inputTextBox.attr("aria-expanded", "false");
485            pickerObject.$holder.attr('tabindex', '-1');
486            pickerObject.$holder.find('.picker__nav--prev, .picker__nav--next, .picker__button--today, .picker__button--clear, .picker__button--close').attr('tabindex', '-1');
487            if (!isTabbingAwayFromDatePicker) {
488                focusInput();
489            }
490            isTabbingAwayFromDatePicker = false;
491            allowDatePickerFocus = false;
492        });
493
494        // setDate is a helper function that should only be called from within this module.
495        function setDate(dateAsString, placeholder) {
496            if (dateAsString === '') {
497                pickerObject.set('clear', null, null);
498            } else {
499                if (pickerObject.component.settings.format == 'dd/mm/yyyy') {
500                    var splitDate = autoCompleteDate(dateAsString, pickerObject.component.settings.format).split('/');
501                    var date = splitDate[1] + '/' + splitDate[0] + '/' + splitDate[2];
502                    var epochDate = Date.parse(date);
503                } else {
504                    var epochDate = Date.parse(autoCompleteDate(dateAsString, pickerObject.component.settings.format));
505                }
506                if (!epochDate) {
507                    return;
508                } else {
509                    var parsedDate = new Date(epochDate);
510                    pickerObject.set('select',
511                        [parsedDate.getFullYear(), parsedDate.getMonth(), parsedDate.getDate()]);
512                }
513            }
514        }
515
516        function updateActiveDescendant() {
517            const $holder = pickerObject.$holder;
518            const $active = $holder.find('.picker__day--highlighted');
519            $holder.find('.picker__day').attr('aria-hidden', 'true');
520
521            if ($active.length) {
522                $active.attr('aria-hidden', 'false');
523                $holder.attr('aria-activedescendant', $active.attr('id'));
524
525                const dateValue = $active.data('pick');
526                if (dateValue) {
527                    const date = new Date(dateValue);
528
529                    const formatted = date.toLocaleDateString('en-US', {
530                        month: 'long',
531                        day: 'numeric',
532                        year: 'numeric'
533                    });
534
535                    // override for active cell
536                    $active.attr('aria-label', formatted);
537                }
538            }
539        }
540
541        var intervalID;
542
543        //Moves the date picker further up the DOM so it isn't overlapped https://civicplus.tpondemand.com/entity/22312
544        function adjustDTPicker() {
545            if (intervalID === 0) {
546                return;
547            }
548
549            var elemPicker = $('.picker--opened')[0];
550            if (elemPicker) {
551                $(elemPicker).appendTo('#cpDatePickerWrapper');
552                elemPicker.style.fontSize = 'inherit';
553            }
554
555            clearInterval(intervalID);
556
557            $('.cpDatePickerElevate').each(function () {
558                var $dateInput = $(this);
559                if ($dateInput.is(':focus')) {
560                    adjustFlyoutPosition($dateInput, $('#cpDatePickerWrapper'));
561                }
562            });
563
564            intervalID = 0;
565        }
566
567        if ($('#cpDatePickerWrapper').length > 0) {
568            $(window).resize(function () {
569                $('.cpDatePickerElevate').each(function () {
570                    var $dateInput = $(this);
571                    if ($dateInput.is(':focus')) {
572                        adjustFlyoutPosition($dateInput, $('#cpDatePickerWrapper'));
573                    }
574                });
575            });
576        }
577
578        function openPicker() {
579            allowDatePickerFocus = false;
580            // We have to set the tab-index of the "today", "close", and "clear" buttons, so tabbing through fields works properly.
581            $('.picker__button--close').attr('tabindex', -1);
582            $('.picker__button--today').attr('tabindex', -1);
583            $('.picker__button--clear').attr('tabindex', -1);
584            // pickerObject.$holder.find('[tabindex="-1"]').attr('tabindex', 0);
585            pickerObject.open(false);
586            if ($('#cpDatePickerWrapper').length > 0)
587                intervalID = setInterval(adjustDTPicker, 50);
588        }
589
590        $inputTextBox.on({
591            change: function () {
592                setDate(this.value);
593            },
594            focus: openPicker,
595            click: openPicker,
596            keydown: function (e) {
597                if (e.keyCode === keyCodes.tab) {
598                    isTabbingAwayFromDatePicker = true;
599                    pickerObject.$holder.attr('tabindex', -1);
600                    pickerObject.$holder.find('[tabindex="0"]').attr('tabindex', -1);
601                    pickerObject.close();
602                    isTabbingAwayFromDatePicker = false;
603                }
604                if (e.keyCode === keyCodes.downArrow) {
605                    e.preventDefault();
606                    allowDatePickerFocus = true;
607                    pickerObject.open();
608                    setTimeout(function () {
609                        enablePickerControlTabbing();
610                        pickerObject.$holder.attr('tabindex', '0').focus();
611                    }, 0);
612                }
613            },
614            blur: function (e) {
615                // If user shifts focus from the input element to its datepicker, then we do not want to close the datepicker.
616                if (!allowDatePickerFocus || !e.relatedTarget?.closest(".picker")) {
617                    pickerObject.close(true);
618                    $inputTextBox.attr("aria-expanded", "false");
619                }
620            },
621        });
622
623        pickerObject.on('set', function () {
624            $inputTextBox.val(this.get('value'));
625            $inputTextBox.attr('value', this.get('value'));
626
627            setTimeout(updateActiveDescendant, 0);
628        });
629
630        // Priming initialization if there was a value specified for the input
631        if ($inputTextBox.val() !== '') {
632            setDate($inputTextBox.val());
633        }
634
635
636        return pickerObject;
637    }
638
639    function insertColonIfOverFourChars(inputString) {
640        if (inputString != null && inputString.length > 3 && inputString.indexOf(":") < 0) {
641            inputString = inputString.slice(0, 2) + ":" + inputString.slice(2, inputString.length);
642        }
643        return inputString;
644    }
645
646    function autoCompleteDate(dateAsString, formatString) {
647        try {
648            var fdts = null;
649            var currentDate = new Date();
650
651            //guard clauses
652            if (formatString == null || formatString.length === 0) {
653                formatString === "mm/dd/yyyy";
654            }
655            if ((dateAsString == null || dateAsString.length == 0 || dateAsString.indexOf(".") != -1) && formatString.toLowerCase == "dd/mm/yyyy") {
656                return ('0' + currentDate.getDate()).slice(-2) + '/' + ('0' + (currentDate.getMonth() + 1)).slice(-2) + '/' + currentDate.getFullYear();
657            } else if (dateAsString == null || dateAsString.length == 0 || dateAsString.indexOf(".") != -1) {
658                return ('0' + (currentDate.getMonth() + 1)).slice(-2) + '/' + ('0' + currentDate.getDate()).slice(-2) + '/' + currentDate.getFullYear();
659            }
660
661            fdts = dateAsString.split("/");
662
663            if (fdts != null) {
664                //switch mm/dd/yyyy to be dd/mm/yyyy for logic further down
665                if (formatString.toLowerCase() !== "dd/mm/yyyy") {
666                    var day = fdts[1];
667                    var month = fdts[0];
668                    fdts[0] = day;
669                    fdts[1] = month;
670                }
671
672                if (fdts[0] == null || fdts[0] === '0' || fdts[0].length < 1 || fdts[0].length > 2) {
673                    fdts[0] = currentDate.getDate();
674                }
675                if (fdts[1] == null || fdts[1] === '0' || fdts[1].length < 1 || fdts[1].length > 2) {
676                    fdts[1] = currentDate.getMonth() + 1;
677                }
678                if (fdts[2] == null || (fdts[2].length !== 2 && fdts[2].length !== 4)) {
679                    //For last year's date it also adds time at the end of date so extracting year
680                    fdts[2] = !isNaN(fdts[2].substr(0, 4)) ? fdts[2].substr(0, 4) : currentDate.getFullYear();
681                } else if (fdts[2].length === 2) {
682                    var yr = fdts[2];
683                    var crDate = new Date();
684                    var crCtry = crDate.getFullYear();
685                    var pstCnry = crCtry - 100;
686                    crCtry = crCtry + ' ';
687                    pstCnry = pstCnry + ' ';
688                    crCtry = crCtry.substr(0, 2);
689                    pstCnry = pstCnry.substr(0, 2);
690                    if (yr >= 32)
691                        yr = pstCnry + yr;
692                    else
693                        yr = crCtry + yr;
694                    fdts[2] = yr;
695                }
696            }
697            if (formatString.toLowerCase() === "dd/mm/yyyy") {
698                dateAsString = ('0' + fdts[0]).slice(-2) + '/' + ('0' + fdts[1]).slice(-2) + '/' + fdts[2];
699            } else {
700                dateAsString = ('0' + fdts[1]).slice(-2) + '/' + ('0' + fdts[0]).slice(-2) + '/' + fdts[2];
701            }
702            return dateAsString;
703        } catch (e) {
704            return "";
705        }
706    }
707
708    function autoTimeFormat(inputString) {
709
710        const regex1 = /^(0?[1-9]|1[0-2]) ?([ap]m)$/i; //eg: 5AM -> 5:00 AM
711        const regex2 = /^(\d{1,2})(\d{2}) ?([ap]m)$/i; //eg: 500AM -> 5:00 AM
712        const regex3 = /^(\d{1,2})(?::(\d{2}))?\s*([ap]m)?$/i; //eg: 05:00 am or 5:00 am -> 5:00 AM
713
714        if (regex1.test(inputString)) {
715            return inputString.replace(regex1, (match, hour, period) => {
716                const hourNum = parseInt(hour);
717                const formattedHour = hourNum === 12 ? 12 : hourNum % 12; // Convert to 12-hour format
718                const formattedMinute = "00"; // Add 00 as minutes
719                const formattedPeriod = period.toUpperCase();
719 // Convert period to uppercase
720                return `${formattedHour}:${formattedMinute} ${formattedPeriod}`;
721            });
722        }
723        else if (regex2.test(inputString)) {
724            return inputString.replace(regex2, (match, hour, minute, period) => {
725                const hourNum = parseInt(hour);
726                const formattedHour = hourNum === 12 ? 12 : hourNum % 12; // Convert to 12-hour format
727                const formattedMinute = minute.padStart(2, "0"); // Pad minute with zero if necessary
728                const formattedPeriod = period.toUpperCase(); // Convert period to uppercase
729                return `${formattedHour}:${formattedMinute} ${formattedPeriod}`;
730            });
731        }
732        else if (regex3.test(inputString)) {
733            return inputString.replace(regex3, (match, hour, minute, period) => {
734                const hourNum = parseInt(hour);
735                const formattedHour = hourNum === 12 ? 12 : hourNum % 12; // Convert to 12-hour format
736                const formattedMinute = minute ? minute : "00"; // Set minute to "00" if not provided
737                const formattedPeriod = period ? period.toUpperCase() : ""; // Convert period to uppercase if provided
738                return `${formattedHour}:${formattedMinute} ${formattedPeriod}`;
739            });
740        }
741        else {
742            return inputString;
743        }
744    }
745})(jQuery);
746;
747

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.