From af25b26fe893aafe16515c4fcbd8e0f7e148299e Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 9 Oct 2018 19:01:34 +0300 Subject: [PATCH] Fix calendar always resetting to today instead of date entered in input (by making the component fully controlled) --- calendar-preact.js | 50 +++++++++++++++++--------------------- calendar-preact.min.js | 2 +- calendar-preact.min.js.map | 2 +- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/calendar-preact.js b/calendar-preact.js index 41cec38..d53e775 100644 --- a/calendar-preact.js +++ b/calendar-preact.js @@ -3,7 +3,7 @@ * Creates a calendar widget which can be used to select the date more easily than using just a text box * * Modified: http://yourcmc.ru/git/vitalif-js/calendar - * Version: 2018-07-01 + * Version: 2018-10-09 * License: MIT-like, http://www.openjs.com/license.php * * Example: @@ -33,28 +33,12 @@ export class Calendar extends preact.Component start: 'days', } - componentWillMount() - { - if (!this.state.mode) - this.setState({ mode: this.props.start }); - if (!this.state.year) - this.setState({ year: this.props.selected.getFullYear() }); - if (!this.state.month) - this.setState({ month: this.props.selected.getMonth() }); - } - - componentWillReceiveProps(nextProps, nextState) - { - if (this.props.mode != nextProps.mode) - this.setState({ mode: nextProps.mode }); - } - render(props, state) { return (
- {this.state.mode == 'months' ? this.renderMonths(props, state) : null} - {this.state.mode == 'years' ? this.renderYears(props, state) : null} - {this.state.mode == 'days' ? this.renderDays(props, state) : null} + {props.mode == 'months' ? this.renderMonths(props) : null} + {props.mode == 'years' ? this.renderYears(props) : null} + {props.mode == 'days' ? this.renderDays(props) : null} Calendar.hideCalendar()}>{props.close_label}
); } @@ -115,21 +99,22 @@ export class Calendar extends preact.Component showMonths(year) { - this.setState({ year, mode: 'months' }); + this.props.onChangeProps({ year, mode: 'months' }); } showYears(year) { - this.setState({ year, mode: 'years' }); + this.props.onChangeProps({ year, mode: 'years' }); } showDays(year, month) { - this.setState({ year, month, mode: 'days' }); + this.props.onChangeProps({ year, month, mode: 'days' }); } - renderMonths(props, { year }) + renderMonths(props) { + var year = props.year; var cur_y = props.today.getFullYear(); var cur_m = props.today.getMonth(); var sel_m = props.selected.getFullYear() == year ? props.selected.getMonth() : -1; @@ -155,7 +140,7 @@ export class Calendar extends preact.Component ); } - renderYears({ selected, today }, { year }) + renderYears({ selected, today, year }) { var beg = year & ~15; var cur_y = today.getFullYear(); @@ -190,9 +175,9 @@ export class Calendar extends preact.Component } /// Creates a calendar with the date given in the argument as the selected date. - renderDays(props, { year, month }) + renderDays(props) { - var { selected, selectboxes, sunday, today, month_names } = props; + var { year, month, selected, selectboxes, sunday, today, month_names } = props; // Display the table var next_month = month+1; @@ -291,7 +276,7 @@ export class Calendar extends preact.Component static showCalendar(input, options) { // Show the calendar with the date in the input as the selected date - var props = { ...options }; + var props = { ...Calendar.defaultProps, ...options }; props.selected = new Date(); var date_in_input = input.value.replace(/\s+.*$/, ''); // Remove time if (date_in_input) @@ -322,7 +307,15 @@ export class Calendar extends preact.Component } } props.today = new Date(); + props.year = props.selected.getFullYear(); + props.month = props.selected.getMonth(); + props.mode = props.start; props.input = input; + props.onChangeProps = (h) => + { + props = { ...props, ...h }; + preact.render(, Calendar.box.parentNode, Calendar.box); + }; Calendar.init(); Calendar.box.style.display = "block"; preact.render(, Calendar.box.parentNode, Calendar.box); @@ -351,6 +344,7 @@ export class Calendar extends preact.Component { Calendar.showCalendar(input_or_id, options); }); + // FIXME: Add change listener to enable interactive date selection in calendar while typing } // Will be called once when the first input is set. diff --git a/calendar-preact.min.js b/calendar-preact.min.js index 8cd0ecf..0c7a2f7 100644 --- a/calendar-preact.min.js +++ b/calendar-preact.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var r={},a=[],l=[];function i(e,t){var n,o,i,s,u=l;for(s=arguments.length;s-- >2;)a.push(arguments[s]);for(t&&null!=t.children&&(a.length||a.push(t.children),delete t.children);a.length;)if((o=a.pop())&&void 0!==o.pop)for(s=o.length;s--;)a.push(o[s]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&n?u[u.length-1]+=o:u===l?u=[o]:u.push(o),n=i;var c=new function(){};return c.nodeName=e,c.children=u,c.attributes=null==t?void 0:t,c.key=null==t?void 0:t.key,void 0!==r.vnode&&r.vnode(c),c}function s(e,t){for(var n in t)e[n]=t[n];return e}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return i(e.nodeName,s(s({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function p(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(r.debounceRendering||u)(h)}function h(){var e,t=f;for(f=[];e=t.pop();)e._dirty&&L(e)}function v(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&m(e,t.nodeName):n||e._componentConstructor===t.nodeName}function m(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=s({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n,r,a){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||a)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"===(void 0===r?"undefined":o(r))){if("string"!=typeof n)for(var l in n)l in r||(e.style[l]="");for(var l in r)e.style[l]="number"==typeof r[l]&&!1===d.test(l)?r[l]+"px":r[l]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var i=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,g,i):e.removeEventListener(t,g,i),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!a&&t in e)!function(e,t,n){try{e[t]=n}catch(e){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=a&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function g(e){return this._listeners[e.type](r.event&&r.event(e)||e)}var w=[],x=0,k=!1,C=!1;function N(){for(var e;e=w.pop();)r.afterMount&&r.afterMount(e),e.componentDidMount&&e.componentDidMount()}function S(e,t,n,o,r,a){x++||(k=null!=r&&void 0!==r.ownerSVGElement,C=null!=e&&!("__preactattr_"in e));var l=M(e,t,n,o,a);return r&&l.parentNode!==r&&r.appendChild(l),--x||(C=!1,a||N()),l}function M(e,t,n,o,r){var a=e,l=k;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),j(e,!0))),a.__preactattr_=!0,a;var i=t.nodeName;if("function"==typeof i)return function(e,t,n,o){var r=e&&e._component,a=r,l=e,i=r&&e._componentConstructor===t.nodeName,s=i,u=y(t);for(;r&&!s&&(r=r._parentComponent);)s=r.constructor===t.nodeName;r&&s&&(!o||r._component)?(T(r,u,3,n,o),e=r.base):(a&&!i&&(Y(a),e=l=null),r=P(t.nodeName,u,n),e&&!r.nextBase&&(r.nextBase=e,l=null),T(r,u,1,n,o),e=r.base,l&&e!==l&&(l._component=null,j(l,!1)));return e}(e,t,n,o);if(k="svg"===i||"foreignObject"!==i&&k,i=String(i),(!e||!m(e,i))&&(a=function(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}(i,k),e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),j(e,!0)}var s=a.firstChild,u=a.__preactattr_,c=t.children;if(null==u){u=a.__preactattr_={};for(var d=a.attributes,f=d.length;f--;)u[d[f].name]=d[f].value}return!C&&c&&1===c.length&&"string"==typeof c[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=c[0]&&(s.nodeValue=c[0]):(c&&c.length||null!=s)&&function(e,t,n,o,r){var a,l,i,s,u,c=e.childNodes,d=[],f={},p=0,h=0,m=c.length,y=0,b=t?t.length:0;if(0!==m)for(var g=0;g=(document.body.clientHeight||document.documentElement.clientHeight)&&o.top-n.offsetHeight>=0?n.style.top=o.top-n.offsetHeight+"px":n.style.top=o.top+r-1+"px"}},{key:"selectDate",value:function(e,n,o){var r=this.props.input,a=r.value.split(/\s+/,2)[1]||"";if(a&&(a=" "+a),(n=Number(n)+1)<10&&(n="0"+n),o<10&&(o="0"+o),this.props.callback)a=e+"-"+n+"-"+o+a,(0,this.props.callback)(new Date(a));else if(a=("Y-m-d"==this.format?e+"-"+n+"-"+o:o+"."+n+"."+e)+a,r.value=a,"Event"in window){var l=document.createEvent("Event");l.initEvent("change",!0,!0),r.dispatchEvent(l)}else r.fireEvent("onchange");t.hideCalendar()}},{key:"showMonths",value:function(e){this.setState({year:e,mode:"months"})}},{key:"showYears",value:function(e){this.setState({year:e,mode:"years"})}},{key:"showDays",value:function(e,t){this.setState({year:e,month:t,mode:"days"})}},{key:"renderMonths",value:function(e,t){var n=this,o=t.year,r=e.today.getFullYear(),l=e.today.getMonth(),i=e.selected.getFullYear()==o?e.selected.getMonth():-1;return a.default.h("table",null,a.default.h("tr",null,a.default.h("th",{colspan:"4",class:"calendar-title"},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showMonths(o-1)},title:o-1,class:"prev"}),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showYears(o)}},o),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showMonths(o+1)},title:o+1,class:"next"}))),[[0,1,2],[3,4,5],[6,7,8],[9,10,11]].map(function(t){return a.default.h("tr",null,t.map(function(t){return a.default.h("td",{class:"months "+(or||o==r&&t>l?"future":"today")+(t==i?" selected":"")},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showDays(o,t)}},e.month_names[t]))}))}))}},{key:"renderYears",value:function(e,t){var n=this,o=e.selected,r=e.today,l=t.year,i=-16&l,s=r.getFullYear(),u=o.getFullYear();return a.default.h("table",null,a.default.h("tr",null,a.default.h("th",{colspan:"4",class:"calendar-title"},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showYears(l-16)},title:i-16+" - "+(i-1),class:"prev"}),a.default.h("b",null,i+" - "+(i+15)),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showYears(l+16)},title:i+16+" - "+(i+31),class:"next"}))),[0,1,2,3].map(function(e){return a.default.h("tr",null,[0,1,2,3].map(function(t){var o=i+t+4*e,r=(os?"future":"today")+(o==u?" selected":"");return a.default.h("td",{class:"years "+r},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showMonths(o)}},o))}))}))}},{key:"_yearOptions",value:function(e,t,n){for(var o=[],r=e;r=12&&(d=0,f++);var p=r-1,h=o;p<0&&(p=11,h--);var v=u.getFullYear(),m=(new Date(o,r,1).getDay()+s)%7,y=2==r?o%4||!(o%100)&&o%400?28:29:r<7==!(1&r)?31:30,_=u.getFullYear(),b=o-_||r-u.getMonth(),g=l&&o==l.getFullYear()&&r==l.getMonth()?l.getDate():-1;return a.default.h("table",null,a.default.h("tr",null,a.default.h("th",{colspan:"7",class:"calendar-title"},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showDays(h,p)},title:c[p]+" "+h,class:"prev"}),i?[a.default.h("select",{name:"calendar-month",class:"calendar-month",onchange:function(e){return n.showDays(o,e.target.value)}},c.map(function(e,t){return a.default.h("option",{value:t,selected:t==r},e)})),a.default.h("select",{name:"calendar-year",class:"calendar-year",onchange:function(e){return n.showDays(e.target.value,r)}},this._yearOptions(v+e.years.min,v+e.years.max,o))]:[a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showMonths(o,r)}},c[r]),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showYears(o)}},o)],a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.showDays(f,d)},title:e.month_names[d]+" "+f,class:"next"}))),a.default.h("tr",{class:"header"},e.weekdays.map(function(e){return a.default.h("td",null,e)})),[0,1,2,3,4].map(function(t){return 7*t0||l>=m)&&i<=y){var s="days",c=b||i-u.getDate();return s+=c<0?" past":c?" future":" today",i==g&&(s+=" selected"),s+=" "+e.weekdayIds[l].toLowerCase(),a.default.h("td",{class:s},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return n.selectDate(o,r,i)}},i))}return a.default.h("td",{class:"days"}," ")})):null}))}}],[{key:"showCalendar",value:function(e,n){var r=o({},n);r.selected=new Date;var l=e.value.replace(/\s+.*$/,"");if(l){var i=!1,s=l.split("-");3==s.length?(s[1]--,i=new Date(s[0],s[1],s[2])):1==s.length&&3==(s=l.split(".")).length&&(s[1]--,i=new Date(s[2],s[1],s[0])),i&&!isNaN(i.getFullYear())&&(r.selected=i)}r.today=new Date,r.input=e,t.init(),t.box.style.display="block",a.default.render(a.default.h(t,r),t.box.parentNode,t.box)}},{key:"hideCalendar",value:function(){t.box&&(t.box.style.display="none")}},{key:"set",value:function(e,n){"string"==typeof e&&(e=document.getElementById(e)),e&&e.addEventListener("focus",function(o){t.showCalendar(e,n)})}},{key:"init",value:function(){if(!t.box||!t.box.parentNode){var e=document.createElement("div");t.box||(t.box=e),e.className="calendar-box",e.addEventListener("mousedown",function(e){return(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0,!0}),document.getElementsByTagName("body")[0].insertBefore(e,document.getElementsByTagName("body")[0].firstChild),t.addedListener||(document.addEventListener("mousedown",function(){t.hideCalendar()}),t.addedListener=!0)}}}]),t}();l.defaultProps={month_names:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],close_label:"Закрыть",weekdays:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],weekdayIds:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],sunday:6,selectboxes:!1,years:{min:-70,max:10},format:"d.m.Y",today:new Date,start:"days"},window.Calendar=l},function(e,t,n){e.exports=n(1)}]); +!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var r={},a=[],l=[];function i(e,t){var n,o,i,u,s=l;for(u=arguments.length;u-- >2;)a.push(arguments[u]);for(t&&null!=t.children&&(a.length||a.push(t.children),delete t.children);a.length;)if((o=a.pop())&&void 0!==o.pop)for(u=o.length;u--;)a.push(o[u]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&n?s[s.length-1]+=o:s===l?s=[o]:s.push(o),n=i;var c=new function(){};return c.nodeName=e,c.children=s,c.attributes=null==t?void 0:t,c.key=null==t?void 0:t.key,void 0!==r.vnode&&r.vnode(c),c}function u(e,t){for(var n in t)e[n]=t[n];return e}var s="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return i(e.nodeName,u(u({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function p(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(r.debounceRendering||s)(h)}function h(){var e,t=f;for(f=[];e=t.pop();)e._dirty&&L(e)}function v(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&m(e,t.nodeName):n||e._componentConstructor===t.nodeName}function m(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=u({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function b(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,n,r,a){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||a)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"===(void 0===r?"undefined":o(r))){if("string"!=typeof n)for(var l in n)l in r||(e.style[l]="");for(var l in r)e.style[l]="number"==typeof r[l]&&!1===d.test(l)?r[l]+"px":r[l]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var i=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,g,i):e.removeEventListener(t,g,i),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!a&&t in e)!function(e,t,n){try{e[t]=n}catch(e){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var u=a&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?u?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(u?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function g(e){return this._listeners[e.type](r.event&&r.event(e)||e)}var w=[],x=0,C=!1,k=!1;function N(){for(var e;e=w.pop();)r.afterMount&&r.afterMount(e),e.componentDidMount&&e.componentDidMount()}function M(e,t,n,o,r,a){x++||(C=null!=r&&void 0!==r.ownerSVGElement,k=null!=e&&!("__preactattr_"in e));var l=j(e,t,n,o,a);return r&&l.parentNode!==r&&r.appendChild(l),--x||(k=!1,a||N()),l}function j(e,t,n,o,r){var a=e,l=C;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),P(e,!0))),a.__preactattr_=!0,a;var i=t.nodeName;if("function"==typeof i)return function(e,t,n,o){var r=e&&e._component,a=r,l=e,i=r&&e._componentConstructor===t.nodeName,u=i,s=y(t);for(;r&&!u&&(r=r._parentComponent);)u=r.constructor===t.nodeName;r&&u&&(!o||r._component)?(T(r,s,3,n,o),e=r.base):(a&&!i&&(Y(a),e=l=null),r=E(t.nodeName,s,n),e&&!r.nextBase&&(r.nextBase=e,l=null),T(r,s,1,n,o),e=r.base,l&&e!==l&&(l._component=null,P(l,!1)));return e}(e,t,n,o);if(C="svg"===i||"foreignObject"!==i&&C,i=String(i),(!e||!m(e,i))&&(a=function(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}(i,C),e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),P(e,!0)}var u=a.firstChild,s=a.__preactattr_,c=t.children;if(null==s){s=a.__preactattr_={};for(var d=a.attributes,f=d.length;f--;)s[d[f].name]=d[f].value}return!k&&c&&1===c.length&&"string"==typeof c[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=c[0]&&(u.nodeValue=c[0]):(c&&c.length||null!=u)&&function(e,t,n,o,r){var a,l,i,u,s,c=e.childNodes,d=[],f={},p=0,h=0,m=c.length,y=0,_=t?t.length:0;if(0!==m)for(var g=0;g=(document.body.clientHeight||document.documentElement.clientHeight)&&o.top-n.offsetHeight>=0?n.style.top=o.top-n.offsetHeight+"px":n.style.top=o.top+r-1+"px"}},{key:"selectDate",value:function(e,n,o){var r=this.props.input,a=r.value.split(/\s+/,2)[1]||"";if(a&&(a=" "+a),(n=Number(n)+1)<10&&(n="0"+n),o<10&&(o="0"+o),this.props.callback)a=e+"-"+n+"-"+o+a,(0,this.props.callback)(new Date(a));else if(a=("Y-m-d"==this.format?e+"-"+n+"-"+o:o+"."+n+"."+e)+a,r.value=a,"Event"in window){var l=document.createEvent("Event");l.initEvent("change",!0,!0),r.dispatchEvent(l)}else r.fireEvent("onchange");t.hideCalendar()}},{key:"showMonths",value:function(e){this.props.onChangeProps({year:e,mode:"months"})}},{key:"showYears",value:function(e){this.props.onChangeProps({year:e,mode:"years"})}},{key:"showDays",value:function(e,t){this.props.onChangeProps({year:e,month:t,mode:"days"})}},{key:"renderMonths",value:function(e){var t=this,n=e.year,o=e.today.getFullYear(),r=e.today.getMonth(),l=e.selected.getFullYear()==n?e.selected.getMonth():-1;return a.default.h("table",null,a.default.h("tr",null,a.default.h("th",{colspan:"4",class:"calendar-title"},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n-1)},title:n-1,class:"prev"}),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(n)}},n),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n+1)},title:n+1,class:"next"}))),[[0,1,2],[3,4,5],[6,7,8],[9,10,11]].map(function(i){return a.default.h("tr",null,i.map(function(i){return a.default.h("td",{class:"months "+(no||n==o&&i>r?"future":"today")+(i==l?" selected":"")},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(n,i)}},e.month_names[i]))}))}))}},{key:"renderYears",value:function(e){var t=this,n=e.selected,o=e.today,r=e.year,l=-16&r,i=o.getFullYear(),u=n.getFullYear();return a.default.h("table",null,a.default.h("tr",null,a.default.h("th",{colspan:"4",class:"calendar-title"},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(r-16)},title:l-16+" - "+(l-1),class:"prev"}),a.default.h("b",null,l+" - "+(l+15)),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(r+16)},title:l+16+" - "+(l+31),class:"next"}))),[0,1,2,3].map(function(e){return a.default.h("tr",null,[0,1,2,3].map(function(n){var o=l+n+4*e,r=(oi?"future":"today")+(o==u?" selected":"");return a.default.h("td",{class:"years "+r},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(o)}},o))}))}))}},{key:"_yearOptions",value:function(e,t,n){for(var o=[],r=e;r=12&&(c=0,d++);var f=o-1,p=n;f<0&&(f=11,p--);var h=u.getFullYear(),v=(new Date(n,o,1).getDay()+i)%7,m=2==o?n%4||!(n%100)&&n%400?28:29:o<7==!(1&o)?31:30,y=u.getFullYear(),b=n-y||o-u.getMonth(),_=r&&n==r.getFullYear()&&o==r.getMonth()?r.getDate():-1;return a.default.h("table",null,a.default.h("tr",null,a.default.h("th",{colspan:"7",class:"calendar-title"},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(p,f)},title:s[f]+" "+p,class:"prev"}),l?[a.default.h("select",{name:"calendar-month",class:"calendar-month",onchange:function(e){return t.showDays(n,e.target.value)}},s.map(function(e,t){return a.default.h("option",{value:t,selected:t==o},e)})),a.default.h("select",{name:"calendar-year",class:"calendar-year",onchange:function(e){return t.showDays(e.target.value,o)}},this._yearOptions(h+e.years.min,h+e.years.max,n))]:[a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n,o)}},s[o]),a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(n)}},n)],a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(d,c)},title:e.month_names[c]+" "+d,class:"next"}))),a.default.h("tr",{class:"header"},e.weekdays.map(function(e){return a.default.h("td",null,e)})),[0,1,2,3,4].map(function(r){return 7*r0||l>=v)&&i<=m){var s="days",c=b||i-u.getDate();return s+=c<0?" past":c?" future":" today",i==_&&(s+=" selected"),s+=" "+e.weekdayIds[l].toLowerCase(),a.default.h("td",{class:s},a.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.selectDate(n,o,i)}},i))}return a.default.h("td",{class:"days"}," ")})):null}))}}],[{key:"showCalendar",value:function(e,n){var r=o({},t.defaultProps,n);r.selected=new Date;var l=e.value.replace(/\s+.*$/,"");if(l){var i=!1,u=l.split("-");3==u.length?(u[1]--,i=new Date(u[0],u[1],u[2])):1==u.length&&3==(u=l.split(".")).length&&(u[1]--,i=new Date(u[2],u[1],u[0])),i&&!isNaN(i.getFullYear())&&(r.selected=i)}r.today=new Date,r.year=r.selected.getFullYear(),r.month=r.selected.getMonth(),r.mode=r.start,r.input=e,r.onChangeProps=function(e){r=o({},r,e),a.default.render(a.default.h(t,r),t.box.parentNode,t.box)},t.init(),t.box.style.display="block",a.default.render(a.default.h(t,r),t.box.parentNode,t.box)}},{key:"hideCalendar",value:function(){t.box&&(t.box.style.display="none")}},{key:"set",value:function(e,n){"string"==typeof e&&(e=document.getElementById(e)),e&&e.addEventListener("focus",function(o){t.showCalendar(e,n)})}},{key:"init",value:function(){if(!t.box||!t.box.parentNode){var e=document.createElement("div");t.box||(t.box=e),e.className="calendar-box",e.addEventListener("mousedown",function(e){return(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0,!0}),document.getElementsByTagName("body")[0].insertBefore(e,document.getElementsByTagName("body")[0].firstChild),t.addedListener||(document.addEventListener("mousedown",function(){t.hideCalendar()}),t.addedListener=!0)}}}]),t}();l.defaultProps={month_names:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],close_label:"Закрыть",weekdays:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],weekdayIds:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],sunday:6,selectboxes:!1,years:{min:-70,max:10},format:"d.m.Y",today:new Date,start:"days"},window.Calendar=l},function(e,t,n){e.exports=n(1)}]); //# sourceMappingURL=calendar-preact.min.js.map \ No newline at end of file diff --git a/calendar-preact.min.js.map b/calendar-preact.min.js.map index aeb6397..13ee889 100644 --- a/calendar-preact.min.js.map +++ b/calendar-preact.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/preact/dist/preact.esm.js","webpack:///./calendar-preact.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","options","stack","EMPTY_CHILDREN","h","nodeName","attributes","lastSimple","child","simple","children","arguments","length","push","pop","undefined","String","vnode","extend","obj","props","defer","Promise","resolve","then","setTimeout","cloneElement","slice","IS_NON_DIMENSIONAL","items","enqueueRender","component","_dirty","debounceRendering","rerender","list","renderComponent","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","removeNode","parentNode","removeChild","setAccessor","old","isSvg","style","cssText","_typeof","test","innerHTML","__html","useCapture","replace","substring","addEventListener","eventProxy","removeEventListener","_listeners","e","setProperty","removeAttribute","removeAttributeNS","setAttributeNS","setAttribute","className","this","type","event","mounts","diffLevel","isSvgMode","flushMounts","afterMount","componentDidMount","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","document","createTextNode","replaceChild","recollectNodeTree","vnodeName","originalComponent","oldDom","isDirectOwner","isOwner","_parentComponent","constructor","setComponentProps","base","unmountComponent","createComponent","nextBase","buildComponentFromVNode","createElementNS","createElement","createNode","firstChild","fc","vchildren","a","nextSibling","isHydrating","j","f","vchild","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","_child","__key","trim","insertBefore","innerDiffNode","dangerouslySetInnerHTML","attrs","diffAttributes","unmountOnly","ref","removeChildren","lastChild","next","previousSibling","components","Ctor","inst","render","Component","doRender","splice","state","opts","_disable","__ref","componentWillMount","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","shouldComponentUpdate","componentWillUpdate","getChildContext","toUnmount","childComponent","childProps","baseParent","componentRef","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","beforeUnmount","componentWillUnmount","inner","collectComponent","merge","setState","callback","forceUpdate","preact","Calendar","start","year","selected","getFullYear","month","getMonth","nextProps","nextState","_preact2","default","class","display","renderMonths","renderYears","renderDays","onclick","hideCalendar","close_label","input","div","box","xy","elem","getBoundingClientRect","body","docElem","documentElement","scrollTop","window","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","top","left","Math","round","getOffsetRect","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetSum","getOffset","height","clientHeight","offsetHeight","day","split","Number","Date","format","evt","createEvent","initEvent","dispatchEvent","fireEvent","_this2","_ref","cur_y","today","cur_m","sel_m","colspan","href","showMonths","title","showYears","map","g","showDays","month_names","_this3","_ref2","_ref3","beg","sel_y","class_name","max","_this4","_ref4","selectboxes","sunday","next_month","next_month_year","previous_month","previous_month_year","current_year","start_day","getDay","days_in_this_month","yea","all_diff","sel_day","getDate","onchange","target","_yearOptions","years","weekdays","weekdayIds","selectDate","date_in_input","selected_date","date_parts","isNaN","init","input_or_id","getElementById","ev","showCalendar","stopPropagation","cancelBubble","getElementsByTagName","addedListener"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EA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EAAS4G,OACT5G,EAASqB,IAAInK,MAAM0J,QAAU,QAC7Bb,UAAO5C,OAAOsD,EAAAC,QAAAzM,EAAC+L,EAAa/K,GAAW+K,EAASqB,IAAIxK,WAAYmJ,EAASqB,4CAMpErB,EAASqB,MAEdrB,EAASqB,IAAInK,MAAM0J,QAAU,oCAInBiG,EAAa/S,GAEG,iBAAf+S,IAEVA,EAAchN,SAASiN,eAAeD,IAElCA,GAILA,EAAYlP,iBAAiB,QAAS,SAASoP,GAE9C/G,EAASgH,aAAaH,EAAa/S,oCAOpC,IAAKkM,EAASqB,MAAQrB,EAASqB,IAAIxK,WACnC,CACC,IAAIuK,EAAMvH,SAASkB,cAAc,OAC5BiF,EAASqB,MACbrB,EAASqB,IAAMD,GAChBA,EAAI/I,UAAY,eAChB+I,EAAIzJ,iBAAiB,YAAa,SAASoP,GAO1C,OALAA,EAAKA,GAAMlF,OAAOrJ,OACXyO,gBACNF,EAAGE,kBAEHF,EAAGG,cAAe,GACZ,IAERrN,SAASsN,qBAAqB,QAAQ,GAAG9K,aAAa+E,EAAKvH,SAASsN,qBAAqB,QAAQ,GAAGlM,YAC/F+E,EAASoH,gBAEbvN,SAASlC,iBAAiB,YAAa,WAAaqI,EAASiB,iBAC7DjB,EAASoH,eAAgB,aAvWhBpH,EAGLrJ,cACN8N,aAAc,SAAS,UAAU,OAAO,SAAS,MAAM,OAAO,OAAO,SAAS,WAAW,UAAU,SAAS,WAC5GvD,YAAa,UACbmF,UAAW,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,MACzCC,YAAa,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,OACjDlB,OAAQ,EACRD,aAAa,EACbiB,OAAStK,KAAM,GAAIkJ,IAAK,IACxB3B,OAAQ,QAERS,MAAO,IAAIV,KACXnD,MAAO,QA+VT4B,OAAO7B,SAAWA","file":"./calendar-preact.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","/** Virtual DOM Node */\nfunction VNode() {}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nvar options = {\n\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t// afterMount(component) { }\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t// afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `
Hello!
`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\n// DOM properties that should NOT have \"px\" added when numeric\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n/** Managed queue of dirty components to be re-rendered */\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p,\n\t list = items;\n\titems = [];\n\twhile (p = list.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nfunction isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined;\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n }\n return hydrating || node._componentConstructor === vnode.nodeName;\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nfunction isNamedNode(node, nodeName) {\n return node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nfunction getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n\n var defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (var i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {\n\t\t// ignore\n\t} else if (name === 'ref') {\n\t\tif (old) old(null);\n\t\tif (value) value(node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\tsetProperty(node, name, value == null ? '' : value);\n\t\tif (value == null || value === false) node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n\ttry {\n\t\tnode[name] = value;\n\t} catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nvar mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nvar diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nvar isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nvar hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\t// If the VNode represents a Component, perform a component diff:\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t} // if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\t// attempt to find a node based on key matching\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt to pluck a node of the same type from the existing children\n\t\t\telse if (!child && min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove unused keyed children:\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\t// remove orphaned unkeyed children:\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\n\t\tunmountComponent(component);\n\t} else {\n\t\t// If the node's VNode had a ref function, invoke it with null here.\n\t\t// (this is part of the React spec, and smart for unsetting references)\n\t\tif (node['__preactattr_'] != null && node['__preactattr_'].ref) node['__preactattr_'].ref(null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\t// remove attributes no longer present on the vnode by setting them to undefined\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\t// add new & update changed attributes\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nvar components = {};\n\n/** Reclaim a component for later re-use by the recycler. */\nfunction collectComponent(component) {\n\tvar name = component.constructor.name;\n\t(components[name] || (components[name] = [])).push(component);\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nfunction createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nfunction setComponentProps(component, props, opts, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tif (component.__ref = props.ref) delete props.ref;\n\tif (component.__key = props.key) delete props.key;\n\n\tif (!component.base || mountAll) {\n\t\tif (component.componentWillMount) component.componentWillMount();\n\t} else if (component.componentWillReceiveProps) {\n\t\tcomponent.componentWillReceiveProps(props, context);\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (opts !== 0) {\n\t\tif (opts === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tif (component.__ref) component.__ref(component);\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nfunction renderComponent(component, opts, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t rendered,\n\t inst,\n\t cbase;\n\n\t// if updating\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (opts !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\t// context to pass to the child, can be updated via (grand-)parent component\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\t\t\t// set up high order component link\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\t// destroy high order component link\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || opts === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.unshift(component);\n\t} else if (!skip) {\n\t\t// Ensure that pending componentDidMount() hooks of child components\n\t\t// are called before the componentDidUpdate() hook in the parent.\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n\t\t// flushMounts();\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\tif (component._renderCallbacks != null) {\n\t\twhile (component._renderCallbacks.length) {\n\t\t\tcomponent._renderCallbacks.pop().call(component);\n\t\t}\n\t}\n\n\tif (!diffLevel && !isChild) flushMounts();\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\t// recursively tear down & recollect high-order component children:\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\tcollectComponent(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tif (component.__ref) component.__ref(null);\n}\n\n/** Base Component class.\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\n *\t@public\n *\n *\t@example\n *\tclass MyFoo extends Component {\n *\t\trender(props, state) {\n *\t\t\treturn
;\n *\t\t}\n *\t}\n */\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.context = context;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.props = props;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.state = this.state || {};\n}\n\nextend(Component.prototype, {\n\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\n *\t@param {object} nextProps\n *\t@param {object} nextState\n *\t@param {object} nextContext\n *\t@returns {Boolean} should the component re-render\n *\t@name shouldComponentUpdate\n *\t@function\n */\n\n\t/** Update component state by copying properties from `state` to `this.state`.\n *\t@param {object} state\t\tA hash of state properties to update with new values\n *\t@param {function} callback\tA function to be called once component state is updated\n */\n\tsetState: function setState(state, callback) {\n\t\tvar s = this.state;\n\t\tif (!this.prevState) this.prevState = extend({}, s);\n\t\textend(s, typeof state === 'function' ? state(s, this.props) : state);\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/** Immediately perform a synchronous re-render of the component.\n *\t@param {function} callback\t\tA function to be called after component is re-rendered.\n *\t@private\n */\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\n\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\n *\t@param {object} state\t\tThe component's current state\n *\t@param {object} context\t\tContext object (if a parent component has provided context)\n *\t@returns VNode\n */\n\trender: function render() {}\n});\n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\n *\t@public\n *\n *\t@example\n *\t// render a div into :\n *\trender(
hello!
, document.body);\n *\n *\t@example\n *\t// render a \"Thing\" component into #foo:\n *\tconst Thing = ({ name }) => { name };\n *\trender(, document.querySelector('#foo'));\n */\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, Component, render, rerender, options };\n//# sourceMappingURL=preact.esm.js.map\n","/**\n * Calendar Script\n * Creates a calendar widget which can be used to select the date more easily than using just a text box\n *\n * Modified: http://yourcmc.ru/git/vitalif-js/calendar\n * Version: 2018-07-01\n * License: MIT-like, http://www.openjs.com/license.php\n *\n * Example:\n * \n * \n */\n\nimport preact from 'preact';\n/** @jsx preact.h */\n\nexport class Calendar extends preact.Component\n{\n\t// Configuration\n\tstatic defaultProps = {\n\t\tmonth_names: [\"Январь\",\"Февраль\",\"Март\",\"Апрель\",\"Май\",\"Июнь\",\"Июль\",\"Август\",\"Сентябрь\",\"Октябрь\",\"Ноябрь\",\"Декабрь\"],\n\t\tclose_label: 'Закрыть',\n\t\tweekdays: [\"Пн\",\"Вт\",\"Ср\",\"Чт\",\"Пт\",\"Сб\",\"Вс\"],\n\t\tweekdayIds: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],\n\t\tsunday: 6,\n\t\tselectboxes: false, // true: use selectboxes for year and month, false: show months and years in table\n\t\tyears: { min: -70, max: 10 }, // range of displayed years if selectboxes==true\n\t\tformat: 'd.m.Y', // either d.m.Y or Y-m-d, other formats are not supported\n\t\t// Today's date\n\t\ttoday: new Date(),\n\t\tstart: 'days',\n\t}\n\n\tcomponentWillMount()\n\t{\n\t\tif (!this.state.mode)\n\t\t\tthis.setState({ mode: this.props.start });\n\t\tif (!this.state.year)\n\t\t\tthis.setState({ year: this.props.selected.getFullYear() });\n\t\tif (!this.state.month)\n\t\t\tthis.setState({ month: this.props.selected.getMonth() });\n\t}\n\n\tcomponentWillReceiveProps(nextProps, nextState)\n\t{\n\t\tif (this.props.mode != nextProps.mode)\n\t\t\tthis.setState({ mode: nextProps.mode });\n\t}\n\n\trender(props, state)\n\t{\n\t\treturn (
\n\t\t\t{this.state.mode == 'months' ? this.renderMonths(props, state) : null}\n\t\t\t{this.state.mode == 'years' ? this.renderYears(props, state) : null}\n\t\t\t{this.state.mode == 'days' ? this.renderDays(props, state) : null}\n\t\t\t Calendar.hideCalendar()}>{props.close_label}\n\t\t
);\n\t}\n\n\tcomponentDidMount()\n\t{\n\t\tthis.componentDidUpdate();\n\t}\n\n\tcomponentDidUpdate()\n\t{\n\t\t// Position the div in the correct location...\n\t\tvar input = this.props.input;\n\t\tvar div = Calendar.box;\n\t\tvar xy = getOffset(input);\n\t\tvar height = input.clientHeight||input.offsetHeight;\n\t\tdiv.style.left = (xy.left-1)+\"px\";\n\t\tif (div.offsetHeight + xy.top+height-1 >= (document.body.clientHeight||document.documentElement.clientHeight) &&\n\t\t\txy.top-div.offsetHeight >= 0)\n\t\t\tdiv.style.top = (xy.top-div.offsetHeight)+'px';\n\t\telse\n\t\t\tdiv.style.top = (xy.top+height-1)+\"px\";\n\t}\n\n\t/// Called when the user clicks on a date in the calendar.\n\tselectDate(year, month, day)\n\t{\n\t\tvar i = this.props.input;\n\t\tvar t = i.value.split(/\\s+/, 2)[1]||'';\n\t\tif (t)\n\t\t\tt = ' '+t;\n\t\tmonth = Number(month)+1;\n\t\tif (month < 10)\n\t\t\tmonth = '0'+month;\n\t\tif (day < 10)\n\t\t\tday = '0'+day;\n\t\tif (this.props.callback)\n\t\t{\n\t\t\tvar c = this.props.callback;\n\t\t\tt = year + '-' + month + '-' + day + t;\n\t\t\tc(new Date(t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tt = (this.format == 'Y-m-d' ? year + '-' + month + '-' + day : day + '.' + month + '.' + year) + t;\n\t\t\ti.value = t;\n\t\t\tif (\"Event\" in window)\n\t\t\t{\n\t\t\t\tvar evt = document.createEvent('Event');\n\t\t\t\tevt.initEvent('change', true, true);\n\t\t\t\ti.dispatchEvent(evt);\n\t\t\t}\n\t\t\telse\n\t\t\t\ti.fireEvent(\"onchange\");\n\t\t}\n\t\tCalendar.hideCalendar();\n\t}\n\n\tshowMonths(year)\n\t{\n\t\tthis.setState({ year, mode: 'months' });\n\t}\n\n\tshowYears(year)\n\t{\n\t\tthis.setState({ year, mode: 'years' });\n\t}\n\n\tshowDays(year, month)\n\t{\n\t\tthis.setState({ year, month, mode: 'days' });\n\t}\n\n\trenderMonths(props, { year })\n\t{\n\t\tvar cur_y = props.today.getFullYear();\n\t\tvar cur_m = props.today.getMonth();\n\t\tvar sel_m = props.selected.getFullYear() == year ? props.selected.getMonth() : -1;\n\t\tvar months = [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ], [ 9, 10, 11 ] ];\n\t\treturn (\n\t\t\t\n\t\t\t{months.map(g => (\n\t\t\t\t{g.map(i => (\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showMonths(year-1)} title={(year-1)} class='prev'>\n\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t this.showMonths(year+1)} title={(year+1)} class='next'>\n\t\t\t
cur_y || year == cur_y && i > cur_m ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_m ? ' selected' : '')}>\n\t\t\t\t\t\t this.showDays(year, i)}>\n\t\t\t\t\t\t\t{props.month_names[i]}\n\t\t\t\t\t\t\n\t\t\t\t\t
);\n\t}\n\n\trenderYears({ selected, today }, { year })\n\t{\n\t\tvar beg = year & ~15;\n\t\tvar cur_y = today.getFullYear();\n\t\tvar sel_y = selected.getFullYear();\n\t\treturn (\n\t\t\t\n\t\t\t{[0, 1, 2, 3].map(r => (\n\t\t\t\t\n\t\t\t\t{[0, 1, 2, 3].map(j => {\n\t\t\t\t\tvar i = beg + j + r*4;\n\t\t\t\t\tvar class_name = (i < cur_y ? 'past' : (i > cur_y ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_y ? ' selected' : '');\n\t\t\t\t\treturn ();\n\t\t\t\t})}\n\t\t\t\t\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showYears(year-16)} title={(beg-16)+\" - \"+(beg-1)} class='prev'>\n\t\t\t\t{beg+' - '+(beg+15)}\n\t\t\t\t this.showYears(year+16)} title={(beg+16)+\" - \"+(beg+31)} class='next'>\n\t\t\t
\n\t\t\t\t\t\t this.showMonths(i)}>{i}\n\t\t\t\t\t
);\n\t}\n\n\t_yearOptions(min, max, year)\n\t{\n\t\tvar r = [];\n\t\tfor (var i = min; i < max; i++)\n\t\t\tr.push();\n\t\treturn r;\n\t}\n\n\t/// Creates a calendar with the date given in the argument as the selected date.\n\trenderDays(props, { year, month })\n\t{\n\t\tvar { selected, selectboxes, sunday, today, month_names } = props;\n\n\t\t// Display the table\n\t\tvar next_month = month+1;\n\t\tvar next_month_year = year;\n\t\tif (next_month >= 12)\n\t\t{\n\t\t\tnext_month = 0;\n\t\t\tnext_month_year++;\n\t\t}\n\n\t\tvar previous_month = month-1;\n\t\tvar previous_month_year = year;\n\t\tif (previous_month < 0)\n\t\t{\n\t\t\tprevious_month = 11;\n\t\t\tprevious_month_year--;\n\t\t}\n\n\t\tvar current_year = today.getFullYear();\n\n\t\t// Get the first day of this month\n\t\tvar first_day = new Date(year, month, 1);\n\t\tvar start_day = (first_day.getDay()+sunday)%7;\n\n\t\tvar d = 1;\n\t\tvar flag = 0;\n\n\t\t// Leap year support\n\t\tvar days_in_this_month = (month == 2\n\t\t\t? (!(year % 4) && ((year % 100) || !(year % 400)) ? 29 : 28)\n\t\t\t: ((month < 7) == !(month & 1) ? 31 : 30));\n\n\t\tvar yea = today.getFullYear();\n\t\tvar all_diff = (year - yea) || (month - today.getMonth());\n\t\tvar sel_day = selected && year == selected.getFullYear() && month == selected.getMonth() ? selected.getDate() : -1;\n\n\t\treturn (\n\t\t\t\n\t\t\t\n\t\t\t\t{props.weekdays.map(name => ())}\n\t\t\t\n\t\t\t{[0, 1, 2, 3, 4].map(i => (\n\t\t\t\t(i*7 < days_in_this_month+start_day ? \n\t\t\t\t\t{[0, 1, 2, 3, 4, 5, 6].map(j =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d = i*7+j+1-start_day;\n\t\t\t\t\t\tvar visible = (i > 0 || j >= start_day) && (d <= days_in_this_month);\n\t\t\t\t\t\tif (visible)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar class_name = 'days';\n\t\t\t\t\t\t\tvar diff = all_diff || (d - today.getDate());\n\t\t\t\t\t\t\tif (diff < 0)\n\t\t\t\t\t\t\t\tclass_name += ' past';\n\t\t\t\t\t\t\telse if (!diff)\n\t\t\t\t\t\t\t\tclass_name += ' today';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tclass_name += ' future';\n\t\t\t\t\t\t\tif (d == sel_day)\n\t\t\t\t\t\t\t\tclass_name += ' selected';\n\t\t\t\t\t\t\tclass_name += ' ' + props.weekdayIds[j].toLowerCase();\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t})}\n\t\t\t\t : null)\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showDays(previous_month_year, previous_month)}\n\t\t\t\t\ttitle={month_names[previous_month]+\" \"+previous_month_year} class='prev'>\n\t\t\t\t{!selectboxes ?\n\t\t\t\t\t[\n\t\t\t\t\t\t this.showMonths(year, month)}>{month_names[month]},\n\t\t\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t\t] : [\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t\t this.showDays(next_month_year,next_month)}\n\t\t\t\t\ttitle={props.month_names[next_month]+\" \"+next_month_year} class='next'>\n\t\t\t
{name}
\n\t\t\t\t\t\t\t\t this.selectDate(year, month, d)}>{d}\n\t\t\t\t\t\t\t 
);\n\t}\n\n\t/// Display the calendar - if a date exists in the input box, that will be selected in the calendar.\n\tstatic showCalendar(input, options)\n\t{\n\t\t// Show the calendar with the date in the input as the selected date\n\t\tvar props = { ...options };\n\t\tprops.selected = new Date();\n\t\tvar date_in_input = input.value.replace(/\\s+.*$/, ''); // Remove time\n\t\tif (date_in_input)\n\t\t{\n\t\t\t// date format is HARDCODE\n\t\t\tvar selected_date = false;\n\t\t\tvar date_parts = date_in_input.split(\"-\");\n\t\t\tif (date_parts.length == 3)\n\t\t\t{\n\t\t\t\t// Y-m-d\n\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\tselected_date = new Date(date_parts[0], date_parts[1], date_parts[2]);\n\t\t\t}\n\t\t\telse if (date_parts.length == 1)\n\t\t\t{\n\t\t\t\tdate_parts = date_in_input.split('.');\n\t\t\t\tif (date_parts.length == 3)\n\t\t\t\t{\n\t\t\t\t\t// d.m.Y\n\t\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\t\tselected_date = new Date(date_parts[2], date_parts[1], date_parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selected_date && !isNaN(selected_date.getFullYear()))\n\t\t\t{\n\t\t\t\t// Valid date.\n\t\t\t\tprops.selected = selected_date;\n\t\t\t}\n\t\t}\n\t\tprops.today = new Date();\n\t\tprops.input = input;\n\t\tCalendar.init();\n\t\tCalendar.box.style.display = \"block\";\n\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t}\n\n\t/// Hides the currently show calendar.\n\tstatic hideCalendar()\n\t{\n\t\tif (!Calendar.box)\n\t\t\treturn;\n\t\tCalendar.box.style.display = \"none\";\n\t}\n\n\t/// Setup a text input box to be a calendar box.\n\tstatic set(input_or_id, options)\n\t{\n\t\tif (typeof input_or_id == 'string')\n\t\t{\n\t\t\tinput_or_id = document.getElementById(input_or_id);\n\t\t}\n\t\tif (!input_or_id)\n\t\t{\n\t\t\treturn; // If the input field is not there, exit.\n\t\t}\n\t\tinput_or_id.addEventListener('focus', function(ev)\n\t\t{\n\t\t\tCalendar.showCalendar(input_or_id, options);\n\t\t});\n\t}\n\n\t// Will be called once when the first input is set.\n\tstatic init()\n\t{\n\t\tif (!Calendar.box || !Calendar.box.parentNode)\n\t\t{\n\t\t\tvar div = document.createElement('div');\n\t\t\tif (!Calendar.box)\n\t\t\t\tCalendar.box = div;\n\t\t\tdiv.className = \"calendar-box\";\n\t\t\tdiv.addEventListener(\"mousedown\", function(ev)\n\t\t\t{\n\t\t\t\tev = ev || window.event;\n\t\t\t\tif (ev.stopPropagation)\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\telse\n\t\t\t\t\tev.cancelBubble = true;\n\t\t\t\treturn true;\n\t\t\t});\n\t\t\tdocument.getElementsByTagName(\"body\")[0].insertBefore(div, document.getElementsByTagName(\"body\")[0].firstChild);\n\t\t\tif (!Calendar.addedListener)\n\t\t\t{\n\t\t\t\tdocument.addEventListener(\"mousedown\", function() { Calendar.hideCalendar(); });\n\t\t\t\tCalendar.addedListener = true;\n\t\t\t}\n\t\t}\n\t}\n}\n\nwindow.Calendar = Calendar;\n\nfunction getOffsetRect(elem)\n{\n\tvar box = elem.getBoundingClientRect();\n\n\tvar body = document.body;\n\tvar docElem = document.documentElement;\n\n\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n\tvar clientTop = docElem.clientTop || body.clientTop || 0;\n\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\n\tvar top = box.top + scrollTop - clientTop;\n\tvar left = box.left + scrollLeft - clientLeft;\n\n\treturn { top: Math.round(top), left: Math.round(left) };\n}\n\nfunction getOffsetSum(elem)\n{\n\tvar top = 0, left = 0;\n\twhile(elem)\n\t{\n\t\ttop = top + parseInt(elem.offsetTop);\n\t\tleft = left + parseInt(elem.offsetLeft);\n\t\telem = elem.offsetParent;\n\t}\n\treturn { top: top, left: left };\n}\n\nfunction getOffset(elem)\n{\n\tif (elem.getBoundingClientRect)\n\t\treturn getOffsetRect(elem);\n\telse\n\t\treturn getOffsetSum(elem);\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/preact/dist/preact.esm.js","webpack:///./calendar-preact.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","options","stack","EMPTY_CHILDREN","h","nodeName","attributes","lastSimple","child","simple","children","arguments","length","push","pop","undefined","String","vnode","extend","obj","props","defer","Promise","resolve","then","setTimeout","cloneElement","slice","IS_NON_DIMENSIONAL","items","enqueueRender","component","_dirty","debounceRendering","rerender","list","renderComponent","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","removeNode","parentNode","removeChild","setAccessor","old","isSvg","style","cssText","_typeof","test","innerHTML","__html","useCapture","replace","substring","addEventListener","eventProxy","removeEventListener","_listeners","e","setProperty","removeAttribute","removeAttributeNS","setAttributeNS","setAttribute","className","this","type","event","mounts","diffLevel","isSvgMode","flushMounts","afterMount","componentDidMount","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","document","createTextNode","replaceChild","recollectNodeTree","vnodeName","originalComponent","oldDom","isDirectOwner","isOwner","_parentComponent","constructor","setComponentProps","base","unmountComponent","createComponent","nextBase","buildComponentFromVNode","createElementNS","createElement","createNode","firstChild","fc","vchildren","a","nextSibling","isHydrating","j","f","vchild","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","_child","__key","trim","insertBefore","innerDiffNode","dangerouslySetInnerHTML","attrs","diffAttributes","unmountOnly","ref","removeChildren","lastChild","next","previousSibling","components","Ctor","inst","render","Component","doRender","splice","state","opts","_disable","__ref","componentWillMount","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","shouldComponentUpdate","componentWillUpdate","getChildContext","toUnmount","childComponent","childProps","baseParent","componentRef","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","beforeUnmount","componentWillUnmount","inner","collectComponent","merge","setState","callback","forceUpdate","preact","Calendar","_preact2","default","class","display","renderMonths","renderYears","renderDays","onclick","hideCalendar","close_label","input","div","box","xy","elem","getBoundingClientRect","body","docElem","documentElement","scrollTop","window","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","top","left","Math","round","getOffsetRect","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetSum","getOffset","height","clientHeight","offsetHeight","year","month","day","split","Number","Date","format","evt","createEvent","initEvent","dispatchEvent","fireEvent","onChangeProps","_this2","cur_y","today","getFullYear","cur_m","getMonth","sel_m","selected","colspan","href","showMonths","title","showYears","map","g","showDays","month_names","_this3","_ref","beg","sel_y","class_name","max","_this4","selectboxes","sunday","next_month","next_month_year","previous_month","previous_month_year","current_year","start_day","getDay","days_in_this_month","yea","all_diff","sel_day","getDate","onchange","target","_yearOptions","years","weekdays","weekdayIds","selectDate","date_in_input","selected_date","date_parts","isNaN","start","init","input_or_id","getElementById","ev","showCalendar","stopPropagation","cancelBubble","getElementsByTagName","addedListener"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,E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S,MAAM,OAAO,OAAO,SAAS,WAAW,UAAU,SAAS,WAC5G5D,YAAa,UACbsF,UAAW,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,MACzCC,YAAa,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,OACjDlB,OAAQ,EACRD,aAAa,EACbiB,OAASjK,KAAM,GAAI8I,IAAK,IACxB7B,OAAQ,QAERS,MAAO,IAAIV,KACXyD,MAAO,QAyVTlF,OAAOrB,SAAWA","file":"./calendar-preact.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","/** Virtual DOM Node */\nfunction VNode() {}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nvar options = {\n\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t// afterMount(component) { }\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t// afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `
Hello!
`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\n// DOM properties that should NOT have \"px\" added when numeric\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n/** Managed queue of dirty components to be re-rendered */\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p,\n\t list = items;\n\titems = [];\n\twhile (p = list.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nfunction isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined;\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n }\n return hydrating || node._componentConstructor === vnode.nodeName;\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nfunction isNamedNode(node, nodeName) {\n return node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nfunction getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n\n var defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (var i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {\n\t\t// ignore\n\t} else if (name === 'ref') {\n\t\tif (old) old(null);\n\t\tif (value) value(node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\tsetProperty(node, name, value == null ? '' : value);\n\t\tif (value == null || value === false) node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n\ttry {\n\t\tnode[name] = value;\n\t} catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nvar mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nvar diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nvar isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nvar hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\t// If the VNode represents a Component, perform a component diff:\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t} // if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\t// attempt to find a node based on key matching\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt to pluck a node of the same type from the existing children\n\t\t\telse if (!child && min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove unused keyed children:\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\t// remove orphaned unkeyed children:\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\n\t\tunmountComponent(component);\n\t} else {\n\t\t// If the node's VNode had a ref function, invoke it with null here.\n\t\t// (this is part of the React spec, and smart for unsetting references)\n\t\tif (node['__preactattr_'] != null && node['__preactattr_'].ref) node['__preactattr_'].ref(null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\t// remove attributes no longer present on the vnode by setting them to undefined\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\t// add new & update changed attributes\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nvar components = {};\n\n/** Reclaim a component for later re-use by the recycler. */\nfunction collectComponent(component) {\n\tvar name = component.constructor.name;\n\t(components[name] || (components[name] = [])).push(component);\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nfunction createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nfunction setComponentProps(component, props, opts, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tif (component.__ref = props.ref) delete props.ref;\n\tif (component.__key = props.key) delete props.key;\n\n\tif (!component.base || mountAll) {\n\t\tif (component.componentWillMount) component.componentWillMount();\n\t} else if (component.componentWillReceiveProps) {\n\t\tcomponent.componentWillReceiveProps(props, context);\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (opts !== 0) {\n\t\tif (opts === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tif (component.__ref) component.__ref(component);\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nfunction renderComponent(component, opts, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t rendered,\n\t inst,\n\t cbase;\n\n\t// if updating\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (opts !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\t// context to pass to the child, can be updated via (grand-)parent component\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\t\t\t// set up high order component link\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\t// destroy high order component link\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || opts === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.unshift(component);\n\t} else if (!skip) {\n\t\t// Ensure that pending componentDidMount() hooks of child components\n\t\t// are called before the componentDidUpdate() hook in the parent.\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n\t\t// flushMounts();\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\tif (component._renderCallbacks != null) {\n\t\twhile (component._renderCallbacks.length) {\n\t\t\tcomponent._renderCallbacks.pop().call(component);\n\t\t}\n\t}\n\n\tif (!diffLevel && !isChild) flushMounts();\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\t// recursively tear down & recollect high-order component children:\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\tcollectComponent(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tif (component.__ref) component.__ref(null);\n}\n\n/** Base Component class.\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\n *\t@public\n *\n *\t@example\n *\tclass MyFoo extends Component {\n *\t\trender(props, state) {\n *\t\t\treturn
;\n *\t\t}\n *\t}\n */\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.context = context;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.props = props;\n\n\t/** @public\n *\t@type {object}\n */\n\tthis.state = this.state || {};\n}\n\nextend(Component.prototype, {\n\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\n *\t@param {object} nextProps\n *\t@param {object} nextState\n *\t@param {object} nextContext\n *\t@returns {Boolean} should the component re-render\n *\t@name shouldComponentUpdate\n *\t@function\n */\n\n\t/** Update component state by copying properties from `state` to `this.state`.\n *\t@param {object} state\t\tA hash of state properties to update with new values\n *\t@param {function} callback\tA function to be called once component state is updated\n */\n\tsetState: function setState(state, callback) {\n\t\tvar s = this.state;\n\t\tif (!this.prevState) this.prevState = extend({}, s);\n\t\textend(s, typeof state === 'function' ? state(s, this.props) : state);\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/** Immediately perform a synchronous re-render of the component.\n *\t@param {function} callback\t\tA function to be called after component is re-rendered.\n *\t@private\n */\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) (this._renderCallbacks = this._renderCallbacks || []).push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\n\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\n *\t@param {object} state\t\tThe component's current state\n *\t@param {object} context\t\tContext object (if a parent component has provided context)\n *\t@returns VNode\n */\n\trender: function render() {}\n});\n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\n *\t@public\n *\n *\t@example\n *\t// render a div into :\n *\trender(
hello!
, document.body);\n *\n *\t@example\n *\t// render a \"Thing\" component into #foo:\n *\tconst Thing = ({ name }) => { name };\n *\trender(, document.querySelector('#foo'));\n */\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, Component, render, rerender, options };\n//# sourceMappingURL=preact.esm.js.map\n","/**\n * Calendar Script\n * Creates a calendar widget which can be used to select the date more easily than using just a text box\n *\n * Modified: http://yourcmc.ru/git/vitalif-js/calendar\n * Version: 2018-10-09\n * License: MIT-like, http://www.openjs.com/license.php\n *\n * Example:\n * \n * \n */\n\nimport preact from 'preact';\n/** @jsx preact.h */\n\nexport class Calendar extends preact.Component\n{\n\t// Configuration\n\tstatic defaultProps = {\n\t\tmonth_names: [\"Январь\",\"Февраль\",\"Март\",\"Апрель\",\"Май\",\"Июнь\",\"Июль\",\"Август\",\"Сентябрь\",\"Октябрь\",\"Ноябрь\",\"Декабрь\"],\n\t\tclose_label: 'Закрыть',\n\t\tweekdays: [\"Пн\",\"Вт\",\"Ср\",\"Чт\",\"Пт\",\"Сб\",\"Вс\"],\n\t\tweekdayIds: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],\n\t\tsunday: 6,\n\t\tselectboxes: false, // true: use selectboxes for year and month, false: show months and years in table\n\t\tyears: { min: -70, max: 10 }, // range of displayed years if selectboxes==true\n\t\tformat: 'd.m.Y', // either d.m.Y or Y-m-d, other formats are not supported\n\t\t// Today's date\n\t\ttoday: new Date(),\n\t\tstart: 'days',\n\t}\n\n\trender(props, state)\n\t{\n\t\treturn (
\n\t\t\t{props.mode == 'months' ? this.renderMonths(props) : null}\n\t\t\t{props.mode == 'years' ? this.renderYears(props) : null}\n\t\t\t{props.mode == 'days' ? this.renderDays(props) : null}\n\t\t\t Calendar.hideCalendar()}>{props.close_label}\n\t\t
);\n\t}\n\n\tcomponentDidMount()\n\t{\n\t\tthis.componentDidUpdate();\n\t}\n\n\tcomponentDidUpdate()\n\t{\n\t\t// Position the div in the correct location...\n\t\tvar input = this.props.input;\n\t\tvar div = Calendar.box;\n\t\tvar xy = getOffset(input);\n\t\tvar height = input.clientHeight||input.offsetHeight;\n\t\tdiv.style.left = (xy.left-1)+\"px\";\n\t\tif (div.offsetHeight + xy.top+height-1 >= (document.body.clientHeight||document.documentElement.clientHeight) &&\n\t\t\txy.top-div.offsetHeight >= 0)\n\t\t\tdiv.style.top = (xy.top-div.offsetHeight)+'px';\n\t\telse\n\t\t\tdiv.style.top = (xy.top+height-1)+\"px\";\n\t}\n\n\t/// Called when the user clicks on a date in the calendar.\n\tselectDate(year, month, day)\n\t{\n\t\tvar i = this.props.input;\n\t\tvar t = i.value.split(/\\s+/, 2)[1]||'';\n\t\tif (t)\n\t\t\tt = ' '+t;\n\t\tmonth = Number(month)+1;\n\t\tif (month < 10)\n\t\t\tmonth = '0'+month;\n\t\tif (day < 10)\n\t\t\tday = '0'+day;\n\t\tif (this.props.callback)\n\t\t{\n\t\t\tvar c = this.props.callback;\n\t\t\tt = year + '-' + month + '-' + day + t;\n\t\t\tc(new Date(t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tt = (this.format == 'Y-m-d' ? year + '-' + month + '-' + day : day + '.' + month + '.' + year) + t;\n\t\t\ti.value = t;\n\t\t\tif (\"Event\" in window)\n\t\t\t{\n\t\t\t\tvar evt = document.createEvent('Event');\n\t\t\t\tevt.initEvent('change', true, true);\n\t\t\t\ti.dispatchEvent(evt);\n\t\t\t}\n\t\t\telse\n\t\t\t\ti.fireEvent(\"onchange\");\n\t\t}\n\t\tCalendar.hideCalendar();\n\t}\n\n\tshowMonths(year)\n\t{\n\t\tthis.props.onChangeProps({ year, mode: 'months' });\n\t}\n\n\tshowYears(year)\n\t{\n\t\tthis.props.onChangeProps({ year, mode: 'years' });\n\t}\n\n\tshowDays(year, month)\n\t{\n\t\tthis.props.onChangeProps({ year, month, mode: 'days' });\n\t}\n\n\trenderMonths(props)\n\t{\n\t\tvar year = props.year;\n\t\tvar cur_y = props.today.getFullYear();\n\t\tvar cur_m = props.today.getMonth();\n\t\tvar sel_m = props.selected.getFullYear() == year ? props.selected.getMonth() : -1;\n\t\tvar months = [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ], [ 9, 10, 11 ] ];\n\t\treturn (\n\t\t\t\n\t\t\t{months.map(g => (\n\t\t\t\t{g.map(i => (\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showMonths(year-1)} title={(year-1)} class='prev'>\n\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t this.showMonths(year+1)} title={(year+1)} class='next'>\n\t\t\t
cur_y || year == cur_y && i > cur_m ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_m ? ' selected' : '')}>\n\t\t\t\t\t\t this.showDays(year, i)}>\n\t\t\t\t\t\t\t{props.month_names[i]}\n\t\t\t\t\t\t\n\t\t\t\t\t
);\n\t}\n\n\trenderYears({ selected, today, year })\n\t{\n\t\tvar beg = year & ~15;\n\t\tvar cur_y = today.getFullYear();\n\t\tvar sel_y = selected.getFullYear();\n\t\treturn (\n\t\t\t\n\t\t\t{[0, 1, 2, 3].map(r => (\n\t\t\t\t\n\t\t\t\t{[0, 1, 2, 3].map(j => {\n\t\t\t\t\tvar i = beg + j + r*4;\n\t\t\t\t\tvar class_name = (i < cur_y ? 'past' : (i > cur_y ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_y ? ' selected' : '');\n\t\t\t\t\treturn ();\n\t\t\t\t})}\n\t\t\t\t\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showYears(year-16)} title={(beg-16)+\" - \"+(beg-1)} class='prev'>\n\t\t\t\t{beg+' - '+(beg+15)}\n\t\t\t\t this.showYears(year+16)} title={(beg+16)+\" - \"+(beg+31)} class='next'>\n\t\t\t
\n\t\t\t\t\t\t this.showMonths(i)}>{i}\n\t\t\t\t\t
);\n\t}\n\n\t_yearOptions(min, max, year)\n\t{\n\t\tvar r = [];\n\t\tfor (var i = min; i < max; i++)\n\t\t\tr.push();\n\t\treturn r;\n\t}\n\n\t/// Creates a calendar with the date given in the argument as the selected date.\n\trenderDays(props)\n\t{\n\t\tvar { year, month, selected, selectboxes, sunday, today, month_names } = props;\n\n\t\t// Display the table\n\t\tvar next_month = month+1;\n\t\tvar next_month_year = year;\n\t\tif (next_month >= 12)\n\t\t{\n\t\t\tnext_month = 0;\n\t\t\tnext_month_year++;\n\t\t}\n\n\t\tvar previous_month = month-1;\n\t\tvar previous_month_year = year;\n\t\tif (previous_month < 0)\n\t\t{\n\t\t\tprevious_month = 11;\n\t\t\tprevious_month_year--;\n\t\t}\n\n\t\tvar current_year = today.getFullYear();\n\n\t\t// Get the first day of this month\n\t\tvar first_day = new Date(year, month, 1);\n\t\tvar start_day = (first_day.getDay()+sunday)%7;\n\n\t\tvar d = 1;\n\t\tvar flag = 0;\n\n\t\t// Leap year support\n\t\tvar days_in_this_month = (month == 2\n\t\t\t? (!(year % 4) && ((year % 100) || !(year % 400)) ? 29 : 28)\n\t\t\t: ((month < 7) == !(month & 1) ? 31 : 30));\n\n\t\tvar yea = today.getFullYear();\n\t\tvar all_diff = (year - yea) || (month - today.getMonth());\n\t\tvar sel_day = selected && year == selected.getFullYear() && month == selected.getMonth() ? selected.getDate() : -1;\n\n\t\treturn (\n\t\t\t\n\t\t\t\n\t\t\t\t{props.weekdays.map(name => ())}\n\t\t\t\n\t\t\t{[0, 1, 2, 3, 4].map(i => (\n\t\t\t\t(i*7 < days_in_this_month+start_day ? \n\t\t\t\t\t{[0, 1, 2, 3, 4, 5, 6].map(j =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d = i*7+j+1-start_day;\n\t\t\t\t\t\tvar visible = (i > 0 || j >= start_day) && (d <= days_in_this_month);\n\t\t\t\t\t\tif (visible)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar class_name = 'days';\n\t\t\t\t\t\t\tvar diff = all_diff || (d - today.getDate());\n\t\t\t\t\t\t\tif (diff < 0)\n\t\t\t\t\t\t\t\tclass_name += ' past';\n\t\t\t\t\t\t\telse if (!diff)\n\t\t\t\t\t\t\t\tclass_name += ' today';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tclass_name += ' future';\n\t\t\t\t\t\t\tif (d == sel_day)\n\t\t\t\t\t\t\t\tclass_name += ' selected';\n\t\t\t\t\t\t\tclass_name += ' ' + props.weekdayIds[j].toLowerCase();\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t})}\n\t\t\t\t : null)\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showDays(previous_month_year, previous_month)}\n\t\t\t\t\ttitle={month_names[previous_month]+\" \"+previous_month_year} class='prev'>\n\t\t\t\t{!selectboxes ?\n\t\t\t\t\t[\n\t\t\t\t\t\t this.showMonths(year, month)}>{month_names[month]},\n\t\t\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t\t] : [\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t\t this.showDays(next_month_year,next_month)}\n\t\t\t\t\ttitle={props.month_names[next_month]+\" \"+next_month_year} class='next'>\n\t\t\t
{name}
\n\t\t\t\t\t\t\t\t this.selectDate(year, month, d)}>{d}\n\t\t\t\t\t\t\t 
);\n\t}\n\n\t/// Display the calendar - if a date exists in the input box, that will be selected in the calendar.\n\tstatic showCalendar(input, options)\n\t{\n\t\t// Show the calendar with the date in the input as the selected date\n\t\tvar props = { ...Calendar.defaultProps, ...options };\n\t\tprops.selected = new Date();\n\t\tvar date_in_input = input.value.replace(/\\s+.*$/, ''); // Remove time\n\t\tif (date_in_input)\n\t\t{\n\t\t\t// date format is HARDCODE\n\t\t\tvar selected_date = false;\n\t\t\tvar date_parts = date_in_input.split(\"-\");\n\t\t\tif (date_parts.length == 3)\n\t\t\t{\n\t\t\t\t// Y-m-d\n\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\tselected_date = new Date(date_parts[0], date_parts[1], date_parts[2]);\n\t\t\t}\n\t\t\telse if (date_parts.length == 1)\n\t\t\t{\n\t\t\t\tdate_parts = date_in_input.split('.');\n\t\t\t\tif (date_parts.length == 3)\n\t\t\t\t{\n\t\t\t\t\t// d.m.Y\n\t\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\t\tselected_date = new Date(date_parts[2], date_parts[1], date_parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selected_date && !isNaN(selected_date.getFullYear()))\n\t\t\t{\n\t\t\t\t// Valid date.\n\t\t\t\tprops.selected = selected_date;\n\t\t\t}\n\t\t}\n\t\tprops.today = new Date();\n\t\tprops.year = props.selected.getFullYear();\n\t\tprops.month = props.selected.getMonth();\n\t\tprops.mode = props.start;\n\t\tprops.input = input;\n\t\tprops.onChangeProps = (h) =>\n\t\t{\n\t\t\tprops = { ...props, ...h };\n\t\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t\t};\n\t\tCalendar.init();\n\t\tCalendar.box.style.display = \"block\";\n\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t}\n\n\t/// Hides the currently show calendar.\n\tstatic hideCalendar()\n\t{\n\t\tif (!Calendar.box)\n\t\t\treturn;\n\t\tCalendar.box.style.display = \"none\";\n\t}\n\n\t/// Setup a text input box to be a calendar box.\n\tstatic set(input_or_id, options)\n\t{\n\t\tif (typeof input_or_id == 'string')\n\t\t{\n\t\t\tinput_or_id = document.getElementById(input_or_id);\n\t\t}\n\t\tif (!input_or_id)\n\t\t{\n\t\t\treturn; // If the input field is not there, exit.\n\t\t}\n\t\tinput_or_id.addEventListener('focus', function(ev)\n\t\t{\n\t\t\tCalendar.showCalendar(input_or_id, options);\n\t\t});\n\t\t// FIXME: Add change listener to enable interactive date selection in calendar while typing\n\t}\n\n\t// Will be called once when the first input is set.\n\tstatic init()\n\t{\n\t\tif (!Calendar.box || !Calendar.box.parentNode)\n\t\t{\n\t\t\tvar div = document.createElement('div');\n\t\t\tif (!Calendar.box)\n\t\t\t\tCalendar.box = div;\n\t\t\tdiv.className = \"calendar-box\";\n\t\t\tdiv.addEventListener(\"mousedown\", function(ev)\n\t\t\t{\n\t\t\t\tev = ev || window.event;\n\t\t\t\tif (ev.stopPropagation)\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\telse\n\t\t\t\t\tev.cancelBubble = true;\n\t\t\t\treturn true;\n\t\t\t});\n\t\t\tdocument.getElementsByTagName(\"body\")[0].insertBefore(div, document.getElementsByTagName(\"body\")[0].firstChild);\n\t\t\tif (!Calendar.addedListener)\n\t\t\t{\n\t\t\t\tdocument.addEventListener(\"mousedown\", function() { Calendar.hideCalendar(); });\n\t\t\t\tCalendar.addedListener = true;\n\t\t\t}\n\t\t}\n\t}\n}\n\nwindow.Calendar = Calendar;\n\nfunction getOffsetRect(elem)\n{\n\tvar box = elem.getBoundingClientRect();\n\n\tvar body = document.body;\n\tvar docElem = document.documentElement;\n\n\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n\tvar clientTop = docElem.clientTop || body.clientTop || 0;\n\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\n\tvar top = box.top + scrollTop - clientTop;\n\tvar left = box.left + scrollLeft - clientLeft;\n\n\treturn { top: Math.round(top), left: Math.round(left) };\n}\n\nfunction getOffsetSum(elem)\n{\n\tvar top = 0, left = 0;\n\twhile(elem)\n\t{\n\t\ttop = top + parseInt(elem.offsetTop);\n\t\tleft = left + parseInt(elem.offsetLeft);\n\t\telem = elem.offsetParent;\n\t}\n\treturn { top: top, left: left };\n}\n\nfunction getOffset(elem)\n{\n\tif (elem.getBoundingClientRect)\n\t\treturn getOffsetRect(elem);\n\telse\n\t\treturn getOffsetSum(elem);\n}\n"],"sourceRoot":""} \ No newline at end of file