/*
 Some components from jQuery UI | https://github.com/jquery/jquery-ui | MIT License
*/
(function(p){var w=window.AmazonUIPageJS||window.P,y=w._namespace||w.attributeErrors,h=y?y("AmazonUICalendar@calendarJS","AmazonUI"):w;h.guardFatal?h.guardFatal(p)(h,window):h.execute(function(){p(h,window)})})(function(p,w,y){p.when("A").register("a-calendar-utils",function(h){function k(a,b){b=a.getFullYear?a.getMonth()+1:b;a=a.getFullYear?a.getFullYear():a;return n(a,b+1,0).getDate()}function n(a,b,d){var c=null;a&&(c=a.getFullYear?new Date(a.getTime()):void 0!==a.year&&void 0!==a.month&&void 0!==
a.day?new Date(a.year,a.month-1,a.day):new Date(a,b-1,d));return c}function f(a){var b=a.match(/[.\/\-\s].*?/);a=a.split(/\W+/);if(!b||!a||0===a.length)throw Error("Invalid date format.");return{separator:b,parts:a}}return{numDaysInMonth:k,newDate:n,add:function(a,b,d){if("d"===d||"w"===d)a.setDate(a.getDate()+b*("w"===d?7:1)),a.setHours(0,0,0,0);else{var c=a.getFullYear()+("y"===d?b:0);b=a.getMonth()+("m"===d?b:0);a.setTime(n(c,b+1,Math.min(a.getDate(),k(c,b+1))).getTime())}return a},parseDate:function(a,
b){b=f(b);a=a?a.split(b.separator):[];var d=null;if(a.length===b.parts.length){var c=new Date;for(var g=c.getFullYear(),q=c.getDate(),r=c.getMonth(),e=0;e<b.parts.length;e++)switch(c=parseInt(a[e],10),b.parts[e]){case "dd":case "d":q=c;break;case "mm":case "m":r=c-1;break;case "yy":case "yyyy":g=100>c?40>c?2E3+c:1900+c:c}!isNaN(g)&&0<=r&&11>=r&&1<=q&&q<=k(g,r+1)&&(d=new Date(g,r,q,0,0,0))}return d},formatDate:function(a,b){b=f(b);a={d:a.getDate(),m:a.getMonth()+1,yy:a.getFullYear()%100,yyyy:a.getFullYear()};
a.dd=(10>a.d?"0":"")+a.d;a.mm=(10>a.m?"0":"")+a.m;a.yy=(10>a.yy?"0":"")+a.yy;for(var d=[],c=0,g=b.parts.length;c<g;c++)d.push(a[b.parts[c]]);return d.join(b.separator)},utcTimestamp:function(a){return Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0)}}});"use strict";p.register("a-calendar-template-default",function(){return{monthNames:"January February March April May June July August September October November December".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),
firstDay:0,currentFormat:"{{month}} {{year}}",genericStatus:"Show {{month}} {{year}}",dateFormat:"mm/dd/yyyy",dateFormatDescription:"Date with format m m/d d/y y y y"}});"use strict";p.when("A","a-calendar-utils","a-calendar-template-default").register("a-calendar-renderer",function(h,k,n){function f(a){if(0!==arguments.length)return this.templateData=a||n,this}var a=h.$,b=f.prototype;b.notifyChange=function(a,c){for(var d=this,b=a.attributes,r=a.$container,e=[],v=k.newDate(b.viewedYear,b.viewedMonth,
1),l=0;l<b.numViewMonths;l++){var f=v.getMonth()+1,m=v.getFullYear();e.push(d.renderMonth(b,m,f,0===l,l===b.numViewMonths-1));v=k.add(v,1,"m")}h.delay(function(){r.html(e.join(""));d.notifyBlacklistChange(a);c&&c();h.trigger("a:calendar:change:"+a.attributes.id)},0)};b.renderMonth=function(a,c,b,q,r){var d=this.templateData,g=k.numDaysInMonth(c,b),l=d.firstDay,h=k.newDate(c,b,1).getDay(),m=k.newDate(c,b,1).getTime(),t=k.newDate(c,b+1,0).getTime(),f=a.minDate?a.minDate.getTime():null,n=a.maxDate?a.maxDate.getTime():
null,u=k.newDate(c,b,1),p=(h-l+7)%7;h=42-p-g;var w=a.selectedDate?a.selectedDate.getTime():null;k.add(u,-p,"d");l=[];for(var x=0;x<p;x++)l.push(this.renderDayOutsideMonth(u)),k.add(u,1,"d");for(p=0;p<g;p++)x=u.getTime(),l.push(this.renderDay(u,a.selectedDate&&x===w,n&&x>n||f&&x<f,a.onRenderDayClass)),k.add(u,1,"d");for(a=0;a<h;a++)l.push(this.renderDayOutsideMonth(u)),k.add(u,1,"d");for(a=1;a<=l.length;a++)u=a-1,1===a?l[u]="\x3ctr\x3e"+l[u]:a===l.length?l[u]+="\x3c/tr\x3e":0===a%7&&(l[u]+="\x3c/tr\x3e\x3ctr\x3e");
r=this.renderMonthHeader(c,b,q&&(!f||m>f),r&&(!n||t<n));m=this.renderDayHeader();t=d.currentFormat;t=t.replace("{{month}}",d.monthNames[(b-1+12)%12]).replace("{{year}}",c);c=["\x3cdiv class\x3d'a-cal-month-container",q?" a-cal-month-container-first":"","'\x3e",r,"\x3ctable class\x3d'a-cal-month-table' summary\x3d'",t,"'\x3e",m,"\x3ctbody class\x3d'a-cal-days'\x3e"].concat(l);c.push("\x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e");return c.join("")};b.renderDay=function(a,c,b,q){var d=a.getTime(),e=k.utcTimestamp(a);
c=["a-cal-d"," ",c?"a-cal-select ":"",b?"a-cal-outbound ":"",q?q.call(this,a)+" ":"","a-cal-d-",d," ","a-cal-d-utc-",e];return["\x3ctd role\x3d'gridcell' class\x3d'"].concat(c).concat(["' data-timestamp\x3d'",d,"' data-timestamp-utc\x3d'",e,"'\x3e\x3ca href\x3d'javascript:void(0)' class\x3d'a-declarative a-cal-date-anchor' data-action\x3d'a-cal-select-date' aria-disabled\x3d'",b?"true":"false","'\x3e",a.getDate(),"\x3c/a\x3e\x3c/td\x3e"]).join("")};b.renderDayOutsideMonth=function(a){var b=k.utcTimestamp(a);
return["\x3ctd class\x3d'a-cal-na a-cal-d-",a.getTime()," a-cal-d-utc-",b,"'\x3e",this.templateData.dayOutsideMonth,"\x3c/td\x3e"].join("")};b.renderDayHeader=function(){for(var a=this.templateData,b=[],g=0;7>g;g++){var q=(g+a.firstDay)%7;b.push("\x3cth class\x3d'a-cal-day-label'\x3e");b.push(a.dayNamesShort[q]);b.push("\x3c/th\x3e")}a=["\x3cthead class\x3d'a-cal-labels'\x3e\x3ctr\x3e"].concat(b);a.push("\x3c/tr\x3e\x3c/thead\x3e");return a.join("")};b.renderMonthHeader=function(a,b,g,q){var c=this.templateData,
d=c.monthNames[(b-1+12)%12],k=c.monthNames[(b+12)%12],l=1===b?a-1:a,h=12===b?a+1:a,m=c.genericStatus,t=c.genericStatus,f=c.currentFormat;m=m.replace("{{month}}",c.monthNames[(b-2+12)%12]).replace("{{year}}",l);t=t.replace("{{month}}",k).replace("{{year}}",h);f=f.replace("{{month}}",d).replace("{{year}}",a);a=g?["\x3ca class\x3d'a-declarative a-cal-paginate-prev' data-action\x3d'a-cal-prev-month' href\x3d'javascript:void(0)' role\x3d'button' aria-label\x3d'",m,"'\x3e\x3cspan class\x3d'a-offscreen'\x3e",
m,"\x3c/span\x3e\x3ci class\x3d'a-icon a-icon-previous'\x3e\x3c/i\x3e\x3c/a\x3e"].join(""):"";q=q?["\x3ca class\x3d'a-declarative a-cal-paginate-next' data-action\x3d'a-cal-next-month' href\x3d'javascript:void(0)' role\x3d'button' aria-label\x3d'",t,"'\x3e\x3cspan class\x3d'a-offscreen'\x3e",t,"\x3c/span\x3e\x3ci class\x3d'a-icon a-icon-next'\x3e\x3c/i\x3e\x3c/a\x3e"].join(""):"";return["\x3cdiv class\x3d'a-row a-cal-month-row'\x3e\x3cdiv class\x3d'a-column a-span2'\x3e",a,"\x3c/div\x3e\x3cdiv class\x3d'a-column a-span8 a-text-center'\x3e\x3ch4 class\x3d'a-cal-month-header'\x3e",
f,"\x3c/h4\x3e\x3c/div\x3e\x3cdiv class\x3d'a-column a-span2 a-span-last'\x3e",q,"\x3c/div\x3e\x3c/div\x3e"].join("")};b.notifyInputChange=function(a){var b=a.attributes.$inputContainer,g=a.attributes.calInput;if(b){a=a.attributes.selectedDate;b.find(".a-cal-input");if(a){var d=a.getMonth()+1;var r=a.getDate();var e=a.getFullYear()}b.find(".a-cal-select-month").val(d);b.find(".a-cal-select-day").val(r);b.find(".a-cal-select-year").val(e);g&&g.setDate(a)}};b.notifyDaySelection=function(a,b,g){a=a.$container.find(".a-cal-d.a-cal-d-"+
b.getTime());a.toggleClass("a-cal-select",g);a.find("a").attr("aria-current",g)};b.notifyBlacklistChange=function(b){var c=b.$container,g=b.attributes.dateBlacklisted;g?c.find(".a-cal-d").each(function(b,c){b=a(c);var e=g(new Date(b.data("timestamp")));b.attr("aria-disabled",function(){return e?"true":"false"}).toggleClass("a-cal-inactive",e)}):c.find(".a-cal-d").removeClass("a-cal-inactive")};return f});"use strict";p.when("A","a-calendar-utils","a-calendar-renderer-instance","a-calendar-input").register("a-calendar",
function(h,k,n,f){function a(a,b){if(0!==arguments.length){b=b||{};this.$container=a;this.observer=b.observer||n;var c=this.attributes={numViewMonths:1};h.extend(c,b);c.selectedDate=k.newDate(c.selectedDate);c.minDate=k.newDate(c.minDate);c.maxDate=k.newDate(c.maxDate);var e=this.attributes.selectedDate||new Date;c.hasOwnProperty("viewedMonth")||(c.viewedMonth=e.getMonth()+1);c.hasOwnProperty("viewedYear")||(c.viewedYear=e.getFullYear());e=this.getTemplateData();if(c.$inputContainer&&e){var g=c.$inputContainer.find(".a-cal-input");
g.attr("aria-label",e.dateFormatDescription);c.$inputContainer.find(".a-cal-icon").attr("aria-label",e.dateFormatDescription);c.calInput=new f(g,this,e.dateFormat)}c.id||(c.id=++d);this.observer.notifyChange(this);this.observer.notifyInputChange(this);return this}}var b=h.$,d=0,c=a.prototype;c.getTemplateData=function(){return this.observer?this.observer.templateData:null};c.selectDate=function(a,b,c){var e=this.attributes;if(!e.disabled){var d=k.newDate(a,b,c);if(!d||!isNaN(d.getFullYear())){var g=
e.dateBlacklisted,f=e.minDate,m=e.maxDate;d&&(g&&g(a,b,c)||f&&d.getTime()<f.getTime()||m&&d.getTime()>m.getTime())?e.onSelectInactiveDate&&e.onSelectInactiveDate.call(this,a,b,c):(g=this.observer,f=k.newDate(e.selectedDate),e.selectedDate=d,f&&g.notifyDaySelection(this,f,!1),e.selectedDate&&g.notifyDaySelection(this,e.selectedDate,!0),e.onSelectDate&&e.onSelectDate.call(this,a,b,c),e.selectedDate&&(a=e.viewedYear,b=e.viewedMonth,d=e.numViewMonths,c=(new Date(a,b-1,1)).getTime(),a=(new Date(a,b-1+
d,0)).getTime(),b=e.selectedDate.getTime(),b<c||b>a)&&(this.changeViewedYear(e.selectedDate.getFullYear()),this.changeViewedMonth(e.selectedDate.getMonth()+1)),this.observer.notifyInputChange(this))}}};c.changeViewedMonth=function(a,c){var d=this,e=d.attributes,g=d.$container;if(!e.disabled){var f=e.minDate,h=e.maxDate,m=e.viewedYear,t=k.newDate(m,a,1);m=k.newDate(m,a+1,0);f&&m.getTime()<f.getTime()||h&&t.getTime()>h.getTime()?e.onChangeViewedMonthFail&&e.onChangeViewedMonthFail.call(d,a):(e.viewedMonth=
t.getMonth()+1,e.viewedYear=t.getFullYear(),d.observer.notifyChange(d,function(){e.onChangeViewedMonth&&e.onChangeViewedMonth.call(d,a);"next"===c&&g.find(b(".a-cal-paginate-next")).focus();"previous"===c&&g.find(b(".a-cal-paginate-prev")).focus()}))}};c.changeViewedYear=function(a){var b=this,c=b.attributes;if(!c.disabled){var d=c.minDate,f=c.maxDate,g=c.viewedMonth,h=k.newDate(a,g,1);g=k.newDate(a,g+1,0);d&&g.getTime()<d.getTime()||f&&h.getTime()>f.getTime()?c.onChangeViewedYearFail&&c.onChangeViewedYearFail.call(b,
a):(c.viewedMonth=h.getMonth()+1,c.viewedYear=h.getFullYear(),b.observer.notifyChange(b,function(){c.onChangeViewedYear&&c.onChangeViewedYear.call(b,a)}))}};c.changeDateBlacklisted=function(a){this.attributes.disabled||(this.attributes.dateBlacklisted=a,this.observer.notifyBlacklistChange(this),this.attributes.onChangeDateBlacklisted&&this.attributes.onChangeDateBlacklisted.call(this,a))};c.setDisabled=function(a){this.attributes.disabled=a};return a});"use strict";p.when("A","a-calendar","a-calendar-renderer-instance",
"a-popover","ready").register("a-calendar-framework",function(h,k,n,f){function a(a,b){a.jquery||(a=v(a));b=new k(a,b);l[b.attributes.id]=b;a.data("a-cal-id",b.attributes.id).addClass("a-cal-calendar-container").removeClass("a-cal-static");return b}function b(b,c){c=h.extend({activate:"onclick"},c||{});c=a(v("\x3cdiv /\x3e"),c);b.data("a-cal-id",c.attributes.id).data("a-cal-popover",!0).removeClass("a-cal-static");return c}function d(a,c){c=c||{};c.$inputContainer=a;c=b(a.find(".a-cal-input"),c);
a.find(".a-cal-input-container").removeClass("a-hidden");a.find(".a-cal-dropdown-container").addClass("a-hidden").attr("aria-hidden","true");a.data("a-cal-id",c.attributes.id).data("a-cal-input",!0).addClass("a-cal-calendar-container").removeClass("a-cal-static");return c}function c(b,c){c=c||{};c.$inputContainer=b;c=a(v("\x3cdiv class\x3d'a-row a-cal-calendar-container' /\x3e"),c);b.append(c.$container);b.find(".a-cal-dropdown-container").addClass("a-hidden").attr("aria-hidden","true");b.data("a-cal-id",
c.attributes.id).data("a-cal-input",!0).addClass("a-cal-calendar-container").removeClass("a-cal-static");return c}function g(a){a.jquery||(a=v(a));var b=a.data("a-cal-renderer-instance")||"a-calendar-renderer-instance";"a-calendar-renderer-instance"===b?q(a,n):p.when(b).execute(function(b){q(a,b)})}function q(m,e){var f=m.data("a-cal-attributes")||{},g=m.data("a-cal-popover"),k=m.data("a-cal-input"),t=m.data("a-cal-inline");e=h.extend({observer:e},f);k?t?c(m,e):d(m,e):g?b(m,e):a(m,e)}function r(){v(".a-cal-static").each(function(){g(v(this))})}
function e(a){a.jquery||(a=v(a));if(a.length){var b=a.closest(".a-cal-calendar-container");b=b.length?l[b.data("a-cal-id")]:l[a.data("a-cal-id")]}return b}var v=h.$,l={};h.on("a:pageUpdate ready",r);var w=function(a){"keydown"===a.type&&a.$event.keyCode===h.constants.keycodes.SPACE&&a.$event.preventDefault();if("keyup"===a.type&&(a.$event.keyCode===h.constants.keycodes.ENTER||a.$event.keyCode===h.constants.keycodes.SPACE)||"click"===a.type){var b=a.$target.closest(".a-input-text-addon-group");a=a.$target;
b.length&&(a=b.find(".a-cal-input"));if(!(b=f.get(a))){b=a;a=b.data("a-cal-id");a=l[a];var c=a.attributes.position?a.attributes.position:"triggerBottom";c={activate:"onclick",popoverLabel:a.getTemplateData().dateFormatDescription,focusWhenShown:!0,width:"auto",padding:"none",position:c,closeButton:!1,popoverArrow:!1,dataStrategy:"inline"};b=f.create(b,c);b.update({content:a.$container.addClass("a-cal-in-popover")})}b.show()}};h.declarative("a-cal-input",["click","keyup"],w);h.declarative("a-cal-icon",
["click","keyup","keydown"],w);return{create:a,createWithPopover:b,createWithInput:d,createWithInputInline:c,createAll:r,get:e,getById:function(a){return l[a]},remove:function(a){var b=e(a);if(b){var c=b.attributes.$inputContainer;b.$container.remove();delete l[b.attributes.id];a.data("a-cal-popover")&&f.remove(a);c&&(a=c.find(".a-popover-trigger"),a.data("a-cal-popover")&&f.remove(a))}}}});"use strict";p.when("A","a-calendar-framework","a-popover").register("a-calendar-handler",function(h,k,n){var f=
h.$;h.declarative("a-cal-select-date",["click"],function(a){var b=a.$target;if(a=k.get(b))b=new Date(b.parent().data("timestamp")||b.data("timestamp")),a.selectDate(b),a.attributes.$inputContainer&&(a=n.get(a.attributes.$inputContainer.find(".a-cal-input")))&&a.hide()});h.declarative("a-cal-dropdown-select",["change"],function(a){if(a=k.get(a.$target)){var b=a.attributes.$inputContainer;if(b){var d=b.find(".a-cal-select-year").val(),c=b.find(".a-cal-select-month").val();b=b.find(".a-cal-select-day").val();
d&&c&&b&&a.selectDate(d,c,b)}}});h.declarative("a-cal-prev-month",["click"],function(a){(a=k.get(a.$target))&&a.changeViewedMonth(a.attributes.viewedMonth-1,"previous")});h.declarative("a-cal-next-month",["click"],function(a){(a=k.get(a.$target))&&a.changeViewedMonth(a.attributes.viewedMonth+1,"next")});f(document).delegate(".a-cal-input","focusin",function(a){f(a.target).siblings(".a-icon-calendar").addClass("a-icon-calendar-focus")}).delegate(".a-cal-input","focusout",function(a){f(a.target).siblings(".a-icon-calendar").removeClass("a-icon-calendar-focus")})});
"use strict";p.when("A","a-calendar-renderer","a-calendar-template-default").register("a-calendar-renderer-instance",function(h,k,n){return new k(n)});"use strict";p.when("A","a-calendar-utils").register("a-calendar-input",function(h,k){function n(f,a,b){var d=this;d.$input=f;d.format=b;d.curDate=k.parseDate(f.val(),b);d.$input.bind("keyup change",function(){d.curDate=k.parseDate(f.val(),b);a.selectDate(d.curDate)}).bind("focusout",function(){d.setDate(a.attributes.selectedDate,!0)}).bind("keydown",
function(a){a.keyCode===h.constants.keycodes.ENTER&&a.preventDefault()})}n.prototype.setDate=function(f,a){var b=this.curDate,d=b instanceof Date,c=f instanceof Date,g=d&&c;if(!f||c)if(d=!g&&(d||c),g&&b.getTime()!==f.getTime()||g&&!0===a||d)f=(this.curDate=f)?k.formatDate(f,this.format):null,this.$input.val(f)};return n})});