From dad262f854a5d5f754214a6e93327f8ccda8e8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 23 Apr 2016 23:06:39 +0200 Subject: [PATCH 01/11] reporting page Former-commit-id: 3685153491fb72c33eaf18c1e0b6331be31dd85e --- html_src/_start.php | 11 +- html_src/css/app.css | 1367 +++- html_src/css/app.css.map | 2 +- html_src/gulpfile.js | 2 +- html_src/js/all.js | 9442 +++++++++++++++++++++- html_src/node_modules.tar.REMOVED.git-id | 1 + html_src/package.json | 7 + html_src/page_about.php | 11 +- html_src/page_monitoring.php | 76 + html_src/page_status.php | 2 +- html_src/sass/layout/_box.scss | 5 + 11 files changed, 10909 insertions(+), 17 deletions(-) create mode 100644 html_src/node_modules.tar.REMOVED.git-id create mode 100755 html_src/package.json create mode 100644 html_src/page_monitoring.php diff --git a/html_src/_start.php b/html_src/_start.php index e2e32b5..862790a 100644 --- a/html_src/_start.php +++ b/html_src/_start.php @@ -4,11 +4,12 @@ $root = $prod ? '' : 'http://192.168.1.13'; $menu = [ - 'home' => [ $prod ? '/status' : '/page_status.php', 'Home' ], - 'wifi' => [ $prod ? '/wifi' : '/page_wifi.php', 'WiFi config' ], - 'waveform' => [ $prod ? '/waveform' : '/page_waveform.php', 'Waveform' ], - 'fft' => [ $prod ? '/fft' : '/page_fft.php', 'FFT' ], - 'spectrogram' => [ $prod ? '/spectrogram' : '/page_spectrogram.php', 'Spectrogram' ], + 'home' => [ $prod ? '/status' : '/page_status.php', 'Home' ], + 'wifi' => [ $prod ? '/wifi' : '/page_wifi.php', 'WiFi config' ], + 'waveform' => [ $prod ? '/waveform' : '/page_waveform.php', 'Waveform' ], + 'fft' => [ $prod ? '/fft' : '/page_fft.php', 'FFT' ], + 'spectrogram' => [ $prod ? '/spectrogram' : '/page_spectrogram.php','Spectrogram' ], + 'monitoring' => [ $prod ? '/monitoring' : '/page_monitoring.php', 'Monitoring' ], // 'transient' => [ '/transient', 'Power-on transient' ], 'about' => [ $prod ? '/about' : '/page_about.php', 'About' ], ]; diff --git a/html_src/css/app.css b/html_src/css/app.css index 0968c33..fa36431 100644 --- a/html_src/css/app.css +++ b/html_src/css/app.css @@ -1 +1,1366 @@ -*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.ct-zoom-rect{fill:rgba(200,100,100,.3);stroke:#ff2b12}.ct-axis-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ct-axis-title,.ct-label{fill:rgba(255,255,255,.8)}.ct-label{color:rgba(255,255,255,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(255,255,255,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-with-area .ct-line{stroke-width:1px}.ct-area{stroke:none;fill-opacity:.3}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}.center{text-align:center}.invis{visibility:hidden}.hidden{display:none}.nb{font-weight:400}html{font-family:Arial,sans-serif;color:#D0D0D0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:white;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:white;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;position:relative;padding:1rem;overflow-y:auto}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}#loader{position:absolute;right:1.618rem;top:1.618rem;transition:opacity .2s;opacity:0}@media screen and (max-width:544px){#loader{top:1rem;right:1rem}}#loader.show{opacity:1}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem 1rem;border-radius:3px;background-color:rgba(255,255,255,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 black;border-radius:6px}.Dialog h1,.Dialog h2{margin-top:0}.Dialog p:last-child{margin-bottom:0}.ErrMsg{position:fixed;bottom:2.617924rem;padding:.6180469716rem 1rem;left:50%;transform:translate(-50%);-webkit-font-smoothing:subpixel-antialiased;-webkit-transform:translateZ(0) scale(1);background:#d03e42;color:white;text-shadow:0 0 2px black;box-shadow:0 0 6px 0 rgba(0,0,0,.6);border-radius:5px;max-width:80%;transition:opacity .5s;opacity:0}@media screen and (max-width:544px){.ErrMsg{width:calc(100% - 1rem)}}.ErrMsg.visible{opacity:1}.ErrMsg.hidden{display:none}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#D04E51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}.btn-blue{background-color:#3983cd;box-shadow:0 3px 0 #265f98;text-decoration:none!important}.btn-blue,.btn-blue:link,.btn-blue:visited{color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:active,.btn-blue:hover{background-color:#2076C6;color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:hover{box-shadow:0 3px 0 #154c80}.btn-blue:active{box-shadow:0 1px 0 #154c80}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px black;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid rgba(255,255,255,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px black;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.2em;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:rgba(255,255,255,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:white}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #staRSSIperc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #staRSSI:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em}#samp-ctrl{display:flex;padding:.3819820591rem;flex-direction:row;justify-content:center;align-items:stretch}@media screen and (max-width:544px){#samp-ctrl{flex-direction:column}}#samp-ctrl>div{margin:.3819820591rem .6180469716rem}#samp-ctrl label{line-height:1.8;font-weight:700}#samp-ctrl input,#samp-ctrl select{width:6em}@media screen and (max-width:544px){#samp-ctrl input,#samp-ctrl select{width:100%}}#samp-ctrl #tile-cfg input{width:3em}#samp-ctrl #interval{width:4.5em}.Box.chartbox{display:flex;flex-direction:row}@media screen and (max-width:544px){.Box.chartbox{flex-direction:column}}.Box.chartbox .stats{flex:0 1;position:relative;padding-bottom:50px}@media screen and (max-width:544px){.Box.chartbox .stats table{margin:0 auto}.Box.chartbox .stats td,.Box.chartbox .stats th{width:50%}}.Box.chartbox .stats td,.Box.chartbox .stats th{white-space:nowrap;word-wrap:normal}.Box.chartbox .stats th sub{font-weight:400}.Box.chartbox .stats td{min-width:100px}.Box.chartbox .stats td:after{font-size:90%;padding-left:.5em}.Box.chartbox .stats #stat-f-s:after{content:"Hz"}.Box.chartbox .stats #stat-i-peak:after,.Box.chartbox .stats #stat-i-rms:after{content:"mA"}.Box.chartbox .stats .ar{position:absolute;bottom:.3819820591rem;width:100%;text-align:center}.Box.chartbox .stats .ar input[type=number]{width:4em}.Box.chartbox .stats .ar input[type=button]{margin-left:.3819820591rem}.page-about .Box{padding-left:1rem;padding-right:1rem}.page-about .Box a{font-weight:700}.page-about #logo{float:right;height:130px}.page-about #logo2{max-width:150px}@media screen and (min-width:545px){.mq-phone{display:none}}@media screen and (max-width:544px){.mq-tablet-min{display:none}}@media screen and (min-width:1001px){.mq-tablet-max{display:none}}@media screen and (max-width:1000px){.mq-normal-min{display:none}} \ No newline at end of file +@charset "UTF-8"; +/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS and IE text size adjust after device orientation change, + * without disabling user zoom. + */ +*, *:before, *:after { + box-sizing: border-box; } + +html { + font-family: sans-serif; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ } + +/** + * Remove default margin. + */ +body { + margin: 0; } + +/* HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ +figure, +nav { + display: block; } + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ +canvas, +progress { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ } + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. + */ +[hidden] { + display: none; } + +/* Links + ========================================================================== */ +/** + * Remove the gray background color from active links in IE 10. + */ +a { + background-color: transparent; } + +/** + * Improve readability of focused elements when they are also in an + * active/hover state. + */ +a:active, +a:hover { + outline: 0; } + +/* Text-level semantics + ========================================================================== */ +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ +b { + font-weight: bold; } + +/** + * Address styling not present in Safari and Chrome. + */ +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; } + +h2 { + font-size: 2em; + margin: 0.67em 0; } + +/** + * Address styling not present in IE 8/9. + */ +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; } + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +/* Embedded content + ========================================================================== */ +/** + * Remove border when inside `a` element in IE 8/9/10. + */ +img { + border: 0; } + +/** + * Correct overflow not hidden in IE 9/10/11. + */ +svg:not(:root) { + overflow: hidden; } + +/* Grouping content + ========================================================================== */ +/** + * Address margin not present in IE 8/9 and Safari. + */ +/** + * Address differences between Firefox and other browsers. + */ +hr { + box-sizing: content-box; + height: 0; } + +/** + * Contain overflow in all browsers. + */ +pre { + overflow: auto; } + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ +code, +pre { + font-family: monospace; + font-size: 1em; } + +/* Forms + ========================================================================== */ +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ +button, +input, +select, +textarea { + color: inherit; + /* 1 */ + font: inherit; + /* 2 */ + margin: 0; + /* 3 */ } + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ +button { + overflow: visible; } + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ +button, +select { + text-transform: none; } + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ } + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; } + +/** + * Remove inner padding and border in Firefox 4+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input { + line-height: normal; } + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. + */ +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ +/** + * Define consistent border, margin, and padding. + */ +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ +textarea { + overflow: auto; } + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ +/* Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; } + +td, +th { + padding: 0; } + +html { + box-sizing: border-box; } + +*, *::after, *::before { + box-sizing: inherit; } + +.ct-zoom-rect { + fill: rgba(200, 100, 100, 0.3); + stroke: #ff2b12; } + +.ct-axis-title { + fill: rgba(255, 255, 255, 0.8); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + +.ct-label { + fill: rgba(255, 255, 255, 0.8); + color: rgba(255, 255, 255, 0.8); + font-size: 0.75rem; + line-height: 1; } + .ct-label.ct-horizontal.ct-start { + align-items: flex-end; + justify-content: flex-start; + text-align: left; + text-anchor: start; } + .ct-label.ct-horizontal.ct-end { + align-items: flex-start; + justify-content: flex-start; + text-align: left; + text-anchor: start; + transform: translate(-4px, 0%) rotate(45deg); } + .ct-label.ct-vertical.ct-start { + align-items: flex-end; + justify-content: flex-end; + text-align: right; + text-anchor: end; + transform: translate(0, 20%); } + .ct-label.ct-vertical.ct-end { + align-items: flex-end; + justify-content: flex-start; + text-align: left; + text-anchor: start; } + +.ct-chart-line .ct-label, +.ct-chart-bar .ct-label { + display: flex; } + +.ct-chart-bar .ct-label.ct-horizontal.ct-start { + align-items: flex-end; + justify-content: center; + text-align: center; + text-anchor: start; } + +.ct-chart-bar .ct-label.ct-horizontal.ct-end { + align-items: flex-start; + justify-content: center; + text-align: center; + text-anchor: start; } + +.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start { + align-items: flex-end; + justify-content: flex-start; + text-align: left; + text-anchor: start; } + +.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end { + align-items: flex-start; + justify-content: flex-start; + text-align: left; + text-anchor: start; } + +.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start { + align-items: center; + justify-content: flex-end; + text-align: right; + text-anchor: end; } + +.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end { + align-items: center; + justify-content: flex-start; + text-align: left; + text-anchor: end; } + +.ct-grid { + stroke: rgba(255, 255, 255, 0.3); + stroke-width: 1px; + stroke-dasharray: 2px; } + +.ct-point { + stroke-width: 4px; + stroke-linecap: round; } + +.ct-line { + fill: none; + stroke-width: 2px; } + +.ct-with-area .ct-line { + stroke-width: 1px; } + +.ct-area { + stroke: none; + fill-opacity: 0.3; } + +.ct-bar { + fill: none; + stroke-width: 10px; } + +.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar { + stroke: #f05b4f; } + +.ct-series-a .ct-slice-pie, .ct-series-a .ct-area { + fill: #f05b4f; } + +.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar { + stroke: #6188e2; } + +.ct-series-b .ct-slice-pie, .ct-series-b .ct-area { + fill: #6188e2; } + +.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar { + stroke: #59922b; } + +.ct-series-c .ct-slice-pie, .ct-series-c .ct-area { + fill: #59922b; } + +.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar { + stroke: #eacf7d; } + +.ct-series-d .ct-slice-pie, .ct-series-d .ct-area { + fill: #eacf7d; } + +.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar { + stroke: #a748ca; } + +.ct-series-e .ct-slice-pie, .ct-series-e .ct-area { + fill: #a748ca; } + +.ct-wide { + display: block; + position: relative; + width: 100%; } + .ct-wide:before { + display: block; + float: left; + content: ""; + width: 0; + height: 0; + padding-bottom: 62.5%; } + .ct-wide:after { + content: ""; + display: table; + clear: both; } + .ct-wide > svg { + display: block; + position: absolute; + top: 0; + left: 0; } + +.ct-narrow { + display: block; + position: relative; + width: 100%; } + .ct-narrow:before { + display: block; + float: left; + content: ""; + width: 0; + height: 0; + padding-bottom: 66.6666666667%; } + .ct-narrow:after { + content: ""; + display: table; + clear: both; } + .ct-narrow > svg { + display: block; + position: absolute; + top: 0; + left: 0; } + +.center { + text-align: center; } + +.invis { + visibility: hidden; } + +.hidden { + display: none; } + +.nb { + font-weight: normal; } + +html { + font-family: Arial, sans-serif; + color: #D0D0D0; + background: #131315; } + +html, body { + border: 0 none; + margin: 0; + padding: 0; + text-decoration: none; + width: 100%; + height: 100%; + overflow: hidden; } + +a, a:visited, a:link { + color: #5abfff; + text-decoration: none; } + +a:hover { + color: #5abfff; + text-decoration: underline; } + +/* Main outer container */ +#outer { + display: flex; + position: absolute; + width: 100%; + height: 100%; + left: 0; + right: 0; + top: 0; + bottom: 0; + overflow: hidden; + flex-direction: row; } + +@media screen and (max-width: 544px) { + #outer { + display: block; + overflow-y: scroll; } } + +#menu { + flex: 0 0 15rem; + background: #2bab5f; } + #menu > * { + display: block; + text-decoration: none; + padding: 0.6180469716rem 1rem; + white-space: nowrap; + word-wrap: normal; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + #menu #brand { + color: white; + background: #218248; + font-size: 120%; + text-align: center; + position: relative; + margin-bottom: 1rem; } + @media screen and (max-width: 544px) { + #menu #brand { + background: #2bab5f; + cursor: pointer; } + #menu #brand:after { + position: absolute; + color: rgba(0, 0, 0, 0.2); + right: 1rem; + content: '>'; + top: 50%; + font-size: 120%; + font-weight: bold; + transform: translate(0, -50%) rotate(90deg); } } + #menu.expanded #brand { + background: #218248; } + @media screen and (max-width: 544px) { + #menu.expanded #brand:after { + transform: translate(0, -50%) rotate(-90deg); } } + #menu a { + font-size: 130%; + color: white; + transition: background-color 0.2s; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.4); } + #menu a:hover, #menu a.selected { + background: #1bd886; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); } + #menu a.selected { + position: relative; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); } + #menu a:before { + content: "▸"; + padding-right: .5rem; + position: relative; + top: -0.1rem; } + @media screen and (max-width: 544px) { + #menu a { + display: none; } } + #menu.expanded a { + display: block; } + @media screen and (min-width: 545px) and (max-width: 1000px) { + #menu { + flex-basis: 10rem; } + #menu #brand { + font-size: 95%; + margin-bottom: 0.6180469716rem; } + #menu a { + font-size: 105%; } + #menu > * { + padding: 0.3819820591rem 0.6180469716rem; } } + +#content { + flex-grow: 1; + position: relative; + padding: 1rem; + overflow-y: auto; } + @media screen and (max-width: 544px) { + #content { + padding: 0.6180469716rem; } } + #content > * { + margin-left: auto; + margin-right: auto; } + #content h1 { + text-align: center; + font-size: 2.2806973457em; + margin-top: 0; + margin-bottom: 1rem; } + #content h2 { + font-size: 1.423828125em; + margin-bottom: 0.6180469716rem; } + #content td, #content th { + padding: 0.3819820591rem; } + #content tbody th { + text-align: right; + width: 130px; + color: white; } + +#loader { + position: absolute; + right: 1.618rem; + top: 1.618rem; + transition: opacity .2s; + opacity: 0; } + @media screen and (max-width: 544px) { + #loader { + top: 1rem; + right: 1rem; } } + #loader.show { + opacity: 1; } + +.Box { + display: block; + max-width: 900px; + margin-top: 1rem; + padding: 0.6180469716rem 1rem; + border-radius: 3px; + background-color: rgba(255, 255, 255, 0.07); } + @media screen and (max-width: 544px) { + .Box { + margin-top: 0.6180469716rem; } } + h1 + .Box { + margin-top: 0; } + .Box h2 { + margin-top: 0; } + .Box.wide { + width: initial; + max-width: initial; } + .Box.medium { + max-width: 1200px; } + .Box .Valfield { + display: inline-block; + min-width: 10em; } + +.Modal { + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + right: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + transition: opacity .5s; + background: rgba(0, 0, 0, 0.65); + opacity: 0; } + .Modal.visible { + opacity: 1; } + .Modal.hidden { + display: none; } + +.Dialog { + margin: 0.6180469716rem; + padding: 1rem; + overflow: hidden; + max-width: 100%; + max-height: 100%; + flex: 0 1 30rem; + background: #1c1c1e; + border-left: 6px solid #217b3a; + border-right: 6px solid #217b3a; + box-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black; + border-radius: 6px; } + .Dialog h1, .Dialog h2 { + margin-top: 0; } + .Dialog p:last-child { + margin-bottom: 0; } + +.ErrMsg { + position: fixed; + bottom: 2.617924rem; + padding: 0.6180469716rem 1rem; + left: 50%; + transform: translate(-50%, 0); + -webkit-font-smoothing: subpixel-antialiased; + -webkit-transform: translateZ(0) scale(1, 1); + background: #d03e42; + color: white; + text-shadow: 0 0 2px black; + box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.6); + border-radius: 5px; + max-width: 80%; + transition: opacity .5s; + opacity: 0; } + @media screen and (max-width: 544px) { + .ErrMsg { + width: calc(100% - 1rem); } } + .ErrMsg.visible { + opacity: 1; } + .ErrMsg.hidden { + display: none; } + +button, input[type="button"], input[type="reset"], input[type="submit"], .button { + text-align: center; + cursor: pointer; + display: inline-block; + border-radius: 2px; + padding: 0 0.6em; + border: 0 none; + outline: 0 none !important; + line-height: 1.8em; + font-size: 1.1em; + margin-bottom: 3px; + min-width: 5em; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* &::before { + margin-right: .4em; + } + + &.icononly::before { + margin-right: 0; + }*/ + text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); } + button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active, .button:active { + position: relative; + top: 2px; } + button.narrow, input[type="button"].narrow, input[type="reset"].narrow, input[type="submit"].narrow, .button.narrow { + min-width: initial; } + +input[type="submit"], .btn-green { + background-color: #2ca94b; + box-shadow: 0 3px 0 #1d7032; + text-decoration: none !important; } + input[type="submit"], input[type="submit"]:link, input[type="submit"]:visited, .btn-green, .btn-green:link, .btn-green:visited { + color: #FEFEFE; } + input[type="submit"]:hover, input[type="submit"]:active, input[type="submit"].active, input[type="submit"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected { + background-color: #28ba5c; + color: #FEFEFE; } + input[type="submit"]:hover, input[type="submit"].selected, input[type="submit"].active, .btn-green:hover, .btn-green.selected, .btn-green.active { + box-shadow: 0 3px 0 #1a773b; } + input[type="submit"]:active, .btn-green:active { + box-shadow: 0 1px 0 #1a773b; } + +input[type="reset"], .btn-red { + background-color: #D04E51; + box-shadow: 0 3px 0 #aa2d30; + text-decoration: none !important; } + input[type="reset"], input[type="reset"]:link, input[type="reset"]:visited, .btn-red, .btn-red:link, .btn-red:visited { + color: #FEFEFE; } + input[type="reset"]:hover, input[type="reset"]:active, input[type="reset"].active, input[type="reset"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected { + background-color: #d4403f; + color: #FEFEFE; } + input[type="reset"]:hover, input[type="reset"].selected, input[type="reset"].active, .btn-red:hover, .btn-red.selected, .btn-red.active { + box-shadow: 0 3px 0 #9e2423; } + input[type="reset"]:active, .btn-red:active { + box-shadow: 0 1px 0 #9e2423; } + +.btn-blue { + background-color: #3983cd; + box-shadow: 0 3px 0 #265f98; + text-decoration: none !important; } + .btn-blue, .btn-blue:link, .btn-blue:visited { + color: #FEFEFE; } + .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected { + background-color: #2076C6; + color: #FEFEFE; } + .btn-blue:hover, .btn-blue.selected, .btn-blue.active { + box-shadow: 0 3px 0 #154c80; } + .btn-blue:active { + box-shadow: 0 1px 0 #154c80; } + +/* + +&[type="submit"], +&.gray-green { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16) + ) +} + +&.gray-blue { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16) + ) +} + +&.gray-red { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16) + ) +} + +&.gray-orange { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16) + ) +} + +// No change on hover - to be used for disabled buttons +&.gray-gray { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-gray-f, $btn-gray-b, $btn-gray-l + ) +} + +*/ +button, input[type="button"], input[type="reset"], input[type="submit"], .button { + text-align: center; + cursor: pointer; + display: inline-block; + border-radius: 2px; + padding: 0 0.6em; + border: 0 none; + outline: 0 none !important; + line-height: 1.8em; + font-size: 1.1em; + margin-bottom: 3px; + min-width: 5em; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* &::before { + margin-right: .4em; + } + + &.icononly::before { + margin-right: 0; + }*/ + text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); } + button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active, .button:active { + position: relative; + top: 2px; } + button.narrow, input[type="button"].narrow, input[type="reset"].narrow, input[type="submit"].narrow, .button.narrow { + min-width: initial; } + +input[type="submit"], .btn-green { + background-color: #2ca94b; + box-shadow: 0 3px 0 #1d7032; + text-decoration: none !important; } + input[type="submit"], input[type="submit"]:link, input[type="submit"]:visited, .btn-green, .btn-green:link, .btn-green:visited { + color: #FEFEFE; } + input[type="submit"]:hover, input[type="submit"]:active, input[type="submit"].active, input[type="submit"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected { + background-color: #28ba5c; + color: #FEFEFE; } + input[type="submit"]:hover, input[type="submit"].selected, input[type="submit"].active, .btn-green:hover, .btn-green.selected, .btn-green.active { + box-shadow: 0 3px 0 #1a773b; } + input[type="submit"]:active, .btn-green:active { + box-shadow: 0 1px 0 #1a773b; } + +input[type="reset"], .btn-red { + background-color: #D04E51; + box-shadow: 0 3px 0 #aa2d30; + text-decoration: none !important; } + input[type="reset"], input[type="reset"]:link, input[type="reset"]:visited, .btn-red, .btn-red:link, .btn-red:visited { + color: #FEFEFE; } + input[type="reset"]:hover, input[type="reset"]:active, input[type="reset"].active, input[type="reset"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected { + background-color: #d4403f; + color: #FEFEFE; } + input[type="reset"]:hover, input[type="reset"].selected, input[type="reset"].active, .btn-red:hover, .btn-red.selected, .btn-red.active { + box-shadow: 0 3px 0 #9e2423; } + input[type="reset"]:active, .btn-red:active { + box-shadow: 0 1px 0 #9e2423; } + +.btn-blue { + background-color: #3983cd; + box-shadow: 0 3px 0 #265f98; + text-decoration: none !important; } + .btn-blue, .btn-blue:link, .btn-blue:visited { + color: #FEFEFE; } + .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected { + background-color: #2076C6; + color: #FEFEFE; } + .btn-blue:hover, .btn-blue.selected, .btn-blue.active { + box-shadow: 0 3px 0 #154c80; } + .btn-blue:active { + box-shadow: 0 1px 0 #154c80; } + +/* + +&[type="submit"], +&.gray-green { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16) + ) +} + +&.gray-blue { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16) + ) +} + +&.gray-red { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16) + ) +} + +&.gray-orange { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16) + ) +} + +// No change on hover - to be used for disabled buttons +&.gray-gray { + @include fancy-btn-colors-full( + $btn-gray-f, $btn-gray-b, $btn-gray-l, + $btn-gray-f, $btn-gray-b, $btn-gray-l + ) +} + +*/ +input[type="number"], input[type="password"], input[type="text"], textarea, select { + border: 0 none; + border-bottom: 2px solid #217b3a; + background-color: #303030; + color: white; + padding: 6px; + line-height: 1em; + outline: 0 none !important; + -moz-outline: 0 none !important; + font-weight: normal; } + input[type="number"]:focus, input[type="number"]:hover, input[type="password"]:focus, input[type="password"]:hover, input[type="text"]:focus, input[type="text"]:hover, textarea:focus, textarea:hover, select:focus, select:hover { + border-bottom-color: #28bc65; } + +input[type="number"], input[type="password"], input[type="text"], textarea { + -webkit-user-select: text; + -khtml-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + cursor: text; } + +textarea { + font-family: monospace; + line-height: 1.2em; + display: block; } + +@media screen and (-webkit-min-device-pixel-ratio: 0) { + select { + padding-right: 18px; } } + +select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + cursor: pointer; + line-height: 1.2em; + padding-right: 1em; } + select:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 white; } + select option { + background: #303030; } + +label.select-wrap { + position: relative; + display: inline !important; + margin: 0 !important; + padding: 0 !important; + width: auto !important; } + label.select-wrap:after { + content: '<>'; + /* will be rotated */ + font-family: "Consolas", monospace; + font-weight: bold; + color: #28bc65; + top: 50%; + transform: translate(0, -50%) rotate(90deg); + right: 2px; + position: absolute; + z-index: 100; + pointer-events: none; } + +form { + border: 0 none; + margin: 0; + padding: 0; + text-decoration: none; } + +input[type="number"], input[type="password"], input[type="text"], textarea, select, label.select-wrap { + width: 250px; } + +form .Row { + vertical-align: middle; + margin: 14px auto; + text-align: left; + display: flex; + flex-direction: row; } + form .Row:first-child { + margin-top: 0; } + form .Row:last-child { + margin-bottom: 0; } + form .Row .spacer { + width: 130px; } + @media screen and (max-width: 544px) { + form .Row .spacer { + display: none; } } + form .Row.buttons input, form .Row.buttons .button { + margin-right: 0.6180469716rem; } + form .Row.centered { + justify-content: center; } + form .Row.message { + font-size: 1em; + text-shadow: 1px 1px 3px black; + text-align: center; } + form .Row.message.error { + color: crimson; } + form .Row.message.ok { + color: #0fe851; } + form .Row.separator { + padding-top: 14px; + border-top: 2px solid rgba(255, 255, 255, 0.1); } + form .Row textarea { + display: inline-block; + vertical-align: top; + min-height: 10rem; + flex-grow: 1; + resize: vertical; } + form .Row label { + font-weight: bold; + color: white; + display: inline-block; + width: 130px; + text-align: right; + text-shadow: 1px 1px 3px black; + padding: 8px; + align-self: flex-start; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + form .Row .checkbox-wrap { + display: inline-block; + width: 130px; + padding: 8px; + text-align: right; + align-self: flex-start; } + form .Row .checkbox-wrap input[type=checkbox] { + margin: auto; + width: auto; + height: auto; } + form .Row .checkbox-wrap + label { + width: 250px; + padding-left: 0; + text-align: left; + cursor: pointer; } + @media screen and (max-width: 544px) { + form .Row { + flex-direction: column; } + form .Row.buttons, form .Row.centered { + flex-direction: row; } + form .Row.buttons { + justify-content: center; } + form .Row.buttons :last-child { + margin-right: 0; } + form .Row label { + padding-left: 0; + text-align: left; + width: auto; } + form .Row .checkbox-wrap { + order: 1; + text-align: left; + padding-bottom: 0; + border-radius: .4px; + width: auto; } + form .Row .checkbox-wrap + label { + width: auto; } + form .Row input[type="number"], form .Row input[type="password"], form .Row input[type="text"], form .Row textarea, form .Row textarea { + width: 100%; } } + +form span.required { + color: red; } + +.RadioGroup { + display: inline-block; + line-height: 1.5em; + vertical-align: middle; } + .RadioGroup label { + width: auto; + text-align: left; + cursor: pointer; + font-weight: normal; } + .RadioGroup input[type="radio"] { + vertical-align: middle; + margin: 0 0 0 5px; } + +@media screen and (-webkit-min-device-pixel-ratio: 0) { + select { + padding-right: 18px; } } + +select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + cursor: pointer; + line-height: 1.2em; + padding-right: 1em; } + select:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 white; } + select option { + background: #303030; } + +label.select-wrap { + position: relative; + display: inline !important; + margin: 0 !important; + padding: 0 !important; + width: auto !important; } + label.select-wrap:after { + content: '<>'; + /* will be rotated */ + font-family: "Consolas", monospace; + font-weight: bold; + color: #28bc65; + top: 50%; + transform: translate(0, -50%) rotate(90deg); + right: 2px; + position: absolute; + z-index: 100; + pointer-events: none; } + +#ap-list { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + -webkit-column-gap: 0; + -moz-column-gap: 0; + column-gap: 0; + margin: 0 -0.2360828548rem; } + @media screen and (min-width: 545px) and (max-width: 1000px) { + #ap-list { + -webkit-column-count: 2; + -moz-column-count: 2; + column-count: 2; } } + @media screen and (max-width: 544px) { + #ap-list { + -webkit-column-count: 1; + -moz-column-count: 1; + column-count: 1; } } + +#ap-loader { + background: rgba(255, 255, 255, 0.1); + border-radius: 5px; + padding: 0.3819820591rem; + margin-bottom: 0.3819820591rem; } + +#ap-box { + padding-bottom: 0.3819820591rem; } + +#psk-modal form { + display: flex; + align-items: center; + margin: 0.3819820591rem; } + #psk-modal form > * { + margin-left: 0.3819820591rem; + margin-right: 0.3819820591rem; } + #psk-modal form > *:first-child { + margin-left: 0; } + #psk-modal form > *:last-child { + margin-right: 0; } + #psk-modal form input[type=password] { + min-width: 5rem; } + +.AP { + -webkit-column-break-inside: avoid; + page-break-inside: avoid; + break-inside: avoid-column; + max-width: 500px; + padding: 0.2360828548rem; } + .AP.selected .inner { + background: #43de81 !important; + cursor: default; + top: 0 !important; } + .AP .inner { + cursor: pointer; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + position: relative; + border-radius: 3px; + color: #222; + background: #afafaf; + transition: background-color 0.5s; + display: flex; } + .AP .inner:active { + left: 0; + top: 1px; } + .AP .inner:hover { + background: white; } + .AP .inner > * { + padding: 0.6180469716rem; + white-space: nowrap; + word-wrap: normal; } + .AP .inner .rssi { + min-width: 2rem; + flex: 0 0 15%; + text-align: right; } + .AP .inner .rssi:after { + padding-left: 0.090179415rem; + content: '%'; + font-size: 0.8888888889em; } + .AP .inner .essid { + flex: 1 1 70%; + min-width: 0; + text-overflow: ellipsis; + overflow: hidden; + font-weight: bold; } + .AP .inner .auth { + flex: 0 0 15%; } + +.page-home #staRSSIperc:after { + padding-left: 0.1459102934rem; + content: '%'; + font-size: 0.8888888889em; } + +.page-home #staRSSI:after { + padding-left: 0.1459102934rem; + content: 'dBm'; + font-size: 0.8888888889em; } + +#samp-ctrl { + display: flex; + padding: 0.3819820591rem; + flex-direction: row; + justify-content: center; + align-items: stretch; } + @media screen and (max-width: 544px) { + #samp-ctrl { + flex-direction: column; } } + #samp-ctrl > div { + margin: 0.3819820591rem 0.6180469716rem; } + #samp-ctrl label { + line-height: 1.8; + font-weight: bold; } + #samp-ctrl input, #samp-ctrl select { + width: 6em; } + @media screen and (max-width: 544px) { + #samp-ctrl input, #samp-ctrl select { + width: 100%; } } + #samp-ctrl #tile-cfg input { + width: 3em; } + #samp-ctrl #interval { + width: 4.5em; } + +.Box.chartbox { + display: flex; + flex-direction: row; } + @media screen and (max-width: 544px) { + .Box.chartbox { + flex-direction: column; } } + .Box.chartbox .stats { + flex: 0 1; + position: relative; + padding-bottom: 50px; } + @media screen and (max-width: 544px) { + .Box.chartbox .stats table { + margin: 0 auto; } + .Box.chartbox .stats td, .Box.chartbox .stats th { + width: 50%; } } + .Box.chartbox .stats th, .Box.chartbox .stats td { + white-space: nowrap; + word-wrap: normal; } + .Box.chartbox .stats th sub { + font-weight: normal; } + .Box.chartbox .stats td { + min-width: 100px; } + .Box.chartbox .stats td:after { + font-size: 90%; + padding-left: .5em; } + .Box.chartbox .stats #stat-f-s:after { + content: "Hz"; } + .Box.chartbox .stats #stat-i-peak:after { + content: "mA"; } + .Box.chartbox .stats #stat-i-rms:after { + content: "mA"; } + .Box.chartbox .stats .ar { + position: absolute; + bottom: 0.3819820591rem; + width: 100%; + text-align: center; } + .Box.chartbox .stats .ar input[type=number] { + width: 4em; } + .Box.chartbox .stats .ar input[type=button] { + margin-left: 0.3819820591rem; } + +.page-about .Box { + padding-left: 1rem; + padding-right: 1rem; } + .page-about .Box a { + font-weight: bold; } + +.page-about #logo { + float: right; + height: 130px; } + +.page-about #logo2 { + max-width: 150px; } + +@media screen and (min-width: 545px) { + .mq-phone { + display: none; } } + +@media screen and (max-width: 544px) { + .mq-tablet-min { + display: none; } } + +@media screen and (min-width: 1001px) { + .mq-tablet-max { + display: none; } } + +@media screen and (max-width: 1000px) { + .mq-normal-min { + display: none; } } + +/*# sourceMappingURL=app.css.map */ diff --git a/html_src/css/app.css.map b/html_src/css/app.css.map index 067ed67..aa1c9ba 100644 --- a/html_src/css/app.css.map +++ b/html_src/css/app.css.map @@ -1 +1 @@ -{"version":3,"sources":["app.css","_normalize.scss","lib/neat/grid/_box-sizing.scss","lib/chartist/_chartist.scss","lib/chartist/_chartist-settings.scss","utils/_pointer.scss","app.scss","layout/_base.scss","utils/_misc.scss","layout/_outer-wrap.scss","lib/neat/grid/_media.scss","layout/_menu.scss","lib/bourbon/functions/_modular-scale.scss","layout/_content.scss","layout/_box.scss","layout/_modal.scss","lib/bourbon/addons/_prefixer.scss","form/_buttons.scss","form/_fancy_button_mixins.scss","form/_form_elements.scss","form/_select.scss","form/_form_layout.scss","pages/_wifi.scss","pages/_home.scss","pages/_wfm.scss","pages/_about.scss"],"names":[],"mappings":"AAAA,iBAAiB;ACAjB,2EAA2E;AAE3E;;;;GAIG;AAEH;EACC,uBAAuB,EACvB;;AAGD;EACE,wBAAwB;EAAE,OAAO;EACjC,2BAA2B;EAAE,OAAO;EACpC,+BAA+B;EAAE,OAAO,EACzC;;AAED;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;gFACgF;AAEhF;;;;;GAKG;AAMH;;EAUE,eAAe,EAChB;;AAED;;;GAGG;AAGH;;EAIE,sBAAsB;EAAE,OAAO;EAC/B,yBAAyB;EAAE,OAAO,EACnC;;AAED;;;GAGG;AAOH;;;GAGG;AD1BH;EC+BE,cAAc,EACf;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,8BAA8B,EAC/B;;AAED;;;GAGG;AAEH;;EAEE,WAAW,EACZ;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EAGE,kBAAkB,EACnB;;AAED;;GAEG;AAMH;;;GAGG;AAEH;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;;GAEG;AAOH;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAEE,eAAe;EACf,eAAe;EACf,mBAAmB;EACnB,yBAAyB,EAC1B;;AAED;EACE,YAAY,EACb;;AAED;EACE,gBAAgB,EACjB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,iBAAiB,EAClB;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EACE,wBAAwB;EACxB,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAKE,uBAAuB;EACvB,eAAe,EAChB;;AAED;gFACgF;AAEhF;;;GAGG;AAEH;;;;;GAKG;AAEH;;;;EAKE,eAAe;EAAE,OAAO;EACxB,cAAc;EAAE,OAAO;EACvB,UAAU;EAAE,OAAO,EACpB;;AAED;;GAEG;AAEH;EACE,kBAAkB,EACnB;;AAED;;;;;GAKG;AAEH;;EAEE,qBAAqB,EACtB;;AAED;;;;;;GAMG;AAEH;;;EAIE,2BAA2B;EAAE,OAAO;EACpC,gBAAgB;EAAE,OAAO,EAC1B;;AAED;;GAEG;AAEH;;EAEE,gBAAgB,EACjB;;AAED;;GAEG;AAEH;;EAEE,UAAU;EACV,WAAW,EACZ;;AAED;;;GAGG;AAEH;EACE,oBAAoB,EACrB;;AAED;;;;;;GAMG;AAEH;;EAEE,uBAAuB;EAAE,OAAO;EAChC,WAAW;EAAE,OAAO,EACrB;;AAED;;;;GAIG;AAOH;;;GAGG;AAOH;;;;GAIG;AAOH;;GAEG;AAQH;;;GAGG;AAEH;EACE,UAAU;EAAE,OAAO;EACnB,WAAW;EAAE,OAAO,EACrB;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;;GAGG;AAMH;gFACgF;AAEhF;;GAEG;AAEH;EACE,0BAA0B;EAC1B,kBAAkB,EACnB;;AAED;;EAEE,WAAW,EACZ;;ACnbC;EACE,uBAAuB,EACxB;;AAED;EAII,oBAAoB,EACrB;;ACuGJ;EACC,+BAAU;EACV,gBAAgB,EAChB;;AAED;EACC,+BCvG8B;ECV/B,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB,EF+GjB;;AAGD;EAjFA,+BCjCyB;EDkCzB,gCClCyB;EDmCzB,mBClCqB;EDmCrB,eChCsB,EDyIrB;EA3BD;IA/FA,sBAmGoC;IAlGpC,4BAkGgD;IA9F/C,iBAAiB;IA+FhB,mBAAmB,EACnB;EANF;IA/FA,wBAwGsC;IAvGtC,4BAuGkD;IAnGjD,iBAAiB;IAoGhB,mBAAmB;IAGnB,6CAAqC,EACrC;EAdF;IA/FA,sBAgHoC;IA/GpC,0BA+G8C;IAzG7C,kBAAkB;IA0GjB,iBAAiB;IAEjB,6BAAoB,EACpB;EArBF;IA/FA,sBAuHoC;IAtHpC,4BAsHgD;IAlH/C,iBAAiB;IAmHhB,mBAAmB,EACnB;;AAGF;;EAEC,cAAc,EACd;;AAID;EAnIA,sBAqIoC;EApIpC,wBAoI4C;EA5H3C,mBAAmB;EA6HlB,mBAAmB,EACnB;;AAJF;EAnIA,wBA0IsC;EAzItC,wBAyI8C;EAjI7C,mBAAmB;EAkIlB,mBAAmB,EACnB;;AATF;EAnIA,sBAgJqC;EA/IrC,4BA+IiD;EA3IhD,iBAAiB;EA4If,mBAAmB,EACnB;;AAfH;EAnIA,wBAqJuC;EApJvC,4BAoJmD;EAhJlD,iBAAiB;EAiJf,mBAAmB,EACnB;;AApBH;EAnIA,oBA2JmC;EA1JnC,0BA0J6C;EApJ5C,kBAAkB;EAqJhB,iBAAiB,EACjB;;AA1BH;EAnIA,oBAgKmC;EA/JnC,4BA+J+C;EA3J9C,iBAAiB;EA4Jf,iBAAiB,EACjB;;AAIH;EAjJA,iCC/ByB;EDgCzB,kBC9BkB;EDiCjB,sBClCqB,EDiLrB;;AAED;EA5IA,kBCjCkB;EDkClB,sBChCqB,ED6KpB;;AAED;EA3IA,WAAW;EACX,kBCzCkB,EDqLjB;;AAED;EACC,kBAAkB,EAClB;;AAED;EA1IA,aAAa;EACb,kBC5CoB,EDuLnB;;AAED;EAzIA,WAAW;EACX,mBC9CkB,EDwLjB;;AAQC;EAvID,gBCtCO,EDuCP;;AAsIC;EAnID,cC1CO,ED2CP;;AAkIC;EAvID,gBCrCO,EDsCP;;AAsIC;EAnID,cCzCO,ED0CP;;AAkIC;EAvID,gBCpCO,EDqCP;;AAsIC;EAnID,cCxCO,EDyCP;;AAkIC;EAvID,gBCnCO,EDoCP;;AAsIC;EAnID,cCvCO,EDwCP;;AAkIC;EAvID,gBClCO,EDmCP;;AAsIC;EAnID,cCtCO,EDuCP;;AA+IC;EA7OF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAgP3C;EAFD;IAxOD,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,sBAAsB,EACtB;EAkOC;IA/ND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EA4NC;IAzND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AAqNC;EA7OF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAgP3C;EAFD;IAxOD,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,+BAAsB,EACtB;EAkOC;IA/ND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EA4NC;IAzND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AGCF;EACC,mBAAmB,EACnB;;AAED;EACC,mBAAmB,EACnB;;AAED;EACC,cAAc,EACd;;AAED;EACC,oBAAoB,EACpB;;AC1CD;EACC,+BAA+B;EAC/B,eAAe;EACf,oBAAoB,EACpB;;AAED;ECaC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB;EDdtB,YAAY;EACZ,aAAa;EACb,iBAAiB,EACjB;;AAED;EACC,eAAe;EACf,sBAAsB,EACtB;;AAED;EACC,eAAe;EACf,2BAA2B,EAC3B;;AErBD,0BAA0B;AAC1B;EACC,cAAc;EAEd,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,SAAS;EACT,OAAO;EACP,UAAU;EACV,iBAAiB;EAEjB,oBAAoB,EACpB;;ACwEG;EDrEH;IACC,eAAe;IACf,mBAAmB,EACnB,EAAA;;AEpBF;EAGC,gBAAgB;EAChB,oBAHiB,EA4FjB;EA7FD;IAOE,eAAe;IACf,sBAAsB;IACtB,8BLY6B;IEU9B,oBAAoB;IACpB,kBAAkB;IHxBlB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EMCjB;EAbF;IAgBE,aAAa;IACb,oBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAkB;IAElB,oBLD6B,EKkB7B;ID+CE;MCtFJ;QAyBG,oBAxBe;QAyBf,gBAAgB,EAajB;QAvCF;UA6BI,mBAAmB;UACnB,0BAAiB;UACjB,YLV2B;UKW3B,aAAa;UACb,SAAQ;UACR,gBAAgB;UAChB,kBAAkB;UAClB,4CAAmC,EACnC,EAAA;EArCJ;IAyCE,oBAAkB,EAKlB;IDwCE;MCtFJ;QA4Ca,6CAAmC,EAAW,EAAA;EA5C3D;IAkDE,gBAAgB;IAChB,aAAa;IAGb,kCAAkC;IAClC,wCAA+B,EAsB/B;IA7EF;MA0DG,oBALW;MAMX,wCAA+B,EAC/B;IA5DH;MA+DG,mBAAmB;MACnB,uCAA8B,EAC9B;IAjEH;MAoEG,aAAS;MACT,qBAAqB;MACrB,mBAAmB;MACnB,aAAa,EACb;IDcC;MCtFJ;QA2EG,cAAc,EAEf,EAAA;EA7EF;IA+EgB,eAAe,EAAE;EDO7B;ICtFJ;MAyFE,kBAAkB,EAInB;MA7FD;QAmFG,eAAe;QACf,+BCvBc,EDwBd;MArFH;QAuFM,gBAAgB,EAAI;MAvF1B;QA2FU,yCC9BO,ED8BuB,EAAA;;AE3FxC;EACC,aAAa;EACb,mBAAmB;EAEnB,cPiB8B;EOZ9B,iBAAiB,EA4BjB;EHiDG;IGtFJ;MAME,yBDuDe,ECxBhB,EAAA;EArCD;IAYE,kBAAkB;IAClB,mBAAmB,EACnB;EAdF;IAiBE,mBAAmB;IACnB,0BD0Be;ICzBf,cAAc;IACd,oBPC6B,EOA7B;EArBF;IAwBE,yBDoBe;ICnBf,+BDoCe,ECnCf;EA1BF;IA6BE,yBDgCe,EC/Bf;EA9BF;IAiCE,kBAAkB;IAClB,aPxBkB;IOyBlB,aPrBqB,EOsBrB;;AAIF;EACC,mBAAmB;EACnB,gBDEgB;ECDhB,cDCgB;ECChB,wBAAwB;EACxB,WAAW,EAUX;EH8BG;IG9CJ;MASE,UP5B6B;MO6B7B,YP7B6B,EOmC9B,EAAA;EAhBD;IAcE,WAAU,EACV;;ACvDF;EACC,eAAe;EACf,iBAAiB;EAEjB,iBRiB8B;EQhB9B,8BRgB8B;EQF9B,mBAAmB;EACnB,4CAA4B,EAU5B;EJwDG;IItFJ;MAQE,4BFqDe,EE/BhB,EAAA;EAnBA;IACC,cAAc,EACd;EAbF;IAgBE,cAAc,EACd;EAjBF;IAuBE,eAAe;IACf,mBAAmB,EACnB;EAzBF;IA4BE,kBAAkB,EAClB;;AC7BF;EACC,gBAAgB;EAChB,YAAY;EAAE,aAAa;EAC3B,QAAQ;EAAE,OAAO;EAAE,SAAS;EAAE,UAAU;EAExC,cAAc;EACd,wBAAwB;EACxB,oBAAoB;EAEpB,wBAAwB;EACxB,gCAAsB;EACtB,WAAW,EAGX;EAdD;IAYa,WAAY,EAAE;EAZ3B;IAaY,cAAe,EAAE;;AAG7B;EACC,wBH4CgB;EG3ChB,cTG8B;ESF9B,iBAAiB;EAEjB,gBAAgB;EAChB,iBAAiB;EACjB,gBAAgB;EAGhB,oBAAoB;EACpB,+BTVyB;ESWzB,gCTXyB;ESYzB,+CAA+C;EAE/C,mBAAmB,EASnB;EAxBD;IAkBE,cAAa,EACb;EAnBF;IAsBE,iBAAiB,EACjB;;AAIF;EACC,gBAAgB;EAChB,oBHDgB;EGEhB,8BTzB8B;ES4B9B,UAAU;ECEH,8BRzBqB;EO0B5B,6CAA6C;EAC7C,6CAAsC;EAEtC,oBAAoB;EACpB,aAAa;EACb,2BAA2B;EAC3B,yCAAgC;EAChC,mBAAmB;EAEnB,eAAe;EAMf,wBAAwB;EACxB,WAAW,EAGX;ELeG;IK3CJ;MAqBE,yBAAW,EAOZ,EAAA;EA5BD;IA0Ba,WAAY,EAAE;EA1B3B;IA2BY,cAAe,EAAE;;AEpE7B;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;EbLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EYNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADKD;ECzBA,0BDOmB;ECNnB,4BAuBuD;EAtBvD,iCAAiC,EDuB6D;EAA9F;ICpBC,eDCoB,ECApB;EDmBD;IChBC,0BDAmB;ICCnB,eDFmB,ECGnB;EDcD;ICXC,4BAU6F,EAT7F;EDUD;ICNC,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AAjGF;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;EbLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EYNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADKD;ECzBA,0BDOmB;ECNnB,4BAuBuD;EAtBvD,iCAAiC,EDuB6D;EAA9F;ICpBC,eDCoB,ECApB;EDmBD;IChBC,0BDAmB;ICCnB,eDFmB,ECGnB;EDcD;ICXC,4BAU6F,EAT7F;EDUD;ICNC,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AEjGF;EACC,eAAe;EACf,iCbayB;EaZzB,0BbUwB;EaTxB,abUsB;EaTtB,aAAa;EACb,iBAAiB;EACjB,2BAA2B;EAC3B,gCAAgC;EAChC,oBAAoB,EAKpB;EAdD;IAYE,6BbI0B,EaH1B;;AAGF;EdAC,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EAElB,aAAa,EcJb;;AAED;EACC,uBAAuB;EACvB,mBAAmB;EACnB,eAAe,EACf;;ACxBD;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EAGnB,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBdJqB,EcKrB;EAfF;IAkBE,oBdTuB,EcUvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,edrB0B;IcuB1B,SAAS;IJUH,4CITsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;ACjDF;EbkBC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB,EarBI;;AAE3B;EACC,afQmB,EePnB;;AAED;EACC,uBAAuB;EACvB,kBAAkB;EAClB,iBAAiB;EAEjB,cAAc;EACd,oBAAoB,EAoIpB;EA1ID;IASE,cAAc,EACd;EAVF;IAaE,iBAAiB,EACjB;EAdF;IAiBE,afdkB,EemBlB;IXyDE;MW/EJ;QAoBG,cAAc,EAEf,EAAA;EAtBF;IA0BG,8BT4Bc,ES3Bd;EA3BH;IA+BE,wBAAwB,EACxB;EAhCF;IAmCE,eAAe;IAEf,+BAA+B;IAC/B,mBAAmB,EASnB;IA/CF;MAyCG,eAAe,EACf;IA1CH;MA6CG,eAAe,EACf;EA9CH;IAkDE,kBAAkB;IAClB,+CAA0B,EAC1B;EApDF;IAuDE,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;IAClB,aAAa;IAEb,iBAAiB,EACjB;EA7DF;IAgEE,kBAAkB;IAClB,af1DqB;Ie2DrB,sBAAsB;IACtB,afhEkB;IeiElB,kBAAkB;IAClB,+BAA+B;IAE/B,afnEkB;IeoElB,uBAAuB;IhBvExB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EgBsEjB;EA3EF;IA8EE,sBAAsB;IACtB,af5EkB;Ie6ElB,af5EkB;Ie6ElB,kBAAkB;IAClB,uBAAuB,EAcvB;IAhGF;MAqFG,aAAa;MACb,YAAY;MACZ,aAAa,EACb;IAxFH;MA2FG,aftFiB;MeuFjB,gBAAgB;MAChB,iBAAiB;MACjB,gBAAgB,EAChB;EXhBC;IW/EJ;MAoGE,uBAAuB,EAsCxB;MA1ID;QAuGG,oBAAoB,EACpB;MAxGH;QA2GG,wBAAwB,EAMxB;QAjHH;UA+GI,gBAAe,EACf;MAhHJ;QAoHG,gBAAgB;QAChB,iBAAiB;QACjB,YAAY,EACZ;MAvHH;QA0HG,SAAS;QACT,iBAAiB;QACjB,kBAAkB;QAElB,oBAAoB;QACpB,YAAY,EAKZ;QApIH;UAkII,YAAY,EACZ;MAnIJ;QAuIG,YAAY,EACZ,EAAA;;AAKH;EACC,WAAW,EACX;;AAED;EACC,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB,EAavB;EAhBD;IAME,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB,EACpB;EAVF;IAaE,uBAAuB;IACvB,kBAAkB,EAClB;;ADrKF;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EAGnB,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBdJqB,EcKrB;EAfF;IAkBE,oBdTuB,EcUvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,edrB0B;IcuB1B,SAAS;IJUH,4CITsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;AElDF;EACC,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;EAChB,sBAAc;EAAd,mBAAc;EAAd,cAAc;EAUd,2BViDgB,EUhDhB;EZyEG;IYtFJ;MAKE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAQjB,EAAA;EZyEG;IYtFJ;MASE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAIjB,EAAA;;AAED;EACC,qCAAsB;EACtB,mBAAmB;EACnB,yBV2CgB;EU1ChB,+BV0CgB,EUzChB;;AAED;EACC,gCVsCgB,EUrChB;;AAGD;EACC,cAAc;EACd,oBAAoB;EACpB,wBV+BgB,EUnBhB;EAfD;IAME,6BV4Be;IU3Bf,8BV2Be,EUxBf;IAVF;MAQkB,eAAgB,EAAE;IARpC;MASiB,gBAAiB,EAAE;EATpC;IAaE,gBAAgB,EAChB;;AAGF;EAGC,mCAA2B;EAA3B,yBAA2B;EAA3B,2BAA2B;EAC3B,iBAAiB;EACjB,yBVYgB,EU6ChB;EA9DD;IAQE,+BAA+B;IAC/B,gBAAgB;IAChB,kBAAkB,EAClB;EAXF;IAeE,gBAAgB;IjBnDjB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB;IiBkDjB,mBAAmB;IAMnB,mBAAmB;IACnB,YAAY;IAEZ,oBAAoB;IACpB,kCAAkC;IAGlC,cAAc,EA8Bd;IA7DF;MAoBG,QAAQ;MACR,SAAS,EACT;IAtBH;MA6BY,kBAAmB,EAAE;IA7BjC;MAkCG,yBVjBc;MJ9BhB,oBAAoB;MACpB,kBAAkB,EcgDhB;IApCH;MAuCG,gBAAgB;MAChB,cAAc;MACd,kBAAkB,EAOlB;MAhDH;QA4CI,6BV3Ba;QU4Bb,aAAa;QACb,0BV7Ba,EU8Bb;IA/CJ;MAmDG,cAAc;MACd,aAAa;MACb,wBAAwB;MACxB,iBAAiB;MACjB,kBAAkB,EAClB;IAxDH;MA2DG,cAAc,EACd;;ACxGH;EACC,8BX4DgB;EW3DhB,aAAa;EACb,0BX0DgB,EWzDhB;;AAED;EACC,8BXsDgB;EWrDhB,eAAe;EACf,0BXoDgB,EWnDhB;;ACVD;EACC,cAAc;EACd,yBZ2DgB;EYzDhB,oBAAoB;EAKpB,wBAAwB;EACxB,qBAAqB,EA4BrB;EdgDG;IctFJ;MAME,uBAAuB,EAgCxB,EAAA;EAtCD;IAaE,wCZgDe,EY/Cf;EAdF;IAiBE,iBAAiB;IACjB,kBAAkB,EAClB;EAnBF;IAsBE,WAAW,EAKX;Id2DE;MctFJ;QAyBG,YAAY,EAEb,EAAA;EA3BF;IAgCE,WAAW,EACX;EAjCF;IAoCE,aAAa,EACb;;AAGF;EACC,cAAc;EACd,oBAAoB,EA0DpB;EddG;Ic9CJ;MAKE,uBAAuB,EAuDxB,EAAA;EA5DD;IASE,UAAU;IACV,mBAAmB;IAgCnB,qBAAqB,EAiBrB;IdbE;Mc9CJ;QAcI,eAAe,EACf;MAfJ;QAkBI,WAAW,EACX,EAAA;IAnBJ;MhBTC,oBAAoB;MACpB,kBAAkB,EgBgChB;IAxBH;MA0BW,oBAAoB,EAAG;IA1BlC;MA6BG,iBAAiB,EACjB;IA9BH;MAiCG,eAAe;MACf,mBAAmB,EACnB;IAnCH;MAsCmB,cAAc,EAAE;IAtCnC;MAuCsB,cAAc,EAAE;IAvCtC;MAwCqB,cAAc,EAAE;IAxCrC;MA8CG,mBAAmB;MACnB,wBZ1Bc;MY2Bd,YAAW;MACX,mBAAmB,EASnB;MA1DH;QAoDI,WAAW,EACX;MArDJ;QAwDI,6BZnCa,EYoCb;;ACjGJ;EAEE,mBnBmB6B;EmBlB7B,oBnBkB6B,EmBf7B;EANF;IAKK,kBAAkB,EAAG;;AAL1B;EASE,aAAY;EACZ,cAAc,EACd;;AAXF;EAcE,iBAAiB,EACjB;;AfuEE;EJhCH;IAAY,cAAc,EAAI,EAAA;;AIgC3B;EJ5BH;IAAiB,cAAc,EAAI,EAAA;;AI4BhC;EJxBH;IAAiB,cAAc,EAAI,EAAA;;AIwBhC;EJpBH;IAAiB,cAAc,EAAI,EAAA","file":"app.css","sourcesContent":["@charset \"UTF-8\";\n/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n*, *:before, *:after {\n box-sizing: border-box; }\n\nhtml {\n font-family: sans-serif;\n /* 1 */\n -ms-text-size-adjust: 100%;\n /* 2 */\n -webkit-text-size-adjust: 100%;\n /* 2 */ }\n\n/**\n * Remove default margin.\n */\nbody {\n margin: 0; }\n\n/* HTML5 display definitions\n ========================================================================== */\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\nfigure,\nnav {\n display: block; }\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\ncanvas,\nprogress {\n display: inline-block;\n /* 1 */\n vertical-align: baseline;\n /* 2 */ }\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n[hidden] {\n display: none; }\n\n/* Links\n ========================================================================== */\n/**\n * Remove the gray background color from active links in IE 10.\n */\na {\n background-color: transparent; }\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\na:active,\na:hover {\n outline: 0; }\n\n/* Text-level semantics\n ========================================================================== */\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\nb {\n font-weight: bold; }\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\nh1 {\n font-size: 2em;\n margin: 0.67em 0; }\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0; }\n\n/**\n * Address styling not present in IE 8/9.\n */\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n font-size: 80%; }\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline; }\n\nsup {\n top: -0.5em; }\n\nsub {\n bottom: -0.25em; }\n\n/* Embedded content\n ========================================================================== */\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\nimg {\n border: 0; }\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\nsvg:not(:root) {\n overflow: hidden; }\n\n/* Grouping content\n ========================================================================== */\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n box-sizing: content-box;\n height: 0; }\n\n/**\n * Contain overflow in all browsers.\n */\npre {\n overflow: auto; }\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\ncode,\npre {\n font-family: monospace;\n font-size: 1em; }\n\n/* Forms\n ========================================================================== */\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\nbutton,\ninput,\nselect,\ntextarea {\n color: inherit;\n /* 1 */\n font: inherit;\n /* 2 */\n margin: 0;\n /* 3 */ }\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\nbutton {\n overflow: visible; }\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\nbutton,\nselect {\n text-transform: none; }\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\nbutton,\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n /* 2 */\n cursor: pointer;\n /* 3 */ }\n\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled],\nhtml input[disabled] {\n cursor: default; }\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0; }\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\ninput {\n line-height: normal; }\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n/**\n * Define consistent border, margin, and padding.\n */\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n border: 0;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\ntextarea {\n overflow: auto; }\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n/* Tables\n ========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n border-collapse: collapse;\n border-spacing: 0; }\n\ntd,\nth {\n padding: 0; }\n\nhtml {\n box-sizing: border-box; }\n\n*, *::after, *::before {\n box-sizing: inherit; }\n\n.ct-zoom-rect {\n fill: rgba(200, 100, 100, 0.3);\n stroke: #ff2b12; }\n\n.ct-axis-title {\n fill: rgba(255, 255, 255, 0.8);\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n\n.ct-label {\n fill: rgba(255, 255, 255, 0.8);\n color: rgba(255, 255, 255, 0.8);\n font-size: 0.75rem;\n line-height: 1; }\n .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start;\n transform: translate(-4px, 0%) rotate(45deg); }\n .ct-label.ct-vertical.ct-start {\n align-items: flex-end;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end;\n transform: translate(0, 20%); }\n .ct-label.ct-vertical.ct-end {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-line .ct-label,\n.ct-chart-bar .ct-label {\n display: flex; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start {\n align-items: center;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end {\n align-items: center;\n justify-content: flex-start;\n text-align: left;\n text-anchor: end; }\n\n.ct-grid {\n stroke: rgba(255, 255, 255, 0.3);\n stroke-width: 1px;\n stroke-dasharray: 2px; }\n\n.ct-point {\n stroke-width: 4px;\n stroke-linecap: round; }\n\n.ct-line {\n fill: none;\n stroke-width: 2px; }\n\n.ct-with-area .ct-line {\n stroke-width: 1px; }\n\n.ct-area {\n stroke: none;\n fill-opacity: 0.3; }\n\n.ct-bar {\n fill: none;\n stroke-width: 10px; }\n\n.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar {\n stroke: #f05b4f; }\n\n.ct-series-a .ct-slice-pie, .ct-series-a .ct-area {\n fill: #f05b4f; }\n\n.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar {\n stroke: #6188e2; }\n\n.ct-series-b .ct-slice-pie, .ct-series-b .ct-area {\n fill: #6188e2; }\n\n.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar {\n stroke: #59922b; }\n\n.ct-series-c .ct-slice-pie, .ct-series-c .ct-area {\n fill: #59922b; }\n\n.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar {\n stroke: #eacf7d; }\n\n.ct-series-d .ct-slice-pie, .ct-series-d .ct-area {\n fill: #eacf7d; }\n\n.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar {\n stroke: #a748ca; }\n\n.ct-series-e .ct-slice-pie, .ct-series-e .ct-area {\n fill: #a748ca; }\n\n.ct-wide {\n display: block;\n position: relative;\n width: 100%; }\n .ct-wide:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 62.5%; }\n .ct-wide:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-wide > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.ct-narrow {\n display: block;\n position: relative;\n width: 100%; }\n .ct-narrow:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 66.6666666667%; }\n .ct-narrow:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-narrow > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.center {\n text-align: center; }\n\n.invis {\n visibility: hidden; }\n\n.hidden {\n display: none; }\n\n.nb {\n font-weight: normal; }\n\nhtml {\n font-family: Arial, sans-serif;\n color: #D0D0D0;\n background: #131315; }\n\nhtml, body {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none;\n width: 100%;\n height: 100%;\n overflow: hidden; }\n\na, a:visited, a:link {\n color: #5abfff;\n text-decoration: none; }\n\na:hover {\n color: #5abfff;\n text-decoration: underline; }\n\n/* Main outer container */\n#outer {\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n flex-direction: row; }\n\n@media screen and (max-width: 544px) {\n #outer {\n display: block;\n overflow-y: scroll; } }\n\n#menu {\n flex: 0 0 15rem;\n background: #2bab5f; }\n #menu > * {\n display: block;\n text-decoration: none;\n padding: 0.6180469716rem 1rem;\n white-space: nowrap;\n word-wrap: normal;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n #menu #brand {\n color: white;\n background: #218248;\n font-size: 120%;\n text-align: center;\n position: relative;\n margin-bottom: 1rem; }\n @media screen and (max-width: 544px) {\n #menu #brand {\n background: #2bab5f;\n cursor: pointer; }\n #menu #brand:after {\n position: absolute;\n color: rgba(0, 0, 0, 0.2);\n right: 1rem;\n content: '>';\n top: 50%;\n font-size: 120%;\n font-weight: bold;\n transform: translate(0, -50%) rotate(90deg); } }\n #menu.expanded #brand {\n background: #218248; }\n @media screen and (max-width: 544px) {\n #menu.expanded #brand:after {\n transform: translate(0, -50%) rotate(-90deg); } }\n #menu a {\n font-size: 130%;\n color: white;\n transition: background-color 0.2s;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.4); }\n #menu a:hover, #menu a.selected {\n background: #1bd886;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); }\n #menu a.selected {\n position: relative;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); }\n #menu a:before {\n content: \"▸\";\n padding-right: .5rem;\n position: relative;\n top: -0.1rem; }\n @media screen and (max-width: 544px) {\n #menu a {\n display: none; } }\n #menu.expanded a {\n display: block; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #menu {\n flex-basis: 10rem; }\n #menu #brand {\n font-size: 95%;\n margin-bottom: 0.6180469716rem; }\n #menu a {\n font-size: 105%; }\n #menu > * {\n padding: 0.3819820591rem 0.6180469716rem; } }\n\n#content {\n flex-grow: 1;\n position: relative;\n padding: 1rem;\n overflow-y: auto; }\n @media screen and (max-width: 544px) {\n #content {\n padding: 0.6180469716rem; } }\n #content > * {\n margin-left: auto;\n margin-right: auto; }\n #content h1 {\n text-align: center;\n font-size: 2.2806973457em;\n margin-top: 0;\n margin-bottom: 1rem; }\n #content h2 {\n font-size: 1.423828125em;\n margin-bottom: 0.6180469716rem; }\n #content td, #content th {\n padding: 0.3819820591rem; }\n #content tbody th {\n text-align: right;\n width: 130px;\n color: white; }\n\n#loader {\n position: absolute;\n right: 1.618rem;\n top: 1.618rem;\n transition: opacity .2s;\n opacity: 0; }\n @media screen and (max-width: 544px) {\n #loader {\n top: 1rem;\n right: 1rem; } }\n #loader.show {\n opacity: 1; }\n\n.Box {\n display: block;\n max-width: 900px;\n margin-top: 1rem;\n padding: 0.6180469716rem 1rem;\n border-radius: 3px;\n background-color: rgba(255, 255, 255, 0.07); }\n @media screen and (max-width: 544px) {\n .Box {\n margin-top: 0.6180469716rem; } }\n h1 + .Box {\n margin-top: 0; }\n .Box h2 {\n margin-top: 0; }\n .Box.wide {\n width: initial;\n max-width: initial; }\n .Box.medium {\n max-width: 1200px; }\n\n.Modal {\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: opacity .5s;\n background: rgba(0, 0, 0, 0.65);\n opacity: 0; }\n .Modal.visible {\n opacity: 1; }\n .Modal.hidden {\n display: none; }\n\n.Dialog {\n margin: 0.6180469716rem;\n padding: 1rem;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n flex: 0 1 30rem;\n background: #1c1c1e;\n border-left: 6px solid #217b3a;\n border-right: 6px solid #217b3a;\n box-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n border-radius: 6px; }\n .Dialog h1, .Dialog h2 {\n margin-top: 0; }\n .Dialog p:last-child {\n margin-bottom: 0; }\n\n.ErrMsg {\n position: fixed;\n bottom: 2.617924rem;\n padding: 0.6180469716rem 1rem;\n left: 50%;\n -webkit-transform: translate(-50%, 0);\n -moz-transform: translate(-50%, 0);\n -ms-transform: translate(-50%, 0);\n -o-transform: translate(-50%, 0);\n transform: translate(-50%, 0);\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-transform: translateZ(0) scale(1, 1);\n background: #d03e42;\n color: white;\n text-shadow: 0 0 2px black;\n box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.6);\n border-radius: 5px;\n max-width: 80%;\n transition: opacity .5s;\n opacity: 0; }\n @media screen and (max-width: 544px) {\n .ErrMsg {\n width: calc(100% - 1rem); } }\n .ErrMsg.visible {\n opacity: 1; }\n .ErrMsg.hidden {\n display: none; }\n\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n.btn-blue {\n background-color: #3983cd;\n box-shadow: 0 3px 0 #265f98;\n text-decoration: none !important; }\n .btn-blue, .btn-blue:link, .btn-blue:visited {\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected {\n background-color: #2076C6;\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue.selected, .btn-blue.active {\n box-shadow: 0 3px 0 #154c80; }\n .btn-blue:active {\n box-shadow: 0 1px 0 #154c80; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n.btn-blue {\n background-color: #3983cd;\n box-shadow: 0 3px 0 #265f98;\n text-decoration: none !important; }\n .btn-blue, .btn-blue:link, .btn-blue:visited {\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected {\n background-color: #2076C6;\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue.selected, .btn-blue.active {\n box-shadow: 0 3px 0 #154c80; }\n .btn-blue:active {\n box-shadow: 0 1px 0 #154c80; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select {\n border: 0 none;\n border-bottom: 2px solid #217b3a;\n background-color: #303030;\n color: white;\n padding: 6px;\n line-height: 1em;\n outline: 0 none !important;\n -moz-outline: 0 none !important;\n font-weight: normal; }\n input[type=\"number\"]:focus, input[type=\"number\"]:hover, input[type=\"password\"]:focus, input[type=\"password\"]:hover, input[type=\"text\"]:focus, input[type=\"text\"]:hover, textarea:focus, textarea:hover, select:focus, select:hover {\n border-bottom-color: #28bc65; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea {\n -webkit-user-select: text;\n -khtml-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: text; }\n\ntextarea {\n font-family: monospace;\n line-height: 1.2em;\n display: block; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.2em;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\nform {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select, label.select-wrap {\n width: 250px; }\n\nform .Row {\n vertical-align: middle;\n margin: 14px auto;\n text-align: left;\n display: flex;\n flex-direction: row; }\n form .Row:first-child {\n margin-top: 0; }\n form .Row:last-child {\n margin-bottom: 0; }\n form .Row .spacer {\n width: 130px; }\n @media screen and (max-width: 544px) {\n form .Row .spacer {\n display: none; } }\n form .Row.buttons input, form .Row.buttons .button {\n margin-right: 0.6180469716rem; }\n form .Row.centered {\n justify-content: center; }\n form .Row.message {\n font-size: 1em;\n text-shadow: 1px 1px 3px black;\n text-align: center; }\n form .Row.message.error {\n color: crimson; }\n form .Row.message.ok {\n color: #0fe851; }\n form .Row.separator {\n padding-top: 14px;\n border-top: 2px solid rgba(255, 255, 255, 0.1); }\n form .Row textarea {\n display: inline-block;\n vertical-align: top;\n min-height: 10rem;\n flex-grow: 1;\n resize: vertical; }\n form .Row label {\n font-weight: bold;\n color: white;\n display: inline-block;\n width: 130px;\n text-align: right;\n text-shadow: 1px 1px 3px black;\n padding: 8px;\n align-self: flex-start;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n form .Row .checkbox-wrap {\n display: inline-block;\n width: 130px;\n padding: 8px;\n text-align: right;\n align-self: flex-start; }\n form .Row .checkbox-wrap input[type=checkbox] {\n margin: auto;\n width: auto;\n height: auto; }\n form .Row .checkbox-wrap + label {\n width: 250px;\n padding-left: 0;\n text-align: left;\n cursor: pointer; }\n @media screen and (max-width: 544px) {\n form .Row {\n flex-direction: column; }\n form .Row.buttons, form .Row.centered {\n flex-direction: row; }\n form .Row.buttons {\n justify-content: center; }\n form .Row.buttons :last-child {\n margin-right: 0; }\n form .Row label {\n padding-left: 0;\n text-align: left;\n width: auto; }\n form .Row .checkbox-wrap {\n order: 1;\n text-align: left;\n padding-bottom: 0;\n border-radius: .4px;\n width: auto; }\n form .Row .checkbox-wrap + label {\n width: auto; }\n form .Row input[type=\"number\"], form .Row input[type=\"password\"], form .Row input[type=\"text\"], form .Row textarea, form .Row textarea {\n width: 100%; } }\n\nform span.required {\n color: red; }\n\n.RadioGroup {\n display: inline-block;\n line-height: 1.5em;\n vertical-align: middle; }\n .RadioGroup label {\n width: auto;\n text-align: left;\n cursor: pointer;\n font-weight: normal; }\n .RadioGroup input[type=\"radio\"] {\n vertical-align: middle;\n margin: 0 0 0 5px; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.2em;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\n#ap-list {\n column-count: 3;\n column-gap: 0;\n margin: 0 -0.2360828548rem; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #ap-list {\n column-count: 2; } }\n @media screen and (max-width: 544px) {\n #ap-list {\n column-count: 1; } }\n\n#ap-loader {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 5px;\n padding: 0.3819820591rem;\n margin-bottom: 0.3819820591rem; }\n\n#ap-box {\n padding-bottom: 0.3819820591rem; }\n\n#psk-modal form {\n display: flex;\n align-items: center;\n margin: 0.3819820591rem; }\n #psk-modal form > * {\n margin-left: 0.3819820591rem;\n margin-right: 0.3819820591rem; }\n #psk-modal form > *:first-child {\n margin-left: 0; }\n #psk-modal form > *:last-child {\n margin-right: 0; }\n #psk-modal form input[type=password] {\n min-width: 5rem; }\n\n.AP {\n break-inside: avoid-column;\n max-width: 500px;\n padding: 0.2360828548rem; }\n .AP.selected .inner {\n background: #43de81 !important;\n cursor: default;\n top: 0 !important; }\n .AP .inner {\n cursor: pointer;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n border-radius: 3px;\n color: #222;\n background: #afafaf;\n transition: background-color 0.5s;\n display: flex; }\n .AP .inner:active {\n left: 0;\n top: 1px; }\n .AP .inner:hover {\n background: white; }\n .AP .inner > * {\n padding: 0.6180469716rem;\n white-space: nowrap;\n word-wrap: normal; }\n .AP .inner .rssi {\n min-width: 2rem;\n flex: 0 0 15%;\n text-align: right; }\n .AP .inner .rssi:after {\n padding-left: 0.090179415rem;\n content: '%';\n font-size: 0.8888888889em; }\n .AP .inner .essid {\n flex: 1 1 70%;\n min-width: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: bold; }\n .AP .inner .auth {\n flex: 0 0 15%; }\n\n.page-home #staRSSIperc:after {\n padding-left: 0.1459102934rem;\n content: '%';\n font-size: 0.8888888889em; }\n\n.page-home #staRSSI:after {\n padding-left: 0.1459102934rem;\n content: 'dBm';\n font-size: 0.8888888889em; }\n\n#samp-ctrl {\n display: flex;\n padding: 0.3819820591rem;\n flex-direction: row;\n justify-content: center;\n align-items: stretch; }\n @media screen and (max-width: 544px) {\n #samp-ctrl {\n flex-direction: column; } }\n #samp-ctrl > div {\n margin: 0.3819820591rem 0.6180469716rem; }\n #samp-ctrl label {\n line-height: 1.8;\n font-weight: bold; }\n #samp-ctrl input, #samp-ctrl select {\n width: 6em; }\n @media screen and (max-width: 544px) {\n #samp-ctrl input, #samp-ctrl select {\n width: 100%; } }\n #samp-ctrl #tile-cfg input {\n width: 3em; }\n #samp-ctrl #interval {\n width: 4.5em; }\n\n.Box.chartbox {\n display: flex;\n flex-direction: row; }\n @media screen and (max-width: 544px) {\n .Box.chartbox {\n flex-direction: column; } }\n .Box.chartbox .stats {\n flex: 0 1;\n position: relative;\n padding-bottom: 50px; }\n @media screen and (max-width: 544px) {\n .Box.chartbox .stats table {\n margin: 0 auto; }\n .Box.chartbox .stats td, .Box.chartbox .stats th {\n width: 50%; } }\n .Box.chartbox .stats th, .Box.chartbox .stats td {\n white-space: nowrap;\n word-wrap: normal; }\n .Box.chartbox .stats th sub {\n font-weight: normal; }\n .Box.chartbox .stats td {\n min-width: 100px; }\n .Box.chartbox .stats td:after {\n font-size: 90%;\n padding-left: .5em; }\n .Box.chartbox .stats #stat-f-s:after {\n content: \"Hz\"; }\n .Box.chartbox .stats #stat-i-peak:after {\n content: \"mA\"; }\n .Box.chartbox .stats #stat-i-rms:after {\n content: \"mA\"; }\n .Box.chartbox .stats .ar {\n position: absolute;\n bottom: 0.3819820591rem;\n width: 100%;\n text-align: center; }\n .Box.chartbox .stats .ar input[type=number] {\n width: 4em; }\n .Box.chartbox .stats .ar input[type=button] {\n margin-left: 0.3819820591rem; }\n\n.page-about .Box {\n padding-left: 1rem;\n padding-right: 1rem; }\n .page-about .Box a {\n font-weight: bold; }\n\n.page-about #logo {\n float: right;\n height: 130px; }\n\n.page-about #logo2 {\n max-width: 150px; }\n\n@media screen and (min-width: 545px) {\n .mq-phone {\n display: none; } }\n\n@media screen and (max-width: 544px) {\n .mq-tablet-min {\n display: none; } }\n\n@media screen and (min-width: 1001px) {\n .mq-tablet-max {\n display: none; } }\n\n@media screen and (max-width: 1000px) {\n .mq-normal-min {\n display: none; } }\n","/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n\n*, *:before, *:after {\n\tbox-sizing: border-box;\n}\n\n\nhtml {\n font-family: sans-serif; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n margin: 0;\n}\n\n/* HTML5 display definitions\n ========================================================================== */\n\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\n\n//article,\n//aside,\n//details,\n//figcaption,\nfigure,\n//footer,\n//header,\n//hgroup,\n//main,\n//menu,\nnav\n//section,\n//summary\n{\n display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\n//audio,\ncanvas,\nprogress\n//video\n{\n display: inline-block; /* 1 */\n vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n//\n//audio:not([controls]) {\n// display: none;\n// height: 0;\n//}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n\n[hidden]\n//template\n{\n display: none;\n}\n\n/* Links\n ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\n\na:active,\na:hover {\n outline: 0;\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n\n//abbr[title] {\n// border-bottom: 1px dotted;\n//}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\n\nb\n//strong\n{\n font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n//\n//dfn {\n// font-style: italic;\n//}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n//\n//mark {\n// background: #ff0;\n// color: #000;\n//}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\n\nimg {\n border: 0;\n}\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n\n//figure {\n// margin: 1em 40px;\n//}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n box-sizing: content-box;\n height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\n//kbd,\npre\n//samp\n{\n font-family: monospace;\n font-size: 1em;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\n\nbutton,\ninput,\n//optgroup,\nselect,\ntextarea {\n color: inherit; /* 1 */\n font: inherit; /* 2 */\n margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\n\nbutton {\n overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\n\nbutton,\n//html input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; /* 2 */\n cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\n//input[type=\"number\"]::-webkit-inner-spin-button,\n//input[type=\"number\"]::-webkit-outer-spin-button {\n// height: auto;\n//}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n//\n//input[type=\"search\"] {\n// -webkit-appearance: textfield; /* 1 */\n// box-sizing: content-box; /* 2 */\n//}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n//\n//input[type=\"search\"]::-webkit-search-cancel-button,\n//input[type=\"search\"]::-webkit-search-decoration {\n// -webkit-appearance: none;\n//}\n\n/**\n * Define consistent border, margin, and padding.\n */\n//\n//fieldset {\n// border: 1px solid #c0c0c0;\n// margin: 0 2px;\n// padding: 0.35em 0.625em 0.75em;\n//}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n border: 0; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n//\n//optgroup {\n// font-weight: bold;\n//}\n\n/* Tables\n ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","@charset \"UTF-8\";\n\n@if $border-box-sizing == true {\n html { // http://bit.ly/1qk2tVR\n box-sizing: border-box;\n }\n\n * {\n &,\n &::after,\n &::before {\n box-sizing: inherit;\n }\n }\n}\n","@import \"chartist-settings\";\n\n@mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {\n\tdisplay: block;\n\tposition: relative;\n\twidth: $width;\n\n\t&:before {\n\t\tdisplay: block;\n\t\tfloat: left;\n\t\tcontent: \"\";\n\t\twidth: 0;\n\t\theight: 0;\n\t\tpadding-bottom: $ratio * 100%;\n\t}\n\n\t&:after {\n\t\tcontent: \"\";\n\t\tdisplay: table;\n\t\tclear: both;\n\t}\n\n\t> svg {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n\n@mixin ct-align-justify($ct-text-align: $ct-text-align, $ct-text-justify: $ct-text-justify) {\n\talign-items: $ct-text-align;\n\tjustify-content: $ct-text-justify;\n\n\t// Fallback to text-align for non-flex browsers\n\t@if ($ct-text-justify == 'flex-start') {\n\t\ttext-align: left;\n\t} @else if ($ct-text-justify == 'flex-end') {\n\t\ttext-align: right;\n\t} @else {\n\t\ttext-align: center;\n\t}\n}\n\n@mixin ct-chart-label($ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-text-line-height: $ct-text-line-height) {\n\tfill: $ct-text-color;\n\tcolor: $ct-text-color;\n\tfont-size: $ct-text-size;\n\tline-height: $ct-text-line-height;\n}\n\n@mixin ct-chart-grid($ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray) {\n\tstroke: $ct-grid-color;\n\tstroke-width: $ct-grid-width;\n\n\t@if ($ct-grid-dasharray) {\n\t\tstroke-dasharray: $ct-grid-dasharray;\n\t}\n}\n\n@mixin ct-chart-point($ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape) {\n\tstroke-width: $ct-point-size;\n\tstroke-linecap: $ct-point-shape;\n}\n\n@mixin ct-chart-line($ct-line-width: $ct-line-width, $ct-line-dasharray: $ct-line-dasharray) {\n\tfill: none;\n\tstroke-width: $ct-line-width;\n\n\t@if ($ct-line-dasharray) {\n\t\tstroke-dasharray: $ct-line-dasharray;\n\t}\n}\n\n@mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {\n\tstroke: none;\n\tfill-opacity: $ct-area-opacity;\n}\n\n@mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {\n\tfill: none;\n\tstroke-width: $ct-bar-width;\n}\n\n//@mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {\n// fill: none;\n// stroke-width: $ct-donut-width;\n//}\n\n@mixin ct-chart-series-color($color) {\n\t.ct-point, .ct-line, .ct-bar /*, .ct-slice-donut*/\n\t{\n\t\tstroke: $color;\n\t}\n\n\t.ct-slice-pie, .ct-area {\n\t\tfill: $color;\n\t}\n}\n\n@mixin ct-chart(\n\t$ct-container-ratio: $ct-container-ratio,\n\t$ct-text-color: $ct-text-color,\n\t$ct-text-size: $ct-text-size,\n\t$ct-grid-color: $ct-grid-color,\n\t$ct-grid-width: $ct-grid-width,\n\t$ct-grid-dasharray: $ct-grid-dasharray,\n\t$ct-point-size: $ct-point-size,\n\t$ct-point-shape: $ct-point-shape,\n\t$ct-line-width: $ct-line-width,\n\t$ct-bar-width: $ct-bar-width,\n\t//$ct-donut-width: $ct-donut-width,\n\t$ct-series-names: $ct-series-names,\n\t$ct-series-colors: $ct-series-colors) {\n\n\t.ct-zoom-rect {\n\t\tfill: rgba(200, 100, 100, 0.3);\n\t\tstroke: #ff2b12;\n\t}\n\n\t.ct-axis-title {\n\t\tfill: $ct-axis-label-color;\n\t\t@include noselect;\n\t}\n\n\t// --- Label ---\n\t.ct-label {\n\t\t@include ct-chart-label($ct-text-color, $ct-text-size);\n\n\t\t&.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start; // Fallback for browsers that don't support foreignObjects\n\t\t}\n\n\t\t&.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\ttext-anchor: start;\n\n\t\t\t// EDIT: added for angled horiz labels\n\t\t\ttransform: translate(-4px, 0%) rotate(45deg);\n\t\t}\n\n\t\t&.ct-vertical.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-end);\n\t\t\ttext-anchor: end;\n\n\t\t\ttransform: translate(0, 20%);\n\t\t}\n\n\t\t&.ct-vertical.ct-end {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start;\n\t\t}\n\t}\n\n\t.ct-chart-line .ct-label,\n\t.ct-chart-bar .ct-label {\n\t\tdisplay: flex;\n\t}\n\n\t// --- Bar labels ---\n\n\t.ct-chart-bar {\n\t\t.ct-label.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t.ct-label.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t&.ct-horizontal-bars .ct-label {\n\t\t\t&.ct-horizontal.ct-start {\n\t\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-horizontal.ct-end {\n\t\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-start {\n\t\t\t\t//@include ct-chart-label($ct-text-color, $ct-text-size, center, $ct-vertical-text-justify);\n\t\t\t\t@include ct-align-justify(center, flex-end);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-end {\n\t\t\t\t@include ct-align-justify(center, flex-start);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\t\t}\n\t}\n\n\t.ct-grid {\n\t\t@include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);\n\t}\n\n\t.ct-point {\n\t\t@include ct-chart-point($ct-point-size, $ct-point-shape);\n\t}\n\n\t.ct-line {\n\t\t@include ct-chart-line($ct-line-width);\n\t}\n\n\t.ct-with-area .ct-line {\n\t\tstroke-width: 1px;\n\t}\n\n\t.ct-area {\n\t\t@include ct-chart-area();\n\t}\n\n\t.ct-bar {\n\t\t@include ct-chart-bar($ct-bar-width);\n\t}\n\n\t//.ct-slice-donut {\n\t// @include ct-chart-donut($ct-donut-width);\n\t//}\n\n\t@if $ct-include-colored-series {\n\t\t@for $i from 0 to length($ct-series-names) {\n\t\t\t.ct-series-#{nth($ct-series-names, $i + 1)} {\n\t\t\t\t$color: nth($ct-series-colors, $i + 1);\n\t\t\t\t@include ct-chart-series-color($color);\n\t\t\t}\n\t\t}\n\t}\n}\n\n@if $ct-include-classes {\n\t@include ct-chart();\n\n\t@if $ct-include-alternative-responsive-containers {\n\t\t@for $i from 0 to length($ct-scales-names) {\n\t\t\t.#{nth($ct-scales-names, $i + 1)} {\n\t\t\t\t@include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));\n\t\t\t}\n\t\t}\n\t}\n}\n","// Scales for responsive SVG containers\n$ct-scales_orig: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;\n$ct-scales-names_orig: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default;\n\n$ct-scales: ((10/16), (2/3));\n$ct-scales-names: (ct-wide, ct-narrow);\n\n\n// Container ratio\n$ct-container-ratio: (1/1.618) !default;\n\n// Text styles for labels\n$ct-text-color: rgba(white, 0.8) !default;\n$ct-text-size: 0.75rem !default;\n$ct-text-align: flex-start !default;\n$ct-text-justify: flex-start !default;\n$ct-text-line-height: 1;\n\n$ct-axis-label-color: rgba(white, 0.8) !default;\n\n// Grid styles\n$ct-grid-color: rgba(white, 0.3) !default;\n$ct-grid-dasharray: 2px !default;\n$ct-grid-width: 1px !default;\n\n// Line chart properties\n$ct-line-width: 2px !default;\n$ct-line-dasharray: false !default;\n$ct-point-size: 4px !default;\n// Line chart point, can be either round or square\n$ct-point-shape: round !default;\n// Area fill transparency between 0 and 1\n$ct-area-opacity: 0.3 !default;\n\n// Bar chart bar width\n$ct-bar-width: 10px !default;\n\n// Donut width (If donut width is to big it can cause issues where the shape gets distorted)\n$ct-donut-width: 60px !default;\n\n// If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you\n// should set this property to false\n$ct-include-classes: true !default;\n\n// If this is set to true the CSS will contain colored series. You can extend or change the color with the\n// properties below\n$ct-include-colored-series: $ct-include-classes !default;\n\n// If set to true this will include all responsive container variations using the scales defined at the top of the script\n$ct-include-alternative-responsive-containers: $ct-include-classes !default;\n\n// Series names and colors. This can be extended or customized as desired. Just add more series and colors.\n$ct-series-names: (a, b, c, d, e) !default;\n$ct-series-colors: (\n #f05b4f,\n #6188e2,\n #59922b,\n #eacf7d,\n #a748ca\n) !default;\n","\n@mixin click-through() {\n\tpointer-events: none;\n}\n\n\n// Disallow text selection\n@mixin noselect() {\n\t-webkit-user-select: none;\n\t-khtml-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n\n// Allow text selection\n@mixin can-select() {\n\t-webkit-user-select: text;\n\t-khtml-user-select: text;\n\t-moz-user-select: text;\n\t-ms-user-select: text;\n\tuser-select: text;\n\n\tcursor: text;\n}\n","@import \"normalize\";\n@import \"lib/bourbon/bourbon\";\n\n@import \"grid-settings\";\n@import \"lib/neat/neat\";\n\n@import \"utils/index\";\n\n@import \"lib/chartist/chartist\";\n\n$form-label-w: 130px;\n$form-label-gap: 8px;\n$form-field-w: 250px;\n\n$c-form-label-fg: white;\n$c-form-field-bg: #303030;\n$c-form-field-fg: white;\n$c-form-highlight: #217b3a;\n$c-form-highlight-a: #28bc65;\n\n@function dist($x) {\n\t@return modular-scale($x, 1rem, $golden);\n}\n\n@function fsize($x) {\n\t@return modular-scale($x, 1em, $major-second);\n}\n\n.center {\n\ttext-align: center;\n}\n\n.invis {\n\tvisibility: hidden;\n}\n\n.hidden {\n\tdisplay: none;\n}\n\n.nb {\n\tfont-weight: normal;\n}\n\n@import \"layout/index\";\n@import \"form/index\";\n\n// import all our pages\n@import \"pages/wifi\";\n@import \"pages/home\";\n@import \"pages/wfm\";\n@import \"pages/about\";\n\n@include media($tablet-min) {\n\t.mq-phone { display: none; }\n}\n\n@include media($phone) {\n\t.mq-tablet-min { display: none; }\n}\n\n@include media($normal-min) {\n\t.mq-tablet-max { display: none; }\n}\n\n@include media($tablet-max) {\n\t.mq-normal-min { display: none; }\n}\n","html {\n\tfont-family: Arial, sans-serif;\n\tcolor: #D0D0D0;\n\tbackground: #131315;\n}\n\nhtml, body {\n\t@include naked();\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n}\n\na, a:visited, a:link {\n\tcolor: #5abfff;\n\ttext-decoration: none;\n}\n\na:hover {\n\tcolor: #5abfff;\n\ttext-decoration: underline;\n}\n","// Add a highlight for debugging\n@mixin highlight($color) {\n\toutline: 1px solid $color;\n\tbackground: rgba($color, .05);\n\tbox-shadow: 0 0 2px 2px rgba($color, .2), inset 0 0 2px 2px rgba($color, .2);\n}\n\n// Ellipsis, but for block elements\n@mixin block-ellipsis($width: 100%) {\n\tdisplay: block;\n\tmax-width: $width;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n\n// No margins, padding, borders\n@mixin naked() {\n\tborder: 0 none;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-decoration: none;\n}\n\n@mixin translate($x, $y) {\n\t@include transform(translate($x, $y));\n}\n\n// Disallow wrapping\n@mixin nowrap() {\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n","/* Main outer container */\n#outer {\n\tdisplay: flex;\n\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tleft: 0;\n\tright: 0;\n\ttop: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\n\tflex-direction: row;\n}\n\n@include media($phone) {\n\t#outer {\n\t\tdisplay: block;\n\t\toverflow-y: scroll;\n\t}\n}\n","@charset \"UTF-8\";\n\n/// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).\n///\n/// @param {List} $query\n/// A list of media query features and values, where each `$feature` should have a corresponding `$value`.\n/// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).\n///\n/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.\n///\n/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).\n///\n///\n/// @param {Number (unitless)} $total-columns [$grid-columns]\n/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.\n///\n/// @example scss - Usage\n/// .responsive-element {\n/// @include media(769px) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// .new-context-element {\n/// @include media(min-width 320px max-width 480px, 6) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// @example css - CSS Output\n/// @media screen and (min-width: 769px) {\n/// .responsive-element {\n/// display: block;\n/// float: left;\n/// margin-right: 2.35765%;\n/// width: 48.82117%;\n/// }\n///\n/// .responsive-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n///\n/// @media screen and (min-width: 320px) and (max-width: 480px) {\n/// .new-context-element {\n/// display: block;\n/// float: left;\n/// margin-right: 4.82916%;\n/// width: 100%;\n/// }\n///\n/// .new-context-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n\n@mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {\n @if length($query) == 1 {\n @media screen and ($default-feature: nth($query, 1)) {\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n } @else {\n $loop-to: length($query);\n $media-query: \"screen and \";\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n\n @if is-not(is-even(length($query))) {\n $grid-columns: nth($query, $loop-to) !global;\n $loop-to: $loop-to - 1;\n }\n\n $i: 1;\n @while $i <= $loop-to {\n $media-query: $media-query + \"(\" + nth($query, $i) + \": \" + nth($query, $i + 1) + \") \";\n\n @if ($i + 1) != $loop-to {\n $media-query: $media-query + \"and \";\n }\n\n $i: $i + 2;\n }\n\n @media #{$media-query} {\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n }\n}\n","#menu {\n\t$menu-bg: #2bab5f;\n\n\tflex: 0 0 15rem;\n\tbackground: $menu-bg;\n\n\t& > * {\n\t\tdisplay: block;\n\t\ttext-decoration: none;\n\t\tpadding: dist(-1) dist(0);\n\n\t\t@include nowrap;\n\t\t@include noselect;\n\t}\n\n\t#brand {\n\t\tcolor: white;\n\t\tbackground: darken($menu-bg, 10%);\n\t\tfont-size: 120%;\n\t\ttext-align: center;\n\t\tposition:relative;\n\n\t\tmargin-bottom: dist(0);\n\n\t\t@include media($phone) {\n\t\t\tbackground: $menu-bg;\n\t\t\tcursor: pointer;\n\n\t\t\t&:after {\n\t\t\t\tposition: absolute;\n\t\t\t\tcolor: rgba(black, .2);\n\t\t\t\tright: dist(0);\n\t\t\t\tcontent: '>';\n\t\t\t\ttop:50%;\n\t\t\t\tfont-size: 120%;\n\t\t\t\tfont-weight: bold;\n\t\t\t\ttransform: translate(0,-50%) rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t&.expanded #brand {\n\t\tbackground: darken($menu-bg, 10%);\n\n\t\t@include media($phone) {\n\t\t\t&:after { transform: translate(0,-50%) rotate(-90deg) }\n\t\t}\n\t}\n\n\n\ta {\n\t\tfont-size: 130%;\n\t\tcolor: white;\n\n\t\t$hl: #1bd886;\n\t\ttransition: background-color 0.2s;\n\t\ttext-shadow: 0 0 5px rgba(black, .4);\n\n\t\t&:hover, &.selected {\n\t\t\tbackground: $hl;\n\t\t\ttext-shadow: 0 0 5px rgba(black, .6);\n\t\t}\n\n\t\t&.selected {\n\t\t\tposition: relative;\n\t\t\tbox-shadow: 0 0 5px rgba(black, .5);\n\t\t}\n\n\t\t&:before {\n\t\t\tcontent: \"▸\";\n\t\t\tpadding-right: .5rem;\n\t\t\tposition: relative;\n\t\t\ttop: -0.1rem;\n\t\t}\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.expanded a { display:block }\n\n\t@include media($tablet) {\n\t\t#brand {\n\t\t\tfont-size: 95%;\n\t\t\tmargin-bottom: dist(-1);\n\t\t}\n\n\t\ta { font-size: 105%; }\n\n\t\tflex-basis: 10rem;\n\n\t\t& > * { padding: dist(-2) dist(-1);\t}\n\t}\n}\n","// Scaling Variables\n$golden: 1.618;\n$minor-second: 1.067;\n$major-second: 1.125;\n$minor-third: 1.2;\n$major-third: 1.25;\n$perfect-fourth: 1.333;\n$augmented-fourth: 1.414;\n$perfect-fifth: 1.5;\n$minor-sixth: 1.6;\n$major-sixth: 1.667;\n$minor-seventh: 1.778;\n$major-seventh: 1.875;\n$octave: 2;\n$major-tenth: 2.5;\n$major-eleventh: 2.667;\n$major-twelfth: 3;\n$double-octave: 4;\n\n$modular-scale-ratio: $perfect-fourth !default;\n$modular-scale-base: em($em-base) !default;\n\n@function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {\n $v1: nth($value, 1);\n $v2: nth($value, length($value));\n $value: $v1;\n\n // scale $v2 to just above $v1\n @while $v2 > $v1 {\n $v2: ($v2 / $ratio); // will be off-by-1\n }\n @while $v2 < $v1 {\n $v2: ($v2 * $ratio); // will fix off-by-1\n }\n\n // check AFTER scaling $v2 to prevent double-counting corner-case\n $double-stranded: $v2 > $v1;\n\n @if $increment > 0 {\n @for $i from 1 through $increment {\n @if $double-stranded and ($v1 * $ratio) > $v2 {\n $value: $v2;\n $v2: ($v2 * $ratio);\n } @else {\n $v1: ($v1 * $ratio);\n $value: $v1;\n }\n }\n }\n\n @if $increment < 0 {\n // adjust $v2 to just below $v1\n @if $double-stranded {\n $v2: ($v2 / $ratio);\n }\n\n @for $i from $increment through -1 {\n @if $double-stranded and ($v1 / $ratio) < $v2 {\n $value: $v2;\n $v2: ($v2 / $ratio);\n } @else {\n $v1: ($v1 / $ratio);\n $value: $v1;\n }\n }\n }\n\n @return $value;\n}\n","#content {\n\tflex-grow: 1;\n\tposition: relative;\n\n\tpadding: dist(0);\n\t@include media($phone) {\n\t\tpadding: dist(-1);\n\t}\n\n\toverflow-y: auto;\n\n\t& > * {\n\t\tmargin-left: auto;\n\t\tmargin-right: auto;\n\t}\n\n\th1 {\n\t\ttext-align: center;\n\t\tfont-size: fsize(7);\n\t\tmargin-top: 0;\n\t\tmargin-bottom: dist(0);\n\t}\n\n\th2 {\n\t\tfont-size: fsize(3);\n\t\tmargin-bottom: dist(-1);\n\t}\n\n\ttd, th {\n\t\tpadding: dist(-2);\n\t}\n\n\ttbody th {\n\t\ttext-align: right;\n\t\twidth: $form-label-w;\n\t\tcolor: $c-form-label-fg;\n\t}\n}\n\n// Loader wheel in top right corner\n#loader {\n\tposition: absolute;\n\tright: dist(1);\n\ttop: dist(1);\n\n\ttransition: opacity .2s;\n\topacity: 0;\n\n\t@include media($phone) {\n\t\ttop: dist(0);\n\t\tright: dist(0);\n\t}\n\n\t&.show {\n\t\topacity:1;\n\t}\n}\n",".Box {\n\tdisplay: block;\n\tmax-width: 900px;\n\n\tmargin-top: dist(0);\n\tpadding: dist(-1) dist(0);\n\n\t@include media($phone) {\n\t\tmargin-top: dist(-1);\n\t}\n\n\th1 + & {\n\t\tmargin-top: 0;\n\t}\n\n\th2 {\n\t\tmargin-top: 0;\n\t}\n\n\tborder-radius: 3px;\n\tbackground-color: rgba(white, .07);\n\n\t&.wide {\n\t\twidth: initial;\n\t\tmax-width: initial;\n\t}\n\n\t&.medium {\n\t\tmax-width: 1200px;\n\t}\n}\n",".Modal {\n\tposition: fixed;\n\twidth: 100%; height: 100%;\n\tleft: 0; top: 0; right: 0; bottom: 0;\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\n\ttransition: opacity .5s;\n\tbackground: rgba(black, .65);\n\topacity: 0;\n\t&.visible { opacity: 1 }\n\t&.hidden { display: none }\n}\n\n.Dialog {\n\tmargin: dist(-1);\n\tpadding: dist(0);\n\toverflow: hidden;\n\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tflex: 0 1 30rem;\n\t//min-height: 15rem;\n\n\tbackground: #1c1c1e;\n\tborder-left: 6px solid $c-form-highlight;\n\tborder-right: 6px solid $c-form-highlight;\n\tbox-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n\n\tborder-radius: 6px;\n\n\th1,h2 {\n\t\tmargin-top:0;\n\t}\n\n\tp:last-child {\n\t\tmargin-bottom: 0;\n\t}\n}\n\n// \"toast\"\n.ErrMsg {\n\tposition: fixed;\n\tbottom: dist(2);\n\tpadding: dist(-1) dist(0);\n\n\t// center horizontally\n\tleft: 50%;\n\t@include translate(-50%,0);\n\t// hack to remove blur in chrome\n\t-webkit-font-smoothing: subpixel-antialiased;\n\t-webkit-transform: translateZ(0) scale(1.0, 1.0);\n\n\tbackground: #d03e42;\n\tcolor: white;\n\ttext-shadow: 0 0 2px black;\n\tbox-shadow: 0 0 6px 0 rgba(black, .6);\n\tborder-radius: 5px;\n\n\tmax-width: 80%;\n\n\t@include media($phone) {\n\t\twidth: calc(100% - #{dist(0)});\n\t}\n\n\ttransition: opacity .5s;\n\topacity: 0;\n\t&.visible { opacity: 1 }\n\t&.hidden { display: none }\n}\n","@charset \"UTF-8\";\n\n/// A mixin for generating vendor prefixes on non-standardized properties.\n///\n/// @param {String} $property\n/// Property to prefix\n///\n/// @param {*} $value\n/// Value to use\n///\n/// @param {List} $prefixes\n/// Prefixes to define\n///\n/// @example scss - Usage\n/// .element {\n/// @include prefixer(border-radius, 10px, webkit ms spec);\n/// }\n///\n/// @example css - CSS Output\n/// .element {\n/// -webkit-border-radius: 10px;\n/// -moz-border-radius: 10px;\n/// border-radius: 10px;\n/// }\n///\n/// @require {variable} $prefix-for-webkit\n/// @require {variable} $prefix-for-mozilla\n/// @require {variable} $prefix-for-microsoft\n/// @require {variable} $prefix-for-opera\n/// @require {variable} $prefix-for-spec\n\n@mixin prefixer($property, $value, $prefixes) {\n @each $prefix in $prefixes {\n @if $prefix == webkit {\n @if $prefix-for-webkit {\n -webkit-#{$property}: $value;\n }\n } @else if $prefix == moz {\n @if $prefix-for-mozilla {\n -moz-#{$property}: $value;\n }\n } @else if $prefix == ms {\n @if $prefix-for-microsoft {\n -ms-#{$property}: $value;\n }\n } @else if $prefix == o {\n @if $prefix-for-opera {\n -o-#{$property}: $value;\n }\n } @else if $prefix == spec {\n @if $prefix-for-spec {\n #{$property}: $value;\n }\n } @else {\n @warn \"Unrecognized prefix: #{$prefix}\";\n }\n }\n}\n\n@mixin disable-prefix-for-all() {\n $prefix-for-webkit: false !global;\n $prefix-for-mozilla: false !global;\n $prefix-for-microsoft: false !global;\n $prefix-for-opera: false !global;\n $prefix-for-spec: false !global;\n}\n","@import \"fancy_button_mixins\";\n\n#{$all-buttons}, .button {\n\t@include fancy-btn-base();\n\n\t// fontello\n/*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n\n\t&.narrow {\n\t\tmin-width: initial;\n\t}\n\n\ttext-shadow: 1.5px 1.5px 2px rgba(black, 0.8);\n}\n\n\n\n\n$btn-gray-f: #DDDDDD;\n$btn-gray-b: #505050;\n$btn-gray-l: #343434; // line\n\n$btn-green-f: #FEFEFE;\n$btn-green-b: #2ca94b;\n$btn-green-fa: #FEFEFE;\n$btn-green-ba: #28ba5c;\n\n$btn-red-f: #FEFEFE;\n$btn-red-b: #D04E51;\n$btn-red-fa: #FEFEFE;\n$btn-red-ba: #d4403f;\n\n$btn-blue-f: #FEFEFE;\n$btn-blue-b: #3983cd;\n$btn-blue-fa: #FEFEFE;\n$btn-blue-ba: #2076C6;\n\n$btn-orange-f: #FEFEFE;\n$btn-orange-b: #dd8751;\n$btn-orange-fa: #FEFEFE;\n$btn-orange-ba: #C6733F;\n\n\ninput[type=\"submit\"], .btn-green {\n\t@include fancy-btn-colors($btn-green-f, $btn-green-b, $btn-green-fa, $btn-green-ba)\n}\n\ninput[type=\"reset\"], .btn-red {\n\t@include fancy-btn-colors($btn-red-f, $btn-red-b, $btn-red-fa, $btn-red-ba)\n}\n\n&.btn-blue {@include fancy-btn-colors($btn-blue-f, $btn-blue-b, $btn-blue-fa, $btn-blue-ba)}\n//&, &.orange {@include fancy-btn-colors($btn-orange-f, $btn-orange-b, $btn-orange-fa, $btn-orange-ba)}\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\n","\n// Button styling\n@mixin fancy-btn-base() {\n\ttext-align: center;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tborder-radius: 2px;\n\tpadding: 0 0.6em;\n\tborder: 0 none;\n\toutline: 0 none !important;\n\tline-height: 1.8em;\n\tfont-size: 1.1em;\n\tmargin-bottom: 3px;\n\tmin-width: 5em;\n\n\t@include noselect();\n\n\t//&[class^=\"icon-\"]::before, &[class*=\" icon-\"]::before {\n\t//\tmargin-left:0;\n\t//}\n\n\t&:active {\n\t\tposition: relative;\n\t\ttop: 2px;\n\t}\n\n\t//&, &:active, &:hover, &:visited {\n\t//\ttext-decoration: none;\n\t//}\n}\n\n@mixin fancy-btn-colors-full($text_p, $back_p, $side_p, $text_a, $back_a, $side_a) {\n\tbackground-color: $back_p;\n\tbox-shadow: 0 3px 0 $side_p;\n\ttext-decoration: none !important;\n\n\t&, &:link, &:visited {\n\t\tcolor: $text_p;\n\t}\n\n\t&:hover, &:active, &.active, &.selected {\n\t\tbackground-color: $back_a;\n\t\tcolor: $text_a;\n\t}\n\n\t&:hover, &.selected, &.active {\n\t\tbox-shadow: 0 3px 0 $side_a;\n\t}\n\n\t// thinner shadow\n\t&:active {\n\t\tbox-shadow: 0 1px 0 $side_a;\n\t}\n}\n\n@mixin fancy-btn-colors($text_p, $back_p, $text_a, $back_a) {\n\t@include fancy-btn-colors-full($text_p, $back_p, darken($back_p, 14), $text_a, $back_a, darken($back_a, 16));\n}\n","@import \"buttons\";\n\n#{$all-text-inputs}, select {\n\tborder: 0 none;\n\tborder-bottom: 2px solid $c-form-highlight;\n\tbackground-color: $c-form-field-bg;\n\tcolor: $c-form-field-fg;\n\tpadding: 6px;\n\tline-height: 1em;\n\toutline: 0 none !important;\n\t-moz-outline: 0 none !important;\n\tfont-weight: normal;\n\n\t&:focus, &:hover {\n\t\tborder-bottom-color: $c-form-highlight-a;\n\t}\n}\n\n#{$all-text-inputs} {\n\t@include can-select();\n}\n\ntextarea {\n\tfont-family: monospace;\n\tline-height: 1.2em;\n\tdisplay: block; // fixes weird bottom margin\n}\n\n@import \"select\";\n","\n// target chrome only\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n\tselect { padding-right: 18px }\n}\n\nselect {\n\t-webkit-appearance: none;\n\t-moz-appearance: none;\n\tappearance: none;\n\n\tcursor: pointer;\n\tline-height: 1.2em;\n\t//padding: 3.5px;\n\n\tpadding-right: 1em;\n\n\t// hack for firefox to disable dotted outline\n\t&:-moz-focusring {\n\t\tcolor: transparent;\n\t\ttext-shadow: 0 0 0 $c-form-field-fg;\n\t}\n\n\toption {\n\t\tbackground: $c-form-field-bg;\n\t}\n}\n\nlabel.select-wrap {\n\tposition: relative;\n\tdisplay: inline !important;\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n\twidth: auto !important;\n\n\t&:after {\n\t\tcontent: '<>'; /* will be rotated */\n\t\tfont-family: \"Consolas\", monospace;\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-highlight-a;\n\n\t\ttop: 50%;\n\t\t@include transform(translate(0, -50%) rotate(90deg));\n\n\t\tright: 2px;\n\n\t\tposition:absolute;\n\t\tz-index: 100;\n\n\t\tpointer-events: none;\n\t}\n}\n","// Unified Form wrapper\nform { @include naked(); }\n\n#{$all-text-inputs}, select, label.select-wrap {\n\twidth: $form-field-w;\n}\n\nform .Row {\n\tvertical-align: middle;\n\tmargin: 14px auto;\n\ttext-align: left;\n\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&:first-child {\n\t\tmargin-top: 0;\n\t}\n\n\t&:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.spacer {\n\t\twidth: $form-label-w;\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.buttons {\n\t\tinput, .button {\n\t\t\tmargin-right: dist(-1);\n\t\t}\n\t}\n\n\t&.centered {\n\t\tjustify-content: center;\n\t}\n\n\t&.message {\n\t\tfont-size: 1em;\n\t\t//margin-left: $label-gap + $w-labels;\n\t\ttext-shadow: 1px 1px 3px black;\n\t\ttext-align: center;\n\n\t\t&.error {\n\t\t\tcolor: crimson;\n\t\t}\n\n\t\t&.ok {\n\t\t\tcolor: #0fe851;\n\t\t}\n\t}\n\n\t&.separator {\n\t\tpadding-top: 14px;\n\t\tborder-top: 2px solid rgba(255, 255, 255, 0.1);\n\t}\n\n\ttextarea {\n\t\tdisplay: inline-block;\n\t\tvertical-align: top;\n\t\tmin-height: 10rem;\n\t\tflex-grow: 1;\n\n\t\tresize: vertical;\n\t}\n\n\tlabel {\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-label-fg;\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\ttext-align: right;\n\t\ttext-shadow: 1px 1px 3px black;\n\n\t\tpadding: $form-label-gap;\n\t\talign-self: flex-start;\n\n\t\t@include noselect;\n\t}\n\n\t.checkbox-wrap {\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\tpadding: $form-label-gap;\n\t\ttext-align: right;\n\t\talign-self: flex-start;\n\n\t\tinput[type=checkbox] {\n\t\t\tmargin: auto;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\n\t\t& + label {\n\t\t\twidth: $form-field-w;\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t// special phone style\n\t@include media($phone) {\n\t\tflex-direction: column;\n\n\t\t&.buttons, &.centered {\n\t\t\tflex-direction: row;\n\t\t}\n\n\t\t&.buttons {\n\t\t\tjustify-content: center;\n\n\t\t\t// remove margin on lats button\n\t\t\t:last-child {\n\t\t\t\tmargin-right:0;\n\t\t\t}\n\t\t}\n\n\t\tlabel {\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\twidth: auto;\n\t\t}\n\n\t\t.checkbox-wrap {\n\t\t\torder: 1;\n\t\t\ttext-align: left;\n\t\t\tpadding-bottom: 0;\n\n\t\t\tborder-radius: .4px;\n\t\t\twidth: auto;\n\n\t\t\t& + label {\n\t\t\t\twidth: auto;\n\t\t\t}\n\t\t}\n\n\t\t#{$all-text-inputs}, textarea {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n}\n\n// red asterisk\nform span.required {\n\tcolor: red;\n}\n\n.RadioGroup {\n\tdisplay: inline-block;\n\tline-height: 1.5em;\n\tvertical-align: middle;\n\n\tlabel {\n\t\twidth: auto;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t\tfont-weight: normal;\n\t}\n\n\tinput[type=\"radio\"] {\n\t\tvertical-align: middle;\n\t\tmargin: 0 0 0 5px;\n\t}\n}\n","#ap-list {\n\tcolumn-count: 3;\n\tcolumn-gap: 0;\n\n\t@include media($tablet) {\n\t\tcolumn-count: 2;\n\t}\n\n\t@include media($phone) {\n\t\tcolumn-count: 1;\n\t}\n\n\tmargin: 0 (- dist(-3));\n}\n\n#ap-loader {\n\tbackground: rgba(white, .1);\n\tborder-radius: 5px;\n\tpadding: dist(-2);\n\tmargin-bottom: dist(-2);\n}\n\n#ap-box {\n\tpadding-bottom: dist(-2);\n}\n\n\n#psk-modal form {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: dist(-2);\n\n\t& > * {\n\t\tmargin-left: dist(-2);\n\t\tmargin-right: dist(-2);\n\t\t&:first-child { margin-left: 0 }\n\t\t&:last-child { margin-right: 0 }\n\t}\n\n\tinput[type=password] {\n\t\tmin-width: 5rem;\n\t}\n}\n\n.AP {\n\t// can't use margins inside a column\n\n\tbreak-inside: avoid-column;\n\tmax-width: 500px;\n\tpadding: dist(-3);\n\n\t&.selected .inner {//#70dfa3\n\t\tbackground: #43de81 !important; // override the hover effect\n\t\tcursor: default;\n\t\ttop: 0 !important; // no click effect\n\t}\n\n\t// the actual silver box\n\t.inner {\n\t\tcursor: pointer;\n\t\t@include noselect;\n\n\t\tposition: relative;\n\t\t&:active {\n\t\t\tleft: 0;\n\t\t\ttop: 1px;\n\t\t}\n\n\t\tborder-radius: 3px;\n\t\tcolor: #222;\n\n\t\tbackground: #afafaf;\n\t\ttransition: background-color 0.5s;\n\t\t&:hover { background: white }\n\n\t\tdisplay: flex;\n\n\t\t& > * {\n\t\t\tpadding: dist(-1);\n\t\t\t@include nowrap;\n\t\t}\n\n\t\t.rssi {\n\t\t\tmin-width: 2rem;\n\t\t\tflex: 0 0 15%;\n\t\t\ttext-align: right;\n\n\t\t\t&:after {\n\t\t\t\tpadding-left: dist(-5);\n\t\t\t\tcontent: '%';\n\t\t\t\tfont-size: fsize(-1);\n\t\t\t}\n\t\t}\n\n\t\t.essid {\n\t\t\tflex: 1 1 70%;\n\t\t\tmin-width: 0;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\t.auth {\n\t\t\tflex: 0 0 15%;\n\t\t}\n\t}\n}\n",".page-home #staRSSIperc:after {\n\tpadding-left: dist(-4);\n\tcontent: '%';\n\tfont-size: fsize(-1);\n}\n\n.page-home #staRSSI:after {\n\tpadding-left: dist(-4);\n\tcontent: 'dBm';\n\tfont-size: fsize(-1);\n}\n","#samp-ctrl {\n\tdisplay: flex;\n\tpadding: dist(-2);\n\n\tflex-direction: row;\n\t@include media($phone) {\n\t\tflex-direction: column;\n\t}\n\n\tjustify-content: center;\n\talign-items: stretch;\n\n\t> div {\n\t\tmargin: dist(-2) dist(-1);\n\t}\n\n\tlabel {\n\t\tline-height: 1.8;\n\t\tfont-weight: bold;\n\t}\n\n\tinput,select {\n\t\twidth: 6em;\n\n\t\t@include media($phone) {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t// -- spectrogram --\n\n\t#tile-cfg input {\n\t\twidth: 3em;\n\t}\n\n\t#interval {\n\t\twidth: 4.5em;\n\t}\n}\n\n.Box.chartbox {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t@include media($phone) {\n\t\tflex-direction: column;\n\t}\n\n\t.stats {\n\t\tflex: 0 1;\n\t\tposition: relative;\n\n\t\t@include media($phone) {\n\t\t\ttable {\n\t\t\t\tmargin: 0 auto;\n\t\t\t} // center the table\n\n\t\t\ttd,th {\n\t\t\t\twidth: 50%;\n\t\t\t}\n\t\t}\n\n\t\tth,td {\n\t\t\t@include nowrap;\n\t\t}\n\n\t\tth sub { font-weight: normal;}\n\n\t\ttd {\n\t\t\tmin-width: 100px;\n\t\t}\n\n\t\ttd:after {\n\t\t\tfont-size: 90%;\n\t\t\tpadding-left: .5em;\n\t\t}\n\n\t\t//#stat-count\n\t\t#stat-f-s:after {content: \"Hz\"}\n\t\t#stat-i-peak:after {content: \"mA\"}\n\t\t#stat-i-rms:after {content: \"mA\"}\n\n\t\tpadding-bottom: 50px;\n\n\t\t// auto reload box\n\t\t.ar {\n\t\t\tposition: absolute;\n\t\t\tbottom:dist(-2);\n\t\t\twidth:100%;\n\t\t\ttext-align: center;\n\n\t\t\tinput[type=number] {\n\t\t\t\twidth: 4em;\n\t\t\t}\n\n\t\t\tinput[type=button] {\n\t\t\t\tmargin-left: dist(-2);\n\t\t\t}\n\t\t}\n\t}\n}\n",".page-about {\n\t.Box {\n\t\tpadding-left:dist(0);\n\t\tpadding-right:dist(0);\n\n\t\ta {font-weight: bold;}\n\t}\n\n\t#logo {\n\t\tfloat:right;\n\t\theight: 130px;\n\t}\n\n\t#logo2 {\n\t\tmax-width: 150px;\n\t}\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["app.css","_normalize.scss","lib/neat/grid/_box-sizing.scss","lib/chartist/_chartist.scss","lib/chartist/_chartist-settings.scss","utils/_pointer.scss","app.scss","layout/_base.scss","utils/_misc.scss","layout/_outer-wrap.scss","lib/neat/grid/_media.scss","layout/_menu.scss","lib/bourbon/functions/_modular-scale.scss","layout/_content.scss","layout/_box.scss","layout/_modal.scss","lib/bourbon/addons/_prefixer.scss","form/_buttons.scss","form/_fancy_button_mixins.scss","form/_form_elements.scss","form/_select.scss","form/_form_layout.scss","pages/_wifi.scss","pages/_home.scss","pages/_wfm.scss","pages/_about.scss"],"names":[],"mappings":"AAAA,iBAAiB;ACAjB,2EAA2E;AAE3E;;;;GAIG;AAEH;EACC,uBAAuB,EACvB;;AAGD;EACE,wBAAwB;EAAE,OAAO;EACjC,2BAA2B;EAAE,OAAO;EACpC,+BAA+B;EAAE,OAAO,EACzC;;AAED;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;gFACgF;AAEhF;;;;;GAKG;AAMH;;EAUE,eAAe,EAChB;;AAED;;;GAGG;AAGH;;EAIE,sBAAsB;EAAE,OAAO;EAC/B,yBAAyB;EAAE,OAAO,EACnC;;AAED;;;GAGG;AAOH;;;GAGG;AD1BH;EC+BE,cAAc,EACf;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,8BAA8B,EAC/B;;AAED;;;GAGG;AAEH;;EAEE,WAAW,EACZ;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EAGE,kBAAkB,EACnB;;AAED;;GAEG;AAMH;;;GAGG;AAEH;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;;GAEG;AAOH;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAEE,eAAe;EACf,eAAe;EACf,mBAAmB;EACnB,yBAAyB,EAC1B;;AAED;EACE,YAAY,EACb;;AAED;EACE,gBAAgB,EACjB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,iBAAiB,EAClB;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EACE,wBAAwB;EACxB,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAKE,uBAAuB;EACvB,eAAe,EAChB;;AAED;gFACgF;AAEhF;;;GAGG;AAEH;;;;;GAKG;AAEH;;;;EAKE,eAAe;EAAE,OAAO;EACxB,cAAc;EAAE,OAAO;EACvB,UAAU;EAAE,OAAO,EACpB;;AAED;;GAEG;AAEH;EACE,kBAAkB,EACnB;;AAED;;;;;GAKG;AAEH;;EAEE,qBAAqB,EACtB;;AAED;;;;;;GAMG;AAEH;;;EAIE,2BAA2B;EAAE,OAAO;EACpC,gBAAgB;EAAE,OAAO,EAC1B;;AAED;;GAEG;AAEH;;EAEE,gBAAgB,EACjB;;AAED;;GAEG;AAEH;;EAEE,UAAU;EACV,WAAW,EACZ;;AAED;;;GAGG;AAEH;EACE,oBAAoB,EACrB;;AAED;;;;;;GAMG;AAEH;;EAEE,uBAAuB;EAAE,OAAO;EAChC,WAAW;EAAE,OAAO,EACrB;;AAED;;;;GAIG;AAOH;;;GAGG;AAOH;;;;GAIG;AAOH;;GAEG;AAQH;;;GAGG;AAEH;EACE,UAAU;EAAE,OAAO;EACnB,WAAW;EAAE,OAAO,EACrB;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;;GAGG;AAMH;gFACgF;AAEhF;;GAEG;AAEH;EACE,0BAA0B;EAC1B,kBAAkB,EACnB;;AAED;;EAEE,WAAW,EACZ;;ACnbC;EACE,uBAAuB,EACxB;;AAED;EAII,oBAAoB,EACrB;;ACuGJ;EACC,+BAAU;EACV,gBAAgB,EAChB;;AAED;EACC,+BCvG8B;ECV/B,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB,EF+GjB;;AAGD;EAjFA,+BCjCyB;EDkCzB,gCClCyB;EDmCzB,mBClCqB;EDmCrB,eChCsB,EDyIrB;EA3BD;IA/FA,sBAmGoC;IAlGpC,4BAkGgD;IA9F/C,iBAAiB;IA+FhB,mBAAmB,EACnB;EANF;IA/FA,wBAwGsC;IAvGtC,4BAuGkD;IAnGjD,iBAAiB;IAoGhB,mBAAmB;IAGnB,6CAAqC,EACrC;EAdF;IA/FA,sBAgHoC;IA/GpC,0BA+G8C;IAzG7C,kBAAkB;IA0GjB,iBAAiB;IAEjB,6BAAoB,EACpB;EArBF;IA/FA,sBAuHoC;IAtHpC,4BAsHgD;IAlH/C,iBAAiB;IAmHhB,mBAAmB,EACnB;;AAGF;;EAEC,cAAc,EACd;;AAID;EAnIA,sBAqIoC;EApIpC,wBAoI4C;EA5H3C,mBAAmB;EA6HlB,mBAAmB,EACnB;;AAJF;EAnIA,wBA0IsC;EAzItC,wBAyI8C;EAjI7C,mBAAmB;EAkIlB,mBAAmB,EACnB;;AATF;EAnIA,sBAgJqC;EA/IrC,4BA+IiD;EA3IhD,iBAAiB;EA4If,mBAAmB,EACnB;;AAfH;EAnIA,wBAqJuC;EApJvC,4BAoJmD;EAhJlD,iBAAiB;EAiJf,mBAAmB,EACnB;;AApBH;EAnIA,oBA2JmC;EA1JnC,0BA0J6C;EApJ5C,kBAAkB;EAqJhB,iBAAiB,EACjB;;AA1BH;EAnIA,oBAgKmC;EA/JnC,4BA+J+C;EA3J9C,iBAAiB;EA4Jf,iBAAiB,EACjB;;AAIH;EAjJA,iCC/ByB;EDgCzB,kBC9BkB;EDiCjB,sBClCqB,EDiLrB;;AAED;EA5IA,kBCjCkB;EDkClB,sBChCqB,ED6KpB;;AAED;EA3IA,WAAW;EACX,kBCzCkB,EDqLjB;;AAED;EACC,kBAAkB,EAClB;;AAED;EA1IA,aAAa;EACb,kBC5CoB,EDuLnB;;AAED;EAzIA,WAAW;EACX,mBC9CkB,EDwLjB;;AAQC;EAvID,gBCtCO,EDuCP;;AAsIC;EAnID,cC1CO,ED2CP;;AAkIC;EAvID,gBCrCO,EDsCP;;AAsIC;EAnID,cCzCO,ED0CP;;AAkIC;EAvID,gBCpCO,EDqCP;;AAsIC;EAnID,cCxCO,EDyCP;;AAkIC;EAvID,gBCnCO,EDoCP;;AAsIC;EAnID,cCvCO,EDwCP;;AAkIC;EAvID,gBClCO,EDmCP;;AAsIC;EAnID,cCtCO,EDuCP;;AA+IC;EA7OF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAgP3C;EAFD;IAxOD,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,sBAAsB,EACtB;EAkOC;IA/ND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EA4NC;IAzND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AAqNC;EA7OF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAgP3C;EAFD;IAxOD,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,+BAAsB,EACtB;EAkOC;IA/ND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EA4NC;IAzND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AGCF;EACC,mBAAmB,EACnB;;AAED;EACC,mBAAmB,EACnB;;AAED;EACC,cAAc,EACd;;AAED;EACC,oBAAoB,EACpB;;AC1CD;EACC,+BAA+B;EAC/B,eAAe;EACf,oBAAoB,EACpB;;AAED;ECaC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB;EDdtB,YAAY;EACZ,aAAa;EACb,iBAAiB,EACjB;;AAED;EACC,eAAe;EACf,sBAAsB,EACtB;;AAED;EACC,eAAe;EACf,2BAA2B,EAC3B;;AErBD,0BAA0B;AAC1B;EACC,cAAc;EAEd,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,SAAS;EACT,OAAO;EACP,UAAU;EACV,iBAAiB;EAEjB,oBAAoB,EACpB;;ACwEG;EDrEH;IACC,eAAe;IACf,mBAAmB,EACnB,EAAA;;AEpBF;EAGC,gBAAgB;EAChB,oBAHiB,EA4FjB;EA7FD;IAOE,eAAe;IACf,sBAAsB;IACtB,8BLY6B;IEU9B,oBAAoB;IACpB,kBAAkB;IHxBlB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EMCjB;EAbF;IAgBE,aAAa;IACb,oBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAkB;IAElB,oBLD6B,EKkB7B;ID+CE;MCtFJ;QAyBG,oBAxBe;QAyBf,gBAAgB,EAajB;QAvCF;UA6BI,mBAAmB;UACnB,0BAAiB;UACjB,YLV2B;UKW3B,aAAa;UACb,SAAQ;UACR,gBAAgB;UAChB,kBAAkB;UAClB,4CAAmC,EACnC,EAAA;EArCJ;IAyCE,oBAAkB,EAKlB;IDwCE;MCtFJ;QA4Ca,6CAAmC,EAAW,EAAA;EA5C3D;IAkDE,gBAAgB;IAChB,aAAa;IAGb,kCAAkC;IAClC,wCAA+B,EAsB/B;IA7EF;MA0DG,oBALW;MAMX,wCAA+B,EAC/B;IA5DH;MA+DG,mBAAmB;MACnB,uCAA8B,EAC9B;IAjEH;MAoEG,aAAS;MACT,qBAAqB;MACrB,mBAAmB;MACnB,aAAa,EACb;IDcC;MCtFJ;QA2EG,cAAc,EAEf,EAAA;EA7EF;IA+EgB,eAAe,EAAE;EDO7B;ICtFJ;MAyFE,kBAAkB,EAInB;MA7FD;QAmFG,eAAe;QACf,+BCvBc,EDwBd;MArFH;QAuFM,gBAAgB,EAAI;MAvF1B;QA2FU,yCC9BO,ED8BuB,EAAA;;AE3FxC;EACC,aAAa;EACb,mBAAmB;EAEnB,cPiB8B;EOZ9B,iBAAiB,EA4BjB;EHiDG;IGtFJ;MAME,yBDuDe,ECxBhB,EAAA;EArCD;IAYE,kBAAkB;IAClB,mBAAmB,EACnB;EAdF;IAiBE,mBAAmB;IACnB,0BD0Be;ICzBf,cAAc;IACd,oBPC6B,EOA7B;EArBF;IAwBE,yBDoBe;ICnBf,+BDoCe,ECnCf;EA1BF;IA6BE,yBDgCe,EC/Bf;EA9BF;IAiCE,kBAAkB;IAClB,aPxBkB;IOyBlB,aPrBqB,EOsBrB;;AAIF;EACC,mBAAmB;EACnB,gBDEgB;ECDhB,cDCgB;ECChB,wBAAwB;EACxB,WAAW,EAUX;EH8BG;IG9CJ;MASE,UP5B6B;MO6B7B,YP7B6B,EOmC9B,EAAA;EAhBD;IAcE,WAAU,EACV;;ACvDF;EACC,eAAe;EACf,iBAAiB;EAEjB,iBRiB8B;EQhB9B,8BRgB8B;EQF9B,mBAAmB;EACnB,4CAA4B,EAe5B;EJmDG;IItFJ;MAQE,4BFqDe,EE1BhB,EAAA;EAxBA;IACC,cAAc,EACd;EAbF;IAgBE,cAAc,EACd;EAjBF;IAuBE,eAAe;IACf,mBAAmB,EACnB;EAzBF;IA4BE,kBAAkB,EAClB;EA7BF;IAgCE,sBAAsB;IACtB,gBAAgB,EAChB;;AClCF;EACC,gBAAgB;EAChB,YAAY;EAAE,aAAa;EAC3B,QAAQ;EAAE,OAAO;EAAE,SAAS;EAAE,UAAU;EAExC,cAAc;EACd,wBAAwB;EACxB,oBAAoB;EAEpB,wBAAwB;EACxB,gCAAsB;EACtB,WAAW,EAGX;EAdD;IAYa,WAAY,EAAE;EAZ3B;IAaY,cAAe,EAAE;;AAG7B;EACC,wBH4CgB;EG3ChB,cTG8B;ESF9B,iBAAiB;EAEjB,gBAAgB;EAChB,iBAAiB;EACjB,gBAAgB;EAGhB,oBAAoB;EACpB,+BTVyB;ESWzB,gCTXyB;ESYzB,+CAA+C;EAE/C,mBAAmB,EASnB;EAxBD;IAkBE,cAAa,EACb;EAnBF;IAsBE,iBAAiB,EACjB;;AAIF;EACC,gBAAgB;EAChB,oBHDgB;EGEhB,8BTzB8B;ES4B9B,UAAU;ECEH,8BRzBqB;EO0B5B,6CAA6C;EAC7C,6CAAsC;EAEtC,oBAAoB;EACpB,aAAa;EACb,2BAA2B;EAC3B,yCAAgC;EAChC,mBAAmB;EAEnB,eAAe;EAMf,wBAAwB;EACxB,WAAW,EAGX;ELeG;IK3CJ;MAqBE,yBAAW,EAOZ,EAAA;EA5BD;IA0Ba,WAAY,EAAE;EA1B3B;IA2BY,cAAe,EAAE;;AEpE7B;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;EbLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EYNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADKD;ECzBA,0BDOmB;ECNnB,4BAuBuD;EAtBvD,iCAAiC,EDuB6D;EAA9F;ICpBC,eDCoB,ECApB;EDmBD;IChBC,0BDAmB;ICCnB,eDFmB,ECGnB;EDcD;ICXC,4BAU6F,EAT7F;EDUD;ICNC,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AAjGF;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;EbLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EYNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADKD;ECzBA,0BDOmB;ECNnB,4BAuBuD;EAtBvD,iCAAiC,EDuB6D;EAA9F;ICpBC,eDCoB,ECApB;EDmBD;IChBC,0BDAmB;ICCnB,eDFmB,ECGnB;EDcD;ICXC,4BAU6F,EAT7F;EDUD;ICNC,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AEjGF;EACC,eAAe;EACf,iCbayB;EaZzB,0BbUwB;EaTxB,abUsB;EaTtB,aAAa;EACb,iBAAiB;EACjB,2BAA2B;EAC3B,gCAAgC;EAChC,oBAAoB,EAKpB;EAdD;IAYE,6BbI0B,EaH1B;;AAGF;EdAC,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EAElB,aAAa,EcJb;;AAED;EACC,uBAAuB;EACvB,mBAAmB;EACnB,eAAe,EACf;;ACxBD;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EAGnB,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBdJqB,EcKrB;EAfF;IAkBE,oBdTuB,EcUvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,edrB0B;IcuB1B,SAAS;IJUH,4CITsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;ACjDF;EbkBC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB,EarBI;;AAE3B;EACC,afQmB,EePnB;;AAED;EACC,uBAAuB;EACvB,kBAAkB;EAClB,iBAAiB;EAEjB,cAAc;EACd,oBAAoB,EAoIpB;EA1ID;IASE,cAAc,EACd;EAVF;IAaE,iBAAiB,EACjB;EAdF;IAiBE,afdkB,EemBlB;IXyDE;MW/EJ;QAoBG,cAAc,EAEf,EAAA;EAtBF;IA0BG,8BT4Bc,ES3Bd;EA3BH;IA+BE,wBAAwB,EACxB;EAhCF;IAmCE,eAAe;IAEf,+BAA+B;IAC/B,mBAAmB,EASnB;IA/CF;MAyCG,eAAe,EACf;IA1CH;MA6CG,eAAe,EACf;EA9CH;IAkDE,kBAAkB;IAClB,+CAA0B,EAC1B;EApDF;IAuDE,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;IAClB,aAAa;IAEb,iBAAiB,EACjB;EA7DF;IAgEE,kBAAkB;IAClB,af1DqB;Ie2DrB,sBAAsB;IACtB,afhEkB;IeiElB,kBAAkB;IAClB,+BAA+B;IAE/B,afnEkB;IeoElB,uBAAuB;IhBvExB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EgBsEjB;EA3EF;IA8EE,sBAAsB;IACtB,af5EkB;Ie6ElB,af5EkB;Ie6ElB,kBAAkB;IAClB,uBAAuB,EAcvB;IAhGF;MAqFG,aAAa;MACb,YAAY;MACZ,aAAa,EACb;IAxFH;MA2FG,aftFiB;MeuFjB,gBAAgB;MAChB,iBAAiB;MACjB,gBAAgB,EAChB;EXhBC;IW/EJ;MAoGE,uBAAuB,EAsCxB;MA1ID;QAuGG,oBAAoB,EACpB;MAxGH;QA2GG,wBAAwB,EAMxB;QAjHH;UA+GI,gBAAe,EACf;MAhHJ;QAoHG,gBAAgB;QAChB,iBAAiB;QACjB,YAAY,EACZ;MAvHH;QA0HG,SAAS;QACT,iBAAiB;QACjB,kBAAkB;QAElB,oBAAoB;QACpB,YAAY,EAKZ;QApIH;UAkII,YAAY,EACZ;MAnIJ;QAuIG,YAAY,EACZ,EAAA;;AAKH;EACC,WAAW,EACX;;AAED;EACC,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB,EAavB;EAhBD;IAME,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB,EACpB;EAVF;IAaE,uBAAuB;IACvB,kBAAkB,EAClB;;ADrKF;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EAGnB,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBdJqB,EcKrB;EAfF;IAkBE,oBdTuB,EcUvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,edrB0B;IcuB1B,SAAS;IJUH,4CITsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;AElDF;EACC,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;EAChB,sBAAc;EAAd,mBAAc;EAAd,cAAc;EAUd,2BViDgB,EUhDhB;EZyEG;IYtFJ;MAKE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAQjB,EAAA;EZyEG;IYtFJ;MASE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAIjB,EAAA;;AAED;EACC,qCAAsB;EACtB,mBAAmB;EACnB,yBV2CgB;EU1ChB,+BV0CgB,EUzChB;;AAED;EACC,gCVsCgB,EUrChB;;AAGD;EACC,cAAc;EACd,oBAAoB;EACpB,wBV+BgB,EUnBhB;EAfD;IAME,6BV4Be;IU3Bf,8BV2Be,EUxBf;IAVF;MAQkB,eAAgB,EAAE;IARpC;MASiB,gBAAiB,EAAE;EATpC;IAaE,gBAAgB,EAChB;;AAGF;EAGC,mCAA2B;EAA3B,yBAA2B;EAA3B,2BAA2B;EAC3B,iBAAiB;EACjB,yBVYgB,EU6ChB;EA9DD;IAQE,+BAA+B;IAC/B,gBAAgB;IAChB,kBAAkB,EAClB;EAXF;IAeE,gBAAgB;IjBnDjB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB;IiBkDjB,mBAAmB;IAMnB,mBAAmB;IACnB,YAAY;IAEZ,oBAAoB;IACpB,kCAAkC;IAGlC,cAAc,EA8Bd;IA7DF;MAoBG,QAAQ;MACR,SAAS,EACT;IAtBH;MA6BY,kBAAmB,EAAE;IA7BjC;MAkCG,yBVjBc;MJ9BhB,oBAAoB;MACpB,kBAAkB,EcgDhB;IApCH;MAuCG,gBAAgB;MAChB,cAAc;MACd,kBAAkB,EAOlB;MAhDH;QA4CI,6BV3Ba;QU4Bb,aAAa;QACb,0BV7Ba,EU8Bb;IA/CJ;MAmDG,cAAc;MACd,aAAa;MACb,wBAAwB;MACxB,iBAAiB;MACjB,kBAAkB,EAClB;IAxDH;MA2DG,cAAc,EACd;;ACxGH;EACC,8BX4DgB;EW3DhB,aAAa;EACb,0BX0DgB,EWzDhB;;AAED;EACC,8BXsDgB;EWrDhB,eAAe;EACf,0BXoDgB,EWnDhB;;ACVD;EACC,cAAc;EACd,yBZ2DgB;EYzDhB,oBAAoB;EAKpB,wBAAwB;EACxB,qBAAqB,EA4BrB;EdgDG;IctFJ;MAME,uBAAuB,EAgCxB,EAAA;EAtCD;IAaE,wCZgDe,EY/Cf;EAdF;IAiBE,iBAAiB;IACjB,kBAAkB,EAClB;EAnBF;IAsBE,WAAW,EAKX;Id2DE;MctFJ;QAyBG,YAAY,EAEb,EAAA;EA3BF;IAgCE,WAAW,EACX;EAjCF;IAoCE,aAAa,EACb;;AAGF;EACC,cAAc;EACd,oBAAoB,EA0DpB;EddG;Ic9CJ;MAKE,uBAAuB,EAuDxB,EAAA;EA5DD;IASE,UAAU;IACV,mBAAmB;IAgCnB,qBAAqB,EAiBrB;IdbE;Mc9CJ;QAcI,eAAe,EACf;MAfJ;QAkBI,WAAW,EACX,EAAA;IAnBJ;MhBTC,oBAAoB;MACpB,kBAAkB,EgBgChB;IAxBH;MA0BW,oBAAoB,EAAG;IA1BlC;MA6BG,iBAAiB,EACjB;IA9BH;MAiCG,eAAe;MACf,mBAAmB,EACnB;IAnCH;MAsCmB,cAAc,EAAE;IAtCnC;MAuCsB,cAAc,EAAE;IAvCtC;MAwCqB,cAAc,EAAE;IAxCrC;MA8CG,mBAAmB;MACnB,wBZ1Bc;MY2Bd,YAAW;MACX,mBAAmB,EASnB;MA1DH;QAoDI,WAAW,EACX;MArDJ;QAwDI,6BZnCa,EYoCb;;ACjGJ;EAEE,mBnBmB6B;EmBlB7B,oBnBkB6B,EmBf7B;EANF;IAKK,kBAAkB,EAAG;;AAL1B;EASE,aAAY;EACZ,cAAc,EACd;;AAXF;EAcE,iBAAiB,EACjB;;AfuEE;EJhCH;IAAY,cAAc,EAAI,EAAA;;AIgC3B;EJ5BH;IAAiB,cAAc,EAAI,EAAA;;AI4BhC;EJxBH;IAAiB,cAAc,EAAI,EAAA;;AIwBhC;EJpBH;IAAiB,cAAc,EAAI,EAAA","file":"app.css","sourcesContent":["@charset \"UTF-8\";\n/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n*, *:before, *:after {\n box-sizing: border-box; }\n\nhtml {\n font-family: sans-serif;\n /* 1 */\n -ms-text-size-adjust: 100%;\n /* 2 */\n -webkit-text-size-adjust: 100%;\n /* 2 */ }\n\n/**\n * Remove default margin.\n */\nbody {\n margin: 0; }\n\n/* HTML5 display definitions\n ========================================================================== */\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\nfigure,\nnav {\n display: block; }\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\ncanvas,\nprogress {\n display: inline-block;\n /* 1 */\n vertical-align: baseline;\n /* 2 */ }\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n[hidden] {\n display: none; }\n\n/* Links\n ========================================================================== */\n/**\n * Remove the gray background color from active links in IE 10.\n */\na {\n background-color: transparent; }\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\na:active,\na:hover {\n outline: 0; }\n\n/* Text-level semantics\n ========================================================================== */\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\nb {\n font-weight: bold; }\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\nh1 {\n font-size: 2em;\n margin: 0.67em 0; }\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0; }\n\n/**\n * Address styling not present in IE 8/9.\n */\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n font-size: 80%; }\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline; }\n\nsup {\n top: -0.5em; }\n\nsub {\n bottom: -0.25em; }\n\n/* Embedded content\n ========================================================================== */\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\nimg {\n border: 0; }\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\nsvg:not(:root) {\n overflow: hidden; }\n\n/* Grouping content\n ========================================================================== */\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n box-sizing: content-box;\n height: 0; }\n\n/**\n * Contain overflow in all browsers.\n */\npre {\n overflow: auto; }\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\ncode,\npre {\n font-family: monospace;\n font-size: 1em; }\n\n/* Forms\n ========================================================================== */\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\nbutton,\ninput,\nselect,\ntextarea {\n color: inherit;\n /* 1 */\n font: inherit;\n /* 2 */\n margin: 0;\n /* 3 */ }\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\nbutton {\n overflow: visible; }\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\nbutton,\nselect {\n text-transform: none; }\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\nbutton,\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n /* 2 */\n cursor: pointer;\n /* 3 */ }\n\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled],\nhtml input[disabled] {\n cursor: default; }\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0; }\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\ninput {\n line-height: normal; }\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n/**\n * Define consistent border, margin, and padding.\n */\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n border: 0;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\ntextarea {\n overflow: auto; }\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n/* Tables\n ========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n border-collapse: collapse;\n border-spacing: 0; }\n\ntd,\nth {\n padding: 0; }\n\nhtml {\n box-sizing: border-box; }\n\n*, *::after, *::before {\n box-sizing: inherit; }\n\n.ct-zoom-rect {\n fill: rgba(200, 100, 100, 0.3);\n stroke: #ff2b12; }\n\n.ct-axis-title {\n fill: rgba(255, 255, 255, 0.8);\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n\n.ct-label {\n fill: rgba(255, 255, 255, 0.8);\n color: rgba(255, 255, 255, 0.8);\n font-size: 0.75rem;\n line-height: 1; }\n .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start;\n transform: translate(-4px, 0%) rotate(45deg); }\n .ct-label.ct-vertical.ct-start {\n align-items: flex-end;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end;\n transform: translate(0, 20%); }\n .ct-label.ct-vertical.ct-end {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-line .ct-label,\n.ct-chart-bar .ct-label {\n display: flex; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start {\n align-items: center;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end {\n align-items: center;\n justify-content: flex-start;\n text-align: left;\n text-anchor: end; }\n\n.ct-grid {\n stroke: rgba(255, 255, 255, 0.3);\n stroke-width: 1px;\n stroke-dasharray: 2px; }\n\n.ct-point {\n stroke-width: 4px;\n stroke-linecap: round; }\n\n.ct-line {\n fill: none;\n stroke-width: 2px; }\n\n.ct-with-area .ct-line {\n stroke-width: 1px; }\n\n.ct-area {\n stroke: none;\n fill-opacity: 0.3; }\n\n.ct-bar {\n fill: none;\n stroke-width: 10px; }\n\n.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar {\n stroke: #f05b4f; }\n\n.ct-series-a .ct-slice-pie, .ct-series-a .ct-area {\n fill: #f05b4f; }\n\n.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar {\n stroke: #6188e2; }\n\n.ct-series-b .ct-slice-pie, .ct-series-b .ct-area {\n fill: #6188e2; }\n\n.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar {\n stroke: #59922b; }\n\n.ct-series-c .ct-slice-pie, .ct-series-c .ct-area {\n fill: #59922b; }\n\n.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar {\n stroke: #eacf7d; }\n\n.ct-series-d .ct-slice-pie, .ct-series-d .ct-area {\n fill: #eacf7d; }\n\n.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar {\n stroke: #a748ca; }\n\n.ct-series-e .ct-slice-pie, .ct-series-e .ct-area {\n fill: #a748ca; }\n\n.ct-wide {\n display: block;\n position: relative;\n width: 100%; }\n .ct-wide:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 62.5%; }\n .ct-wide:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-wide > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.ct-narrow {\n display: block;\n position: relative;\n width: 100%; }\n .ct-narrow:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 66.6666666667%; }\n .ct-narrow:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-narrow > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.center {\n text-align: center; }\n\n.invis {\n visibility: hidden; }\n\n.hidden {\n display: none; }\n\n.nb {\n font-weight: normal; }\n\nhtml {\n font-family: Arial, sans-serif;\n color: #D0D0D0;\n background: #131315; }\n\nhtml, body {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none;\n width: 100%;\n height: 100%;\n overflow: hidden; }\n\na, a:visited, a:link {\n color: #5abfff;\n text-decoration: none; }\n\na:hover {\n color: #5abfff;\n text-decoration: underline; }\n\n/* Main outer container */\n#outer {\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n flex-direction: row; }\n\n@media screen and (max-width: 544px) {\n #outer {\n display: block;\n overflow-y: scroll; } }\n\n#menu {\n flex: 0 0 15rem;\n background: #2bab5f; }\n #menu > * {\n display: block;\n text-decoration: none;\n padding: 0.6180469716rem 1rem;\n white-space: nowrap;\n word-wrap: normal;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n #menu #brand {\n color: white;\n background: #218248;\n font-size: 120%;\n text-align: center;\n position: relative;\n margin-bottom: 1rem; }\n @media screen and (max-width: 544px) {\n #menu #brand {\n background: #2bab5f;\n cursor: pointer; }\n #menu #brand:after {\n position: absolute;\n color: rgba(0, 0, 0, 0.2);\n right: 1rem;\n content: '>';\n top: 50%;\n font-size: 120%;\n font-weight: bold;\n transform: translate(0, -50%) rotate(90deg); } }\n #menu.expanded #brand {\n background: #218248; }\n @media screen and (max-width: 544px) {\n #menu.expanded #brand:after {\n transform: translate(0, -50%) rotate(-90deg); } }\n #menu a {\n font-size: 130%;\n color: white;\n transition: background-color 0.2s;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.4); }\n #menu a:hover, #menu a.selected {\n background: #1bd886;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); }\n #menu a.selected {\n position: relative;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); }\n #menu a:before {\n content: \"▸\";\n padding-right: .5rem;\n position: relative;\n top: -0.1rem; }\n @media screen and (max-width: 544px) {\n #menu a {\n display: none; } }\n #menu.expanded a {\n display: block; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #menu {\n flex-basis: 10rem; }\n #menu #brand {\n font-size: 95%;\n margin-bottom: 0.6180469716rem; }\n #menu a {\n font-size: 105%; }\n #menu > * {\n padding: 0.3819820591rem 0.6180469716rem; } }\n\n#content {\n flex-grow: 1;\n position: relative;\n padding: 1rem;\n overflow-y: auto; }\n @media screen and (max-width: 544px) {\n #content {\n padding: 0.6180469716rem; } }\n #content > * {\n margin-left: auto;\n margin-right: auto; }\n #content h1 {\n text-align: center;\n font-size: 2.2806973457em;\n margin-top: 0;\n margin-bottom: 1rem; }\n #content h2 {\n font-size: 1.423828125em;\n margin-bottom: 0.6180469716rem; }\n #content td, #content th {\n padding: 0.3819820591rem; }\n #content tbody th {\n text-align: right;\n width: 130px;\n color: white; }\n\n#loader {\n position: absolute;\n right: 1.618rem;\n top: 1.618rem;\n transition: opacity .2s;\n opacity: 0; }\n @media screen and (max-width: 544px) {\n #loader {\n top: 1rem;\n right: 1rem; } }\n #loader.show {\n opacity: 1; }\n\n.Box {\n display: block;\n max-width: 900px;\n margin-top: 1rem;\n padding: 0.6180469716rem 1rem;\n border-radius: 3px;\n background-color: rgba(255, 255, 255, 0.07); }\n @media screen and (max-width: 544px) {\n .Box {\n margin-top: 0.6180469716rem; } }\n h1 + .Box {\n margin-top: 0; }\n .Box h2 {\n margin-top: 0; }\n .Box.wide {\n width: initial;\n max-width: initial; }\n .Box.medium {\n max-width: 1200px; }\n .Box .Valfield {\n display: inline-block;\n min-width: 10em; }\n\n.Modal {\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: opacity .5s;\n background: rgba(0, 0, 0, 0.65);\n opacity: 0; }\n .Modal.visible {\n opacity: 1; }\n .Modal.hidden {\n display: none; }\n\n.Dialog {\n margin: 0.6180469716rem;\n padding: 1rem;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n flex: 0 1 30rem;\n background: #1c1c1e;\n border-left: 6px solid #217b3a;\n border-right: 6px solid #217b3a;\n box-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n border-radius: 6px; }\n .Dialog h1, .Dialog h2 {\n margin-top: 0; }\n .Dialog p:last-child {\n margin-bottom: 0; }\n\n.ErrMsg {\n position: fixed;\n bottom: 2.617924rem;\n padding: 0.6180469716rem 1rem;\n left: 50%;\n -webkit-transform: translate(-50%, 0);\n -moz-transform: translate(-50%, 0);\n -ms-transform: translate(-50%, 0);\n -o-transform: translate(-50%, 0);\n transform: translate(-50%, 0);\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-transform: translateZ(0) scale(1, 1);\n background: #d03e42;\n color: white;\n text-shadow: 0 0 2px black;\n box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.6);\n border-radius: 5px;\n max-width: 80%;\n transition: opacity .5s;\n opacity: 0; }\n @media screen and (max-width: 544px) {\n .ErrMsg {\n width: calc(100% - 1rem); } }\n .ErrMsg.visible {\n opacity: 1; }\n .ErrMsg.hidden {\n display: none; }\n\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n.btn-blue {\n background-color: #3983cd;\n box-shadow: 0 3px 0 #265f98;\n text-decoration: none !important; }\n .btn-blue, .btn-blue:link, .btn-blue:visited {\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected {\n background-color: #2076C6;\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue.selected, .btn-blue.active {\n box-shadow: 0 3px 0 #154c80; }\n .btn-blue:active {\n box-shadow: 0 1px 0 #154c80; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n.btn-blue {\n background-color: #3983cd;\n box-shadow: 0 3px 0 #265f98;\n text-decoration: none !important; }\n .btn-blue, .btn-blue:link, .btn-blue:visited {\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected {\n background-color: #2076C6;\n color: #FEFEFE; }\n .btn-blue:hover, .btn-blue.selected, .btn-blue.active {\n box-shadow: 0 3px 0 #154c80; }\n .btn-blue:active {\n box-shadow: 0 1px 0 #154c80; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select {\n border: 0 none;\n border-bottom: 2px solid #217b3a;\n background-color: #303030;\n color: white;\n padding: 6px;\n line-height: 1em;\n outline: 0 none !important;\n -moz-outline: 0 none !important;\n font-weight: normal; }\n input[type=\"number\"]:focus, input[type=\"number\"]:hover, input[type=\"password\"]:focus, input[type=\"password\"]:hover, input[type=\"text\"]:focus, input[type=\"text\"]:hover, textarea:focus, textarea:hover, select:focus, select:hover {\n border-bottom-color: #28bc65; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea {\n -webkit-user-select: text;\n -khtml-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: text; }\n\ntextarea {\n font-family: monospace;\n line-height: 1.2em;\n display: block; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.2em;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\nform {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select, label.select-wrap {\n width: 250px; }\n\nform .Row {\n vertical-align: middle;\n margin: 14px auto;\n text-align: left;\n display: flex;\n flex-direction: row; }\n form .Row:first-child {\n margin-top: 0; }\n form .Row:last-child {\n margin-bottom: 0; }\n form .Row .spacer {\n width: 130px; }\n @media screen and (max-width: 544px) {\n form .Row .spacer {\n display: none; } }\n form .Row.buttons input, form .Row.buttons .button {\n margin-right: 0.6180469716rem; }\n form .Row.centered {\n justify-content: center; }\n form .Row.message {\n font-size: 1em;\n text-shadow: 1px 1px 3px black;\n text-align: center; }\n form .Row.message.error {\n color: crimson; }\n form .Row.message.ok {\n color: #0fe851; }\n form .Row.separator {\n padding-top: 14px;\n border-top: 2px solid rgba(255, 255, 255, 0.1); }\n form .Row textarea {\n display: inline-block;\n vertical-align: top;\n min-height: 10rem;\n flex-grow: 1;\n resize: vertical; }\n form .Row label {\n font-weight: bold;\n color: white;\n display: inline-block;\n width: 130px;\n text-align: right;\n text-shadow: 1px 1px 3px black;\n padding: 8px;\n align-self: flex-start;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n form .Row .checkbox-wrap {\n display: inline-block;\n width: 130px;\n padding: 8px;\n text-align: right;\n align-self: flex-start; }\n form .Row .checkbox-wrap input[type=checkbox] {\n margin: auto;\n width: auto;\n height: auto; }\n form .Row .checkbox-wrap + label {\n width: 250px;\n padding-left: 0;\n text-align: left;\n cursor: pointer; }\n @media screen and (max-width: 544px) {\n form .Row {\n flex-direction: column; }\n form .Row.buttons, form .Row.centered {\n flex-direction: row; }\n form .Row.buttons {\n justify-content: center; }\n form .Row.buttons :last-child {\n margin-right: 0; }\n form .Row label {\n padding-left: 0;\n text-align: left;\n width: auto; }\n form .Row .checkbox-wrap {\n order: 1;\n text-align: left;\n padding-bottom: 0;\n border-radius: .4px;\n width: auto; }\n form .Row .checkbox-wrap + label {\n width: auto; }\n form .Row input[type=\"number\"], form .Row input[type=\"password\"], form .Row input[type=\"text\"], form .Row textarea, form .Row textarea {\n width: 100%; } }\n\nform span.required {\n color: red; }\n\n.RadioGroup {\n display: inline-block;\n line-height: 1.5em;\n vertical-align: middle; }\n .RadioGroup label {\n width: auto;\n text-align: left;\n cursor: pointer;\n font-weight: normal; }\n .RadioGroup input[type=\"radio\"] {\n vertical-align: middle;\n margin: 0 0 0 5px; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.2em;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\n#ap-list {\n column-count: 3;\n column-gap: 0;\n margin: 0 -0.2360828548rem; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #ap-list {\n column-count: 2; } }\n @media screen and (max-width: 544px) {\n #ap-list {\n column-count: 1; } }\n\n#ap-loader {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 5px;\n padding: 0.3819820591rem;\n margin-bottom: 0.3819820591rem; }\n\n#ap-box {\n padding-bottom: 0.3819820591rem; }\n\n#psk-modal form {\n display: flex;\n align-items: center;\n margin: 0.3819820591rem; }\n #psk-modal form > * {\n margin-left: 0.3819820591rem;\n margin-right: 0.3819820591rem; }\n #psk-modal form > *:first-child {\n margin-left: 0; }\n #psk-modal form > *:last-child {\n margin-right: 0; }\n #psk-modal form input[type=password] {\n min-width: 5rem; }\n\n.AP {\n break-inside: avoid-column;\n max-width: 500px;\n padding: 0.2360828548rem; }\n .AP.selected .inner {\n background: #43de81 !important;\n cursor: default;\n top: 0 !important; }\n .AP .inner {\n cursor: pointer;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n border-radius: 3px;\n color: #222;\n background: #afafaf;\n transition: background-color 0.5s;\n display: flex; }\n .AP .inner:active {\n left: 0;\n top: 1px; }\n .AP .inner:hover {\n background: white; }\n .AP .inner > * {\n padding: 0.6180469716rem;\n white-space: nowrap;\n word-wrap: normal; }\n .AP .inner .rssi {\n min-width: 2rem;\n flex: 0 0 15%;\n text-align: right; }\n .AP .inner .rssi:after {\n padding-left: 0.090179415rem;\n content: '%';\n font-size: 0.8888888889em; }\n .AP .inner .essid {\n flex: 1 1 70%;\n min-width: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: bold; }\n .AP .inner .auth {\n flex: 0 0 15%; }\n\n.page-home #staRSSIperc:after {\n padding-left: 0.1459102934rem;\n content: '%';\n font-size: 0.8888888889em; }\n\n.page-home #staRSSI:after {\n padding-left: 0.1459102934rem;\n content: 'dBm';\n font-size: 0.8888888889em; }\n\n#samp-ctrl {\n display: flex;\n padding: 0.3819820591rem;\n flex-direction: row;\n justify-content: center;\n align-items: stretch; }\n @media screen and (max-width: 544px) {\n #samp-ctrl {\n flex-direction: column; } }\n #samp-ctrl > div {\n margin: 0.3819820591rem 0.6180469716rem; }\n #samp-ctrl label {\n line-height: 1.8;\n font-weight: bold; }\n #samp-ctrl input, #samp-ctrl select {\n width: 6em; }\n @media screen and (max-width: 544px) {\n #samp-ctrl input, #samp-ctrl select {\n width: 100%; } }\n #samp-ctrl #tile-cfg input {\n width: 3em; }\n #samp-ctrl #interval {\n width: 4.5em; }\n\n.Box.chartbox {\n display: flex;\n flex-direction: row; }\n @media screen and (max-width: 544px) {\n .Box.chartbox {\n flex-direction: column; } }\n .Box.chartbox .stats {\n flex: 0 1;\n position: relative;\n padding-bottom: 50px; }\n @media screen and (max-width: 544px) {\n .Box.chartbox .stats table {\n margin: 0 auto; }\n .Box.chartbox .stats td, .Box.chartbox .stats th {\n width: 50%; } }\n .Box.chartbox .stats th, .Box.chartbox .stats td {\n white-space: nowrap;\n word-wrap: normal; }\n .Box.chartbox .stats th sub {\n font-weight: normal; }\n .Box.chartbox .stats td {\n min-width: 100px; }\n .Box.chartbox .stats td:after {\n font-size: 90%;\n padding-left: .5em; }\n .Box.chartbox .stats #stat-f-s:after {\n content: \"Hz\"; }\n .Box.chartbox .stats #stat-i-peak:after {\n content: \"mA\"; }\n .Box.chartbox .stats #stat-i-rms:after {\n content: \"mA\"; }\n .Box.chartbox .stats .ar {\n position: absolute;\n bottom: 0.3819820591rem;\n width: 100%;\n text-align: center; }\n .Box.chartbox .stats .ar input[type=number] {\n width: 4em; }\n .Box.chartbox .stats .ar input[type=button] {\n margin-left: 0.3819820591rem; }\n\n.page-about .Box {\n padding-left: 1rem;\n padding-right: 1rem; }\n .page-about .Box a {\n font-weight: bold; }\n\n.page-about #logo {\n float: right;\n height: 130px; }\n\n.page-about #logo2 {\n max-width: 150px; }\n\n@media screen and (min-width: 545px) {\n .mq-phone {\n display: none; } }\n\n@media screen and (max-width: 544px) {\n .mq-tablet-min {\n display: none; } }\n\n@media screen and (min-width: 1001px) {\n .mq-tablet-max {\n display: none; } }\n\n@media screen and (max-width: 1000px) {\n .mq-normal-min {\n display: none; } }\n","/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n\n*, *:before, *:after {\n\tbox-sizing: border-box;\n}\n\n\nhtml {\n font-family: sans-serif; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n margin: 0;\n}\n\n/* HTML5 display definitions\n ========================================================================== */\n\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\n\n//article,\n//aside,\n//details,\n//figcaption,\nfigure,\n//footer,\n//header,\n//hgroup,\n//main,\n//menu,\nnav\n//section,\n//summary\n{\n display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\n//audio,\ncanvas,\nprogress\n//video\n{\n display: inline-block; /* 1 */\n vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n//\n//audio:not([controls]) {\n// display: none;\n// height: 0;\n//}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n\n[hidden]\n//template\n{\n display: none;\n}\n\n/* Links\n ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\n\na:active,\na:hover {\n outline: 0;\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n\n//abbr[title] {\n// border-bottom: 1px dotted;\n//}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\n\nb\n//strong\n{\n font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n//\n//dfn {\n// font-style: italic;\n//}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n//\n//mark {\n// background: #ff0;\n// color: #000;\n//}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\n\nimg {\n border: 0;\n}\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n\n//figure {\n// margin: 1em 40px;\n//}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n box-sizing: content-box;\n height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\n//kbd,\npre\n//samp\n{\n font-family: monospace;\n font-size: 1em;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\n\nbutton,\ninput,\n//optgroup,\nselect,\ntextarea {\n color: inherit; /* 1 */\n font: inherit; /* 2 */\n margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\n\nbutton {\n overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\n\nbutton,\n//html input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; /* 2 */\n cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\n//input[type=\"number\"]::-webkit-inner-spin-button,\n//input[type=\"number\"]::-webkit-outer-spin-button {\n// height: auto;\n//}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n//\n//input[type=\"search\"] {\n// -webkit-appearance: textfield; /* 1 */\n// box-sizing: content-box; /* 2 */\n//}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n//\n//input[type=\"search\"]::-webkit-search-cancel-button,\n//input[type=\"search\"]::-webkit-search-decoration {\n// -webkit-appearance: none;\n//}\n\n/**\n * Define consistent border, margin, and padding.\n */\n//\n//fieldset {\n// border: 1px solid #c0c0c0;\n// margin: 0 2px;\n// padding: 0.35em 0.625em 0.75em;\n//}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n border: 0; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n//\n//optgroup {\n// font-weight: bold;\n//}\n\n/* Tables\n ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","@charset \"UTF-8\";\n\n@if $border-box-sizing == true {\n html { // http://bit.ly/1qk2tVR\n box-sizing: border-box;\n }\n\n * {\n &,\n &::after,\n &::before {\n box-sizing: inherit;\n }\n }\n}\n","@import \"chartist-settings\";\n\n@mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {\n\tdisplay: block;\n\tposition: relative;\n\twidth: $width;\n\n\t&:before {\n\t\tdisplay: block;\n\t\tfloat: left;\n\t\tcontent: \"\";\n\t\twidth: 0;\n\t\theight: 0;\n\t\tpadding-bottom: $ratio * 100%;\n\t}\n\n\t&:after {\n\t\tcontent: \"\";\n\t\tdisplay: table;\n\t\tclear: both;\n\t}\n\n\t> svg {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n\n@mixin ct-align-justify($ct-text-align: $ct-text-align, $ct-text-justify: $ct-text-justify) {\n\talign-items: $ct-text-align;\n\tjustify-content: $ct-text-justify;\n\n\t// Fallback to text-align for non-flex browsers\n\t@if ($ct-text-justify == 'flex-start') {\n\t\ttext-align: left;\n\t} @else if ($ct-text-justify == 'flex-end') {\n\t\ttext-align: right;\n\t} @else {\n\t\ttext-align: center;\n\t}\n}\n\n@mixin ct-chart-label($ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-text-line-height: $ct-text-line-height) {\n\tfill: $ct-text-color;\n\tcolor: $ct-text-color;\n\tfont-size: $ct-text-size;\n\tline-height: $ct-text-line-height;\n}\n\n@mixin ct-chart-grid($ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray) {\n\tstroke: $ct-grid-color;\n\tstroke-width: $ct-grid-width;\n\n\t@if ($ct-grid-dasharray) {\n\t\tstroke-dasharray: $ct-grid-dasharray;\n\t}\n}\n\n@mixin ct-chart-point($ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape) {\n\tstroke-width: $ct-point-size;\n\tstroke-linecap: $ct-point-shape;\n}\n\n@mixin ct-chart-line($ct-line-width: $ct-line-width, $ct-line-dasharray: $ct-line-dasharray) {\n\tfill: none;\n\tstroke-width: $ct-line-width;\n\n\t@if ($ct-line-dasharray) {\n\t\tstroke-dasharray: $ct-line-dasharray;\n\t}\n}\n\n@mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {\n\tstroke: none;\n\tfill-opacity: $ct-area-opacity;\n}\n\n@mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {\n\tfill: none;\n\tstroke-width: $ct-bar-width;\n}\n\n//@mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {\n// fill: none;\n// stroke-width: $ct-donut-width;\n//}\n\n@mixin ct-chart-series-color($color) {\n\t.ct-point, .ct-line, .ct-bar /*, .ct-slice-donut*/\n\t{\n\t\tstroke: $color;\n\t}\n\n\t.ct-slice-pie, .ct-area {\n\t\tfill: $color;\n\t}\n}\n\n@mixin ct-chart(\n\t$ct-container-ratio: $ct-container-ratio,\n\t$ct-text-color: $ct-text-color,\n\t$ct-text-size: $ct-text-size,\n\t$ct-grid-color: $ct-grid-color,\n\t$ct-grid-width: $ct-grid-width,\n\t$ct-grid-dasharray: $ct-grid-dasharray,\n\t$ct-point-size: $ct-point-size,\n\t$ct-point-shape: $ct-point-shape,\n\t$ct-line-width: $ct-line-width,\n\t$ct-bar-width: $ct-bar-width,\n\t//$ct-donut-width: $ct-donut-width,\n\t$ct-series-names: $ct-series-names,\n\t$ct-series-colors: $ct-series-colors) {\n\n\t.ct-zoom-rect {\n\t\tfill: rgba(200, 100, 100, 0.3);\n\t\tstroke: #ff2b12;\n\t}\n\n\t.ct-axis-title {\n\t\tfill: $ct-axis-label-color;\n\t\t@include noselect;\n\t}\n\n\t// --- Label ---\n\t.ct-label {\n\t\t@include ct-chart-label($ct-text-color, $ct-text-size);\n\n\t\t&.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start; // Fallback for browsers that don't support foreignObjects\n\t\t}\n\n\t\t&.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\ttext-anchor: start;\n\n\t\t\t// EDIT: added for angled horiz labels\n\t\t\ttransform: translate(-4px, 0%) rotate(45deg);\n\t\t}\n\n\t\t&.ct-vertical.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-end);\n\t\t\ttext-anchor: end;\n\n\t\t\ttransform: translate(0, 20%);\n\t\t}\n\n\t\t&.ct-vertical.ct-end {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start;\n\t\t}\n\t}\n\n\t.ct-chart-line .ct-label,\n\t.ct-chart-bar .ct-label {\n\t\tdisplay: flex;\n\t}\n\n\t// --- Bar labels ---\n\n\t.ct-chart-bar {\n\t\t.ct-label.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t.ct-label.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t&.ct-horizontal-bars .ct-label {\n\t\t\t&.ct-horizontal.ct-start {\n\t\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-horizontal.ct-end {\n\t\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-start {\n\t\t\t\t//@include ct-chart-label($ct-text-color, $ct-text-size, center, $ct-vertical-text-justify);\n\t\t\t\t@include ct-align-justify(center, flex-end);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-end {\n\t\t\t\t@include ct-align-justify(center, flex-start);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\t\t}\n\t}\n\n\t.ct-grid {\n\t\t@include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);\n\t}\n\n\t.ct-point {\n\t\t@include ct-chart-point($ct-point-size, $ct-point-shape);\n\t}\n\n\t.ct-line {\n\t\t@include ct-chart-line($ct-line-width);\n\t}\n\n\t.ct-with-area .ct-line {\n\t\tstroke-width: 1px;\n\t}\n\n\t.ct-area {\n\t\t@include ct-chart-area();\n\t}\n\n\t.ct-bar {\n\t\t@include ct-chart-bar($ct-bar-width);\n\t}\n\n\t//.ct-slice-donut {\n\t// @include ct-chart-donut($ct-donut-width);\n\t//}\n\n\t@if $ct-include-colored-series {\n\t\t@for $i from 0 to length($ct-series-names) {\n\t\t\t.ct-series-#{nth($ct-series-names, $i + 1)} {\n\t\t\t\t$color: nth($ct-series-colors, $i + 1);\n\t\t\t\t@include ct-chart-series-color($color);\n\t\t\t}\n\t\t}\n\t}\n}\n\n@if $ct-include-classes {\n\t@include ct-chart();\n\n\t@if $ct-include-alternative-responsive-containers {\n\t\t@for $i from 0 to length($ct-scales-names) {\n\t\t\t.#{nth($ct-scales-names, $i + 1)} {\n\t\t\t\t@include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));\n\t\t\t}\n\t\t}\n\t}\n}\n","// Scales for responsive SVG containers\n$ct-scales_orig: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;\n$ct-scales-names_orig: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default;\n\n$ct-scales: ((10/16), (2/3));\n$ct-scales-names: (ct-wide, ct-narrow);\n\n\n// Container ratio\n$ct-container-ratio: (1/1.618) !default;\n\n// Text styles for labels\n$ct-text-color: rgba(white, 0.8) !default;\n$ct-text-size: 0.75rem !default;\n$ct-text-align: flex-start !default;\n$ct-text-justify: flex-start !default;\n$ct-text-line-height: 1;\n\n$ct-axis-label-color: rgba(white, 0.8) !default;\n\n// Grid styles\n$ct-grid-color: rgba(white, 0.3) !default;\n$ct-grid-dasharray: 2px !default;\n$ct-grid-width: 1px !default;\n\n// Line chart properties\n$ct-line-width: 2px !default;\n$ct-line-dasharray: false !default;\n$ct-point-size: 4px !default;\n// Line chart point, can be either round or square\n$ct-point-shape: round !default;\n// Area fill transparency between 0 and 1\n$ct-area-opacity: 0.3 !default;\n\n// Bar chart bar width\n$ct-bar-width: 10px !default;\n\n// Donut width (If donut width is to big it can cause issues where the shape gets distorted)\n$ct-donut-width: 60px !default;\n\n// If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you\n// should set this property to false\n$ct-include-classes: true !default;\n\n// If this is set to true the CSS will contain colored series. You can extend or change the color with the\n// properties below\n$ct-include-colored-series: $ct-include-classes !default;\n\n// If set to true this will include all responsive container variations using the scales defined at the top of the script\n$ct-include-alternative-responsive-containers: $ct-include-classes !default;\n\n// Series names and colors. This can be extended or customized as desired. Just add more series and colors.\n$ct-series-names: (a, b, c, d, e) !default;\n$ct-series-colors: (\n #f05b4f,\n #6188e2,\n #59922b,\n #eacf7d,\n #a748ca\n) !default;\n","\n@mixin click-through() {\n\tpointer-events: none;\n}\n\n\n// Disallow text selection\n@mixin noselect() {\n\t-webkit-user-select: none;\n\t-khtml-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n\n// Allow text selection\n@mixin can-select() {\n\t-webkit-user-select: text;\n\t-khtml-user-select: text;\n\t-moz-user-select: text;\n\t-ms-user-select: text;\n\tuser-select: text;\n\n\tcursor: text;\n}\n","@import \"normalize\";\n@import \"lib/bourbon/bourbon\";\n\n@import \"grid-settings\";\n@import \"lib/neat/neat\";\n\n@import \"utils/index\";\n\n@import \"lib/chartist/chartist\";\n\n$form-label-w: 130px;\n$form-label-gap: 8px;\n$form-field-w: 250px;\n\n$c-form-label-fg: white;\n$c-form-field-bg: #303030;\n$c-form-field-fg: white;\n$c-form-highlight: #217b3a;\n$c-form-highlight-a: #28bc65;\n\n@function dist($x) {\n\t@return modular-scale($x, 1rem, $golden);\n}\n\n@function fsize($x) {\n\t@return modular-scale($x, 1em, $major-second);\n}\n\n.center {\n\ttext-align: center;\n}\n\n.invis {\n\tvisibility: hidden;\n}\n\n.hidden {\n\tdisplay: none;\n}\n\n.nb {\n\tfont-weight: normal;\n}\n\n@import \"layout/index\";\n@import \"form/index\";\n\n// import all our pages\n@import \"pages/wifi\";\n@import \"pages/home\";\n@import \"pages/wfm\";\n@import \"pages/about\";\n\n@include media($tablet-min) {\n\t.mq-phone { display: none; }\n}\n\n@include media($phone) {\n\t.mq-tablet-min { display: none; }\n}\n\n@include media($normal-min) {\n\t.mq-tablet-max { display: none; }\n}\n\n@include media($tablet-max) {\n\t.mq-normal-min { display: none; }\n}\n","html {\n\tfont-family: Arial, sans-serif;\n\tcolor: #D0D0D0;\n\tbackground: #131315;\n}\n\nhtml, body {\n\t@include naked();\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n}\n\na, a:visited, a:link {\n\tcolor: #5abfff;\n\ttext-decoration: none;\n}\n\na:hover {\n\tcolor: #5abfff;\n\ttext-decoration: underline;\n}\n","// Add a highlight for debugging\n@mixin highlight($color) {\n\toutline: 1px solid $color;\n\tbackground: rgba($color, .05);\n\tbox-shadow: 0 0 2px 2px rgba($color, .2), inset 0 0 2px 2px rgba($color, .2);\n}\n\n// Ellipsis, but for block elements\n@mixin block-ellipsis($width: 100%) {\n\tdisplay: block;\n\tmax-width: $width;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n\n// No margins, padding, borders\n@mixin naked() {\n\tborder: 0 none;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-decoration: none;\n}\n\n@mixin translate($x, $y) {\n\t@include transform(translate($x, $y));\n}\n\n// Disallow wrapping\n@mixin nowrap() {\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n","/* Main outer container */\n#outer {\n\tdisplay: flex;\n\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tleft: 0;\n\tright: 0;\n\ttop: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\n\tflex-direction: row;\n}\n\n@include media($phone) {\n\t#outer {\n\t\tdisplay: block;\n\t\toverflow-y: scroll;\n\t}\n}\n","@charset \"UTF-8\";\n\n/// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).\n///\n/// @param {List} $query\n/// A list of media query features and values, where each `$feature` should have a corresponding `$value`.\n/// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).\n///\n/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.\n///\n/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).\n///\n///\n/// @param {Number (unitless)} $total-columns [$grid-columns]\n/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.\n///\n/// @example scss - Usage\n/// .responsive-element {\n/// @include media(769px) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// .new-context-element {\n/// @include media(min-width 320px max-width 480px, 6) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// @example css - CSS Output\n/// @media screen and (min-width: 769px) {\n/// .responsive-element {\n/// display: block;\n/// float: left;\n/// margin-right: 2.35765%;\n/// width: 48.82117%;\n/// }\n///\n/// .responsive-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n///\n/// @media screen and (min-width: 320px) and (max-width: 480px) {\n/// .new-context-element {\n/// display: block;\n/// float: left;\n/// margin-right: 4.82916%;\n/// width: 100%;\n/// }\n///\n/// .new-context-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n\n@mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {\n @if length($query) == 1 {\n @media screen and ($default-feature: nth($query, 1)) {\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n } @else {\n $loop-to: length($query);\n $media-query: \"screen and \";\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n\n @if is-not(is-even(length($query))) {\n $grid-columns: nth($query, $loop-to) !global;\n $loop-to: $loop-to - 1;\n }\n\n $i: 1;\n @while $i <= $loop-to {\n $media-query: $media-query + \"(\" + nth($query, $i) + \": \" + nth($query, $i + 1) + \") \";\n\n @if ($i + 1) != $loop-to {\n $media-query: $media-query + \"and \";\n }\n\n $i: $i + 2;\n }\n\n @media #{$media-query} {\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n }\n}\n","#menu {\n\t$menu-bg: #2bab5f;\n\n\tflex: 0 0 15rem;\n\tbackground: $menu-bg;\n\n\t& > * {\n\t\tdisplay: block;\n\t\ttext-decoration: none;\n\t\tpadding: dist(-1) dist(0);\n\n\t\t@include nowrap;\n\t\t@include noselect;\n\t}\n\n\t#brand {\n\t\tcolor: white;\n\t\tbackground: darken($menu-bg, 10%);\n\t\tfont-size: 120%;\n\t\ttext-align: center;\n\t\tposition:relative;\n\n\t\tmargin-bottom: dist(0);\n\n\t\t@include media($phone) {\n\t\t\tbackground: $menu-bg;\n\t\t\tcursor: pointer;\n\n\t\t\t&:after {\n\t\t\t\tposition: absolute;\n\t\t\t\tcolor: rgba(black, .2);\n\t\t\t\tright: dist(0);\n\t\t\t\tcontent: '>';\n\t\t\t\ttop:50%;\n\t\t\t\tfont-size: 120%;\n\t\t\t\tfont-weight: bold;\n\t\t\t\ttransform: translate(0,-50%) rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t&.expanded #brand {\n\t\tbackground: darken($menu-bg, 10%);\n\n\t\t@include media($phone) {\n\t\t\t&:after { transform: translate(0,-50%) rotate(-90deg) }\n\t\t}\n\t}\n\n\n\ta {\n\t\tfont-size: 130%;\n\t\tcolor: white;\n\n\t\t$hl: #1bd886;\n\t\ttransition: background-color 0.2s;\n\t\ttext-shadow: 0 0 5px rgba(black, .4);\n\n\t\t&:hover, &.selected {\n\t\t\tbackground: $hl;\n\t\t\ttext-shadow: 0 0 5px rgba(black, .6);\n\t\t}\n\n\t\t&.selected {\n\t\t\tposition: relative;\n\t\t\tbox-shadow: 0 0 5px rgba(black, .5);\n\t\t}\n\n\t\t&:before {\n\t\t\tcontent: \"▸\";\n\t\t\tpadding-right: .5rem;\n\t\t\tposition: relative;\n\t\t\ttop: -0.1rem;\n\t\t}\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.expanded a { display:block }\n\n\t@include media($tablet) {\n\t\t#brand {\n\t\t\tfont-size: 95%;\n\t\t\tmargin-bottom: dist(-1);\n\t\t}\n\n\t\ta { font-size: 105%; }\n\n\t\tflex-basis: 10rem;\n\n\t\t& > * { padding: dist(-2) dist(-1);\t}\n\t}\n}\n","// Scaling Variables\n$golden: 1.618;\n$minor-second: 1.067;\n$major-second: 1.125;\n$minor-third: 1.2;\n$major-third: 1.25;\n$perfect-fourth: 1.333;\n$augmented-fourth: 1.414;\n$perfect-fifth: 1.5;\n$minor-sixth: 1.6;\n$major-sixth: 1.667;\n$minor-seventh: 1.778;\n$major-seventh: 1.875;\n$octave: 2;\n$major-tenth: 2.5;\n$major-eleventh: 2.667;\n$major-twelfth: 3;\n$double-octave: 4;\n\n$modular-scale-ratio: $perfect-fourth !default;\n$modular-scale-base: em($em-base) !default;\n\n@function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {\n $v1: nth($value, 1);\n $v2: nth($value, length($value));\n $value: $v1;\n\n // scale $v2 to just above $v1\n @while $v2 > $v1 {\n $v2: ($v2 / $ratio); // will be off-by-1\n }\n @while $v2 < $v1 {\n $v2: ($v2 * $ratio); // will fix off-by-1\n }\n\n // check AFTER scaling $v2 to prevent double-counting corner-case\n $double-stranded: $v2 > $v1;\n\n @if $increment > 0 {\n @for $i from 1 through $increment {\n @if $double-stranded and ($v1 * $ratio) > $v2 {\n $value: $v2;\n $v2: ($v2 * $ratio);\n } @else {\n $v1: ($v1 * $ratio);\n $value: $v1;\n }\n }\n }\n\n @if $increment < 0 {\n // adjust $v2 to just below $v1\n @if $double-stranded {\n $v2: ($v2 / $ratio);\n }\n\n @for $i from $increment through -1 {\n @if $double-stranded and ($v1 / $ratio) < $v2 {\n $value: $v2;\n $v2: ($v2 / $ratio);\n } @else {\n $v1: ($v1 / $ratio);\n $value: $v1;\n }\n }\n }\n\n @return $value;\n}\n","#content {\n\tflex-grow: 1;\n\tposition: relative;\n\n\tpadding: dist(0);\n\t@include media($phone) {\n\t\tpadding: dist(-1);\n\t}\n\n\toverflow-y: auto;\n\n\t& > * {\n\t\tmargin-left: auto;\n\t\tmargin-right: auto;\n\t}\n\n\th1 {\n\t\ttext-align: center;\n\t\tfont-size: fsize(7);\n\t\tmargin-top: 0;\n\t\tmargin-bottom: dist(0);\n\t}\n\n\th2 {\n\t\tfont-size: fsize(3);\n\t\tmargin-bottom: dist(-1);\n\t}\n\n\ttd, th {\n\t\tpadding: dist(-2);\n\t}\n\n\ttbody th {\n\t\ttext-align: right;\n\t\twidth: $form-label-w;\n\t\tcolor: $c-form-label-fg;\n\t}\n}\n\n// Loader wheel in top right corner\n#loader {\n\tposition: absolute;\n\tright: dist(1);\n\ttop: dist(1);\n\n\ttransition: opacity .2s;\n\topacity: 0;\n\n\t@include media($phone) {\n\t\ttop: dist(0);\n\t\tright: dist(0);\n\t}\n\n\t&.show {\n\t\topacity:1;\n\t}\n}\n",".Box {\n\tdisplay: block;\n\tmax-width: 900px;\n\n\tmargin-top: dist(0);\n\tpadding: dist(-1) dist(0);\n\n\t@include media($phone) {\n\t\tmargin-top: dist(-1);\n\t}\n\n\th1 + & {\n\t\tmargin-top: 0;\n\t}\n\n\th2 {\n\t\tmargin-top: 0;\n\t}\n\n\tborder-radius: 3px;\n\tbackground-color: rgba(white, .07);\n\n\t&.wide {\n\t\twidth: initial;\n\t\tmax-width: initial;\n\t}\n\n\t&.medium {\n\t\tmax-width: 1200px;\n\t}\n\n\t.Valfield {\n\t\tdisplay: inline-block;\n\t\tmin-width: 10em;\n\t}\n}\n",".Modal {\n\tposition: fixed;\n\twidth: 100%; height: 100%;\n\tleft: 0; top: 0; right: 0; bottom: 0;\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\n\ttransition: opacity .5s;\n\tbackground: rgba(black, .65);\n\topacity: 0;\n\t&.visible { opacity: 1 }\n\t&.hidden { display: none }\n}\n\n.Dialog {\n\tmargin: dist(-1);\n\tpadding: dist(0);\n\toverflow: hidden;\n\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tflex: 0 1 30rem;\n\t//min-height: 15rem;\n\n\tbackground: #1c1c1e;\n\tborder-left: 6px solid $c-form-highlight;\n\tborder-right: 6px solid $c-form-highlight;\n\tbox-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n\n\tborder-radius: 6px;\n\n\th1,h2 {\n\t\tmargin-top:0;\n\t}\n\n\tp:last-child {\n\t\tmargin-bottom: 0;\n\t}\n}\n\n// \"toast\"\n.ErrMsg {\n\tposition: fixed;\n\tbottom: dist(2);\n\tpadding: dist(-1) dist(0);\n\n\t// center horizontally\n\tleft: 50%;\n\t@include translate(-50%,0);\n\t// hack to remove blur in chrome\n\t-webkit-font-smoothing: subpixel-antialiased;\n\t-webkit-transform: translateZ(0) scale(1.0, 1.0);\n\n\tbackground: #d03e42;\n\tcolor: white;\n\ttext-shadow: 0 0 2px black;\n\tbox-shadow: 0 0 6px 0 rgba(black, .6);\n\tborder-radius: 5px;\n\n\tmax-width: 80%;\n\n\t@include media($phone) {\n\t\twidth: calc(100% - #{dist(0)});\n\t}\n\n\ttransition: opacity .5s;\n\topacity: 0;\n\t&.visible { opacity: 1 }\n\t&.hidden { display: none }\n}\n","@charset \"UTF-8\";\n\n/// A mixin for generating vendor prefixes on non-standardized properties.\n///\n/// @param {String} $property\n/// Property to prefix\n///\n/// @param {*} $value\n/// Value to use\n///\n/// @param {List} $prefixes\n/// Prefixes to define\n///\n/// @example scss - Usage\n/// .element {\n/// @include prefixer(border-radius, 10px, webkit ms spec);\n/// }\n///\n/// @example css - CSS Output\n/// .element {\n/// -webkit-border-radius: 10px;\n/// -moz-border-radius: 10px;\n/// border-radius: 10px;\n/// }\n///\n/// @require {variable} $prefix-for-webkit\n/// @require {variable} $prefix-for-mozilla\n/// @require {variable} $prefix-for-microsoft\n/// @require {variable} $prefix-for-opera\n/// @require {variable} $prefix-for-spec\n\n@mixin prefixer($property, $value, $prefixes) {\n @each $prefix in $prefixes {\n @if $prefix == webkit {\n @if $prefix-for-webkit {\n -webkit-#{$property}: $value;\n }\n } @else if $prefix == moz {\n @if $prefix-for-mozilla {\n -moz-#{$property}: $value;\n }\n } @else if $prefix == ms {\n @if $prefix-for-microsoft {\n -ms-#{$property}: $value;\n }\n } @else if $prefix == o {\n @if $prefix-for-opera {\n -o-#{$property}: $value;\n }\n } @else if $prefix == spec {\n @if $prefix-for-spec {\n #{$property}: $value;\n }\n } @else {\n @warn \"Unrecognized prefix: #{$prefix}\";\n }\n }\n}\n\n@mixin disable-prefix-for-all() {\n $prefix-for-webkit: false !global;\n $prefix-for-mozilla: false !global;\n $prefix-for-microsoft: false !global;\n $prefix-for-opera: false !global;\n $prefix-for-spec: false !global;\n}\n","@import \"fancy_button_mixins\";\n\n#{$all-buttons}, .button {\n\t@include fancy-btn-base();\n\n\t// fontello\n/*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n\n\t&.narrow {\n\t\tmin-width: initial;\n\t}\n\n\ttext-shadow: 1.5px 1.5px 2px rgba(black, 0.8);\n}\n\n\n\n\n$btn-gray-f: #DDDDDD;\n$btn-gray-b: #505050;\n$btn-gray-l: #343434; // line\n\n$btn-green-f: #FEFEFE;\n$btn-green-b: #2ca94b;\n$btn-green-fa: #FEFEFE;\n$btn-green-ba: #28ba5c;\n\n$btn-red-f: #FEFEFE;\n$btn-red-b: #D04E51;\n$btn-red-fa: #FEFEFE;\n$btn-red-ba: #d4403f;\n\n$btn-blue-f: #FEFEFE;\n$btn-blue-b: #3983cd;\n$btn-blue-fa: #FEFEFE;\n$btn-blue-ba: #2076C6;\n\n$btn-orange-f: #FEFEFE;\n$btn-orange-b: #dd8751;\n$btn-orange-fa: #FEFEFE;\n$btn-orange-ba: #C6733F;\n\n\ninput[type=\"submit\"], .btn-green {\n\t@include fancy-btn-colors($btn-green-f, $btn-green-b, $btn-green-fa, $btn-green-ba)\n}\n\ninput[type=\"reset\"], .btn-red {\n\t@include fancy-btn-colors($btn-red-f, $btn-red-b, $btn-red-fa, $btn-red-ba)\n}\n\n&.btn-blue {@include fancy-btn-colors($btn-blue-f, $btn-blue-b, $btn-blue-fa, $btn-blue-ba)}\n//&, &.orange {@include fancy-btn-colors($btn-orange-f, $btn-orange-b, $btn-orange-fa, $btn-orange-ba)}\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\n","\n// Button styling\n@mixin fancy-btn-base() {\n\ttext-align: center;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tborder-radius: 2px;\n\tpadding: 0 0.6em;\n\tborder: 0 none;\n\toutline: 0 none !important;\n\tline-height: 1.8em;\n\tfont-size: 1.1em;\n\tmargin-bottom: 3px;\n\tmin-width: 5em;\n\n\t@include noselect();\n\n\t//&[class^=\"icon-\"]::before, &[class*=\" icon-\"]::before {\n\t//\tmargin-left:0;\n\t//}\n\n\t&:active {\n\t\tposition: relative;\n\t\ttop: 2px;\n\t}\n\n\t//&, &:active, &:hover, &:visited {\n\t//\ttext-decoration: none;\n\t//}\n}\n\n@mixin fancy-btn-colors-full($text_p, $back_p, $side_p, $text_a, $back_a, $side_a) {\n\tbackground-color: $back_p;\n\tbox-shadow: 0 3px 0 $side_p;\n\ttext-decoration: none !important;\n\n\t&, &:link, &:visited {\n\t\tcolor: $text_p;\n\t}\n\n\t&:hover, &:active, &.active, &.selected {\n\t\tbackground-color: $back_a;\n\t\tcolor: $text_a;\n\t}\n\n\t&:hover, &.selected, &.active {\n\t\tbox-shadow: 0 3px 0 $side_a;\n\t}\n\n\t// thinner shadow\n\t&:active {\n\t\tbox-shadow: 0 1px 0 $side_a;\n\t}\n}\n\n@mixin fancy-btn-colors($text_p, $back_p, $text_a, $back_a) {\n\t@include fancy-btn-colors-full($text_p, $back_p, darken($back_p, 14), $text_a, $back_a, darken($back_a, 16));\n}\n","@import \"buttons\";\n\n#{$all-text-inputs}, select {\n\tborder: 0 none;\n\tborder-bottom: 2px solid $c-form-highlight;\n\tbackground-color: $c-form-field-bg;\n\tcolor: $c-form-field-fg;\n\tpadding: 6px;\n\tline-height: 1em;\n\toutline: 0 none !important;\n\t-moz-outline: 0 none !important;\n\tfont-weight: normal;\n\n\t&:focus, &:hover {\n\t\tborder-bottom-color: $c-form-highlight-a;\n\t}\n}\n\n#{$all-text-inputs} {\n\t@include can-select();\n}\n\ntextarea {\n\tfont-family: monospace;\n\tline-height: 1.2em;\n\tdisplay: block; // fixes weird bottom margin\n}\n\n@import \"select\";\n","\n// target chrome only\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n\tselect { padding-right: 18px }\n}\n\nselect {\n\t-webkit-appearance: none;\n\t-moz-appearance: none;\n\tappearance: none;\n\n\tcursor: pointer;\n\tline-height: 1.2em;\n\t//padding: 3.5px;\n\n\tpadding-right: 1em;\n\n\t// hack for firefox to disable dotted outline\n\t&:-moz-focusring {\n\t\tcolor: transparent;\n\t\ttext-shadow: 0 0 0 $c-form-field-fg;\n\t}\n\n\toption {\n\t\tbackground: $c-form-field-bg;\n\t}\n}\n\nlabel.select-wrap {\n\tposition: relative;\n\tdisplay: inline !important;\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n\twidth: auto !important;\n\n\t&:after {\n\t\tcontent: '<>'; /* will be rotated */\n\t\tfont-family: \"Consolas\", monospace;\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-highlight-a;\n\n\t\ttop: 50%;\n\t\t@include transform(translate(0, -50%) rotate(90deg));\n\n\t\tright: 2px;\n\n\t\tposition:absolute;\n\t\tz-index: 100;\n\n\t\tpointer-events: none;\n\t}\n}\n","// Unified Form wrapper\nform { @include naked(); }\n\n#{$all-text-inputs}, select, label.select-wrap {\n\twidth: $form-field-w;\n}\n\nform .Row {\n\tvertical-align: middle;\n\tmargin: 14px auto;\n\ttext-align: left;\n\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&:first-child {\n\t\tmargin-top: 0;\n\t}\n\n\t&:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.spacer {\n\t\twidth: $form-label-w;\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.buttons {\n\t\tinput, .button {\n\t\t\tmargin-right: dist(-1);\n\t\t}\n\t}\n\n\t&.centered {\n\t\tjustify-content: center;\n\t}\n\n\t&.message {\n\t\tfont-size: 1em;\n\t\t//margin-left: $label-gap + $w-labels;\n\t\ttext-shadow: 1px 1px 3px black;\n\t\ttext-align: center;\n\n\t\t&.error {\n\t\t\tcolor: crimson;\n\t\t}\n\n\t\t&.ok {\n\t\t\tcolor: #0fe851;\n\t\t}\n\t}\n\n\t&.separator {\n\t\tpadding-top: 14px;\n\t\tborder-top: 2px solid rgba(255, 255, 255, 0.1);\n\t}\n\n\ttextarea {\n\t\tdisplay: inline-block;\n\t\tvertical-align: top;\n\t\tmin-height: 10rem;\n\t\tflex-grow: 1;\n\n\t\tresize: vertical;\n\t}\n\n\tlabel {\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-label-fg;\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\ttext-align: right;\n\t\ttext-shadow: 1px 1px 3px black;\n\n\t\tpadding: $form-label-gap;\n\t\talign-self: flex-start;\n\n\t\t@include noselect;\n\t}\n\n\t.checkbox-wrap {\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\tpadding: $form-label-gap;\n\t\ttext-align: right;\n\t\talign-self: flex-start;\n\n\t\tinput[type=checkbox] {\n\t\t\tmargin: auto;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\n\t\t& + label {\n\t\t\twidth: $form-field-w;\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t// special phone style\n\t@include media($phone) {\n\t\tflex-direction: column;\n\n\t\t&.buttons, &.centered {\n\t\t\tflex-direction: row;\n\t\t}\n\n\t\t&.buttons {\n\t\t\tjustify-content: center;\n\n\t\t\t// remove margin on lats button\n\t\t\t:last-child {\n\t\t\t\tmargin-right:0;\n\t\t\t}\n\t\t}\n\n\t\tlabel {\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\twidth: auto;\n\t\t}\n\n\t\t.checkbox-wrap {\n\t\t\torder: 1;\n\t\t\ttext-align: left;\n\t\t\tpadding-bottom: 0;\n\n\t\t\tborder-radius: .4px;\n\t\t\twidth: auto;\n\n\t\t\t& + label {\n\t\t\t\twidth: auto;\n\t\t\t}\n\t\t}\n\n\t\t#{$all-text-inputs}, textarea {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n}\n\n// red asterisk\nform span.required {\n\tcolor: red;\n}\n\n.RadioGroup {\n\tdisplay: inline-block;\n\tline-height: 1.5em;\n\tvertical-align: middle;\n\n\tlabel {\n\t\twidth: auto;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t\tfont-weight: normal;\n\t}\n\n\tinput[type=\"radio\"] {\n\t\tvertical-align: middle;\n\t\tmargin: 0 0 0 5px;\n\t}\n}\n","#ap-list {\n\tcolumn-count: 3;\n\tcolumn-gap: 0;\n\n\t@include media($tablet) {\n\t\tcolumn-count: 2;\n\t}\n\n\t@include media($phone) {\n\t\tcolumn-count: 1;\n\t}\n\n\tmargin: 0 (- dist(-3));\n}\n\n#ap-loader {\n\tbackground: rgba(white, .1);\n\tborder-radius: 5px;\n\tpadding: dist(-2);\n\tmargin-bottom: dist(-2);\n}\n\n#ap-box {\n\tpadding-bottom: dist(-2);\n}\n\n\n#psk-modal form {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: dist(-2);\n\n\t& > * {\n\t\tmargin-left: dist(-2);\n\t\tmargin-right: dist(-2);\n\t\t&:first-child { margin-left: 0 }\n\t\t&:last-child { margin-right: 0 }\n\t}\n\n\tinput[type=password] {\n\t\tmin-width: 5rem;\n\t}\n}\n\n.AP {\n\t// can't use margins inside a column\n\n\tbreak-inside: avoid-column;\n\tmax-width: 500px;\n\tpadding: dist(-3);\n\n\t&.selected .inner {//#70dfa3\n\t\tbackground: #43de81 !important; // override the hover effect\n\t\tcursor: default;\n\t\ttop: 0 !important; // no click effect\n\t}\n\n\t// the actual silver box\n\t.inner {\n\t\tcursor: pointer;\n\t\t@include noselect;\n\n\t\tposition: relative;\n\t\t&:active {\n\t\t\tleft: 0;\n\t\t\ttop: 1px;\n\t\t}\n\n\t\tborder-radius: 3px;\n\t\tcolor: #222;\n\n\t\tbackground: #afafaf;\n\t\ttransition: background-color 0.5s;\n\t\t&:hover { background: white }\n\n\t\tdisplay: flex;\n\n\t\t& > * {\n\t\t\tpadding: dist(-1);\n\t\t\t@include nowrap;\n\t\t}\n\n\t\t.rssi {\n\t\t\tmin-width: 2rem;\n\t\t\tflex: 0 0 15%;\n\t\t\ttext-align: right;\n\n\t\t\t&:after {\n\t\t\t\tpadding-left: dist(-5);\n\t\t\t\tcontent: '%';\n\t\t\t\tfont-size: fsize(-1);\n\t\t\t}\n\t\t}\n\n\t\t.essid {\n\t\t\tflex: 1 1 70%;\n\t\t\tmin-width: 0;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\t.auth {\n\t\t\tflex: 0 0 15%;\n\t\t}\n\t}\n}\n",".page-home #staRSSIperc:after {\n\tpadding-left: dist(-4);\n\tcontent: '%';\n\tfont-size: fsize(-1);\n}\n\n.page-home #staRSSI:after {\n\tpadding-left: dist(-4);\n\tcontent: 'dBm';\n\tfont-size: fsize(-1);\n}\n","#samp-ctrl {\n\tdisplay: flex;\n\tpadding: dist(-2);\n\n\tflex-direction: row;\n\t@include media($phone) {\n\t\tflex-direction: column;\n\t}\n\n\tjustify-content: center;\n\talign-items: stretch;\n\n\t> div {\n\t\tmargin: dist(-2) dist(-1);\n\t}\n\n\tlabel {\n\t\tline-height: 1.8;\n\t\tfont-weight: bold;\n\t}\n\n\tinput,select {\n\t\twidth: 6em;\n\n\t\t@include media($phone) {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t// -- spectrogram --\n\n\t#tile-cfg input {\n\t\twidth: 3em;\n\t}\n\n\t#interval {\n\t\twidth: 4.5em;\n\t}\n}\n\n.Box.chartbox {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t@include media($phone) {\n\t\tflex-direction: column;\n\t}\n\n\t.stats {\n\t\tflex: 0 1;\n\t\tposition: relative;\n\n\t\t@include media($phone) {\n\t\t\ttable {\n\t\t\t\tmargin: 0 auto;\n\t\t\t} // center the table\n\n\t\t\ttd,th {\n\t\t\t\twidth: 50%;\n\t\t\t}\n\t\t}\n\n\t\tth,td {\n\t\t\t@include nowrap;\n\t\t}\n\n\t\tth sub { font-weight: normal;}\n\n\t\ttd {\n\t\t\tmin-width: 100px;\n\t\t}\n\n\t\ttd:after {\n\t\t\tfont-size: 90%;\n\t\t\tpadding-left: .5em;\n\t\t}\n\n\t\t//#stat-count\n\t\t#stat-f-s:after {content: \"Hz\"}\n\t\t#stat-i-peak:after {content: \"mA\"}\n\t\t#stat-i-rms:after {content: \"mA\"}\n\n\t\tpadding-bottom: 50px;\n\n\t\t// auto reload box\n\t\t.ar {\n\t\t\tposition: absolute;\n\t\t\tbottom:dist(-2);\n\t\t\twidth:100%;\n\t\t\ttext-align: center;\n\n\t\t\tinput[type=number] {\n\t\t\t\twidth: 4em;\n\t\t\t}\n\n\t\t\tinput[type=button] {\n\t\t\t\tmargin-left: dist(-2);\n\t\t\t}\n\t\t}\n\t}\n}\n",".page-about {\n\t.Box {\n\t\tpadding-left:dist(0);\n\t\tpadding-right:dist(0);\n\n\t\ta {font-weight: bold;}\n\t}\n\n\t#logo {\n\t\tfloat:right;\n\t\theight: 130px;\n\t}\n\n\t#logo2 {\n\t\tmax-width: 150px;\n\t}\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/html_src/gulpfile.js b/html_src/gulpfile.js index 80eb051..41969bf 100644 --- a/html_src/gulpfile.js +++ b/html_src/gulpfile.js @@ -5,7 +5,7 @@ elixir.config.css.autoprefix.options.browsers = ["> 2.5% in CZ"]; elixir.config.css.autoprefix.options.flexbox = "no-2009"; elixir.config.css.cssnano.pluginOptions.discardComments = {removeAll: true}; elixir.config.css.cssnano.pluginOptions.colormin = false; -elixir.config.js.uglify.options.compress.drop_console = false; +//elixir.config.js.uglify.options.compress.drop_console = false; // var info = autoprefixer(elixir.config.css.autoprefix).info(); // console.log(info); diff --git a/html_src/js/all.js b/html_src/js/all.js index c2f2c91..96e8374 100644 --- a/html_src/js/all.js +++ b/html_src/js/all.js @@ -1,3 +1,9439 @@ -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=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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=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-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();++en)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(;++ie&&(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);++re?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-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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},gn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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=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=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=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}(); \ No newline at end of file +/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */ + +// MODIFIED VERSION. +(function () { + 'use strict'; + + var readyfn = [], + loadedfn = [], + domready = false, + pageloaded = false, + d = document, + w = window; + + // Fire any function calls on ready event + function fireReady() { + var i; + domready = true; + for (i = 0; i < readyfn.length; i += 1) { + readyfn[i](); + } + readyfn = []; + } + + // Fire any function calls on loaded event + function fireLoaded() { + var i; + pageloaded = true; + // For browsers with no DOM loaded support + if (!domready) { + fireReady(); + } + for (i = 0; i < loadedfn.length; i += 1) { + loadedfn[i](); + } + loadedfn = []; + } + + // Check DOM ready, page loaded + if (d.addEventListener) { + // Standards + d.addEventListener('DOMContentLoaded', fireReady, false); + w.addEventListener('load', fireLoaded, false); + } else if (d.attachEvent) { + // IE + d.attachEvent('onreadystatechange', fireReady); + // IE < 9 + w.attachEvent('onload', fireLoaded); + } else { + // Anything else + w.onload = fireLoaded; + } + + // Utility functions + + // Loop through node array + function nodeLoop(fn, nodes) { + var i; + // Good idea to walk up the DOM + for (i = nodes.length - 1; i >= 0; i -= 1) { + fn(nodes[i]); + } + } + + // Convert to camel case + function cssCamel(property) { + return property.replace(/-\w/g, function (result) { + return result.charAt(1).toUpperCase(); + }); + } + + // Get computed style + function computeStyle(elm, property) { + // IE, everything else or null + return (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null; + + } + + // Returns URI encoded query string pair + function queryPair(name, value) { + return encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+'); + } + + // Set CSS, important to wrap in try to prevent error thown on unsupported property + function setCss(elm, property, value) { + try { + elm.style[cssCamel(property)] = value; + } catch (e) { + } + } + + // Show CSS + function showCss(elm) { + elm.style.display = ''; + // For elements still hidden by style block + if (computeStyle(elm, 'display') === 'none') { + elm.style.display = 'block'; + } + } + + // Serialize form & JSON values + function serializeData(nodes) { + var querystring = '', subelm, i, j; + if (nodes.constructor === Object) { // Serialize JSON data + for (subelm in nodes) { + if (nodes.hasOwnProperty(subelm)) { + if (nodes[subelm].constructor === Array) { + for (i = 0; i < nodes[subelm].length; i += 1) { + querystring += '&' + queryPair(subelm, nodes[subelm][i]); + } + } else { + querystring += '&' + queryPair(subelm, nodes[subelm]); + } + } + } + } else { // Serialize node data + nodeLoop(function (elm) { + if (elm.nodeName === 'FORM') { + for (i = 0; i < elm.elements.length; i += 1) { + subelm = elm.elements[i]; + + if (!subelm.disabled) { + switch (subelm.type) { + // Ignore buttons, unsupported XHR 1 form fields + case 'button': + case 'image': + case 'file': + case 'submit': + case 'reset': + break; + + case 'select-one': + if (subelm.length > 0) { + querystring += '&' + queryPair(subelm.name, subelm.value); + } + break; + + case 'select-multiple': + for (j = 0; j < subelm.length; j += 1) { + if (subelm[j].selected) { + querystring += '&' + queryPair(subelm.name, subelm[j].value); + } + } + break; + + case 'checkbox': + case 'radio': + if (subelm.checked) { + querystring += '&' + queryPair(subelm.name, subelm.value); + } + break; + + // Everything else including shinny new HTML5 input types + default: + querystring += '&' + queryPair(subelm.name, subelm.value); + } + } + } + } + }, nodes); + } + // Tidy up first & + return (querystring.length > 0) ? querystring.substring(1) : ''; + } + + // Class helper + function classHelper(classes, action, nodes) { + var classarray, search, i, has = false; + if (classes) { + // Trim any whitespace + classarray = classes.split(/\s+/); + nodeLoop(function (elm) { + for (i = 0; i < classarray.length; i += 1) { + search = new RegExp('\\b' + classarray[i] + '\\b', 'g'); + if (action === 'remove') { + elm.className = elm.className.replace(search, ''); + } else if (action === 'toggle') { + elm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i]; + } else if (action === 'has') { + if (elm.className.match(search)) { + has = true; + break; + } + } + } + }, nodes); + } + return has; + } + + // HTML insertion helper + function insertHtml(value, position, nodes) { + var tmpnodes, tmpnode; + if (value) { + nodeLoop(function (elm) { + // No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead + // Convert string to node. We can't innerHTML on a document fragment + tmpnodes = d.createElement('div'); + tmpnodes.innerHTML = value; + while ((tmpnode = tmpnodes.lastChild) !== null) { + // Catch error in unlikely case elm has been removed + try { + if (position === 'before') { + elm.parentNode.insertBefore(tmpnode, elm); + } else if (position === 'after') { + elm.parentNode.insertBefore(tmpnode, elm.nextSibling); + } else if (position === 'append') { + elm.appendChild(tmpnode); + } else if (position === 'prepend') { + elm.insertBefore(tmpnode, elm.firstChild); + } + } catch (e) { + break; + } + } + }, nodes); + } + } + + // Get nodes and return chibi + function chibi(selector) { + var cb, nodes = [], json = false, nodelist, i; + + if (selector) { + + // Element node, would prefer to use (selector instanceof HTMLElement) but no IE support + if (selector.nodeType && selector.nodeType === 1) { + nodes = [selector]; // return element as node list + } else if (typeof selector === 'object') { + // JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support + json = (typeof selector.length !== 'number'); + nodes = selector; + } else if (typeof selector === 'string') { + + // A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector) + + // IE < 8 + if (!d.querySelectorAll) { + // Polyfill querySelectorAll + d.querySelectorAll = function (selector) { + + var style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i; + + style = d.createElement('STYLE'); + style.type = 'text/css'; + + if (style.styleSheet) { + style.styleSheet.cssText = selector + ' {a:b}'; + + head.appendChild(style); + + allnodes = d.getElementsByTagName('*'); + + for (i = 0; i < allnodes.length; i += 1) { + if (computeStyle(allnodes[i], 'a') === 'b') { + selectednodes.push(allnodes[i]); + } + } + + head.removeChild(style); + } + + return selectednodes; + }; + } + + nodelist = d.querySelectorAll(selector); + + // Convert node list to array so results have full access to array methods + // Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway + for (i = 0; i < nodelist.length; i += 1) { + nodes[i] = nodelist[i]; + } + + } + } + + // Only attach nodes if not JSON + cb = json ? {} : nodes; + + // Public functions + + // Fire on DOM ready + cb.ready = function (fn) { + if (fn) { + if (domready) { + fn(); + return cb; + } else { + readyfn.push(fn); + } + } + }; + // Fire on page loaded + cb.loaded = function (fn) { + if (fn) { + if (pageloaded) { + fn(); + return cb; + } else { + loadedfn.push(fn); + } + } + }; + // Executes a function on nodes + cb.each = function (fn) { + if (typeof fn === 'function') { + nodeLoop(function (elm) { + // <= IE 8 loses scope so need to apply + return fn.apply(elm, arguments); + }, nodes); + } + return cb; + }; + // Find first + cb.first = function () { + return chibi(nodes.shift()); + }; + // Find last + cb.last = function () { + return chibi(nodes.pop()); + }; + // Find odd + cb.odd = function () { + var odds = [], i; + for (i = 0; i < nodes.length; i += 2) { + odds.push(nodes[i]); + } + return chibi(odds); + }; + // Find even + cb.even = function () { + var evens = [], i; + for (i = 1; i < nodes.length; i += 2) { + evens.push(nodes[i]); + } + return chibi(evens); + }; + // Hide node + cb.hide = function () { + nodeLoop(function (elm) { + elm.style.display = 'none'; + }, nodes); + return cb; + }; + // Show node + cb.show = function () { + nodeLoop(function (elm) { + showCss(elm); + }, nodes); + return cb; + }; + // Toggle node display + cb.toggle = function (state) { + if (typeof state != 'undefined') { // ADDED + if (state) + cb.show(); + else + cb.hide(); + } else { + nodeLoop(function (elm) { + // computeStyle instead of style.display == 'none' catches elements that are hidden via style block + if (computeStyle(elm, 'display') === 'none') { + showCss(elm); + } else { + elm.style.display = 'none'; + } + + }, nodes); + } + return cb; + }; + // Remove node + cb.remove = function () { + nodeLoop(function (elm) { + // Catch error in unlikely case elm has been removed + try { + elm.parentNode.removeChild(elm); + } catch (e) { + } + }, nodes); + return chibi(); + }; + // Get/Set CSS + cb.css = function (property, value) { + if (property) { + if (value || value === '') { + nodeLoop(function (elm) { + setCss(elm, property, value); + }, nodes); + return cb; + } + if (nodes[0]) { + if (nodes[0].style[cssCamel(property)]) { + return nodes[0].style[cssCamel(property)]; + } + if (computeStyle(nodes[0], property)) { + return computeStyle(nodes[0], property); + } + } + } + }; + // Get class(es) + cb.getClass = function () { + if (nodes[0] && nodes[0].className.length > 0) { + // Weak IE trim support + return nodes[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '').replace(/\s+/, ' '); + } + }; + // Set (replaces) classes + cb.setClass = function (classes) { + if (classes || classes === '') { + nodeLoop(function (elm) { + elm.className = classes; + }, nodes); + } + return cb; + }; + // Add class + cb.addClass = function (classes) { + if (classes) { + nodeLoop(function (elm) { + elm.className += ' ' + classes; + }, nodes); + } + return cb; + }; + // Remove class + cb.removeClass = function (classes) { + classHelper(classes, 'remove', nodes); + return cb; + }; + // Toggle class + cb.toggleClass = function (classes) { + classHelper(classes, 'toggle', nodes); + return cb; + }; + // Has class + cb.hasClass = function (classes) { + return classHelper(classes, 'has', nodes); + }; + // Get/set HTML + cb.html = function (value) { + if (value || value === '') { + nodeLoop(function (elm) { + elm.innerHTML = value; + }, nodes); + return cb; + } + if (nodes[0]) { + return nodes[0].innerHTML; + } + }; + // Insert HTML before selector + cb.htmlBefore = function (value) { + insertHtml(value, 'before', nodes); + return cb; + }; + // Insert HTML after selector + cb.htmlAfter = function (value) { + insertHtml(value, 'after', nodes); + return cb; + }; + // Insert HTML after selector innerHTML + cb.htmlAppend = function (value) { + insertHtml(value, 'append', nodes); + return cb; + }; + // Insert HTML before selector innerHTML + cb.htmlPrepend = function (value) { + insertHtml(value, 'prepend', nodes); + return cb; + }; + // Get/Set HTML attributes + cb.attr = function (property, value) { + if (property) { + property = property.toLowerCase(); + // IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway + if (typeof value !== 'undefined') {//FIXED BUG HERE + nodeLoop(function (elm) { + if (property === 'style') { + elm.style.cssText = value; + } else if (property === 'class') { + elm.className = value; + } else { + elm.setAttribute(property, value); + } + }, nodes); + return cb; + } + if (nodes[0]) { + if (property === 'style') { + if (nodes[0].style.cssText) { + return nodes[0].style.cssText; + } + } else if (property === 'class') { + if (nodes[0].className) { + return nodes[0].className; + } + } else { + if (nodes[0].getAttribute(property)) { + return nodes[0].getAttribute(property); + } + } + } + } + }; + // Get/Set HTML data property + cb.data = function (key, value) { + if (key) { + return cb.attr('data-' + key, value); + } + }; + // Get/Set form element values + cb.val = function (value) { + var values, i, j; + if (!_.isUndefined(value)) { // FIXED A BUG HERE + nodeLoop(function (elm) { + switch (elm.nodeName) { + case 'SELECT': + if (typeof value === 'string' || typeof value === 'number') { + value = [value]; + } + for (i = 0; i < elm.length; i += 1) { + // Multiple select + for (j = 0; j < value.length; j += 1) { + elm[i].selected = ''; + if (elm[i].value === value[j]) { + elm[i].selected = 'selected'; + break; + } + } + } + break; + case 'INPUT': + case 'TEXTAREA': + case 'BUTTON': + elm.value = value; + break; + } + }, nodes); + + return cb; + } + if (nodes[0]) { + switch (nodes[0].nodeName) { + case 'SELECT': + values = []; + for (i = 0; i < nodes[0].length; i += 1) { + if (nodes[0][i].selected) { + values.push(nodes[0][i].value); + } + } + return (values.length > 1) ? values : values[0]; + case 'INPUT': + case 'TEXTAREA': + case 'BUTTON': + return nodes[0].value; + } + } + }; + // Return matching checked checkbox or radios + cb.checked = function (check) { + if (typeof check === 'boolean') { + nodeLoop(function (elm) { + if (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) { + elm.checked = check; + } + }, nodes); + return cb; + } + if (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) { + return (!!nodes[0].checked); + } + }; + // Add event handler + cb.on = function (event, fn) { + if (selector === w || selector === d) { + nodes = [selector]; + } + nodeLoop(function (elm) { + if (d.addEventListener) { + elm.addEventListener(event, fn, false); + } else if (d.attachEvent) { + // <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions) + elm[event + fn] = function () { + return fn.apply(elm, arguments); + }; + elm.attachEvent('on' + event, elm[event + fn]); + } + }, nodes); + return cb; + }; + // Remove event handler + cb.off = function (event, fn) { + if (selector === w || selector === d) { + nodes = [selector]; + } + nodeLoop(function (elm) { + if (d.addEventListener) { + elm.removeEventListener(event, fn, false); + } else if (d.attachEvent) { + elm.detachEvent('on' + event, elm[event + fn]); + // Tidy up + elm[event + fn] = null; + } + }, nodes); + return cb; + }; + // Basic XHR 1, no file support. Shakes fist at IE + cb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms + var xhr; + var query = serializeData(nodes); + var type = (method) ? method.toUpperCase() : 'GET'; + var abortTmeo; + + if (_.isNumber(options)) options = {timeout: options}; + + var opts = Chartist.extend({}, { + nocache: true, + timeout: 5000, + loader: true, + }, options); + + //console.log('ajax to = ' + opts.timeout); + + if (query && (type === 'GET')) { + url += (url.indexOf('?') === -1) ? '?' + query : '&' + query; + query = null; + } + + // FIXME the XHR sometimes seemingly silently fails + + xhr = new XMLHttpRequest(); // we dont support IE < 9 + + if (xhr) { + // prevent caching + if (opts.nocache) { + var ts = (+(new Date())).toString(36); + url += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts; + } + + if (opts.loader) + $('#loader').addClass('show'); + + // Douglas Crockford: "Synchronous programming is disrespectful and should not be employed in applications which are used by people" + xhr.open(type, url, true); + + xhr.timeout = opts.timeout; + + abortTmeo = setTimeout(function () { + errorMsg("XHR timed out."); + xhr.abort(); + if (opts.loader) $('#loader').removeClass('show'); + }, opts.timeout + 10); // a bit later, but still.; + + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + + if (opts.loader) + $('#loader').removeClass('show'); + + if (callback && xhr.status != 0) { // xhr.status 0 means "aborted" + callback(xhr.responseText, xhr.status); + } + + clearTimeout(abortTmeo); + } + }; + + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + + if (type === 'POST') { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } + + xhr.send(query); + } + + return xhr; + }; + // Alias to cb.ajax(url, 'get', callback) + cb.get = function (url, callback, opts) { + return cb.ajax(url, 'get', callback, opts); + }; + // Alias to cb.ajax(url, 'post', callback) + cb.post = function (url, callback, opts) { + return cb.ajax(url, 'post', callback, opts); + }; + + return cb; + } + + // Set Chibi's global namespace here ($) + w.$ = chibi; + +}()); + +(function (root, factory) { + // if (typeof define === 'function' && define.amd) { + // // AMD. Register as an anonymous module unless amdModuleId is set + // define([], function () { + // return (root['Chartist'] = factory()); + // }); + // } else if (typeof exports === 'object') { + // // Node. Does not work with strict CommonJS, but + // // only CommonJS-like environments that support module.exports, + // // like Node. + // module.exports = factory(); + // } else { + root['Chartist'] = factory(); + // } +}(this, function () { + +/* Chartist.js 0.9.7 + * Copyright © 2016 Gion Kunz + * Free to use under either the WTFPL license or the MIT license. + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT + */ +/** + * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules. + * + * @module Chartist.Core + */ +var Chartist = { + version: '0.9.7' +}; + +(function (window, document, Chartist) { + 'use strict'; + + /** + * This object contains all namespaces used within Chartist. + * + * @memberof Chartist.Core + * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}} + */ + Chartist.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' + }; + + /** + * Helps to simplify functional style code + * + * @memberof Chartist.Core + * @param {*} n This exact value will be returned by the noop function + * @return {*} The same value that was provided to the n parameter + */ + Chartist.noop = function (n) { + return n; + }; + + /** + * Generates a-z from a number 0 to 26 + * + * @memberof Chartist.Core + * @param {Number} n A number from 0 to 26 that will result in a letter a-z + * @return {String} A character from a-z based on the input number n + */ + Chartist.alphaNumerate = function (n) { + // Limit to a-z + return String.fromCharCode(97 + n % 26); + }; + + /** + * Simple recursive object extend + * + * @memberof Chartist.Core + * @param {Object} target Target object where the source will be merged into + * @param {Object...} sources This object (objects) will be merged into target and then target is returned + * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source + */ + Chartist.extend = function (target) { + target = target || {}; + + var sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function(source) { + for (var prop in source) { + if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) { + target[prop] = Chartist.extend({}, target[prop], source[prop]); + } else { + target[prop] = source[prop]; + } + } + }); + + return target; + }; + + /** + * Replaces all occurrences of subStr in str with newSubStr and returns a new string. + * + * @memberof Chartist.Core + * @param {String} str + * @param {String} subStr + * @param {String} newSubStr + * @return {String} + */ + Chartist.replaceAll = function(str, subStr, newSubStr) { + return str.replace(new RegExp(subStr, 'g'), newSubStr); + }; + + /** + * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified. + * + * @memberof Chartist.Core + * @param {Number} value + * @param {String} unit + * @return {String} Returns the passed number value with unit. + */ + Chartist.ensureUnit = function(value, unit) { + if(typeof value === 'number') { + value = value + unit; + } + + return value; + }; + + /** + * Converts a number or string to a quantity object. + * + * @memberof Chartist.Core + * @param {String|Number} input + * @return {Object} Returns an object containing the value as number and the unit as string. + */ + Chartist.quantity = function(input) { + if (typeof input === 'string') { + var match = (/^(\d+)\s*(.*)$/g).exec(input); + return { + value : +match[1], + unit: match[2] || undefined + }; + } + return { value: input }; + }; + + /** + * This is a wrapper around document.querySelector that will return the query if it's already of type Node + * + * @memberof Chartist.Core + * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly + * @return {Node} + */ + Chartist.querySelector = function(query) { + return query instanceof Node ? query : document.querySelector(query); + }; + + /** + * Functional style helper to produce array with given length initialized with undefined values + * + * @memberof Chartist.Core + * @param length + * @return {Array} + */ + Chartist.times = function(length) { + return Array.apply(null, new Array(length)); + }; + + /** + * Sum helper to be used in reduce functions + * + * @memberof Chartist.Core + * @param previous + * @param current + * @return {*} + */ + Chartist.sum = function(previous, current) { + return previous + (current ? current : 0); + }; + + /** + * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor. + * + * @memberof Chartist.Core + * @param {Number} factor + * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array + */ + Chartist.mapMultiply = function(factor) { + return function(num) { + return num * factor; + }; + }; + + /** + * Add helper to be used in `Array.map` for adding a addend to each value of an array. + * + * @memberof Chartist.Core + * @param {Number} addend + * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array + */ + Chartist.mapAdd = function(addend) { + return function(num) { + return num + addend; + }; + }; + + /** + * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values). + * + * @memberof Chartist.Core + * @param arr + * @param cb + * @return {Array} + */ + Chartist.serialMap = function(arr, cb) { + var result = [], + length = Math.max.apply(null, arr.map(function(e) { + return e.length; + })); + + Chartist.times(length).forEach(function(e, index) { + var args = arr.map(function(e) { + return e[index]; + }); + + result[index] = cb.apply(null, args); + }); + + return result; + }; + + /** + * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit. + * + * @memberof Chartist.Core + * @param {Number} value The value that should be rounded with precision + * @param {Number} [digits] The number of digits after decimal used to do the rounding + * @returns {number} Rounded value + */ + Chartist.roundWithPrecision = function(value, digits) { + var precision = Math.pow(10, digits || Chartist.precision); + return Math.round(value * precision) / precision; + }; + + /** + * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. + * + * @memberof Chartist.Core + * @type {number} + */ + Chartist.precision = 8; + + /** + * A map with characters to escape for strings to be safely used as attribute values. + * + * @memberof Chartist.Core + * @type {Object} + */ + // Chartist.escapingMap = { + // '&': '&', + // '<': '<', + // '>': '>', + // '"': '"', + // '\'': ''' + // }; + + /** + * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap. + * If called with null or undefined the function will return immediately with null or undefined. + * + * @memberof Chartist.Core + * @param {Number|String|Object} data + * @return {String} + */ + Chartist.serialize = function(data) { + if(data === null || data === undefined) { + return data; + } else if(typeof data === 'number') { + data = ''+data; + } else if(typeof data === 'object') { + data = JSON.stringify({data: data}); + } + + return _.escape(data); + + // return Object.keys(Chartist.escapingMap).reduce(function(result, key) { + // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]); + // }, data); + }; + + /** + * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success. + * + * @memberof Chartist.Core + * @param {String} data + * @return {String|Number|Object} + */ + Chartist.deserialize = function(data) { + if(typeof data !== 'string') { + return data; + } + + // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) { + // return Chartist.replaceAll(result, Chartist.escapingMap[key], key); + // }, data); + data = _.unescape(data); + + try { + data = JSON.parse(data); + data = data.data !== undefined ? data.data : data; + } catch(e) {} + + return data; + }; + + /** + * Create or reinitialize the SVG element for the chart + * + * @memberof Chartist.Core + * @param {Node} container The containing DOM Node object that will be used to plant the SVG element + * @param {String} width Set the width of the SVG element. Default is 100% + * @param {String} height Set the height of the SVG element. Default is 100% + * @param {String} className Specify a class to be added to the SVG element + * @return {Object} The created/reinitialized SVG element + */ + Chartist.createSvg = function (container, width, height, className) { + var svg; + + width = width || '100%'; + height = height || '100%'; + + // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it + // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/ + Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) { + return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct'); + }).forEach(function removePreviousElement(svg) { + container.removeChild(svg); + }); + + // Create svg object with width and height or use 100% as default + svg = new Chartist.Svg('svg').attr({ + width: width, + height: height + }).addClass(className).attr({ + style: 'width: ' + width + '; height: ' + height + ';' + }); + + // Add the DOM node to our container + container.appendChild(svg._node); + + return svg; + }; + + /** + * Ensures that the data object passed as second argument to the charts is present and correctly initialized. + * + * @param {Object} data The data object that is passed as second argument to the charts + * @return {Object} The normalized data object + */ + Chartist.normalizeData = function(data) { + // Ensure data is present otherwise enforce + data = data || {series: [], labels: []}; + data.series = data.series || []; + data.labels = data.labels || []; + + // Check if we should generate some labels based on existing series data + if (data.series.length > 0 && data.labels.length === 0) { + var normalized = Chartist.getDataArray(data), + labelCount; + + // If all elements of the normalized data array are arrays we're dealing with + // data from Bar or Line charts and we need to find the largest series if they are un-even + if (normalized.every(function(value) { + return value instanceof Array; + })) { + // Getting the series with the the most elements + labelCount = Math.max.apply(null, normalized.map(function(series) { + return series.length; + })); + } else { + // We're dealing with Pie data so we just take the normalized array length + labelCount = normalized.length; + } + + // Setting labels to an array with emptry strings using our labelCount estimated above + data.labels = Chartist.times(labelCount).map(function() { + return ''; + }); + } + return data; + }; + + /** + * Reverses the series, labels and series data arrays. + * + * @memberof Chartist.Core + * @param data + */ + Chartist.reverseData = function(data) { + data.labels.reverse(); + data.series.reverse(); + for (var i = 0; i < data.series.length; i++) { + if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) { + data.series[i].data.reverse(); + } else if(data.series[i] instanceof Array) { + data.series[i].reverse(); + } + } + }; + + /** + * Convert data series into plain array + * + * @memberof Chartist.Core + * @param {Object} data The series object that contains the data to be visualized in the chart + * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too. + * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created. + * @return {Array} A plain array that contains the data to be visualized in the chart + */ + Chartist.getDataArray = function (data, reverse, multi) { + // If the data should be reversed but isn't we need to reverse it + // If it's reversed but it shouldn't we need to reverse it back + // That's required to handle data updates correctly and to reflect the responsive configurations + if(reverse && !data.reversed || !reverse && data.reversed) { + Chartist.reverseData(data); + data.reversed = !data.reversed; + } + + // Recursively walks through nested arrays and convert string values to numbers and objects with value properties + // to values. Check the tests in data core -> data normalization for a detailed specification of expected values + function recursiveConvert(value) { + if(Chartist.isFalseyButZero(value)) { + // This is a hole in data and we should return undefined + return undefined; + } else if((value.data || value) instanceof Array) { + return (value.data || value).map(recursiveConvert); + } else if(value.hasOwnProperty('value')) { + return recursiveConvert(value.value); + } else { + if(multi) { + var multiValue = {}; + + // Single series value arrays are assumed to specify the Y-Axis value + // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}] + // If multi is a string then it's assumed that it specified which dimension should be filled as default + if(typeof multi === 'string') { + multiValue[multi] = Chartist.getNumberOrUndefined(value); + } else { + multiValue.y = Chartist.getNumberOrUndefined(value); + } + + multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x; + multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y; + + return multiValue; + + } else { + return Chartist.getNumberOrUndefined(value); + } + } + } + + return data.series.map(recursiveConvert); + }; + + /** + * Converts a number into a padding object. + * + * @memberof Chartist.Core + * @param {Object|Number} padding + * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed + * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned. + */ + Chartist.normalizePadding = function(padding, fallback) { + fallback = fallback || 0; + + return typeof padding === 'number' ? { + top: padding, + right: padding, + bottom: padding, + left: padding + } : { + top: typeof padding.top === 'number' ? padding.top : fallback, + right: typeof padding.right === 'number' ? padding.right : fallback, + bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback, + left: typeof padding.left === 'number' ? padding.left : fallback + }; + }; + + Chartist.getMetaData = function(series, index) { + var value = series.data ? series.data[index] : series[index]; + return value ? Chartist.serialize(value.meta) : undefined; + }; + + /** + * Calculate the order of magnitude for the chart scale + * + * @memberof Chartist.Core + * @param {Number} value The value Range of the chart + * @return {Number} The order of magnitude + */ + Chartist.orderOfMagnitude = function (value) { + return Math.floor(Math.log(Math.abs(value)) / Math.LN10); + }; + + /** + * Project a data length into screen coordinates (pixels) + * + * @memberof Chartist.Core + * @param {Object} axisLength The svg element for the chart + * @param {Number} length Single data value from a series array + * @param {Object} bounds All the values to set the bounds of the chart + * @return {Number} The projected data length in pixels + */ + Chartist.projectLength = function (axisLength, length, bounds) { + return length / bounds.range * axisLength; + }; + + /** + * Get the height of the area in the chart for the data series + * + * @memberof Chartist.Core + * @param {Object} svg The svg element for the chart + * @param {Object} options The Object that contains all the optional values for the chart + * @return {Number} The height of the area in the chart for the data series + */ + Chartist.getAvailableHeight = function (svg, options) { + return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0); + }; + + /** + * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart. + * + * @memberof Chartist.Core + * @param {Array} data The array that contains the data to be visualized in the chart + * @param {Object} options The Object that contains the chart options + * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration + * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart. + */ + Chartist.getHighLow = function (data, options, dimension) { + // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred + options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {}); + + var highLow = { + high: options.high === undefined ? -Number.MAX_VALUE : +options.high, + low: options.low === undefined ? Number.MAX_VALUE : +options.low + }; + var findHigh = options.high === undefined; + var findLow = options.low === undefined; + + // Function to recursively walk through arrays and find highest and lowest number + function recursiveHighLow(data) { + if(data === undefined) { + return undefined; + } else if(data instanceof Array) { + for (var i = 0; i < data.length; i++) { + recursiveHighLow(data[i]); + } + } else { + var value = dimension ? +data[dimension] : +data; + + if (findHigh && value > highLow.high) { + highLow.high = value; + } + + if (findLow && value < highLow.low) { + highLow.low = value; + } + } + } + + // Start to find highest and lowest number recursively + if(findHigh || findLow) { + recursiveHighLow(data); + } + + // Overrides of high / low based on reference value, it will make sure that the invisible reference value is + // used to generate the chart. This is useful when the chart always needs to contain the position of the + // invisible reference value in the view i.e. for bipolar scales. + if (options.referenceValue || options.referenceValue === 0) { + highLow.high = Math.max(options.referenceValue, highLow.high); + highLow.low = Math.min(options.referenceValue, highLow.low); + } + + // If high and low are the same because of misconfiguration or flat data (only the same value) we need + // to set the high or low to 0 depending on the polarity + if (highLow.high <= highLow.low) { + // If both values are 0 we set high to 1 + if (highLow.low === 0) { + highLow.high = 1; + } else if (highLow.low < 0) { + // If we have the same negative value for the bounds we set bounds.high to 0 + highLow.high = 0; + } else if (highLow.high > 0) { + // If we have the same positive value for the bounds we set bounds.low to 0 + highLow.low = 0; + } else { + // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors + highLow.high = 1; + highLow.low = 0; + } + } + + return highLow; + }; + + /** + * Checks if the value is a valid number or string with a number. + * + * @memberof Chartist.Core + * @param value + * @returns {Boolean} + */ + Chartist.isNum = function(value) { + return !isNaN(value) && isFinite(value); + }; + + /** + * Returns true on all falsey values except the numeric value 0. + * + * @memberof Chartist.Core + * @param value + * @returns {boolean} + */ + Chartist.isFalseyButZero = function(value) { + return !value && value !== 0; + }; + + /** + * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined. + * + * @memberof Chartist.Core + * @param value + * @returns {*} + */ + Chartist.getNumberOrUndefined = function(value) { + return isNaN(+value) ? undefined : +value; + }; + + /** + * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined. + * + * @param value + * @param dimension + * @returns {*} + */ + Chartist.getMultiValue = function(value, dimension) { + if(Chartist.isNum(value)) { + return +value; + } else if(value) { + return value[dimension || 'y'] || 0; + } else { + return 0; + } + }; + + /** + * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex. + * + * @memberof Chartist.Core + * @param {Number} num An integer number where the smallest factor should be searched for + * @returns {Number} The smallest integer factor of the parameter num. + */ + Chartist.rho = function(num) { + if(num === 1) { + return num; + } + + function gcd(p, q) { + if (p % q === 0) { + return q; + } else { + return gcd(q, p % q); + } + } + + function f(x) { + return x * x + 1; + } + + var x1 = 2, x2 = 2, divisor; + if (num % 2 === 0) { + return 2; + } + + do { + x1 = f(x1) % num; + x2 = f(f(x2)) % num; + divisor = gcd(Math.abs(x1 - x2), num); + } while (divisor === 1); + + return divisor; + }; + + /** + * Calculate and retrieve all the bounds for the chart and return them in one array + * + * @memberof Chartist.Core + * @param {Number} axisLength The length of the Axis used for + * @param {Object} highLow An object containing a high and low property indicating the value range of the chart. + * @param {Number} scaleMinSpace The minimum projected length a step should result in + * @param {Boolean} onlyInteger + * @return {Object} All the values to set the bounds of the chart + */ + Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) { + var i, + optimizationCounter = 0, + newMin, + newMax, + bounds = { + high: highLow.high, + low: highLow.low + }; + + bounds.valueRange = bounds.high - bounds.low; + bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange); + bounds.step = Math.pow(10, bounds.oom); + bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step; + bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step; + bounds.range = bounds.max - bounds.min; + bounds.numberOfSteps = Math.round(bounds.range / bounds.step); + + // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace + // If we are already below the scaleMinSpace value we will scale up + var length = Chartist.projectLength(axisLength, bounds.step, bounds); + var scaleUp = length < scaleMinSpace; + var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0; + + // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1 + if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) { + bounds.step = 1; + } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) { + // If step 1 was too small, we can try the smallest factor of range + // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor + // is larger than the scaleMinSpace we should go for it. + bounds.step = smallestFactor; + } else { + // Trying to divide or multiply by 2 and find the best step value + while (true) { + if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) { + bounds.step *= 2; + } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) { + bounds.step /= 2; + if(onlyInteger && bounds.step % 1 !== 0) { + bounds.step *= 2; + break; + } + } else { + break; + } + + if(optimizationCounter++ > 1000) { + throw new Error('Exceeded maximum number of iterations while optimizing scale step!'); + } + } + } + + // Narrow min and max based on new step + newMin = bounds.min; + newMax = bounds.max; + while(newMin + bounds.step <= bounds.low) { + newMin += bounds.step; + } + while(newMax - bounds.step >= bounds.high) { + newMax -= bounds.step; + } + bounds.min = newMin; + bounds.max = newMax; + bounds.range = bounds.max - bounds.min; + + bounds.values = []; + for (i = bounds.min; i <= bounds.max; i += bounds.step) { + bounds.values.push(Chartist.roundWithPrecision(i)); + } + + return bounds; + }; + + // /** + // * Calculate cartesian coordinates of polar coordinates + // * + // * @memberof Chartist.Core + // * @param {Number} centerX X-axis coordinates of center point of circle segment + // * @param {Number} centerY X-axis coordinates of center point of circle segment + // * @param {Number} radius Radius of circle segment + // * @param {Number} angleInDegrees Angle of circle segment in degrees + // * @return {{x:Number, y:Number}} Coordinates of point on circumference + // */ + // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) { + // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; + // + // return { + // x: centerX + (radius * Math.cos(angleInRadians)), + // y: centerY + (radius * Math.sin(angleInRadians)) + // }; + // }; + + /** + * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right + * + * @memberof Chartist.Core + * @param {Object} svg The svg element for the chart + * @param {Object} options The Object that contains all the optional values for the chart + * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used + * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements + */ + Chartist.createChartRect = function (svg, options, fallbackPadding) { + var hasAxis = !!(options.axisX || options.axisY); + var yAxisOffset = hasAxis ? options.axisY.offset : 0; + var xAxisOffset = hasAxis ? options.axisX.offset : 0; + // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0 + var width = svg.width() || Chartist.quantity(options.width).value || 0; + var height = svg.height() || Chartist.quantity(options.height).value || 0; + var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding); + + // If settings were to small to cope with offset (legacy) and padding, we'll adjust + width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right); + height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom); + + var chartRect = { + padding: normalizedPadding, + width: function () { + return this.x2 - this.x1; + }, + height: function () { + return this.y1 - this.y2; + } + }; + + if(hasAxis) { + if (options.axisX.position === 'start') { + chartRect.y2 = normalizedPadding.top + xAxisOffset; + chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); + } else { + chartRect.y2 = normalizedPadding.top; + chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1); + } + + if (options.axisY.position === 'start') { + chartRect.x1 = normalizedPadding.left + yAxisOffset; + chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); + } else { + chartRect.x1 = normalizedPadding.left; + chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1); + } + } else { + chartRect.x1 = normalizedPadding.left; + chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); + chartRect.y2 = normalizedPadding.top; + chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); + } + + return chartRect; + }; + + /** + * Creates a grid line based on a projected value. + * + * @memberof Chartist.Core + * @param position + * @param index + * @param axis + * @param offset + * @param length + * @param group + * @param classes + * @param eventEmitter + */ + Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) { + var positionalData = {}; + positionalData[axis.units.pos + '1'] = Math.round(position)+0.5; + positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid + positionalData[axis.counterUnits.pos + '1'] = offset; + positionalData[axis.counterUnits.pos + '2'] = offset + length; + + var gridElement = group.elem('line', positionalData, classes.join(' ')); + + // Event for grid draw + eventEmitter.emit('draw', + Chartist.extend({ + type: 'grid', + axis: axis, + index: index, + group: group, + element: gridElement + }, positionalData) + ); + }; + + /** + * Creates a label based on a projected value and an axis. + * + * @memberof Chartist.Core + * @param position + * @param length + * @param index + * @param labels + * @param axis + * @param axisOffset + * @param labelOffset + * @param group + * @param classes + * @param useForeignObject + * @param eventEmitter + */ + Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) { + var labelElement; + var positionalData = {}; + + positionalData[axis.units.pos] = position + labelOffset[axis.units.pos]; + positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos]; + positionalData[axis.units.len] = length; + positionalData[axis.counterUnits.len] = axisOffset - 10; + + var lblText = labels[index]; + + if (_.isNumber(lblText)) { + lblText = Chartist.roundWithPrecision(lblText, 2); + } + + if(useForeignObject) { + // We need to set width and height explicitly to px as span will not expand with width and height being + // 100% in all browsers + var content = '' + + lblText + ''; + + labelElement = group.foreignObject(content, Chartist.extend({ + style: 'overflow: visible;' + }, positionalData)); + } else { + labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText); + } + + eventEmitter.emit('draw', Chartist.extend({ + type: 'label', + axis: axis, + index: index, + group: group, + element: labelElement, + text: lblText + }, positionalData)); + }; + + /** + * Helper to read series specific options from options object. It automatically falls back to the global option if + * there is no option in the series options. + * + * @param {Object} series Series object + * @param {Object} options Chartist options object + * @param {string} key The options key that should be used to obtain the options + * @returns {*} + */ + Chartist.getSeriesOption = function(series, options, key) { + if(series.name && options.series && options.series[series.name]) { + var seriesOptions = options.series[series.name]; + return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key]; + } else { + return options[key]; + } + }; + + /** + * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches + * + * @memberof Chartist.Core + * @param {Object} options Options set by user + * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart + * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events + * @return {Object} The consolidated options object from the defaults, base and matching responsive options + */ + Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) { + var baseOptions = Chartist.extend({}, options), + currentOptions, + mediaQueryListeners = [], + i; + + function updateCurrentOptions(preventChangedEvent) { + var previousOptions = currentOptions; + currentOptions = Chartist.extend({}, baseOptions); + + if (responsiveOptions) { + for (i = 0; i < responsiveOptions.length; i++) { + var mql = window.matchMedia(responsiveOptions[i][0]); + if (mql.matches) { + currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]); + } + } + } + + if(eventEmitter && !preventChangedEvent) { + eventEmitter.emit('optionsChanged', { + previousOptions: previousOptions, + currentOptions: currentOptions + }); + } + } + + function removeMediaQueryListeners() { + mediaQueryListeners.forEach(function(mql) { + mql.removeListener(updateCurrentOptions); + }); + } + + if (!window.matchMedia) { + throw 'window.matchMedia not found! Make sure you\'re using a polyfill.'; + } else if (responsiveOptions) { + + for (i = 0; i < responsiveOptions.length; i++) { + var mql = window.matchMedia(responsiveOptions[i][0]); + mql.addListener(updateCurrentOptions); + mediaQueryListeners.push(mql); + } + } + // Execute initially so we get the correct options + updateCurrentOptions(true); + + return { + removeMediaQueryListeners: removeMediaQueryListeners, + getCurrentOptions: function getCurrentOptions() { + return Chartist.extend({}, currentOptions); + } + }; + }; + +}(window, document, Chartist)); +;/** + * Chartist path interpolation functions. + * + * @module Chartist.Interpolation + */ +/* global Chartist */ +(function(window, document, Chartist) { + 'use strict'; + + Chartist.Interpolation = {}; + + /** + * This interpolation function does not smooth the path and the result is only containing lines and no curves. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.none({ + * fillHoles: false + * }) + * }); + * + * + * @memberof Chartist.Interpolation + * @return {Function} + */ + Chartist.Interpolation.none = function(options) { + var defaultOptions = { + fillHoles: false + }; + options = Chartist.extend({}, defaultOptions, options); + return function none(pathCoordinates, valueData) { + var path = new Chartist.Svg.Path(); + var hole = true; + + for(var i = 0; i < pathCoordinates.length; i += 2) { + var currX = pathCoordinates[i]; + var currY = pathCoordinates[i + 1]; + var currData = valueData[i / 2]; + + if(currData.value !== undefined) { + + if(hole) { + path.move(currX, currY, false, currData); + } else { + path.line(currX, currY, false, currData); + } + + hole = false; + } else if(!options.fillHoles) { + hole = true; + } + } + + return path; + }; + }; + + /** + * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. + * + * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.simple({ + * divisor: 2, + * fillHoles: false + * }) + * }); + * + * + * @memberof Chartist.Interpolation + * @param {Object} options The options of the simple interpolation factory function. + * @return {Function} + */ + Chartist.Interpolation.simple = function(options) { + var defaultOptions = { + divisor: 2, + fillHoles: false + }; + options = Chartist.extend({}, defaultOptions, options); + + var d = 1 / Math.max(1, options.divisor); + + return function simple(pathCoordinates, valueData) { + var path = new Chartist.Svg.Path(); + var prevX, prevY, prevData; + + for(var i = 0; i < pathCoordinates.length; i += 2) { + var currX = pathCoordinates[i]; + var currY = pathCoordinates[i + 1]; + var length = (currX - prevX) * d; + var currData = valueData[i / 2]; + + if(currData.value !== undefined) { + + if(prevData === undefined) { + path.move(currX, currY, false, currData); + } else { + path.curve( + prevX + length, + prevY, + currX - length, + currY, + currX, + currY, + false, + currData + ); + } + + prevX = currX; + prevY = currY; + prevData = currData; + } else if(!options.fillHoles) { + prevX = currX = prevData = undefined; + } + } + + return path; + }; + }; + + // /** + // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. + // * + // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. + // * + // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity. + // * + // * @example + // * var chart = new Chartist.Line('.ct-chart', { + // * labels: [1, 2, 3, 4, 5], + // * series: [[1, 2, 8, 1, 7]] + // * }, { + // * lineSmooth: Chartist.Interpolation.cardinal({ + // * tension: 1, + // * fillHoles: false + // * }) + // * }); + // * + // * @memberof Chartist.Interpolation + // * @param {Object} options The options of the cardinal factory function. + // * @return {Function} + // */ + // Chartist.Interpolation.cardinal = function(options) { + // var defaultOptions = { + // tension: 1, + // fillHoles: false + // }; + // + // options = Chartist.extend({}, defaultOptions, options); + // + // var t = Math.min(1, Math.max(0, options.tension)), + // c = 1 - t; + // + // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates + // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards. + // // This functionality is necessary to treat "holes" in the line charts + // function splitIntoSegments(pathCoordinates, valueData) { + // var segments = []; + // var hole = true; + // + // for(var i = 0; i < pathCoordinates.length; i += 2) { + // // If this value is a "hole" we set the hole flag + // if(valueData[i / 2].value === undefined) { + // if(!options.fillHoles) { + // hole = true; + // } + // } else { + // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment + // if(hole) { + // segments.push({ + // pathCoordinates: [], + // valueData: [] + // }); + // // As we have a valid value now, we are not in a "hole" anymore + // hole = false; + // } + // + // // Add to the segment pathCoordinates and valueData + // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]); + // segments[segments.length - 1].valueData.push(valueData[i / 2]); + // } + // } + // + // return segments; + // } + // + // return function cardinal(pathCoordinates, valueData) { + // // First we try to split the coordinates into segments + // // This is necessary to treat "holes" in line charts + // var segments = splitIntoSegments(pathCoordinates, valueData); + // + // if(!segments.length) { + // // If there were no segments return 'Chartist.Interpolation.none' + // return Chartist.Interpolation.none()([]); + // } else if(segments.length > 1) { + // // If the split resulted in more that one segment we need to interpolate each segment individually and join them + // // afterwards together into a single path. + // var paths = []; + // // For each segment we will recurse the cardinal function + // segments.forEach(function(segment) { + // paths.push(cardinal(segment.pathCoordinates, segment.valueData)); + // }); + // // Join the segment path data into a single path and return + // return Chartist.Svg.Path.join(paths); + // } else { + // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first + // // segment + // pathCoordinates = segments[0].pathCoordinates; + // valueData = segments[0].valueData; + // + // // If less than two points we need to fallback to no smoothing + // if(pathCoordinates.length <= 4) { + // return Chartist.Interpolation.none()(pathCoordinates, valueData); + // } + // + // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]), + // z; + // + // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) { + // var p = [ + // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]}, + // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}, + // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]}, + // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]} + // ]; + // if (z) { + // if (!i) { + // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]}; + // } else if (iLen - 4 === i) { + // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; + // } else if (iLen - 2 === i) { + // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; + // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]}; + // } + // } else { + // if (iLen - 4 === i) { + // p[3] = p[2]; + // } else if (!i) { + // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}; + // } + // } + // + // path.curve( + // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x), + // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y), + // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x), + // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y), + // p[2].x, + // p[2].y, + // false, + // valueData[(i + 2) / 2] + // ); + // } + // + // return path; + // } + // }; + // }; + + + /** + * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points. + * + * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. + * + * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.monotoneCubic({ + * fillHoles: false + * }) + * }); + * + * @memberof Chartist.Interpolation + * @param {Object} options The options of the monotoneCubic factory function. + * @return {Function} + */ + Chartist.Interpolation.monotoneCubic = function(options) { + var defaultOptions = { + fillHoles: false + }; + + options = Chartist.extend({}, defaultOptions, options); + + // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates + // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards. + // This functionality is necessary to treat "holes" in the line charts + function splitIntoSegments(pathCoordinates, valueData) { + var segments = []; + var hole = true; + + for(var i = 0; i < pathCoordinates.length; i += 2) { + // If this value is a "hole" we set the hole flag + if(valueData[i / 2].value === undefined) { + if(!options.fillHoles) { + hole = true; + } + } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) { + // Because we are doing monotone interpolation, curve fitting only makes sense for + // increasing x values. Therefore if two subsequent points have the same x value, or + // the x value is decreasing, then we create a hole at this point. (Which cannot be + // filled in even with the 'fillHoles' option) + + hole = true; + } else { + // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment + if(hole) { + segments.push({ + pathCoordinates: [], + valueData: [] + }); + // As we have a valid value now, we are not in a "hole" anymore + hole = false; + } + + // Add to the segment pathCoordinates and valueData + segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]); + segments[segments.length - 1].valueData.push(valueData[i / 2]); + } + } + + return segments; + } + + return function monotoneCubic(pathCoordinates, valueData) { + // First we try to split the coordinates into segments + // This is necessary to treat "holes" in line charts + var segments = splitIntoSegments(pathCoordinates, valueData); + + if(!segments.length) { + // If there were no segments return 'Chartist.Interpolation.none' + return Chartist.Interpolation.none()([]); + } else if(segments.length > 1) { + // If the split resulted in more that one segment we need to interpolate each segment individually and join them + // afterwards together into a single path. + var paths = []; + // For each segment we will recurse the monotoneCubic fn function + segments.forEach(function(segment) { + paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData)); + }); + // Join the segment path data into a single path and return + return Chartist.Svg.Path.join(paths); + } else { + // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first + // segment + pathCoordinates = segments[0].pathCoordinates; + valueData = segments[0].valueData; + + // If less than three points we need to fallback to no smoothing + if(pathCoordinates.length <= 4) { + return Chartist.Interpolation.none()(pathCoordinates, valueData); + } + + var xs = [], + ys = [], + i, + n = pathCoordinates.length / 2, + ms = [], + ds = [], dys = [], dxs = [], + path; + + // Populate x and y coordinates into separate arrays, for readability + + for(i = 0; i < n; i++) { + xs[i] = pathCoordinates[i * 2]; + ys[i] = pathCoordinates[i * 2 + 1]; + } + + // Calculate deltas and derivative + + for(i = 0; i < n - 1; i++) { + dys[i] = ys[i + 1] - ys[i]; + dxs[i] = xs[i + 1] - xs[i]; + ds[i] = dys[i] / dxs[i]; + } + + // Determine desired slope (m) at each point using Fritsch-Carlson method + // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation + + ms[0] = ds[0]; + ms[n - 1] = ds[n - 2]; + + for(i = 1; i < n - 1; i++) { + if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) { + ms[i] = 0; + } else { + ms[i] = 3 * (dxs[i - 1] + dxs[i]) / ( + (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] + + (dxs[i] + 2 * dxs[i - 1]) / ds[i]); + + if(!isFinite(ms[i])) { + ms[i] = 0; + } + } + } + + // Now build a path from the slopes + + path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]); + + for(i = 0; i < n - 1; i++) { + path.curve( + // First control point + xs[i] + dxs[i] / 3, + ys[i] + ms[i] * dxs[i] / 3, + // Second control point + xs[i + 1] - dxs[i] / 3, + ys[i + 1] - ms[i + 1] * dxs[i] / 3, + // End point + xs[i + 1], + ys[i + 1], + + false, + valueData[i + 1] // changed as per patch on github + ); + } + + return path; + } + }; + }; + + /** + * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.step({ + * postpone: true, + * fillHoles: false + * }) + * }); + * + * @memberof Chartist.Interpolation + * @param options + * @returns {Function} + */ + Chartist.Interpolation.step = function(options) { + var defaultOptions = { + postpone: true, + fillHoles: false + }; + + options = Chartist.extend({}, defaultOptions, options); + + return function step(pathCoordinates, valueData) { + var path = new Chartist.Svg.Path(); + + var prevX, prevY, prevData; + + for (var i = 0; i < pathCoordinates.length; i += 2) { + var currX = pathCoordinates[i]; + var currY = pathCoordinates[i + 1]; + var currData = valueData[i / 2]; + + // If the current point is also not a hole we can draw the step lines + if(currData.value !== undefined) { + if(prevData === undefined) { + path.move(currX, currY, false, currData); + } else { + if(options.postpone) { + // If postponed we should draw the step line with the value of the previous value + path.line(currX, prevY, false, prevData); + } else { + // If not postponed we should draw the step line with the value of the current value + path.line(prevX, currY, false, currData); + } + // Line to the actual point (this should only be a Y-Axis movement + path.line(currX, currY, false, currData); + } + + prevX = currX; + prevY = currY; + prevData = currData; + } else if(!options.fillHoles) { + prevX = prevY = prevData = undefined; + } + } + + return path; + }; + }; + +}(window, document, Chartist)); +;/** + * A very basic event module that helps to generate and catch events. + * + * @module Chartist.Event + */ +/* global Chartist */ +(function (window, document, Chartist) { + 'use strict'; + + Chartist.EventEmitter = function () { + var handlers = []; + + /** + * Add an event handler for a specific event + * + * @memberof Chartist.Event + * @param {String} event The event name + * @param {Function} handler A event handler function + */ + function addEventHandler(event, handler) { + handlers[event] = handlers[event] || []; + handlers[event].push(handler); + } + + /** + * Remove an event handler of a specific event name or remove all event handlers for a specific event. + * + * @memberof Chartist.Event + * @param {String} event The event name where a specific or all handlers should be removed + * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed. + */ + function removeEventHandler(event, handler) { + // Only do something if there are event handlers with this name existing + if(handlers[event]) { + // If handler is set we will look for a specific handler and only remove this + if(handler) { + handlers[event].splice(handlers[event].indexOf(handler), 1); + if(handlers[event].length === 0) { + delete handlers[event]; + } + } else { + // If no handler is specified we remove all handlers for this event + delete handlers[event]; + } + } + } + + /** + * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter. + * + * @memberof Chartist.Event + * @param {String} event The event name that should be triggered + * @param {*} data Arbitrary data that will be passed to the event handler callback functions + */ + function emit(event, data) { + // Only do something if there are event handlers with this name existing + if(handlers[event]) { + handlers[event].forEach(function(handler) { + handler(data); + }); + } + + // Emit event to star event handlers + if(handlers['*']) { + handlers['*'].forEach(function(starHandler) { + starHandler(event, data); + }); + } + } + + return { + addEventHandler: addEventHandler, + removeEventHandler: removeEventHandler, + emit: emit + }; + }; + +}(window, document, Chartist)); +;/** + * This module provides some basic prototype inheritance utilities. + * + * @module Chartist.Class + */ +/* global Chartist */ +(function(window, document, Chartist) { + 'use strict'; + + function listToArray(list) { + var arr = []; + if (list.length) { + for (var i = 0; i < list.length; i++) { + arr.push(list[i]); + } + } + return arr; + } + + /** + * Method to extend from current prototype. + * + * @memberof Chartist.Class + * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. + * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used. + * @return {Function} Constructor function of the new class + * + * @example + * var Fruit = Class.extend({ + * color: undefined, + * sugar: undefined, + * + * constructor: function(color, sugar) { + * this.color = color; + * this.sugar = sugar; + * }, + * + * eat: function() { + * this.sugar = 0; + * return this; + * } + * }); + * + * var Banana = Fruit.extend({ + * length: undefined, + * + * constructor: function(length, sugar) { + * Banana.super.constructor.call(this, 'Yellow', sugar); + * this.length = length; + * } + * }); + * + * var banana = new Banana(20, 40); + * console.log('banana instanceof Fruit', banana instanceof Fruit); + * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); + * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); + * console.log(banana.sugar); + * console.log(banana.eat().sugar); + * console.log(banana.color); + */ + function extend(properties, superProtoOverride) { + var superProto = superProtoOverride || this.prototype || Chartist.Class; + var proto = Object.create(superProto); + + Chartist.Class.cloneDefinitions(proto, properties); + + var constr = function() { + var fn = proto.constructor || function () {}, + instance; + + // If this is linked to the Chartist namespace the constructor was not called with new + // To provide a fallback we will instantiate here and return the instance + instance = this === Chartist ? Object.create(proto) : this; + fn.apply(instance, Array.prototype.slice.call(arguments, 0)); + + // If this constructor was not called with new we need to return the instance + // This will not harm when the constructor has been called with new as the returned value is ignored + return instance; + }; + + constr.prototype = proto; + constr['super'] = superProto; + constr.extend = this.extend; + + return constr; + } + + // Variable argument list clones args > 0 into args[0] and retruns modified args[0] + function cloneDefinitions() { + var args = listToArray(arguments); + var target = args[0]; + + args.splice(1, args.length - 1).forEach(function (source) { + Object.getOwnPropertyNames(source).forEach(function (propName) { + // If this property already exist in target we delete it first + delete target[propName]; + // Define the property with the descriptor from source + Object.defineProperty(target, propName, + Object.getOwnPropertyDescriptor(source, propName)); + }); + }); + + return target; + } + + Chartist.Class = { + extend: extend, + cloneDefinitions: cloneDefinitions + }; + +}(window, document, Chartist)); +;/** + * Base for all chart types. The methods in Chartist.Base are inherited to all chart types. + * + * @module Chartist.Base + */ +/* global Chartist */ +(function(window, document, Chartist) { + 'use strict'; + + // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance. + // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not + // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage. + // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html + // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj + // The problem is with the label offsets that can't be converted into percentage and affecting the chart container + /** + * Updates the chart which currently does a full reconstruction of the SVG DOM + * + * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart. + * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart. + * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base + * @memberof Chartist.Base + */ + function update(data, options, override) { + if(data) { + this.data = data; + // Event for data transformation that allows to manipulate the data before it gets rendered in the charts + this.eventEmitter.emit('data', { + type: 'update', + data: this.data + }); + } + + if(options) { + this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options); + + // If chartist was not initialized yet, we just set the options and leave the rest to the initialization + // Otherwise we re-create the optionsProvider at this point + if(!this.initializeTimeoutId) { + this.optionsProvider.removeMediaQueryListeners(); + this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); + } + } + + // Only re-created the chart if it has been initialized yet + if(!this.initializeTimeoutId) { + this.createChart(this.optionsProvider.getCurrentOptions()); + } + + // Return a reference to the chart object to chain up calls + return this; + } + + /** + * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically. + * + * @memberof Chartist.Base + */ + function detach() { + // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore + // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout + if(!this.initializeTimeoutId) { + window.removeEventListener('resize', this.resizeListener); + this.optionsProvider.removeMediaQueryListeners(); + } else { + window.clearTimeout(this.initializeTimeoutId); + } + + return this; + } + + /** + * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. + * + * @memberof Chartist.Base + * @param {String} event Name of the event. Check the examples for supported events. + * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. + */ + function on(event, handler) { + this.eventEmitter.addEventHandler(event, handler); + return this; + } + + /** + * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. + * + * @memberof Chartist.Base + * @param {String} event Name of the event for which a handler should be removed + * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. + */ + function off(event, handler) { + this.eventEmitter.removeEventHandler(event, handler); + return this; + } + + function initialize() { + // Add window resize listener that re-creates the chart + window.addEventListener('resize', this.resizeListener); + + // Obtain current options based on matching media queries (if responsive options are given) + // This will also register a listener that is re-creating the chart based on media changes + this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); + // Register options change listener that will trigger a chart update + this.eventEmitter.addEventHandler('optionsChanged', function() { + this.update(); + }.bind(this)); + + // Before the first chart creation we need to register us with all plugins that are configured + // Initialize all relevant plugins with our chart object and the plugin options specified in the config + if(this.options.plugins) { + this.options.plugins.forEach(function(plugin) { + if(plugin instanceof Array) { + plugin[0](this, plugin[1]); + } else { + plugin(this); + } + }.bind(this)); + } + + // Event for data transformation that allows to manipulate the data before it gets rendered in the charts + this.eventEmitter.emit('data', { + type: 'initial', + data: this.data + }); + + // Create the first chart + this.createChart(this.optionsProvider.getCurrentOptions()); + + // As chart is initialized from the event loop now we can reset our timeout reference + // This is important if the chart gets initialized on the same element twice + this.initializeTimeoutId = undefined; + } + + /** + * Constructor of chart base class. + * + * @param query + * @param data + * @param defaultOptions + * @param options + * @param responsiveOptions + * @constructor + */ + function Base(query, data, defaultOptions, options, responsiveOptions) { + this.container = Chartist.querySelector(query); + this.data = data; + this.defaultOptions = defaultOptions; + this.options = options; + this.responsiveOptions = responsiveOptions; + this.eventEmitter = Chartist.EventEmitter(); + this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility'); + this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute'); + this.resizeListener = function resizeListener(){ + this.update(); + }.bind(this); + + if(this.container) { + // If chartist was already initialized in this container we are detaching all event listeners first + if(this.container.__chartist__) { + this.container.__chartist__.detach(); + } + + this.container.__chartist__ = this; + } + + // Using event loop for first draw to make it possible to register event listeners in the same call stack where + // the chart was created. + this.initializeTimeoutId = setTimeout(initialize.bind(this), 0); + } + + // Creating the chart base class + Chartist.Base = Chartist.Class.extend({ + constructor: Base, + optionsProvider: undefined, + container: undefined, + svg: undefined, + eventEmitter: undefined, + createChart: function() { + throw new Error('Base chart type can\'t be instantiated!'); + }, + update: update, + detach: detach, + on: on, + off: off, + version: Chartist.version, + supportsForeignObject: false + }); + +}(window, document, Chartist)); +;/** + * Chartist SVG module for simple SVG DOM abstraction + * + * @module Chartist.Svg + */ +/* global Chartist */ +(function(window, document, Chartist) { + 'use strict'; + + /** + * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. + * + * @memberof Chartist.Svg + * @constructor + * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg + * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. + * @param {String} className This class or class list will be added to the SVG element + * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child + * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element + */ + function Svg(name, attributes, className, parent, insertFirst) { + // If Svg is getting called with an SVG element we just return the wrapper + if(name instanceof Element) { + this._node = name; + } else { + this._node = document.createElementNS(Chartist.namespaces.svg, name); + + // If this is an SVG element created then custom namespace + if(name === 'svg') { + this.attr({ + 'xmlns:ct': Chartist.namespaces.ct + }); + } + } + + if(attributes) { + this.attr(attributes); + } + + if(className) { + this.addClass(className); + } + + if(parent) { + if (insertFirst && parent._node.firstChild) { + parent._node.insertBefore(this._node, parent._node.firstChild); + } else { + parent._node.appendChild(this._node); + } + } + } + + /** + * Set attributes on the current SVG element of the wrapper you're currently working on. + * + * @memberof Chartist.Svg + * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value. + * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object. + * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function. + */ + function attr(attributes, ns) { + if(typeof attributes === 'string') { + if(ns) { + return this._node.getAttributeNS(ns, attributes); + } else { + return this._node.getAttribute(attributes); + } + } + + Object.keys(attributes).forEach(function(key) { + // If the attribute value is undefined we can skip this one + if(attributes[key] === undefined) { + return; + } + + if (key.indexOf(':') !== -1) { + var namespacedAttribute = key.split(':'); + this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]); + } else { + this._node.setAttribute(key, attributes[key]); + } + }.bind(this)); + + return this; + } + + /** + * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. + * + * @memberof Chartist.Svg + * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper + * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. + * @param {String} [className] This class or class list will be added to the SVG element + * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element + * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data + */ + function elem(name, attributes, className, insertFirst) { + return new Chartist.Svg(name, attributes, className, this, insertFirst); + } + + /** + * Returns the parent Chartist.SVG wrapper object + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null. + */ + function parent() { + return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null; + } + + /** + * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element + */ + function root() { + var node = this._node; + while(node.nodeName !== 'svg') { + node = node.parentNode; + } + return new Chartist.Svg(node); + } + + /** + * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. + * + * @memberof Chartist.Svg + * @param {String} selector A CSS selector that is used to query for child SVG elements + * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found + */ + function querySelector(selector) { + var foundNode = this._node.querySelector(selector); + return foundNode ? new Chartist.Svg(foundNode) : null; + } + + /** + * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. + * + * @memberof Chartist.Svg + * @param {String} selector A CSS selector that is used to query for child SVG elements + * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found + */ + function querySelectorAll(selector) { + var foundNodes = this._node.querySelectorAll(selector); + return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null; + } + + /** + * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. + * + * @memberof Chartist.Svg + * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject + * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added. + * @param {String} [className] This class or class list will be added to the SVG element + * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child + * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element + */ + function foreignObject(content, attributes, className, insertFirst) { + // If content is string then we convert it to DOM + // TODO: Handle case where content is not a string nor a DOM Node + if(typeof content === 'string') { + var container = document.createElement('div'); + container.innerHTML = content; + content = container.firstChild; + } + + // Adding namespace to content element + content.setAttribute('xmlns', Chartist.namespaces.xmlns); + + // Creating the foreignObject without required extension attribute (as described here + // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement) + var fnObj = this.elem('foreignObject', attributes, className, insertFirst); + + // Add content to foreignObjectElement + fnObj._node.appendChild(content); + + return fnObj; + } + + /** + * This method adds a new text element to the current Chartist.Svg wrapper. + * + * @memberof Chartist.Svg + * @param {String} t The text that should be added to the text element that is created + * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element + */ + function text(t) { + this._node.appendChild(document.createTextNode(t)); + return this; + } + + /** + * This method will clear all child nodes of the current wrapper object. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The same wrapper object that got emptied + */ + function empty() { + while (this._node.firstChild) { + this._node.removeChild(this._node.firstChild); + } + + return this; + } + + /** + * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The parent wrapper object of the element that got removed + */ + function remove() { + this._node.parentNode.removeChild(this._node); + return this.parent(); + } + + /** + * This method will replace the element with a new element that can be created outside of the current DOM. + * + * @memberof Chartist.Svg + * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object + * @return {Chartist.Svg} The wrapper of the new element + */ + function replace(newElement) { + this._node.parentNode.replaceChild(newElement._node, this._node); + return newElement; + } + + /** + * This method will append an element to the current element as a child. + * + * @memberof Chartist.Svg + * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child + * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child + * @return {Chartist.Svg} The wrapper of the appended object + */ + function append(element, insertFirst) { + if(insertFirst && this._node.firstChild) { + this._node.insertBefore(element._node, this._node.firstChild); + } else { + this._node.appendChild(element._node); + } + + return this; + } + + /** + * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. + * + * @memberof Chartist.Svg + * @return {Array} A list of classes or an empty array if there are no classes on the current element + */ + function classes() { + return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\s+/) : []; + } + + /** + * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. + * + * @memberof Chartist.Svg + * @param {String} names A white space separated list of class names + * @return {Chartist.Svg} The wrapper of the current element + */ + function addClass(names) { + this._node.setAttribute('class', + this.classes(this._node) + .concat(names.trim().split(/\s+/)) + .filter(function(elem, pos, self) { + return self.indexOf(elem) === pos; + }).join(' ') + ); + + return this; + } + + /** + * Removes one or a space separated list of classes from the current element. + * + * @memberof Chartist.Svg + * @param {String} names A white space separated list of class names + * @return {Chartist.Svg} The wrapper of the current element + */ + function removeClass(names) { + var removedClasses = names.trim().split(/\s+/); + + this._node.setAttribute('class', this.classes(this._node).filter(function(name) { + return removedClasses.indexOf(name) === -1; + }).join(' ')); + + return this; + } + + /** + * Removes all classes from the current element. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The wrapper of the current element + */ + function removeAllClasses() { + this._node.setAttribute('class', ''); + + return this; + } + + /** + * Get element height using `getBoundingClientRect` + * + * @memberof Chartist.Svg + * @return {Number} The elements height in pixels + */ + function height() { + return this._node.getBoundingClientRect().height; + } + + /** + * Get element width using `getBoundingClientRect` + * + * @memberof Chartist.Core + * @return {Number} The elements width in pixels + */ + function width() { + return this._node.getBoundingClientRect().width; + } + + /** + * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve. + * **An animations object could look like this:** + * ```javascript + * element.animate({ + * opacity: { + * dur: 1000, + * from: 0, + * to: 1 + * }, + * x1: { + * dur: '1000ms', + * from: 100, + * to: 200, + * easing: 'easeOutQuart' + * }, + * y1: { + * dur: '2s', + * from: 0, + * to: 100 + * } + * }); + * ``` + * **Automatic unit conversion** + * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds. + * **Guided mode** + * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it. + * If guided mode is enabled the following behavior is added: + * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation + * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation) + * - The animate element will be forced to use `fill="freeze"` + * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately. + * - After the animation the element attribute value will be set to the `to` value of the animation + * - The animate element is deleted from the DOM + * + * @memberof Chartist.Svg + * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode. + * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated. + * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends. + * @return {Chartist.Svg} The current element where the animation was added + */ + function animate(animations, guided, eventEmitter) { + if(guided === undefined) { + guided = true; + } + + Object.keys(animations).forEach(function createAnimateForAttributes(attribute) { + + function createAnimate(animationDefinition, guided) { + var attributeProperties = {}, + animate, + timeout, + easing; + + // Check if an easing is specified in the definition object and delete it from the object as it will not + // be part of the animate element attributes. + if(animationDefinition.easing) { + // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object + easing = animationDefinition.easing instanceof Array ? + animationDefinition.easing : + Chartist.Svg.Easing[animationDefinition.easing]; + delete animationDefinition.easing; + } + + // If numeric dur or begin was provided we assume milli seconds + animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms'); + animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms'); + + if(easing) { + animationDefinition.calcMode = 'spline'; + animationDefinition.keySplines = easing.join(' '); + animationDefinition.keyTimes = '0;1'; + } + + // Adding "fill: freeze" if we are in guided mode and set initial attribute values + if(guided) { + animationDefinition.fill = 'freeze'; + // Animated property on our element should already be set to the animation from value in guided mode + attributeProperties[attribute] = animationDefinition.from; + this.attr(attributeProperties); + + // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin + // which needs to be in ms aside + timeout = Chartist.quantity(animationDefinition.begin || 0).value; + animationDefinition.begin = 'indefinite'; + } + + animate = this.elem('animate', Chartist.extend({ + attributeName: attribute + }, animationDefinition)); + + if(guided) { + // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout + setTimeout(function() { + // If beginElement fails we set the animated attribute to the end position and remove the animate element + // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in + // the browser. (Currently FF 34 does not support animate elements in foreignObjects) + try { + animate._node.beginElement(); + } catch(err) { + // Set animated attribute to current animated value + attributeProperties[attribute] = animationDefinition.to; + this.attr(attributeProperties); + // Remove the animate element as it's no longer required + animate.remove(); + } + }.bind(this), timeout); + } + + if(eventEmitter) { + animate._node.addEventListener('beginEvent', function handleBeginEvent() { + eventEmitter.emit('animationBegin', { + element: this, + animate: animate._node, + params: animationDefinition + }); + }.bind(this)); + } + + animate._node.addEventListener('endEvent', function handleEndEvent() { + if(eventEmitter) { + eventEmitter.emit('animationEnd', { + element: this, + animate: animate._node, + params: animationDefinition + }); + } + + if(guided) { + // Set animated attribute to current animated value + attributeProperties[attribute] = animationDefinition.to; + this.attr(attributeProperties); + // Remove the animate element as it's no longer required + animate.remove(); + } + }.bind(this)); + } + + // If current attribute is an array of definition objects we create an animate for each and disable guided mode + if(animations[attribute] instanceof Array) { + animations[attribute].forEach(function(animationDefinition) { + createAnimate.bind(this)(animationDefinition, false); + }.bind(this)); + } else { + createAnimate.bind(this)(animations[attribute], guided); + } + + }.bind(this)); + + return this; + } + + Chartist.Svg = Chartist.Class.extend({ + constructor: Svg, + attr: attr, + elem: elem, + parent: parent, + root: root, + querySelector: querySelector, + querySelectorAll: querySelectorAll, + foreignObject: foreignObject, + text: text, + empty: empty, + remove: remove, + replace: replace, + append: append, + classes: classes, + addClass: addClass, + removeClass: removeClass, + removeAllClasses: removeAllClasses, + height: height, + width: width, + animate: animate + }); + + /** + * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. + * + * @memberof Chartist.Svg + * @param {String} feature The SVG 1.1 feature that should be checked for support. + * @return {Boolean} True of false if the feature is supported or not + */ + Chartist.Svg.isSupported = function(feature) { + return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1'); + }; + + /** + * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions. + * + * @memberof Chartist.Svg + */ + var easingCubicBeziers = { + easeInSine: [0.47, 0, 0.745, 0.715], + easeOutSine: [0.39, 0.575, 0.565, 1], + easeInOutSine: [0.445, 0.05, 0.55, 0.95], + easeInQuad: [0.55, 0.085, 0.68, 0.53], + easeOutQuad: [0.25, 0.46, 0.45, 0.94], + easeInOutQuad: [0.455, 0.03, 0.515, 0.955], + easeInCubic: [0.55, 0.055, 0.675, 0.19], + easeOutCubic: [0.215, 0.61, 0.355, 1], + easeInOutCubic: [0.645, 0.045, 0.355, 1], + easeInQuart: [0.895, 0.03, 0.685, 0.22], + easeOutQuart: [0.165, 0.84, 0.44, 1], + easeInOutQuart: [0.77, 0, 0.175, 1], + easeInQuint: [0.755, 0.05, 0.855, 0.06], + easeOutQuint: [0.23, 1, 0.32, 1], + easeInOutQuint: [0.86, 0, 0.07, 1], + easeInExpo: [0.95, 0.05, 0.795, 0.035], + easeOutExpo: [0.19, 1, 0.22, 1], + easeInOutExpo: [1, 0, 0, 1], + easeInCirc: [0.6, 0.04, 0.98, 0.335], + easeOutCirc: [0.075, 0.82, 0.165, 1], + easeInOutCirc: [0.785, 0.135, 0.15, 0.86], + easeInBack: [0.6, -0.28, 0.735, 0.045], + easeOutBack: [0.175, 0.885, 0.32, 1.275], + easeInOutBack: [0.68, -0.55, 0.265, 1.55] + }; + + Chartist.Svg.Easing = easingCubicBeziers; + + /** + * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements. + * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`. + * + * @memberof Chartist.Svg + * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll) + * @constructor + */ + function SvgList(nodeList) { + var list = this; + + this.svgElements = []; + for(var i = 0; i < nodeList.length; i++) { + this.svgElements.push(new Chartist.Svg(nodeList[i])); + } + + // Add delegation methods for Chartist.Svg + Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) { + return ['constructor', + 'parent', + 'querySelector', + 'querySelectorAll', + 'replace', + 'append', + 'classes', + 'height', + 'width'].indexOf(prototypeProperty) === -1; + }).forEach(function(prototypeProperty) { + list[prototypeProperty] = function() { + var args = Array.prototype.slice.call(arguments, 0); + list.svgElements.forEach(function(element) { + Chartist.Svg.prototype[prototypeProperty].apply(element, args); + }); + return list; + }; + }); + } + + Chartist.Svg.List = Chartist.Class.extend({ + constructor: SvgList + }); +}(window, document, Chartist)); +;/** + * Chartist SVG path module for SVG path description creation and modification. + * + * @module Chartist.Svg.Path + */ +/* global Chartist */ +(function(window, document, Chartist) { + 'use strict'; + + /** + * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported. + * + * @memberof Chartist.Svg.Path + * @type {Object} + */ + var elementDescriptions = { + m: ['x', 'y'], + l: ['x', 'y'], + c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'], + a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y'] + }; + + /** + * Default options for newly created SVG path objects. + * + * @memberof Chartist.Svg.Path + * @type {Object} + */ + var defaultOptions = { + // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed. + accuracy: 3 + }; + + function element(command, params, pathElements, pos, relative, data) { + var pathElement = Chartist.extend({ + command: relative ? command.toLowerCase() : command.toUpperCase() + }, params, data ? { data: data } : {} ); + + pathElements.splice(pos, 0, pathElement); + } + + function forEachParam(pathElements, cb) { + pathElements.forEach(function(pathElement, pathElementIndex) { + elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) { + cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements); + }); + }); + } + + /** + * Used to construct a new path object. + * + * @memberof Chartist.Svg.Path + * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end) + * @param {Object} options Options object that overrides the default objects. See default options for more details. + * @constructor + */ + function SvgPath(close, options) { + this.pathElements = []; + this.pos = 0; + this.close = close; + this.options = Chartist.extend({}, defaultOptions, options); + } + + /** + * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor. + * + * @memberof Chartist.Svg.Path + * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array. + * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned. + */ + function position(pos) { + if(pos !== undefined) { + this.pos = Math.max(0, Math.min(this.pathElements.length, pos)); + return this; + } else { + return this.pos; + } + } + + /** + * Removes elements from the path starting at the current position. + * + * @memberof Chartist.Svg.Path + * @param {Number} count Number of path elements that should be removed from the current position. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function remove(count) { + this.pathElements.splice(this.pos, count); + return this; + } + + /** + * Use this function to add a new move SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The x coordinate for the move element. + * @param {Number} y The y coordinate for the move element. + * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function move(x, y, relative, data) { + element('M', { + x: +x, + y: +y + }, this.pathElements, this.pos++, relative, data); + return this; + } + + /** + * Use this function to add a new line SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The x coordinate for the line element. + * @param {Number} y The y coordinate for the line element. + * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function line(x, y, relative, data) { + element('L', { + x: +x, + y: +y + }, this.pathElements, this.pos++, relative, data); + return this; + } + + /** + * Use this function to add a new curve SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} x1 The x coordinate for the first control point of the bezier curve. + * @param {Number} y1 The y coordinate for the first control point of the bezier curve. + * @param {Number} x2 The x coordinate for the second control point of the bezier curve. + * @param {Number} y2 The y coordinate for the second control point of the bezier curve. + * @param {Number} x The x coordinate for the target point of the curve element. + * @param {Number} y The y coordinate for the target point of the curve element. + * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function curve(x1, y1, x2, y2, x, y, relative, data) { + element('C', { + x1: +x1, + y1: +y1, + x2: +x2, + y2: +y2, + x: +x, + y: +y + }, this.pathElements, this.pos++, relative, data); + return this; + } + + /** + * Use this function to add a new non-bezier curve SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} rx The radius to be used for the x-axis of the arc. + * @param {Number} ry The radius to be used for the y-axis of the arc. + * @param {Number} xAr Defines the orientation of the arc + * @param {Number} lAf Large arc flag + * @param {Number} sf Sweep flag + * @param {Number} x The x coordinate for the target point of the curve element. + * @param {Number} y The y coordinate for the target point of the curve element. + * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) { + element('A', { + rx: +rx, + ry: +ry, + xAr: +xAr, + lAf: +lAf, + sf: +sf, + x: +x, + y: +y + }, this.pathElements, this.pos++, relative, data); + return this; + } + + /** + * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object. + * + * @memberof Chartist.Svg.Path + * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function parse(path) { + // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']] + var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2') + .replace(/([0-9])([A-Za-z])/g, '$1 $2') + .split(/[\s,]+/) + .reduce(function(result, element) { + if(element.match(/[A-Za-z]/)) { + result.push([]); + } + + result[result.length - 1].push(element); + return result; + }, []); + + // If this is a closed path we remove the Z at the end because this is determined by the close option + if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') { + chunks.pop(); + } + + // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters + // For example {command: 'M', x: '10', y: '10'} + var elements = chunks.map(function(chunk) { + var command = chunk.shift(), + description = elementDescriptions[command.toLowerCase()]; + + return Chartist.extend({ + command: command + }, description.reduce(function(result, paramName, index) { + result[paramName] = +chunk[index]; + return result; + }, {})); + }); + + // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position + var spliceArgs = [this.pos, 0]; + Array.prototype.push.apply(spliceArgs, elements); + Array.prototype.splice.apply(this.pathElements, spliceArgs); + // Increase the internal position by the element count + this.pos += elements.length; + + return this; + } + + /** + * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string. + * + * @memberof Chartist.Svg.Path + * @return {String} + */ + function stringify() { + var accuracyMultiplier = Math.pow(10, this.options.accuracy); + + return this.pathElements.reduce(function(path, pathElement) { + var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) { + return this.options.accuracy ? + (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) : + pathElement[paramName]; + }.bind(this)); + + return path + pathElement.command + params.join(','); + }.bind(this), '') + (this.close ? 'Z' : ''); + } + + /** + * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements. + * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function scale(x, y) { + forEachParam(this.pathElements, function(pathElement, paramName) { + pathElement[paramName] *= paramName[0] === 'x' ? x : y; + }); + return this; + } + + /** + * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements. + * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function translate(x, y) { + forEachParam(this.pathElements, function(pathElement, paramName) { + pathElement[paramName] += paramName[0] === 'x' ? x : y; + }); + return this; + } + + /** + * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path. + * The method signature of the callback function looks like this: + * ```javascript + * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) + * ``` + * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate. + * + * @memberof Chartist.Svg.Path + * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */ + function transform(transformFnc) { + forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) { + var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements); + if(transformed || transformed === 0) { + pathElement[paramName] = transformed; + } + }); + return this; + } + + /** + * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned. + * + * @memberof Chartist.Svg.Path + * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used. + * @return {Chartist.Svg.Path} + */ + function clone(close) { + var c = new Chartist.Svg.Path(close || this.close); + c.pos = this.pos; + c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) { + return Chartist.extend({}, pathElement); + }); + c.options = Chartist.extend({}, this.options); + return c; + } + + /** + * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings. + * + * @memberof Chartist.Svg.Path + * @param {String} command The command you'd like to use to split the path + * @return {Array} + */ + function splitByCommand(command) { + var split = [ + new Chartist.Svg.Path() + ]; + + this.pathElements.forEach(function(pathElement) { + if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) { + split.push(new Chartist.Svg.Path()); + } + + split[split.length - 1].pathElements.push(pathElement); + }); + + return split; + } + + /** + * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths. + * + * @memberof Chartist.Svg.Path + * @param {Array} paths A list of paths to be joined together. The order is important. + * @param {boolean} close If the newly created path should be a closed path + * @param {Object} options Path options for the newly created path. + * @return {Chartist.Svg.Path} + */ + + function join(paths, close, options) { + var joinedPath = new Chartist.Svg.Path(close, options); + for(var i = 0; i < paths.length; i++) { + var path = paths[i]; + for(var j = 0; j < path.pathElements.length; j++) { + joinedPath.pathElements.push(path.pathElements[j]); + } + } + return joinedPath; + } + + Chartist.Svg.Path = Chartist.Class.extend({ + constructor: SvgPath, + position: position, + remove: remove, + move: move, + line: line, + curve: curve, + arc: arc, + scale: scale, + translate: translate, + transform: transform, + parse: parse, + stringify: stringify, + clone: clone, + splitByCommand: splitByCommand + }); + + Chartist.Svg.Path.elementDescriptions = elementDescriptions; + Chartist.Svg.Path.join = join; +}(window, document, Chartist)); +;/* global Chartist */ +(function (window, document, Chartist) { + 'use strict'; + + var axisUnits = { + 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' + } + }; + + function Axis(units, chartRect, ticks, options) { + this.units = units; + this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x; + this.chartRect = chartRect; + this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart]; + this.gridOffset = chartRect[units.rectOffset]; + this.ticks = ticks; + this.options = options; + } + + function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) { + var xy = this.units.pos.toUpperCase(); + var axisOptions = chartOptions['axis' + xy]; + var projectedValues = this.ticks.map(this.projectValue.bind(this)); + var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc); + + var lastWidth=undefined; + projectedValues.forEach(function(projectedValue, index) { + var labelOffset = { + x: 0, + y: 0 + }; + + // TODO: Find better solution for solving this problem + // Calculate how much space we have available for the label + + + var labelLength=0; + + + if (xy == 'Y') { // X doesnt use this + if (projectedValues[index + 1]) { + // If we still have one label ahead, we can calculate the distance to the next tick / label + labelLength = projectedValues[index + 1] - projectedValue; + // lastWidth = labelLength; + // } else if (typeof lastWidth != 'undefined') { + // labelLength = lastWidth; // EDIT. added the lastWidth thing + } else { + // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to + // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will + // still be visible inside of the chart padding. + labelLength = Math.max(this.axisLength - projectedValue, 30); + } + } + + // Skip grid lines and labels where interpolated label values are falsey (execpt for 0) + if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') { + return; + } + + // Transform to global coordinates using the chartRect + // We also need to set the label offset for the createLabel function + if(this.units.pos === 'x') { + projectedValue = this.chartRect.x1 + projectedValue; + labelOffset.x = chartOptions.axisX.labelOffset.x; + + // If the labels should be positioned in start position (top side for vertical axis) we need to set a + // different offset as for positioned with end (bottom) + if(chartOptions.axisX.position === 'start') { + labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); + } else { + labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); + } + } else { + projectedValue = this.chartRect.y1 - projectedValue; + labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0); + + // If the labels should be positioned in start position (left side for horizontal axis) we need to set a + // different offset as for positioned with end (right side) + if(chartOptions.axisY.position === 'start') { + labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10; + } else { + labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10; + } + } + + if(axisOptions.showGrid) { + Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [ + chartOptions.classNames.grid, + chartOptions.classNames[this.units.dir] + ], eventEmitter); + } + + if(axisOptions.showLabel) { + Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [ + chartOptions.classNames.label, + chartOptions.classNames[this.units.dir], + chartOptions.classNames[axisOptions.position] + ], useForeignObject, eventEmitter); + } + }.bind(this)); + } + + Chartist.Axis = Chartist.Class.extend({ + constructor: Axis, + createGridAndLabels: createGridAndLabels, + projectValue: function(value, index, data) { + throw new Error('Base axis can\'t be instantiated!'); + } + }); + + Chartist.Axis.units = axisUnits; + +}(window, document, Chartist)); +;/** + * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart. + * **Options** + * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. + * ```javascript + * var options = { + * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored + * high: 100, + * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored + * low: 0, + * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel). + * scaleMinSpace: 20, + * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only. + * onlyInteger: true, + * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart. + * referenceValue: 5 + * }; + * ``` + * + * @module Chartist.AutoScaleAxis + */ +/* global Chartist */ +(function (window, document, Chartist) { + 'use strict'; + + function AutoScaleAxis(axisUnit, data, chartRect, options) { + // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options + var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); + this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger); + this.range = { + min: this.bounds.min, + max: this.bounds.max + }; + + Chartist.AutoScaleAxis['super'].constructor.call(this, + axisUnit, + chartRect, + this.bounds.values, + options); + } + + function projectValue(value) { + return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range; + } + + Chartist.AutoScaleAxis = Chartist.Axis.extend({ + constructor: AutoScaleAxis, + projectValue: projectValue + }); + +}(window, document, Chartist)); +;/** + * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum. + * **Options** + * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. + * ```javascript + * var options = { + * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored + * high: 100, + * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored + * low: 0, + * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1. + * divisor: 4, + * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated. + * ticks: [1, 10, 20, 30] + * }; + * ``` + * + * @module Chartist.FixedScaleAxis + */ +/* global Chartist */ +(function (window, document, Chartist) { + 'use strict'; + + function FixedScaleAxis(axisUnit, data, chartRect, options) { + var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); + this.divisor = options.divisor || 1; + this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) { + return highLow.low + (highLow.high - highLow.low) / this.divisor * index; + }.bind(this)); + this.ticks.sort(function(a, b) { + return a - b; + }); + this.range = { + min: highLow.low, + max: highLow.high + }; + + Chartist.FixedScaleAxis['super'].constructor.call(this, + axisUnit, + chartRect, + this.ticks, + options); + + this.stepLength = this.axisLength / this.divisor; + } + + function projectValue(value) { + return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min); + } + + Chartist.FixedScaleAxis = Chartist.Axis.extend({ + constructor: FixedScaleAxis, + projectValue: projectValue + }); + +}(window, document, Chartist)); +;/** + * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose. + * **Options** + * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. + * ```javascript + * var options = { + * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks. + * ticks: ['One', 'Two', 'Three'], + * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead. + * stretch: true + * }; + * ``` + * + * @module Chartist.StepAxis + */ +/* global Chartist */ +(function (window, document, Chartist) { + 'use strict'; + + function StepAxis(axisUnit, data, chartRect, options) { + Chartist.StepAxis['super'].constructor.call(this, + axisUnit, + chartRect, + options.ticks, + options); + + this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0)); + } + + function projectValue(value, index) { + return this.stepLength * index; + } + + Chartist.StepAxis = Chartist.Axis.extend({ + constructor: StepAxis, + projectValue: projectValue + }); + +}(window, document, Chartist)); +;/** + * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point. + * + * For examples on how to use the line chart please check the examples of the `Chartist.Line` method. + * + * @module Chartist.Line + */ +/* global Chartist */ +(function(window, document, Chartist){ + 'use strict'; + + /** + * Default options in line charts. Expand the code view to see a detailed list of options with comments. + * + * @memberof Chartist.Line + */ + var defaultOptions = { + // Options for X-Axis + axisX: { + // The offset of the labels to the chart area + offset: 30, + // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position: 'end', + // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset: { + x: 0, + y: 0 + }, + // If labels should be shown or not + showLabel: true, + // If the axis grid should be drawn or not + showGrid: true, + // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc: Chartist.noop, + // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + type: undefined + }, + // Options for Y-Axis + axisY: { + // The offset of the labels to the chart area + offset: 40, + // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position: 'start', + // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset: { + x: 0, + y: 0 + }, + // If labels should be shown or not + showLabel: true, + // If the axis grid should be drawn or not + showGrid: true, + // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc: Chartist.noop, + // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + type: undefined, + // This value specifies the minimum height in pixel of the scale steps + scaleMinSpace: 20, + // Use only integer values (whole numbers) for the scale steps + onlyInteger: false + }, + // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + width: undefined, + // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + height: undefined, + // If the line should be drawn or not + showLine: true, + // If dots should be drawn or not + showPoint: true, + // If the line chart should draw an area + showArea: false, + // The base for the area chart that will be used to close the area shape (is normally 0) + areaBase: 0, + // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description. + lineSmooth: true, + // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + low: undefined, + // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + high: undefined, + // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + chartPadding: { + top: 15, + right: 15, + bottom: 5, + left: 10 + }, + // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. + fullWidth: false, + // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + reverseData: false, + // Override the class names that get used to generate the SVG structure of the chart + 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' + } + }; + + /** + * Creates a new chart + * + */ + function createChart(options) { + this.data = Chartist.normalizeData(this.data); + var data = { + raw: this.data, + normalized: Chartist.getDataArray(this.data, options.reverseData, true) + }; + + // Create new svg object + this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); + // Create groups for labels, grid and series + var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); + var seriesGroup = this.svg.elem('g'); + var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); + + var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); + var axisX, axisY; + + if(options.axisX.type === undefined) { + axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { + ticks: data.raw.labels, + stretch: options.fullWidth + })); + } else { + axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); + } + + if(options.axisY.type === undefined) { + axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { + high: Chartist.isNum(options.high) ? options.high : options.axisY.high, + low: Chartist.isNum(options.low) ? options.low : options.axisY.low + })); + } else { + axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); + } + + axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); + axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); + + // Draw the series + data.raw.series.forEach(function(series, seriesIndex) { + var seriesElement = seriesGroup.elem('g'); + + // Write attributes to series group element. If series name or meta is undefined the attributes will not be written + seriesElement.attr({ + 'ct:series-name': series.name, + 'ct:meta': Chartist.serialize(series.meta) + }); + + // Use series class from series data or if not set generate one + seriesElement.addClass([ + options.classNames.series, + (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) + ].join(' ')); + + var pathCoordinates = [], + pathData = []; + + data.normalized[seriesIndex].forEach(function(value, valueIndex) { + var p = { + x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]), + y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex]) + }; + pathCoordinates.push(p.x, p.y); + pathData.push({ + value: value, + valueIndex: valueIndex, + meta: Chartist.getMetaData(series, valueIndex) + }); + }.bind(this)); + + var seriesOptions = { + lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'), + showPoint: Chartist.getSeriesOption(series, options, 'showPoint'), + showLine: Chartist.getSeriesOption(series, options, 'showLine'), + showArea: Chartist.getSeriesOption(series, options, 'showArea'), + areaBase: Chartist.getSeriesOption(series, options, 'areaBase') + }; + + var smoothing = typeof seriesOptions.lineSmooth === 'function' ? + seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none()); + // Interpolating path where pathData will be used to annotate each path element so we can trace back the original + // index, value and meta data + var path = smoothing(pathCoordinates, pathData); + + // If we should show points we need to create them now to avoid secondary loop + // Points are drawn from the pathElements returned by the interpolation function + // Small offset for Firefox to render squares correctly + if (seriesOptions.showPoint) { + + path.pathElements.forEach(function(pathElement) { + var point = seriesElement.elem('line', { + x1: pathElement.x, + y1: pathElement.y, + x2: pathElement.x + 0.01, + y2: pathElement.y + }, options.classNames.point).attr({ + 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','), + 'ct:meta': pathElement.data.meta + }); + + this.eventEmitter.emit('draw', { + type: 'point', + value: pathElement.data.value, + index: pathElement.data.valueIndex, + meta: pathElement.data.meta, + series: series, + seriesIndex: seriesIndex, + axisX: axisX, + axisY: axisY, + group: seriesElement, + element: point, + x: pathElement.x, + y: pathElement.y + }); + }.bind(this)); + } + + if(seriesOptions.showLine) { + var line = seriesElement.elem('path', { + d: path.stringify() + }, options.classNames.line, true); + + this.eventEmitter.emit('draw', { + type: 'line', + values: data.normalized[seriesIndex], + path: path.clone(), + chartRect: chartRect, + index: seriesIndex, + series: series, + seriesIndex: seriesIndex, + axisX: axisX, + axisY: axisY, + group: seriesElement, + element: line + }); + } + + // Area currently only works with axes that support a range! + if(seriesOptions.showArea && axisY.range) { + // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that + // the area is not drawn outside the chart area. + var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min); + + // We project the areaBase value into screen coordinates + var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase); + + // In order to form the area we'll first split the path by move commands so we can chunk it up into segments + path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) { + // We filter only "solid" segments that contain more than one point. Otherwise there's no need for an area + return pathSegment.pathElements.length > 1; + }).map(function convertToArea(solidPathSegments) { + // Receiving the filtered solid path segments we can now convert those segments into fill areas + var firstElement = solidPathSegments.pathElements[0]; + var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1]; + + // Cloning the solid path segment with closing option and removing the first move command from the clone + // We then insert a new move that should start at the area base and draw a straight line up or down + // at the end of the path we add an additional straight line to the projected area base value + // As the closing option is set our path will be automatically closed + return solidPathSegments.clone(true) + .position(0) + .remove(1) + .move(firstElement.x, areaBaseProjected) + .line(firstElement.x, firstElement.y) + .position(solidPathSegments.pathElements.length + 1) + .line(lastElement.x, areaBaseProjected); + + }).forEach(function createArea(areaPath) { + // For each of our newly created area paths, we'll now create path elements by stringifying our path objects + // and adding the created DOM elements to the correct series group + var area = seriesElement.elem('path', { + d: areaPath.stringify() + }, options.classNames.area, true); + + // Emit an event for each area that was drawn + this.eventEmitter.emit('draw', { + type: 'area', + values: data.normalized[seriesIndex], + path: areaPath.clone(), + series: series, + seriesIndex: seriesIndex, + axisX: axisX, + axisY: axisY, + chartRect: chartRect, + index: seriesIndex, + group: seriesElement, + element: area + }); + }.bind(this)); + } + }.bind(this)); + + this.eventEmitter.emit('created', { + bounds: axisY.bounds, + chartRect: chartRect, + axisX: axisX, + axisY: axisY, + svg: this.svg, + options: options + }); + } + + /** + * This method creates a new line chart. + * + * @memberof Chartist.Line + * @param {String|Node} query A selector query string or directly a DOM element + * @param {Object} data The data object that needs to consist of a labels and a series array + * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. + * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] + * @return {Object} An object which exposes the API for the created chart + * + * @example + * // Create a simple line chart + * var data = { + * // A labels array that can contain any sort of values + * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], + * // Our series array that contains series objects or in this case series data arrays + * series: [ + * [5, 2, 4, 2, 0] + * ] + * }; + * + * // As options we currently only set a static size of 300x200 px + * var options = { + * width: '300px', + * height: '200px' + * }; + * + * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options + * new Chartist.Line('.ct-chart', data, options); + * + * @example + * // Use specific interpolation function with configuration from the Chartist.Interpolation module + * + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [ + * [1, 1, 8, 1, 7] + * ] + * }, { + * lineSmooth: Chartist.Interpolation.cardinal({ + * tension: 0.2 + * }) + * }); + * + * @example + * // Create a line chart with responsive options + * + * var data = { + * // A labels array that can contain any sort of values + * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], + * // Our series array that contains series objects or in this case series data arrays + * series: [ + * [5, 2, 4, 2, 0] + * ] + * }; + * + * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries. + * var responsiveOptions = [ + * ['screen and (min-width: 641px) and (max-width: 1024px)', { + * showPoint: false, + * axisX: { + * labelInterpolationFnc: function(value) { + * // Will return Mon, Tue, Wed etc. on medium screens + * return value.slice(0, 3); + * } + * } + * }], + * ['screen and (max-width: 640px)', { + * showLine: false, + * axisX: { + * labelInterpolationFnc: function(value) { + * // Will return M, T, W etc. on small screens + * return value[0]; + * } + * } + * }] + * ]; + * + * new Chartist.Line('.ct-chart', data, null, responsiveOptions); + * + */ + function Line(query, data, options, responsiveOptions) { + Chartist.Line['super'].constructor.call(this, + query, + data, + defaultOptions, + Chartist.extend({}, defaultOptions, options), + responsiveOptions); + } + + // Creating line chart type in Chartist namespace + Chartist.Line = Chartist.Base.extend({ + constructor: Line, + createChart: createChart + }); + +}(window, document, Chartist)); +;/** + * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts. + * + * @module Chartist.Bar + */ +/* global Chartist */ +(function(window, document, Chartist){ + 'use strict'; + + /** + * Default options in bar charts. Expand the code view to see a detailed list of options with comments. + * + * @memberof Chartist.Bar + */ + var defaultOptions = { + // Options for X-Axis + axisX: { + // The offset of the chart drawing area to the border of the container + offset: 30, + // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position: 'end', + // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset: { + x: 0, + y: 0 + }, + // If labels should be shown or not + showLabel: true, + // If the axis grid should be drawn or not + showGrid: true, + // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc: Chartist.noop, + // This value specifies the minimum width in pixel of the scale steps + scaleMinSpace: 30, + // Use only integer values (whole numbers) for the scale steps + onlyInteger: false + }, + // Options for Y-Axis + axisY: { + // The offset of the chart drawing area to the border of the container + offset: 40, + // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position: 'start', + // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset: { + x: 0, + y: 0 + }, + // If labels should be shown or not + showLabel: true, + // If the axis grid should be drawn or not + showGrid: true, + // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc: Chartist.noop, + // This value specifies the minimum height in pixel of the scale steps + scaleMinSpace: 20, + // Use only integer values (whole numbers) for the scale steps + onlyInteger: false + }, + // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + width: undefined, + // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + height: undefined, + // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + high: undefined, + // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + low: undefined, + // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + chartPadding: { + top: 15, + right: 15, + bottom: 5, + left: 10 + }, + // Specify the distance in pixel of bars in a group + seriesBarDistance: 15, + // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options. + stackBars: false, + // If set to 'overlap' this property will force the stacked bars to draw from the zero line. + // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. + stackMode: 'accumulate', + // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values. + horizontalBars: false, + // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time. + distributeSeries: false, + // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + reverseData: false, + // Override the class names that get used to generate the SVG structure of the chart + 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' + } + }; + + /** + * Creates a new chart + * + */ + function createChart(options) { + this.data = Chartist.normalizeData(this.data); + var data = { + raw: this.data, + normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) { + return [value]; + }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y') + }; + + var highLow; + + // Create new svg element + this.svg = Chartist.createSvg( + this.container, + options.width, + options.height, + options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '') + ); + + // Drawing groups in correct order + var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); + var seriesGroup = this.svg.elem('g'); + var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); + + if(options.stackBars && data.normalized.length !== 0) { + // If stacked bars we need to calculate the high low from stacked values from each series + var serialSums = Chartist.serialMap(data.normalized, function serialSums() { + return Array.prototype.slice.call(arguments).map(function(value) { + return value; + }).reduce(function(prev, curr) { + return { + x: prev.x + (curr && curr.x) || 0, + y: prev.y + (curr && curr.y) || 0 + }; + }, {x: 0, y: 0}); + }); + + highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, { + referenceValue: 0 + }), options.horizontalBars ? 'x' : 'y'); + } else { + highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, { + referenceValue: 0 + }), options.horizontalBars ? 'x' : 'y'); + } + // Overrides of high / low from settings + highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high); + highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low); + + var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); + + var valueAxis, + labelAxisTicks, + labelAxis, + axisX, + axisY; + + // We need to set step count based on some options combinations + if(options.distributeSeries && options.stackBars) { + // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should + // use only the first label for the step axis + labelAxisTicks = data.raw.labels.slice(0, 1); + } else { + // If distributed series are enabled but stacked bars aren't, we should use the series labels + // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array + // as the bars are normalized + labelAxisTicks = data.raw.labels; + } + + // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary. + if(options.horizontalBars) { + if(options.axisX.type === undefined) { + valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { + highLow: highLow, + referenceValue: 0 + })); + } else { + valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { + highLow: highLow, + referenceValue: 0 + })); + } + + if(options.axisY.type === undefined) { + labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, { + ticks: labelAxisTicks + }); + } else { + labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); + } + } else { + if(options.axisX.type === undefined) { + labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, { + ticks: labelAxisTicks + }); + } else { + labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); + } + + if(options.axisY.type === undefined) { + valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { + highLow: highLow, + referenceValue: 0 + })); + } else { + valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { + highLow: highLow, + referenceValue: 0 + })); + } + } + + // Projected 0 point + var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0)); + // Used to track the screen coordinates of stacked bars + var stackedBarValues = []; + + labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); + valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); + + // Draw the series + data.raw.series.forEach(function(series, seriesIndex) { + // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc. + var biPol = seriesIndex - (data.raw.series.length - 1) / 2; + // Half of the period width between vertical grid lines used to position bars + var periodHalfLength; + // Current series SVG element + var seriesElement; + + // We need to set periodHalfLength based on some options combinations + if(options.distributeSeries && !options.stackBars) { + // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array + // which is the series count and divide by 2 + periodHalfLength = labelAxis.axisLength / data.normalized.length / 2; + } else if(options.distributeSeries && options.stackBars) { + // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis + // length by 2 + periodHalfLength = labelAxis.axisLength / 2; + } else { + // On regular bar charts we should just use the series length + periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2; + } + + // Adding the series group to the series element + seriesElement = seriesGroup.elem('g'); + + // Write attributes to series group element. If series name or meta is undefined the attributes will not be written + seriesElement.attr({ + 'ct:series-name': series.name, + 'ct:meta': Chartist.serialize(series.meta) + }); + + // Use series class from series data or if not set generate one + seriesElement.addClass([ + options.classNames.series, + (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) + ].join(' ')); + + data.normalized[seriesIndex].forEach(function(value, valueIndex) { + var projected, + bar, + previousStack, + labelAxisValueIndex; + + // We need to set labelAxisValueIndex based on some options combinations + if(options.distributeSeries && !options.stackBars) { + // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection + // on the step axis for label positioning + labelAxisValueIndex = seriesIndex; + } else if(options.distributeSeries && options.stackBars) { + // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use + // 0 for projection on the label step axis + labelAxisValueIndex = 0; + } else { + // On regular bar charts we just use the value index to project on the label step axis + labelAxisValueIndex = valueIndex; + } + + // We need to transform coordinates differently based on the chart layout + if(options.horizontalBars) { + projected = { + x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]), + y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex]) + }; + } else { + projected = { + x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]), + y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex]) + } + } + + // If the label axis is a step based axis we will offset the bar into the middle of between two steps using + // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using + // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not + // add any automated positioning. + if(labelAxis instanceof Chartist.StepAxis) { + // Offset to center bar between grid lines, but only if the step axis is not stretched + if(!labelAxis.options.stretch) { + projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1); + } + // Using bi-polar offset for multiple series if no stacked bars or series distribution is used + projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1); + } + + // Enter value in stacked bar values used to remember previous screen value for stacking up bars + previousStack = stackedBarValues[valueIndex] || zeroPoint; + stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]); + + // Skip if value is undefined + if(value === undefined) { + return; + } + + var positions = {}; + positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos]; + positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos]; + + if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) { + // Stack mode: accumulate (default) + // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line + // We want backwards compatibility, so the expected fallback without the 'stackMode' option + // to be the original behaviour (accumulate) + positions[labelAxis.counterUnits.pos + '1'] = previousStack; + positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex]; + } else { + // Draw from the zero line normally + // This is also the same code for Stack mode: overlap + positions[labelAxis.counterUnits.pos + '1'] = zeroPoint; + positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos]; + } + + // Limit x and y so that they are within the chart rect + positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2); + positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2); + positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1); + positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1); + + // Create bar element + bar = seriesElement.elem('line', positions, options.classNames.bar).attr({ + 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','), + 'ct:meta': Chartist.getMetaData(series, valueIndex) + }); + + this.eventEmitter.emit('draw', Chartist.extend({ + type: 'bar', + value: value, + index: valueIndex, + meta: Chartist.getMetaData(series, valueIndex), + series: series, + seriesIndex: seriesIndex, + axisX: axisX, + axisY: axisY, + chartRect: chartRect, + group: seriesElement, + element: bar + }, positions)); + }.bind(this)); + }.bind(this)); + + this.eventEmitter.emit('created', { + bounds: valueAxis.bounds, + chartRect: chartRect, + axisX: axisX, + axisY: axisY, + svg: this.svg, + options: options + }); + } + + /** + * This method creates a new bar chart and returns API object that you can use for later changes. + * + * @memberof Chartist.Bar + * @param {String|Node} query A selector query string or directly a DOM element + * @param {Object} data The data object that needs to consist of a labels and a series array + * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. + * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] + * @return {Object} An object which exposes the API for the created chart + * + * @example + * // Create a simple bar chart + * var data = { + * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], + * series: [ + * [5, 2, 4, 2, 0] + * ] + * }; + * + * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object. + * new Chartist.Bar('.ct-chart', data); + * + * @example + * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10 + * new Chartist.Bar('.ct-chart', { + * labels: [1, 2, 3, 4, 5, 6, 7], + * series: [ + * [1, 3, 2, -5, -3, 1, -6], + * [-5, -2, -4, -1, 2, -3, 1] + * ] + * }, { + * seriesBarDistance: 12, + * low: -10, + * high: 10 + * }); + * + */ + function Bar(query, data, options, responsiveOptions) { + Chartist.Bar['super'].constructor.call(this, + query, + data, + defaultOptions, + Chartist.extend({}, defaultOptions, options), + responsiveOptions); + } + + // Creating bar chart type in Chartist namespace + Chartist.Bar = Chartist.Base.extend({ + constructor: Bar, + createChart: createChart + }); + +}(window, document, Chartist)); +; +return Chartist; + +})); + +(function (root, factory) { + // if (typeof define === 'function' && define.amd) { + // // AMD. Register as an anonymous module. + // define([], function () { + // return (root.returnExportsGlobal = factory()); + // }); + // } else if (typeof exports === 'object') { + // // Node. Does not work with strict CommonJS, but + // // only CommonJS-like enviroments that support module.exports, + // // like Node. + // module.exports = factory(); + // } else { + root['Chartist.plugins.ctAxisTitle'] = factory(); + // } +}(this, function () { + + /** + * Chartist.js plugin to display a title for 1 or 2 axises. + * + */ + /* global Chartist */ + (function (window, document, Chartist) { + 'use strict'; + + var axisDefaults = { + axisTitle: '', + axisClass: 'ct-axis-title', + offset: { + x: 0, + y: 0 + }, + textAnchor: 'middle', + flipText: false + }; + var defaultOptions = { + axisX: axisDefaults, + axisY: axisDefaults + }; + + Chartist.plugins = Chartist.plugins || {}; + Chartist.plugins.ctAxisTitle = function (options) { + + options = Chartist.extend({}, defaultOptions, options); + + return function ctAxisTitle(chart) { + + chart.on('created', function (data) { + // + // if (!options.axisX.axisTitle && !options.axisY.axisTitle) { + // throw new Error('ctAxisTitle plugin - You must provide at least one axis title'); + // } else if (!data.axisX && !data.axisY) { + // throw new Error('ctAxisTitle plugin can only be used on charts that have at least one axis'); + // } + + var xPos; + var yPos; + var title; + + //position axis X title + if (options.axisX.axisTitle && data.axisX) { + + xPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left; + + yPos = data.options.chartPadding.top; + + if (data.options.axisY.position === 'end') { + xPos -= data.options.axisY.offset; + } + + if (data.options.axisX.position === 'end') { + yPos += data.axisY.axisLength; + } + + title = new Chartist.Svg("text"); + title.addClass(options.axisX.axisClass); + title.text(options.axisX.axisTitle); + title.attr({ + x: xPos + options.axisX.offset.x, + y: yPos + options.axisX.offset.y, + "text-anchor": options.axisX.textAnchor + }); + + data.svg.append(title, true); + + } + + //position axis Y title + if (options.axisY.axisTitle && data.axisY) { + xPos = 0; + + + yPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top; + + if (data.options.axisX.position === 'start') { + yPos += data.options.axisX.offset; + } + + if (data.options.axisY.position === 'end') { + xPos = data.axisX.axisLength; + } + + var transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')'; + + title = new Chartist.Svg("text"); + title.addClass(options.axisY.axisClass); + title.text(options.axisY.axisTitle); + title.attr({ + x: xPos + options.axisY.offset.x, + y: yPos + options.axisY.offset.y, + transform: transform, + "text-anchor": options.axisY.textAnchor + }); + + data.svg.append(title, true); + + } + + }); + }; + }; + + }(window, document, Chartist)); + + return Chartist.plugins.ctAxisTitle; + +})); + +(function (root, factory) { + // if (typeof define === 'function' && define.amd) { + // // AMD. Register as an anonymous module. + // define([], function () { + // return (root.returnExportsGlobal = factory()); + // }); + // } else if (typeof exports === 'object') { + // // Node. Does not work with strict CommonJS, but + // // only CommonJS-like enviroments that support module.exports, + // // like Node. + // module.exports = factory(); + // } else { + root['Chartist.plugins.zoom'] = factory(); + // } +}(this, function () { + + /** + * Chartist.js zoom plugin. + * + */ + (function (window, document, Chartist) { + 'use strict'; + + var defaultOptions = { + // onZoom + // resetOnRightMouseBtn + }; + + + Chartist.plugins = Chartist.plugins || {}; + Chartist.plugins.zoom = function (options) { + + options = Chartist.extend({}, defaultOptions, options); + + return function zoom(chart) { + + if (!(chart instanceof Chartist.Line)) { + return; + } + + var rect, svg, axisX, axisY, chartRect; + var downPosition; + var onZoom = options.onZoom; + var ongoingTouches = []; + + chart.on('draw', function (data) { + var type = data.type; + if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') { + data.element.attr({ + 'clip-path': 'url(#zoom-mask)' + }); + } + }); + + chart.on('created', function (data) { + axisX = data.axisX; + axisY = data.axisY; + chartRect = data.chartRect; + svg = data.svg._node; + rect = data.svg.elem('rect', { + x: 10, + y: 10, + width: 100, + height: 100, + }, 'ct-zoom-rect'); + hide(rect); + + var defs = data.svg.querySelector('defs') || data.svg.elem('defs'); + var width = chartRect.width(); + var height = chartRect.height(); + + defs + .elem('clipPath', { + id: 'zoom-mask' + }) + .elem('rect', { + x: chartRect.x1, + y: chartRect.y2, + width: width, + height: height, + fill: 'white' + }); + + svg.addEventListener('mousedown', onMouseDown); + svg.addEventListener('mouseup', onMouseUp); + svg.addEventListener('mousemove', onMouseMove); + svg.addEventListener('touchstart', onTouchStart); + svg.addEventListener('touchmove', onTouchMove); + svg.addEventListener('touchend', onTouchEnd); + svg.addEventListener('touchcancel', onTouchCancel); + }); + + function copyTouch(touch) { + var p = position(touch, svg); + p.id = touch.identifier; + return p; + } + + function ongoingTouchIndexById(idToFind) { + for (var i = 0; i < ongoingTouches.length; i++) { + var id = ongoingTouches[i].id; + if (id === idToFind) { + return i; + } + } + return -1; + } + + function onTouchStart(event) { + var touches = event.changedTouches; + for (var i = 0; i < touches.length; i++) { + ongoingTouches.push(copyTouch(touches[i])); + } + + if (ongoingTouches.length > 1) { + rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); + show(rect); + } + } + + function onTouchMove(event) { + var touches = event.changedTouches; + for (var i = 0; i < touches.length; i++) { + var idx = ongoingTouchIndexById(touches[i].identifier); + ongoingTouches.splice(idx, 1, copyTouch(touches[i])); + } + + if (ongoingTouches.length > 1) { + rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); + show(rect); + event.preventDefault(); + } + } + + function onTouchCancel(event) { + removeTouches(event.changedTouches); + } + + function removeTouches(touches) { + for (var i = 0; i < touches.length; i++) { + var idx = ongoingTouchIndexById(touches[i].identifier); + if (idx >= 0) { + ongoingTouches.splice(idx, 1); + } + } + } + + function onTouchEnd(event) { + if (ongoingTouches.length > 1) { + zoomIn(getRect(ongoingTouches[0], ongoingTouches[1])); + } + removeTouches(event.changedTouches); + hide(rect); + } + + function onMouseDown(event) { + if (event.button === 0) { + downPosition = position(event, svg); + rect.attr(getRect(downPosition, downPosition)); + show(rect); + event.preventDefault(); + } + } + + var reset = function () { + chart.options.axisX.highLow = null; + chart.options.axisY.highLow = null; + chart.update(chart.data, chart.options); + }; + + function onMouseUp(event) { + if (event.button === 0) { + var box = getRect(downPosition, position(event, svg)); + zoomIn(box); + downPosition = null; + hide(rect); + event.preventDefault(); + } + else if (options.resetOnRightMouseBtn && event.button === 2) { + reset(); + event.preventDefault(); + } + } + + function zoomIn(rect) { + if (rect.width > 5 && rect.height > 5) { + var x1 = rect.x - chartRect.x1; + var x2 = x1 + rect.width; + var y2 = chartRect.y1 - rect.y; + var y1 = y2 - rect.height; + + var xLow = project(x1, axisX); + var xHigh = project(x2, axisX); + var yLow = project(y1, axisY); + var yHigh = project(y2, axisY); + + var explb = chart.options.explicitBounds; + if (!_.isUndefined(explb)) { + if (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow); + if (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh); + if (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow); + if (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh); + } + + chart.options.axisX.highLow = {low: xLow, high: xHigh}; + chart.options.axisY.highLow = {low: yLow, high: yHigh}; + + chart.update(chart.data, chart.options); + onZoom && onZoom(chart, reset); + } + } + + function onMouseMove(event) { + if (downPosition) { + var point = position(event, svg); + rect.attr(getRect(downPosition, point)); + event.preventDefault(); + } + } + }; + + }; + + function hide(rect) { + rect.attr({style: 'display:none'}); + } + + function show(rect) { + rect.attr({style: 'display:block'}); + } + + function getRect(firstPoint, secondPoint) { + var x = firstPoint.x; + var y = firstPoint.y; + var width = secondPoint.x - x; + var height = secondPoint.y - y; + if (width < 0) { + width = -width; + x = secondPoint.x; + } + if (height < 0) { + height = -height; + y = secondPoint.y; + } + return { + x: x, + y: y, + width: width, + height: height + }; + } + + function position(event, svg) { + return transform(event.clientX, event.clientY, svg); + } + + function transform(x, y, svgElement) { + var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement; + var matrix = svg.getScreenCTM(); + var point = svg.createSVGPoint(); + point.x = x; + point.y = y; + point = point.matrixTransform(matrix.inverse()); + return point || {x: 0, y: 0}; + } + + function project(value, axis) { + var max = axis.bounds.max; + var min = axis.bounds.min; + if (axis.scale && axis.scale.type === 'log') { + var base = axis.scale.base; + return Math.pow(base, + value * baseLog(max / min, base) / axis.axisLength) * min; + } + return (value * axis.bounds.range / axis.axisLength) + min; + } + + function baseLog(val, base) { + return Math.log(val) / Math.log(base); + } + + }(window, document, Chartist)); + return Chartist.plugins.zoom; + +})); + +/** + * @license + * lodash 4.6.1 (Custom Build) + * Build: `lodash include="range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined" exports="global" -d` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.6.1'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used to compose bitmasks for comparison styles. */ + var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + NAN = 0 / 0; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, + reUnescapedHtml = /[&<>"'`]/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; + + /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dateTag] = typedArrayTags[errorTag] = + typedArrayTags[funcTag] = typedArrayTags[mapTag] = + typedArrayTags[numberTag] = typedArrayTags[objectTag] = + typedArrayTags[regexpTag] = typedArrayTags[setTag] = + typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = + cloneableTags[dateTag] = cloneableTags[float32Tag] = + cloneableTags[float64Tag] = cloneableTags[int8Tag] = + cloneableTags[int16Tag] = cloneableTags[int32Tag] = + cloneableTags[mapTag] = cloneableTags[numberTag] = + cloneableTags[objectTag] = cloneableTags[regexpTag] = + cloneableTags[setTag] = cloneableTags[stringTag] = + cloneableTags[symbolTag] = cloneableTags[uint8Tag] = + cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = + cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + '`': '`' + }; + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; + + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /*--------------------------------------------------------------------------*/ + + /** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ + function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. + map.set(pair[0], pair[1]); + return map; + } + + /** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ + function addSetEntry(set, value) { + set.add(value); + return set; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the new array of key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Converts `map` to an array. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the converted array. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Converts `set` to an array. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the converted array. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(chr) { + return htmlUnescapes[chr]; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototypeOf = Object.getPrototypeOf, + getOwnPropertySymbols = Object.getOwnPropertySymbols, + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeKeys = Object.keys, + nativeMax = Math.max; + + /* Built-in method references that are verified to be native. */ + var Map = getNative(root, 'Map'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var mapCtorString = Map ? funcToString.call(Map) : '', + setCtorString = Set ? funcToString.call(Set) : '', + weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chaining. Methods that operate on and return arrays, collections, and + * functions can be chained together. Methods that retrieve a single value or + * may return a primitive value will automatically end the chain sequence and + * return the unwrapped value. Otherwise, the value must be unwrapped with + * `_#value`. + * + * Explicit chaining, which must be unwrapped with `_#value` in all cases, + * may be enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. Shortcut + * fusion is an optimization to merge iteratee calls; this avoids the creation + * of intermediate arrays and can greatly reduce the number of iteratee executions. + * Sections of a chain sequence qualify for shortcut fusion if the section is + * applied to an array of at least two hundred elements and any iteratees + * accept only one argument. The heuristic for whether a section qualifies + * for shortcut fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`, + * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`, + * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`, + * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, + * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, + * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, + * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, + * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, + * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`, + * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, + * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, + * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, + * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, + * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, + * `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`, + * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`, + * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`, + * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`, + * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`, + * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`, + * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, + * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`, + * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, + * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, + * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`, + * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`, + * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`, + * `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash() { + // No operation performed. + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ + function Hash() {} + + /** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ + function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache object. + */ + function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function Stack(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = { 'array': [], 'map': null }; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + array = data.array; + + return array ? assocDelete(array, key) : data.map['delete'](key); + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + var data = this.__data__, + array = data.array; + + return array ? assocGet(array, key) : data.map.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + var data = this.__data__, + array = data.array; + + return array ? assocHas(array, key) : data.map.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache object. + */ + function stackSet(key, value) { + var data = this.__data__, + array = data.array; + + if (array) { + if (array.length < (LARGE_ARRAY_SIZE - 1)) { + assocSet(array, key, value); + } else { + data.array = null; + data.map = new MapCache(array); + } + } + var map = data.map; + if (map) { + map.set(key, value); + } + return this; + } + + /*------------------------------------------------------------------------*/ + + /** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; + } + + /** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; + } + + /** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function assocHas(array, key) { + return assocIndexOf(array, key) > -1; + } + + /** + * Gets the index at which the first occurrence of `key` is found in `array` + * of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ + function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the array-like object. + */ + function baseCastFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ + function baseCastPath(value) { + return isArray(value) ? value : stringToPath(value); + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + result = baseAssign(result, value); + return isFull ? copySymbols(value, result) : result; + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + // Recursively populate clone (susceptible to call stack limits). + (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return (isFull && !isArr) ? copySymbols(value, result) : result; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = isKey(path, object) ? [path + ''] : baseCastPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, + // that are composed entirely of index properties, return `false` for + // `hasOwnProperty` checks of them. + return hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototypeOf(object) === null); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return key in Object(object); + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + stack || (stack = new Stack); + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack, + result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; + + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + var type = typeof value; + if (type == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (type == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + return nativeKeys(Object(object)); + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + return object[key] === value && + (value !== undefined || (key in Object(object))); + }; + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ + function baseMatchesProperty(path, srcValue) { + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments to numbers. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the new array of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @returns {Object} Returns the cloned map. + */ + function cloneMap(map) { + return arrayReduce(mapToArray(map), addMapEntry, new map.constructor); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @returns {Object} Returns the cloned set. + */ + function cloneSet(set) { + return arrayReduce(setToArray(set), addSetEntry, new set.constructor); + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object) { + return copyObjectWith(source, props, object); + } + + /** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; + } + + /** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toNumber(start); + start = start === start ? start : 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var index = -1, + isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(array, other); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isUnordered) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + result = false; + break; + } + } + stack['delete'](array); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) ? other != +other : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings primitives and string + // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + // Recursively compare objects (susceptible to call stack limits). + return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other)); + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : baseHas(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(object, other); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + return result; + } + + /** + * Gets the appropriate "iteratee" function. If the `_.iteratee` method is + * customized this function returns the custom method, otherwise it returns + * `baseIteratee`. If arguments are provided the chosen function is invoked + * with them and its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = toPairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Creates an array of the own symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = getOwnPropertySymbols || function() { + return []; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function getTag(value) { + return objectToString.call(value); + } + + // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. + if ((Map && getTag(new Map) != mapTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : null, + ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case mapCtorString: return mapTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + if (object == null) { + return false; + } + var result = hasFunc(object, path); + if (!result && !isKey(path)) { + path = baseCastPath(path); + object = parent(object, path); + if (object != null) { + path = last(path); + result = hasFunc(object, path); + } + } + var length = object ? object.length : undefined; + return result || ( + !!length && isLength(length) && isIndex(path, length) && + (isArray(object) || isString(object) || isArguments(object)) + ); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototypeOf(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object); + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ + function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (typeof value == 'number') { + return true; + } + return !isArray(value) && + (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object))); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + function stringToPath(string) { + var result = []; + toString(string).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; + } + + /*------------------------------------------------------------------------*/ + + /** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" property + * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` + * for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(value) { + * console.log(value); + * }); + * // => logs `1` then `2` + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => logs 'a' then 'b' (iteration order is not guaranteed) + */ + function forEach(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEach(collection, iteratee) + : baseEach(collection, baseCastFunction(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` through + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, + * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, + * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, + * and `words` + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; + }; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(funcToString.call(value)); + } + return isObjectLike(value) && + (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && objectToString.call(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + function isTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined` the `defaultValue` is used in its place. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b.c'); + * // => true + * + * _.hasIn(object, ['a', 'b', 'c']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return hasPath(object, path, baseHasIn); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (baseHas(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; + } + + /** + * Creates an array of own enumerable key-value pairs for `object` which + * can be consumed by `_.fromPairs`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + function toPairs(object) { + return baseToPairs(object, keys(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. + * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) + * for more details. + * + * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) + * to reduce XSS vectors. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * The inverse of `_.escape`; this method converts the HTML entities + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their + * corresponding characters. + * + * **Note:** No other HTML entities are unescaped. To unescape additional HTML + * entities use a third-party library like [_he_](https://mths.be/he). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to unescape. + * @returns {string} Returns the unescaped string. + * @example + * + * _.unescape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function unescape(string) { + string = toString(string); + return (string && reHasEscapedHtml.test(string)) + ? string.replace(reEscapedHtml, unescapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'user': 'fred' }; + * var getter = _.constant(object); + * + * getter() === object; + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + /** + * This method returns the first argument given to it. + * + * @static + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name the created callback returns the + * property value for a given element. If `func` is an object the created + * callback returns `true` for elements that contain the equivalent object + * properties, otherwise it returns `false`. + * + * @static + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(callback, func) { + * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); + * return !p ? callback(func) : function(object) { + * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * }; + * }); + * + * _.filter(users, 'age > 36'); + * // => [{ 'user': 'fred', 'age': 40 }] + */ + function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, true)); + } + + /** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + * @example + * + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } + * ]; + * + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] + */ + function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to, but not including, `end`. A step of `-1` is used if a negative + * `start` is specified without an `end` or `step`. If `end` is not specified + * it's set to `start` with `start` then set to `0`. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the new array of numbers. + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(-4); + * // => [0, -1, -2, -3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + var range = createRange(); + + /*------------------------------------------------------------------------*/ + + // Avoid inheriting from `Object.prototype` when possible. + Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + + // Add functions to the `MapCache`. + MapCache.prototype.clear = mapClear; + MapCache.prototype['delete'] = mapDelete; + MapCache.prototype.get = mapGet; + MapCache.prototype.has = mapHas; + MapCache.prototype.set = mapSet; + + // Add functions to the `Stack` cache. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + // Add functions that return wrapped values when chaining. + lodash.constant = constant; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.property = property; + lodash.range = range; + lodash.toPairs = toPairs; + + /*------------------------------------------------------------------------*/ + + // Add functions that return unwrapped values when chaining. + lodash.eq = eq; + lodash.escape = escape; + lodash.escapeRegExp = escapeRegExp; + lodash.forEach = forEach; + lodash.get = get; + lodash.hasIn = hasIn; + lodash.identity = identity; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isArrayLike = isArrayLike; + lodash.isArrayLikeObject = isArrayLikeObject; + lodash.isBuffer = isBuffer; + lodash.isFunction = isFunction; + lodash.isLength = isLength; + lodash.isNative = isNative; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isObjectLike = isObjectLike; + lodash.isString = isString; + lodash.isSymbol = isSymbol; + lodash.isTypedArray = isTypedArray; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.replace = replace; + lodash.toNumber = toNumber; + lodash.toString = toString; + lodash.unescape = unescape; + + // Add aliases. + lodash.each = forEach; + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + /*--------------------------------------------------------------------------*/ + + // Expose lodash on the free variable `window` or `self` when available. This + // prevents errors in cases where lodash is loaded by a script tag in the presence + // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details. + (freeWindow || freeSelf || {})._ = lodash; + + // Export to the global object. + root._ = lodash; +}.call(this)); + +function bool(x) { + return (x === 1 || x === '1' || x === true || x === 'true'); +} + +function numfmt(x, places) { + var pow = Math.pow(10, places); + return Math.round(x*pow) / pow; +} + +function estimateLoadTime(fs, n) { + return (1000/fs)*n+1500; +} + +function msNow() { + return +(new Date); +} + +function msElapsed(start) { + return msNow() - start; +} + +Math.log10 = Math.log10 || function(x) { + return Math.log(x) / Math.LN10; +}; + +/** + * Perform a substitution in the given string. + * + * Arguments - array or list of replacements. + * Arguments numeric keys will replace {0}, {1} etc. + * Named keys also work, ie. {foo: "bar"} -> replaces {foo} with bar. + * + * Braces are added to keys if missing. + * + * @returns {String} result + */ +String.prototype.format = function () { + var out = this; + + var repl = arguments; + + if (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) { + repl = arguments[0]; + } + + for (var ph in repl) { + if (repl.hasOwnProperty(ph)) { + var ph_orig = ph; + + if (!ph.match(/^\{.*\}$/)) { + ph = '{' + ph + '}'; + } + + // replace all occurrences + var pattern = new RegExp(_.escapeRegExp(ph), "g"); + out = out.replace(pattern, repl[ph_orig]); + } + } + + return out; +}; + +/** Module for toggling a modal overlay */ +var modal = (function () { + var modal = {}; + + modal.show = function (sel) { + var $m = $(sel); + $m.removeClass('hidden visible'); + setTimeout(function () { + $m.addClass('visible'); + }, 1); + }; + + modal.hide = function (sel) { + var $m = $(sel); + $m.removeClass('visible'); + setTimeout(function () { + $m.addClass('hidden'); + }, 500); // transition time + }; + + modal.init = function () { + // close modal by click outside the dialog + $('.Modal').on('click', function () { + if ($(this).hasClass('no-close')) return; // this is a no-close modal + modal.hide(this); + }); + + $('.Dialog').on('click', function (e) { + e.stopImmediatePropagation(); + }); + + // Hide all modals on esc + $(window).on('keydown', function (e) { + if (e.which == 27) { + modal.hide('.Modal'); + } + }); + }; + + return modal; +})(); + +var notify = (function () { + var nt = {}; + var sel = '#notif'; + + var hideTmeo1; + var hideTmeo2; + + nt.show = function (message, timeout) { + $(sel).html(message); + modal.show(sel); + + clearTimeout(hideTmeo1); + clearTimeout(hideTmeo2); + + if (!_.isUndefined(timeout)) { + hideTmeo1 = setTimeout(nt.hide, timeout); + } + }; + + nt.hide = function () { + var $m = $(sel); + $m.removeClass('visible'); + hideTmeo2 = setTimeout(function () { + $m.addClass('hidden'); + }, 250); // transition time + }; + + nt.init = function() { + $(sel).on('click', function() { + nt.hide(this); + }); + }; + + return nt; +})(); + +// requires other modules... + +// - utils.js +// - modal.js +// - wifi.js + +// all must be included after 3rd party libs + + +/** Global generic init */ +$().ready(function () { + + // loader dots... + setInterval(function () { + $('.anim-dots').each(function (x) { + var $x = $(x); + var dots = $x.html() + '.'; + if (dots.length == 5) dots = '.'; + $x.html(dots); + }); + }, 1000); + + $('input[type=number]').on('mousewheel', function(e) { + var val = +$(this).val(); + var step = +($(this).attr('step') || 1); + var min = $(this).attr('min'); + var max = $(this).attr('max'); + if(e.wheelDelta > 0) { + val += step; + } else { + val -= step; + } + if (!_.isUndefined(min)) val = Math.max(val, min); + if (!_.isUndefined(max)) val = Math.min(val, max); + $(this).val(val); + + if ("createEvent" in document) { + var evt = document.createEvent("HTMLEvents"); + evt.initEvent("change", false, true); + $(this)[0].dispatchEvent(evt); + } else { + $(this)[0].fireEvent("onchange"); + } + + e.preventDefault(); + }); + + modal.init(); + notify.init(); +}); + + +function errorMsg(msg, time) { + notify.show(msg, time || 3000); +} + +/** Wifi page */ +var page_wifi = (function () { + var wifi = {}; + var authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2']; + + /** Update display for received response */ + function onScan(resp, status) { + if (status != 200) { + // bad response + rescan(5000); // wait 5sm then retry + return; + } + + resp = JSON.parse(resp); + + var done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0); + rescan(done ? 15000 : 1000); + if (!done) return; // no redraw yet + + // clear the AP list + var $list = $('#ap-list'); + // remove old APs + $('.AP').remove(); + + $list.toggle(done); + $('#ap-loader').toggle(!done); + + // scan done + resp.result.APs + .sort(function (a, b) { + return b.rssi - a.rssi + }) + .forEach(function (ap) { + ap.enc = parseInt(ap.enc); + + if (ap.enc > 4) return; // hide unsupported auths + + var item = document.createElement('div'); + + var $item = $(item) + .data('ssid', ap.essid) + .data('pwd', ap.enc != 0) + .addClass('AP'); + + // mark current SSID + if (ap.essid == wifi.current) { + $item.addClass('selected'); + } + + var inner = document.createElement('div'); + var $inner = $(inner).addClass('inner') + .htmlAppend('
{0}
'.format(ap.rssi_perc)) + .htmlAppend('
{0}
'.format(_.escape(ap.essid))) + .htmlAppend('
{0}
'.format(authStr[ap.enc])); + + $item.on('click', function () { + var $th = $(this); + + // populate the form + $('#conn-essid').val($th.data('ssid')); + $('#conn-passwd').val(''); // clear + + if ($th.data('pwd')) { + // this AP needs a password + modal.show('#psk-modal'); + } else { + $('#conn-form').submit(); + } + }); + + + item.appendChild(inner); + $list[0].appendChild(item); + }); + } + + /** Ask the CGI what APs are visible (async) */ + function scanAPs() { + $().get(_root+'/wifi/scan', onScan); // no cache, no jsonp + } + + function rescan(time) { + setTimeout(scanAPs, time); + } + + /** Set up the WiFi page */ + wifi.init = function () { + //var ap_json = { + // "result": { + // "inProgress": "0", + // "APs": [ + // {"essid": "Chlivek", "bssid": "88:f7:c7:52:b3:99", "rssi": "204", "enc": "4", "channel": "1"}, + // {"essid": "TyNikdy", "bssid": "5c:f4:ab:0d:f1:1b", "rssi": "164", "enc": "3", "channel": "1"}, + // ] + // } + //}; + + scanAPs(); + }; + + return wifi; +})(); + +var page_waveform = (function () { + var wfm = {}; + + var zoomResetFn; + var dataFormat; + + var readoutPending = false; + var autoReload = false; + var autoReloadTime = 1; + var arTimeout = -1; + + var lastLoadMs; + + var zoomSavedX, zoomSavedY; + + var readXhr; // read xhr + + var opts = { + count: 0, // sample count + freq: 0 // sampling freq + }; + + function buildChart(j) { + // Build the chart + var mql = window.matchMedia('screen and (min-width: 544px)'); + var isPhone = !mql.matches; + + var fft = (j.stats.format == 'FFT'); + + var xLabel, yLabel; + if (fft) { + xLabel = 'Frequency - [ Hz ]'; + yLabel = 'Magnitude - [ mA ]'; + } else { + xLabel = 'Sample time - [ ms ]'; + yLabel = 'Current - [ mA ]'; + } + + var peak = Math.max(-j.stats.min, j.stats.max); + var displayPeak = Math.max(peak, 10); + + // Sidebar + + $('#stat-count').html(j.stats.count); + $('#stat-f-s').html(numfmt(j.stats.freq, 2)); + $('#stat-i-peak').html(numfmt(peak, 2)); + $('#stat-i-rms').html(numfmt(j.stats.rms, 2)); + $('.stats').removeClass('invis'); + + // --- chart --- + + // Generate point entries + // add synthetic properties + var step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq); + var points = _.map(j.samples, function (a, i) { + return { + x: i * step, + y: a + }; + }); + + var plugins = [ + Chartist.plugins.zoom({ + resetOnRightMouseBtn: true, + onZoom: function (chart, reset) { + zoomResetFn = reset; + + zoomSavedX = chart.options.axisX.highLow; + zoomSavedY = chart.options.axisY.highLow; + } + }) + ]; + + if (!isPhone) plugins.push( // larger than phone + Chartist.plugins.ctAxisTitle({ + axisX: { + axisTitle: xLabel, + offset: { + x: 0, + y: 55 + } + }, + axisY: { + axisTitle: yLabel, + flipText: true, + offset: { + x: 0, + y: 15 + } + } + }) + ); + + var xHigh, xLow, yHigh, yLow; + + if (zoomSavedX) { + // we have saved coords of the zoom rect, restore the zoom. + xHigh = zoomSavedX.high; + xLow = zoomSavedX.low; + yHigh = zoomSavedY.high; + yLow = zoomSavedY.low; + } else { + yHigh = fft ? undefined : displayPeak; + yLow = fft ? 0 : -displayPeak; + } + + new Chartist.Line('#chart', { + series: [ + { + name: 'a', + data: points + }, + ] + }, { + showPoint: false, + showArea: fft, + fullWidth: true, + chartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}), + series: { + 'a': { + lineSmooth: Chartist.Interpolation.monotoneCubic() + } + }, + axisX: { + type: Chartist.AutoScaleAxis, + //onlyInteger: !fft // only for raw + high: xHigh, + low: xLow, + }, + axisY: { + type: Chartist.AutoScaleAxis, + //onlyInteger: true + high: yHigh, + low: yLow, + }, + explicitBounds: { + xLow: 0, + yLow: fft ? 0 : undefined, + xHigh: points[points.length-1].x + }, + plugins: plugins + }); + } + + function onRxData(resp, status) { + readoutPending = false; + + if (status != 200) { + errorMsg("Request failed.", 1000); + } else { + var j = JSON.parse(resp); + if (!j.success) { + errorMsg("Sampling failed.", 1000); + } else { + buildChart(j); + } + } + + if (autoReload) + arTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs))); + } + + function readInputs() { + opts.count = $('#count').val(); + opts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s + } + + function requestReload() { + if (readoutPending) { + errorMsg("Request already pending - aborting."); + readXhr.abort(); + } + + readoutPending = true; + lastLoadMs = msNow(); + + var n = opts.count; + var fs = opts.freq; + var url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs; + readXhr = $().get(url, onRxData, estimateLoadTime(fs,n)); + + return true; + } + + function toggleAutoReload() { + autoReloadTime = +$('#ar-time').val(); // ms + + readInputs(); + + autoReload = !autoReload; + if (autoReload) { + requestReload(); + } else { + clearTimeout(arTimeout); + } + + $('#ar-btn') + .toggleClass('btn-blue') + .toggleClass('btn-red') + .val(autoReload ? 'Stop' : 'Auto'); + } + + wfm.init = function (format) { + // --- Load data --- + dataFormat = format; + + function onLoadClick() { + readInputs(); + requestReload(); + } + + $('#load').on('click', onLoadClick); + + $('#count,#freq').on('keyup', function (e) { + if (e.which == 13) { + onLoadClick(); + } + }); + + // --- zooming --- + + $('#chart').on('contextmenu', function (e) { // right click on the chart -> reset + zoomResetFn && zoomResetFn(); + zoomResetFn = null; + + zoomSavedX = null; + zoomSavedY = null; + + e.preventDefault(); + return false; + }); + + // auto-reload button + $('#ar-btn').on('click', toggleAutoReload); + }; + + return wfm; +})(); + +var page_spectrogram = (function () { + var sg = {}; + + var ctx; + + // drawing area + var plot = { + x:50, + y:10, + w:740,//860 total + h:512, + dx: 1, // bin + dy: 1 + }; + + var opts = { + interval: 0, + sampCount: 0, + freq:0 + }; + + var interval = 1000; + var running = false; + var readTimeout; // timer + var readoutPending; + var readXhr; + + var lastLoadMs; + var lastMarkMs; + var lastMark10s; + + var colormap = [ + /* [val, r, g, b] */ + [0.00, 0, 0, 0], + [0.10, 41, 17, 41], + [0.25, 34, 17, 78], + [0.6, 17, 30, 105], + [1.0, 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.90, 223, 217, 86], + [1.97, 248, 222, 176], + [1.99, 255, 237, 222], + [2.00, 255, 255, 255], + ]; + + function val2color(val) { + var x1, x2, c1, c2; + + val = Math.log10(1+val); + + if (val > 2) val = 2; + if (val < 0) val = 0; + + for (var i = 0; i < colormap.length; i++) { + var c = colormap[i]; + var point = c[0]; + if (val >= point) { + x1 = point; + c1 = c; + } + + if (val <= point) { + x2 = point; + c2 = c; + break; + } + } + + var rate = ((val - x1)/(x2 - x1)); + if (x1 == x2) rate=0; + + var r = Math.round((c1[1] + (c2[1] - c1[1])*rate)); + var g = Math.round((c1[2] + (c2[2] - c1[2])*rate)); + var b = Math.round((c1[3] + (c2[3] - c1[3])*rate)); + return 'rgb('+r+','+g+','+b+')'; + } + + function shiftSg() { + var imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10); + + ctx.fillStyle = 'black'; + ctx.fillRect(plot.x, plot.y, plot.w, plot.h); + ctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box + + ctx.putImageData(imageData, plot.x, plot.y); + } + + function drawSg(col) { + shiftSg(); + + var bc = opts.sampCount/2; + for (var i = 0; i < bc; i++) { + // resolve color from the value + var clr; + + if (i*plot.dy > plot.h) { + break; + } + + if (i > col.length) { + clr = '#000'; + } else { + clr = val2color(col[i]); + } + ctx.fillStyle = clr; + + var tx = plot.x+plot.w-plot.dx; + var ty = plot.y+plot.h-(i+1)*plot.dy; + var tw = plot.dx; + var th = plot.dy; + + if (ty= 950) { + lastMarkMs = msNow(); + + var long = false; + if (msElapsed(lastMark10s) > 9500) { + long = true; + lastMark10s = msNow(); + } + + ctx.strokeStyle = 'white'; + ctx.beginPath(); + ctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1); + ctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2)); + ctx.stroke(); + } + } + + + function onRxData(resp, status) { + readoutPending = false; + if (status == 200) { + try { + var j = JSON.parse(resp); + if (j.success) { + // display + drawSg(j.samples); + } else { + errorMsg("Sampling failed.", 1000); + } + } catch(e) { + errorMsg(e); + } + } else { + errorMsg("Request failed.", 1000); + } + + if (running) + readTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time. + } + + function requestData() { + if (readoutPending) { + errorMsg("Request already pending - aborting."); + readXhr.abort(); + } + readoutPending = true; + lastLoadMs = msNow(); + + var fs = opts.freq; + var n = opts.sampCount; + var url = _root+'/measure/fft?n='+n+'&fs='+fs; + + readXhr = $().get(url, onRxData, estimateLoadTime(fs,n)); + + return true; + } + + function drawLegend() { + var gap = 8; + var barW = 10; + var barH = plot.h-12; + var barY = plot.y+6; + var barX = plot.x - gap - barW; + var vStep = (100 / barH); + for (var i = 0; i < barH; i++) { + var c1 = val2color(i * vStep); + var c2 = val2color((i + 1) * vStep); + + var y = Math.floor(barY + barH - (i + 1)); + + var gradient = ctx.createLinearGradient(0, y + 1, 0, y); + gradient.addColorStop(0, c1); + gradient.addColorStop(1, c2); + ctx.fillStyle = gradient; + + ctx.fillRect(barX, y, barW, 1); + } + + // border + ctx.strokeStyle = '#000'; + ctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1); + + vStep = (100 / barH); + ctx.font = '12px sans-serif'; + ctx.fillStyle = 'white'; + ctx.textAlign = 'right'; + for (var i = 0; i <= plot.h; i+=barH/10) { + ctx.fillText(Math.round(i*vStep)+"", plot.x - gap - barW - gap, barY+barH-i+3); + } + } + + function drawAxis() { + var gap = 8; + var rX0 = plot.x+plot.w; + var rX = rX0+gap; + var rY = plot.y; + var rH = plot.h; + var rW = 70; + ctx.clearRect(rX0+.5, rY-10, rW, rH+20); + + var perBin = (opts.freq/2) / (opts.sampCount/2); + + var totalBins = (plot.h / plot.dy); + var totalHz = totalBins*perBin; + + //console.log("perbin=",perBin,"totalBins=",totalBins,"totalHz=",totalHz); + + var step; + + // get the best step size + var steps = [10, 25, 50]; + var multiplier = 1; + var suc = false; + do { + for (var i = 0; i < steps.length; i++) { + if ((totalHz / (steps[i] * multiplier)) <= 21) { + step = (steps[i] * multiplier); + suc = true; + break; + } + } + if (suc) break; + multiplier *= 10; + } while (true); + + step = step/perBin; + + // every step-th bin has a label + ctx.font = '12px sans-serif'; + ctx.fillStyle = 'white'; + ctx.strokeStyle = 'white'; + ctx.textAlign = 'left'; + + // labels and dashes + for(var i = 0; i <= totalBins+step; i+= step) { + if (i >= totalBins) { + var dist = i - totalBins; + if (dist > step/2) break;// make sure not too close + i = totalBins; + } + + var hz = i*(totalHz/totalBins); + if (hz>=1000000) hz = numfmt(hz/1e6,2)+'M'; + else if (hz>=1000) hz = numfmt(hz/1e3,2)+'k'; + else hz = numfmt(hz,1); + + var yy = Math.round(rY+rH-(plot.dy*i)); + ctx.fillText(hz, rX, yy+4); + + ctx.beginPath(); + ctx.moveTo(rX0, yy+.5); + ctx.lineTo(rX0+gap/2, yy+.5); + ctx.stroke(); + + if (i >= totalBins) break; + } + + // Hz label + ctx.font = '16px sans-serif'; + ctx.save(); + ctx.translate(rX0+50, plot.y+plot.h/2); + ctx.rotate(Math.PI/2); + ctx.textAlign = "center"; + ctx.fillText("Frequency - [Hz]", 0, 0); + ctx.restore(); + } + + function readOpts() { + opts.interval = +$('#interval').val(); // ms + opts.freq = +$('#freq').val()*2; + opts.sampCount = +$('#count').val(); + + plot.dx = +$('#tile-x').val(); + plot.dy = +$('#tile-y').val(); + } + + function clearSgArea() { + ctx.fillStyle = '#000'; + ctx.fillRect(plot.x, plot.y, plot.w, plot.h); + ctx.strokeStyle = 'white'; + ctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1); + } + + sg.init = function () { + var canvas = $('#sg')[0]; + ctx = canvas.getContext('2d'); + + // CLS + clearSgArea(); + readOpts(); + drawLegend(); + drawAxis(); + lastMarkMs = msNow()-10000; + lastMark10s = msNow()-10000; + + // update tile size on bin count selection + $('#count').on('change', function() { + var count = +$('#count').val(); + var tile = Math.max(1, plot.h/(count/2)); + + $('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely) + $('#tile-y').val(tile); + }); + + // chain Y with X + $('#tile-y').on('change', function() { + $('#tile-x').val(Math.max(4,$(this).val())); + }); + + $('#go-btn').on('click', function() { + running = !running; + if (running) { + readOpts(); + drawAxis(); + + requestData(); + } else { + clearTimeout(readTimeout); + } + + $('#go-btn') + .toggleClass('btn-green') + .toggleClass('btn-red') + .html(running ? 'Stop' : 'Start'); + }); + }; + + return sg; +})(); + +var page_status = (function() { + var st = {}; + st.j = {}; + + var updateTime = 10000; + + var updateInhibited = false; + + st.trigReset = function() { + var modal_sel = '#reset-modal'; + $().get(_root + '/system/reset', function(resp, status) { + if (status == 200) { + + modal.show(modal_sel); + updateInhibited = true; + + var ping_i = setInterval(function() { + $().get(_root+'/system/ping', function(resp, code){ + if (code == 200) { + // device is ready + modal.hide(modal_sel); + requestUpdate(); + clearInterval(ping_i); + updateInhibited = false; + } + }, {timeout: 500}); + }, 1000); + } + }); + }; + + function onUpdate(resp, status) { + if (status != 200) { + // bad response + errorMsg('Update failed.'); + } else { + try { + // OK + var j = JSON.parse(resp); + st.j = j; // store for global access + + $('.sta-only').toggle(j.sta); + $('.ap-only').toggle(j.ap); + + $('#uptime').html(j.uptime); + $('#heap').html(j.heap + " bytes"); + $('#wmode').html(j.wifiMode); + + if (j.sta) { + $('#staSSID').html(j.sta.SSID); + $('#staRSSIperc').html(j.sta.RSSIperc); + $('#staRSSI').html(j.sta.RSSI); + $('#staMAC').html(j.sta.MAC); + } + + if (j.ap) { + $('#apSSID').html(j.ap.SSID); + $('#apHidden').html(j.ap.hidden ? "Yes" : "No"); + $('#apAuth').html(j.ap.auth); + + // hide the password row if auth is Open + $('.ap-auth-only').toggle(j.ap.auth != 'Open'); + + $('#apPwd').html(j.ap.pwd); + $('#apChan').html(j.ap.chan); + $('#apMAC').html(j.ap.MAC); + } + // chip ID & macs don't change + } catch(e) { + errorMsg(e); + } + } + + if (!updateInhibited) { + setTimeout(requestUpdate, updateTime); + } + } + + function requestUpdate() { + $().get(_root+'/system/status', onUpdate); + } + + st.init = function() { + requestUpdate(); + }; + + return st; +})(); + +//# sourceMappingURL=all.js.map diff --git a/html_src/node_modules.tar.REMOVED.git-id b/html_src/node_modules.tar.REMOVED.git-id new file mode 100644 index 0000000..830e9bd --- /dev/null +++ b/html_src/node_modules.tar.REMOVED.git-id @@ -0,0 +1 @@ +0648559aed5a9ec1d478b445839bdb807ced7fc5 \ No newline at end of file diff --git a/html_src/package.json b/html_src/package.json new file mode 100755 index 0000000..b52e421 --- /dev/null +++ b/html_src/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "laravel-elixir": "^4.0.0", + "gulp": "^3.8.8" + } +} diff --git a/html_src/page_about.php b/html_src/page_about.php index 0d3457f..2d816a3 100644 --- a/html_src/page_about.php +++ b/html_src/page_about.php @@ -16,11 +16,6 @@

Firmware

-

- The ESP8266 firmware is based on the amazing esp-httpd - library by Jeroen Domburg. -

- @@ -38,7 +33,13 @@ +
FirmwareIoT SDK v%vers_sdk%
+ +

+ The webserver is built using the great esp-httpd + library by Jeroen Domburg. +

diff --git a/html_src/page_monitoring.php b/html_src/page_monitoring.php new file mode 100644 index 0000000..9391ad4 --- /dev/null +++ b/html_src/page_monitoring.php @@ -0,0 +1,76 @@ + + +

Monitoring & Reporting

+ +
+

Status

+ + + + + + + + + +
Reference: + %hasref% + Capture +
Actual distance: + N/A + Measure +
+
+ +
+

Reporting

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+   +
+ + seconds +
Service: +    +   +
+ +
+ +
  + +
+
+
+ + + + diff --git a/html_src/page_status.php b/html_src/page_status.php index ae448c4..dae7cf1 100644 --- a/html_src/page_status.php +++ b/html_src/page_status.php @@ -15,7 +15,7 @@ - SW reset + Restart system diff --git a/html_src/sass/layout/_box.scss b/html_src/sass/layout/_box.scss index e4121af..dd1d385 100644 --- a/html_src/sass/layout/_box.scss +++ b/html_src/sass/layout/_box.scss @@ -28,4 +28,9 @@ &.medium { max-width: 1200px; } + + .Valfield { + display: inline-block; + min-width: 10em; + } } From a9fca71169d53c3a9f8a55ff12d5f08053216bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 23 Apr 2016 23:55:00 +0200 Subject: [PATCH 02/11] improved some stuffs Former-commit-id: 7cf8b899e46fecc15700ee8ad531fd5b3461047e --- html_src/js-src/page_mon.js | 9 +++++++++ html_src/page_monitoring.php | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 html_src/js-src/page_mon.js diff --git a/html_src/js-src/page_mon.js b/html_src/js-src/page_mon.js new file mode 100644 index 0000000..7ee3f1c --- /dev/null +++ b/html_src/js-src/page_mon.js @@ -0,0 +1,9 @@ +var page_mon = (function() { + var mon = {}; + + mon.init = function() { + // + }; + + return mon; +})(); diff --git a/html_src/page_monitoring.php b/html_src/page_monitoring.php index 9391ad4..21adee8 100644 --- a/html_src/page_monitoring.php +++ b/html_src/page_monitoring.php @@ -1,6 +1,6 @@ -

Monitoring & Reporting

+

Monitoring & Reporting

Status

@@ -8,7 +8,7 @@ Reference: - %hasref% + %refStored% Capture @@ -29,7 +29,7 @@ -   @@ -43,20 +43,20 @@ Service: -    -   +    +   - + - + From 244fa6aa11f332d94e2d8ac6f8cca26d1ae258f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 23 Apr 2016 23:57:34 +0200 Subject: [PATCH 03/11] stubs for the mon js Former-commit-id: 75781892f4d3618a6beb16c5feb1febf0ae70070 --- html_src/gulpfile.js | 1 + html_src/js-src/page_mon.js | 8 ++++++++ html_src/page_monitoring.php | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/html_src/gulpfile.js b/html_src/gulpfile.js index 41969bf..ee98a02 100644 --- a/html_src/gulpfile.js +++ b/html_src/gulpfile.js @@ -33,5 +33,6 @@ elixir(function (mix) { 'js-src/page_waveform.js', 'js-src/page_spectrogram.js', 'js-src/page_status.js', + 'js-src/page_mon.js', ], 'js/all.js'); }); diff --git a/html_src/js-src/page_mon.js b/html_src/js-src/page_mon.js index 7ee3f1c..ec57d6b 100644 --- a/html_src/js-src/page_mon.js +++ b/html_src/js-src/page_mon.js @@ -1,6 +1,14 @@ var page_mon = (function() { var mon = {}; + mon.captureRef = function() { + // TODO ajax & update the field + }; + + mon.compareNow = function() { + // TODO ajax & show result + }; + mon.init = function() { // }; diff --git a/html_src/page_monitoring.php b/html_src/page_monitoring.php index 21adee8..2b5a517 100644 --- a/html_src/page_monitoring.php +++ b/html_src/page_monitoring.php @@ -16,7 +16,7 @@ Actual distance: N/A - Measure + Measure From 91025a4cc7efdf01f896afeb5da72574d7fb069e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 10:19:45 +0200 Subject: [PATCH 04/11] monitoring clickhandler js Former-commit-id: 424d53773336b155929da3a74d68808969377145 --- html_src/js-src/page_mon.js | 43 +++++++++++++++++++++++++-- html_src/js/all.js | 57 ++++++++++++++++++++++++++++++++++++ html_src/js/all.js.map | 2 +- html_src/page_monitoring.php | 18 ++++-------- 4 files changed, 105 insertions(+), 15 deletions(-) diff --git a/html_src/js-src/page_mon.js b/html_src/js-src/page_mon.js index ec57d6b..88299a6 100644 --- a/html_src/js-src/page_mon.js +++ b/html_src/js-src/page_mon.js @@ -1,12 +1,51 @@ var page_mon = (function() { var mon = {}; + function updRefInfoField(ok) { + $('#hasref').html(ok ? 'OK' : 'Not set!'); + } + + /** Capture reference & save to flash */ mon.captureRef = function() { - // TODO ajax & update the field + $().get(_root + '/mon/setref', function(resp, status) { + if (status != 200) { + // bad response + errorMsg('Operation failed.'); + } else { + try { + // OK + var j = JSON.parse(resp); + updRefInfoField(j.success); + } catch(e) { + errorMsg(e); + updRefInfoField(false); + } + } + }); }; + /** Capture waveform and compare with reference */ mon.compareNow = function() { - // TODO ajax & show result + $().get(_root + '/mon/compare', function(resp, status) { + if (status != 200) { + // bad response + errorMsg('Operation failed.'); + } else { + try { + // OK + var j = JSON.parse(resp); + if (j.success) { + $('#refdist').html(numfmt(j.deviation, 2)); + } else { + errorMsg('Capture failed.'); + $('#refdist').html('--'); + } + } catch(e) { + errorMsg(e); + $('#refdist').html('--'); + } + } + }); }; mon.init = function() { diff --git a/html_src/js/all.js b/html_src/js/all.js index 96e8374..976dc4a 100644 --- a/html_src/js/all.js +++ b/html_src/js/all.js @@ -9436,4 +9436,61 @@ var page_status = (function() { return st; })(); +var page_mon = (function() { + var mon = {}; + + function updRefInfoField(ok) { + $('#hasref').html(ok ? 'OK' : 'Not set!'); + } + + /** Capture reference & save to flash */ + mon.captureRef = function() { + $().get(_root + '/mon/setref', function(resp, status) { + if (status != 200) { + // bad response + errorMsg('Operation failed.'); + } else { + try { + // OK + var j = JSON.parse(resp); + updRefInfoField(j.success); + } catch(e) { + errorMsg(e); + updRefInfoField(false); + } + } + }); + }; + + /** Capture waveform and compare with reference */ + mon.compareNow = function() { + $().get(_root + '/mon/compare', function(resp, status) { + if (status != 200) { + // bad response + errorMsg('Operation failed.'); + } else { + try { + // OK + var j = JSON.parse(resp); + if (j.success) { + $('#refdist').html(numfmt(j.deviation, 2)); + } else { + errorMsg('Capture failed.'); + $('#refdist').html('--'); + } + } catch(e) { + errorMsg(e); + $('#refdist').html('--'); + } + } + }); + }; + + mon.init = function() { + // + }; + + return mon; +})(); + //# sourceMappingURL=all.js.map diff --git a/html_src/js/all.js.map b/html_src/js/all.js.map index b62bc70..6d195b2 100644 --- a/html_src/js/all.js.map +++ b/html_src/js/all.js.map @@ -1 +1 @@ -{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","lodash.custom.js","utils.js","modal.js","notif.js","app.js","page_wifi.js","page_waveform.js","page_spectrogram.js","page_status.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC95HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\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}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\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\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (!_.isUndefined(value)) { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms\n\t\t\tvar xhr;\n\t\t\tvar\tquery = serializeData(nodes);\n\t\t\tvar\ttype = (method) ? method.toUpperCase() : 'GET';\n\t\t\tvar\tabortTmeo;\n\n\t\t\tif (_.isNumber(options)) options = {timeout: options};\n\n\t\t\tvar opts = Chartist.extend({}, {\n\t\t\t\tnocache: true,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tloader: true,\n\t\t\t}, options);\n\n\t\t\t//console.log('ajax to = ' + opts.timeout);\n\n\t\t\tif (query && (type === 'GET')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// FIXME the XHR sometimes seemingly silently fails\n\n\t\t\txhr = new XMLHttpRequest(); // we dont support IE < 9\n\n\t\t\tif (xhr) {\n\t\t\t\t// prevent caching\n\t\t\t\tif (opts.nocache) {\n\t\t\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t\t\t}\n\n\t\t\t\tif (opts.loader)\n\t\t\t\t\t$('#loader').addClass('show');\n\n\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\txhr.timeout = opts.timeout;\n\n\t\t\t\tabortTmeo = setTimeout(function () {\n\t\t\t\t\terrorMsg(\"XHR timed out.\");\n\t\t\t\t\txhr.abort();\n\t\t\t\t\tif (opts.loader) $('#loader').removeClass('show');\n\t\t\t\t}, opts.timeout + 10); // a bit later, but still.;\n\n\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\n\t\t\t\t\t\tif (opts.loader)\n\t\t\t\t\t\t\t$('#loader').removeClass('show');\n\n\t\t\t\t\t\tif (callback && xhr.status != 0) { // xhr.status 0 means \"aborted\"\n\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\tif (type === 'POST') {\n\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t}\n\n\t\t\t\txhr.send(query);\n\t\t\t}\n\n\t\t\treturn xhr;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback)\n\t\tcb.get = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'get', callback, opts);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback)\n\t\tcb.post = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'post', callback, opts);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n // Chartist.escapingMap = {\n // '&': '&',\n // '<': '<',\n // '>': '>',\n // '\"': '"',\n // '\\'': '''\n // };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return _.escape(data);\n\n // return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n // }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n // }, data);\n data = _.unescape(data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n // /**\n // * Calculate cartesian coordinates of polar coordinates\n // *\n // * @memberof Chartist.Core\n // * @param {Number} centerX X-axis coordinates of center point of circle segment\n // * @param {Number} centerY X-axis coordinates of center point of circle segment\n // * @param {Number} radius Radius of circle segment\n // * @param {Number} angleInDegrees Angle of circle segment in degrees\n // * @return {{x:Number, y:Number}} Coordinates of point on circumference\n // */\n // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n //\n // return {\n // x: centerX + (radius * Math.cos(angleInRadians)),\n // y: centerY + (radius * Math.sin(angleInRadians))\n // };\n // };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\n if (_.isNumber(lblText)) {\n lblText = Chartist.roundWithPrecision(lblText, 2);\n }\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n // /**\n // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n // *\n // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n // *\n // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n // *\n // * @example\n // * var chart = new Chartist.Line('.ct-chart', {\n // * labels: [1, 2, 3, 4, 5],\n // * series: [[1, 2, 8, 1, 7]]\n // * }, {\n // * lineSmooth: Chartist.Interpolation.cardinal({\n // * tension: 1,\n // * fillHoles: false\n // * })\n // * });\n // *\n // * @memberof Chartist.Interpolation\n // * @param {Object} options The options of the cardinal factory function.\n // * @return {Function}\n // */\n // Chartist.Interpolation.cardinal = function(options) {\n // var defaultOptions = {\n // tension: 1,\n // fillHoles: false\n // };\n //\n // options = Chartist.extend({}, defaultOptions, options);\n //\n // var t = Math.min(1, Math.max(0, options.tension)),\n // c = 1 - t;\n //\n // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // // This functionality is necessary to treat \"holes\" in the line charts\n // function splitIntoSegments(pathCoordinates, valueData) {\n // var segments = [];\n // var hole = true;\n //\n // for(var i = 0; i < pathCoordinates.length; i += 2) {\n // // If this value is a \"hole\" we set the hole flag\n // if(valueData[i / 2].value === undefined) {\n // if(!options.fillHoles) {\n // hole = true;\n // }\n // } else {\n // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n // if(hole) {\n // segments.push({\n // pathCoordinates: [],\n // valueData: []\n // });\n // // As we have a valid value now, we are not in a \"hole\" anymore\n // hole = false;\n // }\n //\n // // Add to the segment pathCoordinates and valueData\n // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n // segments[segments.length - 1].valueData.push(valueData[i / 2]);\n // }\n // }\n //\n // return segments;\n // }\n //\n // return function cardinal(pathCoordinates, valueData) {\n // // First we try to split the coordinates into segments\n // // This is necessary to treat \"holes\" in line charts\n // var segments = splitIntoSegments(pathCoordinates, valueData);\n //\n // if(!segments.length) {\n // // If there were no segments return 'Chartist.Interpolation.none'\n // return Chartist.Interpolation.none()([]);\n // } else if(segments.length > 1) {\n // // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // // afterwards together into a single path.\n // var paths = [];\n // // For each segment we will recurse the cardinal function\n // segments.forEach(function(segment) {\n // paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n // });\n // // Join the segment path data into a single path and return\n // return Chartist.Svg.Path.join(paths);\n // } else {\n // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // // segment\n // pathCoordinates = segments[0].pathCoordinates;\n // valueData = segments[0].valueData;\n //\n // // If less than two points we need to fallback to no smoothing\n // if(pathCoordinates.length <= 4) {\n // return Chartist.Interpolation.none()(pathCoordinates, valueData);\n // }\n //\n // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n // z;\n //\n // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n // var p = [\n // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n // ];\n // if (z) {\n // if (!i) {\n // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n // } else if (iLen - 4 === i) {\n // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // } else if (iLen - 2 === i) {\n // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n // }\n // } else {\n // if (iLen - 4 === i) {\n // p[3] = p[2];\n // } else if (!i) {\n // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n // }\n // }\n //\n // path.curve(\n // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n // p[2].x,\n // p[2].y,\n // false,\n // valueData[(i + 2) / 2]\n // );\n // }\n //\n // return path;\n // }\n // };\n // };\n\n\n /**\n * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.\n *\n * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.monotoneCubic({\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the monotoneCubic factory function.\n * @return {Function}\n */\n Chartist.Interpolation.monotoneCubic = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {\n // Because we are doing monotone interpolation, curve fitting only makes sense for\n // increasing x values. Therefore if two subsequent points have the same x value, or\n // the x value is decreasing, then we create a hole at this point. (Which cannot be\n // filled in even with the 'fillHoles' option)\n\n hole = true;\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function monotoneCubic(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the monotoneCubic fn function\n segments.forEach(function(segment) {\n paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than three points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var xs = [],\n ys = [],\n i,\n n = pathCoordinates.length / 2,\n ms = [],\n ds = [], dys = [], dxs = [],\n path;\n\n // Populate x and y coordinates into separate arrays, for readability\n\n for(i = 0; i < n; i++) {\n xs[i] = pathCoordinates[i * 2];\n ys[i] = pathCoordinates[i * 2 + 1];\n }\n\n // Calculate deltas and derivative\n\n for(i = 0; i < n - 1; i++) {\n dys[i] = ys[i + 1] - ys[i];\n dxs[i] = xs[i + 1] - xs[i];\n ds[i] = dys[i] / dxs[i];\n }\n\n // Determine desired slope (m) at each point using Fritsch-Carlson method\n // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation\n\n ms[0] = ds[0];\n ms[n - 1] = ds[n - 2];\n\n for(i = 1; i < n - 1; i++) {\n if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {\n ms[i] = 0;\n } else {\n ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (\n (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +\n (dxs[i] + 2 * dxs[i - 1]) / ds[i]);\n\n if(!isFinite(ms[i])) {\n ms[i] = 0;\n }\n }\n }\n\n // Now build a path from the slopes\n\n path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);\n\n for(i = 0; i < n - 1; i++) {\n path.curve(\n // First control point\n xs[i] + dxs[i] / 3,\n ys[i] + ms[i] * dxs[i] / 3,\n // Second control point\n xs[i + 1] - dxs[i] / 3,\n ys[i + 1] - ms[i + 1] * dxs[i] / 3,\n // End point\n xs[i + 1],\n ys[i + 1],\n\n false,\n valueData[i + 1] // changed as per patch on github\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var xy = this.units.pos.toUpperCase();\n var axisOptions = chartOptions['axis' + xy];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n\n\n var labelLength=0;\n\n\n if (xy == 'Y') { // X doesnt use this\n if (projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n // lastWidth = labelLength;\n // } else if (typeof lastWidth != 'undefined') {\n // labelLength = lastWidth; // EDIT. added the lastWidth thing\n } else {\n // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // still be visible inside of the chart padding.\n labelLength = Math.max(this.axisLength - projectedValue, 30);\n }\n }\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// // AMD. Register as an anonymous module.\n\t// define([], function () {\n\t// return (root.returnExportsGlobal = factory());\n\t// });\n\t// } else if (typeof exports === 'object') {\n\t// // Node. Does not work with strict CommonJS, but\n\t// // only CommonJS-like enviroments that support module.exports,\n\t// // like Node.\n\t// module.exports = factory();\n\t// } else {\n\troot['Chartist.plugins.zoom'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js zoom plugin.\n\t *\n\t */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar defaultOptions = {\n\t\t\t// onZoom\n\t\t\t// resetOnRightMouseBtn\n\t\t};\n\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.zoom = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function zoom(chart) {\n\n\t\t\t\tif (!(chart instanceof Chartist.Line)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rect, svg, axisX, axisY, chartRect;\n\t\t\t\tvar downPosition;\n\t\t\t\tvar onZoom = options.onZoom;\n\t\t\t\tvar ongoingTouches = [];\n\n\t\t\t\tchart.on('draw', function (data) {\n\t\t\t\t\tvar type = data.type;\n\t\t\t\t\tif (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n\t\t\t\t\t\tdata.element.attr({\n\t\t\t\t\t\t\t'clip-path': 'url(#zoom-mask)'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\taxisX = data.axisX;\n\t\t\t\t\taxisY = data.axisY;\n\t\t\t\t\tchartRect = data.chartRect;\n\t\t\t\t\tsvg = data.svg._node;\n\t\t\t\t\trect = data.svg.elem('rect', {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 10,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\theight: 100,\n\t\t\t\t\t}, 'ct-zoom-rect');\n\t\t\t\t\thide(rect);\n\n\t\t\t\t\tvar defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n\t\t\t\t\tvar width = chartRect.width();\n\t\t\t\t\tvar height = chartRect.height();\n\n\t\t\t\t\tdefs\n\t\t\t\t\t\t.elem('clipPath', {\n\t\t\t\t\t\t\tid: 'zoom-mask'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.elem('rect', {\n\t\t\t\t\t\t\tx: chartRect.x1,\n\t\t\t\t\t\t\ty: chartRect.y2,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\theight: height,\n\t\t\t\t\t\t\tfill: 'white'\n\t\t\t\t\t\t});\n\n\t\t\t\t\tsvg.addEventListener('mousedown', onMouseDown);\n\t\t\t\t\tsvg.addEventListener('mouseup', onMouseUp);\n\t\t\t\t\tsvg.addEventListener('mousemove', onMouseMove);\n\t\t\t\t\tsvg.addEventListener('touchstart', onTouchStart);\n\t\t\t\t\tsvg.addEventListener('touchmove', onTouchMove);\n\t\t\t\t\tsvg.addEventListener('touchend', onTouchEnd);\n\t\t\t\t\tsvg.addEventListener('touchcancel', onTouchCancel);\n\t\t\t\t});\n\n\t\t\t\tfunction copyTouch(touch) {\n\t\t\t\t\tvar p = position(touch, svg);\n\t\t\t\t\tp.id = touch.identifier;\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tfunction ongoingTouchIndexById(idToFind) {\n\t\t\t\t\tfor (var i = 0; i < ongoingTouches.length; i++) {\n\t\t\t\t\t\tvar id = ongoingTouches[i].id;\n\t\t\t\t\t\tif (id === idToFind) {\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchStart(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tongoingTouches.push(copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchMove(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchCancel(event) {\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t}\n\n\t\t\t\tfunction removeTouches(touches) {\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\t\tongoingTouches.splice(idx, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchEnd(event) {\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\tzoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t}\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t\thide(rect);\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseDown(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tdownPosition = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, downPosition));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar reset = function () {\n\t\t\t\t\tchart.options.axisX.highLow = null;\n\t\t\t\t\tchart.options.axisY.highLow = null;\n\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t};\n\n\t\t\t\tfunction onMouseUp(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tvar box = getRect(downPosition, position(event, svg));\n\t\t\t\t\t\tzoomIn(box);\n\t\t\t\t\t\tdownPosition = null;\n\t\t\t\t\t\thide(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\telse if (options.resetOnRightMouseBtn && event.button === 2) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction zoomIn(rect) {\n\t\t\t\t\tif (rect.width > 5 && rect.height > 5) {\n\t\t\t\t\t\tvar x1 = rect.x - chartRect.x1;\n\t\t\t\t\t\tvar x2 = x1 + rect.width;\n\t\t\t\t\t\tvar y2 = chartRect.y1 - rect.y;\n\t\t\t\t\t\tvar y1 = y2 - rect.height;\n\n\t\t\t\t\t\tvar xLow = project(x1, axisX);\n\t\t\t\t\t\tvar xHigh = project(x2, axisX);\n\t\t\t\t\t\tvar yLow = project(y1, axisY);\n\t\t\t\t\t\tvar yHigh = project(y2, axisY);\n\n\t\t\t\t\t\tvar explb = chart.options.explicitBounds;\n\t\t\t\t\t\tif (!_.isUndefined(explb)) {\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchart.options.axisX.highLow = {low: xLow, high: xHigh};\n\t\t\t\t\t\tchart.options.axisY.highLow = {low: yLow, high: yHigh};\n\n\t\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t\t\tonZoom && onZoom(chart, reset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseMove(event) {\n\t\t\t\t\tif (downPosition) {\n\t\t\t\t\t\tvar point = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, point));\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tfunction hide(rect) {\n\t\t\trect.attr({style: 'display:none'});\n\t\t}\n\n\t\tfunction show(rect) {\n\t\t\trect.attr({style: 'display:block'});\n\t\t}\n\n\t\tfunction getRect(firstPoint, secondPoint) {\n\t\t\tvar x = firstPoint.x;\n\t\t\tvar y = firstPoint.y;\n\t\t\tvar width = secondPoint.x - x;\n\t\t\tvar height = secondPoint.y - y;\n\t\t\tif (width < 0) {\n\t\t\t\twidth = -width;\n\t\t\t\tx = secondPoint.x;\n\t\t\t}\n\t\t\tif (height < 0) {\n\t\t\t\theight = -height;\n\t\t\t\ty = secondPoint.y;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t}\n\n\t\tfunction position(event, svg) {\n\t\t\treturn transform(event.clientX, event.clientY, svg);\n\t\t}\n\n\t\tfunction transform(x, y, svgElement) {\n\t\t\tvar svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n\t\t\tvar matrix = svg.getScreenCTM();\n\t\t\tvar point = svg.createSVGPoint();\n\t\t\tpoint.x = x;\n\t\t\tpoint.y = y;\n\t\t\tpoint = point.matrixTransform(matrix.inverse());\n\t\t\treturn point || {x: 0, y: 0};\n\t\t}\n\n\t\tfunction project(value, axis) {\n\t\t\tvar max = axis.bounds.max;\n\t\t\tvar min = axis.bounds.min;\n\t\t\tif (axis.scale && axis.scale.type === 'log') {\n\t\t\t\tvar base = axis.scale.base;\n\t\t\t\treturn Math.pow(base,\n\t\t\t\t\t\tvalue * baseLog(max / min, base) / axis.axisLength) * min;\n\t\t\t}\n\t\t\treturn (value * axis.bounds.range / axis.axisLength) + min;\n\t\t}\n\n\t\tfunction baseLog(val, base) {\n\t\t\treturn Math.log(val) / Math.log(base);\n\t\t}\n\n\t}(window, document, Chartist));\n\treturn Chartist.plugins.zoom;\n\n}));\n","/**\n * @license\n * lodash 4.6.1 (Custom Build) \n * Build: `lodash include=\"range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined\" exports=\"global\" -d`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.6.1';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n NAN = 0 / 0;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[mapTag] = cloneableTags[numberTag] =\n cloneableTags[objectTag] = cloneableTags[regexpTag] =\n cloneableTags[setTag] = cloneableTags[stringTag] =\n cloneableTags[symbolTag] = cloneableTags[uint8Tag] =\n cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =\n cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseInt = parseInt;\n\n /** Detect free variable `exports`. */\n var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n /** Detect free variable `module`. */\n var freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = (freeModule && freeModule.exports === freeExports)\n ? freeExports\n : undefined;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n /** Detect free variable `self`. */\n var freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n /** Detect free variable `window`. */\n var freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n /** Detect `this` as the global object. */\n var thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `Map#set` because it doesn't return the map instance in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n set.add(value);\n return set;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the new array of key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\n function checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Converts `map` to an array.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the converted array.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Converts `set` to an array.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the converted array.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertySymbols = Object.getOwnPropertySymbols,\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeKeys = Object.keys,\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var mapCtorString = Map ? funcToString.call(Map) : '',\n setCtorString = Set ? funcToString.call(Set) : '',\n weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chaining. Methods that operate on and return arrays, collections, and\n * functions can be chained together. Methods that retrieve a single value or\n * may return a primitive value will automatically end the chain sequence and\n * return the unwrapped value. Otherwise, the value must be unwrapped with\n * `_#value`.\n *\n * Explicit chaining, which must be unwrapped with `_#value` in all cases,\n * may be enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization to merge iteratee calls; this avoids the creation\n * of intermediate arrays and can greatly reduce the number of iteratee executions.\n * Sections of a chain sequence qualify for shortcut fusion if the section is\n * applied to an array of at least two hundred elements and any iteratees\n * accept only one argument. The heuristic for whether a section qualifies\n * for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,\n * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,\n * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,\n * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,\n * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,\n * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,\n * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,\n * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,\n * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,\n * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,\n * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,\n * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,\n * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,\n * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,\n * `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,\n * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,\n * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,\n * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,\n * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,\n * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,\n * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,\n * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,\n * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,\n * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,\n * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,\n * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,\n * `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an hash object.\n *\n * @private\n * @constructor\n * @returns {Object} Returns the new hash object.\n */\n function Hash() {}\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(hash, key) {\n return hashHas(hash, key) && delete hash[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(hash, key) {\n if (nativeCreate) {\n var result = hash[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(hash, key) ? hash[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(hash, key) {\n return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function hashSet(hash, key, value) {\n hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function MapCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapDelete(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashDelete(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map['delete'](key) : assocDelete(data.map, key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapGet(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashGet(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.get(key) : assocGet(data.map, key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashHas(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.has(key) : assocHas(data.map, key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache object.\n */\n function mapSet(key, value) {\n var data = this.__data__;\n if (isKeyable(key)) {\n hashSet(typeof key == 'string' ? data.string : data.hash, key, value);\n } else if (Map) {\n data.map.set(key, value);\n } else {\n assocSet(data.map, key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function Stack(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocDelete(array, key) : data.map['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocGet(array, key) : data.map.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocHas(array, key) : data.map.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache object.\n */\n function stackSet(key, value) {\n var data = this.__data__,\n array = data.array;\n\n if (array) {\n if (array.length < (LARGE_ARRAY_SIZE - 1)) {\n assocSet(array, key, value);\n } else {\n data.array = null;\n data.map = new MapCache(array);\n }\n }\n var map = data.map;\n if (map) {\n map.set(key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Removes `key` and its value from the associative array.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function assocDelete(array, key) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n return false;\n }\n var lastIndex = array.length - 1;\n if (index == lastIndex) {\n array.pop();\n } else {\n splice.call(array, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the associative array value for `key`.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function assocGet(array, key) {\n var index = assocIndexOf(array, key);\n return index < 0 ? undefined : array[index][1];\n }\n\n /**\n * Checks if an associative array value for `key` exists.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function assocHas(array, key) {\n return assocIndexOf(array, key) > -1;\n }\n\n /**\n * Gets the index at which the first occurrence of `key` is found in `array`\n * of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Sets the associative array `key` to `value`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function assocSet(array, key, value) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n array.push([key, value]);\n } else {\n array[index][1] = value;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the array-like object.\n */\n function baseCastFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function baseCastPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n result = baseAssign(result, value);\n return isFull ? copySymbols(value, result) : result;\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return (isFull && !isArr) ? copySymbols(value, result) : result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path + ''] : baseCastPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n stack || (stack = new Stack);\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack,\n result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;\n\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n var type = typeof value;\n if (type == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (type == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n return nativeKeys(Object(object));\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value &&\n (value !== undefined || (key in Object(object)));\n };\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments to numbers.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the new array of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map) {\n return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set) {\n return arrayReduce(setToArray(set), addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n }\n\n /**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toNumber(start);\n start = start === start ? start : 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toNumber(end) || 0;\n }\n step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var index = -1,\n isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n isUnordered = bitmask & UNORDERED_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(array, other);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isUnordered) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object) ? other != +other : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n // Recursively compare objects (susceptible to call stack limits).\n return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : baseHas(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n return result;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If the `_.iteratee` method is\n * customized this function returns the custom method, otherwise it returns\n * `baseIteratee`. If arguments are provided the chosen function is invoked\n * with them and its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = toPairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = getOwnPropertySymbols || function() {\n return [];\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function getTag(value) {\n return objectToString.call(value);\n }\n\n // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.\n if ((Map && getTag(new Map) != mapTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : null,\n ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case mapCtorString: return mapTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n if (object == null) {\n return false;\n }\n var result = hasFunc(object, path);\n if (!result && !isKey(path)) {\n path = baseCastPath(path);\n object = parent(object, path);\n if (object != null) {\n path = last(path);\n result = hasFunc(object, path);\n }\n }\n var length = object ? object.length : undefined;\n return result || (\n !!length && isLength(length) && isIndex(path, length) &&\n (isArray(object) || isString(object) || isArguments(object))\n );\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototypeOf(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\n function indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (typeof value == 'number') {\n return true;\n }\n return !isArray(value) &&\n (reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object)));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return type == 'number' || type == 'boolean' ||\n (type == 'string' && value != '__proto__') || value == null;\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n function stringToPath(string) {\n var result = [];\n toString(string).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`\n * for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => logs `1` then `2`\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' then 'b' (iteration order is not guaranteed)\n */\n function forEach(collection, iteratee) {\n return (typeof iteratee == 'function' && isArray(collection))\n ? arrayEach(collection, iteratee)\n : baseEach(collection, baseCastFunction(iteratee));\n }\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,\n * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,\n * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,\n * and `words`\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = !Buffer ? constant(false) : function(value) {\n return value instanceof Buffer;\n };\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(funcToString.call(value));\n }\n return isObjectLike(value) &&\n (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\n function toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b.c');\n * // => true\n *\n * _.hasIn(object, ['a', 'b', 'c']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Creates an array of own enumerable key-value pairs for `object` which\n * can be consumed by `_.fromPairs`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n function toPairs(object) {\n return baseToPairs(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument given to it.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name the created callback returns the\n * property value for a given element. If `func` is an object the created\n * callback returns `true` for elements that contain the equivalent object\n * properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(callback, func) {\n * var p = /^(\\S+)\\s*([<>])\\s*(\\S+)$/.exec(func);\n * return !p ? callback(func) : function(object) {\n * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);\n * };\n * });\n *\n * _.filter(users, 'age > 36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /*------------------------------------------------------------------------*/\n\n // Avoid inheriting from `Object.prototype` when possible.\n Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;\n\n // Add functions to the `MapCache`.\n MapCache.prototype.clear = mapClear;\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Stack` cache.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n // Add functions that return wrapped values when chaining.\n lodash.constant = constant;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.property = property;\n lodash.range = range;\n lodash.toPairs = toPairs;\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isNative = isNative;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.replace = replace;\n lodash.toNumber = toNumber;\n lodash.toString = toString;\n lodash.unescape = unescape;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n // Expose lodash on the free variable `window` or `self` when available. This\n // prevents errors in cases where lodash is loaded by a script tag in the presence\n // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.\n (freeWindow || freeSelf || {})._ = lodash;\n\n // Export to the global object.\n root._ = lodash;\n}.call(this));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\nfunction numfmt(x, places) {\n\tvar pow = Math.pow(10, places);\n\treturn Math.round(x*pow) / pow;\n}\n\nfunction estimateLoadTime(fs, n) {\n\treturn (1000/fs)*n+1500;\n}\n\nfunction msNow() {\n\treturn +(new Date);\n}\n\nfunction msElapsed(start) {\n\treturn msNow() - start;\n}\n\nMath.log10 = Math.log10 || function(x) {\n\treturn Math.log(x) / Math.LN10;\n};\n\n/**\n * Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(_.escapeRegExp(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tif ($(this).hasClass('no-close')) return; // this is a no-close modal\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","var notify = (function () {\n\tvar nt = {};\n\tvar sel = '#notif';\n\n\tvar hideTmeo1;\n\tvar hideTmeo2;\n\n\tnt.show = function (message, timeout) {\n\t\t$(sel).html(message);\n\t\tmodal.show(sel);\n\n\t\tclearTimeout(hideTmeo1);\n\t\tclearTimeout(hideTmeo2);\n\n\t\tif (!_.isUndefined(timeout)) {\n\t\t\thideTmeo1 = setTimeout(nt.hide, timeout);\n\t\t}\n\t};\n\n\tnt.hide = function () {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\thideTmeo2 = setTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 250); // transition time\n\t};\n\n\tnt.init = function() {\n\t\t$(sel).on('click', function() {\n\t\t\tnt.hide(this);\n\t\t});\n\t};\n\n\treturn nt;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\t$('input[type=number]').on('mousewheel', function(e) {\n\t\tvar val = +$(this).val();\n\t\tvar step = +($(this).attr('step') || 1);\n\t\tvar min = $(this).attr('min');\n\t\tvar max = $(this).attr('max');\n\t\tif(e.wheelDelta > 0) {\n\t\t\tval += step;\n\t\t} else {\n\t\t\tval -= step;\n\t\t}\n\t\tif (!_.isUndefined(min)) val = Math.max(val, min);\n\t\tif (!_.isUndefined(max)) val = Math.min(val, max);\n\t\t$(this).val(val);\n\n\t\tif (\"createEvent\" in document) {\n\t\t\tvar evt = document.createEvent(\"HTMLEvents\");\n\t\t\tevt.initEvent(\"change\", false, true);\n\t\t\t$(this)[0].dispatchEvent(evt);\n\t\t} else {\n\t\t\t$(this)[0].fireEvent(\"onchange\");\n\t\t}\n\n\t\te.preventDefault();\n\t});\n\n\tmodal.init();\n\tnotify.init();\n});\n\n\nfunction errorMsg(msg, time) {\n\tnotify.show(msg, time || 3000);\n}\n","/** Wifi page */\nvar page_wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","lodash.custom.js","utils.js","modal.js","notif.js","app.js","page_wifi.js","page_waveform.js","page_spectrogram.js","page_status.js","page_mon.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC95HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\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}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\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\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (!_.isUndefined(value)) { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms\n\t\t\tvar xhr;\n\t\t\tvar\tquery = serializeData(nodes);\n\t\t\tvar\ttype = (method) ? method.toUpperCase() : 'GET';\n\t\t\tvar\tabortTmeo;\n\n\t\t\tif (_.isNumber(options)) options = {timeout: options};\n\n\t\t\tvar opts = Chartist.extend({}, {\n\t\t\t\tnocache: true,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tloader: true,\n\t\t\t}, options);\n\n\t\t\t//console.log('ajax to = ' + opts.timeout);\n\n\t\t\tif (query && (type === 'GET')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// FIXME the XHR sometimes seemingly silently fails\n\n\t\t\txhr = new XMLHttpRequest(); // we dont support IE < 9\n\n\t\t\tif (xhr) {\n\t\t\t\t// prevent caching\n\t\t\t\tif (opts.nocache) {\n\t\t\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t\t\t}\n\n\t\t\t\tif (opts.loader)\n\t\t\t\t\t$('#loader').addClass('show');\n\n\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\txhr.timeout = opts.timeout;\n\n\t\t\t\tabortTmeo = setTimeout(function () {\n\t\t\t\t\terrorMsg(\"XHR timed out.\");\n\t\t\t\t\txhr.abort();\n\t\t\t\t\tif (opts.loader) $('#loader').removeClass('show');\n\t\t\t\t}, opts.timeout + 10); // a bit later, but still.;\n\n\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\n\t\t\t\t\t\tif (opts.loader)\n\t\t\t\t\t\t\t$('#loader').removeClass('show');\n\n\t\t\t\t\t\tif (callback && xhr.status != 0) { // xhr.status 0 means \"aborted\"\n\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\tif (type === 'POST') {\n\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t}\n\n\t\t\t\txhr.send(query);\n\t\t\t}\n\n\t\t\treturn xhr;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback)\n\t\tcb.get = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'get', callback, opts);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback)\n\t\tcb.post = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'post', callback, opts);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n // Chartist.escapingMap = {\n // '&': '&',\n // '<': '<',\n // '>': '>',\n // '\"': '"',\n // '\\'': '''\n // };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return _.escape(data);\n\n // return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n // }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n // }, data);\n data = _.unescape(data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n // /**\n // * Calculate cartesian coordinates of polar coordinates\n // *\n // * @memberof Chartist.Core\n // * @param {Number} centerX X-axis coordinates of center point of circle segment\n // * @param {Number} centerY X-axis coordinates of center point of circle segment\n // * @param {Number} radius Radius of circle segment\n // * @param {Number} angleInDegrees Angle of circle segment in degrees\n // * @return {{x:Number, y:Number}} Coordinates of point on circumference\n // */\n // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n //\n // return {\n // x: centerX + (radius * Math.cos(angleInRadians)),\n // y: centerY + (radius * Math.sin(angleInRadians))\n // };\n // };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\n if (_.isNumber(lblText)) {\n lblText = Chartist.roundWithPrecision(lblText, 2);\n }\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n // /**\n // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n // *\n // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n // *\n // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n // *\n // * @example\n // * var chart = new Chartist.Line('.ct-chart', {\n // * labels: [1, 2, 3, 4, 5],\n // * series: [[1, 2, 8, 1, 7]]\n // * }, {\n // * lineSmooth: Chartist.Interpolation.cardinal({\n // * tension: 1,\n // * fillHoles: false\n // * })\n // * });\n // *\n // * @memberof Chartist.Interpolation\n // * @param {Object} options The options of the cardinal factory function.\n // * @return {Function}\n // */\n // Chartist.Interpolation.cardinal = function(options) {\n // var defaultOptions = {\n // tension: 1,\n // fillHoles: false\n // };\n //\n // options = Chartist.extend({}, defaultOptions, options);\n //\n // var t = Math.min(1, Math.max(0, options.tension)),\n // c = 1 - t;\n //\n // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // // This functionality is necessary to treat \"holes\" in the line charts\n // function splitIntoSegments(pathCoordinates, valueData) {\n // var segments = [];\n // var hole = true;\n //\n // for(var i = 0; i < pathCoordinates.length; i += 2) {\n // // If this value is a \"hole\" we set the hole flag\n // if(valueData[i / 2].value === undefined) {\n // if(!options.fillHoles) {\n // hole = true;\n // }\n // } else {\n // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n // if(hole) {\n // segments.push({\n // pathCoordinates: [],\n // valueData: []\n // });\n // // As we have a valid value now, we are not in a \"hole\" anymore\n // hole = false;\n // }\n //\n // // Add to the segment pathCoordinates and valueData\n // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n // segments[segments.length - 1].valueData.push(valueData[i / 2]);\n // }\n // }\n //\n // return segments;\n // }\n //\n // return function cardinal(pathCoordinates, valueData) {\n // // First we try to split the coordinates into segments\n // // This is necessary to treat \"holes\" in line charts\n // var segments = splitIntoSegments(pathCoordinates, valueData);\n //\n // if(!segments.length) {\n // // If there were no segments return 'Chartist.Interpolation.none'\n // return Chartist.Interpolation.none()([]);\n // } else if(segments.length > 1) {\n // // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // // afterwards together into a single path.\n // var paths = [];\n // // For each segment we will recurse the cardinal function\n // segments.forEach(function(segment) {\n // paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n // });\n // // Join the segment path data into a single path and return\n // return Chartist.Svg.Path.join(paths);\n // } else {\n // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // // segment\n // pathCoordinates = segments[0].pathCoordinates;\n // valueData = segments[0].valueData;\n //\n // // If less than two points we need to fallback to no smoothing\n // if(pathCoordinates.length <= 4) {\n // return Chartist.Interpolation.none()(pathCoordinates, valueData);\n // }\n //\n // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n // z;\n //\n // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n // var p = [\n // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n // ];\n // if (z) {\n // if (!i) {\n // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n // } else if (iLen - 4 === i) {\n // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // } else if (iLen - 2 === i) {\n // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n // }\n // } else {\n // if (iLen - 4 === i) {\n // p[3] = p[2];\n // } else if (!i) {\n // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n // }\n // }\n //\n // path.curve(\n // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n // p[2].x,\n // p[2].y,\n // false,\n // valueData[(i + 2) / 2]\n // );\n // }\n //\n // return path;\n // }\n // };\n // };\n\n\n /**\n * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.\n *\n * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.monotoneCubic({\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the monotoneCubic factory function.\n * @return {Function}\n */\n Chartist.Interpolation.monotoneCubic = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {\n // Because we are doing monotone interpolation, curve fitting only makes sense for\n // increasing x values. Therefore if two subsequent points have the same x value, or\n // the x value is decreasing, then we create a hole at this point. (Which cannot be\n // filled in even with the 'fillHoles' option)\n\n hole = true;\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function monotoneCubic(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the monotoneCubic fn function\n segments.forEach(function(segment) {\n paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than three points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var xs = [],\n ys = [],\n i,\n n = pathCoordinates.length / 2,\n ms = [],\n ds = [], dys = [], dxs = [],\n path;\n\n // Populate x and y coordinates into separate arrays, for readability\n\n for(i = 0; i < n; i++) {\n xs[i] = pathCoordinates[i * 2];\n ys[i] = pathCoordinates[i * 2 + 1];\n }\n\n // Calculate deltas and derivative\n\n for(i = 0; i < n - 1; i++) {\n dys[i] = ys[i + 1] - ys[i];\n dxs[i] = xs[i + 1] - xs[i];\n ds[i] = dys[i] / dxs[i];\n }\n\n // Determine desired slope (m) at each point using Fritsch-Carlson method\n // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation\n\n ms[0] = ds[0];\n ms[n - 1] = ds[n - 2];\n\n for(i = 1; i < n - 1; i++) {\n if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {\n ms[i] = 0;\n } else {\n ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (\n (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +\n (dxs[i] + 2 * dxs[i - 1]) / ds[i]);\n\n if(!isFinite(ms[i])) {\n ms[i] = 0;\n }\n }\n }\n\n // Now build a path from the slopes\n\n path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);\n\n for(i = 0; i < n - 1; i++) {\n path.curve(\n // First control point\n xs[i] + dxs[i] / 3,\n ys[i] + ms[i] * dxs[i] / 3,\n // Second control point\n xs[i + 1] - dxs[i] / 3,\n ys[i + 1] - ms[i + 1] * dxs[i] / 3,\n // End point\n xs[i + 1],\n ys[i + 1],\n\n false,\n valueData[i + 1] // changed as per patch on github\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var xy = this.units.pos.toUpperCase();\n var axisOptions = chartOptions['axis' + xy];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n\n\n var labelLength=0;\n\n\n if (xy == 'Y') { // X doesnt use this\n if (projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n // lastWidth = labelLength;\n // } else if (typeof lastWidth != 'undefined') {\n // labelLength = lastWidth; // EDIT. added the lastWidth thing\n } else {\n // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // still be visible inside of the chart padding.\n labelLength = Math.max(this.axisLength - projectedValue, 30);\n }\n }\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// // AMD. Register as an anonymous module.\n\t// define([], function () {\n\t// return (root.returnExportsGlobal = factory());\n\t// });\n\t// } else if (typeof exports === 'object') {\n\t// // Node. Does not work with strict CommonJS, but\n\t// // only CommonJS-like enviroments that support module.exports,\n\t// // like Node.\n\t// module.exports = factory();\n\t// } else {\n\troot['Chartist.plugins.zoom'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js zoom plugin.\n\t *\n\t */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar defaultOptions = {\n\t\t\t// onZoom\n\t\t\t// resetOnRightMouseBtn\n\t\t};\n\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.zoom = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function zoom(chart) {\n\n\t\t\t\tif (!(chart instanceof Chartist.Line)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rect, svg, axisX, axisY, chartRect;\n\t\t\t\tvar downPosition;\n\t\t\t\tvar onZoom = options.onZoom;\n\t\t\t\tvar ongoingTouches = [];\n\n\t\t\t\tchart.on('draw', function (data) {\n\t\t\t\t\tvar type = data.type;\n\t\t\t\t\tif (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n\t\t\t\t\t\tdata.element.attr({\n\t\t\t\t\t\t\t'clip-path': 'url(#zoom-mask)'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\taxisX = data.axisX;\n\t\t\t\t\taxisY = data.axisY;\n\t\t\t\t\tchartRect = data.chartRect;\n\t\t\t\t\tsvg = data.svg._node;\n\t\t\t\t\trect = data.svg.elem('rect', {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 10,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\theight: 100,\n\t\t\t\t\t}, 'ct-zoom-rect');\n\t\t\t\t\thide(rect);\n\n\t\t\t\t\tvar defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n\t\t\t\t\tvar width = chartRect.width();\n\t\t\t\t\tvar height = chartRect.height();\n\n\t\t\t\t\tdefs\n\t\t\t\t\t\t.elem('clipPath', {\n\t\t\t\t\t\t\tid: 'zoom-mask'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.elem('rect', {\n\t\t\t\t\t\t\tx: chartRect.x1,\n\t\t\t\t\t\t\ty: chartRect.y2,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\theight: height,\n\t\t\t\t\t\t\tfill: 'white'\n\t\t\t\t\t\t});\n\n\t\t\t\t\tsvg.addEventListener('mousedown', onMouseDown);\n\t\t\t\t\tsvg.addEventListener('mouseup', onMouseUp);\n\t\t\t\t\tsvg.addEventListener('mousemove', onMouseMove);\n\t\t\t\t\tsvg.addEventListener('touchstart', onTouchStart);\n\t\t\t\t\tsvg.addEventListener('touchmove', onTouchMove);\n\t\t\t\t\tsvg.addEventListener('touchend', onTouchEnd);\n\t\t\t\t\tsvg.addEventListener('touchcancel', onTouchCancel);\n\t\t\t\t});\n\n\t\t\t\tfunction copyTouch(touch) {\n\t\t\t\t\tvar p = position(touch, svg);\n\t\t\t\t\tp.id = touch.identifier;\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tfunction ongoingTouchIndexById(idToFind) {\n\t\t\t\t\tfor (var i = 0; i < ongoingTouches.length; i++) {\n\t\t\t\t\t\tvar id = ongoingTouches[i].id;\n\t\t\t\t\t\tif (id === idToFind) {\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchStart(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tongoingTouches.push(copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchMove(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchCancel(event) {\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t}\n\n\t\t\t\tfunction removeTouches(touches) {\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\t\tongoingTouches.splice(idx, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchEnd(event) {\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\tzoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t}\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t\thide(rect);\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseDown(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tdownPosition = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, downPosition));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar reset = function () {\n\t\t\t\t\tchart.options.axisX.highLow = null;\n\t\t\t\t\tchart.options.axisY.highLow = null;\n\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t};\n\n\t\t\t\tfunction onMouseUp(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tvar box = getRect(downPosition, position(event, svg));\n\t\t\t\t\t\tzoomIn(box);\n\t\t\t\t\t\tdownPosition = null;\n\t\t\t\t\t\thide(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\telse if (options.resetOnRightMouseBtn && event.button === 2) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction zoomIn(rect) {\n\t\t\t\t\tif (rect.width > 5 && rect.height > 5) {\n\t\t\t\t\t\tvar x1 = rect.x - chartRect.x1;\n\t\t\t\t\t\tvar x2 = x1 + rect.width;\n\t\t\t\t\t\tvar y2 = chartRect.y1 - rect.y;\n\t\t\t\t\t\tvar y1 = y2 - rect.height;\n\n\t\t\t\t\t\tvar xLow = project(x1, axisX);\n\t\t\t\t\t\tvar xHigh = project(x2, axisX);\n\t\t\t\t\t\tvar yLow = project(y1, axisY);\n\t\t\t\t\t\tvar yHigh = project(y2, axisY);\n\n\t\t\t\t\t\tvar explb = chart.options.explicitBounds;\n\t\t\t\t\t\tif (!_.isUndefined(explb)) {\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchart.options.axisX.highLow = {low: xLow, high: xHigh};\n\t\t\t\t\t\tchart.options.axisY.highLow = {low: yLow, high: yHigh};\n\n\t\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t\t\tonZoom && onZoom(chart, reset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseMove(event) {\n\t\t\t\t\tif (downPosition) {\n\t\t\t\t\t\tvar point = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, point));\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tfunction hide(rect) {\n\t\t\trect.attr({style: 'display:none'});\n\t\t}\n\n\t\tfunction show(rect) {\n\t\t\trect.attr({style: 'display:block'});\n\t\t}\n\n\t\tfunction getRect(firstPoint, secondPoint) {\n\t\t\tvar x = firstPoint.x;\n\t\t\tvar y = firstPoint.y;\n\t\t\tvar width = secondPoint.x - x;\n\t\t\tvar height = secondPoint.y - y;\n\t\t\tif (width < 0) {\n\t\t\t\twidth = -width;\n\t\t\t\tx = secondPoint.x;\n\t\t\t}\n\t\t\tif (height < 0) {\n\t\t\t\theight = -height;\n\t\t\t\ty = secondPoint.y;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t}\n\n\t\tfunction position(event, svg) {\n\t\t\treturn transform(event.clientX, event.clientY, svg);\n\t\t}\n\n\t\tfunction transform(x, y, svgElement) {\n\t\t\tvar svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n\t\t\tvar matrix = svg.getScreenCTM();\n\t\t\tvar point = svg.createSVGPoint();\n\t\t\tpoint.x = x;\n\t\t\tpoint.y = y;\n\t\t\tpoint = point.matrixTransform(matrix.inverse());\n\t\t\treturn point || {x: 0, y: 0};\n\t\t}\n\n\t\tfunction project(value, axis) {\n\t\t\tvar max = axis.bounds.max;\n\t\t\tvar min = axis.bounds.min;\n\t\t\tif (axis.scale && axis.scale.type === 'log') {\n\t\t\t\tvar base = axis.scale.base;\n\t\t\t\treturn Math.pow(base,\n\t\t\t\t\t\tvalue * baseLog(max / min, base) / axis.axisLength) * min;\n\t\t\t}\n\t\t\treturn (value * axis.bounds.range / axis.axisLength) + min;\n\t\t}\n\n\t\tfunction baseLog(val, base) {\n\t\t\treturn Math.log(val) / Math.log(base);\n\t\t}\n\n\t}(window, document, Chartist));\n\treturn Chartist.plugins.zoom;\n\n}));\n","/**\n * @license\n * lodash 4.6.1 (Custom Build) \n * Build: `lodash include=\"range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined\" exports=\"global\" -d`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.6.1';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n NAN = 0 / 0;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[mapTag] = cloneableTags[numberTag] =\n cloneableTags[objectTag] = cloneableTags[regexpTag] =\n cloneableTags[setTag] = cloneableTags[stringTag] =\n cloneableTags[symbolTag] = cloneableTags[uint8Tag] =\n cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =\n cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseInt = parseInt;\n\n /** Detect free variable `exports`. */\n var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n /** Detect free variable `module`. */\n var freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = (freeModule && freeModule.exports === freeExports)\n ? freeExports\n : undefined;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n /** Detect free variable `self`. */\n var freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n /** Detect free variable `window`. */\n var freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n /** Detect `this` as the global object. */\n var thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `Map#set` because it doesn't return the map instance in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n set.add(value);\n return set;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the new array of key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\n function checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Converts `map` to an array.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the converted array.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Converts `set` to an array.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the converted array.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertySymbols = Object.getOwnPropertySymbols,\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeKeys = Object.keys,\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var mapCtorString = Map ? funcToString.call(Map) : '',\n setCtorString = Set ? funcToString.call(Set) : '',\n weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chaining. Methods that operate on and return arrays, collections, and\n * functions can be chained together. Methods that retrieve a single value or\n * may return a primitive value will automatically end the chain sequence and\n * return the unwrapped value. Otherwise, the value must be unwrapped with\n * `_#value`.\n *\n * Explicit chaining, which must be unwrapped with `_#value` in all cases,\n * may be enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization to merge iteratee calls; this avoids the creation\n * of intermediate arrays and can greatly reduce the number of iteratee executions.\n * Sections of a chain sequence qualify for shortcut fusion if the section is\n * applied to an array of at least two hundred elements and any iteratees\n * accept only one argument. The heuristic for whether a section qualifies\n * for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,\n * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,\n * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,\n * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,\n * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,\n * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,\n * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,\n * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,\n * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,\n * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,\n * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,\n * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,\n * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,\n * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,\n * `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,\n * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,\n * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,\n * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,\n * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,\n * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,\n * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,\n * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,\n * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,\n * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,\n * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,\n * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,\n * `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an hash object.\n *\n * @private\n * @constructor\n * @returns {Object} Returns the new hash object.\n */\n function Hash() {}\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(hash, key) {\n return hashHas(hash, key) && delete hash[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(hash, key) {\n if (nativeCreate) {\n var result = hash[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(hash, key) ? hash[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(hash, key) {\n return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function hashSet(hash, key, value) {\n hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function MapCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapDelete(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashDelete(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map['delete'](key) : assocDelete(data.map, key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapGet(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashGet(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.get(key) : assocGet(data.map, key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashHas(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.has(key) : assocHas(data.map, key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache object.\n */\n function mapSet(key, value) {\n var data = this.__data__;\n if (isKeyable(key)) {\n hashSet(typeof key == 'string' ? data.string : data.hash, key, value);\n } else if (Map) {\n data.map.set(key, value);\n } else {\n assocSet(data.map, key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function Stack(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocDelete(array, key) : data.map['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocGet(array, key) : data.map.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocHas(array, key) : data.map.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache object.\n */\n function stackSet(key, value) {\n var data = this.__data__,\n array = data.array;\n\n if (array) {\n if (array.length < (LARGE_ARRAY_SIZE - 1)) {\n assocSet(array, key, value);\n } else {\n data.array = null;\n data.map = new MapCache(array);\n }\n }\n var map = data.map;\n if (map) {\n map.set(key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Removes `key` and its value from the associative array.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function assocDelete(array, key) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n return false;\n }\n var lastIndex = array.length - 1;\n if (index == lastIndex) {\n array.pop();\n } else {\n splice.call(array, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the associative array value for `key`.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function assocGet(array, key) {\n var index = assocIndexOf(array, key);\n return index < 0 ? undefined : array[index][1];\n }\n\n /**\n * Checks if an associative array value for `key` exists.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function assocHas(array, key) {\n return assocIndexOf(array, key) > -1;\n }\n\n /**\n * Gets the index at which the first occurrence of `key` is found in `array`\n * of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Sets the associative array `key` to `value`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function assocSet(array, key, value) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n array.push([key, value]);\n } else {\n array[index][1] = value;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the array-like object.\n */\n function baseCastFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function baseCastPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n result = baseAssign(result, value);\n return isFull ? copySymbols(value, result) : result;\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return (isFull && !isArr) ? copySymbols(value, result) : result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path + ''] : baseCastPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n stack || (stack = new Stack);\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack,\n result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;\n\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n var type = typeof value;\n if (type == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (type == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n return nativeKeys(Object(object));\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value &&\n (value !== undefined || (key in Object(object)));\n };\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments to numbers.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the new array of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map) {\n return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set) {\n return arrayReduce(setToArray(set), addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n }\n\n /**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toNumber(start);\n start = start === start ? start : 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toNumber(end) || 0;\n }\n step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var index = -1,\n isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n isUnordered = bitmask & UNORDERED_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(array, other);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isUnordered) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object) ? other != +other : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n // Recursively compare objects (susceptible to call stack limits).\n return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : baseHas(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n return result;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If the `_.iteratee` method is\n * customized this function returns the custom method, otherwise it returns\n * `baseIteratee`. If arguments are provided the chosen function is invoked\n * with them and its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = toPairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = getOwnPropertySymbols || function() {\n return [];\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function getTag(value) {\n return objectToString.call(value);\n }\n\n // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.\n if ((Map && getTag(new Map) != mapTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : null,\n ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case mapCtorString: return mapTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n if (object == null) {\n return false;\n }\n var result = hasFunc(object, path);\n if (!result && !isKey(path)) {\n path = baseCastPath(path);\n object = parent(object, path);\n if (object != null) {\n path = last(path);\n result = hasFunc(object, path);\n }\n }\n var length = object ? object.length : undefined;\n return result || (\n !!length && isLength(length) && isIndex(path, length) &&\n (isArray(object) || isString(object) || isArguments(object))\n );\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototypeOf(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\n function indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (typeof value == 'number') {\n return true;\n }\n return !isArray(value) &&\n (reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object)));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return type == 'number' || type == 'boolean' ||\n (type == 'string' && value != '__proto__') || value == null;\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n function stringToPath(string) {\n var result = [];\n toString(string).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`\n * for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => logs `1` then `2`\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' then 'b' (iteration order is not guaranteed)\n */\n function forEach(collection, iteratee) {\n return (typeof iteratee == 'function' && isArray(collection))\n ? arrayEach(collection, iteratee)\n : baseEach(collection, baseCastFunction(iteratee));\n }\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,\n * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,\n * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,\n * and `words`\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = !Buffer ? constant(false) : function(value) {\n return value instanceof Buffer;\n };\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(funcToString.call(value));\n }\n return isObjectLike(value) &&\n (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\n function toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b.c');\n * // => true\n *\n * _.hasIn(object, ['a', 'b', 'c']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Creates an array of own enumerable key-value pairs for `object` which\n * can be consumed by `_.fromPairs`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n function toPairs(object) {\n return baseToPairs(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument given to it.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name the created callback returns the\n * property value for a given element. If `func` is an object the created\n * callback returns `true` for elements that contain the equivalent object\n * properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(callback, func) {\n * var p = /^(\\S+)\\s*([<>])\\s*(\\S+)$/.exec(func);\n * return !p ? callback(func) : function(object) {\n * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);\n * };\n * });\n *\n * _.filter(users, 'age > 36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /*------------------------------------------------------------------------*/\n\n // Avoid inheriting from `Object.prototype` when possible.\n Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;\n\n // Add functions to the `MapCache`.\n MapCache.prototype.clear = mapClear;\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Stack` cache.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n // Add functions that return wrapped values when chaining.\n lodash.constant = constant;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.property = property;\n lodash.range = range;\n lodash.toPairs = toPairs;\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isNative = isNative;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.replace = replace;\n lodash.toNumber = toNumber;\n lodash.toString = toString;\n lodash.unescape = unescape;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n // Expose lodash on the free variable `window` or `self` when available. This\n // prevents errors in cases where lodash is loaded by a script tag in the presence\n // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.\n (freeWindow || freeSelf || {})._ = lodash;\n\n // Export to the global object.\n root._ = lodash;\n}.call(this));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\nfunction numfmt(x, places) {\n\tvar pow = Math.pow(10, places);\n\treturn Math.round(x*pow) / pow;\n}\n\nfunction estimateLoadTime(fs, n) {\n\treturn (1000/fs)*n+1500;\n}\n\nfunction msNow() {\n\treturn +(new Date);\n}\n\nfunction msElapsed(start) {\n\treturn msNow() - start;\n}\n\nMath.log10 = Math.log10 || function(x) {\n\treturn Math.log(x) / Math.LN10;\n};\n\n/**\n * Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(_.escapeRegExp(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tif ($(this).hasClass('no-close')) return; // this is a no-close modal\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","var notify = (function () {\n\tvar nt = {};\n\tvar sel = '#notif';\n\n\tvar hideTmeo1;\n\tvar hideTmeo2;\n\n\tnt.show = function (message, timeout) {\n\t\t$(sel).html(message);\n\t\tmodal.show(sel);\n\n\t\tclearTimeout(hideTmeo1);\n\t\tclearTimeout(hideTmeo2);\n\n\t\tif (!_.isUndefined(timeout)) {\n\t\t\thideTmeo1 = setTimeout(nt.hide, timeout);\n\t\t}\n\t};\n\n\tnt.hide = function () {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\thideTmeo2 = setTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 250); // transition time\n\t};\n\n\tnt.init = function() {\n\t\t$(sel).on('click', function() {\n\t\t\tnt.hide(this);\n\t\t});\n\t};\n\n\treturn nt;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\t$('input[type=number]').on('mousewheel', function(e) {\n\t\tvar val = +$(this).val();\n\t\tvar step = +($(this).attr('step') || 1);\n\t\tvar min = $(this).attr('min');\n\t\tvar max = $(this).attr('max');\n\t\tif(e.wheelDelta > 0) {\n\t\t\tval += step;\n\t\t} else {\n\t\t\tval -= step;\n\t\t}\n\t\tif (!_.isUndefined(min)) val = Math.max(val, min);\n\t\tif (!_.isUndefined(max)) val = Math.min(val, max);\n\t\t$(this).val(val);\n\n\t\tif (\"createEvent\" in document) {\n\t\t\tvar evt = document.createEvent(\"HTMLEvents\");\n\t\t\tevt.initEvent(\"change\", false, true);\n\t\t\t$(this)[0].dispatchEvent(evt);\n\t\t} else {\n\t\t\t$(this)[0].fireEvent(\"onchange\");\n\t\t}\n\n\t\te.preventDefault();\n\t});\n\n\tmodal.init();\n\tnotify.init();\n});\n\n\nfunction errorMsg(msg, time) {\n\tnotify.show(msg, time || 3000);\n}\n","/** Wifi page */\nvar page_wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n","var page_mon = (function() {\n\tvar mon = {};\n\n\tfunction updRefInfoField(ok) {\n\t\t$('#hasref').html(ok ? 'OK' : 'Not set!');\n\t}\n\n\t/** Capture reference & save to flash */\n\tmon.captureRef = function() {\n\t\t$().get(_root + '/mon/setref', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tupdRefInfoField(j.success);\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\tupdRefInfoField(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Capture waveform and compare with reference */\n\tmon.compareNow = function() {\n\t\t$().get(_root + '/mon/compare', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t$('#refdist').html(numfmt(j.deviation, 2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorMsg('Capture failed.');\n\t\t\t\t\t\t$('#refdist').html('--');\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t$('#refdist').html('--');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tmon.init = function() {\n\t\t//\n\t};\n\n\treturn mon;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/html_src/page_monitoring.php b/html_src/page_monitoring.php index 2b5a517..75f142e 100644 --- a/html_src/page_monitoring.php +++ b/html_src/page_monitoring.php @@ -15,7 +15,7 @@ Actual distance: - N/A + N/A Measure @@ -36,8 +36,8 @@ - - seconds +  seconds @@ -49,21 +49,15 @@ - - - + - - - +   - - - + From daf3d6dee43f1732e30979e591821d13075736ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 11:42:47 +0200 Subject: [PATCH 05/11] work on reporting code. todo.. Former-commit-id: 0a0a48ec0d540d232b2cf3e8930a125ad7f38256 --- _web-build_do.sh | 3 +- esp_meas.pro | 8 +- html/css/app.css | 2 +- html/js/all.js | 6 +- html/pages/about.tpl | 13 +- html/pages/fft.html | 2 +- html/pages/monitoring.tpl | 99 + html/pages/sgm.html | 2 +- html/pages/status.tpl | 4 +- html/pages/wfm.html | 2 +- html/pages/wifi.tpl | 2 +- html_src/css/app.css | 1367 +----- html_src/js/all.js | 9499 +------------------------------------ user/datalink.h | 3 + user/page_monitoring.c | 39 + user/page_monitoring.h | 8 + user/reporting.c | 103 + user/reporting.h | 45 + user/routes.c | 2 + 19 files changed, 328 insertions(+), 10881 deletions(-) create mode 100644 html/pages/monitoring.tpl create mode 100644 user/page_monitoring.c create mode 100644 user/page_monitoring.h create mode 100644 user/reporting.c create mode 100644 user/reporting.h diff --git a/_web-build_do.sh b/_web-build_do.sh index ee2bb5d..695a0d2 100755 --- a/_web-build_do.sh +++ b/_web-build_do.sh @@ -26,6 +26,7 @@ mkdir -p "$BLDDIR/pages" php "$SRCDIR/page_status.php" > "$BLDDIR/pages/status.tpl" php "$SRCDIR/page_about.php" > "$BLDDIR/pages/about.tpl" php "$SRCDIR/page_wifi.php" > "$BLDDIR/pages/wifi.tpl" +php "$SRCDIR/page_monitoring.php" > "$BLDDIR/pages/monitoring.tpl" php "$SRCDIR/page_waveform.php" > "$BLDDIR/pages/wfm.html" # no substitutions, .html allows to gzip it. php "$SRCDIR/page_fft.php" > "$BLDDIR/pages/fft.html" # same -php "$SRCDIR/page_spectrogram.php" > "$BLDDIR/pages/sgm.html" # same \ No newline at end of file +php "$SRCDIR/page_spectrogram.php" > "$BLDDIR/pages/sgm.html" # same diff --git a/esp_meas.pro b/esp_meas.pro index bc698fe..8c8630a 100644 --- a/esp_meas.pro +++ b/esp_meas.pro @@ -66,7 +66,9 @@ SOURCES += \ user/cgi_reset.c \ user/cgi_ping.c \ esphttpclient/test/httpclient_test.c \ - esphttpclient/httpclient.c + esphttpclient/httpclient.c \ + user/page_monitoring.c \ + user/reporting.c HEADERS += \ include/uart_hw.h \ @@ -154,7 +156,9 @@ HEADERS += \ user/cgi_reset.h \ user/cgi_ping.h \ esphttpclient/espmissingincludes.h \ - esphttpclient/httpclient.h + esphttpclient/httpclient.h \ + user/page_monitoring.h \ + user/reporting.h DISTFILES += \ style.astylerc \ diff --git a/html/css/app.css b/html/css/app.css index 0968c33..3d91c39 100644 --- a/html/css/app.css +++ b/html/css/app.css @@ -1 +1 @@ -*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.ct-zoom-rect{fill:rgba(200,100,100,.3);stroke:#ff2b12}.ct-axis-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ct-axis-title,.ct-label{fill:rgba(255,255,255,.8)}.ct-label{color:rgba(255,255,255,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(255,255,255,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-with-area .ct-line{stroke-width:1px}.ct-area{stroke:none;fill-opacity:.3}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}.center{text-align:center}.invis{visibility:hidden}.hidden{display:none}.nb{font-weight:400}html{font-family:Arial,sans-serif;color:#D0D0D0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:white;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:white;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;position:relative;padding:1rem;overflow-y:auto}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}#loader{position:absolute;right:1.618rem;top:1.618rem;transition:opacity .2s;opacity:0}@media screen and (max-width:544px){#loader{top:1rem;right:1rem}}#loader.show{opacity:1}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem 1rem;border-radius:3px;background-color:rgba(255,255,255,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 black;border-radius:6px}.Dialog h1,.Dialog h2{margin-top:0}.Dialog p:last-child{margin-bottom:0}.ErrMsg{position:fixed;bottom:2.617924rem;padding:.6180469716rem 1rem;left:50%;transform:translate(-50%);-webkit-font-smoothing:subpixel-antialiased;-webkit-transform:translateZ(0) scale(1);background:#d03e42;color:white;text-shadow:0 0 2px black;box-shadow:0 0 6px 0 rgba(0,0,0,.6);border-radius:5px;max-width:80%;transition:opacity .5s;opacity:0}@media screen and (max-width:544px){.ErrMsg{width:calc(100% - 1rem)}}.ErrMsg.visible{opacity:1}.ErrMsg.hidden{display:none}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#D04E51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}.btn-blue{background-color:#3983cd;box-shadow:0 3px 0 #265f98;text-decoration:none!important}.btn-blue,.btn-blue:link,.btn-blue:visited{color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:active,.btn-blue:hover{background-color:#2076C6;color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:hover{box-shadow:0 3px 0 #154c80}.btn-blue:active{box-shadow:0 1px 0 #154c80}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px black;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid rgba(255,255,255,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px black;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.2em;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:rgba(255,255,255,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:white}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #staRSSIperc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #staRSSI:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em}#samp-ctrl{display:flex;padding:.3819820591rem;flex-direction:row;justify-content:center;align-items:stretch}@media screen and (max-width:544px){#samp-ctrl{flex-direction:column}}#samp-ctrl>div{margin:.3819820591rem .6180469716rem}#samp-ctrl label{line-height:1.8;font-weight:700}#samp-ctrl input,#samp-ctrl select{width:6em}@media screen and (max-width:544px){#samp-ctrl input,#samp-ctrl select{width:100%}}#samp-ctrl #tile-cfg input{width:3em}#samp-ctrl #interval{width:4.5em}.Box.chartbox{display:flex;flex-direction:row}@media screen and (max-width:544px){.Box.chartbox{flex-direction:column}}.Box.chartbox .stats{flex:0 1;position:relative;padding-bottom:50px}@media screen and (max-width:544px){.Box.chartbox .stats table{margin:0 auto}.Box.chartbox .stats td,.Box.chartbox .stats th{width:50%}}.Box.chartbox .stats td,.Box.chartbox .stats th{white-space:nowrap;word-wrap:normal}.Box.chartbox .stats th sub{font-weight:400}.Box.chartbox .stats td{min-width:100px}.Box.chartbox .stats td:after{font-size:90%;padding-left:.5em}.Box.chartbox .stats #stat-f-s:after{content:"Hz"}.Box.chartbox .stats #stat-i-peak:after,.Box.chartbox .stats #stat-i-rms:after{content:"mA"}.Box.chartbox .stats .ar{position:absolute;bottom:.3819820591rem;width:100%;text-align:center}.Box.chartbox .stats .ar input[type=number]{width:4em}.Box.chartbox .stats .ar input[type=button]{margin-left:.3819820591rem}.page-about .Box{padding-left:1rem;padding-right:1rem}.page-about .Box a{font-weight:700}.page-about #logo{float:right;height:130px}.page-about #logo2{max-width:150px}@media screen and (min-width:545px){.mq-phone{display:none}}@media screen and (max-width:544px){.mq-tablet-min{display:none}}@media screen and (min-width:1001px){.mq-tablet-max{display:none}}@media screen and (max-width:1000px){.mq-normal-min{display:none}} \ No newline at end of file +*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.ct-zoom-rect{fill:rgba(200,100,100,.3);stroke:#ff2b12}.ct-axis-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ct-axis-title,.ct-label{fill:rgba(255,255,255,.8)}.ct-label{color:rgba(255,255,255,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(255,255,255,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-with-area .ct-line{stroke-width:1px}.ct-area{stroke:none;fill-opacity:.3}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}.center{text-align:center}.invis{visibility:hidden}.hidden{display:none}.nb{font-weight:400}html{font-family:Arial,sans-serif;color:#D0D0D0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:white;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:white;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;position:relative;padding:1rem;overflow-y:auto}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}#loader{position:absolute;right:1.618rem;top:1.618rem;transition:opacity .2s;opacity:0}@media screen and (max-width:544px){#loader{top:1rem;right:1rem}}#loader.show{opacity:1}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem 1rem;border-radius:3px;background-color:rgba(255,255,255,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Box .Valfield{display:inline-block;min-width:10em}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 black;border-radius:6px}.Dialog h1,.Dialog h2{margin-top:0}.Dialog p:last-child{margin-bottom:0}.ErrMsg{position:fixed;bottom:2.617924rem;padding:.6180469716rem 1rem;left:50%;transform:translate(-50%);-webkit-font-smoothing:subpixel-antialiased;-webkit-transform:translateZ(0) scale(1);background:#d03e42;color:white;text-shadow:0 0 2px black;box-shadow:0 0 6px 0 rgba(0,0,0,.6);border-radius:5px;max-width:80%;transition:opacity .5s;opacity:0}@media screen and (max-width:544px){.ErrMsg{width:calc(100% - 1rem)}}.ErrMsg.visible{opacity:1}.ErrMsg.hidden{display:none}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#D04E51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}.btn-blue{background-color:#3983cd;box-shadow:0 3px 0 #265f98;text-decoration:none!important}.btn-blue,.btn-blue:link,.btn-blue:visited{color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:active,.btn-blue:hover{background-color:#2076C6;color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:hover{box-shadow:0 3px 0 #154c80}.btn-blue:active{box-shadow:0 1px 0 #154c80}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px black;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid rgba(255,255,255,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px black;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.2em;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:rgba(255,255,255,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:white}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #staRSSIperc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #staRSSI:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em}#samp-ctrl{display:flex;padding:.3819820591rem;flex-direction:row;justify-content:center;align-items:stretch}@media screen and (max-width:544px){#samp-ctrl{flex-direction:column}}#samp-ctrl>div{margin:.3819820591rem .6180469716rem}#samp-ctrl label{line-height:1.8;font-weight:700}#samp-ctrl input,#samp-ctrl select{width:6em}@media screen and (max-width:544px){#samp-ctrl input,#samp-ctrl select{width:100%}}#samp-ctrl #tile-cfg input{width:3em}#samp-ctrl #interval{width:4.5em}.Box.chartbox{display:flex;flex-direction:row}@media screen and (max-width:544px){.Box.chartbox{flex-direction:column}}.Box.chartbox .stats{flex:0 1;position:relative;padding-bottom:50px}@media screen and (max-width:544px){.Box.chartbox .stats table{margin:0 auto}.Box.chartbox .stats td,.Box.chartbox .stats th{width:50%}}.Box.chartbox .stats td,.Box.chartbox .stats th{white-space:nowrap;word-wrap:normal}.Box.chartbox .stats th sub{font-weight:400}.Box.chartbox .stats td{min-width:100px}.Box.chartbox .stats td:after{font-size:90%;padding-left:.5em}.Box.chartbox .stats #stat-f-s:after{content:"Hz"}.Box.chartbox .stats #stat-i-peak:after,.Box.chartbox .stats #stat-i-rms:after{content:"mA"}.Box.chartbox .stats .ar{position:absolute;bottom:.3819820591rem;width:100%;text-align:center}.Box.chartbox .stats .ar input[type=number]{width:4em}.Box.chartbox .stats .ar input[type=button]{margin-left:.3819820591rem}.page-about .Box{padding-left:1rem;padding-right:1rem}.page-about .Box a{font-weight:700}.page-about #logo{float:right;height:130px}.page-about #logo2{max-width:150px}@media screen and (min-width:545px){.mq-phone{display:none}}@media screen and (max-width:544px){.mq-tablet-min{display:none}}@media screen and (min-width:1001px){.mq-tablet-max{display:none}}@media screen and (max-width:1000px){.mq-normal-min{display:none}} \ No newline at end of file diff --git a/html/js/all.js b/html/js/all.js index c2f2c91..6564426 100644 --- a/html/js/all.js +++ b/html/js/all.js @@ -1,3 +1,3 @@ -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=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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=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-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();++en)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(;++ie&&(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);++re?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-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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},gn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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=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=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=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}(); \ No newline at end of file +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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(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 g(e){if(0===e.button){var n=a(S,o(e,b));v(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(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",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return jn.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)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?ge: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!==ge||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!==ge)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?gt(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?gt(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:ge}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(;++ie&&(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);++re?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-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===ge}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?ge:F(t,e);return r===ge?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 ge,ve="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 gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,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:ge,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:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(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();g.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=ve,(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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?$("#refdist").html(numfmt(n.deviation,2)):(errorMsg("Capture failed."),$("#refdist").html("--"))}catch(r){errorMsg(r),$("#refdist").html("--")}})},e.init=function(){},e}(); \ No newline at end of file diff --git a/html/pages/about.tpl b/html/pages/about.tpl index f695ee6..387532d 100644 --- a/html/pages/about.tpl +++ b/html/pages/about.tpl @@ -19,7 +19,7 @@
+ HomeWiFi configWaveformFFTSpectrogramMonitoringAbout
Loading… @@ -39,11 +39,6 @@

Firmware

-

- The ESP8266 firmware is based on the amazing esp-httpd - library by Jeroen Domburg. -

- @@ -61,7 +56,13 @@ +
FirmwareIoT SDK v%vers_sdk%
+ +

+ The webserver is built using the great esp-httpd + library by Jeroen Domburg. +

diff --git a/html/pages/fft.html b/html/pages/fft.html index defcf09..97fa3b4 100644 --- a/html/pages/fft.html +++ b/html/pages/fft.html @@ -19,7 +19,7 @@
+ HomeWiFi configWaveformFFTSpectrogramMonitoringAbout
Loading… diff --git a/html/pages/monitoring.tpl b/html/pages/monitoring.tpl new file mode 100644 index 0000000..340dc84 --- /dev/null +++ b/html/pages/monitoring.tpl @@ -0,0 +1,99 @@ + + + + + + + + Monitoring - Current Analyser + + + + + + +
+ +
+ Loading… + +

Monitoring & Reporting

+ +
+

Status

+ + + + + + + + + +
Reference: + %refStored% + Capture +
Actual distance: + N/A + Measure +
+
+ +
+

Reporting

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+   +
+  seconds +
Service: +    +   +
 
+
+
+ + + + + + +
+
+ + diff --git a/html/pages/sgm.html b/html/pages/sgm.html index c0e94ee..27db50e 100644 --- a/html/pages/sgm.html +++ b/html/pages/sgm.html @@ -19,7 +19,7 @@
+ HomeWiFi configWaveformFFTSpectrogramMonitoringAbout
Loading… diff --git a/html/pages/status.tpl b/html/pages/status.tpl index 7c962d0..e0f46ed 100644 --- a/html/pages/status.tpl +++ b/html/pages/status.tpl @@ -19,7 +19,7 @@
+ HomeWiFi configWaveformFFTSpectrogramMonitoringAbout
Loading… @@ -38,7 +38,7 @@ - SW reset + Restart system
diff --git a/html/pages/wfm.html b/html/pages/wfm.html index 650c017..bb19e38 100644 --- a/html/pages/wfm.html +++ b/html/pages/wfm.html @@ -19,7 +19,7 @@
+ HomeWiFi configWaveformFFTSpectrogramMonitoringAbout
Loading… diff --git a/html/pages/wifi.tpl b/html/pages/wifi.tpl index b72002c..874976c 100644 --- a/html/pages/wifi.tpl +++ b/html/pages/wifi.tpl @@ -19,7 +19,7 @@
+ HomeWiFi configWaveformFFTSpectrogramMonitoringAbout
Loading… diff --git a/html_src/css/app.css b/html_src/css/app.css index fa36431..3d91c39 100644 --- a/html_src/css/app.css +++ b/html_src/css/app.css @@ -1,1366 +1 @@ -@charset "UTF-8"; -/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS and IE text size adjust after device orientation change, - * without disabling user zoom. - */ -*, *:before, *:after { - box-sizing: border-box; } - -html { - font-family: sans-serif; - /* 1 */ - -ms-text-size-adjust: 100%; - /* 2 */ - -webkit-text-size-adjust: 100%; - /* 2 */ } - -/** - * Remove default margin. - */ -body { - margin: 0; } - -/* HTML5 display definitions - ========================================================================== */ -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ -figure, -nav { - display: block; } - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ -canvas, -progress { - display: inline-block; - /* 1 */ - vertical-align: baseline; - /* 2 */ } - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. - */ -[hidden] { - display: none; } - -/* Links - ========================================================================== */ -/** - * Remove the gray background color from active links in IE 10. - */ -a { - background-color: transparent; } - -/** - * Improve readability of focused elements when they are also in an - * active/hover state. - */ -a:active, -a:hover { - outline: 0; } - -/* Text-level semantics - ========================================================================== */ -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ -b { - font-weight: bold; } - -/** - * Address styling not present in Safari and Chrome. - */ -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ -h1 { - font-size: 2em; - margin: 0.67em 0; } - -h2 { - font-size: 2em; - margin: 0.67em 0; } - -/** - * Address styling not present in IE 8/9. - */ -/** - * Address inconsistent and variable font size in all browsers. - */ -small { - font-size: 80%; } - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; } - -sup { - top: -0.5em; } - -sub { - bottom: -0.25em; } - -/* Embedded content - ========================================================================== */ -/** - * Remove border when inside `a` element in IE 8/9/10. - */ -img { - border: 0; } - -/** - * Correct overflow not hidden in IE 9/10/11. - */ -svg:not(:root) { - overflow: hidden; } - -/* Grouping content - ========================================================================== */ -/** - * Address margin not present in IE 8/9 and Safari. - */ -/** - * Address differences between Firefox and other browsers. - */ -hr { - box-sizing: content-box; - height: 0; } - -/** - * Contain overflow in all browsers. - */ -pre { - overflow: auto; } - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ -code, -pre { - font-family: monospace; - font-size: 1em; } - -/* Forms - ========================================================================== */ -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ -button, -input, -select, -textarea { - color: inherit; - /* 1 */ - font: inherit; - /* 2 */ - margin: 0; - /* 3 */ } - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ -button { - overflow: visible; } - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ -button, -select { - text-transform: none; } - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ -button, -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - /* 2 */ - cursor: pointer; - /* 3 */ } - -/** - * Re-set default cursor for disabled elements. - */ -button[disabled], -html input[disabled] { - cursor: default; } - -/** - * Remove inner padding and border in Firefox 4+. - */ -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; } - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ -input { - line-height: normal; } - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - /* 1 */ - padding: 0; - /* 2 */ } - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. - */ -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ -/** - * Define consistent border, margin, and padding. - */ -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ -legend { - border: 0; - /* 1 */ - padding: 0; - /* 2 */ } - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ -textarea { - overflow: auto; } - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ -/* Tables - ========================================================================== */ -/** - * Remove most spacing between table cells. - */ -table { - border-collapse: collapse; - border-spacing: 0; } - -td, -th { - padding: 0; } - -html { - box-sizing: border-box; } - -*, *::after, *::before { - box-sizing: inherit; } - -.ct-zoom-rect { - fill: rgba(200, 100, 100, 0.3); - stroke: #ff2b12; } - -.ct-axis-title { - fill: rgba(255, 255, 255, 0.8); - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } - -.ct-label { - fill: rgba(255, 255, 255, 0.8); - color: rgba(255, 255, 255, 0.8); - font-size: 0.75rem; - line-height: 1; } - .ct-label.ct-horizontal.ct-start { - align-items: flex-end; - justify-content: flex-start; - text-align: left; - text-anchor: start; } - .ct-label.ct-horizontal.ct-end { - align-items: flex-start; - justify-content: flex-start; - text-align: left; - text-anchor: start; - transform: translate(-4px, 0%) rotate(45deg); } - .ct-label.ct-vertical.ct-start { - align-items: flex-end; - justify-content: flex-end; - text-align: right; - text-anchor: end; - transform: translate(0, 20%); } - .ct-label.ct-vertical.ct-end { - align-items: flex-end; - justify-content: flex-start; - text-align: left; - text-anchor: start; } - -.ct-chart-line .ct-label, -.ct-chart-bar .ct-label { - display: flex; } - -.ct-chart-bar .ct-label.ct-horizontal.ct-start { - align-items: flex-end; - justify-content: center; - text-align: center; - text-anchor: start; } - -.ct-chart-bar .ct-label.ct-horizontal.ct-end { - align-items: flex-start; - justify-content: center; - text-align: center; - text-anchor: start; } - -.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start { - align-items: flex-end; - justify-content: flex-start; - text-align: left; - text-anchor: start; } - -.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end { - align-items: flex-start; - justify-content: flex-start; - text-align: left; - text-anchor: start; } - -.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start { - align-items: center; - justify-content: flex-end; - text-align: right; - text-anchor: end; } - -.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end { - align-items: center; - justify-content: flex-start; - text-align: left; - text-anchor: end; } - -.ct-grid { - stroke: rgba(255, 255, 255, 0.3); - stroke-width: 1px; - stroke-dasharray: 2px; } - -.ct-point { - stroke-width: 4px; - stroke-linecap: round; } - -.ct-line { - fill: none; - stroke-width: 2px; } - -.ct-with-area .ct-line { - stroke-width: 1px; } - -.ct-area { - stroke: none; - fill-opacity: 0.3; } - -.ct-bar { - fill: none; - stroke-width: 10px; } - -.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar { - stroke: #f05b4f; } - -.ct-series-a .ct-slice-pie, .ct-series-a .ct-area { - fill: #f05b4f; } - -.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar { - stroke: #6188e2; } - -.ct-series-b .ct-slice-pie, .ct-series-b .ct-area { - fill: #6188e2; } - -.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar { - stroke: #59922b; } - -.ct-series-c .ct-slice-pie, .ct-series-c .ct-area { - fill: #59922b; } - -.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar { - stroke: #eacf7d; } - -.ct-series-d .ct-slice-pie, .ct-series-d .ct-area { - fill: #eacf7d; } - -.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar { - stroke: #a748ca; } - -.ct-series-e .ct-slice-pie, .ct-series-e .ct-area { - fill: #a748ca; } - -.ct-wide { - display: block; - position: relative; - width: 100%; } - .ct-wide:before { - display: block; - float: left; - content: ""; - width: 0; - height: 0; - padding-bottom: 62.5%; } - .ct-wide:after { - content: ""; - display: table; - clear: both; } - .ct-wide > svg { - display: block; - position: absolute; - top: 0; - left: 0; } - -.ct-narrow { - display: block; - position: relative; - width: 100%; } - .ct-narrow:before { - display: block; - float: left; - content: ""; - width: 0; - height: 0; - padding-bottom: 66.6666666667%; } - .ct-narrow:after { - content: ""; - display: table; - clear: both; } - .ct-narrow > svg { - display: block; - position: absolute; - top: 0; - left: 0; } - -.center { - text-align: center; } - -.invis { - visibility: hidden; } - -.hidden { - display: none; } - -.nb { - font-weight: normal; } - -html { - font-family: Arial, sans-serif; - color: #D0D0D0; - background: #131315; } - -html, body { - border: 0 none; - margin: 0; - padding: 0; - text-decoration: none; - width: 100%; - height: 100%; - overflow: hidden; } - -a, a:visited, a:link { - color: #5abfff; - text-decoration: none; } - -a:hover { - color: #5abfff; - text-decoration: underline; } - -/* Main outer container */ -#outer { - display: flex; - position: absolute; - width: 100%; - height: 100%; - left: 0; - right: 0; - top: 0; - bottom: 0; - overflow: hidden; - flex-direction: row; } - -@media screen and (max-width: 544px) { - #outer { - display: block; - overflow-y: scroll; } } - -#menu { - flex: 0 0 15rem; - background: #2bab5f; } - #menu > * { - display: block; - text-decoration: none; - padding: 0.6180469716rem 1rem; - white-space: nowrap; - word-wrap: normal; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } - #menu #brand { - color: white; - background: #218248; - font-size: 120%; - text-align: center; - position: relative; - margin-bottom: 1rem; } - @media screen and (max-width: 544px) { - #menu #brand { - background: #2bab5f; - cursor: pointer; } - #menu #brand:after { - position: absolute; - color: rgba(0, 0, 0, 0.2); - right: 1rem; - content: '>'; - top: 50%; - font-size: 120%; - font-weight: bold; - transform: translate(0, -50%) rotate(90deg); } } - #menu.expanded #brand { - background: #218248; } - @media screen and (max-width: 544px) { - #menu.expanded #brand:after { - transform: translate(0, -50%) rotate(-90deg); } } - #menu a { - font-size: 130%; - color: white; - transition: background-color 0.2s; - text-shadow: 0 0 5px rgba(0, 0, 0, 0.4); } - #menu a:hover, #menu a.selected { - background: #1bd886; - text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); } - #menu a.selected { - position: relative; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); } - #menu a:before { - content: "▸"; - padding-right: .5rem; - position: relative; - top: -0.1rem; } - @media screen and (max-width: 544px) { - #menu a { - display: none; } } - #menu.expanded a { - display: block; } - @media screen and (min-width: 545px) and (max-width: 1000px) { - #menu { - flex-basis: 10rem; } - #menu #brand { - font-size: 95%; - margin-bottom: 0.6180469716rem; } - #menu a { - font-size: 105%; } - #menu > * { - padding: 0.3819820591rem 0.6180469716rem; } } - -#content { - flex-grow: 1; - position: relative; - padding: 1rem; - overflow-y: auto; } - @media screen and (max-width: 544px) { - #content { - padding: 0.6180469716rem; } } - #content > * { - margin-left: auto; - margin-right: auto; } - #content h1 { - text-align: center; - font-size: 2.2806973457em; - margin-top: 0; - margin-bottom: 1rem; } - #content h2 { - font-size: 1.423828125em; - margin-bottom: 0.6180469716rem; } - #content td, #content th { - padding: 0.3819820591rem; } - #content tbody th { - text-align: right; - width: 130px; - color: white; } - -#loader { - position: absolute; - right: 1.618rem; - top: 1.618rem; - transition: opacity .2s; - opacity: 0; } - @media screen and (max-width: 544px) { - #loader { - top: 1rem; - right: 1rem; } } - #loader.show { - opacity: 1; } - -.Box { - display: block; - max-width: 900px; - margin-top: 1rem; - padding: 0.6180469716rem 1rem; - border-radius: 3px; - background-color: rgba(255, 255, 255, 0.07); } - @media screen and (max-width: 544px) { - .Box { - margin-top: 0.6180469716rem; } } - h1 + .Box { - margin-top: 0; } - .Box h2 { - margin-top: 0; } - .Box.wide { - width: initial; - max-width: initial; } - .Box.medium { - max-width: 1200px; } - .Box .Valfield { - display: inline-block; - min-width: 10em; } - -.Modal { - position: fixed; - width: 100%; - height: 100%; - left: 0; - top: 0; - right: 0; - bottom: 0; - display: flex; - justify-content: center; - align-items: center; - transition: opacity .5s; - background: rgba(0, 0, 0, 0.65); - opacity: 0; } - .Modal.visible { - opacity: 1; } - .Modal.hidden { - display: none; } - -.Dialog { - margin: 0.6180469716rem; - padding: 1rem; - overflow: hidden; - max-width: 100%; - max-height: 100%; - flex: 0 1 30rem; - background: #1c1c1e; - border-left: 6px solid #217b3a; - border-right: 6px solid #217b3a; - box-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black; - border-radius: 6px; } - .Dialog h1, .Dialog h2 { - margin-top: 0; } - .Dialog p:last-child { - margin-bottom: 0; } - -.ErrMsg { - position: fixed; - bottom: 2.617924rem; - padding: 0.6180469716rem 1rem; - left: 50%; - transform: translate(-50%, 0); - -webkit-font-smoothing: subpixel-antialiased; - -webkit-transform: translateZ(0) scale(1, 1); - background: #d03e42; - color: white; - text-shadow: 0 0 2px black; - box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.6); - border-radius: 5px; - max-width: 80%; - transition: opacity .5s; - opacity: 0; } - @media screen and (max-width: 544px) { - .ErrMsg { - width: calc(100% - 1rem); } } - .ErrMsg.visible { - opacity: 1; } - .ErrMsg.hidden { - display: none; } - -button, input[type="button"], input[type="reset"], input[type="submit"], .button { - text-align: center; - cursor: pointer; - display: inline-block; - border-radius: 2px; - padding: 0 0.6em; - border: 0 none; - outline: 0 none !important; - line-height: 1.8em; - font-size: 1.1em; - margin-bottom: 3px; - min-width: 5em; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - /* &::before { - margin-right: .4em; - } - - &.icononly::before { - margin-right: 0; - }*/ - text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); } - button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active, .button:active { - position: relative; - top: 2px; } - button.narrow, input[type="button"].narrow, input[type="reset"].narrow, input[type="submit"].narrow, .button.narrow { - min-width: initial; } - -input[type="submit"], .btn-green { - background-color: #2ca94b; - box-shadow: 0 3px 0 #1d7032; - text-decoration: none !important; } - input[type="submit"], input[type="submit"]:link, input[type="submit"]:visited, .btn-green, .btn-green:link, .btn-green:visited { - color: #FEFEFE; } - input[type="submit"]:hover, input[type="submit"]:active, input[type="submit"].active, input[type="submit"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected { - background-color: #28ba5c; - color: #FEFEFE; } - input[type="submit"]:hover, input[type="submit"].selected, input[type="submit"].active, .btn-green:hover, .btn-green.selected, .btn-green.active { - box-shadow: 0 3px 0 #1a773b; } - input[type="submit"]:active, .btn-green:active { - box-shadow: 0 1px 0 #1a773b; } - -input[type="reset"], .btn-red { - background-color: #D04E51; - box-shadow: 0 3px 0 #aa2d30; - text-decoration: none !important; } - input[type="reset"], input[type="reset"]:link, input[type="reset"]:visited, .btn-red, .btn-red:link, .btn-red:visited { - color: #FEFEFE; } - input[type="reset"]:hover, input[type="reset"]:active, input[type="reset"].active, input[type="reset"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected { - background-color: #d4403f; - color: #FEFEFE; } - input[type="reset"]:hover, input[type="reset"].selected, input[type="reset"].active, .btn-red:hover, .btn-red.selected, .btn-red.active { - box-shadow: 0 3px 0 #9e2423; } - input[type="reset"]:active, .btn-red:active { - box-shadow: 0 1px 0 #9e2423; } - -.btn-blue { - background-color: #3983cd; - box-shadow: 0 3px 0 #265f98; - text-decoration: none !important; } - .btn-blue, .btn-blue:link, .btn-blue:visited { - color: #FEFEFE; } - .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected { - background-color: #2076C6; - color: #FEFEFE; } - .btn-blue:hover, .btn-blue.selected, .btn-blue.active { - box-shadow: 0 3px 0 #154c80; } - .btn-blue:active { - box-shadow: 0 1px 0 #154c80; } - -/* - -&[type="submit"], -&.gray-green { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16) - ) -} - -&.gray-blue { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16) - ) -} - -&.gray-red { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16) - ) -} - -&.gray-orange { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16) - ) -} - -// No change on hover - to be used for disabled buttons -&.gray-gray { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-gray-f, $btn-gray-b, $btn-gray-l - ) -} - -*/ -button, input[type="button"], input[type="reset"], input[type="submit"], .button { - text-align: center; - cursor: pointer; - display: inline-block; - border-radius: 2px; - padding: 0 0.6em; - border: 0 none; - outline: 0 none !important; - line-height: 1.8em; - font-size: 1.1em; - margin-bottom: 3px; - min-width: 5em; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - /* &::before { - margin-right: .4em; - } - - &.icononly::before { - margin-right: 0; - }*/ - text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); } - button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active, .button:active { - position: relative; - top: 2px; } - button.narrow, input[type="button"].narrow, input[type="reset"].narrow, input[type="submit"].narrow, .button.narrow { - min-width: initial; } - -input[type="submit"], .btn-green { - background-color: #2ca94b; - box-shadow: 0 3px 0 #1d7032; - text-decoration: none !important; } - input[type="submit"], input[type="submit"]:link, input[type="submit"]:visited, .btn-green, .btn-green:link, .btn-green:visited { - color: #FEFEFE; } - input[type="submit"]:hover, input[type="submit"]:active, input[type="submit"].active, input[type="submit"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected { - background-color: #28ba5c; - color: #FEFEFE; } - input[type="submit"]:hover, input[type="submit"].selected, input[type="submit"].active, .btn-green:hover, .btn-green.selected, .btn-green.active { - box-shadow: 0 3px 0 #1a773b; } - input[type="submit"]:active, .btn-green:active { - box-shadow: 0 1px 0 #1a773b; } - -input[type="reset"], .btn-red { - background-color: #D04E51; - box-shadow: 0 3px 0 #aa2d30; - text-decoration: none !important; } - input[type="reset"], input[type="reset"]:link, input[type="reset"]:visited, .btn-red, .btn-red:link, .btn-red:visited { - color: #FEFEFE; } - input[type="reset"]:hover, input[type="reset"]:active, input[type="reset"].active, input[type="reset"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected { - background-color: #d4403f; - color: #FEFEFE; } - input[type="reset"]:hover, input[type="reset"].selected, input[type="reset"].active, .btn-red:hover, .btn-red.selected, .btn-red.active { - box-shadow: 0 3px 0 #9e2423; } - input[type="reset"]:active, .btn-red:active { - box-shadow: 0 1px 0 #9e2423; } - -.btn-blue { - background-color: #3983cd; - box-shadow: 0 3px 0 #265f98; - text-decoration: none !important; } - .btn-blue, .btn-blue:link, .btn-blue:visited { - color: #FEFEFE; } - .btn-blue:hover, .btn-blue:active, .btn-blue.active, .btn-blue.selected { - background-color: #2076C6; - color: #FEFEFE; } - .btn-blue:hover, .btn-blue.selected, .btn-blue.active { - box-shadow: 0 3px 0 #154c80; } - .btn-blue:active { - box-shadow: 0 1px 0 #154c80; } - -/* - -&[type="submit"], -&.gray-green { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16) - ) -} - -&.gray-blue { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16) - ) -} - -&.gray-red { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16) - ) -} - -&.gray-orange { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16) - ) -} - -// No change on hover - to be used for disabled buttons -&.gray-gray { - @include fancy-btn-colors-full( - $btn-gray-f, $btn-gray-b, $btn-gray-l, - $btn-gray-f, $btn-gray-b, $btn-gray-l - ) -} - -*/ -input[type="number"], input[type="password"], input[type="text"], textarea, select { - border: 0 none; - border-bottom: 2px solid #217b3a; - background-color: #303030; - color: white; - padding: 6px; - line-height: 1em; - outline: 0 none !important; - -moz-outline: 0 none !important; - font-weight: normal; } - input[type="number"]:focus, input[type="number"]:hover, input[type="password"]:focus, input[type="password"]:hover, input[type="text"]:focus, input[type="text"]:hover, textarea:focus, textarea:hover, select:focus, select:hover { - border-bottom-color: #28bc65; } - -input[type="number"], input[type="password"], input[type="text"], textarea { - -webkit-user-select: text; - -khtml-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; - cursor: text; } - -textarea { - font-family: monospace; - line-height: 1.2em; - display: block; } - -@media screen and (-webkit-min-device-pixel-ratio: 0) { - select { - padding-right: 18px; } } - -select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - cursor: pointer; - line-height: 1.2em; - padding-right: 1em; } - select:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 white; } - select option { - background: #303030; } - -label.select-wrap { - position: relative; - display: inline !important; - margin: 0 !important; - padding: 0 !important; - width: auto !important; } - label.select-wrap:after { - content: '<>'; - /* will be rotated */ - font-family: "Consolas", monospace; - font-weight: bold; - color: #28bc65; - top: 50%; - transform: translate(0, -50%) rotate(90deg); - right: 2px; - position: absolute; - z-index: 100; - pointer-events: none; } - -form { - border: 0 none; - margin: 0; - padding: 0; - text-decoration: none; } - -input[type="number"], input[type="password"], input[type="text"], textarea, select, label.select-wrap { - width: 250px; } - -form .Row { - vertical-align: middle; - margin: 14px auto; - text-align: left; - display: flex; - flex-direction: row; } - form .Row:first-child { - margin-top: 0; } - form .Row:last-child { - margin-bottom: 0; } - form .Row .spacer { - width: 130px; } - @media screen and (max-width: 544px) { - form .Row .spacer { - display: none; } } - form .Row.buttons input, form .Row.buttons .button { - margin-right: 0.6180469716rem; } - form .Row.centered { - justify-content: center; } - form .Row.message { - font-size: 1em; - text-shadow: 1px 1px 3px black; - text-align: center; } - form .Row.message.error { - color: crimson; } - form .Row.message.ok { - color: #0fe851; } - form .Row.separator { - padding-top: 14px; - border-top: 2px solid rgba(255, 255, 255, 0.1); } - form .Row textarea { - display: inline-block; - vertical-align: top; - min-height: 10rem; - flex-grow: 1; - resize: vertical; } - form .Row label { - font-weight: bold; - color: white; - display: inline-block; - width: 130px; - text-align: right; - text-shadow: 1px 1px 3px black; - padding: 8px; - align-self: flex-start; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } - form .Row .checkbox-wrap { - display: inline-block; - width: 130px; - padding: 8px; - text-align: right; - align-self: flex-start; } - form .Row .checkbox-wrap input[type=checkbox] { - margin: auto; - width: auto; - height: auto; } - form .Row .checkbox-wrap + label { - width: 250px; - padding-left: 0; - text-align: left; - cursor: pointer; } - @media screen and (max-width: 544px) { - form .Row { - flex-direction: column; } - form .Row.buttons, form .Row.centered { - flex-direction: row; } - form .Row.buttons { - justify-content: center; } - form .Row.buttons :last-child { - margin-right: 0; } - form .Row label { - padding-left: 0; - text-align: left; - width: auto; } - form .Row .checkbox-wrap { - order: 1; - text-align: left; - padding-bottom: 0; - border-radius: .4px; - width: auto; } - form .Row .checkbox-wrap + label { - width: auto; } - form .Row input[type="number"], form .Row input[type="password"], form .Row input[type="text"], form .Row textarea, form .Row textarea { - width: 100%; } } - -form span.required { - color: red; } - -.RadioGroup { - display: inline-block; - line-height: 1.5em; - vertical-align: middle; } - .RadioGroup label { - width: auto; - text-align: left; - cursor: pointer; - font-weight: normal; } - .RadioGroup input[type="radio"] { - vertical-align: middle; - margin: 0 0 0 5px; } - -@media screen and (-webkit-min-device-pixel-ratio: 0) { - select { - padding-right: 18px; } } - -select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - cursor: pointer; - line-height: 1.2em; - padding-right: 1em; } - select:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 white; } - select option { - background: #303030; } - -label.select-wrap { - position: relative; - display: inline !important; - margin: 0 !important; - padding: 0 !important; - width: auto !important; } - label.select-wrap:after { - content: '<>'; - /* will be rotated */ - font-family: "Consolas", monospace; - font-weight: bold; - color: #28bc65; - top: 50%; - transform: translate(0, -50%) rotate(90deg); - right: 2px; - position: absolute; - z-index: 100; - pointer-events: none; } - -#ap-list { - -webkit-column-count: 3; - -moz-column-count: 3; - column-count: 3; - -webkit-column-gap: 0; - -moz-column-gap: 0; - column-gap: 0; - margin: 0 -0.2360828548rem; } - @media screen and (min-width: 545px) and (max-width: 1000px) { - #ap-list { - -webkit-column-count: 2; - -moz-column-count: 2; - column-count: 2; } } - @media screen and (max-width: 544px) { - #ap-list { - -webkit-column-count: 1; - -moz-column-count: 1; - column-count: 1; } } - -#ap-loader { - background: rgba(255, 255, 255, 0.1); - border-radius: 5px; - padding: 0.3819820591rem; - margin-bottom: 0.3819820591rem; } - -#ap-box { - padding-bottom: 0.3819820591rem; } - -#psk-modal form { - display: flex; - align-items: center; - margin: 0.3819820591rem; } - #psk-modal form > * { - margin-left: 0.3819820591rem; - margin-right: 0.3819820591rem; } - #psk-modal form > *:first-child { - margin-left: 0; } - #psk-modal form > *:last-child { - margin-right: 0; } - #psk-modal form input[type=password] { - min-width: 5rem; } - -.AP { - -webkit-column-break-inside: avoid; - page-break-inside: avoid; - break-inside: avoid-column; - max-width: 500px; - padding: 0.2360828548rem; } - .AP.selected .inner { - background: #43de81 !important; - cursor: default; - top: 0 !important; } - .AP .inner { - cursor: pointer; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - position: relative; - border-radius: 3px; - color: #222; - background: #afafaf; - transition: background-color 0.5s; - display: flex; } - .AP .inner:active { - left: 0; - top: 1px; } - .AP .inner:hover { - background: white; } - .AP .inner > * { - padding: 0.6180469716rem; - white-space: nowrap; - word-wrap: normal; } - .AP .inner .rssi { - min-width: 2rem; - flex: 0 0 15%; - text-align: right; } - .AP .inner .rssi:after { - padding-left: 0.090179415rem; - content: '%'; - font-size: 0.8888888889em; } - .AP .inner .essid { - flex: 1 1 70%; - min-width: 0; - text-overflow: ellipsis; - overflow: hidden; - font-weight: bold; } - .AP .inner .auth { - flex: 0 0 15%; } - -.page-home #staRSSIperc:after { - padding-left: 0.1459102934rem; - content: '%'; - font-size: 0.8888888889em; } - -.page-home #staRSSI:after { - padding-left: 0.1459102934rem; - content: 'dBm'; - font-size: 0.8888888889em; } - -#samp-ctrl { - display: flex; - padding: 0.3819820591rem; - flex-direction: row; - justify-content: center; - align-items: stretch; } - @media screen and (max-width: 544px) { - #samp-ctrl { - flex-direction: column; } } - #samp-ctrl > div { - margin: 0.3819820591rem 0.6180469716rem; } - #samp-ctrl label { - line-height: 1.8; - font-weight: bold; } - #samp-ctrl input, #samp-ctrl select { - width: 6em; } - @media screen and (max-width: 544px) { - #samp-ctrl input, #samp-ctrl select { - width: 100%; } } - #samp-ctrl #tile-cfg input { - width: 3em; } - #samp-ctrl #interval { - width: 4.5em; } - -.Box.chartbox { - display: flex; - flex-direction: row; } - @media screen and (max-width: 544px) { - .Box.chartbox { - flex-direction: column; } } - .Box.chartbox .stats { - flex: 0 1; - position: relative; - padding-bottom: 50px; } - @media screen and (max-width: 544px) { - .Box.chartbox .stats table { - margin: 0 auto; } - .Box.chartbox .stats td, .Box.chartbox .stats th { - width: 50%; } } - .Box.chartbox .stats th, .Box.chartbox .stats td { - white-space: nowrap; - word-wrap: normal; } - .Box.chartbox .stats th sub { - font-weight: normal; } - .Box.chartbox .stats td { - min-width: 100px; } - .Box.chartbox .stats td:after { - font-size: 90%; - padding-left: .5em; } - .Box.chartbox .stats #stat-f-s:after { - content: "Hz"; } - .Box.chartbox .stats #stat-i-peak:after { - content: "mA"; } - .Box.chartbox .stats #stat-i-rms:after { - content: "mA"; } - .Box.chartbox .stats .ar { - position: absolute; - bottom: 0.3819820591rem; - width: 100%; - text-align: center; } - .Box.chartbox .stats .ar input[type=number] { - width: 4em; } - .Box.chartbox .stats .ar input[type=button] { - margin-left: 0.3819820591rem; } - -.page-about .Box { - padding-left: 1rem; - padding-right: 1rem; } - .page-about .Box a { - font-weight: bold; } - -.page-about #logo { - float: right; - height: 130px; } - -.page-about #logo2 { - max-width: 150px; } - -@media screen and (min-width: 545px) { - .mq-phone { - display: none; } } - -@media screen and (max-width: 544px) { - .mq-tablet-min { - display: none; } } - -@media screen and (min-width: 1001px) { - .mq-tablet-max { - display: none; } } - -@media screen and (max-width: 1000px) { - .mq-normal-min { - display: none; } } - -/*# sourceMappingURL=app.css.map */ +*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.ct-zoom-rect{fill:rgba(200,100,100,.3);stroke:#ff2b12}.ct-axis-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ct-axis-title,.ct-label{fill:rgba(255,255,255,.8)}.ct-label{color:rgba(255,255,255,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(255,255,255,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-with-area .ct-line{stroke-width:1px}.ct-area{stroke:none;fill-opacity:.3}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}.center{text-align:center}.invis{visibility:hidden}.hidden{display:none}.nb{font-weight:400}html{font-family:Arial,sans-serif;color:#D0D0D0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:white;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:white;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;position:relative;padding:1rem;overflow-y:auto}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}#loader{position:absolute;right:1.618rem;top:1.618rem;transition:opacity .2s;opacity:0}@media screen and (max-width:544px){#loader{top:1rem;right:1rem}}#loader.show{opacity:1}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem 1rem;border-radius:3px;background-color:rgba(255,255,255,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Box .Valfield{display:inline-block;min-width:10em}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 black;border-radius:6px}.Dialog h1,.Dialog h2{margin-top:0}.Dialog p:last-child{margin-bottom:0}.ErrMsg{position:fixed;bottom:2.617924rem;padding:.6180469716rem 1rem;left:50%;transform:translate(-50%);-webkit-font-smoothing:subpixel-antialiased;-webkit-transform:translateZ(0) scale(1);background:#d03e42;color:white;text-shadow:0 0 2px black;box-shadow:0 0 6px 0 rgba(0,0,0,.6);border-radius:5px;max-width:80%;transition:opacity .5s;opacity:0}@media screen and (max-width:544px){.ErrMsg{width:calc(100% - 1rem)}}.ErrMsg.visible{opacity:1}.ErrMsg.hidden{display:none}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#D04E51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}.btn-blue{background-color:#3983cd;box-shadow:0 3px 0 #265f98;text-decoration:none!important}.btn-blue,.btn-blue:link,.btn-blue:visited{color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:active,.btn-blue:hover{background-color:#2076C6;color:#FEFEFE}.btn-blue.active,.btn-blue.selected,.btn-blue:hover{box-shadow:0 3px 0 #154c80}.btn-blue:active{box-shadow:0 1px 0 #154c80}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px black;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid rgba(255,255,255,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px black;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.2em;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:rgba(255,255,255,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:white}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #staRSSIperc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #staRSSI:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em}#samp-ctrl{display:flex;padding:.3819820591rem;flex-direction:row;justify-content:center;align-items:stretch}@media screen and (max-width:544px){#samp-ctrl{flex-direction:column}}#samp-ctrl>div{margin:.3819820591rem .6180469716rem}#samp-ctrl label{line-height:1.8;font-weight:700}#samp-ctrl input,#samp-ctrl select{width:6em}@media screen and (max-width:544px){#samp-ctrl input,#samp-ctrl select{width:100%}}#samp-ctrl #tile-cfg input{width:3em}#samp-ctrl #interval{width:4.5em}.Box.chartbox{display:flex;flex-direction:row}@media screen and (max-width:544px){.Box.chartbox{flex-direction:column}}.Box.chartbox .stats{flex:0 1;position:relative;padding-bottom:50px}@media screen and (max-width:544px){.Box.chartbox .stats table{margin:0 auto}.Box.chartbox .stats td,.Box.chartbox .stats th{width:50%}}.Box.chartbox .stats td,.Box.chartbox .stats th{white-space:nowrap;word-wrap:normal}.Box.chartbox .stats th sub{font-weight:400}.Box.chartbox .stats td{min-width:100px}.Box.chartbox .stats td:after{font-size:90%;padding-left:.5em}.Box.chartbox .stats #stat-f-s:after{content:"Hz"}.Box.chartbox .stats #stat-i-peak:after,.Box.chartbox .stats #stat-i-rms:after{content:"mA"}.Box.chartbox .stats .ar{position:absolute;bottom:.3819820591rem;width:100%;text-align:center}.Box.chartbox .stats .ar input[type=number]{width:4em}.Box.chartbox .stats .ar input[type=button]{margin-left:.3819820591rem}.page-about .Box{padding-left:1rem;padding-right:1rem}.page-about .Box a{font-weight:700}.page-about #logo{float:right;height:130px}.page-about #logo2{max-width:150px}@media screen and (min-width:545px){.mq-phone{display:none}}@media screen and (max-width:544px){.mq-tablet-min{display:none}}@media screen and (min-width:1001px){.mq-tablet-max{display:none}}@media screen and (max-width:1000px){.mq-normal-min{display:none}} \ No newline at end of file diff --git a/html_src/js/all.js b/html_src/js/all.js index 976dc4a..6564426 100644 --- a/html_src/js/all.js +++ b/html_src/js/all.js @@ -1,9496 +1,3 @@ -/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */ - -// MODIFIED VERSION. -(function () { - 'use strict'; - - var readyfn = [], - loadedfn = [], - domready = false, - pageloaded = false, - d = document, - w = window; - - // Fire any function calls on ready event - function fireReady() { - var i; - domready = true; - for (i = 0; i < readyfn.length; i += 1) { - readyfn[i](); - } - readyfn = []; - } - - // Fire any function calls on loaded event - function fireLoaded() { - var i; - pageloaded = true; - // For browsers with no DOM loaded support - if (!domready) { - fireReady(); - } - for (i = 0; i < loadedfn.length; i += 1) { - loadedfn[i](); - } - loadedfn = []; - } - - // Check DOM ready, page loaded - if (d.addEventListener) { - // Standards - d.addEventListener('DOMContentLoaded', fireReady, false); - w.addEventListener('load', fireLoaded, false); - } else if (d.attachEvent) { - // IE - d.attachEvent('onreadystatechange', fireReady); - // IE < 9 - w.attachEvent('onload', fireLoaded); - } else { - // Anything else - w.onload = fireLoaded; - } - - // Utility functions - - // Loop through node array - function nodeLoop(fn, nodes) { - var i; - // Good idea to walk up the DOM - for (i = nodes.length - 1; i >= 0; i -= 1) { - fn(nodes[i]); - } - } - - // Convert to camel case - function cssCamel(property) { - return property.replace(/-\w/g, function (result) { - return result.charAt(1).toUpperCase(); - }); - } - - // Get computed style - function computeStyle(elm, property) { - // IE, everything else or null - return (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null; - - } - - // Returns URI encoded query string pair - function queryPair(name, value) { - return encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+'); - } - - // Set CSS, important to wrap in try to prevent error thown on unsupported property - function setCss(elm, property, value) { - try { - elm.style[cssCamel(property)] = value; - } catch (e) { - } - } - - // Show CSS - function showCss(elm) { - elm.style.display = ''; - // For elements still hidden by style block - if (computeStyle(elm, 'display') === 'none') { - elm.style.display = 'block'; - } - } - - // Serialize form & JSON values - function serializeData(nodes) { - var querystring = '', subelm, i, j; - if (nodes.constructor === Object) { // Serialize JSON data - for (subelm in nodes) { - if (nodes.hasOwnProperty(subelm)) { - if (nodes[subelm].constructor === Array) { - for (i = 0; i < nodes[subelm].length; i += 1) { - querystring += '&' + queryPair(subelm, nodes[subelm][i]); - } - } else { - querystring += '&' + queryPair(subelm, nodes[subelm]); - } - } - } - } else { // Serialize node data - nodeLoop(function (elm) { - if (elm.nodeName === 'FORM') { - for (i = 0; i < elm.elements.length; i += 1) { - subelm = elm.elements[i]; - - if (!subelm.disabled) { - switch (subelm.type) { - // Ignore buttons, unsupported XHR 1 form fields - case 'button': - case 'image': - case 'file': - case 'submit': - case 'reset': - break; - - case 'select-one': - if (subelm.length > 0) { - querystring += '&' + queryPair(subelm.name, subelm.value); - } - break; - - case 'select-multiple': - for (j = 0; j < subelm.length; j += 1) { - if (subelm[j].selected) { - querystring += '&' + queryPair(subelm.name, subelm[j].value); - } - } - break; - - case 'checkbox': - case 'radio': - if (subelm.checked) { - querystring += '&' + queryPair(subelm.name, subelm.value); - } - break; - - // Everything else including shinny new HTML5 input types - default: - querystring += '&' + queryPair(subelm.name, subelm.value); - } - } - } - } - }, nodes); - } - // Tidy up first & - return (querystring.length > 0) ? querystring.substring(1) : ''; - } - - // Class helper - function classHelper(classes, action, nodes) { - var classarray, search, i, has = false; - if (classes) { - // Trim any whitespace - classarray = classes.split(/\s+/); - nodeLoop(function (elm) { - for (i = 0; i < classarray.length; i += 1) { - search = new RegExp('\\b' + classarray[i] + '\\b', 'g'); - if (action === 'remove') { - elm.className = elm.className.replace(search, ''); - } else if (action === 'toggle') { - elm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i]; - } else if (action === 'has') { - if (elm.className.match(search)) { - has = true; - break; - } - } - } - }, nodes); - } - return has; - } - - // HTML insertion helper - function insertHtml(value, position, nodes) { - var tmpnodes, tmpnode; - if (value) { - nodeLoop(function (elm) { - // No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead - // Convert string to node. We can't innerHTML on a document fragment - tmpnodes = d.createElement('div'); - tmpnodes.innerHTML = value; - while ((tmpnode = tmpnodes.lastChild) !== null) { - // Catch error in unlikely case elm has been removed - try { - if (position === 'before') { - elm.parentNode.insertBefore(tmpnode, elm); - } else if (position === 'after') { - elm.parentNode.insertBefore(tmpnode, elm.nextSibling); - } else if (position === 'append') { - elm.appendChild(tmpnode); - } else if (position === 'prepend') { - elm.insertBefore(tmpnode, elm.firstChild); - } - } catch (e) { - break; - } - } - }, nodes); - } - } - - // Get nodes and return chibi - function chibi(selector) { - var cb, nodes = [], json = false, nodelist, i; - - if (selector) { - - // Element node, would prefer to use (selector instanceof HTMLElement) but no IE support - if (selector.nodeType && selector.nodeType === 1) { - nodes = [selector]; // return element as node list - } else if (typeof selector === 'object') { - // JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support - json = (typeof selector.length !== 'number'); - nodes = selector; - } else if (typeof selector === 'string') { - - // A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector) - - // IE < 8 - if (!d.querySelectorAll) { - // Polyfill querySelectorAll - d.querySelectorAll = function (selector) { - - var style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i; - - style = d.createElement('STYLE'); - style.type = 'text/css'; - - if (style.styleSheet) { - style.styleSheet.cssText = selector + ' {a:b}'; - - head.appendChild(style); - - allnodes = d.getElementsByTagName('*'); - - for (i = 0; i < allnodes.length; i += 1) { - if (computeStyle(allnodes[i], 'a') === 'b') { - selectednodes.push(allnodes[i]); - } - } - - head.removeChild(style); - } - - return selectednodes; - }; - } - - nodelist = d.querySelectorAll(selector); - - // Convert node list to array so results have full access to array methods - // Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway - for (i = 0; i < nodelist.length; i += 1) { - nodes[i] = nodelist[i]; - } - - } - } - - // Only attach nodes if not JSON - cb = json ? {} : nodes; - - // Public functions - - // Fire on DOM ready - cb.ready = function (fn) { - if (fn) { - if (domready) { - fn(); - return cb; - } else { - readyfn.push(fn); - } - } - }; - // Fire on page loaded - cb.loaded = function (fn) { - if (fn) { - if (pageloaded) { - fn(); - return cb; - } else { - loadedfn.push(fn); - } - } - }; - // Executes a function on nodes - cb.each = function (fn) { - if (typeof fn === 'function') { - nodeLoop(function (elm) { - // <= IE 8 loses scope so need to apply - return fn.apply(elm, arguments); - }, nodes); - } - return cb; - }; - // Find first - cb.first = function () { - return chibi(nodes.shift()); - }; - // Find last - cb.last = function () { - return chibi(nodes.pop()); - }; - // Find odd - cb.odd = function () { - var odds = [], i; - for (i = 0; i < nodes.length; i += 2) { - odds.push(nodes[i]); - } - return chibi(odds); - }; - // Find even - cb.even = function () { - var evens = [], i; - for (i = 1; i < nodes.length; i += 2) { - evens.push(nodes[i]); - } - return chibi(evens); - }; - // Hide node - cb.hide = function () { - nodeLoop(function (elm) { - elm.style.display = 'none'; - }, nodes); - return cb; - }; - // Show node - cb.show = function () { - nodeLoop(function (elm) { - showCss(elm); - }, nodes); - return cb; - }; - // Toggle node display - cb.toggle = function (state) { - if (typeof state != 'undefined') { // ADDED - if (state) - cb.show(); - else - cb.hide(); - } else { - nodeLoop(function (elm) { - // computeStyle instead of style.display == 'none' catches elements that are hidden via style block - if (computeStyle(elm, 'display') === 'none') { - showCss(elm); - } else { - elm.style.display = 'none'; - } - - }, nodes); - } - return cb; - }; - // Remove node - cb.remove = function () { - nodeLoop(function (elm) { - // Catch error in unlikely case elm has been removed - try { - elm.parentNode.removeChild(elm); - } catch (e) { - } - }, nodes); - return chibi(); - }; - // Get/Set CSS - cb.css = function (property, value) { - if (property) { - if (value || value === '') { - nodeLoop(function (elm) { - setCss(elm, property, value); - }, nodes); - return cb; - } - if (nodes[0]) { - if (nodes[0].style[cssCamel(property)]) { - return nodes[0].style[cssCamel(property)]; - } - if (computeStyle(nodes[0], property)) { - return computeStyle(nodes[0], property); - } - } - } - }; - // Get class(es) - cb.getClass = function () { - if (nodes[0] && nodes[0].className.length > 0) { - // Weak IE trim support - return nodes[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '').replace(/\s+/, ' '); - } - }; - // Set (replaces) classes - cb.setClass = function (classes) { - if (classes || classes === '') { - nodeLoop(function (elm) { - elm.className = classes; - }, nodes); - } - return cb; - }; - // Add class - cb.addClass = function (classes) { - if (classes) { - nodeLoop(function (elm) { - elm.className += ' ' + classes; - }, nodes); - } - return cb; - }; - // Remove class - cb.removeClass = function (classes) { - classHelper(classes, 'remove', nodes); - return cb; - }; - // Toggle class - cb.toggleClass = function (classes) { - classHelper(classes, 'toggle', nodes); - return cb; - }; - // Has class - cb.hasClass = function (classes) { - return classHelper(classes, 'has', nodes); - }; - // Get/set HTML - cb.html = function (value) { - if (value || value === '') { - nodeLoop(function (elm) { - elm.innerHTML = value; - }, nodes); - return cb; - } - if (nodes[0]) { - return nodes[0].innerHTML; - } - }; - // Insert HTML before selector - cb.htmlBefore = function (value) { - insertHtml(value, 'before', nodes); - return cb; - }; - // Insert HTML after selector - cb.htmlAfter = function (value) { - insertHtml(value, 'after', nodes); - return cb; - }; - // Insert HTML after selector innerHTML - cb.htmlAppend = function (value) { - insertHtml(value, 'append', nodes); - return cb; - }; - // Insert HTML before selector innerHTML - cb.htmlPrepend = function (value) { - insertHtml(value, 'prepend', nodes); - return cb; - }; - // Get/Set HTML attributes - cb.attr = function (property, value) { - if (property) { - property = property.toLowerCase(); - // IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway - if (typeof value !== 'undefined') {//FIXED BUG HERE - nodeLoop(function (elm) { - if (property === 'style') { - elm.style.cssText = value; - } else if (property === 'class') { - elm.className = value; - } else { - elm.setAttribute(property, value); - } - }, nodes); - return cb; - } - if (nodes[0]) { - if (property === 'style') { - if (nodes[0].style.cssText) { - return nodes[0].style.cssText; - } - } else if (property === 'class') { - if (nodes[0].className) { - return nodes[0].className; - } - } else { - if (nodes[0].getAttribute(property)) { - return nodes[0].getAttribute(property); - } - } - } - } - }; - // Get/Set HTML data property - cb.data = function (key, value) { - if (key) { - return cb.attr('data-' + key, value); - } - }; - // Get/Set form element values - cb.val = function (value) { - var values, i, j; - if (!_.isUndefined(value)) { // FIXED A BUG HERE - nodeLoop(function (elm) { - switch (elm.nodeName) { - case 'SELECT': - if (typeof value === 'string' || typeof value === 'number') { - value = [value]; - } - for (i = 0; i < elm.length; i += 1) { - // Multiple select - for (j = 0; j < value.length; j += 1) { - elm[i].selected = ''; - if (elm[i].value === value[j]) { - elm[i].selected = 'selected'; - break; - } - } - } - break; - case 'INPUT': - case 'TEXTAREA': - case 'BUTTON': - elm.value = value; - break; - } - }, nodes); - - return cb; - } - if (nodes[0]) { - switch (nodes[0].nodeName) { - case 'SELECT': - values = []; - for (i = 0; i < nodes[0].length; i += 1) { - if (nodes[0][i].selected) { - values.push(nodes[0][i].value); - } - } - return (values.length > 1) ? values : values[0]; - case 'INPUT': - case 'TEXTAREA': - case 'BUTTON': - return nodes[0].value; - } - } - }; - // Return matching checked checkbox or radios - cb.checked = function (check) { - if (typeof check === 'boolean') { - nodeLoop(function (elm) { - if (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) { - elm.checked = check; - } - }, nodes); - return cb; - } - if (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) { - return (!!nodes[0].checked); - } - }; - // Add event handler - cb.on = function (event, fn) { - if (selector === w || selector === d) { - nodes = [selector]; - } - nodeLoop(function (elm) { - if (d.addEventListener) { - elm.addEventListener(event, fn, false); - } else if (d.attachEvent) { - // <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions) - elm[event + fn] = function () { - return fn.apply(elm, arguments); - }; - elm.attachEvent('on' + event, elm[event + fn]); - } - }, nodes); - return cb; - }; - // Remove event handler - cb.off = function (event, fn) { - if (selector === w || selector === d) { - nodes = [selector]; - } - nodeLoop(function (elm) { - if (d.addEventListener) { - elm.removeEventListener(event, fn, false); - } else if (d.attachEvent) { - elm.detachEvent('on' + event, elm[event + fn]); - // Tidy up - elm[event + fn] = null; - } - }, nodes); - return cb; - }; - // Basic XHR 1, no file support. Shakes fist at IE - cb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms - var xhr; - var query = serializeData(nodes); - var type = (method) ? method.toUpperCase() : 'GET'; - var abortTmeo; - - if (_.isNumber(options)) options = {timeout: options}; - - var opts = Chartist.extend({}, { - nocache: true, - timeout: 5000, - loader: true, - }, options); - - //console.log('ajax to = ' + opts.timeout); - - if (query && (type === 'GET')) { - url += (url.indexOf('?') === -1) ? '?' + query : '&' + query; - query = null; - } - - // FIXME the XHR sometimes seemingly silently fails - - xhr = new XMLHttpRequest(); // we dont support IE < 9 - - if (xhr) { - // prevent caching - if (opts.nocache) { - var ts = (+(new Date())).toString(36); - url += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts; - } - - if (opts.loader) - $('#loader').addClass('show'); - - // Douglas Crockford: "Synchronous programming is disrespectful and should not be employed in applications which are used by people" - xhr.open(type, url, true); - - xhr.timeout = opts.timeout; - - abortTmeo = setTimeout(function () { - errorMsg("XHR timed out."); - xhr.abort(); - if (opts.loader) $('#loader').removeClass('show'); - }, opts.timeout + 10); // a bit later, but still.; - - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - - if (opts.loader) - $('#loader').removeClass('show'); - - if (callback && xhr.status != 0) { // xhr.status 0 means "aborted" - callback(xhr.responseText, xhr.status); - } - - clearTimeout(abortTmeo); - } - }; - - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - if (type === 'POST') { - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - } - - xhr.send(query); - } - - return xhr; - }; - // Alias to cb.ajax(url, 'get', callback) - cb.get = function (url, callback, opts) { - return cb.ajax(url, 'get', callback, opts); - }; - // Alias to cb.ajax(url, 'post', callback) - cb.post = function (url, callback, opts) { - return cb.ajax(url, 'post', callback, opts); - }; - - return cb; - } - - // Set Chibi's global namespace here ($) - w.$ = chibi; - -}()); - -(function (root, factory) { - // if (typeof define === 'function' && define.amd) { - // // AMD. Register as an anonymous module unless amdModuleId is set - // define([], function () { - // return (root['Chartist'] = factory()); - // }); - // } else if (typeof exports === 'object') { - // // Node. Does not work with strict CommonJS, but - // // only CommonJS-like environments that support module.exports, - // // like Node. - // module.exports = factory(); - // } else { - root['Chartist'] = factory(); - // } -}(this, function () { - -/* Chartist.js 0.9.7 - * Copyright © 2016 Gion Kunz - * Free to use under either the WTFPL license or the MIT license. - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT - */ -/** - * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules. - * - * @module Chartist.Core - */ -var Chartist = { - version: '0.9.7' -}; - -(function (window, document, Chartist) { - 'use strict'; - - /** - * This object contains all namespaces used within Chartist. - * - * @memberof Chartist.Core - * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}} - */ - Chartist.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' - }; - - /** - * Helps to simplify functional style code - * - * @memberof Chartist.Core - * @param {*} n This exact value will be returned by the noop function - * @return {*} The same value that was provided to the n parameter - */ - Chartist.noop = function (n) { - return n; - }; - - /** - * Generates a-z from a number 0 to 26 - * - * @memberof Chartist.Core - * @param {Number} n A number from 0 to 26 that will result in a letter a-z - * @return {String} A character from a-z based on the input number n - */ - Chartist.alphaNumerate = function (n) { - // Limit to a-z - return String.fromCharCode(97 + n % 26); - }; - - /** - * Simple recursive object extend - * - * @memberof Chartist.Core - * @param {Object} target Target object where the source will be merged into - * @param {Object...} sources This object (objects) will be merged into target and then target is returned - * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source - */ - Chartist.extend = function (target) { - target = target || {}; - - var sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function(source) { - for (var prop in source) { - if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) { - target[prop] = Chartist.extend({}, target[prop], source[prop]); - } else { - target[prop] = source[prop]; - } - } - }); - - return target; - }; - - /** - * Replaces all occurrences of subStr in str with newSubStr and returns a new string. - * - * @memberof Chartist.Core - * @param {String} str - * @param {String} subStr - * @param {String} newSubStr - * @return {String} - */ - Chartist.replaceAll = function(str, subStr, newSubStr) { - return str.replace(new RegExp(subStr, 'g'), newSubStr); - }; - - /** - * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified. - * - * @memberof Chartist.Core - * @param {Number} value - * @param {String} unit - * @return {String} Returns the passed number value with unit. - */ - Chartist.ensureUnit = function(value, unit) { - if(typeof value === 'number') { - value = value + unit; - } - - return value; - }; - - /** - * Converts a number or string to a quantity object. - * - * @memberof Chartist.Core - * @param {String|Number} input - * @return {Object} Returns an object containing the value as number and the unit as string. - */ - Chartist.quantity = function(input) { - if (typeof input === 'string') { - var match = (/^(\d+)\s*(.*)$/g).exec(input); - return { - value : +match[1], - unit: match[2] || undefined - }; - } - return { value: input }; - }; - - /** - * This is a wrapper around document.querySelector that will return the query if it's already of type Node - * - * @memberof Chartist.Core - * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly - * @return {Node} - */ - Chartist.querySelector = function(query) { - return query instanceof Node ? query : document.querySelector(query); - }; - - /** - * Functional style helper to produce array with given length initialized with undefined values - * - * @memberof Chartist.Core - * @param length - * @return {Array} - */ - Chartist.times = function(length) { - return Array.apply(null, new Array(length)); - }; - - /** - * Sum helper to be used in reduce functions - * - * @memberof Chartist.Core - * @param previous - * @param current - * @return {*} - */ - Chartist.sum = function(previous, current) { - return previous + (current ? current : 0); - }; - - /** - * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor. - * - * @memberof Chartist.Core - * @param {Number} factor - * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array - */ - Chartist.mapMultiply = function(factor) { - return function(num) { - return num * factor; - }; - }; - - /** - * Add helper to be used in `Array.map` for adding a addend to each value of an array. - * - * @memberof Chartist.Core - * @param {Number} addend - * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array - */ - Chartist.mapAdd = function(addend) { - return function(num) { - return num + addend; - }; - }; - - /** - * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values). - * - * @memberof Chartist.Core - * @param arr - * @param cb - * @return {Array} - */ - Chartist.serialMap = function(arr, cb) { - var result = [], - length = Math.max.apply(null, arr.map(function(e) { - return e.length; - })); - - Chartist.times(length).forEach(function(e, index) { - var args = arr.map(function(e) { - return e[index]; - }); - - result[index] = cb.apply(null, args); - }); - - return result; - }; - - /** - * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit. - * - * @memberof Chartist.Core - * @param {Number} value The value that should be rounded with precision - * @param {Number} [digits] The number of digits after decimal used to do the rounding - * @returns {number} Rounded value - */ - Chartist.roundWithPrecision = function(value, digits) { - var precision = Math.pow(10, digits || Chartist.precision); - return Math.round(value * precision) / precision; - }; - - /** - * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. - * - * @memberof Chartist.Core - * @type {number} - */ - Chartist.precision = 8; - - /** - * A map with characters to escape for strings to be safely used as attribute values. - * - * @memberof Chartist.Core - * @type {Object} - */ - // Chartist.escapingMap = { - // '&': '&', - // '<': '<', - // '>': '>', - // '"': '"', - // '\'': ''' - // }; - - /** - * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap. - * If called with null or undefined the function will return immediately with null or undefined. - * - * @memberof Chartist.Core - * @param {Number|String|Object} data - * @return {String} - */ - Chartist.serialize = function(data) { - if(data === null || data === undefined) { - return data; - } else if(typeof data === 'number') { - data = ''+data; - } else if(typeof data === 'object') { - data = JSON.stringify({data: data}); - } - - return _.escape(data); - - // return Object.keys(Chartist.escapingMap).reduce(function(result, key) { - // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]); - // }, data); - }; - - /** - * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success. - * - * @memberof Chartist.Core - * @param {String} data - * @return {String|Number|Object} - */ - Chartist.deserialize = function(data) { - if(typeof data !== 'string') { - return data; - } - - // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) { - // return Chartist.replaceAll(result, Chartist.escapingMap[key], key); - // }, data); - data = _.unescape(data); - - try { - data = JSON.parse(data); - data = data.data !== undefined ? data.data : data; - } catch(e) {} - - return data; - }; - - /** - * Create or reinitialize the SVG element for the chart - * - * @memberof Chartist.Core - * @param {Node} container The containing DOM Node object that will be used to plant the SVG element - * @param {String} width Set the width of the SVG element. Default is 100% - * @param {String} height Set the height of the SVG element. Default is 100% - * @param {String} className Specify a class to be added to the SVG element - * @return {Object} The created/reinitialized SVG element - */ - Chartist.createSvg = function (container, width, height, className) { - var svg; - - width = width || '100%'; - height = height || '100%'; - - // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it - // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/ - Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) { - return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct'); - }).forEach(function removePreviousElement(svg) { - container.removeChild(svg); - }); - - // Create svg object with width and height or use 100% as default - svg = new Chartist.Svg('svg').attr({ - width: width, - height: height - }).addClass(className).attr({ - style: 'width: ' + width + '; height: ' + height + ';' - }); - - // Add the DOM node to our container - container.appendChild(svg._node); - - return svg; - }; - - /** - * Ensures that the data object passed as second argument to the charts is present and correctly initialized. - * - * @param {Object} data The data object that is passed as second argument to the charts - * @return {Object} The normalized data object - */ - Chartist.normalizeData = function(data) { - // Ensure data is present otherwise enforce - data = data || {series: [], labels: []}; - data.series = data.series || []; - data.labels = data.labels || []; - - // Check if we should generate some labels based on existing series data - if (data.series.length > 0 && data.labels.length === 0) { - var normalized = Chartist.getDataArray(data), - labelCount; - - // If all elements of the normalized data array are arrays we're dealing with - // data from Bar or Line charts and we need to find the largest series if they are un-even - if (normalized.every(function(value) { - return value instanceof Array; - })) { - // Getting the series with the the most elements - labelCount = Math.max.apply(null, normalized.map(function(series) { - return series.length; - })); - } else { - // We're dealing with Pie data so we just take the normalized array length - labelCount = normalized.length; - } - - // Setting labels to an array with emptry strings using our labelCount estimated above - data.labels = Chartist.times(labelCount).map(function() { - return ''; - }); - } - return data; - }; - - /** - * Reverses the series, labels and series data arrays. - * - * @memberof Chartist.Core - * @param data - */ - Chartist.reverseData = function(data) { - data.labels.reverse(); - data.series.reverse(); - for (var i = 0; i < data.series.length; i++) { - if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) { - data.series[i].data.reverse(); - } else if(data.series[i] instanceof Array) { - data.series[i].reverse(); - } - } - }; - - /** - * Convert data series into plain array - * - * @memberof Chartist.Core - * @param {Object} data The series object that contains the data to be visualized in the chart - * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too. - * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created. - * @return {Array} A plain array that contains the data to be visualized in the chart - */ - Chartist.getDataArray = function (data, reverse, multi) { - // If the data should be reversed but isn't we need to reverse it - // If it's reversed but it shouldn't we need to reverse it back - // That's required to handle data updates correctly and to reflect the responsive configurations - if(reverse && !data.reversed || !reverse && data.reversed) { - Chartist.reverseData(data); - data.reversed = !data.reversed; - } - - // Recursively walks through nested arrays and convert string values to numbers and objects with value properties - // to values. Check the tests in data core -> data normalization for a detailed specification of expected values - function recursiveConvert(value) { - if(Chartist.isFalseyButZero(value)) { - // This is a hole in data and we should return undefined - return undefined; - } else if((value.data || value) instanceof Array) { - return (value.data || value).map(recursiveConvert); - } else if(value.hasOwnProperty('value')) { - return recursiveConvert(value.value); - } else { - if(multi) { - var multiValue = {}; - - // Single series value arrays are assumed to specify the Y-Axis value - // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}] - // If multi is a string then it's assumed that it specified which dimension should be filled as default - if(typeof multi === 'string') { - multiValue[multi] = Chartist.getNumberOrUndefined(value); - } else { - multiValue.y = Chartist.getNumberOrUndefined(value); - } - - multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x; - multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y; - - return multiValue; - - } else { - return Chartist.getNumberOrUndefined(value); - } - } - } - - return data.series.map(recursiveConvert); - }; - - /** - * Converts a number into a padding object. - * - * @memberof Chartist.Core - * @param {Object|Number} padding - * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed - * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned. - */ - Chartist.normalizePadding = function(padding, fallback) { - fallback = fallback || 0; - - return typeof padding === 'number' ? { - top: padding, - right: padding, - bottom: padding, - left: padding - } : { - top: typeof padding.top === 'number' ? padding.top : fallback, - right: typeof padding.right === 'number' ? padding.right : fallback, - bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback, - left: typeof padding.left === 'number' ? padding.left : fallback - }; - }; - - Chartist.getMetaData = function(series, index) { - var value = series.data ? series.data[index] : series[index]; - return value ? Chartist.serialize(value.meta) : undefined; - }; - - /** - * Calculate the order of magnitude for the chart scale - * - * @memberof Chartist.Core - * @param {Number} value The value Range of the chart - * @return {Number} The order of magnitude - */ - Chartist.orderOfMagnitude = function (value) { - return Math.floor(Math.log(Math.abs(value)) / Math.LN10); - }; - - /** - * Project a data length into screen coordinates (pixels) - * - * @memberof Chartist.Core - * @param {Object} axisLength The svg element for the chart - * @param {Number} length Single data value from a series array - * @param {Object} bounds All the values to set the bounds of the chart - * @return {Number} The projected data length in pixels - */ - Chartist.projectLength = function (axisLength, length, bounds) { - return length / bounds.range * axisLength; - }; - - /** - * Get the height of the area in the chart for the data series - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @return {Number} The height of the area in the chart for the data series - */ - Chartist.getAvailableHeight = function (svg, options) { - return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0); - }; - - /** - * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart. - * - * @memberof Chartist.Core - * @param {Array} data The array that contains the data to be visualized in the chart - * @param {Object} options The Object that contains the chart options - * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration - * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart. - */ - Chartist.getHighLow = function (data, options, dimension) { - // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred - options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {}); - - var highLow = { - high: options.high === undefined ? -Number.MAX_VALUE : +options.high, - low: options.low === undefined ? Number.MAX_VALUE : +options.low - }; - var findHigh = options.high === undefined; - var findLow = options.low === undefined; - - // Function to recursively walk through arrays and find highest and lowest number - function recursiveHighLow(data) { - if(data === undefined) { - return undefined; - } else if(data instanceof Array) { - for (var i = 0; i < data.length; i++) { - recursiveHighLow(data[i]); - } - } else { - var value = dimension ? +data[dimension] : +data; - - if (findHigh && value > highLow.high) { - highLow.high = value; - } - - if (findLow && value < highLow.low) { - highLow.low = value; - } - } - } - - // Start to find highest and lowest number recursively - if(findHigh || findLow) { - recursiveHighLow(data); - } - - // Overrides of high / low based on reference value, it will make sure that the invisible reference value is - // used to generate the chart. This is useful when the chart always needs to contain the position of the - // invisible reference value in the view i.e. for bipolar scales. - if (options.referenceValue || options.referenceValue === 0) { - highLow.high = Math.max(options.referenceValue, highLow.high); - highLow.low = Math.min(options.referenceValue, highLow.low); - } - - // If high and low are the same because of misconfiguration or flat data (only the same value) we need - // to set the high or low to 0 depending on the polarity - if (highLow.high <= highLow.low) { - // If both values are 0 we set high to 1 - if (highLow.low === 0) { - highLow.high = 1; - } else if (highLow.low < 0) { - // If we have the same negative value for the bounds we set bounds.high to 0 - highLow.high = 0; - } else if (highLow.high > 0) { - // If we have the same positive value for the bounds we set bounds.low to 0 - highLow.low = 0; - } else { - // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors - highLow.high = 1; - highLow.low = 0; - } - } - - return highLow; - }; - - /** - * Checks if the value is a valid number or string with a number. - * - * @memberof Chartist.Core - * @param value - * @returns {Boolean} - */ - Chartist.isNum = function(value) { - return !isNaN(value) && isFinite(value); - }; - - /** - * Returns true on all falsey values except the numeric value 0. - * - * @memberof Chartist.Core - * @param value - * @returns {boolean} - */ - Chartist.isFalseyButZero = function(value) { - return !value && value !== 0; - }; - - /** - * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined. - * - * @memberof Chartist.Core - * @param value - * @returns {*} - */ - Chartist.getNumberOrUndefined = function(value) { - return isNaN(+value) ? undefined : +value; - }; - - /** - * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined. - * - * @param value - * @param dimension - * @returns {*} - */ - Chartist.getMultiValue = function(value, dimension) { - if(Chartist.isNum(value)) { - return +value; - } else if(value) { - return value[dimension || 'y'] || 0; - } else { - return 0; - } - }; - - /** - * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex. - * - * @memberof Chartist.Core - * @param {Number} num An integer number where the smallest factor should be searched for - * @returns {Number} The smallest integer factor of the parameter num. - */ - Chartist.rho = function(num) { - if(num === 1) { - return num; - } - - function gcd(p, q) { - if (p % q === 0) { - return q; - } else { - return gcd(q, p % q); - } - } - - function f(x) { - return x * x + 1; - } - - var x1 = 2, x2 = 2, divisor; - if (num % 2 === 0) { - return 2; - } - - do { - x1 = f(x1) % num; - x2 = f(f(x2)) % num; - divisor = gcd(Math.abs(x1 - x2), num); - } while (divisor === 1); - - return divisor; - }; - - /** - * Calculate and retrieve all the bounds for the chart and return them in one array - * - * @memberof Chartist.Core - * @param {Number} axisLength The length of the Axis used for - * @param {Object} highLow An object containing a high and low property indicating the value range of the chart. - * @param {Number} scaleMinSpace The minimum projected length a step should result in - * @param {Boolean} onlyInteger - * @return {Object} All the values to set the bounds of the chart - */ - Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) { - var i, - optimizationCounter = 0, - newMin, - newMax, - bounds = { - high: highLow.high, - low: highLow.low - }; - - bounds.valueRange = bounds.high - bounds.low; - bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange); - bounds.step = Math.pow(10, bounds.oom); - bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step; - bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step; - bounds.range = bounds.max - bounds.min; - bounds.numberOfSteps = Math.round(bounds.range / bounds.step); - - // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace - // If we are already below the scaleMinSpace value we will scale up - var length = Chartist.projectLength(axisLength, bounds.step, bounds); - var scaleUp = length < scaleMinSpace; - var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0; - - // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1 - if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) { - bounds.step = 1; - } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) { - // If step 1 was too small, we can try the smallest factor of range - // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor - // is larger than the scaleMinSpace we should go for it. - bounds.step = smallestFactor; - } else { - // Trying to divide or multiply by 2 and find the best step value - while (true) { - if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) { - bounds.step *= 2; - } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) { - bounds.step /= 2; - if(onlyInteger && bounds.step % 1 !== 0) { - bounds.step *= 2; - break; - } - } else { - break; - } - - if(optimizationCounter++ > 1000) { - throw new Error('Exceeded maximum number of iterations while optimizing scale step!'); - } - } - } - - // Narrow min and max based on new step - newMin = bounds.min; - newMax = bounds.max; - while(newMin + bounds.step <= bounds.low) { - newMin += bounds.step; - } - while(newMax - bounds.step >= bounds.high) { - newMax -= bounds.step; - } - bounds.min = newMin; - bounds.max = newMax; - bounds.range = bounds.max - bounds.min; - - bounds.values = []; - for (i = bounds.min; i <= bounds.max; i += bounds.step) { - bounds.values.push(Chartist.roundWithPrecision(i)); - } - - return bounds; - }; - - // /** - // * Calculate cartesian coordinates of polar coordinates - // * - // * @memberof Chartist.Core - // * @param {Number} centerX X-axis coordinates of center point of circle segment - // * @param {Number} centerY X-axis coordinates of center point of circle segment - // * @param {Number} radius Radius of circle segment - // * @param {Number} angleInDegrees Angle of circle segment in degrees - // * @return {{x:Number, y:Number}} Coordinates of point on circumference - // */ - // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) { - // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; - // - // return { - // x: centerX + (radius * Math.cos(angleInRadians)), - // y: centerY + (radius * Math.sin(angleInRadians)) - // }; - // }; - - /** - * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used - * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements - */ - Chartist.createChartRect = function (svg, options, fallbackPadding) { - var hasAxis = !!(options.axisX || options.axisY); - var yAxisOffset = hasAxis ? options.axisY.offset : 0; - var xAxisOffset = hasAxis ? options.axisX.offset : 0; - // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0 - var width = svg.width() || Chartist.quantity(options.width).value || 0; - var height = svg.height() || Chartist.quantity(options.height).value || 0; - var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding); - - // If settings were to small to cope with offset (legacy) and padding, we'll adjust - width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right); - height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom); - - var chartRect = { - padding: normalizedPadding, - width: function () { - return this.x2 - this.x1; - }, - height: function () { - return this.y1 - this.y2; - } - }; - - if(hasAxis) { - if (options.axisX.position === 'start') { - chartRect.y2 = normalizedPadding.top + xAxisOffset; - chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); - } else { - chartRect.y2 = normalizedPadding.top; - chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1); - } - - if (options.axisY.position === 'start') { - chartRect.x1 = normalizedPadding.left + yAxisOffset; - chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); - } else { - chartRect.x1 = normalizedPadding.left; - chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1); - } - } else { - chartRect.x1 = normalizedPadding.left; - chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); - chartRect.y2 = normalizedPadding.top; - chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); - } - - return chartRect; - }; - - /** - * Creates a grid line based on a projected value. - * - * @memberof Chartist.Core - * @param position - * @param index - * @param axis - * @param offset - * @param length - * @param group - * @param classes - * @param eventEmitter - */ - Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) { - var positionalData = {}; - positionalData[axis.units.pos + '1'] = Math.round(position)+0.5; - positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid - positionalData[axis.counterUnits.pos + '1'] = offset; - positionalData[axis.counterUnits.pos + '2'] = offset + length; - - var gridElement = group.elem('line', positionalData, classes.join(' ')); - - // Event for grid draw - eventEmitter.emit('draw', - Chartist.extend({ - type: 'grid', - axis: axis, - index: index, - group: group, - element: gridElement - }, positionalData) - ); - }; - - /** - * Creates a label based on a projected value and an axis. - * - * @memberof Chartist.Core - * @param position - * @param length - * @param index - * @param labels - * @param axis - * @param axisOffset - * @param labelOffset - * @param group - * @param classes - * @param useForeignObject - * @param eventEmitter - */ - Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) { - var labelElement; - var positionalData = {}; - - positionalData[axis.units.pos] = position + labelOffset[axis.units.pos]; - positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos]; - positionalData[axis.units.len] = length; - positionalData[axis.counterUnits.len] = axisOffset - 10; - - var lblText = labels[index]; - - if (_.isNumber(lblText)) { - lblText = Chartist.roundWithPrecision(lblText, 2); - } - - if(useForeignObject) { - // We need to set width and height explicitly to px as span will not expand with width and height being - // 100% in all browsers - var content = '' + - lblText + ''; - - labelElement = group.foreignObject(content, Chartist.extend({ - style: 'overflow: visible;' - }, positionalData)); - } else { - labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText); - } - - eventEmitter.emit('draw', Chartist.extend({ - type: 'label', - axis: axis, - index: index, - group: group, - element: labelElement, - text: lblText - }, positionalData)); - }; - - /** - * Helper to read series specific options from options object. It automatically falls back to the global option if - * there is no option in the series options. - * - * @param {Object} series Series object - * @param {Object} options Chartist options object - * @param {string} key The options key that should be used to obtain the options - * @returns {*} - */ - Chartist.getSeriesOption = function(series, options, key) { - if(series.name && options.series && options.series[series.name]) { - var seriesOptions = options.series[series.name]; - return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key]; - } else { - return options[key]; - } - }; - - /** - * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches - * - * @memberof Chartist.Core - * @param {Object} options Options set by user - * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart - * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events - * @return {Object} The consolidated options object from the defaults, base and matching responsive options - */ - Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) { - var baseOptions = Chartist.extend({}, options), - currentOptions, - mediaQueryListeners = [], - i; - - function updateCurrentOptions(preventChangedEvent) { - var previousOptions = currentOptions; - currentOptions = Chartist.extend({}, baseOptions); - - if (responsiveOptions) { - for (i = 0; i < responsiveOptions.length; i++) { - var mql = window.matchMedia(responsiveOptions[i][0]); - if (mql.matches) { - currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]); - } - } - } - - if(eventEmitter && !preventChangedEvent) { - eventEmitter.emit('optionsChanged', { - previousOptions: previousOptions, - currentOptions: currentOptions - }); - } - } - - function removeMediaQueryListeners() { - mediaQueryListeners.forEach(function(mql) { - mql.removeListener(updateCurrentOptions); - }); - } - - if (!window.matchMedia) { - throw 'window.matchMedia not found! Make sure you\'re using a polyfill.'; - } else if (responsiveOptions) { - - for (i = 0; i < responsiveOptions.length; i++) { - var mql = window.matchMedia(responsiveOptions[i][0]); - mql.addListener(updateCurrentOptions); - mediaQueryListeners.push(mql); - } - } - // Execute initially so we get the correct options - updateCurrentOptions(true); - - return { - removeMediaQueryListeners: removeMediaQueryListeners, - getCurrentOptions: function getCurrentOptions() { - return Chartist.extend({}, currentOptions); - } - }; - }; - -}(window, document, Chartist)); -;/** - * Chartist path interpolation functions. - * - * @module Chartist.Interpolation - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - Chartist.Interpolation = {}; - - /** - * This interpolation function does not smooth the path and the result is only containing lines and no curves. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.none({ - * fillHoles: false - * }) - * }); - * - * - * @memberof Chartist.Interpolation - * @return {Function} - */ - Chartist.Interpolation.none = function(options) { - var defaultOptions = { - fillHoles: false - }; - options = Chartist.extend({}, defaultOptions, options); - return function none(pathCoordinates, valueData) { - var path = new Chartist.Svg.Path(); - var hole = true; - - for(var i = 0; i < pathCoordinates.length; i += 2) { - var currX = pathCoordinates[i]; - var currY = pathCoordinates[i + 1]; - var currData = valueData[i / 2]; - - if(currData.value !== undefined) { - - if(hole) { - path.move(currX, currY, false, currData); - } else { - path.line(currX, currY, false, currData); - } - - hole = false; - } else if(!options.fillHoles) { - hole = true; - } - } - - return path; - }; - }; - - /** - * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. - * - * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point. - * - * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.simple({ - * divisor: 2, - * fillHoles: false - * }) - * }); - * - * - * @memberof Chartist.Interpolation - * @param {Object} options The options of the simple interpolation factory function. - * @return {Function} - */ - Chartist.Interpolation.simple = function(options) { - var defaultOptions = { - divisor: 2, - fillHoles: false - }; - options = Chartist.extend({}, defaultOptions, options); - - var d = 1 / Math.max(1, options.divisor); - - return function simple(pathCoordinates, valueData) { - var path = new Chartist.Svg.Path(); - var prevX, prevY, prevData; - - for(var i = 0; i < pathCoordinates.length; i += 2) { - var currX = pathCoordinates[i]; - var currY = pathCoordinates[i + 1]; - var length = (currX - prevX) * d; - var currData = valueData[i / 2]; - - if(currData.value !== undefined) { - - if(prevData === undefined) { - path.move(currX, currY, false, currData); - } else { - path.curve( - prevX + length, - prevY, - currX - length, - currY, - currX, - currY, - false, - currData - ); - } - - prevX = currX; - prevY = currY; - prevData = currData; - } else if(!options.fillHoles) { - prevX = currX = prevData = undefined; - } - } - - return path; - }; - }; - - // /** - // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. - // * - // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. - // * - // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity. - // * - // * @example - // * var chart = new Chartist.Line('.ct-chart', { - // * labels: [1, 2, 3, 4, 5], - // * series: [[1, 2, 8, 1, 7]] - // * }, { - // * lineSmooth: Chartist.Interpolation.cardinal({ - // * tension: 1, - // * fillHoles: false - // * }) - // * }); - // * - // * @memberof Chartist.Interpolation - // * @param {Object} options The options of the cardinal factory function. - // * @return {Function} - // */ - // Chartist.Interpolation.cardinal = function(options) { - // var defaultOptions = { - // tension: 1, - // fillHoles: false - // }; - // - // options = Chartist.extend({}, defaultOptions, options); - // - // var t = Math.min(1, Math.max(0, options.tension)), - // c = 1 - t; - // - // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates - // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards. - // // This functionality is necessary to treat "holes" in the line charts - // function splitIntoSegments(pathCoordinates, valueData) { - // var segments = []; - // var hole = true; - // - // for(var i = 0; i < pathCoordinates.length; i += 2) { - // // If this value is a "hole" we set the hole flag - // if(valueData[i / 2].value === undefined) { - // if(!options.fillHoles) { - // hole = true; - // } - // } else { - // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment - // if(hole) { - // segments.push({ - // pathCoordinates: [], - // valueData: [] - // }); - // // As we have a valid value now, we are not in a "hole" anymore - // hole = false; - // } - // - // // Add to the segment pathCoordinates and valueData - // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]); - // segments[segments.length - 1].valueData.push(valueData[i / 2]); - // } - // } - // - // return segments; - // } - // - // return function cardinal(pathCoordinates, valueData) { - // // First we try to split the coordinates into segments - // // This is necessary to treat "holes" in line charts - // var segments = splitIntoSegments(pathCoordinates, valueData); - // - // if(!segments.length) { - // // If there were no segments return 'Chartist.Interpolation.none' - // return Chartist.Interpolation.none()([]); - // } else if(segments.length > 1) { - // // If the split resulted in more that one segment we need to interpolate each segment individually and join them - // // afterwards together into a single path. - // var paths = []; - // // For each segment we will recurse the cardinal function - // segments.forEach(function(segment) { - // paths.push(cardinal(segment.pathCoordinates, segment.valueData)); - // }); - // // Join the segment path data into a single path and return - // return Chartist.Svg.Path.join(paths); - // } else { - // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first - // // segment - // pathCoordinates = segments[0].pathCoordinates; - // valueData = segments[0].valueData; - // - // // If less than two points we need to fallback to no smoothing - // if(pathCoordinates.length <= 4) { - // return Chartist.Interpolation.none()(pathCoordinates, valueData); - // } - // - // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]), - // z; - // - // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) { - // var p = [ - // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]}, - // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}, - // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]}, - // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]} - // ]; - // if (z) { - // if (!i) { - // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]}; - // } else if (iLen - 4 === i) { - // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; - // } else if (iLen - 2 === i) { - // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; - // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]}; - // } - // } else { - // if (iLen - 4 === i) { - // p[3] = p[2]; - // } else if (!i) { - // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}; - // } - // } - // - // path.curve( - // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x), - // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y), - // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x), - // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y), - // p[2].x, - // p[2].y, - // false, - // valueData[(i + 2) / 2] - // ); - // } - // - // return path; - // } - // }; - // }; - - - /** - * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points. - * - * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. - * - * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points. - * - * All smoothing functions within Chartist are factory functions that accept an options parameter. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.monotoneCubic({ - * fillHoles: false - * }) - * }); - * - * @memberof Chartist.Interpolation - * @param {Object} options The options of the monotoneCubic factory function. - * @return {Function} - */ - Chartist.Interpolation.monotoneCubic = function(options) { - var defaultOptions = { - fillHoles: false - }; - - options = Chartist.extend({}, defaultOptions, options); - - // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates - // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards. - // This functionality is necessary to treat "holes" in the line charts - function splitIntoSegments(pathCoordinates, valueData) { - var segments = []; - var hole = true; - - for(var i = 0; i < pathCoordinates.length; i += 2) { - // If this value is a "hole" we set the hole flag - if(valueData[i / 2].value === undefined) { - if(!options.fillHoles) { - hole = true; - } - } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) { - // Because we are doing monotone interpolation, curve fitting only makes sense for - // increasing x values. Therefore if two subsequent points have the same x value, or - // the x value is decreasing, then we create a hole at this point. (Which cannot be - // filled in even with the 'fillHoles' option) - - hole = true; - } else { - // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment - if(hole) { - segments.push({ - pathCoordinates: [], - valueData: [] - }); - // As we have a valid value now, we are not in a "hole" anymore - hole = false; - } - - // Add to the segment pathCoordinates and valueData - segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]); - segments[segments.length - 1].valueData.push(valueData[i / 2]); - } - } - - return segments; - } - - return function monotoneCubic(pathCoordinates, valueData) { - // First we try to split the coordinates into segments - // This is necessary to treat "holes" in line charts - var segments = splitIntoSegments(pathCoordinates, valueData); - - if(!segments.length) { - // If there were no segments return 'Chartist.Interpolation.none' - return Chartist.Interpolation.none()([]); - } else if(segments.length > 1) { - // If the split resulted in more that one segment we need to interpolate each segment individually and join them - // afterwards together into a single path. - var paths = []; - // For each segment we will recurse the monotoneCubic fn function - segments.forEach(function(segment) { - paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData)); - }); - // Join the segment path data into a single path and return - return Chartist.Svg.Path.join(paths); - } else { - // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first - // segment - pathCoordinates = segments[0].pathCoordinates; - valueData = segments[0].valueData; - - // If less than three points we need to fallback to no smoothing - if(pathCoordinates.length <= 4) { - return Chartist.Interpolation.none()(pathCoordinates, valueData); - } - - var xs = [], - ys = [], - i, - n = pathCoordinates.length / 2, - ms = [], - ds = [], dys = [], dxs = [], - path; - - // Populate x and y coordinates into separate arrays, for readability - - for(i = 0; i < n; i++) { - xs[i] = pathCoordinates[i * 2]; - ys[i] = pathCoordinates[i * 2 + 1]; - } - - // Calculate deltas and derivative - - for(i = 0; i < n - 1; i++) { - dys[i] = ys[i + 1] - ys[i]; - dxs[i] = xs[i + 1] - xs[i]; - ds[i] = dys[i] / dxs[i]; - } - - // Determine desired slope (m) at each point using Fritsch-Carlson method - // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation - - ms[0] = ds[0]; - ms[n - 1] = ds[n - 2]; - - for(i = 1; i < n - 1; i++) { - if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) { - ms[i] = 0; - } else { - ms[i] = 3 * (dxs[i - 1] + dxs[i]) / ( - (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] + - (dxs[i] + 2 * dxs[i - 1]) / ds[i]); - - if(!isFinite(ms[i])) { - ms[i] = 0; - } - } - } - - // Now build a path from the slopes - - path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]); - - for(i = 0; i < n - 1; i++) { - path.curve( - // First control point - xs[i] + dxs[i] / 3, - ys[i] + ms[i] * dxs[i] / 3, - // Second control point - xs[i + 1] - dxs[i] / 3, - ys[i + 1] - ms[i + 1] * dxs[i] / 3, - // End point - xs[i + 1], - ys[i + 1], - - false, - valueData[i + 1] // changed as per patch on github - ); - } - - return path; - } - }; - }; - - /** - * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled. - * - * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.step({ - * postpone: true, - * fillHoles: false - * }) - * }); - * - * @memberof Chartist.Interpolation - * @param options - * @returns {Function} - */ - Chartist.Interpolation.step = function(options) { - var defaultOptions = { - postpone: true, - fillHoles: false - }; - - options = Chartist.extend({}, defaultOptions, options); - - return function step(pathCoordinates, valueData) { - var path = new Chartist.Svg.Path(); - - var prevX, prevY, prevData; - - for (var i = 0; i < pathCoordinates.length; i += 2) { - var currX = pathCoordinates[i]; - var currY = pathCoordinates[i + 1]; - var currData = valueData[i / 2]; - - // If the current point is also not a hole we can draw the step lines - if(currData.value !== undefined) { - if(prevData === undefined) { - path.move(currX, currY, false, currData); - } else { - if(options.postpone) { - // If postponed we should draw the step line with the value of the previous value - path.line(currX, prevY, false, prevData); - } else { - // If not postponed we should draw the step line with the value of the current value - path.line(prevX, currY, false, currData); - } - // Line to the actual point (this should only be a Y-Axis movement - path.line(currX, currY, false, currData); - } - - prevX = currX; - prevY = currY; - prevData = currData; - } else if(!options.fillHoles) { - prevX = prevY = prevData = undefined; - } - } - - return path; - }; - }; - -}(window, document, Chartist)); -;/** - * A very basic event module that helps to generate and catch events. - * - * @module Chartist.Event - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - Chartist.EventEmitter = function () { - var handlers = []; - - /** - * Add an event handler for a specific event - * - * @memberof Chartist.Event - * @param {String} event The event name - * @param {Function} handler A event handler function - */ - function addEventHandler(event, handler) { - handlers[event] = handlers[event] || []; - handlers[event].push(handler); - } - - /** - * Remove an event handler of a specific event name or remove all event handlers for a specific event. - * - * @memberof Chartist.Event - * @param {String} event The event name where a specific or all handlers should be removed - * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed. - */ - function removeEventHandler(event, handler) { - // Only do something if there are event handlers with this name existing - if(handlers[event]) { - // If handler is set we will look for a specific handler and only remove this - if(handler) { - handlers[event].splice(handlers[event].indexOf(handler), 1); - if(handlers[event].length === 0) { - delete handlers[event]; - } - } else { - // If no handler is specified we remove all handlers for this event - delete handlers[event]; - } - } - } - - /** - * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter. - * - * @memberof Chartist.Event - * @param {String} event The event name that should be triggered - * @param {*} data Arbitrary data that will be passed to the event handler callback functions - */ - function emit(event, data) { - // Only do something if there are event handlers with this name existing - if(handlers[event]) { - handlers[event].forEach(function(handler) { - handler(data); - }); - } - - // Emit event to star event handlers - if(handlers['*']) { - handlers['*'].forEach(function(starHandler) { - starHandler(event, data); - }); - } - } - - return { - addEventHandler: addEventHandler, - removeEventHandler: removeEventHandler, - emit: emit - }; - }; - -}(window, document, Chartist)); -;/** - * This module provides some basic prototype inheritance utilities. - * - * @module Chartist.Class - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - function listToArray(list) { - var arr = []; - if (list.length) { - for (var i = 0; i < list.length; i++) { - arr.push(list[i]); - } - } - return arr; - } - - /** - * Method to extend from current prototype. - * - * @memberof Chartist.Class - * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. - * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used. - * @return {Function} Constructor function of the new class - * - * @example - * var Fruit = Class.extend({ - * color: undefined, - * sugar: undefined, - * - * constructor: function(color, sugar) { - * this.color = color; - * this.sugar = sugar; - * }, - * - * eat: function() { - * this.sugar = 0; - * return this; - * } - * }); - * - * var Banana = Fruit.extend({ - * length: undefined, - * - * constructor: function(length, sugar) { - * Banana.super.constructor.call(this, 'Yellow', sugar); - * this.length = length; - * } - * }); - * - * var banana = new Banana(20, 40); - * console.log('banana instanceof Fruit', banana instanceof Fruit); - * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); - * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); - * console.log(banana.sugar); - * console.log(banana.eat().sugar); - * console.log(banana.color); - */ - function extend(properties, superProtoOverride) { - var superProto = superProtoOverride || this.prototype || Chartist.Class; - var proto = Object.create(superProto); - - Chartist.Class.cloneDefinitions(proto, properties); - - var constr = function() { - var fn = proto.constructor || function () {}, - instance; - - // If this is linked to the Chartist namespace the constructor was not called with new - // To provide a fallback we will instantiate here and return the instance - instance = this === Chartist ? Object.create(proto) : this; - fn.apply(instance, Array.prototype.slice.call(arguments, 0)); - - // If this constructor was not called with new we need to return the instance - // This will not harm when the constructor has been called with new as the returned value is ignored - return instance; - }; - - constr.prototype = proto; - constr['super'] = superProto; - constr.extend = this.extend; - - return constr; - } - - // Variable argument list clones args > 0 into args[0] and retruns modified args[0] - function cloneDefinitions() { - var args = listToArray(arguments); - var target = args[0]; - - args.splice(1, args.length - 1).forEach(function (source) { - Object.getOwnPropertyNames(source).forEach(function (propName) { - // If this property already exist in target we delete it first - delete target[propName]; - // Define the property with the descriptor from source - Object.defineProperty(target, propName, - Object.getOwnPropertyDescriptor(source, propName)); - }); - }); - - return target; - } - - Chartist.Class = { - extend: extend, - cloneDefinitions: cloneDefinitions - }; - -}(window, document, Chartist)); -;/** - * Base for all chart types. The methods in Chartist.Base are inherited to all chart types. - * - * @module Chartist.Base - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance. - // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not - // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage. - // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html - // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj - // The problem is with the label offsets that can't be converted into percentage and affecting the chart container - /** - * Updates the chart which currently does a full reconstruction of the SVG DOM - * - * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart. - * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart. - * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base - * @memberof Chartist.Base - */ - function update(data, options, override) { - if(data) { - this.data = data; - // Event for data transformation that allows to manipulate the data before it gets rendered in the charts - this.eventEmitter.emit('data', { - type: 'update', - data: this.data - }); - } - - if(options) { - this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options); - - // If chartist was not initialized yet, we just set the options and leave the rest to the initialization - // Otherwise we re-create the optionsProvider at this point - if(!this.initializeTimeoutId) { - this.optionsProvider.removeMediaQueryListeners(); - this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); - } - } - - // Only re-created the chart if it has been initialized yet - if(!this.initializeTimeoutId) { - this.createChart(this.optionsProvider.getCurrentOptions()); - } - - // Return a reference to the chart object to chain up calls - return this; - } - - /** - * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically. - * - * @memberof Chartist.Base - */ - function detach() { - // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore - // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout - if(!this.initializeTimeoutId) { - window.removeEventListener('resize', this.resizeListener); - this.optionsProvider.removeMediaQueryListeners(); - } else { - window.clearTimeout(this.initializeTimeoutId); - } - - return this; - } - - /** - * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. - * - * @memberof Chartist.Base - * @param {String} event Name of the event. Check the examples for supported events. - * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. - */ - function on(event, handler) { - this.eventEmitter.addEventHandler(event, handler); - return this; - } - - /** - * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. - * - * @memberof Chartist.Base - * @param {String} event Name of the event for which a handler should be removed - * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. - */ - function off(event, handler) { - this.eventEmitter.removeEventHandler(event, handler); - return this; - } - - function initialize() { - // Add window resize listener that re-creates the chart - window.addEventListener('resize', this.resizeListener); - - // Obtain current options based on matching media queries (if responsive options are given) - // This will also register a listener that is re-creating the chart based on media changes - this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); - // Register options change listener that will trigger a chart update - this.eventEmitter.addEventHandler('optionsChanged', function() { - this.update(); - }.bind(this)); - - // Before the first chart creation we need to register us with all plugins that are configured - // Initialize all relevant plugins with our chart object and the plugin options specified in the config - if(this.options.plugins) { - this.options.plugins.forEach(function(plugin) { - if(plugin instanceof Array) { - plugin[0](this, plugin[1]); - } else { - plugin(this); - } - }.bind(this)); - } - - // Event for data transformation that allows to manipulate the data before it gets rendered in the charts - this.eventEmitter.emit('data', { - type: 'initial', - data: this.data - }); - - // Create the first chart - this.createChart(this.optionsProvider.getCurrentOptions()); - - // As chart is initialized from the event loop now we can reset our timeout reference - // This is important if the chart gets initialized on the same element twice - this.initializeTimeoutId = undefined; - } - - /** - * Constructor of chart base class. - * - * @param query - * @param data - * @param defaultOptions - * @param options - * @param responsiveOptions - * @constructor - */ - function Base(query, data, defaultOptions, options, responsiveOptions) { - this.container = Chartist.querySelector(query); - this.data = data; - this.defaultOptions = defaultOptions; - this.options = options; - this.responsiveOptions = responsiveOptions; - this.eventEmitter = Chartist.EventEmitter(); - this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility'); - this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute'); - this.resizeListener = function resizeListener(){ - this.update(); - }.bind(this); - - if(this.container) { - // If chartist was already initialized in this container we are detaching all event listeners first - if(this.container.__chartist__) { - this.container.__chartist__.detach(); - } - - this.container.__chartist__ = this; - } - - // Using event loop for first draw to make it possible to register event listeners in the same call stack where - // the chart was created. - this.initializeTimeoutId = setTimeout(initialize.bind(this), 0); - } - - // Creating the chart base class - Chartist.Base = Chartist.Class.extend({ - constructor: Base, - optionsProvider: undefined, - container: undefined, - svg: undefined, - eventEmitter: undefined, - createChart: function() { - throw new Error('Base chart type can\'t be instantiated!'); - }, - update: update, - detach: detach, - on: on, - off: off, - version: Chartist.version, - supportsForeignObject: false - }); - -}(window, document, Chartist)); -;/** - * Chartist SVG module for simple SVG DOM abstraction - * - * @module Chartist.Svg - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - /** - * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. - * - * @memberof Chartist.Svg - * @constructor - * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg - * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} className This class or class list will be added to the SVG element - * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child - * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element - */ - function Svg(name, attributes, className, parent, insertFirst) { - // If Svg is getting called with an SVG element we just return the wrapper - if(name instanceof Element) { - this._node = name; - } else { - this._node = document.createElementNS(Chartist.namespaces.svg, name); - - // If this is an SVG element created then custom namespace - if(name === 'svg') { - this.attr({ - 'xmlns:ct': Chartist.namespaces.ct - }); - } - } - - if(attributes) { - this.attr(attributes); - } - - if(className) { - this.addClass(className); - } - - if(parent) { - if (insertFirst && parent._node.firstChild) { - parent._node.insertBefore(this._node, parent._node.firstChild); - } else { - parent._node.appendChild(this._node); - } - } - } - - /** - * Set attributes on the current SVG element of the wrapper you're currently working on. - * - * @memberof Chartist.Svg - * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value. - * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object. - * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function. - */ - function attr(attributes, ns) { - if(typeof attributes === 'string') { - if(ns) { - return this._node.getAttributeNS(ns, attributes); - } else { - return this._node.getAttribute(attributes); - } - } - - Object.keys(attributes).forEach(function(key) { - // If the attribute value is undefined we can skip this one - if(attributes[key] === undefined) { - return; - } - - if (key.indexOf(':') !== -1) { - var namespacedAttribute = key.split(':'); - this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]); - } else { - this._node.setAttribute(key, attributes[key]); - } - }.bind(this)); - - return this; - } - - /** - * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. - * - * @memberof Chartist.Svg - * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper - * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} [className] This class or class list will be added to the SVG element - * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element - * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data - */ - function elem(name, attributes, className, insertFirst) { - return new Chartist.Svg(name, attributes, className, this, insertFirst); - } - - /** - * Returns the parent Chartist.SVG wrapper object - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null. - */ - function parent() { - return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null; - } - - /** - * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element - */ - function root() { - var node = this._node; - while(node.nodeName !== 'svg') { - node = node.parentNode; - } - return new Chartist.Svg(node); - } - - /** - * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. - * - * @memberof Chartist.Svg - * @param {String} selector A CSS selector that is used to query for child SVG elements - * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found - */ - function querySelector(selector) { - var foundNode = this._node.querySelector(selector); - return foundNode ? new Chartist.Svg(foundNode) : null; - } - - /** - * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. - * - * @memberof Chartist.Svg - * @param {String} selector A CSS selector that is used to query for child SVG elements - * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found - */ - function querySelectorAll(selector) { - var foundNodes = this._node.querySelectorAll(selector); - return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null; - } - - /** - * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. - * - * @memberof Chartist.Svg - * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject - * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added. - * @param {String} [className] This class or class list will be added to the SVG element - * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child - * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element - */ - function foreignObject(content, attributes, className, insertFirst) { - // If content is string then we convert it to DOM - // TODO: Handle case where content is not a string nor a DOM Node - if(typeof content === 'string') { - var container = document.createElement('div'); - container.innerHTML = content; - content = container.firstChild; - } - - // Adding namespace to content element - content.setAttribute('xmlns', Chartist.namespaces.xmlns); - - // Creating the foreignObject without required extension attribute (as described here - // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement) - var fnObj = this.elem('foreignObject', attributes, className, insertFirst); - - // Add content to foreignObjectElement - fnObj._node.appendChild(content); - - return fnObj; - } - - /** - * This method adds a new text element to the current Chartist.Svg wrapper. - * - * @memberof Chartist.Svg - * @param {String} t The text that should be added to the text element that is created - * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element - */ - function text(t) { - this._node.appendChild(document.createTextNode(t)); - return this; - } - - /** - * This method will clear all child nodes of the current wrapper object. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The same wrapper object that got emptied - */ - function empty() { - while (this._node.firstChild) { - this._node.removeChild(this._node.firstChild); - } - - return this; - } - - /** - * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The parent wrapper object of the element that got removed - */ - function remove() { - this._node.parentNode.removeChild(this._node); - return this.parent(); - } - - /** - * This method will replace the element with a new element that can be created outside of the current DOM. - * - * @memberof Chartist.Svg - * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object - * @return {Chartist.Svg} The wrapper of the new element - */ - function replace(newElement) { - this._node.parentNode.replaceChild(newElement._node, this._node); - return newElement; - } - - /** - * This method will append an element to the current element as a child. - * - * @memberof Chartist.Svg - * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child - * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child - * @return {Chartist.Svg} The wrapper of the appended object - */ - function append(element, insertFirst) { - if(insertFirst && this._node.firstChild) { - this._node.insertBefore(element._node, this._node.firstChild); - } else { - this._node.appendChild(element._node); - } - - return this; - } - - /** - * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. - * - * @memberof Chartist.Svg - * @return {Array} A list of classes or an empty array if there are no classes on the current element - */ - function classes() { - return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\s+/) : []; - } - - /** - * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. - * - * @memberof Chartist.Svg - * @param {String} names A white space separated list of class names - * @return {Chartist.Svg} The wrapper of the current element - */ - function addClass(names) { - this._node.setAttribute('class', - this.classes(this._node) - .concat(names.trim().split(/\s+/)) - .filter(function(elem, pos, self) { - return self.indexOf(elem) === pos; - }).join(' ') - ); - - return this; - } - - /** - * Removes one or a space separated list of classes from the current element. - * - * @memberof Chartist.Svg - * @param {String} names A white space separated list of class names - * @return {Chartist.Svg} The wrapper of the current element - */ - function removeClass(names) { - var removedClasses = names.trim().split(/\s+/); - - this._node.setAttribute('class', this.classes(this._node).filter(function(name) { - return removedClasses.indexOf(name) === -1; - }).join(' ')); - - return this; - } - - /** - * Removes all classes from the current element. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The wrapper of the current element - */ - function removeAllClasses() { - this._node.setAttribute('class', ''); - - return this; - } - - /** - * Get element height using `getBoundingClientRect` - * - * @memberof Chartist.Svg - * @return {Number} The elements height in pixels - */ - function height() { - return this._node.getBoundingClientRect().height; - } - - /** - * Get element width using `getBoundingClientRect` - * - * @memberof Chartist.Core - * @return {Number} The elements width in pixels - */ - function width() { - return this._node.getBoundingClientRect().width; - } - - /** - * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve. - * **An animations object could look like this:** - * ```javascript - * element.animate({ - * opacity: { - * dur: 1000, - * from: 0, - * to: 1 - * }, - * x1: { - * dur: '1000ms', - * from: 100, - * to: 200, - * easing: 'easeOutQuart' - * }, - * y1: { - * dur: '2s', - * from: 0, - * to: 100 - * } - * }); - * ``` - * **Automatic unit conversion** - * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds. - * **Guided mode** - * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it. - * If guided mode is enabled the following behavior is added: - * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation - * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation) - * - The animate element will be forced to use `fill="freeze"` - * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately. - * - After the animation the element attribute value will be set to the `to` value of the animation - * - The animate element is deleted from the DOM - * - * @memberof Chartist.Svg - * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode. - * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated. - * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends. - * @return {Chartist.Svg} The current element where the animation was added - */ - function animate(animations, guided, eventEmitter) { - if(guided === undefined) { - guided = true; - } - - Object.keys(animations).forEach(function createAnimateForAttributes(attribute) { - - function createAnimate(animationDefinition, guided) { - var attributeProperties = {}, - animate, - timeout, - easing; - - // Check if an easing is specified in the definition object and delete it from the object as it will not - // be part of the animate element attributes. - if(animationDefinition.easing) { - // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object - easing = animationDefinition.easing instanceof Array ? - animationDefinition.easing : - Chartist.Svg.Easing[animationDefinition.easing]; - delete animationDefinition.easing; - } - - // If numeric dur or begin was provided we assume milli seconds - animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms'); - animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms'); - - if(easing) { - animationDefinition.calcMode = 'spline'; - animationDefinition.keySplines = easing.join(' '); - animationDefinition.keyTimes = '0;1'; - } - - // Adding "fill: freeze" if we are in guided mode and set initial attribute values - if(guided) { - animationDefinition.fill = 'freeze'; - // Animated property on our element should already be set to the animation from value in guided mode - attributeProperties[attribute] = animationDefinition.from; - this.attr(attributeProperties); - - // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin - // which needs to be in ms aside - timeout = Chartist.quantity(animationDefinition.begin || 0).value; - animationDefinition.begin = 'indefinite'; - } - - animate = this.elem('animate', Chartist.extend({ - attributeName: attribute - }, animationDefinition)); - - if(guided) { - // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout - setTimeout(function() { - // If beginElement fails we set the animated attribute to the end position and remove the animate element - // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in - // the browser. (Currently FF 34 does not support animate elements in foreignObjects) - try { - animate._node.beginElement(); - } catch(err) { - // Set animated attribute to current animated value - attributeProperties[attribute] = animationDefinition.to; - this.attr(attributeProperties); - // Remove the animate element as it's no longer required - animate.remove(); - } - }.bind(this), timeout); - } - - if(eventEmitter) { - animate._node.addEventListener('beginEvent', function handleBeginEvent() { - eventEmitter.emit('animationBegin', { - element: this, - animate: animate._node, - params: animationDefinition - }); - }.bind(this)); - } - - animate._node.addEventListener('endEvent', function handleEndEvent() { - if(eventEmitter) { - eventEmitter.emit('animationEnd', { - element: this, - animate: animate._node, - params: animationDefinition - }); - } - - if(guided) { - // Set animated attribute to current animated value - attributeProperties[attribute] = animationDefinition.to; - this.attr(attributeProperties); - // Remove the animate element as it's no longer required - animate.remove(); - } - }.bind(this)); - } - - // If current attribute is an array of definition objects we create an animate for each and disable guided mode - if(animations[attribute] instanceof Array) { - animations[attribute].forEach(function(animationDefinition) { - createAnimate.bind(this)(animationDefinition, false); - }.bind(this)); - } else { - createAnimate.bind(this)(animations[attribute], guided); - } - - }.bind(this)); - - return this; - } - - Chartist.Svg = Chartist.Class.extend({ - constructor: Svg, - attr: attr, - elem: elem, - parent: parent, - root: root, - querySelector: querySelector, - querySelectorAll: querySelectorAll, - foreignObject: foreignObject, - text: text, - empty: empty, - remove: remove, - replace: replace, - append: append, - classes: classes, - addClass: addClass, - removeClass: removeClass, - removeAllClasses: removeAllClasses, - height: height, - width: width, - animate: animate - }); - - /** - * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. - * - * @memberof Chartist.Svg - * @param {String} feature The SVG 1.1 feature that should be checked for support. - * @return {Boolean} True of false if the feature is supported or not - */ - Chartist.Svg.isSupported = function(feature) { - return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1'); - }; - - /** - * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions. - * - * @memberof Chartist.Svg - */ - var easingCubicBeziers = { - easeInSine: [0.47, 0, 0.745, 0.715], - easeOutSine: [0.39, 0.575, 0.565, 1], - easeInOutSine: [0.445, 0.05, 0.55, 0.95], - easeInQuad: [0.55, 0.085, 0.68, 0.53], - easeOutQuad: [0.25, 0.46, 0.45, 0.94], - easeInOutQuad: [0.455, 0.03, 0.515, 0.955], - easeInCubic: [0.55, 0.055, 0.675, 0.19], - easeOutCubic: [0.215, 0.61, 0.355, 1], - easeInOutCubic: [0.645, 0.045, 0.355, 1], - easeInQuart: [0.895, 0.03, 0.685, 0.22], - easeOutQuart: [0.165, 0.84, 0.44, 1], - easeInOutQuart: [0.77, 0, 0.175, 1], - easeInQuint: [0.755, 0.05, 0.855, 0.06], - easeOutQuint: [0.23, 1, 0.32, 1], - easeInOutQuint: [0.86, 0, 0.07, 1], - easeInExpo: [0.95, 0.05, 0.795, 0.035], - easeOutExpo: [0.19, 1, 0.22, 1], - easeInOutExpo: [1, 0, 0, 1], - easeInCirc: [0.6, 0.04, 0.98, 0.335], - easeOutCirc: [0.075, 0.82, 0.165, 1], - easeInOutCirc: [0.785, 0.135, 0.15, 0.86], - easeInBack: [0.6, -0.28, 0.735, 0.045], - easeOutBack: [0.175, 0.885, 0.32, 1.275], - easeInOutBack: [0.68, -0.55, 0.265, 1.55] - }; - - Chartist.Svg.Easing = easingCubicBeziers; - - /** - * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements. - * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`. - * - * @memberof Chartist.Svg - * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll) - * @constructor - */ - function SvgList(nodeList) { - var list = this; - - this.svgElements = []; - for(var i = 0; i < nodeList.length; i++) { - this.svgElements.push(new Chartist.Svg(nodeList[i])); - } - - // Add delegation methods for Chartist.Svg - Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) { - return ['constructor', - 'parent', - 'querySelector', - 'querySelectorAll', - 'replace', - 'append', - 'classes', - 'height', - 'width'].indexOf(prototypeProperty) === -1; - }).forEach(function(prototypeProperty) { - list[prototypeProperty] = function() { - var args = Array.prototype.slice.call(arguments, 0); - list.svgElements.forEach(function(element) { - Chartist.Svg.prototype[prototypeProperty].apply(element, args); - }); - return list; - }; - }); - } - - Chartist.Svg.List = Chartist.Class.extend({ - constructor: SvgList - }); -}(window, document, Chartist)); -;/** - * Chartist SVG path module for SVG path description creation and modification. - * - * @module Chartist.Svg.Path - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - /** - * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported. - * - * @memberof Chartist.Svg.Path - * @type {Object} - */ - var elementDescriptions = { - m: ['x', 'y'], - l: ['x', 'y'], - c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'], - a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y'] - }; - - /** - * Default options for newly created SVG path objects. - * - * @memberof Chartist.Svg.Path - * @type {Object} - */ - var defaultOptions = { - // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed. - accuracy: 3 - }; - - function element(command, params, pathElements, pos, relative, data) { - var pathElement = Chartist.extend({ - command: relative ? command.toLowerCase() : command.toUpperCase() - }, params, data ? { data: data } : {} ); - - pathElements.splice(pos, 0, pathElement); - } - - function forEachParam(pathElements, cb) { - pathElements.forEach(function(pathElement, pathElementIndex) { - elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) { - cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements); - }); - }); - } - - /** - * Used to construct a new path object. - * - * @memberof Chartist.Svg.Path - * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end) - * @param {Object} options Options object that overrides the default objects. See default options for more details. - * @constructor - */ - function SvgPath(close, options) { - this.pathElements = []; - this.pos = 0; - this.close = close; - this.options = Chartist.extend({}, defaultOptions, options); - } - - /** - * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor. - * - * @memberof Chartist.Svg.Path - * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array. - * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned. - */ - function position(pos) { - if(pos !== undefined) { - this.pos = Math.max(0, Math.min(this.pathElements.length, pos)); - return this; - } else { - return this.pos; - } - } - - /** - * Removes elements from the path starting at the current position. - * - * @memberof Chartist.Svg.Path - * @param {Number} count Number of path elements that should be removed from the current position. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function remove(count) { - this.pathElements.splice(this.pos, count); - return this; - } - - /** - * Use this function to add a new move SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The x coordinate for the move element. - * @param {Number} y The y coordinate for the move element. - * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function move(x, y, relative, data) { - element('M', { - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Use this function to add a new line SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The x coordinate for the line element. - * @param {Number} y The y coordinate for the line element. - * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function line(x, y, relative, data) { - element('L', { - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Use this function to add a new curve SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} x1 The x coordinate for the first control point of the bezier curve. - * @param {Number} y1 The y coordinate for the first control point of the bezier curve. - * @param {Number} x2 The x coordinate for the second control point of the bezier curve. - * @param {Number} y2 The y coordinate for the second control point of the bezier curve. - * @param {Number} x The x coordinate for the target point of the curve element. - * @param {Number} y The y coordinate for the target point of the curve element. - * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function curve(x1, y1, x2, y2, x, y, relative, data) { - element('C', { - x1: +x1, - y1: +y1, - x2: +x2, - y2: +y2, - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Use this function to add a new non-bezier curve SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} rx The radius to be used for the x-axis of the arc. - * @param {Number} ry The radius to be used for the y-axis of the arc. - * @param {Number} xAr Defines the orientation of the arc - * @param {Number} lAf Large arc flag - * @param {Number} sf Sweep flag - * @param {Number} x The x coordinate for the target point of the curve element. - * @param {Number} y The y coordinate for the target point of the curve element. - * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) { - element('A', { - rx: +rx, - ry: +ry, - xAr: +xAr, - lAf: +lAf, - sf: +sf, - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object. - * - * @memberof Chartist.Svg.Path - * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function parse(path) { - // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']] - var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2') - .replace(/([0-9])([A-Za-z])/g, '$1 $2') - .split(/[\s,]+/) - .reduce(function(result, element) { - if(element.match(/[A-Za-z]/)) { - result.push([]); - } - - result[result.length - 1].push(element); - return result; - }, []); - - // If this is a closed path we remove the Z at the end because this is determined by the close option - if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') { - chunks.pop(); - } - - // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters - // For example {command: 'M', x: '10', y: '10'} - var elements = chunks.map(function(chunk) { - var command = chunk.shift(), - description = elementDescriptions[command.toLowerCase()]; - - return Chartist.extend({ - command: command - }, description.reduce(function(result, paramName, index) { - result[paramName] = +chunk[index]; - return result; - }, {})); - }); - - // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position - var spliceArgs = [this.pos, 0]; - Array.prototype.push.apply(spliceArgs, elements); - Array.prototype.splice.apply(this.pathElements, spliceArgs); - // Increase the internal position by the element count - this.pos += elements.length; - - return this; - } - - /** - * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string. - * - * @memberof Chartist.Svg.Path - * @return {String} - */ - function stringify() { - var accuracyMultiplier = Math.pow(10, this.options.accuracy); - - return this.pathElements.reduce(function(path, pathElement) { - var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) { - return this.options.accuracy ? - (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) : - pathElement[paramName]; - }.bind(this)); - - return path + pathElement.command + params.join(','); - }.bind(this), '') + (this.close ? 'Z' : ''); - } - - /** - * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements. - * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function scale(x, y) { - forEachParam(this.pathElements, function(pathElement, paramName) { - pathElement[paramName] *= paramName[0] === 'x' ? x : y; - }); - return this; - } - - /** - * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements. - * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function translate(x, y) { - forEachParam(this.pathElements, function(pathElement, paramName) { - pathElement[paramName] += paramName[0] === 'x' ? x : y; - }); - return this; - } - - /** - * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path. - * The method signature of the callback function looks like this: - * ```javascript - * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) - * ``` - * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate. - * - * @memberof Chartist.Svg.Path - * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function transform(transformFnc) { - forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) { - var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements); - if(transformed || transformed === 0) { - pathElement[paramName] = transformed; - } - }); - return this; - } - - /** - * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned. - * - * @memberof Chartist.Svg.Path - * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used. - * @return {Chartist.Svg.Path} - */ - function clone(close) { - var c = new Chartist.Svg.Path(close || this.close); - c.pos = this.pos; - c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) { - return Chartist.extend({}, pathElement); - }); - c.options = Chartist.extend({}, this.options); - return c; - } - - /** - * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings. - * - * @memberof Chartist.Svg.Path - * @param {String} command The command you'd like to use to split the path - * @return {Array} - */ - function splitByCommand(command) { - var split = [ - new Chartist.Svg.Path() - ]; - - this.pathElements.forEach(function(pathElement) { - if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) { - split.push(new Chartist.Svg.Path()); - } - - split[split.length - 1].pathElements.push(pathElement); - }); - - return split; - } - - /** - * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths. - * - * @memberof Chartist.Svg.Path - * @param {Array} paths A list of paths to be joined together. The order is important. - * @param {boolean} close If the newly created path should be a closed path - * @param {Object} options Path options for the newly created path. - * @return {Chartist.Svg.Path} - */ - - function join(paths, close, options) { - var joinedPath = new Chartist.Svg.Path(close, options); - for(var i = 0; i < paths.length; i++) { - var path = paths[i]; - for(var j = 0; j < path.pathElements.length; j++) { - joinedPath.pathElements.push(path.pathElements[j]); - } - } - return joinedPath; - } - - Chartist.Svg.Path = Chartist.Class.extend({ - constructor: SvgPath, - position: position, - remove: remove, - move: move, - line: line, - curve: curve, - arc: arc, - scale: scale, - translate: translate, - transform: transform, - parse: parse, - stringify: stringify, - clone: clone, - splitByCommand: splitByCommand - }); - - Chartist.Svg.Path.elementDescriptions = elementDescriptions; - Chartist.Svg.Path.join = join; -}(window, document, Chartist)); -;/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - var axisUnits = { - 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' - } - }; - - function Axis(units, chartRect, ticks, options) { - this.units = units; - this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x; - this.chartRect = chartRect; - this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart]; - this.gridOffset = chartRect[units.rectOffset]; - this.ticks = ticks; - this.options = options; - } - - function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) { - var xy = this.units.pos.toUpperCase(); - var axisOptions = chartOptions['axis' + xy]; - var projectedValues = this.ticks.map(this.projectValue.bind(this)); - var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc); - - var lastWidth=undefined; - projectedValues.forEach(function(projectedValue, index) { - var labelOffset = { - x: 0, - y: 0 - }; - - // TODO: Find better solution for solving this problem - // Calculate how much space we have available for the label - - - var labelLength=0; - - - if (xy == 'Y') { // X doesnt use this - if (projectedValues[index + 1]) { - // If we still have one label ahead, we can calculate the distance to the next tick / label - labelLength = projectedValues[index + 1] - projectedValue; - // lastWidth = labelLength; - // } else if (typeof lastWidth != 'undefined') { - // labelLength = lastWidth; // EDIT. added the lastWidth thing - } else { - // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to - // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will - // still be visible inside of the chart padding. - labelLength = Math.max(this.axisLength - projectedValue, 30); - } - } - - // Skip grid lines and labels where interpolated label values are falsey (execpt for 0) - if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') { - return; - } - - // Transform to global coordinates using the chartRect - // We also need to set the label offset for the createLabel function - if(this.units.pos === 'x') { - projectedValue = this.chartRect.x1 + projectedValue; - labelOffset.x = chartOptions.axisX.labelOffset.x; - - // If the labels should be positioned in start position (top side for vertical axis) we need to set a - // different offset as for positioned with end (bottom) - if(chartOptions.axisX.position === 'start') { - labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); - } else { - labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); - } - } else { - projectedValue = this.chartRect.y1 - projectedValue; - labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0); - - // If the labels should be positioned in start position (left side for horizontal axis) we need to set a - // different offset as for positioned with end (right side) - if(chartOptions.axisY.position === 'start') { - labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10; - } else { - labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10; - } - } - - if(axisOptions.showGrid) { - Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [ - chartOptions.classNames.grid, - chartOptions.classNames[this.units.dir] - ], eventEmitter); - } - - if(axisOptions.showLabel) { - Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [ - chartOptions.classNames.label, - chartOptions.classNames[this.units.dir], - chartOptions.classNames[axisOptions.position] - ], useForeignObject, eventEmitter); - } - }.bind(this)); - } - - Chartist.Axis = Chartist.Class.extend({ - constructor: Axis, - createGridAndLabels: createGridAndLabels, - projectValue: function(value, index, data) { - throw new Error('Base axis can\'t be instantiated!'); - } - }); - - Chartist.Axis.units = axisUnits; - -}(window, document, Chartist)); -;/** - * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart. - * **Options** - * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. - * ```javascript - * var options = { - * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored - * high: 100, - * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored - * low: 0, - * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel). - * scaleMinSpace: 20, - * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only. - * onlyInteger: true, - * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart. - * referenceValue: 5 - * }; - * ``` - * - * @module Chartist.AutoScaleAxis - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - function AutoScaleAxis(axisUnit, data, chartRect, options) { - // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options - var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); - this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger); - this.range = { - min: this.bounds.min, - max: this.bounds.max - }; - - Chartist.AutoScaleAxis['super'].constructor.call(this, - axisUnit, - chartRect, - this.bounds.values, - options); - } - - function projectValue(value) { - return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range; - } - - Chartist.AutoScaleAxis = Chartist.Axis.extend({ - constructor: AutoScaleAxis, - projectValue: projectValue - }); - -}(window, document, Chartist)); -;/** - * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum. - * **Options** - * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. - * ```javascript - * var options = { - * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored - * high: 100, - * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored - * low: 0, - * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1. - * divisor: 4, - * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated. - * ticks: [1, 10, 20, 30] - * }; - * ``` - * - * @module Chartist.FixedScaleAxis - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - function FixedScaleAxis(axisUnit, data, chartRect, options) { - var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); - this.divisor = options.divisor || 1; - this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) { - return highLow.low + (highLow.high - highLow.low) / this.divisor * index; - }.bind(this)); - this.ticks.sort(function(a, b) { - return a - b; - }); - this.range = { - min: highLow.low, - max: highLow.high - }; - - Chartist.FixedScaleAxis['super'].constructor.call(this, - axisUnit, - chartRect, - this.ticks, - options); - - this.stepLength = this.axisLength / this.divisor; - } - - function projectValue(value) { - return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min); - } - - Chartist.FixedScaleAxis = Chartist.Axis.extend({ - constructor: FixedScaleAxis, - projectValue: projectValue - }); - -}(window, document, Chartist)); -;/** - * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose. - * **Options** - * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. - * ```javascript - * var options = { - * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks. - * ticks: ['One', 'Two', 'Three'], - * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead. - * stretch: true - * }; - * ``` - * - * @module Chartist.StepAxis - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - function StepAxis(axisUnit, data, chartRect, options) { - Chartist.StepAxis['super'].constructor.call(this, - axisUnit, - chartRect, - options.ticks, - options); - - this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0)); - } - - function projectValue(value, index) { - return this.stepLength * index; - } - - Chartist.StepAxis = Chartist.Axis.extend({ - constructor: StepAxis, - projectValue: projectValue - }); - -}(window, document, Chartist)); -;/** - * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point. - * - * For examples on how to use the line chart please check the examples of the `Chartist.Line` method. - * - * @module Chartist.Line - */ -/* global Chartist */ -(function(window, document, Chartist){ - 'use strict'; - - /** - * Default options in line charts. Expand the code view to see a detailed list of options with comments. - * - * @memberof Chartist.Line - */ - var defaultOptions = { - // Options for X-Axis - axisX: { - // The offset of the labels to the chart area - offset: 30, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'end', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. - type: undefined - }, - // Options for Y-Axis - axisY: { - // The offset of the labels to the chart area - offset: 40, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'start', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. - type: undefined, - // This value specifies the minimum height in pixel of the scale steps - scaleMinSpace: 20, - // Use only integer values (whole numbers) for the scale steps - onlyInteger: false - }, - // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - width: undefined, - // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - height: undefined, - // If the line should be drawn or not - showLine: true, - // If dots should be drawn or not - showPoint: true, - // If the line chart should draw an area - showArea: false, - // The base for the area chart that will be used to close the area shape (is normally 0) - areaBase: 0, - // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description. - lineSmooth: true, - // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - low: undefined, - // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - high: undefined, - // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - chartPadding: { - top: 15, - right: 15, - bottom: 5, - left: 10 - }, - // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. - fullWidth: false, - // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. - reverseData: false, - // Override the class names that get used to generate the SVG structure of the chart - 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' - } - }; - - /** - * Creates a new chart - * - */ - function createChart(options) { - this.data = Chartist.normalizeData(this.data); - var data = { - raw: this.data, - normalized: Chartist.getDataArray(this.data, options.reverseData, true) - }; - - // Create new svg object - this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); - // Create groups for labels, grid and series - var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); - var seriesGroup = this.svg.elem('g'); - var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); - - var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); - var axisX, axisY; - - if(options.axisX.type === undefined) { - axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { - ticks: data.raw.labels, - stretch: options.fullWidth - })); - } else { - axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); - } - - if(options.axisY.type === undefined) { - axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { - high: Chartist.isNum(options.high) ? options.high : options.axisY.high, - low: Chartist.isNum(options.low) ? options.low : options.axisY.low - })); - } else { - axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); - } - - axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - - // Draw the series - data.raw.series.forEach(function(series, seriesIndex) { - var seriesElement = seriesGroup.elem('g'); - - // Write attributes to series group element. If series name or meta is undefined the attributes will not be written - seriesElement.attr({ - 'ct:series-name': series.name, - 'ct:meta': Chartist.serialize(series.meta) - }); - - // Use series class from series data or if not set generate one - seriesElement.addClass([ - options.classNames.series, - (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) - ].join(' ')); - - var pathCoordinates = [], - pathData = []; - - data.normalized[seriesIndex].forEach(function(value, valueIndex) { - var p = { - x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]), - y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex]) - }; - pathCoordinates.push(p.x, p.y); - pathData.push({ - value: value, - valueIndex: valueIndex, - meta: Chartist.getMetaData(series, valueIndex) - }); - }.bind(this)); - - var seriesOptions = { - lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'), - showPoint: Chartist.getSeriesOption(series, options, 'showPoint'), - showLine: Chartist.getSeriesOption(series, options, 'showLine'), - showArea: Chartist.getSeriesOption(series, options, 'showArea'), - areaBase: Chartist.getSeriesOption(series, options, 'areaBase') - }; - - var smoothing = typeof seriesOptions.lineSmooth === 'function' ? - seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none()); - // Interpolating path where pathData will be used to annotate each path element so we can trace back the original - // index, value and meta data - var path = smoothing(pathCoordinates, pathData); - - // If we should show points we need to create them now to avoid secondary loop - // Points are drawn from the pathElements returned by the interpolation function - // Small offset for Firefox to render squares correctly - if (seriesOptions.showPoint) { - - path.pathElements.forEach(function(pathElement) { - var point = seriesElement.elem('line', { - x1: pathElement.x, - y1: pathElement.y, - x2: pathElement.x + 0.01, - y2: pathElement.y - }, options.classNames.point).attr({ - 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','), - 'ct:meta': pathElement.data.meta - }); - - this.eventEmitter.emit('draw', { - type: 'point', - value: pathElement.data.value, - index: pathElement.data.valueIndex, - meta: pathElement.data.meta, - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - group: seriesElement, - element: point, - x: pathElement.x, - y: pathElement.y - }); - }.bind(this)); - } - - if(seriesOptions.showLine) { - var line = seriesElement.elem('path', { - d: path.stringify() - }, options.classNames.line, true); - - this.eventEmitter.emit('draw', { - type: 'line', - values: data.normalized[seriesIndex], - path: path.clone(), - chartRect: chartRect, - index: seriesIndex, - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - group: seriesElement, - element: line - }); - } - - // Area currently only works with axes that support a range! - if(seriesOptions.showArea && axisY.range) { - // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that - // the area is not drawn outside the chart area. - var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min); - - // We project the areaBase value into screen coordinates - var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase); - - // In order to form the area we'll first split the path by move commands so we can chunk it up into segments - path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) { - // We filter only "solid" segments that contain more than one point. Otherwise there's no need for an area - return pathSegment.pathElements.length > 1; - }).map(function convertToArea(solidPathSegments) { - // Receiving the filtered solid path segments we can now convert those segments into fill areas - var firstElement = solidPathSegments.pathElements[0]; - var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1]; - - // Cloning the solid path segment with closing option and removing the first move command from the clone - // We then insert a new move that should start at the area base and draw a straight line up or down - // at the end of the path we add an additional straight line to the projected area base value - // As the closing option is set our path will be automatically closed - return solidPathSegments.clone(true) - .position(0) - .remove(1) - .move(firstElement.x, areaBaseProjected) - .line(firstElement.x, firstElement.y) - .position(solidPathSegments.pathElements.length + 1) - .line(lastElement.x, areaBaseProjected); - - }).forEach(function createArea(areaPath) { - // For each of our newly created area paths, we'll now create path elements by stringifying our path objects - // and adding the created DOM elements to the correct series group - var area = seriesElement.elem('path', { - d: areaPath.stringify() - }, options.classNames.area, true); - - // Emit an event for each area that was drawn - this.eventEmitter.emit('draw', { - type: 'area', - values: data.normalized[seriesIndex], - path: areaPath.clone(), - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - chartRect: chartRect, - index: seriesIndex, - group: seriesElement, - element: area - }); - }.bind(this)); - } - }.bind(this)); - - this.eventEmitter.emit('created', { - bounds: axisY.bounds, - chartRect: chartRect, - axisX: axisX, - axisY: axisY, - svg: this.svg, - options: options - }); - } - - /** - * This method creates a new line chart. - * - * @memberof Chartist.Line - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object that needs to consist of a labels and a series array - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object which exposes the API for the created chart - * - * @example - * // Create a simple line chart - * var data = { - * // A labels array that can contain any sort of values - * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], - * // Our series array that contains series objects or in this case series data arrays - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // As options we currently only set a static size of 300x200 px - * var options = { - * width: '300px', - * height: '200px' - * }; - * - * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options - * new Chartist.Line('.ct-chart', data, options); - * - * @example - * // Use specific interpolation function with configuration from the Chartist.Interpolation module - * - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [ - * [1, 1, 8, 1, 7] - * ] - * }, { - * lineSmooth: Chartist.Interpolation.cardinal({ - * tension: 0.2 - * }) - * }); - * - * @example - * // Create a line chart with responsive options - * - * var data = { - * // A labels array that can contain any sort of values - * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], - * // Our series array that contains series objects or in this case series data arrays - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries. - * var responsiveOptions = [ - * ['screen and (min-width: 641px) and (max-width: 1024px)', { - * showPoint: false, - * axisX: { - * labelInterpolationFnc: function(value) { - * // Will return Mon, Tue, Wed etc. on medium screens - * return value.slice(0, 3); - * } - * } - * }], - * ['screen and (max-width: 640px)', { - * showLine: false, - * axisX: { - * labelInterpolationFnc: function(value) { - * // Will return M, T, W etc. on small screens - * return value[0]; - * } - * } - * }] - * ]; - * - * new Chartist.Line('.ct-chart', data, null, responsiveOptions); - * - */ - function Line(query, data, options, responsiveOptions) { - Chartist.Line['super'].constructor.call(this, - query, - data, - defaultOptions, - Chartist.extend({}, defaultOptions, options), - responsiveOptions); - } - - // Creating line chart type in Chartist namespace - Chartist.Line = Chartist.Base.extend({ - constructor: Line, - createChart: createChart - }); - -}(window, document, Chartist)); -;/** - * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts. - * - * @module Chartist.Bar - */ -/* global Chartist */ -(function(window, document, Chartist){ - 'use strict'; - - /** - * Default options in bar charts. Expand the code view to see a detailed list of options with comments. - * - * @memberof Chartist.Bar - */ - var defaultOptions = { - // Options for X-Axis - axisX: { - // The offset of the chart drawing area to the border of the container - offset: 30, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'end', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // This value specifies the minimum width in pixel of the scale steps - scaleMinSpace: 30, - // Use only integer values (whole numbers) for the scale steps - onlyInteger: false - }, - // Options for Y-Axis - axisY: { - // The offset of the chart drawing area to the border of the container - offset: 40, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'start', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // This value specifies the minimum height in pixel of the scale steps - scaleMinSpace: 20, - // Use only integer values (whole numbers) for the scale steps - onlyInteger: false - }, - // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - width: undefined, - // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - height: undefined, - // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - high: undefined, - // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - low: undefined, - // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - chartPadding: { - top: 15, - right: 15, - bottom: 5, - left: 10 - }, - // Specify the distance in pixel of bars in a group - seriesBarDistance: 15, - // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options. - stackBars: false, - // If set to 'overlap' this property will force the stacked bars to draw from the zero line. - // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. - stackMode: 'accumulate', - // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values. - horizontalBars: false, - // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time. - distributeSeries: false, - // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. - reverseData: false, - // Override the class names that get used to generate the SVG structure of the chart - 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' - } - }; - - /** - * Creates a new chart - * - */ - function createChart(options) { - this.data = Chartist.normalizeData(this.data); - var data = { - raw: this.data, - normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) { - return [value]; - }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y') - }; - - var highLow; - - // Create new svg element - this.svg = Chartist.createSvg( - this.container, - options.width, - options.height, - options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '') - ); - - // Drawing groups in correct order - var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); - var seriesGroup = this.svg.elem('g'); - var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); - - if(options.stackBars && data.normalized.length !== 0) { - // If stacked bars we need to calculate the high low from stacked values from each series - var serialSums = Chartist.serialMap(data.normalized, function serialSums() { - return Array.prototype.slice.call(arguments).map(function(value) { - return value; - }).reduce(function(prev, curr) { - return { - x: prev.x + (curr && curr.x) || 0, - y: prev.y + (curr && curr.y) || 0 - }; - }, {x: 0, y: 0}); - }); - - highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, { - referenceValue: 0 - }), options.horizontalBars ? 'x' : 'y'); - } else { - highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, { - referenceValue: 0 - }), options.horizontalBars ? 'x' : 'y'); - } - // Overrides of high / low from settings - highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high); - highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low); - - var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); - - var valueAxis, - labelAxisTicks, - labelAxis, - axisX, - axisY; - - // We need to set step count based on some options combinations - if(options.distributeSeries && options.stackBars) { - // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should - // use only the first label for the step axis - labelAxisTicks = data.raw.labels.slice(0, 1); - } else { - // If distributed series are enabled but stacked bars aren't, we should use the series labels - // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array - // as the bars are normalized - labelAxisTicks = data.raw.labels; - } - - // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary. - if(options.horizontalBars) { - if(options.axisX.type === undefined) { - valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { - highLow: highLow, - referenceValue: 0 - })); - } else { - valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { - highLow: highLow, - referenceValue: 0 - })); - } - - if(options.axisY.type === undefined) { - labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, { - ticks: labelAxisTicks - }); - } else { - labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); - } - } else { - if(options.axisX.type === undefined) { - labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, { - ticks: labelAxisTicks - }); - } else { - labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); - } - - if(options.axisY.type === undefined) { - valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { - highLow: highLow, - referenceValue: 0 - })); - } else { - valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { - highLow: highLow, - referenceValue: 0 - })); - } - } - - // Projected 0 point - var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0)); - // Used to track the screen coordinates of stacked bars - var stackedBarValues = []; - - labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - - // Draw the series - data.raw.series.forEach(function(series, seriesIndex) { - // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc. - var biPol = seriesIndex - (data.raw.series.length - 1) / 2; - // Half of the period width between vertical grid lines used to position bars - var periodHalfLength; - // Current series SVG element - var seriesElement; - - // We need to set periodHalfLength based on some options combinations - if(options.distributeSeries && !options.stackBars) { - // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array - // which is the series count and divide by 2 - periodHalfLength = labelAxis.axisLength / data.normalized.length / 2; - } else if(options.distributeSeries && options.stackBars) { - // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis - // length by 2 - periodHalfLength = labelAxis.axisLength / 2; - } else { - // On regular bar charts we should just use the series length - periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2; - } - - // Adding the series group to the series element - seriesElement = seriesGroup.elem('g'); - - // Write attributes to series group element. If series name or meta is undefined the attributes will not be written - seriesElement.attr({ - 'ct:series-name': series.name, - 'ct:meta': Chartist.serialize(series.meta) - }); - - // Use series class from series data or if not set generate one - seriesElement.addClass([ - options.classNames.series, - (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) - ].join(' ')); - - data.normalized[seriesIndex].forEach(function(value, valueIndex) { - var projected, - bar, - previousStack, - labelAxisValueIndex; - - // We need to set labelAxisValueIndex based on some options combinations - if(options.distributeSeries && !options.stackBars) { - // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection - // on the step axis for label positioning - labelAxisValueIndex = seriesIndex; - } else if(options.distributeSeries && options.stackBars) { - // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use - // 0 for projection on the label step axis - labelAxisValueIndex = 0; - } else { - // On regular bar charts we just use the value index to project on the label step axis - labelAxisValueIndex = valueIndex; - } - - // We need to transform coordinates differently based on the chart layout - if(options.horizontalBars) { - projected = { - x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]), - y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex]) - }; - } else { - projected = { - x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]), - y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex]) - } - } - - // If the label axis is a step based axis we will offset the bar into the middle of between two steps using - // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using - // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not - // add any automated positioning. - if(labelAxis instanceof Chartist.StepAxis) { - // Offset to center bar between grid lines, but only if the step axis is not stretched - if(!labelAxis.options.stretch) { - projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1); - } - // Using bi-polar offset for multiple series if no stacked bars or series distribution is used - projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1); - } - - // Enter value in stacked bar values used to remember previous screen value for stacking up bars - previousStack = stackedBarValues[valueIndex] || zeroPoint; - stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]); - - // Skip if value is undefined - if(value === undefined) { - return; - } - - var positions = {}; - positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos]; - positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos]; - - if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) { - // Stack mode: accumulate (default) - // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line - // We want backwards compatibility, so the expected fallback without the 'stackMode' option - // to be the original behaviour (accumulate) - positions[labelAxis.counterUnits.pos + '1'] = previousStack; - positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex]; - } else { - // Draw from the zero line normally - // This is also the same code for Stack mode: overlap - positions[labelAxis.counterUnits.pos + '1'] = zeroPoint; - positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos]; - } - - // Limit x and y so that they are within the chart rect - positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2); - positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2); - positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1); - positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1); - - // Create bar element - bar = seriesElement.elem('line', positions, options.classNames.bar).attr({ - 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','), - 'ct:meta': Chartist.getMetaData(series, valueIndex) - }); - - this.eventEmitter.emit('draw', Chartist.extend({ - type: 'bar', - value: value, - index: valueIndex, - meta: Chartist.getMetaData(series, valueIndex), - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - chartRect: chartRect, - group: seriesElement, - element: bar - }, positions)); - }.bind(this)); - }.bind(this)); - - this.eventEmitter.emit('created', { - bounds: valueAxis.bounds, - chartRect: chartRect, - axisX: axisX, - axisY: axisY, - svg: this.svg, - options: options - }); - } - - /** - * This method creates a new bar chart and returns API object that you can use for later changes. - * - * @memberof Chartist.Bar - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object that needs to consist of a labels and a series array - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object which exposes the API for the created chart - * - * @example - * // Create a simple bar chart - * var data = { - * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object. - * new Chartist.Bar('.ct-chart', data); - * - * @example - * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10 - * new Chartist.Bar('.ct-chart', { - * labels: [1, 2, 3, 4, 5, 6, 7], - * series: [ - * [1, 3, 2, -5, -3, 1, -6], - * [-5, -2, -4, -1, 2, -3, 1] - * ] - * }, { - * seriesBarDistance: 12, - * low: -10, - * high: 10 - * }); - * - */ - function Bar(query, data, options, responsiveOptions) { - Chartist.Bar['super'].constructor.call(this, - query, - data, - defaultOptions, - Chartist.extend({}, defaultOptions, options), - responsiveOptions); - } - - // Creating bar chart type in Chartist namespace - Chartist.Bar = Chartist.Base.extend({ - constructor: Bar, - createChart: createChart - }); - -}(window, document, Chartist)); -; -return Chartist; - -})); - -(function (root, factory) { - // if (typeof define === 'function' && define.amd) { - // // AMD. Register as an anonymous module. - // define([], function () { - // return (root.returnExportsGlobal = factory()); - // }); - // } else if (typeof exports === 'object') { - // // Node. Does not work with strict CommonJS, but - // // only CommonJS-like enviroments that support module.exports, - // // like Node. - // module.exports = factory(); - // } else { - root['Chartist.plugins.ctAxisTitle'] = factory(); - // } -}(this, function () { - - /** - * Chartist.js plugin to display a title for 1 or 2 axises. - * - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - var axisDefaults = { - axisTitle: '', - axisClass: 'ct-axis-title', - offset: { - x: 0, - y: 0 - }, - textAnchor: 'middle', - flipText: false - }; - var defaultOptions = { - axisX: axisDefaults, - axisY: axisDefaults - }; - - Chartist.plugins = Chartist.plugins || {}; - Chartist.plugins.ctAxisTitle = function (options) { - - options = Chartist.extend({}, defaultOptions, options); - - return function ctAxisTitle(chart) { - - chart.on('created', function (data) { - // - // if (!options.axisX.axisTitle && !options.axisY.axisTitle) { - // throw new Error('ctAxisTitle plugin - You must provide at least one axis title'); - // } else if (!data.axisX && !data.axisY) { - // throw new Error('ctAxisTitle plugin can only be used on charts that have at least one axis'); - // } - - var xPos; - var yPos; - var title; - - //position axis X title - if (options.axisX.axisTitle && data.axisX) { - - xPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left; - - yPos = data.options.chartPadding.top; - - if (data.options.axisY.position === 'end') { - xPos -= data.options.axisY.offset; - } - - if (data.options.axisX.position === 'end') { - yPos += data.axisY.axisLength; - } - - title = new Chartist.Svg("text"); - title.addClass(options.axisX.axisClass); - title.text(options.axisX.axisTitle); - title.attr({ - x: xPos + options.axisX.offset.x, - y: yPos + options.axisX.offset.y, - "text-anchor": options.axisX.textAnchor - }); - - data.svg.append(title, true); - - } - - //position axis Y title - if (options.axisY.axisTitle && data.axisY) { - xPos = 0; - - - yPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top; - - if (data.options.axisX.position === 'start') { - yPos += data.options.axisX.offset; - } - - if (data.options.axisY.position === 'end') { - xPos = data.axisX.axisLength; - } - - var transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')'; - - title = new Chartist.Svg("text"); - title.addClass(options.axisY.axisClass); - title.text(options.axisY.axisTitle); - title.attr({ - x: xPos + options.axisY.offset.x, - y: yPos + options.axisY.offset.y, - transform: transform, - "text-anchor": options.axisY.textAnchor - }); - - data.svg.append(title, true); - - } - - }); - }; - }; - - }(window, document, Chartist)); - - return Chartist.plugins.ctAxisTitle; - -})); - -(function (root, factory) { - // if (typeof define === 'function' && define.amd) { - // // AMD. Register as an anonymous module. - // define([], function () { - // return (root.returnExportsGlobal = factory()); - // }); - // } else if (typeof exports === 'object') { - // // Node. Does not work with strict CommonJS, but - // // only CommonJS-like enviroments that support module.exports, - // // like Node. - // module.exports = factory(); - // } else { - root['Chartist.plugins.zoom'] = factory(); - // } -}(this, function () { - - /** - * Chartist.js zoom plugin. - * - */ - (function (window, document, Chartist) { - 'use strict'; - - var defaultOptions = { - // onZoom - // resetOnRightMouseBtn - }; - - - Chartist.plugins = Chartist.plugins || {}; - Chartist.plugins.zoom = function (options) { - - options = Chartist.extend({}, defaultOptions, options); - - return function zoom(chart) { - - if (!(chart instanceof Chartist.Line)) { - return; - } - - var rect, svg, axisX, axisY, chartRect; - var downPosition; - var onZoom = options.onZoom; - var ongoingTouches = []; - - chart.on('draw', function (data) { - var type = data.type; - if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') { - data.element.attr({ - 'clip-path': 'url(#zoom-mask)' - }); - } - }); - - chart.on('created', function (data) { - axisX = data.axisX; - axisY = data.axisY; - chartRect = data.chartRect; - svg = data.svg._node; - rect = data.svg.elem('rect', { - x: 10, - y: 10, - width: 100, - height: 100, - }, 'ct-zoom-rect'); - hide(rect); - - var defs = data.svg.querySelector('defs') || data.svg.elem('defs'); - var width = chartRect.width(); - var height = chartRect.height(); - - defs - .elem('clipPath', { - id: 'zoom-mask' - }) - .elem('rect', { - x: chartRect.x1, - y: chartRect.y2, - width: width, - height: height, - fill: 'white' - }); - - svg.addEventListener('mousedown', onMouseDown); - svg.addEventListener('mouseup', onMouseUp); - svg.addEventListener('mousemove', onMouseMove); - svg.addEventListener('touchstart', onTouchStart); - svg.addEventListener('touchmove', onTouchMove); - svg.addEventListener('touchend', onTouchEnd); - svg.addEventListener('touchcancel', onTouchCancel); - }); - - function copyTouch(touch) { - var p = position(touch, svg); - p.id = touch.identifier; - return p; - } - - function ongoingTouchIndexById(idToFind) { - for (var i = 0; i < ongoingTouches.length; i++) { - var id = ongoingTouches[i].id; - if (id === idToFind) { - return i; - } - } - return -1; - } - - function onTouchStart(event) { - var touches = event.changedTouches; - for (var i = 0; i < touches.length; i++) { - ongoingTouches.push(copyTouch(touches[i])); - } - - if (ongoingTouches.length > 1) { - rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); - show(rect); - } - } - - function onTouchMove(event) { - var touches = event.changedTouches; - for (var i = 0; i < touches.length; i++) { - var idx = ongoingTouchIndexById(touches[i].identifier); - ongoingTouches.splice(idx, 1, copyTouch(touches[i])); - } - - if (ongoingTouches.length > 1) { - rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); - show(rect); - event.preventDefault(); - } - } - - function onTouchCancel(event) { - removeTouches(event.changedTouches); - } - - function removeTouches(touches) { - for (var i = 0; i < touches.length; i++) { - var idx = ongoingTouchIndexById(touches[i].identifier); - if (idx >= 0) { - ongoingTouches.splice(idx, 1); - } - } - } - - function onTouchEnd(event) { - if (ongoingTouches.length > 1) { - zoomIn(getRect(ongoingTouches[0], ongoingTouches[1])); - } - removeTouches(event.changedTouches); - hide(rect); - } - - function onMouseDown(event) { - if (event.button === 0) { - downPosition = position(event, svg); - rect.attr(getRect(downPosition, downPosition)); - show(rect); - event.preventDefault(); - } - } - - var reset = function () { - chart.options.axisX.highLow = null; - chart.options.axisY.highLow = null; - chart.update(chart.data, chart.options); - }; - - function onMouseUp(event) { - if (event.button === 0) { - var box = getRect(downPosition, position(event, svg)); - zoomIn(box); - downPosition = null; - hide(rect); - event.preventDefault(); - } - else if (options.resetOnRightMouseBtn && event.button === 2) { - reset(); - event.preventDefault(); - } - } - - function zoomIn(rect) { - if (rect.width > 5 && rect.height > 5) { - var x1 = rect.x - chartRect.x1; - var x2 = x1 + rect.width; - var y2 = chartRect.y1 - rect.y; - var y1 = y2 - rect.height; - - var xLow = project(x1, axisX); - var xHigh = project(x2, axisX); - var yLow = project(y1, axisY); - var yHigh = project(y2, axisY); - - var explb = chart.options.explicitBounds; - if (!_.isUndefined(explb)) { - if (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow); - if (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh); - if (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow); - if (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh); - } - - chart.options.axisX.highLow = {low: xLow, high: xHigh}; - chart.options.axisY.highLow = {low: yLow, high: yHigh}; - - chart.update(chart.data, chart.options); - onZoom && onZoom(chart, reset); - } - } - - function onMouseMove(event) { - if (downPosition) { - var point = position(event, svg); - rect.attr(getRect(downPosition, point)); - event.preventDefault(); - } - } - }; - - }; - - function hide(rect) { - rect.attr({style: 'display:none'}); - } - - function show(rect) { - rect.attr({style: 'display:block'}); - } - - function getRect(firstPoint, secondPoint) { - var x = firstPoint.x; - var y = firstPoint.y; - var width = secondPoint.x - x; - var height = secondPoint.y - y; - if (width < 0) { - width = -width; - x = secondPoint.x; - } - if (height < 0) { - height = -height; - y = secondPoint.y; - } - return { - x: x, - y: y, - width: width, - height: height - }; - } - - function position(event, svg) { - return transform(event.clientX, event.clientY, svg); - } - - function transform(x, y, svgElement) { - var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement; - var matrix = svg.getScreenCTM(); - var point = svg.createSVGPoint(); - point.x = x; - point.y = y; - point = point.matrixTransform(matrix.inverse()); - return point || {x: 0, y: 0}; - } - - function project(value, axis) { - var max = axis.bounds.max; - var min = axis.bounds.min; - if (axis.scale && axis.scale.type === 'log') { - var base = axis.scale.base; - return Math.pow(base, - value * baseLog(max / min, base) / axis.axisLength) * min; - } - return (value * axis.bounds.range / axis.axisLength) + min; - } - - function baseLog(val, base) { - return Math.log(val) / Math.log(base); - } - - }(window, document, Chartist)); - return Chartist.plugins.zoom; - -})); - -/** - * @license - * lodash 4.6.1 (Custom Build) - * Build: `lodash include="range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined" exports="global" -d` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.6.1'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - NAN = 0 / 0; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, - reUnescapedHtml = /[&<>"'`]/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - - /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dateTag] = typedArrayTags[errorTag] = - typedArrayTags[funcTag] = typedArrayTags[mapTag] = - typedArrayTags[numberTag] = typedArrayTags[objectTag] = - typedArrayTags[regexpTag] = typedArrayTags[setTag] = - typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = - cloneableTags[dateTag] = cloneableTags[float32Tag] = - cloneableTags[float64Tag] = cloneableTags[int8Tag] = - cloneableTags[int16Tag] = cloneableTags[int32Tag] = - cloneableTags[mapTag] = cloneableTags[numberTag] = - cloneableTags[objectTag] = cloneableTags[regexpTag] = - cloneableTags[setTag] = cloneableTags[stringTag] = - cloneableTags[symbolTag] = cloneableTags[uint8Tag] = - cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = - cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - '`': '`' - }; - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** Detect free variable `exports`. */ - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - - /** Detect free variable `module`. */ - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = (freeModule && freeModule.exports === freeExports) - ? freeExports - : undefined; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - - /*--------------------------------------------------------------------------*/ - - /** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ - function addMapEntry(map, pair) { - // Don't return `Map#set` because it doesn't return the map instance in IE 11. - map.set(pair[0], pair[1]); - return map; - } - - /** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ - function addSetEntry(set, value) { - set.add(value); - return set; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Converts `map` to an array. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** - * Converts `set` to an array. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } - - /*--------------------------------------------------------------------------*/ - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = Function.prototype.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototypeOf = Object.getPrototypeOf, - getOwnPropertySymbols = Object.getOwnPropertySymbols, - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeKeys = Object.keys, - nativeMax = Math.max; - - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /** Used to detect maps, sets, and weakmaps. */ - var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chaining. Methods that operate on and return arrays, collections, and - * functions can be chained together. Methods that retrieve a single value or - * may return a primitive value will automatically end the chain sequence and - * return the unwrapped value. Otherwise, the value must be unwrapped with - * `_#value`. - * - * Explicit chaining, which must be unwrapped with `_#value` in all cases, - * may be enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization to merge iteratee calls; this avoids the creation - * of intermediate arrays and can greatly reduce the number of iteratee executions. - * Sections of a chain sequence qualify for shortcut fusion if the section is - * applied to an array of at least two hundred elements and any iteratees - * accept only one argument. The heuristic for whether a section qualifies - * for shortcut fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`, - * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`, - * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`, - * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, - * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, - * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, - * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, - * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, - * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`, - * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, - * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, - * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, - * `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`, - * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`, - * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, - * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`, - * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`, - * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`, - * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`, - * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, - * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`, - * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, - * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, - * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`, - * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`, - * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`, - * `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash() { - // No operation performed. - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an hash object. - * - * @private - * @constructor - * @returns {Object} Returns the new hash object. - */ - function Hash() {} - - /** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function MapCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapClear() { - this.__data__ = { - 'hash': new Hash, - 'map': Map ? new Map : [], - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. - */ - function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = { 'array': [], 'map': null }; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. - */ - function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; - } - - /** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; - } - - /** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; - } - - /** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the array-like object. - */ - function baseCastFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ - function baseCastPath(value) { - return isArray(value) ? value : stringToPath(value); - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - result = baseAssign(result, value); - return isFull ? copySymbols(value, result) : result; - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return (isFull && !isArr) ? copySymbols(value, result) : result; - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = isKey(path, object) ? [path + ''] : baseCastPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[path[index++]]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); - } - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return key in Object(object); - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = getTag(object); - objTag = objTag == argsTag ? objectTag : objTag; - } - if (!othIsArr) { - othTag = getTag(other); - othTag = othTag == argsTag ? objectTag : othTag; - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; - - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) - : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); - } - if (!(bitmask & PARTIAL_COMPARE_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - stack || (stack = new Stack); - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, equalFunc, customizer, bitmask, stack); - } - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack, - result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) - : result - )) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - var type = typeof value; - if (type == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (type == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; - - return function(object) { - if (object == null) { - return false; - } - return object[key] === value && - (value !== undefined || (key in Object(object))); - }; - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. - */ - function baseMatchesProperty(path, srcValue) { - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments to numbers. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the new array of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; - } - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @returns {Object} Returns the cloned map. - */ - function cloneMap(map) { - return arrayReduce(mapToArray(map), addMapEntry, new map.constructor); - } - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - /** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @returns {Object} Returns the cloned set. - */ - function cloneSet(set) { - return arrayReduce(setToArray(set), addSetEntry, new set.constructor); - } - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object) { - return copyObjectWith(source, props, object); - } - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : source[key]; - - assignValue(object, key, newValue); - } - return object; - } - - /** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toNumber(start); - start = start === start ? start : 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = toNumber(end) || 0; - } - step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); - return baseRange(start, end, step, fromRight); - }; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(array, other); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); - })) { - result = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - result = false; - break; - } - } - stack['delete'](array); - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { - switch (tag) { - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - // Recursively compare objects (susceptible to call stack limits). - return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other)); - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(object, other); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - return result; - } - - /** - * Gets the appropriate "iteratee" function. If the `_.iteratee` method is - * customized this function returns the custom method, otherwise it returns - * `baseIteratee`. If arguments are provided the chosen function is invoked - * with them and its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = toPairs(object), - length = result.length; - - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; - } - - /** - * Creates an array of the own symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = getOwnPropertySymbols || function() { - return []; - }; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function getTag(value) { - return objectToString.call(value); - } - - // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. - if ((Map && getTag(new Map) != mapTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case mapCtorString: return mapTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - if (object == null) { - return false; - } - var result = hasFunc(object, path); - if (!result && !isKey(path)) { - path = baseCastPath(path); - object = parent(object, path); - if (object != null) { - path = last(path); - result = hasFunc(object, path); - } - } - var length = object ? object.length : undefined; - return result || ( - !!length && isLength(length) && isIndex(path, length) && - (isArray(object) || isString(object) || isArguments(object)) - ); - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototypeOf(object)) - : {}; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object); - - case symbolTag: - return cloneSymbol(object); - } - } - - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (typeof value == 'number') { - return true; - } - return !isArray(value) && - (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object))); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || - (type == 'string' && value != '__proto__') || value == null; - } - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); - } - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - function stringToPath(string) { - var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - - /*------------------------------------------------------------------------*/ - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(value) { - * console.log(value); - * }); - * // => logs `1` then `2` - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ - function forEach(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEach(collection, iteratee) - : baseEach(collection, baseCastFunction(iteratee)); - } - - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = !Buffer ? constant(false) : function(value) { - return value instanceof Buffer; - }; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && objectToString.call(value) == numberTag); - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (value == null) { - return ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return hasPath(object, path, baseHasIn); - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; - } - - /** - * Creates an array of own enumerable key-value pairs for `object` which - * can be consumed by `_.fromPairs`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - function toPairs(object) { - return baseToPairs(object, keys(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of - * attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** - * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their - * corresponding characters. - * - * **Note:** No other HTML entities are unescaped. To unescape additional HTML - * entities use a third-party library like [_he_](https://mths.be/he). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to unescape. - * @returns {string} Returns the unescaped string. - * @example - * - * _.unescape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function unescape(string) { - string = toString(string); - return (string && reHasEscapedHtml.test(string)) - ? string.replace(reEscapedHtml, unescapeHtmlChar) - : string; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. - * @example - * - * var object = { 'user': 'fred' }; - * var getter = _.constant(object); - * - * getter() === object; - * // => true - */ - function constant(value) { - return function() { - return value; - }; - } - - /** - * This method returns the first argument given to it. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ - function identity(value) { - return value; - } - - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object - * properties, otherwise it returns `false`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - function iteratee(func) { - return baseIteratee(typeof func == 'function' ? func : baseClone(func, true)); - } - - /** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - * @example - * - * var objects = [ - * { 'a': { 'b': { 'c': 2 } } }, - * { 'a': { 'b': { 'c': 1 } } } - * ]; - * - * _.map(objects, _.property('a.b.c')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); - * // => [1, 2] - */ - function property(path) { - return isKey(path) ? baseProperty(path) : basePropertyDeep(path); - } - - /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified - * it's set to `start` with `start` then set to `0`. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @category Util - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. - * @example - * - * _.range(4); - * // => [0, 1, 2, 3] - * - * _.range(-4); - * // => [0, -1, -2, -3] - * - * _.range(1, 5); - * // => [1, 2, 3, 4] - * - * _.range(0, 20, 5); - * // => [0, 5, 10, 15] - * - * _.range(0, -4, -1); - * // => [0, -1, -2, -3] - * - * _.range(1, 4, 0); - * // => [1, 1, 1] - * - * _.range(0); - * // => [] - */ - var range = createRange(); - - /*------------------------------------------------------------------------*/ - - // Avoid inheriting from `Object.prototype` when possible. - Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - - // Add functions to the `MapCache`. - MapCache.prototype.clear = mapClear; - MapCache.prototype['delete'] = mapDelete; - MapCache.prototype.get = mapGet; - MapCache.prototype.has = mapHas; - MapCache.prototype.set = mapSet; - - // Add functions to the `Stack` cache. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - // Add functions that return wrapped values when chaining. - lodash.constant = constant; - lodash.iteratee = iteratee; - lodash.keys = keys; - lodash.map = map; - lodash.property = property; - lodash.range = range; - lodash.toPairs = toPairs; - - /*------------------------------------------------------------------------*/ - - // Add functions that return unwrapped values when chaining. - lodash.eq = eq; - lodash.escape = escape; - lodash.escapeRegExp = escapeRegExp; - lodash.forEach = forEach; - lodash.get = get; - lodash.hasIn = hasIn; - lodash.identity = identity; - lodash.isArguments = isArguments; - lodash.isArray = isArray; - lodash.isArrayLike = isArrayLike; - lodash.isArrayLikeObject = isArrayLikeObject; - lodash.isBuffer = isBuffer; - lodash.isFunction = isFunction; - lodash.isLength = isLength; - lodash.isNative = isNative; - lodash.isNumber = isNumber; - lodash.isObject = isObject; - lodash.isObjectLike = isObjectLike; - lodash.isString = isString; - lodash.isSymbol = isSymbol; - lodash.isTypedArray = isTypedArray; - lodash.isUndefined = isUndefined; - lodash.last = last; - lodash.replace = replace; - lodash.toNumber = toNumber; - lodash.toString = toString; - lodash.unescape = unescape; - - // Add aliases. - lodash.each = forEach; - - /*------------------------------------------------------------------------*/ - - /** - * The semantic version number. - * - * @static - * @memberOf _ - * @type {string} - */ - lodash.VERSION = VERSION; - - /*--------------------------------------------------------------------------*/ - - // Expose lodash on the free variable `window` or `self` when available. This - // prevents errors in cases where lodash is loaded by a script tag in the presence - // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details. - (freeWindow || freeSelf || {})._ = lodash; - - // Export to the global object. - root._ = lodash; -}.call(this)); - -function bool(x) { - return (x === 1 || x === '1' || x === true || x === 'true'); -} - -function numfmt(x, places) { - var pow = Math.pow(10, places); - return Math.round(x*pow) / pow; -} - -function estimateLoadTime(fs, n) { - return (1000/fs)*n+1500; -} - -function msNow() { - return +(new Date); -} - -function msElapsed(start) { - return msNow() - start; -} - -Math.log10 = Math.log10 || function(x) { - return Math.log(x) / Math.LN10; -}; - -/** - * Perform a substitution in the given string. - * - * Arguments - array or list of replacements. - * Arguments numeric keys will replace {0}, {1} etc. - * Named keys also work, ie. {foo: "bar"} -> replaces {foo} with bar. - * - * Braces are added to keys if missing. - * - * @returns {String} result - */ -String.prototype.format = function () { - var out = this; - - var repl = arguments; - - if (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) { - repl = arguments[0]; - } - - for (var ph in repl) { - if (repl.hasOwnProperty(ph)) { - var ph_orig = ph; - - if (!ph.match(/^\{.*\}$/)) { - ph = '{' + ph + '}'; - } - - // replace all occurrences - var pattern = new RegExp(_.escapeRegExp(ph), "g"); - out = out.replace(pattern, repl[ph_orig]); - } - } - - return out; -}; - -/** Module for toggling a modal overlay */ -var modal = (function () { - var modal = {}; - - modal.show = function (sel) { - var $m = $(sel); - $m.removeClass('hidden visible'); - setTimeout(function () { - $m.addClass('visible'); - }, 1); - }; - - modal.hide = function (sel) { - var $m = $(sel); - $m.removeClass('visible'); - setTimeout(function () { - $m.addClass('hidden'); - }, 500); // transition time - }; - - modal.init = function () { - // close modal by click outside the dialog - $('.Modal').on('click', function () { - if ($(this).hasClass('no-close')) return; // this is a no-close modal - modal.hide(this); - }); - - $('.Dialog').on('click', function (e) { - e.stopImmediatePropagation(); - }); - - // Hide all modals on esc - $(window).on('keydown', function (e) { - if (e.which == 27) { - modal.hide('.Modal'); - } - }); - }; - - return modal; -})(); - -var notify = (function () { - var nt = {}; - var sel = '#notif'; - - var hideTmeo1; - var hideTmeo2; - - nt.show = function (message, timeout) { - $(sel).html(message); - modal.show(sel); - - clearTimeout(hideTmeo1); - clearTimeout(hideTmeo2); - - if (!_.isUndefined(timeout)) { - hideTmeo1 = setTimeout(nt.hide, timeout); - } - }; - - nt.hide = function () { - var $m = $(sel); - $m.removeClass('visible'); - hideTmeo2 = setTimeout(function () { - $m.addClass('hidden'); - }, 250); // transition time - }; - - nt.init = function() { - $(sel).on('click', function() { - nt.hide(this); - }); - }; - - return nt; -})(); - -// requires other modules... - -// - utils.js -// - modal.js -// - wifi.js - -// all must be included after 3rd party libs - - -/** Global generic init */ -$().ready(function () { - - // loader dots... - setInterval(function () { - $('.anim-dots').each(function (x) { - var $x = $(x); - var dots = $x.html() + '.'; - if (dots.length == 5) dots = '.'; - $x.html(dots); - }); - }, 1000); - - $('input[type=number]').on('mousewheel', function(e) { - var val = +$(this).val(); - var step = +($(this).attr('step') || 1); - var min = $(this).attr('min'); - var max = $(this).attr('max'); - if(e.wheelDelta > 0) { - val += step; - } else { - val -= step; - } - if (!_.isUndefined(min)) val = Math.max(val, min); - if (!_.isUndefined(max)) val = Math.min(val, max); - $(this).val(val); - - if ("createEvent" in document) { - var evt = document.createEvent("HTMLEvents"); - evt.initEvent("change", false, true); - $(this)[0].dispatchEvent(evt); - } else { - $(this)[0].fireEvent("onchange"); - } - - e.preventDefault(); - }); - - modal.init(); - notify.init(); -}); - - -function errorMsg(msg, time) { - notify.show(msg, time || 3000); -} - -/** Wifi page */ -var page_wifi = (function () { - var wifi = {}; - var authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2']; - - /** Update display for received response */ - function onScan(resp, status) { - if (status != 200) { - // bad response - rescan(5000); // wait 5sm then retry - return; - } - - resp = JSON.parse(resp); - - var done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0); - rescan(done ? 15000 : 1000); - if (!done) return; // no redraw yet - - // clear the AP list - var $list = $('#ap-list'); - // remove old APs - $('.AP').remove(); - - $list.toggle(done); - $('#ap-loader').toggle(!done); - - // scan done - resp.result.APs - .sort(function (a, b) { - return b.rssi - a.rssi - }) - .forEach(function (ap) { - ap.enc = parseInt(ap.enc); - - if (ap.enc > 4) return; // hide unsupported auths - - var item = document.createElement('div'); - - var $item = $(item) - .data('ssid', ap.essid) - .data('pwd', ap.enc != 0) - .addClass('AP'); - - // mark current SSID - if (ap.essid == wifi.current) { - $item.addClass('selected'); - } - - var inner = document.createElement('div'); - var $inner = $(inner).addClass('inner') - .htmlAppend('
{0}
'.format(ap.rssi_perc)) - .htmlAppend('
{0}
'.format(_.escape(ap.essid))) - .htmlAppend('
{0}
'.format(authStr[ap.enc])); - - $item.on('click', function () { - var $th = $(this); - - // populate the form - $('#conn-essid').val($th.data('ssid')); - $('#conn-passwd').val(''); // clear - - if ($th.data('pwd')) { - // this AP needs a password - modal.show('#psk-modal'); - } else { - $('#conn-form').submit(); - } - }); - - - item.appendChild(inner); - $list[0].appendChild(item); - }); - } - - /** Ask the CGI what APs are visible (async) */ - function scanAPs() { - $().get(_root+'/wifi/scan', onScan); // no cache, no jsonp - } - - function rescan(time) { - setTimeout(scanAPs, time); - } - - /** Set up the WiFi page */ - wifi.init = function () { - //var ap_json = { - // "result": { - // "inProgress": "0", - // "APs": [ - // {"essid": "Chlivek", "bssid": "88:f7:c7:52:b3:99", "rssi": "204", "enc": "4", "channel": "1"}, - // {"essid": "TyNikdy", "bssid": "5c:f4:ab:0d:f1:1b", "rssi": "164", "enc": "3", "channel": "1"}, - // ] - // } - //}; - - scanAPs(); - }; - - return wifi; -})(); - -var page_waveform = (function () { - var wfm = {}; - - var zoomResetFn; - var dataFormat; - - var readoutPending = false; - var autoReload = false; - var autoReloadTime = 1; - var arTimeout = -1; - - var lastLoadMs; - - var zoomSavedX, zoomSavedY; - - var readXhr; // read xhr - - var opts = { - count: 0, // sample count - freq: 0 // sampling freq - }; - - function buildChart(j) { - // Build the chart - var mql = window.matchMedia('screen and (min-width: 544px)'); - var isPhone = !mql.matches; - - var fft = (j.stats.format == 'FFT'); - - var xLabel, yLabel; - if (fft) { - xLabel = 'Frequency - [ Hz ]'; - yLabel = 'Magnitude - [ mA ]'; - } else { - xLabel = 'Sample time - [ ms ]'; - yLabel = 'Current - [ mA ]'; - } - - var peak = Math.max(-j.stats.min, j.stats.max); - var displayPeak = Math.max(peak, 10); - - // Sidebar - - $('#stat-count').html(j.stats.count); - $('#stat-f-s').html(numfmt(j.stats.freq, 2)); - $('#stat-i-peak').html(numfmt(peak, 2)); - $('#stat-i-rms').html(numfmt(j.stats.rms, 2)); - $('.stats').removeClass('invis'); - - // --- chart --- - - // Generate point entries - // add synthetic properties - var step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq); - var points = _.map(j.samples, function (a, i) { - return { - x: i * step, - y: a - }; - }); - - var plugins = [ - Chartist.plugins.zoom({ - resetOnRightMouseBtn: true, - onZoom: function (chart, reset) { - zoomResetFn = reset; - - zoomSavedX = chart.options.axisX.highLow; - zoomSavedY = chart.options.axisY.highLow; - } - }) - ]; - - if (!isPhone) plugins.push( // larger than phone - Chartist.plugins.ctAxisTitle({ - axisX: { - axisTitle: xLabel, - offset: { - x: 0, - y: 55 - } - }, - axisY: { - axisTitle: yLabel, - flipText: true, - offset: { - x: 0, - y: 15 - } - } - }) - ); - - var xHigh, xLow, yHigh, yLow; - - if (zoomSavedX) { - // we have saved coords of the zoom rect, restore the zoom. - xHigh = zoomSavedX.high; - xLow = zoomSavedX.low; - yHigh = zoomSavedY.high; - yLow = zoomSavedY.low; - } else { - yHigh = fft ? undefined : displayPeak; - yLow = fft ? 0 : -displayPeak; - } - - new Chartist.Line('#chart', { - series: [ - { - name: 'a', - data: points - }, - ] - }, { - showPoint: false, - showArea: fft, - fullWidth: true, - chartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}), - series: { - 'a': { - lineSmooth: Chartist.Interpolation.monotoneCubic() - } - }, - axisX: { - type: Chartist.AutoScaleAxis, - //onlyInteger: !fft // only for raw - high: xHigh, - low: xLow, - }, - axisY: { - type: Chartist.AutoScaleAxis, - //onlyInteger: true - high: yHigh, - low: yLow, - }, - explicitBounds: { - xLow: 0, - yLow: fft ? 0 : undefined, - xHigh: points[points.length-1].x - }, - plugins: plugins - }); - } - - function onRxData(resp, status) { - readoutPending = false; - - if (status != 200) { - errorMsg("Request failed.", 1000); - } else { - var j = JSON.parse(resp); - if (!j.success) { - errorMsg("Sampling failed.", 1000); - } else { - buildChart(j); - } - } - - if (autoReload) - arTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs))); - } - - function readInputs() { - opts.count = $('#count').val(); - opts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s - } - - function requestReload() { - if (readoutPending) { - errorMsg("Request already pending - aborting."); - readXhr.abort(); - } - - readoutPending = true; - lastLoadMs = msNow(); - - var n = opts.count; - var fs = opts.freq; - var url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs; - readXhr = $().get(url, onRxData, estimateLoadTime(fs,n)); - - return true; - } - - function toggleAutoReload() { - autoReloadTime = +$('#ar-time').val(); // ms - - readInputs(); - - autoReload = !autoReload; - if (autoReload) { - requestReload(); - } else { - clearTimeout(arTimeout); - } - - $('#ar-btn') - .toggleClass('btn-blue') - .toggleClass('btn-red') - .val(autoReload ? 'Stop' : 'Auto'); - } - - wfm.init = function (format) { - // --- Load data --- - dataFormat = format; - - function onLoadClick() { - readInputs(); - requestReload(); - } - - $('#load').on('click', onLoadClick); - - $('#count,#freq').on('keyup', function (e) { - if (e.which == 13) { - onLoadClick(); - } - }); - - // --- zooming --- - - $('#chart').on('contextmenu', function (e) { // right click on the chart -> reset - zoomResetFn && zoomResetFn(); - zoomResetFn = null; - - zoomSavedX = null; - zoomSavedY = null; - - e.preventDefault(); - return false; - }); - - // auto-reload button - $('#ar-btn').on('click', toggleAutoReload); - }; - - return wfm; -})(); - -var page_spectrogram = (function () { - var sg = {}; - - var ctx; - - // drawing area - var plot = { - x:50, - y:10, - w:740,//860 total - h:512, - dx: 1, // bin - dy: 1 - }; - - var opts = { - interval: 0, - sampCount: 0, - freq:0 - }; - - var interval = 1000; - var running = false; - var readTimeout; // timer - var readoutPending; - var readXhr; - - var lastLoadMs; - var lastMarkMs; - var lastMark10s; - - var colormap = [ - /* [val, r, g, b] */ - [0.00, 0, 0, 0], - [0.10, 41, 17, 41], - [0.25, 34, 17, 78], - [0.6, 17, 30, 105], - [1.0, 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.90, 223, 217, 86], - [1.97, 248, 222, 176], - [1.99, 255, 237, 222], - [2.00, 255, 255, 255], - ]; - - function val2color(val) { - var x1, x2, c1, c2; - - val = Math.log10(1+val); - - if (val > 2) val = 2; - if (val < 0) val = 0; - - for (var i = 0; i < colormap.length; i++) { - var c = colormap[i]; - var point = c[0]; - if (val >= point) { - x1 = point; - c1 = c; - } - - if (val <= point) { - x2 = point; - c2 = c; - break; - } - } - - var rate = ((val - x1)/(x2 - x1)); - if (x1 == x2) rate=0; - - var r = Math.round((c1[1] + (c2[1] - c1[1])*rate)); - var g = Math.round((c1[2] + (c2[2] - c1[2])*rate)); - var b = Math.round((c1[3] + (c2[3] - c1[3])*rate)); - return 'rgb('+r+','+g+','+b+')'; - } - - function shiftSg() { - var imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10); - - ctx.fillStyle = 'black'; - ctx.fillRect(plot.x, plot.y, plot.w, plot.h); - ctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box - - ctx.putImageData(imageData, plot.x, plot.y); - } - - function drawSg(col) { - shiftSg(); - - var bc = opts.sampCount/2; - for (var i = 0; i < bc; i++) { - // resolve color from the value - var clr; - - if (i*plot.dy > plot.h) { - break; - } - - if (i > col.length) { - clr = '#000'; - } else { - clr = val2color(col[i]); - } - ctx.fillStyle = clr; - - var tx = plot.x+plot.w-plot.dx; - var ty = plot.y+plot.h-(i+1)*plot.dy; - var tw = plot.dx; - var th = plot.dy; - - if (ty= 950) { - lastMarkMs = msNow(); - - var long = false; - if (msElapsed(lastMark10s) > 9500) { - long = true; - lastMark10s = msNow(); - } - - ctx.strokeStyle = 'white'; - ctx.beginPath(); - ctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1); - ctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2)); - ctx.stroke(); - } - } - - - function onRxData(resp, status) { - readoutPending = false; - if (status == 200) { - try { - var j = JSON.parse(resp); - if (j.success) { - // display - drawSg(j.samples); - } else { - errorMsg("Sampling failed.", 1000); - } - } catch(e) { - errorMsg(e); - } - } else { - errorMsg("Request failed.", 1000); - } - - if (running) - readTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time. - } - - function requestData() { - if (readoutPending) { - errorMsg("Request already pending - aborting."); - readXhr.abort(); - } - readoutPending = true; - lastLoadMs = msNow(); - - var fs = opts.freq; - var n = opts.sampCount; - var url = _root+'/measure/fft?n='+n+'&fs='+fs; - - readXhr = $().get(url, onRxData, estimateLoadTime(fs,n)); - - return true; - } - - function drawLegend() { - var gap = 8; - var barW = 10; - var barH = plot.h-12; - var barY = plot.y+6; - var barX = plot.x - gap - barW; - var vStep = (100 / barH); - for (var i = 0; i < barH; i++) { - var c1 = val2color(i * vStep); - var c2 = val2color((i + 1) * vStep); - - var y = Math.floor(barY + barH - (i + 1)); - - var gradient = ctx.createLinearGradient(0, y + 1, 0, y); - gradient.addColorStop(0, c1); - gradient.addColorStop(1, c2); - ctx.fillStyle = gradient; - - ctx.fillRect(barX, y, barW, 1); - } - - // border - ctx.strokeStyle = '#000'; - ctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1); - - vStep = (100 / barH); - ctx.font = '12px sans-serif'; - ctx.fillStyle = 'white'; - ctx.textAlign = 'right'; - for (var i = 0; i <= plot.h; i+=barH/10) { - ctx.fillText(Math.round(i*vStep)+"", plot.x - gap - barW - gap, barY+barH-i+3); - } - } - - function drawAxis() { - var gap = 8; - var rX0 = plot.x+plot.w; - var rX = rX0+gap; - var rY = plot.y; - var rH = plot.h; - var rW = 70; - ctx.clearRect(rX0+.5, rY-10, rW, rH+20); - - var perBin = (opts.freq/2) / (opts.sampCount/2); - - var totalBins = (plot.h / plot.dy); - var totalHz = totalBins*perBin; - - //console.log("perbin=",perBin,"totalBins=",totalBins,"totalHz=",totalHz); - - var step; - - // get the best step size - var steps = [10, 25, 50]; - var multiplier = 1; - var suc = false; - do { - for (var i = 0; i < steps.length; i++) { - if ((totalHz / (steps[i] * multiplier)) <= 21) { - step = (steps[i] * multiplier); - suc = true; - break; - } - } - if (suc) break; - multiplier *= 10; - } while (true); - - step = step/perBin; - - // every step-th bin has a label - ctx.font = '12px sans-serif'; - ctx.fillStyle = 'white'; - ctx.strokeStyle = 'white'; - ctx.textAlign = 'left'; - - // labels and dashes - for(var i = 0; i <= totalBins+step; i+= step) { - if (i >= totalBins) { - var dist = i - totalBins; - if (dist > step/2) break;// make sure not too close - i = totalBins; - } - - var hz = i*(totalHz/totalBins); - if (hz>=1000000) hz = numfmt(hz/1e6,2)+'M'; - else if (hz>=1000) hz = numfmt(hz/1e3,2)+'k'; - else hz = numfmt(hz,1); - - var yy = Math.round(rY+rH-(plot.dy*i)); - ctx.fillText(hz, rX, yy+4); - - ctx.beginPath(); - ctx.moveTo(rX0, yy+.5); - ctx.lineTo(rX0+gap/2, yy+.5); - ctx.stroke(); - - if (i >= totalBins) break; - } - - // Hz label - ctx.font = '16px sans-serif'; - ctx.save(); - ctx.translate(rX0+50, plot.y+plot.h/2); - ctx.rotate(Math.PI/2); - ctx.textAlign = "center"; - ctx.fillText("Frequency - [Hz]", 0, 0); - ctx.restore(); - } - - function readOpts() { - opts.interval = +$('#interval').val(); // ms - opts.freq = +$('#freq').val()*2; - opts.sampCount = +$('#count').val(); - - plot.dx = +$('#tile-x').val(); - plot.dy = +$('#tile-y').val(); - } - - function clearSgArea() { - ctx.fillStyle = '#000'; - ctx.fillRect(plot.x, plot.y, plot.w, plot.h); - ctx.strokeStyle = 'white'; - ctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1); - } - - sg.init = function () { - var canvas = $('#sg')[0]; - ctx = canvas.getContext('2d'); - - // CLS - clearSgArea(); - readOpts(); - drawLegend(); - drawAxis(); - lastMarkMs = msNow()-10000; - lastMark10s = msNow()-10000; - - // update tile size on bin count selection - $('#count').on('change', function() { - var count = +$('#count').val(); - var tile = Math.max(1, plot.h/(count/2)); - - $('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely) - $('#tile-y').val(tile); - }); - - // chain Y with X - $('#tile-y').on('change', function() { - $('#tile-x').val(Math.max(4,$(this).val())); - }); - - $('#go-btn').on('click', function() { - running = !running; - if (running) { - readOpts(); - drawAxis(); - - requestData(); - } else { - clearTimeout(readTimeout); - } - - $('#go-btn') - .toggleClass('btn-green') - .toggleClass('btn-red') - .html(running ? 'Stop' : 'Start'); - }); - }; - - return sg; -})(); - -var page_status = (function() { - var st = {}; - st.j = {}; - - var updateTime = 10000; - - var updateInhibited = false; - - st.trigReset = function() { - var modal_sel = '#reset-modal'; - $().get(_root + '/system/reset', function(resp, status) { - if (status == 200) { - - modal.show(modal_sel); - updateInhibited = true; - - var ping_i = setInterval(function() { - $().get(_root+'/system/ping', function(resp, code){ - if (code == 200) { - // device is ready - modal.hide(modal_sel); - requestUpdate(); - clearInterval(ping_i); - updateInhibited = false; - } - }, {timeout: 500}); - }, 1000); - } - }); - }; - - function onUpdate(resp, status) { - if (status != 200) { - // bad response - errorMsg('Update failed.'); - } else { - try { - // OK - var j = JSON.parse(resp); - st.j = j; // store for global access - - $('.sta-only').toggle(j.sta); - $('.ap-only').toggle(j.ap); - - $('#uptime').html(j.uptime); - $('#heap').html(j.heap + " bytes"); - $('#wmode').html(j.wifiMode); - - if (j.sta) { - $('#staSSID').html(j.sta.SSID); - $('#staRSSIperc').html(j.sta.RSSIperc); - $('#staRSSI').html(j.sta.RSSI); - $('#staMAC').html(j.sta.MAC); - } - - if (j.ap) { - $('#apSSID').html(j.ap.SSID); - $('#apHidden').html(j.ap.hidden ? "Yes" : "No"); - $('#apAuth').html(j.ap.auth); - - // hide the password row if auth is Open - $('.ap-auth-only').toggle(j.ap.auth != 'Open'); - - $('#apPwd').html(j.ap.pwd); - $('#apChan').html(j.ap.chan); - $('#apMAC').html(j.ap.MAC); - } - // chip ID & macs don't change - } catch(e) { - errorMsg(e); - } - } - - if (!updateInhibited) { - setTimeout(requestUpdate, updateTime); - } - } - - function requestUpdate() { - $().get(_root+'/system/status', onUpdate); - } - - st.init = function() { - requestUpdate(); - }; - - return st; -})(); - -var page_mon = (function() { - var mon = {}; - - function updRefInfoField(ok) { - $('#hasref').html(ok ? 'OK' : 'Not set!'); - } - - /** Capture reference & save to flash */ - mon.captureRef = function() { - $().get(_root + '/mon/setref', function(resp, status) { - if (status != 200) { - // bad response - errorMsg('Operation failed.'); - } else { - try { - // OK - var j = JSON.parse(resp); - updRefInfoField(j.success); - } catch(e) { - errorMsg(e); - updRefInfoField(false); - } - } - }); - }; - - /** Capture waveform and compare with reference */ - mon.compareNow = function() { - $().get(_root + '/mon/compare', function(resp, status) { - if (status != 200) { - // bad response - errorMsg('Operation failed.'); - } else { - try { - // OK - var j = JSON.parse(resp); - if (j.success) { - $('#refdist').html(numfmt(j.deviation, 2)); - } else { - errorMsg('Capture failed.'); - $('#refdist').html('--'); - } - } catch(e) { - errorMsg(e); - $('#refdist').html('--'); - } - } - }); - }; - - mon.init = function() { - // - }; - - return mon; -})(); - -//# sourceMappingURL=all.js.map +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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(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 g(e){if(0===e.button){var n=a(S,o(e,b));v(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(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",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return jn.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)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?ge: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!==ge||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!==ge)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?gt(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?gt(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:ge}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(;++ie&&(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);++re?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-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===ge}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?ge:F(t,e);return r===ge?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 ge,ve="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 gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,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:ge,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:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(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();g.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=ve,(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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?$("#refdist").html(numfmt(n.deviation,2)):(errorMsg("Capture failed."),$("#refdist").html("--"))}catch(r){errorMsg(r),$("#refdist").html("--")}})},e.init=function(){},e}(); \ No newline at end of file diff --git a/user/datalink.h b/user/datalink.h index 517360a..f03f5ab 100644 --- a/user/datalink.h +++ b/user/datalink.h @@ -7,6 +7,9 @@ // request to capture data... #define DG_REQUEST_RAW 40 #define DG_REQUEST_FFT 41 +// reporting helpers +#define DG_REQUEST_STORE_REF 42 +#define DG_REQUEST_COMPARE_REF 43 extern SBMP_Endpoint *dlnk_ep; diff --git a/user/page_monitoring.c b/user/page_monitoring.c new file mode 100644 index 0000000..35cc8ae --- /dev/null +++ b/user/page_monitoring.c @@ -0,0 +1,39 @@ +#include +#include +#include "page_monitoring.h" + +/** "Monitoring" page - fill form fields */ +int FLASH_FN tplMonitoring(HttpdConnData *connData, char *token, void **arg) +{ + // arg is unused + (void)arg; + + char buf[20]; + + if (token == NULL) return HTTPD_CGI_DONE; + + if (streq(token, "refStored")) { + httpdSend(connData, true ? "OK" : "Not set!", -1); // fixme + + } else if (streq(token, "repEnableCheck")) { + if (true) httpdSend(connData, "checked", -1); // fixme + + } else if (streq(token, "repInterval")) { + sprintf(buf, "%d", 123); // fixme + httpdSend(connData, buf, -1); + + } else if (streq(token, "repSvcCheckXv")) { // Xively + if (true) httpdSend(connData, "checked", -1); // fixme + + } else if (streq(token, "repSvcCheckTs")) { // ThingSpeak + if (true) httpdSend(connData, "checked", -1); // fixme + + } else if (streq(token, "repFeed")) { + httpdSend(connData, "null", -1); // fixme + + } else if (streq(token, "repKey")) { + httpdSend(connData, "null", -1); // fixme + } + + return HTTPD_CGI_DONE; +} diff --git a/user/page_monitoring.h b/user/page_monitoring.h new file mode 100644 index 0000000..3cd8991 --- /dev/null +++ b/user/page_monitoring.h @@ -0,0 +1,8 @@ +#ifndef PAGE_MONITORING_H +#define PAGE_MONITORING_H + +#include + +int tplMonitoring(HttpdConnData *connData, char *token, void **arg); + +#endif // PAGE_MONITORING_H diff --git a/user/reporting.c b/user/reporting.c new file mode 100644 index 0000000..edf4b53 --- /dev/null +++ b/user/reporting.c @@ -0,0 +1,103 @@ +#include "reporting.h" +#include "datalink.h" +#include "serial.h" + +#define RPT_CONF_MAGIC 0x24C595D5 + +ReportingResult rpt_result; +ReportingCfg rpt_conf; + +static os_timer_t rpt_tim; + +/** Timer cb */ +static void rpt_tim_cb(void *arg) +{ + (void)arg; + reporting_send_now(); +} + +/** Stop / start timer & set interval based on rpt conf */ +static void set_timer(void) +{ + os_timer_disarm(&rpt_tim); + + if (rpt_conf.enabled) { + os_timer_setfn(&rpt_tim, rpt_tim_cb, NULL); + os_timer_arm(&rpt_tim, (int)(rpt_conf.interval*1000), 1); + } +} + +/** Fix unterminated strings, add magic, etc.. */ +static void normalize_rpt_conf(void) +{ + // terminate strings + rpt_conf.feed[sizeof(rpt_conf.feed)-1] = 0; + rpt_conf.key[sizeof(rpt_conf.key)-1] = 0; + // set magic + rpt_conf.magic = RPT_CONF_MAGIC; +} + +/** Save reporting config to flash */ +void reporting_save(void) +{ + normalize_rpt_conf(); // fix weirdness + system_param_save_with_protect(0x3D, &rpt_conf, sizeof(ReportingCfg)); + + // start timer for the new interval time + set_timer(); +} + +/** Load the reporting config from flash */ +void reporting_load(void) +{ + system_param_load(0x3D, 0, &rpt_conf, sizeof(ReportingCfg)); + + if (rpt_conf.magic != RPT_CONF_MAGIC) { + // invalid config, zero out + memset(&rpt_conf, 0, sizeof(ReportingCfg)); + rpt_conf.magic = RPT_CONF_MAGIC; + + // save fixed + reporting_save(); + } + + set_timer(); +} + +void compare_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void **obj) +{ + (void)obj; + sbmp_ep_remove_listener(ep, dg->session); + + PayloadParser pp = pp_start(dg->payload, dg->length); + rpt_result.deviation = pp_float(&pp); + rpt_result.rms = pp_float(&pp); +} + +/** Immediately send report to xively / thingspeak */ +void reporting_send_now(void) +{ + uint16_t sesn; + sbmp_ep_send_message(dlnk_ep, DG_REQUEST_COMPARE_REF, NULL, 0, &sesn, NULL); + sbmp_ep_add_listener(dlnk_ep, sesn, compare_ref_cb, NULL); + + // poll & wait for response + const int timeout = 500; + for (uint32_t i = 0; i < timeout*100; i++) { + uart_poll(); // can stop measure & start first chunk, if rx offer + + // check for closed connection - aborted by peer? + if (meas_is_closed()) { + error("Session closed by peer, readout failed."); + return false; // assume already cleaned up + } + + if (meas_chunk_ready()) { + // yay!! + return true; + } + + os_delay_us(10); + system_soft_wdt_feed(); // Feed the dog, or it'll bite. + } +} diff --git a/user/reporting.h b/user/reporting.h new file mode 100644 index 0000000..ab16a53 --- /dev/null +++ b/user/reporting.h @@ -0,0 +1,45 @@ +#ifndef REPORTING_H +#define REPORTING_H + +#include + +typedef struct { + // 0 + bool enabled : 4; + // 4 + uint32_t interval; + // 8 + enum { + RPT_XIVELY, + RPT_THINGSPEAK + } service : 4; + // 12 + char feed[64]; + // 76 + char key[64]; + // 80 + uint32_t magic; +} ReportingCfg; + +/** Comapre result is stored here */ +typedef struct { + bool ready : 4; + float deviation; + float rms; +} ReportingResult; + +extern ReportingResult rpt_result; + +/** Reporting config struct */ +extern ReportingCfg rpt_conf; + +/** Save reporting config to flash */ +void reporting_save(void); + +/** Load the reporting config from flash */ +void reporting_load(void); + +/** Immediately send report to xively / thingspeak */ +void reporting_send_now(void); + +#endif // REPORTING_H diff --git a/user/routes.c b/user/routes.c index a836f9e..e250b7e 100644 --- a/user/routes.c +++ b/user/routes.c @@ -13,6 +13,7 @@ #include "page_status.h" #include "page_waveform.h" #include "page_about.h" +#include "page_monitoring.h" #include "cgi_reset.h" #include "cgi_ping.h" @@ -51,6 +52,7 @@ HttpdBuiltInUrl builtInUrls[] = { ROUTE_TPL_FILE("/", tplSystemStatus, "/pages/status.tpl"), ROUTE_TPL_FILE("/status", tplSystemStatus, "/pages/status.tpl"), ROUTE_TPL_FILE("/about", tplAbout, "/pages/about.tpl"), + ROUTE_TPL_FILE("/monitoring", tplMonitoring, "/pages/monitoring.tpl"), ROUTE_FILE("/waveform", "/pages/wfm.html"), // static file, html -> can use gzip ROUTE_FILE("/fft", "/pages/fft.html"), // static file, html -> can use gzip ROUTE_FILE("/spectrogram", "/pages/sgm.html"), // static file, html -> can use gzip From c620976902bf63a7017213909a6a77d1facab842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 18:44:04 +0200 Subject: [PATCH 06/11] work on the reporting Former-commit-id: 22df0fb4780da583ee956c45441fc15e9283eab1 --- esphttpclient/httpclient.c | 4 +- html/js/all.js | 2 +- html/pages/monitoring.tpl | 21 ++-- html_src/js-src/page_mon.js | 9 +- html_src/js/all.js | 2 +- html_src/js/all.js.map | 2 +- html_src/page_monitoring.php | 21 ++-- libesphttpd/core/httpd.c | 87 ++++++++-------- libesphttpd/core/httpdespfs.c | 12 +-- libesphttpd/include/cgiflash.h | 8 +- libesphttpd/include/cgiwebsocket.h | 9 +- libesphttpd/include/cgiwifi.h | 14 +-- libesphttpd/include/httpd.h | 37 ++++--- libesphttpd/include/httpdespfs.h | 6 +- libesphttpd/util/cgiflash.c | 8 +- libesphttpd/util/cgiwebsocket.c | 45 ++++---- libesphttpd/util/cgiwifi.c | 10 +- sbmp | 2 +- user/cgi_ping.c | 3 +- user/cgi_ping.h | 2 +- user/cgi_reset.c | 3 +- user/cgi_reset.h | 2 +- user/datalink.h | 1 + user/page_about.c | 2 +- user/page_about.h | 2 +- user/page_monitoring.c | 161 ++++++++++++++++++++++++++--- user/page_monitoring.h | 8 +- user/page_status.c | 2 +- user/page_status.h | 2 +- user/page_waveform.c | 8 +- user/page_waveform.h | 4 +- user/reporting.c | 135 ++++++++++++++++++++---- user/reporting.h | 19 ++-- user/routes.c | 4 + user/user_main.c | 7 +- 35 files changed, 467 insertions(+), 197 deletions(-) diff --git a/esphttpclient/httpclient.c b/esphttpclient/httpclient.c index 0dd6861..9a7d1ce 100644 --- a/esphttpclient/httpclient.c +++ b/esphttpclient/httpclient.c @@ -241,8 +241,8 @@ static void FLASH_FN sent_callback(void * arg) static void FLASH_FN connect_callback(void * arg) { info("Connected!"); - struct espconn * conn = (struct espconn *)arg; - request_args * req = (request_args *)conn->reserve; + struct espconn *conn = (struct espconn *)arg; + request_args *req = (request_args *)conn->reserve; espconn_regist_recvcb(conn, receive_callback); espconn_regist_sentcb(conn, sent_callback); diff --git a/html/js/all.js b/html/js/all.js index 6564426..385e9b1 100644 --- a/html/js/all.js +++ b/html/js/all.js @@ -1,3 +1,3 @@ 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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(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 g(e){if(0===e.button){var n=a(S,o(e,b));v(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(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",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return jn.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)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?ge: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!==ge||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!==ge)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?gt(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?gt(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:ge}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(;++ie&&(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);++re?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-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===ge}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?ge:F(t,e);return r===ge?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 ge,ve="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 gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,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:ge,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:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(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();g.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=ve,(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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?$("#refdist").html(numfmt(n.deviation,2)):(errorMsg("Capture failed."),$("#refdist").html("--"))}catch(r){errorMsg(r),$("#refdist").html("--")}})},e.init=function(){},e}(); \ No newline at end of file +$("#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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?($("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))):(errorMsg("Capture failed."),$("#actual-dev").html("--"),$("#actual-rms").html("--"))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},e.init=function(){},e}(); \ No newline at end of file diff --git a/html/pages/monitoring.tpl b/html/pages/monitoring.tpl index 340dc84..97661f5 100644 --- a/html/pages/monitoring.tpl +++ b/html/pages/monitoring.tpl @@ -36,9 +36,12 @@ - Actual distance: + Actual state: - N/A + + Δ = %curDeviation%, + Irms = %curRMS% mA + Measure @@ -47,36 +50,36 @@

Reporting

-
+ - + - + diff --git a/html_src/js-src/page_mon.js b/html_src/js-src/page_mon.js index 88299a6..ef96e20 100644 --- a/html_src/js-src/page_mon.js +++ b/html_src/js-src/page_mon.js @@ -35,14 +35,17 @@ var page_mon = (function() { // OK var j = JSON.parse(resp); if (j.success) { - $('#refdist').html(numfmt(j.deviation, 2)); + $('#actual-dev').html(numfmt(j.deviation, 2)); + $('#actual-rms').html(numfmt(j.rms, 2)); } else { errorMsg('Capture failed.'); - $('#refdist').html('--'); + $('#actual-dev').html('--'); + $('#actual-rms').html('--'); } } catch(e) { errorMsg(e); - $('#refdist').html('--'); + $('#actual-dev').html('--'); + $('#actual-rms').html('--'); } } }); diff --git a/html_src/js/all.js b/html_src/js/all.js index 6564426..385e9b1 100644 --- a/html_src/js/all.js +++ b/html_src/js/all.js @@ -1,3 +1,3 @@ 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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(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 g(e){if(0===e.button){var n=a(S,o(e,b));v(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(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",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return jn.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)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?ge: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!==ge||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!==ge)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?gt(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?gt(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:ge}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(;++ie&&(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);++re?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-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===ge}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?ge:F(t,e);return r===ge?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 ge,ve="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 gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,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:ge,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:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(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();g.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=ve,(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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?$("#refdist").html(numfmt(n.deviation,2)):(errorMsg("Capture failed."),$("#refdist").html("--"))}catch(r){errorMsg(r),$("#refdist").html("--")}})},e.init=function(){},e}(); \ No newline at end of file +$("#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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?($("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))):(errorMsg("Capture failed."),$("#actual-dev").html("--"),$("#actual-rms").html("--"))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},e.init=function(){},e}(); \ No newline at end of file diff --git a/html_src/js/all.js.map b/html_src/js/all.js.map index 6d195b2..2fc8fe2 100644 --- a/html_src/js/all.js.map +++ b/html_src/js/all.js.map @@ -1 +1 @@ -{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","lodash.custom.js","utils.js","modal.js","notif.js","app.js","page_wifi.js","page_waveform.js","page_spectrogram.js","page_status.js","page_mon.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC95HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\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}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\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\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (!_.isUndefined(value)) { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms\n\t\t\tvar xhr;\n\t\t\tvar\tquery = serializeData(nodes);\n\t\t\tvar\ttype = (method) ? method.toUpperCase() : 'GET';\n\t\t\tvar\tabortTmeo;\n\n\t\t\tif (_.isNumber(options)) options = {timeout: options};\n\n\t\t\tvar opts = Chartist.extend({}, {\n\t\t\t\tnocache: true,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tloader: true,\n\t\t\t}, options);\n\n\t\t\t//console.log('ajax to = ' + opts.timeout);\n\n\t\t\tif (query && (type === 'GET')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// FIXME the XHR sometimes seemingly silently fails\n\n\t\t\txhr = new XMLHttpRequest(); // we dont support IE < 9\n\n\t\t\tif (xhr) {\n\t\t\t\t// prevent caching\n\t\t\t\tif (opts.nocache) {\n\t\t\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t\t\t}\n\n\t\t\t\tif (opts.loader)\n\t\t\t\t\t$('#loader').addClass('show');\n\n\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\txhr.timeout = opts.timeout;\n\n\t\t\t\tabortTmeo = setTimeout(function () {\n\t\t\t\t\terrorMsg(\"XHR timed out.\");\n\t\t\t\t\txhr.abort();\n\t\t\t\t\tif (opts.loader) $('#loader').removeClass('show');\n\t\t\t\t}, opts.timeout + 10); // a bit later, but still.;\n\n\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\n\t\t\t\t\t\tif (opts.loader)\n\t\t\t\t\t\t\t$('#loader').removeClass('show');\n\n\t\t\t\t\t\tif (callback && xhr.status != 0) { // xhr.status 0 means \"aborted\"\n\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\tif (type === 'POST') {\n\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t}\n\n\t\t\t\txhr.send(query);\n\t\t\t}\n\n\t\t\treturn xhr;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback)\n\t\tcb.get = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'get', callback, opts);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback)\n\t\tcb.post = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'post', callback, opts);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n // Chartist.escapingMap = {\n // '&': '&',\n // '<': '<',\n // '>': '>',\n // '\"': '"',\n // '\\'': '''\n // };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return _.escape(data);\n\n // return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n // }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n // }, data);\n data = _.unescape(data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n // /**\n // * Calculate cartesian coordinates of polar coordinates\n // *\n // * @memberof Chartist.Core\n // * @param {Number} centerX X-axis coordinates of center point of circle segment\n // * @param {Number} centerY X-axis coordinates of center point of circle segment\n // * @param {Number} radius Radius of circle segment\n // * @param {Number} angleInDegrees Angle of circle segment in degrees\n // * @return {{x:Number, y:Number}} Coordinates of point on circumference\n // */\n // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n //\n // return {\n // x: centerX + (radius * Math.cos(angleInRadians)),\n // y: centerY + (radius * Math.sin(angleInRadians))\n // };\n // };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\n if (_.isNumber(lblText)) {\n lblText = Chartist.roundWithPrecision(lblText, 2);\n }\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n // /**\n // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n // *\n // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n // *\n // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n // *\n // * @example\n // * var chart = new Chartist.Line('.ct-chart', {\n // * labels: [1, 2, 3, 4, 5],\n // * series: [[1, 2, 8, 1, 7]]\n // * }, {\n // * lineSmooth: Chartist.Interpolation.cardinal({\n // * tension: 1,\n // * fillHoles: false\n // * })\n // * });\n // *\n // * @memberof Chartist.Interpolation\n // * @param {Object} options The options of the cardinal factory function.\n // * @return {Function}\n // */\n // Chartist.Interpolation.cardinal = function(options) {\n // var defaultOptions = {\n // tension: 1,\n // fillHoles: false\n // };\n //\n // options = Chartist.extend({}, defaultOptions, options);\n //\n // var t = Math.min(1, Math.max(0, options.tension)),\n // c = 1 - t;\n //\n // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // // This functionality is necessary to treat \"holes\" in the line charts\n // function splitIntoSegments(pathCoordinates, valueData) {\n // var segments = [];\n // var hole = true;\n //\n // for(var i = 0; i < pathCoordinates.length; i += 2) {\n // // If this value is a \"hole\" we set the hole flag\n // if(valueData[i / 2].value === undefined) {\n // if(!options.fillHoles) {\n // hole = true;\n // }\n // } else {\n // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n // if(hole) {\n // segments.push({\n // pathCoordinates: [],\n // valueData: []\n // });\n // // As we have a valid value now, we are not in a \"hole\" anymore\n // hole = false;\n // }\n //\n // // Add to the segment pathCoordinates and valueData\n // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n // segments[segments.length - 1].valueData.push(valueData[i / 2]);\n // }\n // }\n //\n // return segments;\n // }\n //\n // return function cardinal(pathCoordinates, valueData) {\n // // First we try to split the coordinates into segments\n // // This is necessary to treat \"holes\" in line charts\n // var segments = splitIntoSegments(pathCoordinates, valueData);\n //\n // if(!segments.length) {\n // // If there were no segments return 'Chartist.Interpolation.none'\n // return Chartist.Interpolation.none()([]);\n // } else if(segments.length > 1) {\n // // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // // afterwards together into a single path.\n // var paths = [];\n // // For each segment we will recurse the cardinal function\n // segments.forEach(function(segment) {\n // paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n // });\n // // Join the segment path data into a single path and return\n // return Chartist.Svg.Path.join(paths);\n // } else {\n // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // // segment\n // pathCoordinates = segments[0].pathCoordinates;\n // valueData = segments[0].valueData;\n //\n // // If less than two points we need to fallback to no smoothing\n // if(pathCoordinates.length <= 4) {\n // return Chartist.Interpolation.none()(pathCoordinates, valueData);\n // }\n //\n // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n // z;\n //\n // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n // var p = [\n // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n // ];\n // if (z) {\n // if (!i) {\n // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n // } else if (iLen - 4 === i) {\n // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // } else if (iLen - 2 === i) {\n // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n // }\n // } else {\n // if (iLen - 4 === i) {\n // p[3] = p[2];\n // } else if (!i) {\n // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n // }\n // }\n //\n // path.curve(\n // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n // p[2].x,\n // p[2].y,\n // false,\n // valueData[(i + 2) / 2]\n // );\n // }\n //\n // return path;\n // }\n // };\n // };\n\n\n /**\n * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.\n *\n * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.monotoneCubic({\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the monotoneCubic factory function.\n * @return {Function}\n */\n Chartist.Interpolation.monotoneCubic = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {\n // Because we are doing monotone interpolation, curve fitting only makes sense for\n // increasing x values. Therefore if two subsequent points have the same x value, or\n // the x value is decreasing, then we create a hole at this point. (Which cannot be\n // filled in even with the 'fillHoles' option)\n\n hole = true;\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function monotoneCubic(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the monotoneCubic fn function\n segments.forEach(function(segment) {\n paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than three points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var xs = [],\n ys = [],\n i,\n n = pathCoordinates.length / 2,\n ms = [],\n ds = [], dys = [], dxs = [],\n path;\n\n // Populate x and y coordinates into separate arrays, for readability\n\n for(i = 0; i < n; i++) {\n xs[i] = pathCoordinates[i * 2];\n ys[i] = pathCoordinates[i * 2 + 1];\n }\n\n // Calculate deltas and derivative\n\n for(i = 0; i < n - 1; i++) {\n dys[i] = ys[i + 1] - ys[i];\n dxs[i] = xs[i + 1] - xs[i];\n ds[i] = dys[i] / dxs[i];\n }\n\n // Determine desired slope (m) at each point using Fritsch-Carlson method\n // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation\n\n ms[0] = ds[0];\n ms[n - 1] = ds[n - 2];\n\n for(i = 1; i < n - 1; i++) {\n if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {\n ms[i] = 0;\n } else {\n ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (\n (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +\n (dxs[i] + 2 * dxs[i - 1]) / ds[i]);\n\n if(!isFinite(ms[i])) {\n ms[i] = 0;\n }\n }\n }\n\n // Now build a path from the slopes\n\n path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);\n\n for(i = 0; i < n - 1; i++) {\n path.curve(\n // First control point\n xs[i] + dxs[i] / 3,\n ys[i] + ms[i] * dxs[i] / 3,\n // Second control point\n xs[i + 1] - dxs[i] / 3,\n ys[i + 1] - ms[i + 1] * dxs[i] / 3,\n // End point\n xs[i + 1],\n ys[i + 1],\n\n false,\n valueData[i + 1] // changed as per patch on github\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var xy = this.units.pos.toUpperCase();\n var axisOptions = chartOptions['axis' + xy];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n\n\n var labelLength=0;\n\n\n if (xy == 'Y') { // X doesnt use this\n if (projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n // lastWidth = labelLength;\n // } else if (typeof lastWidth != 'undefined') {\n // labelLength = lastWidth; // EDIT. added the lastWidth thing\n } else {\n // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // still be visible inside of the chart padding.\n labelLength = Math.max(this.axisLength - projectedValue, 30);\n }\n }\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// // AMD. Register as an anonymous module.\n\t// define([], function () {\n\t// return (root.returnExportsGlobal = factory());\n\t// });\n\t// } else if (typeof exports === 'object') {\n\t// // Node. Does not work with strict CommonJS, but\n\t// // only CommonJS-like enviroments that support module.exports,\n\t// // like Node.\n\t// module.exports = factory();\n\t// } else {\n\troot['Chartist.plugins.zoom'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js zoom plugin.\n\t *\n\t */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar defaultOptions = {\n\t\t\t// onZoom\n\t\t\t// resetOnRightMouseBtn\n\t\t};\n\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.zoom = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function zoom(chart) {\n\n\t\t\t\tif (!(chart instanceof Chartist.Line)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rect, svg, axisX, axisY, chartRect;\n\t\t\t\tvar downPosition;\n\t\t\t\tvar onZoom = options.onZoom;\n\t\t\t\tvar ongoingTouches = [];\n\n\t\t\t\tchart.on('draw', function (data) {\n\t\t\t\t\tvar type = data.type;\n\t\t\t\t\tif (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n\t\t\t\t\t\tdata.element.attr({\n\t\t\t\t\t\t\t'clip-path': 'url(#zoom-mask)'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\taxisX = data.axisX;\n\t\t\t\t\taxisY = data.axisY;\n\t\t\t\t\tchartRect = data.chartRect;\n\t\t\t\t\tsvg = data.svg._node;\n\t\t\t\t\trect = data.svg.elem('rect', {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 10,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\theight: 100,\n\t\t\t\t\t}, 'ct-zoom-rect');\n\t\t\t\t\thide(rect);\n\n\t\t\t\t\tvar defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n\t\t\t\t\tvar width = chartRect.width();\n\t\t\t\t\tvar height = chartRect.height();\n\n\t\t\t\t\tdefs\n\t\t\t\t\t\t.elem('clipPath', {\n\t\t\t\t\t\t\tid: 'zoom-mask'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.elem('rect', {\n\t\t\t\t\t\t\tx: chartRect.x1,\n\t\t\t\t\t\t\ty: chartRect.y2,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\theight: height,\n\t\t\t\t\t\t\tfill: 'white'\n\t\t\t\t\t\t});\n\n\t\t\t\t\tsvg.addEventListener('mousedown', onMouseDown);\n\t\t\t\t\tsvg.addEventListener('mouseup', onMouseUp);\n\t\t\t\t\tsvg.addEventListener('mousemove', onMouseMove);\n\t\t\t\t\tsvg.addEventListener('touchstart', onTouchStart);\n\t\t\t\t\tsvg.addEventListener('touchmove', onTouchMove);\n\t\t\t\t\tsvg.addEventListener('touchend', onTouchEnd);\n\t\t\t\t\tsvg.addEventListener('touchcancel', onTouchCancel);\n\t\t\t\t});\n\n\t\t\t\tfunction copyTouch(touch) {\n\t\t\t\t\tvar p = position(touch, svg);\n\t\t\t\t\tp.id = touch.identifier;\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tfunction ongoingTouchIndexById(idToFind) {\n\t\t\t\t\tfor (var i = 0; i < ongoingTouches.length; i++) {\n\t\t\t\t\t\tvar id = ongoingTouches[i].id;\n\t\t\t\t\t\tif (id === idToFind) {\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchStart(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tongoingTouches.push(copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchMove(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchCancel(event) {\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t}\n\n\t\t\t\tfunction removeTouches(touches) {\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\t\tongoingTouches.splice(idx, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchEnd(event) {\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\tzoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t}\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t\thide(rect);\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseDown(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tdownPosition = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, downPosition));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar reset = function () {\n\t\t\t\t\tchart.options.axisX.highLow = null;\n\t\t\t\t\tchart.options.axisY.highLow = null;\n\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t};\n\n\t\t\t\tfunction onMouseUp(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tvar box = getRect(downPosition, position(event, svg));\n\t\t\t\t\t\tzoomIn(box);\n\t\t\t\t\t\tdownPosition = null;\n\t\t\t\t\t\thide(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\telse if (options.resetOnRightMouseBtn && event.button === 2) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction zoomIn(rect) {\n\t\t\t\t\tif (rect.width > 5 && rect.height > 5) {\n\t\t\t\t\t\tvar x1 = rect.x - chartRect.x1;\n\t\t\t\t\t\tvar x2 = x1 + rect.width;\n\t\t\t\t\t\tvar y2 = chartRect.y1 - rect.y;\n\t\t\t\t\t\tvar y1 = y2 - rect.height;\n\n\t\t\t\t\t\tvar xLow = project(x1, axisX);\n\t\t\t\t\t\tvar xHigh = project(x2, axisX);\n\t\t\t\t\t\tvar yLow = project(y1, axisY);\n\t\t\t\t\t\tvar yHigh = project(y2, axisY);\n\n\t\t\t\t\t\tvar explb = chart.options.explicitBounds;\n\t\t\t\t\t\tif (!_.isUndefined(explb)) {\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchart.options.axisX.highLow = {low: xLow, high: xHigh};\n\t\t\t\t\t\tchart.options.axisY.highLow = {low: yLow, high: yHigh};\n\n\t\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t\t\tonZoom && onZoom(chart, reset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseMove(event) {\n\t\t\t\t\tif (downPosition) {\n\t\t\t\t\t\tvar point = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, point));\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tfunction hide(rect) {\n\t\t\trect.attr({style: 'display:none'});\n\t\t}\n\n\t\tfunction show(rect) {\n\t\t\trect.attr({style: 'display:block'});\n\t\t}\n\n\t\tfunction getRect(firstPoint, secondPoint) {\n\t\t\tvar x = firstPoint.x;\n\t\t\tvar y = firstPoint.y;\n\t\t\tvar width = secondPoint.x - x;\n\t\t\tvar height = secondPoint.y - y;\n\t\t\tif (width < 0) {\n\t\t\t\twidth = -width;\n\t\t\t\tx = secondPoint.x;\n\t\t\t}\n\t\t\tif (height < 0) {\n\t\t\t\theight = -height;\n\t\t\t\ty = secondPoint.y;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t}\n\n\t\tfunction position(event, svg) {\n\t\t\treturn transform(event.clientX, event.clientY, svg);\n\t\t}\n\n\t\tfunction transform(x, y, svgElement) {\n\t\t\tvar svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n\t\t\tvar matrix = svg.getScreenCTM();\n\t\t\tvar point = svg.createSVGPoint();\n\t\t\tpoint.x = x;\n\t\t\tpoint.y = y;\n\t\t\tpoint = point.matrixTransform(matrix.inverse());\n\t\t\treturn point || {x: 0, y: 0};\n\t\t}\n\n\t\tfunction project(value, axis) {\n\t\t\tvar max = axis.bounds.max;\n\t\t\tvar min = axis.bounds.min;\n\t\t\tif (axis.scale && axis.scale.type === 'log') {\n\t\t\t\tvar base = axis.scale.base;\n\t\t\t\treturn Math.pow(base,\n\t\t\t\t\t\tvalue * baseLog(max / min, base) / axis.axisLength) * min;\n\t\t\t}\n\t\t\treturn (value * axis.bounds.range / axis.axisLength) + min;\n\t\t}\n\n\t\tfunction baseLog(val, base) {\n\t\t\treturn Math.log(val) / Math.log(base);\n\t\t}\n\n\t}(window, document, Chartist));\n\treturn Chartist.plugins.zoom;\n\n}));\n","/**\n * @license\n * lodash 4.6.1 (Custom Build) \n * Build: `lodash include=\"range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined\" exports=\"global\" -d`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.6.1';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n NAN = 0 / 0;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[mapTag] = cloneableTags[numberTag] =\n cloneableTags[objectTag] = cloneableTags[regexpTag] =\n cloneableTags[setTag] = cloneableTags[stringTag] =\n cloneableTags[symbolTag] = cloneableTags[uint8Tag] =\n cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =\n cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseInt = parseInt;\n\n /** Detect free variable `exports`. */\n var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n /** Detect free variable `module`. */\n var freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = (freeModule && freeModule.exports === freeExports)\n ? freeExports\n : undefined;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n /** Detect free variable `self`. */\n var freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n /** Detect free variable `window`. */\n var freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n /** Detect `this` as the global object. */\n var thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `Map#set` because it doesn't return the map instance in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n set.add(value);\n return set;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the new array of key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\n function checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Converts `map` to an array.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the converted array.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Converts `set` to an array.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the converted array.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertySymbols = Object.getOwnPropertySymbols,\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeKeys = Object.keys,\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var mapCtorString = Map ? funcToString.call(Map) : '',\n setCtorString = Set ? funcToString.call(Set) : '',\n weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chaining. Methods that operate on and return arrays, collections, and\n * functions can be chained together. Methods that retrieve a single value or\n * may return a primitive value will automatically end the chain sequence and\n * return the unwrapped value. Otherwise, the value must be unwrapped with\n * `_#value`.\n *\n * Explicit chaining, which must be unwrapped with `_#value` in all cases,\n * may be enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization to merge iteratee calls; this avoids the creation\n * of intermediate arrays and can greatly reduce the number of iteratee executions.\n * Sections of a chain sequence qualify for shortcut fusion if the section is\n * applied to an array of at least two hundred elements and any iteratees\n * accept only one argument. The heuristic for whether a section qualifies\n * for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,\n * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,\n * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,\n * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,\n * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,\n * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,\n * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,\n * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,\n * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,\n * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,\n * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,\n * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,\n * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,\n * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,\n * `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,\n * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,\n * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,\n * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,\n * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,\n * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,\n * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,\n * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,\n * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,\n * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,\n * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,\n * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,\n * `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an hash object.\n *\n * @private\n * @constructor\n * @returns {Object} Returns the new hash object.\n */\n function Hash() {}\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(hash, key) {\n return hashHas(hash, key) && delete hash[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(hash, key) {\n if (nativeCreate) {\n var result = hash[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(hash, key) ? hash[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(hash, key) {\n return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function hashSet(hash, key, value) {\n hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function MapCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapDelete(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashDelete(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map['delete'](key) : assocDelete(data.map, key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapGet(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashGet(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.get(key) : assocGet(data.map, key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashHas(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.has(key) : assocHas(data.map, key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache object.\n */\n function mapSet(key, value) {\n var data = this.__data__;\n if (isKeyable(key)) {\n hashSet(typeof key == 'string' ? data.string : data.hash, key, value);\n } else if (Map) {\n data.map.set(key, value);\n } else {\n assocSet(data.map, key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function Stack(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocDelete(array, key) : data.map['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocGet(array, key) : data.map.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocHas(array, key) : data.map.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache object.\n */\n function stackSet(key, value) {\n var data = this.__data__,\n array = data.array;\n\n if (array) {\n if (array.length < (LARGE_ARRAY_SIZE - 1)) {\n assocSet(array, key, value);\n } else {\n data.array = null;\n data.map = new MapCache(array);\n }\n }\n var map = data.map;\n if (map) {\n map.set(key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Removes `key` and its value from the associative array.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function assocDelete(array, key) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n return false;\n }\n var lastIndex = array.length - 1;\n if (index == lastIndex) {\n array.pop();\n } else {\n splice.call(array, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the associative array value for `key`.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function assocGet(array, key) {\n var index = assocIndexOf(array, key);\n return index < 0 ? undefined : array[index][1];\n }\n\n /**\n * Checks if an associative array value for `key` exists.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function assocHas(array, key) {\n return assocIndexOf(array, key) > -1;\n }\n\n /**\n * Gets the index at which the first occurrence of `key` is found in `array`\n * of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Sets the associative array `key` to `value`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function assocSet(array, key, value) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n array.push([key, value]);\n } else {\n array[index][1] = value;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the array-like object.\n */\n function baseCastFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function baseCastPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n result = baseAssign(result, value);\n return isFull ? copySymbols(value, result) : result;\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return (isFull && !isArr) ? copySymbols(value, result) : result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path + ''] : baseCastPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n stack || (stack = new Stack);\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack,\n result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;\n\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n var type = typeof value;\n if (type == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (type == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n return nativeKeys(Object(object));\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value &&\n (value !== undefined || (key in Object(object)));\n };\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments to numbers.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the new array of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map) {\n return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set) {\n return arrayReduce(setToArray(set), addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n }\n\n /**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toNumber(start);\n start = start === start ? start : 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toNumber(end) || 0;\n }\n step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var index = -1,\n isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n isUnordered = bitmask & UNORDERED_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(array, other);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isUnordered) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object) ? other != +other : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n // Recursively compare objects (susceptible to call stack limits).\n return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : baseHas(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n return result;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If the `_.iteratee` method is\n * customized this function returns the custom method, otherwise it returns\n * `baseIteratee`. If arguments are provided the chosen function is invoked\n * with them and its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = toPairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = getOwnPropertySymbols || function() {\n return [];\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function getTag(value) {\n return objectToString.call(value);\n }\n\n // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.\n if ((Map && getTag(new Map) != mapTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : null,\n ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case mapCtorString: return mapTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n if (object == null) {\n return false;\n }\n var result = hasFunc(object, path);\n if (!result && !isKey(path)) {\n path = baseCastPath(path);\n object = parent(object, path);\n if (object != null) {\n path = last(path);\n result = hasFunc(object, path);\n }\n }\n var length = object ? object.length : undefined;\n return result || (\n !!length && isLength(length) && isIndex(path, length) &&\n (isArray(object) || isString(object) || isArguments(object))\n );\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototypeOf(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\n function indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (typeof value == 'number') {\n return true;\n }\n return !isArray(value) &&\n (reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object)));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return type == 'number' || type == 'boolean' ||\n (type == 'string' && value != '__proto__') || value == null;\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n function stringToPath(string) {\n var result = [];\n toString(string).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`\n * for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => logs `1` then `2`\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' then 'b' (iteration order is not guaranteed)\n */\n function forEach(collection, iteratee) {\n return (typeof iteratee == 'function' && isArray(collection))\n ? arrayEach(collection, iteratee)\n : baseEach(collection, baseCastFunction(iteratee));\n }\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,\n * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,\n * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,\n * and `words`\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = !Buffer ? constant(false) : function(value) {\n return value instanceof Buffer;\n };\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(funcToString.call(value));\n }\n return isObjectLike(value) &&\n (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\n function toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b.c');\n * // => true\n *\n * _.hasIn(object, ['a', 'b', 'c']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Creates an array of own enumerable key-value pairs for `object` which\n * can be consumed by `_.fromPairs`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n function toPairs(object) {\n return baseToPairs(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument given to it.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name the created callback returns the\n * property value for a given element. If `func` is an object the created\n * callback returns `true` for elements that contain the equivalent object\n * properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(callback, func) {\n * var p = /^(\\S+)\\s*([<>])\\s*(\\S+)$/.exec(func);\n * return !p ? callback(func) : function(object) {\n * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);\n * };\n * });\n *\n * _.filter(users, 'age > 36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /*------------------------------------------------------------------------*/\n\n // Avoid inheriting from `Object.prototype` when possible.\n Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;\n\n // Add functions to the `MapCache`.\n MapCache.prototype.clear = mapClear;\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Stack` cache.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n // Add functions that return wrapped values when chaining.\n lodash.constant = constant;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.property = property;\n lodash.range = range;\n lodash.toPairs = toPairs;\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isNative = isNative;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.replace = replace;\n lodash.toNumber = toNumber;\n lodash.toString = toString;\n lodash.unescape = unescape;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n // Expose lodash on the free variable `window` or `self` when available. This\n // prevents errors in cases where lodash is loaded by a script tag in the presence\n // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.\n (freeWindow || freeSelf || {})._ = lodash;\n\n // Export to the global object.\n root._ = lodash;\n}.call(this));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\nfunction numfmt(x, places) {\n\tvar pow = Math.pow(10, places);\n\treturn Math.round(x*pow) / pow;\n}\n\nfunction estimateLoadTime(fs, n) {\n\treturn (1000/fs)*n+1500;\n}\n\nfunction msNow() {\n\treturn +(new Date);\n}\n\nfunction msElapsed(start) {\n\treturn msNow() - start;\n}\n\nMath.log10 = Math.log10 || function(x) {\n\treturn Math.log(x) / Math.LN10;\n};\n\n/**\n * Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(_.escapeRegExp(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tif ($(this).hasClass('no-close')) return; // this is a no-close modal\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","var notify = (function () {\n\tvar nt = {};\n\tvar sel = '#notif';\n\n\tvar hideTmeo1;\n\tvar hideTmeo2;\n\n\tnt.show = function (message, timeout) {\n\t\t$(sel).html(message);\n\t\tmodal.show(sel);\n\n\t\tclearTimeout(hideTmeo1);\n\t\tclearTimeout(hideTmeo2);\n\n\t\tif (!_.isUndefined(timeout)) {\n\t\t\thideTmeo1 = setTimeout(nt.hide, timeout);\n\t\t}\n\t};\n\n\tnt.hide = function () {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\thideTmeo2 = setTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 250); // transition time\n\t};\n\n\tnt.init = function() {\n\t\t$(sel).on('click', function() {\n\t\t\tnt.hide(this);\n\t\t});\n\t};\n\n\treturn nt;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\t$('input[type=number]').on('mousewheel', function(e) {\n\t\tvar val = +$(this).val();\n\t\tvar step = +($(this).attr('step') || 1);\n\t\tvar min = $(this).attr('min');\n\t\tvar max = $(this).attr('max');\n\t\tif(e.wheelDelta > 0) {\n\t\t\tval += step;\n\t\t} else {\n\t\t\tval -= step;\n\t\t}\n\t\tif (!_.isUndefined(min)) val = Math.max(val, min);\n\t\tif (!_.isUndefined(max)) val = Math.min(val, max);\n\t\t$(this).val(val);\n\n\t\tif (\"createEvent\" in document) {\n\t\t\tvar evt = document.createEvent(\"HTMLEvents\");\n\t\t\tevt.initEvent(\"change\", false, true);\n\t\t\t$(this)[0].dispatchEvent(evt);\n\t\t} else {\n\t\t\t$(this)[0].fireEvent(\"onchange\");\n\t\t}\n\n\t\te.preventDefault();\n\t});\n\n\tmodal.init();\n\tnotify.init();\n});\n\n\nfunction errorMsg(msg, time) {\n\tnotify.show(msg, time || 3000);\n}\n","/** Wifi page */\nvar page_wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n","var page_mon = (function() {\n\tvar mon = {};\n\n\tfunction updRefInfoField(ok) {\n\t\t$('#hasref').html(ok ? 'OK' : 'Not set!');\n\t}\n\n\t/** Capture reference & save to flash */\n\tmon.captureRef = function() {\n\t\t$().get(_root + '/mon/setref', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tupdRefInfoField(j.success);\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\tupdRefInfoField(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Capture waveform and compare with reference */\n\tmon.compareNow = function() {\n\t\t$().get(_root + '/mon/compare', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t$('#refdist').html(numfmt(j.deviation, 2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorMsg('Capture failed.');\n\t\t\t\t\t\t$('#refdist').html('--');\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t$('#refdist').html('--');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tmon.init = function() {\n\t\t//\n\t};\n\n\treturn mon;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","lodash.custom.js","utils.js","modal.js","notif.js","app.js","page_wifi.js","page_waveform.js","page_spectrogram.js","page_status.js","page_mon.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC95HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\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}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\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\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (!_.isUndefined(value)) { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms\n\t\t\tvar xhr;\n\t\t\tvar\tquery = serializeData(nodes);\n\t\t\tvar\ttype = (method) ? method.toUpperCase() : 'GET';\n\t\t\tvar\tabortTmeo;\n\n\t\t\tif (_.isNumber(options)) options = {timeout: options};\n\n\t\t\tvar opts = Chartist.extend({}, {\n\t\t\t\tnocache: true,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tloader: true,\n\t\t\t}, options);\n\n\t\t\t//console.log('ajax to = ' + opts.timeout);\n\n\t\t\tif (query && (type === 'GET')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// FIXME the XHR sometimes seemingly silently fails\n\n\t\t\txhr = new XMLHttpRequest(); // we dont support IE < 9\n\n\t\t\tif (xhr) {\n\t\t\t\t// prevent caching\n\t\t\t\tif (opts.nocache) {\n\t\t\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t\t\t}\n\n\t\t\t\tif (opts.loader)\n\t\t\t\t\t$('#loader').addClass('show');\n\n\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\txhr.timeout = opts.timeout;\n\n\t\t\t\tabortTmeo = setTimeout(function () {\n\t\t\t\t\terrorMsg(\"XHR timed out.\");\n\t\t\t\t\txhr.abort();\n\t\t\t\t\tif (opts.loader) $('#loader').removeClass('show');\n\t\t\t\t}, opts.timeout + 10); // a bit later, but still.;\n\n\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\n\t\t\t\t\t\tif (opts.loader)\n\t\t\t\t\t\t\t$('#loader').removeClass('show');\n\n\t\t\t\t\t\tif (callback && xhr.status != 0) { // xhr.status 0 means \"aborted\"\n\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\tif (type === 'POST') {\n\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t}\n\n\t\t\t\txhr.send(query);\n\t\t\t}\n\n\t\t\treturn xhr;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback)\n\t\tcb.get = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'get', callback, opts);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback)\n\t\tcb.post = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'post', callback, opts);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n // Chartist.escapingMap = {\n // '&': '&',\n // '<': '<',\n // '>': '>',\n // '\"': '"',\n // '\\'': '''\n // };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return _.escape(data);\n\n // return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n // }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n // }, data);\n data = _.unescape(data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n // /**\n // * Calculate cartesian coordinates of polar coordinates\n // *\n // * @memberof Chartist.Core\n // * @param {Number} centerX X-axis coordinates of center point of circle segment\n // * @param {Number} centerY X-axis coordinates of center point of circle segment\n // * @param {Number} radius Radius of circle segment\n // * @param {Number} angleInDegrees Angle of circle segment in degrees\n // * @return {{x:Number, y:Number}} Coordinates of point on circumference\n // */\n // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n //\n // return {\n // x: centerX + (radius * Math.cos(angleInRadians)),\n // y: centerY + (radius * Math.sin(angleInRadians))\n // };\n // };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\n if (_.isNumber(lblText)) {\n lblText = Chartist.roundWithPrecision(lblText, 2);\n }\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n // /**\n // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n // *\n // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n // *\n // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n // *\n // * @example\n // * var chart = new Chartist.Line('.ct-chart', {\n // * labels: [1, 2, 3, 4, 5],\n // * series: [[1, 2, 8, 1, 7]]\n // * }, {\n // * lineSmooth: Chartist.Interpolation.cardinal({\n // * tension: 1,\n // * fillHoles: false\n // * })\n // * });\n // *\n // * @memberof Chartist.Interpolation\n // * @param {Object} options The options of the cardinal factory function.\n // * @return {Function}\n // */\n // Chartist.Interpolation.cardinal = function(options) {\n // var defaultOptions = {\n // tension: 1,\n // fillHoles: false\n // };\n //\n // options = Chartist.extend({}, defaultOptions, options);\n //\n // var t = Math.min(1, Math.max(0, options.tension)),\n // c = 1 - t;\n //\n // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // // This functionality is necessary to treat \"holes\" in the line charts\n // function splitIntoSegments(pathCoordinates, valueData) {\n // var segments = [];\n // var hole = true;\n //\n // for(var i = 0; i < pathCoordinates.length; i += 2) {\n // // If this value is a \"hole\" we set the hole flag\n // if(valueData[i / 2].value === undefined) {\n // if(!options.fillHoles) {\n // hole = true;\n // }\n // } else {\n // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n // if(hole) {\n // segments.push({\n // pathCoordinates: [],\n // valueData: []\n // });\n // // As we have a valid value now, we are not in a \"hole\" anymore\n // hole = false;\n // }\n //\n // // Add to the segment pathCoordinates and valueData\n // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n // segments[segments.length - 1].valueData.push(valueData[i / 2]);\n // }\n // }\n //\n // return segments;\n // }\n //\n // return function cardinal(pathCoordinates, valueData) {\n // // First we try to split the coordinates into segments\n // // This is necessary to treat \"holes\" in line charts\n // var segments = splitIntoSegments(pathCoordinates, valueData);\n //\n // if(!segments.length) {\n // // If there were no segments return 'Chartist.Interpolation.none'\n // return Chartist.Interpolation.none()([]);\n // } else if(segments.length > 1) {\n // // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // // afterwards together into a single path.\n // var paths = [];\n // // For each segment we will recurse the cardinal function\n // segments.forEach(function(segment) {\n // paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n // });\n // // Join the segment path data into a single path and return\n // return Chartist.Svg.Path.join(paths);\n // } else {\n // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // // segment\n // pathCoordinates = segments[0].pathCoordinates;\n // valueData = segments[0].valueData;\n //\n // // If less than two points we need to fallback to no smoothing\n // if(pathCoordinates.length <= 4) {\n // return Chartist.Interpolation.none()(pathCoordinates, valueData);\n // }\n //\n // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n // z;\n //\n // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n // var p = [\n // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n // ];\n // if (z) {\n // if (!i) {\n // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n // } else if (iLen - 4 === i) {\n // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // } else if (iLen - 2 === i) {\n // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n // }\n // } else {\n // if (iLen - 4 === i) {\n // p[3] = p[2];\n // } else if (!i) {\n // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n // }\n // }\n //\n // path.curve(\n // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n // p[2].x,\n // p[2].y,\n // false,\n // valueData[(i + 2) / 2]\n // );\n // }\n //\n // return path;\n // }\n // };\n // };\n\n\n /**\n * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.\n *\n * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.monotoneCubic({\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the monotoneCubic factory function.\n * @return {Function}\n */\n Chartist.Interpolation.monotoneCubic = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {\n // Because we are doing monotone interpolation, curve fitting only makes sense for\n // increasing x values. Therefore if two subsequent points have the same x value, or\n // the x value is decreasing, then we create a hole at this point. (Which cannot be\n // filled in even with the 'fillHoles' option)\n\n hole = true;\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function monotoneCubic(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the monotoneCubic fn function\n segments.forEach(function(segment) {\n paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than three points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var xs = [],\n ys = [],\n i,\n n = pathCoordinates.length / 2,\n ms = [],\n ds = [], dys = [], dxs = [],\n path;\n\n // Populate x and y coordinates into separate arrays, for readability\n\n for(i = 0; i < n; i++) {\n xs[i] = pathCoordinates[i * 2];\n ys[i] = pathCoordinates[i * 2 + 1];\n }\n\n // Calculate deltas and derivative\n\n for(i = 0; i < n - 1; i++) {\n dys[i] = ys[i + 1] - ys[i];\n dxs[i] = xs[i + 1] - xs[i];\n ds[i] = dys[i] / dxs[i];\n }\n\n // Determine desired slope (m) at each point using Fritsch-Carlson method\n // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation\n\n ms[0] = ds[0];\n ms[n - 1] = ds[n - 2];\n\n for(i = 1; i < n - 1; i++) {\n if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {\n ms[i] = 0;\n } else {\n ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (\n (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +\n (dxs[i] + 2 * dxs[i - 1]) / ds[i]);\n\n if(!isFinite(ms[i])) {\n ms[i] = 0;\n }\n }\n }\n\n // Now build a path from the slopes\n\n path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);\n\n for(i = 0; i < n - 1; i++) {\n path.curve(\n // First control point\n xs[i] + dxs[i] / 3,\n ys[i] + ms[i] * dxs[i] / 3,\n // Second control point\n xs[i + 1] - dxs[i] / 3,\n ys[i + 1] - ms[i + 1] * dxs[i] / 3,\n // End point\n xs[i + 1],\n ys[i + 1],\n\n false,\n valueData[i + 1] // changed as per patch on github\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var xy = this.units.pos.toUpperCase();\n var axisOptions = chartOptions['axis' + xy];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n\n\n var labelLength=0;\n\n\n if (xy == 'Y') { // X doesnt use this\n if (projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n // lastWidth = labelLength;\n // } else if (typeof lastWidth != 'undefined') {\n // labelLength = lastWidth; // EDIT. added the lastWidth thing\n } else {\n // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // still be visible inside of the chart padding.\n labelLength = Math.max(this.axisLength - projectedValue, 30);\n }\n }\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// // AMD. Register as an anonymous module.\n\t// define([], function () {\n\t// return (root.returnExportsGlobal = factory());\n\t// });\n\t// } else if (typeof exports === 'object') {\n\t// // Node. Does not work with strict CommonJS, but\n\t// // only CommonJS-like enviroments that support module.exports,\n\t// // like Node.\n\t// module.exports = factory();\n\t// } else {\n\troot['Chartist.plugins.zoom'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js zoom plugin.\n\t *\n\t */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar defaultOptions = {\n\t\t\t// onZoom\n\t\t\t// resetOnRightMouseBtn\n\t\t};\n\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.zoom = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function zoom(chart) {\n\n\t\t\t\tif (!(chart instanceof Chartist.Line)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rect, svg, axisX, axisY, chartRect;\n\t\t\t\tvar downPosition;\n\t\t\t\tvar onZoom = options.onZoom;\n\t\t\t\tvar ongoingTouches = [];\n\n\t\t\t\tchart.on('draw', function (data) {\n\t\t\t\t\tvar type = data.type;\n\t\t\t\t\tif (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n\t\t\t\t\t\tdata.element.attr({\n\t\t\t\t\t\t\t'clip-path': 'url(#zoom-mask)'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\taxisX = data.axisX;\n\t\t\t\t\taxisY = data.axisY;\n\t\t\t\t\tchartRect = data.chartRect;\n\t\t\t\t\tsvg = data.svg._node;\n\t\t\t\t\trect = data.svg.elem('rect', {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 10,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\theight: 100,\n\t\t\t\t\t}, 'ct-zoom-rect');\n\t\t\t\t\thide(rect);\n\n\t\t\t\t\tvar defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n\t\t\t\t\tvar width = chartRect.width();\n\t\t\t\t\tvar height = chartRect.height();\n\n\t\t\t\t\tdefs\n\t\t\t\t\t\t.elem('clipPath', {\n\t\t\t\t\t\t\tid: 'zoom-mask'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.elem('rect', {\n\t\t\t\t\t\t\tx: chartRect.x1,\n\t\t\t\t\t\t\ty: chartRect.y2,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\theight: height,\n\t\t\t\t\t\t\tfill: 'white'\n\t\t\t\t\t\t});\n\n\t\t\t\t\tsvg.addEventListener('mousedown', onMouseDown);\n\t\t\t\t\tsvg.addEventListener('mouseup', onMouseUp);\n\t\t\t\t\tsvg.addEventListener('mousemove', onMouseMove);\n\t\t\t\t\tsvg.addEventListener('touchstart', onTouchStart);\n\t\t\t\t\tsvg.addEventListener('touchmove', onTouchMove);\n\t\t\t\t\tsvg.addEventListener('touchend', onTouchEnd);\n\t\t\t\t\tsvg.addEventListener('touchcancel', onTouchCancel);\n\t\t\t\t});\n\n\t\t\t\tfunction copyTouch(touch) {\n\t\t\t\t\tvar p = position(touch, svg);\n\t\t\t\t\tp.id = touch.identifier;\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tfunction ongoingTouchIndexById(idToFind) {\n\t\t\t\t\tfor (var i = 0; i < ongoingTouches.length; i++) {\n\t\t\t\t\t\tvar id = ongoingTouches[i].id;\n\t\t\t\t\t\tif (id === idToFind) {\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchStart(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tongoingTouches.push(copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchMove(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchCancel(event) {\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t}\n\n\t\t\t\tfunction removeTouches(touches) {\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\t\tongoingTouches.splice(idx, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchEnd(event) {\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\tzoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t}\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t\thide(rect);\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseDown(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tdownPosition = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, downPosition));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar reset = function () {\n\t\t\t\t\tchart.options.axisX.highLow = null;\n\t\t\t\t\tchart.options.axisY.highLow = null;\n\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t};\n\n\t\t\t\tfunction onMouseUp(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tvar box = getRect(downPosition, position(event, svg));\n\t\t\t\t\t\tzoomIn(box);\n\t\t\t\t\t\tdownPosition = null;\n\t\t\t\t\t\thide(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\telse if (options.resetOnRightMouseBtn && event.button === 2) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction zoomIn(rect) {\n\t\t\t\t\tif (rect.width > 5 && rect.height > 5) {\n\t\t\t\t\t\tvar x1 = rect.x - chartRect.x1;\n\t\t\t\t\t\tvar x2 = x1 + rect.width;\n\t\t\t\t\t\tvar y2 = chartRect.y1 - rect.y;\n\t\t\t\t\t\tvar y1 = y2 - rect.height;\n\n\t\t\t\t\t\tvar xLow = project(x1, axisX);\n\t\t\t\t\t\tvar xHigh = project(x2, axisX);\n\t\t\t\t\t\tvar yLow = project(y1, axisY);\n\t\t\t\t\t\tvar yHigh = project(y2, axisY);\n\n\t\t\t\t\t\tvar explb = chart.options.explicitBounds;\n\t\t\t\t\t\tif (!_.isUndefined(explb)) {\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchart.options.axisX.highLow = {low: xLow, high: xHigh};\n\t\t\t\t\t\tchart.options.axisY.highLow = {low: yLow, high: yHigh};\n\n\t\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t\t\tonZoom && onZoom(chart, reset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseMove(event) {\n\t\t\t\t\tif (downPosition) {\n\t\t\t\t\t\tvar point = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, point));\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tfunction hide(rect) {\n\t\t\trect.attr({style: 'display:none'});\n\t\t}\n\n\t\tfunction show(rect) {\n\t\t\trect.attr({style: 'display:block'});\n\t\t}\n\n\t\tfunction getRect(firstPoint, secondPoint) {\n\t\t\tvar x = firstPoint.x;\n\t\t\tvar y = firstPoint.y;\n\t\t\tvar width = secondPoint.x - x;\n\t\t\tvar height = secondPoint.y - y;\n\t\t\tif (width < 0) {\n\t\t\t\twidth = -width;\n\t\t\t\tx = secondPoint.x;\n\t\t\t}\n\t\t\tif (height < 0) {\n\t\t\t\theight = -height;\n\t\t\t\ty = secondPoint.y;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t}\n\n\t\tfunction position(event, svg) {\n\t\t\treturn transform(event.clientX, event.clientY, svg);\n\t\t}\n\n\t\tfunction transform(x, y, svgElement) {\n\t\t\tvar svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n\t\t\tvar matrix = svg.getScreenCTM();\n\t\t\tvar point = svg.createSVGPoint();\n\t\t\tpoint.x = x;\n\t\t\tpoint.y = y;\n\t\t\tpoint = point.matrixTransform(matrix.inverse());\n\t\t\treturn point || {x: 0, y: 0};\n\t\t}\n\n\t\tfunction project(value, axis) {\n\t\t\tvar max = axis.bounds.max;\n\t\t\tvar min = axis.bounds.min;\n\t\t\tif (axis.scale && axis.scale.type === 'log') {\n\t\t\t\tvar base = axis.scale.base;\n\t\t\t\treturn Math.pow(base,\n\t\t\t\t\t\tvalue * baseLog(max / min, base) / axis.axisLength) * min;\n\t\t\t}\n\t\t\treturn (value * axis.bounds.range / axis.axisLength) + min;\n\t\t}\n\n\t\tfunction baseLog(val, base) {\n\t\t\treturn Math.log(val) / Math.log(base);\n\t\t}\n\n\t}(window, document, Chartist));\n\treturn Chartist.plugins.zoom;\n\n}));\n","/**\n * @license\n * lodash 4.6.1 (Custom Build) \n * Build: `lodash include=\"range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined\" exports=\"global\" -d`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.6.1';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n NAN = 0 / 0;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[mapTag] = cloneableTags[numberTag] =\n cloneableTags[objectTag] = cloneableTags[regexpTag] =\n cloneableTags[setTag] = cloneableTags[stringTag] =\n cloneableTags[symbolTag] = cloneableTags[uint8Tag] =\n cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =\n cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseInt = parseInt;\n\n /** Detect free variable `exports`. */\n var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n /** Detect free variable `module`. */\n var freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = (freeModule && freeModule.exports === freeExports)\n ? freeExports\n : undefined;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n /** Detect free variable `self`. */\n var freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n /** Detect free variable `window`. */\n var freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n /** Detect `this` as the global object. */\n var thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `Map#set` because it doesn't return the map instance in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n set.add(value);\n return set;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the new array of key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\n function checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Converts `map` to an array.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the converted array.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Converts `set` to an array.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the converted array.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertySymbols = Object.getOwnPropertySymbols,\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeKeys = Object.keys,\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var mapCtorString = Map ? funcToString.call(Map) : '',\n setCtorString = Set ? funcToString.call(Set) : '',\n weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chaining. Methods that operate on and return arrays, collections, and\n * functions can be chained together. Methods that retrieve a single value or\n * may return a primitive value will automatically end the chain sequence and\n * return the unwrapped value. Otherwise, the value must be unwrapped with\n * `_#value`.\n *\n * Explicit chaining, which must be unwrapped with `_#value` in all cases,\n * may be enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization to merge iteratee calls; this avoids the creation\n * of intermediate arrays and can greatly reduce the number of iteratee executions.\n * Sections of a chain sequence qualify for shortcut fusion if the section is\n * applied to an array of at least two hundred elements and any iteratees\n * accept only one argument. The heuristic for whether a section qualifies\n * for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,\n * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,\n * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,\n * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,\n * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,\n * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,\n * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,\n * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,\n * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,\n * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,\n * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,\n * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,\n * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,\n * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,\n * `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,\n * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,\n * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,\n * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,\n * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,\n * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,\n * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,\n * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,\n * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,\n * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,\n * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,\n * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,\n * `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an hash object.\n *\n * @private\n * @constructor\n * @returns {Object} Returns the new hash object.\n */\n function Hash() {}\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(hash, key) {\n return hashHas(hash, key) && delete hash[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(hash, key) {\n if (nativeCreate) {\n var result = hash[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(hash, key) ? hash[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(hash, key) {\n return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function hashSet(hash, key, value) {\n hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function MapCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapDelete(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashDelete(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map['delete'](key) : assocDelete(data.map, key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapGet(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashGet(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.get(key) : assocGet(data.map, key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashHas(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.has(key) : assocHas(data.map, key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache object.\n */\n function mapSet(key, value) {\n var data = this.__data__;\n if (isKeyable(key)) {\n hashSet(typeof key == 'string' ? data.string : data.hash, key, value);\n } else if (Map) {\n data.map.set(key, value);\n } else {\n assocSet(data.map, key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function Stack(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocDelete(array, key) : data.map['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocGet(array, key) : data.map.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocHas(array, key) : data.map.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache object.\n */\n function stackSet(key, value) {\n var data = this.__data__,\n array = data.array;\n\n if (array) {\n if (array.length < (LARGE_ARRAY_SIZE - 1)) {\n assocSet(array, key, value);\n } else {\n data.array = null;\n data.map = new MapCache(array);\n }\n }\n var map = data.map;\n if (map) {\n map.set(key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Removes `key` and its value from the associative array.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function assocDelete(array, key) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n return false;\n }\n var lastIndex = array.length - 1;\n if (index == lastIndex) {\n array.pop();\n } else {\n splice.call(array, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the associative array value for `key`.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function assocGet(array, key) {\n var index = assocIndexOf(array, key);\n return index < 0 ? undefined : array[index][1];\n }\n\n /**\n * Checks if an associative array value for `key` exists.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function assocHas(array, key) {\n return assocIndexOf(array, key) > -1;\n }\n\n /**\n * Gets the index at which the first occurrence of `key` is found in `array`\n * of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Sets the associative array `key` to `value`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function assocSet(array, key, value) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n array.push([key, value]);\n } else {\n array[index][1] = value;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the array-like object.\n */\n function baseCastFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function baseCastPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n result = baseAssign(result, value);\n return isFull ? copySymbols(value, result) : result;\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return (isFull && !isArr) ? copySymbols(value, result) : result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path + ''] : baseCastPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n stack || (stack = new Stack);\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack,\n result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;\n\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n var type = typeof value;\n if (type == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (type == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n return nativeKeys(Object(object));\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value &&\n (value !== undefined || (key in Object(object)));\n };\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments to numbers.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the new array of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map) {\n return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set) {\n return arrayReduce(setToArray(set), addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n }\n\n /**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toNumber(start);\n start = start === start ? start : 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toNumber(end) || 0;\n }\n step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var index = -1,\n isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n isUnordered = bitmask & UNORDERED_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(array, other);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isUnordered) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object) ? other != +other : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n // Recursively compare objects (susceptible to call stack limits).\n return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : baseHas(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n return result;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If the `_.iteratee` method is\n * customized this function returns the custom method, otherwise it returns\n * `baseIteratee`. If arguments are provided the chosen function is invoked\n * with them and its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = toPairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = getOwnPropertySymbols || function() {\n return [];\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function getTag(value) {\n return objectToString.call(value);\n }\n\n // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.\n if ((Map && getTag(new Map) != mapTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : null,\n ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case mapCtorString: return mapTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n if (object == null) {\n return false;\n }\n var result = hasFunc(object, path);\n if (!result && !isKey(path)) {\n path = baseCastPath(path);\n object = parent(object, path);\n if (object != null) {\n path = last(path);\n result = hasFunc(object, path);\n }\n }\n var length = object ? object.length : undefined;\n return result || (\n !!length && isLength(length) && isIndex(path, length) &&\n (isArray(object) || isString(object) || isArguments(object))\n );\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototypeOf(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\n function indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (typeof value == 'number') {\n return true;\n }\n return !isArray(value) &&\n (reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object)));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return type == 'number' || type == 'boolean' ||\n (type == 'string' && value != '__proto__') || value == null;\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n function stringToPath(string) {\n var result = [];\n toString(string).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`\n * for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => logs `1` then `2`\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' then 'b' (iteration order is not guaranteed)\n */\n function forEach(collection, iteratee) {\n return (typeof iteratee == 'function' && isArray(collection))\n ? arrayEach(collection, iteratee)\n : baseEach(collection, baseCastFunction(iteratee));\n }\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,\n * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,\n * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,\n * and `words`\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = !Buffer ? constant(false) : function(value) {\n return value instanceof Buffer;\n };\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(funcToString.call(value));\n }\n return isObjectLike(value) &&\n (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\n function toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b.c');\n * // => true\n *\n * _.hasIn(object, ['a', 'b', 'c']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Creates an array of own enumerable key-value pairs for `object` which\n * can be consumed by `_.fromPairs`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n function toPairs(object) {\n return baseToPairs(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument given to it.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name the created callback returns the\n * property value for a given element. If `func` is an object the created\n * callback returns `true` for elements that contain the equivalent object\n * properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(callback, func) {\n * var p = /^(\\S+)\\s*([<>])\\s*(\\S+)$/.exec(func);\n * return !p ? callback(func) : function(object) {\n * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);\n * };\n * });\n *\n * _.filter(users, 'age > 36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /*------------------------------------------------------------------------*/\n\n // Avoid inheriting from `Object.prototype` when possible.\n Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;\n\n // Add functions to the `MapCache`.\n MapCache.prototype.clear = mapClear;\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Stack` cache.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n // Add functions that return wrapped values when chaining.\n lodash.constant = constant;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.property = property;\n lodash.range = range;\n lodash.toPairs = toPairs;\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isNative = isNative;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.replace = replace;\n lodash.toNumber = toNumber;\n lodash.toString = toString;\n lodash.unescape = unescape;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n // Expose lodash on the free variable `window` or `self` when available. This\n // prevents errors in cases where lodash is loaded by a script tag in the presence\n // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.\n (freeWindow || freeSelf || {})._ = lodash;\n\n // Export to the global object.\n root._ = lodash;\n}.call(this));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\nfunction numfmt(x, places) {\n\tvar pow = Math.pow(10, places);\n\treturn Math.round(x*pow) / pow;\n}\n\nfunction estimateLoadTime(fs, n) {\n\treturn (1000/fs)*n+1500;\n}\n\nfunction msNow() {\n\treturn +(new Date);\n}\n\nfunction msElapsed(start) {\n\treturn msNow() - start;\n}\n\nMath.log10 = Math.log10 || function(x) {\n\treturn Math.log(x) / Math.LN10;\n};\n\n/**\n * Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(_.escapeRegExp(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tif ($(this).hasClass('no-close')) return; // this is a no-close modal\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","var notify = (function () {\n\tvar nt = {};\n\tvar sel = '#notif';\n\n\tvar hideTmeo1;\n\tvar hideTmeo2;\n\n\tnt.show = function (message, timeout) {\n\t\t$(sel).html(message);\n\t\tmodal.show(sel);\n\n\t\tclearTimeout(hideTmeo1);\n\t\tclearTimeout(hideTmeo2);\n\n\t\tif (!_.isUndefined(timeout)) {\n\t\t\thideTmeo1 = setTimeout(nt.hide, timeout);\n\t\t}\n\t};\n\n\tnt.hide = function () {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\thideTmeo2 = setTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 250); // transition time\n\t};\n\n\tnt.init = function() {\n\t\t$(sel).on('click', function() {\n\t\t\tnt.hide(this);\n\t\t});\n\t};\n\n\treturn nt;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\t$('input[type=number]').on('mousewheel', function(e) {\n\t\tvar val = +$(this).val();\n\t\tvar step = +($(this).attr('step') || 1);\n\t\tvar min = $(this).attr('min');\n\t\tvar max = $(this).attr('max');\n\t\tif(e.wheelDelta > 0) {\n\t\t\tval += step;\n\t\t} else {\n\t\t\tval -= step;\n\t\t}\n\t\tif (!_.isUndefined(min)) val = Math.max(val, min);\n\t\tif (!_.isUndefined(max)) val = Math.min(val, max);\n\t\t$(this).val(val);\n\n\t\tif (\"createEvent\" in document) {\n\t\t\tvar evt = document.createEvent(\"HTMLEvents\");\n\t\t\tevt.initEvent(\"change\", false, true);\n\t\t\t$(this)[0].dispatchEvent(evt);\n\t\t} else {\n\t\t\t$(this)[0].fireEvent(\"onchange\");\n\t\t}\n\n\t\te.preventDefault();\n\t});\n\n\tmodal.init();\n\tnotify.init();\n});\n\n\nfunction errorMsg(msg, time) {\n\tnotify.show(msg, time || 3000);\n}\n","/** Wifi page */\nvar page_wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n","var page_mon = (function() {\n\tvar mon = {};\n\n\tfunction updRefInfoField(ok) {\n\t\t$('#hasref').html(ok ? 'OK' : 'Not set!');\n\t}\n\n\t/** Capture reference & save to flash */\n\tmon.captureRef = function() {\n\t\t$().get(_root + '/mon/setref', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tupdRefInfoField(j.success);\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\tupdRefInfoField(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Capture waveform and compare with reference */\n\tmon.compareNow = function() {\n\t\t$().get(_root + '/mon/compare', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t$('#actual-dev').html(numfmt(j.deviation, 2));\n\t\t\t\t\t\t$('#actual-rms').html(numfmt(j.rms, 2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorMsg('Capture failed.');\n\t\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tmon.init = function() {\n\t\t//\n\t};\n\n\treturn mon;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/html_src/page_monitoring.php b/html_src/page_monitoring.php index 75f142e..8753b32 100644 --- a/html_src/page_monitoring.php +++ b/html_src/page_monitoring.php @@ -13,9 +13,12 @@
- + @@ -24,36 +27,36 @@

Reporting

- +
-  
-  seconds
Service: -    -   +    +  
 
Actual distance:Actual state: - N/A + + Δ = %curDeviation%, + Irms = %curRMS% mA + Measure
- + - + diff --git a/libesphttpd/core/httpd.c b/libesphttpd/core/httpd.c index d8d4ff2..f2b17bd 100644 --- a/libesphttpd/core/httpd.c +++ b/libesphttpd/core/httpd.c @@ -62,7 +62,7 @@ struct HttpdPriv { //Connection pool -static HttpdConnData *connData[HTTPD_MAX_CONNECTIONS]; +static HttpdConnData *connPool[HTTPD_MAX_CONNECTIONS]; //Struct to keep extension->mime data in typedef struct { @@ -118,10 +118,10 @@ const char ICACHE_FLASH_ATTR *httpdGetMimetype(const char *filepath) { //Looks up the connData info for a specific connection static HttpdConnData ICACHE_FLASH_ATTR *httpdFindConnData(ConnTypePtr conn, const char *remIp, int remPort) { for (int i=0; iremote_port == remPort && - memcmp(connData[i]->remote_ip, remIp, 4) == 0) { - connData[i]->conn=conn; - return connData[i]; + if (connPool[i] && connPool[i]->remote_port == remPort && + memcmp(connPool[i]->remote_ip, remIp, 4) == 0) { + connPool[i]->conn=conn; + return connPool[i]; } } //Shouldn't happen. @@ -146,7 +146,7 @@ static void ICACHE_FLASH_ATTR httpdRetireConn(HttpdConnData *conn) { if (conn->priv!=NULL) free(conn->priv); if (conn) free(conn); for (int i=0; iconn==NULL) { //Connection aborted. Clean up. return HTTPD_CGI_DONE; @@ -295,7 +295,7 @@ int ICACHE_FLASH_ATTR cgiRedirect(HttpdConnData *connData) { } //Used to spit out a 404 error -static int ICACHE_FLASH_ATTR cgiNotFound(HttpdConnData *connData) { +static httpd_cgi_state ICACHE_FLASH_ATTR cgiNotFound(HttpdConnData *connData) { if (connData->conn==NULL) return HTTPD_CGI_DONE; httpdStartResponse(connData, 404); httpdEndHeaders(connData); @@ -308,7 +308,7 @@ static int ICACHE_FLASH_ATTR cgiNotFound(HttpdConnData *connData) { //ESP in order to load a HTML page as soon as a phone, tablet etc connects to the ESP. Watch out: //this will also redirect connections when the ESP is in STA mode, potentially to a hostname that is not //in the 'official' DNS and so will fail. -int ICACHE_FLASH_ATTR cgiRedirectToHostname(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiRedirectToHostname(HttpdConnData *connData) { static const char hostFmt[]="http://%s/"; char *buff; int isIP=0; @@ -345,7 +345,7 @@ int ICACHE_FLASH_ATTR cgiRedirectToHostname(HttpdConnData *connData) { //Same as above, but will only redirect clients with an IP that is in the range of //the SoftAP interface. This should preclude clients connected to the STA interface //to be redirected to nowhere. -int ICACHE_FLASH_ATTR cgiRedirectApClientToHostname(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiRedirectApClientToHostname(HttpdConnData *connData) { #ifndef FREERTOS uint32 *remadr; struct ip_info apip; @@ -588,19 +588,22 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) { int i; char firstLine=0; - if (strncmp(h, "GET ", 4)==0) { + if (strstarts(h, "GET ")) { conn->requestType = HTTPD_METHOD_GET; firstLine=1; - } else if (strncmp(h, "Host:", 5)==0) { - i=5; - while (h[i]==' ') i++; - conn->hostName=&h[i]; - } else if (strncmp(h, "POST ", 5)==0) { + } else if (strstarts(h, "POST ")) { conn->requestType = HTTPD_METHOD_POST; firstLine=1; - } else if (strncmp(h, "OPTIONS ", 8)==0) { + } else if (strstarts(h, "PUT ")) { + conn->requestType = HTTPD_METHOD_PUT; + firstLine=1; + } else if (strstarts(h, "OPTIONS ")) { conn->requestType = HTTPD_METHOD_OPTIONS; firstLine=1; + } else if (strstarts(h, "Host:")) { + i=5; + while (h[i]==' ') i++; + conn->hostName=&h[i]; } if (firstLine) { @@ -630,12 +633,12 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) { } else { conn->getArgs=NULL; } - } else if (strncmp(h, "Connection:", 11)==0) { + } else if (strstarts(h, "Connection:")) { i=11; //Skip trailing spaces while (h[i]==' ') i++; - if (strncmp(&h[i], "close", 5)==0) conn->priv->flags&=~HFL_CHUNKED; //Don't use chunked conn - } else if (strncmp(h, "Content-Length:", 15)==0) { + if (strstarts(&h[i], "close")) conn->priv->flags&=~HFL_CHUNKED; //Don't use chunked conn + } else if (strstarts(h, "Content-Length:")) { i=15; //Skip trailing spaces while (h[i]==' ') i++; @@ -652,7 +655,7 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) { dbg("Malloc'd buffer for %d + 1 bytes of post data.", conn->post->buffSize); conn->post->buff=(char*)malloc(conn->post->buffSize + 1); conn->post->buffLen=0; - } else if (strncmp(h, "Content-Type: ", 14)==0) { + } else if (strstarts(h, "Content-Type: ")) { if (strstr(h, "multipart/form-data")) { // It's multipart form data so let's pull out the boundary for future use char *b; @@ -663,7 +666,7 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) { dbg("boundary = %s", conn->post->multipartBoundary); } } - } else if (strncmp(h, "Access-Control-Request-Headers: ", 32)==0) { + } else if (strstarts(h, "Access-Control-Request-Headers: ")) { // CORS crap that needs to be repeated in the response info("CORS preflight request."); @@ -783,7 +786,7 @@ int ICACHE_FLASH_ATTR httpdConnectCb(ConnTypePtr conn, char *remIp, int remPort) int i; //Find empty conndata in pool - for (i=0; ipriv=malloc(sizeof(HttpdPriv)); - memset(connData[i]->priv, 0, sizeof(HttpdPriv)); - connData[i]->conn=conn; - connData[i]->slot=i; - connData[i]->priv->headPos=0; - connData[i]->post=malloc(sizeof(HttpdPostData)); - memset(connData[i]->post, 0, sizeof(HttpdPostData)); - connData[i]->post->buff=NULL; - connData[i]->post->buffLen=0; - connData[i]->post->received=0; - connData[i]->post->len=-1; - connData[i]->hostName=NULL; - connData[i]->remote_port=remPort; - connData[i]->priv->sendBacklog=NULL; - connData[i]->priv->sendBacklogSize=0; - memcpy(connData[i]->remote_ip, remIp, 4); + connPool[i]=malloc(sizeof(HttpdConnData)); + memset(connPool[i], 0, sizeof(HttpdConnData)); + connPool[i]->priv=malloc(sizeof(HttpdPriv)); + memset(connPool[i]->priv, 0, sizeof(HttpdPriv)); + connPool[i]->conn=conn; + connPool[i]->slot=i; + connPool[i]->priv->headPos=0; + connPool[i]->post=malloc(sizeof(HttpdPostData)); + memset(connPool[i]->post, 0, sizeof(HttpdPostData)); + connPool[i]->post->buff=NULL; + connPool[i]->post->buffLen=0; + connPool[i]->post->received=0; + connPool[i]->post->len=-1; + connPool[i]->hostName=NULL; + connPool[i]->remote_port=remPort; + connPool[i]->priv->sendBacklog=NULL; + connPool[i]->priv->sendBacklogSize=0; + memcpy(connPool[i]->remote_ip, remIp, 4); return 1; } @@ -826,7 +829,7 @@ void ICACHE_FLASH_ATTR httpdInit(HttpdBuiltInUrl *fixedUrls, int port) { int i; for (i=0; icgiData; int len; @@ -153,13 +153,13 @@ int ICACHE_FLASH_ATTR serveStaticFile(HttpdConnData *connData, const char* filep //This is a catch-all cgi function. It takes the url passed to it, looks up the corresponding //path in the filesystem and if it exists, passes the file through. This simulates what a normal //webserver would do with static files. -int ICACHE_FLASH_ATTR cgiEspFsHook(HttpdConnData *connData) +httpd_cgi_state cgiEspFsHook(HttpdConnData *connData) { return serveStaticFile(connData, connData->url); } -int ICACHE_FLASH_ATTR cgiEspFsFile(HttpdConnData *connData) +httpd_cgi_state ICACHE_FLASH_ATTR cgiEspFsFile(HttpdConnData *connData) { return serveStaticFile(connData, connData->cgiArg); } @@ -183,9 +183,9 @@ typedef struct { char *buff_e; } TplData; -typedef int (* TplCallback)(HttpdConnData *connData, char *token, void **arg); +typedef httpd_cgi_state (* TplCallback)(HttpdConnData *connData, char *token, void **arg); -int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData) +httpd_cgi_state ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData) { TplData *tpd = connData->cgiData; int len; @@ -289,7 +289,7 @@ int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData) tpd->chunk_resume = false; - int status = ((TplCallback)(connData->cgiArg))(connData, tpd->token, &tpd->tplArg); + httpd_cgi_state status = ((TplCallback)(connData->cgiArg))(connData, tpd->token, &tpd->tplArg); if (status == HTTPD_CGI_MORE) { // dbg("Multi-part tpl subst, saving parser state"); diff --git a/libesphttpd/include/cgiflash.h b/libesphttpd/include/cgiflash.h index 847621d..3ab1779 100644 --- a/libesphttpd/include/cgiflash.h +++ b/libesphttpd/include/cgiflash.h @@ -14,9 +14,9 @@ typedef struct { char *tagName; } CgiUploadFlashDef; -int cgiReadFlash(HttpdConnData *connData); -int cgiGetFirmwareNext(HttpdConnData *connData); -int cgiUploadFirmware(HttpdConnData *connData); -int cgiRebootFirmware(HttpdConnData *connData); +httpd_cgi_state cgiReadFlash(HttpdConnData *connData); +httpd_cgi_state cgiGetFirmwareNext(HttpdConnData *connData); +httpd_cgi_state cgiUploadFirmware(HttpdConnData *connData); +httpd_cgi_state cgiRebootFirmware(HttpdConnData *connData); #endif diff --git a/libesphttpd/include/cgiwebsocket.h b/libesphttpd/include/cgiwebsocket.h index f65253f..ba20b21 100644 --- a/libesphttpd/include/cgiwebsocket.h +++ b/libesphttpd/include/cgiwebsocket.h @@ -27,11 +27,12 @@ struct Websock { WebsockPriv *priv; }; -int ICACHE_FLASH_ATTR cgiWebsocket(HttpdConnData *connData); +httpd_cgi_state cgiWebsocket(HttpdConnData *connData); int ICACHE_FLASH_ATTR cgiWebsocketSend(Websock *ws, char *data, int len, int flags); void ICACHE_FLASH_ATTR cgiWebsocketClose(Websock *ws, int reason); -int ICACHE_FLASH_ATTR cgiWebSocketRecv(HttpdConnData *connData, char *data, int len); -int ICACHE_FLASH_ATTR cgiWebsockBroadcast(char *resource, char *data, int len, int flags); +httpd_cgi_state cgiWebSocketRecv(HttpdConnData *connData, char *data, int len); +//int ICACHE_FLASH_ATTR cgiWebsockBroadcast(char *resource, char *data, int len, int flags); -#endif \ No newline at end of file + +#endif diff --git a/libesphttpd/include/cgiwifi.h b/libesphttpd/include/cgiwifi.h index 21ef2fc..ed03d71 100644 --- a/libesphttpd/include/cgiwifi.h +++ b/libesphttpd/include/cgiwifi.h @@ -3,11 +3,11 @@ #include "httpd.h" -int cgiWiFiScan(HttpdConnData *connData); -int tplWlan(HttpdConnData *connData, char *token, void **arg); -int cgiWiFi(HttpdConnData *connData); -int cgiWiFiConnect(HttpdConnData *connData); -int cgiWiFiSetMode(HttpdConnData *connData); -int cgiWiFiConnStatus(HttpdConnData *connData); +httpd_cgi_state cgiWiFiScan(HttpdConnData *connData); +httpd_cgi_state tplWlan(HttpdConnData *connData, char *token, void **arg); +httpd_cgi_state cgiWiFi(HttpdConnData *connData); +httpd_cgi_state cgiWiFiConnect(HttpdConnData *connData); +httpd_cgi_state cgiWiFiSetMode(HttpdConnData *connData); +httpd_cgi_state cgiWiFiConnStatus(HttpdConnData *connData); -#endif \ No newline at end of file +#endif diff --git a/libesphttpd/include/httpd.h b/libesphttpd/include/httpd.h index 7224ed4..bd4f7cd 100644 --- a/libesphttpd/include/httpd.h +++ b/libesphttpd/include/httpd.h @@ -5,26 +5,34 @@ #define HTTPDVER "0.4-based" -#define HTTPD_CGI_MORE 0 -#define HTTPD_CGI_DONE 1 -#define HTTPD_CGI_NOTFOUND 2 -#define HTTPD_CGI_AUTHENTICATED 3 - -#define HTTPD_METHOD_GET 1 -#define HTTPD_METHOD_POST 2 -#define HTTPD_METHOD_OPTIONS 3 +typedef enum { + HTTPD_CGI_MORE = 0, + HTTPD_CGI_DONE = 1, + HTTPD_CGI_NOTFOUND = 2, + HTTPD_CGI_AUTHENTICATED = 3, +} httpd_cgi_state; + +typedef enum { + HTTPD_METHOD_GET = 1, + HTTPD_METHOD_POST = 2, + HTTPD_METHOD_OPTIONS = 3, + HTTPD_METHOD_PUT = 4, + HTTPD_METHOD_DELETE = 5, + HTTPD_METHOD_PATCH = 6, + HTTPD_METHOD_HEAD = 7, +} http_method; typedef struct HttpdPriv HttpdPriv; typedef struct HttpdConnData HttpdConnData; typedef struct HttpdPostData HttpdPostData; -typedef int (* cgiSendCallback)(HttpdConnData *connData); -typedef int (* cgiRecvHandler)(HttpdConnData *connData, char *data, int len); +typedef httpd_cgi_state (* cgiSendCallback)(HttpdConnData *connData); +typedef httpd_cgi_state (* cgiRecvHandler)(HttpdConnData *connData, char *data, int len); //A struct describing a http connection. This gets passed to cgi functions. struct HttpdConnData { ConnTypePtr conn; // The TCP connection. Exact type depends on the platform. - char requestType; // One of the HTTPD_METHOD_* values + http_method requestType; // method type char *url; // The URL requested, without hostname or GET arguments char *getArgs; // The GET arguments for this request, if any. @@ -89,9 +97,10 @@ typedef struct { -int cgiRedirect(HttpdConnData *connData); -int cgiRedirectToHostname(HttpdConnData *connData); -int cgiRedirectApClientToHostname(HttpdConnData *connData); +httpd_cgi_state cgiRedirect(HttpdConnData *connData); +httpd_cgi_state cgiRedirectToHostname(HttpdConnData *connData); +httpd_cgi_state cgiRedirectApClientToHostname(HttpdConnData *connData); + void httpdRedirect(HttpdConnData *conn, char *newUrl); int httpdUrlDecode(char *val, int valLen, char *ret, int retLen); int httpdFindArg(char *line, char *arg, char *buff, int buffLen); diff --git a/libesphttpd/include/httpdespfs.h b/libesphttpd/include/httpdespfs.h index cc4bff0..bf508b4 100644 --- a/libesphttpd/include/httpdespfs.h +++ b/libesphttpd/include/httpdespfs.h @@ -4,12 +4,12 @@ #include "httpd.h" /** Catch-all, use in '*' routes */ -int cgiEspFsHook(HttpdConnData *connData); +httpd_cgi_state cgiEspFsHook(HttpdConnData *connData); /** Template route */ -int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData); +httpd_cgi_state ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData); /** Static file route with the file as the first arg. */ -int ICACHE_FLASH_ATTR cgiEspFsFile(HttpdConnData *connData); +httpd_cgi_state ICACHE_FLASH_ATTR cgiEspFsFile(HttpdConnData *connData); #endif diff --git a/libesphttpd/util/cgiflash.c b/libesphttpd/util/cgiflash.c index 8a63bf6..bededa6 100644 --- a/libesphttpd/util/cgiflash.c +++ b/libesphttpd/util/cgiflash.c @@ -43,7 +43,7 @@ static int ICACHE_FLASH_ATTR checkEspfsHeader(void *buf) { // Cgi to query which firmware needs to be uploaded next -int ICACHE_FLASH_ATTR cgiGetFirmwareNext(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiGetFirmwareNext(HttpdConnData *connData) { if (connData->conn==NULL) { //Connection aborted. Clean up. return HTTPD_CGI_DONE; @@ -62,7 +62,7 @@ int ICACHE_FLASH_ATTR cgiGetFirmwareNext(HttpdConnData *connData) { //Cgi that reads the SPI flash. Assumes 512KByte flash. //ToDo: Figure out real flash size somehow? -int ICACHE_FLASH_ATTR cgiReadFlash(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiReadFlash(HttpdConnData *connData) { int *pos=(int *)&connData->cgiData; if (connData->conn==NULL) { //Connection aborted. Clean up. @@ -123,7 +123,7 @@ typedef struct __attribute__((packed)) { } OtaHeader; -int ICACHE_FLASH_ATTR cgiUploadFirmware(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiUploadFirmware(HttpdConnData *connData) { CgiUploadFlashDef *def=(CgiUploadFlashDef*)connData->cgiArg; UploadState *state=(UploadState *)connData->cgiData; int len; @@ -302,7 +302,7 @@ static void ICACHE_FLASH_ATTR resetTimerCb(void *arg) { } // Handle request to reboot into the new firmware -int ICACHE_FLASH_ATTR cgiRebootFirmware(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiRebootFirmware(HttpdConnData *connData) { if (connData->conn==NULL) { //Connection aborted. Clean up. return HTTPD_CGI_DONE; diff --git a/libesphttpd/util/cgiwebsocket.c b/libesphttpd/util/cgiwebsocket.c index cf0c958..3b34642 100644 --- a/libesphttpd/util/cgiwebsocket.c +++ b/libesphttpd/util/cgiwebsocket.c @@ -119,26 +119,27 @@ int ICACHE_FLASH_ATTR cgiWebsocketSend(Websock *ws, char *data, int len, int fla return r; } -//Broadcast data to all websockets at a specific url. Returns the amount of connections sent to. -int ICACHE_FLASH_ATTR cgiWebsockBroadcast(char *resource, char *data, int len, int flags) { -//This is majorly broken (and actually, always, it just tended to work because the circumstances -//were juuuust right). Because the socket is used outside of the httpd send/receive context, it -//will not have an associated send buffer. This means httpdSend will write to a dangling pointer! -//Disabled for now. If you really need this, open an issue on github or otherwise poke me and I'll -//see what I can do. -/* - Websock *lw=llStart; - int ret=0; - while (lw!=NULL) { - if (strcmp(lw->conn->url, resource)==0) { - cgiWebsocketSend(lw, data, len, flags); - ret++; - } - lw=lw->priv->next; - } - return ret;*/ - return 0; -} + +////Broadcast data to all websockets at a specific url. Returns the amount of connections sent to. +//int ICACHE_FLASH_ATTR cgiWebsockBroadcast(char *resource, char *data, int len, int flags) { +////This is majorly broken (and actually, always, it just tended to work because the circumstances +////were juuuust right). Because the socket is used outside of the httpd send/receive context, it +////will not have an associated send buffer. This means httpdSend will write to a dangling pointer! +////Disabled for now. If you really need this, open an issue on github or otherwise poke me and I'll +////see what I can do. +///* +// Websock *lw=llStart; +// int ret=0; +// while (lw!=NULL) { +// if (strcmp(lw->conn->url, resource)==0) { +// cgiWebsocketSend(lw, data, len, flags); +// ret++; +// } +// lw=lw->priv->next; +// } +// return ret;*/ +// return 0; +//} void ICACHE_FLASH_ATTR cgiWebsocketClose(Websock *ws, int reason) { @@ -167,7 +168,7 @@ static void ICACHE_FLASH_ATTR websockFree(Websock *ws) { if (ws->priv) free(ws->priv); } -int ICACHE_FLASH_ATTR cgiWebSocketRecv(HttpdConnData *connData, char *data, int len) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiWebSocketRecv(HttpdConnData *connData, char *data, int len) { int i, j, sl; int r=HTTPD_CGI_MORE; int wasHeaderByte; @@ -280,7 +281,7 @@ int ICACHE_FLASH_ATTR cgiWebSocketRecv(HttpdConnData *connData, char *data, int } //Websocket 'cgi' implementation -int ICACHE_FLASH_ATTR cgiWebsocket(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiWebsocket(HttpdConnData *connData) { char buff[256]; int i; sha1nfo s; diff --git a/libesphttpd/util/cgiwifi.c b/libesphttpd/util/cgiwifi.c index d032297..6ff9602 100644 --- a/libesphttpd/util/cgiwifi.c +++ b/libesphttpd/util/cgiwifi.c @@ -130,7 +130,7 @@ static void ICACHE_FLASH_ATTR wifiStartScan() { //This CGI is called from the bit of AJAX-code in wifi.tpl. It will initiate a //scan for access points and if available will return the result of an earlier scan. //The result is embedded in a bit of JSON parsed by the javascript in wifi.tpl. -int ICACHE_FLASH_ATTR cgiWiFiScan(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiWiFiScan(HttpdConnData *connData) { int pos=(int)connData->cgiData; int len; char buff[256]; @@ -226,7 +226,7 @@ static void ICACHE_FLASH_ATTR reassTimerCb(void *arg) { //This cgi uses the routines above to connect to a specific access point with the //given ESSID using the given password. -int ICACHE_FLASH_ATTR cgiWiFiConnect(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiWiFiConnect(HttpdConnData *connData) { char essid[128]; char passwd[128]; static os_timer_t reassTimer; @@ -258,7 +258,7 @@ int ICACHE_FLASH_ATTR cgiWiFiConnect(HttpdConnData *connData) { //This cgi uses the routines above to connect to a specific access point with the //given ESSID using the given password. -int ICACHE_FLASH_ATTR cgiWiFiSetMode(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiWiFiSetMode(HttpdConnData *connData) { int len; char buff[64]; @@ -282,7 +282,7 @@ int ICACHE_FLASH_ATTR cgiWiFiSetMode(HttpdConnData *connData) { return HTTPD_CGI_DONE; } -int ICACHE_FLASH_ATTR cgiWiFiConnStatus(HttpdConnData *connData) { +httpd_cgi_state ICACHE_FLASH_ATTR cgiWiFiConnStatus(HttpdConnData *connData) { char buff[256]; int len; struct ip_info info; @@ -314,7 +314,7 @@ int ICACHE_FLASH_ATTR cgiWiFiConnStatus(HttpdConnData *connData) { } //Template code for the WLAN page. -int ICACHE_FLASH_ATTR tplWlan(HttpdConnData *connData, char *token, void **arg) { +httpd_cgi_state ICACHE_FLASH_ATTR tplWlan(HttpdConnData *connData, char *token, void **arg) { char buff[256]; int x; static struct station_config stconf; diff --git a/sbmp b/sbmp index b2fca26..70e41c9 160000 --- a/sbmp +++ b/sbmp @@ -1 +1 @@ -Subproject commit b2fca263f880869744bb086047d394d32e13117d +Subproject commit 70e41c91e5daabeb6e39a02df9baeadb3995b700 diff --git a/user/cgi_ping.c b/user/cgi_ping.c index 40b1fe8..caf1027 100644 --- a/user/cgi_ping.c +++ b/user/cgi_ping.c @@ -1,6 +1,6 @@ #include "cgi_ping.h" -int FLASH_FN cgiPing(HttpdConnData *connData) +httpd_cgi_state FLASH_FN cgiPing(HttpdConnData *connData) { if (connData->conn==NULL) { //Connection aborted. Clean up. @@ -8,6 +8,7 @@ int FLASH_FN cgiPing(HttpdConnData *connData) } httpdStartResponse(connData, 200); + httpdHeader(connData, "Content-Type", "text/plain"); httpdEndHeaders(connData); httpdSend(connData, "pong\n", -1); diff --git a/user/cgi_ping.h b/user/cgi_ping.h index 801baa5..c500697 100644 --- a/user/cgi_ping.h +++ b/user/cgi_ping.h @@ -6,6 +6,6 @@ // this is used by the UI to check if server is already restarted and working again. -int cgiPing(HttpdConnData *connData); +httpd_cgi_state cgiPing(HttpdConnData *connData); #endif // CGI_PING_H diff --git a/user/cgi_reset.c b/user/cgi_reset.c index 5dfd7b8..e11bee4 100644 --- a/user/cgi_reset.c +++ b/user/cgi_reset.c @@ -7,7 +7,7 @@ static void FLASH_FN tmrCb(void *arg) system_restart(); } -int FLASH_FN cgiResetDevice(HttpdConnData *connData) +httpd_cgi_state FLASH_FN cgiResetDevice(HttpdConnData *connData) { if (connData->conn==NULL) { //Connection aborted. Clean up. @@ -15,6 +15,7 @@ int FLASH_FN cgiResetDevice(HttpdConnData *connData) } httpdStartResponse(connData, 200); + httpdHeader(connData, "Content-Type", "text/plain"); httpdEndHeaders(connData); os_timer_disarm(&tmr); diff --git a/user/cgi_reset.h b/user/cgi_reset.h index fdd4491..a7b6927 100644 --- a/user/cgi_reset.h +++ b/user/cgi_reset.h @@ -4,6 +4,6 @@ #include #include -int cgiResetDevice(HttpdConnData *connData); +httpd_cgi_state cgiResetDevice(HttpdConnData *connData); #endif // CGI_RESET_H diff --git a/user/datalink.h b/user/datalink.h index f03f5ab..a63058a 100644 --- a/user/datalink.h +++ b/user/datalink.h @@ -12,6 +12,7 @@ #define DG_REQUEST_COMPARE_REF 43 + extern SBMP_Endpoint *dlnk_ep; void datalinkInit(void); diff --git a/user/page_about.c b/user/page_about.c index 19aefe6..fe987cb 100644 --- a/user/page_about.c +++ b/user/page_about.c @@ -5,7 +5,7 @@ #include "sbmp.h" /** "About" page */ -int FLASH_FN tplAbout(HttpdConnData *connData, char *token, void **arg) +httpd_cgi_state FLASH_FN tplAbout(HttpdConnData *connData, char *token, void **arg) { // arg is unused (void)arg; diff --git a/user/page_about.h b/user/page_about.h index db47f99..4165ed1 100644 --- a/user/page_about.h +++ b/user/page_about.h @@ -3,6 +3,6 @@ #include -int tplAbout(HttpdConnData *connData, char *token, void **arg); +httpd_cgi_state tplAbout(HttpdConnData *connData, char *token, void **arg); #endif // PAGE_ABOUT_H diff --git a/user/page_monitoring.c b/user/page_monitoring.c index 35cc8ae..8472546 100644 --- a/user/page_monitoring.c +++ b/user/page_monitoring.c @@ -1,11 +1,124 @@ #include #include #include "page_monitoring.h" +#include "reporting.h" +#include "ftoa.h" + + +httpd_cgi_state FLASH_FN cgiMonCompare(HttpdConnData *connData) +{ + if (connData->conn == NULL) { + //Connection aborted. Clean up. + return HTTPD_CGI_DONE; + } + + httpdStartResponse(connData, 200); + httpdHeader(connData, "Content-Type", "application/json"); + httpdEndHeaders(connData); + + // this is semi-async (waits for completion) + bool suc = capture_and_report(); + + char buf[100]; + + if (suc && rpt_result.ready) { + // success + sprintf(buf, "{\"success\": true, \"deviation\": "); + my_ftoa(buf+strlen(buf),rpt_result.deviation, 2); + sprintf(buf, ", \"rms\": "); + my_ftoa(buf+strlen(buf),rpt_result.i_rms, 2); + sprintf(buf, "}"); + + httpdSend(connData, buf, -1); + } else { + httpdSend(connData, "{\"success\": false}", -1); + } + + return HTTPD_CGI_DONE; +} + + +httpd_cgi_state FLASH_FN cgiMonSetRef(HttpdConnData *connData) +{ + if (connData->conn == NULL) { + //Connection aborted. Clean up. + return HTTPD_CGI_DONE; + } + + httpdStartResponse(connData, 200); + httpdHeader(connData, "Content-Type", "application/json"); + httpdEndHeaders(connData); + + // this is semi-async (waits for completion) + bool suc = capture_reporting_reference(); + httpdSend(connData, suc ? "{\"success\": true}" : "{\"success\": false}", -1); + + return HTTPD_CGI_DONE; +} + + +httpd_cgi_state FLASH_FN cgiMonitoringCfg(HttpdConnData *connData) +{ + if (connData->conn == NULL) { + //Connection aborted. Clean up. + return HTTPD_CGI_DONE; + } + + httpdStartResponse(connData, 200); + httpdHeader(connData, "Content-Type", "application/json"); + httpdEndHeaders(connData); + + // TODO + HttpdPostData *post = connData->post; + if (post != NULL) { + char buf[64]; + int blen; + + // enabled=1 + blen = httpdFindArg(post->buff, "enabled", buf, 64); + if (blen == -1) { + // wasn't found + rpt_conf.enabled = false; + } else { + rpt_conf.enabled = (buf[0] == '1'); + } + + // interval=secs + blen = httpdFindArg(post->buff, "enabled", buf, 64); + if (blen != -1) { + rpt_conf.interval = (uint32_t)atoi(buf); + } + + // service=xv or ts + blen = httpdFindArg(post->buff, "service", buf, 64); + if (blen != -1) { + rpt_conf.service = (buf[0] == 'x' ? RPT_XIVELY: RPT_THINGSPEAK); + } + + // feed + blen = httpdFindArg(post->buff, "feed", buf, 64); + if (blen != -1) { + strcpy(rpt_conf.feed, buf); + } + + // key + blen = httpdFindArg(post->buff, "key", buf, 64); + if (blen != -1) { + strcpy(rpt_conf.key, buf); + } + + // Save & Apply + reporting_cfg_save(); + } + + httpdRedirect(connData, "/monitoring"); + return HTTPD_CGI_DONE; +} + /** "Monitoring" page - fill form fields */ -int FLASH_FN tplMonitoring(HttpdConnData *connData, char *token, void **arg) +httpd_cgi_state FLASH_FN tplMonitoring(HttpdConnData *connData, char *token, void **arg) { - // arg is unused (void)arg; char buf[20]; @@ -15,24 +128,46 @@ int FLASH_FN tplMonitoring(HttpdConnData *connData, char *token, void **arg) if (streq(token, "refStored")) { httpdSend(connData, true ? "OK" : "Not set!", -1); // fixme + } else if (streq(token, "curDeviation")) { + // current deviation + if (rpt_result.ready) { + my_ftoa(buf, rpt_result.deviation, 2); + } else { + sprintf(buf, "--"); + } + httpdSend(connData, buf, -1); + + } else if (streq(token, "curRMS")) { + // current deviation + if (rpt_result.ready) { + my_ftoa(buf, rpt_result.i_rms, 2); + } else { + sprintf(buf, "--"); + } + httpdSend(connData, buf, -1); + } else if (streq(token, "repEnableCheck")) { - if (true) httpdSend(connData, "checked", -1); // fixme + if (rpt_conf.enabled) httpdSend(connData, "checked", -1); - } else if (streq(token, "repInterval")) { - sprintf(buf, "%d", 123); // fixme + } else if (streq(token, "repInterval")) { // interval in seconds + sprintf(buf, "%d", rpt_conf.interval); httpdSend(connData, buf, -1); - } else if (streq(token, "repSvcCheckXv")) { // Xively - if (true) httpdSend(connData, "checked", -1); // fixme + } else if (streq(token, "repSvcCheckXv")) { // Xively checkbox + if (rpt_conf.service == RPT_XIVELY) { + httpdSend(connData, "checked", -1); + } - } else if (streq(token, "repSvcCheckTs")) { // ThingSpeak - if (true) httpdSend(connData, "checked", -1); // fixme + } else if (streq(token, "repSvcCheckTs")) { // ThingSpeak checkbox + if (rpt_conf.service == RPT_THINGSPEAK) { + httpdSend(connData, "checked", -1); + } - } else if (streq(token, "repFeed")) { - httpdSend(connData, "null", -1); // fixme + } else if (streq(token, "repFeed")) { // reporting feed ID + httpdSend(connData, rpt_conf.feed, -1); - } else if (streq(token, "repKey")) { - httpdSend(connData, "null", -1); // fixme + } else if (streq(token, "repKey")) { // reporting key + httpdSend(connData, rpt_conf.key, -1); } return HTTPD_CGI_DONE; diff --git a/user/page_monitoring.h b/user/page_monitoring.h index 3cd8991..a5cc406 100644 --- a/user/page_monitoring.h +++ b/user/page_monitoring.h @@ -3,6 +3,12 @@ #include -int tplMonitoring(HttpdConnData *connData, char *token, void **arg); +httpd_cgi_state tplMonitoring(HttpdConnData *connData, char *token, void **arg); + +httpd_cgi_state cgiMonCompare(HttpdConnData *connData); + +httpd_cgi_state cgiMonSetRef(HttpdConnData *connData); + +httpd_cgi_state cgiMonitoringCfg(HttpdConnData *connData); #endif // PAGE_MONITORING_H diff --git a/user/page_status.c b/user/page_status.c index 43ea34b..8d38561 100644 --- a/user/page_status.c +++ b/user/page_status.c @@ -7,7 +7,7 @@ /** System Status page */ -int FLASH_FN tplSystemStatus(HttpdConnData *connData, char *token, void **arg) +httpd_cgi_state FLASH_FN tplSystemStatus(HttpdConnData *connData, char *token, void **arg) { // arg is unused (void)arg; diff --git a/user/page_status.h b/user/page_status.h index a6727e2..baf3351 100644 --- a/user/page_status.h +++ b/user/page_status.h @@ -3,6 +3,6 @@ #include -int tplSystemStatus(HttpdConnData *connData, char *token, void **arg); +httpd_cgi_state tplSystemStatus(HttpdConnData *connData, char *token, void **arg); #endif // PAGE_HOME_H diff --git a/user/page_waveform.c b/user/page_waveform.c index ae83dc1..1be65c1 100644 --- a/user/page_waveform.c +++ b/user/page_waveform.c @@ -19,22 +19,22 @@ typedef struct { } tplReadSamplesJSON_state; -static int FLASH_FN tplSamplesJSON(MEAS_FORMAT fmt, HttpdConnData *connData, char *token, void **arg); +static httpd_cgi_state FLASH_FN tplSamplesJSON(MEAS_FORMAT fmt, HttpdConnData *connData, char *token, void **arg); -int FLASH_FN tplWaveformJSON(HttpdConnData *connData, char *token, void **arg) +httpd_cgi_state FLASH_FN tplWaveformJSON(HttpdConnData *connData, char *token, void **arg) { return tplSamplesJSON(RAW, connData, token, arg); } -int FLASH_FN tplFourierJSON(HttpdConnData *connData, char *token, void **arg) +httpd_cgi_state FLASH_FN tplFourierJSON(HttpdConnData *connData, char *token, void **arg) { return tplSamplesJSON(FFT, connData, token, arg); } -static int FLASH_FN tplSamplesJSON(MEAS_FORMAT fmt, HttpdConnData *connData, char *token, void **arg) +static httpd_cgi_state FLASH_FN tplSamplesJSON(MEAS_FORMAT fmt, HttpdConnData *connData, char *token, void **arg) { char buff[128]; int len; diff --git a/user/page_waveform.h b/user/page_waveform.h index 068a1a8..0c08fb0 100644 --- a/user/page_waveform.h +++ b/user/page_waveform.h @@ -3,8 +3,8 @@ #include -int tplWaveformJSON(HttpdConnData *connData, char *token, void **arg); +httpd_cgi_state tplWaveformJSON(HttpdConnData *connData, char *token, void **arg); -int tplFourierJSON(HttpdConnData *connData, char *token, void **arg); +httpd_cgi_state tplFourierJSON(HttpdConnData *connData, char *token, void **arg); #endif // PAGE_WAVEFORM_H diff --git a/user/reporting.c b/user/reporting.c index edf4b53..049988a 100644 --- a/user/reporting.c +++ b/user/reporting.c @@ -1,6 +1,7 @@ #include "reporting.h" #include "datalink.h" #include "serial.h" +#include "httpclient.h" #define RPT_CONF_MAGIC 0x24C595D5 @@ -10,94 +11,184 @@ ReportingCfg rpt_conf; static os_timer_t rpt_tim; /** Timer cb */ -static void rpt_tim_cb(void *arg) +static void FLASH_FN rpt_tim_cb(void *arg) { (void)arg; - reporting_send_now(); + // send report now... + if (rpt_conf.enabled) { + capture_and_report(); + } } /** Stop / start timer & set interval based on rpt conf */ -static void set_timer(void) +static FLASH_FN void set_timer(void) { os_timer_disarm(&rpt_tim); if (rpt_conf.enabled) { os_timer_setfn(&rpt_tim, rpt_tim_cb, NULL); - os_timer_arm(&rpt_tim, (int)(rpt_conf.interval*1000), 1); + os_timer_arm(&rpt_tim, (int)(rpt_conf.interval * 1000), 1); } } /** Fix unterminated strings, add magic, etc.. */ -static void normalize_rpt_conf(void) +static FLASH_FN void normalize_rpt_conf(void) { // terminate strings - rpt_conf.feed[sizeof(rpt_conf.feed)-1] = 0; - rpt_conf.key[sizeof(rpt_conf.key)-1] = 0; + rpt_conf.feed[sizeof(rpt_conf.feed) - 1] = 0; + rpt_conf.key[sizeof(rpt_conf.key) - 1] = 0; // set magic rpt_conf.magic = RPT_CONF_MAGIC; } +static FLASH_FN void dump_rpt_conf(void) +{ + dbg("Enabled: %d | Interval: %d | Service: %s", rpt_conf.enabled, rpt_conf.interval, (rpt_conf.service == RPT_XIVELY ? "Xively" : "ThingSpeak")); + dbg("Key: %s | Feed: %s", rpt_conf.key, rpt_conf.feed); +} + /** Save reporting config to flash */ -void reporting_save(void) +void FLASH_FN reporting_cfg_save(void) { normalize_rpt_conf(); // fix weirdness + + info("Saving monitoring config"); + dump_rpt_conf(); + system_param_save_with_protect(0x3D, &rpt_conf, sizeof(ReportingCfg)); // start timer for the new interval time set_timer(); + + info("Config saved."); } /** Load the reporting config from flash */ -void reporting_load(void) +void FLASH_FN reporting_cfg_load(void) { + info("Loading monitoring config"); + system_param_load(0x3D, 0, &rpt_conf, sizeof(ReportingCfg)); if (rpt_conf.magic != RPT_CONF_MAGIC) { + warn("Config block corrupted, reset to defaults."); + // invalid config, zero out memset(&rpt_conf, 0, sizeof(ReportingCfg)); rpt_conf.magic = RPT_CONF_MAGIC; // save fixed - reporting_save(); + reporting_cfg_save(); + } else { + dump_rpt_conf(); } set_timer(); + + info("Config loaded."); } -void compare_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void **obj) +/** Called when response to Compare Ref is received */ +static void FLASH_FN compare_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void **obj) { (void)obj; sbmp_ep_remove_listener(ep, dg->session); + info("Measurement complete."); + PayloadParser pp = pp_start(dg->payload, dg->length); rpt_result.deviation = pp_float(&pp); - rpt_result.rms = pp_float(&pp); + rpt_result.i_rms = pp_float(&pp); + + rpt_result.ready = true; // signal to waiting loop +} + + +/** Send report from rpt_result */ +static void FLASH_FN do_send_report(void) +{ + info("Sending report..."); + switch (rpt_conf.service) { + case RPT_XIVELY: + // TODO send request + break; + + case RPT_THINGSPEAK: + break; + } } + /** Immediately send report to xively / thingspeak */ -void reporting_send_now(void) +bool FLASH_FN capture_and_report(void) { + info("Starting reporting measurmenet..."); + rpt_result.ready = false; + uint16_t sesn; sbmp_ep_send_message(dlnk_ep, DG_REQUEST_COMPARE_REF, NULL, 0, &sesn, NULL); sbmp_ep_add_listener(dlnk_ep, sesn, compare_ref_cb, NULL); // poll & wait for response const int timeout = 500; - for (uint32_t i = 0; i < timeout*100; i++) { - uart_poll(); // can stop measure & start first chunk, if rx offer + for (uint32_t i = 0; i < timeout * 100; i++) { + uart_poll(); - // check for closed connection - aborted by peer? - if (meas_is_closed()) { - error("Session closed by peer, readout failed."); - return false; // assume already cleaned up + if (rpt_result.ready) { + do_send_report(); + return true; // done } - if (meas_chunk_ready()) { - // yay!! - return true; + os_delay_us(10); + system_soft_wdt_feed(); // Feed the dog, or it'll bite. + } + + // timeout - remove listener + error("Measure timeout - no resp received."); + sbmp_ep_remove_listener(dlnk_ep, sesn); + return false; +} + + +static bool capt_ref_done; +static bool capt_ref_success; + +/** Callback for "store ref" */ +static void FLASH_FN store_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void **obj) +{ + (void)obj; + sbmp_ep_remove_listener(ep, dg->session); + + capt_ref_done = true; + capt_ref_success = (dg->type == DG_SUCCESS); +} + +/** Capture reference vector for monitoring */ +bool FLASH_FN capture_reporting_reference(void) +{ + info("Capturing refernece..."); + + uint16_t sesn; + sbmp_ep_send_message(dlnk_ep, DG_REQUEST_STORE_REF, NULL, 0, &sesn, NULL); + sbmp_ep_add_listener(dlnk_ep, sesn, store_ref_cb, NULL); + + capt_ref_done = false; + capt_ref_success = false; + + const int timeout = 500; + for (uint32_t i = 0; i < timeout * 100; i++) { + uart_poll(); + + if (capt_ref_done) { + return capt_ref_success; // done } os_delay_us(10); system_soft_wdt_feed(); // Feed the dog, or it'll bite. } + + // timeout - remove listener + error("Ref capture timeout - no resp received."); + sbmp_ep_remove_listener(dlnk_ep, sesn); + return false; } diff --git a/user/reporting.h b/user/reporting.h index ab16a53..aea8f6c 100644 --- a/user/reporting.h +++ b/user/reporting.h @@ -5,14 +5,14 @@ typedef struct { // 0 - bool enabled : 4; + bool enabled; // 4 uint32_t interval; // 8 enum { RPT_XIVELY, RPT_THINGSPEAK - } service : 4; + } service; // 12 char feed[64]; // 76 @@ -23,23 +23,28 @@ typedef struct { /** Comapre result is stored here */ typedef struct { - bool ready : 4; + bool ready; float deviation; - float rms; + float i_rms; } ReportingResult; +/** Report result */ extern ReportingResult rpt_result; /** Reporting config struct */ extern ReportingCfg rpt_conf; + /** Save reporting config to flash */ -void reporting_save(void); +void reporting_cfg_save(void); /** Load the reporting config from flash */ -void reporting_load(void); +void reporting_cfg_load(void); /** Immediately send report to xively / thingspeak */ -void reporting_send_now(void); +bool capture_and_report(void); + +/** Capture reference vector for monitoring */ +bool capture_reporting_reference(void); #endif // REPORTING_H diff --git a/user/routes.c b/user/routes.c index e250b7e..295ef2f 100644 --- a/user/routes.c +++ b/user/routes.c @@ -47,6 +47,10 @@ HttpdBuiltInUrl builtInUrls[] = { ROUTE_TPL_FILE("/measure/raw", tplWaveformJSON, "/json/samples.tpl"), ROUTE_TPL_FILE("/measure/fft", tplFourierJSON, "/json/samples.tpl"), + ROUTE_CGI("/mon/compare", cgiMonCompare), + ROUTE_CGI("/mon/setref", cgiMonSetRef), + ROUTE_CGI("/mon/config", cgiMonitoringCfg), // redirects to /monitoring + // --- UI pages --- // System Status page ROUTE_TPL_FILE("/", tplSystemStatus, "/pages/status.tpl"), diff --git a/user/user_main.c b/user/user_main.c index aebe2d9..22d65c5 100644 --- a/user/user_main.c +++ b/user/user_main.c @@ -23,14 +23,14 @@ #include "routes.h" #include "fw_version.h" -#include "httpclient.h" +#include "reporting.h" extern HttpdBuiltInUrl builtInUrls[]; static ETSTimer prSecondTimer; /** Timer called each second */ -static void ICACHE_FLASH_ATTR prSecondTimerCb(void *arg) +static void FLASH_FN prSecondTimerCb(void *arg) { (void)arg; @@ -112,6 +112,9 @@ void user_init(void) httpdInit(builtInUrls, 80); + // start reporting timer + reporting_cfg_load(); + printf(LOG_EOL); info("Ready"); printf(LOG_EOL); From c883c02788316c36d0ffdbcfa67679e1776c1536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 20:53:16 +0200 Subject: [PATCH 07/11] working param setting etc.. Former-commit-id: 5e5f4be8455add9305cc6fd6bf4c2dba280bd796 --- html/pages/monitoring.tpl | 14 +++++------ html_src/page_monitoring.php | 14 +++++------ libesphttpd/core/httpd.c | 2 +- libesphttpd/html-minifier-conf.json | 2 +- user/page_monitoring.c | 38 ++++++++++------------------- user/reporting.c | 21 +++++++++++----- user/reporting.h | 1 + 7 files changed, 45 insertions(+), 47 deletions(-) diff --git a/html/pages/monitoring.tpl b/html/pages/monitoring.tpl index 97661f5..1e39184 100644 --- a/html/pages/monitoring.tpl +++ b/html/pages/monitoring.tpl @@ -36,11 +36,11 @@ - + @@ -55,7 +55,7 @@ @@ -69,8 +69,8 @@ diff --git a/html_src/page_monitoring.php b/html_src/page_monitoring.php index 8753b32..9b36405 100644 --- a/html_src/page_monitoring.php +++ b/html_src/page_monitoring.php @@ -13,11 +13,11 @@ - + @@ -32,7 +32,7 @@ @@ -46,8 +46,8 @@ diff --git a/libesphttpd/core/httpd.c b/libesphttpd/core/httpd.c index f2b17bd..a2adf4e 100644 --- a/libesphttpd/core/httpd.c +++ b/libesphttpd/core/httpd.c @@ -207,7 +207,7 @@ int ICACHE_FLASH_ATTR httpdFindArg(char *line, char *arg, char *buff, int buffLe p=(char*)strstr(p, "&"); if (p!=NULL) p+=1; } - warn("Finding %s in %s: Not found :/", arg, line); +// warn("Finding %s in %s: Not found :/", arg, line); return -1; //not found } diff --git a/libesphttpd/html-minifier-conf.json b/libesphttpd/html-minifier-conf.json index d413316..eaa3b9b 100644 --- a/libesphttpd/html-minifier-conf.json +++ b/libesphttpd/html-minifier-conf.json @@ -7,7 +7,7 @@ "collapseBooleanAttributes": true, "removeTagWhitespace": true, "removeAttributeQuotes": true, - "removeRedundantAttributes": true, + "removeRedundantAttributes": false, "useShortDoctype": true, "removeEmptyAttributes": true, "removeScriptTypeAttributes": true, diff --git a/user/page_monitoring.c b/user/page_monitoring.c index 8472546..6acf147 100644 --- a/user/page_monitoring.c +++ b/user/page_monitoring.c @@ -7,10 +7,7 @@ httpd_cgi_state FLASH_FN cgiMonCompare(HttpdConnData *connData) { - if (connData->conn == NULL) { - //Connection aborted. Clean up. - return HTTPD_CGI_DONE; - } + if (connData->conn == NULL) return HTTPD_CGI_DONE; httpdStartResponse(connData, 200); httpdHeader(connData, "Content-Type", "application/json"); @@ -23,11 +20,12 @@ httpd_cgi_state FLASH_FN cgiMonCompare(HttpdConnData *connData) if (suc && rpt_result.ready) { // success - sprintf(buf, "{\"success\": true, \"deviation\": "); - my_ftoa(buf+strlen(buf),rpt_result.deviation, 2); - sprintf(buf, ", \"rms\": "); - my_ftoa(buf+strlen(buf),rpt_result.i_rms, 2); - sprintf(buf, "}"); + char *bb = buf; + bb += sprintf(bb, "{\"success\": true, \"deviation\": "); + bb += my_ftoa(bb,rpt_result.deviation, 2); + bb += sprintf(bb, ", \"rms\": "); + bb += my_ftoa(bb,rpt_result.i_rms, 2); + bb += sprintf(bb, "}"); httpdSend(connData, buf, -1); } else { @@ -40,10 +38,7 @@ httpd_cgi_state FLASH_FN cgiMonCompare(HttpdConnData *connData) httpd_cgi_state FLASH_FN cgiMonSetRef(HttpdConnData *connData) { - if (connData->conn == NULL) { - //Connection aborted. Clean up. - return HTTPD_CGI_DONE; - } + if (connData->conn == NULL) return HTTPD_CGI_DONE; httpdStartResponse(connData, 200); httpdHeader(connData, "Content-Type", "application/json"); @@ -59,14 +54,7 @@ httpd_cgi_state FLASH_FN cgiMonSetRef(HttpdConnData *connData) httpd_cgi_state FLASH_FN cgiMonitoringCfg(HttpdConnData *connData) { - if (connData->conn == NULL) { - //Connection aborted. Clean up. - return HTTPD_CGI_DONE; - } - - httpdStartResponse(connData, 200); - httpdHeader(connData, "Content-Type", "application/json"); - httpdEndHeaders(connData); + if (connData->conn == NULL) return HTTPD_CGI_DONE; // TODO HttpdPostData *post = connData->post; @@ -84,7 +72,7 @@ httpd_cgi_state FLASH_FN cgiMonitoringCfg(HttpdConnData *connData) } // interval=secs - blen = httpdFindArg(post->buff, "enabled", buf, 64); + blen = httpdFindArg(post->buff, "interval", buf, 64); if (blen != -1) { rpt_conf.interval = (uint32_t)atoi(buf); } @@ -146,19 +134,19 @@ httpd_cgi_state FLASH_FN tplMonitoring(HttpdConnData *connData, char *token, voi } httpdSend(connData, buf, -1); - } else if (streq(token, "repEnableCheck")) { + } else if (streq(token, "rep_en")) { if (rpt_conf.enabled) httpdSend(connData, "checked", -1); } else if (streq(token, "repInterval")) { // interval in seconds sprintf(buf, "%d", rpt_conf.interval); httpdSend(connData, buf, -1); - } else if (streq(token, "repSvcCheckXv")) { // Xively checkbox + } else if (streq(token, "svc_xv")) { // Xively checkbox if (rpt_conf.service == RPT_XIVELY) { httpdSend(connData, "checked", -1); } - } else if (streq(token, "repSvcCheckTs")) { // ThingSpeak checkbox + } else if (streq(token, "svc_ts")) { // ThingSpeak checkbox if (rpt_conf.service == RPT_THINGSPEAK) { httpdSend(connData, "checked", -1); } diff --git a/user/reporting.c b/user/reporting.c index 049988a..20d1fdf 100644 --- a/user/reporting.c +++ b/user/reporting.c @@ -96,9 +96,15 @@ static void FLASH_FN compare_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void * info("Measurement complete."); - PayloadParser pp = pp_start(dg->payload, dg->length); - rpt_result.deviation = pp_float(&pp); - rpt_result.i_rms = pp_float(&pp); + rpt_result.success = (dg->type == DG_SUCCESS); + + if (dg->type == DG_SUCCESS) { + PayloadParser pp = pp_start(dg->payload, dg->length); + rpt_result.deviation = pp_float(&pp); + rpt_result.i_rms = pp_float(&pp); + } else { + error("FAIL resp from sbmp."); + } rpt_result.ready = true; // signal to waiting loop } @@ -110,10 +116,11 @@ static void FLASH_FN do_send_report(void) info("Sending report..."); switch (rpt_conf.service) { case RPT_XIVELY: - // TODO send request + warn("------- TODO: REPORT TO XIVELY -------"); break; case RPT_THINGSPEAK: + warn("------- TODO: REPORT TO THINGSPEAK -------"); break; } } @@ -135,7 +142,9 @@ bool FLASH_FN capture_and_report(void) uart_poll(); if (rpt_result.ready) { - do_send_report(); + if (rpt_result.success) { + do_send_report(); + } return true; // done } @@ -166,7 +175,7 @@ static void FLASH_FN store_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void **o /** Capture reference vector for monitoring */ bool FLASH_FN capture_reporting_reference(void) { - info("Capturing refernece..."); + info("Capturing reference..."); uint16_t sesn; sbmp_ep_send_message(dlnk_ep, DG_REQUEST_STORE_REF, NULL, 0, &sesn, NULL); diff --git a/user/reporting.h b/user/reporting.h index aea8f6c..a564dd9 100644 --- a/user/reporting.h +++ b/user/reporting.h @@ -24,6 +24,7 @@ typedef struct { /** Comapre result is stored here */ typedef struct { bool ready; + bool success; float deviation; float i_rms; } ReportingResult; From f64bbb94d742ae63d2926956ce2e7eb81c699ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 22:54:29 +0200 Subject: [PATCH 08/11] working xively report Former-commit-id: eea29fc09155b1be61b49b02e319554f1040991a --- esphttpclient/httpclient.c | 145 +++++++++++++++++++++--------------- esphttpclient/httpclient.h | 34 +++++---- libesphttpd/core/httpd.c | 24 ++++-- libesphttpd/include/httpd.h | 17 +++-- user/reporting.c | 24 +++++- 5 files changed, 153 insertions(+), 91 deletions(-) diff --git a/esphttpclient/httpclient.c b/esphttpclient/httpclient.c index 9a7d1ce..995b3b0 100644 --- a/esphttpclient/httpclient.c +++ b/esphttpclient/httpclient.c @@ -10,6 +10,7 @@ // FIXME: sprintf->snprintf everywhere. #include +#include #include "httpclient.h" #include @@ -27,6 +28,7 @@ typedef struct { httpclient_cb user_callback; int timeout; os_timer_t timeout_timer; + http_method method; } request_args; static char *FLASH_FN esp_strdup(const char *str) @@ -247,14 +249,18 @@ static void FLASH_FN connect_callback(void * arg) espconn_regist_recvcb(conn, receive_callback); espconn_regist_sentcb(conn, sent_callback); - const char *method = "GET"; char post_headers[32] = ""; if (req->post_data != NULL) { // If there is data this is a POST request. - method = "POST"; sprintf(post_headers, "Content-Length: %d\r\n", strlen(req->post_data)); + + if (req->method == HTTP_GET) { + req->method = HTTP_POST; + } } + const char* method = http_method_str(req->method); + if (req->headers == NULL) { /* Avoid NULL pointer, it may cause exception */ req->headers = (char *)malloc(sizeof(char)); req->headers[0] = '\0'; @@ -438,68 +444,30 @@ static void FLASH_FN dns_callback(const char *hostname, ip_addr_t *addr, void *a } } -void FLASH_FN http_raw_request(const char *hostname, int port, bool secure, const char *path, const char *post_data, const char *headers, httpclient_cb user_callback) +bool FLASH_FN http_request( + const char *url, + http_method method, + const char *body, + const char *headers, + httpclient_cb user_callback) { - info("HTTP request: %s:%d%s", hostname, port, path); - - request_args * req = (request_args *)malloc(sizeof(request_args)); - req->hostname = esp_strdup(hostname); - req->path = esp_strdup(path); - req->port = port; - req->secure = secure; - req->headers = esp_strdup(headers); - req->post_data = esp_strdup(post_data); - req->buffer_size = 1; - req->buffer = (char *)malloc(1); - req->buffer[0] = '\0'; // Empty string. - req->user_callback = user_callback; - req->timeout = HTTP_REQUEST_TIMEOUT_MS; + // --- prepare port, secure... --- - ip_addr_t addr; - err_t error = espconn_gethostbyname((struct espconn *)req, // It seems we don't need a real espconn pointer here. - hostname, &addr, dns_callback); - - if (error == ESPCONN_INPROGRESS) { - dbg("DNS pending"); - } else if (error == ESPCONN_OK) { - // Already in the local names table (or hostname was an IP address), execute the callback ourselves. - dns_callback(hostname, &addr, req); - } else { - if (error == ESPCONN_ARG) { - error("DNS arg error %s", hostname); - } else { - error("DNS error code %d", error); - } - dns_callback(hostname, NULL, req); // Handle all DNS errors the same way. - } -} - -/* - * Parse an URL of the form http://host:port/path - * can be a hostname or an IP address - * is optional - */ -void FLASH_FN http_post(const char *url, const char *post_data, const char *headers, httpclient_cb user_callback) -{ // FIXME: handle HTTP auth with http://user:pass@host/ - // FIXME: get rid of the #anchor part if present. char hostname[128] = ""; int port = 80; bool secure = false; - bool is_http = strstarts(url, "http://"); - bool is_https = strstarts(url, "https://"); - - if (is_http) + if (strstarts(url, "http://")) url += strlen("http://"); // Get rid of the protocol. - else if (is_https) { + else if (strstarts(url, "https://")) { port = 443; secure = true; url += strlen("https://"); // Get rid of the protocol. } else { - error("URL is not HTTP or HTTPS %s", url); - return; + error("Invalid URL protocol: %s", url); + return false; } char *path = strchr(url, '/'); @@ -513,38 +481,91 @@ void FLASH_FN http_post(const char *url, const char *post_data, const char *head } if (colon == NULL) { // The port is not present. - memcpy(hostname, url, path - url); + memcpy(hostname, url, (size_t)(path - url)); hostname[path - url] = '\0'; } else { port = atoi(colon + 1); if (port == 0) { error("Port error %s\n", url); - return; + return false; } - memcpy(hostname, url, colon - url); + memcpy(hostname, url, (size_t)(colon - url)); hostname[colon - url] = '\0'; } - if (path[0] == '\0') { // Empty path is not allowed. path = "/"; } - http_raw_request(hostname, port, secure, path, post_data, headers, user_callback); + // --- + + info("HTTP request: %s:%d%s", hostname, port, path); + + request_args * req = (request_args *)malloc(sizeof(request_args)); + req->hostname = esp_strdup(hostname); + req->path = esp_strdup(path); + + // remove #anchor + char *hash = strchr(req->path, '#'); + if (hash != NULL) *hash = '\0'; // remove the hash part + + req->port = port; + req->secure = secure; + req->headers = esp_strdup(headers); + req->post_data = esp_strdup(body); + req->buffer_size = 1; + req->buffer = (char *)malloc(1); + req->buffer[0] = '\0'; // Empty string. + req->user_callback = user_callback; + req->timeout = HTTP_REQUEST_TIMEOUT_MS; + req->method = method; + + ip_addr_t addr; + err_t error = espconn_gethostbyname((struct espconn *)req, // It seems we don't need a real espconn pointer here. + hostname, &addr, dns_callback); + + if (error == ESPCONN_INPROGRESS) { + dbg("DNS pending"); + } else if (error == ESPCONN_OK) { + // Already in the local names table (or hostname was an IP address), execute the callback ourselves. + dns_callback(hostname, &addr, req); + } else { + if (error == ESPCONN_ARG) { + error("DNS arg error %s", hostname); + } else { + error("DNS error code %d", error); + } + dns_callback(hostname, NULL, req); // Handle all DNS errors the same way. + } + + return true; } -void FLASH_FN http_get(const char *url, const char *headers, httpclient_cb user_callback) + +bool FLASH_FN http_post(const char *url, const char *body, const char *headers, httpclient_cb user_callback) +{ + return http_request(url, HTTP_POST, body, headers, user_callback); +} + + +bool http_get(const char *url, const char *headers, httpclient_cb user_callback) { - http_post(url, NULL, headers, user_callback); + return http_request(url, HTTP_GET, NULL, headers, user_callback); } + +bool http_put(const char *url, const char *body, const char *headers, httpclient_cb user_callback) +{ + return http_request(url, HTTP_PUT, body, headers, user_callback); +} + + void FLASH_FN http_callback_example(char *response_body, int http_status, char *response_headers, int body_size) { - dbg("http_status=%d", http_status); + dbg("Response: code %d", http_status); if (http_status != HTTP_STATUS_GENERIC_ERROR) { - dbg("strlen(headers)=%d", (int)strlen(response_headers)); - dbg("body_size=%d", body_size); - dbg("body=%s", response_body); // FIXME: this does not handle binary data. + dbg("len(headers) = %d, len(body) = %d", (int)strlen(response_headers), body_size); + dbg("body: %s", response_body); // FIXME: this does not handle binary data. } } diff --git a/esphttpclient/httpclient.h b/esphttpclient/httpclient.h index 4871656..70041f3 100644 --- a/esphttpclient/httpclient.h +++ b/esphttpclient/httpclient.h @@ -11,6 +11,7 @@ #define HTTPCLIENT_H #include +#include #define HTTP_STATUS_GENERIC_ERROR -1 // In case of TCP or DNS error the callback is called with this status. #define BUFFER_SIZE_MAX 5000 // Size of http responses that will cause an error. @@ -27,34 +28,39 @@ * A successful request corresponds to an HTTP status code of 200 (OK). * More info at http://en.wikipedia.org/wiki/List_of_HTTP_status_codes */ -typedef void (* httpclient_cb)(char * response_body, int http_status, char * response_headers, int body_size); +typedef void (* httpclient_cb)(char *response_body, int http_status, char *response_headers, int body_size); /** - * Download a web page from its URL. + * @brief Download a web page from its URL. + * * Try: * http_get("http://wtfismyip.com/text", http_callback_example); */ -void http_get(const char * url, const char *headers, httpclient_cb user_callback); +bool http_get(const char * url, const char *headers, httpclient_cb user_callback); /** - * Post data to a web form. + * @brief Post data to a web form. + * * The data should be encoded as application/x-www-form-urlencoded. + * * Try: * http_post("http://httpbin.org/post", "first_word=hello&second_word=world", http_callback_example); */ -void http_post(const char *url, const char *post_data, const char *headers, httpclient_cb user_callback); +bool http_post(const char *url, const char *post_data, const char *headers, httpclient_cb user_callback); + +/** Like POST, but with the PUT method. */ +bool http_put(const char *url, const char *body, const char *headers, httpclient_cb user_callback); /** - * Call this function to skip URL parsing if the arguments are already in separate variables. + * @brief Send a HTTP request + * @param url : protocol://host[:port][/path] + * @param method : get, post, ... + * @param body : request body. If GET & body != NULL, method changes to POST. + * @param headers : additional headers string. Must end with \r\n + * @param user_callback : callback for parsing the response + * @return success (in sending) */ -void http_raw_request( - const char * hostname, - int port, - bool secure, - const char *path, - const char *post_data, - const char *headers, - httpclient_cb user_callback); +bool http_request(const char *url, http_method method, const char *body, const char *headers, httpclient_cb user_callback); /** * Output on the UART. diff --git a/libesphttpd/core/httpd.c b/libesphttpd/core/httpd.c index a2adf4e..2131476 100644 --- a/libesphttpd/core/httpd.c +++ b/libesphttpd/core/httpd.c @@ -115,6 +115,20 @@ const char ICACHE_FLASH_ATTR *httpdGetMimetype(const char *filepath) { return mimeTypes[i].mimetype; } +const char* ICACHE_FLASH_ATTR http_method_str(http_method m) +{ + switch (m) { + default: + case HTTP_GET: return "GET"; + case HTTP_POST: return "POST"; + case HTTP_OPTIONS: return "OPTIONS"; + case HTTP_PUT: return "PUT"; + case HTTP_DELETE: return "DELETE"; + case HTTP_PATCH: return "PATCH"; + case HTTP_HEAD: return "HEAD"; + } +} + //Looks up the connData info for a specific connection static HttpdConnData ICACHE_FLASH_ATTR *httpdFindConnData(ConnTypePtr conn, const char *remIp, int remPort) { for (int i=0; irequestType == HTTPD_METHOD_OPTIONS /*&& conn->priv->chunkHdr[0] != 0*/) { + if (conn->requestType == HTTP_OPTIONS /*&& conn->priv->chunkHdr[0] != 0*/) { // we have a CORS preflight httpdStartResponse(conn, 200); httpdHeader(conn, "Access-Control-Allow-Headers", conn->priv->corsToken); @@ -589,16 +603,16 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) { char firstLine=0; if (strstarts(h, "GET ")) { - conn->requestType = HTTPD_METHOD_GET; + conn->requestType = HTTP_GET; firstLine=1; } else if (strstarts(h, "POST ")) { - conn->requestType = HTTPD_METHOD_POST; + conn->requestType = HTTP_POST; firstLine=1; } else if (strstarts(h, "PUT ")) { - conn->requestType = HTTPD_METHOD_PUT; + conn->requestType = HTTP_PUT; firstLine=1; } else if (strstarts(h, "OPTIONS ")) { - conn->requestType = HTTPD_METHOD_OPTIONS; + conn->requestType = HTTP_OPTIONS; firstLine=1; } else if (strstarts(h, "Host:")) { i=5; diff --git a/libesphttpd/include/httpd.h b/libesphttpd/include/httpd.h index bd4f7cd..0daecc7 100644 --- a/libesphttpd/include/httpd.h +++ b/libesphttpd/include/httpd.h @@ -13,15 +13,16 @@ typedef enum { } httpd_cgi_state; typedef enum { - HTTPD_METHOD_GET = 1, - HTTPD_METHOD_POST = 2, - HTTPD_METHOD_OPTIONS = 3, - HTTPD_METHOD_PUT = 4, - HTTPD_METHOD_DELETE = 5, - HTTPD_METHOD_PATCH = 6, - HTTPD_METHOD_HEAD = 7, + HTTP_GET = 1, + HTTP_POST = 2, + HTTP_OPTIONS = 3, + HTTP_PUT = 4, + HTTP_DELETE = 5, + HTTP_PATCH = 6, + HTTP_HEAD = 7, } http_method; + typedef struct HttpdPriv HttpdPriv; typedef struct HttpdConnData HttpdConnData; typedef struct HttpdPostData HttpdPostData; @@ -95,7 +96,7 @@ typedef struct { #define ROUTE_END() {NULL, NULL, NULL, NULL} - +const char *http_method_str(http_method m); httpd_cgi_state cgiRedirect(HttpdConnData *connData); httpd_cgi_state cgiRedirectToHostname(HttpdConnData *connData); diff --git a/user/reporting.c b/user/reporting.c index 20d1fdf..12e19d9 100644 --- a/user/reporting.c +++ b/user/reporting.c @@ -2,6 +2,7 @@ #include "datalink.h" #include "serial.h" #include "httpclient.h" +#include "ftoa.h" #define RPT_CONF_MAGIC 0x24C595D5 @@ -114,9 +115,28 @@ static void FLASH_FN compare_ref_cb(SBMP_Endpoint *ep, SBMP_Datagram *dg, void * static void FLASH_FN do_send_report(void) { info("Sending report..."); + + char buf[100]; + char *bb = buf; + + char url_buf[200]; + char hdrs_buf[100]; + switch (rpt_conf.service) { - case RPT_XIVELY: - warn("------- TODO: REPORT TO XIVELY -------"); + case RPT_XIVELY:; + bb += sprintf(bb, "deviation,"); + bb += my_ftoa(bb, rpt_result.deviation, 2); + bb += sprintf(bb, "\nI_rms,"); + bb += my_ftoa(bb, rpt_result.i_rms, 2); + + // URL + sprintf(url_buf, "http://api.xively.com/v2/feeds/%s.csv", rpt_conf.feed); + + // Key + sprintf(hdrs_buf, "X-ApiKey: %s\r\n", rpt_conf.key); + + http_put(url_buf, buf, hdrs_buf, http_callback_example); + break; case RPT_THINGSPEAK: From 48de8fffa0d58a892edc405316c84a77ff654b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 23:45:06 +0200 Subject: [PATCH 09/11] js poll status; shorter logging Former-commit-id: 75ebcfa31020000196aa83e69d82b23009d18b03 --- esphttpclient/httpclient.c | 20 ++++++++++++++++++++ esphttpclient/httpclient.h | 5 +++++ html/js/all.js | 6 +++--- html_src/js-src/page_mon.js | 25 +++++++++++++++++++++---- html_src/js/all.js | 6 +++--- html_src/js/all.js.map | 2 +- user/page_monitoring.c | 29 ++++++++++++++++++++++++++++- user/page_monitoring.h | 1 + user/reporting.c | 28 ++++++++++++++++++++++++---- user/reporting.h | 5 +++-- user/routes.c | 1 + 11 files changed, 110 insertions(+), 18 deletions(-) diff --git a/esphttpclient/httpclient.c b/esphttpclient/httpclient.c index 995b3b0..f50f530 100644 --- a/esphttpclient/httpclient.c +++ b/esphttpclient/httpclient.c @@ -569,3 +569,23 @@ void FLASH_FN http_callback_example(char *response_body, int http_status, char * dbg("body: %s", response_body); // FIXME: this does not handle binary data. } } + + + +void FLASH_FN http_callback_showstatus(char *response_body, int code, char *response_headers, int body_size) +{ + (void)response_body; + (void)response_headers; + (void)body_size; + + if (code == 200) { + info("Response OK (200)"); + } else if (code >= 400) { + error("Response ERROR (%d)", code); + dbg("Body: %s",response_body); + } else { + // ??? + warn("Response %d", code); + dbg("Body: %s",response_body); + } +} diff --git a/esphttpclient/httpclient.h b/esphttpclient/httpclient.h index 70041f3..ebe36a6 100644 --- a/esphttpclient/httpclient.h +++ b/esphttpclient/httpclient.h @@ -67,4 +67,9 @@ bool http_request(const char *url, http_method method, const char *body, const c */ void http_callback_example(char *response_body, int http_status, char *response_headers, int body_size); +/** + * Show status code, and body on error. Error/warn log msg on error. + */ +void http_callback_showstatus(char *response_body, int code, char *response_headers, int body_size); + #endif diff --git a/html/js/all.js b/html/js/all.js index 385e9b1..1ba5c8c 100644 --- a/html/js/all.js +++ b/html/js/all.js @@ -1,3 +1,3 @@ -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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(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 g(e){if(0===e.button){var n=a(S,o(e,b));v(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(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",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return jn.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)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?ge: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!==ge||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!==ge)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?gt(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?gt(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:ge}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(;++ie&&(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);++re?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-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===ge}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?ge:F(t,e);return r===ge?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 ge,ve="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 gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,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:ge,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:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(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();g.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=ve,(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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?($("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))):(errorMsg("Capture failed."),$("#actual-dev").html("--"),$("#actual-rms").html("--"))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},e.init=function(){},e}(); \ No newline at end of file +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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(a(M[0],M[1])),d(t.changedTouches),r(y)}function m(t){0===t.button&&(A=o(t,b),y.attr(a(A,A)),i(y),t.preventDefault())}function g(e){if(0===e.button){var n=a(A,o(e,b));v(n),A=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(t){if(t.width>5&&t.height>5){var n=t.x-S.x1,r=n+t.width,i=S.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(A){var e=o(t,b);y.attr(a(A,e)),t.preventDefault()}}if(e instanceof n.Line){var y,b,w,E,S,A,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,S=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=S.width(),i=S.height();e.elem("clipPath",{id:"zoom-mask"}).elem("rect",{x:S.x1,y:S.y2,width:n,height:i,fill:"white"}),b.addEventListener("mousedown",m),b.addEventListener("mouseup",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return $n.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:$n.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)return!1;var r=t.length-1;return n==r?t.pop():Xn.call(t,n,1),!0}function T(t,e){var n=P(t,e);return 0>n?ge:t[n][1]}function I(t,e){return P(t,e)>-1}function P(t,e){for(var n=t.length;n--;)if(Yt(t[n][0],e))return n;return-1}function z(t,e,n){var r=P(t,e);0>r?t.push([e,n]):t[r][1]=n}function B(t,e,n){var r=t[e];$n.call(t,e)&&Yt(r,n)&&(n!==ge||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!==ge)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==$e;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?gt(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?gt(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:ge}function H(t,e){return $n.call(t,e)||"object"==typeof t&&e in t&&null===zn(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&&$n.call(t,"__wrapped__"),m=f&&$n.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(;++ie&&(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);++re?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-1&&t%1==0&&Se>=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)&&jn.call(t)==ke}function Jt(t){return"string"==typeof t||!ar(t)&&Wt(t)&&jn.call(t)==ze}function Kt(t){return"symbol"==typeof t||Wt(t)&&jn.call(t)==Be}function te(t){return Wt(t)&&Vt(t.length)&&!!pn[jn.call(t)]}function ee(t){return t===ge}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)?Ae:+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?ge:F(t,e);return r===ge?n:r}function ae(t,e){return Mt(t,e,V)}function oe(t){var e=It(t);if(!e&&!qt(t))return J(t);var n=$t(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 ge,ve="4.6.1",xe=200,ye="__lodash_hash_undefined__",be=1,we=2,Ee=1/0,Se=9007199254740991,Ae=NaN,Ce="[object Arguments]",_e="[object Array]",Me="[object Boolean]",Oe="[object Date]",Le="[object Error]",Ne="[object Function]",$e="[object GeneratorFunction]",je="[object Map]",ke="[object Number]",Te="[object Object]",Ie="[object RegExp]",Pe="[object Set]",ze="[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[je]=pn[ke]=pn[Te]=pn[Ie]=pn[Pe]=pn[ze]=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[je]=mn[ke]=mn[Te]=mn[Ie]=mn[Pe]=mn[ze]=mn[Be]=mn[He]=mn[Ve]=mn[Ge]=mn[We]=!0,mn[Le]=mn[Ne]=mn[Re]=!1;var gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,Sn=u(bn&&wn&&"object"==typeof global&&global),An=u(xn[typeof self]&&self),Cn=u(xn[typeof window]&&window),_n=u(xn[typeof this]&&this),Mn=Sn||Cn!==(_n&&_n.window)&&Cn||An||_n||Function("return this")(),On=Array.prototype,Ln=Object.prototype,Nn=Function.prototype.toString,$n=Ln.hasOwnProperty,jn=Ln.toString,kn=RegExp("^"+Nn.call($n).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tn=En?Mn.Buffer:ge,In=Mn.Symbol,Pn=Mn.Uint8Array,zn=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=In?In.prototype:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(q),nr=xt(),rr=nt("length"),ir=Bn||function(){return[]};(Fn&&_t(new Fn)!=je||Hn&&_t(new Hn)!=Pe||Vn&&_t(new Vn)!=Re)&&(_t=function(t){var e=jn.call(t),n=e==Te?t.constructor:null,r="function"==typeof n?Nn.call(n):"";if(r)switch(r){case Wn:return je;case Qn:return Pe;case Zn:return Re}return e});var ar=Array.isArray,or=Tn?function(t){return t instanceof Tn}:fe(!1),sr=yt();g.prototype=Gn?Gn(null):Ln,w.prototype.clear=E,w.prototype["delete"]=S,w.prototype.get=A,w.prototype.has=C,w.prototype.set=_,M.prototype.clear=O,M.prototype["delete"]=L,M.prototype.get=N,M.prototype.has=$,M.prototype.set=j,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=ve,(Cn||An||{})._=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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);if(!n.success)throw"Capture failed.";$("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},e.init=function(){setInterval(function(){$().get(_root+"/mon/status",function(t,e){if(200==e)try{var n=JSON.parse(t);if(!n.success)throw"Capture failed.";$("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},1e4)},e}(); \ No newline at end of file diff --git a/html_src/js-src/page_mon.js b/html_src/js-src/page_mon.js index ef96e20..4876443 100644 --- a/html_src/js-src/page_mon.js +++ b/html_src/js-src/page_mon.js @@ -38,9 +38,7 @@ var page_mon = (function() { $('#actual-dev').html(numfmt(j.deviation, 2)); $('#actual-rms').html(numfmt(j.rms, 2)); } else { - errorMsg('Capture failed.'); - $('#actual-dev').html('--'); - $('#actual-rms').html('--'); + throw 'Capture failed.'; } } catch(e) { errorMsg(e); @@ -52,7 +50,26 @@ var page_mon = (function() { }; mon.init = function() { - // + setInterval(function() { + $().get(_root + '/mon/status', function(resp, status) { + if (status == 200) { + try { + // OK + var j = JSON.parse(resp); + if (j.success) { + $('#actual-dev').html(numfmt(j.deviation, 2)); + $('#actual-rms').html(numfmt(j.rms, 2)); + } else { + throw 'Capture failed.'; + } + } catch(e) { + errorMsg(e); + $('#actual-dev').html('--'); + $('#actual-rms').html('--'); + } + } + }); + }, 10000); }; return mon; diff --git a/html_src/js/all.js b/html_src/js/all.js index 385e9b1..1ba5c8c 100644 --- a/html_src/js/all.js +++ b/html_src/js/all.js @@ -1,3 +1,3 @@ -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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(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 g(e){if(0===e.button){var n=a(S,o(e,b));v(n),S=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(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",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return jn.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:jn.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)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?ge: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!==ge||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!==ge)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?gt(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?gt(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:ge}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(;++ie&&(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);++re?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-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===ge}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?ge:F(t,e);return r===ge?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 ge,ve="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 gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,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:ge,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:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(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();g.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=ve,(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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);n.success?($("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))):(errorMsg("Capture failed."),$("#actual-dev").html("--"),$("#actual-rms").html("--"))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},e.init=function(){},e}(); \ No newline at end of file +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=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)]:v.getComputedStyle?v.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;r0&&(o+="&"+a(e.name,e.value));break;case"select-multiple":for(i=0;i0?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;o0?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;i1?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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.addEventListener(r,i,!1):g.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===v||t===g)&&(y=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,i,!1):g.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,g=document,v=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),v.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),v.attachEvent("onload",e)):v.onload=e,v.$=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;ea.high&&(a.high=n),s&&n0?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=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=''+p+"";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=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;u1}).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,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).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),g=[];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 v,x,y,b;if(b=t.distributeSeries&&!t.stackBars?i:t.distributeSeries&&t.stackBars?0:l,v=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||(v[h.units.pos]+=a*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:u*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==o){var w={};w[h.units.pos+"1"]=v[h.units.pos],w[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(w[h.counterUnits.pos+"1"]=m,w[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(w[h.counterUnits.pos+"1"]=y,w[h.counterUnits.pos+"2"]=g[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;e1&&(y.attr(a(M[0],M[1])),i(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(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=0&&M.splice(n,1)}}function p(t){M.length>1&&v(a(M[0],M[1])),d(t.changedTouches),r(y)}function m(t){0===t.button&&(A=o(t,b),y.attr(a(A,A)),i(y),t.preventDefault())}function g(e){if(0===e.button){var n=a(A,o(e,b));v(n),A=null,r(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(O(),e.preventDefault())}function v(t){if(t.width>5&&t.height>5){var n=t.x-S.x1,r=n+t.width,i=S.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(A){var e=o(t,b);y.attr(a(A,e)),t.preventDefault()}}if(e instanceof n.Line){var y,b,w,E,S,A,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,S=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=S.width(),i=S.height();e.elem("clipPath",{id:"zoom-mask"}).elem("rect",{x:S.x1,y:S.y2,width:n,height:i,fill:"white"}),b.addEventListener("mousedown",m),b.addEventListener("mouseup",g),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-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 vn[t]}function m(){}function g(){}function v(t,e){return y(t,e)&&delete t[e]}function x(t,e){if(Gn){var n=t[e];return n===ye?ge:n}return $n.call(t,e)?t[e]:ge}function y(t,e){return Gn?t[e]!==ge:$n.call(t,e)}function b(t,e,n){t[e]=Gn&&n===ge?ye:n}function w(t){var e=-1,n=t?t.length:0;for(this.clear();++en)return!1;var r=t.length-1;return n==r?t.pop():Xn.call(t,n,1),!0}function T(t,e){var n=P(t,e);return 0>n?ge:t[n][1]}function I(t,e){return P(t,e)>-1}function P(t,e){for(var n=t.length;n--;)if(Yt(t[n][0],e))return n;return-1}function z(t,e,n){var r=P(t,e);0>r?t.push([e,n]):t[r][1]=n}function B(t,e,n){var r=t[e];$n.call(t,e)&&Yt(r,n)&&(n!==ge||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!==ge)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==$e;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?gt(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?gt(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:ge}function H(t,e){return $n.call(t,e)||"object"==typeof t&&e in t&&null===zn(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&&$n.call(t,"__wrapped__"),m=f&&$n.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(;++ie&&(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);++re?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-1&&t%1==0&&Se>=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)&&jn.call(t)==ke}function Jt(t){return"string"==typeof t||!ar(t)&&Wt(t)&&jn.call(t)==ze}function Kt(t){return"symbol"==typeof t||Wt(t)&&jn.call(t)==Be}function te(t){return Wt(t)&&Vt(t.length)&&!!pn[jn.call(t)]}function ee(t){return t===ge}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)?Ae:+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?ge:F(t,e);return r===ge?n:r}function ae(t,e){return Mt(t,e,V)}function oe(t){var e=It(t);if(!e&&!qt(t))return J(t);var n=$t(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 ge,ve="4.6.1",xe=200,ye="__lodash_hash_undefined__",be=1,we=2,Ee=1/0,Se=9007199254740991,Ae=NaN,Ce="[object Arguments]",_e="[object Array]",Me="[object Boolean]",Oe="[object Date]",Le="[object Error]",Ne="[object Function]",$e="[object GeneratorFunction]",je="[object Map]",ke="[object Number]",Te="[object Object]",Ie="[object RegExp]",Pe="[object Set]",ze="[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[je]=pn[ke]=pn[Te]=pn[Ie]=pn[Pe]=pn[ze]=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[je]=mn[ke]=mn[Te]=mn[Ie]=mn[Pe]=mn[ze]=mn[Be]=mn[He]=mn[Ve]=mn[Ge]=mn[We]=!0,mn[Le]=mn[Ne]=mn[Re]=!1;var gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},xn={"function":!0,object:!0},yn=parseInt,bn=xn[typeof exports]&&exports&&!exports.nodeType?exports:ge,wn=xn[typeof module]&&module&&!module.nodeType?module:ge,En=wn&&wn.exports===bn?bn:ge,Sn=u(bn&&wn&&"object"==typeof global&&global),An=u(xn[typeof self]&&self),Cn=u(xn[typeof window]&&window),_n=u(xn[typeof this]&&this),Mn=Sn||Cn!==(_n&&_n.window)&&Cn||An||_n||Function("return this")(),On=Array.prototype,Ln=Object.prototype,Nn=Function.prototype.toString,$n=Ln.hasOwnProperty,jn=Ln.toString,kn=RegExp("^"+Nn.call($n).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tn=En?Mn.Buffer:ge,In=Mn.Symbol,Pn=Mn.Uint8Array,zn=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=In?In.prototype:ge,Kn=Jn?Jn.valueOf:ge,tr=Jn?Jn.toString:ge,er=vt(q),nr=xt(),rr=nt("length"),ir=Bn||function(){return[]};(Fn&&_t(new Fn)!=je||Hn&&_t(new Hn)!=Pe||Vn&&_t(new Vn)!=Re)&&(_t=function(t){var e=jn.call(t),n=e==Te?t.constructor:null,r="function"==typeof n?Nn.call(n):"";if(r)switch(r){case Wn:return je;case Qn:return Pe;case Zn:return Re}return e});var ar=Array.isArray,or=Tn?function(t){return t instanceof Tn}:fe(!1),sr=yt();g.prototype=Gn?Gn(null):Ln,w.prototype.clear=E,w.prototype["delete"]=S,w.prototype.get=A,w.prototype.has=C,w.prototype.set=_,M.prototype.clear=O,M.prototype["delete"]=L,M.prototype.get=N,M.prototype.has=$,M.prototype.set=j,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=ve,(Cn||An||{})._=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('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.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,g,v;u?(p=u.high,m=u.low,g=c.high,v=c.low):(g=o?void 0:l,v=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:g,low:v},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(){g.count=$("#count").val(),g.freq=$("#freq").val()*("fft"==o?2:1)}function r(){f&&(errorMsg("Request already pending - aborting."),l.abort()),f=!0,s=msNow();var t=g.count,n=g.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,g={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=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(v.x+v.dx,v.y,v.w-v.dx,v.h+10);c.fillStyle="black",c.fillRect(v.x,v.y,v.w,v.h),c.clearRect(v.x,v.y+v.h+1,v.w,10),c.putImageData(t,v.x,v.y)}function n(n){e();for(var r=x.sampCount/2,i=0;r>i;i++){var a;if(i*v.dy>v.h)break;a=i>n.length?"#000":t(n[i]),c.fillStyle=a;var o=v.x+v.w-v.dx,s=v.y+v.h-(i+1)*v.dy,u=v.dx,l=v.dy;s=950){p=msNow();var h=!1;msElapsed(m)>9500&&(h=!0,m=msNow()),c.strokeStyle="white",c.beginPath(),c.moveTo(v.x+v.w-.5,v.y+v.h+1),c.lineTo(v.x+v.w-.5,v.y+v.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=v.h-12,i=v.y+6,a=v.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<=v.h;s+=r/10)c.fillText(Math.round(s*o)+"",v.x-e-n-e,i+r-s+3)}function o(){var t=8,e=v.x+v.w,n=e+t,r=v.y,i=v.h,a=70;c.clearRect(e+.5,r-10,a,i+20);for(var o,s=x.freq/2/(x.sampCount/2),u=v.h/v.dy,l=u*s,h=[10,25,50],f=1,d=!1;;){for(var p=0;p=p;p+=o){if(p>=u){var m=p-u;if(m>o/2)break;p=u}var g=p*(l/u);g=g>=1e6?numfmt(g/1e6,2)+"M":g>=1e3?numfmt(g/1e3,2)+"k":numfmt(g,1);var y=Math.round(r+i-v.dy*p);if(c.fillText(g,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,v.y+v.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(),v.dx=+$("#tile-x").val(),v.dy=+$("#tile-y").val()}function u(){c.fillStyle="#000",c.fillRect(v.x,v.y,v.w,v.h),c.strokeStyle="white",c.strokeRect(v.x-.5,v.y-.5,v.w+1,v.h+1)}var c,l,h,f,d,p,m,g={},v={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 g.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,v.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")})},g}(),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}(),page_mon=function(){function t(t){$("#hasref").html(t?"OK":"Not set!")}var e={};return e.captureRef=function(){$().get(_root+"/mon/setref",function(e,n){if(200!=n)errorMsg("Operation failed.");else try{var r=JSON.parse(e);t(r.success)}catch(i){errorMsg(i),t(!1)}})},e.compareNow=function(){$().get(_root+"/mon/compare",function(t,e){if(200!=e)errorMsg("Operation failed.");else try{var n=JSON.parse(t);if(!n.success)throw"Capture failed.";$("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},e.init=function(){setInterval(function(){$().get(_root+"/mon/status",function(t,e){if(200==e)try{var n=JSON.parse(t);if(!n.success)throw"Capture failed.";$("#actual-dev").html(numfmt(n.deviation,2)),$("#actual-rms").html(numfmt(n.rms,2))}catch(r){errorMsg(r),$("#actual-dev").html("--"),$("#actual-rms").html("--")}})},1e4)},e}(); \ No newline at end of file diff --git a/html_src/js/all.js.map b/html_src/js/all.js.map index 2fc8fe2..e08de45 100644 --- a/html_src/js/all.js.map +++ b/html_src/js/all.js.map @@ -1 +1 @@ -{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","lodash.custom.js","utils.js","modal.js","notif.js","app.js","page_wifi.js","page_waveform.js","page_spectrogram.js","page_status.js","page_mon.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC95HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\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}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\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\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (!_.isUndefined(value)) { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms\n\t\t\tvar xhr;\n\t\t\tvar\tquery = serializeData(nodes);\n\t\t\tvar\ttype = (method) ? method.toUpperCase() : 'GET';\n\t\t\tvar\tabortTmeo;\n\n\t\t\tif (_.isNumber(options)) options = {timeout: options};\n\n\t\t\tvar opts = Chartist.extend({}, {\n\t\t\t\tnocache: true,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tloader: true,\n\t\t\t}, options);\n\n\t\t\t//console.log('ajax to = ' + opts.timeout);\n\n\t\t\tif (query && (type === 'GET')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// FIXME the XHR sometimes seemingly silently fails\n\n\t\t\txhr = new XMLHttpRequest(); // we dont support IE < 9\n\n\t\t\tif (xhr) {\n\t\t\t\t// prevent caching\n\t\t\t\tif (opts.nocache) {\n\t\t\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t\t\t}\n\n\t\t\t\tif (opts.loader)\n\t\t\t\t\t$('#loader').addClass('show');\n\n\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\txhr.timeout = opts.timeout;\n\n\t\t\t\tabortTmeo = setTimeout(function () {\n\t\t\t\t\terrorMsg(\"XHR timed out.\");\n\t\t\t\t\txhr.abort();\n\t\t\t\t\tif (opts.loader) $('#loader').removeClass('show');\n\t\t\t\t}, opts.timeout + 10); // a bit later, but still.;\n\n\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\n\t\t\t\t\t\tif (opts.loader)\n\t\t\t\t\t\t\t$('#loader').removeClass('show');\n\n\t\t\t\t\t\tif (callback && xhr.status != 0) { // xhr.status 0 means \"aborted\"\n\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\tif (type === 'POST') {\n\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t}\n\n\t\t\t\txhr.send(query);\n\t\t\t}\n\n\t\t\treturn xhr;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback)\n\t\tcb.get = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'get', callback, opts);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback)\n\t\tcb.post = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'post', callback, opts);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n // Chartist.escapingMap = {\n // '&': '&',\n // '<': '<',\n // '>': '>',\n // '\"': '"',\n // '\\'': '''\n // };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return _.escape(data);\n\n // return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n // }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n // }, data);\n data = _.unescape(data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n // /**\n // * Calculate cartesian coordinates of polar coordinates\n // *\n // * @memberof Chartist.Core\n // * @param {Number} centerX X-axis coordinates of center point of circle segment\n // * @param {Number} centerY X-axis coordinates of center point of circle segment\n // * @param {Number} radius Radius of circle segment\n // * @param {Number} angleInDegrees Angle of circle segment in degrees\n // * @return {{x:Number, y:Number}} Coordinates of point on circumference\n // */\n // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n //\n // return {\n // x: centerX + (radius * Math.cos(angleInRadians)),\n // y: centerY + (radius * Math.sin(angleInRadians))\n // };\n // };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\n if (_.isNumber(lblText)) {\n lblText = Chartist.roundWithPrecision(lblText, 2);\n }\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n // /**\n // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n // *\n // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n // *\n // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n // *\n // * @example\n // * var chart = new Chartist.Line('.ct-chart', {\n // * labels: [1, 2, 3, 4, 5],\n // * series: [[1, 2, 8, 1, 7]]\n // * }, {\n // * lineSmooth: Chartist.Interpolation.cardinal({\n // * tension: 1,\n // * fillHoles: false\n // * })\n // * });\n // *\n // * @memberof Chartist.Interpolation\n // * @param {Object} options The options of the cardinal factory function.\n // * @return {Function}\n // */\n // Chartist.Interpolation.cardinal = function(options) {\n // var defaultOptions = {\n // tension: 1,\n // fillHoles: false\n // };\n //\n // options = Chartist.extend({}, defaultOptions, options);\n //\n // var t = Math.min(1, Math.max(0, options.tension)),\n // c = 1 - t;\n //\n // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // // This functionality is necessary to treat \"holes\" in the line charts\n // function splitIntoSegments(pathCoordinates, valueData) {\n // var segments = [];\n // var hole = true;\n //\n // for(var i = 0; i < pathCoordinates.length; i += 2) {\n // // If this value is a \"hole\" we set the hole flag\n // if(valueData[i / 2].value === undefined) {\n // if(!options.fillHoles) {\n // hole = true;\n // }\n // } else {\n // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n // if(hole) {\n // segments.push({\n // pathCoordinates: [],\n // valueData: []\n // });\n // // As we have a valid value now, we are not in a \"hole\" anymore\n // hole = false;\n // }\n //\n // // Add to the segment pathCoordinates and valueData\n // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n // segments[segments.length - 1].valueData.push(valueData[i / 2]);\n // }\n // }\n //\n // return segments;\n // }\n //\n // return function cardinal(pathCoordinates, valueData) {\n // // First we try to split the coordinates into segments\n // // This is necessary to treat \"holes\" in line charts\n // var segments = splitIntoSegments(pathCoordinates, valueData);\n //\n // if(!segments.length) {\n // // If there were no segments return 'Chartist.Interpolation.none'\n // return Chartist.Interpolation.none()([]);\n // } else if(segments.length > 1) {\n // // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // // afterwards together into a single path.\n // var paths = [];\n // // For each segment we will recurse the cardinal function\n // segments.forEach(function(segment) {\n // paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n // });\n // // Join the segment path data into a single path and return\n // return Chartist.Svg.Path.join(paths);\n // } else {\n // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // // segment\n // pathCoordinates = segments[0].pathCoordinates;\n // valueData = segments[0].valueData;\n //\n // // If less than two points we need to fallback to no smoothing\n // if(pathCoordinates.length <= 4) {\n // return Chartist.Interpolation.none()(pathCoordinates, valueData);\n // }\n //\n // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n // z;\n //\n // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n // var p = [\n // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n // ];\n // if (z) {\n // if (!i) {\n // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n // } else if (iLen - 4 === i) {\n // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // } else if (iLen - 2 === i) {\n // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n // }\n // } else {\n // if (iLen - 4 === i) {\n // p[3] = p[2];\n // } else if (!i) {\n // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n // }\n // }\n //\n // path.curve(\n // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n // p[2].x,\n // p[2].y,\n // false,\n // valueData[(i + 2) / 2]\n // );\n // }\n //\n // return path;\n // }\n // };\n // };\n\n\n /**\n * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.\n *\n * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.monotoneCubic({\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the monotoneCubic factory function.\n * @return {Function}\n */\n Chartist.Interpolation.monotoneCubic = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {\n // Because we are doing monotone interpolation, curve fitting only makes sense for\n // increasing x values. Therefore if two subsequent points have the same x value, or\n // the x value is decreasing, then we create a hole at this point. (Which cannot be\n // filled in even with the 'fillHoles' option)\n\n hole = true;\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function monotoneCubic(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the monotoneCubic fn function\n segments.forEach(function(segment) {\n paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than three points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var xs = [],\n ys = [],\n i,\n n = pathCoordinates.length / 2,\n ms = [],\n ds = [], dys = [], dxs = [],\n path;\n\n // Populate x and y coordinates into separate arrays, for readability\n\n for(i = 0; i < n; i++) {\n xs[i] = pathCoordinates[i * 2];\n ys[i] = pathCoordinates[i * 2 + 1];\n }\n\n // Calculate deltas and derivative\n\n for(i = 0; i < n - 1; i++) {\n dys[i] = ys[i + 1] - ys[i];\n dxs[i] = xs[i + 1] - xs[i];\n ds[i] = dys[i] / dxs[i];\n }\n\n // Determine desired slope (m) at each point using Fritsch-Carlson method\n // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation\n\n ms[0] = ds[0];\n ms[n - 1] = ds[n - 2];\n\n for(i = 1; i < n - 1; i++) {\n if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {\n ms[i] = 0;\n } else {\n ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (\n (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +\n (dxs[i] + 2 * dxs[i - 1]) / ds[i]);\n\n if(!isFinite(ms[i])) {\n ms[i] = 0;\n }\n }\n }\n\n // Now build a path from the slopes\n\n path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);\n\n for(i = 0; i < n - 1; i++) {\n path.curve(\n // First control point\n xs[i] + dxs[i] / 3,\n ys[i] + ms[i] * dxs[i] / 3,\n // Second control point\n xs[i + 1] - dxs[i] / 3,\n ys[i + 1] - ms[i + 1] * dxs[i] / 3,\n // End point\n xs[i + 1],\n ys[i + 1],\n\n false,\n valueData[i + 1] // changed as per patch on github\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var xy = this.units.pos.toUpperCase();\n var axisOptions = chartOptions['axis' + xy];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n\n\n var labelLength=0;\n\n\n if (xy == 'Y') { // X doesnt use this\n if (projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n // lastWidth = labelLength;\n // } else if (typeof lastWidth != 'undefined') {\n // labelLength = lastWidth; // EDIT. added the lastWidth thing\n } else {\n // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // still be visible inside of the chart padding.\n labelLength = Math.max(this.axisLength - projectedValue, 30);\n }\n }\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// // AMD. Register as an anonymous module.\n\t// define([], function () {\n\t// return (root.returnExportsGlobal = factory());\n\t// });\n\t// } else if (typeof exports === 'object') {\n\t// // Node. Does not work with strict CommonJS, but\n\t// // only CommonJS-like enviroments that support module.exports,\n\t// // like Node.\n\t// module.exports = factory();\n\t// } else {\n\troot['Chartist.plugins.zoom'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js zoom plugin.\n\t *\n\t */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar defaultOptions = {\n\t\t\t// onZoom\n\t\t\t// resetOnRightMouseBtn\n\t\t};\n\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.zoom = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function zoom(chart) {\n\n\t\t\t\tif (!(chart instanceof Chartist.Line)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rect, svg, axisX, axisY, chartRect;\n\t\t\t\tvar downPosition;\n\t\t\t\tvar onZoom = options.onZoom;\n\t\t\t\tvar ongoingTouches = [];\n\n\t\t\t\tchart.on('draw', function (data) {\n\t\t\t\t\tvar type = data.type;\n\t\t\t\t\tif (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n\t\t\t\t\t\tdata.element.attr({\n\t\t\t\t\t\t\t'clip-path': 'url(#zoom-mask)'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\taxisX = data.axisX;\n\t\t\t\t\taxisY = data.axisY;\n\t\t\t\t\tchartRect = data.chartRect;\n\t\t\t\t\tsvg = data.svg._node;\n\t\t\t\t\trect = data.svg.elem('rect', {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 10,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\theight: 100,\n\t\t\t\t\t}, 'ct-zoom-rect');\n\t\t\t\t\thide(rect);\n\n\t\t\t\t\tvar defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n\t\t\t\t\tvar width = chartRect.width();\n\t\t\t\t\tvar height = chartRect.height();\n\n\t\t\t\t\tdefs\n\t\t\t\t\t\t.elem('clipPath', {\n\t\t\t\t\t\t\tid: 'zoom-mask'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.elem('rect', {\n\t\t\t\t\t\t\tx: chartRect.x1,\n\t\t\t\t\t\t\ty: chartRect.y2,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\theight: height,\n\t\t\t\t\t\t\tfill: 'white'\n\t\t\t\t\t\t});\n\n\t\t\t\t\tsvg.addEventListener('mousedown', onMouseDown);\n\t\t\t\t\tsvg.addEventListener('mouseup', onMouseUp);\n\t\t\t\t\tsvg.addEventListener('mousemove', onMouseMove);\n\t\t\t\t\tsvg.addEventListener('touchstart', onTouchStart);\n\t\t\t\t\tsvg.addEventListener('touchmove', onTouchMove);\n\t\t\t\t\tsvg.addEventListener('touchend', onTouchEnd);\n\t\t\t\t\tsvg.addEventListener('touchcancel', onTouchCancel);\n\t\t\t\t});\n\n\t\t\t\tfunction copyTouch(touch) {\n\t\t\t\t\tvar p = position(touch, svg);\n\t\t\t\t\tp.id = touch.identifier;\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tfunction ongoingTouchIndexById(idToFind) {\n\t\t\t\t\tfor (var i = 0; i < ongoingTouches.length; i++) {\n\t\t\t\t\t\tvar id = ongoingTouches[i].id;\n\t\t\t\t\t\tif (id === idToFind) {\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchStart(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tongoingTouches.push(copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchMove(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchCancel(event) {\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t}\n\n\t\t\t\tfunction removeTouches(touches) {\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\t\tongoingTouches.splice(idx, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchEnd(event) {\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\tzoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t}\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t\thide(rect);\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseDown(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tdownPosition = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, downPosition));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar reset = function () {\n\t\t\t\t\tchart.options.axisX.highLow = null;\n\t\t\t\t\tchart.options.axisY.highLow = null;\n\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t};\n\n\t\t\t\tfunction onMouseUp(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tvar box = getRect(downPosition, position(event, svg));\n\t\t\t\t\t\tzoomIn(box);\n\t\t\t\t\t\tdownPosition = null;\n\t\t\t\t\t\thide(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\telse if (options.resetOnRightMouseBtn && event.button === 2) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction zoomIn(rect) {\n\t\t\t\t\tif (rect.width > 5 && rect.height > 5) {\n\t\t\t\t\t\tvar x1 = rect.x - chartRect.x1;\n\t\t\t\t\t\tvar x2 = x1 + rect.width;\n\t\t\t\t\t\tvar y2 = chartRect.y1 - rect.y;\n\t\t\t\t\t\tvar y1 = y2 - rect.height;\n\n\t\t\t\t\t\tvar xLow = project(x1, axisX);\n\t\t\t\t\t\tvar xHigh = project(x2, axisX);\n\t\t\t\t\t\tvar yLow = project(y1, axisY);\n\t\t\t\t\t\tvar yHigh = project(y2, axisY);\n\n\t\t\t\t\t\tvar explb = chart.options.explicitBounds;\n\t\t\t\t\t\tif (!_.isUndefined(explb)) {\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchart.options.axisX.highLow = {low: xLow, high: xHigh};\n\t\t\t\t\t\tchart.options.axisY.highLow = {low: yLow, high: yHigh};\n\n\t\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t\t\tonZoom && onZoom(chart, reset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseMove(event) {\n\t\t\t\t\tif (downPosition) {\n\t\t\t\t\t\tvar point = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, point));\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tfunction hide(rect) {\n\t\t\trect.attr({style: 'display:none'});\n\t\t}\n\n\t\tfunction show(rect) {\n\t\t\trect.attr({style: 'display:block'});\n\t\t}\n\n\t\tfunction getRect(firstPoint, secondPoint) {\n\t\t\tvar x = firstPoint.x;\n\t\t\tvar y = firstPoint.y;\n\t\t\tvar width = secondPoint.x - x;\n\t\t\tvar height = secondPoint.y - y;\n\t\t\tif (width < 0) {\n\t\t\t\twidth = -width;\n\t\t\t\tx = secondPoint.x;\n\t\t\t}\n\t\t\tif (height < 0) {\n\t\t\t\theight = -height;\n\t\t\t\ty = secondPoint.y;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t}\n\n\t\tfunction position(event, svg) {\n\t\t\treturn transform(event.clientX, event.clientY, svg);\n\t\t}\n\n\t\tfunction transform(x, y, svgElement) {\n\t\t\tvar svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n\t\t\tvar matrix = svg.getScreenCTM();\n\t\t\tvar point = svg.createSVGPoint();\n\t\t\tpoint.x = x;\n\t\t\tpoint.y = y;\n\t\t\tpoint = point.matrixTransform(matrix.inverse());\n\t\t\treturn point || {x: 0, y: 0};\n\t\t}\n\n\t\tfunction project(value, axis) {\n\t\t\tvar max = axis.bounds.max;\n\t\t\tvar min = axis.bounds.min;\n\t\t\tif (axis.scale && axis.scale.type === 'log') {\n\t\t\t\tvar base = axis.scale.base;\n\t\t\t\treturn Math.pow(base,\n\t\t\t\t\t\tvalue * baseLog(max / min, base) / axis.axisLength) * min;\n\t\t\t}\n\t\t\treturn (value * axis.bounds.range / axis.axisLength) + min;\n\t\t}\n\n\t\tfunction baseLog(val, base) {\n\t\t\treturn Math.log(val) / Math.log(base);\n\t\t}\n\n\t}(window, document, Chartist));\n\treturn Chartist.plugins.zoom;\n\n}));\n","/**\n * @license\n * lodash 4.6.1 (Custom Build) \n * Build: `lodash include=\"range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined\" exports=\"global\" -d`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.6.1';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n NAN = 0 / 0;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[mapTag] = cloneableTags[numberTag] =\n cloneableTags[objectTag] = cloneableTags[regexpTag] =\n cloneableTags[setTag] = cloneableTags[stringTag] =\n cloneableTags[symbolTag] = cloneableTags[uint8Tag] =\n cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =\n cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseInt = parseInt;\n\n /** Detect free variable `exports`. */\n var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n /** Detect free variable `module`. */\n var freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = (freeModule && freeModule.exports === freeExports)\n ? freeExports\n : undefined;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n /** Detect free variable `self`. */\n var freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n /** Detect free variable `window`. */\n var freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n /** Detect `this` as the global object. */\n var thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `Map#set` because it doesn't return the map instance in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n set.add(value);\n return set;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the new array of key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\n function checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Converts `map` to an array.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the converted array.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Converts `set` to an array.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the converted array.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertySymbols = Object.getOwnPropertySymbols,\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeKeys = Object.keys,\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var mapCtorString = Map ? funcToString.call(Map) : '',\n setCtorString = Set ? funcToString.call(Set) : '',\n weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chaining. Methods that operate on and return arrays, collections, and\n * functions can be chained together. Methods that retrieve a single value or\n * may return a primitive value will automatically end the chain sequence and\n * return the unwrapped value. Otherwise, the value must be unwrapped with\n * `_#value`.\n *\n * Explicit chaining, which must be unwrapped with `_#value` in all cases,\n * may be enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization to merge iteratee calls; this avoids the creation\n * of intermediate arrays and can greatly reduce the number of iteratee executions.\n * Sections of a chain sequence qualify for shortcut fusion if the section is\n * applied to an array of at least two hundred elements and any iteratees\n * accept only one argument. The heuristic for whether a section qualifies\n * for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,\n * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,\n * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,\n * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,\n * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,\n * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,\n * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,\n * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,\n * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,\n * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,\n * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,\n * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,\n * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,\n * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,\n * `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,\n * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,\n * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,\n * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,\n * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,\n * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,\n * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,\n * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,\n * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,\n * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,\n * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,\n * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,\n * `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an hash object.\n *\n * @private\n * @constructor\n * @returns {Object} Returns the new hash object.\n */\n function Hash() {}\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(hash, key) {\n return hashHas(hash, key) && delete hash[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(hash, key) {\n if (nativeCreate) {\n var result = hash[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(hash, key) ? hash[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(hash, key) {\n return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function hashSet(hash, key, value) {\n hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function MapCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapDelete(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashDelete(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map['delete'](key) : assocDelete(data.map, key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapGet(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashGet(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.get(key) : assocGet(data.map, key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashHas(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.has(key) : assocHas(data.map, key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache object.\n */\n function mapSet(key, value) {\n var data = this.__data__;\n if (isKeyable(key)) {\n hashSet(typeof key == 'string' ? data.string : data.hash, key, value);\n } else if (Map) {\n data.map.set(key, value);\n } else {\n assocSet(data.map, key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function Stack(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocDelete(array, key) : data.map['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocGet(array, key) : data.map.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocHas(array, key) : data.map.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache object.\n */\n function stackSet(key, value) {\n var data = this.__data__,\n array = data.array;\n\n if (array) {\n if (array.length < (LARGE_ARRAY_SIZE - 1)) {\n assocSet(array, key, value);\n } else {\n data.array = null;\n data.map = new MapCache(array);\n }\n }\n var map = data.map;\n if (map) {\n map.set(key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Removes `key` and its value from the associative array.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function assocDelete(array, key) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n return false;\n }\n var lastIndex = array.length - 1;\n if (index == lastIndex) {\n array.pop();\n } else {\n splice.call(array, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the associative array value for `key`.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function assocGet(array, key) {\n var index = assocIndexOf(array, key);\n return index < 0 ? undefined : array[index][1];\n }\n\n /**\n * Checks if an associative array value for `key` exists.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function assocHas(array, key) {\n return assocIndexOf(array, key) > -1;\n }\n\n /**\n * Gets the index at which the first occurrence of `key` is found in `array`\n * of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Sets the associative array `key` to `value`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function assocSet(array, key, value) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n array.push([key, value]);\n } else {\n array[index][1] = value;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the array-like object.\n */\n function baseCastFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function baseCastPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n result = baseAssign(result, value);\n return isFull ? copySymbols(value, result) : result;\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return (isFull && !isArr) ? copySymbols(value, result) : result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path + ''] : baseCastPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n stack || (stack = new Stack);\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack,\n result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;\n\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n var type = typeof value;\n if (type == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (type == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n return nativeKeys(Object(object));\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value &&\n (value !== undefined || (key in Object(object)));\n };\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments to numbers.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the new array of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map) {\n return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set) {\n return arrayReduce(setToArray(set), addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n }\n\n /**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toNumber(start);\n start = start === start ? start : 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toNumber(end) || 0;\n }\n step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var index = -1,\n isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n isUnordered = bitmask & UNORDERED_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(array, other);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isUnordered) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object) ? other != +other : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n // Recursively compare objects (susceptible to call stack limits).\n return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : baseHas(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n return result;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If the `_.iteratee` method is\n * customized this function returns the custom method, otherwise it returns\n * `baseIteratee`. If arguments are provided the chosen function is invoked\n * with them and its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = toPairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = getOwnPropertySymbols || function() {\n return [];\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function getTag(value) {\n return objectToString.call(value);\n }\n\n // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.\n if ((Map && getTag(new Map) != mapTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : null,\n ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case mapCtorString: return mapTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n if (object == null) {\n return false;\n }\n var result = hasFunc(object, path);\n if (!result && !isKey(path)) {\n path = baseCastPath(path);\n object = parent(object, path);\n if (object != null) {\n path = last(path);\n result = hasFunc(object, path);\n }\n }\n var length = object ? object.length : undefined;\n return result || (\n !!length && isLength(length) && isIndex(path, length) &&\n (isArray(object) || isString(object) || isArguments(object))\n );\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototypeOf(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\n function indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (typeof value == 'number') {\n return true;\n }\n return !isArray(value) &&\n (reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object)));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return type == 'number' || type == 'boolean' ||\n (type == 'string' && value != '__proto__') || value == null;\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n function stringToPath(string) {\n var result = [];\n toString(string).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`\n * for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => logs `1` then `2`\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' then 'b' (iteration order is not guaranteed)\n */\n function forEach(collection, iteratee) {\n return (typeof iteratee == 'function' && isArray(collection))\n ? arrayEach(collection, iteratee)\n : baseEach(collection, baseCastFunction(iteratee));\n }\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,\n * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,\n * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,\n * and `words`\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = !Buffer ? constant(false) : function(value) {\n return value instanceof Buffer;\n };\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(funcToString.call(value));\n }\n return isObjectLike(value) &&\n (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\n function toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b.c');\n * // => true\n *\n * _.hasIn(object, ['a', 'b', 'c']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Creates an array of own enumerable key-value pairs for `object` which\n * can be consumed by `_.fromPairs`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n function toPairs(object) {\n return baseToPairs(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument given to it.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name the created callback returns the\n * property value for a given element. If `func` is an object the created\n * callback returns `true` for elements that contain the equivalent object\n * properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(callback, func) {\n * var p = /^(\\S+)\\s*([<>])\\s*(\\S+)$/.exec(func);\n * return !p ? callback(func) : function(object) {\n * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);\n * };\n * });\n *\n * _.filter(users, 'age > 36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /*------------------------------------------------------------------------*/\n\n // Avoid inheriting from `Object.prototype` when possible.\n Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;\n\n // Add functions to the `MapCache`.\n MapCache.prototype.clear = mapClear;\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Stack` cache.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n // Add functions that return wrapped values when chaining.\n lodash.constant = constant;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.property = property;\n lodash.range = range;\n lodash.toPairs = toPairs;\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isNative = isNative;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.replace = replace;\n lodash.toNumber = toNumber;\n lodash.toString = toString;\n lodash.unescape = unescape;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n // Expose lodash on the free variable `window` or `self` when available. This\n // prevents errors in cases where lodash is loaded by a script tag in the presence\n // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.\n (freeWindow || freeSelf || {})._ = lodash;\n\n // Export to the global object.\n root._ = lodash;\n}.call(this));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\nfunction numfmt(x, places) {\n\tvar pow = Math.pow(10, places);\n\treturn Math.round(x*pow) / pow;\n}\n\nfunction estimateLoadTime(fs, n) {\n\treturn (1000/fs)*n+1500;\n}\n\nfunction msNow() {\n\treturn +(new Date);\n}\n\nfunction msElapsed(start) {\n\treturn msNow() - start;\n}\n\nMath.log10 = Math.log10 || function(x) {\n\treturn Math.log(x) / Math.LN10;\n};\n\n/**\n * Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(_.escapeRegExp(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tif ($(this).hasClass('no-close')) return; // this is a no-close modal\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","var notify = (function () {\n\tvar nt = {};\n\tvar sel = '#notif';\n\n\tvar hideTmeo1;\n\tvar hideTmeo2;\n\n\tnt.show = function (message, timeout) {\n\t\t$(sel).html(message);\n\t\tmodal.show(sel);\n\n\t\tclearTimeout(hideTmeo1);\n\t\tclearTimeout(hideTmeo2);\n\n\t\tif (!_.isUndefined(timeout)) {\n\t\t\thideTmeo1 = setTimeout(nt.hide, timeout);\n\t\t}\n\t};\n\n\tnt.hide = function () {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\thideTmeo2 = setTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 250); // transition time\n\t};\n\n\tnt.init = function() {\n\t\t$(sel).on('click', function() {\n\t\t\tnt.hide(this);\n\t\t});\n\t};\n\n\treturn nt;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\t$('input[type=number]').on('mousewheel', function(e) {\n\t\tvar val = +$(this).val();\n\t\tvar step = +($(this).attr('step') || 1);\n\t\tvar min = $(this).attr('min');\n\t\tvar max = $(this).attr('max');\n\t\tif(e.wheelDelta > 0) {\n\t\t\tval += step;\n\t\t} else {\n\t\t\tval -= step;\n\t\t}\n\t\tif (!_.isUndefined(min)) val = Math.max(val, min);\n\t\tif (!_.isUndefined(max)) val = Math.min(val, max);\n\t\t$(this).val(val);\n\n\t\tif (\"createEvent\" in document) {\n\t\t\tvar evt = document.createEvent(\"HTMLEvents\");\n\t\t\tevt.initEvent(\"change\", false, true);\n\t\t\t$(this)[0].dispatchEvent(evt);\n\t\t} else {\n\t\t\t$(this)[0].fireEvent(\"onchange\");\n\t\t}\n\n\t\te.preventDefault();\n\t});\n\n\tmodal.init();\n\tnotify.init();\n});\n\n\nfunction errorMsg(msg, time) {\n\tnotify.show(msg, time || 3000);\n}\n","/** Wifi page */\nvar page_wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n","var page_mon = (function() {\n\tvar mon = {};\n\n\tfunction updRefInfoField(ok) {\n\t\t$('#hasref').html(ok ? 'OK' : 'Not set!');\n\t}\n\n\t/** Capture reference & save to flash */\n\tmon.captureRef = function() {\n\t\t$().get(_root + '/mon/setref', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tupdRefInfoField(j.success);\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\tupdRefInfoField(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Capture waveform and compare with reference */\n\tmon.compareNow = function() {\n\t\t$().get(_root + '/mon/compare', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t$('#actual-dev').html(numfmt(j.deviation, 2));\n\t\t\t\t\t\t$('#actual-rms').html(numfmt(j.rms, 2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorMsg('Capture failed.');\n\t\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tmon.init = function() {\n\t\t//\n\t};\n\n\treturn mon;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","lodash.custom.js","utils.js","modal.js","notif.js","app.js","page_wifi.js","page_waveform.js","page_spectrogram.js","page_status.js","page_mon.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC95HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\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}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\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\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (!_.isUndefined(value)) { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, options) { // if options is a number, it's timeout in ms\n\t\t\tvar xhr;\n\t\t\tvar\tquery = serializeData(nodes);\n\t\t\tvar\ttype = (method) ? method.toUpperCase() : 'GET';\n\t\t\tvar\tabortTmeo;\n\n\t\t\tif (_.isNumber(options)) options = {timeout: options};\n\n\t\t\tvar opts = Chartist.extend({}, {\n\t\t\t\tnocache: true,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tloader: true,\n\t\t\t}, options);\n\n\t\t\t//console.log('ajax to = ' + opts.timeout);\n\n\t\t\tif (query && (type === 'GET')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// FIXME the XHR sometimes seemingly silently fails\n\n\t\t\txhr = new XMLHttpRequest(); // we dont support IE < 9\n\n\t\t\tif (xhr) {\n\t\t\t\t// prevent caching\n\t\t\t\tif (opts.nocache) {\n\t\t\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t\t\t}\n\n\t\t\t\tif (opts.loader)\n\t\t\t\t\t$('#loader').addClass('show');\n\n\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\txhr.timeout = opts.timeout;\n\n\t\t\t\tabortTmeo = setTimeout(function () {\n\t\t\t\t\terrorMsg(\"XHR timed out.\");\n\t\t\t\t\txhr.abort();\n\t\t\t\t\tif (opts.loader) $('#loader').removeClass('show');\n\t\t\t\t}, opts.timeout + 10); // a bit later, but still.;\n\n\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\n\t\t\t\t\t\tif (opts.loader)\n\t\t\t\t\t\t\t$('#loader').removeClass('show');\n\n\t\t\t\t\t\tif (callback && xhr.status != 0) { // xhr.status 0 means \"aborted\"\n\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\tif (type === 'POST') {\n\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t}\n\n\t\t\t\txhr.send(query);\n\t\t\t}\n\n\t\t\treturn xhr;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback)\n\t\tcb.get = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'get', callback, opts);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback)\n\t\tcb.post = function (url, callback, opts) {\n\t\t\treturn cb.ajax(url, 'post', callback, opts);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n // Chartist.escapingMap = {\n // '&': '&',\n // '<': '<',\n // '>': '>',\n // '\"': '"',\n // '\\'': '''\n // };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return _.escape(data);\n\n // return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n // }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n // data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n // return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n // }, data);\n data = _.unescape(data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n // /**\n // * Calculate cartesian coordinates of polar coordinates\n // *\n // * @memberof Chartist.Core\n // * @param {Number} centerX X-axis coordinates of center point of circle segment\n // * @param {Number} centerY X-axis coordinates of center point of circle segment\n // * @param {Number} radius Radius of circle segment\n // * @param {Number} angleInDegrees Angle of circle segment in degrees\n // * @return {{x:Number, y:Number}} Coordinates of point on circumference\n // */\n // Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n // var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n //\n // return {\n // x: centerX + (radius * Math.cos(angleInRadians)),\n // y: centerY + (radius * Math.sin(angleInRadians))\n // };\n // };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\n if (_.isNumber(lblText)) {\n lblText = Chartist.roundWithPrecision(lblText, 2);\n }\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n // /**\n // * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n // *\n // * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n // *\n // * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n // *\n // * @example\n // * var chart = new Chartist.Line('.ct-chart', {\n // * labels: [1, 2, 3, 4, 5],\n // * series: [[1, 2, 8, 1, 7]]\n // * }, {\n // * lineSmooth: Chartist.Interpolation.cardinal({\n // * tension: 1,\n // * fillHoles: false\n // * })\n // * });\n // *\n // * @memberof Chartist.Interpolation\n // * @param {Object} options The options of the cardinal factory function.\n // * @return {Function}\n // */\n // Chartist.Interpolation.cardinal = function(options) {\n // var defaultOptions = {\n // tension: 1,\n // fillHoles: false\n // };\n //\n // options = Chartist.extend({}, defaultOptions, options);\n //\n // var t = Math.min(1, Math.max(0, options.tension)),\n // c = 1 - t;\n //\n // // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // // This functionality is necessary to treat \"holes\" in the line charts\n // function splitIntoSegments(pathCoordinates, valueData) {\n // var segments = [];\n // var hole = true;\n //\n // for(var i = 0; i < pathCoordinates.length; i += 2) {\n // // If this value is a \"hole\" we set the hole flag\n // if(valueData[i / 2].value === undefined) {\n // if(!options.fillHoles) {\n // hole = true;\n // }\n // } else {\n // // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n // if(hole) {\n // segments.push({\n // pathCoordinates: [],\n // valueData: []\n // });\n // // As we have a valid value now, we are not in a \"hole\" anymore\n // hole = false;\n // }\n //\n // // Add to the segment pathCoordinates and valueData\n // segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n // segments[segments.length - 1].valueData.push(valueData[i / 2]);\n // }\n // }\n //\n // return segments;\n // }\n //\n // return function cardinal(pathCoordinates, valueData) {\n // // First we try to split the coordinates into segments\n // // This is necessary to treat \"holes\" in line charts\n // var segments = splitIntoSegments(pathCoordinates, valueData);\n //\n // if(!segments.length) {\n // // If there were no segments return 'Chartist.Interpolation.none'\n // return Chartist.Interpolation.none()([]);\n // } else if(segments.length > 1) {\n // // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // // afterwards together into a single path.\n // var paths = [];\n // // For each segment we will recurse the cardinal function\n // segments.forEach(function(segment) {\n // paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n // });\n // // Join the segment path data into a single path and return\n // return Chartist.Svg.Path.join(paths);\n // } else {\n // // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // // segment\n // pathCoordinates = segments[0].pathCoordinates;\n // valueData = segments[0].valueData;\n //\n // // If less than two points we need to fallback to no smoothing\n // if(pathCoordinates.length <= 4) {\n // return Chartist.Interpolation.none()(pathCoordinates, valueData);\n // }\n //\n // var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n // z;\n //\n // for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n // var p = [\n // {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n // {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n // {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n // {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n // ];\n // if (z) {\n // if (!i) {\n // p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n // } else if (iLen - 4 === i) {\n // p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // } else if (iLen - 2 === i) {\n // p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n // p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n // }\n // } else {\n // if (iLen - 4 === i) {\n // p[3] = p[2];\n // } else if (!i) {\n // p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n // }\n // }\n //\n // path.curve(\n // (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n // (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n // (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n // (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n // p[2].x,\n // p[2].y,\n // false,\n // valueData[(i + 2) / 2]\n // );\n // }\n //\n // return path;\n // }\n // };\n // };\n\n\n /**\n * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.\n *\n * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.monotoneCubic({\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the monotoneCubic factory function.\n * @return {Function}\n */\n Chartist.Interpolation.monotoneCubic = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else if(i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {\n // Because we are doing monotone interpolation, curve fitting only makes sense for\n // increasing x values. Therefore if two subsequent points have the same x value, or\n // the x value is decreasing, then we create a hole at this point. (Which cannot be\n // filled in even with the 'fillHoles' option)\n\n hole = true;\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function monotoneCubic(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the monotoneCubic fn function\n segments.forEach(function(segment) {\n paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than three points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var xs = [],\n ys = [],\n i,\n n = pathCoordinates.length / 2,\n ms = [],\n ds = [], dys = [], dxs = [],\n path;\n\n // Populate x and y coordinates into separate arrays, for readability\n\n for(i = 0; i < n; i++) {\n xs[i] = pathCoordinates[i * 2];\n ys[i] = pathCoordinates[i * 2 + 1];\n }\n\n // Calculate deltas and derivative\n\n for(i = 0; i < n - 1; i++) {\n dys[i] = ys[i + 1] - ys[i];\n dxs[i] = xs[i + 1] - xs[i];\n ds[i] = dys[i] / dxs[i];\n }\n\n // Determine desired slope (m) at each point using Fritsch-Carlson method\n // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation\n\n ms[0] = ds[0];\n ms[n - 1] = ds[n - 2];\n\n for(i = 1; i < n - 1; i++) {\n if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {\n ms[i] = 0;\n } else {\n ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (\n (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +\n (dxs[i] + 2 * dxs[i - 1]) / ds[i]);\n\n if(!isFinite(ms[i])) {\n ms[i] = 0;\n }\n }\n }\n\n // Now build a path from the slopes\n\n path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);\n\n for(i = 0; i < n - 1; i++) {\n path.curve(\n // First control point\n xs[i] + dxs[i] / 3,\n ys[i] + ms[i] * dxs[i] / 3,\n // Second control point\n xs[i + 1] - dxs[i] / 3,\n ys[i + 1] - ms[i + 1] * dxs[i] / 3,\n // End point\n xs[i + 1],\n ys[i + 1],\n\n false,\n valueData[i + 1] // changed as per patch on github\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var xy = this.units.pos.toUpperCase();\n var axisOptions = chartOptions['axis' + xy];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n\n\n var labelLength=0;\n\n\n if (xy == 'Y') { // X doesnt use this\n if (projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n // lastWidth = labelLength;\n // } else if (typeof lastWidth != 'undefined') {\n // labelLength = lastWidth; // EDIT. added the lastWidth thing\n } else {\n // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // still be visible inside of the chart padding.\n labelLength = Math.max(this.axisLength - projectedValue, 30);\n }\n }\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// // AMD. Register as an anonymous module.\n\t// define([], function () {\n\t// return (root.returnExportsGlobal = factory());\n\t// });\n\t// } else if (typeof exports === 'object') {\n\t// // Node. Does not work with strict CommonJS, but\n\t// // only CommonJS-like enviroments that support module.exports,\n\t// // like Node.\n\t// module.exports = factory();\n\t// } else {\n\troot['Chartist.plugins.zoom'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js zoom plugin.\n\t *\n\t */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar defaultOptions = {\n\t\t\t// onZoom\n\t\t\t// resetOnRightMouseBtn\n\t\t};\n\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.zoom = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\treturn function zoom(chart) {\n\n\t\t\t\tif (!(chart instanceof Chartist.Line)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rect, svg, axisX, axisY, chartRect;\n\t\t\t\tvar downPosition;\n\t\t\t\tvar onZoom = options.onZoom;\n\t\t\t\tvar ongoingTouches = [];\n\n\t\t\t\tchart.on('draw', function (data) {\n\t\t\t\t\tvar type = data.type;\n\t\t\t\t\tif (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n\t\t\t\t\t\tdata.element.attr({\n\t\t\t\t\t\t\t'clip-path': 'url(#zoom-mask)'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\taxisX = data.axisX;\n\t\t\t\t\taxisY = data.axisY;\n\t\t\t\t\tchartRect = data.chartRect;\n\t\t\t\t\tsvg = data.svg._node;\n\t\t\t\t\trect = data.svg.elem('rect', {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 10,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\theight: 100,\n\t\t\t\t\t}, 'ct-zoom-rect');\n\t\t\t\t\thide(rect);\n\n\t\t\t\t\tvar defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n\t\t\t\t\tvar width = chartRect.width();\n\t\t\t\t\tvar height = chartRect.height();\n\n\t\t\t\t\tdefs\n\t\t\t\t\t\t.elem('clipPath', {\n\t\t\t\t\t\t\tid: 'zoom-mask'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.elem('rect', {\n\t\t\t\t\t\t\tx: chartRect.x1,\n\t\t\t\t\t\t\ty: chartRect.y2,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\theight: height,\n\t\t\t\t\t\t\tfill: 'white'\n\t\t\t\t\t\t});\n\n\t\t\t\t\tsvg.addEventListener('mousedown', onMouseDown);\n\t\t\t\t\tsvg.addEventListener('mouseup', onMouseUp);\n\t\t\t\t\tsvg.addEventListener('mousemove', onMouseMove);\n\t\t\t\t\tsvg.addEventListener('touchstart', onTouchStart);\n\t\t\t\t\tsvg.addEventListener('touchmove', onTouchMove);\n\t\t\t\t\tsvg.addEventListener('touchend', onTouchEnd);\n\t\t\t\t\tsvg.addEventListener('touchcancel', onTouchCancel);\n\t\t\t\t});\n\n\t\t\t\tfunction copyTouch(touch) {\n\t\t\t\t\tvar p = position(touch, svg);\n\t\t\t\t\tp.id = touch.identifier;\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tfunction ongoingTouchIndexById(idToFind) {\n\t\t\t\t\tfor (var i = 0; i < ongoingTouches.length; i++) {\n\t\t\t\t\t\tvar id = ongoingTouches[i].id;\n\t\t\t\t\t\tif (id === idToFind) {\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchStart(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tongoingTouches.push(copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchMove(event) {\n\t\t\t\t\tvar touches = event.changedTouches;\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\trect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchCancel(event) {\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t}\n\n\t\t\t\tfunction removeTouches(touches) {\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\t\tvar idx = ongoingTouchIndexById(touches[i].identifier);\n\t\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\t\tongoingTouches.splice(idx, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onTouchEnd(event) {\n\t\t\t\t\tif (ongoingTouches.length > 1) {\n\t\t\t\t\t\tzoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n\t\t\t\t\t}\n\t\t\t\t\tremoveTouches(event.changedTouches);\n\t\t\t\t\thide(rect);\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseDown(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tdownPosition = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, downPosition));\n\t\t\t\t\t\tshow(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar reset = function () {\n\t\t\t\t\tchart.options.axisX.highLow = null;\n\t\t\t\t\tchart.options.axisY.highLow = null;\n\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t};\n\n\t\t\t\tfunction onMouseUp(event) {\n\t\t\t\t\tif (event.button === 0) {\n\t\t\t\t\t\tvar box = getRect(downPosition, position(event, svg));\n\t\t\t\t\t\tzoomIn(box);\n\t\t\t\t\t\tdownPosition = null;\n\t\t\t\t\t\thide(rect);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\telse if (options.resetOnRightMouseBtn && event.button === 2) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction zoomIn(rect) {\n\t\t\t\t\tif (rect.width > 5 && rect.height > 5) {\n\t\t\t\t\t\tvar x1 = rect.x - chartRect.x1;\n\t\t\t\t\t\tvar x2 = x1 + rect.width;\n\t\t\t\t\t\tvar y2 = chartRect.y1 - rect.y;\n\t\t\t\t\t\tvar y1 = y2 - rect.height;\n\n\t\t\t\t\t\tvar xLow = project(x1, axisX);\n\t\t\t\t\t\tvar xHigh = project(x2, axisX);\n\t\t\t\t\t\tvar yLow = project(y1, axisY);\n\t\t\t\t\t\tvar yHigh = project(y2, axisY);\n\n\t\t\t\t\t\tvar explb = chart.options.explicitBounds;\n\t\t\t\t\t\tif (!_.isUndefined(explb)) {\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow);\n\t\t\t\t\t\t\tif (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchart.options.axisX.highLow = {low: xLow, high: xHigh};\n\t\t\t\t\t\tchart.options.axisY.highLow = {low: yLow, high: yHigh};\n\n\t\t\t\t\t\tchart.update(chart.data, chart.options);\n\t\t\t\t\t\tonZoom && onZoom(chart, reset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction onMouseMove(event) {\n\t\t\t\t\tif (downPosition) {\n\t\t\t\t\t\tvar point = position(event, svg);\n\t\t\t\t\t\trect.attr(getRect(downPosition, point));\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tfunction hide(rect) {\n\t\t\trect.attr({style: 'display:none'});\n\t\t}\n\n\t\tfunction show(rect) {\n\t\t\trect.attr({style: 'display:block'});\n\t\t}\n\n\t\tfunction getRect(firstPoint, secondPoint) {\n\t\t\tvar x = firstPoint.x;\n\t\t\tvar y = firstPoint.y;\n\t\t\tvar width = secondPoint.x - x;\n\t\t\tvar height = secondPoint.y - y;\n\t\t\tif (width < 0) {\n\t\t\t\twidth = -width;\n\t\t\t\tx = secondPoint.x;\n\t\t\t}\n\t\t\tif (height < 0) {\n\t\t\t\theight = -height;\n\t\t\t\ty = secondPoint.y;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t}\n\n\t\tfunction position(event, svg) {\n\t\t\treturn transform(event.clientX, event.clientY, svg);\n\t\t}\n\n\t\tfunction transform(x, y, svgElement) {\n\t\t\tvar svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n\t\t\tvar matrix = svg.getScreenCTM();\n\t\t\tvar point = svg.createSVGPoint();\n\t\t\tpoint.x = x;\n\t\t\tpoint.y = y;\n\t\t\tpoint = point.matrixTransform(matrix.inverse());\n\t\t\treturn point || {x: 0, y: 0};\n\t\t}\n\n\t\tfunction project(value, axis) {\n\t\t\tvar max = axis.bounds.max;\n\t\t\tvar min = axis.bounds.min;\n\t\t\tif (axis.scale && axis.scale.type === 'log') {\n\t\t\t\tvar base = axis.scale.base;\n\t\t\t\treturn Math.pow(base,\n\t\t\t\t\t\tvalue * baseLog(max / min, base) / axis.axisLength) * min;\n\t\t\t}\n\t\t\treturn (value * axis.bounds.range / axis.axisLength) + min;\n\t\t}\n\n\t\tfunction baseLog(val, base) {\n\t\t\treturn Math.log(val) / Math.log(base);\n\t\t}\n\n\t}(window, document, Chartist));\n\treturn Chartist.plugins.zoom;\n\n}));\n","/**\n * @license\n * lodash 4.6.1 (Custom Build) \n * Build: `lodash include=\"range,isArray,isObject,escape,unescape,escapeRegExp,each,replace,map,isNumber,isUndefined\" exports=\"global\" -d`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.6.1';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n NAN = 0 / 0;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[mapTag] = cloneableTags[numberTag] =\n cloneableTags[objectTag] = cloneableTags[regexpTag] =\n cloneableTags[setTag] = cloneableTags[stringTag] =\n cloneableTags[symbolTag] = cloneableTags[uint8Tag] =\n cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =\n cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseInt = parseInt;\n\n /** Detect free variable `exports`. */\n var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n /** Detect free variable `module`. */\n var freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = (freeModule && freeModule.exports === freeExports)\n ? freeExports\n : undefined;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n /** Detect free variable `self`. */\n var freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n /** Detect free variable `window`. */\n var freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n /** Detect `this` as the global object. */\n var thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `Map#set` because it doesn't return the map instance in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n set.add(value);\n return set;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the new array of key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\n function checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Converts `map` to an array.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the converted array.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Converts `set` to an array.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the converted array.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertySymbols = Object.getOwnPropertySymbols,\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeKeys = Object.keys,\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var mapCtorString = Map ? funcToString.call(Map) : '',\n setCtorString = Set ? funcToString.call(Set) : '',\n weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chaining. Methods that operate on and return arrays, collections, and\n * functions can be chained together. Methods that retrieve a single value or\n * may return a primitive value will automatically end the chain sequence and\n * return the unwrapped value. Otherwise, the value must be unwrapped with\n * `_#value`.\n *\n * Explicit chaining, which must be unwrapped with `_#value` in all cases,\n * may be enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization to merge iteratee calls; this avoids the creation\n * of intermediate arrays and can greatly reduce the number of iteratee executions.\n * Sections of a chain sequence qualify for shortcut fusion if the section is\n * applied to an array of at least two hundred elements and any iteratees\n * accept only one argument. The heuristic for whether a section qualifies\n * for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,\n * `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,\n * `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,\n * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,\n * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,\n * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,\n * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,\n * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,\n * `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,\n * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,\n * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,\n * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,\n * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,\n * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,\n * `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,\n * `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,\n * `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,\n * `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,\n * `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,\n * `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,\n * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,\n * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,\n * `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,\n * `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,\n * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,\n * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,\n * `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an hash object.\n *\n * @private\n * @constructor\n * @returns {Object} Returns the new hash object.\n */\n function Hash() {}\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(hash, key) {\n return hashHas(hash, key) && delete hash[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(hash, key) {\n if (nativeCreate) {\n var result = hash[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(hash, key) ? hash[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @param {Object} hash The hash to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(hash, key) {\n return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function hashSet(hash, key, value) {\n hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function MapCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapDelete(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashDelete(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map['delete'](key) : assocDelete(data.map, key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapGet(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashGet(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.get(key) : assocGet(data.map, key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n var data = this.__data__;\n if (isKeyable(key)) {\n return hashHas(typeof key == 'string' ? data.string : data.hash, key);\n }\n return Map ? data.map.has(key) : assocHas(data.map, key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache object.\n */\n function mapSet(key, value) {\n var data = this.__data__;\n if (isKeyable(key)) {\n hashSet(typeof key == 'string' ? data.string : data.hash, key, value);\n } else if (Map) {\n data.map.set(key, value);\n } else {\n assocSet(data.map, key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function Stack(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = values[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocDelete(array, key) : data.map['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocGet(array, key) : data.map.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n var data = this.__data__,\n array = data.array;\n\n return array ? assocHas(array, key) : data.map.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache object.\n */\n function stackSet(key, value) {\n var data = this.__data__,\n array = data.array;\n\n if (array) {\n if (array.length < (LARGE_ARRAY_SIZE - 1)) {\n assocSet(array, key, value);\n } else {\n data.array = null;\n data.map = new MapCache(array);\n }\n }\n var map = data.map;\n if (map) {\n map.set(key, value);\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Removes `key` and its value from the associative array.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function assocDelete(array, key) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n return false;\n }\n var lastIndex = array.length - 1;\n if (index == lastIndex) {\n array.pop();\n } else {\n splice.call(array, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the associative array value for `key`.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function assocGet(array, key) {\n var index = assocIndexOf(array, key);\n return index < 0 ? undefined : array[index][1];\n }\n\n /**\n * Checks if an associative array value for `key` exists.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function assocHas(array, key) {\n return assocIndexOf(array, key) > -1;\n }\n\n /**\n * Gets the index at which the first occurrence of `key` is found in `array`\n * of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Sets the associative array `key` to `value`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n */\n function assocSet(array, key, value) {\n var index = assocIndexOf(array, key);\n if (index < 0) {\n array.push([key, value]);\n } else {\n array[index][1] = value;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the array-like object.\n */\n function baseCastFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function baseCastPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n result = baseAssign(result, value);\n return isFull ? copySymbols(value, result) : result;\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return (isFull && !isArr) ? copySymbols(value, result) : result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path + ''] : baseCastPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n stack || (stack = new Stack);\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack,\n result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;\n\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n var type = typeof value;\n if (type == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (type == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n return nativeKeys(Object(object));\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value &&\n (value !== undefined || (key in Object(object)));\n };\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments to numbers.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the new array of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map) {\n return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set) {\n return arrayReduce(setToArray(set), addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n }\n\n /**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toNumber(start);\n start = start === start ? start : 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toNumber(end) || 0;\n }\n step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var index = -1,\n isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n isUnordered = bitmask & UNORDERED_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(array, other);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isUnordered) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object) ? other != +other : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n // Recursively compare objects (susceptible to call stack limits).\n return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : baseHas(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n return result;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If the `_.iteratee` method is\n * customized this function returns the custom method, otherwise it returns\n * `baseIteratee`. If arguments are provided the chosen function is invoked\n * with them and its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = toPairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = getOwnPropertySymbols || function() {\n return [];\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function getTag(value) {\n return objectToString.call(value);\n }\n\n // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.\n if ((Map && getTag(new Map) != mapTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : null,\n ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case mapCtorString: return mapTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n if (object == null) {\n return false;\n }\n var result = hasFunc(object, path);\n if (!result && !isKey(path)) {\n path = baseCastPath(path);\n object = parent(object, path);\n if (object != null) {\n path = last(path);\n result = hasFunc(object, path);\n }\n }\n var length = object ? object.length : undefined;\n return result || (\n !!length && isLength(length) && isIndex(path, length) &&\n (isArray(object) || isString(object) || isArguments(object))\n );\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototypeOf(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\n function indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (typeof value == 'number') {\n return true;\n }\n return !isArray(value) &&\n (reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object)));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return type == 'number' || type == 'boolean' ||\n (type == 'string' && value != '__proto__') || value == null;\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n function stringToPath(string) {\n var result = [];\n toString(string).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`\n * for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => logs `1` then `2`\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' then 'b' (iteration order is not guaranteed)\n */\n function forEach(collection, iteratee) {\n return (typeof iteratee == 'function' && isArray(collection))\n ? arrayEach(collection, iteratee)\n : baseEach(collection, baseCastFunction(iteratee));\n }\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,\n * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,\n * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,\n * and `words`\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = !Buffer ? constant(false) : function(value) {\n return value instanceof Buffer;\n };\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(funcToString.call(value));\n }\n return isObjectLike(value) &&\n (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\n function toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b.c');\n * // => true\n *\n * _.hasIn(object, ['a', 'b', 'c']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Creates an array of own enumerable key-value pairs for `object` which\n * can be consumed by `_.fromPairs`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n function toPairs(object) {\n return baseToPairs(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument given to it.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name the created callback returns the\n * property value for a given element. If `func` is an object the created\n * callback returns `true` for elements that contain the equivalent object\n * properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(callback, func) {\n * var p = /^(\\S+)\\s*([<>])\\s*(\\S+)$/.exec(func);\n * return !p ? callback(func) : function(object) {\n * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);\n * };\n * });\n *\n * _.filter(users, 'age > 36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /*------------------------------------------------------------------------*/\n\n // Avoid inheriting from `Object.prototype` when possible.\n Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;\n\n // Add functions to the `MapCache`.\n MapCache.prototype.clear = mapClear;\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Stack` cache.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n // Add functions that return wrapped values when chaining.\n lodash.constant = constant;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.property = property;\n lodash.range = range;\n lodash.toPairs = toPairs;\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isNative = isNative;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.replace = replace;\n lodash.toNumber = toNumber;\n lodash.toString = toString;\n lodash.unescape = unescape;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n // Expose lodash on the free variable `window` or `self` when available. This\n // prevents errors in cases where lodash is loaded by a script tag in the presence\n // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.\n (freeWindow || freeSelf || {})._ = lodash;\n\n // Export to the global object.\n root._ = lodash;\n}.call(this));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\nfunction numfmt(x, places) {\n\tvar pow = Math.pow(10, places);\n\treturn Math.round(x*pow) / pow;\n}\n\nfunction estimateLoadTime(fs, n) {\n\treturn (1000/fs)*n+1500;\n}\n\nfunction msNow() {\n\treturn +(new Date);\n}\n\nfunction msElapsed(start) {\n\treturn msNow() - start;\n}\n\nMath.log10 = Math.log10 || function(x) {\n\treturn Math.log(x) / Math.LN10;\n};\n\n/**\n * Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (_.isArray(arguments[0]) || _.isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(_.escapeRegExp(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tif ($(this).hasClass('no-close')) return; // this is a no-close modal\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","var notify = (function () {\n\tvar nt = {};\n\tvar sel = '#notif';\n\n\tvar hideTmeo1;\n\tvar hideTmeo2;\n\n\tnt.show = function (message, timeout) {\n\t\t$(sel).html(message);\n\t\tmodal.show(sel);\n\n\t\tclearTimeout(hideTmeo1);\n\t\tclearTimeout(hideTmeo2);\n\n\t\tif (!_.isUndefined(timeout)) {\n\t\t\thideTmeo1 = setTimeout(nt.hide, timeout);\n\t\t}\n\t};\n\n\tnt.hide = function () {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\thideTmeo2 = setTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 250); // transition time\n\t};\n\n\tnt.init = function() {\n\t\t$(sel).on('click', function() {\n\t\t\tnt.hide(this);\n\t\t});\n\t};\n\n\treturn nt;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\t$('input[type=number]').on('mousewheel', function(e) {\n\t\tvar val = +$(this).val();\n\t\tvar step = +($(this).attr('step') || 1);\n\t\tvar min = $(this).attr('min');\n\t\tvar max = $(this).attr('max');\n\t\tif(e.wheelDelta > 0) {\n\t\t\tval += step;\n\t\t} else {\n\t\t\tval -= step;\n\t\t}\n\t\tif (!_.isUndefined(min)) val = Math.max(val, min);\n\t\tif (!_.isUndefined(max)) val = Math.min(val, max);\n\t\t$(this).val(val);\n\n\t\tif (\"createEvent\" in document) {\n\t\t\tvar evt = document.createEvent(\"HTMLEvents\");\n\t\t\tevt.initEvent(\"change\", false, true);\n\t\t\t$(this)[0].dispatchEvent(evt);\n\t\t} else {\n\t\t\t$(this)[0].fireEvent(\"onchange\");\n\t\t}\n\n\t\te.preventDefault();\n\t});\n\n\tmodal.init();\n\tnotify.init();\n});\n\n\nfunction errorMsg(msg, time) {\n\tnotify.show(msg, time || 3000);\n}\n","/** Wifi page */\nvar page_wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n","var page_mon = (function() {\n\tvar mon = {};\n\n\tfunction updRefInfoField(ok) {\n\t\t$('#hasref').html(ok ? 'OK' : 'Not set!');\n\t}\n\n\t/** Capture reference & save to flash */\n\tmon.captureRef = function() {\n\t\t$().get(_root + '/mon/setref', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tupdRefInfoField(j.success);\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\tupdRefInfoField(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Capture waveform and compare with reference */\n\tmon.compareNow = function() {\n\t\t$().get(_root + '/mon/compare', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t$('#actual-dev').html(numfmt(j.deviation, 2));\n\t\t\t\t\t\t$('#actual-rms').html(numfmt(j.rms, 2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow 'Capture failed.';\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tmon.init = function() {\n\t\tsetInterval(function() {\n\t\t\t$().get(_root + '/mon/status', function(resp, status) {\n\t\t\t\tif (status == 200) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// OK\n\t\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t\t$('#actual-dev').html(numfmt(j.deviation, 2));\n\t\t\t\t\t\t\t$('#actual-rms').html(numfmt(j.rms, 2));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow 'Capture failed.';\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}, 10000);\n\t};\n\n\treturn mon;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/user/page_monitoring.c b/user/page_monitoring.c index 6acf147..d91f0f8 100644 --- a/user/page_monitoring.c +++ b/user/page_monitoring.c @@ -14,7 +14,7 @@ httpd_cgi_state FLASH_FN cgiMonCompare(HttpdConnData *connData) httpdEndHeaders(connData); // this is semi-async (waits for completion) - bool suc = capture_and_report(); + bool suc = capture_and_report(false); char buf[100]; @@ -35,6 +35,33 @@ httpd_cgi_state FLASH_FN cgiMonCompare(HttpdConnData *connData) return HTTPD_CGI_DONE; } +/** This is an automated poll for current state, to update the display (measured by reporting func) */ +httpd_cgi_state FLASH_FN cgiMonStatus(HttpdConnData *connData) +{ + if (connData->conn == NULL) return HTTPD_CGI_DONE; + + httpdStartResponse(connData, 200); + httpdHeader(connData, "Content-Type", "application/json"); + httpdEndHeaders(connData); + + char buf[100]; + + if (rpt_result.ready) { + // success + char *bb = buf; + bb += sprintf(bb, "{\"success\": true, \"deviation\": "); + bb += my_ftoa(bb,rpt_result.deviation, 2); + bb += sprintf(bb, ", \"rms\": "); + bb += my_ftoa(bb,rpt_result.i_rms, 2); + bb += sprintf(bb, "}"); + httpdSend(connData, buf, -1); + } else { + httpdSend(connData, "{\"success\": false}", -1); + } + + return HTTPD_CGI_DONE; +} + httpd_cgi_state FLASH_FN cgiMonSetRef(HttpdConnData *connData) { diff --git a/user/page_monitoring.h b/user/page_monitoring.h index a5cc406..7449e2f 100644 --- a/user/page_monitoring.h +++ b/user/page_monitoring.h @@ -6,6 +6,7 @@ httpd_cgi_state tplMonitoring(HttpdConnData *connData, char *token, void **arg); httpd_cgi_state cgiMonCompare(HttpdConnData *connData); +httpd_cgi_state cgiMonStatus(HttpdConnData *connData); // same result as "compare", but doesn't measure anything httpd_cgi_state cgiMonSetRef(HttpdConnData *connData); diff --git a/user/reporting.c b/user/reporting.c index 12e19d9..e37bcb0 100644 --- a/user/reporting.c +++ b/user/reporting.c @@ -17,7 +17,7 @@ static void FLASH_FN rpt_tim_cb(void *arg) (void)arg; // send report now... if (rpt_conf.enabled) { - capture_and_report(); + capture_and_report(true); } } @@ -130,12 +130,13 @@ static void FLASH_FN do_send_report(void) bb += my_ftoa(bb, rpt_result.i_rms, 2); // URL + // We technically could use HTTPS, but it's not tested and probably buggy as hell sprintf(url_buf, "http://api.xively.com/v2/feeds/%s.csv", rpt_conf.feed); // Key sprintf(hdrs_buf, "X-ApiKey: %s\r\n", rpt_conf.key); - http_put(url_buf, buf, hdrs_buf, http_callback_example); + http_put(url_buf, buf, hdrs_buf, http_callback_showstatus); break; @@ -147,10 +148,17 @@ static void FLASH_FN do_send_report(void) /** Immediately send report to xively / thingspeak */ -bool FLASH_FN capture_and_report(void) +bool FLASH_FN capture_and_report(bool do_report) { info("Starting reporting measurmenet..."); + + if (rpt_result.busy) { + error("Capture busy."); + return false; + } + rpt_result.ready = false; + rpt_result.busy = true; uint16_t sesn; sbmp_ep_send_message(dlnk_ep, DG_REQUEST_COMPARE_REF, NULL, 0, &sesn, NULL); @@ -162,9 +170,11 @@ bool FLASH_FN capture_and_report(void) uart_poll(); if (rpt_result.ready) { - if (rpt_result.success) { + if (rpt_result.success && do_report) { do_send_report(); } + + rpt_result.busy = false; return true; // done } @@ -175,6 +185,8 @@ bool FLASH_FN capture_and_report(void) // timeout - remove listener error("Measure timeout - no resp received."); sbmp_ep_remove_listener(dlnk_ep, sesn); + + rpt_result.busy = false; return false; } @@ -197,6 +209,12 @@ bool FLASH_FN capture_reporting_reference(void) { info("Capturing reference..."); + if (rpt_result.busy) { + error("Capture busy."); + return false; + } + rpt_result.busy = true; + uint16_t sesn; sbmp_ep_send_message(dlnk_ep, DG_REQUEST_STORE_REF, NULL, 0, &sesn, NULL); sbmp_ep_add_listener(dlnk_ep, sesn, store_ref_cb, NULL); @@ -209,6 +227,7 @@ bool FLASH_FN capture_reporting_reference(void) uart_poll(); if (capt_ref_done) { + rpt_result.busy = false; return capt_ref_success; // done } @@ -219,5 +238,6 @@ bool FLASH_FN capture_reporting_reference(void) // timeout - remove listener error("Ref capture timeout - no resp received."); sbmp_ep_remove_listener(dlnk_ep, sesn); + rpt_result.busy = false; return false; } diff --git a/user/reporting.h b/user/reporting.h index a564dd9..64a743a 100644 --- a/user/reporting.h +++ b/user/reporting.h @@ -25,6 +25,7 @@ typedef struct { typedef struct { bool ready; bool success; + bool busy; float deviation; float i_rms; } ReportingResult; @@ -42,8 +43,8 @@ void reporting_cfg_save(void); /** Load the reporting config from flash */ void reporting_cfg_load(void); -/** Immediately send report to xively / thingspeak */ -bool capture_and_report(void); +/** Immediately capture & send report to xively / thingspeak (or dont send - just for view) */ +bool capture_and_report(bool do_report); /** Capture reference vector for monitoring */ bool capture_reporting_reference(void); diff --git a/user/routes.c b/user/routes.c index 295ef2f..01141c4 100644 --- a/user/routes.c +++ b/user/routes.c @@ -48,6 +48,7 @@ HttpdBuiltInUrl builtInUrls[] = { ROUTE_TPL_FILE("/measure/fft", tplFourierJSON, "/json/samples.tpl"), ROUTE_CGI("/mon/compare", cgiMonCompare), + ROUTE_CGI("/mon/status", cgiMonStatus), ROUTE_CGI("/mon/setref", cgiMonSetRef), ROUTE_CGI("/mon/config", cgiMonitoringCfg), // redirects to /monitoring From 63365e093114059d2a19b2ff4a082c16bce78f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 24 Apr 2016 23:46:54 +0200 Subject: [PATCH 10/11] deleted shitz Former-commit-id: 9b40e2aa2aee419539e5a6dfd51bb04e7430c760 --- .gitignore | 4 ++++ esp_iot_sdk_v1.5.2/lib/tmp/aes-cbc.o | Bin 3128 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/aes-internal-dec.o | Bin 4552 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/aes-internal-enc.o | Bin 4020 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/aes-internal.o | Bin 3024 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/aes-wrap.o | Bin 2552 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/bignum.o | Bin 27832 -> 0 bytes .../lib/tmp/crypto_internal-cipher.o | Bin 5232 -> 0 bytes .../lib/tmp/crypto_internal-modexp.o | Bin 2732 -> 0 bytes .../lib/tmp/crypto_internal-rsa.o | Bin 3708 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal.o | Bin 6900 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/dh_group5.o | Bin 2148 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/dh_groups.o | Bin 4192 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/sha256-internal.o | Bin 4632 -> 0 bytes esp_iot_sdk_v1.5.2/lib/tmp/sha256.o | Bin 3204 -> 0 bytes html_src/css/app.css.map | 1 - html_src/js/.gitignore | 1 + html_src/js/all.js.map | 1 - 18 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/aes-cbc.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/aes-internal-dec.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/aes-internal-enc.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/aes-internal.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/aes-wrap.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/bignum.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-cipher.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-modexp.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-rsa.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/dh_group5.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/dh_groups.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/sha256-internal.o delete mode 100644 esp_iot_sdk_v1.5.2/lib/tmp/sha256.o delete mode 100644 html_src/css/app.css.map create mode 100644 html_src/js/.gitignore delete mode 100644 html_src/js/all.js.map diff --git a/.gitignore b/.gitignore index e1b62c0..f11fed3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ build/ .idea *.pro.user + +*.o +*.d +*.map diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/aes-cbc.o b/esp_iot_sdk_v1.5.2/lib/tmp/aes-cbc.o deleted file mode 100644 index dc89829825ab7f46d85e4071db8b6922d8bc9044..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3128 zcma)8U1(Eh82(OMU7Hw<#erKLgiMALayU7)u9IanZBu(@n%JLcFUF3i>FEr#X-zV$ zW3YAXW-xFa-VBE5F2svnC^+z97md5v1cf;mC`^VR!|q4in4lN3J31z8Wz}f&{iRKc>y~_ScFvQnzpn0-NU7hwa&&*|x1!yZ`r!5RY1}nD6|#eyd1qjA`52v_D9$v?V*1&xHFgT@7#87z>3ovqkg^ z(G~6MHq1WJCBFIOx7enHHlk@iGd>ndu8!3itadEjIDL6}^?be7znDYT+NEl}N0PN(I}^@$wMMJq zLu+uIEj8thLh0DY8dgi7=xlw{N%N+y9ZBxiMoFziMp4spT2Yc zLA8CUv)YHcpP#I_#j+C_n4eoH%(|t>0k>2x%oii^xNhjCZW{3(qsNGM$Iaf}p2(g^ z#Bs~9{8V1gNAk5k(~+Zv%3-)-Su+xQvs-KsLY%_Ra&v3xZL2slFNP1=1KG@wwbvRn z62@ZQ?9ER*Gfu$A$HB*qUUO>q%ST!vxvyks~p2a^3(A|A+% zr|e|^cs8AzNZDy?A~lvwk0%T!Jdhe2x3ZZ;G(FjkiNvEMN34u;*dxi;vSSIe+wj8I zc&rROaj!#i@<|>19@$|ml};s5QYJZ)N<_zoVq84kj0TjWUQ}&y8;)8r-uw*Hndzf^WVIHBEkIhw_DYTVRtv#$z zp)@~d=(B~2TXJTFKJ8Q-p-+{|LNB?qj$U(D+{KE}as21pBEX_|h4cc?cr9$P!W0c- zp)|k1f&Z6qIa%#`8C`o18(rHZ>_hu+adO6Dr;NkX>Pd4x6=%T9<@v8TZfoUz3w=tFXjegAq(h2=4s3<#I*kd1 zWegkTdmUKSN`5$4JA$karPk{!0;@iN;ym(QCy=6i1=#+4hmenP%m-M{w;5QiF`)Pm zosJSnQTf>NIw^S%lQ%%}Nb`tuEY6Fy`tzN`CY}JNMCDWV& zO1N%sDFZF-r6yb8OK0P=XX9&UyTyFz*h0nQB(@7h+;O*3w&&cr{K7H6&yVeC*NgP0 zn|2%NB(9}n(Bqsk2k+DtY$%`6TN3k`qi8&2kQbqhp%4cp&-EhDC!4#a@$x}lg_0*n z9F)8z`QvC^iFq%%lbZZ%#=F73CH3Hbra7;?lx$={UxZM0uNRSmyLo*c2N;lAYg**FKR;@e;|KRIF*e}OTZ@dF9V z7;?lx$?udrKT8+kQ#p4@o*c2tIVgF4(!OGRCw?H7#3&ia?4OA40_$x_w{0{GRu9_ZQz?E9ckBmzL{l+|Nz6EY|^rSY4aUqY9r_ z_-sy_)3gOmi)npT^R8J3=ee0#<-)uY?NhX%7P6`_O=mKX57tHfHeqoN!u@3g)%r9%)lc#^aiNrh`LFd-quYPC-1&iYm#l90n~ZtW2O8b>T}%Ea z!q+brKiqZE<{GgS>a(_Or)})4O}ZWa*neDdcs@O158ShD@3C30*z7lL4tCz7&PiB|H&CSYOo8w&Cb=Fq3dV{OO(oLIFElBX!3S3?HfIMrfS@RMx3|PCm zz*Qahe-~=?-Rosi;X4V{veKbj=lD#FyBLZUomJ#>xr~~Vi?j&Q{+xVO;j6jQx>mZO zm4>y_f>v7AN(HTSUMo@M&p8YBCHK5*r21;jTCFVSO0C-Jdj56-Yp`-7pIKF~r0Bj@ z+hzlgG5Uw|mGyz4xJ-;%$gAf$$eFo3FXX@@ON_xarC`s5av1BJvqTH4o!27-IbYy% zYd$lgpx0DSG?bGI9Mfw{j8yB6MO1A#e_@g%m>fi}r8)t$e1HdoMLa zXB0h)l>*1uGeO=T?~t*{QeIo(!V(K@+;?mi<9YeU%USB(IT2$jI}aaSyY6(Wg&Yfd-g;Y}Qhxa3>^5d$Or7*(7|+^S;eB;d$^`k6 zg)`2Ud67S`OU0>NR%VxEYe1HYOW{kh--?!mz>9RVcfcL;p|5$$NHRQIoX!kcS+=q0z z;3jHxw`jj!@<{(C{mG7r41EIm8#BjoC;{D+LJQNt%JG|G~5^L{l zjmNs%kHjMJ_EwlU=X>_?#J8Q{miA`9Gj=o*54RjW+!^bQ#5>!2BR%2Hqs^QG9*guG zZ9m-I?CtCeA|t<-$gcKoVTgByUpm~=9KgDK#?symi(jY1egCV2*2z-_+6s&`+)II>9|GsAdbj^Vs?Um7d{m8AHX{-6@O*}0il?Ldtsxw_0pga znj7I~fT`~Z6EA8*@u$F3Ey(9r!UtH04RM)o;?$^;7{FJ_R=y(wrLyCr+?P(_s3y|P zH1s|hoOa}gceq)N<1}&OC$4x=y+D?N~F`{gG|SVvdJX+ zH%*wG%@_gnu1RGgKAIezNGkf%AsL&Z4F!^DGeKydNwmozYiPpfmI>2}2p>Qu(ftmg zv$oSHcEZ5qYXL_*#n^3NitRTrJrP$7OymCtTY&uODR>qE2-6(j#=;S%tDSa%g#AhK z1vKJ`BkVGGx+jUJXKj~(=^3Q;AfBEC(uL0z1JjfEHv`jJ-9eM+@IhSYNB+bSb{YH* zgQq9)O9rMgK5yVAd`r+JeZg_|4W2l{E`$FU)`a5Iw(mFcrROmNEbRmjdDGyDBkVGG zg?x-S?-)MB5f<^OzxXc&y@oUvgt`g-SraCk;3*%0%|5$LJU8J3CfsJiy(Zjm!f6wp zGT}E&c*ca!nD99h{=kHbCcJFIS55eq371UxkqO&TCy_g?kH8Hk{7n-M5jM`(e*v%( BcN+iz diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/aes-internal-enc.o b/esp_iot_sdk_v1.5.2/lib/tmp/aes-internal-enc.o deleted file mode 100644 index 34d97b852e5b79b9c5f24cf13e6e9f6d3acc1540..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4020 zcmai1O-y6g6}}HY7-J0BBpp@i#<)>5YJ+uchp8J4k`0*HH9sDMQ@3hj8?a+q1CDvl zfYKi`iYnAiovu34EMAdXS*Qy-%3{>nz^JMml}Lz1L>H)T)dk&9H_a%t8}~c!y$cVT zHWyv)cfWhix#xcO=fRJ{lM|98F;OJ;2D|Jr*05s4!r052!7b)weTHe9+BSaJz<%?C z!Jl^&+*<=>`Np=)9?8-K9F`F@N?fIxw~~jBfEM2NVYXc zc-6pNh(!1Suie8?$9o^Osk_6~E#AXeBv{&2_+h2Gr|?sSx0HB9sTL|FwNl$rYk9Rc zuGZRW?M$s5sI?Qd_C$T$bKKjopZ1;iN900R-NpkIb!W5YR|6I`&mF;FaD1~`R~(UG zW}G8P-4@SOTJ6nf7L!$j6$ITHEp#DpM9$O293ZVcb^c6 zut7gBMJk#nd=S1=P=aTCJrS8l)I!(pIN!U+n@}&m8E;hJ%JUqFH|&A(;Q`;nqQ`k$ zRkWu0--uiJ+#0CIjR!bV%}`p+mrTAw$H2cq){L+3G&pS!5DyDp)*LdqAsg?r?ru z(FiN9EAF8Kt3SVc8WK77iyV88V)n-1u~*BjZ(!fm+cKVsYt5*-wru%9$H0E;1Fu{C z#QSNxdvL?KBuSsP_Za)Ib%y!GD`U%bI?3O<4kp4}vyyxv9`>6VphEt#Y zvmCRzwV|aIC0Aa_7Kd^x3!VkWzMN8WD{EQT*y?g=shBIfUdxr&mR46>UayCHd>$Y7 z4)bB|^?QARz_9BTm+QZyxE6HhMc2J0r2w0u8J}zDO+T|EZ51ytJ;M4t>F7#+l|{ap z9-En-h`t&f=OcW5!53Iq%;vK;6YmA@k=IS+RCHPl zq^CmPm`RNI{9H4?G7_D}h*xt6rT&+LdBku?geSuxq%<9x3XixG6GNn;$LF?*fs3Sc zl`jYMWVH2hUp61O@IYRarEP2`A>tMx&~3MEE*egcMZ#mT+2m9ja$Y5%<5j|Uo$wPe z9!tkVbCD6Z+h!a!2ijXQW6z_lqouv1LcDZKZ+`)NAN4n=&vh`ijrMnFsnEBU@H{r3 z_!kj_iWR;hF2%V6J_!Ck>i2k37??3Bu@C6UbMw_kz@W!z<$>VMZ< z`WY+KgUv<|vfVjUa6!UvFL5$~@Aj3UMq^v&@O5s&OB9_b>Y5Th8HuuFtrgIi3W}cDONoR}Nn+QFC-WP!BIhsXF z{TI=SLUw-9K}-Etul4ENiD!uXUq@d&In*y*vuATT&dN*QU0KZLis6-o@+CH*DI2OY%!W6q? zV4CxX2Bs&yVPMMZx3DF9`h0NoCF9?;Im3oH!aWB69fPOO$IGY^T@aL7%Q6rS}oPU0r*t{eJ80(D&u6;iCRO^Q=B!cO84)BLzjoH__$uM=O9Z9BCC!NuE z+ktgzDN{}@32Uot9XwP7wZv_f7^v@CR%pXAwJy>|^}4Whl`YdfWK~eFbJ}$V>N`JH zul-zo)xJoZWok>(y=qa&OH8IsF)BFe``mdb4F^ zV1ZbuP^R{EdO)oRP;;5`ga~SdBNYbfjoz}hx%tWFI(;BQ4_fFUBl9*=!pzsA?D>x| z@yNu7O|90~CnmXAWb#;eO9>|wP13ZAw$+lh<}dTA#6u^xEa7}194lx=ZN3pIiZwvP z!ZBs3$mc68QDHJ6X*)D7Tx6R?7ISWS7Lu?pBSQt3u2m-&!xgr@yq4HJc;!GlN%zK% zZGv?r43G5~=PVyS$6Ky^TeZ+5W%^)}wqsQiRCRc_Dp0?wW|B$zP=r2gp+}99I(7~N z3z8=;w{Xu@FS2f-Ovs=NE%ApHzpvm=6tFO_R!iSU(^lqFR7qeJ=JzSJ^HHOG-pjKn z^I4W8KHuO#4M)tw zLY62nA4W}EYyR^RuX=?g2myyAF<)dWiSEkK7VrpU_m|tZ{SfSqv+S7o;qK)-TY)CG z{idV!mzLWDe^gt_*59k-cuYy<=0r!|>`XqBP05allsuQ2%{km|7jt=B9_H?1UCixu zdwjkw$0>(HOwDy>a!N|hiCNc_W2(M!+EL6XX|Q*WdK{hSy`%-cE)70S{5tC~;-Q>0 zO9s!y`$k6wLQjVJSr40^^7y8vMM<=ocsKBF=JO;^N+)f-(a=zTJUS9O8x6)o{a|8@ zbv@3+Zd;%?)Z?~A$Aa-d@7U;2bUYXz3XKONfuXS;h7Ko!k+IO|NRM+U=7nn9P9%pz zBZeV99C&Ip(&K@4-De4nfW=*-1F?VFV7BNRBEg|x08$zW3K)!S)RU>z$2_9s+t~pbW0tnQ(TL$U3k^Eyw2g;?@xH-e-sN1+j?e160{qK5{tfW3 zjt4A++|+R++_9k6{4@h@*0CKh3i?Fc05irqWa1GUe20lAuDOL7MNGo1$n`mGpo}~_ z!(7=6ytrbPxTZx#B(CJ#9C691tmvwnmDIdKT<}WIq;de}Yu|<|gYRv9*}Q@-c9pz5 zn}_87x3t4bY#RPdq11n;>KLDUbm)iq-`1fG@crsWA-T(tIFb9l}5{3kxuEW|BZ8%0@G}f5CEEDC^?WcteAA5la)6CJ0LcaL_YneJ3|j_tv%e1ThwIQE zz#V@AV57$X$-~gdA_83ue>mgYZ^&Ut>I+cz!@#c)WAQLBSF^vLfH(@AA%;Ig|GSyi zPGr|Y@2MF5n=?V(91(SM<*1ua3U%`dppIGZ3WW}t^TfLF9WexT>|yQJfzWoej;9!r zr)G0=M9y5uO^d1Qnbg8qN-5-nxhX>6mz;382?Vn#^{rd{@VKBks{-;cbdy`geE-V{Has>lOGzc?5>RGZQ{-!hMY6pTo2+NC1*}#IxDo*K>iW64xL7(*e?)|>zHt6)g$@!h% zIp4YGJNL_%ypc#xNs`2bNbDun_83zSQ^dpAGj_rdJIZ=R>SOId>-L|QkHo&1-Z6f@ zIM({LD}4RtgG2WY2fO@Nq(^_TJaOT@?GH8vcRsp$buTDseN^y!dwsv=C;T1o(5@zB zBIxE4n=x7~VP?8QU%` zygRfj-9v`|(4Fb~#!najxZD#PXpQ$iVo%LmX02(+lgrh5xneftIkV9$FW2NyNKuur z5>`Va>WCVOgu>D2hNbYi}Fg@TB2Am7nXysM3|p3cAch=7vR*_ zQ?=4EOJ2|?bJ?lXbE&whsjJ0sw76)L46ln15g$^c;f2xCsCS}}O2_p=HZ@&H=&3k` zR8<{0tr}zA*hESTc?&ZMJvK3uOBZGndO9_m$j8z%nu>yRiTq3|m(>F4`3UVK6abk? zWko>G#LnjOS~#NG=?5aIEJZ^0g4q1OEpSKpf_x&Kh*3+~SSFzb@>4-fPYDOSBCy|- zGu?K;X~y248a7JN{T0*~y7W%w@}h2q1~eM*&ZZLjWHK>%Zl;jYX`BZMn&Uwt+(|@0 z#LwyHW3x#u5b)Bwf}C=UZKWZ{j}!MM=@O6ia6CZvebQG+k8!+CHp}r2*+GtfC)>}l zhkr9shbhgqs%0#YwHl6H5~$o*uBu9-S=gmo5wNRq%)EmonJotYJ+DErf@NDP)XfMUJ0vRWLTpr&sdz$CbRb)$N zJ&~tU6yy1?yfc*3`CKtxJV5j};=o?-2P30$c<%$QKx)1Z~KE?Hze9k}rBi=+Y6VAM{6XzrPw`cfAbNs}Ltd#L7gt z>%C1ykcWCc9>acdY{iTTvQNob0pKF)!5$JM*-ab>B5|bg)xoollA>34y-ga@dE$hK zdcyxF>#^TRJK{O8W7Kzd0^j{a`0kyo8TW?D_XYF3-3C1A0>W{1sMv9VUS^m2{9zR2f<8|#av z9X6@{acUaZ3`D|9CK)FM4;d%*aUK(rZ~#cANs$8%*vENHN#cJKUf?<4fPI`dIKM>p zb&hfEp@gWv!Fh1NqCVy%a<1_laKIwxIC5}kNj@Y+pWuLfoIgQW)cKg_fCCnFPP%fw zDgMb0;z#})n~$GF;MQV9p0&vDVtN+S+DW`v8eS;XYz+LCJ<@ilr{PW>~KCUcZ^^*2~^^-@QK`@9(+h zI@h`XpZm|HzsxBZXEK>I6-?TL+O<1PGt%f6v!;y*DkN$SEn16usBX}}VUHT-sJZcJ z*}7H~p%rCo+2gf%chvHS2X)(eG%XMa^!>T{X+5T)>rz&W<5X&gE7H^%w$7iZTg@vM z53RPoZat$P(8igxGui?Db#wd`>rJl~Mhx%kv1Rlve?(iccza=me@anAg|F&NAa|5C zV}dRTF>CEq=I=XOy)cRL6KO(@&V;q=*0^T#r`0x3Scc8=Q_WYnB5TTq@WeYR z(sD;_j_!zFd_GW@a4V%*i`PoRwp;VZ=2ukDtxvhVei5ZwPq~v)6|wc0EtqP}AX7I$ zF@Nm!8ZVu)MjPf$)z)-9UZW?rT=Ya+W?oIFN~NkrO-sEJ$gcUXn1&vt^?;tNo4ya! zYg*EnR`04~Yb}})W@tuvA8(#HUz=NhG0(_LHuPx;%?_BdqXt9as)a;vhigZz)i7*z zcKdW2@^gQ7N0`sZpFGNWKJ@~2<}u2T1wwUwtqhI+l

xW^=J#F{s5=;yw_zdT#xTljA4P ze0XE2$r8}E8&=bafhI$XOm21|HNg^#X*if(mFJ(fIB88}jmOk5ljT$(u`s+hKz8!{k&9c_Bo!Vo zdrUcB29CtAou)CGVR%gCCjuU$d5v{($WCE~VT4ULHLapoRF=`t$LS^Gz6&I}tjR;| z`#na6Dc4WQIiQd031}K}XR;0+Vz-wJ8qzPy2+yg~xT01a+JBke-!oq)4R_+8sLY6% zNF#RD`OHBZsqE(3BR%Gf@EnU4ZqhvAO=0ReE!SPF4~dIAajPxSo2U;>3m@f;Fmzjw z5o7CFb>7w!d}q!a&4{y_9`jOxIlX^ONpm@!gPnsnj&=td+-AMRoSU|3$nb}gZu5CF zld9c~ms8TKz3*SHyRn}UUSVFLKRL>=+!sS~62{Mcc+1y6dIws2ur-98FP?XuTn9-VzjaLhx>* zFFN;*D05~Ss^f(&-3ZfSGL8NT&CZH?ZFx=9@+eIkkV(I3vuko=H9a$PV%4It_L-BN z(_-gpM`^UWL93ij9nMrvc1`8)1Pnd=;{e)Xx~at#={TS_?GCgSQQ4SsbnR-dD)#zf zjEI%)m3m#QF+U=H?n+B;O#bBYLoRTeYH@V94(OfcQ8D9uy7i_})m9q89opp$KBHtz zVn$tTEQTsyc>dgUodzrSC}+<&`ao#8w(-?8q{eIMda*6vJ=J-^XQbOol1n|I!Jj)s zu-(?h-c_NOc%K|(v3wU;Ytv>ftxnlok48zRb0hMX=Y?13`EyCO$$2Jd{mJUSMnt@} zGAMu2d4Yb~qF)^hscsPx!Z0dkb@*EfF(P_Q88*|UVDTFsTS8d7-*gdo)QeMnj$Bio zk)9AaCMnsP)m#`H|8n)NNshX>8+_jT)4U%Cyo2s6YP#HdU)0ztG`+FVwMu zZwviJ`RQ;WCC1rVUtmrglaf(wx&SFY82cmW%aMJ+ zZcWHb7+>u$!n;x&@!IGmr4hvm`Ds&~=YL#g!8cHy*vh{OR4%#tRWbCW#a6D5&qy4TZa6*Fkvfg_znt)=lXa0aY-&xh+7$hAP(Ro)`Za#vZurL3-SooZ&ja)Y4fcWo2`$bo^;$(u zRD~9qxyKwoc4u`Jbq{TC&CZ?9YO8(GUi;hTb|XLS)4`qNKBe)sK4}eoDQc$eDs5QV zhVcq>Bz&ih%zj1T=Np^}<AI!t%!h*22@-@tqzmUyB%SaW^=rw+|g|O3w839p-c& z3b@^OMix#f`se;A>a0dVROb+ztLce=&B$;4V7NsO>PL`%fvsiku+lXvtI$$Tr5Xi0ijFnd6P~vGGGy38hV7J)2oDTLE5lO`{qtHm z)8`F+8>4ZH1FgF*Hjnye%!g^zL(4x6TyFH)K1@ruMVS*bx(Xc5wCY*!U(QUcrxD}> zXG~OblvZpep0)q-w0;pAdJ;3Ju+2RA*?RH1=BDN9^X{V7PG6g1Z|2~hiDRp?4+pXb z-Czk#gCa7* zn%)jjMrp`>J5ad+(+~dGQ~%@^lw?YH-(xd2G*svkl|uK#!rlRulDF^%naUTX|z({}J?&n1a+uKv0!E~a57eVA?8uGq>Ep0K7@10EYq7N~I< zv4{LI<@*DkXqu*UQs>F}I*?&_# z=|SB03En&DzA1Pgxx{6k9}%^DiQoRhi7?X4Fg2|V42iipn9>QR@`s=n6X9)ex*Jj^ z=sDAa_u({4qXrMV&qAPELIN_J^9%|4&H6sPuU6)Y?H=BoY~0w@T3_F?aciQ->TO8L zc`e{}#rkwZOR0an#hvYn*&0U^bW_vzK#?nEg~bS8bmH+-w_aCNmV<$D?*+8W4oz#Z zY1$sUrj^yMUhSwq?|-St|NJcfM%};VkpI_>{uht=w;l*PL*E>a`I!GXOMBpu|Ean% zJv>vRf|+)~oFwt<4?cud_dBMC<-_?l#@sXwT5gy&4t35{uWhKAS}Q?Dc&im=!k5 z^>k0GLkrKWpSUYxj?3$+3OzDGZ@Q0)=ydk=PaMfEa;=L$d-C~Lysqa%noXMmhAo6S zSpkBkOe(sn^2|WCtHSGgdHiqV>MuCz-**gb9f(QMoq@(y`*&L}cx;WX7Z169eayA> zyz3=z?P}e%WwgWAlbku!Il;(S`(A+ZMES07bkz4a1_lPUHu|6O7@bDW?Sad);?Fi7 zAS-9-eK{jhxwXAs*TyMJ!%09%&bb}g)4x0SQXu?B&0AeLbkI;^!rJYWrkCCR%9GpZ zV0jFk^c7OMzLh^dCAT%$Ps!#lYfU1&p5$9jdRT z>^?p2g@Bie(Y4+(1n(*9Iaf{(KZmk%RatV8p6tJq&10?&2{!HKOs%u#vxW@AvND*` zGrH^PI_IrMG<_Zn%ZP5LJ>=SS@Yj}}PRAktrq+J_Uj1Qi zztma&-%x`*eXU7GBIDUdWCPP(>qw@5KFjr+aYw16Jsq!UkJM}ZGquv1nXS&L>mR7Q zVVDseN_&P*iwIJWX_qGO{HJ*G?9`V(A;tOv$K9!va~cGOAn)G4{z%(>I9LMx!kYrd zkp1rm=aZqiN7GcA3()dRENHQ=D#W^~qY5)dnuXc|t!1>VA#%{X81rYIJ<}ZW#Q?3> z3}4m+({v+ed?3j`WfrZ`e1#KCO*i4L>@u|g6D=doU7@?$AL!23lolAG?*vi3{`1PX zztguKI|j6xqorSX;Iy9Tw>%%9>9r}i9&FtZTpSkWe18RtLrWyh#*qT-I9v;uCAvDY zT2edBG)umRhHLux1Sg6~rg(3lyX)A``nNGl$Lk4v1-qz$f_ zm{y%+Zcc5_@@Q69=ncW|b8!A__L)2Nl(e3MX%1SBwr-$>1Ff133k?s~t>QH+)+AY% z*0dCM_)jhFq*c}dy%#fABj>I_rMFXG8$qQRb!T}&fM$>1?Q~d% zdagNQo5>b-qKB$HvBtNnxPcZp;c-+7zJ{hmjYer}O=3fm$*MK_V@}w|(^T4srsYSK zuc7#8;?elY!-kKlHANb}wrNN6)6(0pJIQD56; zz4X((fi0sWhjrY2>i$kMO=02=Sf*A-W>{$UaeH7&QLNQg5&cG+wPo+R-}kBbV7qDE zUU!={@r@HP`u=3i=xc;Ut!}&1%(7zHN%HXl%Wl-}z7LnaFsJUXl1^q&Z^4Ai)CkIbK2+A=jx5AO)j8(_>{@}~-|RI{eMaJwFVI|*;xpZ?1=ZVWnFB*u18EZPasL(?pXrC{>>-ISh~94AdyQ|khHoArE~^;nzrP@A=}&DuPseM0wxy$h{Qe2h^Ce~-l9p>W-N zJh$<@BJcq7l!o|@axybId7HJ`Pfe9II+H@|h!i8bS^C+Yr}^rKw| z9f{`>y}qNLxf6BM$1pbEY((T5wDS`-ey1ru?d#Q3|7k?HOpUmQ+LJe+0|b4tG#dUI=Huf>&r&?W`mT!UfJ_I`>Uk7 z=`EAdk6u3Io-5rA2ekaNry8dGP!2qRXbbXe(tF>8g0x6|5p9G z|E}`-?M9z6o#`F=&TzB12=8CKOfQFlxe?Qzfs;g)i4etYbtJg60hiOgET&X_<&+Tv7Wu*pEm}H$^&HT&L*Ea7MT6qK`=B z4y!SAXLypa>imAQ=85*1n)Y6qq6aFC4ueWKxRuQt+4Sm=%|Bi-!dCS-!yc!Pw23xJ zd5^29PP~iO)YML{y&LyW{fp$~~{r3qyp<{t^Md0X z&$NW@Gb2LrPKr_2V@V0mEu$Fsd&n5#BlH*I5?Y|cPA|pK>y8QC4~V0$0o`xEAruej z7t&wUKlFRWfROw!#dsb8-^MbINlmMz%SjjQ00r4iF@iPmT7FE#^hX;?7oNSBE(F*F zhtmZ+lj-s>L(j>K-w>b=MjjB?(G|_Sn_?&PVTzGX=ycLW#T4Y@6ys|P`9J7FKsr@< zBb~h@yMwMWx^Aa(cT)`gVqyfO0j$#S05P5Q26bi-QxOLF5n}b;Rm3Vim2*i>x@Hcyj$Ajx4fT)&ov zSYm1tK|4c<>3kx{USb5;89_XlxQwo1C1+N7Um)aQysMV33MD5yU?<7S=-RI2%*xK6 zg&cef{a#B~r;?MMF5>?nSs7hXR1qr8{ZJ_skmdozXsghiv5qCq1xghY@Jl6s&ZCl^xo)zxu9Nr9(F3h*3UBPqLCT z-!p>wNFD6F4L%y6?l}RNr)L?%-fCADCR`TbB9IWJf2svF~rEd_ccIy&4U}b+0F^amDu0&$h9&Q&pK4SV4)VUKt0cpr24!)B(mpGH; zWpq^t9Wd-e{xq?w_d2CRaxk)nH0&VOng3hqkbO1hKs$VwnNKY=whq2BQp`+$S&{<9L1lHNA zbm$(e^7}HeY7f6B#(Qh&dPB(nhZq47_yLNMws=bXtrSB)6B(fptRvziV(63-tA6xL zr9*PCY6DLY>m-AnwZxdGfnN~%U<^T!zeudw*dK%rSlQf7tZe>?Sk*;?&<87h@&^hA zR_}U(SiS36Vg%ST>-AIzUC9mtor6bV%2^+h}GEm1+f}Gdx@1DGY#50+aW)rt9Ifsm{Y)e z!K!?26>_j@13qF^&UwVD92N+DuzK%GAqS&~kgsx~vtG!z3VpD$^E)92EBPBj4p#lT zQOLn6%^wq|aT@5rIXG8AdWI3-#PadP|G~V37~c`-{GJ%~2>yat+3X=6$?{u~017Bi zFzTX=t~-d6D8{o76W_-Cg3t%6Hu-BMr}ndzSlM|~$Z@Ex7Poh^dA&FN9e1yJlgyslHbkGzC%n+F_`xcgnlzI+7IlX zAy(;TJqe_thvaI08%Lc&*}oMXgaXn7R`cylAqT7Re=MNlYU98zWcqzXiLx^L_)P*&L&p+_d}Ti@(5P# z%}=bxrJoT~c7k?(A>`nWe}+J+(4}A z-A%00Jc?M2{~5$8ow>whDwu``iB%oVCq_W})qWb%zk=johgjU`s~Sg7>L<|JYy75ejp9IVptn2@g$@?QygC9$%zO~}DY{;rUNmHe=f zgO&WWkb{*x3TpvWa0dj;qywD%~|4~rwyO& zU*^|_&sw@v8@^=DJpb^}&&%elSf&MecnIl4Vg8&2BwGN(_~c|3|+s zpnDAMgZcMW_??C<)Hn1uQ;gv|i|=<*tcG6v-c0vu$i@A~bgzb5+;`Ev8e(z(4c)7u z755kEUJa?Z$3MqYLn-e2(!Cl&ajz|UbmGD#%O?2e&0F}87UXeD=FHJ%%$QyJ=+e?O zg82()1Ln_}|Inh9tY0)I^uUZ6kMPf+N9HXpolUBtgV-6R3us&n*}p%e&Ogka6a0zq z9-gyo#v==s(&6o#*)wL9E|@WI&H`oP$G<80(jPsep9X6_-9TOGzog z0x2WvZqABD%Wxa|WSh9dRZ_hw#*{!Yrg@5wQ>R9mBVZY>7~6wab?A4+IMPyFK+nX{ zJ=)kJX0)TOus|t0`X*K9JOs@hP?)69C-zgt|-Pa*JR2Eo?S`t&ji21e30V3 zf|IHHLLWyx)0uG`w2T=?G(+s=&oInRvk*gNQgKDJ$_ zFylCR3p2JhEi_y~2ivF_%-AAb#fM-d-8o|Y#&})E5%J07+XXo%xJ$q zW5(9Sqe5p3Gq!WK3HcucV@m`!yU5P}2>C%~^c6P^y3oP)#zw)L1^2s4)K$C^vsk_q(HH{8GN_yxOPm*(F~+>X zj3vdp%ovAGGh<1SO5YRM!PK6*Z;+i7W0?XuHLKv#3Vbi|f3kc5#j}`kWbrfR;}k!} zTubqb%w-hUF}G0ss^I<1yD9!(=1z(~V?Ipr7tAIb`4{mcPgHeH0&LhAY7( zX1D+Zm@&TE=|XzoGSE%2iP|;7jVy-@9L4epEQgyw5pyEx;~sW!wELgTa1$tD?j@Z^ z1;4}$H-TDa*ulNB^Exx!1okk)&H=#zW^6Bo^H>d+fuYR!whUv&_&<_)CdFfz;W}{- za~IjWj~Q+S#X@HxGi)wl#<$}!=3J_yGG^G^%#7{%mzd!KP$P6+XNHTxpP1o}@c}cA z{aXdMF=K1|3^R`UaiQFByl0X6U3d;|S$J#T5IQas0l7 zxsu|?m~mYH3ufr7W5!Yc@0s7EcqcRZ&L5d^6#o`8j*kD#jHCMxm{-$x>O*Gef5nVG z63O4z0(#b9#&LZ-b0)8R=^wdKVpuh{<51`)$bveLk3p$y9YWnH$muT9mv2@ zEI-R~xCUHdhJ8C-crRQ7l9+M4pUjMUyiLgOV@4T1%Zz#HbIj1+#Ec_)%uQh*NB6HY zSJ3-c5UY0H#B#{Ms-1t#@?#W##*DV{1vBg)XFf;qH_SMiKFbW9RdlH`{FddAfmIp) zz;dKhr^yS_3^#<)%y1=`&Ww3A+yA`E&z`*!+ii3bl^U)o*B<=WybOTZX_jsfD6yUP2e0ej^c5Y4>|M$%s9r!1v!rK`!hp#Br}fO?_kDpeHJsyb1XBC;%6}9 z=zbCNY>I!$jAQ)gm~kxsduANJzrl=S`8H-8r+>nXHgkd*$LZfNqs{z7@I_`Er{nlu z)m;SLBae`QRo%S{9UdEFSqCz(YD+^{j-&X|%s8U2$FtZ7qcD!;kb$FEK7-|Gw`I&Y zq7NR^Q+hCWs$@Bi=$~cAQT+4F$m46wnN%;YGvoOELuRax{=$s1`WrJ`X})B}H~nkD z-!nT&C%}v~R|H)sE6C~JSOyvL{>=CmCkXjaAx{?abY{2!WHEQqoMkNYT#D~uuD~3O z8Si?K8S|otgnS`0zT?Y;e6^65Gs7j}MP|4j)G+5#UHp+5?|NIv|H=#(m}qJjCbm`!mA@;AUpHCk$gozxFU=y*Y^)>({Bwa1(&*0_-wo4V{f6E8OQqvn30Af%rmJy9~JV8%;>W}2syt0C@Z*5 z^kGK*_GO06TLcefhTDag8SWMLFbCHx%y{-8!3&w;nz4cz<@|G@Q^Ab!;g8I4(|Cs& zZSxyuxNMwZ#=Zyckr%jZToP=id&rS5D>K?*g5cYk;l7d13>S}a%y>4R8P7f-cs4WK zLzXe4999aQrv$&kjHBijW|TuKGu%BsW=5O&iW&X=JTu0b@0f#bBh(I%N4(d<40$wj zB7F;Dg?u10#`&9sdB(UZx{5Hv&7_DKcBU~SFF$9-w*amt z>Kpe2%OL}+Z`=l!UW? z{sJ?;N52;GTIM*a$5)u)0<(iT*pHYohup)A^fWNzTee@w4>04Kc#!!Mia!=QN0?E+ zN15?nEAI!weWounTx^0Dl?~*#upE1YNz8ETNM^*nNb(j%y6sO%bZE^X-cb!E`(264jDL#&3c&3|J#+;+ZY zhC9zqypM`^Iho-Kl*SBKok`4a=b6h4_ngO=;kNTQGs=7?vFd{@EQbuN`rvNpP(MTH zWF5%BYM<~cmcyOr5;NR(B6z9Rq%Gf zy9Hy+Qu;VoQrs^1xZobamjzpC+*HqE3{~tDjI$*r_X!>=c%tA31eXY2CU~`AoH;4` z7~d6d6O1z^C4X0Nv*5#m;n$(`PYcF3M#;ly9jF+-ABqzMCkh@RI8$(e;9|kSvl!}c z2#bV#mEa1&&k3#;yhHFF!TSWm7e%EXXG4m+1z!-X(K<@$7=i}~9xNDVLrQ;);9S9z z1moOC>0`aBc!l661g{s2Ga#kEUGQ$f^@3Xkw+lWlxJU41!B(2LsdvQ*b_z}wj58#q zA3WdT`kg4`4+t(1yiD+F!IgqH3*II;=)1-5!Wv1Xp;_=@!Cit+3+@#hX1!(y=RV42 zg5X5KBLrs(E)ZNSc(&k0f`jKToR z@mu8`=Rt}G2p%jrMerEGxq>GNo+)^q;1z9i^?-pDyxK%KG3sqj=+o!lk z@MXbP+K*N`I1f_n6r3#BCwQ#jiGm*xjI$YKbD7}Pf-41Y7Q9XHPQmXAZWer4aF^iI zf^n{+(i28!8H(+K69gv;9w9hWFwT9HonpbW1uqi3N^phX=LA;^-XVC8;C+JO&#BUY za~#Fpf-eY$GrZC<1P>5ASa6EqF@kdiPZB&+@I1jdyHW3bLhyRQTLo_yyjyU+;8wxy zf{zQv`Hp(;Wx+VpQSvy!PQl57eS*gdo+udSJIZE>V4UwL`D($Hg5h(kbhZiJDfnH% z&4LdL?h<@jaIfGnI?GV+vI|ZSoG5sN;7q{%k`ES~B6y78T)~qB&lEgQFwSn2{U-#k7ra&QcEP&^ z*9&eH+%6bC*y>$46HGoq}<;qU1io@YPmwoUQ!vhMluohW*@71dUL_dk zDC$|9<0!5cyhHFF!TSUs6nsQ*x8Mtc@o$IKy9~ht1P>ORB6y78T){X4QZ{D_o+o&P M;3vSeCx!5T07q0NF8}}l diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-cipher.o b/esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-cipher.o deleted file mode 100644 index 6922743678e822f2674d1e2c759eb477b7b098e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5232 zcmbW4e{56N702(hoz97!)NvVN3mZ<@kfGRnb_g?7y~RnK#v{Lf0Ig_UCvl2Z=Le44 zCEBKrXj{>!v;xwaN^}F-KROACRGO+*LkP1DLPZdCKa@zY2HF)e(JsKIg=t-OzVDq& zZbDh59qHtL?)RQ|?z#8<@Xd44`dUrXgfvY&Ar^W<*zGi86=H)C;1$K9NQVAj?GJ43 z-1Nimca%(P5JKF%A~E?Fk5>rV#$I)A2E`(*xv5EGVTBU6?&Um05ScuU};`Kp6` z+6?rc*hRR=t7%u!S$pK-i1&c@7qHJ6xHP}LM*9FAr}LCWgo-z>Uuo0chhQ(AjQE__ zTE+wJoTqShrMNm)7y8dG_QN)fqb8>Ay2!7>mM)N z^Nmn{-Kt)vHjBP})w?2pRqYDlyt&n4`~J<^<)V2*WK+xXTeg$uT)rZwZFBt5L~Li_ z{hbz(5w?=D5;4%DcUD?Y@4H@?@cuGv)BcP^zQRy~)_f6s@~rE<3D@qH(VbV2qvYk6 zcfK@w%xM`fo-Dl6B@5@PkX zY_e}K;i>NL9Z02<8PAqvW-!&?=LrP-xVXQqLJyP&f}v1_=OK^hUb#G7W{Pgl zcT?FN6zOXUdVEin3n$&4gY-7yg*0c2$NGBuMcvkTbyH()?2%ZF9@dAtf}yVNL{FkX z(F3Fh^iZ&KW6#Eds*YHFO}wKq*3uD;$7*Ou*Y%2T>WNJSk*ZiYP|(p9jYq25n(8~+ zqw)G!d$cuD-xk)9a7(ncE!NZ+F00>GPU{MkL2QUM%7J)8J4Km$y)a-FW2{dPCVE15uAsV5 zWkGdQtIV6G4cb^%&>oA%tLviGo7*}X;xpjd9Iuw%?}y2>JIgK!$HFcs2Q9@?VhWF~3SJ3^8ClBZxUl zen0bZYGH^0KR}L{3*<29;9_#p4CW*cyh3; z$E&bUi2=*Ksw7@X*BvI`PF%sfmsr+=`w2rm^4_AJG19+E`Uv?sV!6f-WIQfn!!siM zgTuYqL?^Y`jM?sxl*;t?>i%?!zCVey@OLM&3E}S?92EXcGM(_7!`b9eRv7Fzk-jLs z$v)DCjE|H*h0lh0#ZVU67CHl&{sCFc=eH#kf{O3sQ1e`{aGi~@lG^_jhcOs#8`z2t z+0uM6PNy;4#?Om;h+>w`E4Q77gscy@Q!;c`ymai|lviQ>9VH2z`?{uuce48{EO3dOyJ0XB(g>PyB@2NmT3u*tEfsIRU=cbhd} z9rzTbIORVO5lJX%A`LG`{A3h!OUJ!~O)1pQIY%(8OWg0O? zMZHKO_RT?#eBgX?HD4u7Hcgr|nNRjVtF;<;Zehf_Xs3~XaTe>M$}p~0fWEpD=;H}o zFso6u+Q*JBn3Z-6GvcSkXN4z=jxd6I_y)8zO( zzez3T+a(97#rRK`^nXtMX^KBVE#i+X8GnoV_?(sV_{5TN!G{|2Ttw$2`m_u@+uWbY zK9)$Q`@4j}wV7m6B$9*i?xYcK#z9E-nL>BcxHOp^jQ1vcy9S1ha5-v>EuM*oM5b#) zeDLYifEvG~D4tX;;I0T`2DL&i2%mM0A7JdCWV{QK@l;606C;`M4tEgazQEGtV8jkF z<0pPUGx8l|K1%IxnK9=%X2ieGjF?-@sPR9{h-s&JFxT7UPcY*r)kAB7{xfRVG2^H0 zJTumfXH~Ky_0p!)x&&++7$C~YFChJ^nHb8$dLyc*ugq}YBm1X@;Q!y z26nLiJnOGg>mk?hQ6k$zj+`E52kT#>zMOZIW1xZMyk5j$)5v~Bjy%x74%Sbwjw920 za+!0Sb!cFjQ%4M6JH;{3z%u6s#NZ=J_7OSeg$8!8{t4?i3Wmt#ymPEW1Iu|Iq#VeD zqnDoHxh720j1+$Y& z#&$?XI?0507@rKOt1-rV$~p0#$Qb14UEwDcPAfd5@Q)OJQQ-p$zpn7F6+WTx zS%oJR{!rmrh5xNE-XFOZJdct+3a?if@1u;VQMg%QyxTHnhr(Hff2i;a3XdxMn!;lW aA5(Z-VdMFyK5SaiuPZ#KFy1@)oA_Vm7rNE} diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-modexp.o b/esp_iot_sdk_v1.5.2/lib/tmp/crypto_internal-modexp.o deleted file mode 100644 index f3b3551c30b395511cfea9f8dc39366102123818..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2732 zcmb7GOKcle6n!r#(AaU(L|q`kVrp2Vs56>zNH7(a>NpcT)E{EUB^961_>*)be-eA5 zCK6KBN^Fse_$;VUir9d<=>iFf4M8l3)S@DwkVTL{ELsp%m#_$M&-lG$Vo^Rue!5q$IoxUr_u0$@~x%8s1Dz{{M%K21M!%1aCvk?kKARC%zL$F$5B$P z#*$mFwUtw~cE@cs6~oYUEvChEV?v+Mjd3Fuk54Ga6{XT%Tk=}A+w^Mfrc+lNt!iy` zNvkN8Zi%XL*7eSiQq9K{b#a^xGRD?v7qAiCyV+KAp~ceA*{OVP#(LVC))V?_B^Iw# zodqWp;0@vpJsvAhE=-1|N>*mtF6FG*l4)Dhl+ty5;tAb(GL)RM5=N+0H0|V6F`p^T znRdpSGYiQ~F`=X2DYHZ&@v0h>v#Pmt~+2mY05sijuuVCF5rMvR6?ph)K z0{L6y50Jl0{th|pAUUu`4*nXsA@B~ZFld<8S!;MsnO3jeUC&75wp$HdtGjf*oI2C0 zj^{9~-03i_U8_4wS*i0CwqugIIi~# zwH$-I7@rZ?3G#o^AqRVm9GE^mzV+6VI-Rl@&%f!8lcx8+a=f^K>~A7~!4FdL6Mc*g z5x!64@OsXWqaN-LGbpHbq5l^-c%B?vF6|8>KSDy7gbu|LBbB8G^0&Q5_X5STSEMp@ z?$8hV8z4sxag#h)uSE6ch?6FBE)l_c^HdKy)C-Fo>Wz@g853mhQ*ahQn5>7D#Ute+-?K5;fT$w#RlJexG&hh;!3;@~+(oa)Ix-xD+O<3Ya}HvMR@vb)$^Y0z&8 zy{Q6sYM#B)>`-3@E!2yQ_|FPhq zSI9YDLbA`u(Z3>aSn!Wh%<*E8eL)TlIN-40#|TT!O`!n?EH%dhn(u`M9I({r0nHtu k0S7EK1XG(v@n2nzn4Gjs3EO`2N$;M;rd z`Of|Bckj);yLqKh8r5}OlcsAgYEe(qj&DIErfE<3g56rb*5{+t>aAW~|MTxln%1MI zR{Q&I`E>Z<$3NfpqkVnnPu<^ieG$`tqxS2w=dO%z9q7v?^`tbW-TLqTy!q6sA?LkQJ-3ffCAa^N@psC* z3IE8kj#qEH#&Bb?S*>|3J6+vW6^s(9UGDL&iSCsI<;BI}N8= z?|7}cTN`M#U9)0Tg7I_4>1t;IvVn5O7&tMgC9%2h;cR$3!BkGMKHt#Bjyl8TiP7RS z#StrKEmbnv%A7mz#ueTMZ(G^S?4J2O@dGo((ugxNQ9L|TaEc=cS(Y`l*K(hX=MNNf zc6?^4;N%ZXl}j_z1*cS;E==Z2Q#p$Xj}#`Sisgx1x^!$1i?Y)s$BPp(;Ed-FmM3$W zLCcq~ixejivHb!0V|N;$M#O;0LaC5PNfY_;LM}ZyI>3!IGwHYtghd4#9R-47{PkHG zcRm}AKwYddK3txZd2869J?Z##vEU4k6^0K@&5S$P&h-TLaXpdQNDPt~IpjQ>pB~Gl z({Y>?tsDLToM*To`pcqS5$#pcu8Ech&2cog`tG1j0iT8MfYW-w%iPrL0yhY!<|v#O z_I>yqoJKt{b5gSar;#Tn&pb7>X*e}+z-iRTx~X{+oUG>qUlC|lfMuQwz%tJjMI+bC zJYRyBdA?UPYrrzkO-1vUqLKT=Jl)tcnP&$t3ap18X8X)y$DKvnX$9?qMAcSf(K2gQ zTtc^|nR9N()y&y;TQgf;%{7B?$6M-XCa&h9R|i<~uew>~{R?DE9j1sn%~qqyiT|TL z1Rd+WN9cq1HX6)LpzVkMn@+4*drau?bo;h3pVV21a)a)s+Xv0YdF2Lk0$JaXg2|T> znsyEYw*vF4ggRb=Q8@E)e%e8F+yMHYjM2;RdwnMO_z>hL3<#6ZMPFiuDp=5d0%0=t zJo>U$hOVKQ<7io5FI?7F2bN<1we!d~q7V{R#TaU6S==`2m=8-2^KAo`dkm=kfQe2M z2$T8Pc1aTL4J`g6koN)eF=2iEaMr5kTL$r|OoEsK(c9c&{)t4f*oINDb(L^Fbw>8p zon&7 z4So4YQGb4eUK76wnlH`Psuky?cgCqMHXE&u4B$6{V4O%JgUwd;l-u#tVa=13cJ_9{ ztKTholq$>~)ijSc)2Vn-Sy3$xQuB9>!+k6NHJL;N*ZnG5a z>WO+VWf)b<^*l*)1Ls>&U(LUckA|-+Ppl^7LK#jO_l}ny#{0QloGo!e@cg3IgP+hE z-%4u85hn!yl;HX0ofCK*?Za@L4-2dS=U8&Y3Bex{JjWVvoeu|$_l9~y;Dq28(AW9L z340Yz4LRb3;Fp2*?f8Jb4X1`2aYFDbz%tLO(2ygRd9G4(KR#gB;mkvhI3f5oV5#|8 zXvh&u4Id3%JQTga%tMYip*$e+-ZtA9?(k{@#n3k?|Jle8ukcftjLRA<7G__q9t=hD$S`t;Pn>xJT_xkrs zPBQlRV>{Bx`JC_ho^#JR_jk{|hOdMob-J!=l639!+I&sZDzd1>s%h&?Ly4BJImG%u zE&HtnXOf=&wP&GEm~t)Ab3|Z@%qV;mNi}Y;V?{)z3i5(P@x?rkySG1uC_b+I>&V(4}5M zlP5Q*M{N2_;EWq7nZ^m!Wg0(5B|VK}z~Y=m)A%7&Wg16OUoefsP;Nhs@1cpO@ie&Z zREl=%Dd1zrQ`%fA7@uCMADGIt9B{75Te8NP)8i{3KS!8s_h|8Fh`gP);^ z_y1L9M{%uw8jL_r2g=OzsY#2r*54xWZGfXnhr+RJM%SvQ1r}QJ}UpJl_vE6*hDeepULCBB&gx1)waj8vz#&k`k z*3yDK4qCDqAahIJkLCqS{x+1`FZmm2;w3-M>?pSBd%@oSR~a;l9BEr{C}Oc>~^n&tL8< z_xa2Gfr^T9=LVRCQM`HRi(eOaepjQ9c zXialdUHCKMT3^sN(jBPi-e&X|S&Hr_-S4Xibgl1MpHpbrCX3bnR{o122}NM{)>$nS>O z7;ch=Xk*m_&8@*ena{K@XbCq_i{I=})%mYFs4d)~H53U|(Uh918bd*MYn=z1=nc5D zq+xDS=}n$*NKeLGpD$qaRLu3Dd101WHO;LuZk#q~y*sNt9E#S|hiV$yIvS(2oeKrp z$Av;*u}}t~wjtV5)m|TTyYa?CYNz}sx^bCQuC{1eFGNbv^^$biNxYl#8096D4^e)R zG7|cMQ9^%(@^a?OR3f1b?4b`^-cs6CG-VL-$#k1?@40mdzx7K z{+bvGeZh7raos6n%;Bes4i^2YqJu^MqoRXz`C5Ndbg-<&W1C;gL&Qkf z+c+_*yD1MTI@rQ`LUgK2vf(~^hj;WRjV>yaiFDa3)R!3S_j%)ebUGSw&AZJ=8k)Cj zcv$l$VsXQpZcfHVlA6ihG}7tU9~&TT#5_s8eK_LMJw}okZN4&;7#xzx{5R!FGGWdc zY)*ei&iCXsYLz7YJ0IGRK0z7G`_12_Xh|pW;Xy)R{U_fB@+`itY&=Gk`IRdSy`Jv; zIl2G>06_*Hg0qgYI^HpAC?HJ|f)?pP%J5;HNE77yTpG>4XhYsi84stVd+1^>qk)rP zoa(}8x=tI8!%C90Z6`t2gtlxlt)>#|z`=<&tYZgd=|iafnZ`SZ$mAq#Nvf;k`Di@& zFdoK{@$!k~UJz=>m!^Xsj3ncsR4${vOM{G(h<(Fhhw;GFeZhFU=x50!X_90-so$=& zns;u##kydpG5*3)tP5s_c6CLlt2==@B5*!g%~`8;c~zw~EA1Grh!@m%2nuL^i(?0e zxg_kvTB%TpIu2t=s3X25p&pV7m8dr_sw3Vcp*HyiQzV7F#+T_P6K8f(kLXl|>o z^3OrX5S?%_Q>*Kv&p|Dg9FF$K`n!jA2oA@R=*v!`v{Ak6!|72}sfVUA+$)pY9v|#7 z;_2zJi=}NbbIzJpN^90Ra7z?ktuQTp&hrp)A#OIMA5jM51EYgV;kOk2ox*uECOmj? zA7RD|7cXY$xTcLl6O5N~f*JFAm>Dn7Z!+UW`7ATWIn9i|mlgiK!hd1LI57%)Tnl^9 z%M2Y)gN{Rh63!ENpn>hIf0gwyDj#J=jO=4Z9PMYu$I=1j%T(g&(($&Zbc8a-hX%H@ zj?3u$PZr170}X6v{g zrYXY%4QywQQ?12UrPciHG;9L#=GWtWQgmq|OJL~tej*rq3 zYLoTWunr9@>n(+c*VW7(Xkc0IX4d5+R`xu~x{v%|+4FT66PrdU&K_uBJL?rx*YAWw z(;i_DG_alZjZ~LCe4IVdz_LG;isxzeKm&{CS=RC4T?;?&)eEdc1Ir%1#yURE>*42E zy1+U#u&g%%53lPQd!T`3y)E!?jQxf^(7nO@{l7EgV?M>4No=8vSc1NU8Gig2 zlKYs&IyA7{$7y(Yo_Deb8d&Ceh;^JdW6b#QenH_=%=p+o!;BB?^UV0DzQBwh1wP91 zEMH|E8d#p?S=RAmVI8sfZ?O&yEdC03_*u)PKG+jzV0i{N!o$znD)vAFOKeoa!}0J* z_CNzmJcL-skC$5b`940tIyA7{$9j19ncBo2XkfV)5yjKR9%x|kw7|n_jI#$CSk~AM z4?izoW)C#5JV%}I@R_-nJ<1R7ZOCkYS7NgjKkfhA5x z;NduNvj-Yj;-rFg{4m@JKc5>x)}evr+}H&VKaXMdKm*J3xJU7Hum>7gJYR!{*BE6F zG_b6Zjv7t=DZ7NUJG}->0y7RgD!L7^#Co2>#R``wyiVath0XJg$1%?zW<2vU czWHpjZay!}W;`=LsrW|~9#i;bFlD5F07U3a_5c6? diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/dh_group5.o b/esp_iot_sdk_v1.5.2/lib/tmp/dh_group5.o deleted file mode 100644 index ae76c90c9ecd38f0238fd2706d83cd972822d231..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2148 zcma)7O>f&q5M9PjYfDZmxj7{0g;sNL3Wy-7&{cv6uq@LxYkj2pNPGyw&=zG8kR^j+ z8|PG@zo0;GJ@wju(B7K=(?fb}duZPyxe{&kYk<+rzBfBNJG)DLWj7BLMG;aI@j@&| zLVU9V2Kpcl*cJtGONNTgH*X&n?Tv9yg|ja%EbUZ1O=b<%S3xueS?-u>`K%%~P{{Y#Avc*U z;5yUMOdLLQ8=dxn^Qp71*YwL%vwAx8MqVz18^8^{YM$(jc5-_Ir@8MA+Ro<#+jaIq z>AG%xqI(Z>^*yI%E)|l+ojCex*_@5?ZnRG(eZrXK})ULPeTB&S6}!VwJf@rz`VL(4d`CuJ71xWnI#407f8;)? z_YZ5OQZBtbYp_))ErnLuPHY+e*H8;eSpzO(8M6!Q9+WXdD1|ZfZ$OEUpp-TKX!FJnx;6D#VmY`7XBS-ff60f4;uU@;jZWU@a_Va8?!x|C968FzQ2KoCl*H}rpZN24@y&sK4|)?yj!*Ug%6wd(@*VV9>?J?ss2wO$EaX>sKaxmA zx*o>TC-npFKp~Bxk=%3m+4_D#@;ks--+IcizA04Bfh&GOzL#`Tkz9arHs30m`4SlO zY&xUJpU#vBouYi3tfk~11`8GPKfJ{PD{<9}A^3c}BBS`+H&KuLG%$+$=PI$PFlc3W}r>-pBbZPj)yZGjO# zVH$!GgI|arQ4uA?sDJpKXjBLxAQESc20t)L&`1=)k3TSK=J~yM?{-Ht(UY9s-~F9) z&pqe7d*9pch{W4uS(doS(hbtoOp?aWB8yd$nhXbzG+U~YqV9u%Wi4Y~oAZ=Z#uj2t z73q6yo|u>jmd$_A>Me7gs<4pb|CH+8<1@7bt3F$Q$a2K`w%cQsPfk#5Ph9>9V}tXF zqrtfRBQT9WV02nM&KH)+$AK$sF=vHkpGEQ{f?@ePP@cs8RfpG?Yt_3I=PCK9v2tlN zE`JTQv)Vc8tSB3ve{k)MLu1`-v{6G?{sN|kL~Y;?k5fL3$%frkqw(RT!3Db#9hN?) zr>^guZ5JPWe#>KHkII{7$>Z?(^nuf!g#003+gB6PzYEp)`*u`${Ql3@pRgXW9J19m zmDO6xYCpDlT511Z5aTaP?NO`OY1ZG6IDCQkZ21HX7BiQFUBOHHE>xPvIxL>VW%A5f zA*WgJr+XxCrTi^ijaGOosTD@u-b%FM`}$}L9p2NlcVGX# zcYay-QG=zk{GOo?N*2dEJD1FU+?`lazV5yz+mVwGpZCh4#VzM6m)Ntvs5OhazG=>8 z6MG`Z?tX1e{|&eA`z^lw_|8QqZgxyu_xf*Vy>a5F;LU$rv+1elUV5s2)~)RqeHZf# zCVo72ZD@~l>zmtC@0M-*Ji4$h`SD}v+ADVbRsW$nre8nr%N;Lnt?U1FrR(nQx1Ri@ zVMc!I*6dJ4bLWb;x7mI!Wy;^5SDerDmge=9^pT?GYRP5u>5N`*t<(#}bZ*4u_xluI zz!y;b%}TT4Z}bO(!DiQDmup~H9V+Bj=Zn6SD`l=4aIH<3hRNvd3b?#OjZy_Q=V?0g zIQHfSYHVaMCq=JTTe>>iVpqmmm5?%;3ItOF+Ms3^ct7!eB^c;mIJnThJQ<6(s>#k+ zA{kL*tz=RZrFoH}U1kq2kA?j9WKTp5FYoD!Cwn7mJk}fO4##^!3IeW-boa!%Iz#Sw zUn7;`cZ2MRb#jB+5nj>N9SSrmhWj*2tdlH$V?ns@-xi1#wxBx_kAx|u&TvO0Ntx}PGMLF2^(g^uFgUq_@`nZ z%n@e*{&?*{;13L+XGpOJq@4WuepuT|Tnj1IZY0Gk6#kn@A&3Kv_~5sZA}8P-q!9Q3 z&m{%Fmo&z(ljVwid41T|L;OwTvw`#h!hGLHxIgj0eBT{}D_P8!1s|e}bB~_z+HFxH zeZ_UzlGaaSsbG%79Hk4ntm4b0OL{@eNWOxe(R>41Nt1m2#Uh)VJ|%s$L`2TC(*4Wo zBSefEx7e4)B{P?gmJn}hk}u@)NbSGLTyjHA_`E^P@0*G7i-!m~pY*@@MgGB$A0))# z@h)Y4^hq^j8U6Bu0)jX6V#0h4_{|gy2Xz+XVZ(!JCdFak@p=i1g4`ijkcxG{k3Uq{ z`Cf|!4E|Z#x0ixr-xNnqdsEL9Zi4d@hS< z&o^OU!r=(bIfm&ZCC)D}=G>Mh%xeOF`fN$6rxA4^f7meILdw?=lxEPaXcY(!*N{z& zS4TGkeuzh*C*xtxp9MjwoetPt08Ds1jJ$U+?Vl-0R}ooFnCFMHK=ibDbLe@Lh~vWJ z@%cZE)@czCPpkxUvGbT?*D0}1>k#Z>=9u$aWUjGF{8h{6l(ZmLqrxe|N*zQU$O<)A zQ$Bd{w2~fR^K)tB0-t$&LL=tN8S^D)%wuQF#e0JFDN?*3@1YUwlfG?}`)*-A;DGtQ3*bZjfFLg7g9COjULh>w z0+PH)3LkL54#vO2_`NhXk@EiRXFNDy-k)*Cqd!4Xp2H`M2M5e^SPGxn^h5GHDRKY@ z>|i|prvSg1#$}|uKlmVn2M5givxM>Z=wB}2uz>N00(|c z9$=HH7DzcM$5_TOY%;BZ826E3<6f})Xq-^ep!0!q80|6fv@G$|O67Zh_E~mPAUB+`~bs5is;RW!q(IS$dfd2+Rz%?WQ diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/sha256-internal.o b/esp_iot_sdk_v1.5.2/lib/tmp/sha256-internal.o deleted file mode 100644 index 8aa7e1b1d4efe208924ba3b6603c1323b7dbbf0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4632 zcmai%4^&g<6~Mpuf)HbZ33WYdf%YX@tR2Z-LQ!CikrDEEEa6e2A;~1z6KdClJwh5Q zqz?%XM}&vQ1nz9Ym+Xj4&vc}dolgv2>CrPeD!bCgk&9O6fOF)tm%r3ACT-f3$H;(5 z$rcdu%y>lm(2(}wF)e5639;Jr1sc`W*j<`f>n^id6OIUuA)#nYaE=QuRd~b0njqE2BMpF`%}X!^Z;QGnT=lyxM9GALSz% z{@-th2q`p&_Xoo7SqA&~a39~-`RmSL-DYRq`fW#@q<<*-wsxPUo9Q$Tuk{P{Wz(|M z4s%r@U;58LX}+2im`iU2TJw40G?zXS;G#Tnn|0jgt5C`nHzgd0Md%bz#f*U1!H+quGUaX(8`qj;6$Z7E6e^szsg zm#QKIVcm!9lGmA3GBtgUDp5mREYXEezRrBd<|ezRU*L3+Oy<*Qn2_67at>S_2;a_{ zf1vI!>3UTTWBWL|&CANu?JDII-3M%;SY_FP#m8L92#09V~nU+e(|SJX7uY zZF{PB!+uXerhNaxO-YARzaCVbX-^Gp-#=yt*WtlydS&i(+felKekEDxO){y@^rRj< zvVW`yqDik`Q`^m#(&S3k_46^;>QTF8wDiVk{nOR1RUTKZ)m2BH2$)>;YO^_aIxz%v zt_ET^>y_k6V9d4V{edVu!0pTI+4pp>n{;P}LN~hHOlPKZpuN))bhG|6uUqCEN!s}_ zOj$Fmy=1&;ku$L=lkT5xv2M+uxAxC>!f)>V_|419Ba7!>(_CA&C-`L7hfk%w*4>vh z%q)K{<#>m2)_cz?D|{=Dd++}4Z|$!nUfkikwxhqlVaF%GC_Mh}6EF8qAK0aw)slHx z-?zzEbn(@LD=u{2TIVTyqPyvYao?%gvV$i#E_?U-w9ylVTVMIGtmaJO>N#^}bSU1M zouf@PeA|@izE71?zNk%6dsMMzo#AvO(2?ow+I8vOUT58d`&wUcMs}Aqo_yd^*ST4V z+dt~aPX4O3XN~&){yh)K8|OXbT5q5I=COm1zoATz`YXX-`dVuC z`e*o0ZIZJmU%VYX9{N{f>7H+P-#R|-UweYgT%(Ii~8l zb#oQg3WqDdvZB~gR$;4jKuvi;tyGia3fPVvG&2Ed5^tq!Bv6 zV{_Ro&{DC*ZOhep3iP;$29r)92JST#U*w5EyqVbic#}|jP~tuoJU%X5}jxGP~fCp%yrCp%2vcVwX>-&t8|S!B=E=@js+R)8je4#R`vz-F@X zYrvS`^F(&fMAX|SIptTKNI|z zQx1&t?FID%CsE!Aj3Ng`#`Oz=J`bD?wiom`F#e7}J_!u}Vtg7vT&rPpf?yrwDPVg+ zM?^pLGYXsvz98rw(NB2>*j~`-@MGmc%5#8|DbE9*M%fB1)-ROgQ~+CO&Nko-%Ey4k zKK}@ef_;jTfNN}M+tB0_s=@laaa%7^gSVxLH#9cDh9NW(!z#fi5JPoa8!>om8wEo= z?5p+rz|j(q!j{rh+YAnWY1m@84Hka;zx!hp(2%=wG3NUzG4l;A6r^ zi!t1O@w3Bv^lga;#HPTn21O|bMK|^t6DYD$WUv@R#m^02eNk3I-rJITA~ryR$e8;h z81!RtkR-MWSUQhkn7}OX;XLqD66diFSXxgH_0sN5Y9h9ljsX*sZ=n$8VLeI~!38R0c{HzBe~A1%hQ>j{y?R$O|mymv?3rconyJ~gQN|+*k2?lG43IABM<4Pu>fcTMxQ2a{t04aXWvqXM zG9Go9hkfFad7UyIR|;5b^y3jVlQJGf8IA;bB1>~{s-hqFDUoMMn3pg_b{kTC8G;#^|;2wbD!cP{!9;Jp-CjSPzNA1&%l?*IS* diff --git a/esp_iot_sdk_v1.5.2/lib/tmp/sha256.o b/esp_iot_sdk_v1.5.2/lib/tmp/sha256.o deleted file mode 100644 index eedd80341ce03b861700e705815145b643724d4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3204 zcma)8-ER{|5Z^l|Avg{sE=3Lw;qHp6B*f-?As-;Da*iEx#7T;i(6oX&YsVoL&Ih(t z!UN(%{R1d(t*De%s#K{@l@LO$)aD|D(vk>>RH-jWX++glqE$;;27dW@l$-_jY|T7Vj1Wfp8JX>!hR+vRDol7a<2MhelFEs=4bk`zv#+mulw~s%kW} zMq5PMv_P9z=)UFhhZW)jL7cyxdLX3k%-uP zh-#d)xK7@Qm{On&rW!3xR+IBD|FX##ltN>mS3X{p8ZcR3%}xQU%dD9;~!|#TcRw9bdO@H_tn~_vzo4|ow}xn zc3v&_GUim1 zMJ3tjmN$=pU!NyXt(ixJuk4l9t;oC9Wd9SnUYWZj%06qcFN_p3Qw1t@O;65bbD6w! zB9kvCS)D5wUtpr(e})HXHL8qzvD+oVI1RG6SzTYE4qrR^bO(z$GL0xW?6O$wZD zB_62E92`|Vt#%XL^i|Q@4W;0UuI3wN(3fyE`&$ z#G}dKe&hIXENMi+q^fFLhe{8+^@tG;xrYa1Nj)++5FZ|jCF90WETP8-!zu8sd43|T^0K*z!?i0fU0#XU_djRhNjPXx9c%BR9Fa!Ju^H~Jk3K(|jspPsSj|9`)JaKnXEFn9Z2FO4l@@Cfw( z=EsUbnwcLw5teL@$Nf~WVuk+84|j9(yu89V0ne|^fswzlm5|3Ua2sHJvd|B2h;C>Y z59dc2hus>oq4kS4Y4##RL%@W`!=4>n%hCgz zQv>97(C{n8xo};Wt25pR5U&Bpg~#LivwD}cBPEM#!-_G!GZWOEGotQXIqJ@xLf!iI z)+caTS+A>Lud-&uTc-&U_Ch{8N@i=F$|fCe5-wPWPH6o0!0}Pg@upaS9(6oFT&(jj zF-g-&`w>gNkx3V)^JJrzDHf8GnaM(?NEl4doF|T9+TYuYzE0CcHq*A34NTjQ^bRxEBu?#+Tv|VixCj#^Y<^ z0YA>?K_eH5cB*YJ;MK

{0}
'.format(ap.rssi_perc))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(_.escape(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get(_root+'/wifi/scan', onScan); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var page_waveform = (function () {\n\tvar wfm = {};\n\n\tvar zoomResetFn;\n\tvar dataFormat;\n\n\tvar readoutPending = false;\n\tvar autoReload = false;\n\tvar autoReloadTime = 1;\n\tvar arTimeout = -1;\n\n\tvar lastLoadMs;\n\n\tvar zoomSavedX, zoomSavedY;\n\n\tvar readXhr; // read xhr\n\n\tvar opts = {\n\t\tcount: 0, // sample count\n\t\tfreq: 0 // sampling freq\n\t};\n\n\tfunction buildChart(j) {\n\t\t// Build the chart\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tvar fft = (j.stats.format == 'FFT');\n\n\t\tvar xLabel, yLabel;\n\t\tif (fft) {\n\t\t\txLabel = 'Frequency - [ Hz ]';\n\t\t\tyLabel = 'Magnitude - [ mA ]';\n\t\t} else {\n\t\t\txLabel = 'Sample time - [ ms ]';\n\t\t\tyLabel = 'Current - [ mA ]';\n\t\t}\n\n\t\tvar peak = Math.max(-j.stats.min, j.stats.max);\n\t\tvar displayPeak = Math.max(peak, 10);\n\n\t\t// Sidebar\n\n\t\t$('#stat-count').html(j.stats.count);\n\t\t$('#stat-f-s').html(numfmt(j.stats.freq, 2));\n\t\t$('#stat-i-peak').html(numfmt(peak, 2));\n\t\t$('#stat-i-rms').html(numfmt(j.stats.rms, 2));\n\t\t$('.stats').removeClass('invis');\n\n\t\t// --- chart ---\n\n\t\t// Generate point entries\n\t\t// add synthetic properties\n\t\tvar step = fft ? (j.stats.freq/j.stats.count) : (1000/j.stats.freq);\n\t\tvar points = _.map(j.samples, function (a, i) {\n\t\t\treturn {\n\t\t\t\tx: i * step,\n\t\t\t\ty: a\n\t\t\t};\n\t\t});\n\n\t\tvar plugins = [\n\t\t\tChartist.plugins.zoom({\n\t\t\t\tresetOnRightMouseBtn: true,\n\t\t\t\tonZoom: function (chart, reset) {\n\t\t\t\t\tzoomResetFn = reset;\n\n\t\t\t\t\tzoomSavedX = chart.options.axisX.highLow;\n\t\t\t\t\tzoomSavedY = chart.options.axisY.highLow;\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\n\t\tif (!isPhone) plugins.push( // larger than phone\n\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\taxisX: {\n\t\t\t\t\taxisTitle: xLabel,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 55\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\taxisY: {\n\t\t\t\t\taxisTitle: yLabel,\n\t\t\t\t\tflipText: true,\n\t\t\t\t\toffset: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tvar xHigh, xLow, yHigh, yLow;\n\n\t\tif (zoomSavedX) {\n\t\t\t// we have saved coords of the zoom rect, restore the zoom.\n\t\t\txHigh = zoomSavedX.high;\n\t\t\txLow = zoomSavedX.low;\n\t\t\tyHigh = zoomSavedY.high;\n\t\t\tyLow = zoomSavedY.low;\n\t\t} else {\n\t\t\tyHigh = fft ? undefined : displayPeak;\n\t\t\tyLow = fft ? 0 : -displayPeak;\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: points\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\tshowArea: fft,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.monotoneCubic()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: !fft // only for raw\n\t\t\t\thigh: xHigh,\n\t\t\t\tlow: xLow,\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t\thigh: yHigh,\n\t\t\t\tlow: yLow,\n\t\t\t},\n\t\t\texplicitBounds: {\n\t\t\t\txLow: 0,\n\t\t\t\tyLow: fft ? 0 : undefined,\n\t\t\t\txHigh: points[points.length-1].x\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\n\t\tif (status != 200) {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t} else {\n\t\t\tvar j = JSON.parse(resp);\n\t\t\tif (!j.success) {\n\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t} else {\n\t\t\t\tbuildChart(j);\n\t\t\t}\n\t\t}\n\n\t\tif (autoReload)\n\t\t\tarTimeout = setTimeout(requestReload, Math.max(0, autoReloadTime - msElapsed(lastLoadMs)));\n\t}\n\n\tfunction readInputs() {\n\t\topts.count = $('#count').val();\n\t\topts.freq = $('#freq').val() * (dataFormat == 'fft' ? 2 : 1); // bw 2x -> f_s\n\t}\n\n\tfunction requestReload() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar n = opts.count;\n\t\tvar fs = opts.freq;\n\t\tvar url = _root+'/measure/'+dataFormat+'?n='+n+'&fs='+fs;\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction toggleAutoReload() {\n\t\tautoReloadTime = +$('#ar-time').val(); // ms\n\n\t\treadInputs();\n\n\t\tautoReload = !autoReload;\n\t\tif (autoReload) {\n\t\t\trequestReload();\n\t\t} else {\n\t\t\tclearTimeout(arTimeout);\n\t\t}\n\n\t\t$('#ar-btn')\n\t\t\t.toggleClass('btn-blue')\n\t\t\t.toggleClass('btn-red')\n\t\t\t.val(autoReload ? 'Stop' : 'Auto');\n\t}\n\n\twfm.init = function (format) {\n\t\t// --- Load data ---\n\t\tdataFormat = format;\n\n\t\tfunction onLoadClick() {\n\t\t\treadInputs();\n\t\t\trequestReload();\n\t\t}\n\n\t\t$('#load').on('click', onLoadClick);\n\n\t\t$('#count,#freq').on('keyup', function (e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tonLoadClick();\n\t\t\t}\n\t\t});\n\n\t\t// --- zooming ---\n\n\t\t$('#chart').on('contextmenu', function (e) { // right click on the chart -> reset\n\t\t\tzoomResetFn && zoomResetFn();\n\t\t\tzoomResetFn = null;\n\n\t\t\tzoomSavedX = null;\n\t\t\tzoomSavedY = null;\n\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t\t// auto-reload button\n\t\t$('#ar-btn').on('click', toggleAutoReload);\n\t};\n\n\treturn wfm;\n})();\n","var page_spectrogram = (function () {\n\tvar sg = {};\n\n\tvar ctx;\n\n\t// drawing area\n\tvar plot = {\n\t\tx:50,\n\t\ty:10,\n\t\tw:740,//860 total\n\t\th:512,\n\t\tdx: 1, // bin\n\t\tdy: 1\n\t};\n\n\tvar opts = {\n\t\tinterval: 0,\n\t\tsampCount: 0,\n\t\tfreq:0\n\t};\n\n\tvar interval = 1000;\n\tvar running = false;\n\tvar readTimeout; // timer\n\tvar readoutPending;\n\tvar readXhr;\n\n\tvar lastLoadMs;\n\tvar lastMarkMs;\n\tvar lastMark10s;\n\n\tvar colormap = [\n\t\t/* [val, r, g, b] */\n\t\t[0.00, 0, 0, 0],\n\t\t[0.10, 41, 17, 41],\n\t\t[0.25, 34, 17, 78],\n\t\t[0.6, 17, 30, 105],\n\t\t[1.0, 17, 57, 126],\n\t\t[1.2, 17, 84, 128],\n\t\t[1.3, 17, 111, 115],\n\t\t[1.4, 17, 134, 96],\n\t\t[1.5, 17, 155, 71],\n\t\t[1.6, 68, 194, 17],\n\t\t[1.75, 111, 209, 17],\n\t\t[1.84, 180, 213, 17],\n\t\t[1.90, 223, 217, 86],\n\t\t[1.97, 248, 222, 176],\n\t\t[1.99, 255, 237, 222],\n\t\t[2.00, 255, 255, 255],\n\t];\n\n\tfunction val2color(val) {\n\t\tvar x1, x2, c1, c2;\n\n\t\tval = Math.log10(1+val);\n\n\t\tif (val > 2) val = 2;\n\t\tif (val < 0) val = 0;\n\n\t\tfor (var i = 0; i < colormap.length; i++) {\n\t\t\tvar c = colormap[i];\n\t\t\tvar point = c[0];\n\t\t\tif (val >= point) {\n\t\t\t\tx1 = point;\n\t\t\t\tc1 = c;\n\t\t\t}\n\n\t\t\tif (val <= point) {\n\t\t\t\tx2 = point;\n\t\t\t\tc2 = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar rate = ((val - x1)/(x2 - x1));\n\t\tif (x1 == x2) rate=0;\n\n\t\tvar r =\tMath.round((c1[1] + (c2[1] - c1[1])*rate));\n\t\tvar g =\tMath.round((c1[2] + (c2[2] - c1[2])*rate));\n\t\tvar b =\tMath.round((c1[3] + (c2[3] - c1[3])*rate));\n\t\treturn 'rgb('+r+','+g+','+b+')';\n\t}\n\n\tfunction shiftSg() {\n\t\tvar imageData = ctx.getImageData(plot.x+plot.dx, plot.y, plot.w-plot.dx, plot.h+10);\n\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.clearRect(plot.x, plot.y+plot.h+1, plot.w, 10); // clear the second marks box\n\n\t\tctx.putImageData(imageData, plot.x, plot.y);\n\t}\n\n\tfunction drawSg(col) {\n\t\tshiftSg();\n\n\t\tvar bc = opts.sampCount/2;\n\t\tfor (var i = 0; i < bc; i++) {\n\t\t\t// resolve color from the value\n\t\t\tvar clr;\n\n\t\t\tif (i*plot.dy > plot.h) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (i > col.length) {\n\t\t\t\tclr = '#000';\n\t\t\t} else {\n\t\t\t\tclr = val2color(col[i]);\n\t\t\t}\n\t\t\tctx.fillStyle = clr;\n\n\t\t\tvar tx = plot.x+plot.w-plot.dx;\n\t\t\tvar ty = plot.y+plot.h-(i+1)*plot.dy;\n\t\t\tvar tw = plot.dx;\n\t\t\tvar th = plot.dy;\n\n\t\t\tif (ty= 950) {\n\t\t\tlastMarkMs = msNow();\n\n\t\t\tvar long = false;\n\t\t\tif (msElapsed(lastMark10s) > 9500) {\n\t\t\t\tlong = true;\n\t\t\t\tlastMark10s = msNow();\n\t\t\t}\n\n\t\t\tctx.strokeStyle = 'white';\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);\n\t\t\tctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\n\tfunction onRxData(resp, status) {\n\t\treadoutPending = false;\n\t\tif (status == 200) {\n\t\t\ttry {\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tif (j.success) {\n\t\t\t\t\t// display\n\t\t\t\t\tdrawSg(j.samples);\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg(\"Sampling failed.\", 1000);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg(\"Request failed.\", 1000);\n\t\t}\n\n\t\tif (running)\n\t\t\treadTimeout = setTimeout(requestData, Math.max(0, opts.interval - msElapsed(lastLoadMs))); // TODO should actually compute time remaining, this adds interval to the request time.\n\t}\n\n\tfunction requestData() {\n\t\tif (readoutPending) {\n\t\t\terrorMsg(\"Request already pending - aborting.\");\n\t\t\treadXhr.abort();\n\t\t}\n\t\treadoutPending = true;\n\t\tlastLoadMs = msNow();\n\n\t\tvar fs = opts.freq;\n\t\tvar n = opts.sampCount;\n\t\tvar url = _root+'/measure/fft?n='+n+'&fs='+fs;\n\n\t\treadXhr = $().get(url, onRxData, estimateLoadTime(fs,n));\n\n\t\treturn true;\n\t}\n\n\tfunction drawLegend() {\n\t\tvar gap = 8;\n\t\tvar barW = 10;\n\t\tvar barH = plot.h-12;\n\t\tvar barY = plot.y+6;\n\t\tvar barX = plot.x - gap - barW;\n\t\tvar vStep = (100 / barH);\n\t\tfor (var i = 0; i < barH; i++) {\n\t\t\tvar c1 = val2color(i * vStep);\n\t\t\tvar c2 = val2color((i + 1) * vStep);\n\n\t\t\tvar y = Math.floor(barY + barH - (i + 1));\n\n\t\t\tvar gradient = ctx.createLinearGradient(0, y + 1, 0, y);\n\t\t\tgradient.addColorStop(0, c1);\n\t\t\tgradient.addColorStop(1, c2);\n\t\t\tctx.fillStyle = gradient;\n\n\t\t\tctx.fillRect(barX, y, barW, 1);\n\t\t}\n\n\t\t// border\n\t\tctx.strokeStyle = '#000';\n\t\tctx.strokeRect(barX-.5, barY-.5, barW+1, barH+1);\n\n\t\tvStep = (100 / barH);\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.textAlign = 'right';\n\t\tfor (var i = 0; i <= plot.h; i+=barH/10) {\n\t\t\tctx.fillText(Math.round(i*vStep)+\"\", plot.x - gap - barW - gap, barY+barH-i+3);\n\t\t}\n\t}\n\n\tfunction drawAxis() {\n\t\tvar gap = 8;\n\t\tvar rX0 = plot.x+plot.w;\n\t\tvar rX = rX0+gap;\n\t\tvar rY = plot.y;\n\t\tvar rH = plot.h;\n\t\tvar rW = 70;\n\t\tctx.clearRect(rX0+.5, rY-10, rW, rH+20);\n\n\t\tvar perBin = (opts.freq/2) / (opts.sampCount/2);\n\n\t\tvar totalBins = (plot.h / plot.dy);\n\t\tvar totalHz = totalBins*perBin;\n\n\t\t//console.log(\"perbin=\",perBin,\"totalBins=\",totalBins,\"totalHz=\",totalHz);\n\n\t\tvar step;\n\n\t\t// get the best step size\n\t\tvar steps = [10, 25, 50];\n\t\tvar multiplier = 1;\n\t\tvar suc = false;\n\t\tdo {\n\t\t\tfor (var i = 0; i < steps.length; i++) {\n\t\t\t\tif ((totalHz / (steps[i] * multiplier)) <= 21) {\n\t\t\t\t\tstep = (steps[i] * multiplier);\n\t\t\t\t\tsuc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (suc) break;\n\t\t\tmultiplier *= 10;\n\t\t} while (true);\n\n\t\tstep = step/perBin;\n\n\t\t// every step-th bin has a label\n\t\tctx.font = '12px sans-serif';\n\t\tctx.fillStyle = 'white';\n\t\tctx.strokeStyle = 'white';\n\t\tctx.textAlign = 'left';\n\n\t\t// labels and dashes\n\t\tfor(var i = 0; i <= totalBins+step; i+= step) {\n\t\t\tif (i >= totalBins) {\n\t\t\t\tvar dist = i - totalBins;\n\t\t\t\tif (dist > step/2) break;// make sure not too close\n\t\t\t\ti = totalBins;\n\t\t\t}\n\n\t\t\tvar hz = i*(totalHz/totalBins);\n\t\t\tif (hz>=1000000) hz = numfmt(hz/1e6,2)+'M';\n\t\t\telse if (hz>=1000) hz = numfmt(hz/1e3,2)+'k';\n\t\t\telse hz = numfmt(hz,1);\n\n\t\t\tvar yy = Math.round(rY+rH-(plot.dy*i));\n\t\t\tctx.fillText(hz, rX, yy+4);\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(rX0, yy+.5);\n\t\t\tctx.lineTo(rX0+gap/2, yy+.5);\n\t\t\tctx.stroke();\n\n\t\t\tif (i >= totalBins) break;\n\t\t}\n\n\t\t// Hz label\n\t\tctx.font = '16px sans-serif';\n\t\tctx.save();\n\t\tctx.translate(rX0+50, plot.y+plot.h/2);\n\t\tctx.rotate(Math.PI/2);\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(\"Frequency - [Hz]\", 0, 0);\n\t\tctx.restore();\n\t}\n\n\tfunction readOpts() {\n\t\topts.interval = +$('#interval').val(); // ms\n\t\topts.freq = +$('#freq').val()*2;\n\t\topts.sampCount = +$('#count').val();\n\n\t\tplot.dx = +$('#tile-x').val();\n\t\tplot.dy = +$('#tile-y').val();\n\t}\n\n\tfunction clearSgArea() {\n\t\tctx.fillStyle = '#000';\n\t\tctx.fillRect(plot.x, plot.y, plot.w, plot.h);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(plot.x-.5, plot.y-.5, plot.w+1, plot.h+1);\n\t}\n\n\tsg.init = function () {\n\t\tvar canvas = $('#sg')[0];\n\t\tctx = canvas.getContext('2d');\n\n\t\t// CLS\n\t\tclearSgArea();\n\t\treadOpts();\n\t\tdrawLegend();\n\t\tdrawAxis();\n\t\tlastMarkMs = msNow()-10000;\n\t\tlastMark10s = msNow()-10000;\n\n\t\t// update tile size on bin count selection\n\t\t$('#count').on('change', function() {\n\t\t\tvar count = +$('#count').val();\n\t\t\tvar tile = Math.max(1, plot.h/(count/2));\n\n\t\t\t$('#tile-x').val(Math.max(4, tile)); // use width 4 for smaller by default (rolls more nicely)\n\t\t\t$('#tile-y').val(tile);\n\t\t});\n\n\t\t// chain Y with X\n\t\t$('#tile-y').on('change', function() {\n\t\t\t$('#tile-x').val(Math.max(4,$(this).val()));\n\t\t});\n\n\t\t$('#go-btn').on('click', function() {\n\t\t\trunning = !running;\n\t\t\tif (running) {\n\t\t\t\treadOpts();\n\t\t\t\tdrawAxis();\n\n\t\t\t\trequestData();\n\t\t\t} else {\n\t\t\t\tclearTimeout(readTimeout);\n\t\t\t}\n\n\t\t\t$('#go-btn')\n\t\t\t\t.toggleClass('btn-green')\n\t\t\t\t.toggleClass('btn-red')\n\t\t\t\t.html(running ? 'Stop' : 'Start');\n\t\t});\n\t};\n\n\treturn sg;\n})();\n","var page_status = (function() {\n\tvar st = {};\n\tst.j = {};\n\n\tvar updateTime = 10000;\n\n\tvar updateInhibited = false;\n\n\tst.trigReset = function() {\n\t\tvar modal_sel = '#reset-modal';\n\t\t$().get(_root + '/system/reset', function(resp, status) {\n\t\t\tif (status == 200) {\n\n\t\t\t\tmodal.show(modal_sel);\n\t\t\t\tupdateInhibited = true;\n\n\t\t\t\tvar ping_i = setInterval(function() {\n\t\t\t\t\t$().get(_root+'/system/ping', function(resp, code){\n\t\t\t\t\t\tif (code == 200) {\n\t\t\t\t\t\t\t// device is ready\n\t\t\t\t\t\t\tmodal.hide(modal_sel);\n\t\t\t\t\t\t\trequestUpdate();\n\t\t\t\t\t\t\tclearInterval(ping_i);\n\t\t\t\t\t\t\tupdateInhibited = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {timeout: 500});\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t};\n\n\tfunction onUpdate(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\terrorMsg('Update failed.');\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// OK\n\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\tst.j = j; // store for global access\n\n\t\t\t\t$('.sta-only').toggle(j.sta);\n\t\t\t\t$('.ap-only').toggle(j.ap);\n\n\t\t\t\t$('#uptime').html(j.uptime);\n\t\t\t\t$('#heap').html(j.heap + \" bytes\");\n\t\t\t\t$('#wmode').html(j.wifiMode);\n\n\t\t\t\tif (j.sta) {\n\t\t\t\t\t$('#staSSID').html(j.sta.SSID);\n\t\t\t\t\t$('#staRSSIperc').html(j.sta.RSSIperc);\n\t\t\t\t\t$('#staRSSI').html(j.sta.RSSI);\n\t\t\t\t\t$('#staMAC').html(j.sta.MAC);\n\t\t\t\t}\n\n\t\t\t\tif (j.ap) {\n\t\t\t\t\t$('#apSSID').html(j.ap.SSID);\n\t\t\t\t\t$('#apHidden').html(j.ap.hidden ? \"Yes\" : \"No\");\n\t\t\t\t\t$('#apAuth').html(j.ap.auth);\n\n\t\t\t\t\t// hide the password row if auth is Open\n\t\t\t\t\t$('.ap-auth-only').toggle(j.ap.auth != 'Open');\n\n\t\t\t\t\t$('#apPwd').html(j.ap.pwd);\n\t\t\t\t\t$('#apChan').html(j.ap.chan);\n\t\t\t\t\t$('#apMAC').html(j.ap.MAC);\n\t\t\t\t}\n\t\t\t\t// chip ID & macs don't change\n\t\t\t} catch(e) {\n\t\t\t\terrorMsg(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!updateInhibited) {\n\t\t\tsetTimeout(requestUpdate, updateTime);\n\t\t}\n\t}\n\n\tfunction requestUpdate() {\n\t\t$().get(_root+'/system/status', onUpdate);\n\t}\n\n\tst.init = function() {\n\t\trequestUpdate();\n\t};\n\n\treturn st;\n})();\n","var page_mon = (function() {\n\tvar mon = {};\n\n\tfunction updRefInfoField(ok) {\n\t\t$('#hasref').html(ok ? 'OK' : 'Not set!');\n\t}\n\n\t/** Capture reference & save to flash */\n\tmon.captureRef = function() {\n\t\t$().get(_root + '/mon/setref', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tupdRefInfoField(j.success);\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\tupdRefInfoField(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Capture waveform and compare with reference */\n\tmon.compareNow = function() {\n\t\t$().get(_root + '/mon/compare', function(resp, status) {\n\t\t\tif (status != 200) {\n\t\t\t\t// bad response\n\t\t\t\terrorMsg('Operation failed.');\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t// OK\n\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t$('#actual-dev').html(numfmt(j.deviation, 2));\n\t\t\t\t\t\t$('#actual-rms').html(numfmt(j.rms, 2));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow 'Capture failed.';\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tmon.init = function() {\n\t\tsetInterval(function() {\n\t\t\t$().get(_root + '/mon/status', function(resp, status) {\n\t\t\t\tif (status == 200) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// OK\n\t\t\t\t\t\tvar j = JSON.parse(resp);\n\t\t\t\t\t\tif (j.success) {\n\t\t\t\t\t\t\t$('#actual-dev').html(numfmt(j.deviation, 2));\n\t\t\t\t\t\t\t$('#actual-rms').html(numfmt(j.rms, 2));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow 'Capture failed.';\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\terrorMsg(e);\n\t\t\t\t\t\t$('#actual-dev').html('--');\n\t\t\t\t\t\t$('#actual-rms').html('--');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}, 10000);\n\t};\n\n\treturn mon;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file From 21e5b5acecbc6f65924a585598ba518f34e53e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 25 Apr 2016 00:27:24 +0200 Subject: [PATCH 11/11] upd gitignore Former-commit-id: 7c43ee4153127bf0f6dacdb8bbc3008c96f20942 --- html/js/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 html/js/.gitignore diff --git a/html/js/.gitignore b/html/js/.gitignore new file mode 100644 index 0000000..46af539 --- /dev/null +++ b/html/js/.gitignore @@ -0,0 +1 @@ +*.map \ No newline at end of file
-  
-  seconds
Service: -    -   +    +  
 
Actual state:Status: - - Δ = %curDeviation%, - Irms = %curRMS% mA + + Δ = %curDeviation%
+ IRMS = %curRMS% mA
Measure
-  
Service: -    -   +    +  
Actual state:Status: - - Δ = %curDeviation%, - Irms = %curRMS% mA + + Δ = %curDeviation%
+ IRMS = %curRMS% mA
Measure
-  
Service: -    -   +    +