text: /**
   * better-dateinput-polyfill: input[type=date] polyfill for better-dom
   * @version 3.2.3 Tue, 18 Dec 2018 03:21:57 GMT
   * @link https://github.com/chemerisuk/better-dateinput-polyfill
   * @copyright 2018 Maksim Chemerisuk
   * @license MIT
   */
  !function(){"use strict";function t(t,e){return"en-US"===c?t:e}function e(t){return[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-")}function i(t){var e=t.split("-"),i=new Date(e[0],e[1]-1,e[2]);return isNaN(i.getTime())?null:i}function n(t,e){return"string"==typeof e?Array(t+1).join(e):Array.apply(null,Array(t)).map(e).join("")}function a(e){var i=new Date(Date.UTC(t(2001,2002),0,e));if(p)try{return i.toLocaleDateString(c,{weekday:"short"})}catch(n){}return i.toUTCString().split(",")[0].slice(0,2)}function r(t){var e=new Date(Date.UTC(2010,t));if(p)try{return e.toLocaleDateString(c,{month:"short"})}catch(i){}return e.toUTCString().split(" ")[2]}function s(t){var e=new Date(t.getFullYear(),t.getMonth(),12);if(p)try{return e.toLocaleDateString(c,{month:"long",year:"numeric"})}catch(i){}return e.toUTCString().split(" ").slice(2,4).join(" ")}var o="dateinput-picker{display:inline-block;vertical-align:bottom}dateinput-picker>object{position:absolute;z-index:1000;width:21rem;height:20rem;max-height:20rem;box-shadow:0 8px 24px #888;background:#fff;opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform-origin:0 0;transform-origin:0 0;transition:.1s ease-out}dateinput-picker[aria-hidden=true]>object{opacity:0;-webkit-transform:skew(-25deg) scaleX(.75);transform:skew(-25deg) scaleX(.75);visibility:hidden;height:0}dateinput-picker[aria-expanded=true]>object{height:13.75rem;max-height:13.75rem}dateinput-picker+input{color:transparent!important;caret-color:transparent!important}dateinput-picker+input::selection{background:none}dateinput-picker+input::-moz-selection{background:none}",l="body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:2.5rem;text-align:center;cursor:default;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0;overflow:hidden}a{position:absolute;width:3rem;height:2.5rem}a[rel=prev]{left:0}a[rel=next]{right:0}b{display:block;cursor:pointer}table{width:100%;table-layout:fixed;border-spacing:0;border-collapse:collapse;text-align:center;line-height:2.5rem}table+table{line-height:3.75rem;background:#fff;position:absolute;top:2.5rem;left:0;opacity:1;transition:.1s ease-out}table+table[aria-hidden=true]{visibility:hidden!important;opacity:0}td,th{padding:0}thead{background:#ddd;font-size:smaller;font-weight:700}[aria-selected=false],[aria-disabled=true]{color:#888}[aria-selected=true]{box-shadow:inset 0 0 0 1px #888}a:hover,td:hover,[aria-disabled=true],[aria-selected=true]{background-color:#f5f5f5}",h=DOM.find("html"),c=h.get("lang")||void 0,d="orientation"in window?"mobile":"desktop",u="mobile"===d?"touchend":"mousedown",p=function(){try{(new Date).toLocaleString("_")}catch(t){return t instanceof RangeError}return!1}(),g=function(){return"_"!==DOM.create("<input type='date'>").value("_").value()}(),f='<a rel="prev"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="100%" viewBox="0 0 16 16"><path d="M11.5 14.06L1 8L11.5 1.94z"/></svg></a><a rel="next"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="100%" viewBox="0 0 16 16"><path d="M15 8L4.5 14.06L4.5 1.94z"/></svg></a><b></b><table><thead>'+n(7,function(t,e){return"<th>"+a(e)})+"</thead><tbody>"+n(7,"<tr>"+n(7,"<td>")+"</tr>")+"</tbody></table><table><tbody>"+n(3,function(t,e){return"<tr>"+n(4,function(t,i){return"<td>"+r(4*e+i)})})+"</tbody></table>",b=DOM.findAll("meta[name^='data-format:']").reduce(function(t,e){var i=e.get("name").split(":")[1].trim(),n=JSON.parse(e.get("content"));if(i)try{t[i]=new window.Intl.DateTimeFormat(c,n)}catch(a){}return t},{});DOM.extend("input[type=date]",{constructor:function(){if(this._isPolyfillEnabled())return!1;var t=this.css(["color","font-size","font-family","font-style","line-height","padding-left","border-left-width","text-indent"]);t.dx=["padding-left","border-left-width","text-indent"].map(function(e){return parseFloat(t[e])}).reduce(function(t,e){return t+e}),t.css=["font-family","font-style","line-height","font-size"].map(function(e){return e+":"+t[e]}).join(";").replace(/"/g,""),this._backgroundTemplate=('<svg xmlns="http://www.w3.org/2000/svg"><text x="'+t.dx+'" y="50%" dy=".35em" fill="'+t.color+'"></text></svg>').replace("></",' style="'+t.css+'"></');var e=DOM.create("<dateinput-picker tabindex='-1'>");e._parentInput=this,this.before(e.hide()),this._picker=e;var i=this._syncDisplayedText.bind(this,"defaultValue"),n=this._syncDisplayedText.bind(this,"value"),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");Object.defineProperty(this[0],"value",{configurable:!1,enumerable:!0,get:a.get,set:this._setValue.bind(this,a.set,n)}),Object.defineProperty(this[0],"valueAsDate",{configurable:!1,enumerable:!0,get:this._getValueAsDate.bind(this),set:this._setValueAsDate.bind(this)}),this.on("change",n),this.on("focus",this._focusInput.bind(this)),this.on("blur",this._blurInput.bind(this)),this.on("keydown",["which"],this._keydownInput.bind(this)),this.on(u,this._focusInput.bind(this)),this.closest("form").on("reset",i),i()},_isPolyfillEnabled:function(){var t=this.get("data-polyfill");return"none"===t||(!t||t!==d&&"all"!==t?g:(this.set("type","text"),!1))},_setValue:function(t,n,a){var r=i(a);if(r){var s=i(this.get("min"))||Number.MIN_VALUE,o=i(this.get("max"))||Number.MAX_VALUE;r<s?a=e(s):r>o&&(a=e(o))}else a="";t.call(this[0],a),n()},_getValueAsDate:function(){return i(this.value())},_setValueAsDate:function(t){t instanceof Date&&!isNaN(t.getTime())&&this.value(e(t))},_syncDisplayedText:function(t){var e=this.get(t),n=i(e);if(n&&p){var a=this.get("data-format"),r=b[a];try{var s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),12);e=r?r.format(s):s.toLocaleDateString(c,a?JSON.parse(a):{})}catch(o){}}this.css("background-image","url('data:image/svg+xml,"+encodeURIComponent(this._backgroundTemplate.replace("></",">"+e+"</"))+"')")},_keydownInput:function(t){if(13===t&&"true"===this._picker.get("aria-hidden"))return!0;if(32===t)this.get("readonly")||(this._picker.toggleState(!1),this._picker.invalidateState(),"true"===this._picker.get("aria-hidden")?this._picker.show():this._picker.hide());else if(27===t||9===t||13===t)this._picker.hide();else if(8===t||46===t)this.empty().fire("change");else if(17===t)this._picker.toggleState(),this._picker.invalidateState();else{var i;if(74===t||40===t?i=7:75===t||38===t?i=-7:76===t||39===t?i=1:72!==t&&37!==t||(i=-1),i){var n=this.get("valueAsDate")||new Date,a="true"===this._picker.get("aria-expanded");!a||40!==t&&38!==t?!a||37!==t&&39!==t?n.setDate(n.getDate()+i):n.setMonth(n.getMonth()+(i>0?1:-1)):n.setMonth(n.getMonth()+(i>0?4:-4)),this.value(e(n)).fire("change")}}return 9===t},_blurInput:function(){this._picker.hide()},_focusInput:function(){if(this.get("readonly"))return!1;var t=this.offset(),e=this._picker.offset(),i=t.height;h.get("clientHeight")<t.bottom+e.height&&(i=-e.height),this._picker.toggleState(!1),this._picker.invalidateState(),this._picker.css("margin-top",i).show()}}),DOM.extend("dateinput-picker",{constructor:function(){var t="ScriptEngineMajorVersion"in window,e=DOM.create("<object type='text/html' width='100%' height='100%'>");t||e.set("data","about:blank"),this.on("load",{capture:!0,once:!0},["target"],this._loadContent.bind(this)),this.append(e),t&&e.set("data","about:blank")},_loadContent:function(t){var e=DOM.constructor(t.get("contentDocument")),i=e.find("body");e.importStyles(l),i.set(f),this._calendarDays=i.find("table"),this._calendarMonths=i.find("table+table"),this._calendarCaption=i.find("b"),this._calendarDays.on("picker:invalidate",["detail"],this._invalidateDays.bind(this)),this._calendarMonths.on("picker:invalidate",["detail"],this._invalidateMonths.bind(this)),i.on("picker:invalidate",["detail"],this._invalidateCaption.bind(this)),i.on(u,"a",["currentTarget"],this._clickPickerButton.bind(this)),i.on(u,"td",["target"],this._clickPickerDay.bind(this)),this._calendarCaption.on(u,this._clickCaption.bind(this)),i.on(u,function(){return!1}),this._parentInput.on("change",this.invalidateState.bind(this)),DOM.get("activeElement")===this._parentInput[0]&&this.show()},_invalidateDays:function(e){var n=e.getMonth(),a=e.getDate(),r=e.getFullYear(),s=i(this._parentInput.get("min"))||Number.MIN_VALUE,o=i(this._parentInput.get("max"))||Number.MAX_VALUE,l=new Date(r,n,1);l.setDate(1-l.getDay()-t(1,0===l.getDay()?7:0)),this._calendarDays.findAll("td").forEach(function(t){l.setDate(l.getDate()+1);var e=n-l.getMonth(),i=null,h=null;r!==l.getFullYear()&&(e*=-1),l<s||l>o?h="true":e>0||e<0?i="false":a===l.getDate()&&(i="true"),t._ts=l.getTime(),t.set("aria-selected",i),t.set("aria-disabled",h),t.value(l.getDate())})},_invalidateMonths:function(t){var e=t.getMonth(),n=t.getFullYear(),a=i(this._parentInput.get("min"))||Number.MIN_VALUE,r=i(this._parentInput.get("max"))||Number.MAX_VALUE,s=new Date(n,e,1);this._calendarMonths.findAll("td").forEach(function(t,i){s.setMonth(i);var n=e-s.getMonth(),o=null;s<a||s>r?o="false":n||(o="true"),t._ts=s.getTime(),t.set("aria-selected",o)})},_invalidateCaption:function(t){var e=t.getFullYear();"true"!==this.get("aria-expanded")&&(e=s(t)),this._calendarCaption.value(e)},_clickCaption:function(){this.toggleState(),this.invalidateState()},_clickPickerButton:function(t){var i="next"===t.get("rel")?1:-1,n=this._parentInput.get("valueAsDate")||new Date;"true"===this.get("aria-expanded")?n.setFullYear(n.getFullYear()+i):n.setMonth(n.getMonth()+i),this._parentInput.value(e(n)).fire("change")},_clickPickerDay:function(t){var i;"true"===this.get("aria-expanded")?(i=isNaN(t._ts)?new Date:new Date(t._ts),this.toggleState(!1)):isNaN(t._ts)||(i=new Date(t._ts),this.hide()),null!=i&&this._parentInput.value(e(i)).fire("change")},toggleState:function(t){"boolean"!=typeof t&&(t="true"!==this.get("aria-expanded")),this.set("aria-expanded",t)},invalidateState:function(){var t="true"===this.get("aria-expanded"),e=t?this._calendarMonths:this._calendarDays,i=this._parentInput.get("valueAsDate")||new Date;e.fire("picker:invalidate",i),t?this._calendarMonths.show():this._calendarMonths.hide()}}),DOM.importStyles(o)}();