ESP8266 part of the f105-motor-demo project (see f105-motor-demo_stm32)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

3 lines
69 KiB

function bool(t){return 1===t||"1"===t||t===!0||"true"===t}function numfmt(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function estimateLoadTime(t,e){return 1e3/t*e+1500}function msNow(){return+new Date}function msElapsed(t){return msNow()-t}function errorMsg(t,e){notify.show(t,e||3e3)}!function(){"use strict";function t(){var t;for(p=!0,t=0;t<f.length;t+=1)f[t]();f=[]}function e(){var e;for(m=!0,p||t(),e=0;e<d.length;e+=1)d[e]();d=[]}function n(t,e){var n;for(n=e.length-1;n>=0;n-=1)t(e[n])}function r(t){return t.replace(/-\w/g,function(t){return t.charAt(1).toUpperCase()})}function i(t,e){return t.currentStyle?t.currentStyle[r(e)]:g.getComputedStyle?g.getComputedStyle(t,null).getPropertyValue(e):null}function a(t,e){return encodeURIComponent(t).replace(/%20/g,"+")+"="+encodeURIComponent(e).replace(/%20/g,"+")}function o(t,e,n){try{t.style[r(e)]=n}catch(i){}}function s(t){t.style.display="","none"===i(t,"display")&&(t.style.display="block")}function u(t){var e,r,i,o="";if(t.constructor===Object){for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(r=0;r<t[e].length;r+=1)o+="&"+a(e,t[e][r]);else o+="&"+a(e,t[e])}else n(function(t){if("FORM"===t.nodeName)for(r=0;r<t.elements.length;r+=1)if(e=t.elements[r],!e.disabled)switch(e.type){case"button":case"image":case"file":case"submit":case"reset":break;case"select-one":e.length>0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i<e.length;i+=1)e[i].selected&&(o+="&"+a(e.name,e[i].value));break;case"checkbox":case"radio":e.checked&&(o+="&"+a(e.name,e.value));break;default:o+="&"+a(e.name,e.value)}},t);return o.length>0?o.substring(1):""}function c(t,e,r){var i,a,o,s=!1;return t&&(i=t.split(/\s+/),n(function(t){for(o=0;o<i.length;o+=1)if(a=new RegExp("\\b"+i[o]+"\\b","g"),"remove"===e)t.className=t.className.replace(a,"");else if("toggle"===e)t.className=t.className.match(a)?t.className.replace(a,""):t.className+" "+i[o];else if("has"===e&&t.className.match(a)){s=!0;break}},r)),s}function l(t,e,r){var i,a;t&&n(function(n){for(i=v.createElement("div"),i.innerHTML=t;null!==(a=i.lastChild);)try{"before"===e?n.parentNode.insertBefore(a,n):"after"===e?n.parentNode.insertBefore(a,n.nextSibling):"append"===e?n.appendChild(a):"prepend"===e&&n.insertBefore(a,n.firstChild)}catch(r){break}},r)}function h(t){var e,a,x,y=[],b=!1;if(t)if(t.nodeType&&1===t.nodeType)y=[t];else if("object"==typeof t)b="number"!=typeof t.length,y=t;else if("string"==typeof t)for(v.querySelectorAll||(v.querySelectorAll=function(t){var e,n,r,a=v.getElementsByTagName("head")[0],o=[];if(e=v.createElement("STYLE"),e.type="text/css",e.styleSheet){for(e.styleSheet.cssText=t+" {a:b}",a.appendChild(e),n=v.getElementsByTagName("*"),r=0;r<n.length;r+=1)"b"===i(n[r],"a")&&o.push(n[r]);a.removeChild(e)}return o}),a=v.querySelectorAll(t),x=0;x<a.length;x+=1)y[x]=a[x];return e=b?{}:y,e.ready=function(t){if(t){if(p)return t(),e;f.push(t)}},e.loaded=function(t){if(t){if(m)return t(),e;d.push(t)}},e.each=function(t){return"function"==typeof t&&n(function(e){return t.apply(e,arguments)},y),e},e.first=function(){return h(y.shift())},e.last=function(){return h(y.pop())},e.odd=function(){var t,e=[];for(t=0;t<y.length;t+=2)e.push(y[t]);return h(e)},e.even=function(){var t,e=[];for(t=1;t<y.length;t+=2)e.push(y[t]);return h(e)},e.hide=function(){return n(function(t){t.style.display="none"},y),e},e.show=function(){return n(function(t){s(t)},y),e},e.toggle=function(t){return"undefined"!=typeof t?t?e.show():e.hide():n(function(t){"none"===i(t,"display")?s(t):t.style.display="none"},y),e},e.remove=function(){return n(function(t){try{t.parentNode.removeChild(t)}catch(e){}},y),h()},e.css=function(t,a){if(t){if(a||""===a)return n(function(e){o(e,t,a)},y),e;if(y[0]){if(y[0].style[r(t)])return y[0].style[r(t)];if(i(y[0],t))return i(y[0],t)}}},e.getClass=function(){return y[0]&&y[0].className.length>0?y[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+/," "):void 0},e.setClass=function(t){return(t||""===t)&&n(function(e){e.className=t},y),e},e.addClass=function(t){return t&&n(function(e){e.className+=" "+t},y),e},e.removeClass=function(t){return c(t,"remove",y),e},e.toggleClass=function(t){return c(t,"toggle",y),e},e.hasClass=function(t){return c(t,"has",y)},e.html=function(t){return t||""===t?(n(function(e){e.innerHTML=t},y),e):y[0]?y[0].innerHTML:void 0},e.htmlBefore=function(t){return l(t,"before",y),e},e.htmlAfter=function(t){return l(t,"after",y),e},e.htmlAppend=function(t){return l(t,"append",y),e},e.htmlPrepend=function(t){return l(t,"prepend",y),e},e.attr=function(t,r){if(t){if(t=t.toLowerCase(),"undefined"!=typeof r)return n(function(e){"style"===t?e.style.cssText=r:"class"===t?e.className=r:e.setAttribute(t,r)},y),e;if(y[0])if("style"===t){if(y[0].style.cssText)return y[0].style.cssText}else if("class"===t){if(y[0].className)return y[0].className}else if(y[0].getAttribute(t))return y[0].getAttribute(t)}},e.data=function(t,n){return t?e.attr("data-"+t,n):void 0},e.val=function(t){var r,i,a;if(!_.isUndefined(t))return n(function(e){switch(e.nodeName){case"SELECT":for("string"!=typeof t&&"number"!=typeof t||(t=[t]),i=0;i<e.length;i+=1)for(a=0;a<t.length;a+=1)if(e[i].selected="",e[i].value===t[a]){e[i].selected="selected";break}break;case"INPUT":case"TEXTAREA":case"BUTTON":e.value=t}},y),e;if(y[0])switch(y[0].nodeName){case"SELECT":for(r=[],i=0;i<y[0].length;i+=1)y[0][i].selected&&r.push(y[0][i].value);return r.length>1?r:r[0];case"INPUT":case"TEXTAREA":case"BUTTON":return y[0].value}},e.checked=function(t){return"boolean"==typeof t?(n(function(e){"INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||(e.checked=t)},y),e):!y[0]||"INPUT"!==y[0].nodeName||"checkbox"!==y[0].type&&"radio"!==y[0].type?void 0:!!y[0].checked},e.on=function(r,i){return t!==g&&t!==v||(y=[t]),n(function(t){v.addEventListener?t.addEventListener(r,i,!1):v.attachEvent&&(t[r+i]=function(){return i.apply(t,arguments)},t.attachEvent("on"+r,t[r+i]))},y),e},e.off=function(r,i){return t!==g&&t!==v||(y=[t]),n(function(t){v.addEventListener?t.removeEventListener(r,i,!1):v.attachEvent&&(t.detachEvent("on"+r,t[r+i]),t[r+i]=null)},y),e},e.ajax=function(t,e,n,r){var i,a,o=u(y),s=e?e.toUpperCase():"GET";_.isNumber(r)&&(r={timeout:r});var c=Chartist.extend({},{nocache:!0,timeout:5e3,loader:!0},r);if(o&&"GET"===s&&(t+=-1===t.indexOf("?")?"?"+o:"&"+o,o=null),i=new XMLHttpRequest){if(c.nocache){var l=(+new Date).toString(36);t+=(-1===t.indexOf("?")?"?":"&")+"_="+l}c.loader&&$("#loader").addClass("show"),i.open(s,t,!0),i.timeout=c.timeout,a=setTimeout(function(){errorMsg("XHR timed out."),i.abort(),c.loader&&$("#loader").removeClass("show")},c.timeout+10),i.onreadystatechange=function(){4===i.readyState&&(c.loader&&$("#loader").removeClass("show"),n&&0!=i.status&&n(i.responseText,i.status),clearTimeout(a))},i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"POST"===s&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.send(o)}return i},e.get=function(t,n,r){return e.ajax(t,"get",n,r)},e.post=function(t,n,r){return e.ajax(t,"post",n,r)},e}var f=[],d=[],p=!1,m=!1,v=document,g=window;v.addEventListener?(v.addEventListener("DOMContentLoaded",t,!1),g.addEventListener("load",e,!1)):v.attachEvent?(v.attachEvent("onreadystatechange",t),g.attachEvent("onload",e)):g.onload=e,g.$=h}(),function(t,e){t.Chartist=e()}(this,function(){var t={version:"0.9.7"};return function(t,e,n){"use strict";n.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},n.noop=function(t){return t},n.alphaNumerate=function(t){return String.fromCharCode(97+t%26)},n.extend=function(t){t=t||{};var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(e){for(var r in e)"object"!=typeof e[r]||null===e[r]||e[r]instanceof Array?t[r]=e[r]:t[r]=n.extend({},t[r],e[r])}),t},n.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"g"),n)},n.ensureUnit=function(t,e){return"number"==typeof t&&(t+=e),t},n.quantity=function(t){if("string"==typeof t){var e=/^(\d+)\s*(.*)$/g.exec(t);return{value:+e[1],unit:e[2]||void 0}}return{value:t}},n.querySelector=function(t){return t instanceof Node?t:e.querySelector(t)},n.times=function(t){return Array.apply(null,new Array(t))},n.sum=function(t,e){return t+(e?e:0)},n.mapMultiply=function(t){return function(e){return e*t}},n.mapAdd=function(t){return function(e){return e+t}},n.serialMap=function(t,e){var r=[],i=Math.max.apply(null,t.map(function(t){return t.length}));return n.times(i).forEach(function(n,i){var a=t.map(function(t){return t[i]});r[i]=e.apply(null,a)}),r},n.roundWithPrecision=function(t,e){var r=Math.pow(10,e||n.precision);return Math.round(t*r)/r},n.precision=8,n.serialize=function(t){return null===t||void 0===t?t:("number"==typeof t?t=""+t:"object"==typeof t&&(t=JSON.stringify({data:t})),_.escape(t))},n.deserialize=function(t){if("string"!=typeof t)return t;t=_.unescape(t);try{t=JSON.parse(t),t=void 0!==t.data?t.data:t}catch(e){}return t},n.createSvg=function(t,e,r,i){var a;return e=e||"100%",r=r||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(t){return t.getAttributeNS(n.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),a=new n.Svg("svg").attr({width:e,height:r}).addClass(i).attr({style:"width: "+e+"; height: "+r+";"}),t.appendChild(a._node),a},n.normalizeData=function(t){if(t=t||{series:[],labels:[]},t.series=t.series||[],t.labels=t.labels||[],t.series.length>0&&0===t.labels.length){var e,r=n.getDataArray(t);e=r.every(function(t){return t instanceof Array})?Math.max.apply(null,r.map(function(t){return t.length})):r.length,t.labels=n.times(e).map(function(){return""})}return t},n.reverseData=function(t){t.labels.reverse(),t.series.reverse();for(var e=0;e<t.series.length;e++)"object"==typeof t.series[e]&&void 0!==t.series[e].data?t.series[e].data.reverse():t.series[e]instanceof Array&&t.series[e].reverse()},n.getDataArray=function(t,e,r){function i(t){if(!n.isFalseyButZero(t)){if((t.data||t)instanceof Array)return(t.data||t).map(i);if(t.hasOwnProperty("value"))return i(t.value);if(r){var e={};return"string"==typeof r?e[r]=n.getNumberOrUndefined(t):e.y=n.getNumberOrUndefined(t),e.x=t.hasOwnProperty("x")?n.getNumberOrUndefined(t.x):e.x,e.y=t.hasOwnProperty("y")?n.getNumberOrUndefined(t.y):e.y,e}return n.getNumberOrUndefined(t)}}return(e&&!t.reversed||!e&&t.reversed)&&(n.reverseData(t),t.reversed=!t.reversed),t.series.map(i)},n.normalizePadding=function(t,e){return e=e||0,"number"==typeof t?{top:t,right:t,bottom:t,left:t}:{top:"number"==typeof t.top?t.top:e,right:"number"==typeof t.right?t.right:e,bottom:"number"==typeof t.bottom?t.bottom:e,left:"number"==typeof t.left?t.left:e}},n.getMetaData=function(t,e){var r=t.data?t.data[e]:t[e];return r?n.serialize(r.meta):void 0},n.orderOfMagnitude=function(t){return Math.floor(Math.log(Math.abs(t))/Math.LN10)},n.projectLength=function(t,e,n){return e/n.range*t},n.getAvailableHeight=function(t,e){return Math.max((n.quantity(e.height).value||t.height())-(e.chartPadding.top+e.chartPadding.bottom)-e.axisX.offset,0)},n.getHighLow=function(t,e,r){function i(t){if(void 0!==t)if(t instanceof Array)for(var e=0;e<t.length;e++)i(t[e]);else{var n=r?+t[r]:+t;o&&n>a.high&&(a.high=n),s&&n<a.low&&(a.low=n)}}e=n.extend({},e,r?e["axis"+r.toUpperCase()]:{});var a={high:void 0===e.high?-Number.MAX_VALUE:+e.high,low:void 0===e.low?Number.MAX_VALUE:+e.low},o=void 0===e.high,s=void 0===e.low;return(o||s)&&i(t),(e.referenceValue||0===e.referenceValue)&&(a.high=Math.max(e.referenceValue,a.high),a.low=Math.min(e.referenceValue,a.low)),a.high<=a.low&&(0===a.low?a.high=1:a.low<0?a.high=0:a.high>0?a.low=0:(a.high=1,a.low=0)),a},n.isNum=function(t){return!isNaN(t)&&isFinite(t)},n.isFalseyButZero=function(t){return!t&&0!==t},n.getNumberOrUndefined=function(t){return isNaN(+t)?void 0:+t},n.getMultiValue=function(t,e){return n.isNum(t)?+t:t?t[e||"y"]||0:0},n.rho=function(t){function e(t,n){return t%n===0?n:e(n,t%n)}function n(t){return t*t+1}if(1===t)return t;var r,i=2,a=2;if(t%2===0)return 2;do i=n(i)%t,a=n(n(a))%t,r=e(Math.abs(i-a),t);while(1===r);return r},n.getBounds=function(t,e,r,i){var a,o,s,u=0,c={high:e.high,low:e.low};c.valueRange=c.high-c.low,c.oom=n.orderOfMagnitude(c.valueRange),c.step=Math.pow(10,c.oom),c.min=Math.floor(c.low/c.step)*c.step,c.max=Math.ceil(c.high/c.step)*c.step,c.range=c.max-c.min,c.numberOfSteps=Math.round(c.range/c.step);var l=n.projectLength(t,c.step,c),h=r>l,f=i?n.rho(c.range):0;if(i&&n.projectLength(t,1,c)>=r)c.step=1;else if(i&&f<c.step&&n.projectLength(t,f,c)>=r)c.step=f;else for(;;){if(h&&n.projectLength(t,c.step,c)<=r)c.step*=2;else{if(h||!(n.projectLength(t,c.step/2,c)>=r))break;if(c.step/=2,i&&c.step%1!==0){c.step*=2;break}}if(u++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}for(o=c.min,s=c.max;o+c.step<=c.low;)o+=c.step;for(;s-c.step>=c.high;)s-=c.step;for(c.min=o,c.max=s,c.range=c.max-c.min,c.values=[],a=c.min;a<=c.max;a+=c.step)c.values.push(n.roundWithPrecision(a));return c},n.createChartRect=function(t,e,r){var i=!(!e.axisX&&!e.axisY),a=i?e.axisY.offset:0,o=i?e.axisX.offset:0,s=t.width()||n.quantity(e.width).value||0,u=t.height()||n.quantity(e.height).value||0,c=n.normalizePadding(e.chartPadding,r);s=Math.max(s,a+c.left+c.right),u=Math.max(u,o+c.top+c.bottom);var l={padding:c,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return i?("start"===e.axisX.position?(l.y2=c.top+o,l.y1=Math.max(u-c.bottom,l.y2+1)):(l.y2=c.top,l.y1=Math.max(u-c.bottom-o,l.y2+1)),"start"===e.axisY.position?(l.x1=c.left+a,l.x2=Math.max(s-c.right,l.x1+1)):(l.x1=c.left,l.x2=Math.max(s-c.right-a,l.x1+1))):(l.x1=c.left,l.x2=Math.max(s-c.right,l.x1+1),l.y2=c.top,l.y1=Math.max(u-c.bottom,l.y2+1)),l},n.createGrid=function(t,e,r,i,a,o,s,u){var c={};c[r.units.pos+"1"]=Math.round(t)+.5,c[r.units.pos+"2"]=Math.round(t)+.5,c[r.counterUnits.pos+"1"]=i,c[r.counterUnits.pos+"2"]=i+a;var l=o.elem("line",c,s.join(" "));u.emit("draw",n.extend({type:"grid",axis:r,index:e,group:o,element:l},c))},n.createLabel=function(t,e,r,i,a,o,s,u,c,l,h){var f,d={};d[a.units.pos]=t+s[a.units.pos],d[a.counterUnits.pos]=s[a.counterUnits.pos],d[a.units.len]=e,d[a.counterUnits.len]=o-10;var p=i[r];if(_.isNumber(p)&&(p=n.roundWithPrecision(p,2)),l){var m='<span class="'+c.join(" ")+'" style="'+a.units.len+": "+Math.round(d[a.units.len])+"px; "+a.counterUnits.len+": "+Math.round(d[a.counterUnits.len])+'px">'+p+"</span>";f=u.foreignObject(m,n.extend({style:"overflow: visible;"},d))}else f=u.elem("text",d,c.join(" ")).text(p);h.emit("draw",n.extend({type:"label",axis:a,index:r,group:u,element:f,text:p},d))},n.getSeriesOption=function(t,e,n){if(t.name&&e.series&&e.series[t.name]){var r=e.series[t.name];return r.hasOwnProperty(n)?r[n]:e[n]}return e[n]},n.optionsProvider=function(e,r,i){function a(e){var a=s;if(s=n.extend({},c),r)for(u=0;u<r.length;u++){var o=t.matchMedia(r[u][0]);o.matches&&(s=n.extend(s,r[u][1]))}i&&!e&&i.emit("optionsChanged",{previousOptions:a,currentOptions:s})}function o(){l.forEach(function(t){t.removeListener(a)})}var s,u,c=n.extend({},e),l=[];if(!t.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(r)for(u=0;u<r.length;u++){var h=t.matchMedia(r[u][0]);h.addListener(a),l.push(h)}return a(!0),{removeMediaQueryListeners:o,getCurrentOptions:function(){return n.extend({},s)}}}}(window,document,t),function(t,e,n){"use strict";n.Interpolation={},n.Interpolation.none=function(t){var e={fillHoles:!1};return t=n.extend({},e,t),function(e,r){for(var i=new n.Svg.Path,a=!0,o=0;o<e.length;o+=2){var s=e[o],u=e[o+1],c=r[o/2];void 0!==c.value?(a?i.move(s,u,!1,c):i.line(s,u,!1,c),a=!1):t.fillHoles||(a=!0)}return i}},n.Interpolation.simple=function(t){var e={divisor:2,fillHoles:!1};t=n.extend({},e,t);var r=1/Math.max(1,t.divisor);return function(e,i){for(var a,o,s,u=new n.Svg.Path,c=0;c<e.length;c+=2){var l=e[c],h=e[c+1],f=(l-a)*r,d=i[c/2];void 0!==d.value?(void 0===s?u.move(l,h,!1,d):u.curve(a+f,o,l-f,h,l,h,!1,d),a=l,o=h,s=d):t.fillHoles||(a=l=s=void 0)}return u}},n.Interpolation.monotoneCubic=function(t){function e(e,n){for(var r=[],i=!0,a=0;a<e.length;a+=2)void 0===n[a/2].value?t.fillHoles||(i=!0):a>=2&&e[a]<=e[a-2]?i=!0:(i&&(r.push({pathCoordinates:[],valueData:[]}),i=!1),r[r.length-1].pathCoordinates.push(e[a],e[a+1]),r[r.length-1].valueData.push(n[a/2]));return r}var r={fillHoles:!1};return t=n.extend({},r,t),function i(t,r){var a=e(t,r);if(a.length){if(a.length>1){var o=[];return a.forEach(function(t){o.push(i(t.pathCoordinates,t.valueData))}),n.Svg.Path.join(o)}if(t=a[0].pathCoordinates,r=a[0].valueData,t.length<=4)return n.Interpolation.none()(t,r);var s,u,c=[],l=[],h=t.length/2,f=[],d=[],p=[],m=[];for(s=0;h>s;s++)c[s]=t[2*s],l[s]=t[2*s+1];for(s=0;h-1>s;s++)p[s]=l[s+1]-l[s],m[s]=c[s+1]-c[s],d[s]=p[s]/m[s];for(f[0]=d[0],f[h-1]=d[h-2],s=1;h-1>s;s++)0===d[s]||0===d[s-1]||d[s-1]>0!=d[s]>0?f[s]=0:(f[s]=3*(m[s-1]+m[s])/((2*m[s]+m[s-1])/d[s-1]+(m[s]+2*m[s-1])/d[s]),isFinite(f[s])||(f[s]=0));for(u=(new n.Svg.Path).move(c[0],l[0],!1,r[0]),s=0;h-1>s;s++)u.curve(c[s]+m[s]/3,l[s]+f[s]*m[s]/3,c[s+1]-m[s]/3,l[s+1]-f[s+1]*m[s]/3,c[s+1],l[s+1],!1,r[s+1]);return u}return n.Interpolation.none()([])}},n.Interpolation.step=function(t){var e={postpone:!0,fillHoles:!1};return t=n.extend({},e,t),function(e,r){for(var i,a,o,s=new n.Svg.Path,u=0;u<e.length;u+=2){var c=e[u],l=e[u+1],h=r[u/2];void 0!==h.value?(void 0===o?s.move(c,l,!1,h):(t.postpone?s.line(c,a,!1,o):s.line(i,l,!1,h),s.line(c,l,!1,h)),i=c,a=l,o=h):t.fillHoles||(i=a=o=void 0)}return s}}}(window,document,t),function(t,e,n){"use strict";n.EventEmitter=function(){function t(t,e){r[t]=r[t]||[],r[t].push(e)}function e(t,e){r[t]&&(e?(r[t].splice(r[t].indexOf(e),1),0===r[t].length&&delete r[t]):delete r[t])}function n(t,e){r[t]&&r[t].forEach(function(t){t(e)}),r["*"]&&r["*"].forEach(function(n){n(t,e)})}var r=[];return{addEventHandler:t,removeEventHandler:e,emit:n}}}(window,document,t),function(t,e,n){"use strict";function r(t){var e=[];if(t.length)for(var n=0;n<t.length;n++)e.push(t[n]);return e}function i(t,e){var r=e||this.prototype||n.Class,i=Object.create(r);n.Class.cloneDefinitions(i,t);var a=function(){var t,e=i.constructor||function(){};return t=this===n?Object.create(i):this,e.apply(t,Array.prototype.slice.call(arguments,0)),t};return a.prototype=i,a["super"]=r,a.extend=this.extend,a}function a(){var t=r(arguments),e=t[0];return t.splice(1,t.length-1).forEach(function(t){Object.getOwnPropertyNames(t).forEach(function(n){delete e[n],Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}),e}n.Class={extend:i,cloneDefinitions:a}}(window,document,t),function(t,e,n){"use strict";function r(t,e,r){return t&&(this.data=t,this.eventEmitter.emit("data",{type:"update",data:this.data})),e&&(this.options=n.extend({},r?this.options:this.defaultOptions,e),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=n.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this}function i(){return this.initializeTimeoutId?t.clearTimeout(this.initializeTimeoutId):(t.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this}function a(t,e){return this.eventEmitter.addEventHandler(t,e),this}function o(t,e){return this.eventEmitter.removeEventHandler(t,e),this}function s(){t.addEventListener("resize",this.resizeListener),this.optionsProvider=n.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",function(){this.update()}.bind(this)),this.options.plugins&&this.options.plugins.forEach(function(t){t instanceof Array?t[0](this,t[1]):t(this)}.bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}function u(t,e,r,i,a){this.container=n.querySelector(t),this.data=e,this.defaultOptions=r,this.options=i,this.responsiveOptions=a,this.eventEmitter=n.EventEmitter(),this.supportsForeignObject=n.Svg.isSupported("Extensibility"),this.supportsAnimations=n.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=function(){this.update()}.bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(s.bind(this),0)}n.Base=n.Class.extend({constructor:u,optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:r,detach:i,on:a,off:o,version:n.version,supportsForeignObject:!1})}(window,document,t),function(t,e,n){"use strict";function r(t,r,i,a,o){t instanceof Element?this._node=t:(this._node=e.createElementNS(n.namespaces.svg,t),"svg"===t&&this.attr({"xmlns:ct":n.namespaces.ct})),r&&this.attr(r),i&&this.addClass(i),a&&(o&&a._node.firstChild?a._node.insertBefore(this._node,a._node.firstChild):a._node.appendChild(this._node))}function i(t,e){return"string"==typeof t?e?this._node.getAttributeNS(e,t):this._node.getAttribute(t):(Object.keys(t).forEach(function(e){if(void 0!==t[e])if(-1!==e.indexOf(":")){var r=e.split(":");this._node.setAttributeNS(n.namespaces[r[0]],e,t[e])}else this._node.setAttribute(e,t[e])}.bind(this)),this)}function a(t,e,r,i){return new n.Svg(t,e,r,this,i)}function o(){return this._node.parentNode instanceof SVGElement?new n.Svg(this._node.parentNode):null}function s(){for(var t=this._node;"svg"!==t.nodeName;)t=t.parentNode;return new n.Svg(t)}function u(t){var e=this._node.querySelector(t);return e?new n.Svg(e):null}function c(t){var e=this._node.querySelectorAll(t);return e.length?new n.Svg.List(e):null}function l(t,r,i,a){if("string"==typeof t){var o=e.createElement("div");o.innerHTML=t,t=o.firstChild}t.setAttribute("xmlns",n.namespaces.xmlns);var s=this.elem("foreignObject",r,i,a);return s._node.appendChild(t),s}function h(t){return this._node.appendChild(e.createTextNode(t)),this}function f(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}function d(){return this._node.parentNode.removeChild(this._node),this.parent()}function p(t){return this._node.parentNode.replaceChild(t._node,this._node),t}function m(t,e){return e&&this._node.firstChild?this._node.insertBefore(t._node,this._node.firstChild):this._node.appendChild(t._node),this}function v(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]}function g(t){return this._node.setAttribute("class",this.classes(this._node).concat(t.trim().split(/\s+/)).filter(function(t,e,n){return n.indexOf(t)===e}).join(" ")),this}function x(t){var e=t.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(t){return-1===e.indexOf(t)}).join(" ")),this}function y(){return this._node.setAttribute("class",""),this}function b(){return this._node.getBoundingClientRect().height}function w(){return this._node.getBoundingClientRect().width}function E(t,e,r){return void 0===e&&(e=!0),Object.keys(t).forEach(function(i){function a(t,e){var a,o,s,u={};t.easing&&(s=t.easing instanceof Array?t.easing:n.Svg.Easing[t.easing],delete t.easing),t.begin=n.ensureUnit(t.begin,"ms"),t.dur=n.ensureUnit(t.dur,"ms"),s&&(t.calcMode="spline",t.keySplines=s.join(" "),t.keyTimes="0;1"),e&&(t.fill="freeze",u[i]=t.from,this.attr(u),o=n.quantity(t.begin||0).value,t.begin="indefinite"),a=this.elem("animate",n.extend({attributeName:i},t)),e&&setTimeout(function(){try{a._node.beginElement()}catch(e){u[i]=t.to,this.attr(u),a.remove()}}.bind(this),o),r&&a._node.addEventListener("beginEvent",function(){r.emit("animationBegin",{element:this,animate:a._node,params:t})}.bind(this)),a._node.addEventListener("endEvent",function(){r&&r.emit("animationEnd",{element:this,animate:a._node,params:t}),e&&(u[i]=t.to,this.attr(u),a.remove())}.bind(this))}t[i]instanceof Array?t[i].forEach(function(t){a.bind(this)(t,!1)}.bind(this)):a.bind(this)(t[i],e)}.bind(this)),this}function A(t){var e=this;this.svgElements=[];for(var r=0;r<t.length;r++)this.svgElements.push(new n.Svg(t[r]));Object.keys(n.Svg.prototype).filter(function(t){return-1===["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(t)}).forEach(function(t){e[t]=function(){var r=Array.prototype.slice.call(arguments,0);return e.svgElements.forEach(function(e){n.Svg.prototype[t].apply(e,r)}),e}})}n.Svg=n.Class.extend({constructor:r,attr:i,elem:a,parent:o,root:s,querySelector:u,querySelectorAll:c,foreignObject:l,text:h,empty:f,remove:d,replace:p,append:m,classes:v,addClass:g,removeClass:x,removeAllClasses:y,height:b,width:w,animate:E}),n.Svg.isSupported=function(t){return e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+t,"1.1")};var S={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]};n.Svg.Easing=S,n.Svg.List=n.Class.extend({constructor:A})}(window,document,t),function(t,e,n){"use strict";function r(t,e,r,i,a,o){var s=n.extend({command:a?t.toLowerCase():t.toUpperCase()},e,o?{data:o}:{});r.splice(i,0,s)}function i(t,e){t.forEach(function(n,r){b[n.command.toLowerCase()].forEach(function(i,a){e(n,i,r,a,t)})})}function a(t,e){this.pathElements=[],this.pos=0,this.close=t,this.options=n.extend({},w,e)}function o(t){return void 0!==t?(this.pos=Math.max(0,Math.min(this.pathElements.length,t)),this):this.pos}function s(t){return this.pathElements.splice(this.pos,t),this}function u(t,e,n,i){return r("M",{x:+t,y:+e},this.pathElements,this.pos++,n,i),this}function c(t,e,n,i){return r("L",{x:+t,y:+e},this.pathElements,this.pos++,n,i),this}function l(t,e,n,i,a,o,s,u){return r("C",{x1:+t,y1:+e,x2:+n,y2:+i,x:+a,y:+o},this.pathElements,this.pos++,s,u),this}function h(t,e,n,i,a,o,s,u,c){return r("A",{rx:+t,ry:+e,xAr:+n,lAf:+i,sf:+a,x:+o,y:+s},this.pathElements,this.pos++,u,c),this}function f(t){var e=t.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(t,e){return e.match(/[A-Za-z]/)&&t.push([]),t[t.length-1].push(e),t},[]);"Z"===e[e.length-1][0].toUpperCase()&&e.pop();var r=e.map(function(t){var e=t.shift(),r=b[e.toLowerCase()];return n.extend({command:e},r.reduce(function(e,n,r){return e[n]=+t[r],e},{}))}),i=[this.pos,0];return Array.prototype.push.apply(i,r),Array.prototype.splice.apply(this.pathElements,i),this.pos+=r.length,this}function d(){var t=Math.pow(10,this.options.accuracy);return this.pathElements.reduce(function(e,n){var r=b[n.command.toLowerCase()].map(function(e){return this.options.accuracy?Math.round(n[e]*t)/t:n[e]}.bind(this));return e+n.command+r.join(",")}.bind(this),"")+(this.close?"Z":"")}function p(t,e){return i(this.pathElements,function(n,r){n[r]*="x"===r[0]?t:e}),this}function m(t,e){return i(this.pathElements,function(n,r){n[r]+="x"===r[0]?t:e}),this}function v(t){return i(this.pathElements,function(e,n,r,i,a){var o=t(e,n,r,i,a);(o||0===o)&&(e[n]=o)}),this}function g(t){var e=new n.Svg.Path(t||this.close);return e.pos=this.pos,e.pathElements=this.pathElements.slice().map(function(t){return n.extend({},t)}),e.options=n.extend({},this.options),e}function x(t){var e=[new n.Svg.Path];return this.pathElements.forEach(function(r){r.command===t.toUpperCase()&&0!==e[e.length-1].pathElements.length&&e.push(new n.Svg.Path),e[e.length-1].pathElements.push(r)}),e}function y(t,e,r){for(var i=new n.Svg.Path(e,r),a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.pathElements.length;s++)i.pathElements.push(o.pathElements[s]);return i}var b={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},w={accuracy:3};n.Svg.Path=n.Class.extend({constructor:a,position:o,remove:s,move:u,line:c,curve:l,arc:h,scale:p,translate:m,transform:v,parse:f,stringify:d,clone:g,splitByCommand:x}),n.Svg.Path.elementDescriptions=b,n.Svg.Path.join=y}(window,document,t),function(t,e,n){"use strict";function r(t,e,n,r){this.units=t,this.counterUnits=t===a.x?a.y:a.x,this.chartRect=e,this.axisLength=e[t.rectEnd]-e[t.rectStart],this.gridOffset=e[t.rectOffset],this.ticks=n,this.options=r}function i(t,e,r,i,a){var o=this.units.pos.toUpperCase(),s=i["axis"+o],u=this.ticks.map(this.projectValue.bind(this)),c=this.ticks.map(s.labelInterpolationFnc);u.forEach(function(l,h){var f={x:0,y:0},d=0;"Y"==o&&(d=u[h+1]?u[h+1]-l:Math.max(this.axisLength-l,30)),n.isFalseyButZero(c[h])&&""!==c[h]||("x"===this.units.pos?(l=this.chartRect.x1+l,f.x=i.axisX.labelOffset.x,"start"===i.axisX.position?f.y=this.chartRect.padding.top+i.axisX.labelOffset.y+(r?5:20):f.y=this.chartRect.y1+i.axisX.labelOffset.y+(r?5:20)):(l=this.chartRect.y1-l,f.y=i.axisY.labelOffset.y-(r?d:0),"start"===i.axisY.position?f.x=r?this.chartRect.padding.left+i.axisY.labelOffset.x:this.chartRect.x1-10:f.x=this.chartRect.x2+i.axisY.labelOffset.x+10),s.showGrid&&n.createGrid(l,h,this,this.gridOffset,this.chartRect[this.counterUnits.len](),t,[i.classNames.grid,i.classNames[this.units.dir]],a),s.showLabel&&n.createLabel(l,d,h,c,this,s.offset,f,e,[i.classNames.label,i.classNames[this.units.dir],i.classNames[s.position]],r,a))}.bind(this))}var a={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};n.Axis=n.Class.extend({constructor:r,createGridAndLabels:i,projectValue:function(t,e,n){throw new Error("Base axis can't be instantiated!")}}),n.Axis.units=a}(window,document,t),function(t,e,n){"use strict";function r(t,e,r,i){var a=i.highLow||n.getHighLow(e.normalized,i,t.pos);this.bounds=n.getBounds(r[t.rectEnd]-r[t.rectStart],a,i.scaleMinSpace||20,i.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},n.AutoScaleAxis["super"].constructor.call(this,t,r,this.bounds.values,i)}function i(t){return this.axisLength*(+n.getMultiValue(t,this.units.pos)-this.bounds.min)/this.bounds.range}n.AutoScaleAxis=n.Axis.extend({constructor:r,projectValue:i})}(window,document,t),function(t,e,n){"use strict";function r(t,e,r,i){var a=i.highLow||n.getHighLow(e.normalized,i,t.pos);this.divisor=i.divisor||1,this.ticks=i.ticks||n.times(this.divisor).map(function(t,e){return a.low+(a.high-a.low)/this.divisor*e}.bind(this)),this.ticks.sort(function(t,e){return t-e}),this.range={min:a.low,max:a.high},n.FixedScaleAxis["super"].constructor.call(this,t,r,this.ticks,i),this.stepLength=this.axisLength/this.divisor}function i(t){return this.axisLength*(+n.getMultiValue(t,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}n.FixedScaleAxis=n.Axis.extend({constructor:r,projectValue:i})}(window,document,t),function(t,e,n){"use strict";function r(t,e,r,i){n.StepAxis["super"].constructor.call(this,t,r,i.ticks,i),this.stepLength=this.axisLength/(i.ticks.length-(i.stretch?1:0))}function i(t,e){return this.stepLength*e}n.StepAxis=n.Axis.extend({constructor:r,projectValue:i})}(window,document,t),function(t,e,n){"use strict";function r(t){this.data=n.normalizeData(this.data);var e={raw:this.data,normalized:n.getDataArray(this.data,t.reverseData,!0)
};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart);var r,i,o=this.svg.elem("g").addClass(t.classNames.gridGroup),s=this.svg.elem("g"),u=this.svg.elem("g").addClass(t.classNames.labelGroup),c=n.createChartRect(this.svg,t,a.padding);r=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,e,c,n.extend({},t.axisX,{ticks:e.raw.labels,stretch:t.fullWidth})):t.axisX.type.call(n,n.Axis.units.x,e,c,t.axisX),i=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,e,c,n.extend({},t.axisY,{high:n.isNum(t.high)?t.high:t.axisY.high,low:n.isNum(t.low)?t.low:t.axisY.low})):t.axisY.type.call(n,n.Axis.units.y,e,c,t.axisY),r.createGridAndLabels(o,u,this.supportsForeignObject,t,this.eventEmitter),i.createGridAndLabels(o,u,this.supportsForeignObject,t,this.eventEmitter),e.raw.series.forEach(function(a,o){var u=s.elem("g");u.attr({"ct:series-name":a.name,"ct:meta":n.serialize(a.meta)}),u.addClass([t.classNames.series,a.className||t.classNames.series+"-"+n.alphaNumerate(o)].join(" "));var l=[],h=[];e.normalized[o].forEach(function(t,s){var u={x:c.x1+r.projectValue(t,s,e.normalized[o]),y:c.y1-i.projectValue(t,s,e.normalized[o])};l.push(u.x,u.y),h.push({value:t,valueIndex:s,meta:n.getMetaData(a,s)})}.bind(this));var f={lineSmooth:n.getSeriesOption(a,t,"lineSmooth"),showPoint:n.getSeriesOption(a,t,"showPoint"),showLine:n.getSeriesOption(a,t,"showLine"),showArea:n.getSeriesOption(a,t,"showArea"),areaBase:n.getSeriesOption(a,t,"areaBase")},d="function"==typeof f.lineSmooth?f.lineSmooth:f.lineSmooth?n.Interpolation.cardinal():n.Interpolation.none(),p=d(l,h);if(f.showPoint&&p.pathElements.forEach(function(e){var s=u.elem("line",{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y},t.classNames.point).attr({"ct:value":[e.data.value.x,e.data.value.y].filter(n.isNum).join(","),"ct:meta":e.data.meta});this.eventEmitter.emit("draw",{type:"point",value:e.data.value,index:e.data.valueIndex,meta:e.data.meta,series:a,seriesIndex:o,axisX:r,axisY:i,group:u,element:s,x:e.x,y:e.y})}.bind(this)),f.showLine){var m=u.elem("path",{d:p.stringify()},t.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:e.normalized[o],path:p.clone(),chartRect:c,index:o,series:a,seriesIndex:o,axisX:r,axisY:i,group:u,element:m})}if(f.showArea&&i.range){var v=Math.max(Math.min(f.areaBase,i.range.max),i.range.min),g=c.y1-i.projectValue(v);p.splitByCommand("M").filter(function(t){return t.pathElements.length>1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,g).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,g)}).forEach(function(n){var s=u.elem("path",{d:n.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:e.normalized[o],path:n.clone(),series:a,seriesIndex:o,axisX:r,axisY:i,chartRect:c,index:o,group:u,element:s})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:i.bounds,chartRect:c,axisX:r,axisY:i,svg:this.svg,options:t})}function i(t,e,r,i){n.Line["super"].constructor.call(this,t,e,a,n.extend({},a,r),i)}var a={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Line=n.Base.extend({constructor:i,createChart:r})}(window,document,t),function(t,e,n){"use strict";function r(t){this.data=n.normalizeData(this.data);var e,r={raw:this.data,normalized:t.distributeSeries?n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y").map(function(t){return[t]}):n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y")};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var i=this.svg.elem("g").addClass(t.classNames.gridGroup),o=this.svg.elem("g"),s=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==r.normalized.length){var u=n.serialMap(r.normalized,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});e=n.getHighLow([u],n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y")}else e=n.getHighLow(r.normalized,n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y");e.high=+t.high||(0===t.high?0:e.high),e.low=+t.low||(0===t.low?0:e.low);var c,l,h,f,d,p=n.createChartRect(this.svg,t,a.padding);l=t.distributeSeries&&t.stackBars?r.raw.labels.slice(0,1):r.raw.labels,t.horizontalBars?(c=f=void 0===t.axisX.type?new n.AutoScaleAxis(n.Axis.units.x,r,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})):t.axisX.type.call(n,n.Axis.units.x,r,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})),h=d=void 0===t.axisY.type?new n.StepAxis(n.Axis.units.y,r,p,{ticks:l}):t.axisY.type.call(n,n.Axis.units.y,r,p,t.axisY)):(h=f=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,r,p,{ticks:l}):t.axisX.type.call(n,n.Axis.units.x,r,p,t.axisX),c=d=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,r,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})):t.axisY.type.call(n,n.Axis.units.y,r,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})));var m=t.horizontalBars?p.x1+c.projectValue(0):p.y1-c.projectValue(0),v=[];h.createGridAndLabels(i,s,this.supportsForeignObject,t,this.eventEmitter),c.createGridAndLabels(i,s,this.supportsForeignObject,t,this.eventEmitter),r.raw.series.forEach(function(e,i){var a,s,u=i-(r.raw.series.length-1)/2;a=t.distributeSeries&&!t.stackBars?h.axisLength/r.normalized.length/2:t.distributeSeries&&t.stackBars?h.axisLength/2:h.axisLength/r.normalized[i].length/2,s=o.elem("g"),s.attr({"ct:series-name":e.name,"ct:meta":n.serialize(e.meta)}),s.addClass([t.classNames.series,e.className||t.classNames.series+"-"+n.alphaNumerate(i)].join(" ")),r.normalized[i].forEach(function(o,l){var g,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,g=t.horizontalBars?{x:p.x1+c.projectValue(o&&o.x?o.x:0,l,r.normalized[i]),y:p.y1-h.projectValue(o&&o.y?o.y:0,b,r.normalized[i])}:{x:p.x1+h.projectValue(o&&o.x?o.x:0,b,r.normalized[i]),y:p.y1-c.projectValue(o&&o.y?o.y:0,l,r.normalized[i])},h instanceof n.StepAxis&&(h.options.stretch||(g[h.units.pos]+=a*(t.horizontalBars?-1:1)),g[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=v[l]||m,v[l]=y-(m-g[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=g[h.units.pos],w[h.units.pos+"2"]=g[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=g[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=v[l]),w.x1=Math.min(Math.max(w.x1,p.x1),p.x2),w.x2=Math.min(Math.max(w.x2,p.x1),p.x2),w.y1=Math.min(Math.max(w.y1,p.y2),p.y1),w.y2=Math.min(Math.max(w.y2,p.y2),p.y1),x=s.elem("line",w,t.classNames.bar).attr({"ct:value":[o.x,o.y].filter(n.isNum).join(","),"ct:meta":n.getMetaData(e,l)}),this.eventEmitter.emit("draw",n.extend({type:"bar",value:o,index:l,meta:n.getMetaData(e,l),series:e,seriesIndex:i,axisX:f,axisY:d,chartRect:p,group:s,element:x},w))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:c.bounds,chartRect:p,axisX:f,axisY:d,svg:this.svg,options:t})}function i(t,e,r,i){n.Bar["super"].constructor.call(this,t,e,a,n.extend({},a,r),i)}var a={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Bar=n.Base.extend({constructor:i,createChart:r})}(window,document,t),t}),function(t,e){t["Chartist.plugins.ctAxisTitle"]=e()}(this,function(){return function(t,e,n){"use strict";var r={axisTitle:"",axisClass:"ct-axis-title",offset:{x:0,y:0},textAnchor:"middle",flipText:!1},i={axisX:r,axisY:r};n.plugins=n.plugins||{},n.plugins.ctAxisTitle=function(t){return t=n.extend({},i,t),function(e){e.on("created",function(e){var r,i,a;if(t.axisX.axisTitle&&e.axisX&&(r=e.axisX.axisLength/2+e.options.axisY.offset+e.options.chartPadding.left,i=e.options.chartPadding.top,"end"===e.options.axisY.position&&(r-=e.options.axisY.offset),"end"===e.options.axisX.position&&(i+=e.axisY.axisLength),a=new n.Svg("text"),a.addClass(t.axisX.axisClass),a.text(t.axisX.axisTitle),a.attr({x:r+t.axisX.offset.x,y:i+t.axisX.offset.y,"text-anchor":t.axisX.textAnchor}),e.svg.append(a,!0)),t.axisY.axisTitle&&e.axisY){r=0,i=e.axisY.axisLength/2+e.options.chartPadding.top,"start"===e.options.axisX.position&&(i+=e.options.axisX.offset),"end"===e.options.axisY.position&&(r=e.axisX.axisLength);var o="rotate("+(t.axisY.flipText?-90:90)+", "+r+", "+i+")";a=new n.Svg("text"),a.addClass(t.axisY.axisClass),a.text(t.axisY.axisTitle),a.attr({x:r+t.axisY.offset.x,y:i+t.axisY.offset.y,transform:o,"text-anchor":t.axisY.textAnchor}),e.svg.append(a,!0)}})}}}(window,document,Chartist),Chartist.plugins.ctAxisTitle}),function(t,e){t["Chartist.plugins.zoom"]=e()}(this,function(){return function(t,e,n){"use strict";function r(t){t.attr({style:"display:none"})}function i(t){t.attr({style:"display:block"})}function a(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r;return 0>i&&(i=-i,n=e.x),0>a&&(a=-a,r=e.y),{x:n,y:r,width:i,height:a}}function o(t,e){return s(t.clientX,t.clientY,e)}function s(t,e,n){var r="svg"===n.tagName?n:n.ownerSVGElement,i=r.getScreenCTM(),a=r.createSVGPoint();return a.x=t,a.y=e,a=a.matrixTransform(i.inverse()),a||{x:0,y:0}}function u(t,e){var n=e.bounds.max,r=e.bounds.min;if(e.scale&&"log"===e.scale.type){var i=e.scale.base;return Math.pow(i,t*c(n/r,i)/e.axisLength)*r}return t*e.bounds.range/e.axisLength+r}function c(t,e){return Math.log(t)/Math.log(e)}var l={};n.plugins=n.plugins||{},n.plugins.zoom=function(t){return t=n.extend({},l,t),function(e){function s(t){var e=o(t,b);return e.id=t.identifier,e}function c(t){for(var e=0;e<M.length;e++){var n=M[e].id;if(n===t)return e}return-1}function l(t){for(var e=t.changedTouches,n=0;n<e.length;n++)M.push(s(e[n]));M.length>1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n<e.length;n++){var r=c(e[n].identifier);M.splice(r,1,s(e[n]))}M.length>1&&(y.attr(a(M[0],M[1])),i(y),t.preventDefault())}function f(t){d(t.changedTouches)}function d(t){for(var e=0;e<t.length;e++){var n=c(t[e].identifier);n>=0&&M.splice(n,1)}}function p(t){M.length>1&&g(a(M[0],M[1])),d(t.changedTouches),r(y)}function m(t){0===t.button&&(S=o(t,b),y.attr(a(S,S)),i(y),t.preventDefault())}function v(e){if(0===e.button){var n=a(S,o(e,b));g(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function g(t){if(t.width>5&&t.height>5){var n=t.x-A.x1,r=n+t.width,i=A.y1-t.y,a=i-t.height,o=u(n,w),s=u(r,w),c=u(a,E),l=u(i,E),h=e.options.explicitBounds;_.isUndefined(h)||(_.isUndefined(h.xLow)||(o=Math.max(h.xLow,o)),_.isUndefined(h.xHigh)||(s=Math.min(h.xHigh,s)),_.isUndefined(h.yLow)||(c=Math.max(h.yLow,c)),_.isUndefined(h.yHigh)||(l=Math.min(h.yHigh,l))),e.options.axisX.highLow={low:o,high:s},e.options.axisY.highLow={low:c,high:l},e.update(e.data,e.options),C&&C(e,O)}}function x(t){if(S){var e=o(t,b);y.attr(a(S,e)),t.preventDefault()}}if(e instanceof n.Line){var y,b,w,E,A,S,C=t.onZoom,M=[];e.on("draw",function(t){var e=t.type;"line"!==e&&"bar"!==e&&"area"!==e&&"point"!==e||t.element.attr({"clip-path":"url(#zoom-mask)"})}),e.on("created",function(t){w=t.axisX,E=t.axisY,A=t.chartRect,b=t.svg._node,y=t.svg.elem("rect",{x:10,y:10,width:100,height:100},"ct-zoom-rect"),r(y);var e=t.svg.querySelector("defs")||t.svg.elem("defs"),n=A.width(),i=A.height();e.elem("clipPath",{id:"zoom-mask"}).elem("rect",{x:A.x1,y:A.y2,width:n,height:i,fill:"white"}),b.addEventListener("mousedown",m),b.addEventListener("mouseup",v),b.addEventListener("mousemove",x),b.addEventListener("touchstart",l),b.addEventListener("touchmove",h),b.addEventListener("touchend",p),b.addEventListener("touchcancel",f)});var O=function(){e.options.axisX.highLow=null,e.options.axisY.highLow=null,e.update(e.data,e.options)}}}}}(window,document,Chartist),Chartist.plugins.zoom}),function(){function t(t,e){return t.set(e[0],e[1]),t}function e(t,e){return t.add(e),t}function n(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function r(t,e){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function i(t,e,n,r){var i=-1,a=t.length;for(r&&a&&(n=t[++i]);++i<a;)n=e(n,t[i],i,t);return n}function a(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function o(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function s(t,e){return r(e,function(e){return[e,t[e]]})}function u(t){return t&&t.Object===Object?t:null}function c(t){return vn[t]}function l(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}function h(t,e){return t="number"==typeof t||dn.test(t)?+t:-1,e=null==e?Ae:e,t>-1&&t%1==0&&e>t}function f(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function d(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function p(t){return gn[t]}function m(){}function v(){}function g(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ve:n}return jn.call(t,e)?t[e]:ve}function y(t,e){return Gn?t[e]!==ve:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ve?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function E(){this.__data__={hash:new v,map:Fn?new Fn:[],string:new v}}function A(t){var e=this.__data__;return Tt(t)?g("string"==typeof t?e.string:e.hash,t):Fn?e.map["delete"](t):k(e.map,t)}function S(t){var e=this.__data__;return Tt(t)?x("string"==typeof t?e.string:e.hash,t):Fn?e.map.get(t):T(e.map,t)}function C(t){var e=this.__data__;return Tt(t)?y("string"==typeof t?e.string:e.hash,t):Fn?e.map.has(t):P(e.map,t)}function _(t,e){var n=this.__data__;return Tt(t)?b("string"==typeof t?n.string:n.hash,t,e):Fn?n.map.set(t,e):I(n.map,t,e),this}function M(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function O(){this.__data__={array:[],map:null}}function L(t){var e=this.__data__,n=e.array;return n?k(n,t):e.map["delete"](t)}function N(t){var e=this.__data__,n=e.array;return n?T(n,t):e.map.get(t)}function j(t){var e=this.__data__,n=e.array;return n?P(n,t):e.map.has(t)}function $(t,e){var n=this.__data__,r=n.array;r&&(r.length<xe-1?I(r,t,e):(n.array=null,n.map=new w(r)));var i=n.map;return i&&i.set(t,e),this}function k(t,e){var n=z(t,e);if(0>n)return!1;var r=t.length-1;return n==r?t.pop():Xn.call(t,n,1),!0}function T(t,e){var n=z(t,e);return 0>n?ve:t[n][1]}function P(t,e){return z(t,e)>-1}function z(t,e){for(var n=t.length;n--;)if(Yt(t[n][0],e))return n;return-1}function I(t,e,n){var r=z(t,e);0>r?t.push([e,n]):t[r][1]=n}function B(t,e,n){var r=t[e];jn.call(t,e)&&Yt(r,n)&&(n!==ve||e in t)||(t[e]=n)}function R(t,e){return t&&pt(e,oe(e),t)}function U(t){return"function"==typeof t?t:de}function X(t){return ar(t)?t:Bt(t)}function Y(t,e,r,i,a,o,s){var u;if(i&&(u=o?i(t,a,o,s):i(t)),u!==ve)return u;if(!Gt(t))return t;var c=ar(t);if(c){if(u=Ot(t),!e)return dt(t,u)}else{var h=_t(t),f=h==Ne||h==je;if(or(t))return ot(t,e);if(h==Te||h==Ce||f&&!o){if(l(t))return o?t:{};if(u=Lt(f?{}:t),!e)return u=R(u,t),r?vt(t,u):u}else{if(!mn[h])return o?t:{};u=Nt(t,h,e)}}s||(s=new M);var d=s.get(t);return d?d:(s.set(t,u),(c?n:q)(t,function(n,a){B(u,a,Y(n,e,r,i,a,t,s))}),r&&!c?vt(t,u):u)}function D(t){return Gt(t)?Rn(t):{}}function q(t,e){return t&&nr(t,e,oe)}function F(t,e){e=kt(e,t)?[e+""]:X(e);for(var n=0,r=e.length;null!=t&&r>n;)t=t[e[n++]];return n&&n==r?t:ve}function H(t,e){return jn.call(t,e)||"object"==typeof t&&e in t&&null===In(t)}function V(t,e){return e in Object(t)}function G(t,e,n,r,i){return t===e?!0:null==t||null==e||!Gt(t)&&!Wt(e)?t!==t&&e!==e:W(t,e,G,n,r,i)}function W(t,e,n,r,i,a){var o=ar(t),s=ar(e),u=_e,c=_e;o||(u=_t(t),u=u==Ce?Te:u),s||(c=_t(e),c=c==Ce?Te:c);var h=u==Te&&!l(t),f=c==Te&&!l(e),d=u==c;if(d&&!h)return a||(a=new M),o||te(t)?bt(t,e,n,r,i,a):wt(t,e,u,n,r,i,a);if(!(i&we)){var p=h&&jn.call(t,"__wrapped__"),m=f&&jn.call(e,"__wrapped__");if(p||m)return a||(a=new M),n(p?t.value():t,m?e.value():e,r,i,a)}return d?(a||(a=new M),Et(t,e,n,r,i,a)):!1}function Q(t,e,n,r){var i=n.length,a=i,o=!r;if(null==t)return!a;for(t=Object(t);i--;){var s=n[i];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=n[i];var u=s[0],c=t[u],l=s[1];if(o&&s[2]){if(c===ve&&!(u in t))return!1}else{var h=new M,f=r?r(c,l,u,t,e,h):ve;if(!(f===ve?G(l,c,r,be|we,h):f))return!1}}return!0}function Z(t){var e=typeof t;return"function"==e?t:null==t?de:"object"==e?ar(t)?et(t[0],t[1]):tt(t):me(t)}function J(t){return Dn(Object(t))}function K(t,e){var n=-1,r=qt(t)?Array(t.length):[];return er(t,function(t,i,a){r[++n]=e(t,i,a)}),r}function tt(t){var e=St(t);if(1==e.length&&e[0][2]){var n=e[0][0],r=e[0][1];return function(t){return null==t?!1:t[n]===r&&(r!==ve||n in Object(t))}}return function(n){return n===t||Q(n,t,e)}}function et(t,e){return function(n){var r=ie(n,t);return r===ve&&r===e?ae(n,t):G(e,r,ve,be|we)}}function nt(t){return function(e){return null==e?ve:e[t]}}function rt(t){return function(e){return F(e,t)}}function it(t,e,n,r){for(var i=-1,a=qn(Yn((e-t)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=t,t+=n;return o}function at(t,e,n){var r=-1,i=t.length;0>e&&(e=-e>i?0:i+e),n=n>i?i:n,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r<i;)a[r]=t[r+e];return a}function ot(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}function st(t){var e=new t.constructor(t.byteLength);return new zn(e).set(new zn(t)),e}function ut(e){return i(f(e),t,new e.constructor)}function ct(t){var e=new t.constructor(t.source,un.exec(t));return e.lastIndex=t.lastIndex,e}function lt(t){return i(d(t),e,new t.constructor)}function ht(t){return Kn?Object(Kn.call(t)):{}}function ft(t,e){var n=e?st(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function dt(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function pt(t,e,n){return mt(t,e,n)}function mt(t,e,n,r){n||(n={});for(var i=-1,a=e.length;++i<a;){var o=e[i],s=r?r(n[o],t[o],o,n,t):t[o];B(n,o,s)}return n}function vt(t,e){return pt(t,ir(t),e)}function gt(t,e){return function(n,r){if(null==n)return n;if(!qt(n))return t(n,r);for(var i=n.length,a=e?i:-1,o=Object(n);(e?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function xt(t){return function(e,n,r){for(var i=-1,a=Object(e),o=r(e),s=o.length;s--;){var u=o[t?s:++i];if(n(a[u],u,a)===!1)break}return e}}function yt(t){return function(e,n,r){return r&&"number"!=typeof r&&$t(e,n,r)&&(n=r=ve),e=ne(e),e=e===e?e:0,n===ve?(n=e,e=0):n=ne(n)||0,r=r===ve?n>e?1:-1:ne(r)||0,it(e,n,r,t)}}function bt(t,e,n,r,i,o){var s=-1,u=i&we,c=i&be,l=t.length,h=e.length;if(l!=h&&!(u&&h>l))return!1;var f=o.get(t);if(f)return f==e;var d=!0;for(o.set(t,e);++s<l;){var p=t[s],m=e[s];if(r)var v=u?r(m,p,s,e,t,o):r(p,m,s,t,e,o);if(v!==ve){if(v)continue;d=!1;break}if(c){if(!a(e,function(t){return p===t||n(p,t,r,i,o)})){d=!1;break}}else if(p!==m&&!n(p,m,r,i,o)){d=!1;break}}return o["delete"](t),d}function wt(t,e,n,r,i,a,o){switch(n){case Ue:return!(t.byteLength!=e.byteLength||!r(new zn(t),new zn(e)));case Me:case Oe:return+t==+e;case Le:return t.name==e.name&&t.message==e.message;case ke:return t!=+t?e!=+e:t==+e;case Pe:case Ie:return t==e+"";case $e:var s=f;case ze:var u=a&we;if(s||(s=d),t.size!=e.size&&!u)return!1;var c=o.get(t);return c?c==e:bt(s(t),s(e),r,i,a|be,o.set(t,e));case Be:if(Kn)return Kn.call(t)==Kn.call(e)}return!1}function Et(t,e,n,r,i,a){var o=i&we,s=oe(t),u=s.length,c=oe(e),l=c.length;if(u!=l&&!o)return!1;for(var h=u;h--;){var f=s[h];if(!(o?f in e:H(e,f)))return!1}var d=a.get(t);if(d)return d==e;var p=!0;a.set(t,e);for(var m=o;++h<u;){f=s[h];var v=t[f],g=e[f];if(r)var x=o?r(g,v,f,e,t,a):r(v,g,f,t,e,a);if(!(x===ve?v===g||n(v,g,r,i,a):x)){p=!1;break}m||(m="constructor"==f)}if(p&&!m){var y=t.constructor,b=e.constructor;y!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(p=!1)}return a["delete"](t),p}function At(){var t=m.iteratee||pe;return t=t===pe?Z:t,arguments.length?t(arguments[0],arguments[1]):t}function St(t){for(var e=se(t),n=e.length;n--;)e[n][2]=zt(e[n][1]);return e}function Ct(t,e){var n=t[e];return Qt(n)?n:ve}function _t(t){return $n.call(t)}function Mt(t,e,n){if(null==t)return!1;var r=n(t,e);r||kt(e)||(e=X(e),t=It(t,e),null!=t&&(e=Rt(e),r=n(t,e)));var i=t?t.length:ve;return r||!!i&&Vt(i)&&h(e,i)&&(ar(t)||Jt(t)||Dt(t))}function Ot(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&jn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function Lt(t){return"function"!=typeof t.constructor||Pt(t)?{}:D(In(t))}function Nt(t,e,n){var r=t.constructor;switch(e){case Ue:return st(t);case Me:case Oe:return new r(+t);case Xe:case Ye:case De:case qe:case Fe:case He:case Ve:case Ge:case We:return ft(t,n);case $e:return ut(t);case ke:case Ie:return new r(t);case Pe:return ct(t);case ze:return lt(t);case Be:return ht(t)}}function jt(t){var e=t?t.length:ve;return Vt(e)&&(ar(t)||Jt(t)||Dt(t))?o(e,String):null}function $t(t,e,n){if(!Gt(n))return!1;var r=typeof e;return("number"==r?qt(n)&&h(e,n.length):"string"==r&&e in n)?Yt(n[e],t):!1}function kt(t,e){return"number"==typeof t?!0:!ar(t)&&(en.test(t)||!tn.test(t)||null!=e&&t in Object(e))}function Tt(t){var e=typeof t;return"number"==e||"boolean"==e||"string"==e&&"__proto__"!=t||null==t}function Pt(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||Ln;return t===n}function zt(t){return t===t&&!Gt(t)}function It(t,e){return 1==e.length?t:ie(t,at(e,0,-1))}function Bt(t){var e=[];return re(t).replace(nn,function(t,n,r,i){e.push(r?i.replace(sn,"$1"):n||t)}),e}function Rt(t){var e=t?t.length:0;return e?t[e-1]:ve}function Ut(t,e){return"function"==typeof e&&ar(t)?n(t,e):er(t,U(e))}function Xt(t,e){var n=ar(t)?r:K;return n(t,At(e,3))}function Yt(t,e){return t===e||t!==t&&e!==e}function Dt(t){return Ft(t)&&jn.call(t,"callee")&&(!Un.call(t,"callee")||$n.call(t)==Ce)}function qt(t){return null!=t&&Vt(rr(t))&&!Ht(t)}function Ft(t){return Wt(t)&&qt(t)}function Ht(t){var e=Gt(t)?$n.call(t):"";return e==Ne||e==je}function Vt(t){return"number"==typeof t&&t>-1&&t%1==0&&Ae>=t}function Gt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wt(t){return!!t&&"object"==typeof t}function Qt(t){return null==t?!1:Ht(t)?kn.test(Nn.call(t)):Wt(t)&&(l(t)?kn:hn).test(t)}function Zt(t){return"number"==typeof t||Wt(t)&&$n.call(t)==ke}function Jt(t){return"string"==typeof t||!ar(t)&&Wt(t)&&$n.call(t)==Ie}function Kt(t){return"symbol"==typeof t||Wt(t)&&$n.call(t)==Be}function te(t){return Wt(t)&&Vt(t.length)&&!!pn[$n.call(t)]}function ee(t){return t===ve}function ne(t){if(Gt(t)){var e=Ht(t.valueOf)?t.valueOf():t;t=Gt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(on,"");var n=ln.test(t);return n||fn.test(t)?yn(t.slice(2),n?2:8):cn.test(t)?Se:+t}function re(t){if("string"==typeof t)return t;if(null==t)return"";if(Kt(t))return tr?tr.call(t):"";var e=t+"";return"0"==e&&1/t==-Ee?"-0":e}function ie(t,e,n){var r=null==t?ve:F(t,e);return r===ve?n:r}function ae(t,e){return Mt(t,e,V)}function oe(t){var e=Pt(t);if(!e&&!qt(t))return J(t);var n=jt(t),r=!!n,i=n||[],a=i.length;for(var o in t)!H(t,o)||r&&("length"==o||h(o,a))||e&&"constructor"==o||i.push(o);return i}function se(t){return s(t,oe(t))}function ue(t){return t=re(t),t&&Ke.test(t)?t.replace(Ze,c):t}function ce(t){return t=re(t),t&&an.test(t)?t.replace(rn,"\\$&"):t}function le(){var t=arguments,e=re(t[0]);return t.length<3?e:e.replace(t[1],t[2])}function he(t){return t=re(t),t&&Je.test(t)?t.replace(Qe,p):t}function fe(t){return function(){return t}}function de(t){return t}function pe(t){return Z("function"==typeof t?t:Y(t,!0))}function me(t){return kt(t)?nt(t):rt(t)}var ve,ge="4.6.1",xe=200,ye="__lodash_hash_undefined__",be=1,we=2,Ee=1/0,Ae=9007199254740991,Se=NaN,Ce="[object Arguments]",_e="[object Array]",Me="[object Boolean]",Oe="[object Date]",Le="[object Error]",Ne="[object Function]",je="[object GeneratorFunction]",$e="[object Map]",ke="[object Number]",Te="[object Object]",Pe="[object RegExp]",ze="[object Set]",Ie="[object String]",Be="[object Symbol]",Re="[object WeakMap]",Ue="[object ArrayBuffer]",Xe="[object Float32Array]",Ye="[object Float64Array]",De="[object Int8Array]",qe="[object Int16Array]",Fe="[object Int32Array]",He="[object Uint8Array]",Ve="[object Uint8ClampedArray]",Ge="[object Uint16Array]",We="[object Uint32Array]",Qe=/&(?:amp|lt|gt|quot|#39|#96);/g,Ze=/[&<>"'`]/g,Je=RegExp(Qe.source),Ke=RegExp(Ze.source),tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,en=/^\w*$/,nn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,rn=/[\\^$.*+?()[\]{}|]/g,an=RegExp(rn.source),on=/^\s+|\s+$/g,sn=/\\(\\)?/g,un=/\w*$/,cn=/^[-+]0x[0-9a-f]+$/i,ln=/^0b[01]+$/i,hn=/^\[object .+?Constructor\]$/,fn=/^0o[0-7]+$/i,dn=/^(?:0|[1-9]\d*)$/,pn={};pn[Xe]=pn[Ye]=pn[De]=pn[qe]=pn[Fe]=pn[He]=pn[Ve]=pn[Ge]=pn[We]=!0,pn[Ce]=pn[_e]=pn[Ue]=pn[Me]=pn[Oe]=pn[Le]=pn[Ne]=pn[$e]=pn[ke]=pn[Te]=pn[Pe]=pn[ze]=pn[Ie]=pn[Re]=!1;var mn={};mn[Ce]=mn[_e]=mn[Ue]=mn[Me]=mn[Oe]=mn[Xe]=mn[Ye]=mn[De]=mn[qe]=mn[Fe]=mn[$e]=mn[ke]=mn[Te]=mn[Pe]=mn[ze]=mn[Ie]=mn[Be]=mn[He]=mn[Ve]=mn[Ge]=mn[We]=!0,mn[Le]=mn[Ne]=mn[Re]=!1;var vn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},gn={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ve,wn=xn[typeof module]&&module&&!module.nodeType?module:ve,En=wn&&wn.exports===bn?bn:ve,An=u(bn&&wn&&"object"==typeof global&&global),Sn=u(xn[typeof self]&&self),Cn=u(xn[typeof window]&&window),_n=u(xn[typeof this]&&this),Mn=An||Cn!==(_n&&_n.window)&&Cn||Sn||_n||Function("return this")(),On=Array.prototype,Ln=Object.prototype,Nn=Function.prototype.toString,jn=Ln.hasOwnProperty,$n=Ln.toString,kn=RegExp("^"+Nn.call(jn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tn=En?Mn.Buffer:ve,Pn=Mn.Symbol,zn=Mn.Uint8Array,In=Object.getPrototypeOf,Bn=Object.getOwnPropertySymbols,Rn=Object.create,Un=Ln.propertyIsEnumerable,Xn=On.splice,Yn=Math.ceil,Dn=Object.keys,qn=Math.max,Fn=Ct(Mn,"Map"),Hn=Ct(Mn,"Set"),Vn=Ct(Mn,"WeakMap"),Gn=Ct(Object,"create"),Wn=Fn?Nn.call(Fn):"",Qn=Hn?Nn.call(Hn):"",Zn=Vn?Nn.call(Vn):"",Jn=Pn?Pn.prototype:ve,Kn=Jn?Jn.valueOf:ve,tr=Jn?Jn.toString:ve,er=gt(q),nr=xt(),rr=nt("length"),ir=Bn||function(){return[]};(Fn&&_t(new Fn)!=$e||Hn&&_t(new Hn)!=ze||Vn&&_t(new Vn)!=Re)&&(_t=function(t){var e=$n.call(t),n=e==Te?t.constructor:null,r="function"==typeof n?Nn.call(n):"";if(r)switch(r){case Wn:return $e;case Qn:return ze;case Zn:return Re}return e});var ar=Array.isArray,or=Tn?function(t){return t instanceof Tn}:fe(!1),sr=yt();v.prototype=Gn?Gn(null):Ln,w.prototype.clear=E,w.prototype["delete"]=A,w.prototype.get=S,w.prototype.has=C,w.prototype.set=_,M.prototype.clear=O,M.prototype["delete"]=L,M.prototype.get=N,M.prototype.has=j,M.prototype.set=$,m.constant=fe,m.iteratee=pe,m.keys=oe,m.map=Xt,m.property=me,m.range=sr,m.toPairs=se,m.eq=Yt,m.escape=ue,m.escapeRegExp=ce,m.forEach=Ut,m.get=ie,m.hasIn=ae,m.identity=de,m.isArguments=Dt,m.isArray=ar,m.isArrayLike=qt,m.isArrayLikeObject=Ft,m.isBuffer=or,m.isFunction=Ht,m.isLength=Vt,m.isNative=Qt,m.isNumber=Zt,m.isObject=Gt,m.isObjectLike=Wt,m.isString=Jt,m.isSymbol=Kt,m.isTypedArray=te,m.isUndefined=ee,m.last=Rt,m.replace=le,m.toNumber=ne,m.toString=re,m.unescape=he,m.each=Ut,m.VERSION=ge,(Cn||Sn||{})._=m,Mn._=m}.call(this),Math.log10=Math.log10||function(t){return Math.log(t)/Math.LN10},String.prototype.format=function(){var t=this,e=arguments;1==arguments.length&&(_.isArray(arguments[0])||_.isObject(arguments[0]))&&(e=arguments[0]);for(var n in e)if(e.hasOwnProperty(n)){var r=n;n.match(/^\{.*\}$/)||(n="{"+n+"}");var i=new RegExp(_.escapeRegExp(n),"g");t=t.replace(i,e[r])}return t};var modal=function(){var t={};return t.show=function(t){var e=$(t);e.removeClass("hidden visible"),setTimeout(function(){e.addClass("visible")},1)},t.hide=function(t){var e=$(t);e.removeClass("visible"),setTimeout(function(){e.addClass("hidden")},500)},t.init=function(){$(".Modal").on("click",function(){$(this).hasClass("no-close")||t.hide(this)}),$(".Dialog").on("click",function(t){t.stopImmediatePropagation()}),$(window).on("keydown",function(e){27==e.which&&t.hide(".Modal")})},t}(),notify=function(){var t,e,n={},r="#notif";return n.show=function(i,a){$(r).html(i),modal.show(r),clearTimeout(t),clearTimeout(e),_.isUndefined(a)||(t=setTimeout(n.hide,a))},n.hide=function(){var t=$(r);t.removeClass("visible"),e=setTimeout(function(){t.addClass("hidden")},250)},n.init=function(){$(r).on("click",function(){n.hide(this)})},n}();$().ready(function(){setInterval(function(){$(".anim-dots").each(function(t){var e=$(t),n=e.html()+".";5==n.length&&(n="."),e.html(n)})},1e3),$("input[type=number]").on("mousewheel",function(t){var e=+$(this).val(),n=+($(this).attr("step")||1),r=$(this).attr("min"),i=$(this).attr("max");if(t.wheelDelta>0?e+=n:e-=n,_.isUndefined(r)||(e=Math.max(e,r)),_.isUndefined(i)||(e=Math.min(e,i)),$(this).val(e),"createEvent"in document){var a=document.createEvent("HTMLEvents");a.initEvent("change",!1,!0),$(this)[0].dispatchEvent(a)}else $(this)[0].fireEvent("onchange");t.preventDefault()}),modal.init(),notify.init()});var page_wifi=function(){function t(t,e){if(200!=e)return void n(5e3);t=JSON.parse(t);var a=!bool(t.result.inProgress)&&t.result.APs.length>0;if(n(a?15e3:1e3),a){var o=$("#ap-list");$(".AP").remove(),o.toggle(a),$("#ap-loader").toggle(!a),t.result.APs.sort(function(t,e){return e.rssi-t.rssi}).forEach(function(t){if(t.enc=parseInt(t.enc),!(t.enc>4)){var e=document.createElement("div"),n=$(e).data("ssid",t.essid).data("pwd",0!=t.enc).addClass("AP");t.essid==r.current&&n.addClass("selected");var a=document.createElement("div");$(a).addClass("inner").htmlAppend('<div class="rssi">{0}</div>'.format(t.rssi_perc)).htmlAppend('<div class="essid" title="{0}">{0}</div>'.format(_.escape(t.essid))).htmlAppend('<div class="auth">{0}</div>'.format(i[t.enc]));n.on("click",function(){var t=$(this);$("#conn-essid").val(t.data("ssid")),$("#conn-passwd").val(""),t.data("pwd")?modal.show("#psk-modal"):$("#conn-form").submit()}),e.appendChild(a),o[0].appendChild(e)}})}}function e(){$().get(_root+"/wifi/scan",t)}function n(t){setTimeout(e,t)}var r={},i=["Open","WEP","WPA","WPA2","WPA/WPA2"];return r.init=function(){e()},r}(),page_waveform=function(){function t(t){var e,n,r=window.matchMedia("screen and (min-width: 544px)"),i=!r.matches,o="FFT"==t.stats.format;o?(e="Frequency - [ Hz ]",n="Magnitude - [ mA ]"):(e="Sample time - [ ms ]",n="Current - [ mA ]");var s=Math.max(-t.stats.min,t.stats.max),l=Math.max(s,10);$("#stat-count").html(t.stats.count),$("#stat-f-s").html(numfmt(t.stats.freq,2)),
$("#stat-i-peak").html(numfmt(s,2)),$("#stat-i-rms").html(numfmt(t.stats.rms,2)),$(".stats").removeClass("invis");var h=o?t.stats.freq/t.stats.count:1e3/t.stats.freq,f=_.map(t.samples,function(t,e){return{x:e*h,y:t}}),d=[Chartist.plugins.zoom({resetOnRightMouseBtn:!0,onZoom:function(t,e){a=e,u=t.options.axisX.highLow,c=t.options.axisY.highLow}})];i||d.push(Chartist.plugins.ctAxisTitle({axisX:{axisTitle:e,offset:{x:0,y:55}},axisY:{axisTitle:n,flipText:!0,offset:{x:0,y:15}}}));var p,m,v,g;u?(p=u.high,m=u.low,v=c.high,g=c.low):(v=o?void 0:l,g=o?0:-l),new Chartist.Line("#chart",{series:[{name:"a",data:f}]},{showPoint:!1,showArea:o,fullWidth:!0,chartPadding:i?{right:20,bottom:5,left:0}:{right:25,bottom:30,left:25},series:{a:{lineSmooth:Chartist.Interpolation.monotoneCubic()}},axisX:{type:Chartist.AutoScaleAxis,high:p,low:m},axisY:{type:Chartist.AutoScaleAxis,high:v,low:g},explicitBounds:{xLow:0,yLow:o?0:void 0,xHigh:f[f.length-1].x},plugins:d})}function e(e,n){if(f=!1,200!=n)errorMsg("Request failed.",1e3);else{var i=JSON.parse(e);i.success?t(i):errorMsg("Sampling failed.",1e3)}d&&(m=setTimeout(r,Math.max(0,p-msElapsed(s))))}function n(){v.count=$("#count").val(),v.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=v.count,n=v.freq,r=_root+"/measure/"+o+"?n="+t+"&fs="+n;return l=$().get(r,e,estimateLoadTime(n,t)),!0}function i(){p=+$("#ar-time").val(),n(),d=!d,d?r():clearTimeout(m),$("#ar-btn").toggleClass("btn-blue").toggleClass("btn-red").val(d?"Stop":"Auto")}var a,o,s,u,c,l,h={},f=!1,d=!1,p=1,m=-1,v={count:0,freq:0};return h.init=function(t){function e(){n(),r()}o=t,$("#load").on("click",e),$("#count,#freq").on("keyup",function(t){13==t.which&&e()}),$("#chart").on("contextmenu",function(t){return a&&a(),a=null,u=null,c=null,t.preventDefault(),!1}),$("#ar-btn").on("click",i)},h}(),page_spectrogram=function(){function t(t){var e,n,r,i;t=Math.log10(1+t),t>2&&(t=2),0>t&&(t=0);for(var a=0;a<b.length;a++){var o=b[a],s=o[0];if(t>=s&&(e=s,r=o),s>=t){n=s,i=o;break}}var u=(t-e)/(n-e);e==n&&(u=0);var c=Math.round(r[1]+(i[1]-r[1])*u),l=Math.round(r[2]+(i[2]-r[2])*u),h=Math.round(r[3]+(i[3]-r[3])*u);return"rgb("+c+","+l+","+h+")"}function e(){var t=c.getImageData(g.x+g.dx,g.y,g.w-g.dx,g.h+10);c.fillStyle="black",c.fillRect(g.x,g.y,g.w,g.h),c.clearRect(g.x,g.y+g.h+1,g.w,10),c.putImageData(t,g.x,g.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*g.dy>g.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=g.x+g.w-g.dx,s=g.y+g.h-(i+1)*g.dy,u=g.dx,l=g.dy;s<g.y&&(l-=g.y-s,s=g.y),c.fillRect(o,s,u,l)}if(msElapsed(p)>=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(g.x+g.w-.5,g.y+g.h+1),c.lineTo(g.x+g.w-.5,g.y+g.h+1+(h?6:2)),c.stroke()}}function r(t,e){if(h=!1,200==e)try{var r=JSON.parse(t);r.success?n(r.samples):errorMsg("Sampling failed.",1e3)}catch(a){errorMsg(a)}else errorMsg("Request failed.",1e3);y&&(l=setTimeout(i,Math.max(0,x.interval-msElapsed(d))))}function i(){h&&(errorMsg("Request already pending - aborting."),f.abort()),h=!0,d=msNow();var t=x.freq,e=x.sampCount,n=_root+"/measure/fft?n="+e+"&fs="+t;return f=$().get(n,r,estimateLoadTime(t,e)),!0}function a(){for(var e=8,n=10,r=g.h-12,i=g.y+6,a=g.x-e-n,o=100/r,s=0;r>s;s++){var u=t(s*o),l=t((s+1)*o),h=Math.floor(i+r-(s+1)),f=c.createLinearGradient(0,h+1,0,h);f.addColorStop(0,u),f.addColorStop(1,l),c.fillStyle=f,c.fillRect(a,h,n,1)}c.strokeStyle="#000",c.strokeRect(a-.5,i-.5,n+1,r+1),o=100/r,c.font="12px sans-serif",c.fillStyle="white",c.textAlign="right";for(var s=0;s<=g.h;s+=r/10)c.fillText(Math.round(s*o)+"",g.x-e-n-e,i+r-s+3)}function o(){var t=8,e=g.x+g.w,n=e+t,r=g.y,i=g.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=g.h/g.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p<h.length;p++)if(l/(h[p]*f)<=21){o=h[p]*f,d=!0;break}if(d)break;f*=10}o/=s,c.font="12px sans-serif",c.fillStyle="white",c.strokeStyle="white",c.textAlign="left";for(var p=0;u+o>=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var v=p*(l/u);v=v>=1e6?numfmt(v/1e6,2)+"M":v>=1e3?numfmt(v/1e3,2)+"k":numfmt(v,1);var y=Math.round(r+i-g.dy*p);if(c.fillText(v,n,y+4),c.beginPath(),c.moveTo(e,y+.5),c.lineTo(e+t/2,y+.5),c.stroke(),p>=u)break}c.font="16px sans-serif",c.save(),c.translate(e+50,g.y+g.h/2),c.rotate(Math.PI/2),c.textAlign="center",c.fillText("Frequency - [Hz]",0,0),c.restore()}function s(){x.interval=+$("#interval").val(),x.freq=2*+$("#freq").val(),x.sampCount=+$("#count").val(),g.dx=+$("#tile-x").val(),g.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(g.x,g.y,g.w,g.h),c.strokeStyle="white",c.strokeRect(g.x-.5,g.y-.5,g.w+1,g.h+1)}var c,l,h,f,d,p,m,v={},g={x:50,y:10,w:740,h:512,dx:1,dy:1},x={interval:0,sampCount:0,freq:0},y=!1,b=[[0,0,0,0],[.1,41,17,41],[.25,34,17,78],[.6,17,30,105],[1,17,57,126],[1.2,17,84,128],[1.3,17,111,115],[1.4,17,134,96],[1.5,17,155,71],[1.6,68,194,17],[1.75,111,209,17],[1.84,180,213,17],[1.9,223,217,86],[1.97,248,222,176],[1.99,255,237,222],[2,255,255,255]];return v.init=function(){var t=$("#sg")[0];c=t.getContext("2d"),u(),s(),a(),o(),p=msNow()-1e4,m=msNow()-1e4,$("#count").on("change",function(){var t=+$("#count").val(),e=Math.max(1,g.h/(t/2));$("#tile-x").val(Math.max(4,e)),$("#tile-y").val(e)}),$("#tile-y").on("change",function(){$("#tile-x").val(Math.max(4,$(this).val()))}),$("#go-btn").on("click",function(){y=!y,y?(s(),o(),i()):clearTimeout(l),$("#go-btn").toggleClass("btn-green").toggleClass("btn-red").html(y?"Stop":"Start")})},v}(),page_status=function(){function t(t,a){if(200!=a)errorMsg("Update failed.");else try{var o=JSON.parse(t);n.j=o,$(".sta-only").toggle(o.sta),$(".ap-only").toggle(o.ap),$("#uptime").html(o.uptime),$("#heap").html(o.heap+" bytes"),$("#wmode").html(o.wifiMode),o.sta&&($("#staSSID").html(o.sta.SSID),$("#staRSSIperc").html(o.sta.RSSIperc),$("#staRSSI").html(o.sta.RSSI),$("#staMAC").html(o.sta.MAC)),o.ap&&($("#apSSID").html(o.ap.SSID),$("#apHidden").html(o.ap.hidden?"Yes":"No"),$("#apAuth").html(o.ap.auth),$(".ap-auth-only").toggle("Open"!=o.ap.auth),$("#apPwd").html(o.ap.pwd),$("#apChan").html(o.ap.chan),$("#apMAC").html(o.ap.MAC))}catch(s){errorMsg(s)}i||setTimeout(e,r)}function e(){$().get(_root+"/system/status",t)}var n={};n.j={};var r=1e4,i=!1;return n.trigReset=function(){var t="#reset-modal";$().get(_root+"/system/reset",function(n,r){if(200==r){modal.show(t),i=!0;var a=setInterval(function(){$().get(_root+"/system/ping",function(n,r){200==r&&(modal.hide(t),e(),clearInterval(a),i=!1)},{timeout:500})},1e3)}})},n.init=function(){e()},n}();