diff --git a/bower.json b/bower.json index 5ab17cf..7c16dfb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "grommet", - "version": "0.2.2", + "version": "0.2.3", "main": "grommet.js", "description": "The most advanced UX framework for enterprise applications.", "authors": [ @@ -11,7 +11,7 @@ ], "homepage": "http://grommet.io", "bugs": "https://github.com/HewlettPackard/grommet/issues", - "license": "Apache 2", + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/HewlettPackard/grommet.git" diff --git a/css/grommet-hpinc.min.css b/css/grommet-hpinc.min.css index 9c8b36a..e69de29 100644 --- a/css/grommet-hpinc.min.css +++ b/css/grommet-hpinc.min.css @@ -1,5 +0,0 @@ -@charset "UTF-8";dfn,img{font-style:italic}img,legend{border:0}a,ins,u{text-decoration:none}a,a:visited{color:#2883d7}code.hljs,input,select,textarea{border:1px solid #ccc}.menu:focus,.search:focus,a:active,a:hover,input,input[type=range]:focus,select,textarea{outline:0}@font-face{font-family:HPSimplified;src:url(~grommet/scss/hpinc/font/hps-me-w27-regular-woff.woff)format('woff')}.brand-font,html{font-family:HPSimplified,Arial,sans-serif}.control-icon circle,.control-icon line,.control-icon path,.control-icon polygon,.control-icon polyline,.control-icon rect{stroke-width:4px;stroke-linecap:round;stroke-linejoin:round}/*! - * inuitcss, by @csswizardry - * - * github.com/inuitcss | inuitcss.com - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#loading,.app{position:absolute}sup{top:-.5em}sub{bottom:-.25em}img{max-width:100%;vertical-align:middle}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}#loading,.tbd{font-style:italic}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}a,select{cursor:pointer}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver}table{border-collapse:collapse;border-spacing:0}blockquote,body,caption,dd,dl,fieldset,figure,form,h1,h2,h3,h4,h5,h6,hr,legend,ol,p,pre,table,td,th,ul{margin:0;padding:0}abbr[title],dfn[title]{cursor:help}ins{border-bottom:1px solid}.header--fixed .header__content,.header__content{border-bottom:1px solid #ccc}html{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:1em;line-height:1.5;background-color:#fff;color:#333;overflow-y:scroll;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:'Source Sans Pro',Arial,sans-serif}*,:after,:before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}address,blockquote,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,ol,p,pre,table,ul{margin-bottom:1.5rem}dd,ol,ul{margin-left:3rem}h6{font-size:14px;font-size:.875rem;line-height:1.71429}li>ol,li>ul{margin-bottom:0}.gm-style img,img[height],img[width]{max-width:none}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGPS42wKzre0cxmO5m5GyTsY.ttf)format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro-Regular'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlEY6Fu39Tt9XkmtSosaMoEA.ttf)format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGLlcMrNrsnL9dgADnXgYJjs.ttf)format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-It'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/M2Jd71oPJhLKp0zdtTvoMzpKUtbt71woJ25xl7KOGD0.ttf)format('truetype')}dd,li,p{max-width:576px}.h1,h1{font-size:48px;font-size:3rem;line-height:1;font-weight:600}.h2,.h3,h2,h3{font-size:36px;line-height:1.33333}.h2,h2{font-size:2.25rem;font-weight:400}.h3,.h4,.h5,h3,h4,h5{font-weight:100}.h3,h3{font-size:2.25rem}.h4,h4{font-size:24px;font-size:1.5rem;line-height:1}.h5,h5{font-size:20px;font-size:1.25rem;line-height:1.2}a{background-color:transparent}a:hover{text-decoration:underline}a.active{color:#333}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}input,select,textarea{font-size:16px;font-size:1rem;line-height:1.5;padding:11px 23px;border-radius:0 5px;margin-right:12px;background-color:inherit}input:focus,select:focus,textarea:focus{padding:10px 22px;border-width:2px;border-color:#99d5ef}input::-moz-focus-inner,select::-moz-focus-inner,textarea::-moz-focus-inner{border:none;outline:0}input.error,select.error,textarea.error{border-color:#DC442F}input[type=button],input[type=submit]{line-height:inherit}a.button,button,input[type=button],input[type=submit]{display:inline-block;padding:4px 12px;border:2px solid #0096D6;border-radius:0 5px;background-color:inherit;text-decoration:none;cursor:pointer;text-align:center;outline:0}a.button:hover,button:hover,input[type=button]:hover,input[type=submit]:hover{background-color:#eee;border-color:#0096D6}a.button.primary,button.primary,input[type=button].primary,input[type=submit].primary{background-color:#0096D6;border-color:#0096D6;color:#fff}a.button.primary:hover,button.primary:hover,input[type=button].primary:hover,input[type=submit].primary:hover{background-color:#0096D6;border-color:#0096D6}a.button.call-to-action,button.call-to-action,input[type=button].call-to-action,input[type=submit].call-to-action{font-size:20px;font-size:1.25rem;line-height:1.2;padding:12px 24px}a.button:focus,button:focus,input[type=button]:focus,input[type=submit]:focus{border-color:#99d5ef;box-shadow:0 0 1px 1px #99d5ef}[class*=background-color-index-] a.button:hover,[class*=background-color-index-] button:hover,[class*=background-color-index-] input[type=button]:hover,[class*=background-color-index-] input[type=submit]:hover{background-color:#0096D6;border-color:#0096D6;text-decoration:none}select{border-color:#ccc;padding-right:24px;-webkit-appearance:none;-moz-appearance:none;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAALNJREFUKBVjYBj6gHH69Olb////L8rIyJiemZl5HpuXgGoMgWpmAtW8ZgIyuIEMU6DCk0CJioaGBiaYJhAbJAaSA6kBqwUKcoiJiXUBBXKAEoxAwcM/f/6MA2liZ2dfBBS3BTKBwv+nvHr1qowRJAECU6dOdQNKzgdiKaDkNyANEuYCsp8BcWJ2dvYukADcepDAjx8/dIFia4CKuUCKQWyQGEwxkI8dTJs2rRLqduwKaCoKAOClUKEWEZS1AAAAAElFTkSuQmCC')center right 12px no-repeat}select:hover{background-color:#eee}select::-moz-focus-inner{border:none}select.plain{border:none}input[type=range]{-webkit-appearance:none;border-color:transparent;padding:0}input[type=range]::-moz-focus-inner{border:none}input[type=range]::-webkit-slider-runnable-track{width:100%;height:6px;cursor:pointer;background:0 0;border:1px solid #ccc;border-radius:0 5px}input[type=range]::-webkit-slider-thumb{border:none;height:24px;width:24px;border-radius:24px;background:#0096D6;cursor:pointer;-webkit-appearance:none;margin-top:-10px}input[type=range]::-moz-range-track{width:100%;height:6px;cursor:pointer;background:0 0;border:1px solid #ccc;border-radius:0 5px}input[type=range]::-moz-range-thumb{border:none;height:24px;width:24px;border-radius:24px;background:#0096D6;cursor:pointer}input[type=range]::-ms-track{width:100%;height:6px;cursor:pointer;border:1px solid transparent;border-radius:0 5px;background:0 0;border-width:16px 0;color:transparent}input[type=range]::-ms-fill-lower{background:#2a6495;border-radius:0 5px}input[type=range]::-ms-fill-upper{background:#3071a9;border-radius:0 5px}input[type=range]::-ms-thumb{border:none;height:24px;width:24px;border-radius:24px;background:#0096D6;cursor:pointer}body,html{height:100%;width:100%;overflow:hidden}.i-list-bare{margin:0;padding:0;list-style:none}.app--centered .document,.app--centered .section,.app--centered>.footer,.app--centered>div>.footer{padding-left:24px;padding-right:24px}.app--centered .document__content,.app--centered .section__content,.app--centered>.footer .footer__content,.app--centered>.header .header__content,.app--centered>div>.footer .footer__content,.app--centered>div>.header .header__content{width:100%;max-width:960px;margin-left:auto;margin-right:auto}#loading{width:100%;height:100%;background-color:#ddd;text-align:center;padding-top:100px;font-size:48px;color:#ccc}.app{top:0;bottom:0;left:0;right:0;overflow:auto}.app--inline,.chart{position:relative}.app--centered .section .document{padding-left:0;padding-right:0}.app--centered .section .document__content{width:auto;max-width:none}.chart{display:block}.chart__grid{stroke:#ccc}.chart__graphic{width:100%;max-height:calc(100vh - 144px)}.chart__values-line{stroke-width:3px}.chart__values-line.color-index-error{stroke:#DC442F}.chart__values-line.color-index-warning{stroke:#F4B51E}.chart__values-line.color-index-ok{stroke:#42A425}.chart__values-line.color-index-disabled,.chart__values-line.color-index-unknown{stroke:#848484}.chart__values-line.color-index-graph-1,.chart__values-line.color-index-graph-6{stroke:#0096D6}.chart__values-line.color-index-graph-2,.chart__values-line.color-index-graph-7{stroke:#C094bf}.chart__values-line.color-index-graph-3,.chart__values-line.color-index-graph-8{stroke:#99d5ef}.chart__values-line.color-index-graph-4,.chart__values-line.color-index-graph-9{stroke:#87898b}.chart__values-line.color-index-graph-10,.chart__values-line.color-index-graph-5{stroke:#b9b8bb}.chart__values-area.color-index-error{fill:rgba(220,68,47,.7)}.chart__values-area.color-index-warning{fill:rgba(244,181,30,.7)}.chart__values-area.color-index-ok{fill:rgba(66,164,37,.7)}.chart__values-area.color-index-disabled,.chart__values-area.color-index-unknown{fill:rgba(132,132,132,.7)}.chart__values-area.color-index-graph-1,.chart__values-area.color-index-graph-6{fill:rgba(0,150,214,.7)}.chart__values-area.color-index-graph-2,.chart__values-area.color-index-graph-7{fill:rgba(192,148,191,.7)}.chart__values-area.color-index-graph-3,.chart__values-area.color-index-graph-8{fill:rgba(153,213,239,.7)}.chart__values-area.color-index-graph-4,.chart__values-area.color-index-graph-9{fill:rgba(135,137,139,.7)}.chart__values-area.color-index-graph-10,.chart__values-area.color-index-graph-5{fill:rgba(185,184,187,.7)}.chart__values-bar.color-index-error{fill:rgba(220,68,47,.7)}.chart__values-bar.color-index-warning{fill:rgba(244,181,30,.7)}.chart__values-bar.color-index-ok{fill:rgba(66,164,37,.7)}.chart__values-bar.color-index-disabled,.chart__values-bar.color-index-unknown{fill:rgba(132,132,132,.7)}.chart__values-bar.color-index-graph-1,.chart__values-bar.color-index-graph-6{fill:rgba(0,150,214,.7)}.chart__values-bar.color-index-graph-2,.chart__values-bar.color-index-graph-7{fill:rgba(192,148,191,.7)}.chart__values-bar.color-index-graph-3,.chart__values-bar.color-index-graph-8{fill:rgba(153,213,239,.7)}.chart__values-bar.color-index-graph-4,.chart__values-bar.color-index-graph-9{fill:rgba(135,137,139,.7)}.chart__values-bar.color-index-graph-10,.chart__values-bar.color-index-graph-5{fill:rgba(185,184,187,.7)}.chart__values-bar--active.color-index-error{fill:#DC442F}.chart__values-bar--active.color-index-warning{fill:#F4B51E}.chart__values-bar--active.color-index-ok{fill:#42A425}.chart__values-bar--active.color-index-disabled,.chart__values-bar--active.color-index-unknown{fill:#848484}.chart__values-bar--active.color-index-graph-1,.chart__values-bar--active.color-index-graph-6{fill:#0096D6}.chart__values-bar--active.color-index-graph-2,.chart__values-bar--active.color-index-graph-7{fill:#C094bf}.chart__values-bar--active.color-index-graph-3,.chart__values-bar--active.color-index-graph-8{fill:#99d5ef}.chart__values-bar--active.color-index-graph-4,.chart__values-bar--active.color-index-graph-9{fill:#87898b}.chart__values-bar--active.color-index-graph-10,.chart__values-bar--active.color-index-graph-5{fill:#b9b8bb}.chart__threshold{stroke-width:1px;stroke:#545454}.chart__xaxis-index text{fill:#777}.chart__xaxis-index--active text{fill:#333}.chart__back-band-background{fill:transparent}.chart__back-band--active .chart__back-band-background{fill:rgba(230,230,230,.7)}.chart__front-band-background{fill:transparent}.chart__legend{position:absolute;left:0;margin:0;padding:12px;background-color:rgba(230,230,230,.7);display:inline-block;text-align:left;list-style-type:none;pointer-events:none}.chart__legend-label{text-align:right;font-size:20px;font-size:1.25rem;line-height:1.2;margin-bottom:12px}.chart__legend-item,.chart__legend-total{white-space:nowrap}.chart__legend-item>*,.chart__legend-total>*{vertical-align:top}.chart__legend-item-label,.chart__legend-total-label{display:inline-block;width:96px;color:#777}.chart__legend-item-value,.chart__legend-total-value{display:inline-block;width:48px;text-align:right;font-size:20px;font-size:1.25rem;line-height:1.2}.chart__legend-item-units,.chart__legend-total-units{margin-left:6px;font-size:20px;font-size:1.25rem;line-height:1.2}.chart__legend-item--unset,.chart__legend-total--unset{color:#777}.chart__legend-item svg.chart__legend-item-swatch{width:12px;height:12px;margin-top:6px;margin-right:12px;overflow:visible}.chart__legend-item svg.chart__legend-item-swatch.color-index-error{stroke:#DC442F}.chart__legend-item svg.chart__legend-item-swatch.color-index-warning{stroke:#F4B51E}.chart__legend-item svg.chart__legend-item-swatch.color-index-ok{stroke:#42A425}.chart__legend-item svg.chart__legend-item-swatch.color-index-disabled,.chart__legend-item svg.chart__legend-item-swatch.color-index-unknown{stroke:#848484}.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-1,.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-6{stroke:#0096D6}.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-2,.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-7{stroke:#C094bf}.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-3,.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-8{stroke:#99d5ef}.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-4,.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-9{stroke:#87898b}.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-10,.chart__legend-item svg.chart__legend-item-swatch.color-index-graph-5{stroke:#b9b8bb}.chart__legend-item svg.chart__legend-item-swatch path{stroke-width:12px;transition-property:stroke-width;transition-duration:.3s;transition-timing-function:ease-in-out}.chart__legend-total{margin-top:6px;border-top:1px dotted #ccc;padding-top:6px;margin-left:24px;color:#777}.check-box__input{opacity:0;position:absolute}.check-box__input:checked+label.checkbox:after{content:"";position:absolute;top:6px;left:4px;width:16px;height:16px;background-color:#0096D6}.check-box__input:focus+label.checkbox:before{content:"";border-color:#99d5ef;box-shadow:0 0 1px 1px #99d5ef}.layer__container,.login-form{box-shadow:0 2px 4px rgba(0,0,0,.3)}.check-box__label{position:relative;display:inline-block;user-select:none}.check-box__label,.radio-button__label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.check-box__label:before{content:"";display:inline-block;width:24px;height:24px;margin-right:12px;vertical-align:middle;background-color:inherit;color:#0076a8;border:1px solid #ccc;border-radius:0 5px;text-align:center}.header-color-index-neutral-1 dt,.header-color-index-neutral-1 h1,.header-color-index-neutral-1 h2,.header-color-index-neutral-1 h3,.header-color-index-neutral-1 h4,.header-color-index-neutral-1 h5,.header-color-index-neutral-1 h6,.header-color-index-neutral-4 dt,.header-color-index-neutral-4 h1,.header-color-index-neutral-4 h2,.header-color-index-neutral-4 h3,.header-color-index-neutral-4 h4,.header-color-index-neutral-4 h5,.header-color-index-neutral-4 h6{color:#545454}.background-color-index-neutral-1,.background-color-index-neutral-4{background-color:#545454;color:#fff}.background-color-index-neutral-1 a,.background-color-index-neutral-4 a{color:#fff}.header-color-index-neutral-2 dt,.header-color-index-neutral-2 h1,.header-color-index-neutral-2 h2,.header-color-index-neutral-2 h3,.header-color-index-neutral-2 h4,.header-color-index-neutral-2 h5,.header-color-index-neutral-2 h6,.header-color-index-neutral-5 dt,.header-color-index-neutral-5 h1,.header-color-index-neutral-5 h2,.header-color-index-neutral-5 h3,.header-color-index-neutral-5 h4,.header-color-index-neutral-5 h5,.header-color-index-neutral-5 h6{color:#767676}.background-color-index-neutral-2,.background-color-index-neutral-5{background-color:#767676;color:#fff}.background-color-index-neutral-2 a,.background-color-index-neutral-5 a{color:#fff}.header-color-index-neutral-3 dt,.header-color-index-neutral-3 h1,.header-color-index-neutral-3 h2,.header-color-index-neutral-3 h3,.header-color-index-neutral-3 h4,.header-color-index-neutral-3 h5,.header-color-index-neutral-3 h6,.header-color-index-neutral-6 dt,.header-color-index-neutral-6 h1,.header-color-index-neutral-6 h2,.header-color-index-neutral-6 h3,.header-color-index-neutral-6 h4,.header-color-index-neutral-6 h5,.header-color-index-neutral-6 h6{color:#989898}.background-color-index-neutral-3,.background-color-index-neutral-6{background-color:#989898;color:#fff}.background-color-index-neutral-3 a,.background-color-index-neutral-6 a{color:#fff}.background-color-index-accent-1,.background-color-index-accent-3{background-color:#008424;color:#fff}.background-color-index-accent-1 a,.background-color-index-accent-3 a{color:#fff}.background-color-index-accent-2,.background-color-index-accent-4{background-color:#822980;color:#fff}.background-color-index-accent-2 a,.background-color-index-accent-4 a{color:#fff}.background-color-index-grey-1,.background-color-index-grey-4{background-color:#545454;color:#fff}.background-color-index-grey-1 a,.background-color-index-grey-4 a{color:#fff}.background-color-index-grey-2,.background-color-index-grey-5{background-color:#767676;color:#fff}.background-color-index-grey-2 a,.background-color-index-grey-5 a{color:#fff}.background-color-index-grey-3,.background-color-index-grey-6{background-color:#989898;color:#fff}.background-color-index-grey-3 a,.background-color-index-grey-6 a{color:#fff}.center-column{padding-left:24px;padding-right:24px}.center-column .center-column__content{width:100%;max-width:960px;margin-left:auto;margin-right:auto}@media screen and (min-width:45em){.dashboard{height:calc(100vh - 96px)}}.document{width:100%}.document--no-contents .document__content{padding-left:0}.document section{margin-top:24px;margin-bottom:24px;padding-top:24px}.document header>img,.document section>img{margin-top:48px;margin-bottom:48px;display:block;max-width:576px}@media screen and (max-width:44.9375em){.dashboard{height:calc(100vh - 48px)}.document header>img,.document section>img{max-width:100%}.document header>ol,.document header>ul,.document section>ol,.document section>ul{padding-left:24px;padding-right:24px;margin-left:0;margin-bottom:24px}}.document header>dl>dt,.document section>dl>dt{margin-top:24px;margin-bottom:6px;text-transform:uppercase}.document header>dl>dt code,.document section>dl>dt code{text-transform:none;white-space:pre-wrap}.document header>dl>dd,.document section>dl>dd{margin-left:0}.document header>h2,.document section>h2{position:relative;padding-top:24px}.document header>h2:after,.document section>h2:after{position:absolute;content:'';top:0;left:0;right:0;border-top:1px solid #ccc}.document section:first-child{margin-top:0;padding-top:0}.document section:first-child>h2{padding-top:0}.document section:first-child>h2:after{border-top:none}@-webkit-keyframes draw-stroke{0%{stroke-dashoffset:768px}100%{stroke-dashoffset:0}}@keyframes draw-stroke{0%{stroke-dashoffset:768px}100%{stroke-dashoffset:0}}.donut.series-pre path{stroke-dashoffset:768px}.donut__graphic-container{position:relative;width:192px;height:192px}.donut svg.donut__graphic{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible}.donut svg.donut__graphic path{stroke-width:24px;stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0;fill:none;cursor:pointer;-webkit-animation:draw-stroke 3s;animation:draw-stroke 3s}.donut svg.donut__graphic path.donut__slice--active{stroke-width:24px}.donut__slice.color-index-error{stroke:#DC442F}.donut__slice.color-index-warning{stroke:#F4B51E}.donut__slice.color-index-ok{stroke:#42A425}.donut__slice.color-index-disabled,.donut__slice.color-index-unknown{stroke:#848484}.donut__slice.color-index-graph-1,.donut__slice.color-index-graph-6{stroke:#0096D6}.donut__slice.color-index-graph-2,.donut__slice.color-index-graph-7{stroke:#C094bf}.donut__slice.color-index-graph-3,.donut__slice.color-index-graph-8{stroke:#99d5ef}.donut__slice.color-index-graph-4,.donut__slice.color-index-graph-9{stroke:#87898b}.donut__slice.color-index-graph-10,.donut__slice.color-index-graph-5{stroke:#b9b8bb}.donut__active{position:absolute;width:100%;margin-top:72px;text-align:center;white-space:normal;pointer-events:none}.form,.form-field{position:relative}.donut__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.donut__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.donut__active-label{width:50%;margin:0 auto;font-size:14px;font-size:.875rem;line-height:16px}.donut__legend{text-align:left;list-style-type:none;white-space:normal}.donut--landscape,.header__content,.menu__layer a,.search__layer-header{white-space:nowrap}.donut__legend-item,.donut__legend-total{color:#777}.donut__legend-item>*,.donut__legend-total>*{vertical-align:top}.donut__legend-item-label,.donut__legend-total-label{display:inline-block;width:96px}.donut__legend-item-value,.donut__legend-total-value{display:inline-block;width:48px;text-align:right}.donut__legend-item svg.donut__legend-item-swatch{width:12px;height:12px;margin-top:6px;margin-right:12px;overflow:visible}.index,.layer .form>.form-fields{overflow:auto}.donut__legend-item svg.donut__legend-item-swatch.color-index-error{stroke:#DC442F}.donut__legend-item svg.donut__legend-item-swatch.color-index-warning{stroke:#F4B51E}.donut__legend-item svg.donut__legend-item-swatch.color-index-ok{stroke:#42A425}.donut__legend-item svg.donut__legend-item-swatch.color-index-disabled,.donut__legend-item svg.donut__legend-item-swatch.color-index-unknown{stroke:#848484}.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-1,.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-6{stroke:#0096D6}.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-2,.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-7{stroke:#C094bf}.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-3,.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-8{stroke:#99d5ef}.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-4,.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-9{stroke:#87898b}.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-10,.donut__legend-item svg.donut__legend-item-swatch.color-index-graph-5{stroke:#b9b8bb}.donut__legend-item svg.donut__legend-item-swatch path{stroke-width:12px;transition-property:stroke-width;transition-duration:.3s;transition-timing-function:ease-in-out}.donut__legend-item--active{color:#333;font-weight:700}.donut__legend-item--active svg.donut__legend-item-swatch path{stroke-width:12px}.donut__legend-total{margin-left:24px}.donut__legend-total>*{margin-top:6px;padding-top:6px;border-top:1px dotted #ccc}.index-tiles.tiles--flush .tile>.header,.object__attribute--array>.object__attribute-value>ol>li,.session__actions{border-top:1px solid #ccc}.donut--landscape .donut__graphic-container,.donut--landscape .donut__legend{display:inline-block;vertical-align:middle}.donut--landscape .donut__legend{margin:0 0 0 24px}.donut--portrait .donut__graphic-container,.donut--portrait .donut__legend{display:block}.donut--portrait .donut__legend{margin:24px 0 0}.donut--small .donut__legend{display:none}.footer{min-height:48px;line-height:48px}.footer__content{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;width:100%}.footer__content.center-column__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}@media screen and (max-width:44.9375em){.document header>dl>dd,.document section>dl>dd{padding-right:24px}.footer__content.center-column__content>.menu:first-child{width:100%}.footer__content.center-column__content>.menu:first-child:empty{width:0;margin:0;padding:0}}.footer__content>.flex-1{-webkit-flex:1;flex:1}.footer__content>.flex-2{-webkit-flex:2;flex:2}.footer__content>.flex-3{-webkit-flex:3;flex:3}.footer__content>.flex-4{-webkit-flex:4;flex:4}.footer__content>*{margin-right:48px}.footer__content>:last-child{margin-right:0}@media screen and (max-width:44.9375em){.footer__content>:last-child{text-align:left}}@media screen and (min-width:45em)and (max-width:63.9375em){.footer__content>:last-child{text-align:left}}.footer__content a.button,.footer__content button,.footer__content input[type=button],.footer__content input[type=submit]{font-size:24px;font-size:1.5rem;line-height:inherit;min-width:96px}.footer--primary{height:auto;padding:24px}.footer--primary .footer__content{position:relative;color:#777}.footer--primary .footer__content p{padding-top:12px;margin:0;max-width:none;text-align:right;line-height:24px}@media screen and (max-width:44.9375em){.footer--primary .footer__content{display:block}}@media screen and (min-width:45em)and (max-width:63.9375em){.footer--primary .footer__content{display:block}}.footer--centered .footer__content{display:block;text-align:center}.footer--centered .footer__content>*{margin-right:auto;margin-left:auto;text-align:center}@media screen and (min-width:45em){.form{min-width:480px}}.form>.header .header__wrapper{background-color:inherit}.form>.footer{margin-top:24px}.form fieldset{border:none;margin:24px 0 2rem}.form-field,.form-field__contents>input[type=range]{border:1px solid #ccc}.form fieldset legend{font-size:24px;font-size:1.5rem;line-height:1;font-weight:100;margin-bottom:12px;color:#777}.layer .form{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;max-height:calc(100vh - 48px);max-width:calc(100vw - 48px)}.layer .form>.footer,.layer .form>.header{-webkit-flex:0 0 auto;flex:0 0 auto}.form--compact{min-width:240px}.form-field{padding:24px 24px 12px;margin-bottom:-1px;background-color:#fff}@media screen and (min-width:45em){.form-field{width:576px;max-width:100%}}@media screen and (max-width:44.9375em){.layer .form>.form-fields{margin-left:-24px;margin-right:-24px}.layer .form>.form-fields>fieldset>:not(.form-field){margin-left:24px;margin-right:24px}.form-field{width:100vw}}.form-field:last-child{margin-bottom:0}.form-field__label{position:absolute;top:6px;left:25px;display:block;text-align:left;font-size:14px;font-size:.875rem;line-height:24px;color:#777;z-index:1}.form-field__contents button{line-height:24px}.form-field__contents>.search-input input,.form-field__contents>input[type=email],.form-field__contents>input[type=number],.form-field__contents>input[type=password],.form-field__contents>input[type=range],.form-field__contents>input[type=text],.form-field__contents>select,.form-field__contents>textarea{display:block;width:100%;margin-right:0;border-radius:0;font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__contents>.search-input input,.form-field__contents>input[type=email],.form-field__contents>input[type=number],.form-field__contents>input[type=password],.form-field__contents>input[type=range],.form-field__contents>input[type=text],.form-field__contents>select{padding-top:23px;height:72px}.form-field__contents>.search-input input:focus,.form-field__contents>input[type=email]:focus,.form-field__contents>input[type=number]:focus,.form-field__contents>input[type=password]:focus,.form-field__contents>input[type=range]:focus,.form-field__contents>input[type=text]:focus,.form-field__contents>select:focus{padding-top:22px}.form-field__contents>textarea{vertical-align:top;padding-top:29px;height:auto}.control-icon,.header__content svg,.status-icon{vertical-align:middle}.form-field__contents>textarea:focus{padding-top:28px}.form-field__contents>select{height:72px;background-position:bottom 18px right 24px}.form-field__contents>.check-box,.form-field__contents>.radio-button{display:block;margin-top:6px;font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__contents>.check-box:first-of-type,.form-field__contents>.radio-button:first-of-type{margin-top:12px}.form-field__contents label.checkbox,.form-field__contents label.radio{margin-right:24px}.form-field__contents>.search-input{display:block}.form-field__contents>.table--selectable{font-size:18px;font-size:1.125rem;line-height:1.33333;margin:12px -24px -12px}.form-field--error,.form-field__contents>.table--selectable table{margin-bottom:0}.form-field__error,.form-field__help{position:absolute;top:6px;right:24px;display:block;line-height:24px}.form-field__contents>.table--selectable table td:first-child,.form-field__contents>.table--selectable table th:first-child{padding-left:24px}.form-field__help{color:#777}.form-field__error{color:#DC442F;background-color:#fff}.header--fixed .header__content,.header__wrapper{background-color:rgba(255,255,255,.9)}.form-field--text{padding:0;border:none}.form-field--error input,.form-field--error select,.form-field--error textarea{border-color:#DC442F}.header{font-size:24px;font-size:1.5rem;line-height:inherit}@media screen and (max-width:44.9375em){.header{height:48px}}@media screen and (min-width:45em){.header{height:72px}}.header__content{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;width:100%;padding-left:24px;padding-right:24px}@media screen and (max-width:44.9375em){.header__wrapper{height:48px}.header__content{line-height:48px}}@media screen and (min-width:45em){.header__wrapper{height:72px}.header__content{line-height:72px}}.header__content>*{-webkit-flex:1 0;flex:1 0}.header__content>:last-child:not(:first-child){-webkit-flex:0 0 auto;flex:0 0 auto}.header__content .title,.header__content>h1,.header__content>h2,.header__content>h3,.header__content>h4{margin-bottom:0;line-height:inherit}.header__content .title svg,.header__content>h1 svg,.header__content>h2 svg,.header__content>h3 svg,.header__content>h4 svg{height:48px}.header__content>.menu{-webkit-flex:0 0 auto;flex:0 0 auto}.header__content a{color:inherit}.header--fixed .header__wrapper{position:absolute;top:0;left:0;right:0;z-index:3}@media screen and (min-width:45em){.header--large,.header--large .header__wrapper{height:96px}.header--large .header__content{line-height:96px}.header--small,.header--small .header__wrapper{height:48px}.header--small .header__content{line-height:48px}.header--small .header__content .title svg,.header--small .header__content>h1 svg,.header--small .header__content>h2 svg,.header--small .header__content>h3 svg,.header--small .header__content>h4 svg{height:24px}.header--fixed .header__content{position:fixed}}.header--fixed.header--primary .header__wrapper{position:fixed;background-color:rgba(255,255,255,.9)}.header--fixed.header--primary .header__content{position:static;background-color:transparent}.index-header,.index__container,.index__items{position:relative}.header--flush .header__content,.header--flush .header__wrapper{padding-left:0;padding-right:0}.header--primary .header__content,.header--primary .header__wrapper{border-bottom:none}.control-icon{display:inline-block;width:48px;height:48px;cursor:pointer;fill:#999;stroke:#999;transition:all .3s ease-in-out}.control-icon:hover{fill:#000;stroke:#000}.control-icon__badge circle{fill:#0096D6}.control-icon__badge text{stroke:#fff;fill:#fff}.control-icon--active{fill:#000;stroke:#000}.status-icon{width:24px;height:24px}.status-icon .status-icon__base{fill:#848484}.status-icon-error .status-icon__base{fill:#DC442F}.status-icon-warning .status-icon__base{fill:#F4B51E}.status-icon-ok .status-icon__base{fill:#42A425}.status-icon-disabled .status-icon__base,.status-icon-unknown .status-icon__base{fill:#848484}.status-icon-label .status-icon__base{fill:#999}.status-icon__detail{fill:#fff}.status-icon--large{width:48px;height:48px}.status-icon--small{width:12px;height:12px;margin-top:6px;margin-bottom:6px}.status-icon--small .status-icon__detail{display:none}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.icon-changing{width:24px;height:24px;-webkit-animation:rotate 1.5s linear infinite;animation:rotate 1.5s linear infinite}.icon-changing--small{width:12px;height:12px}.icon-spinning{width:24px;height:24px;-webkit-animation:rotate 4s steps(4,end)infinite;animation:rotate 4s steps(4,end)infinite}.icon-spinning--small{width:12px;height:12px}.index{border-right:1px solid #000}.index__items{width:100%}.index__more{padding-top:24px}.index__error{color:#DC442F}.index-header .index-header__count{position:absolute;right:24px;bottom:-25px;padding-left:6px;padding-right:6px;font-size:14px;font-size:.875rem;line-height:1.71429;color:#777;background-color:#fff;text-align:right;white-space:nowrap}.layer,.layer--align-bottom:not(.layer--hidden) .layer__container,.login{bottom:0}.index-header__out-of{margin-left:6px;display:none}@media screen and (min-width:45em){.index-header__out-of--active{display:inline}}.index-filters{padding-left:24px;padding-right:24px}.index-filters__menu{margin-left:24px}.index-filters__filter{margin-bottom:24px}.index-table table{margin-bottom:0}.index-table__header--small{width:48px}.index-table__header--medium{width:192px}.index-tiles.tiles--flush{margin-top:0}.index-tiles.tiles--flush .tile>.header svg{margin-right:12px}.index-tiles.tiles--flush .tile>:not(.header){display:block}.index-tiles.tiles--flush .tile>:not(.index-attribute--medium):not(.header):not(.footer){-webkit-flex:1;flex:1}.index-attribute--secondary{color:#777}a.active>.label .label__icon.control-icon svg{fill:#000;stroke:#000}.layer{position:fixed;top:0;left:0;right:0;overflow:none;z-index:10}.layer__container{position:absolute;background-color:#eee;overflow:none;border-radius:0 5px;max-height:100vh;max-width:100vw}@media screen and (max-width:44.9375em){.label__text{display:none}.layer__container{padding:24px}}.layer__closer{position:absolute;top:24px;right:24px}@media screen and (min-width:45em){.label__icon{display:none}.layer__container{padding:24px 96px}.layer--closeable .layer__container{padding-top:72px;padding-bottom:72px}}.layer--flush .layer__container{padding:0}.layer--align-center:not(.layer--hidden){background-image:radial-gradient(circle at top,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-center:not(.layer--hidden) .layer__container{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layer--align-left:not(.layer--hidden){background-image:radial-gradient(circle at left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-left:not(.layer--hidden) .layer__container{left:0;-webkit-animation:slide-right .2s ease-in-out forwards;animation:slide-right .2s ease-in-out forwards}.layer--align-right:not(.layer--hidden){background-image:radial-gradient(circle at right,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-right:not(.layer--hidden) .layer__container{right:0}.layer--align-top:not(.layer--hidden){background-image:radial-gradient(circle at top left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-top:not(.layer--hidden) .layer__container{top:0;-webkit-animation:slide-down .2s ease-in-out forwards;animation:slide-down .2s ease-in-out forwards}.layer--align-bottom:not(.layer--hidden){background-image:radial-gradient(circle at bottom left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--hidden.layer--align-left{right:auto}.layer--hidden.layer--align-left .layer__container{left:-100vw}@media screen and (min-width:45em){.layer--hidden.layer--peek.layer--align-left{right:auto}.layer--hidden.layer--peek.layer--align-left .layer__container{left:auto;right:-12px;border-right:2px solid #0096D6;-webkit-animation:peek-right .5s ease-in-out alternate 5;animation:peek-right .5s ease-in-out alternate 5}}@-webkit-keyframes peek-right{0%{right:-6px}100%{right:-12px}}@keyframes peek-right{0%{right:-6px}100%{right:-12px}}@-webkit-keyframes slide-right{0%{left:-100vw}100%{left:0}}@keyframes slide-right{0%{left:-100vw}100%{left:0}}@-webkit-keyframes slide-down{0%{top:-100vh}100%{top:0}}@keyframes slide-down{0%{top:-100vh}100%{top:0}}.login{position:absolute;top:0;left:0;right:0;overflow:hidden;z-index:100}.login__background{position:absolute;max-width:none}.login__background--portrait{width:auto;height:100%}.login__background--landscape{height:auto;width:100%}.login__container{position:relative;width:384px;margin:96px auto;animation-name:fadein;animation-duration:.5s}.login-form,.login__container{z-index:1;-webkit-animation-name:fadein;-webkit-animation-duration:.5s}@media screen and (max-width:44.9375em){.login__container{margin:48px 0;width:100%;border-radius:0}}.login__footer{position:absolute;left:0;right:0;bottom:6px;padding:6px 24px;background-color:rgba(255,255,255,.9);text-align:center}.login-form,.map{position:relative}.login-form{width:384px;padding:24px 24px 48px;background-color:#eee;border:1px solid #ccc;border-radius:0 5px;text-align:center;animation-name:fadein;animation-duration:.5s}@media screen and (max-width:44.9375em){.login-form{width:100%;border-radius:0}}.login-form__logo{display:inline-block;width:48px;height:48px;margin-bottom:24px}.login-form fieldset{text-align:left;border:none;margin-bottom:0}.login-form fieldset>*{width:100%;display:block}.login-form__submit{margin-top:24px;width:100%;background-color:#0096D6;color:#fff;font-size:24px;font-size:1.5rem;line-height:inherit}.login-form__error{margin-bottom:12px;color:#DC442F;text-align:left}.login-form__footer{margin-top:12px;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;line-height:36px}.map{padding:24px}.map__canvas{position:absolute;top:0;left:0;z-index:-1;opacity:.1}.map__canvas--highlight{opacity:1}.map__categories{margin:0;list-style-type:none}.map__category{position:relative;padding-top:24px;margin-bottom:12px;max-width:none}.map__category-label{position:absolute;top:0;left:0;font-size:14px;font-size:.875rem;line-height:1.71429}.map__category-items{margin:0;list-style-type:none;overflow:hidden;text-align:center}.menu--inline.menu--left,.menu__layer--align-right .menu__control,.menu__layer--left{text-align:right}.menu__layer,.object{overflow:auto}.map__item{display:inline-block;width:192px;border:1px solid #ccc;margin-right:12px;margin-bottom:12px;background-color:#fff;font-size:18px;font-size:1.125rem;line-height:1.33333}.map__item>a{display:block;padding:6px 12px;transition:background-color .2s}.map__item>a>*,.menu{display:inline-block}.map__item>a:hover{background-color:rgba(0,0,0,.1)}.map__item .status-icon{margin-right:6px}.menu{position:relative}.menu__control--fixed-label .menu__control-icon,.menu__layer .menu__control-drop-icon{display:none}.menu a:not(.button){color:gray}.menu a:not(.button):hover{color:#333}.menu a:not(.button).active{color:#0076a8}.menu:focus:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border:1px solid #99d5ef;box-shadow:0 0 1px 1px #99d5ef;pointer-events:none}.menu__control{cursor:pointer}.menu__control-drop-icon{width:24px;height:24px;margin-left:12px;stroke:#999}@media screen and (max-width:44.9375em){.menu__control--labelled .menu__control-drop-icon,.menu__control--labelled .menu__control-label{display:none}}@media screen and (min-width:45em){.menu__control--labelled .menu__control-icon{display:none}}.menu__layer{position:fixed;z-index:5;font-size:24px;font-size:1.5rem;line-height:inherit;background-color:#fff;border:none;border-radius:0 5px;box-shadow:0 2px 4px rgba(0,0,0,.3)}.menu__layer .menu__control-label{padding-left:24px}.menu__layer a{padding:12px 24px;display:block}.menu__layer a:hover{text-decoration:none;background-color:rgba(0,0,0,.1)}.menu--controlled{display:inline-block;cursor:pointer}.menu--labelled{padding-left:24px;padding-right:24px}.menu--inline.menu--left>*{margin-left:24px;margin-right:0}.menu--inline.menu--left>:first-child{margin-left:0}.menu--inline.menu--right>*{margin-left:0;margin-right:24px}.menu--inline.menu--right>:last-child{margin-right:0}@media screen and (max-width:44.9375em){.menu--inline.menu--down:empty{width:0;margin:0;padding:0}}.menu--inline.menu--small .menu__control-icon svg,.menu--small .menu__control-icon svg,.menu__layer--small .menu__control-icon svg{width:18px;height:18px}[class*=background-color-index-] .menu--inline a,[class*=background-color-index-] .menu--inline a.active,[class*=background-color-index-] .menu--inline a:hover{color:inherit}[class*=background-color-index-] .menu--inline.menu--left a,[class*=background-color-index-] .menu--inline.menu--right a{text-decoration:none}[class*=background-color-index-] .menu--inline.menu--left a:hover:not(.active):not(.button),[class*=background-color-index-] .menu--inline.menu--right a:hover:not(.active):not(.button){text-decoration:underline}.menu--primary>a:not(.button):hover,.title a:hover,[class*=background-color-index-] .menu--inline.menu--down a:hover{text-decoration:none}[class*=background-color-index-] .menu--inline.menu--down a{padding:12px;border:1px solid transparent}[class*=background-color-index-] .menu--inline.menu--down a:hover:not(.active){border-color:rgba(0,0,0,.2)}[class*=background-color-index-] .menu--inline.menu--down a.active{background-color:rgba(0,0,0,.2)}.menu--small{font-size:16px;font-size:1rem;line-height:1.5}.menu--small .menu__control-drop-icon{margin-left:6px}.menu--primary{display:block;max-height:100vh;overflow:auto}.menu--inline.menu--left>*,.menu--inline.menu--right>*,.menu__layer--left>*,.menu__layer--right>*{display:inline-block}.menu--primary>.header:first-child{margin-left:-24px;margin-right:-24px;margin-bottom:24px}.menu--primary>a:not(.button){padding:12px 24px}.menu--primary>a:not(.button):hover:not(.active){background-color:rgba(0,0,0,.1)}.menu--primary>a:not(.button).active{color:#333;background-color:rgba(0,150,214,.2)}.menu--inline.menu--right,.menu__layer--right{text-align:left}.section--centered,.settings{text-align:center}.menu--inline.menu--small,.menu__layer--small{font-size:1em}.menu--inline.menu--small .menu__control-label,.menu__layer--small .menu__control-label{padding:12px}.menu--inline.menu--small a,.menu__layer--small a{padding:6px 12px}.menu--inline.menu--down>*,.menu--inline.menu--up>*,.menu__layer--down>*,.menu__layer--up>*{display:block}.meter,.meter__label{display:inline-block}.menu--inline.menu--down h1,.menu--inline.menu--down h2,.menu--inline.menu--down h3,.menu--inline.menu--down h4,.menu--inline.menu--down h5,.menu--inline.menu--down h6,.menu--inline.menu--up h1,.menu--inline.menu--up h2,.menu--inline.menu--up h3,.menu--inline.menu--up h4,.menu--inline.menu--up h5,.menu--inline.menu--up h6,.menu__layer--down h1,.menu__layer--down h2,.menu__layer--down h3,.menu__layer--down h4,.menu__layer--down h5,.menu__layer--down h6,.menu__layer--up h1,.menu__layer--up h2,.menu__layer--up h3,.menu__layer--up h4,.menu__layer--up h5,.menu__layer--up h6{margin:24px 0 0;padding:12px 0;border-top:1px solid #ccc;min-width:192px}.menu--inline.menu--down h1:first-child,.menu--inline.menu--down h2:first-child,.menu--inline.menu--down h3:first-child,.menu--inline.menu--down h4:first-child,.menu--inline.menu--down h5:first-child,.menu--inline.menu--down h6:first-child,.menu--inline.menu--up h1:first-child,.menu--inline.menu--up h2:first-child,.menu--inline.menu--up h3:first-child,.menu--inline.menu--up h4:first-child,.menu--inline.menu--up h5:first-child,.menu--inline.menu--up h6:first-child,.menu__layer--down h1:first-child,.menu__layer--down h2:first-child,.menu__layer--down h3:first-child,.menu__layer--down h4:first-child,.menu__layer--down h5:first-child,.menu__layer--down h6:first-child,.menu__layer--up h1:first-child,.menu__layer--up h2:first-child,.menu__layer--up h3:first-child,.menu__layer--up h4:first-child,.menu__layer--up h5:first-child,.menu__layer--up h6:first-child{margin-top:0}@-webkit-keyframes draw-meter{0%{stroke-dashoffset:192px}100%{stroke-dashoffset:0}}@keyframes draw-meter{0%{stroke-dashoffset:192px}100%{stroke-dashoffset:0}}.meter__graphic{width:192px;height:24px;background-color:#eee}.notifications-control__icon,.notifications__icon{vertical-align:middle;width:48px;height:48px}.meter__value{stroke:#0096D6;stroke-width:18px;stroke-dasharray:192px 192px;stroke-dashoffset:0;-webkit-animation:draw-meter 1.5s;animation:draw-meter 1.5s}.meter__threshold{stroke:#545454;stroke-width:1px}.meter__label{vertical-align:top;margin-left:12px}.meter__label-units{color:#777;margin-left:.5em}.notifications{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(128,128,128,.6);z-index:10}.notifications__container,.panel{border-bottom:1px solid #ccc;background-color:#fff}.notifications__container{position:absolute;top:0;right:0;min-width:300px;padding:96px 24px 24px;border-left:1px solid #ccc;border-bottom-left-radius:0 5px 0 5px}.notifications__icon{position:absolute;top:24px;right:84px}.object__container{padding:24px}.object ol,.object ul{margin:0;list-style-type:none}.object li{width:auto}.object__attribute{margin-bottom:12px}.object__attribute-name{display:block;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.object__attribute-value{display:block;font-size:18px;font-size:1.125rem;line-height:1.33333}.object__attribute-value ol,.object__attribute-value ul{margin-left:24px;padding-top:24px;padding-bottom:24px}.object__attribute--container>.object__attribute-name{font-weight:700}.object__attribute--unset .object__attribute-value{font-style:italic;color:#777}.object__attribute--array>.object__attribute-value>ol>li:last-child{border-bottom:1px solid #ccc}.object__attribute--array>.object__attribute-value>ol>li>ul{padding-top:0;padding-bottom:0}.panel{padding:24px}.panel:last-of-type{border-bottom:none}.panel__title{text-transform:uppercase;font-weight:400}.panel>a{display:block}.panel a.call-to-action,.radio-button__label,.radio-button__label:before,.search,.search-input,.search__layer-contents{display:inline-block}.panel a.call-to-action{font-size:20px;font-size:1.25rem;line-height:1.2;margin-bottom:24px;text-decoration:none;padding:12px 24px;border-radius:0 5px;color:#fff}.panel--index-1 .panel__title{color:#545454}.panel--index-1 a.call-to-action{background-color:#545454}.panel--index-2 .panel__title{color:#767676}.panel--index-2 a.call-to-action{background-color:#767676}@media screen and (max-width:44.9375em){.panel{padding:24px}.panel>h2{margin-bottom:12px}}.radio-button__input{opacity:0;position:absolute}.radio-button__input:checked+label.radio:after{content:"";position:absolute;top:6px;left:4px;width:16px;height:16px;background-color:#0096D6;border-radius:16px}.radio-button__input:focus+label.checkbox:before{content:"";border-color:#99d5ef;box-shadow:0 0 1px 1px #99d5ef}.radio-button__label{position:relative;user-select:none}.radio-button__label:before{content:"";width:24px;height:24px;margin-right:12px;vertical-align:middle;background-color:inherit;color:#0076a8;border:1px solid #ccc;border-radius:24px;text-align:center}.search:focus{margin:-1px;border:1px solid #99d5ef;box-shadow:0 0 1px 1px #99d5ef}.search-input__layer,.search__layer{z-index:2;box-shadow:0 2px 4px rgba(0,0,0,.3)}.search--controlled,.search__control{cursor:pointer}.search__input{margin-right:0}.header .search__input{padding:0 12px;font-size:inherit}.header .search__input:focus{padding:0 11px}.search__layer{position:fixed;font-size:20px;font-size:1.25rem;line-height:inherit;background-color:#fff;border:none;border-radius:0 5px}.search__layer--inline{margin-left:-1px}.search__layer input{margin-right:0;box-sizing:border-box}.search__layer .search__control{display:inline-block;vertical-align:top}.search__layer .search__suggestion{padding:6px 24px;cursor:pointer}.search__layer .search__suggestion--active,.search__layer .search__suggestion:hover{background-color:rgba(0,0,0,.1)}.search--inline .search__input{width:100%;box-sizing:border-box}.header .search--inline .search__input{padding:0;border:none}.search-input{position:relative}.search-input__input{width:100%;height:100%;display:block;padding-right:60px}.search-input__input:focus{padding-right:59px}.search-input__control{position:absolute;bottom:0;right:12px}.search-input__layer{position:fixed;background-color:#fff;border:none;border-radius:0 0 0 5px}.search-input__layer input[type=search]{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-radius:0}.search-input__layer-suggestion{padding:6px 12px;cursor:pointer}.search-input__layer-suggestion--active,.search-input__layer-suggestion:hover{background-color:rgba(0,0,0,.1)}.search-input--active .search-input__input{border-bottom-left-radius:0;border-bottom-right-radius:0}.section{padding-top:48px;padding-bottom:48px}.section--right .section__content{display:-webkit-flex;display:flex}.section--right .section__content.center-column__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}@media screen and (max-width:44.9375em){.section--right .section__content.center-column__content>.menu:first-child{width:100%}.section--right .section__content.center-column__content>.menu:first-child:empty{width:0;margin:0;padding:0}}.section--right .section__content>.flex-1{-webkit-flex:1;flex:1}.section--right .section__content>.flex-2{-webkit-flex:2;flex:2}.section--right .section__content>.flex-3{-webkit-flex:3;flex:3}.section--right .section__content>.flex-4{-webkit-flex:4;flex:4}@media screen and (min-width:45em){.section--right .section__content>*{margin-right:48px}.section--right .section__content>:last-child{margin-right:0}.section--right .section__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}}@media screen and (max-width:44.9375em){.section--right .section__content{-webkit-flex-direction:column;flex-direction:column}.section--right .section__content>*{margin-bottom:48px;padding-bottom:48px}.section--right .section__content>:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}}.section--compact{padding-top:0;padding-bottom:0}.section--compact .section__content{padding-top:12px;padding-bottom:12px}.section--centered .section__content>*{margin-left:auto;margin-right:auto}.react-gravatar{width:48px;height:48px;border-radius:24px;border:2px solid transparent;margin:0 24px;overflow:hidden;cursor:pointer;transition:all .3s ease-in-out}.table--selectable tbody tr td,.tile--selectable{transition:background-color .2s}.react-gravatar:hover{border-color:#0096D6}.session{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(128,128,128,.6);z-index:10}.session__container{position:absolute;top:0;right:0;min-width:300px;padding:96px 24px 24px;background-color:#fff;border-left:1px solid #ccc;border-bottom:1px solid #ccc;border-bottom-left-radius:0 5px 0 5px}.session .react-gravatar{position:absolute;top:24px;right:24px}.session__actions{margin-top:24px;padding-top:24px}.session a{cursor:pointer}.settings{position:relative}.settings__panels{display:inline-block}.settings__panel{vertical-align:top}.sidebar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100vh;background-color:#fff}@media screen and (max-width:44.9375em){.sidebar{width:100vw}}.sidebar>*{-webkit-flex:1 0;flex:1 0}.sidebar>.footer,.sidebar>.header{-webkit-flex:0 0 auto;flex:0 0 auto}.sidebar--primary{background-image:linear-gradient(to left,#dfdfdf,#f5f5f5 10px);background-color:none}@media screen and (min-width:45em){.sidebar{width:384px}.split{display:-webkit-flex;display:flex;height:100vh}.split>div{-webkit-flex:1 0;flex:1 0;position:relative;height:100vh;overflow:auto}.split>div:first-child:not(:last-of-type){max-width:384px}.split--left>div:last-child,.split--right>div:first-child{-webkit-flex:0 0 auto;flex:0 0 auto}}.tile,.title{overflow:hidden}.table table{width:100%}.table th{font-weight:100;font-size:20px;font-size:1.25rem;line-height:1.2;border-bottom:1px solid #ccc}.table td,.table th{padding:12px;vertical-align:top;text-align:left}.table__more,.tbd{text-align:center}.table td:first-child,.table th:first-child{padding-left:24px}.table td:last-child,.table th:last-child{padding-right:24px}.table__mirror{position:absolute;top:0;left:0;right:0}.table__mirror>thead{position:fixed;background-color:rgba(255,255,255,.9)}@media screen and (max-width:44.9375em){.split>div:not(:last-of-type){display:none}.table__mirror>thead{position:static}}.table__more{margin-top:24px;margin-bottom:24px}.table--selectable tbody tr{cursor:pointer}.table--selectable tbody tr.table__row--selected td{background-color:rgba(0,150,214,.2)}.table--selectable tbody tr:hover:not(.table__row--selected) td{background-color:rgba(0,0,0,.1)}.tbd{padding:96px;font-size:96px;font-size:6rem;line-height:1;background-color:#ccc;color:#fff}.tiles{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;padding:12px}.tiles>.tile{-webkit-flex:0 0 192px;flex:0 0 192px;flex-grow:1}.tiles>.tile--wide{-webkit-flex-basis:100%;flex-basis:100%}.tiles--moreable{position:relative;padding-bottom:48px}.tiles--moreable .tiles__more{position:absolute;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width:45em){.tiles--flush{margin:-24px}.tiles--flush>.tile{-webkit-flex:0 0 168px;flex:0 0 168px;flex-grow:1}}.tiles--small>.tile{-webkit-flex-basis:96px;flex-basis:96px}.tiles--fill{-webkit-align-items:stretch;align-items:stretch;-webkit-align-content:stretch;align-content:stretch}.tiles--fill>.tile{-webkit-flex-grow:1;flex-grow:1}.tile{-webkit-flex:0 0 192px;flex:0 0 192px;flex-grow:1;padding:12px}@media screen and (max-width:44.9375em){.tile{margin:0;border-radius:0}}.tile .status-icon{margin-right:6px}.title,.title img,.title svg:not(.control-icon){margin-right:12px}.tile>.header{margin-bottom:24px}.tile>.header .header__content{border-bottom:none}.tile--selectable{cursor:pointer}.tile--selectable.tile--selected{background-color:rgba(0,150,214,.2)}.tile--selectable:hover:not(.tile--selected){background-color:rgba(0,0,0,.1)}.title{display:inline;text-overflow:ellipsis;font-weight:400}.title a{color:inherit}[class*=background-color-index-] .title a:hover{text-decoration:underline}@media screen and (max-width:44.9375em){.title{font-size:32px;font-size:2rem;line-height:inherit}.title img,.title svg:not(.control-icon){height:24px}}@media screen and (min-width:45em){.title{font-size:24px;font-size:1.5rem;line-height:inherit;font-weight:600}.title img,.title svg:not(.control-icon){height:48px}}.title--interactive:hover{color:#0096D6;cursor:pointer;transition:color .3s}.title--menu .control-icon{margin-left:12px}.title--menu:hover{cursor:pointer}.title--menu:hover .control-icon{stroke:#0096D6}.clearfix:after{content:"";display:table;clear:both} \ No newline at end of file diff --git a/css/grommet.css b/css/grommet.css index c8b2381..363860f 100644 --- a/css/grommet.css +++ b/css/grommet.css @@ -613,39 +613,6 @@ input[type="button"], input[type="submit"] { text-align: center; line-height: inherit; } -input[type="button"], input[type="submit"], button, a.button { - display: inline-block; - padding: 4px 12px; - border: 2px solid #FF856B; - border-radius: 4px; - background-color: inherit; - text-decoration: none; - cursor: pointer; - text-align: center; - outline: none; } - input[type="button"]:hover, input[type="submit"]:hover, button:hover, a.button:hover { - background-color: #eee; - border-color: #FF856B; } - input[type="button"].primary, input[type="submit"].primary, button.primary, a.button.primary { - background-color: #FF856B; - border-color: #FF856B; - color: #fff; } - input[type="button"].primary:hover, input[type="submit"].primary:hover, button.primary:hover, a.button.primary:hover { - background-color: #FF856B; - border-color: #FF856B; } - input[type="button"].call-to-action, input[type="submit"].call-to-action, button.call-to-action, a.button.call-to-action { - font-size: 20px; - font-size: 1.25rem; - line-height: 1.2; - padding: 12px 24px; } - input[type="button"]:focus, input[type="submit"]:focus, button:focus, a.button:focus { - border-color: #70ABC1; - box-shadow: 0 0 1px 1px #70ABC1; } - [class*="background-color-index-"] input[type="button"]:hover, [class*="background-color-index-"] input[type="submit"]:hover, [class*="background-color-index-"] button:hover, [class*="background-color-index-"] a.button:hover { - background-color: #FF856B; - border-color: #FF856B; - text-decoration: none; } - select { border-color: #ccc; padding-right: 24px; @@ -739,10 +706,11 @@ input[type=range] { width: 24px; overflow: visible; } -html, body { - height: 100%; - width: 100%; - overflow: hidden; } +@media screen and (min-width: 45em) { + html, body { + height: 100%; + width: 100%; + overflow: hidden; } } /*------------------------------------*\ #LIST-BARE @@ -766,42 +734,43 @@ html, body { color: #ccc; font-style: italic; } -.app { - position: absolute; - top: 0px; - bottom: 0px; - left: 0px; - right: 0px; - overflow: auto; } - .app--inline { - position: relative; } - .app--centered > .header .header__content, .app--centered > div > .header .header__content { +@media screen and (min-width: 45em) { + .app { + position: absolute; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; + overflow: auto; } } +.app--inline { + position: relative; } +.app--centered > .header .header__content, .app--centered > div > .header .header__content { + width: 100%; + max-width: 960px; + margin-left: auto; + margin-right: auto; } +.app--centered > .footer, .app--centered > div > .footer { + padding-left: 24px; + padding-right: 24px; } + .app--centered > .footer .footer__content, .app--centered > div > .footer .footer__content { width: 100%; max-width: 960px; margin-left: auto; margin-right: auto; } - .app--centered > .footer, .app--centered > div > .footer { - padding-left: 24px; - padding-right: 24px; } - .app--centered > .footer .footer__content, .app--centered > div > .footer .footer__content { - width: 100%; - max-width: 960px; - margin-left: auto; - margin-right: auto; } - .app--centered .document, .app--centered .section { - padding-left: 24px; - padding-right: 24px; } - .app--centered .document__content, .app--centered .section__content { - width: 100%; - max-width: 960px; - margin-left: auto; - margin-right: auto; } - .app--centered .section .document { - padding-left: 0px; - padding-right: 0px; } - .app--centered .section .document__content { - width: auto; - max-width: none; } +.app--centered .document, .app--centered .section { + padding-left: 24px; + padding-right: 24px; } + .app--centered .document__content, .app--centered .section__content { + width: 100%; + max-width: 960px; + margin-left: auto; + margin-right: auto; } +.app--centered .section .document { + padding-left: 0px; + padding-right: 0px; } + .app--centered .section .document__content { + width: auto; + max-width: none; } .attribute { padding: 24px 24px 12px; } @@ -822,6 +791,108 @@ html, body { line-height: 24px; color: #777; } +input[type="button"], input[type="submit"], button, a.button { + height: 48px; + padding: 10px 46px; + background-color: transparent; + border: 2px solid #818181; + border-radius: 4px; + color: #333; + font-size: 18px; + font-size: 1.125rem; + line-height: 24px; + text-transform: none; + font-weight: inherit; + text-decoration: none; + cursor: pointer; + text-align: center; + outline: none; } + +.button { + height: 48px; + padding: 10px 46px; + background-color: transparent; + border: 2px solid #818181; + border-radius: 4px; + color: #333; + font-size: 18px; + font-size: 1.125rem; + line-height: 24px; + text-transform: none; + font-weight: inherit; + text-decoration: none; + cursor: pointer; + text-align: center; + outline: none; } + .button:hover { + border-width: 3px; + padding: 9px 45px; } + .button:active { + border-color: #5b5b5b; + background-color: #5b5b5b; + color: #fff; } + .button:focus { + border-color: #70ABC1; + box-shadow: 0 0 1px 1px #70ABC1; } + .button--strong { + background-color: #818181; } + .button--primary { + border-color: #FF856B; } + .button--primary.button--strong { + background-color: #FF856B; + color: #fff; } + .button--primary:active, .button--primary.button--strong:active { + border-color: #ff461f; + background-color: #ff461f; } + .button--alternate { + border-color: #70ABC1; } + .button--alternate.button--strong { + background-color: #70ABC1; } + .button--alternate:active, .button--alternate.button--strong:active { + border-color: #45879f; + background-color: #45879f; } + .button--large { + height: 72px; + padding: 22px 46px; } + .button--large:hover { + padding: 21px 45px; } + .button--small { + border: none; + height: 24px; + padding: 0px 12px; + font-size: 16px; + font-size: 1rem; + line-height: 24px; + color: #FF8706; + text-transform: none; + font-weight: normal; } + .button--small:hover { + border-width: 0px; + padding: 0px 12px; } + .button--disabled { + opacity: 0.2; + border-color: #CBCBCB; + background-color: #CBCBCB; + cursor: default; } + .button--disabled:active { + color: #333; + border-color: #CBCBCB; + background-color: #CBCBCB; } + +@-webkit-keyframes reveal-chart { + 0% { + opacity: 0; } + + 100% { + opacity: 1; } } + +@keyframes reveal-chart { + 0% { + opacity: 0; } + + 100% { + opacity: 1; } } + .chart { position: relative; display: block; } @@ -831,8 +902,16 @@ html, body { width: 100%; height: 384px; max-height: calc(100vh - 144px); } + @media screen and (min-width: 45em) { + .chart__values g { + -webkit-animation: reveal-chart 1.5s; + animation: reveal-chart 1.5s; } } .chart__values-line { stroke-width: 3px; } + .chart__values-line.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } .chart__values-line.color-index-unset { stroke: #ddd; } .chart__values-line.color-index-error { @@ -863,6 +942,42 @@ html, body { stroke: #434343; } .chart__values-line.color-index-grey-4, .chart__values-line.color-index-grey-8 { stroke: #666666; } + .chart__values--loading { + stroke-width: 24px; } + .chart__values--loading.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } + .chart__values--loading.color-index-unset { + stroke: #ddd; } + .chart__values--loading.color-index-error { + stroke: #FF856B; } + .chart__values--loading.color-index-warning { + stroke: #FFB86B; } + .chart__values--loading.color-index-ok { + stroke: #4EB976; } + .chart__values--loading.color-index-unknown { + stroke: #a8a8a8; } + .chart__values--loading.color-index-disabled { + stroke: #a8a8a8; } + .chart__values--loading.color-index-graph-1, .chart__values--loading.color-index-graph-6 { + stroke: #70ABC1; } + .chart__values--loading.color-index-graph-2, .chart__values--loading.color-index-graph-7 { + stroke: #FFCA90; } + .chart__values--loading.color-index-graph-3, .chart__values--loading.color-index-graph-8 { + stroke: #2E738E; } + .chart__values--loading.color-index-graph-4, .chart__values--loading.color-index-graph-9 { + stroke: #E29643; } + .chart__values--loading.color-index-graph-5, .chart__values--loading.color-index-graph-10 { + stroke: #767676; } + .chart__values--loading.color-index-grey-1, .chart__values--loading.color-index-grey-5 { + stroke: #333333; } + .chart__values--loading.color-index-grey-2, .chart__values--loading.color-index-grey-6 { + stroke: #3B3B3B; } + .chart__values--loading.color-index-grey-3, .chart__values--loading.color-index-grey-7 { + stroke: #434343; } + .chart__values--loading.color-index-grey-4, .chart__values--loading.color-index-grey-8 { + stroke: #666666; } .chart__threshold { stroke-width: 1px; stroke: #333333; } @@ -890,51 +1005,81 @@ html, body { background-color: rgba(255, 255, 255, 0.8); } } .chart--area .chart__gradient.color-index-error .begin, .chart--bar .chart__gradient.color-index-error .begin { stop-color: #FF856B; } + .chart--area .chart__gradient.color-index-error .mid, .chart--bar .chart__gradient.color-index-error .mid { + stop-color: #FF856B; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-error .end, .chart--bar .chart__gradient.color-index-error .end { stop-color: #FF856B; stop-opacity: 0; } .chart--area .chart__gradient.color-index-warning .begin, .chart--bar .chart__gradient.color-index-warning .begin { stop-color: #FFB86B; } + .chart--area .chart__gradient.color-index-warning .mid, .chart--bar .chart__gradient.color-index-warning .mid { + stop-color: #FFB86B; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-warning .end, .chart--bar .chart__gradient.color-index-warning .end { stop-color: #FFB86B; stop-opacity: 0; } .chart--area .chart__gradient.color-index-ok .begin, .chart--bar .chart__gradient.color-index-ok .begin { stop-color: #4EB976; } + .chart--area .chart__gradient.color-index-ok .mid, .chart--bar .chart__gradient.color-index-ok .mid { + stop-color: #4EB976; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-ok .end, .chart--bar .chart__gradient.color-index-ok .end { stop-color: #4EB976; stop-opacity: 0; } .chart--area .chart__gradient.color-index-unknown .begin, .chart--bar .chart__gradient.color-index-unknown .begin { stop-color: #a8a8a8; } + .chart--area .chart__gradient.color-index-unknown .mid, .chart--bar .chart__gradient.color-index-unknown .mid { + stop-color: #a8a8a8; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-unknown .end, .chart--bar .chart__gradient.color-index-unknown .end { stop-color: #a8a8a8; stop-opacity: 0; } .chart--area .chart__gradient.color-index-disabled .begin, .chart--bar .chart__gradient.color-index-disabled .begin { stop-color: #a8a8a8; } + .chart--area .chart__gradient.color-index-disabled .mid, .chart--bar .chart__gradient.color-index-disabled .mid { + stop-color: #a8a8a8; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-disabled .end, .chart--bar .chart__gradient.color-index-disabled .end { stop-color: #a8a8a8; stop-opacity: 0; } .chart--area .chart__gradient.color-index-graph-1 .begin, .chart--area .chart__gradient.color-index-graph-6 .begin, .chart--bar .chart__gradient.color-index-graph-1 .begin, .chart--bar .chart__gradient.color-index-graph-6 .begin { stop-color: #70ABC1; } + .chart--area .chart__gradient.color-index-graph-1 .mid, .chart--area .chart__gradient.color-index-graph-6 .mid, .chart--bar .chart__gradient.color-index-graph-1 .mid, .chart--bar .chart__gradient.color-index-graph-6 .mid { + stop-color: #70ABC1; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-graph-1 .end, .chart--area .chart__gradient.color-index-graph-6 .end, .chart--bar .chart__gradient.color-index-graph-1 .end, .chart--bar .chart__gradient.color-index-graph-6 .end { stop-color: #70ABC1; stop-opacity: 0; } .chart--area .chart__gradient.color-index-graph-2 .begin, .chart--area .chart__gradient.color-index-graph-7 .begin, .chart--bar .chart__gradient.color-index-graph-2 .begin, .chart--bar .chart__gradient.color-index-graph-7 .begin { stop-color: #FFCA90; } + .chart--area .chart__gradient.color-index-graph-2 .mid, .chart--area .chart__gradient.color-index-graph-7 .mid, .chart--bar .chart__gradient.color-index-graph-2 .mid, .chart--bar .chart__gradient.color-index-graph-7 .mid { + stop-color: #FFCA90; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-graph-2 .end, .chart--area .chart__gradient.color-index-graph-7 .end, .chart--bar .chart__gradient.color-index-graph-2 .end, .chart--bar .chart__gradient.color-index-graph-7 .end { stop-color: #FFCA90; stop-opacity: 0; } .chart--area .chart__gradient.color-index-graph-3 .begin, .chart--area .chart__gradient.color-index-graph-8 .begin, .chart--bar .chart__gradient.color-index-graph-3 .begin, .chart--bar .chart__gradient.color-index-graph-8 .begin { stop-color: #2E738E; } + .chart--area .chart__gradient.color-index-graph-3 .mid, .chart--area .chart__gradient.color-index-graph-8 .mid, .chart--bar .chart__gradient.color-index-graph-3 .mid, .chart--bar .chart__gradient.color-index-graph-8 .mid { + stop-color: #2E738E; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-graph-3 .end, .chart--area .chart__gradient.color-index-graph-8 .end, .chart--bar .chart__gradient.color-index-graph-3 .end, .chart--bar .chart__gradient.color-index-graph-8 .end { stop-color: #2E738E; stop-opacity: 0; } .chart--area .chart__gradient.color-index-graph-4 .begin, .chart--area .chart__gradient.color-index-graph-9 .begin, .chart--bar .chart__gradient.color-index-graph-4 .begin, .chart--bar .chart__gradient.color-index-graph-9 .begin { stop-color: #E29643; } + .chart--area .chart__gradient.color-index-graph-4 .mid, .chart--area .chart__gradient.color-index-graph-9 .mid, .chart--bar .chart__gradient.color-index-graph-4 .mid, .chart--bar .chart__gradient.color-index-graph-9 .mid { + stop-color: #E29643; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-graph-4 .end, .chart--area .chart__gradient.color-index-graph-9 .end, .chart--bar .chart__gradient.color-index-graph-4 .end, .chart--bar .chart__gradient.color-index-graph-9 .end { stop-color: #E29643; stop-opacity: 0; } .chart--area .chart__gradient.color-index-graph-5 .begin, .chart--area .chart__gradient.color-index-graph-10 .begin, .chart--bar .chart__gradient.color-index-graph-5 .begin, .chart--bar .chart__gradient.color-index-graph-10 .begin { stop-color: #767676; } + .chart--area .chart__gradient.color-index-graph-5 .mid, .chart--area .chart__gradient.color-index-graph-10 .mid, .chart--bar .chart__gradient.color-index-graph-5 .mid, .chart--bar .chart__gradient.color-index-graph-10 .mid { + stop-color: #767676; + stop-opacity: 0.5; } .chart--area .chart__gradient.color-index-graph-5 .end, .chart--area .chart__gradient.color-index-graph-10 .end, .chart--bar .chart__gradient.color-index-graph-5 .end, .chart--bar .chart__gradient.color-index-graph-10 .end { stop-color: #767676; stop-opacity: 0; } @@ -1079,6 +1224,86 @@ html, body { .dashboard { height: calc(100vh - 48px); } } +.distribution { + position: relative; + display: block; } + .distribution__graphic { + width: 100%; + height: 384px; + max-height: calc(100vh - 144px); } + .distribution__box.color-index-unset { + fill: #ddd; } + .distribution__box.color-index-error { + fill: #FF856B; } + .distribution__box.color-index-warning { + fill: #FFB86B; } + .distribution__box.color-index-ok { + fill: #4EB976; } + .distribution__box.color-index-unknown { + fill: #a8a8a8; } + .distribution__box.color-index-disabled { + fill: #a8a8a8; } + .distribution__box.color-index-graph-1, .distribution__box.color-index-graph-6 { + fill: #70ABC1; } + .distribution__box.color-index-graph-2, .distribution__box.color-index-graph-7 { + fill: #FFCA90; } + .distribution__box.color-index-graph-3, .distribution__box.color-index-graph-8 { + fill: #2E738E; } + .distribution__box.color-index-graph-4, .distribution__box.color-index-graph-9 { + fill: #E29643; } + .distribution__box.color-index-graph-5, .distribution__box.color-index-graph-10 { + fill: #767676; } + .distribution__box.color-index-grey-1, .distribution__box.color-index-grey-5 { + fill: #333333; } + .distribution__box.color-index-grey-2, .distribution__box.color-index-grey-6 { + fill: #3B3B3B; } + .distribution__box.color-index-grey-3, .distribution__box.color-index-grey-7 { + fill: #434343; } + .distribution__box.color-index-grey-4, .distribution__box.color-index-grey-8 { + fill: #666666; } + .distribution__box-label { + fill: rgba(255, 255, 255, 0.8); } + .distribution__loading-indicator { + stroke-width: 24px; } + .distribution__loading-indicator.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } + .distribution__loading-indicator.color-index-unset { + stroke: #ddd; } + .distribution__loading-indicator.color-index-error { + stroke: #FF856B; } + .distribution__loading-indicator.color-index-warning { + stroke: #FFB86B; } + .distribution__loading-indicator.color-index-ok { + stroke: #4EB976; } + .distribution__loading-indicator.color-index-unknown { + stroke: #a8a8a8; } + .distribution__loading-indicator.color-index-disabled { + stroke: #a8a8a8; } + .distribution__loading-indicator.color-index-graph-1, .distribution__loading-indicator.color-index-graph-6 { + stroke: #70ABC1; } + .distribution__loading-indicator.color-index-graph-2, .distribution__loading-indicator.color-index-graph-7 { + stroke: #FFCA90; } + .distribution__loading-indicator.color-index-graph-3, .distribution__loading-indicator.color-index-graph-8 { + stroke: #2E738E; } + .distribution__loading-indicator.color-index-graph-4, .distribution__loading-indicator.color-index-graph-9 { + stroke: #E29643; } + .distribution__loading-indicator.color-index-graph-5, .distribution__loading-indicator.color-index-graph-10 { + stroke: #767676; } + .distribution__loading-indicator.color-index-grey-1, .distribution__loading-indicator.color-index-grey-5 { + stroke: #333333; } + .distribution__loading-indicator.color-index-grey-2, .distribution__loading-indicator.color-index-grey-6 { + stroke: #3B3B3B; } + .distribution__loading-indicator.color-index-grey-3, .distribution__loading-indicator.color-index-grey-7 { + stroke: #434343; } + .distribution__loading-indicator.color-index-grey-4, .distribution__loading-indicator.color-index-grey-8 { + stroke: #666666; } + .distribution--small .distribution__graphic { + height: 192px; } + .distribution--large .distribution__graphic { + height: 576px; } + .document { width: 100%; } .document--no-contents .document__content { @@ -1095,6 +1320,16 @@ html, body { @media screen and (max-width: 44.9375em) { .document section > img, .document header > img { max-width: 100%; } } + .document section > iframe, .document header > iframe { + width: 100%; + max-width: 576px; + height: 400px; } + @media screen and (max-width: 44.9375em) { + .document section > iframe, .document header > iframe { + height: 250px; } } + @media screen and (min-width: 45em) and (max-width: 63.9375em) { + .document section > iframe, .document header > iframe { + height: 250px; } } @media screen and (max-width: 44.9375em) { .document section > ol, .document section > ul, .document header > ol, .document header > ul { padding-left: 24px; @@ -1170,6 +1405,10 @@ html, body { fill: none; cursor: pointer; stroke: #eee; } + .donut__slice.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } .donut__slice.color-index-unset { stroke: #ddd; } .donut__slice.color-index-error { @@ -1341,11 +1580,6 @@ html, body { @media screen and (min-width: 45em) and (max-width: 63.9375em) { .footer__content > *:last-child { text-align: left; } } - .footer__content button, .footer__content a.button, .footer__content input[type="submit"], .footer__content input[type="button"] { - font-size: 24px; - font-size: 1.5rem; - line-height: inherit; - min-width: 96px; } .footer--primary { height: auto; padding: 24px; } @@ -1872,7 +2106,7 @@ a.active > .label .label__icon.control-icon svg { .layer--hidden.layer--peek.layer--align-left .layer__container { left: auto; right: -12px; - border-right: 2px solid #FF856B; + border-right: 10px solid #FF856B; -webkit-animation: peek-right 0.5s ease-in-out alternate 5; animation: peek-right 0.5s ease-in-out alternate 5; } } @@ -2013,6 +2247,10 @@ a.active > .label .label__icon.control-icon svg { margin-top: 6px; margin-right: 12px; overflow: visible; } + .legend__item svg.legend__item-swatch.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } .legend__item svg.legend__item-swatch.color-index-unset { stroke: #ddd; } .legend__item svg.legend__item-swatch.color-index-error { @@ -2139,12 +2377,7 @@ a.active > .label .label__icon.control-icon svg { display: block; } .login-form__submit { margin-top: 24px; - width: 100%; - background-color: #FF856B; - color: #fff; - font-size: 24px; - font-size: 1.5rem; - line-height: inherit; } + width: 100%; } .login-form__error { margin-bottom: 12px; color: #FF856B; @@ -2268,6 +2501,8 @@ a.active > .label .label__icon.control-icon svg { .menu__layer a:hover { text-decoration: none; background-color: rgba(0, 0, 0, 0.1); } + .menu__layer > .check-box, .menu__layer > .radio-button { + margin: 12px 24px; } .menu__layer--align-right .menu__control { text-align: right; } .menu--controlled { @@ -2380,6 +2615,12 @@ a.active > .label .label__icon.control-icon svg { position: relative; } .meter__threshold { stroke: #333333; } + .meter__active-graphic { + position: relative; } + .meter__labeled-graphic { + white-space: normal; } + .meter__labels-container { + display: block; } .meter__labels { display: -webkit-flex; display: flex; @@ -2392,142 +2633,213 @@ a.active > .label .label__icon.control-icon svg { flex: 1; } .meter__label-max { text-align: right; } + .meter--bar .meter__labeled-graphic { + display: inline-block; } .meter--bar .meter__graphic { width: 192px; height: 24px; } .meter--bar .meter__bar { - stroke-width: 24px; stroke-linecap: butt; stroke-dasharray: 768px 768px; stroke-dashoffset: 0; } - .meter--bar .meter__bar.color-index-unset { + .meter--bar .meter__values .meter__bar { + stroke-width: 24px; } + .meter--bar .meter__values .meter__bar.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } + .meter--bar .meter__values .meter__bar.color-index-unset { stroke: #ddd; } - .meter--bar .meter__bar.color-index-error { + .meter--bar .meter__values .meter__bar.color-index-error { stroke: #FF856B; } - .meter--bar .meter__bar.color-index-warning { + .meter--bar .meter__values .meter__bar.color-index-warning { stroke: #FFB86B; } - .meter--bar .meter__bar.color-index-ok { + .meter--bar .meter__values .meter__bar.color-index-ok { stroke: #4EB976; } - .meter--bar .meter__bar.color-index-unknown { + .meter--bar .meter__values .meter__bar.color-index-unknown { stroke: #a8a8a8; } - .meter--bar .meter__bar.color-index-disabled { + .meter--bar .meter__values .meter__bar.color-index-disabled { stroke: #a8a8a8; } - .meter--bar .meter__bar.color-index-graph-1, .meter--bar .meter__bar.color-index-graph-6 { + .meter--bar .meter__values .meter__bar.color-index-graph-1, .meter--bar .meter__values .meter__bar.color-index-graph-6 { stroke: #70ABC1; } - .meter--bar .meter__bar.color-index-graph-2, .meter--bar .meter__bar.color-index-graph-7 { + .meter--bar .meter__values .meter__bar.color-index-graph-2, .meter--bar .meter__values .meter__bar.color-index-graph-7 { stroke: #FFCA90; } - .meter--bar .meter__bar.color-index-graph-3, .meter--bar .meter__bar.color-index-graph-8 { + .meter--bar .meter__values .meter__bar.color-index-graph-3, .meter--bar .meter__values .meter__bar.color-index-graph-8 { stroke: #2E738E; } - .meter--bar .meter__bar.color-index-graph-4, .meter--bar .meter__bar.color-index-graph-9 { + .meter--bar .meter__values .meter__bar.color-index-graph-4, .meter--bar .meter__values .meter__bar.color-index-graph-9 { stroke: #E29643; } - .meter--bar .meter__bar.color-index-graph-5, .meter--bar .meter__bar.color-index-graph-10 { + .meter--bar .meter__values .meter__bar.color-index-graph-5, .meter--bar .meter__values .meter__bar.color-index-graph-10 { stroke: #767676; } - .meter--bar .meter__bar.color-index-grey-1, .meter--bar .meter__bar.color-index-grey-5 { + .meter--bar .meter__values .meter__bar.color-index-grey-1, .meter--bar .meter__values .meter__bar.color-index-grey-5 { stroke: #333333; } - .meter--bar .meter__bar.color-index-grey-2, .meter--bar .meter__bar.color-index-grey-6 { + .meter--bar .meter__values .meter__bar.color-index-grey-2, .meter--bar .meter__values .meter__bar.color-index-grey-6 { stroke: #3B3B3B; } - .meter--bar .meter__bar.color-index-grey-3, .meter--bar .meter__bar.color-index-grey-7 { + .meter--bar .meter__values .meter__bar.color-index-grey-3, .meter--bar .meter__values .meter__bar.color-index-grey-7 { stroke: #434343; } - .meter--bar .meter__bar.color-index-grey-4, .meter--bar .meter__bar.color-index-grey-8 { + .meter--bar .meter__values .meter__bar.color-index-grey-4, .meter--bar .meter__values .meter__bar.color-index-grey-8 { stroke: #666666; } @media screen and (min-width: 45em) { - .meter--bar .meter__bar { + .meter--bar .meter__values .meter__bar { -webkit-animation: draw-meter 1.5s; animation: draw-meter 1.5s; } } + .meter--bar .meter__thresholds .meter__bar { + stroke-width: 12px; } + .meter--bar .meter__thresholds .meter__bar.color-index-unset { + stroke: rgba(221, 221, 221, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-error { + stroke: rgba(255, 133, 107, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-warning { + stroke: rgba(255, 184, 107, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-ok { + stroke: rgba(78, 185, 118, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-unknown { + stroke: rgba(168, 168, 168, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-disabled { + stroke: rgba(168, 168, 168, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-graph-1, .meter--bar .meter__thresholds .meter__bar.color-index-graph-6 { + stroke: rgba(112, 171, 193, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-graph-2, .meter--bar .meter__thresholds .meter__bar.color-index-graph-7 { + stroke: rgba(255, 202, 144, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-graph-3, .meter--bar .meter__thresholds .meter__bar.color-index-graph-8 { + stroke: rgba(46, 115, 142, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-graph-4, .meter--bar .meter__thresholds .meter__bar.color-index-graph-9 { + stroke: rgba(226, 150, 67, 0.5); } + .meter--bar .meter__thresholds .meter__bar.color-index-graph-5, .meter--bar .meter__thresholds .meter__bar.color-index-graph-10 { + stroke: rgba(118, 118, 118, 0.5); } .meter--bar .meter__threshold { stroke-width: 1; } .meter--bar .meter__active { display: inline-block; vertical-align: top; - margin-left: 12px; } + margin-left: 12px; + font-size: 24px; + font-size: 1.5rem; + line-height: 1; } .meter--bar .meter__active-units { color: #777; margin-left: 0.5em; } - .meter--bar .meter__labels { + .meter--bar .meter__labels-container { width: 192px; } @media screen and (max-width: 44.9375em) { .meter--circle, .meter--arc { width: 192px; margin: 0px auto; } } .meter--circle svg.meter__graphic, .meter--arc svg.meter__graphic { + display: block; width: 192px; height: 192px; } .meter--circle .meter.series-pre path, .meter--arc .meter.series-pre path { stroke-dashoffset: 768px; } .meter--circle .meter__slice, .meter--arc .meter__slice { - stroke-width: 24px; stroke-linecap: butt; stroke-dasharray: 768px 768px; stroke-dashoffset: 0; fill: none; cursor: pointer; stroke: #eee; } - .meter--circle .meter__slice.color-index-unset, .meter--arc .meter__slice.color-index-unset { + .meter--circle .meter__slice-indicator, .meter--arc .meter__slice-indicator { + stroke-linecap: round; + stroke-width: 3; } + .meter--circle .meter__slice-indicator.color-index-loading, .meter--arc .meter__slice-indicator.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } + .meter--circle .meter__slice-indicator.color-index-unset, .meter--arc .meter__slice-indicator.color-index-unset { + stroke: #ddd; } + .meter--circle .meter__slice-indicator.color-index-error, .meter--arc .meter__slice-indicator.color-index-error { + stroke: #FF856B; } + .meter--circle .meter__slice-indicator.color-index-warning, .meter--arc .meter__slice-indicator.color-index-warning { + stroke: #FFB86B; } + .meter--circle .meter__slice-indicator.color-index-ok, .meter--arc .meter__slice-indicator.color-index-ok { + stroke: #4EB976; } + .meter--circle .meter__slice-indicator.color-index-unknown, .meter--arc .meter__slice-indicator.color-index-unknown { + stroke: #a8a8a8; } + .meter--circle .meter__slice-indicator.color-index-disabled, .meter--arc .meter__slice-indicator.color-index-disabled { + stroke: #a8a8a8; } + .meter--circle .meter__slice-indicator.color-index-graph-1, .meter--circle .meter__slice-indicator.color-index-graph-6, .meter--arc .meter__slice-indicator.color-index-graph-1, .meter--arc .meter__slice-indicator.color-index-graph-6 { + stroke: #70ABC1; } + .meter--circle .meter__slice-indicator.color-index-graph-2, .meter--circle .meter__slice-indicator.color-index-graph-7, .meter--arc .meter__slice-indicator.color-index-graph-2, .meter--arc .meter__slice-indicator.color-index-graph-7 { + stroke: #FFCA90; } + .meter--circle .meter__slice-indicator.color-index-graph-3, .meter--circle .meter__slice-indicator.color-index-graph-8, .meter--arc .meter__slice-indicator.color-index-graph-3, .meter--arc .meter__slice-indicator.color-index-graph-8 { + stroke: #2E738E; } + .meter--circle .meter__slice-indicator.color-index-graph-4, .meter--circle .meter__slice-indicator.color-index-graph-9, .meter--arc .meter__slice-indicator.color-index-graph-4, .meter--arc .meter__slice-indicator.color-index-graph-9 { + stroke: #E29643; } + .meter--circle .meter__slice-indicator.color-index-graph-5, .meter--circle .meter__slice-indicator.color-index-graph-10, .meter--arc .meter__slice-indicator.color-index-graph-5, .meter--arc .meter__slice-indicator.color-index-graph-10 { + stroke: #767676; } + .meter--circle .meter__slice-indicator.color-index-grey-1, .meter--circle .meter__slice-indicator.color-index-grey-5, .meter--arc .meter__slice-indicator.color-index-grey-1, .meter--arc .meter__slice-indicator.color-index-grey-5 { + stroke: #333333; } + .meter--circle .meter__slice-indicator.color-index-grey-2, .meter--circle .meter__slice-indicator.color-index-grey-6, .meter--arc .meter__slice-indicator.color-index-grey-2, .meter--arc .meter__slice-indicator.color-index-grey-6 { + stroke: #3B3B3B; } + .meter--circle .meter__slice-indicator.color-index-grey-3, .meter--circle .meter__slice-indicator.color-index-grey-7, .meter--arc .meter__slice-indicator.color-index-grey-3, .meter--arc .meter__slice-indicator.color-index-grey-7 { + stroke: #434343; } + .meter--circle .meter__slice-indicator.color-index-grey-4, .meter--circle .meter__slice-indicator.color-index-grey-8, .meter--arc .meter__slice-indicator.color-index-grey-4, .meter--arc .meter__slice-indicator.color-index-grey-8 { + stroke: #666666; } + .meter--circle .meter__slice--active, .meter--arc .meter__slice--active { + stroke-width: 24px; } + .meter--circle .meter__values .meter__slice, .meter--arc .meter__values .meter__slice { + stroke-width: 24px; } + .meter--circle .meter__values .meter__slice.color-index-loading, .meter--arc .meter__values .meter__slice.color-index-loading { + stroke: #ddd; + stroke-dasharray: 1px 10px; + stroke-dashoffset: 0; } + .meter--circle .meter__values .meter__slice.color-index-unset, .meter--arc .meter__values .meter__slice.color-index-unset { stroke: #ddd; } - .meter--circle .meter__slice.color-index-error, .meter--arc .meter__slice.color-index-error { + .meter--circle .meter__values .meter__slice.color-index-error, .meter--arc .meter__values .meter__slice.color-index-error { stroke: #FF856B; } - .meter--circle .meter__slice.color-index-warning, .meter--arc .meter__slice.color-index-warning { + .meter--circle .meter__values .meter__slice.color-index-warning, .meter--arc .meter__values .meter__slice.color-index-warning { stroke: #FFB86B; } - .meter--circle .meter__slice.color-index-ok, .meter--arc .meter__slice.color-index-ok { + .meter--circle .meter__values .meter__slice.color-index-ok, .meter--arc .meter__values .meter__slice.color-index-ok { stroke: #4EB976; } - .meter--circle .meter__slice.color-index-unknown, .meter--arc .meter__slice.color-index-unknown { + .meter--circle .meter__values .meter__slice.color-index-unknown, .meter--arc .meter__values .meter__slice.color-index-unknown { stroke: #a8a8a8; } - .meter--circle .meter__slice.color-index-disabled, .meter--arc .meter__slice.color-index-disabled { + .meter--circle .meter__values .meter__slice.color-index-disabled, .meter--arc .meter__values .meter__slice.color-index-disabled { stroke: #a8a8a8; } - .meter--circle .meter__slice.color-index-graph-1, .meter--circle .meter__slice.color-index-graph-6, .meter--arc .meter__slice.color-index-graph-1, .meter--arc .meter__slice.color-index-graph-6 { + .meter--circle .meter__values .meter__slice.color-index-graph-1, .meter--circle .meter__values .meter__slice.color-index-graph-6, .meter--arc .meter__values .meter__slice.color-index-graph-1, .meter--arc .meter__values .meter__slice.color-index-graph-6 { stroke: #70ABC1; } - .meter--circle .meter__slice.color-index-graph-2, .meter--circle .meter__slice.color-index-graph-7, .meter--arc .meter__slice.color-index-graph-2, .meter--arc .meter__slice.color-index-graph-7 { + .meter--circle .meter__values .meter__slice.color-index-graph-2, .meter--circle .meter__values .meter__slice.color-index-graph-7, .meter--arc .meter__values .meter__slice.color-index-graph-2, .meter--arc .meter__values .meter__slice.color-index-graph-7 { stroke: #FFCA90; } - .meter--circle .meter__slice.color-index-graph-3, .meter--circle .meter__slice.color-index-graph-8, .meter--arc .meter__slice.color-index-graph-3, .meter--arc .meter__slice.color-index-graph-8 { + .meter--circle .meter__values .meter__slice.color-index-graph-3, .meter--circle .meter__values .meter__slice.color-index-graph-8, .meter--arc .meter__values .meter__slice.color-index-graph-3, .meter--arc .meter__values .meter__slice.color-index-graph-8 { stroke: #2E738E; } - .meter--circle .meter__slice.color-index-graph-4, .meter--circle .meter__slice.color-index-graph-9, .meter--arc .meter__slice.color-index-graph-4, .meter--arc .meter__slice.color-index-graph-9 { + .meter--circle .meter__values .meter__slice.color-index-graph-4, .meter--circle .meter__values .meter__slice.color-index-graph-9, .meter--arc .meter__values .meter__slice.color-index-graph-4, .meter--arc .meter__values .meter__slice.color-index-graph-9 { stroke: #E29643; } - .meter--circle .meter__slice.color-index-graph-5, .meter--circle .meter__slice.color-index-graph-10, .meter--arc .meter__slice.color-index-graph-5, .meter--arc .meter__slice.color-index-graph-10 { + .meter--circle .meter__values .meter__slice.color-index-graph-5, .meter--circle .meter__values .meter__slice.color-index-graph-10, .meter--arc .meter__values .meter__slice.color-index-graph-5, .meter--arc .meter__values .meter__slice.color-index-graph-10 { stroke: #767676; } - .meter--circle .meter__slice.color-index-grey-1, .meter--circle .meter__slice.color-index-grey-5, .meter--arc .meter__slice.color-index-grey-1, .meter--arc .meter__slice.color-index-grey-5 { + .meter--circle .meter__values .meter__slice.color-index-grey-1, .meter--circle .meter__values .meter__slice.color-index-grey-5, .meter--arc .meter__values .meter__slice.color-index-grey-1, .meter--arc .meter__values .meter__slice.color-index-grey-5 { stroke: #333333; } - .meter--circle .meter__slice.color-index-grey-2, .meter--circle .meter__slice.color-index-grey-6, .meter--arc .meter__slice.color-index-grey-2, .meter--arc .meter__slice.color-index-grey-6 { + .meter--circle .meter__values .meter__slice.color-index-grey-2, .meter--circle .meter__values .meter__slice.color-index-grey-6, .meter--arc .meter__values .meter__slice.color-index-grey-2, .meter--arc .meter__values .meter__slice.color-index-grey-6 { stroke: #3B3B3B; } - .meter--circle .meter__slice.color-index-grey-3, .meter--circle .meter__slice.color-index-grey-7, .meter--arc .meter__slice.color-index-grey-3, .meter--arc .meter__slice.color-index-grey-7 { + .meter--circle .meter__values .meter__slice.color-index-grey-3, .meter--circle .meter__values .meter__slice.color-index-grey-7, .meter--arc .meter__values .meter__slice.color-index-grey-3, .meter--arc .meter__values .meter__slice.color-index-grey-7 { stroke: #434343; } - .meter--circle .meter__slice.color-index-grey-4, .meter--circle .meter__slice.color-index-grey-8, .meter--arc .meter__slice.color-index-grey-4, .meter--arc .meter__slice.color-index-grey-8 { + .meter--circle .meter__values .meter__slice.color-index-grey-4, .meter--circle .meter__values .meter__slice.color-index-grey-8, .meter--arc .meter__values .meter__slice.color-index-grey-4, .meter--arc .meter__values .meter__slice.color-index-grey-8 { stroke: #666666; } @media screen and (min-width: 45em) { - .meter--circle .meter__slice, .meter--arc .meter__slice { + .meter--circle .meter__values .meter__slice, .meter--arc .meter__values .meter__slice { -webkit-animation: draw-stroke 3s; animation: draw-stroke 3s; } } - .meter--circle .meter__slice-indicator.color-index-unset, .meter--arc .meter__slice-indicator.color-index-unset { - fill: #ddd; } - .meter--circle .meter__slice-indicator.color-index-error, .meter--arc .meter__slice-indicator.color-index-error { - fill: #FF856B; } - .meter--circle .meter__slice-indicator.color-index-warning, .meter--arc .meter__slice-indicator.color-index-warning { - fill: #FFB86B; } - .meter--circle .meter__slice-indicator.color-index-ok, .meter--arc .meter__slice-indicator.color-index-ok { - fill: #4EB976; } - .meter--circle .meter__slice-indicator.color-index-unknown, .meter--arc .meter__slice-indicator.color-index-unknown { - fill: #a8a8a8; } - .meter--circle .meter__slice-indicator.color-index-disabled, .meter--arc .meter__slice-indicator.color-index-disabled { - fill: #a8a8a8; } - .meter--circle .meter__slice-indicator.color-index-graph-1, .meter--circle .meter__slice-indicator.color-index-graph-6, .meter--arc .meter__slice-indicator.color-index-graph-1, .meter--arc .meter__slice-indicator.color-index-graph-6 { - fill: #70ABC1; } - .meter--circle .meter__slice-indicator.color-index-graph-2, .meter--circle .meter__slice-indicator.color-index-graph-7, .meter--arc .meter__slice-indicator.color-index-graph-2, .meter--arc .meter__slice-indicator.color-index-graph-7 { - fill: #FFCA90; } - .meter--circle .meter__slice-indicator.color-index-graph-3, .meter--circle .meter__slice-indicator.color-index-graph-8, .meter--arc .meter__slice-indicator.color-index-graph-3, .meter--arc .meter__slice-indicator.color-index-graph-8 { - fill: #2E738E; } - .meter--circle .meter__slice-indicator.color-index-graph-4, .meter--circle .meter__slice-indicator.color-index-graph-9, .meter--arc .meter__slice-indicator.color-index-graph-4, .meter--arc .meter__slice-indicator.color-index-graph-9 { - fill: #E29643; } - .meter--circle .meter__slice-indicator.color-index-graph-5, .meter--circle .meter__slice-indicator.color-index-graph-10, .meter--arc .meter__slice-indicator.color-index-graph-5, .meter--arc .meter__slice-indicator.color-index-graph-10 { - fill: #767676; } - .meter--circle .meter__slice-indicator.color-index-grey-1, .meter--circle .meter__slice-indicator.color-index-grey-5, .meter--arc .meter__slice-indicator.color-index-grey-1, .meter--arc .meter__slice-indicator.color-index-grey-5 { - fill: #333333; } - .meter--circle .meter__slice-indicator.color-index-grey-2, .meter--circle .meter__slice-indicator.color-index-grey-6, .meter--arc .meter__slice-indicator.color-index-grey-2, .meter--arc .meter__slice-indicator.color-index-grey-6 { - fill: #3B3B3B; } - .meter--circle .meter__slice-indicator.color-index-grey-3, .meter--circle .meter__slice-indicator.color-index-grey-7, .meter--arc .meter__slice-indicator.color-index-grey-3, .meter--arc .meter__slice-indicator.color-index-grey-7 { - fill: #434343; } - .meter--circle .meter__slice-indicator.color-index-grey-4, .meter--circle .meter__slice-indicator.color-index-grey-8, .meter--arc .meter__slice-indicator.color-index-grey-4, .meter--arc .meter__slice-indicator.color-index-grey-8 { - fill: #666666; } - .meter--circle .meter__slice--active, .meter--arc .meter__slice--active { - stroke-width: 24px; } + .meter--circle .meter__thresholds .meter__slice, .meter--arc .meter__thresholds .meter__slice { + stroke-width: 12px; } + .meter--circle .meter__thresholds .meter__slice.color-index-unset, .meter--arc .meter__thresholds .meter__slice.color-index-unset { + stroke: rgba(221, 221, 221, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-error, .meter--arc .meter__thresholds .meter__slice.color-index-error { + stroke: rgba(255, 133, 107, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-warning, .meter--arc .meter__thresholds .meter__slice.color-index-warning { + stroke: rgba(255, 184, 107, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-ok, .meter--arc .meter__thresholds .meter__slice.color-index-ok { + stroke: rgba(78, 185, 118, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-unknown, .meter--arc .meter__thresholds .meter__slice.color-index-unknown { + stroke: rgba(168, 168, 168, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-disabled, .meter--arc .meter__thresholds .meter__slice.color-index-disabled { + stroke: rgba(168, 168, 168, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-graph-1, .meter--circle .meter__thresholds .meter__slice.color-index-graph-6, .meter--arc .meter__thresholds .meter__slice.color-index-graph-1, .meter--arc .meter__thresholds .meter__slice.color-index-graph-6 { + stroke: rgba(112, 171, 193, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-graph-2, .meter--circle .meter__thresholds .meter__slice.color-index-graph-7, .meter--arc .meter__thresholds .meter__slice.color-index-graph-2, .meter--arc .meter__thresholds .meter__slice.color-index-graph-7 { + stroke: rgba(255, 202, 144, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-graph-3, .meter--circle .meter__thresholds .meter__slice.color-index-graph-8, .meter--arc .meter__thresholds .meter__slice.color-index-graph-3, .meter--arc .meter__thresholds .meter__slice.color-index-graph-8 { + stroke: rgba(46, 115, 142, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-graph-4, .meter--circle .meter__thresholds .meter__slice.color-index-graph-9, .meter--arc .meter__thresholds .meter__slice.color-index-graph-4, .meter--arc .meter__thresholds .meter__slice.color-index-graph-9 { + stroke: rgba(226, 150, 67, 0.5); } + .meter--circle .meter__thresholds .meter__slice.color-index-graph-5, .meter--circle .meter__thresholds .meter__slice.color-index-graph-10, .meter--arc .meter__thresholds .meter__slice.color-index-graph-5, .meter--arc .meter__thresholds .meter__slice.color-index-graph-10 { + stroke: rgba(118, 118, 118, 0.5); } .meter--circle .meter__threshold, .meter--arc .meter__threshold { stroke-width: 24px; stroke-linecap: butt; } @@ -2558,66 +2870,92 @@ a.active > .label .label__icon.control-icon svg { font-size: 14px; font-size: 0.875rem; line-height: 16px; } - .meter--circle .meter__labels, .meter--arc .meter__labels { + .meter--circle .meter__labels-container, .meter--arc .meter__labels-container { width: 192px; } .meter--circle .meter__legend, .meter--arc .meter__legend { margin: 24px 0 0; } .meter--arc svg.meter__graphic { height: 144px; } - .meter--arc .meter__labels { + .meter--arc .meter__labels-container { padding-left: 12px; padding-right: 12px; } .meter--circle svg.meter__graphic { height: 192px; } - .meter--vertical { - display: -webkit-flex; - display: flex; } - .meter--vertical .meter__labels { - -webkit-flex-direction: column; - flex-direction: column; - -webkit-justify-content: space-between; - justify-content: space-between; } - .meter--vertical .meter__label-min, .meter--vertical .meter__label-max { - -webkit-flex: 0 0 auto; - flex: 0 0 auto; - text-align: left; } - .meter--vertical.meter--bar { - white-space: nowrap; } - .meter--vertical.meter--bar svg.meter__graphic { - width: 24px; - height: 192px; } - .meter--vertical.meter--bar .meter__active { - margin-top: 72px; - margin-left: 12px; } - .meter--vertical.meter--bar .meter__active-value { - font-size: 48px; - font-size: 3rem; - line-height: 38px; - font-weight: bold; } - .meter--vertical.meter--bar .meter__active-units { - font-size: 24px; - font-size: 1.5rem; - line-height: inherit; - margin-left: 6px; - color: #777; - font-weight: normal; } - .meter--vertical.meter--bar .meter__labels { - position: absolute; - left: 36px; - vertical-align: top; - width: auto; - height: 192px; } - .meter--vertical.meter--bar .meter__legend { - margin-left: 24px; } - .meter--vertical.meter--arc svg.meter__graphic { - width: 144px; + .meter--vertical .meter__active-graphic { + display: inline-block; + vertical-align: middle; } + .meter--vertical .meter__labeled-graphic { + white-space: nowrap; } + .meter--vertical .meter__labels { + -webkit-flex-direction: column; + flex-direction: column; + -webkit-justify-content: space-between; + justify-content: space-between; } + .meter--vertical .meter__label-min, .meter--vertical .meter__label-max { + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + text-align: left; } + .meter--vertical .meter__label-min { + -webkit-order: 1; + order: 1; } + .meter--vertical .meter__label-max { + -webkit-order: 0; + order: 0; } + @media screen and (min-width: 45em) { + .meter--vertical .meter__legend { + vertical-align: middle; + margin: 0px 0px 0px 24px; } } + .meter--vertical.meter--bar { + white-space: nowrap; } + .meter--vertical.meter--bar svg.meter__graphic { + width: 24px; height: 192px; } - .meter--vertical.meter--arc .meter__labels { + .meter--vertical.meter--bar .meter__active { + margin-top: 72px; + margin-left: 12px; } + .meter--vertical.meter--bar .meter__active-value { + font-size: 48px; + font-size: 3rem; + line-height: 38px; + font-weight: bold; } + .meter--vertical.meter--bar .meter__active-units { + font-size: 24px; + font-size: 1.5rem; + line-height: inherit; + margin-left: 6px; + color: #777; + font-weight: normal; } + .meter--vertical.meter--bar .meter__labels-container { + position: absolute; + top: 0px; + left: 36px; width: auto; - padding-top: 12px; - padding-bottom: 12px; } + height: 192px; } + .meter--vertical.meter--bar .meter__labels { + height: 192px; } + .meter--vertical.meter--bar .meter__legend { + margin-left: 24px; } + .meter--vertical.meter--arc svg.meter__graphic { + display: inline; + width: 144px; + height: 192px; } + .meter--vertical.meter--arc .meter__labels-container { + display: inline-block; + vertical-align: top; + width: auto; + height: 192px; + padding-top: 12px; + padding-bottom: 12px; } + .meter--vertical.meter--arc .meter__labels { + height: 168px; } + .meter--small.meter--bar .meter__labels-container { + width: 144px; } .meter--small.meter--bar svg.meter__graphic { width: 144px; } + .meter--small.meter--bar .meter__active { + font-size: 16px; + font-size: 1rem; + line-height: 1.5; } .meter--small.meter--arc svg.meter__graphic, .meter--small.meter--circle svg.meter__graphic { width: 144px; height: 144px; } @@ -2625,8 +2963,8 @@ a.active > .label .label__icon.control-icon svg { width: 144px; margin-top: 48px; } .meter--small.meter--arc .meter__active-value, .meter--small.meter--circle .meter__active-value { - font-size: 36px; - font-size: 2.25rem; + font-size: 28px; + font-size: 1.75rem; line-height: inherit; } .meter--small.meter--arc svg.meter__graphic { height: 120px; } @@ -2637,8 +2975,8 @@ a.active > .label .label__icon.control-icon svg { width: 288px; height: 36px; } .meter--large.meter--bar .meter__active { - font-size: 36px; - font-size: 2.25rem; + font-size: 28px; + font-size: 1.75rem; line-height: inherit; } .meter--large.meter--arc svg.meter__graphic, .meter--large.meter--circle svg.meter__graphic { width: 288px; @@ -2652,6 +2990,14 @@ a.active > .label .label__icon.control-icon svg { line-height: inherit; } .meter--large.meter--arc svg.meter__graphic { height: 264px; } + .meter--legend-right { + white-space: nowrap; } + .meter--legend-right .meter__labels-container { + width: auto; } + .meter--legend-right .meter__legend { + vertical-align: top; } + .meter--loading .meter__thresholds { + display: none; } .notification { padding: 24px; } diff --git a/css/grommet.min.css b/css/grommet.min.css index 596d2f7..c8dd7cc 100644 --- a/css/grommet.min.css +++ b/css/grommet.min.css @@ -2,4 +2,4 @@ * inuitcss, by @csswizardry * * github.com/inuitcss | inuitcss.com - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */dfn,img{font-style:italic}img,legend{border:0}a,ins,u{text-decoration:none}a,a:visited{color:#FF8706}code.hljs,input,select,textarea{border:1px solid #ccc}.index-list,.legend,.map__categories,.map__category-items{list-style-type:none}.menu:focus,.search:focus,a:active,a:hover,input,input[type=range]:focus,select,textarea{outline:0}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{max-width:100%;vertical-align:middle}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}#loading,.tbd{font-style:italic}button{overflow:visible}button,select{text-transform:none}button,html input[type=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[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver}table{border-collapse:collapse;border-spacing:0}blockquote,body,caption,dd,dl,fieldset,figure,form,h1,h2,h3,h4,h5,h6,hr,legend,ol,p,pre,table,td,th,ul{margin:0;padding:0}abbr[title],dfn[title]{cursor:help}ins{border-bottom:1px solid}html{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:1em;line-height:1.5;background-color:#fff;color:#333;overflow-y:scroll;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:'Source Sans Pro',Arial,sans-serif}*,:after,:before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}address,blockquote,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,ol,p,pre,table,ul{margin-bottom:1.5rem}dd,ol,ul{margin-left:3rem}h6{font-size:14px;font-size:.875rem;line-height:1.71429}li>ol,li>ul{margin-bottom:0}.gm-style img,img[height],img[width]{max-width:none}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGPS42wKzre0cxmO5m5GyTsY.ttf) format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro-Regular'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlEY6Fu39Tt9XkmtSosaMoEA.ttf) format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGLlcMrNrsnL9dgADnXgYJjs.ttf) format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-It'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/M2Jd71oPJhLKp0zdtTvoMzpKUtbt71woJ25xl7KOGD0.ttf) format('truetype')}dd,li,p{max-width:576px}.h1,h1{font-size:48px;font-size:3rem;line-height:1;font-weight:600}.h2,.h3,h2,h3{font-size:36px;line-height:1.33333}.h2,h2{font-size:2.25rem;font-weight:400}.h3,.h4,.h5,h3,h4,h5{font-weight:100}.h3,h3{font-size:2.25rem}.h4,h4{font-size:24px;font-size:1.5rem;line-height:1}.h5,h5{font-size:20px;font-size:1.25rem;line-height:1.2}a{background-color:transparent;cursor:pointer}a:hover{text-decoration:underline}a.active{color:#333}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}input,select,textarea{font-size:16px;font-size:1rem;line-height:1.5;padding:11px 23px;border-radius:4px;margin-right:12px;background-color:inherit}input:focus,select:focus,textarea:focus{padding:10px 22px;border-width:2px;border-color:#70ABC1}input::-moz-focus-inner,select::-moz-focus-inner,textarea::-moz-focus-inner{border:none;outline:0}input.error,select.error,textarea.error{border-color:#FF856B}input[type=button],input[type=submit]{line-height:inherit}a.button,button,input[type=button],input[type=submit]{display:inline-block;padding:4px 12px;border:2px solid #FF856B;border-radius:4px;background-color:inherit;text-decoration:none;cursor:pointer;text-align:center;outline:0}a.button:hover,button:hover,input[type=button]:hover,input[type=submit]:hover{background-color:#eee;border-color:#FF856B}a.button.primary,button.primary,input[type=button].primary,input[type=submit].primary{background-color:#FF856B;border-color:#FF856B;color:#fff}a.button.primary:hover,button.primary:hover,input[type=button].primary:hover,input[type=submit].primary:hover{background-color:#FF856B;border-color:#FF856B}a.button.call-to-action,button.call-to-action,input[type=button].call-to-action,input[type=submit].call-to-action{font-size:20px;font-size:1.25rem;line-height:1.2;padding:12px 24px}a.button:focus,button:focus,input[type=button]:focus,input[type=submit]:focus{border-color:#70ABC1;box-shadow:0 0 1px 1px #70ABC1}[class*=background-color-index-] a.button:hover,[class*=background-color-index-] button:hover,[class*=background-color-index-] input[type=button]:hover,[class*=background-color-index-] input[type=submit]:hover{background-color:#FF856B;border-color:#FF856B;text-decoration:none}select{border-color:#ccc;padding-right:24px;-webkit-appearance:none;-moz-appearance:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAAAXNSR0IArs4c6QAAARpJREFUKBVjnDlzJuu/f//cGagAmJiYTjCCzAEaWg+kGkBsCsCG58+fB4MNBBkyY8aMeYyMjIlkGnjy69evjkVFRd+ZYAa8ePEiDcjeBeOTQN/9+fOnL8gwkB64C0Gczs5OXn5+/sNAl+qD+ESAN////7fKyMi4DVOLYiBIcPLkyVKsrKwngIbKwhRho4EGgVzkDDTsOLI83Mswwdzc3GdAxV5A/keYGDoNlP8HFItBNwykDsNAkGBmZuYVIBUIxL9AfCygCGjYOizi2A0EKUxPT98PdEkyFk39QMMmYhEHC2F1IUwxUOMSILsaxgdasAaY1kpgfGw0RqRgUwRMozOB4trApOXS0NDwA5saksRCQ0OZ+/v7BYjRBACZeF+tn9zqUwAAAABJRU5ErkJggg==) center right 12px no-repeat;cursor:pointer}select:hover{background-color:#eee}select::-moz-focus-inner{border:none}select.plain{border:none}input[type=range]{position:relative;-webkit-appearance:none;border-color:transparent;height:24px;padding:0;overflow-x:hidden}input[type=range]::-moz-focus-inner{border:none}input[type=range]::-webkit-slider-runnable-track{width:100%;height:12px;cursor:pointer;background:0 0;border:1px solid #ccc}input[type=range]::-webkit-slider-thumb{position:relative;height:24px;width:24px;overflow:visible;-webkit-appearance:none;margin-top:-7px}input[type=range]::-webkit-slider-thumb:before{content:"";position:absolute;left:-3000px;right:12px;top:6px;bottom:6px;background-color:#FF856B;pointer-events:none}.app,.layer,.layer--align-bottom:not(.layer--hidden) .layer__container,.login{bottom:0}input[type=range]::-webkit-slider-thumb:after{content:"";position:absolute;border:1px solid #ccc;height:21px;width:21px;border-radius:24px;background-color:#fff;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.2)}input[type=range]::-moz-range-track{width:100%;height:12px;cursor:pointer;background:0 0;border:1px solid #ccc}input[type=range]::-moz-range-thumb{position:relative;height:24px;width:24px;overflow:visible;border-radius:24px;border:none;background-color:#FF856B}input[type=range]::-ms-track{width:100%;height:12px;cursor:pointer;border:1px solid transparent;background:0 0;border-width:16px 0;color:transparent}input[type=range]::-ms-fill-lower{background:#FF856B;border-radius:4px}input[type=range]::-ms-fill-upper{background:#fff;border-radius:4px}input[type=range]::-ms-thumb{position:relative;height:24px;width:24px;overflow:visible}#loading,.app{position:absolute}body,html{height:100%;width:100%;overflow:hidden}.i-list-bare{margin:0;padding:0;list-style:none}.app--centered .document,.app--centered .section,.app--centered>.footer,.app--centered>div>.footer{padding-left:24px;padding-right:24px}.app--centered .document__content,.app--centered .section__content,.app--centered>.footer .footer__content,.app--centered>.header .header__content,.app--centered>div>.footer .footer__content,.app--centered>div>.header .header__content{width:100%;max-width:960px;margin-left:auto;margin-right:auto}#loading{width:100%;height:100%;background-color:#ddd;text-align:center;padding-top:100px;font-size:48px;color:#ccc}.app{top:0;left:0;right:0;overflow:auto}.app--inline,.chart{position:relative}.app--centered .section .document{padding-left:0;padding-right:0}.app--centered .section .document__content{width:auto;max-width:none}.attribute{padding:24px 24px 12px}@media screen and (min-width:45em){.attribute{width:480px;max-width:100%}.form--compact .attribute{width:240px}}@media screen and (max-width:44.9375em){.attribute{width:100vw}}.attribute__label{display:block;text-align:left;font-size:14px;font-size:.875rem;line-height:24px;color:#777}.chart{display:block}.chart__grid{stroke:#ccc}.chart__graphic{width:100%;height:384px;max-height:calc(100vh - 144px)}.chart__values-line{stroke-width:3px}.chart__values-line.color-index-unset{stroke:#ddd}.chart__values-line.color-index-error{stroke:#FF856B}.chart__values-line.color-index-warning{stroke:#FFB86B}.chart__values-line.color-index-ok{stroke:#4EB976}.chart__values-line.color-index-disabled,.chart__values-line.color-index-unknown{stroke:#a8a8a8}.chart__values-line.color-index-graph-1,.chart__values-line.color-index-graph-6{stroke:#70ABC1}.chart__values-line.color-index-graph-2,.chart__values-line.color-index-graph-7{stroke:#FFCA90}.chart__values-line.color-index-graph-3,.chart__values-line.color-index-graph-8{stroke:#2E738E}.chart__values-line.color-index-graph-4,.chart__values-line.color-index-graph-9{stroke:#E29643}.chart__values-line.color-index-graph-10,.chart__values-line.color-index-graph-5{stroke:#767676}.chart__values-line.color-index-grey-1,.chart__values-line.color-index-grey-5{stroke:#333}.chart__values-line.color-index-grey-2,.chart__values-line.color-index-grey-6{stroke:#3B3B3B}.chart__values-line.color-index-grey-3,.chart__values-line.color-index-grey-7{stroke:#434343}.chart__values-line.color-index-grey-4,.chart__values-line.color-index-grey-8{stroke:#666}.chart__threshold{stroke-width:1px;stroke:#333}.chart__xaxis-index text{fill:#777}.chart__xaxis-index--active text{fill:#333}.chart__front-xband-background{fill:transparent}.chart__cursor{stroke:#70ABC1;stroke-width:3;pointer-events:none}.chart__legend{padding:12px;pointer-events:none}@media screen and (max-width:44.9375em){.chart__legend{margin:0 auto}}@media screen and (min-width:45em){.chart__legend{position:absolute;left:0;margin:0;background-color:rgba(255,255,255,.8)}}.chart--area .chart__gradient.color-index-error .begin,.chart--bar .chart__gradient.color-index-error .begin{stop-color:#FF856B}.chart--area .chart__gradient.color-index-error .end,.chart--bar .chart__gradient.color-index-error .end{stop-color:#FF856B;stop-opacity:0}.chart--area .chart__gradient.color-index-warning .begin,.chart--bar .chart__gradient.color-index-warning .begin{stop-color:#FFB86B}.chart--area .chart__gradient.color-index-warning .end,.chart--bar .chart__gradient.color-index-warning .end{stop-color:#FFB86B;stop-opacity:0}.chart--area .chart__gradient.color-index-ok .begin,.chart--bar .chart__gradient.color-index-ok .begin{stop-color:#4EB976}.chart--area .chart__gradient.color-index-ok .end,.chart--bar .chart__gradient.color-index-ok .end{stop-color:#4EB976;stop-opacity:0}.chart--area .chart__gradient.color-index-unknown .begin,.chart--bar .chart__gradient.color-index-unknown .begin{stop-color:#a8a8a8}.chart--area .chart__gradient.color-index-unknown .end,.chart--bar .chart__gradient.color-index-unknown .end{stop-color:#a8a8a8;stop-opacity:0}.chart--area .chart__gradient.color-index-disabled .begin,.chart--bar .chart__gradient.color-index-disabled .begin{stop-color:#a8a8a8}.chart--area .chart__gradient.color-index-disabled .end,.chart--bar .chart__gradient.color-index-disabled .end{stop-color:#a8a8a8;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-1 .begin,.chart--area .chart__gradient.color-index-graph-6 .begin,.chart--bar .chart__gradient.color-index-graph-1 .begin,.chart--bar .chart__gradient.color-index-graph-6 .begin{stop-color:#70ABC1}.chart--area .chart__gradient.color-index-graph-1 .end,.chart--area .chart__gradient.color-index-graph-6 .end,.chart--bar .chart__gradient.color-index-graph-1 .end,.chart--bar .chart__gradient.color-index-graph-6 .end{stop-color:#70ABC1;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-2 .begin,.chart--area .chart__gradient.color-index-graph-7 .begin,.chart--bar .chart__gradient.color-index-graph-2 .begin,.chart--bar .chart__gradient.color-index-graph-7 .begin{stop-color:#FFCA90}.chart--area .chart__gradient.color-index-graph-2 .end,.chart--area .chart__gradient.color-index-graph-7 .end,.chart--bar .chart__gradient.color-index-graph-2 .end,.chart--bar .chart__gradient.color-index-graph-7 .end{stop-color:#FFCA90;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-3 .begin,.chart--area .chart__gradient.color-index-graph-8 .begin,.chart--bar .chart__gradient.color-index-graph-3 .begin,.chart--bar .chart__gradient.color-index-graph-8 .begin{stop-color:#2E738E}.chart--area .chart__gradient.color-index-graph-3 .end,.chart--area .chart__gradient.color-index-graph-8 .end,.chart--bar .chart__gradient.color-index-graph-3 .end,.chart--bar .chart__gradient.color-index-graph-8 .end{stop-color:#2E738E;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-4 .begin,.chart--area .chart__gradient.color-index-graph-9 .begin,.chart--bar .chart__gradient.color-index-graph-4 .begin,.chart--bar .chart__gradient.color-index-graph-9 .begin{stop-color:#E29643}.chart--area .chart__gradient.color-index-graph-4 .end,.chart--area .chart__gradient.color-index-graph-9 .end,.chart--bar .chart__gradient.color-index-graph-4 .end,.chart--bar .chart__gradient.color-index-graph-9 .end{stop-color:#E29643;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-10 .begin,.chart--area .chart__gradient.color-index-graph-5 .begin,.chart--bar .chart__gradient.color-index-graph-10 .begin,.chart--bar .chart__gradient.color-index-graph-5 .begin{stop-color:#767676}.chart--area .chart__gradient.color-index-graph-10 .end,.chart--area .chart__gradient.color-index-graph-5 .end,.chart--bar .chart__gradient.color-index-graph-10 .end,.chart--bar .chart__gradient.color-index-graph-5 .end{stop-color:#767676;stop-opacity:0}.chart--small .chart__graphic{height:192px}.chart--large .chart__graphic{height:576px}.check-box{margin-right:12px;cursor:pointer}.check-box__input{opacity:0;position:absolute}.check-box__input:checked+.check-box__control:after{content:"";display:block;position:absolute;top:3px;left:3px;width:16px;height:16px;background-color:#FF856B}.check-box__input:focus+.check-box__control{content:"";border-color:#70ABC1;box-shadow:0 0 1px 1px #70ABC1}.check-box__control{position:relative;display:inline-block;width:24px;height:24px;margin-right:12px;vertical-align:middle;background-color:inherit;border:1px solid #ccc;border-radius:4px}.check-box--toggle .check-box__control{width:48px;height:24px;background-color:#eee;border:none;transition:background-color .3s}.check-box--toggle .check-box__control:after{content:"";display:block;position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:#fff;border-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:margin-left .3s}.layer__container,.login-form{box-shadow:0 2px 4px rgba(0,0,0,.3)}.check-box--toggle .check-box__input:checked+.check-box__control{background-color:#FF856B}.check-box--toggle .check-box__input:checked+.check-box__control:after{top:2px;left:2px;width:20px;height:20px;background-color:#fff;margin-left:24px}.header-color-index-neutral-1 dt,.header-color-index-neutral-1 h1,.header-color-index-neutral-1 h2,.header-color-index-neutral-1 h3,.header-color-index-neutral-1 h4,.header-color-index-neutral-1 h5,.header-color-index-neutral-1 h6,.header-color-index-neutral-4 dt,.header-color-index-neutral-4 h1,.header-color-index-neutral-4 h2,.header-color-index-neutral-4 h3,.header-color-index-neutral-4 h4,.header-color-index-neutral-4 h5,.header-color-index-neutral-4 h6{color:#2E738E}.background-color-index-neutral-1,.background-color-index-neutral-4{background-color:#2E738E;color:#fff}.background-color-index-neutral-1 a,.background-color-index-neutral-4 a{color:#fff}.header-color-index-neutral-2 dt,.header-color-index-neutral-2 h1,.header-color-index-neutral-2 h2,.header-color-index-neutral-2 h3,.header-color-index-neutral-2 h4,.header-color-index-neutral-2 h5,.header-color-index-neutral-2 h6,.header-color-index-neutral-5 dt,.header-color-index-neutral-5 h1,.header-color-index-neutral-5 h2,.header-color-index-neutral-5 h3,.header-color-index-neutral-5 h4,.header-color-index-neutral-5 h5,.header-color-index-neutral-5 h6{color:#E29643}.background-color-index-neutral-2,.background-color-index-neutral-5{background-color:#E29643;color:#fff}.background-color-index-neutral-2 a,.background-color-index-neutral-5 a{color:#fff}.header-color-index-neutral-3 dt,.header-color-index-neutral-3 h1,.header-color-index-neutral-3 h2,.header-color-index-neutral-3 h3,.header-color-index-neutral-3 h4,.header-color-index-neutral-3 h5,.header-color-index-neutral-3 h6,.header-color-index-neutral-6 dt,.header-color-index-neutral-6 h1,.header-color-index-neutral-6 h2,.header-color-index-neutral-6 h3,.header-color-index-neutral-6 h4,.header-color-index-neutral-6 h5,.header-color-index-neutral-6 h6{color:#767676}.background-color-index-neutral-3,.background-color-index-neutral-6{background-color:#767676;color:#fff}.background-color-index-neutral-3 a,.background-color-index-neutral-6 a{color:#fff}.background-color-index-accent-1,.background-color-index-accent-3{background-color:#70ABC1;color:#fff}.background-color-index-accent-1 a,.background-color-index-accent-3 a{color:#fff}.background-color-index-accent-2,.background-color-index-accent-4{background-color:#FFCA90;color:#fff}.background-color-index-accent-2 a,.background-color-index-accent-4 a{color:#fff}.background-color-index-grey-1,.background-color-index-grey-5{background-color:#333;color:#fff}.background-color-index-grey-1 a,.background-color-index-grey-5 a{color:#fff}.background-color-index-grey-2,.background-color-index-grey-6{background-color:#3B3B3B;color:#fff}.background-color-index-grey-2 a,.background-color-index-grey-6 a{color:#fff}.background-color-index-grey-3,.background-color-index-grey-7{background-color:#434343;color:#fff}.background-color-index-grey-3 a,.background-color-index-grey-7 a{color:#fff}.background-color-index-grey-4,.background-color-index-grey-8{background-color:#666;color:#fff}.background-color-index-grey-4 a,.background-color-index-grey-8 a{color:#fff}.center-column{padding-left:24px;padding-right:24px}.center-column .center-column__content{width:100%;max-width:960px;margin-left:auto;margin-right:auto}@media screen and (min-width:45em){.dashboard{height:calc(100vh - 96px)}}.document{width:100%}.document--no-contents .document__content{padding-left:0}.document section{margin-top:24px;margin-bottom:24px;padding-top:24px}.document header>img,.document section>img{margin-top:48px;margin-bottom:48px;display:block;max-width:576px}@media screen and (max-width:44.9375em){.dashboard{height:calc(100vh - 48px)}.document header>img,.document section>img{max-width:100%}.document header>ol,.document header>ul,.document section>ol,.document section>ul{padding-left:24px;padding-right:24px;margin-left:0;margin-bottom:24px}}.document header>dl>dt,.document section>dl>dt{margin-top:24px;margin-bottom:6px;text-transform:uppercase}.document header>dl>dt code,.document section>dl>dt code{text-transform:none;white-space:pre-wrap}.document header>dl>dd,.document section>dl>dd{margin-left:0}.document header>h2,.document section>h2{position:relative;padding-top:24px}.document header>h2:after,.document section>h2:after{position:absolute;content:'';top:0;left:0;right:0;border-top:1px solid #ccc}.document section:first-child{margin-top:0;padding-top:0}.document section:first-child>h2{padding-top:0}.document section:first-child>h2:after{border-top:none}@-webkit-keyframes draw-stroke{0%{stroke-dashoffset:768px}100%{stroke-dashoffset:0}}@keyframes draw-stroke{0%{stroke-dashoffset:768px}100%{stroke-dashoffset:0}}@media screen and (max-width:44.9375em){.document header>dl>dd,.document section>dl>dd{padding-right:24px}.donut{width:192px;margin:0 auto}}.donut.series-pre path{stroke-dashoffset:768px}.donut__graphic-container{position:relative;width:192px;height:192px}.donut svg.donut__graphic{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible}.donut__slice{stroke-width:24px;stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0;fill:none;cursor:pointer;stroke:#eee}.donut__slice.color-index-unset{stroke:#ddd}.donut__slice.color-index-error{stroke:#FF856B}.donut__slice.color-index-warning{stroke:#FFB86B}.donut__slice.color-index-ok{stroke:#4EB976}.donut__slice.color-index-disabled,.donut__slice.color-index-unknown{stroke:#a8a8a8}.donut__slice.color-index-graph-1,.donut__slice.color-index-graph-6{stroke:#70ABC1}.donut__slice.color-index-graph-2,.donut__slice.color-index-graph-7{stroke:#FFCA90}.donut__slice.color-index-graph-3,.donut__slice.color-index-graph-8{stroke:#2E738E}.donut__slice.color-index-graph-4,.donut__slice.color-index-graph-9{stroke:#E29643}.donut__slice.color-index-graph-10,.donut__slice.color-index-graph-5{stroke:#767676}.donut__slice.color-index-grey-1,.donut__slice.color-index-grey-5{stroke:#333}.donut__slice.color-index-grey-2,.donut__slice.color-index-grey-6{stroke:#3B3B3B}.donut__slice.color-index-grey-3,.donut__slice.color-index-grey-7{stroke:#434343}.donut__slice.color-index-grey-4,.donut__slice.color-index-grey-8{stroke:#666}.donut__slice-indicator.color-index-unset{fill:#ddd}.donut__slice-indicator.color-index-error{fill:#FF856B}.donut__slice-indicator.color-index-warning{fill:#FFB86B}.donut__slice-indicator.color-index-ok{fill:#4EB976}.donut__slice-indicator.color-index-disabled,.donut__slice-indicator.color-index-unknown{fill:#a8a8a8}.donut__slice-indicator.color-index-graph-1,.donut__slice-indicator.color-index-graph-6{fill:#70ABC1}.donut__slice-indicator.color-index-graph-2,.donut__slice-indicator.color-index-graph-7{fill:#FFCA90}.donut__slice-indicator.color-index-graph-3,.donut__slice-indicator.color-index-graph-8{fill:#2E738E}.donut__slice-indicator.color-index-graph-4,.donut__slice-indicator.color-index-graph-9{fill:#E29643}.donut__slice-indicator.color-index-graph-10,.donut__slice-indicator.color-index-graph-5{fill:#767676}.donut__slice-indicator.color-index-grey-1,.donut__slice-indicator.color-index-grey-5{fill:#333}.donut__slice-indicator.color-index-grey-2,.donut__slice-indicator.color-index-grey-6{fill:#3B3B3B}.donut__slice-indicator.color-index-grey-3,.donut__slice-indicator.color-index-grey-7{fill:#434343}.donut__slice-indicator.color-index-grey-4,.donut__slice-indicator.color-index-grey-8{fill:#666}.donut__slice--active{stroke-width:24px}.donut__active{position:absolute;width:100%;margin-top:72px;text-align:center;white-space:normal;pointer-events:none}.donut__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.donut__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.donut__active-label{width:50%;margin:0 auto;font-size:14px;font-size:.875rem;line-height:16px}.donut__max-label,.donut__min-label{position:absolute;bottom:0;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.form,.form-field{position:relative}.donut__min-label{left:12px}.donut__max-label{right:12px}.donut__legend{margin:24px 0 0}@media screen and (min-width:45em){.donut__slice{-webkit-animation:draw-stroke 3s;animation:draw-stroke 3s}.donut--landscape{white-space:nowrap}.donut--landscape .donut__graphic-container,.donut--landscape .donut__legend{display:inline-block;vertical-align:middle}.donut--landscape .donut__legend{margin:0 0 0 24px}}.donut--portrait .donut__graphic-container{display:block}.donut--portrait .donut__legend{margin:24px 0 0}.donut--partial .donut__graphic-container{height:168px}.donut--small .donut__graphic-container{width:144px;height:144px}.donut--small .donut__active{margin-top:48px}@media screen and (min-width:45em){.donut--small .donut__legend{display:none}}.footer{min-height:48px;line-height:48px}.footer__content{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;width:100%;padding-left:24px;padding-right:24px}.footer__content.center-column__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}@media screen and (max-width:44.9375em){.footer__content.center-column__content>.menu:first-child{width:100%}.footer__content.center-column__content>.menu:first-child:empty{width:0;margin:0;padding:0}}.footer__content>.flex-1{-webkit-flex:1;flex:1}.footer__content>.flex-2{-webkit-flex:2;flex:2}.footer__content>.flex-3{-webkit-flex:3;flex:3}.footer__content>.flex-4{-webkit-flex:4;flex:4}.footer__content>*{margin-right:48px}.footer__content>:last-child{margin-right:0}@media screen and (max-width:44.9375em){.footer__content>:last-child{text-align:left}}@media screen and (min-width:45em) and (max-width:63.9375em){.footer__content>:last-child{text-align:left}}.footer__content a.button,.footer__content button,.footer__content input[type=button],.footer__content input[type=submit]{font-size:24px;font-size:1.5rem;line-height:inherit;min-width:96px}.footer--primary{height:auto;padding:24px}.footer--primary .footer__content{position:relative;color:#777}.footer--primary .footer__content p{padding-top:12px;margin:0;max-width:none;text-align:right;line-height:24px}@media screen and (max-width:44.9375em){.footer--primary .footer__content{display:block}}@media screen and (min-width:45em) and (max-width:63.9375em){.footer--primary .footer__content{display:block}}.footer--centered .footer__content{display:block;text-align:center}.footer--centered .footer__content>*{margin-right:auto;margin-left:auto;text-align:center}.footer--flush .footer__content{padding-left:0;padding-right:0}@media screen and (min-width:45em){.form{min-width:480px}}.form>.header .header__wrapper{background-color:inherit}.form>.footer{margin-top:24px}.form fieldset{border:none;margin:24px 24px 2rem}.form fieldset legend{font-size:24px;font-size:1.5rem;line-height:1;font-weight:100;margin-bottom:12px;color:#777}.layer .form{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;max-height:calc(100vh - 48px);max-width:calc(100vw - 48px)}.layer .form>.footer,.layer .form>.header{-webkit-flex:0 0 auto;flex:0 0 auto}.layer .form>.form-fields{overflow:auto}@media screen and (max-width:44.9375em){.layer .form>.form-fields{margin-left:-24px;margin-right:-24px}.layer .form>.form-fields>fieldset>:not(.form-field){margin-left:24px;margin-right:24px}}.form--fill{min-width:0}.form--flush fieldset{margin-left:0;margin-right:0}.form--compact{min-width:240px}.form-field{padding:6px 24px;border:1px solid #ccc;margin-bottom:-1px;background-color:#fff}.header--fixed .header__content,.header__wrapper{background-color:rgba(255,255,255,.9)}.form-field:last-child,.form-field__contents>.table--selectable table{margin-bottom:0}@media screen and (min-width:45em){.form-field{width:480px;max-width:100%}.form--compact .form-field{width:240px}}@media screen and (max-width:44.9375em){.form-field{width:100vw}}.form--fill .form-field,.form-field__contents>.search-input,.header__content{width:100%}.form-field__label{display:block;font-size:14px;font-size:.875rem;line-height:24px;color:#777}.form-field__contents{display:block}.form-field__contents>.search-input input,.form-field__contents>input[type=email],.form-field__contents>input[type=number],.form-field__contents>input[type=password],.form-field__contents>input[type=range],.form-field__contents>input[type=text],.form-field__contents>select,.form-field__contents>textarea{border:none;padding:0;width:100%;margin-right:0;border-radius:0;font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__contents>.table--selectable table td:first-child,.form-field__contents>.table--selectable table th:first-child,.header__content{padding-left:24px}.form-field__contents>.search-input input:focus,.form-field__contents>input[type=email]:focus,.form-field__contents>input[type=number]:focus,.form-field__contents>input[type=password]:focus,.form-field__contents>input[type=range]:focus,.form-field__contents>input[type=text]:focus,.form-field__contents>select:focus,.form-field__contents>textarea:focus{border:none}.form-field__contents>select{background-position:center right}.form-field__contents>textarea{vertical-align:top;height:auto}.control-icon,.header__content svg,.logo-icon,.status-icon{vertical-align:middle}.form-field__contents>.check-box,.form-field__contents>.radio-button{font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__contents>.search-input .search-input__control{right:-12px}.form-field__contents>.table--selectable{margin-left:-24px;margin-right:-24px;font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__help{display:block;margin-top:6px;line-height:24px;color:#777}.form-field__error{display:block;float:right;color:#FF856B;line-height:24px}.form-field--text,.form-field--text .form-field__label{cursor:pointer}.form-field--error{z-index:1;border-color:#FF856B}.form-field--focus{z-index:2;border-color:#70ABC1}.header{font-size:24px;font-size:1.5rem;line-height:inherit}@media screen and (max-width:44.9375em){.header{height:48px}}@media screen and (min-width:45em){.header{height:72px}}.header__content{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;white-space:nowrap;padding-right:24px;border-bottom:1px solid #ccc}@media screen and (max-width:44.9375em){.header__wrapper{height:48px}.header__content{line-height:48px}}@media screen and (min-width:45em){.header__wrapper{height:72px}.header__content{line-height:72px}}.header__content>*{-webkit-flex:1 0;flex:1 0;overflow:hidden}.header__content>:last-child:not(:first-child){-webkit-flex:0 0 auto;flex:0 0 auto}.header__content .title,.header__content>h1,.header__content>h2,.header__content>h3,.header__content>h4{margin-bottom:0;line-height:inherit}.header__content .title svg,.header__content>h1 svg,.header__content>h2 svg,.header__content>h3 svg,.header__content>h4 svg{height:48px}.header__content>.menu{-webkit-flex:0 0 auto;flex:0 0 auto}.header__content .status-icon{margin-right:12px}.header__content a{color:inherit}.header--fixed .header__wrapper{position:absolute;top:0;left:0;right:0;z-index:3}.header--fixed .header__content{border-bottom:1px solid #ccc}@media screen and (min-width:45em){.header--large,.header--large .header__wrapper{height:96px}.header--large .header__content{line-height:96px}.header--small,.header--small .header__wrapper{height:48px}.header--small .header__content{line-height:48px}.header--small .header__content .title svg,.header--small .header__content>h1 svg,.header--small .header__content>h2 svg,.header--small .header__content>h3 svg,.header--small .header__content>h4 svg{height:24px}.header--fixed .header__content{position:fixed}}.header--fixed.header--primary .header__wrapper{position:fixed;background-color:rgba(255,255,255,.9)}.header--fixed.header--primary .header__content{position:static;background-color:transparent}.index-header,.index__container,.index__items{position:relative}.header--flush .header__content,.header--flush .header__wrapper{padding-left:0;padding-right:0}.header--primary .header__content,.header--primary .header__wrapper{border-bottom:none}.control-icon{display:inline-block;width:48px;height:48px;cursor:pointer;fill:#999;stroke:#999}.control-icon:hover{fill:#000;stroke:#000}.control-icon__badge circle{fill:#FF856B}.control-icon__badge text{stroke:#fff;fill:#fff}.control-icon--active{fill:#000;stroke:#000}.status-icon{width:24px;height:24px}.status-icon .status-icon__base{fill:#a8a8a8}.status-icon-error .status-icon__base{fill:#FF856B}.status-icon-warning .status-icon__base{fill:#FFB86B}.status-icon-ok .status-icon__base{fill:#4EB976}.status-icon-disabled .status-icon__base,.status-icon-unknown .status-icon__base{fill:#a8a8a8}.status-icon-label .status-icon__base{fill:#999}.status-icon__detail{fill:#fff}.status-icon--large{width:48px;height:48px}.status-icon--small{width:12px;height:12px;margin-top:6px;margin-bottom:6px}.status-icon--small .status-icon__detail{display:none}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.icon-changing{width:24px;height:24px;-webkit-animation:rotate 1.5s linear infinite;animation:rotate 1.5s linear infinite}.icon-changing--small{width:12px;height:12px}.icon-spinning{width:24px;height:24px;-webkit-animation:rotate 4s steps(4,end) infinite;animation:rotate 4s steps(4,end) infinite}.icon-spinning--small{width:12px;height:12px}.logo-icon{display:inline-block;width:48px;height:48px;margin-right:24px}.index{overflow:auto;border-right:1px solid #000}.index__items{width:100%}.index__more{padding-top:24px}.index__error{padding:6px 24px;color:#FF856B;border-bottom:1px solid #ccc}.index-attribute--secondary,.legend__item,.legend__total{color:#777}.index-header__count{color:#777;font-size:14px;font-size:.875rem;line-height:inherit}@media screen and (max-width:44.9375em){.index-header__count{margin-left:12px}}.index-header__out-of{display:none}@media screen and (min-width:45em){.control-icon{transition:all .3s ease-in-out}.index-header__count{position:absolute;right:24px;bottom:0;padding-left:6px;padding-right:6px;font-size:14px;font-size:.875rem;line-height:1.71429;background-color:#fff;text-align:right;white-space:nowrap}.index-header__out-of--active{display:inline;margin-left:6px}}.index-filters{padding-left:24px;padding-right:24px}.index-filters__menu{margin-left:24px}.index-filters__filter{margin-bottom:24px}.index-filters__filter-value{display:block;margin-bottom:6px}.index-table table{margin-bottom:0}.index-table__header--small{width:48px}.index-table__header--medium{width:192px}.index-tiles.tiles--flush{margin-top:0}.index-tiles.tiles--flush .tile>.header{border-top:1px solid #ccc}.index-tiles.tiles--flush .tile>.header svg{margin-right:12px}.index-tiles.tiles--flush .tile>:not(.header){display:block}.index-tiles.tiles--flush .tile>:not(.index-attribute--medium):not(.header):not(.footer){-webkit-flex:1;flex:1}.index-list{margin:0;padding:24px}.index-list__item{margin-bottom:6px;padding:12px;border:1px solid #ccc;max-width:none;cursor:pointer}.index-list__item>.index-attribute{margin-right:12px}.index-list__item--selected{background-color:rgba(255,133,107,.2)}.index-list__item:hover:not(.index-list__item--selected){background-color:rgba(0,0,0,.1)}.index-list--flush{padding-left:0;padding-right:0}a.active>.label .label__icon.control-icon svg{fill:#000;stroke:#000}.layer{position:fixed;top:0;left:0;right:0;overflow:none;z-index:10}.layer__closer,.layer__container,.login{position:absolute}.layer__container{background-color:#eee;overflow:none;border-radius:4px;max-height:100vh;max-width:100vw}@media screen and (max-width:44.9375em){.label__text{display:none}.layer__container{padding:24px}.layer__closer{top:0;right:0}}@media screen and (min-width:45em){.label__icon{display:none}.layer__container{padding:24px 96px}.layer__closer{top:24px;right:24px}.layer--closeable .layer__container{padding-top:72px;padding-bottom:72px}}.layer--flush .layer__container{padding:0}.layer--align-center:not(.layer--hidden){background-image:radial-gradient(circle at top,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-center:not(.layer--hidden) .layer__container{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layer--align-left:not(.layer--hidden){background-image:radial-gradient(circle at left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-left:not(.layer--hidden) .layer__container{left:0;-webkit-animation:slide-right .2s ease-in-out forwards;animation:slide-right .2s ease-in-out forwards}.layer--align-right:not(.layer--hidden){background-image:radial-gradient(circle at right,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-right:not(.layer--hidden) .layer__container{right:0}.layer--align-top:not(.layer--hidden){background-image:radial-gradient(circle at top left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-top:not(.layer--hidden) .layer__container{top:0;-webkit-animation:slide-down .2s ease-in-out forwards;animation:slide-down .2s ease-in-out forwards}.layer--align-bottom:not(.layer--hidden){background-image:radial-gradient(circle at bottom left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--hidden.layer--align-left{right:auto}.layer--hidden.layer--align-left .layer__container{left:-100vw}@media screen and (min-width:45em){.layer--hidden.layer--peek.layer--align-left{right:auto}.layer--hidden.layer--peek.layer--align-left .layer__container{left:auto;right:-12px;border-right:2px solid #FF856B;-webkit-animation:peek-right .5s ease-in-out alternate 5;animation:peek-right .5s ease-in-out alternate 5}}@-webkit-keyframes peek-right{0%{right:-6px}100%{right:-12px}}@keyframes peek-right{0%{right:-6px}100%{right:-12px}}@-webkit-keyframes slide-right{0%{left:-100vw}100%{left:0}}@keyframes slide-right{0%{left:-100vw}100%{left:0}}@-webkit-keyframes slide-down{0%{top:-100vh}100%{top:0}}@keyframes slide-down{0%{top:-100vh}100%{top:0}}.legend{text-align:left;white-space:normal;display:inline-block;margin:0}.legend__item>*,.legend__total>*{vertical-align:top}.legend__item-label,.legend__total-label{display:inline-block;width:96px}.legend__item-value,.legend__total-value{display:inline-block;width:48px;text-align:right}.legend__item-units,.legend__total-units{display:inline-block;margin-left:6px}.legend__item{cursor:pointer}.legend__item svg.legend__item-swatch{width:12px;height:12px;margin-top:6px;margin-right:12px;overflow:visible}.legend__item svg.legend__item-swatch.color-index-unset{stroke:#ddd}.legend__item svg.legend__item-swatch.color-index-error{stroke:#FF856B}.legend__item svg.legend__item-swatch.color-index-warning{stroke:#FFB86B}.legend__item svg.legend__item-swatch.color-index-ok{stroke:#4EB976}.legend__item svg.legend__item-swatch.color-index-disabled,.legend__item svg.legend__item-swatch.color-index-unknown{stroke:#a8a8a8}.legend__item svg.legend__item-swatch.color-index-graph-1,.legend__item svg.legend__item-swatch.color-index-graph-6{stroke:#70ABC1}.legend__item svg.legend__item-swatch.color-index-graph-2,.legend__item svg.legend__item-swatch.color-index-graph-7{stroke:#FFCA90}.legend__item svg.legend__item-swatch.color-index-graph-3,.legend__item svg.legend__item-swatch.color-index-graph-8{stroke:#2E738E}.legend__item svg.legend__item-swatch.color-index-graph-4,.legend__item svg.legend__item-swatch.color-index-graph-9{stroke:#E29643}.legend__item svg.legend__item-swatch.color-index-graph-10,.legend__item svg.legend__item-swatch.color-index-graph-5{stroke:#767676}.legend__item svg.legend__item-swatch.color-index-grey-1,.legend__item svg.legend__item-swatch.color-index-grey-5{stroke:#333}.legend__item svg.legend__item-swatch.color-index-grey-2,.legend__item svg.legend__item-swatch.color-index-grey-6{stroke:#3B3B3B}.legend__item svg.legend__item-swatch.color-index-grey-3,.legend__item svg.legend__item-swatch.color-index-grey-7{stroke:#434343}.legend__item svg.legend__item-swatch.color-index-grey-4,.legend__item svg.legend__item-swatch.color-index-grey-8{stroke:#666}.legend__item svg.legend__item-swatch path{stroke-width:12px;transition-property:stroke-width;transition-duration:.3s;transition-timing-function:ease-in-out}.legend__item--active{color:#333}.legend__item--active svg.legend__item-swatch path{stroke-width:12px}.legend__total{margin-left:24px}.legend__total>*{margin-top:6px;padding-top:6px;border-top:1px dotted #ccc}.legend--single .legend__item-label,.legend--single .legend__item-swatch{display:none}.legend--single .legend__item-value{font-size:48px;font-size:3rem;line-height:1;font-weight:700}.login{top:0;left:0;right:0;overflow:hidden;z-index:100}.login__background{position:absolute;max-width:none}.login__background--portrait{width:auto;height:100%}.login__background--landscape{height:auto;width:100%}.login__container{position:relative;width:384px;margin:96px auto;animation-name:fadein;animation-duration:.5s}.login-form,.login__container{z-index:1;-webkit-animation-name:fadein;-webkit-animation-duration:.5s}@media screen and (max-width:44.9375em){.login__container{margin:48px 0;width:100%;border-radius:0}}.login__footer{position:absolute;left:0;right:0;bottom:6px;padding:6px 24px;background-color:rgba(255,255,255,.9);text-align:center}.login-form,.map{position:relative}.login-form{width:384px;padding:24px 24px 48px;background-color:#eee;border:1px solid #ccc;border-radius:4px;text-align:center;animation-name:fadein;animation-duration:.5s}@media screen and (max-width:44.9375em){.login-form{width:100%;border-radius:0}}.login-form__logo{display:inline-block;width:48px;height:48px;margin-bottom:24px}.login-form fieldset{text-align:left;border:none;margin-bottom:0}.login-form fieldset>*{width:100%;display:block}.login-form__submit{margin-top:24px;width:100%;background-color:#FF856B;color:#fff;font-size:24px;font-size:1.5rem;line-height:inherit}.login-form__error{margin-bottom:12px;color:#FF856B;text-align:left}.login-form__footer{margin-top:12px;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;line-height:36px}.map{padding:24px}.map__canvas{position:absolute;top:0;left:0;z-index:-1;opacity:.1}.map__canvas--highlight{opacity:1}.map__categories{margin:0}.map__category{position:relative;padding-top:24px;margin-bottom:12px;max-width:none}.map__category-label{position:absolute;top:0;left:0;font-size:14px;font-size:.875rem;line-height:1.71429}.map__category-items{margin:0;overflow:hidden;text-align:center}.menu--inline.menu--left,.menu__layer--align-right .menu__control,.menu__layer--left{text-align:right}.menu__layer,.object{overflow:auto}.map__item{display:inline-block;width:192px;border:1px solid #ccc;margin-right:12px;margin-bottom:12px;background-color:#fff;font-size:18px;font-size:1.125rem;line-height:1.33333}.map__item>a{display:block;padding:6px 12px;transition:background-color .2s}.map__item>a>*{display:inline-block}.menu__control--fixed-label .menu__control-icon,.menu__layer .menu__control-drop-icon{display:none}.map__item>a:hover{background-color:rgba(0,0,0,.1)}.map__item .status-icon{margin-right:6px}.map__item--active{border-color:#000}.menu{position:relative}.menu a:not(.button){color:gray}.menu a:not(.button):hover{color:#333}.menu a:not(.button).active{color:#ff5f3d}.menu:focus:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border:1px solid #70ABC1;box-shadow:0 0 1px 1px #70ABC1;pointer-events:none}.menu__control{cursor:pointer}.menu__control-drop-icon{width:24px;height:24px;margin-left:12px;stroke:#999}@media screen and (max-width:44.9375em){.menu__control--labelled .menu__control-drop-icon,.menu__control--labelled .menu__control-label{display:none}}@media screen and (min-width:45em){.menu__control--labelled .menu__control-icon{display:none}}.menu__layer{position:fixed;z-index:20;font-size:16px;font-size:1rem;line-height:inherit;background-color:#fff;border:none;border-radius:4px;box-shadow:0 2px 4px rgba(0,0,0,.3)}.menu__layer .menu__control-label{padding-left:24px}.menu__layer a{padding:12px 24px;white-space:nowrap;display:block}.menu__layer a:hover{text-decoration:none;background-color:rgba(0,0,0,.1)}.menu--controlled{display:inline-block;cursor:pointer}.menu--labelled{padding-left:24px;padding-right:24px}.menu--inline.menu--left>*{margin-left:24px;margin-right:0}.menu--inline.menu--left>:first-child{margin-left:0}.menu--inline.menu--right>*{margin-left:0;margin-right:24px}.menu--inline.menu--right>:last-child{margin-right:0}@media screen and (max-width:44.9375em){.menu--inline.menu--down:empty{width:0;margin:0;padding:0}}.menu--inline.menu--small .menu__control-icon svg,.menu--small .menu__control-icon svg,.menu__layer--small .menu__control-icon svg{width:18px;height:18px}[class*=background-color-index-] .menu--inline a,[class*=background-color-index-] .menu--inline a.active,[class*=background-color-index-] .menu--inline a:hover{color:inherit}[class*=background-color-index-] .menu--inline.menu--left a,[class*=background-color-index-] .menu--inline.menu--right a{text-decoration:none}[class*=background-color-index-] .menu--inline.menu--left a:hover:not(.active):not(.button),[class*=background-color-index-] .menu--inline.menu--right a:hover:not(.active):not(.button){text-decoration:underline}.menu--primary>a:not(.button):hover,.title a:hover,[class*=background-color-index-] .menu--inline.menu--down a:hover{text-decoration:none}[class*=background-color-index-] .menu--inline.menu--down a{padding:12px;border:1px solid transparent}[class*=background-color-index-] .menu--inline.menu--down a:hover:not(.active){border-color:rgba(0,0,0,.2)}[class*=background-color-index-] .menu--inline.menu--down a.active{background-color:rgba(0,0,0,.2)}.menu--small{font-size:16px;font-size:1rem;line-height:1.5}.menu--small .menu__control-drop-icon{margin-left:6px}.menu--primary{display:block;max-height:100vh;overflow:auto}.menu--inline.menu--left>*,.menu--inline.menu--right>*,.menu__layer--left>*,.menu__layer--right>*{display:inline-block}.menu--primary>.header:first-child{margin-left:-24px;margin-right:-24px;margin-bottom:24px}.menu--primary>a:not(.button){padding:12px 24px}.menu--primary>a:not(.button):hover:not(.active){background-color:rgba(0,0,0,.1)}.menu--primary>a:not(.button).active{color:#333;background-color:rgba(255,133,107,.2)}.menu--inline.menu--right,.menu__layer--right{text-align:left}.menu--inline.menu--small,.menu__layer--small{font-size:1em}.menu--inline.menu--small .menu__control-label,.menu__layer--small .menu__control-label{padding:12px}.menu--inline.menu--small a,.menu__layer--small a{padding:6px 12px}.menu--inline.menu--down>*,.menu--inline.menu--up>*,.menu__layer--down>*,.menu__layer--up>*{display:block}.menu--inline.menu--down h1,.menu--inline.menu--down h2,.menu--inline.menu--down h3,.menu--inline.menu--down h4,.menu--inline.menu--down h5,.menu--inline.menu--down h6,.menu--inline.menu--up h1,.menu--inline.menu--up h2,.menu--inline.menu--up h3,.menu--inline.menu--up h4,.menu--inline.menu--up h5,.menu--inline.menu--up h6,.menu__layer--down h1,.menu__layer--down h2,.menu__layer--down h3,.menu__layer--down h4,.menu__layer--down h5,.menu__layer--down h6,.menu__layer--up h1,.menu__layer--up h2,.menu__layer--up h3,.menu__layer--up h4,.menu__layer--up h5,.menu__layer--up h6{margin:24px 0 0;padding:12px 0;border-top:1px solid #ccc;min-width:192px}.menu--inline.menu--down h1:first-child,.menu--inline.menu--down h2:first-child,.menu--inline.menu--down h3:first-child,.menu--inline.menu--down h4:first-child,.menu--inline.menu--down h5:first-child,.menu--inline.menu--down h6:first-child,.menu--inline.menu--up h1:first-child,.menu--inline.menu--up h2:first-child,.menu--inline.menu--up h3:first-child,.menu--inline.menu--up h4:first-child,.menu--inline.menu--up h5:first-child,.menu--inline.menu--up h6:first-child,.menu__layer--down h1:first-child,.menu__layer--down h2:first-child,.menu__layer--down h3:first-child,.menu__layer--down h4:first-child,.menu__layer--down h5:first-child,.menu__layer--down h6:first-child,.menu__layer--up h1:first-child,.menu__layer--up h2:first-child,.menu__layer--up h3:first-child,.menu__layer--up h4:first-child,.menu__layer--up h5:first-child,.menu__layer--up h6:first-child{margin-top:0}@-webkit-keyframes draw-meter{0%{stroke-dashoffset:192px}100%{stroke-dashoffset:0}}@keyframes draw-meter{0%{stroke-dashoffset:192px}100%{stroke-dashoffset:0}}.meter{display:inline-block;position:relative}.meter__threshold{stroke:#333}.meter__labels{display:-webkit-flex;display:flex;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.meter__label-max,.meter__label-min{-webkit-flex:1;flex:1}.meter__label-max{text-align:right}.meter--bar .meter__graphic{width:192px;height:24px}.meter--bar .meter__bar{stroke-width:24px;stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0}.meter--bar .meter__bar.color-index-unset{stroke:#ddd}.meter--bar .meter__bar.color-index-error{stroke:#FF856B}.meter--bar .meter__bar.color-index-warning{stroke:#FFB86B}.meter--bar .meter__bar.color-index-ok{stroke:#4EB976}.meter--bar .meter__bar.color-index-disabled,.meter--bar .meter__bar.color-index-unknown{stroke:#a8a8a8}.meter--bar .meter__bar.color-index-graph-1,.meter--bar .meter__bar.color-index-graph-6{stroke:#70ABC1}.meter--bar .meter__bar.color-index-graph-2,.meter--bar .meter__bar.color-index-graph-7{stroke:#FFCA90}.meter--bar .meter__bar.color-index-graph-3,.meter--bar .meter__bar.color-index-graph-8{stroke:#2E738E}.meter--bar .meter__bar.color-index-graph-4,.meter--bar .meter__bar.color-index-graph-9{stroke:#E29643}.meter--bar .meter__bar.color-index-graph-10,.meter--bar .meter__bar.color-index-graph-5{stroke:#767676}.meter--bar .meter__bar.color-index-grey-1,.meter--bar .meter__bar.color-index-grey-5{stroke:#333}.meter--bar .meter__bar.color-index-grey-2,.meter--bar .meter__bar.color-index-grey-6{stroke:#3B3B3B}.meter--bar .meter__bar.color-index-grey-3,.meter--bar .meter__bar.color-index-grey-7{stroke:#434343}.meter--bar .meter__bar.color-index-grey-4,.meter--bar .meter__bar.color-index-grey-8{stroke:#666}.meter--bar .meter__threshold{stroke-width:1}.meter--bar .meter__active{display:inline-block;vertical-align:top;margin-left:12px}.meter--bar .meter__active-units{color:#777;margin-left:.5em}.meter--bar .meter__labels{width:192px}@media screen and (max-width:44.9375em){.meter--arc,.meter--circle{width:192px;margin:0 auto}}.meter--arc svg.meter__graphic,.meter--circle svg.meter__graphic{width:192px;height:192px}.meter--arc .meter.series-pre path,.meter--circle .meter.series-pre path{stroke-dashoffset:768px}.meter--arc .meter__slice,.meter--circle .meter__slice{stroke-width:24px;stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0;fill:none;cursor:pointer;stroke:#eee}.meter--arc .meter__slice.color-index-unset,.meter--circle .meter__slice.color-index-unset{stroke:#ddd}.meter--arc .meter__slice.color-index-error,.meter--circle .meter__slice.color-index-error{stroke:#FF856B}.meter--arc .meter__slice.color-index-warning,.meter--circle .meter__slice.color-index-warning{stroke:#FFB86B}.meter--arc .meter__slice.color-index-ok,.meter--circle .meter__slice.color-index-ok{stroke:#4EB976}.meter--arc .meter__slice.color-index-disabled,.meter--arc .meter__slice.color-index-unknown,.meter--circle .meter__slice.color-index-disabled,.meter--circle .meter__slice.color-index-unknown{stroke:#a8a8a8}.meter--arc .meter__slice.color-index-graph-1,.meter--arc .meter__slice.color-index-graph-6,.meter--circle .meter__slice.color-index-graph-1,.meter--circle .meter__slice.color-index-graph-6{stroke:#70ABC1}.meter--arc .meter__slice.color-index-graph-2,.meter--arc .meter__slice.color-index-graph-7,.meter--circle .meter__slice.color-index-graph-2,.meter--circle .meter__slice.color-index-graph-7{stroke:#FFCA90}.meter--arc .meter__slice.color-index-graph-3,.meter--arc .meter__slice.color-index-graph-8,.meter--circle .meter__slice.color-index-graph-3,.meter--circle .meter__slice.color-index-graph-8{stroke:#2E738E}.meter--arc .meter__slice.color-index-graph-4,.meter--arc .meter__slice.color-index-graph-9,.meter--circle .meter__slice.color-index-graph-4,.meter--circle .meter__slice.color-index-graph-9{stroke:#E29643}.meter--arc .meter__slice.color-index-graph-10,.meter--arc .meter__slice.color-index-graph-5,.meter--circle .meter__slice.color-index-graph-10,.meter--circle .meter__slice.color-index-graph-5{stroke:#767676}.meter--arc .meter__slice.color-index-grey-1,.meter--arc .meter__slice.color-index-grey-5,.meter--circle .meter__slice.color-index-grey-1,.meter--circle .meter__slice.color-index-grey-5{stroke:#333}.meter--arc .meter__slice.color-index-grey-2,.meter--arc .meter__slice.color-index-grey-6,.meter--circle .meter__slice.color-index-grey-2,.meter--circle .meter__slice.color-index-grey-6{stroke:#3B3B3B}.meter--arc .meter__slice.color-index-grey-3,.meter--arc .meter__slice.color-index-grey-7,.meter--circle .meter__slice.color-index-grey-3,.meter--circle .meter__slice.color-index-grey-7{stroke:#434343}.meter--arc .meter__slice.color-index-grey-4,.meter--arc .meter__slice.color-index-grey-8,.meter--circle .meter__slice.color-index-grey-4,.meter--circle .meter__slice.color-index-grey-8{stroke:#666}.meter--arc .meter__slice-indicator.color-index-unset,.meter--circle .meter__slice-indicator.color-index-unset{fill:#ddd}.meter--arc .meter__slice-indicator.color-index-error,.meter--circle .meter__slice-indicator.color-index-error{fill:#FF856B}.meter--arc .meter__slice-indicator.color-index-warning,.meter--circle .meter__slice-indicator.color-index-warning{fill:#FFB86B}.meter--arc .meter__slice-indicator.color-index-ok,.meter--circle .meter__slice-indicator.color-index-ok{fill:#4EB976}.meter--arc .meter__slice-indicator.color-index-disabled,.meter--arc .meter__slice-indicator.color-index-unknown,.meter--circle .meter__slice-indicator.color-index-disabled,.meter--circle .meter__slice-indicator.color-index-unknown{fill:#a8a8a8}.meter--arc .meter__slice-indicator.color-index-graph-1,.meter--arc .meter__slice-indicator.color-index-graph-6,.meter--circle .meter__slice-indicator.color-index-graph-1,.meter--circle .meter__slice-indicator.color-index-graph-6{fill:#70ABC1}.meter--arc .meter__slice-indicator.color-index-graph-2,.meter--arc .meter__slice-indicator.color-index-graph-7,.meter--circle .meter__slice-indicator.color-index-graph-2,.meter--circle .meter__slice-indicator.color-index-graph-7{fill:#FFCA90}.meter--arc .meter__slice-indicator.color-index-graph-3,.meter--arc .meter__slice-indicator.color-index-graph-8,.meter--circle .meter__slice-indicator.color-index-graph-3,.meter--circle .meter__slice-indicator.color-index-graph-8{fill:#2E738E}.meter--arc .meter__slice-indicator.color-index-graph-4,.meter--arc .meter__slice-indicator.color-index-graph-9,.meter--circle .meter__slice-indicator.color-index-graph-4,.meter--circle .meter__slice-indicator.color-index-graph-9{fill:#E29643}.meter--arc .meter__slice-indicator.color-index-graph-10,.meter--arc .meter__slice-indicator.color-index-graph-5,.meter--circle .meter__slice-indicator.color-index-graph-10,.meter--circle .meter__slice-indicator.color-index-graph-5{fill:#767676}.meter--arc .meter__slice-indicator.color-index-grey-1,.meter--arc .meter__slice-indicator.color-index-grey-5,.meter--circle .meter__slice-indicator.color-index-grey-1,.meter--circle .meter__slice-indicator.color-index-grey-5{fill:#333}.meter--arc .meter__slice-indicator.color-index-grey-2,.meter--arc .meter__slice-indicator.color-index-grey-6,.meter--circle .meter__slice-indicator.color-index-grey-2,.meter--circle .meter__slice-indicator.color-index-grey-6{fill:#3B3B3B}.meter--arc .meter__slice-indicator.color-index-grey-3,.meter--arc .meter__slice-indicator.color-index-grey-7,.meter--circle .meter__slice-indicator.color-index-grey-3,.meter--circle .meter__slice-indicator.color-index-grey-7{fill:#434343}.meter--arc .meter__slice-indicator.color-index-grey-4,.meter--arc .meter__slice-indicator.color-index-grey-8,.meter--circle .meter__slice-indicator.color-index-grey-4,.meter--circle .meter__slice-indicator.color-index-grey-8{fill:#666}.meter--arc .meter__slice--active,.meter--circle .meter__slice--active{stroke-width:24px}.meter--arc .meter__threshold,.meter--circle .meter__threshold{stroke-width:24px;stroke-linecap:butt}.meter--arc .meter__active,.meter--circle .meter__active{position:absolute;top:0;left:0;width:192px;margin-top:72px;text-align:center;white-space:normal;pointer-events:none}.meter--vertical.meter--bar,.search__layer-header{white-space:nowrap}.meter--arc .meter__active-value,.meter--circle .meter__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.meter--arc .meter__active-units,.meter--circle .meter__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.meter--arc .meter__active-label,.meter--circle .meter__active-label{width:50%;margin:0 auto;font-size:14px;font-size:.875rem;line-height:16px}.meter--arc .meter__labels,.meter--circle .meter__labels{width:192px}.meter--arc .meter__legend,.meter--circle .meter__legend{margin:24px 0 0}.meter--arc svg.meter__graphic{height:144px}.meter--arc .meter__labels{padding-left:12px;padding-right:12px}.meter--circle svg.meter__graphic{height:192px}.meter--vertical{display:-webkit-flex;display:flex}.meter--vertical .meter__labels{-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;justify-content:space-between}.meter--vertical .meter__label-max,.meter--vertical .meter__label-min{-webkit-flex:0 0 auto;flex:0 0 auto;text-align:left}.section--centered,.settings{text-align:center}.meter--vertical.meter--bar svg.meter__graphic{width:24px;height:192px}.meter--vertical.meter--bar .meter__active{margin-top:72px;margin-left:12px}.meter--vertical.meter--bar .meter__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.meter--vertical.meter--bar .meter__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.meter--vertical.meter--bar .meter__labels{position:absolute;left:36px;vertical-align:top;width:auto;height:192px}.meter--vertical.meter--bar .meter__legend{margin-left:24px}.meter--vertical.meter--arc svg.meter__graphic{width:144px;height:192px}.meter--vertical.meter--arc .meter__labels{width:auto;padding-top:12px;padding-bottom:12px}.meter--small.meter--bar svg.meter__graphic{width:144px}.meter--small.meter--arc svg.meter__graphic,.meter--small.meter--circle svg.meter__graphic{width:144px;height:144px}.meter--small.meter--arc .meter__active,.meter--small.meter--circle .meter__active{width:144px;margin-top:48px}.meter--small.meter--arc .meter__active-value,.meter--small.meter--circle .meter__active-value{font-size:36px;font-size:2.25rem;line-height:inherit}.meter--small.meter--arc svg.meter__graphic{height:120px}@media screen and (min-width:45em){.meter--bar .meter__bar{-webkit-animation:draw-meter 1.5s;animation:draw-meter 1.5s}.meter--arc .meter__slice,.meter--circle .meter__slice{-webkit-animation:draw-stroke 3s;animation:draw-stroke 3s}.meter--small .meter__legend{display:none}}.meter--large.meter--bar svg.meter__graphic{width:288px;height:36px}.meter--large.meter--bar .meter__active{font-size:36px;font-size:2.25rem;line-height:inherit}.meter--large.meter--arc svg.meter__graphic,.meter--large.meter--circle svg.meter__graphic{width:288px;height:288px}.meter--large.meter--arc .meter__active,.meter--large.meter--circle .meter__active{width:288px;margin-top:96px}.meter--large.meter--arc .meter__active-value,.meter--large.meter--circle .meter__active-value{font-size:64px;font-size:4rem;line-height:inherit}.meter--large.meter--arc svg.meter__graphic{height:264px}.notifications-control__icon,.notifications__icon{vertical-align:middle;width:48px;height:48px}.notification{padding:24px}.notification__status{margin-right:12px}.notification__message{font-size:18px;font-size:1.125rem;line-height:1.33333;margin-bottom:24px;vertical-align:middle}.notification__state,.notification__timestamp{display:block;color:#777}.notification--error{background-color:rgba(255,133,107,.15)}.notification--warning{background-color:rgba(255,184,107,.15)}.notification--ok{background-color:rgba(78,185,118,.15)}.notification--disabled,.notification--unknown{background-color:rgba(168,168,168,.15)}.notification--flush{padding-left:0;padding-right:0}.notifications{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(128,128,128,.6);z-index:10}.notifications__container,.panel{border-bottom:1px solid #ccc;background-color:#fff}.notifications__container{position:absolute;top:0;right:0;min-width:300px;padding:96px 24px 24px;border-left:1px solid #ccc;border-bottom-left-radius:4px}.notifications__icon{position:absolute;top:24px;right:84px}.object__container{padding:24px}.object ol,.object ul{margin:0;list-style-type:none}.object li{width:auto}.object__attribute{margin-bottom:12px}.object__attribute-name{display:block;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.object__attribute-value{display:block;font-size:18px;font-size:1.125rem;line-height:1.33333}.object__attribute-value ol,.object__attribute-value ul{margin-left:24px;padding-top:24px;padding-bottom:24px}.object__attribute--container>.object__attribute-name{font-weight:700}.object__attribute--unset .object__attribute-value{font-style:italic;color:#777}.object__attribute--array>.object__attribute-value>ol>li{border-top:1px solid #ccc}.object__attribute--array>.object__attribute-value>ol>li:last-child{border-bottom:1px solid #ccc}.object__attribute--array>.object__attribute-value>ol>li>ul{padding-top:0;padding-bottom:0}.panel{padding:24px}.panel:last-of-type{border-bottom:none}.panel__title{text-transform:uppercase;font-weight:400}.panel>a{display:block}.panel a.call-to-action{display:inline-block;font-size:20px;font-size:1.25rem;line-height:1.2;margin-bottom:24px;text-decoration:none;padding:12px 24px;border-radius:4px;color:#fff}.panel--index-1 .panel__title{color:#2E738E}.panel--index-1 a.call-to-action{background-color:#2E738E}.panel--index-2 .panel__title{color:#E29643}.panel--index-2 a.call-to-action{background-color:#E29643}@media screen and (max-width:44.9375em){.panel{padding:24px}.panel>h2{margin-bottom:12px}}.radio-button{margin-right:12px;cursor:pointer}.radio-button__input{opacity:0;position:absolute}.radio-button__input:checked+.radio-button__control:after{content:"";display:block;position:absolute;top:3px;left:3px;width:16px;height:16px;background-color:#FF856B;border-radius:16px}.radio-button__control,.search,.search-input,.search__layer-contents{display:inline-block}.radio-button__input:focus+.radio-button__control{content:"";border-color:#70ABC1;box-shadow:0 0 1px 1px #70ABC1}.radio-button__control{position:relative;width:24px;height:24px;margin-right:12px;vertical-align:middle;background-color:inherit;color:#ff5f3d;border:1px solid #ccc;border-radius:24px}.search:focus{margin:-1px;border:1px solid #70ABC1;box-shadow:0 0 1px 1px #70ABC1}.search-input__layer,.search__layer{box-shadow:0 2px 4px rgba(0,0,0,.3)}.search--controlled,.search__control{cursor:pointer}.search__input{margin-right:0}.header .search__input{padding:0 12px;font-size:inherit}.header .search__input:focus{padding:0 11px}.search__layer{position:fixed;z-index:10;font-size:20px;font-size:1.25rem;line-height:inherit;background-color:#fff;border:none;border-radius:4px}.search__layer--inline{margin-left:-1px}.search__layer input{margin-right:0;box-sizing:border-box}.search__layer .search__control{display:inline-block;vertical-align:top}.search__layer .search__suggestion{padding:6px 24px;cursor:pointer}.search__layer .search__suggestion--active,.search__layer .search__suggestion:hover{background-color:rgba(0,0,0,.1)}.search--inline .search__input{width:100%;box-sizing:border-box}.header .search--inline .search__input{padding:0;border:none}.search-input{position:relative}.search-input__input{width:100%;height:100%;display:block;padding-right:60px}.search-input__input:focus{padding-right:59px}.search-input__control{position:absolute;bottom:0;right:12px}.search-input__layer{position:fixed;z-index:20;background-color:#fff;border:none;border-radius:0 0 4px 4px}.search-input__layer input[type=search]{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-radius:0}.search-input__layer-suggestion{padding:6px 12px;cursor:pointer}.search-input__layer-suggestion--active,.search-input__layer-suggestion:hover{background-color:rgba(0,0,0,.1)}.search-input--active .search-input__input{border-bottom-left-radius:0;border-bottom-right-radius:0}.section{padding-top:48px;padding-bottom:48px}.section__content>h2,.section__content>h3,.section__content>h4{padding-left:24px;padding-right:24px}.section--right .section__content{display:-webkit-flex;display:flex}.section--right .section__content.center-column__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}@media screen and (max-width:44.9375em){.section--right .section__content.center-column__content>.menu:first-child{width:100%}.section--right .section__content.center-column__content>.menu:first-child:empty{width:0;margin:0;padding:0}}.section--right .section__content>.flex-1{-webkit-flex:1;flex:1}.section--right .section__content>.flex-2{-webkit-flex:2;flex:2}.section--right .section__content>.flex-3{-webkit-flex:3;flex:3}.section--right .section__content>.flex-4{-webkit-flex:4;flex:4}@media screen and (min-width:45em){.section--right .section__content>*{margin-right:48px}.section--right .section__content>:last-child{margin-right:0}.section--right .section__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}}@media screen and (max-width:44.9375em){.section--right .section__content{-webkit-flex-direction:column;flex-direction:column}.section--right .section__content>*{margin-bottom:48px;padding-bottom:48px}.section--right .section__content>:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}}.section--compact{padding-top:0;padding-bottom:0}.section--compact .section__content{padding-top:12px;padding-bottom:12px}.section--centered .section__content>*{margin-left:auto;margin-right:auto}.section--flush .section__content>h2,.section--flush .section__content>h3,.section--flush .section__content>h4{padding-left:0;padding-right:0}.react-gravatar{border-radius:24px;border:2px solid transparent;margin:0 24px;overflow:hidden;cursor:pointer;transition:all .3s ease-in-out}.table--selectable tbody tr td,.tile--selectable{transition:background-color .2s}.react-gravatar:hover{border-color:#FF856B}@media screen and (max-width:44.9375em){.react-gravatar{width:28px;height:28px}}@media screen and (min-width:45em){.react-gravatar{width:52px;height:52px}}.session{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(128,128,128,.6);z-index:10}.session__container{position:absolute;top:0;right:0;min-width:300px;padding:96px 24px 24px;background-color:#fff;border-left:1px solid #ccc;border-bottom:1px solid #ccc;border-bottom-left-radius:4px}.session .react-gravatar{position:absolute;top:24px;right:24px}.session__actions{margin-top:24px;padding-top:24px;border-top:1px solid #ccc}.session a{cursor:pointer}.settings{position:relative}.settings__panels{display:inline-block}.settings__panel{vertical-align:top}.sidebar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100vh;background-color:#fff}@media screen and (max-width:44.9375em){.sidebar{width:calc(100vw - 48px)}}.sidebar>*{-webkit-flex:1 0;flex:1 0}.sidebar>.footer,.sidebar>.header{-webkit-flex:0 0 auto;flex:0 0 auto}.sidebar--primary{background-image:linear-gradient(to left,#dfdfdf,#f5f5f5 10px);background-color:none}@media screen and (min-width:45em){.sidebar{width:384px}.split{display:-webkit-flex;display:flex;height:100vh}.split>*{-webkit-flex:1 0;flex:1 0;position:relative;height:100vh;overflow:auto}.split--flex-left>:last-child:not(:first-child),.split--flex-right>:first-child:not(:last-child){-webkit-flex:0 0 384px;flex:0 0 384px}}.tile,.title{overflow:hidden}.table table{width:100%}.table td,.table th{padding:11px 12px;vertical-align:top;text-align:left}.table__more,.tbd{text-align:center}.table td:first-child,.table th:first-child{padding-left:24px}.table td:last-child,.table th:last-child{padding-right:24px}.table th{font-weight:100;font-size:20px;font-size:1.25rem;line-height:1.2;border-bottom:1px solid #ccc}.table__mirror{position:absolute;top:0;left:0;right:0}.table__mirror>thead{position:fixed;background-color:rgba(255,255,255,.9)}@media screen and (max-width:44.9375em){.table__mirror>thead{position:static}}.table__more{margin-top:24px;margin-bottom:24px}.table--selectable tbody tr{cursor:pointer}.table--selectable tbody tr.table__row--selected td{background-color:rgba(255,133,107,.2)}.table--selectable tbody tr:hover:not(.table__row--selected) td{background-color:rgba(0,0,0,.1)}.tbd{padding:96px;font-size:96px;font-size:6rem;line-height:1;background-color:#ccc;color:#fff}.tiles{padding:12px}.tiles--moreable{position:relative;padding-bottom:48px}.tiles--moreable .tiles__more{position:absolute;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width:45em){.tiles{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.tiles>.tile{-webkit-flex:0 0 192px;flex:0 0 192px;flex-grow:1}.tiles>.tile--wide{-webkit-flex-basis:100%;flex-basis:100%}.tiles--flush{margin:-24px}@media screen and (min-width:45em){.tiles--flush>.tile{-webkit-flex:0 0 168px;flex:0 0 168px;flex-grow:1}}.tiles--small>.tile{-webkit-flex-basis:96px;flex-basis:96px}.tiles--fill{-webkit-align-items:stretch;align-items:stretch;-webkit-align-content:stretch;align-content:stretch}.tiles--fill>.tile{-webkit-flex-grow:1;flex-grow:1}}.tile{padding:12px}@media screen and (max-width:44.9375em){.tile{margin:0;border-radius:0;text-align:center}}.tile .status-icon{margin-right:6px}.title,.title img,.title svg:not(.control-icon){margin-right:12px}.tile>.header{margin-bottom:24px}.tile>.header .header__content{border-bottom:none}.tile--selectable{cursor:pointer}.tile--selectable.tile--selected{background-color:rgba(255,133,107,.2)}.tile--selectable:hover:not(.tile--selected){background-color:rgba(0,0,0,.1)}.title{display:inline;text-overflow:ellipsis;font-weight:400}.title a{color:inherit}[class*=background-color-index-] .title a:hover{text-decoration:underline}@media screen and (max-width:44.9375em){.title{font-size:24px;font-size:1.5rem;line-height:inherit}.title img,.title svg:not(.control-icon){height:24px}}.title--interactive:hover{color:#FF856B;cursor:pointer}@media screen and (min-width:45em){.tile{-webkit-flex:0 0 192px;flex:0 0 192px;flex-grow:1}.title{font-size:24px;font-size:1.5rem;line-height:inherit;font-weight:600}.title img,.title svg:not(.control-icon){height:48px}.title--interactive:hover{transition:color .3s}}.title--menu .control-icon{margin-left:12px}.title--menu:hover{cursor:pointer}.title--menu:hover .control-icon{stroke:#FF856B}.clearfix:after{content:"";display:table;clear:both} \ No newline at end of file + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */dfn,img{font-style:italic}img,legend{border:0}a,ins,u{text-decoration:none}a,a:visited{color:#FF8706}code.hljs,input,select,textarea{border:1px solid #ccc}.button--small,button,select{text-transform:none}.index-list,.legend,.map__categories,.map__category-items{list-style-type:none}.menu:focus,.search:focus,a:active,a:hover,input,input[type=range]:focus,select,textarea{outline:0}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{max-width:100%;vertical-align:middle}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}#loading,.tbd{font-style:italic}button{overflow:visible}button,html input[type=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[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver}table{border-collapse:collapse;border-spacing:0}blockquote,body,caption,dd,dl,fieldset,figure,form,h1,h2,h3,h4,h5,h6,hr,legend,ol,p,pre,table,td,th,ul{margin:0;padding:0}abbr[title],dfn[title]{cursor:help}a,select{cursor:pointer}ins{border-bottom:1px solid}html{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:1em;line-height:1.5;background-color:#fff;color:#333;overflow-y:scroll;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:'Source Sans Pro',Arial,sans-serif}*,:after,:before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}address,blockquote,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,ol,p,pre,table,ul{margin-bottom:1.5rem}dd,ol,ul{margin-left:3rem}h6{font-size:14px;font-size:.875rem;line-height:1.71429}li>ol,li>ul{margin-bottom:0}.gm-style img,img[height],img[width]{max-width:none}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGPS42wKzre0cxmO5m5GyTsY.ttf) format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro-Regular'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlEY6Fu39Tt9XkmtSosaMoEA.ttf) format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGLlcMrNrsnL9dgADnXgYJjs.ttf) format('truetype')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-It'),url(http://fonts.gstatic.com/s/sourcesanspro/v9/M2Jd71oPJhLKp0zdtTvoMzpKUtbt71woJ25xl7KOGD0.ttf) format('truetype')}dd,li,p{max-width:576px}.h1,h1{font-size:48px;font-size:3rem;line-height:1;font-weight:600}.h2,.h3,h2,h3{font-size:36px;line-height:1.33333}.h2,h2{font-size:2.25rem;font-weight:400}.h3,.h4,.h5,h3,h4,h5{font-weight:100}.h3,h3{font-size:2.25rem}.h4,h4{font-size:24px;font-size:1.5rem;line-height:1}.h5,h5{font-size:20px;font-size:1.25rem;line-height:1.2}a{background-color:transparent}a:hover{text-decoration:underline}.menu__layer a:hover,[class*=background-color-index-] .menu--inline.menu--left a,[class*=background-color-index-] .menu--inline.menu--right a{text-decoration:none}a.active{color:#333}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}input,select,textarea{font-size:16px;font-size:1rem;line-height:1.5;padding:11px 23px;border-radius:4px;margin-right:12px;background-color:inherit}input:focus,select:focus,textarea:focus{padding:10px 22px;border-width:2px;border-color:#70ABC1}input::-moz-focus-inner,select::-moz-focus-inner,textarea::-moz-focus-inner{border:none;outline:0}input.error,select.error,textarea.error{border-color:#FF856B}select{border-color:#ccc;padding-right:24px;-webkit-appearance:none;-moz-appearance:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAAAXNSR0IArs4c6QAAARpJREFUKBVjnDlzJuu/f//cGagAmJiYTjCCzAEaWg+kGkBsCsCG58+fB4MNBBkyY8aMeYyMjIlkGnjy69evjkVFRd+ZYAa8ePEiDcjeBeOTQN/9+fOnL8gwkB64C0Gczs5OXn5+/sNAl+qD+ESAN////7fKyMi4DVOLYiBIcPLkyVKsrKwngIbKwhRho4EGgVzkDDTsOLI83Mswwdzc3GdAxV5A/keYGDoNlP8HFItBNwykDsNAkGBmZuYVIBUIxL9AfCygCGjYOizi2A0EKUxPT98PdEkyFk39QMMmYhEHC2F1IUwxUOMSILsaxgdasAaY1kpgfGw0RqRgUwRMozOB4trApOXS0NDwA5saksRCQ0OZ+/v7BYjRBACZeF+tn9zqUwAAAABJRU5ErkJggg==) center right 12px no-repeat}select:hover{background-color:#eee}select::-moz-focus-inner{border:none}select.plain{border:none}input[type=range]{position:relative;-webkit-appearance:none;border-color:transparent;height:24px;padding:0;overflow-x:hidden}input[type=range]::-moz-focus-inner{border:none}input[type=range]::-webkit-slider-runnable-track{width:100%;height:12px;cursor:pointer;background:0 0;border:1px solid #ccc}input[type=range]::-webkit-slider-thumb{position:relative;height:24px;width:24px;overflow:visible;-webkit-appearance:none;margin-top:-7px}input[type=range]::-webkit-slider-thumb:before{content:"";position:absolute;left:-3000px;right:12px;top:6px;bottom:6px;background-color:#FF856B;pointer-events:none}.layer,.layer--align-bottom:not(.layer--hidden) .layer__container,.login{bottom:0}input[type=range]::-webkit-slider-thumb:after{content:"";position:absolute;border:1px solid #ccc;height:21px;width:21px;border-radius:24px;background-color:#fff;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.2)}input[type=range]::-moz-range-track{width:100%;height:12px;cursor:pointer;background:0 0;border:1px solid #ccc}input[type=range]::-moz-range-thumb{position:relative;height:24px;width:24px;overflow:visible;border-radius:24px;border:none;background-color:#FF856B}input[type=range]::-ms-track{width:100%;height:12px;cursor:pointer;border:1px solid transparent;background:0 0;border-width:16px 0;color:transparent}input[type=range]::-ms-fill-lower{background:#FF856B;border-radius:4px}input[type=range]::-ms-fill-upper{background:#fff;border-radius:4px}input[type=range]::-ms-thumb{position:relative;height:24px;width:24px;overflow:visible}.i-list-bare{margin:0;padding:0;list-style:none}.app--centered .document,.app--centered .section,.app--centered>.footer,.app--centered>div>.footer{padding-left:24px;padding-right:24px}.app--centered .document__content,.app--centered .section__content,.app--centered>.footer .footer__content,.app--centered>.header .header__content,.app--centered>div>.footer .footer__content,.app--centered>div>.header .header__content{width:100%;max-width:960px;margin-left:auto;margin-right:auto}#loading{position:absolute;width:100%;height:100%;background-color:#ddd;text-align:center;padding-top:100px;font-size:48px;color:#ccc}@media screen and (min-width:45em){body,html{height:100%;width:100%;overflow:hidden}.app{position:absolute;top:0;bottom:0;left:0;right:0;overflow:auto}}.app--inline,.chart{position:relative}.app--centered .section .document{padding-left:0;padding-right:0}.app--centered .section .document__content{width:auto;max-width:none}.attribute{padding:24px 24px 12px}@media screen and (min-width:45em){.attribute{width:480px;max-width:100%}.form--compact .attribute{width:240px}}@media screen and (max-width:44.9375em){.attribute{width:100vw}}.attribute__label{display:block;text-align:left;font-size:14px;font-size:.875rem;line-height:24px;color:#777}.button,a.button,button,input[type=button],input[type=submit]{height:48px;padding:10px 46px;background-color:transparent;border:2px solid #818181;border-radius:4px;color:#333;font-size:18px;font-size:1.125rem;line-height:24px;text-transform:none;font-weight:inherit;text-decoration:none;cursor:pointer;text-align:center;outline:0}.button:hover{border-width:3px;padding:9px 45px}.button:active{border-color:#5b5b5b;background-color:#5b5b5b;color:#fff}.button:focus{border-color:#70ABC1;box-shadow:0 0 1px 1px #70ABC1}.button--strong{background-color:#818181}.button--primary{border-color:#FF856B}.button--primary.button--strong{background-color:#FF856B;color:#fff}.button--primary.button--strong:active,.button--primary:active{border-color:#ff461f;background-color:#ff461f}.button--alternate{border-color:#70ABC1}.button--alternate.button--strong{background-color:#70ABC1}.button--alternate.button--strong:active,.button--alternate:active{border-color:#45879f;background-color:#45879f}.button--large{height:72px;padding:22px 46px}.button--large:hover{padding:21px 45px}.button--small{border:none;height:24px;padding:0 12px;font-size:16px;font-size:1rem;line-height:24px;color:#FF8706;font-weight:400}.button--disabled,.button--disabled:active{border-color:#CBCBCB;background-color:#CBCBCB}.button--small:hover{border-width:0;padding:0 12px}.button--disabled{opacity:.2;cursor:default}.check-box,.control-icon,.donut__slice,.form-field--text,.form-field--text .form-field__label,.index-list__item,.legend__item,.menu--controlled,.menu__control,.meter--arc .meter__slice,.meter--circle .meter__slice,.react-gravatar,.search--controlled,.search-input__layer-suggestion,.search__control,.search__layer .search__suggestion,.session a,.table--selectable tbody tr,.tile--selectable,.title--interactive:hover,.title--menu:hover{cursor:pointer}.button--disabled:active{color:#333}@-webkit-keyframes reveal-chart{0%{opacity:0}100%{opacity:1}}@keyframes reveal-chart{0%{opacity:0}100%{opacity:1}}.chart{display:block}.chart__grid{stroke:#ccc}.chart__graphic{width:100%;height:384px;max-height:calc(100vh - 144px)}.chart__values-line{stroke-width:3px}.chart__values-line.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.chart__values-line.color-index-unset{stroke:#ddd}.chart__values-line.color-index-error{stroke:#FF856B}.chart__values-line.color-index-warning{stroke:#FFB86B}.chart__values-line.color-index-ok{stroke:#4EB976}.chart__values-line.color-index-disabled,.chart__values-line.color-index-unknown{stroke:#a8a8a8}.chart__values-line.color-index-graph-1,.chart__values-line.color-index-graph-6{stroke:#70ABC1}.chart__values-line.color-index-graph-2,.chart__values-line.color-index-graph-7{stroke:#FFCA90}.chart__values-line.color-index-graph-3,.chart__values-line.color-index-graph-8{stroke:#2E738E}.chart__values-line.color-index-graph-4,.chart__values-line.color-index-graph-9{stroke:#E29643}.chart__values-line.color-index-graph-10,.chart__values-line.color-index-graph-5{stroke:#767676}.chart__values-line.color-index-grey-1,.chart__values-line.color-index-grey-5{stroke:#333}.chart__values-line.color-index-grey-2,.chart__values-line.color-index-grey-6{stroke:#3B3B3B}.chart__values-line.color-index-grey-3,.chart__values-line.color-index-grey-7{stroke:#434343}.chart__values-line.color-index-grey-4,.chart__values-line.color-index-grey-8{stroke:#666}.chart__values--loading{stroke-width:24px}.chart__values--loading.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.chart__values--loading.color-index-unset{stroke:#ddd}.chart__values--loading.color-index-error{stroke:#FF856B}.chart__values--loading.color-index-warning{stroke:#FFB86B}.chart__values--loading.color-index-ok{stroke:#4EB976}.chart__values--loading.color-index-disabled,.chart__values--loading.color-index-unknown{stroke:#a8a8a8}.chart__values--loading.color-index-graph-1,.chart__values--loading.color-index-graph-6{stroke:#70ABC1}.chart__values--loading.color-index-graph-2,.chart__values--loading.color-index-graph-7{stroke:#FFCA90}.chart__values--loading.color-index-graph-3,.chart__values--loading.color-index-graph-8{stroke:#2E738E}.chart__values--loading.color-index-graph-4,.chart__values--loading.color-index-graph-9{stroke:#E29643}.chart__values--loading.color-index-graph-10,.chart__values--loading.color-index-graph-5{stroke:#767676}.chart__values--loading.color-index-grey-1,.chart__values--loading.color-index-grey-5{stroke:#333}.chart__values--loading.color-index-grey-2,.chart__values--loading.color-index-grey-6{stroke:#3B3B3B}.chart__values--loading.color-index-grey-3,.chart__values--loading.color-index-grey-7{stroke:#434343}.chart__values--loading.color-index-grey-4,.chart__values--loading.color-index-grey-8{stroke:#666}.chart__threshold{stroke-width:1px;stroke:#333}.chart__xaxis-index text{fill:#777}.chart__xaxis-index--active text{fill:#333}.chart__front-xband-background{fill:transparent}.chart__cursor{stroke:#70ABC1;stroke-width:3;pointer-events:none}.chart__legend{padding:12px;pointer-events:none}@media screen and (max-width:44.9375em){.chart__legend{margin:0 auto}}@media screen and (min-width:45em){.chart__values g{-webkit-animation:reveal-chart 1.5s;animation:reveal-chart 1.5s}.chart__legend{position:absolute;left:0;margin:0;background-color:rgba(255,255,255,.8)}}.chart--area .chart__gradient.color-index-error .begin,.chart--bar .chart__gradient.color-index-error .begin{stop-color:#FF856B}.chart--area .chart__gradient.color-index-error .mid,.chart--bar .chart__gradient.color-index-error .mid{stop-color:#FF856B;stop-opacity:.5}.chart--area .chart__gradient.color-index-error .end,.chart--bar .chart__gradient.color-index-error .end{stop-color:#FF856B;stop-opacity:0}.chart--area .chart__gradient.color-index-warning .begin,.chart--bar .chart__gradient.color-index-warning .begin{stop-color:#FFB86B}.chart--area .chart__gradient.color-index-warning .mid,.chart--bar .chart__gradient.color-index-warning .mid{stop-color:#FFB86B;stop-opacity:.5}.chart--area .chart__gradient.color-index-warning .end,.chart--bar .chart__gradient.color-index-warning .end{stop-color:#FFB86B;stop-opacity:0}.chart--area .chart__gradient.color-index-ok .begin,.chart--bar .chart__gradient.color-index-ok .begin{stop-color:#4EB976}.chart--area .chart__gradient.color-index-ok .mid,.chart--bar .chart__gradient.color-index-ok .mid{stop-color:#4EB976;stop-opacity:.5}.chart--area .chart__gradient.color-index-ok .end,.chart--bar .chart__gradient.color-index-ok .end{stop-color:#4EB976;stop-opacity:0}.chart--area .chart__gradient.color-index-unknown .begin,.chart--bar .chart__gradient.color-index-unknown .begin{stop-color:#a8a8a8}.chart--area .chart__gradient.color-index-unknown .mid,.chart--bar .chart__gradient.color-index-unknown .mid{stop-color:#a8a8a8;stop-opacity:.5}.chart--area .chart__gradient.color-index-unknown .end,.chart--bar .chart__gradient.color-index-unknown .end{stop-color:#a8a8a8;stop-opacity:0}.chart--area .chart__gradient.color-index-disabled .begin,.chart--bar .chart__gradient.color-index-disabled .begin{stop-color:#a8a8a8}.chart--area .chart__gradient.color-index-disabled .mid,.chart--bar .chart__gradient.color-index-disabled .mid{stop-color:#a8a8a8;stop-opacity:.5}.chart--area .chart__gradient.color-index-disabled .end,.chart--bar .chart__gradient.color-index-disabled .end{stop-color:#a8a8a8;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-1 .begin,.chart--area .chart__gradient.color-index-graph-6 .begin,.chart--bar .chart__gradient.color-index-graph-1 .begin,.chart--bar .chart__gradient.color-index-graph-6 .begin{stop-color:#70ABC1}.chart--area .chart__gradient.color-index-graph-1 .mid,.chart--area .chart__gradient.color-index-graph-6 .mid,.chart--bar .chart__gradient.color-index-graph-1 .mid,.chart--bar .chart__gradient.color-index-graph-6 .mid{stop-color:#70ABC1;stop-opacity:.5}.chart--area .chart__gradient.color-index-graph-1 .end,.chart--area .chart__gradient.color-index-graph-6 .end,.chart--bar .chart__gradient.color-index-graph-1 .end,.chart--bar .chart__gradient.color-index-graph-6 .end{stop-color:#70ABC1;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-2 .begin,.chart--area .chart__gradient.color-index-graph-7 .begin,.chart--bar .chart__gradient.color-index-graph-2 .begin,.chart--bar .chart__gradient.color-index-graph-7 .begin{stop-color:#FFCA90}.chart--area .chart__gradient.color-index-graph-2 .mid,.chart--area .chart__gradient.color-index-graph-7 .mid,.chart--bar .chart__gradient.color-index-graph-2 .mid,.chart--bar .chart__gradient.color-index-graph-7 .mid{stop-color:#FFCA90;stop-opacity:.5}.chart--area .chart__gradient.color-index-graph-2 .end,.chart--area .chart__gradient.color-index-graph-7 .end,.chart--bar .chart__gradient.color-index-graph-2 .end,.chart--bar .chart__gradient.color-index-graph-7 .end{stop-color:#FFCA90;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-3 .begin,.chart--area .chart__gradient.color-index-graph-8 .begin,.chart--bar .chart__gradient.color-index-graph-3 .begin,.chart--bar .chart__gradient.color-index-graph-8 .begin{stop-color:#2E738E}.chart--area .chart__gradient.color-index-graph-3 .mid,.chart--area .chart__gradient.color-index-graph-8 .mid,.chart--bar .chart__gradient.color-index-graph-3 .mid,.chart--bar .chart__gradient.color-index-graph-8 .mid{stop-color:#2E738E;stop-opacity:.5}.chart--area .chart__gradient.color-index-graph-3 .end,.chart--area .chart__gradient.color-index-graph-8 .end,.chart--bar .chart__gradient.color-index-graph-3 .end,.chart--bar .chart__gradient.color-index-graph-8 .end{stop-color:#2E738E;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-4 .begin,.chart--area .chart__gradient.color-index-graph-9 .begin,.chart--bar .chart__gradient.color-index-graph-4 .begin,.chart--bar .chart__gradient.color-index-graph-9 .begin{stop-color:#E29643}.chart--area .chart__gradient.color-index-graph-4 .mid,.chart--area .chart__gradient.color-index-graph-9 .mid,.chart--bar .chart__gradient.color-index-graph-4 .mid,.chart--bar .chart__gradient.color-index-graph-9 .mid{stop-color:#E29643;stop-opacity:.5}.chart--area .chart__gradient.color-index-graph-4 .end,.chart--area .chart__gradient.color-index-graph-9 .end,.chart--bar .chart__gradient.color-index-graph-4 .end,.chart--bar .chart__gradient.color-index-graph-9 .end{stop-color:#E29643;stop-opacity:0}.chart--area .chart__gradient.color-index-graph-10 .begin,.chart--area .chart__gradient.color-index-graph-5 .begin,.chart--bar .chart__gradient.color-index-graph-10 .begin,.chart--bar .chart__gradient.color-index-graph-5 .begin{stop-color:#767676}.chart--area .chart__gradient.color-index-graph-10 .mid,.chart--area .chart__gradient.color-index-graph-5 .mid,.chart--bar .chart__gradient.color-index-graph-10 .mid,.chart--bar .chart__gradient.color-index-graph-5 .mid{stop-color:#767676;stop-opacity:.5}.chart--area .chart__gradient.color-index-graph-10 .end,.chart--area .chart__gradient.color-index-graph-5 .end,.chart--bar .chart__gradient.color-index-graph-10 .end,.chart--bar .chart__gradient.color-index-graph-5 .end{stop-color:#767676;stop-opacity:0}.chart--small .chart__graphic{height:192px}.chart--large .chart__graphic{height:576px}.check-box{margin-right:12px}.check-box__input{opacity:0;position:absolute}.check-box__input:checked+.check-box__control:after{content:"";display:block;position:absolute;top:3px;left:3px;width:16px;height:16px;background-color:#FF856B}.check-box__input:focus+.check-box__control{content:"";border-color:#70ABC1;box-shadow:0 0 1px 1px #70ABC1}.check-box__control{position:relative;display:inline-block;width:24px;height:24px;margin-right:12px;vertical-align:middle;background-color:inherit;border:1px solid #ccc;border-radius:4px}.check-box--toggle .check-box__control{width:48px;height:24px;background-color:#eee;border:none;transition:background-color .3s}.check-box--toggle .check-box__control:after{content:"";display:block;position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:#fff;border-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:margin-left .3s}.layer__container,.login-form{box-shadow:0 2px 4px rgba(0,0,0,.3)}.check-box--toggle .check-box__input:checked+.check-box__control{background-color:#FF856B}.check-box--toggle .check-box__input:checked+.check-box__control:after{top:2px;left:2px;width:20px;height:20px;background-color:#fff;margin-left:24px}.header-color-index-neutral-1 dt,.header-color-index-neutral-1 h1,.header-color-index-neutral-1 h2,.header-color-index-neutral-1 h3,.header-color-index-neutral-1 h4,.header-color-index-neutral-1 h5,.header-color-index-neutral-1 h6,.header-color-index-neutral-4 dt,.header-color-index-neutral-4 h1,.header-color-index-neutral-4 h2,.header-color-index-neutral-4 h3,.header-color-index-neutral-4 h4,.header-color-index-neutral-4 h5,.header-color-index-neutral-4 h6{color:#2E738E}.background-color-index-neutral-1,.background-color-index-neutral-4{background-color:#2E738E;color:#fff}.background-color-index-neutral-1 a,.background-color-index-neutral-4 a{color:#fff}.header-color-index-neutral-2 dt,.header-color-index-neutral-2 h1,.header-color-index-neutral-2 h2,.header-color-index-neutral-2 h3,.header-color-index-neutral-2 h4,.header-color-index-neutral-2 h5,.header-color-index-neutral-2 h6,.header-color-index-neutral-5 dt,.header-color-index-neutral-5 h1,.header-color-index-neutral-5 h2,.header-color-index-neutral-5 h3,.header-color-index-neutral-5 h4,.header-color-index-neutral-5 h5,.header-color-index-neutral-5 h6{color:#E29643}.background-color-index-neutral-2,.background-color-index-neutral-5{background-color:#E29643;color:#fff}.background-color-index-neutral-2 a,.background-color-index-neutral-5 a{color:#fff}.header-color-index-neutral-3 dt,.header-color-index-neutral-3 h1,.header-color-index-neutral-3 h2,.header-color-index-neutral-3 h3,.header-color-index-neutral-3 h4,.header-color-index-neutral-3 h5,.header-color-index-neutral-3 h6,.header-color-index-neutral-6 dt,.header-color-index-neutral-6 h1,.header-color-index-neutral-6 h2,.header-color-index-neutral-6 h3,.header-color-index-neutral-6 h4,.header-color-index-neutral-6 h5,.header-color-index-neutral-6 h6{color:#767676}.background-color-index-neutral-3,.background-color-index-neutral-6{background-color:#767676;color:#fff}.background-color-index-neutral-3 a,.background-color-index-neutral-6 a{color:#fff}.background-color-index-accent-1,.background-color-index-accent-3{background-color:#70ABC1;color:#fff}.background-color-index-accent-1 a,.background-color-index-accent-3 a{color:#fff}.background-color-index-accent-2,.background-color-index-accent-4{background-color:#FFCA90;color:#fff}.background-color-index-accent-2 a,.background-color-index-accent-4 a{color:#fff}.background-color-index-grey-1,.background-color-index-grey-5{background-color:#333;color:#fff}.background-color-index-grey-1 a,.background-color-index-grey-5 a{color:#fff}.background-color-index-grey-2,.background-color-index-grey-6{background-color:#3B3B3B;color:#fff}.background-color-index-grey-2 a,.background-color-index-grey-6 a{color:#fff}.background-color-index-grey-3,.background-color-index-grey-7{background-color:#434343;color:#fff}.background-color-index-grey-3 a,.background-color-index-grey-7 a{color:#fff}.background-color-index-grey-4,.background-color-index-grey-8{background-color:#666;color:#fff}.background-color-index-grey-4 a,.background-color-index-grey-8 a{color:#fff}.center-column{padding-left:24px;padding-right:24px}.center-column .center-column__content{width:100%;max-width:960px;margin-left:auto;margin-right:auto}@media screen and (min-width:45em){.dashboard{height:calc(100vh - 96px)}}@media screen and (max-width:44.9375em){.dashboard{height:calc(100vh - 48px)}}.distribution{position:relative;display:block}.distribution__graphic{width:100%;height:384px;max-height:calc(100vh - 144px)}.distribution__box.color-index-unset{fill:#ddd}.distribution__box.color-index-error{fill:#FF856B}.distribution__box.color-index-warning{fill:#FFB86B}.distribution__box.color-index-ok{fill:#4EB976}.distribution__box.color-index-disabled,.distribution__box.color-index-unknown{fill:#a8a8a8}.distribution__box.color-index-graph-1,.distribution__box.color-index-graph-6{fill:#70ABC1}.distribution__box.color-index-graph-2,.distribution__box.color-index-graph-7{fill:#FFCA90}.distribution__box.color-index-graph-3,.distribution__box.color-index-graph-8{fill:#2E738E}.distribution__box.color-index-graph-4,.distribution__box.color-index-graph-9{fill:#E29643}.distribution__box.color-index-graph-10,.distribution__box.color-index-graph-5{fill:#767676}.distribution__box.color-index-grey-1,.distribution__box.color-index-grey-5{fill:#333}.distribution__box.color-index-grey-2,.distribution__box.color-index-grey-6{fill:#3B3B3B}.distribution__box.color-index-grey-3,.distribution__box.color-index-grey-7{fill:#434343}.distribution__box.color-index-grey-4,.distribution__box.color-index-grey-8{fill:#666}.distribution__box-label{fill:rgba(255,255,255,.8)}.distribution__loading-indicator{stroke-width:24px}.distribution__loading-indicator.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.distribution__loading-indicator.color-index-unset{stroke:#ddd}.distribution__loading-indicator.color-index-error{stroke:#FF856B}.distribution__loading-indicator.color-index-warning{stroke:#FFB86B}.distribution__loading-indicator.color-index-ok{stroke:#4EB976}.distribution__loading-indicator.color-index-disabled,.distribution__loading-indicator.color-index-unknown{stroke:#a8a8a8}.distribution__loading-indicator.color-index-graph-1,.distribution__loading-indicator.color-index-graph-6{stroke:#70ABC1}.distribution__loading-indicator.color-index-graph-2,.distribution__loading-indicator.color-index-graph-7{stroke:#FFCA90}.distribution__loading-indicator.color-index-graph-3,.distribution__loading-indicator.color-index-graph-8{stroke:#2E738E}.distribution__loading-indicator.color-index-graph-4,.distribution__loading-indicator.color-index-graph-9{stroke:#E29643}.distribution__loading-indicator.color-index-graph-10,.distribution__loading-indicator.color-index-graph-5{stroke:#767676}.distribution__loading-indicator.color-index-grey-1,.distribution__loading-indicator.color-index-grey-5{stroke:#333}.distribution__loading-indicator.color-index-grey-2,.distribution__loading-indicator.color-index-grey-6{stroke:#3B3B3B}.distribution__loading-indicator.color-index-grey-3,.distribution__loading-indicator.color-index-grey-7{stroke:#434343}.distribution__loading-indicator.color-index-grey-4,.distribution__loading-indicator.color-index-grey-8{stroke:#666}.distribution--small .distribution__graphic{height:192px}.distribution--large .distribution__graphic{height:576px}.document{width:100%}.document--no-contents .document__content{padding-left:0}.document section{margin-top:24px;margin-bottom:24px;padding-top:24px}.document header>img,.document section>img{margin-top:48px;margin-bottom:48px;display:block;max-width:576px}@media screen and (max-width:44.9375em){.document header>img,.document section>img{max-width:100%}}.document header>iframe,.document section>iframe{width:100%;max-width:576px;height:400px}@media screen and (min-width:45em) and (max-width:63.9375em){.document header>iframe,.document section>iframe{height:250px}}@media screen and (max-width:44.9375em){.document header>iframe,.document section>iframe{height:250px}.document header>ol,.document header>ul,.document section>ol,.document section>ul{padding-left:24px;padding-right:24px;margin-left:0;margin-bottom:24px}}.document header>dl>dt,.document section>dl>dt{margin-top:24px;margin-bottom:6px;text-transform:uppercase}.document header>dl>dt code,.document section>dl>dt code{text-transform:none;white-space:pre-wrap}.document header>dl>dd,.document section>dl>dd{margin-left:0}.document header>h2,.document section>h2{position:relative;padding-top:24px}.document header>h2:after,.document section>h2:after{position:absolute;content:'';top:0;left:0;right:0;border-top:1px solid #ccc}.document section:first-child{margin-top:0;padding-top:0}.document section:first-child>h2{padding-top:0}.document section:first-child>h2:after{border-top:none}@-webkit-keyframes draw-stroke{0%{stroke-dashoffset:768px}100%{stroke-dashoffset:0}}@keyframes draw-stroke{0%{stroke-dashoffset:768px}100%{stroke-dashoffset:0}}@media screen and (max-width:44.9375em){.document header>dl>dd,.document section>dl>dd{padding-right:24px}.donut{width:192px;margin:0 auto}}.donut.series-pre path{stroke-dashoffset:768px}.donut__graphic-container{position:relative;width:192px;height:192px}.donut svg.donut__graphic{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible}.donut__slice{stroke-width:24px;stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0;fill:none;stroke:#eee}.donut__slice.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.donut__slice.color-index-unset{stroke:#ddd}.donut__slice.color-index-error{stroke:#FF856B}.donut__slice.color-index-warning{stroke:#FFB86B}.donut__slice.color-index-ok{stroke:#4EB976}.donut__slice.color-index-disabled,.donut__slice.color-index-unknown{stroke:#a8a8a8}.donut__slice.color-index-graph-1,.donut__slice.color-index-graph-6{stroke:#70ABC1}.donut__slice.color-index-graph-2,.donut__slice.color-index-graph-7{stroke:#FFCA90}.donut__slice.color-index-graph-3,.donut__slice.color-index-graph-8{stroke:#2E738E}.donut__slice.color-index-graph-4,.donut__slice.color-index-graph-9{stroke:#E29643}.donut__slice.color-index-graph-10,.donut__slice.color-index-graph-5{stroke:#767676}.donut__slice.color-index-grey-1,.donut__slice.color-index-grey-5{stroke:#333}.donut__slice.color-index-grey-2,.donut__slice.color-index-grey-6{stroke:#3B3B3B}.donut__slice.color-index-grey-3,.donut__slice.color-index-grey-7{stroke:#434343}.donut__slice.color-index-grey-4,.donut__slice.color-index-grey-8{stroke:#666}.donut__slice-indicator.color-index-unset{fill:#ddd}.donut__slice-indicator.color-index-error{fill:#FF856B}.donut__slice-indicator.color-index-warning{fill:#FFB86B}.donut__slice-indicator.color-index-ok{fill:#4EB976}.donut__slice-indicator.color-index-disabled,.donut__slice-indicator.color-index-unknown{fill:#a8a8a8}.donut__slice-indicator.color-index-graph-1,.donut__slice-indicator.color-index-graph-6{fill:#70ABC1}.donut__slice-indicator.color-index-graph-2,.donut__slice-indicator.color-index-graph-7{fill:#FFCA90}.donut__slice-indicator.color-index-graph-3,.donut__slice-indicator.color-index-graph-8{fill:#2E738E}.donut__slice-indicator.color-index-graph-4,.donut__slice-indicator.color-index-graph-9{fill:#E29643}.donut__slice-indicator.color-index-graph-10,.donut__slice-indicator.color-index-graph-5{fill:#767676}.donut__slice-indicator.color-index-grey-1,.donut__slice-indicator.color-index-grey-5{fill:#333}.donut__slice-indicator.color-index-grey-2,.donut__slice-indicator.color-index-grey-6{fill:#3B3B3B}.donut__slice-indicator.color-index-grey-3,.donut__slice-indicator.color-index-grey-7{fill:#434343}.donut__slice-indicator.color-index-grey-4,.donut__slice-indicator.color-index-grey-8{fill:#666}.donut__slice--active{stroke-width:24px}.donut__active{position:absolute;width:100%;margin-top:72px;text-align:center;white-space:normal;pointer-events:none}.donut__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.donut__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.donut__active-label{width:50%;margin:0 auto;font-size:14px;font-size:.875rem;line-height:16px}.donut__max-label,.donut__min-label{position:absolute;bottom:0;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.form,.form-field{position:relative}.donut__min-label{left:12px}.donut__max-label{right:12px}.donut__legend{margin:24px 0 0}@media screen and (min-width:45em){.donut__slice{-webkit-animation:draw-stroke 3s;animation:draw-stroke 3s}.donut--landscape{white-space:nowrap}.donut--landscape .donut__graphic-container,.donut--landscape .donut__legend{display:inline-block;vertical-align:middle}.donut--landscape .donut__legend{margin:0 0 0 24px}}.donut--portrait .donut__graphic-container{display:block}.donut--portrait .donut__legend{margin:24px 0 0}.donut--partial .donut__graphic-container{height:168px}.donut--small .donut__graphic-container{width:144px;height:144px}.donut--small .donut__active{margin-top:48px}@media screen and (min-width:45em){.donut--small .donut__legend{display:none}}.footer{min-height:48px;line-height:48px}.footer__content{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;width:100%;padding-left:24px;padding-right:24px}.footer__content.center-column__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}@media screen and (max-width:44.9375em){.footer__content.center-column__content>.menu:first-child{width:100%}.footer__content.center-column__content>.menu:first-child:empty{width:0;margin:0;padding:0}}.footer__content>.flex-1{-webkit-flex:1;flex:1}.footer__content>.flex-2{-webkit-flex:2;flex:2}.footer__content>.flex-3{-webkit-flex:3;flex:3}.footer__content>.flex-4{-webkit-flex:4;flex:4}.footer__content>*{margin-right:48px}.footer__content>:last-child{margin-right:0}@media screen and (max-width:44.9375em){.footer__content>:last-child{text-align:left}}@media screen and (min-width:45em) and (max-width:63.9375em){.footer__content>:last-child{text-align:left}}.footer--primary{height:auto;padding:24px}.footer--primary .footer__content{position:relative;color:#777}.footer--primary .footer__content p{padding-top:12px;margin:0;max-width:none;text-align:right;line-height:24px}@media screen and (max-width:44.9375em){.footer--primary .footer__content{display:block}}@media screen and (min-width:45em) and (max-width:63.9375em){.footer--primary .footer__content{display:block}}.footer--centered .footer__content{display:block;text-align:center}.footer--centered .footer__content>*{margin-right:auto;margin-left:auto;text-align:center}.footer--flush .footer__content{padding-left:0;padding-right:0}@media screen and (min-width:45em){.form{min-width:480px}}.form>.header .header__wrapper{background-color:inherit}.form>.footer{margin-top:24px}.form fieldset{border:none;margin:24px 24px 2rem}.form fieldset legend{font-size:24px;font-size:1.5rem;line-height:1;font-weight:100;margin-bottom:12px;color:#777}.layer .form{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;max-height:calc(100vh - 48px);max-width:calc(100vw - 48px)}.layer .form>.footer,.layer .form>.header{-webkit-flex:0 0 auto;flex:0 0 auto}.layer .form>.form-fields{overflow:auto}@media screen and (max-width:44.9375em){.layer .form>.form-fields{margin-left:-24px;margin-right:-24px}.layer .form>.form-fields>fieldset>:not(.form-field){margin-left:24px;margin-right:24px}}.form--fill{min-width:0}.form--flush fieldset{margin-left:0;margin-right:0}.form--compact{min-width:240px}.form-field{padding:6px 24px;border:1px solid #ccc;margin-bottom:-1px;background-color:#fff}.header--fixed .header__content,.header__wrapper{background-color:rgba(255,255,255,.9)}.form-field:last-child,.form-field__contents>.table--selectable table{margin-bottom:0}@media screen and (min-width:45em){.form-field{width:480px;max-width:100%}.form--compact .form-field{width:240px}}@media screen and (max-width:44.9375em){.form-field{width:100vw}}.form--fill .form-field,.form-field__contents>.search-input,.header__content{width:100%}.form-field__label{display:block;font-size:14px;font-size:.875rem;line-height:24px;color:#777}.form-field__contents{display:block}.form-field__contents>.search-input input,.form-field__contents>input[type=email],.form-field__contents>input[type=number],.form-field__contents>input[type=password],.form-field__contents>input[type=range],.form-field__contents>input[type=text],.form-field__contents>select,.form-field__contents>textarea{border:none;padding:0;width:100%;margin-right:0;border-radius:0;font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__contents>.table--selectable table td:first-child,.form-field__contents>.table--selectable table th:first-child,.header__content{padding-left:24px}.form-field__contents>.search-input input:focus,.form-field__contents>input[type=email]:focus,.form-field__contents>input[type=number]:focus,.form-field__contents>input[type=password]:focus,.form-field__contents>input[type=range]:focus,.form-field__contents>input[type=text]:focus,.form-field__contents>select:focus,.form-field__contents>textarea:focus{border:none}.form-field__contents>select{background-position:center right}.form-field__contents>textarea{vertical-align:top;height:auto}.control-icon,.header__content svg,.logo-icon,.status-icon{vertical-align:middle}.form-field__contents>.check-box,.form-field__contents>.radio-button{font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__contents>.search-input .search-input__control{right:-12px}.form-field__contents>.table--selectable{margin-left:-24px;margin-right:-24px;font-size:18px;font-size:1.125rem;line-height:1.33333}.form-field__help{display:block;margin-top:6px;line-height:24px;color:#777}.form-field__error{display:block;float:right;color:#FF856B;line-height:24px}.form-field--error{z-index:1;border-color:#FF856B}.form-field--focus{z-index:2;border-color:#70ABC1}.header{font-size:24px;font-size:1.5rem;line-height:inherit}@media screen and (max-width:44.9375em){.header{height:48px}}@media screen and (min-width:45em){.header{height:72px}}.header__content{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;white-space:nowrap;padding-right:24px;border-bottom:1px solid #ccc}@media screen and (max-width:44.9375em){.header__wrapper{height:48px}.header__content{line-height:48px}}@media screen and (min-width:45em){.header__wrapper{height:72px}.header__content{line-height:72px}}.header__content>*{-webkit-flex:1 0;flex:1 0;overflow:hidden}.header__content>:last-child:not(:first-child){-webkit-flex:0 0 auto;flex:0 0 auto}.header__content .title,.header__content>h1,.header__content>h2,.header__content>h3,.header__content>h4{margin-bottom:0;line-height:inherit}.header__content .title svg,.header__content>h1 svg,.header__content>h2 svg,.header__content>h3 svg,.header__content>h4 svg{height:48px}.header__content>.menu{-webkit-flex:0 0 auto;flex:0 0 auto}.header__content .status-icon{margin-right:12px}.header__content a{color:inherit}.header--fixed .header__wrapper{position:absolute;top:0;left:0;right:0;z-index:3}.header--fixed .header__content{border-bottom:1px solid #ccc}@media screen and (min-width:45em){.header--large,.header--large .header__wrapper{height:96px}.header--large .header__content{line-height:96px}.header--small,.header--small .header__wrapper{height:48px}.header--small .header__content{line-height:48px}.header--small .header__content .title svg,.header--small .header__content>h1 svg,.header--small .header__content>h2 svg,.header--small .header__content>h3 svg,.header--small .header__content>h4 svg{height:24px}.header--fixed .header__content{position:fixed}}.header--fixed.header--primary .header__wrapper{position:fixed;background-color:rgba(255,255,255,.9)}.header--fixed.header--primary .header__content{position:static;background-color:transparent}.index-header,.index__container,.index__items{position:relative}.header--flush .header__content,.header--flush .header__wrapper{padding-left:0;padding-right:0}.header--primary .header__content,.header--primary .header__wrapper{border-bottom:none}.control-icon{display:inline-block;width:48px;height:48px;fill:#999;stroke:#999}.control-icon:hover{fill:#000;stroke:#000}.control-icon__badge circle{fill:#FF856B}.control-icon__badge text{stroke:#fff;fill:#fff}.control-icon--active{fill:#000;stroke:#000}.status-icon{width:24px;height:24px}.status-icon .status-icon__base{fill:#a8a8a8}.status-icon-error .status-icon__base{fill:#FF856B}.status-icon-warning .status-icon__base{fill:#FFB86B}.status-icon-ok .status-icon__base{fill:#4EB976}.status-icon-disabled .status-icon__base,.status-icon-unknown .status-icon__base{fill:#a8a8a8}.status-icon-label .status-icon__base{fill:#999}.status-icon__detail{fill:#fff}.status-icon--large{width:48px;height:48px}.status-icon--small{width:12px;height:12px;margin-top:6px;margin-bottom:6px}.status-icon--small .status-icon__detail{display:none}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.icon-changing{width:24px;height:24px;-webkit-animation:rotate 1.5s linear infinite;animation:rotate 1.5s linear infinite}.icon-changing--small{width:12px;height:12px}.icon-spinning{width:24px;height:24px;-webkit-animation:rotate 4s steps(4,end) infinite;animation:rotate 4s steps(4,end) infinite}.icon-spinning--small{width:12px;height:12px}.logo-icon{display:inline-block;width:48px;height:48px;margin-right:24px}.index{overflow:auto;border-right:1px solid #000}.index__items{width:100%}.index__more{padding-top:24px}.index__error{padding:6px 24px;color:#FF856B;border-bottom:1px solid #ccc}.index-attribute--secondary,.legend__item,.legend__total{color:#777}.index-header__count{color:#777;font-size:14px;font-size:.875rem;line-height:inherit}@media screen and (max-width:44.9375em){.index-header__count{margin-left:12px}}.index-header__out-of{display:none}@media screen and (min-width:45em){.control-icon{transition:all .3s ease-in-out}.index-header__count{position:absolute;right:24px;bottom:0;padding-left:6px;padding-right:6px;font-size:14px;font-size:.875rem;line-height:1.71429;background-color:#fff;text-align:right;white-space:nowrap}.index-header__out-of--active{display:inline;margin-left:6px}}.index-filters{padding-left:24px;padding-right:24px}.index-filters__menu{margin-left:24px}.index-filters__filter{margin-bottom:24px}.index-filters__filter-value{display:block;margin-bottom:6px}.index-table table{margin-bottom:0}.index-table__header--small{width:48px}.index-table__header--medium{width:192px}.index-tiles.tiles--flush{margin-top:0}.index-tiles.tiles--flush .tile>.header{border-top:1px solid #ccc}.index-tiles.tiles--flush .tile>.header svg{margin-right:12px}.index-tiles.tiles--flush .tile>:not(.header){display:block}.index-tiles.tiles--flush .tile>:not(.index-attribute--medium):not(.header):not(.footer){-webkit-flex:1;flex:1}.index-list{margin:0;padding:24px}.index-list__item{margin-bottom:6px;padding:12px;border:1px solid #ccc;max-width:none}.index-list__item>.index-attribute{margin-right:12px}.index-list__item--selected{background-color:rgba(255,133,107,.2)}.index-list__item:hover:not(.index-list__item--selected){background-color:rgba(0,0,0,.1)}.index-list--flush{padding-left:0;padding-right:0}a.active>.label .label__icon.control-icon svg{fill:#000;stroke:#000}.layer{position:fixed;top:0;left:0;right:0;overflow:none;z-index:10}.layer__closer,.layer__container,.login{position:absolute}.layer__container{background-color:#eee;overflow:none;border-radius:4px;max-height:100vh;max-width:100vw}@media screen and (max-width:44.9375em){.label__text{display:none}.layer__container{padding:24px}.layer__closer{top:0;right:0}}@media screen and (min-width:45em){.label__icon{display:none}.layer__container{padding:24px 96px}.layer__closer{top:24px;right:24px}.layer--closeable .layer__container{padding-top:72px;padding-bottom:72px}}.layer--flush .layer__container{padding:0}.layer--align-center:not(.layer--hidden){background-image:radial-gradient(circle at top,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-center:not(.layer--hidden) .layer__container{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layer--align-left:not(.layer--hidden){background-image:radial-gradient(circle at left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-left:not(.layer--hidden) .layer__container{left:0;-webkit-animation:slide-right .2s ease-in-out forwards;animation:slide-right .2s ease-in-out forwards}.layer--align-right:not(.layer--hidden){background-image:radial-gradient(circle at right,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-right:not(.layer--hidden) .layer__container{right:0}.layer--align-top:not(.layer--hidden){background-image:radial-gradient(circle at top left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--align-top:not(.layer--hidden) .layer__container{top:0;-webkit-animation:slide-down .2s ease-in-out forwards;animation:slide-down .2s ease-in-out forwards}.layer--align-bottom:not(.layer--hidden){background-image:radial-gradient(circle at bottom left,#eee,#eee 20%,rgba(128,128,128,.6))}.layer--hidden.layer--align-left{right:auto}.layer--hidden.layer--align-left .layer__container{left:-100vw}@media screen and (min-width:45em){.layer--hidden.layer--peek.layer--align-left{right:auto}.layer--hidden.layer--peek.layer--align-left .layer__container{left:auto;right:-12px;border-right:10px solid #FF856B;-webkit-animation:peek-right .5s ease-in-out alternate 5;animation:peek-right .5s ease-in-out alternate 5}}@-webkit-keyframes peek-right{0%{right:-6px}100%{right:-12px}}@keyframes peek-right{0%{right:-6px}100%{right:-12px}}@-webkit-keyframes slide-right{0%{left:-100vw}100%{left:0}}@keyframes slide-right{0%{left:-100vw}100%{left:0}}@-webkit-keyframes slide-down{0%{top:-100vh}100%{top:0}}@keyframes slide-down{0%{top:-100vh}100%{top:0}}.legend{text-align:left;white-space:normal;display:inline-block;margin:0}.legend__item>*,.legend__total>*{vertical-align:top}.legend__item-label,.legend__total-label{display:inline-block;width:96px}.legend__item-value,.legend__total-value{display:inline-block;width:48px;text-align:right}.legend__item-units,.legend__total-units{display:inline-block;margin-left:6px}.legend__item svg.legend__item-swatch{width:12px;height:12px;margin-top:6px;margin-right:12px;overflow:visible}.legend__item svg.legend__item-swatch.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.legend__item svg.legend__item-swatch.color-index-unset{stroke:#ddd}.legend__item svg.legend__item-swatch.color-index-error{stroke:#FF856B}.legend__item svg.legend__item-swatch.color-index-warning{stroke:#FFB86B}.legend__item svg.legend__item-swatch.color-index-ok{stroke:#4EB976}.legend__item svg.legend__item-swatch.color-index-disabled,.legend__item svg.legend__item-swatch.color-index-unknown{stroke:#a8a8a8}.legend__item svg.legend__item-swatch.color-index-graph-1,.legend__item svg.legend__item-swatch.color-index-graph-6{stroke:#70ABC1}.legend__item svg.legend__item-swatch.color-index-graph-2,.legend__item svg.legend__item-swatch.color-index-graph-7{stroke:#FFCA90}.legend__item svg.legend__item-swatch.color-index-graph-3,.legend__item svg.legend__item-swatch.color-index-graph-8{stroke:#2E738E}.legend__item svg.legend__item-swatch.color-index-graph-4,.legend__item svg.legend__item-swatch.color-index-graph-9{stroke:#E29643}.legend__item svg.legend__item-swatch.color-index-graph-10,.legend__item svg.legend__item-swatch.color-index-graph-5{stroke:#767676}.legend__item svg.legend__item-swatch.color-index-grey-1,.legend__item svg.legend__item-swatch.color-index-grey-5{stroke:#333}.legend__item svg.legend__item-swatch.color-index-grey-2,.legend__item svg.legend__item-swatch.color-index-grey-6{stroke:#3B3B3B}.legend__item svg.legend__item-swatch.color-index-grey-3,.legend__item svg.legend__item-swatch.color-index-grey-7{stroke:#434343}.legend__item svg.legend__item-swatch.color-index-grey-4,.legend__item svg.legend__item-swatch.color-index-grey-8{stroke:#666}.legend__item svg.legend__item-swatch path{stroke-width:12px;transition-property:stroke-width;transition-duration:.3s;transition-timing-function:ease-in-out}.legend__item--active{color:#333}.legend__item--active svg.legend__item-swatch path{stroke-width:12px}.legend__total{margin-left:24px}.legend__total>*{margin-top:6px;padding-top:6px;border-top:1px dotted #ccc}.legend--single .legend__item-label,.legend--single .legend__item-swatch{display:none}.legend--single .legend__item-value{font-size:48px;font-size:3rem;line-height:1;font-weight:700}.login{top:0;left:0;right:0;overflow:hidden;z-index:100}.login__background{position:absolute;max-width:none}.login__background--portrait{width:auto;height:100%}.login__background--landscape{height:auto;width:100%}.login__container{position:relative;width:384px;margin:96px auto;animation-name:fadein;animation-duration:.5s}.login-form,.login__container{z-index:1;-webkit-animation-name:fadein;-webkit-animation-duration:.5s}@media screen and (max-width:44.9375em){.login__container{margin:48px 0;width:100%;border-radius:0}}.login__footer{position:absolute;left:0;right:0;bottom:6px;padding:6px 24px;background-color:rgba(255,255,255,.9);text-align:center}.login-form,.map{position:relative}.login-form{width:384px;padding:24px 24px 48px;background-color:#eee;border:1px solid #ccc;border-radius:4px;text-align:center;animation-name:fadein;animation-duration:.5s}@media screen and (max-width:44.9375em){.login-form{width:100%;border-radius:0}}.login-form__logo{display:inline-block;width:48px;height:48px;margin-bottom:24px}.login-form fieldset{text-align:left;border:none;margin-bottom:0}.login-form fieldset>*{width:100%;display:block}.login-form__submit{margin-top:24px;width:100%}.login-form__error{margin-bottom:12px;color:#FF856B;text-align:left}.login-form__footer{margin-top:12px;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;line-height:36px}.map{padding:24px}.map__canvas{position:absolute;top:0;left:0;z-index:-1;opacity:.1}.map__canvas--highlight{opacity:1}.map__categories{margin:0}.map__category{position:relative;padding-top:24px;margin-bottom:12px;max-width:none}.map__category-label{position:absolute;top:0;left:0;font-size:14px;font-size:.875rem;line-height:1.71429}.map__category-items{margin:0;overflow:hidden;text-align:center}.menu--inline.menu--left,.menu__layer--align-right .menu__control,.menu__layer--left{text-align:right}.menu__layer,.object{overflow:auto}.map__item{display:inline-block;width:192px;border:1px solid #ccc;margin-right:12px;margin-bottom:12px;background-color:#fff;font-size:18px;font-size:1.125rem;line-height:1.33333}.map__item>a{display:block;padding:6px 12px;transition:background-color .2s}.map__item>a>*{display:inline-block}.menu__control--fixed-label .menu__control-icon,.menu__layer .menu__control-drop-icon{display:none}.map__item>a:hover{background-color:rgba(0,0,0,.1)}.map__item .status-icon{margin-right:6px}.map__item--active{border-color:#000}.menu{position:relative}.menu a:not(.button){color:gray}.menu a:not(.button):hover{color:#333}.menu a:not(.button).active{color:#ff5f3d}.menu:focus:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border:1px solid #70ABC1;box-shadow:0 0 1px 1px #70ABC1;pointer-events:none}.menu__control-drop-icon{width:24px;height:24px;margin-left:12px;stroke:#999}@media screen and (max-width:44.9375em){.menu__control--labelled .menu__control-drop-icon,.menu__control--labelled .menu__control-label{display:none}}@media screen and (min-width:45em){.menu__control--labelled .menu__control-icon{display:none}}.menu__layer{position:fixed;z-index:20;font-size:16px;font-size:1rem;line-height:inherit;background-color:#fff;border:none;border-radius:4px;box-shadow:0 2px 4px rgba(0,0,0,.3)}.meter,.meter__active-graphic{position:relative}.menu__layer .menu__control-label{padding-left:24px}.menu__layer a{padding:12px 24px;white-space:nowrap;display:block}.menu__layer a:hover{background-color:rgba(0,0,0,.1)}.menu__layer>.check-box,.menu__layer>.radio-button{margin:12px 24px}.menu--controlled{display:inline-block}.menu--labelled{padding-left:24px;padding-right:24px}.menu--inline.menu--left>*{margin-left:24px;margin-right:0}.menu--inline.menu--left>:first-child{margin-left:0}.menu--inline.menu--right>*{margin-left:0;margin-right:24px}.menu--inline.menu--right>:last-child{margin-right:0}@media screen and (max-width:44.9375em){.menu--inline.menu--down:empty{width:0;margin:0;padding:0}}.menu--inline.menu--small .menu__control-icon svg,.menu--small .menu__control-icon svg,.menu__layer--small .menu__control-icon svg{width:18px;height:18px}[class*=background-color-index-] .menu--inline a,[class*=background-color-index-] .menu--inline a.active,[class*=background-color-index-] .menu--inline a:hover{color:inherit}[class*=background-color-index-] .menu--inline.menu--left a:hover:not(.active):not(.button),[class*=background-color-index-] .menu--inline.menu--right a:hover:not(.active):not(.button){text-decoration:underline}.menu--primary>a:not(.button):hover,.title a:hover,[class*=background-color-index-] .menu--inline.menu--down a:hover{text-decoration:none}[class*=background-color-index-] .menu--inline.menu--down a{padding:12px;border:1px solid transparent}[class*=background-color-index-] .menu--inline.menu--down a:hover:not(.active){border-color:rgba(0,0,0,.2)}[class*=background-color-index-] .menu--inline.menu--down a.active{background-color:rgba(0,0,0,.2)}.menu--small{font-size:16px;font-size:1rem;line-height:1.5}.menu--small .menu__control-drop-icon{margin-left:6px}.menu--primary{display:block;max-height:100vh;overflow:auto}.menu--inline.menu--left>*,.menu--inline.menu--right>*,.menu__layer--left>*,.menu__layer--right>*{display:inline-block}.menu--primary>.header:first-child{margin-left:-24px;margin-right:-24px;margin-bottom:24px}.menu--primary>a:not(.button){padding:12px 24px}.menu--primary>a:not(.button):hover:not(.active){background-color:rgba(0,0,0,.1)}.menu--primary>a:not(.button).active{color:#333;background-color:rgba(255,133,107,.2)}.menu--inline.menu--right,.menu__layer--right{text-align:left}.menu--inline.menu--small,.menu__layer--small{font-size:1em}.menu--inline.menu--small .menu__control-label,.menu__layer--small .menu__control-label{padding:12px}.menu--inline.menu--small a,.menu__layer--small a{padding:6px 12px}.menu--inline.menu--down>*,.menu--inline.menu--up>*,.menu__layer--down>*,.menu__layer--up>*{display:block}.menu--inline.menu--down h1,.menu--inline.menu--down h2,.menu--inline.menu--down h3,.menu--inline.menu--down h4,.menu--inline.menu--down h5,.menu--inline.menu--down h6,.menu--inline.menu--up h1,.menu--inline.menu--up h2,.menu--inline.menu--up h3,.menu--inline.menu--up h4,.menu--inline.menu--up h5,.menu--inline.menu--up h6,.menu__layer--down h1,.menu__layer--down h2,.menu__layer--down h3,.menu__layer--down h4,.menu__layer--down h5,.menu__layer--down h6,.menu__layer--up h1,.menu__layer--up h2,.menu__layer--up h3,.menu__layer--up h4,.menu__layer--up h5,.menu__layer--up h6{margin:24px 0 0;padding:12px 0;border-top:1px solid #ccc;min-width:192px}.menu--inline.menu--down h1:first-child,.menu--inline.menu--down h2:first-child,.menu--inline.menu--down h3:first-child,.menu--inline.menu--down h4:first-child,.menu--inline.menu--down h5:first-child,.menu--inline.menu--down h6:first-child,.menu--inline.menu--up h1:first-child,.menu--inline.menu--up h2:first-child,.menu--inline.menu--up h3:first-child,.menu--inline.menu--up h4:first-child,.menu--inline.menu--up h5:first-child,.menu--inline.menu--up h6:first-child,.menu__layer--down h1:first-child,.menu__layer--down h2:first-child,.menu__layer--down h3:first-child,.menu__layer--down h4:first-child,.menu__layer--down h5:first-child,.menu__layer--down h6:first-child,.menu__layer--up h1:first-child,.menu__layer--up h2:first-child,.menu__layer--up h3:first-child,.menu__layer--up h4:first-child,.menu__layer--up h5:first-child,.menu__layer--up h6:first-child{margin-top:0}@-webkit-keyframes draw-meter{0%{stroke-dashoffset:192px}100%{stroke-dashoffset:0}}@keyframes draw-meter{0%{stroke-dashoffset:192px}100%{stroke-dashoffset:0}}.meter{display:inline-block}.meter__threshold{stroke:#333}.meter__labeled-graphic{white-space:normal}.meter__labels-container{display:block}.meter__labels{display:-webkit-flex;display:flex;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.meter__label-max,.meter__label-min{-webkit-flex:1;flex:1}.meter__label-max{text-align:right}.meter--bar .meter__labeled-graphic{display:inline-block}.meter--bar .meter__graphic{width:192px;height:24px}.meter--bar .meter__bar{stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0}.meter--bar .meter__values .meter__bar{stroke-width:24px}.meter--bar .meter__values .meter__bar.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.meter--bar .meter__values .meter__bar.color-index-unset{stroke:#ddd}.meter--bar .meter__values .meter__bar.color-index-error{stroke:#FF856B}.meter--bar .meter__values .meter__bar.color-index-warning{stroke:#FFB86B}.meter--bar .meter__values .meter__bar.color-index-ok{stroke:#4EB976}.meter--bar .meter__values .meter__bar.color-index-disabled,.meter--bar .meter__values .meter__bar.color-index-unknown{stroke:#a8a8a8}.meter--bar .meter__values .meter__bar.color-index-graph-1,.meter--bar .meter__values .meter__bar.color-index-graph-6{stroke:#70ABC1}.meter--bar .meter__values .meter__bar.color-index-graph-2,.meter--bar .meter__values .meter__bar.color-index-graph-7{stroke:#FFCA90}.meter--bar .meter__values .meter__bar.color-index-graph-3,.meter--bar .meter__values .meter__bar.color-index-graph-8{stroke:#2E738E}.meter--bar .meter__values .meter__bar.color-index-graph-4,.meter--bar .meter__values .meter__bar.color-index-graph-9{stroke:#E29643}.meter--bar .meter__values .meter__bar.color-index-graph-10,.meter--bar .meter__values .meter__bar.color-index-graph-5{stroke:#767676}.meter--bar .meter__values .meter__bar.color-index-grey-1,.meter--bar .meter__values .meter__bar.color-index-grey-5{stroke:#333}.meter--bar .meter__values .meter__bar.color-index-grey-2,.meter--bar .meter__values .meter__bar.color-index-grey-6{stroke:#3B3B3B}.meter--bar .meter__values .meter__bar.color-index-grey-3,.meter--bar .meter__values .meter__bar.color-index-grey-7{stroke:#434343}.meter--bar .meter__values .meter__bar.color-index-grey-4,.meter--bar .meter__values .meter__bar.color-index-grey-8{stroke:#666}.meter--bar .meter__thresholds .meter__bar{stroke-width:12px}.meter--bar .meter__thresholds .meter__bar.color-index-unset{stroke:rgba(221,221,221,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-error{stroke:rgba(255,133,107,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-warning{stroke:rgba(255,184,107,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-ok{stroke:rgba(78,185,118,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-disabled,.meter--bar .meter__thresholds .meter__bar.color-index-unknown{stroke:rgba(168,168,168,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-graph-1,.meter--bar .meter__thresholds .meter__bar.color-index-graph-6{stroke:rgba(112,171,193,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-graph-2,.meter--bar .meter__thresholds .meter__bar.color-index-graph-7{stroke:rgba(255,202,144,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-graph-3,.meter--bar .meter__thresholds .meter__bar.color-index-graph-8{stroke:rgba(46,115,142,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-graph-4,.meter--bar .meter__thresholds .meter__bar.color-index-graph-9{stroke:rgba(226,150,67,.5)}.meter--bar .meter__thresholds .meter__bar.color-index-graph-10,.meter--bar .meter__thresholds .meter__bar.color-index-graph-5{stroke:rgba(118,118,118,.5)}.meter--bar .meter__threshold{stroke-width:1}.meter--bar .meter__active{display:inline-block;vertical-align:top;margin-left:12px;font-size:24px;font-size:1.5rem;line-height:1}.meter--bar .meter__active-units{color:#777;margin-left:.5em}.meter--bar .meter__labels-container{width:192px}@media screen and (max-width:44.9375em){.meter--arc,.meter--circle{width:192px;margin:0 auto}}.meter--arc svg.meter__graphic,.meter--circle svg.meter__graphic{display:block;width:192px;height:192px}.meter--arc .meter.series-pre path,.meter--circle .meter.series-pre path{stroke-dashoffset:768px}.meter--arc .meter__slice,.meter--circle .meter__slice{stroke-linecap:butt;stroke-dasharray:768px 768px;stroke-dashoffset:0;fill:none;stroke:#eee}.meter--arc .meter__slice-indicator,.meter--circle .meter__slice-indicator{stroke-linecap:round;stroke-width:3}.meter--arc .meter__slice-indicator.color-index-loading,.meter--circle .meter__slice-indicator.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.meter--arc .meter__slice-indicator.color-index-unset,.meter--circle .meter__slice-indicator.color-index-unset{stroke:#ddd}.meter--arc .meter__slice-indicator.color-index-error,.meter--circle .meter__slice-indicator.color-index-error{stroke:#FF856B}.meter--arc .meter__slice-indicator.color-index-warning,.meter--circle .meter__slice-indicator.color-index-warning{stroke:#FFB86B}.meter--arc .meter__slice-indicator.color-index-ok,.meter--circle .meter__slice-indicator.color-index-ok{stroke:#4EB976}.meter--arc .meter__slice-indicator.color-index-disabled,.meter--arc .meter__slice-indicator.color-index-unknown,.meter--circle .meter__slice-indicator.color-index-disabled,.meter--circle .meter__slice-indicator.color-index-unknown{stroke:#a8a8a8}.meter--arc .meter__slice-indicator.color-index-graph-1,.meter--arc .meter__slice-indicator.color-index-graph-6,.meter--circle .meter__slice-indicator.color-index-graph-1,.meter--circle .meter__slice-indicator.color-index-graph-6{stroke:#70ABC1}.meter--arc .meter__slice-indicator.color-index-graph-2,.meter--arc .meter__slice-indicator.color-index-graph-7,.meter--circle .meter__slice-indicator.color-index-graph-2,.meter--circle .meter__slice-indicator.color-index-graph-7{stroke:#FFCA90}.meter--arc .meter__slice-indicator.color-index-graph-3,.meter--arc .meter__slice-indicator.color-index-graph-8,.meter--circle .meter__slice-indicator.color-index-graph-3,.meter--circle .meter__slice-indicator.color-index-graph-8{stroke:#2E738E}.meter--arc .meter__slice-indicator.color-index-graph-4,.meter--arc .meter__slice-indicator.color-index-graph-9,.meter--circle .meter__slice-indicator.color-index-graph-4,.meter--circle .meter__slice-indicator.color-index-graph-9{stroke:#E29643}.meter--arc .meter__slice-indicator.color-index-graph-10,.meter--arc .meter__slice-indicator.color-index-graph-5,.meter--circle .meter__slice-indicator.color-index-graph-10,.meter--circle .meter__slice-indicator.color-index-graph-5{stroke:#767676}.meter--arc .meter__slice-indicator.color-index-grey-1,.meter--arc .meter__slice-indicator.color-index-grey-5,.meter--circle .meter__slice-indicator.color-index-grey-1,.meter--circle .meter__slice-indicator.color-index-grey-5{stroke:#333}.meter--arc .meter__slice-indicator.color-index-grey-2,.meter--arc .meter__slice-indicator.color-index-grey-6,.meter--circle .meter__slice-indicator.color-index-grey-2,.meter--circle .meter__slice-indicator.color-index-grey-6{stroke:#3B3B3B}.meter--arc .meter__slice-indicator.color-index-grey-3,.meter--arc .meter__slice-indicator.color-index-grey-7,.meter--circle .meter__slice-indicator.color-index-grey-3,.meter--circle .meter__slice-indicator.color-index-grey-7{stroke:#434343}.meter--arc .meter__slice-indicator.color-index-grey-4,.meter--arc .meter__slice-indicator.color-index-grey-8,.meter--circle .meter__slice-indicator.color-index-grey-4,.meter--circle .meter__slice-indicator.color-index-grey-8{stroke:#666}.meter--arc .meter__slice--active,.meter--arc .meter__values .meter__slice,.meter--circle .meter__slice--active,.meter--circle .meter__values .meter__slice{stroke-width:24px}.meter--arc .meter__values .meter__slice.color-index-loading,.meter--circle .meter__values .meter__slice.color-index-loading{stroke:#ddd;stroke-dasharray:1px 10px;stroke-dashoffset:0}.meter--arc .meter__values .meter__slice.color-index-unset,.meter--circle .meter__values .meter__slice.color-index-unset{stroke:#ddd}.meter--arc .meter__values .meter__slice.color-index-error,.meter--circle .meter__values .meter__slice.color-index-error{stroke:#FF856B}.meter--arc .meter__values .meter__slice.color-index-warning,.meter--circle .meter__values .meter__slice.color-index-warning{stroke:#FFB86B}.meter--arc .meter__values .meter__slice.color-index-ok,.meter--circle .meter__values .meter__slice.color-index-ok{stroke:#4EB976}.meter--arc .meter__values .meter__slice.color-index-disabled,.meter--arc .meter__values .meter__slice.color-index-unknown,.meter--circle .meter__values .meter__slice.color-index-disabled,.meter--circle .meter__values .meter__slice.color-index-unknown{stroke:#a8a8a8}.meter--arc .meter__values .meter__slice.color-index-graph-1,.meter--arc .meter__values .meter__slice.color-index-graph-6,.meter--circle .meter__values .meter__slice.color-index-graph-1,.meter--circle .meter__values .meter__slice.color-index-graph-6{stroke:#70ABC1}.meter--arc .meter__values .meter__slice.color-index-graph-2,.meter--arc .meter__values .meter__slice.color-index-graph-7,.meter--circle .meter__values .meter__slice.color-index-graph-2,.meter--circle .meter__values .meter__slice.color-index-graph-7{stroke:#FFCA90}.meter--arc .meter__values .meter__slice.color-index-graph-3,.meter--arc .meter__values .meter__slice.color-index-graph-8,.meter--circle .meter__values .meter__slice.color-index-graph-3,.meter--circle .meter__values .meter__slice.color-index-graph-8{stroke:#2E738E}.meter--arc .meter__values .meter__slice.color-index-graph-4,.meter--arc .meter__values .meter__slice.color-index-graph-9,.meter--circle .meter__values .meter__slice.color-index-graph-4,.meter--circle .meter__values .meter__slice.color-index-graph-9{stroke:#E29643}.meter--arc .meter__values .meter__slice.color-index-graph-10,.meter--arc .meter__values .meter__slice.color-index-graph-5,.meter--circle .meter__values .meter__slice.color-index-graph-10,.meter--circle .meter__values .meter__slice.color-index-graph-5{stroke:#767676}.meter--arc .meter__values .meter__slice.color-index-grey-1,.meter--arc .meter__values .meter__slice.color-index-grey-5,.meter--circle .meter__values .meter__slice.color-index-grey-1,.meter--circle .meter__values .meter__slice.color-index-grey-5{stroke:#333}.meter--arc .meter__values .meter__slice.color-index-grey-2,.meter--arc .meter__values .meter__slice.color-index-grey-6,.meter--circle .meter__values .meter__slice.color-index-grey-2,.meter--circle .meter__values .meter__slice.color-index-grey-6{stroke:#3B3B3B}.meter--arc .meter__values .meter__slice.color-index-grey-3,.meter--arc .meter__values .meter__slice.color-index-grey-7,.meter--circle .meter__values .meter__slice.color-index-grey-3,.meter--circle .meter__values .meter__slice.color-index-grey-7{stroke:#434343}.meter--arc .meter__values .meter__slice.color-index-grey-4,.meter--arc .meter__values .meter__slice.color-index-grey-8,.meter--circle .meter__values .meter__slice.color-index-grey-4,.meter--circle .meter__values .meter__slice.color-index-grey-8{stroke:#666}.meter--arc .meter__thresholds .meter__slice,.meter--circle .meter__thresholds .meter__slice{stroke-width:12px}.meter--arc .meter__thresholds .meter__slice.color-index-unset,.meter--circle .meter__thresholds .meter__slice.color-index-unset{stroke:rgba(221,221,221,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-error,.meter--circle .meter__thresholds .meter__slice.color-index-error{stroke:rgba(255,133,107,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-warning,.meter--circle .meter__thresholds .meter__slice.color-index-warning{stroke:rgba(255,184,107,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-ok,.meter--circle .meter__thresholds .meter__slice.color-index-ok{stroke:rgba(78,185,118,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-disabled,.meter--arc .meter__thresholds .meter__slice.color-index-unknown,.meter--circle .meter__thresholds .meter__slice.color-index-disabled,.meter--circle .meter__thresholds .meter__slice.color-index-unknown{stroke:rgba(168,168,168,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-graph-1,.meter--arc .meter__thresholds .meter__slice.color-index-graph-6,.meter--circle .meter__thresholds .meter__slice.color-index-graph-1,.meter--circle .meter__thresholds .meter__slice.color-index-graph-6{stroke:rgba(112,171,193,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-graph-2,.meter--arc .meter__thresholds .meter__slice.color-index-graph-7,.meter--circle .meter__thresholds .meter__slice.color-index-graph-2,.meter--circle .meter__thresholds .meter__slice.color-index-graph-7{stroke:rgba(255,202,144,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-graph-3,.meter--arc .meter__thresholds .meter__slice.color-index-graph-8,.meter--circle .meter__thresholds .meter__slice.color-index-graph-3,.meter--circle .meter__thresholds .meter__slice.color-index-graph-8{stroke:rgba(46,115,142,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-graph-4,.meter--arc .meter__thresholds .meter__slice.color-index-graph-9,.meter--circle .meter__thresholds .meter__slice.color-index-graph-4,.meter--circle .meter__thresholds .meter__slice.color-index-graph-9{stroke:rgba(226,150,67,.5)}.meter--arc .meter__thresholds .meter__slice.color-index-graph-10,.meter--arc .meter__thresholds .meter__slice.color-index-graph-5,.meter--circle .meter__thresholds .meter__slice.color-index-graph-10,.meter--circle .meter__thresholds .meter__slice.color-index-graph-5{stroke:rgba(118,118,118,.5)}.meter--arc .meter__threshold,.meter--circle .meter__threshold{stroke-width:24px;stroke-linecap:butt}.meter--arc .meter__active,.meter--circle .meter__active{position:absolute;top:0;left:0;width:192px;margin-top:72px;text-align:center;white-space:normal;pointer-events:none}.meter--legend-right,.meter--vertical .meter__labeled-graphic,.meter--vertical.meter--bar,.search__layer-header{white-space:nowrap}.meter--arc .meter__active-value,.meter--circle .meter__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.meter--arc .meter__active-units,.meter--circle .meter__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.meter--arc .meter__active-label,.meter--circle .meter__active-label{width:50%;margin:0 auto;font-size:14px;font-size:.875rem;line-height:16px}.meter--arc .meter__labels-container,.meter--circle .meter__labels-container{width:192px}.meter--arc .meter__legend,.meter--circle .meter__legend{margin:24px 0 0}.meter--arc svg.meter__graphic{height:144px}.meter--arc .meter__labels-container{padding-left:12px;padding-right:12px}.meter--circle svg.meter__graphic{height:192px}.meter--vertical .meter__active-graphic{display:inline-block;vertical-align:middle}.meter--vertical .meter__labels{-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;justify-content:space-between}.meter--vertical .meter__label-max,.meter--vertical .meter__label-min{-webkit-flex:0 0 auto;flex:0 0 auto;text-align:left}.section--centered,.settings{text-align:center}.meter--vertical .meter__label-min{-webkit-order:1;order:1}.meter--vertical .meter__label-max{-webkit-order:0;order:0}@media screen and (min-width:45em){.meter--bar .meter__values .meter__bar{-webkit-animation:draw-meter 1.5s;animation:draw-meter 1.5s}.meter--arc .meter__values .meter__slice,.meter--circle .meter__values .meter__slice{-webkit-animation:draw-stroke 3s;animation:draw-stroke 3s}.meter--vertical .meter__legend{vertical-align:middle;margin:0 0 0 24px}}.meter--vertical.meter--bar svg.meter__graphic{width:24px;height:192px}.meter--vertical.meter--bar .meter__active{margin-top:72px;margin-left:12px}.meter--vertical.meter--bar .meter__active-value{font-size:48px;font-size:3rem;line-height:38px;font-weight:700}.meter--vertical.meter--bar .meter__active-units{font-size:24px;font-size:1.5rem;line-height:inherit;margin-left:6px;color:#777;font-weight:400}.meter--vertical.meter--bar .meter__labels-container{position:absolute;top:0;left:36px;width:auto;height:192px}.meter--vertical.meter--bar .meter__labels{height:192px}.meter--vertical.meter--bar .meter__legend{margin-left:24px}.meter--vertical.meter--arc svg.meter__graphic{display:inline;width:144px;height:192px}.meter--vertical.meter--arc .meter__labels-container{display:inline-block;vertical-align:top;width:auto;height:192px;padding-top:12px;padding-bottom:12px}.meter--vertical.meter--arc .meter__labels{height:168px}.meter--small.meter--bar .meter__labels-container,.meter--small.meter--bar svg.meter__graphic{width:144px}.meter--small.meter--bar .meter__active{font-size:16px;font-size:1rem;line-height:1.5}.meter--small.meter--arc svg.meter__graphic,.meter--small.meter--circle svg.meter__graphic{width:144px;height:144px}.meter--small.meter--arc .meter__active,.meter--small.meter--circle .meter__active{width:144px;margin-top:48px}.meter--small.meter--arc .meter__active-value,.meter--small.meter--circle .meter__active-value{font-size:28px;font-size:1.75rem;line-height:inherit}.meter--small.meter--arc svg.meter__graphic{height:120px}@media screen and (min-width:45em){.meter--small .meter__legend{display:none}}.meter--large.meter--bar svg.meter__graphic{width:288px;height:36px}.meter--large.meter--bar .meter__active{font-size:28px;font-size:1.75rem;line-height:inherit}.meter--large.meter--arc svg.meter__graphic,.meter--large.meter--circle svg.meter__graphic{width:288px;height:288px}.meter--large.meter--arc .meter__active,.meter--large.meter--circle .meter__active{width:288px;margin-top:96px}.meter--large.meter--arc .meter__active-value,.meter--large.meter--circle .meter__active-value{font-size:64px;font-size:4rem;line-height:inherit}.meter--large.meter--arc svg.meter__graphic{height:264px}.meter--legend-right .meter__labels-container{width:auto}.meter--legend-right .meter__legend{vertical-align:top}.meter--loading .meter__thresholds{display:none}.notification{padding:24px}.notification__status{margin-right:12px}.notification__message{font-size:18px;font-size:1.125rem;line-height:1.33333;margin-bottom:24px;vertical-align:middle}.notification__state,.notification__timestamp{display:block;color:#777}.notification--error{background-color:rgba(255,133,107,.15)}.notification--warning{background-color:rgba(255,184,107,.15)}.notification--ok{background-color:rgba(78,185,118,.15)}.notification--disabled,.notification--unknown{background-color:rgba(168,168,168,.15)}.notification--flush{padding-left:0;padding-right:0}.notifications-control__icon{width:48px;height:48px;vertical-align:middle}.notifications{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(128,128,128,.6);z-index:10}.notifications__container,.panel{border-bottom:1px solid #ccc;background-color:#fff}.notifications__container{position:absolute;top:0;right:0;min-width:300px;padding:96px 24px 24px;border-left:1px solid #ccc;border-bottom-left-radius:4px}.notifications__icon{position:absolute;top:24px;right:84px;width:48px;height:48px;vertical-align:middle}.object__container{padding:24px}.object ol,.object ul{margin:0;list-style-type:none}.object li{width:auto}.object__attribute{margin-bottom:12px}.object__attribute-name{display:block;color:#777;font-size:14px;font-size:.875rem;line-height:1.71429}.object__attribute-value{display:block;font-size:18px;font-size:1.125rem;line-height:1.33333}.object__attribute-value ol,.object__attribute-value ul{margin-left:24px;padding-top:24px;padding-bottom:24px}.object__attribute--container>.object__attribute-name{font-weight:700}.object__attribute--unset .object__attribute-value{font-style:italic;color:#777}.object__attribute--array>.object__attribute-value>ol>li{border-top:1px solid #ccc}.object__attribute--array>.object__attribute-value>ol>li:last-child{border-bottom:1px solid #ccc}.object__attribute--array>.object__attribute-value>ol>li>ul{padding-top:0;padding-bottom:0}.panel{padding:24px}.panel:last-of-type{border-bottom:none}.panel__title{text-transform:uppercase;font-weight:400}.panel>a{display:block}.panel a.call-to-action{display:inline-block;font-size:20px;font-size:1.25rem;line-height:1.2;margin-bottom:24px;text-decoration:none;padding:12px 24px;border-radius:4px;color:#fff}.panel--index-1 .panel__title{color:#2E738E}.panel--index-1 a.call-to-action{background-color:#2E738E}.panel--index-2 .panel__title{color:#E29643}.panel--index-2 a.call-to-action{background-color:#E29643}@media screen and (max-width:44.9375em){.panel{padding:24px}.panel>h2{margin-bottom:12px}}.radio-button{margin-right:12px;cursor:pointer}.radio-button__input{opacity:0;position:absolute}.radio-button__input:checked+.radio-button__control:after{content:"";display:block;position:absolute;top:3px;left:3px;width:16px;height:16px;background-color:#FF856B;border-radius:16px}.radio-button__control,.search,.search-input,.search__layer-contents{display:inline-block}.radio-button__input:focus+.radio-button__control{content:"";border-color:#70ABC1;box-shadow:0 0 1px 1px #70ABC1}.radio-button__control{position:relative;width:24px;height:24px;margin-right:12px;vertical-align:middle;background-color:inherit;color:#ff5f3d;border:1px solid #ccc;border-radius:24px}.search:focus{margin:-1px;border:1px solid #70ABC1;box-shadow:0 0 1px 1px #70ABC1}.search-input__layer,.search__layer{box-shadow:0 2px 4px rgba(0,0,0,.3)}.search__input{margin-right:0}.header .search__input{padding:0 12px;font-size:inherit}.header .search__input:focus{padding:0 11px}.search__layer{position:fixed;z-index:10;font-size:20px;font-size:1.25rem;line-height:inherit;background-color:#fff;border:none;border-radius:4px}.search__layer--inline{margin-left:-1px}.search__layer input{margin-right:0;box-sizing:border-box}.search__layer .search__control{display:inline-block;vertical-align:top}.search__layer .search__suggestion{padding:6px 24px}.search__layer .search__suggestion--active,.search__layer .search__suggestion:hover{background-color:rgba(0,0,0,.1)}.search--inline .search__input{width:100%;box-sizing:border-box}.header .search--inline .search__input{padding:0;border:none}.search-input{position:relative}.search-input__input{width:100%;height:100%;display:block;padding-right:60px}.search-input__input:focus{padding-right:59px}.search-input__control{position:absolute;bottom:0;right:12px}.search-input__layer{position:fixed;z-index:20;background-color:#fff;border:none;border-radius:0 0 4px 4px}.search-input__layer input[type=search]{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-radius:0}.search-input__layer-suggestion{padding:6px 12px}.search-input__layer-suggestion--active,.search-input__layer-suggestion:hover{background-color:rgba(0,0,0,.1)}.search-input--active .search-input__input{border-bottom-left-radius:0;border-bottom-right-radius:0}.section{padding-top:48px;padding-bottom:48px}.section__content>h2,.section__content>h3,.section__content>h4{padding-left:24px;padding-right:24px}.section--right .section__content{display:-webkit-flex;display:flex}.section--right .section__content.center-column__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}@media screen and (max-width:44.9375em){.section--right .section__content.center-column__content>.menu:first-child{width:100%}.section--right .section__content.center-column__content>.menu:first-child:empty{width:0;margin:0;padding:0}}.section--right .section__content>.flex-1{-webkit-flex:1;flex:1}.section--right .section__content>.flex-2{-webkit-flex:2;flex:2}.section--right .section__content>.flex-3{-webkit-flex:3;flex:3}.section--right .section__content>.flex-4{-webkit-flex:4;flex:4}@media screen and (min-width:45em){.section--right .section__content>*{margin-right:48px}.section--right .section__content>:last-child{margin-right:0}.section--right .section__content>.menu:first-child{-webkit-flex:0 0 auto;flex:0 0 auto;width:192px}}@media screen and (max-width:44.9375em){.section--right .section__content{-webkit-flex-direction:column;flex-direction:column}.section--right .section__content>*{margin-bottom:48px;padding-bottom:48px}.section--right .section__content>:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}}.section--compact{padding-top:0;padding-bottom:0}.section--compact .section__content{padding-top:12px;padding-bottom:12px}.section--centered .section__content>*{margin-left:auto;margin-right:auto}.section--flush .section__content>h2,.section--flush .section__content>h3,.section--flush .section__content>h4{padding-left:0;padding-right:0}.react-gravatar{border-radius:24px;border:2px solid transparent;margin:0 24px;overflow:hidden;transition:all .3s ease-in-out}.table--selectable tbody tr td,.tile--selectable{transition:background-color .2s}.react-gravatar:hover{border-color:#FF856B}@media screen and (max-width:44.9375em){.react-gravatar{width:28px;height:28px}}@media screen and (min-width:45em){.react-gravatar{width:52px;height:52px}}.session{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(128,128,128,.6);z-index:10}.session__container{position:absolute;top:0;right:0;min-width:300px;padding:96px 24px 24px;background-color:#fff;border-left:1px solid #ccc;border-bottom:1px solid #ccc;border-bottom-left-radius:4px}.session .react-gravatar{position:absolute;top:24px;right:24px}.session__actions{margin-top:24px;padding-top:24px;border-top:1px solid #ccc}.settings{position:relative}.settings__panels{display:inline-block}.settings__panel{vertical-align:top}.sidebar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100vh;background-color:#fff}@media screen and (max-width:44.9375em){.sidebar{width:calc(100vw - 48px)}}.sidebar>*{-webkit-flex:1 0;flex:1 0}.sidebar>.footer,.sidebar>.header{-webkit-flex:0 0 auto;flex:0 0 auto}.sidebar--primary{background-image:linear-gradient(to left,#dfdfdf,#f5f5f5 10px);background-color:none}@media screen and (min-width:45em){.sidebar{width:384px}.split{display:-webkit-flex;display:flex;height:100vh}.split>*{-webkit-flex:1 0;flex:1 0;position:relative;height:100vh;overflow:auto}.split--flex-left>:last-child:not(:first-child),.split--flex-right>:first-child:not(:last-child){-webkit-flex:0 0 384px;flex:0 0 384px}}.tile,.title{overflow:hidden}.table table{width:100%}.table td,.table th{padding:11px 12px;vertical-align:top;text-align:left}.table__more,.tbd{text-align:center}.table td:first-child,.table th:first-child{padding-left:24px}.table td:last-child,.table th:last-child{padding-right:24px}.table th{font-weight:100;font-size:20px;font-size:1.25rem;line-height:1.2;border-bottom:1px solid #ccc}.table__mirror{position:absolute;top:0;left:0;right:0}.table__mirror>thead{position:fixed;background-color:rgba(255,255,255,.9)}@media screen and (max-width:44.9375em){.table__mirror>thead{position:static}}.table__more{margin-top:24px;margin-bottom:24px}.table--selectable tbody tr.table__row--selected td{background-color:rgba(255,133,107,.2)}.table--selectable tbody tr:hover:not(.table__row--selected) td{background-color:rgba(0,0,0,.1)}.tbd{padding:96px;font-size:96px;font-size:6rem;line-height:1;background-color:#ccc;color:#fff}.tiles{padding:12px}.tiles--moreable{position:relative;padding-bottom:48px}.tiles--moreable .tiles__more{position:absolute;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width:45em){.tiles{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.tiles>.tile{-webkit-flex:0 0 192px;flex:0 0 192px;flex-grow:1}.tiles>.tile--wide{-webkit-flex-basis:100%;flex-basis:100%}.tiles--flush{margin:-24px}@media screen and (min-width:45em){.tiles--flush>.tile{-webkit-flex:0 0 168px;flex:0 0 168px;flex-grow:1}}.tiles--small>.tile{-webkit-flex-basis:96px;flex-basis:96px}.tiles--fill{-webkit-align-items:stretch;align-items:stretch;-webkit-align-content:stretch;align-content:stretch}.tiles--fill>.tile{-webkit-flex-grow:1;flex-grow:1}}.tile{padding:12px}@media screen and (max-width:44.9375em){.tile{margin:0;border-radius:0;text-align:center}}.tile .status-icon{margin-right:6px}.title,.title img,.title svg:not(.control-icon){margin-right:12px}.tile>.header{margin-bottom:24px}.tile>.header .header__content{border-bottom:none}.tile--selectable.tile--selected{background-color:rgba(255,133,107,.2)}.tile--selectable:hover:not(.tile--selected){background-color:rgba(0,0,0,.1)}.title{display:inline;text-overflow:ellipsis;font-weight:400}.title a{color:inherit}[class*=background-color-index-] .title a:hover{text-decoration:underline}@media screen and (max-width:44.9375em){.title{font-size:24px;font-size:1.5rem;line-height:inherit}.title img,.title svg:not(.control-icon){height:24px}}.title--interactive:hover{color:#FF856B}@media screen and (min-width:45em){.tile{-webkit-flex:0 0 192px;flex:0 0 192px;flex-grow:1}.title{font-size:24px;font-size:1.5rem;line-height:inherit;font-weight:600}.title img,.title svg:not(.control-icon){height:48px}.title--interactive:hover{transition:color .3s}}.title--menu .control-icon{margin-left:12px}.title--menu:hover .control-icon{stroke:#FF856B}.clearfix:after{content:"";display:table;clear:both} \ No newline at end of file diff --git a/grommet.js b/grommet.js index 3a5f1dc..d1ddb01 100644 --- a/grommet.js +++ b/grommet.js @@ -49,55 +49,56 @@ var Grommet = var Grommet = { // Components - App: __webpack_require__(1), - CheckBox: __webpack_require__(2), - Document: __webpack_require__(3), - Donut: __webpack_require__(4), - Footer: __webpack_require__(5), - Form: __webpack_require__(6), - FormField: __webpack_require__(7), - Header: __webpack_require__(8), - Label: __webpack_require__(9), - Login: __webpack_require__(10), - LoginForm: __webpack_require__(11), - Menu: __webpack_require__(12), - Meter: __webpack_require__(13), - Panel: __webpack_require__(14), - RadioButton: __webpack_require__(15), - Search: __webpack_require__(16), - SearchInput: __webpack_require__(17), - Section: __webpack_require__(18), - Table: __webpack_require__(19), - Tiles: __webpack_require__(20), - Tile: __webpack_require__(21), - Title: __webpack_require__(22), - Object: __webpack_require__(23), - TBD: __webpack_require__(24), + App: __webpack_require__(3), + Button: __webpack_require__(44), + CheckBox: __webpack_require__(45), + Document: __webpack_require__(46), + Donut: __webpack_require__(47), + Footer: __webpack_require__(49), + Form: __webpack_require__(51), + FormField: __webpack_require__(52), + Header: __webpack_require__(53), + Label: __webpack_require__(54), + Login: __webpack_require__(55), + LoginForm: __webpack_require__(56), + Menu: __webpack_require__(57), + Meter: __webpack_require__(64), + Panel: __webpack_require__(65), + RadioButton: __webpack_require__(66), + Search: __webpack_require__(67), + SearchInput: __webpack_require__(69), + Section: __webpack_require__(70), + Table: __webpack_require__(71), + Tiles: __webpack_require__(74), + Tile: __webpack_require__(1), + Title: __webpack_require__(75), + Object: __webpack_require__(76), + TBD: __webpack_require__(77), Icons: { - Clear: __webpack_require__(25), - DragHandle: __webpack_require__(26), - Edit: __webpack_require__(27), - Filter: __webpack_require__(28), - Help: __webpack_require__(29), - Left: __webpack_require__(30), - More: __webpack_require__(31), - Right: __webpack_require__(32), - Search: __webpack_require__(33), - SearchPlus: __webpack_require__(34), - Spinning: __webpack_require__(35), - Status: __webpack_require__(36) + Clear: __webpack_require__(78), + DragHandle: __webpack_require__(79), + Edit: __webpack_require__(80), + Filter: __webpack_require__(81), + Help: __webpack_require__(82), + Left: __webpack_require__(83), + More: __webpack_require__(62), + Right: __webpack_require__(84), + Search: __webpack_require__(68), + SearchPlus: __webpack_require__(85), + Spinning: __webpack_require__(72), + Status: __webpack_require__(86) }, // Mixins Mixins: { - KeyboardAccelerators: __webpack_require__(37), - ReactLayeredComponent: __webpack_require__(38) + KeyboardAccelerators: __webpack_require__(61), + ReactLayeredComponent: __webpack_require__(60) }, // Actions - Actions: __webpack_require__(39), + Actions: __webpack_require__(93), // Stores - SessionStore: __webpack_require__(40), + SessionStore: __webpack_require__(121), // Utils - Rest: __webpack_require__(41) + Rest: __webpack_require__(117) }; module.exports = Grommet; @@ -109,9 +110,64 @@ var Grommet = // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - var React = __webpack_require__(42); + var React = __webpack_require__(2); - var IntlMixin = __webpack_require__(43); + var CLASS_ROOT = "tile"; + + var Tile = React.createClass({displayName: "Tile", + + propTypes: { + onClick: React.PropTypes.func, + selected: React.PropTypes.bool, + status: React.PropTypes.string, + wide: React.PropTypes.bool + }, + + render: function() { + var classes = [CLASS_ROOT]; + if (this.props.status) { + classes.push(CLASS_ROOT = "--status-" + this.props.status.toLowerCase()); + } + if (this.props.wide) { + classes.push(CLASS_ROOT + "--wide"); + } + if (this.props.onClick) { + classes.push(CLASS_ROOT + "--selectable"); + } + if (this.props.selected) { + classes.push(CLASS_ROOT + "--selected"); + } + if (this.props.className) { + classes.push(this.props.className); + } + + return ( + React.createElement("div", {className: classes.join(' '), onClick: this.props.onClick}, + this.props.children + ) + ); + } + + }); + + module.exports = Tile; + + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = React; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var IntlMixin = __webpack_require__(4); var App = React.createClass({displayName: "App", @@ -160,8993 +216,3156 @@ var Grommet = /***/ }, -/* 2 */ +/* 4 */ /***/ function(module, exports, __webpack_require__) { - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + /* WEBPACK VAR INJECTION */(function(global) {// (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - var React = __webpack_require__(42); + var supportedLocales = ['en-US', 'pt-BR']; - var CLASS_ROOT = "check-box"; + function localesSupported() { + return global.Intl && supportedLocales.every(function (locale) { + return Intl.NumberFormat.supportedLocalesOf(locale)[0] === locale && + Intl.DateTimeFormat.supportedLocalesOf(locale)[0] === locale; + }); + } - var CheckBox = React.createClass({displayName: "CheckBox", + if (! localesSupported()) { + __webpack_require__(5); + IntlPolyfill.__addLocaleData(__webpack_require__(6)); + IntlPolyfill.__addLocaleData(__webpack_require__(7)); + Intl.NumberFormat = IntlPolyfill.NumberFormat; + Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; + } - propTypes: { - checked: React.PropTypes.bool, - defaultChecked: React.PropTypes.bool, - id: React.PropTypes.string.isRequired, - label: React.PropTypes.string.isRequired, - name: React.PropTypes.string, - onChange: React.PropTypes.func, - toggle: React.PropTypes.bool - }, + var React = __webpack_require__(2); + var ReactIntl = __webpack_require__(8); + var IntlMixin = ReactIntl.IntlMixin; + var FormattedDate = ReactIntl.FormattedDate; - render: function () { - var classes = [CLASS_ROOT]; - if (this.props.toggle) { - classes.push(CLASS_ROOT + "--toggle"); + module.exports = { + mixins: [IntlMixin], + + getChildContext: function () { + if (!this.props.locales && !this.context.locales) { + this.context.locales = 'en-US'; } - if (this.props.className) { - classes.push(this.props.className); + + if (!this.props.messages && !this.context.messages) { + try { + this.context.messages = __webpack_require__(41)("./" + (this.props.locales || this.context.locales || 'en-US')); + } catch (e) { + this.context.messages = __webpack_require__(42); + } } + }, + + getGrommetFormattedDate: function (date) { return ( - React.createElement("label", {className: classes.join(' ')}, - React.createElement("input", {className: CLASS_ROOT + "__input", - id: this.props.id, name: this.props.name, type: "checkbox", - checked: this.props.checked, - defaultChecked: this.props.defaultChecked, - onChange: this.props.onChange}), - React.createElement("span", {className: CLASS_ROOT + "__control"}), - React.createElement("span", {className: CLASS_ROOT + "__label"}, - this.props.label - ) - ) + React.createElement(FormattedDate, { + value: new Date(date), + day: "numeric", + month: "numeric", + year: "numeric", + hour: "numeric", + minute: "numeric", + second: "numeric"}) ); - } - - }); + }, - module.exports = CheckBox; + getGrommetIntlMessage: function(messageKey) { + var message = messageKey; + if (messageKey) { + try { + message = this.getIntlMessage(messageKey); + } catch (e) { + message = messageKey; + } + } + return message; + } + }; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 3 */ +/* 5 */ /***/ function(module, exports, __webpack_require__) { - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {/** + * @license Copyright 2013 Andy Earnshaw, MIT License + * + * Implements the ECMAScript Internationalization API in ES5-compatible environments, + * following the ECMA-402 specification as closely as possible + * + * ECMA-402: http://ecma-international.org/ecma-402/1.0/ + * + * CLDR format locale data should be provided using IntlPolyfill.__addLocaleData(). + */ + /*jshint proto:true, eqnull:true, boss:true, laxbreak:true, newcap:false, shadow:true, funcscope:true */ + /*globals global, define, exports, module, window*/ - var React = __webpack_require__(42); + (function (global, factory) { + var IntlPolyfill = factory(); - var CLASS_ROOT = "document"; + // register in -all- the module systems (at once) + if (true) + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (IntlPolyfill), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - var GrommetDocument = React.createClass({displayName: "GrommetDocument", + if (true) + module.exports = IntlPolyfill; - propTypes: { - colorIndex: React.PropTypes.string, - flush: React.PropTypes.bool - }, + if (!global.Intl) { + global.Intl = IntlPolyfill; + IntlPolyfill.__applyLocaleSensitivePrototypes(); + } - getDefaultProps: function () { - return { - flush: true - }; - }, + global.IntlPolyfill = IntlPolyfill; - render: function() { - var classes = [CLASS_ROOT]; - if (this.props.flush) { - classes.push(CLASS_ROOT + "--flush"); - } - if (this.props.colorIndex) { - classes.push("header-color-index-" + this.props.colorIndex); - } + })(typeof global !== 'undefined' ? global : this, function() { + "use strict"; + var + Intl = {}, - return ( - React.createElement("div", {ref: "document", className: classes.join(' ')}, - React.createElement("div", {className: CLASS_ROOT + "__content"}, - this.props.children - ) - ) - ); - } - }); + realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(), - module.exports = GrommetDocument; + // Need a workaround for getters in ES3 + es3 = !realDefineProp && !Object.prototype.__defineGetter__, + // We use this a lot (and need it for proto-less objects) + hop = Object.prototype.hasOwnProperty, -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { + // Naive defineProperty for compatibility + defineProperty = realDefineProp ? Object.defineProperty : function (obj, name, desc) { + if ('get' in desc && obj.__defineGetter__) + obj.__defineGetter__(name, desc.get); - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + else if (!hop.call(obj, name) || 'value' in desc) + obj[name] = desc.value; + }, - var React = __webpack_require__(42); - var Legend = __webpack_require__(44); + // Array.prototype.indexOf, as good as we need it to be + arrIndexOf = Array.prototype.indexOf || function (search) { + /*jshint validthis:true */ + var t = this; + if (!t.length) + return -1; - var CLASS_ROOT = "donut"; - var BASE_SIZE = 192; - var PARTIAL_SIZE = 168; + for (var i = arguments[1] || 0, max = t.length; i < max; i++) { + if (t[i] === search) + return i; + } - function polarToCartesian (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)) - }; - } + return -1; + }, - function arcCommands (x, y, radius, startAngle, endAngle) { - var start = polarToCartesian(x, y, radius, endAngle); - var end = polarToCartesian(x, y, radius, startAngle); - var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; - var d = [ - "M", start.x, start.y, - "A", radius, radius, 0, arcSweep, 0, end.x, end.y - ].join(" "); - return d; - } + // Create an object with the specified prototype (2nd arg required for Record) + objCreate = Object.create || function (proto, props) { + var obj; - function activeIndicatorCommands (x, y, radius, startAngle, endAngle) { - var midAngle = endAngle - ((endAngle - startAngle) / 2); - var point = polarToCartesian(x, y, radius - 24, midAngle); - var start = polarToCartesian(x, y, radius, midAngle - 10); - var end = polarToCartesian(x, y, radius, midAngle + 10); - //var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; - var d = ["M", point.x, point.y, - "L", start.x, start.y, - "A", radius, radius, 0, 0, 0, end.x, end.y, - "Z" - ].join(" "); - return d; - } - - var Donut = React.createClass({displayName: "Donut", - - propTypes: { - legend: React.PropTypes.bool, - partial: React.PropTypes.bool, - max: React.PropTypes.oneOfType([ - React.PropTypes.shape({ - value: React.PropTypes.number, - label: React.PropTypes.string - }), - React.PropTypes.number - ]), - min: React.PropTypes.oneOfType([ - React.PropTypes.shape({ - value: React.PropTypes.number, - label: React.PropTypes.string - }), - React.PropTypes.number - ]), - series: React.PropTypes.arrayOf(React.PropTypes.shape({ - label: React.PropTypes.string, - value: React.PropTypes.number.isRequired, - units: React.PropTypes.string, - colorIndex: React.PropTypes.string, - important: React.PropTypes.bool, - onClick: React.PropTypes.func - })), - small: React.PropTypes.bool, - units: React.PropTypes.string, - value: React.PropTypes.number - }, - - getDefaultProps: function () { - return { - max: {value: 100}, - min: {value: 0} - }; - }, - - _initialTimeout: function () { - this.setState({ - initial: false, - activeIndex: this.state.importantIndex - }); - clearTimeout(this._timeout); - }, - - _onActive: function (index) { - this.setState({initial: false, activeIndex: index}); - }, - - _layout: function () { - // orientation based on available window orientation - var ratio = window.innerWidth / window.innerHeight; - if (ratio < 0.8) { - this.setState({orientation: 'portrait'}); - } else if (ratio > 1.2) { - this.setState({orientation: 'landscape'}); - } - // content based on avialable real estate - var parentElement = this.refs.donut.getDOMNode().parentNode; - var width = parentElement.offsetWidth; - var height = parentElement.offsetHeight; - var donutHeight = BASE_SIZE; - if (this.props.partial) { - donutHeight = PARTIAL_SIZE; - } - if (height < donutHeight || width < BASE_SIZE || - (width < (BASE_SIZE * 2) && height < (donutHeight * 2))) { - this.setState({size: 'small'}); - } else { - this.setState({size: null}); - } - }, - - _onResize: function() { - // debounce - clearTimeout(this._resizeTimer); - this._resizeTimer = setTimeout(this._layout, 50); - }, - - _generateSeries: function (props) { - var total = props.max.value - props.min.value; - var remaining = total - (props.value - props.min.value); - return [ - {value: props.value}, - {value: remaining, colorIndex: 'unset'} - ]; - }, - - _importantIndex: function (series) { - var result = 0; - series.some(function (data, index) { - if (data.important) { - result = index; - return true; - } - }); - return result; - }, + function F() {} + F.prototype = proto; + obj = new F(); - getInitialState: function() { - var series = this.props.series || this._generateSeries(this.props); - var importantIndex = this._importantIndex(series); - return { - initial: true, - importantIndex: importantIndex, - activeIndex: importantIndex, - legend: false, - orientation: 'portrait', - series: series - }; - }, + for (var k in props) { + if (hop.call(props, k)) + defineProperty(obj, k, props[k]); + } - componentDidMount: function() { - console.log('Grommet Donut is deprecated. Please use Grommet Meter instead.'); - this._initialTimer = setTimeout(this._initialTimeout, 10); - this.setState({initial: true, activeIndex: 0}); - window.addEventListener('resize', this._onResize); - this._onResize(); - }, + return obj; + }, - componentWillReceiveProps: function (newProps) { - var series = newProps.series || this._generateSeries(newProps); - var importantIndex = this._importantIndex(series); - this.setState({ - importantIndex: importantIndex, - activeIndex: importantIndex, - series: series - }); - }, + // Snapshot some (hopefully still) native built-ins + arrSlice = Array.prototype.slice, + arrConcat = Array.prototype.concat, + arrPush = Array.prototype.push, + arrJoin = Array.prototype.join, + arrShift = Array.prototype.shift, + arrUnshift= Array.prototype.unshift, - componentWillUnmount: function() { - clearTimeout(this._initialTimer); - clearTimeout(this._resizeTimer); - window.removeEventListener('resize', this._onResize); - }, + // Naive Function.prototype.bind for compatibility + fnBind = Function.prototype.bind || function (thisObj) { + var fn = this, + args = arrSlice.call(arguments, 1); - _itemColorIndex: function (item, index) { - return item.colorIndex || ('graph-' + (index + 1)); - }, + // All our (presently) bound functions have either 1 or 0 arguments. By returning + // different function signatures, we can pass some tests in ES3 environments + if (fn.length === 1) { + return function (a) { + return fn.apply(thisObj, arrConcat.call(args, arrSlice.call(arguments))); + }; + } + else { + return function () { + return fn.apply(thisObj, arrConcat.call(args, arrSlice.call(arguments))); + }; + } + }, - render: function() { - var classes = [CLASS_ROOT, CLASS_ROOT + "--" + this.state.orientation]; - if (this.state.size) { - classes.push(CLASS_ROOT + "--" + this.state.size); - } - if (this.props.partial) { - classes.push(CLASS_ROOT + "--partial"); - } - if (this.props.small) { - classes.push(CLASS_ROOT + "--small"); - } + // Default locale is the first-added locale data for us + defaultLocale, - var viewBoxHeight = BASE_SIZE; - if (this.props.partial) { - viewBoxHeight = PARTIAL_SIZE; - } + // Object housing internal properties for constructors + internals = objCreate(null), - var total = 0; - this.state.series.some(function (item) { - total += item.value; - }); + // Keep internal properties internal + secret = Math.random(), - var startAngle = 0; - var anglePer = 360.0 / total; - if (this.props.partial) { - startAngle = 60; - anglePer = 240.0 / total; - } - var value = null; - var units = null; - var label = null; - var activeIndicator = null; + // An object map of date component keys, saves using a regex later + dateWidths = objCreate(null, { narrow:{}, short:{}, long:{} }), - var paths = this.state.series.map(function (item, index) { + // Each constructor prototype should be an instance of the constructor itself, but we + // can't initialise them as such until some locale data has been added, so this is how + // we keep track + numberFormatProtoInitialised = false, + dateTimeFormatProtoInitialised = false, - var endAngle = Math.min(360, Math.max(10, startAngle + (anglePer * item.value))); - if (item.value > 0 && (startAngle + 360) === endAngle) { - // full use for this item, make sure we render it. - endAngle -= 0.1; - } - var radius = 84; - // start from the bottom - var commands = arcCommands(BASE_SIZE / 2, BASE_SIZE / 2, radius, - startAngle + 180, endAngle + 180); - var colorIndex = this._itemColorIndex(item, index); + // Some regular expressions we're using + expCurrencyCode = /^[A-Z]{3}$/, + expUnicodeExSeq = /-u(?:-[0-9a-z]{2,8})+/gi, // See `extension` below - var sliceClasses = [CLASS_ROOT + "__slice"]; - sliceClasses.push("color-index-" + colorIndex); - if (this.state.activeIndex === index) { - sliceClasses.push(CLASS_ROOT + "__slice--active"); - value = item.value; - units = item.units || this.props.units; - label = item.label; - } + expBCP47Syntax, + expExtSequences, + expVariantDupes, + expSingletonDupes, - if (index === this.state.activeIndex) { - var indicatorCommands = activeIndicatorCommands(BASE_SIZE / 2, BASE_SIZE / 2, radius, - startAngle + 180, endAngle + 180); - activeIndicator = ( - React.createElement("path", {stroke: "none", - className: CLASS_ROOT + "__slice-indicator color-index-" + colorIndex, - d: indicatorCommands}) - ); - } + // IANA Subtag Registry redundant tag and subtag maps + redundantTags = { + tags: { + "art-lojban": "jbo", "i-ami": "ami", "i-bnn": "bnn", "i-hak": "hak", + "i-klingon": "tlh", "i-lux": "lb", "i-navajo": "nv", "i-pwn": "pwn", + "i-tao": "tao", "i-tay": "tay", "i-tsu": "tsu", "no-bok": "nb", + "no-nyn": "nn", "sgn-BE-FR": "sfb", "sgn-BE-NL": "vgt", "sgn-CH-DE": "sgg", + "zh-guoyu": "cmn", "zh-hakka": "hak", "zh-min-nan": "nan", "zh-xiang": "hsn", + "sgn-BR": "bzs", "sgn-CO": "csn", "sgn-DE": "gsg", "sgn-DK": "dsl", + "sgn-ES": "ssp", "sgn-FR": "fsl", "sgn-GB": "bfi", "sgn-GR": "gss", + "sgn-IE": "isg", "sgn-IT": "ise", "sgn-JP": "jsl", "sgn-MX": "mfs", + "sgn-NI": "ncs", "sgn-NL": "dse", "sgn-NO": "nsl", "sgn-PT": "psr", + "sgn-SE": "swl", "sgn-US": "ase", "sgn-ZA": "sfs", "zh-cmn": "cmn", + "zh-cmn-Hans": "cmn-Hans", "zh-cmn-Hant": "cmn-Hant", "zh-gan": "gan", "zh-wuu": "wuu", + "zh-yue": "yue" + }, + subtags: { + BU: "MM", DD: "DE", FX: "FR", TP: "TL", YD: "YE", ZR: "CD", heploc: "alalc97", + 'in': "id", iw: "he", ji: "yi", jw: "jv", mo: "ro", ayx: "nun", bjd: "drl", + ccq: "rki", cjr: "mom", cka: "cmr", cmk: "xch", drh: "khk", drw: "prs", gav: "dev", + hrr: "jal", ibi: "opa", kgh: "kml", lcq: "ppr", mst: "mry", myt: "mry", sca: "hle", + tie: "ras", tkk: "twm", tlw: "weo", tnf: "prs", ybd: "rki", yma: "lrr" + }, + extLang: { + aao: [ "aao", "ar" ], abh: [ "abh", "ar" ], abv: [ "abv", "ar" ], acm: [ "acm", "ar" ], + acq: [ "acq", "ar" ], acw: [ "acw", "ar" ], acx: [ "acx", "ar" ], acy: [ "acy", "ar" ], + adf: [ "adf", "ar" ], ads: [ "ads", "sgn" ], aeb: [ "aeb", "ar" ], aec: [ "aec", "ar" ], + aed: [ "aed", "sgn" ], aen: [ "aen", "sgn" ], afb: [ "afb", "ar" ], afg: [ "afg", "sgn" ], + ajp: [ "ajp", "ar" ], apc: [ "apc", "ar" ], apd: [ "apd", "ar" ], arb: [ "arb", "ar" ], + arq: [ "arq", "ar" ], ars: [ "ars", "ar" ], ary: [ "ary", "ar" ], arz: [ "arz", "ar" ], + ase: [ "ase", "sgn" ], asf: [ "asf", "sgn" ], asp: [ "asp", "sgn" ], asq: [ "asq", "sgn" ], + asw: [ "asw", "sgn" ], auz: [ "auz", "ar" ], avl: [ "avl", "ar" ], ayh: [ "ayh", "ar" ], + ayl: [ "ayl", "ar" ], ayn: [ "ayn", "ar" ], ayp: [ "ayp", "ar" ], bbz: [ "bbz", "ar" ], + bfi: [ "bfi", "sgn" ], bfk: [ "bfk", "sgn" ], bjn: [ "bjn", "ms" ], bog: [ "bog", "sgn" ], + bqn: [ "bqn", "sgn" ], bqy: [ "bqy", "sgn" ], btj: [ "btj", "ms" ], bve: [ "bve", "ms" ], + bvl: [ "bvl", "sgn" ], bvu: [ "bvu", "ms" ], bzs: [ "bzs", "sgn" ], cdo: [ "cdo", "zh" ], + cds: [ "cds", "sgn" ], cjy: [ "cjy", "zh" ], cmn: [ "cmn", "zh" ], coa: [ "coa", "ms" ], + cpx: [ "cpx", "zh" ], csc: [ "csc", "sgn" ], csd: [ "csd", "sgn" ], cse: [ "cse", "sgn" ], + csf: [ "csf", "sgn" ], csg: [ "csg", "sgn" ], csl: [ "csl", "sgn" ], csn: [ "csn", "sgn" ], + csq: [ "csq", "sgn" ], csr: [ "csr", "sgn" ], czh: [ "czh", "zh" ], czo: [ "czo", "zh" ], + doq: [ "doq", "sgn" ], dse: [ "dse", "sgn" ], dsl: [ "dsl", "sgn" ], dup: [ "dup", "ms" ], + ecs: [ "ecs", "sgn" ], esl: [ "esl", "sgn" ], esn: [ "esn", "sgn" ], eso: [ "eso", "sgn" ], + eth: [ "eth", "sgn" ], fcs: [ "fcs", "sgn" ], fse: [ "fse", "sgn" ], fsl: [ "fsl", "sgn" ], + fss: [ "fss", "sgn" ], gan: [ "gan", "zh" ], gds: [ "gds", "sgn" ], gom: [ "gom", "kok" ], + gse: [ "gse", "sgn" ], gsg: [ "gsg", "sgn" ], gsm: [ "gsm", "sgn" ], gss: [ "gss", "sgn" ], + gus: [ "gus", "sgn" ], hab: [ "hab", "sgn" ], haf: [ "haf", "sgn" ], hak: [ "hak", "zh" ], + hds: [ "hds", "sgn" ], hji: [ "hji", "ms" ], hks: [ "hks", "sgn" ], hos: [ "hos", "sgn" ], + hps: [ "hps", "sgn" ], hsh: [ "hsh", "sgn" ], hsl: [ "hsl", "sgn" ], hsn: [ "hsn", "zh" ], + icl: [ "icl", "sgn" ], ils: [ "ils", "sgn" ], inl: [ "inl", "sgn" ], ins: [ "ins", "sgn" ], + ise: [ "ise", "sgn" ], isg: [ "isg", "sgn" ], isr: [ "isr", "sgn" ], jak: [ "jak", "ms" ], + jax: [ "jax", "ms" ], jcs: [ "jcs", "sgn" ], jhs: [ "jhs", "sgn" ], jls: [ "jls", "sgn" ], + jos: [ "jos", "sgn" ], jsl: [ "jsl", "sgn" ], jus: [ "jus", "sgn" ], kgi: [ "kgi", "sgn" ], + knn: [ "knn", "kok" ], kvb: [ "kvb", "ms" ], kvk: [ "kvk", "sgn" ], kvr: [ "kvr", "ms" ], + kxd: [ "kxd", "ms" ], lbs: [ "lbs", "sgn" ], lce: [ "lce", "ms" ], lcf: [ "lcf", "ms" ], + liw: [ "liw", "ms" ], lls: [ "lls", "sgn" ], lsg: [ "lsg", "sgn" ], lsl: [ "lsl", "sgn" ], + lso: [ "lso", "sgn" ], lsp: [ "lsp", "sgn" ], lst: [ "lst", "sgn" ], lsy: [ "lsy", "sgn" ], + ltg: [ "ltg", "lv" ], lvs: [ "lvs", "lv" ], lzh: [ "lzh", "zh" ], max: [ "max", "ms" ], + mdl: [ "mdl", "sgn" ], meo: [ "meo", "ms" ], mfa: [ "mfa", "ms" ], mfb: [ "mfb", "ms" ], + mfs: [ "mfs", "sgn" ], min: [ "min", "ms" ], mnp: [ "mnp", "zh" ], mqg: [ "mqg", "ms" ], + mre: [ "mre", "sgn" ], msd: [ "msd", "sgn" ], msi: [ "msi", "ms" ], msr: [ "msr", "sgn" ], + mui: [ "mui", "ms" ], mzc: [ "mzc", "sgn" ], mzg: [ "mzg", "sgn" ], mzy: [ "mzy", "sgn" ], + nan: [ "nan", "zh" ], nbs: [ "nbs", "sgn" ], ncs: [ "ncs", "sgn" ], nsi: [ "nsi", "sgn" ], + nsl: [ "nsl", "sgn" ], nsp: [ "nsp", "sgn" ], nsr: [ "nsr", "sgn" ], nzs: [ "nzs", "sgn" ], + okl: [ "okl", "sgn" ], orn: [ "orn", "ms" ], ors: [ "ors", "ms" ], pel: [ "pel", "ms" ], + pga: [ "pga", "ar" ], pks: [ "pks", "sgn" ], prl: [ "prl", "sgn" ], prz: [ "prz", "sgn" ], + psc: [ "psc", "sgn" ], psd: [ "psd", "sgn" ], pse: [ "pse", "ms" ], psg: [ "psg", "sgn" ], + psl: [ "psl", "sgn" ], pso: [ "pso", "sgn" ], psp: [ "psp", "sgn" ], psr: [ "psr", "sgn" ], + pys: [ "pys", "sgn" ], rms: [ "rms", "sgn" ], rsi: [ "rsi", "sgn" ], rsl: [ "rsl", "sgn" ], + sdl: [ "sdl", "sgn" ], sfb: [ "sfb", "sgn" ], sfs: [ "sfs", "sgn" ], sgg: [ "sgg", "sgn" ], + sgx: [ "sgx", "sgn" ], shu: [ "shu", "ar" ], slf: [ "slf", "sgn" ], sls: [ "sls", "sgn" ], + sqk: [ "sqk", "sgn" ], sqs: [ "sqs", "sgn" ], ssh: [ "ssh", "ar" ], ssp: [ "ssp", "sgn" ], + ssr: [ "ssr", "sgn" ], svk: [ "svk", "sgn" ], swc: [ "swc", "sw" ], swh: [ "swh", "sw" ], + swl: [ "swl", "sgn" ], syy: [ "syy", "sgn" ], tmw: [ "tmw", "ms" ], tse: [ "tse", "sgn" ], + tsm: [ "tsm", "sgn" ], tsq: [ "tsq", "sgn" ], tss: [ "tss", "sgn" ], tsy: [ "tsy", "sgn" ], + tza: [ "tza", "sgn" ], ugn: [ "ugn", "sgn" ], ugy: [ "ugy", "sgn" ], ukl: [ "ukl", "sgn" ], + uks: [ "uks", "sgn" ], urk: [ "urk", "ms" ], uzn: [ "uzn", "uz" ], uzs: [ "uzs", "uz" ], + vgt: [ "vgt", "sgn" ], vkk: [ "vkk", "ms" ], vkt: [ "vkt", "ms" ], vsi: [ "vsi", "sgn" ], + vsl: [ "vsl", "sgn" ], vsv: [ "vsv", "sgn" ], wuu: [ "wuu", "zh" ], xki: [ "xki", "sgn" ], + xml: [ "xml", "sgn" ], xmm: [ "xmm", "ms" ], xms: [ "xms", "sgn" ], yds: [ "yds", "sgn" ], + ysl: [ "ysl", "sgn" ], yue: [ "yue", "zh" ], zib: [ "zib", "sgn" ], zlm: [ "zlm", "ms" ], + zmi: [ "zmi", "ms" ], zsl: [ "zsl", "sgn" ], zsm: [ "zsm", "ms" ] + } + }, - startAngle = endAngle; + // Currency minor units output from tools/getISO4217data.js, formatted + currencyMinorUnits = { + BHD: 3, BYR: 0, XOF: 0, BIF: 0, XAF: 0, CLF: 0, CLP: 0, KMF: 0, DJF: 0, + XPF: 0, GNF: 0, ISK: 0, IQD: 3, JPY: 0, JOD: 3, KRW: 0, KWD: 3, LYD: 3, + OMR: 3, PYG: 0, RWF: 0, TND: 3, UGX: 0, UYI: 0, VUV: 0, VND: 0 + }; - return ( - React.createElement("path", {key: item.label, fill: "none", className: sliceClasses.join(' '), d: commands, - onMouseOver: this._onActive.bind(this, index), - onMouseOut: this._onActive.bind(this, this.state.importantIndex), - onClick: item.onClick}) - ); - }, this); + /** + * Defines regular expressions for various operations related to the BCP 47 syntax, + * as defined at http://tools.ietf.org/html/bcp47#section-2.1 + */ + (function () { + var + // extlang = 3ALPHA ; selected ISO 639 codes + // *2("-" 3ALPHA) ; permanently reserved + extlang = '[a-z]{3}(?:-[a-z]{3}){0,2}', - var minLabel; - var maxLabel; - if (this.props.partial) { - if (this.props.min) { - minLabel = ( - React.createElement("div", {className: CLASS_ROOT + "__min-label"}, - this.props.min.value, " ", this.props.units - ) - ); - } - if (this.props.max) { - maxLabel = ( - React.createElement("div", {className: CLASS_ROOT + "__max-label"}, - this.props.max.value, " ", this.props.units - ) - ); - } - } + // language = 2*3ALPHA ; shortest ISO 639 code + // ["-" extlang] ; sometimes followed by + // ; extended language subtags + // / 4ALPHA ; or reserved for future use + // / 5*8ALPHA ; or registered language subtag + language = '(?:[a-z]{2,3}(?:-' + extlang + ')?|[a-z]{4}|[a-z]{5,8})', - var legend = null; - if (this.props.legend) { - legend = ( - React.createElement(Legend, {className: CLASS_ROOT + "__legend", - series: this.props.series, - units: this.props.units, - value: this.props.value, - activeIndex: this.state.activeIndex, - onActive: this._onActive}) - ); - } + // script = 4ALPHA ; ISO 15924 code + script = '[a-z]{4}', - return ( - React.createElement("div", {ref: "donut", className: classes.join(' ')}, - React.createElement("div", {className: CLASS_ROOT + "__graphic-container"}, - React.createElement("svg", {className: CLASS_ROOT + "__graphic", - viewBox: "0 0 " + BASE_SIZE + " " + viewBoxHeight, - preserveAspectRatio: "xMidYMid meet"}, - React.createElement("g", null, - activeIndicator, - paths - ) - ), - React.createElement("div", {className: CLASS_ROOT + "__active"}, - React.createElement("div", {className: CLASS_ROOT + "__active-value large-number-font"}, - value, - React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, units) - ), - React.createElement("div", {className: CLASS_ROOT + "__active-label"}, label) - ), - minLabel, - maxLabel - ), - legend - ) - ); - } + // region = 2ALPHA ; ISO 3166-1 code + // / 3DIGIT ; UN M.49 code + region = '(?:[a-z]{2}|\\d{3})', - }); + // variant = 5*8alphanum ; registered variants + // / (DIGIT 3alphanum) + variant = '(?:[a-z0-9]{5,8}|\\d[a-z0-9]{3})', - module.exports = Donut; + // ; Single alphanumerics + // ; "x" reserved for private use + // singleton = DIGIT ; 0 - 9 + // / %x41-57 ; A - W + // / %x59-5A ; Y - Z + // / %x61-77 ; a - w + // / %x79-7A ; y - z + singleton = '[0-9a-wy-z]', + // extension = singleton 1*("-" (2*8alphanum)) + extension = singleton + '(?:-[a-z0-9]{2,8})+', -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { + // privateuse = "x" 1*("-" (1*8alphanum)) + privateuse = 'x(?:-[a-z0-9]{1,8})+', - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // irregular = "en-GB-oed" ; irregular tags do not match + // / "i-ami" ; the 'langtag' production and + // / "i-bnn" ; would not otherwise be + // / "i-default" ; considered 'well-formed' + // / "i-enochian" ; These tags are all valid, + // / "i-hak" ; but most are deprecated + // / "i-klingon" ; in favor of more modern + // / "i-lux" ; subtags or subtag + // / "i-mingo" ; combination + // / "i-navajo" + // / "i-pwn" + // / "i-tao" + // / "i-tay" + // / "i-tsu" + // / "sgn-BE-FR" + // / "sgn-BE-NL" + // / "sgn-CH-DE" + irregular = '(?:en-GB-oed' + + '|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)' + + '|sgn-(?:BE-FR|BE-NL|CH-DE))', - var React = __webpack_require__(42); - var Top = __webpack_require__(45); + // regular = "art-lojban" ; these tags match the 'langtag' + // / "cel-gaulish" ; production, but their subtags + // / "no-bok" ; are not extended language + // / "no-nyn" ; or variant subtags: their meaning + // / "zh-guoyu" ; is defined by their registration + // / "zh-hakka" ; and all of these are deprecated + // / "zh-min" ; in favor of a more modern + // / "zh-min-nan" ; subtag or sequence of subtags + // / "zh-xiang" + regular = '(?:art-lojban|cel-gaulish|no-bok|no-nyn' + + '|zh-(?:guoyu|hakka|min|min-nan|xiang))', - var CLASS_ROOT = "footer"; + // grandfathered = irregular ; non-redundant tags registered + // / regular ; during the RFC 3066 era + grandfathered = '(?:' + irregular + '|' + regular + ')', - var Footer = React.createClass({displayName: "Footer", + // langtag = language + // ["-" script] + // ["-" region] + // *("-" variant) + // *("-" extension) + // ["-" privateuse] + langtag = language + '(?:-' + script + ')?(?:-' + region + ')?(?:-' + + variant + ')*(?:-' + extension + ')*(?:-' + privateuse + ')?'; - propTypes: { - centered: React.PropTypes.bool, - colorIndex: React.PropTypes.string, - flush: React.PropTypes.bool, - primary: React.PropTypes.bool, - scrollTop: React.PropTypes.bool - }, + // Language-Tag = langtag ; normal language tags + // / privateuse ; private use tag + // / grandfathered ; grandfathered tags + expBCP47Syntax = RegExp('^(?:'+langtag+'|'+privateuse+'|'+grandfathered+')$', 'i'); - getDefaultProps: function () { - return { - flush: true - }; - }, + // Match duplicate variants in a language tag + expVariantDupes = RegExp('^(?!x).*?-('+variant+')-(?:\\w{4,8}-(?!x-))*\\1\\b', 'i'); - _updateState: function () { - this.setState({scrolled: this._scrollable.scrollTop > 0}); - }, + // Match duplicate singletons in a language tag (except in private use) + expSingletonDupes = RegExp('^(?!x).*?-('+singleton+')-(?:\\w+-(?!x-))*\\1\\b', 'i'); - _onClickTop: function() { - this._scrollable.scrollTop = 0; - }, + // Match all extension sequences + expExtSequences = RegExp('-'+extension, 'ig'); + })(); - _onScroll: function() { - // debounce - clearTimeout(this._scrollTimer); - this._scrollTimer = setTimeout(this._updateState, 10); - }, + // Sect 6.2 Language Tags + // ====================== - getInitialState: function () { - return {scrolled: false}; - }, + /** + * The IsStructurallyValidLanguageTag abstract operation verifies that the locale + * argument (which must be a String value) + * + * - represents a well-formed BCP 47 language tag as specified in RFC 5646 section + * 2.1, or successor, + * - does not include duplicate variant subtags, and + * - does not include duplicate singleton subtags. + * + * The abstract operation returns true if locale can be generated from the ABNF + * grammar in section 2.1 of the RFC, starting with Language-Tag, and does not + * contain duplicate variant or singleton subtags (other than as a private use + * subtag). It returns false otherwise. Terminal value characters in the grammar are + * interpreted as the Unicode equivalents of the ASCII octet values given. + */ + function /* 6.2.2 */IsStructurallyValidLanguageTag(locale) { + // represents a well-formed BCP 47 language tag as specified in RFC 5646 + if (!expBCP47Syntax.test(locale)) + return false; - componentDidMount: function () { - this._scrollable = this.refs.footer.getDOMNode().parentNode.parentNode; - this._scrollable.addEventListener("scroll", this._onScroll); - }, + // does not include duplicate variant subtags, and + if (expVariantDupes.test(locale)) + return false; - componentWillUnmount: function () { - this._scrollable.removeEventListener("scroll", this._onScroll); - }, + // does not include duplicate singleton subtags. + if (expSingletonDupes.test(locale)) + return false; - componentWillReceiveProps: function() { - this.setState({scrolled: false}); - }, + return true; + } - componentDidUpdate: function() { - if (!this.state.scrolled) { - this._scrollable.scrollTop = 0; - } - }, + /** + * The CanonicalizeLanguageTag abstract operation returns the canonical and case- + * regularized form of the locale argument (which must be a String value that is + * a structurally valid BCP 47 language tag as verified by the + * IsStructurallyValidLanguageTag abstract operation). It takes the steps + * specified in RFC 5646 section 4.5, or successor, to bring the language tag + * into canonical form, and to regularize the case of the subtags, but does not + * take the steps to bring a language tag into “extlang form” and to reorder + * variant subtags. - render: function() { - var classes = [CLASS_ROOT]; - if (this.props.primary) { - classes.push(CLASS_ROOT + "--primary"); - } - if (this.props.centered) { - classes.push(CLASS_ROOT + "--centered"); - } - if (this.props.flush) { - classes.push(CLASS_ROOT + "--flush"); - } - if (this.props.colorIndex) { - classes.push("background-color-index-" + this.props.colorIndex); - } - if (this.props.className) { - classes.push(this.props.className); - } + * The specifications for extensions to BCP 47 language tags, such as RFC 6067, + * may include canonicalization rules for the extension subtag sequences they + * define that go beyond the canonicalization rules of RFC 5646 section 4.5. + * Implementations are allowed, but not required, to apply these additional rules. + */ + function /* 6.2.3 */CanonicalizeLanguageTag (locale) { + var match, parts; - var top = null; - if (this.props.scrollTop && this.state.scrolled) { - top = ( - React.createElement("div", {className: CLASS_ROOT + "__top control-icon", - onClick: this._onClickTop}, - React.createElement(Top, null) - ) - ); - } + // A language tag is in 'canonical form' when the tag is well-formed + // according to the rules in Sections 2.1 and 2.2 - return ( - React.createElement("div", {ref: "footer", className: classes.join(' ')}, - React.createElement("div", {className: CLASS_ROOT + "__content"}, - this.props.children, - top - ) - ) - ); - } + // Section 2.1 says all subtags use lowercase... + locale = locale.toLowerCase(); - }); + // ...with 2 exceptions: 'two-letter and four-letter subtags that neither + // appear at the start of the tag nor occur after singletons. Such two-letter + // subtags are all uppercase (as in the tags "en-CA-x-ca" or "sgn-BE-FR") and + // four-letter subtags are titlecase (as in the tag "az-Latn-x-latn"). + parts = locale.split('-'); + for (var i = 1, max = parts.length; i < max; i++) { + // Two-letter subtags are all uppercase + if (parts[i].length === 2) + parts[i] = parts[i].toUpperCase(); - module.exports = Footer; + // Four-letter subtags are titlecase + else if (parts[i].length === 4) + parts[i] = parts[i].charAt(0).toUpperCase() + parts[i].slice(1); + // Is it a singleton? + else if (parts[i].length === 1 && parts[i] != 'x') + break; + } + locale = arrJoin.call(parts, '-'); -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { + // The steps laid out in RFC 5646 section 4.5 are as follows: - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 1. Extension sequences are ordered into case-insensitive ASCII order + // by singleton subtag. + if ((match = locale.match(expExtSequences)) && match.length > 1) { + // The built-in sort() sorts by ASCII order, so use that + match.sort(); - var React = __webpack_require__(42); + // Replace all extensions with the joined, sorted array + locale = locale.replace( + RegExp('(?:' + expExtSequences.source + ')+', 'i'), + arrJoin.call(match, '') + ); + } - var CLASS_ROOT = "form"; + // 2. Redundant or grandfathered tags are replaced by their 'Preferred- + // Value', if there is one. + if (hop.call(redundantTags.tags, locale)) + locale = redundantTags.tags[locale]; - var Form = React.createClass({displayName: "Form", + // 3. Subtags are replaced by their 'Preferred-Value', if there is one. + // For extlangs, the original primary language subtag is also + // replaced if there is a primary language subtag in the 'Preferred- + // Value'. + parts = locale.split('-'); - propTypes: { - compact: React.PropTypes.bool, - fill: React.PropTypes.bool, - flush: React.PropTypes.bool, - onSubmit: React.PropTypes.func, - className: React.PropTypes.string - }, + for (var i = 1, max = parts.length; i < max; i++) { + if (hop.call(redundantTags.subtags, parts[i])) + parts[i] = redundantTags.subtags[parts[i]]; - getDefaultProps: function () { - return { - compact: false, - fill: false, - flush: true - }; - }, + else if (hop.call(redundantTags.extLang, parts[i])) { + parts[i] = redundantTags.extLang[parts[i]][0]; - render: function () { - var classes = [CLASS_ROOT]; - if (this.props.compact) { - classes.push(CLASS_ROOT + "--compact"); - } - if (this.props.fill) { - classes.push(CLASS_ROOT + "--fill"); - } - if (this.props.flush) { - classes.push(CLASS_ROOT + "--flush"); - } - if (this.props.className) { - classes.push(this.props.className); + // For extlang tags, the prefix needs to be removed if it is redundant + if (i === 1 && redundantTags.extLang[parts[1]][1] === parts[0]) { + parts = arrSlice.call(parts, i++); + max -= 1; + } + } } - return ( - React.createElement("form", {className: classes.join(' '), onSubmit: this.props.onSubmit}, - this.props.children - ) - ); - } - }); + return arrJoin.call(parts, '-'); + } - module.exports = Form; + /** + * The DefaultLocale abstract operation returns a String value representing the + * structurally valid (6.2.2) and canonicalized (6.2.3) BCP 47 language tag for the + * host environment’s current locale. + */ + function /* 6.2.4 */DefaultLocale () { + return defaultLocale; + } + // Sect 6.3 Currency Codes + // ======================= -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { + /** + * The IsWellFormedCurrencyCode abstract operation verifies that the currency argument + * (after conversion to a String value) represents a well-formed 3-letter ISO currency + * code. The following steps are taken: + */ + function /* 6.3.1 */IsWellFormedCurrencyCode(currency) { + var + // 1. Let `c` be ToString(currency) + c = String(currency), - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 2. Let `normalized` be the result of mapping c to upper case as described + // in 6.1. + normalized = toLatinUpperCase(c); - var React = __webpack_require__(42); + // 3. If the string length of normalized is not 3, return false. + // 4. If normalized contains any character that is not in the range "A" to "Z" + // (U+0041 to U+005A), return false. + if (expCurrencyCode.test(normalized) === false) + return false; - var CLASS_ROOT = "form-field"; + // 5. Return true + return true; + } - var FormField = React.createClass({displayName: "FormField", + // Sect 9.2 Abstract Operations + // ============================ + function /* 9.2.1 */CanonicalizeLocaleList (locales) { + // The abstract operation CanonicalizeLocaleList takes the following steps: - propTypes: { - error: React.PropTypes.string, - help: React.PropTypes.node, - htmlFor: React.PropTypes.string, - label: React.PropTypes.string, - required: React.PropTypes.bool - }, + // 1. If locales is undefined, then a. Return a new empty List + if (locales === undefined) + return new List(); - _onFocus: function () { - this.setState({focus: true}); - }, + var + // 2. Let seen be a new empty List. + seen = new List(), - _onBlur: function () { - this.setState({focus: false}); - }, + // 3. If locales is a String value, then + // a. Let locales be a new array created as if by the expression new + // Array(locales) where Array is the standard built-in constructor with + // that name and locales is the value of locales. + locales = typeof locales === 'string' ? [ locales ] : locales, - _onClick: function () { - if (this._inputElement) { - this._inputElement.focus(); - } - }, + // 4. Let O be ToObject(locales). + O = toObject(locales), - getInitialState: function () { - return {focus: false}; - }, + // 5. Let lenValue be the result of calling the [[Get]] internal method of + // O with the argument "length". + // 6. Let len be ToUint32(lenValue). + len = O.length, - componentDidMount: function () { - var contentsElement = this.refs.contents.getDOMNode(); - var inputElements = contentsElement.querySelectorAll('input, textarea, select'); - if (inputElements.length === 1) { - this._inputElement = inputElements[0]; - this._inputElement.addEventListener('focus', this._onFocus); - this._inputElement.addEventListener('blur', this._onBlur); - } - }, + // 7. Let k be 0. + k = 0; - componentWillUnmount: function () { - if (this._inputElement) { - this._inputElement.removeEventListener('focus', this._onFocus); - this._inputElement.removeEventListener('blur', this._onBlur); - delete this._inputElement; - } - }, + // 8. Repeat, while k < len + while (k < len) { + var + // a. Let Pk be ToString(k). + Pk = String(k), - render: function () { - var classes = [CLASS_ROOT]; - if (this.state.focus) { - classes.push(CLASS_ROOT + "--focus"); - } - if (this.props.required) { - classes.push(CLASS_ROOT + "--required"); - } - if (this.props.htmlFor) { - classes.push(CLASS_ROOT + "--text"); - } + // b. Let kPresent be the result of calling the [[HasProperty]] internal + // method of O with argument Pk. + kPresent = Pk in O; - var error = null; - if (this.props.error) { - classes.push(CLASS_ROOT + "--error"); - error = React.createElement("span", {className: CLASS_ROOT + "__error"}, this.props.error); - } - var help = null; - if (this.props.help) { - help = React.createElement("span", {className: CLASS_ROOT + "__help"}, this.props.help); - } + // c. If kPresent is true, then + if (kPresent) { + var + // i. Let kValue be the result of calling the [[Get]] internal + // method of O with argument Pk. + kValue = O[Pk]; - return ( - React.createElement("div", {className: classes.join(' '), onClick: this._onClick}, - error, - React.createElement("label", {className: CLASS_ROOT + "__label", htmlFor: this.props.htmlFor}, - this.props.label - ), - React.createElement("span", {ref: "contents", className: CLASS_ROOT + "__contents"}, - this.props.children - ), - help - ) - ); - } + // ii. If the type of kValue is not String or Object, then throw a + // TypeError exception. + if (kValue == null || (typeof kValue !== 'string' && typeof kValue !== 'object')) + throw new TypeError('String or Object type expected'); - }); + var + // iii. Let tag be ToString(kValue). + tag = String(kValue); - module.exports = FormField; + // iv. If the result of calling the abstract operation + // IsStructurallyValidLanguageTag (defined in 6.2.2), passing tag as + // the argument, is false, then throw a RangeError exception. + if (!IsStructurallyValidLanguageTag(tag)) + throw new RangeError("'" + tag + "' is not a structurally valid language tag"); + // v. Let tag be the result of calling the abstract operation + // CanonicalizeLanguageTag (defined in 6.2.3), passing tag as the + // argument. + tag = CanonicalizeLanguageTag(tag); -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { + // vi. If tag is not an element of seen, then append tag as the last + // element of seen. + if (arrIndexOf.call(seen, tag) === -1) + arrPush.call(seen, tag); + } - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // d. Increase k by 1. + k++; + } - var React = __webpack_require__(42); + // 9. Return seen. + return seen; + } - var CLASS_ROOT = "header"; + /** + * The BestAvailableLocale abstract operation compares the provided argument + * locale, which must be a String value with a structurally valid and + * canonicalized BCP 47 language tag, against the locales in availableLocales and + * returns either the longest non-empty prefix of locale that is an element of + * availableLocales, or undefined if there is no such element. It uses the + * fallback mechanism of RFC 4647, section 3.4. The following steps are taken: + */ + function /* 9.2.2 */BestAvailableLocale (availableLocales, locale) { + var + // 1. Let candidate be locale + candidate = locale; - var Header = React.createClass({displayName: "Header", + // 2. Repeat + while (true) { + // a. If availableLocales contains an element equal to candidate, then return + // candidate. + if (arrIndexOf.call(availableLocales, candidate) > -1) + return candidate; - propTypes: { - colorIndex: React.PropTypes.string, - fixed: React.PropTypes.bool, - flush: React.PropTypes.bool, - large: React.PropTypes.bool, - primary: React.PropTypes.bool, - small: React.PropTypes.bool - }, + var + // b. Let pos be the character index of the last occurrence of "-" + // (U+002D) within candidate. If that character does not occur, return + // undefined. + pos = candidate.lastIndexOf('-'); - getDefaultProps: function () { - return { - flush: true, - large: false, - primary: false, - small: false - }; - }, + if (pos < 0) + return; - _onResize: function () { - this._alignMirror(); - }, + // c. If pos ≥ 2 and the character "-" occurs at index pos-2 of candidate, + // then decrease pos by 2. + if (pos >= 2 && candidate.charAt(pos - 2) == '-') + pos -= 2; - _alignMirror: function () { - var contentElement = this.refs.content.getDOMNode(); - var mirrorElement = this.refs.mirror.getDOMNode(); + // d. Let candidate be the substring of candidate from position 0, inclusive, + // to position pos, exclusive. + candidate = candidate.substring(0, pos); + } + } - // constrain fixed content to the width of the mirror - var mirrorRect = mirrorElement.getBoundingClientRect(); - contentElement.style.width = '' + Math.floor(mirrorRect.width) + 'px'; + /** + * The LookupMatcher abstract operation compares requestedLocales, which must be + * a List as returned by CanonicalizeLocaleList, against the locales in + * availableLocales and determines the best available language to meet the + * request. The following steps are taken: + */ + function /* 9.2.3 */LookupMatcher (availableLocales, requestedLocales) { + var + // 1. Let i be 0. + i = 0, - // align the mirror height with the content's height - var contentRect = contentElement.getBoundingClientRect(); - mirrorElement.style.height = '' + Math.floor(contentRect.height) + 'px'; - }, + // 2. Let len be the number of elements in requestedLocales. + len = requestedLocales.length, - componentDidMount: function () { - if (this.props.fixed) { - this._alignMirror(); - window.addEventListener('resize', this._onResize); - } - }, + // 3. Let availableLocale be undefined. + availableLocale; - componentDidUpdate: function () { - if (this.props.fixed) { - this._alignMirror(); - } - }, + // 4. Repeat while i < len and availableLocale is undefined: + while (i < len && !availableLocale) { + var + // a. Let locale be the element of requestedLocales at 0-origined list + // position i. + locale = requestedLocales[i], - componentWillUnmount: function () { - if (this.props.fixed) { - window.removeEventListener('resize', this._onResize); - } - }, + // b. Let noExtensionsLocale be the String value that is locale with all + // Unicode locale extension sequences removed. + noExtensionsLocale = String(locale).replace(expUnicodeExSeq, ''), - render: function() { - var classes = [CLASS_ROOT]; - if (this.props.primary) { - classes.push(CLASS_ROOT + "--primary"); - } - if (this.props.fixed) { - classes.push(CLASS_ROOT + "--fixed"); - } - if (this.props.flush) { - classes.push(CLASS_ROOT + "--flush"); - } - if (this.props.large) { - classes.push(CLASS_ROOT + "--large"); + // c. Let availableLocale be the result of calling the + // BestAvailableLocale abstract operation (defined in 9.2.2) with + // arguments availableLocales and noExtensionsLocale. + availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale); + + // d. Increase i by 1. + i++; } - if (this.props.small) { - classes.push(CLASS_ROOT + "--small"); - } - if (this.props.className) { - classes.push(this.props.className); - } - - var mirror = null; - if (this.props.fixed) { - mirror = React.createElement("div", {ref: "mirror", className: CLASS_ROOT + "__mirror"}); - } - - var content = ( - React.createElement("div", {ref: "content", className: CLASS_ROOT + "__content"}, - this.props.children - ) - ); - if (this.props.colorIndex || this.props.fixed) { - var wrapperClasses = [CLASS_ROOT + "__wrapper"]; - if (this.props.colorIndex) { - wrapperClasses.push("background-color-index-" + - this.props.colorIndex); - } - - content = ( - React.createElement("div", {className: wrapperClasses.join(' ')}, - content - ) - ); - } - - return ( - React.createElement("div", {className: classes.join(' ')}, - mirror, - content - ) - ); - } - }); + var + // 5. Let result be a new Record. + result = new Record(); - module.exports = Header; + // 6. If availableLocale is not undefined, then + if (availableLocale !== undefined) { + // a. Set result.[[locale]] to availableLocale. + result['[[locale]]'] = availableLocale; + // b. If locale and noExtensionsLocale are not the same String value, then + if (String(locale) !== String(noExtensionsLocale)) { + var + // i. Let extension be the String value consisting of the first + // substring of locale that is a Unicode locale extension sequence. + extension = locale.match(expUnicodeExSeq)[0], -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { + // ii. Let extensionIndex be the character position of the initial + // "-" of the first Unicode locale extension sequence within locale. + extensionIndex = locale.indexOf('-u-'); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // iii. Set result.[[extension]] to extension. + result['[[extension]]'] = extension; - var React = __webpack_require__(42); + // iv. Set result.[[extensionIndex]] to extensionIndex. + result['[[extensionIndex]]'] = extensionIndex; + } + } + // 7. Else + else + // a. Set result.[[locale]] to the value returned by the DefaultLocale abstract + // operation (defined in 6.2.4). + result['[[locale]]'] = DefaultLocale(); - var Label = React.createClass({displayName: "Label", + // 8. Return result + return result; + } - propTypes: { - icon: React.PropTypes.node, - text: React.PropTypes.string - }, + /** + * The BestFitMatcher abstract operation compares requestedLocales, which must be + * a List as returned by CanonicalizeLocaleList, against the locales in + * availableLocales and determines the best available language to meet the + * request. The algorithm is implementation dependent, but should produce results + * that a typical user of the requested locales would perceive as at least as + * good as those produced by the LookupMatcher abstract operation. Options + * specified through Unicode locale extension sequences must be ignored by the + * algorithm. Information about such subsequences is returned separately. + * The abstract operation returns a record with a [[locale]] field, whose value + * is the language tag of the selected locale, which must be an element of + * availableLocales. If the language tag of the request locale that led to the + * selected locale contained a Unicode locale extension sequence, then the + * returned record also contains an [[extension]] field whose value is the first + * Unicode locale extension sequence, and an [[extensionIndex]] field whose value + * is the index of the first Unicode locale extension sequence within the request + * locale language tag. + */ + function /* 9.2.4 */BestFitMatcher (availableLocales, requestedLocales) { + return LookupMatcher(availableLocales, requestedLocales); + } - render: function() { - var icon = null; - var text = null; - if (this.props.icon) { - icon = (React.createElement("span", {className: "label__icon control-icon"}, this.props.icon)); - } - if (this.props.text) { - text = (React.createElement("span", {className: "label__text"}, this.props.text)); + /** + * The ResolveLocale abstract operation compares a BCP 47 language priority list + * requestedLocales against the locales in availableLocales and determines the + * best available language to meet the request. availableLocales and + * requestedLocales must be provided as List values, options as a Record. + */ + function /* 9.2.5 */ResolveLocale (availableLocales, requestedLocales, options, relevantExtensionKeys, localeData) { + if (availableLocales.length === 0) { + throw new ReferenceError('No locale data has been provided for this object yet.'); } - return ( - React.createElement("div", {className: "label"}, - icon, - text - ) - ); - } - - }); - - module.exports = Label; + // The following steps are taken: + var + // 1. Let matcher be the value of options.[[localeMatcher]]. + matcher = options['[[localeMatcher]]']; -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { + // 2. If matcher is "lookup", then + if (matcher === 'lookup') + var + // a. Let r be the result of calling the LookupMatcher abstract operation + // (defined in 9.2.3) with arguments availableLocales and + // requestedLocales. + r = LookupMatcher(availableLocales, requestedLocales); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 3. Else + else + var + // a. Let r be the result of calling the BestFitMatcher abstract + // operation (defined in 9.2.4) with arguments availableLocales and + // requestedLocales. + r = BestFitMatcher(availableLocales, requestedLocales); - var React = __webpack_require__(42); + var + // 4. Let foundLocale be the value of r.[[locale]]. + foundLocale = r['[[locale]]']; - var Login = React.createClass({displayName: "Login", + // 5. If r has an [[extension]] field, then + if (hop.call(r, '[[extension]]')) + var + // a. Let extension be the value of r.[[extension]]. + extension = r['[[extension]]'], + // b. Let extensionIndex be the value of r.[[extensionIndex]]. + extensionIndex = r['[[extensionIndex]]'], + // c. Let split be the standard built-in function object defined in ES5, + // 15.5.4.14. + split = String.prototype.split, + // d. Let extensionSubtags be the result of calling the [[Call]] internal + // method of split with extension as the this value and an argument + // list containing the single item "-". + extensionSubtags = split.call(extension, '-'), + // e. Let extensionSubtagsLength be the result of calling the [[Get]] + // internal method of extensionSubtags with argument "length". + extensionSubtagsLength = extensionSubtags.length; - propTypes: { - background: React.PropTypes.string - }, + var + // 6. Let result be a new Record. + result = new Record(); - _onResize: function() { - this.adjustBackground(); - }, + // 7. Set result.[[dataLocale]] to foundLocale. + result['[[dataLocale]]'] = foundLocale; - adjustBackground: function() { - // make sure the background always fills the screen, preserve aspect ratio - var windowRatio = window.innerWidth / window.innerHeight; - var image = this.refs.background.getDOMNode(); - var imageRatio = image.scrollWidth / image.scrollHeight; - this.setState({orientation: (windowRatio < imageRatio) ? 'portrait' : 'landscape'}); - }, + var + // 8. Let supportedExtension be "-u". + supportedExtension = '-u', + // 9. Let i be 0. + i = 0, + // 10. Let len be the result of calling the [[Get]] internal method of + // relevantExtensionKeys with argument "length". + len = relevantExtensionKeys.length; - getInitialState: function() { - return { - orientation: null - }; - }, + // 11 Repeat while i < len: + while (i < len) { + var + // a. Let key be the result of calling the [[Get]] internal method of + // relevantExtensionKeys with argument ToString(i). + key = relevantExtensionKeys[i], + // b. Let foundLocaleData be the result of calling the [[Get]] internal + // method of localeData with the argument foundLocale. + foundLocaleData = localeData[foundLocale], + // c. Let keyLocaleData be the result of calling the [[Get]] internal + // method of foundLocaleData with the argument key. + keyLocaleData = foundLocaleData[key], + // d. Let value be the result of calling the [[Get]] internal method of + // keyLocaleData with argument "0". + value = keyLocaleData['0'], + // e. Let supportedExtensionAddition be "". + supportedExtensionAddition = '', + // f. Let indexOf be the standard built-in function object defined in + // ES5, 15.4.4.14. + indexOf = arrIndexOf; - componentDidMount: function() { - window.addEventListener('resize', this._onResize); - setTimeout(this.adjustBackground, 300); - }, + // g. If extensionSubtags is not undefined, then + if (extensionSubtags !== undefined) { + var + // i. Let keyPos be the result of calling the [[Call]] internal + // method of indexOf with extensionSubtags as the this value and + // an argument list containing the single item key. + keyPos = indexOf.call(extensionSubtags, key); - componentWillUnmount: function() { - window.removeEventListener('resize', this._onResize); - }, + // ii. If keyPos ≠ -1, then + if (keyPos !== -1) { + // 1. If keyPos + 1 < extensionSubtagsLength and the length of the + // result of calling the [[Get]] internal method of + // extensionSubtags with argument ToString(keyPos +1) is greater + // than 2, then + if (keyPos + 1 < extensionSubtagsLength + && extensionSubtags[keyPos + 1].length > 2) { + var + // a. Let requestedValue be the result of calling the [[Get]] + // internal method of extensionSubtags with argument + // ToString(keyPos + 1). + requestedValue = extensionSubtags[keyPos + 1], + // b. Let valuePos be the result of calling the [[Call]] + // internal method of indexOf with keyLocaleData as the + // this value and an argument list containing the single + // item requestedValue. + valuePos = indexOf.call(keyLocaleData, requestedValue); - render: function() { - var background = null; - if (this.props.background) { - var classes = ['login__background']; - if (this.state.orientation) { - classes.push('login__background--' + this.state.orientation); - } - background = ( - React.createElement("img", {ref: "background", className: classes.join(' '), - src: this.props.background}) - ); - } - - return ( - React.createElement("div", {className: "login"}, - background, - React.createElement("div", {className: "login__container"}, - this.props.children - ) - ) - ); - } - - }); + // c. If valuePos ≠ -1, then + if (valuePos !== -1) + var + // i. Let value be requestedValue. + value = requestedValue, + // ii. Let supportedExtensionAddition be the + // concatenation of "-", key, "-", and value. + supportedExtensionAddition = '-' + key + '-' + value; + } + // 2. Else + else { + var + // a. Let valuePos be the result of calling the [[Call]] + // internal method of indexOf with keyLocaleData as the this + // value and an argument list containing the single item + // "true". + valuePos = indexOf(keyLocaleData, 'true'); - module.exports = Login; + // b. If valuePos ≠ -1, then + if (valuePos !== -1) + var + // i. Let value be "true". + value = 'true'; + } + } + } + // h. If options has a field [[]], then + if (hop.call(options, '[[' + key + ']]')) { + var + // i. Let optionsValue be the value of options.[[]]. + optionsValue = options['[[' + key + ']]']; + // ii. If the result of calling the [[Call]] internal method of indexOf + // with keyLocaleData as the this value and an argument list + // containing the single item optionsValue is not -1, then + if (indexOf.call(keyLocaleData, optionsValue) !== -1) { + // 1. If optionsValue is not equal to value, then + if (optionsValue !== value) { + // a. Let value be optionsValue. + value = optionsValue; + // b. Let supportedExtensionAddition be "". + supportedExtensionAddition = ''; + } + } + } + // i. Set result.[[]] to value. + result['[[' + key + ']]'] = value; -/***/ }, -/* 11 */ -/***/ function(module, exports, __webpack_require__) { + // j. Append supportedExtensionAddition to supportedExtension. + supportedExtension += supportedExtensionAddition; - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // k. Increase i by 1. + i++; + } + // 12. If the length of supportedExtension is greater than 2, then + if (supportedExtension.length > 2) { + var + // a. Let preExtension be the substring of foundLocale from position 0, + // inclusive, to position extensionIndex, exclusive. + preExtension = foundLocale.substring(0, extensionIndex), + // b. Let postExtension be the substring of foundLocale from position + // extensionIndex to the end of the string. + postExtension = foundLocale.substring(extensionIndex), + // c. Let foundLocale be the concatenation of preExtension, + // supportedExtension, and postExtension. + foundLocale = preExtension + supportedExtension + postExtension; + } + // 13. Set result.[[locale]] to foundLocale. + result['[[locale]]'] = foundLocale; - var React = __webpack_require__(42); - var Form = __webpack_require__(6); - var FormField = __webpack_require__(7); - var CheckBox = __webpack_require__(2); - var IntlMixin = __webpack_require__(43); - var CLASS_ROOT = "login-form"; + // 14. Return result. + return result; + } - var LoginForm = React.createClass({displayName: "LoginForm", + /** + * The LookupSupportedLocales abstract operation returns the subset of the + * provided BCP 47 language priority list requestedLocales for which + * availableLocales has a matching locale when using the BCP 47 Lookup algorithm. + * Locales appear in the same order in the returned list as in requestedLocales. + * The following steps are taken: + */ + function /* 9.2.6 */LookupSupportedLocales (availableLocales, requestedLocales) { + var + // 1. Let len be the number of elements in requestedLocales. + len = requestedLocales.length, + // 2. Let subset be a new empty List. + subset = new List(), + // 3. Let k be 0. + k = 0; - mixins: [IntlMixin], + // 4. Repeat while k < len + while (k < len) { + var + // a. Let locale be the element of requestedLocales at 0-origined list + // position k. + locale = requestedLocales[k], + // b. Let noExtensionsLocale be the String value that is locale with all + // Unicode locale extension sequences removed. + noExtensionsLocale = String(locale).replace(expUnicodeExSeq, ''), + // c. Let availableLocale be the result of calling the + // BestAvailableLocale abstract operation (defined in 9.2.2) with + // arguments availableLocales and noExtensionsLocale. + availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale); - propTypes: { - logo: React.PropTypes.node, - title: React.PropTypes.string, - rememberMe: React.PropTypes.bool, - forgotPassword: React.PropTypes.node, - errors: React.PropTypes.arrayOf(React.PropTypes.string), - onSubmit: React.PropTypes.func - }, + // d. If availableLocale is not undefined, then append locale to the end of + // subset. + if (availableLocale !== undefined) + arrPush.call(subset, locale); - _onSubmit: function (event) { - event.preventDefault(); - var username = this.refs.username.getDOMNode().value.trim(); - var password = this.refs.password.getDOMNode().value.trim(); - if (this.props.onSubmit) { - this.props.onSubmit({username: username, password: password}); + // e. Increment k by 1. + k++; } - }, - getDefaultProps: function () { - return ({ - errors: [] - }); - }, + var + // 5. Let subsetArray be a new Array object whose elements are the same + // values in the same order as the elements of subset. + subsetArray = arrSlice.call(subset); - componentDidMount: function() { - this.refs.username.getDOMNode().focus(); - }, + // 6. Return subsetArray. + return subsetArray; + } - render: function() { - var classes = [CLASS_ROOT]; + /** + * The BestFitSupportedLocales abstract operation returns the subset of the + * provided BCP 47 language priority list requestedLocales for which + * availableLocales has a matching locale when using the Best Fit Matcher + * algorithm. Locales appear in the same order in the returned list as in + * requestedLocales. The steps taken are implementation dependent. + */ + function /*9.2.7 */BestFitSupportedLocales (availableLocales, requestedLocales) { + // ###TODO: implement this function as described by the specification### + return LookupSupportedLocales(availableLocales, requestedLocales); + } - var errors = this.props.errors.map(function (error, index) { - return (React.createElement("div", {key: index, className: CLASS_ROOT + "__error"}, this.getGrommetIntlMessage(error))); - }.bind(this)); + /** + * The SupportedLocales abstract operation returns the subset of the provided BCP + * 47 language priority list requestedLocales for which availableLocales has a + * matching locale. Two algorithms are available to match the locales: the Lookup + * algorithm described in RFC 4647 section 3.4, and an implementation dependent + * best-fit algorithm. Locales appear in the same order in the returned list as + * in requestedLocales. The following steps are taken: + */ + function /*9.2.8 */SupportedLocales (availableLocales, requestedLocales, options) { + // 1. If options is not undefined, then + if (options !== undefined) { + var + // a. Let options be ToObject(options). + options = new Record(toObject(options)), + // b. Let matcher be the result of calling the [[Get]] internal method of + // options with argument "localeMatcher". + matcher = options.localeMatcher; - var logo = null; - if (this.props.logo) { - logo = ( - React.createElement("div", {className: CLASS_ROOT + "__logo"}, - this.props.logo - ) - ); - } + // c. If matcher is not undefined, then + if (matcher !== undefined) { + // i. Let matcher be ToString(matcher). + matcher = String(matcher); - var title = null; - if (this.props.title) { - title = ( - React.createElement("h1", {className: CLASS_ROOT + "__title"}, - this.props.title - ) - ); + // ii. If matcher is not "lookup" or "best fit", then throw a RangeError + // exception. + if (matcher !== 'lookup' && matcher !== 'best fit') + throw new RangeError('matcher should be "lookup" or "best fit"'); + } } + // 2. If matcher is undefined or "best fit", then + if (matcher === undefined || matcher === 'best fit') + var + // a. Let subset be the result of calling the BestFitSupportedLocales + // abstract operation (defined in 9.2.7) with arguments + // availableLocales and requestedLocales. + subset = BestFitSupportedLocales(availableLocales, requestedLocales); + // 3. Else + else + var + // a. Let subset be the result of calling the LookupSupportedLocales + // abstract operation (defined in 9.2.6) with arguments + // availableLocales and requestedLocales. + subset = LookupSupportedLocales(availableLocales, requestedLocales); - var footer = null; - if (this.props.rememberMe || this.props.forgotPassword) { - var rememberMe = null; - if (this.props.rememberMe) { - rememberMe = ( - React.createElement(CheckBox, {className: CLASS_ROOT + "__remember-me", - id: "remember-me", label: this.getGrommetIntlMessage('Remember me')}) - ); - } - footer = ( - React.createElement("div", {className: CLASS_ROOT + "__footer"}, - rememberMe, - this.props.forgotPassword - ) - ); - } + // 4. For each named own property name P of subset, + for (var P in subset) { + if (!hop.call(subset, P)) + continue; - return ( - React.createElement(Form, {className: classes.join(' '), onSubmit: this._onSubmit}, - logo, - title, - React.createElement("fieldset", null, - React.createElement(FormField, {htmlFor: "username", label: this.getGrommetIntlMessage('Username')}, - React.createElement("input", {id: "username", ref: "username", type: "email"}) - ), - React.createElement(FormField, {htmlFor: "password", label: this.getGrommetIntlMessage('Password')}, - React.createElement("input", {id: "password", ref: "password", type: "password"}) - ) - ), - errors, - React.createElement("input", {type: "submit", className: CLASS_ROOT + "__submit primary call-to-action", value: this.getGrommetIntlMessage('Log In')}), - footer - ) - ); - } + // a. Let desc be the result of calling the [[GetOwnProperty]] internal + // method of subset with P. + // b. Set desc.[[Writable]] to false. + // c. Set desc.[[Configurable]] to false. + // d. Call the [[DefineOwnProperty]] internal method of subset with P, desc, + // and true as arguments. + defineProperty(subset, P, { + writable: false, configurable: false, value: subset[P] + }); + } + // "Freeze" the array so no new elements can be added + defineProperty(subset, 'length', { writable: false }); - }); + // 5. Return subset + return subset; + } - module.exports = LoginForm; + /** + * The GetOption abstract operation extracts the value of the property named + * property from the provided options object, converts it to the required type, + * checks whether it is one of a List of allowed values, and fills in a fallback + * value if necessary. + */ + function /*9.2.9 */GetOption (options, property, type, values, fallback) { + var + // 1. Let value be the result of calling the [[Get]] internal method of + // options with argument property. + value = options[property]; + // 2. If value is not undefined, then + if (value !== undefined) { + // a. Assert: type is "boolean" or "string". + // b. If type is "boolean", then let value be ToBoolean(value). + // c. If type is "string", then let value be ToString(value). + value = type === 'boolean' ? Boolean(value) + : (type === 'string' ? String(value) : value); -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { + // d. If values is not undefined, then + if (values !== undefined) { + // i. If values does not contain an element equal to value, then throw a + // RangeError exception. + if (arrIndexOf.call(values, value) === -1) + throw new RangeError("'" + value + "' is not an allowed value for `" + property +'`'); + } - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // e. Return value. + return value; + } + // Else return fallback. + return fallback; + } - var React = __webpack_require__(42); - var ReactLayeredComponent = __webpack_require__(38); - var KeyboardAccelerators = __webpack_require__(37); - var Overlay = __webpack_require__(46); - var MoreIcon = __webpack_require__(31); - var DropCaretIcon = __webpack_require__(47); + /** + * The GetNumberOption abstract operation extracts a property value from the + * provided options object, converts it to a Number value, checks whether it is + * in the allowed range, and fills in a fallback value if necessary. + */ + function /* 9.2.10 */GetNumberOption (options, property, minimum, maximum, fallback) { + var + // 1. Let value be the result of calling the [[Get]] internal method of + // options with argument property. + value = options[property]; - var ROOT_CLASS = "menu"; + // 2. If value is not undefined, then + if (value !== undefined) { + // a. Let value be ToNumber(value). + value = Number(value); - var MenuLayer = React.createClass({displayName: "MenuLayer", + // b. If value is NaN or less than minimum or greater than maximum, throw a + // RangeError exception. + if (isNaN(value) || value < minimum || value > maximum) + throw new RangeError('Value is not a number or outside accepted range'); - propTypes: { - align: React.PropTypes.oneOf(['top', 'bottom', 'left', 'right']), - direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right', 'center']), - onClick: React.PropTypes.func.isRequired, - router: React.PropTypes.func - }, + // c. Return floor(value). + return Math.floor(value); + } + // 3. Else return fallback. + return fallback; + } - childContextTypes: { - router: React.PropTypes.func - }, + // 11.1 The Intl.NumberFormat constructor + // ====================================== - getChildContext: function () { - return { router: this.props.router }; - }, + // Define the NumberFormat constructor internally so it cannot be tainted + function NumberFormatConstructor () { + var locales = arguments[0]; + var options = arguments[1]; - render: function () { - var classes = [ROOT_CLASS + "__layer"]; - if (this.props.direction) { - classes.push(ROOT_CLASS + "__layer--" + this.props.direction); - } - if (this.props.align) { - classes.push(ROOT_CLASS + "__layer--align-" + this.props.align); + if (!this || this === Intl) { + return new Intl.NumberFormat(locales, options); } - return ( - React.createElement("div", {id: "menu-layer", className: classes.join(' '), - onClick: this.props.onClick}, - this.props.children - ) - ); - } + return InitializeNumberFormat(toObject(this), locales, options); + } + + defineProperty(Intl, 'NumberFormat', { + configurable: true, + writable: true, + value: NumberFormatConstructor }); - var Menu = React.createClass({displayName: "Menu", + // Must explicitly set prototypes as unwritable + defineProperty(Intl.NumberFormat, 'prototype', { + writable: false + }); - propTypes: { - align: React.PropTypes.oneOf(['top', 'bottom', 'left', 'right']), - collapse: React.PropTypes.bool, - direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right', 'center']), - icon: React.PropTypes.node, - label: React.PropTypes.string, - primary: React.PropTypes.bool, - small: React.PropTypes.bool - }, + /** + * The abstract operation InitializeNumberFormat accepts the arguments + * numberFormat (which must be an object), locales, and options. It initializes + * numberFormat as a NumberFormat object. + */ + function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, options) { + var + // This will be a internal properties object if we're not already initialized + internal = getInternalProperties(numberFormat), - contextTypes: { - router: React.PropTypes.func - }, + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(); - getDefaultProps: function () { - return { - align: 'left', - direction: 'down', - small: false - }; - }, + // 1. If numberFormat has an [[initializedIntlObject]] internal property with + // value true, throw a TypeError exception. + if (internal['[[initializedIntlObject]]'] === true) + throw new TypeError('`this` object has already been initialized as an Intl object'); - mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay], + // Need this to access the `internal` object + defineProperty(numberFormat, '__getInternalProperties', { + value: function () { + // NOTE: Non-standard, for internal use only + if (arguments[0] === secret) + return internal; + } + }); - _onOpen: function (event) { - event.preventDefault(); - this.setState({active: true}); - }, + // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true. + internal['[[initializedIntlObject]]'] = true; - _onClose: function () { - this.setState({active: false}); - }, + var + // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList + // abstract operation (defined in 9.2.1) with argument locales. + requestedLocales = CanonicalizeLocaleList(locales); - _onFocusControl: function () { - this.setState({controlFocused: true}); - }, + // 4. If options is undefined, then + if (options === undefined) + // a. Let options be the result of creating a new object as if by the + // expression new Object() where Object is the standard built-in constructor + // with that name. + options = {}; - _onBlurControl: function () { - this.setState({controlFocused: false}); - }, + // 5. Else + else + // a. Let options be ToObject(options). + options = toObject(options); - getInitialState: function () { - return { - controlFocused: false, - active: false, - inline: (! this.props.label && ! this.props.icon && ! this.props.collapse) - }; - }, + var + // 6. Let opt be a new Record. + opt = new Record(), - componentDidUpdate: function (prevProps, prevState) { - // Set up keyboard listeners appropriate to the current state. + // 7. Let matcher be the result of calling the GetOption abstract operation + // (defined in 9.2.9) with the arguments options, "localeMatcher", "string", + // a List containing the two String values "lookup" and "best fit", and + // "best fit". + matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit'); - var activeKeyboardHandlers = { - esc: this._onClose, - space: this._onClose, - tab: this._onClose - }; - var focusedKeyboardHandlers = { - space: this._onOpen, - down: this._onOpen - }; + // 8. Set opt.[[localeMatcher]] to matcher. + opt['[[localeMatcher]]'] = matcher; - // the order here is important, need to turn off keys before turning on + var + // 9. Let NumberFormat be the standard built-in object that is the initial value + // of Intl.NumberFormat. + // 10. Let localeData be the value of the [[localeData]] internal property of + // NumberFormat. + localeData = internals.NumberFormat['[[localeData]]'], - if (! this.state.controlFocused && prevState.controlFocused) { - this.stopListeningToKeyboard(focusedKeyboardHandlers); - } + // 11. Let r be the result of calling the ResolveLocale abstract operation + // (defined in 9.2.5) with the [[availableLocales]] internal property of + // NumberFormat, requestedLocales, opt, the [[relevantExtensionKeys]] + // internal property of NumberFormat, and localeData. + r = ResolveLocale( + internals.NumberFormat['[[availableLocales]]'], requestedLocales, + opt, internals.NumberFormat['[[relevantExtensionKeys]]'], localeData + ); - if (! this.state.active && prevState.active) { - document.removeEventListener('click', this._onClose); - this.stopListeningToKeyboard(activeKeyboardHandlers); - this.stopOverlay(); - } + // 12. Set the [[locale]] internal property of numberFormat to the value of + // r.[[locale]]. + internal['[[locale]]'] = r['[[locale]]']; - // re-arm the space key in case we used it when active - if (this.state.controlFocused && (! prevState.controlFocused || - (! this.state.active && prevState.active))) { - this.startListeningToKeyboard(focusedKeyboardHandlers); - } + // 13. Set the [[numberingSystem]] internal property of numberFormat to the value + // of r.[[nu]]. + internal['[[numberingSystem]]'] = r['[[nu]]']; - if (this.state.active && ! prevState.active) { - document.addEventListener('click', this._onClose); - this.startListeningToKeyboard(activeKeyboardHandlers); + // The specification doesn't tell us to do this, but it's helpful later on + internal['[[dataLocale]]'] = r['[[dataLocale]]']; - var controlElement = this.refs.control.getDOMNode(); - var layerElement = document.getElementById('menu-layer'); - var layerControlElement = layerElement.querySelectorAll("." + ROOT_CLASS + "__control")[0]; - var layerControlIconElement = layerElement.querySelectorAll('svg, img')[0]; + var + // 14. Let dataLocale be the value of r.[[dataLocale]]. + dataLocale = r['[[dataLocale]]'], - // give layer control element the same line height and font size as the control - var fontSize = window.getComputedStyle(controlElement).fontSize; - layerControlElement.style.fontSize = fontSize; - var height = controlElement.clientHeight; - if (layerControlIconElement && - height <= (layerControlIconElement.clientHeight + 1)) { - // adjust to align with underlying control when control uses all height - if ('down' === this.props.direction) { - layerControlElement.style.marginTop = '-1px'; - } else if ('up' === this.props.direction) { - layerControlElement.style.marginBottom = '1px'; - } - } - layerControlElement.style.height = height + 'px'; - layerControlElement.style.lineHeight = height + 'px'; + // 15. Let s be the result of calling the GetOption abstract operation with the + // arguments options, "style", "string", a List containing the three String + // values "decimal", "percent", and "currency", and "decimal". + s = GetOption(options, 'style', 'string', new List('decimal', 'percent', 'currency'), 'decimal'); - this.startOverlay(controlElement, layerElement, this.props.align); - } - }, + // 16. Set the [[style]] internal property of numberFormat to s. + internal['[[style]]'] = s; - componentWillUnmount: function () { - document.removeEventListener('click', this._onClose); - }, + var + // 17. Let c be the result of calling the GetOption abstract operation with the + // arguments options, "currency", "string", undefined, and undefined. + c = GetOption(options, 'currency', 'string'); - _renderControl: function () { - var result = null; - var icon = null; - var controlClassName = ROOT_CLASS + "__control"; + // 18. If c is not undefined and the result of calling the + // IsWellFormedCurrencyCode abstract operation (defined in 6.3.1) with + // argument c is false, then throw a RangeError exception. + if (c !== undefined && !IsWellFormedCurrencyCode(c)) + throw new RangeError("'" + c + "' is not a valid currency code"); - var classes = [controlClassName]; + // 19. If s is "currency" and c is undefined, throw a TypeError exception. + if (s === 'currency' && c === undefined) + throw new TypeError('Currency code is required when style is currency'); - if (this.props.icon) { - classes.push(controlClassName + "--labelled"); - icon = this.props.icon; - } else { - classes.push(controlClassName + "--fixed-label"); - icon = React.createElement(MoreIcon, null); - } + // 20. If s is "currency", then + if (s === 'currency') { + // a. Let c be the result of converting c to upper case as specified in 6.1. + c = c.toUpperCase(); - if (this.props.label) { - result = ( - React.createElement("div", {className: classes.join(' ')}, - React.createElement("div", {className: controlClassName + "-icon"}, - icon - ), - React.createElement("span", {className: controlClassName + "-label"}, this.props.label), - React.createElement(DropCaretIcon, {className: controlClassName + "-drop-icon"}) - ) - ); - } else { - result = ( - React.createElement("div", {className: controlClassName}, - icon - ) - ); + // b. Set the [[currency]] internal property of numberFormat to c. + internal['[[currency]]'] = c; + + var + // c. Let cDigits be the result of calling the CurrencyDigits abstract + // operation (defined below) with argument c. + cDigits = CurrencyDigits(c); } - return result; - }, - _classes: function (prefix) { - var classes = [prefix]; + var + // 21. Let cd be the result of calling the GetOption abstract operation with the + // arguments options, "currencyDisplay", "string", a List containing the + // three String values "code", "symbol", and "name", and "symbol". + cd = GetOption(options, 'currencyDisplay', 'string', new List('code', 'symbol', 'name'), 'symbol'); - if (this.props.direction) { - classes.push(prefix + "--" + this.props.direction); - } - if (this.props.align) { - classes.push(prefix + "--align-" + this.props.align); - } - if (this.props.small) { - classes.push(prefix + "--small"); - } - if (this.props.primary) { - classes.push(prefix + "--primary"); - } + // 22. If s is "currency", then set the [[currencyDisplay]] internal property of + // numberFormat to cd. + if (s === 'currency') + internal['[[currencyDisplay]]'] = cd; - return classes; - }, + var + // 23. Let mnid be the result of calling the GetNumberOption abstract operation + // (defined in 9.2.10) with arguments options, "minimumIntegerDigits", 1, 21, + // and 1. + mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1); - render: function () { - var classes = this._classes(ROOT_CLASS); - if (this.state.inline) { - classes.push(ROOT_CLASS + "--inline"); - } else { - classes.push(ROOT_CLASS + "--controlled"); - if (this.props.label) { - classes.push(ROOT_CLASS + "--labelled"); - } - } - if (this.props.className) { - classes.push(this.props.className); - } + // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid. + internal['[[minimumIntegerDigits]]'] = mnid; - if (this.state.inline) { + var + // 25. If s is "currency", then let mnfdDefault be cDigits; else let mnfdDefault + // be 0. + mnfdDefault = s === 'currency' ? cDigits : 0, - return ( - React.createElement("div", {className: classes.join(' '), onClick: this._onClose}, - this.props.children - ) - ); + // 26. Let mnfd be the result of calling the GetNumberOption abstract operation + // with arguments options, "minimumFractionDigits", 0, 20, and mnfdDefault. + mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault); - } else { + // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd. + internal['[[minimumFractionDigits]]'] = mnfd; - var controlContents = this._renderControl(); + var + // 28. If s is "currency", then let mxfdDefault be max(mnfd, cDigits); else if s + // is "percent", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault + // be max(mnfd, 3). + mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits) + : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3)), - return ( - React.createElement("div", {ref: "control", className: classes.join(' '), - tabIndex: "0", - onClick: this._onOpen, - onFocus: this._onFocusControl, - onBlur: this._onBlurControl}, - controlContents - ) - ); + // 29. Let mxfd be the result of calling the GetNumberOption abstract operation + // with arguments options, "maximumFractionDigits", mnfd, 20, and mxfdDefault. + mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault); - } - }, + // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd. + internal['[[maximumFractionDigits]]'] = mxfd; - renderLayer: function() { - if (this.state.active) { + var + // 31. Let mnsd be the result of calling the [[Get]] internal method of options + // with argument "minimumSignificantDigits". + mnsd = options.minimumSignificantDigits, - var controlContents = this._renderControl(); + // 32. Let mxsd be the result of calling the [[Get]] internal method of options + // with argument "maximumSignificantDigits". + mxsd = options.maximumSignificantDigits; - var first = null; - var second = null; - if ('up' === this.props.direction) { - first = this.props.children; - second = controlContents; - } else { - first = controlContents; - second = this.props.children; - } + // 33. If mnsd is not undefined or mxsd is not undefined, then: + if (mnsd !== undefined || mxsd !== undefined) { + // a. Let mnsd be the result of calling the GetNumberOption abstract + // operation with arguments options, "minimumSignificantDigits", 1, 21, + // and 1. + mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1); - return ( - React.createElement(MenuLayer, {router: this.context.router, - align: this.props.align, - direction: this.props.direction, - onClick: this._onClose}, - first, - second - ) - ); + // b. Let mxsd be the result of calling the GetNumberOption abstract + // operation with arguments options, "maximumSignificantDigits", mnsd, + // 21, and 21. + mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21); - } else { - return (React.createElement("span", null)); + // c. Set the [[minimumSignificantDigits]] internal property of numberFormat + // to mnsd, and the [[maximumSignificantDigits]] internal property of + // numberFormat to mxsd. + internal['[[minimumSignificantDigits]]'] = mnsd; + internal['[[maximumSignificantDigits]]'] = mxsd; } - } - - }); + var + // 34. Let g be the result of calling the GetOption abstract operation with the + // arguments options, "useGrouping", "boolean", undefined, and true. + g = GetOption(options, 'useGrouping', 'boolean', undefined, true); - module.exports = Menu; + // 35. Set the [[useGrouping]] internal property of numberFormat to g. + internal['[[useGrouping]]'] = g; + var + // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of + // localeData with argument dataLocale. + dataLocaleData = localeData[dataLocale], -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { + // 37. Let patterns be the result of calling the [[Get]] internal method of + // dataLocaleData with argument "patterns". + patterns = dataLocaleData.patterns; - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + // 38. Assert: patterns is an object (see 11.2.3) - var React = __webpack_require__(42); - var Legend = __webpack_require__(44); + var + // 39. Let stylePatterns be the result of calling the [[Get]] internal method of + // patterns with argument s. + stylePatterns = patterns[s]; - var CLASS_ROOT = "meter"; + // 40. Set the [[positivePattern]] internal property of numberFormat to the + // result of calling the [[Get]] internal method of stylePatterns with the + // argument "positivePattern". + internal['[[positivePattern]]'] = stylePatterns.positivePattern; - var BAR_LENGTH = 192; - var BAR_THICKNESS = 24; - var MID_BAR_THICKNESS = BAR_THICKNESS / 2; + // 41. Set the [[negativePattern]] internal property of numberFormat to the + // result of calling the [[Get]] internal method of stylePatterns with the + // argument "negativePattern". + internal['[[negativePattern]]'] = stylePatterns.negativePattern; - var CIRCLE_WIDTH = 192; - var CIRCLE_RADIUS = 84; + // 42. Set the [[boundFormat]] internal property of numberFormat to undefined. + internal['[[boundFormat]]'] = undefined; - var ARC_HEIGHT = 144; + // 43. Set the [[initializedNumberFormat]] internal property of numberFormat to + // true. + internal['[[initializedNumberFormat]]'] = true; - function polarToCartesian (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)) - }; - } + // In ES3, we need to pre-bind the format() function + if (es3) + numberFormat.format = GetFormatNumber.call(numberFormat); - function arcCommands (x, y, radius, startAngle, endAngle) { - var start = polarToCartesian(x, y, radius, endAngle); - var end = polarToCartesian(x, y, radius, startAngle); - var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; - var d = [ - "M", start.x, start.y, - "A", radius, radius, 0, arcSweep, 0, end.x, end.y - ].join(" "); - return d; + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); + + // Return the newly initialised object + return numberFormat; } - function activeIndicatorCommands (x, y, radius, startAngle, endAngle) { - var midAngle = endAngle - ((endAngle - startAngle) / 2); - var point = polarToCartesian(x, y, radius - 24, midAngle); - var start = polarToCartesian(x, y, radius, midAngle - 10); - var end = polarToCartesian(x, y, radius, midAngle + 10); - var d = ["M", point.x, point.y, - "L", start.x, start.y, - "A", radius, radius, 0, 0, 0, end.x, end.y, - "Z" - ].join(" "); - return d; + function CurrencyDigits(currency) { + // When the CurrencyDigits abstract operation is called with an argument currency + // (which must be an upper case String value), the following steps are taken: + + // 1. If the ISO 4217 currency and funds code list contains currency as an + // alphabetic code, then return the minor unit value corresponding to the + // currency from the list; else return 2. + return currencyMinorUnits[currency] !== undefined + ? currencyMinorUnits[currency] + : 2; } - var Meter = React.createClass({displayName: "Meter", + /* 11.2.3 */internals.NumberFormat = { + '[[availableLocales]]': [], + '[[relevantExtensionKeys]]': ['nu'], + '[[localeData]]': {} + }; - propTypes: { - important: React.PropTypes.number, - large: React.PropTypes.bool, - legend: React.PropTypes.bool, - legendTotal: React.PropTypes.bool, - max: React.PropTypes.oneOfType([ - React.PropTypes.shape({ - value: React.PropTypes.number.isRequired, - label: React.PropTypes.string - }), - React.PropTypes.number - ]), - min: React.PropTypes.oneOfType([ - React.PropTypes.shape({ - value: React.PropTypes.number.isRequired, - label: React.PropTypes.string - }), - React.PropTypes.number - ]), - series: React.PropTypes.arrayOf(React.PropTypes.shape({ - label: React.PropTypes.string, - value: React.PropTypes.number.isRequired, - colorIndex: React.PropTypes.string, - important: React.PropTypes.bool, - onClick: React.PropTypes.func - })), - small: React.PropTypes.bool, - threshold: React.PropTypes.number, - type: React.PropTypes.oneOf(['bar', 'arc', 'circle']), - units: React.PropTypes.string, - value: React.PropTypes.number, - vertical: React.PropTypes.bool - }, + /** + * When the supportedLocalesOf method of Intl.NumberFormat is called, the + * following steps are taken: + */ + /* 11.2.2 */defineProperty(Intl.NumberFormat, 'supportedLocalesOf', { + configurable: true, + writable: true, + value: fnBind.call(supportedLocalesOf, internals.NumberFormat) + }); - getDefaultProps: function () { - return { - type: 'bar' - }; - }, + /** + * This named accessor property returns a function that formats a number + * according to the effective locale and the formatting options of this + * NumberFormat object. + */ + /* 11.3.2 */defineProperty(Intl.NumberFormat.prototype, 'format', { + configurable: true, + get: GetFormatNumber + }); - _initialTimeout: function () { - this.setState({ - initial: false, - activeIndex: this.state.importantIndex - }); - clearTimeout(this._timeout); - }, + function GetFormatNumber() { + var internal = this != null && typeof this === 'object' && getInternalProperties(this); - _onActivate: function (index) { - this.setState({initial: false, activeIndex: index}); - }, + // Satisfy test 11.3_b + if (!internal || !internal['[[initializedNumberFormat]]']) + throw new TypeError('`this` value for format() is not an initialized Intl.NumberFormat object.'); - _onResize: function() { - // debounce - clearTimeout(this._resizeTimer); - this._resizeTimer = setTimeout(this._layout, 50); - }, + // The value of the [[Get]] attribute is a function that takes the following + // steps: - _layout: function () { - // legendPosition based on available window orientation - var ratio = window.innerWidth / window.innerHeight; - if (ratio < 0.8) { - this.setState({legendPosition: 'bottom'}); - } else if (ratio > 1.2) { - this.setState({legendPosition: 'right'}); - } - /* - // content based on available real estate - var parentElement = this.refs.donut.getDOMNode().parentNode; - var width = parentElement.offsetWidth; - var height = parentElement.offsetHeight; - var donutHeight = BASE_SIZE; - if (this.props.partial) { - donutHeight = PARTIAL_SIZE; - } - if (height < donutHeight || width < BASE_SIZE || - (width < (BASE_SIZE * 2) && height < (donutHeight * 2))) { - this.setState({size: 'small'}); - } else { - this.setState({size: null}); - } - */ - }, + // 1. If the [[boundFormat]] internal property of this NumberFormat object + // is undefined, then: + if (internal['[[boundFormat]]'] === undefined) { + var + // a. Let F be a Function object, with internal properties set as + // specified for built-in functions in ES5, 15, or successor, and the + // length property set to 1, that takes the argument value and + // performs the following steps: + F = function (value) { + // i. If value is not provided, then let value be undefined. + // ii. Let x be ToNumber(value). + // iii. Return the result of calling the FormatNumber abstract + // operation (defined below) with arguments this and x. + return FormatNumber(this, /* x = */Number(value)); + }, - _generateSeries: function (props, min, max) { - var remaining = max.value - props.value; - return [ - {value: props.value, important: true}, - {value: remaining, colorIndex: 'unset'} - ]; - }, + // b. Let bind be the standard built-in function object defined in ES5, + // 15.3.4.5. + // c. Let bf be the result of calling the [[Call]] internal method of + // bind with F as the this value and an argument list containing + // the single item this. + bf = fnBind.call(F, this); - _importantIndex: function (series) { - var result = series.length - 1; - if (this.props.hasOwnProperty('important')) { - result = this.props.important; + // d. Set the [[boundFormat]] internal property of this NumberFormat + // object to bf. + internal['[[boundFormat]]'] = bf; + } + // Return the value of the [[boundFormat]] internal property of this + // NumberFormat object. + return internal['[[boundFormat]]']; } - series.some(function (data, index) { - if (data.important) { - result = index; - return true; - } - }); - return result; - }, - // Normalize min or max to an object. - _terminal: function (terminal) { - if (typeof terminal === 'number') { - terminal = {value: terminal}; - } - return terminal; - }, + /** + * When the FormatNumber abstract operation is called with arguments numberFormat + * (which must be an object initialized as a NumberFormat) and x (which must be a + * Number value), it returns a String value representing x according to the + * effective locale and the formatting options of numberFormat. + */ + function FormatNumber (numberFormat, x) { + var n, - _seriesTotal: function (series) { - var total = 0; - series.some(function (item) { - total += item.value; - }); - return total; - }, + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(), - // Generates state based on the provided props. - _stateFromProps: function (props) { - var total; - if (props.series && props.series.length > 1) { - total = this._seriesTotal(props.series); - } else { - total = 100; - } - // Normalize min and max - var min = this._terminal(props.min || 0); - // Max could be provided in props or come from the total of - // a multi-value series. - var max = this._terminal(props.max || total); - // Normalize simple value prop to a series, if needed. - var series = props.series || this._generateSeries(props, min, max); - // Determine important index. - var importantIndex = this._importantIndex(series); - total = this._seriesTotal(series); + internal = getInternalProperties(numberFormat), + locale = internal['[[dataLocale]]'], + nums = internal['[[numberingSystem]]'], + data = internals.NumberFormat['[[localeData]]'][locale], + ild = data.symbols[nums] || data.symbols.latn, - var state = { - importantIndex: importantIndex, - activeIndex: importantIndex, - legendPosition: 'bottom', - series: series, - min: min, - max: max, - total: total - }; + // 1. Let negative be false. + negative = false; - if ('arc' === this.props.type) { - state.startAngle = 60; - state.anglePer = 240.0 / total; - if (this.props.vertical) { - state.angleOffset = 90; - } else { - state.angleOffset = 180; - } - } else if ('circle' === this.props.type) { - state.startAngle = 1; - state.anglePer = 358.0 / total; - state.angleOffset = 180; - } else if ('bar' === this.props.type) { - state.scale = BAR_LENGTH / (max.value - min.value); + // 2. If the result of isFinite(x) is false, then + if (isFinite(x) === false) { + // a. If x is NaN, then let n be an ILD String value indicating the NaN value. + if (isNaN(x)) + n = ild.nan; + + // b. Else + else { + // a. Let n be an ILD String value indicating infinity. + n = ild.infinity; + // b. If x < 0, then let negative be true. + if (x < 0) + negative = true; + } } + // 3. Else + else { + // a. If x < 0, then + if (x < 0) { + // i. Let negative be true. + negative = true; + // ii. Let x be -x. + x = -x; + } - return state; - }, + // b. If the value of the [[style]] internal property of numberFormat is + // "percent", let x be 100 × x. + if (internal['[[style]]'] === 'percent') + x *= 100; - getInitialState: function() { - var state = this._stateFromProps(this.props); - state.initial = true; - return state; - }, + // c. If the [[minimumSignificantDigits]] and [[maximumSignificantDigits]] + // internal properties of numberFormat are present, then + if (hop.call(internal, '[[minimumSignificantDigits]]') && + hop.call(internal, '[[maximumSignificantDigits]]')) + // i. Let n be the result of calling the ToRawPrecision abstract operation + // (defined below), passing as arguments x and the values of the + // [[minimumSignificantDigits]] and [[maximumSignificantDigits]] + // internal properties of numberFormat. + n = ToRawPrecision(x, + internal['[[minimumSignificantDigits]]'], + internal['[[maximumSignificantDigits]]']); + // d. Else + else + // i. Let n be the result of calling the ToRawFixed abstract operation + // (defined below), passing as arguments x and the values of the + // [[minimumIntegerDigits]], [[minimumFractionDigits]], and + // [[maximumFractionDigits]] internal properties of numberFormat. + n = ToRawFixed(x, + internal['[[minimumIntegerDigits]]'], + internal['[[minimumFractionDigits]]'], + internal['[[maximumFractionDigits]]']); - componentDidMount: function() { - this._initialTimer = setTimeout(this._initialTimeout, 10); - window.addEventListener('resize', this._onResize); - this._onResize(); - }, + // e. If the value of the [[numberingSystem]] internal property of + // numberFormat matches one of the values in the “Numbering System” column + // of Table 2 below, then + if (numSys[nums]) { + // i. Let digits be an array whose 10 String valued elements are the + // UTF-16 string representations of the 10 digits specified in the + // “Digits” column of Table 2 in the row containing the value of the + // [[numberingSystem]] internal property. + var digits = numSys[internal['[[numberingSystem]]']]; + // ii. Replace each digit in n with the value of digits[digit]. + n = String(n).replace(/\d/g, function (digit) { + return digits[digit]; + }); + } + // f. Else use an implementation dependent algorithm to map n to the + // appropriate representation of n in the given numbering system. + else + n = String(n); // ###TODO### - componentWillReceiveProps: function (newProps) { - var state = this._stateFromProps(newProps); - this.setState(state); - }, + // g. If n contains the character ".", then replace it with an ILND String + // representing the decimal separator. + n = n.replace(/\./g, ild.decimal); - componentWillUnmount: function() { - clearTimeout(this._initialTimer); - clearTimeout(this._resizeTimer); - window.removeEventListener('resize', this._onResize); - }, + // h. If the value of the [[useGrouping]] internal property of numberFormat + // is true, then insert an ILND String representing a grouping separator + // into an ILND set of locations within the integer part of n. + if (internal['[[useGrouping]]'] === true) { + var + parts = n.split(ild.decimal), + igr = parts[0], - _itemColorIndex: function (item, index) { - return item.colorIndex || ('graph-' + (index + 1)); - }, + // Primary group represents the group closest to the decimal + pgSize = data.patterns.primaryGroupSize || 3, - _translateBarWidth: function (value) { - return Math.round(this.state.scale * value); - }, + // Secondary group is every other group + sgSize = data.patterns.secondaryGroupSize || pgSize; - _renderBar: function () { - var start = 0; - var minRemaining = this.state.min.value; - var bars = this.state.series.map(function (item, index) { - var colorIndex = this._itemColorIndex(item, index); - var barClasses = [CLASS_ROOT + "__bar"]; - if (index === this.state.activeIndex) { - barClasses.push(CLASS_ROOT + "__bar--active"); - } - barClasses.push("color-index-" + colorIndex); + // Group only if necessary + if (igr.length > pgSize) { + var + groups = new List(), - var value = item.value - minRemaining; - minRemaining = Math.max(0, minRemaining - item.value); - var distance = this._translateBarWidth(value); - var commands; - if (this.props.vertical) { - commands = "M" + MID_BAR_THICKNESS + "," + (BAR_LENGTH - start) + - " L" + MID_BAR_THICKNESS + "," + (BAR_LENGTH - (start + distance)); - } else { - commands = "M" + start + "," + MID_BAR_THICKNESS + - " L" + (start + distance) + "," + MID_BAR_THICKNESS; - } - start += distance; + // Index of the primary grouping separator + end = igr.length - pgSize, - return ( - React.createElement("path", {key: index, className: barClasses.join(' '), d: commands, - onMouseOver: this._onActivate.bind(this, index), - onMouseOut: this._onActivate.bind(this, this.state.importantIndex), - onClick: item.onClick}) - ); - }, this); + // Starting index for our loop + idx = end % sgSize, - return bars; - }, + start = igr.slice(0, idx); - _renderArcOrCircle: function () { - var startAngle = this.state.startAngle; - var activeIndicator = null; + if (start.length) + arrPush.call(groups, start); - var paths = this.state.series.map(function (item, index) { - var sliceClasses = [CLASS_ROOT + "__slice"]; - if (index === this.state.activeIndex) { - sliceClasses.push(CLASS_ROOT + "__slice--active"); - } - var colorIndex = this._itemColorIndex(item, index); - sliceClasses.push("color-index-" + colorIndex); + // Loop to separate into secondary grouping digits + while (idx < end) { + arrPush.call(groups, igr.slice(idx, idx + sgSize)); + idx += sgSize; + } - var endAngle = Math.min(360, Math.max(0, - startAngle + (this.state.anglePer * item.value))); - // start from the bottom - var commands = arcCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, - startAngle + this.state.angleOffset, - endAngle + this.state.angleOffset); + // Add the primary grouping digits + arrPush.call(groups, igr.slice(end)); - if (index === this.state.activeIndex) { - var indicatorCommands = - activeIndicatorCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, - startAngle + this.state.angleOffset, - endAngle + this.state.angleOffset); - activeIndicator = ( - React.createElement("path", {stroke: "none", - className: CLASS_ROOT + "__slice-indicator color-index-" + colorIndex, - d: indicatorCommands}) - ); - } + parts[0] = arrJoin.call(groups, ild.group); + } - startAngle = endAngle; + n = arrJoin.call(parts, ild.decimal); + } + } - return ( - React.createElement("path", {key: item.label, fill: "none", - className: sliceClasses.join(' '), d: commands, - onMouseOver: this._onActivate.bind(this, index), - onMouseOut: this._onActivate.bind(this, this.state.importantIndex), - onClick: item.onClick}) - ); - }, this); + var + // 4. If negative is true, then let result be the value of the [[negativePattern]] + // internal property of numberFormat; else let result be the value of the + // [[positivePattern]] internal property of numberFormat. + result = internal[negative === true ? '[[negativePattern]]' : '[[positivePattern]]']; - return ( - React.createElement("g", null, - activeIndicator, - paths - ) - ); - }, + // 5. Replace the substring "{number}" within result with n. + result = result.replace('{number}', n); - _renderCurrent: function () { - var current; - var active = this.state.series[this.state.activeIndex]; - if ('arc' === this.props.type || 'circle' === this.props.type) { - current = ( - React.createElement("div", {className: CLASS_ROOT + "__active"}, - React.createElement("div", {className: CLASS_ROOT + "__active-value large-number-font"}, - active.value, - React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, - this.props.units - ) - ), - React.createElement("div", {className: CLASS_ROOT + "__active-label"}, - active.label - ) - ) - ); - } else if ('bar' === this.props.type) { - current = ( - React.createElement("span", {className: CLASS_ROOT + "__active"}, - React.createElement("span", {className: CLASS_ROOT + "__active-value large-number-font"}, - active.value - ), - React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, - this.props.units - ) - ) - ); - } - return current; - }, + // 6. If the value of the [[style]] internal property of numberFormat is + // "currency", then: + if (internal['[[style]]'] === 'currency') { + var cd, + // a. Let currency be the value of the [[currency]] internal property of + // numberFormat. + currency = internal['[[currency]]'], - _renderBarThreshold: function () { - var distance = - this._translateBarWidth(this.props.threshold - this.state.min.value); - var commands; - if (this.props.vertical) { - commands = "M0," + (BAR_LENGTH - distance) + - " L" + BAR_THICKNESS + "," + (BAR_LENGTH - distance); - } else { - commands = "M" + distance + ",0 L" + distance + "," + BAR_THICKNESS; - } - return React.createElement("path", {className: CLASS_ROOT + "__threshold", d: commands}); - }, + // Shorthand for the currency data + cData = data.currencies[currency]; - _renderCircleOrArcThreshold: function () { - var startAngle = this.state.startAngle + - (this.state.anglePer * this.props.threshold); - var endAngle = Math.min(360, Math.max(0, startAngle + 1)); - // start from the bottom - var commands = arcCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, - startAngle + 180, endAngle + 180); - return ( - React.createElement("path", {className: CLASS_ROOT + "__threshold", d: commands}) - ); - }, + // b. If the value of the [[currencyDisplay]] internal property of + // numberFormat is "code", then let cd be currency. + // c. Else if the value of the [[currencyDisplay]] internal property of + // numberFormat is "symbol", then let cd be an ILD string representing + // currency in short form. If the implementation does not have such a + // representation of currency, then use currency itself. + // d. Else if the value of the [[currencyDisplay]] internal property of + // numberFormat is "name", then let cd be an ILD string representing + // currency in long form. If the implementation does not have such a + // representation of currency, then use currency itself. + switch (internal['[[currencyDisplay]]']) { + case 'symbol': + cd = cData || currency; + break; - _renderLegend: function () { - return ( - React.createElement(Legend, {className: CLASS_ROOT + "__legend", - series: this.state.series, - units: this.props.units, - activeIndex: this.state.activeIndex, - onActive: this._onActive}) - ); - }, + default: + case 'code': + case 'name': + cd = currency; + } - render: function() { - var classes = [CLASS_ROOT]; - classes.push(CLASS_ROOT + "--" + this.props.type); - classes.push(CLASS_ROOT + "--legend-" + this.state.legendPosition); - if (this.props.vertical) { - classes.push(CLASS_ROOT + "--vertical"); - } - if (this.props.small) { - classes.push(CLASS_ROOT + "--small"); - } - if (this.props.large) { - classes.push(CLASS_ROOT + "--large"); - } - if (this.props.className) { - classes.push(this.props.className); + // e. Replace the substring "{currency}" within result with cd. + result = result.replace('{currency}', cd); } - var viewBoxHeight; - var viewBoxWidth; - if ('arc' === this.props.type) { - if (this.props.vertical) { - viewBoxWidth = ARC_HEIGHT; - viewBoxHeight = CIRCLE_WIDTH; - } else { - viewBoxWidth = CIRCLE_WIDTH; - viewBoxHeight = ARC_HEIGHT; - } - } else if ('circle' === this.props.type) { - viewBoxWidth = CIRCLE_WIDTH; - viewBoxHeight = CIRCLE_WIDTH; - } else if ('bar' === this.props.type) { - if (this.props.vertical) { - viewBoxWidth = BAR_THICKNESS; - viewBoxHeight = BAR_LENGTH; - } else { - viewBoxWidth = BAR_LENGTH; - viewBoxHeight = BAR_THICKNESS; - } - } + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); - var values = null; - if ('arc' === this.props.type || 'circle' === this.props.type) { - values = this._renderArcOrCircle(); - } else if ('bar' === this.props.type) { - values = this._renderBar(); - } + // 7. Return result. + return result; + } - var threshold = null; - if (this.props.threshold) { - if ('arc' === this.props.type || 'circle' === this.props.type) { - threshold = this._renderCircleOrArcThreshold(); - } else if ('bar' === this.props.type) { - threshold = this._renderBarThreshold(); - } - } + /** + * When the ToRawPrecision abstract operation is called with arguments x (which + * must be a finite non-negative number), minPrecision, and maxPrecision (both + * must be integers between 1 and 21) the following steps are taken: + */ + function ToRawPrecision (x, minPrecision, maxPrecision) { + var + // 1. Let p be maxPrecision. + p = maxPrecision; - var minLabel = null; - if (this.state.min.label) { - minLabel = ( - React.createElement("div", {className: CLASS_ROOT + "__label-min"}, - this.state.min.label - ) - ); - } - var maxLabel = null; - if (this.state.max.label) { - maxLabel = ( - React.createElement("div", {className: CLASS_ROOT + "__label-max"}, - this.state.max.label - ) - ); + // 2. If x = 0, then + if (x === 0) { + var + // a. Let m be the String consisting of p occurrences of the character "0". + m = arrJoin.call(Array (p + 1), '0'), + // b. Let e be 0. + e = 0; } + // 3. Else + else { + // a. Let e and n be integers such that 10ᵖ⁻¹ ≤ n < 10ᵖ and for which the + // exact mathematical value of n × 10ᵉ⁻ᵖ⁺¹ – x is as close to zero as + // possible. If there are two such sets of e and n, pick the e and n for + // which n × 10ᵉ⁻ᵖ⁺¹ is larger. + var + e = log10Floor(Math.abs(x)), - var current = null; - if (this.state.activeIndex >= 0) { - current = this._renderCurrent(); - } + // Easier to get to m from here + f = Math.round(Math.exp((Math.abs(e - p + 1)) * Math.LN10)), - var legend = null; - if (this.props.legend) { - legend = this._renderLegend(); + // b. Let m be the String consisting of the digits of the decimal + // representation of n (in order, with no leading zeroes) + m = String(Math.round(e - p + 1 < 0 ? x * f : x / f)); } - return ( - React.createElement("div", {className: classes.join(' ')}, - React.createElement("svg", {className: CLASS_ROOT + "__graphic", - viewBox: "0 0 " + viewBoxWidth + " " + viewBoxHeight, - preserveAspectRatio: "xMidYMid meet"}, - React.createElement("g", null, - values, - threshold - ) - ), - current, - React.createElement("div", {className: CLASS_ROOT + "__labels"}, - minLabel, - maxLabel - ), - legend - ) - ); - } - - }); + // 4. If e ≥ p, then + if (e >= p) + // a. Return the concatenation of m and e-p+1 occurrences of the character "0". + return m + arrJoin.call(Array(e-p+1 + 1), '0'); - module.exports = Meter; + // 5. If e = p-1, then + else if (e === p - 1) + // a. Return m. + return m; + // 6. If e ≥ 0, then + else if (e >= 0) + // a. Let m be the concatenation of the first e+1 characters of m, the character + // ".", and the remaining p–(e+1) characters of m. + m = m.slice(0, e + 1) + '.' + m.slice(e + 1); -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { + // 7. If e < 0, then + else if (e < 0) + // a. Let m be the concatenation of the String "0.", –(e+1) occurrences of the + // character "0", and the string m. + m = '0.' + arrJoin.call(Array (-(e+1) + 1), '0') + m; - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - var React = __webpack_require__(42); + // 8. If m contains the character ".", and maxPrecision > minPrecision, then + if (m.indexOf(".") >= 0 && maxPrecision > minPrecision) { + var + // a. Let cut be maxPrecision – minPrecision. + cut = maxPrecision - minPrecision; - var Panel = React.createClass({displayName: "Panel", + // b. Repeat while cut > 0 and the last character of m is "0": + while (cut > 0 && m.charAt(m.length-1) === '0') { + // i. Remove the last character from m. + m = m.slice(0, -1); - propTypes: { - direction: React.PropTypes.string, - index: React.PropTypes.oneOf([1, 2]) - }, + // ii. Decrease cut by 1. + cut--; + } - render: function() { - var classes = ["panel"]; - if (this.props.direction === 'horizontal') { - classes.push("panel--horizontal"); - } - if (this.props.index) { - classes.push("panel--index-" + this.props.index); + // c. If the last character of m is ".", then + if (m.charAt(m.length-1) === '.') + // i. Remove the last character from m. + m = m.slice(0, -1); } + // 9. Return m. + return m; + } - var title = null; - if (this.props.title) { - title = (React.createElement("h2", {className: "panel__title"}, this.props.title)); - } + /** + * When the ToRawFixed abstract operation is called with arguments x (which must + * be a finite non-negative number), minInteger (which must be an integer between + * 1 and 21), minFraction, and maxFraction (which must be integers between 0 and + * 20) the following steps are taken: + */ + function ToRawFixed (x, minInteger, minFraction, maxFraction) { + // (or not because Number.toPrototype.toFixed does a lot of it for us) + var idx, - return ( - React.createElement("div", {className: classes.join(' ')}, - title, - this.props.children - ) - ); - } - }); + // We can pick up after the fixed formatted string (m) is created + m = Number.prototype.toFixed.call(x, maxFraction), - module.exports = Panel; + // 4. If [maxFraction] ≠ 0, then + // ... + // e. Let int be the number of characters in a. + // + // 5. Else let int be the number of characters in m. + igr = m.split(".")[0].length, // int is a reserved word + // 6. Let cut be maxFraction – minFraction. + cut = maxFraction - minFraction, -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { + exp = (idx = m.indexOf('e')) > -1 ? m.slice(idx + 1) : 0; - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + if (exp) { + m = m.slice(0, idx).replace('.', ''); + m += arrJoin.call(Array(exp - (m.length - 1) + 1), '0') + + '.' + arrJoin.call(Array(maxFraction + 1), '0'); - var React = __webpack_require__(42); + igr = m.length; + } - var CLASS_ROOT = "radio-button"; + // 7. Repeat while cut > 0 and the last character of m is "0": + while (cut > 0 && m.slice(-1) === "0") { + // a. Remove the last character from m. + m = m.slice(0, -1); - var RadioButton = React.createClass({displayName: "RadioButton", + // b. Decrease cut by 1. + cut--; + } - propTypes: { - checked: React.PropTypes.bool, - defaultChecked: React.PropTypes.bool, - id: React.PropTypes.string.isRequired, - label: React.PropTypes.string.isRequired, - name: React.PropTypes.string, - onChange: React.PropTypes.func - }, - - render: function () { - var classes = [CLASS_ROOT]; - if (this.props.className) { - classes.push(this.props.className); - } - return ( - React.createElement("label", {className: classes.join(' ')}, - React.createElement("input", {className: CLASS_ROOT + "__input", - id: this.props.id, name: this.props.name, type: "radio", - checked: this.props.checked, - defaultChecked: this.props.defaultChecked, - onChange: this.props.onChange}), - React.createElement("span", {className: CLASS_ROOT + "__control"}), - React.createElement("span", {className: CLASS_ROOT + "__label"}, - this.props.label - ) - ) - ); - } + // 8. If the last character of m is ".", then + if (m.slice(-1) === ".") + // a. Remove the last character from m. + m = m.slice(0, -1); - }); + // 9. If int < minInteger, then + if (igr < minInteger) + // a. Let z be the String consisting of minInteger–int occurrences of the + // character "0". + var z = arrJoin.call(Array(minInteger - igr + 1), '0'); - module.exports = RadioButton; + // 10. Let m be the concatenation of Strings z and m. + // 11. Return m. + return (z ? z : '') + m; + } + // Sect 11.3.2 Table 2, Numbering systems + // ====================================== + var numSys = { + arab: [ '\u0660', '\u0661', '\u0662', '\u0663', '\u0664', '\u0665', '\u0666', '\u0667', '\u0668', '\u0669' ], + arabext: [ '\u06F0', '\u06F1', '\u06F2', '\u06F3', '\u06F4', '\u06F5', '\u06F6', '\u06F7', '\u06F8', '\u06F9' ], + bali: [ '\u1B50', '\u1B51', '\u1B52', '\u1B53', '\u1B54', '\u1B55', '\u1B56', '\u1B57', '\u1B58', '\u1B59' ], + beng: [ '\u09E6', '\u09E7', '\u09E8', '\u09E9', '\u09EA', '\u09EB', '\u09EC', '\u09ED', '\u09EE', '\u09EF' ], + deva: [ '\u0966', '\u0967', '\u0968', '\u0969', '\u096A', '\u096B', '\u096C', '\u096D', '\u096E', '\u096F' ], + fullwide:[ '\uFF10', '\uFF11', '\uFF12', '\uFF13', '\uFF14', '\uFF15', '\uFF16', '\uFF17', '\uFF18', '\uFF19' ], + gujr: [ '\u0AE6', '\u0AE7', '\u0AE8', '\u0AE9', '\u0AEA', '\u0AEB', '\u0AEC', '\u0AED', '\u0AEE', '\u0AEF' ], + guru: [ '\u0A66', '\u0A67', '\u0A68', '\u0A69', '\u0A6A', '\u0A6B', '\u0A6C', '\u0A6D', '\u0A6E', '\u0A6F' ], + hanidec: [ '\u3007', '\u4E00', '\u4E8C', '\u4E09', '\u56DB', '\u4E94', '\u516D', '\u4E03', '\u516B', '\u4E5D' ], + khmr: [ '\u17E0', '\u17E1', '\u17E2', '\u17E3', '\u17E4', '\u17E5', '\u17E6', '\u17E7', '\u17E8', '\u17E9' ], + knda: [ '\u0CE6', '\u0CE7', '\u0CE8', '\u0CE9', '\u0CEA', '\u0CEB', '\u0CEC', '\u0CED', '\u0CEE', '\u0CEF' ], + laoo: [ '\u0ED0', '\u0ED1', '\u0ED2', '\u0ED3', '\u0ED4', '\u0ED5', '\u0ED6', '\u0ED7', '\u0ED8', '\u0ED9' ], + latn: [ '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039' ], + limb: [ '\u1946', '\u1947', '\u1948', '\u1949', '\u194A', '\u194B', '\u194C', '\u194D', '\u194E', '\u194F' ], + mlym: [ '\u0D66', '\u0D67', '\u0D68', '\u0D69', '\u0D6A', '\u0D6B', '\u0D6C', '\u0D6D', '\u0D6E', '\u0D6F' ], + mong: [ '\u1810', '\u1811', '\u1812', '\u1813', '\u1814', '\u1815', '\u1816', '\u1817', '\u1818', '\u1819' ], + mymr: [ '\u1040', '\u1041', '\u1042', '\u1043', '\u1044', '\u1045', '\u1046', '\u1047', '\u1048', '\u1049' ], + orya: [ '\u0B66', '\u0B67', '\u0B68', '\u0B69', '\u0B6A', '\u0B6B', '\u0B6C', '\u0B6D', '\u0B6E', '\u0B6F' ], + tamldec: [ '\u0BE6', '\u0BE7', '\u0BE8', '\u0BE9', '\u0BEA', '\u0BEB', '\u0BEC', '\u0BED', '\u0BEE', '\u0BEF' ], + telu: [ '\u0C66', '\u0C67', '\u0C68', '\u0C69', '\u0C6A', '\u0C6B', '\u0C6C', '\u0C6D', '\u0C6E', '\u0C6F' ], + thai: [ '\u0E50', '\u0E51', '\u0E52', '\u0E53', '\u0E54', '\u0E55', '\u0E56', '\u0E57', '\u0E58', '\u0E59' ], + tibt: [ '\u0F20', '\u0F21', '\u0F22', '\u0F23', '\u0F24', '\u0F25', '\u0F26', '\u0F27', '\u0F28', '\u0F29' ] + }; -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { + /** + * This function provides access to the locale and formatting options computed + * during initialization of the object. + * + * The function returns a new object whose properties and attributes are set as + * if constructed by an object literal assigning to each of the following + * properties the value of the corresponding internal property of this + * NumberFormat object (see 11.4): locale, numberingSystem, style, currency, + * currencyDisplay, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, and + * useGrouping. Properties whose corresponding internal properties are not present + * are not assigned. + */ + /* 11.3.3 */defineProperty(Intl.NumberFormat.prototype, 'resolvedOptions', { + configurable: true, + writable: true, + value: function () { + var prop, + descs = new Record(), + props = [ + 'locale', 'numberingSystem', 'style', 'currency', 'currencyDisplay', + 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits', + 'minimumSignificantDigits', 'maximumSignificantDigits', 'useGrouping' + ], + internal = this != null && typeof this === 'object' && getInternalProperties(this); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // Satisfy test 11.3_b + if (!internal || !internal['[[initializedNumberFormat]]']) + throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.'); - var React = __webpack_require__(42); - var ReactLayeredComponent = __webpack_require__(38); - var KeyboardAccelerators = __webpack_require__(37); - var Overlay = __webpack_require__(46); - var SearchIcon = __webpack_require__(33); - var IntlMixin = __webpack_require__(43); + for (var i = 0, max = props.length; i < max; i++) { + if (hop.call(internal, prop = '[['+ props[i] +']]')) + descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true }; + } - var CLASS_ROOT = "search"; + return objCreate({}, descs); + } + }); - var Search = React.createClass({displayName: "Search", + // 12.1 The Intl.DateTimeFormat constructor + // ================================== - propTypes: { - align: React.PropTypes.oneOf(['left', 'right']), - defaultValue: React.PropTypes.string, - inline: React.PropTypes.bool, - onChange: React.PropTypes.func, - placeHolder: React.PropTypes.string, - suggestions: React.PropTypes.arrayOf(React.PropTypes.string) - }, + // Define the DateTimeFormat constructor internally so it cannot be tainted + function DateTimeFormatConstructor () { + var locales = arguments[0]; + var options = arguments[1]; - getDefaultProps: function () { - return { - align: 'left', - inline: false, - placeHolder: 'Search' - }; - }, + if (!this || this === Intl) { + return new Intl.DateTimeFormat(locales, options); + } + return InitializeDateTimeFormat(toObject(this), locales, options); + } - mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay, IntlMixin], + defineProperty(Intl, 'DateTimeFormat', { + configurable: true, + writable: true, + value: DateTimeFormatConstructor + }); - _onAddLayer: function (event) { - event.preventDefault(); - this.setState({layer: true, activeSuggestionIndex: -1}); - }, + // Must explicitly set prototypes as unwritable + defineProperty(DateTimeFormatConstructor, 'prototype', { + writable: false + }); - _onRemoveLayer: function () { - this.setState({layer: false}); - }, + /** + * The abstract operation InitializeDateTimeFormat accepts the arguments dateTimeFormat + * (which must be an object), locales, and options. It initializes dateTimeFormat as a + * DateTimeFormat object. + */ + function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales, options) { + var + // This will be a internal properties object if we're not already initialized + internal = getInternalProperties(dateTimeFormat), - _onFocusControl: function () { - this.setState({ - controlFocused: true, - layer: true, - activeSuggestionIndex: -1 - }); - }, + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(); - _onBlurControl: function () { - this.setState({controlFocused: false}); - }, + // 1. If dateTimeFormat has an [[initializedIntlObject]] internal property with + // value true, throw a TypeError exception. + if (internal['[[initializedIntlObject]]'] === true) + throw new TypeError('`this` object has already been initialized as an Intl object'); - _onFocusInput: function () { - this.refs.input.getDOMNode().select(); - this.setState({ - layer: (! this.state.inline || this.props.suggestions), - activeSuggestionIndex: -1 + // Need this to access the `internal` object + defineProperty(dateTimeFormat, '__getInternalProperties', { + value: function () { + // NOTE: Non-standard, for internal use only + if (arguments[0] === secret) + return internal; + } }); - }, - _onBlurInput: function () { - //this.setState({layer: false}); - }, + // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true. + internal['[[initializedIntlObject]]'] = true; - _onChangeInput: function (event) { - this.setState({activeSuggestionIndex: -1}); - if (this.props.onChange) { - this.props.onChange(event.target.value); - } - }, + var + // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList + // abstract operation (defined in 9.2.1) with argument locales. + requestedLocales = CanonicalizeLocaleList(locales), - _onNextSuggestion: function () { - var index = this.state.activeSuggestionIndex; - index = Math.min(index + 1, this.props.suggestions.length - 1); - this.setState({activeSuggestionIndex: index}); - }, + // 4. Let options be the result of calling the ToDateTimeOptions abstract + // operation (defined below) with arguments options, "any", and "date". + options = ToDateTimeOptions(options, 'any', 'date'), - _onPreviousSuggestion: function () { - var index = this.state.activeSuggestionIndex; - index = Math.max(index - 1, 0); - this.setState({activeSuggestionIndex: index}); - }, + // 5. Let opt be a new Record. + opt = new Record(); - _onEnter: function () { - if (this.state.activeSuggestionIndex >= 0) { - var text = this.props.suggestions[this.state.activeSuggestionIndex]; - if (this.props.onChange) { - this.props.onChange(text); - } - } - this._onRemoveLayer(); - }, + // 6. Let matcher be the result of calling the GetOption abstract operation + // (defined in 9.2.9) with arguments options, "localeMatcher", "string", a List + // containing the two String values "lookup" and "best fit", and "best fit". + matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit'); - _onClickSuggestion: function (item) { - if (this.props.onChange) { - this.props.onChange(item); - } - this._onRemoveLayer(); - }, + // 7. Set opt.[[localeMatcher]] to matcher. + opt['[[localeMatcher]]'] = matcher; - _onSink: function (event) { - event.stopPropagation(); - event.nativeEvent.stopImmediatePropagation(); - }, + var + // 8. Let DateTimeFormat be the standard built-in object that is the initial + // value of Intl.DateTimeFormat. + DateTimeFormat = internals.DateTimeFormat, // This is what we *really* need - _layout: function () { - if (window.innerWidth < 600) { - this.setState({inline: false}); - } else { - this.setState({inline: this.props.inline}); - } - }, + // 9. Let localeData be the value of the [[localeData]] internal property of + // DateTimeFormat. + localeData = DateTimeFormat['[[localeData]]'], - _onResize: function () { - // debounce - clearTimeout(this._resizeTimer); - this._resizeTimer = setTimeout(this._layout, 50); - }, + // 10. Let r be the result of calling the ResolveLocale abstract operation + // (defined in 9.2.5) with the [[availableLocales]] internal property of + // DateTimeFormat, requestedLocales, opt, the [[relevantExtensionKeys]] + // internal property of DateTimeFormat, and localeData. + r = ResolveLocale(DateTimeFormat['[[availableLocales]]'], requestedLocales, + opt, DateTimeFormat['[[relevantExtensionKeys]]'], localeData); - getInitialState: function () { - return { - align: 'left', - controlFocused: false, - inline: this.props.inline, - layer: false, - activeSuggestionIndex: -1 - }; - }, + // 11. Set the [[locale]] internal property of dateTimeFormat to the value of + // r.[[locale]]. + internal['[[locale]]'] = r['[[locale]]']; - componentDidMount: function () { - window.addEventListener('resize', this._onResize); - this._layout(); - }, + // 12. Set the [[calendar]] internal property of dateTimeFormat to the value of + // r.[[ca]]. + internal['[[calendar]]'] = r['[[ca]]']; - componentDidUpdate: function (prevProps, prevState) { + // 13. Set the [[numberingSystem]] internal property of dateTimeFormat to the value of + // r.[[nu]]. + internal['[[numberingSystem]]'] = r['[[nu]]']; - // Set up keyboard listeners appropriate to the current state. + // The specification doesn't tell us to do this, but it's helpful later on + internal['[[dataLocale]]'] = r['[[dataLocale]]']; - var activeKeyboardHandlers = { - esc: this._onRemoveLayer, - tab: this._onRemoveLayer, - up: this._onPreviousSuggestion, - down: this._onNextSuggestion, - enter: this._onEnter - }; - var focusedKeyboardHandlers = { - space: this._onAddLayer - }; + var + // 14. Let dataLocale be the value of r.[[dataLocale]]. + dataLocale = r['[[dataLocale]]'], - // the order here is important, need to turn off keys before turning on + // 15. Let tz be the result of calling the [[Get]] internal method of options with + // argument "timeZone". + tz = options.timeZone; - if (! this.state.controlFocused && prevState.controlFocused) { - this.stopListeningToKeyboard(focusedKeyboardHandlers); - } + // 16. If tz is not undefined, then + if (tz !== undefined) { + // a. Let tz be ToString(tz). + // b. Convert tz to upper case as described in 6.1. + // NOTE: If an implementation accepts additional time zone values, as permitted + // under certain conditions by the Conformance clause, different casing + // rules apply. + tz = toLatinUpperCase(tz); - if (! this.state.layer && prevState.layer) { - document.removeEventListener('click', this._onRemoveLayer); - this.stopListeningToKeyboard(activeKeyboardHandlers); - this.stopOverlay(); + // c. If tz is not "UTC", then throw a RangeError exception. + // ###TODO: accept more time zones### + if (tz !== 'UTC') + throw new RangeError('timeZone is not supported.'); } - if (this.state.controlFocused && ! prevState.controlFocused) { - this.startListeningToKeyboard(focusedKeyboardHandlers); - } + // 17. Set the [[timeZone]] internal property of dateTimeFormat to tz. + internal['[[timeZone]]'] = tz; - if (this.state.layer && ! prevState.layer) { - document.addEventListener('click', this._onRemoveLayer); - this.startListeningToKeyboard(activeKeyboardHandlers); + // 18. Let opt be a new Record. + opt = new Record(); - var baseElement = - (this.refs.control ? this.refs.control : this.refs.input).getDOMNode(); - var layerElement = document.getElementById('search-layer'); - var layerControlElement = layerElement.querySelectorAll('.search__control')[0]; - var layerControlIconElement = layerElement.querySelectorAll('svg')[0]; - var inputElement = layerElement.querySelectorAll('.search__input')[0]; + // 19. For each row of Table 3, except the header row, do: + for (var prop in dateTimeComponents) { + if (!hop.call(dateTimeComponents, prop)) + continue; - // give input element the same line height and font size as the control - var fontSize = window.getComputedStyle(baseElement).fontSize; - inputElement.style.fontSize = fontSize; - var height = baseElement.clientHeight; - if (layerControlIconElement && height <= layerControlIconElement.clientHeight) { - // adjust to align with underlying control when control uses all height - layerControlElement.style.marginTop = '-2px'; - } - inputElement.style.height = height + 'px'; - if (layerControlElement) { - layerControlElement.style.height = height + 'px'; - layerControlElement.style.lineHeight = height + 'px'; - } + var + // 20. Let prop be the name given in the Property column of the row. + // 21. Let value be the result of calling the GetOption abstract operation, + // passing as argument options, the name given in the Property column of the + // row, "string", a List containing the strings given in the Values column of + // the row, and undefined. + value = GetOption(options, prop, 'string', dateTimeComponents[prop]); - this.startOverlay(baseElement, layerElement, this.props.align); - inputElement.focus(); + // 22. Set opt.[[]] to value. + opt['[['+prop+']]'] = value; } - }, - componentWillUnmount: function () { - document.removeEventListener('click', this._onRemoveLayer); - window.removeEventListener('resize', this._onResize); - }, + var + // Assigned a value below + bestFormat, - focus: function () { - var ref = this.refs.input || this.refs.control; - if (ref) { - ref.getDOMNode().focus(); - } - }, + // 23. Let dataLocaleData be the result of calling the [[Get]] internal method of + // localeData with argument dataLocale. + dataLocaleData = localeData[dataLocale], - _createControl: function () { - var controlClassName = CLASS_ROOT + "__control"; - return ( - React.createElement("div", {className: controlClassName}, - React.createElement(SearchIcon, null) - ) - ); - }, + // 24. Let formats be the result of calling the [[Get]] internal method of + // dataLocaleData with argument "formats". + formats = dataLocaleData.formats, + // 25. Let matcher be the result of calling the GetOption abstract operation with + // arguments options, "formatMatcher", "string", a List containing the two String + // values "basic" and "best fit", and "best fit". + matcher = GetOption(options, 'formatMatcher', 'string', new List('basic', 'best fit'), 'best fit'); - _classes: function (prefix) { - var classes = [prefix]; + // 26. If matcher is "basic", then + if (matcher === 'basic') + // 27. Let bestFormat be the result of calling the BasicFormatMatcher abstract + // operation (defined below) with opt and formats. + bestFormat = BasicFormatMatcher(opt, formats); - if (this.state.inline) { - classes.push(prefix + "--inline"); - } else { - classes.push(prefix + "--controlled"); - } - if (this.props.align) { - classes.push(prefix + "--align-" + this.props.align); - } + // 28. Else + else + // 29. Let bestFormat be the result of calling the BestFitFormatMatcher + // abstract operation (defined below) with opt and formats. + bestFormat = BestFitFormatMatcher(opt, formats); - return classes; - }, + // 30. For each row in Table 3, except the header row, do + for (var prop in dateTimeComponents) { + if (!hop.call(dateTimeComponents, prop)) + continue; - render: function () { + // a. Let prop be the name given in the Property column of the row. + // b. Let pDesc be the result of calling the [[GetOwnProperty]] internal method of + // bestFormat with argument prop. + // c. If pDesc is not undefined, then + if (hop.call(bestFormat, prop)) { + var + // i. Let p be the result of calling the [[Get]] internal method of bestFormat + // with argument prop. + p = bestFormat[prop]; - var classes = this._classes(CLASS_ROOT); - if (this.props.className) { - classes.push(this.props.className); + // ii. Set the [[]] internal property of dateTimeFormat to p. + internal['[['+prop+']]'] = p; + } } - if (this.state.inline) { + var + // Assigned a value below + pattern, - var readOnly = this.props.suggestions ? true : false; + // 31. Let hr12 be the result of calling the GetOption abstract operation with + // arguments options, "hour12", "boolean", undefined, and undefined. + hr12 = GetOption(options, 'hour12', 'boolean'/*, undefined, undefined*/); - return ( - React.createElement("div", {className: classes.join(' ')}, - React.createElement("input", {ref: "input", type: "search", - placeholder: this.getGrommetIntlMessage(this.props.placeHolder), - value: this.props.defaultValue, - className: CLASS_ROOT + "__input", - readOnly: readOnly, - onFocus: this._onFocusInput, - onBlur: this._onBlurInput, - onChange: this._onChangeInput}) - ) - ); + // 32. If dateTimeFormat has an internal property [[hour]], then + if (internal['[[hour]]']) { + // a. If hr12 is undefined, then let hr12 be the result of calling the [[Get]] + // internal method of dataLocaleData with argument "hour12". + hr12 = hr12 === undefined ? dataLocaleData.hour12 : hr12; - } else { + // b. Set the [[hour12]] internal property of dateTimeFormat to hr12. + internal['[[hour12]]'] = hr12; - var controlContents = this._createControl(); + // c. If hr12 is true, then + if (hr12 === true) { + var + // i. Let hourNo0 be the result of calling the [[Get]] internal method of + // dataLocaleData with argument "hourNo0". + hourNo0 = dataLocaleData.hourNo0; - return ( - React.createElement("div", {ref: "control", className: classes.join(' '), - tabIndex: "0", - onClick: this._onAddLayer, - onFocus: this._onFocusControl, - onBlur: this._onBlurControl}, - controlContents - ) - ); - } - }, + // ii. Set the [[hourNo0]] internal property of dateTimeFormat to hourNo0. + internal['[[hourNo0]]'] = hourNo0; - renderLayer: function() { - if (this.state.layer) { + // iii. Let pattern be the result of calling the [[Get]] internal method of + // bestFormat with argument "pattern12". + pattern = bestFormat.pattern12; + } - var classes = this._classes(CLASS_ROOT + "__layer"); + // d. Else + else + // i. Let pattern be the result of calling the [[Get]] internal method of + // bestFormat with argument "pattern". + pattern = bestFormat.pattern; + } - var suggestions = null; - if (this.props.suggestions) { - suggestions = this.props.suggestions.map(function (item, index) { - var classes = [CLASS_ROOT + "__suggestion"]; - if (index === this.state.activeSuggestionIndex) { - classes.push(CLASS_ROOT + "__suggestion--active"); - } - return ( - React.createElement("div", {key: item, - className: classes.join(' '), - onClick: this._onClickSuggestion.bind(this, item)}, - item - ) - ); - }, this); - } - - var contents = ( - React.createElement("div", {className: CLASS_ROOT + "__layer-contents", onClick: this._onSink}, - React.createElement("input", {type: "search", - defaultValue: this.props.defaultValue, - className: CLASS_ROOT + "__input", - onChange: this._onChangeInput}), - React.createElement("div", {className: CLASS_ROOT + "__suggestions"}, - suggestions - ) - ) - ); + // 33. Else + else + // a. Let pattern be the result of calling the [[Get]] internal method of + // bestFormat with argument "pattern". + pattern = bestFormat.pattern; - if (! this.state.inline) { - var control = this._createControl(); - var rightAlign = ('right' === this.props.align); - var first = rightAlign ? contents : control; - var second = rightAlign ? control : contents; + // 34. Set the [[pattern]] internal property of dateTimeFormat to pattern. + internal['[[pattern]]'] = pattern; - contents = ( - React.createElement("div", {className: CLASS_ROOT + "__layer-header"}, - first, - second - ) - ); - } + // 35. Set the [[boundFormat]] internal property of dateTimeFormat to undefined. + internal['[[boundFormat]]'] = undefined; - return ( - React.createElement("div", {id: "search-layer", className: classes.join(' ')}, - contents - ) - ); + // 36. Set the [[initializedDateTimeFormat]] internal property of dateTimeFormat to + // true. + internal['[[initializedDateTimeFormat]]'] = true; - } else { // no layer - return (React.createElement("span", null)); - } - } + // In ES3, we need to pre-bind the format() function + if (es3) + dateTimeFormat.format = GetFormatDateTime.call(dateTimeFormat); - }); + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); - module.exports = Search; + // Return the newly initialised object + return dateTimeFormat; + } + /** + * Several DateTimeFormat algorithms use values from the following table, which provides + * property names and allowable values for the components of date and time formats: + */ + var dateTimeComponents = { + weekday: [ "narrow", "short", "long" ], + era: [ "narrow", "short", "long" ], + year: [ "2-digit", "numeric" ], + month: [ "2-digit", "numeric", "narrow", "short", "long" ], + day: [ "2-digit", "numeric" ], + hour: [ "2-digit", "numeric" ], + minute: [ "2-digit", "numeric" ], + second: [ "2-digit", "numeric" ], + timeZoneName: [ "short", "long" ] + }; -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { + /** + * When the ToDateTimeOptions abstract operation is called with arguments options, + * required, and defaults, the following steps are taken: + */ + function ToDateTimeOptions (options, required, defaults) { + // 1. If options is undefined, then let options be null, else let options be + // ToObject(options). + if (options === undefined) + options = null; - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + else { + // (#12) options needs to be a Record, but it also needs to inherit properties + var opt2 = toObject(options); + options = new Record(); - var React = __webpack_require__(42); - var ReactLayeredComponent = __webpack_require__(38); - var KeyboardAccelerators = __webpack_require__(37); - var Overlay = __webpack_require__(46); - var SearchIcon = __webpack_require__(33); + for (var k in opt2) + options[k] = opt2[k]; + } - var CLASS_ROOT = "search-input"; + var + // 2. Let create be the standard built-in function object defined in ES5, 15.2.3.5. + create = objCreate, - var SearchInput = React.createClass({displayName: "SearchInput", + // 3. Let options be the result of calling the [[Call]] internal method of create with + // undefined as the this value and an argument list containing the single item + // options. + options = create(options), - propTypes: { - defaultValue: React.PropTypes.oneOfType([ - React.PropTypes.shape({ - label: React.PropTypes.string, - value: React.PropTypes.string - }), - React.PropTypes.string - ]), - id: React.PropTypes.string, - name: React.PropTypes.string, - onChange: React.PropTypes.func, - onSearch: React.PropTypes.func, - suggestions: React.PropTypes.arrayOf( - React.PropTypes.oneOfType([ - React.PropTypes.shape({ - label: React.PropTypes.string, - value: React.PropTypes.string - }), - React.PropTypes.string - ]) - ), - value: React.PropTypes.oneOfType([ - React.PropTypes.shape({ - label: React.PropTypes.string, - value: React.PropTypes.string - }), - React.PropTypes.string - ]) - }, + // 4. Let needDefaults be true. + needDefaults = true; - mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay], + // 5. If required is "date" or "any", then + if (required === 'date' || required === 'any') { + // a. For each of the property names "weekday", "year", "month", "day": + // i. If the result of calling the [[Get]] internal method of options with the + // property name is not undefined, then let needDefaults be false. + if (options.weekday !== undefined || options.year !== undefined + || options.month !== undefined || options.day !== undefined) + needDefaults = false; + } - _onInputChange: function (event) { - this.props.onChange(event.target.value); - }, + // 6. If required is "time" or "any", then + if (required === 'time' || required === 'any') { + // a. For each of the property names "hour", "minute", "second": + // i. If the result of calling the [[Get]] internal method of options with the + // property name is not undefined, then let needDefaults be false. + if (options.hour !== undefined || options.minute !== undefined || options.second !== undefined) + needDefaults = false; + } - _onOpen: function (event) { - event.preventDefault(); - this.setState({active: true, activeSuggestionIndex: -1}); - }, + // 7. If needDefaults is true and defaults is either "date" or "all", then + if (needDefaults && (defaults === 'date' || defaults === 'all')) + // a. For each of the property names "year", "month", "day": + // i. Call the [[DefineOwnProperty]] internal method of options with the + // property name, Property Descriptor {[[Value]]: "numeric", [[Writable]]: + // true, [[Enumerable]]: true, [[Configurable]]: true}, and false. + options.year = options.month = options.day = 'numeric'; - _onClose: function () { - this.setState({active: false}); - }, + // 8. If needDefaults is true and defaults is either "time" or "all", then + if (needDefaults && (defaults === 'time' || defaults === 'all')) + // a. For each of the property names "hour", "minute", "second": + // i. Call the [[DefineOwnProperty]] internal method of options with the + // property name, Property Descriptor {[[Value]]: "numeric", [[Writable]]: + // true, [[Enumerable]]: true, [[Configurable]]: true}, and false. + options.hour = options.minute = options.second = 'numeric'; - _onSearchChange: function (event) { - this.setState({activeSuggestionIndex: -1}); - this.props.onSearch(event.target.value); - }, + // 9. Return options. + return options; + } - _onNextSuggestion: function () { - var index = this.state.activeSuggestionIndex; - index = Math.min(index + 1, this.props.suggestions.length - 1); - this.setState({activeSuggestionIndex: index}); - }, + /** + * When the BasicFormatMatcher abstract operation is called with two arguments options and + * formats, the following steps are taken: + */ + function BasicFormatMatcher (options, formats) { + return calculateScore(options, formats); + } - _onPreviousSuggestion: function () { - var index = this.state.activeSuggestionIndex; - index = Math.max(index - 1, 0); - this.setState({activeSuggestionIndex: index}); - }, + /** + * Calculates score for BestFitFormatMatcher and BasicFormatMatcher. + * Abstracted from BasicFormatMatcher section. + */ + function calculateScore (options, formats, bestFit) { + var + // Additional penalty type when bestFit === true + diffDataTypePenalty = 8, - _onEnter: function () { - this.setState({active: false}); - this._activation(false); - if (this.state.activeSuggestionIndex >= 0) { - var suggestion = this.props.suggestions[this.state.activeSuggestionIndex]; - this.setState({value: suggestion}); - this.props.onChange(suggestion); - } - }, + // 1. Let removalPenalty be 120. + removalPenalty = 120, - _onClickSuggestion: function (suggestion) { - this.setState({value: suggestion}); - this._activation(false); - this.props.onChange(suggestion); - }, + // 2. Let additionPenalty be 20. + additionPenalty = 20, - _activation: function (active) { + // 3. Let longLessPenalty be 8. + longLessPenalty = 8, - var listeners = { - esc: this._onClose, - tab: this._onClose, - up: this._onPreviousSuggestion, - down: this._onNextSuggestion, - enter: this._onEnter - }; + // 4. Let longMorePenalty be 6. + longMorePenalty = 6, - if (active) { + // 5. Let shortLessPenalty be 6. + shortLessPenalty = 6, - document.addEventListener('click', this._onClose); - this.startListeningToKeyboard(listeners); + // 6. Let shortMorePenalty be 3. + shortMorePenalty = 3, - var element = this.refs.component.getDOMNode(); - var layerElement = document.getElementById(CLASS_ROOT + '-layer'); - this.startOverlay(element, layerElement, 'below'); + // 7. Let bestScore be -Infinity. + bestScore = -Infinity, - // focus on search - var searchInputElement = layerElement.querySelectorAll('input')[0]; - searchInputElement.focus(); + // 8. Let bestFormat be undefined. + bestFormat, - } else { + // 9. Let i be 0. + i = 0, - document.removeEventListener('click', this._onClose); - this.stopListeningToKeyboard(listeners); - this.stopOverlay(); + // 10. Let len be the result of calling the [[Get]] internal method of formats with argument "length". + len = formats.length; - } - }, + // 11. Repeat while i < len: + while (i < len) { + var + // a. Let format be the result of calling the [[Get]] internal method of formats with argument ToString(i). + format = formats[i], - getInitialState: function () { - return { - active: false, - defaultValue: this.props.defaultValue, - value: this.props.value, - activeSuggestionIndex: -1 - }; - }, + // b. Let score be 0. + score = 0; - componentDidMount: function () { - if (this.state.active) { - this._activation(this.state.active); - } - }, + // c. For each property shown in Table 3: + for (var property in dateTimeComponents) { + if (!hop.call(dateTimeComponents, property)) + continue; - componentDidUpdate: function (prevProps, prevState) { - // Set up keyboard listeners appropriate to the current state. - if (! this.state.active && prevState.active) { - this._activation(this.state.active); - } - if (this.state.active && ! prevState.active) { - this._activation(this.state.active); - } - }, + var + // i. Let optionsProp be options.[[]]. + optionsProp = options['[['+ property +']]'], - componentWillUnmount: function () { - this._activation(false); - }, + // ii. Let formatPropDesc be the result of calling the [[GetOwnProperty]] internal method of format + // with argument property. + // iii. If formatPropDesc is not undefined, then + // 1. Let formatProp be the result of calling the [[Get]] internal method of format with argument property. + formatProp = hop.call(format, property) ? format[property] : undefined; - _valueText: function (value) { - var text = ''; - if (value) { - if ('string' === typeof value) { - text = value; - } else { - text = value.label || value.value; - } - } - return text; - }, + // iv. If optionsProp is undefined and formatProp is not undefined, then decrease score by + // additionPenalty. + if (optionsProp === undefined && formatProp !== undefined) + score -= additionPenalty; - render: function() { - var classes = [CLASS_ROOT]; - if (this.state.active) { - classes.push(CLASS_ROOT + "--active"); - } - if (this.props.className) { - classes.push(this.props.className); - } + // v. Else if optionsProp is not undefined and formatProp is undefined, then decrease score by + // removalPenalty. + else if (optionsProp !== undefined && formatProp === undefined) + score -= removalPenalty; - return ( - React.createElement("div", {ref: "component", className: classes.join(' ')}, - React.createElement("input", {className: CLASS_ROOT + "__input", - id: this.props.id, name: this.props.name, - value: this._valueText(this.props.value), - defaultValue: this._valueText(this.props.defaultValue), - onChange: this._onInputChange}), - React.createElement("div", {className: CLASS_ROOT + "__control", onClick: this._onOpen}, - React.createElement(SearchIcon, null) - ) - ) - ); - }, + // vi. Else + else { + var + // 1. Let values be the array ["2-digit", "numeric", "narrow", "short", + // "long"]. + values = [ '2-digit', 'numeric', 'narrow', 'short', 'long' ], - renderLayer: function() { - if (this.state.active) { + // 2. Let optionsPropIndex be the index of optionsProp within values. + optionsPropIndex = arrIndexOf.call(values, optionsProp), - var suggestions = null; - if (this.props.suggestions) { - suggestions = this.props.suggestions.map(function (suggestion, index) { - var classes = [CLASS_ROOT + "__layer-suggestion"]; - if (index === this.state.activeSuggestionIndex) { - classes.push(CLASS_ROOT + "__layer-suggestion--active"); - } - return ( - React.createElement("div", {key: this._valueText(suggestion), - className: classes.join(' '), - onClick: this._onClickSuggestion.bind(this, suggestion)}, - this._valueText(suggestion) - ) - ); - }, this); - } + // 3. Let formatPropIndex be the index of formatProp within values. + formatPropIndex = arrIndexOf.call(values, formatProp), - return ( - React.createElement("div", {id: CLASS_ROOT + "-layer", className: CLASS_ROOT + "__layer", - onClick: this._onClose}, - React.createElement("input", {type: "search", - defaultValue: "", - placeholder: "Search", - className: CLASS_ROOT + "__layer-input", - onChange: this._onSearchChange}), - React.createElement("div", {className: CLASS_ROOT + "__layer-suggestions"}, - suggestions - ) - ) - ); - } else { - return (React.createElement("span", null)); - } - } + // 4. Let delta be max(min(formatPropIndex - optionsPropIndex, 2), -2). + delta = Math.max(Math.min(formatPropIndex - optionsPropIndex, 2), -2); - }); + // When the bestFit argument is true, subtract additional penalty where data types are not the same + if (bestFit && ( + ((optionsProp === 'numeric' || optionsProp === '2-digit') && (formatProp !== 'numeric' && formatProp !== '2-digit')) + || ((optionsProp !== 'numeric' && optionsProp !== '2-digit') && (formatProp === '2-digit' || formatProp === 'numeric')) + )) + score -= diffDataTypePenalty; - module.exports = SearchInput; + // 5. If delta = 2, decrease score by longMorePenalty. + if (delta === 2) + score -= longMorePenalty; + // 6. Else if delta = 1, decrease score by shortMorePenalty. + else if (delta === 1) + score -= shortMorePenalty; -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { + // 7. Else if delta = -1, decrease score by shortLessPenalty. + else if (delta === -1) + score -= shortLessPenalty; - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 8. Else if delta = -2, decrease score by longLessPenalty. + else if (delta === -2) + score -= longLessPenalty; + } + } - var React = __webpack_require__(42); + // d. If score > bestScore, then + if (score > bestScore) { + // i. Let bestScore be score. + bestScore = score; - var CLASS_ROOT = "section"; + // ii. Let bestFormat be format. + bestFormat = format; + } - var Section = React.createClass({displayName: "Section", + // e. Increase i by 1. + i++; + } - propTypes: { - centered: React.PropTypes.bool, - compact: React.PropTypes.bool, - colorIndex: React.PropTypes.string, - direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right']), - flush: React.PropTypes.bool, - texture: React.PropTypes.string - }, + // 12. Return bestFormat. + return bestFormat; + } - getDefaultProps: function () { - return { - colored: false, - direction: 'down', - flush: true, - small: false - }; - }, + /** + * When the BestFitFormatMatcher abstract operation is called with two arguments options + * and formats, it performs implementation dependent steps, which should return a set of + * component representations that a typical user of the selected locale would perceive as + * at least as good as the one returned by BasicFormatMatcher. + * + * This polyfill defines the algorithm to be the same as BasicFormatMatcher, + * with the addition of bonus points awarded where the requested format is of + * the same data type as the potentially matching format. + * + * For example, + * + * { month: 'numeric', day: 'numeric' } + * + * should match + * + * { month: '2-digit', day: '2-digit' } + * + * rather than + * + * { month: 'short', day: 'numeric' } + * + * This makes sense because a user requesting a formatted date with numeric parts would + * not expect to see the returned format containing narrow, short or long part names + */ + function BestFitFormatMatcher (options, formats) { + return calculateScore(options, formats, true); + } - render: function() { - var classes = [CLASS_ROOT]; - var contentClasses = [CLASS_ROOT + "__content"]; + /* 12.2.3 */internals.DateTimeFormat = { + '[[availableLocales]]': [], + '[[relevantExtensionKeys]]': ['ca', 'nu'], + '[[localeData]]': {} + }; - if (this.props.compact) { - classes.push(CLASS_ROOT + "--compact"); - } - if (this.props.centered) { - classes.push(CLASS_ROOT + "--centered"); - } - if (this.props.flush) { - classes.push(CLASS_ROOT + "--flush"); - } - if (this.props.direction) { - classes.push(CLASS_ROOT + "--" + this.props.direction); - } - if (this.props.colorIndex) { - classes.push("background-color-index-" + this.props.colorIndex); - } - if (this.props.className) { - classes.push(this.props.className); - } - - var style = {}; - if (this.props.texture) { - style.backgroundImage = this.props.texture; - } - - return ( - React.createElement("div", {className: classes.join(' '), style: style}, - React.createElement("div", {className: contentClasses.join(' ')}, - this.props.children - ) - ) - ); - } + /** + * When the supportedLocalesOf method of Intl.DateTimeFormat is called, the + * following steps are taken: + */ + /* 12.2.2 */defineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', { + configurable: true, + writable: true, + value: fnBind.call(supportedLocalesOf, internals.DateTimeFormat) + }); + /** + * This named accessor property returns a function that formats a number + * according to the effective locale and the formatting options of this + * DateTimeFormat object. + */ + /* 12.3.2 */defineProperty(Intl.DateTimeFormat.prototype, 'format', { + configurable: true, + get: GetFormatDateTime }); - module.exports = Section; + function GetFormatDateTime() { + var internal = this != null && typeof this === 'object' && getInternalProperties(this); + // Satisfy test 12.3_b + if (!internal || !internal['[[initializedDateTimeFormat]]']) + throw new TypeError('`this` value for format() is not an initialized Intl.DateTimeFormat object.'); -/***/ }, -/* 19 */ -/***/ function(module, exports, __webpack_require__) { + // The value of the [[Get]] attribute is a function that takes the following + // steps: - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 1. If the [[boundFormat]] internal property of this DateTimeFormat object + // is undefined, then: + if (internal['[[boundFormat]]'] === undefined) { + var + // a. Let F be a Function object, with internal properties set as + // specified for built-in functions in ES5, 15, or successor, and the + // length property set to 0, that takes the argument date and + // performs the following steps: + F = function () { + // i. If date is not provided or is undefined, then let x be the + // result as if by the expression Date.now() where Date.now is + // the standard built-in function defined in ES5, 15.9.4.4. + // ii. Else let x be ToNumber(date). + // iii. Return the result of calling the FormatDateTime abstract + // operation (defined below) with arguments this and x. + var x = Number(arguments.length === 0 ? Date.now() : arguments[0]); + return FormatDateTime(this, x); + }, + // b. Let bind be the standard built-in function object defined in ES5, + // 15.3.4.5. + // c. Let bf be the result of calling the [[Call]] internal method of + // bind with F as the this value and an argument list containing + // the single item this. + bf = fnBind.call(F, this); + // d. Set the [[boundFormat]] internal property of this NumberFormat + // object to bf. + internal['[[boundFormat]]'] = bf; + } + // Return the value of the [[boundFormat]] internal property of this + // NumberFormat object. + return internal['[[boundFormat]]']; + } - var React = __webpack_require__(42); - var SpinningIcon = __webpack_require__(35); - var InfiniteScroll = __webpack_require__(48); + /** + * When the FormatDateTime abstract operation is called with arguments dateTimeFormat + * (which must be an object initialized as a DateTimeFormat) and x (which must be a Number + * value), it returns a String value representing x (interpreted as a time value as + * specified in ES5, 15.9.1.1) according to the effective locale and the formatting + * options of dateTimeFormat. + */ + function FormatDateTime(dateTimeFormat, x) { + // 1. If x is not a finite Number, then throw a RangeError exception. + if (!isFinite(x)) + throw new RangeError('Invalid valid date passed to format'); - var CLASS_ROOT = "table"; + var + internal = dateTimeFormat.__getInternalProperties(secret), - var Table = React.createClass({displayName: "Table", + // Creating restore point for properties on the RegExp object... please wait + regexpState = createRegExpRestore(), - propTypes: { - selection: React.PropTypes.number, - onMore: React.PropTypes.func, - scrollable: React.PropTypes.bool, - selectable: React.PropTypes.bool - }, + // 2. Let locale be the value of the [[locale]] internal property of dateTimeFormat. + locale = internal['[[locale]]'], - mixins: [InfiniteScroll], + // 3. Let nf be the result of creating a new NumberFormat object as if by the + // expression new Intl.NumberFormat([locale], {useGrouping: false}) where + // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. + nf = new Intl.NumberFormat([locale], {useGrouping: false}), - getDefaultProps: function () { - return { - selection: null, - scrollable: false, - selectable: false - }; - }, + // 4. Let nf2 be the result of creating a new NumberFormat object as if by the + // expression new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: + // false}) where Intl.NumberFormat is the standard built-in constructor defined in + // 11.1.3. + nf2 = new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: false}), - _clearSelection: function () { - var rows = this.refs.table.getDOMNode() - .querySelectorAll("." + CLASS_ROOT + "__row--selected"); - for (var i = 0; i < rows.length; i++) { - rows[i].classList.remove(CLASS_ROOT + "__row--selected"); - } - }, + // 5. Let tm be the result of calling the ToLocalTime abstract operation (defined + // below) with x, the value of the [[calendar]] internal property of dateTimeFormat, + // and the value of the [[timeZone]] internal property of dateTimeFormat. + tm = ToLocalTime(x, internal['[[calendar]]'], internal['[[timeZone]]']), - _markSelection: function () { - this._clearSelection(); - if (null !== this.state.selection) { - var tbody = this.refs.table.getDOMNode().querySelectorAll('tbody')[0]; - tbody.childNodes[this.state.selection].classList. - add(CLASS_ROOT + "__row--selected"); - } - }, + // 6. Let result be the value of the [[pattern]] internal property of dateTimeFormat. + result = internal['[[pattern]]'], - _onClick: function (event) { - var element = event.target; - while (element.nodeName !== 'TR') { - element = element.parentNode; - } - if (element && element.parentNode.nodeName === 'TBODY') { - this._clearSelection(); - element.classList.add(CLASS_ROOT + "__row--selected"); - } - }, + // Need the locale minus any extensions + dataLocale = internal['[[dataLocale]]'], - _onResize: function () { - this._alignMirror(); - }, + // Need the calendar data from CLDR + localeData = internals.DateTimeFormat['[[localeData]]'][dataLocale].calendars, + ca = internal['[[calendar]]']; - _buildMirror: function () { - var tableElement = this.refs.table.getDOMNode(); - var cells = tableElement.querySelectorAll('thead tr th'); - var mirrorElement = this.refs.mirror.getDOMNode(); - var mirrorRow = mirrorElement.querySelectorAll('thead tr')[0]; - for (var i = 0; i < cells.length; i++) { - mirrorRow.appendChild(cells[i].cloneNode(true)); - } - }, + // 7. For each row of Table 3, except the header row, do: + for (var p in dateTimeComponents) { + // a. If dateTimeFormat has an internal property with the name given in the + // Property column of the row, then: + if (hop.call(internal, '[['+ p +']]')) { + var + // Assigned values below + pm, fv, - _alignMirror: function () { - var tableElement = this.refs.table.getDOMNode(); - var cells = tableElement.querySelectorAll('thead tr th'); - var mirrorElement = this.refs.mirror.getDOMNode(); - var mirrorCells = mirrorElement.querySelectorAll('thead tr th'); + // i. Let p be the name given in the Property column of the row. + // ii. Let f be the value of the [[

]] internal property of dateTimeFormat. + f = internal['[['+ p +']]'], - var rect = tableElement.getBoundingClientRect(); - mirrorElement.style.width = '' + Math.floor(rect.right - rect.left) + 'px'; + // iii. Let v be the value of tm.[[

]]. + v = tm['[['+ p +']]']; - var height = 0; - for (var i = 0; i < cells.length; i++) { - rect = cells[i].getBoundingClientRect(); - mirrorCells[i].style.width = '' + Math.floor(rect.right - rect.left) + 'px'; - mirrorCells[i].style.height = '' + Math.floor(rect.bottom - rect.top) + 'px'; - height = Math.max(height, Math.floor(rect.bottom - rect.top)); - } - mirrorElement.style.height = '' + height + 'px'; - }, + // iv. If p is "year" and v ≤ 0, then let v be 1 - v. + if (p === 'year' && v <= 0) + v = 1 - v; - getInitialState: function () { - return {selection: this.props.selection}; - }, + // v. If p is "month", then increase v by 1. + else if (p === 'month') + v++; - componentDidMount: function () { - this._markSelection(); - if (this.props.scrollable) { - this._buildMirror(); - this._alignMirror(); - } - if (this.props.onMore) { - this.startListeningForScroll(this.refs.more.getDOMNode(), this.props.onMore); - } - window.addEventListener('resize', this._onResize); - }, + // vi. If p is "hour" and the value of the [[hour12]] internal property of + // dateTimeFormat is true, then + else if (p === 'hour' && internal['[[hour12]]'] === true) { + // 1. Let v be v modulo 12. + v = v % 12; - componentWillReceiveProps: function (newProps) { - if (newProps.hasOwnProperty('selection')) { - this.setState({selection: newProps.selection}); - } - }, + // 2. If v is equal to the value of tm.[[

]], then let pm be false; else + // let pm be true. + pm = v !== tm['[['+ p +']]']; - componentDidUpdate: function (prevProps, prevState) { - if (this.state.selection !== prevState.selection) { - this._markSelection(); - } - if (this.props.scrollable) { - this._alignMirror(); - } - this.stopListeningForScroll(); - if (this.props.onMore) { - this.startListeningForScroll(this.refs.more.getDOMNode(), this.props.onMore); - } - }, + // 3. If v is 0 and the value of the [[hourNo0]] internal property of + // dateTimeFormat is true, then let v be 12. + if (v === 0 && internal['[[hourNo0]]'] === true) + v = 12; + } - componentWillUnmount: function () { - if (this.props.onMore) { - this.stopListeningForScroll(); - } - window.removeEventListener('resize', this._onResize); - }, + // vii. If f is "numeric", then + if (f === 'numeric') + // 1. Let fv be the result of calling the FormatNumber abstract operation + // (defined in 11.3.2) with arguments nf and v. + fv = FormatNumber(nf, v); - render: function () { - var classes = [CLASS_ROOT]; - if (this.props.selectable) { - classes.push(CLASS_ROOT + "--selectable"); - } - if (this.props.scrollable) { - classes.push(CLASS_ROOT + "--scrollable"); - } - if (this.props.className) { - classes.push(this.props.className); - } + // viii. Else if f is "2-digit", then + else if (f === '2-digit') { + // 1. Let fv be the result of calling the FormatNumber abstract operation + // with arguments nf2 and v. + fv = FormatNumber(nf2, v); - var mirror = null; - if (this.props.scrollable) { - mirror = ( - React.createElement("table", {ref: "mirror", className: CLASS_ROOT + "__mirror"}, - React.createElement("thead", null, - React.createElement("tr", null) - ) - ) - ); - } + // 2. If the length of fv is greater than 2, let fv be the substring of fv + // containing the last two characters. + if (fv.length > 2) + fv = fv.slice(-2); + } - var more = null; - if (this.props.onMore) { - more = ( - React.createElement("div", {ref: "more", className: CLASS_ROOT + "__more"}, - React.createElement(SpinningIcon, null) - ) - ); - } + // ix. Else if f is "narrow", "short", or "long", then let fv be a String + // value representing f in the desired form; the String value depends upon + // the implementation and the effective locale and calendar of + // dateTimeFormat. If p is "month", then the String value may also depend + // on whether dateTimeFormat has a [[day]] internal property. If p is + // "timeZoneName", then the String value may also depend on the value of + // the [[inDST]] field of tm. + else if (f in dateWidths) { + switch (p) { + case 'month': + fv = resolveDateString(localeData, ca, 'months', f, tm['[['+ p +']]']); + break; - return ( - React.createElement("div", {ref: "container", className: classes.join(' ')}, - mirror, - React.createElement("table", {ref: "table", className: CLASS_ROOT + "__table", onClick: this._onClick}, - this.props.children - ), - more - ) - ); - } + case 'weekday': + try { + fv = resolveDateString(localeData, ca, 'days', f, tm['[['+ p +']]']); + // fv = resolveDateString(ca.days, f)[tm['[['+ p +']]']]; + } catch (e) { + throw new Error('Could not find weekday data for locale '+locale); + } + break; - }); + case 'timeZoneName': + fv = ''; // TODO + break; - module.exports = Table; + // TODO: Era + default: + fv = tm['[['+ p +']]']; + } + } + // x. Replace the substring of result that consists of "{", p, and "}", with + // fv. + result = result.replace('{'+ p +'}', fv); + } + } + // 8. If dateTimeFormat has an internal property [[hour12]] whose value is true, then + if (internal['[[hour12]]'] === true) { + // a. If pm is true, then let fv be an implementation and locale dependent String + // value representing “post meridiem”; else let fv be an implementation and + // locale dependent String value representing “ante meridiem”. + fv = resolveDateString(localeData, ca, 'dayPeriods', pm ? 'pm' : 'am'); -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { + // b. Replace the substring of result that consists of "{ampm}", with fv. + result = result.replace('{ampm}', fv); + } - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // Restore properties of the RegExp object + regexpState.exp.test(regexpState.input); - var React = __webpack_require__(42); - var SpinningIcon = __webpack_require__(35); - var InfiniteScroll = __webpack_require__(48); + // 9. Return result. + return result; + } - var CLASS_ROOT = "tiles"; + /** + * When the ToLocalTime abstract operation is called with arguments date, calendar, and + * timeZone, the following steps are taken: + */ + function ToLocalTime(date, calendar, timeZone) { + // 1. Apply calendrical calculations on date for the given calendar and time zone to + // produce weekday, era, year, month, day, hour, minute, second, and inDST values. + // The calculations should use best available information about the specified + // calendar and time zone. If the calendar is "gregory", then the calculations must + // match the algorithms specified in ES5, 15.9.1, except that calculations are not + // bound by the restrictions on the use of best available information on time zones + // for local time zone adjustment and daylight saving time adjustment imposed by + // ES5, 15.9.1.7 and 15.9.1.8. + // ###TODO### + var d = new Date(date), + m = 'get' + (timeZone || ''); - var Tiles = React.createClass({displayName: "Tiles", + // 2. Return a Record with fields [[weekday]], [[era]], [[year]], [[month]], [[day]], + // [[hour]], [[minute]], [[second]], and [[inDST]], each with the corresponding + // calculated value. + return new Record({ + '[[weekday]]': d[m + 'Day'](), + '[[era]]' : +(d[m + 'FullYear']() >= 0), + '[[year]]' : d[m + 'FullYear'](), + '[[month]]' : d[m + 'Month'](), + '[[day]]' : d[m + 'Date'](), + '[[hour]]' : d[m + 'Hours'](), + '[[minute]]' : d[m + 'Minutes'](), + '[[second]]' : d[m + 'Seconds'](), + '[[inDST]]' : false // ###TODO### + }); + } - propTypes: { - fill: React.PropTypes.bool, - flush: React.PropTypes.bool, - onMore: React.PropTypes.func, - small: React.PropTypes.bool - }, + /** + * The function returns a new object whose properties and attributes are set as if + * constructed by an object literal assigning to each of the following properties the + * value of the corresponding internal property of this DateTimeFormat object (see 12.4): + * locale, calendar, numberingSystem, timeZone, hour12, weekday, era, year, month, day, + * hour, minute, second, and timeZoneName. Properties whose corresponding internal + * properties are not present are not assigned. + */ + /* 12.3.3 */defineProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions', { + writable: true, + configurable: true, + value: function () { + var prop, + descs = new Record(), + props = [ + 'locale', 'calendar', 'numberingSystem', 'timeZone', 'hour12', 'weekday', + 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName' + ], + internal = this != null && typeof this === 'object' && getInternalProperties(this); - mixins: [InfiniteScroll], + // Satisfy test 12.3_b + if (!internal || !internal['[[initializedDateTimeFormat]]']) + throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.'); - getDefaultProps: function () { - return {flush: true, fill: false, small: false}; - }, + for (var i = 0, max = props.length; i < max; i++) { + if (hop.call(internal, prop = '[[' + props[i] + ']]')) + descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true }; + } - componentDidMount: function () { - if (this.props.onMore) { - this.startListeningForScroll(this.refs.more.getDOMNode(), this.props.onMore); + return objCreate({}, descs); } - }, + }); - componentDidUpdate: function () { - this.stopListeningForScroll(); - if (this.props.onMore) { - this.startListeningForScroll(this.refs.more.getDOMNode(), this.props.onMore); - } - }, + // Sect 13 Locale Sensitive Functions of the ECMAScript Language Specification + // =========================================================================== - componentWillUnmount: function () { - if (this.props.onMore) { - this.stopListeningForScroll(); - } - }, + var ls = Intl.__localeSensitiveProtos = { + Number: {}, + Date: {} + }; - // children should be an array of Tile - render: function () { - var classes = [CLASS_ROOT]; - if (this.props.fill) { - classes.push(CLASS_ROOT + "--fill"); - } - if (this.props.flush) { - classes.push(CLASS_ROOT + "--flush"); - } - if (this.props.small) { - classes.push(CLASS_ROOT + "--small"); - } - if (this.props.className) { - classes.push(this.props.className); - } + /** + * When the toLocaleString method is called with optional arguments locales and options, + * the following steps are taken: + */ + /* 13.2.1 */ls.Number.toLocaleString = function () { + // Satisfy test 13.2.1_1 + if (Object.prototype.toString.call(this) !== '[object Number]') + throw new TypeError('`this` value must be a number for Number.prototype.toLocaleString()'); - var more = null; - if (this.props.onMore) { - classes.push(CLASS_ROOT + "--moreable"); - more = ( - React.createElement("div", {ref: "more", className: CLASS_ROOT + "__more"}, - React.createElement(SpinningIcon, null) - ) - ); - } + // 1. Let x be this Number value (as defined in ES5, 15.7.4). + // 2. If locales is not provided, then let locales be undefined. + // 3. If options is not provided, then let options be undefined. + // 4. Let numberFormat be the result of creating a new object as if by the + // expression new Intl.NumberFormat(locales, options) where + // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. + // 5. Return the result of calling the FormatNumber abstract operation + // (defined in 11.3.2) with arguments numberFormat and x. + return FormatNumber(new NumberFormatConstructor(arguments[0], arguments[1]), this); + }; - return ( - React.createElement("div", {ref: "tiles", className: classes.join(' ')}, - this.props.children, - more - ) - ); - } + /** + * When the toLocaleString method is called with optional arguments locales and options, + * the following steps are taken: + */ + /* 13.3.1 */ls.Date.toLocaleString = function () { + // Satisfy test 13.3.0_1 + if (Object.prototype.toString.call(this) !== '[object Date]') + throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleString()'); - }); - - module.exports = Tiles; + var + // 1. Let x be this time value (as defined in ES5, 15.9.5). + x = +this; + // 2. If x is NaN, then return "Invalid Date". + if (isNaN(x)) + return 'Invalid Date'; -/***/ }, -/* 21 */ -/***/ function(module, exports, __webpack_require__) { + var + // 3. If locales is not provided, then let locales be undefined. + locales = arguments[0], - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 4. If options is not provided, then let options be undefined. + options = arguments[1], - var React = __webpack_require__(42); + // 5. Let options be the result of calling the ToDateTimeOptions abstract + // operation (defined in 12.1.1) with arguments options, "any", and "all". + options = ToDateTimeOptions(options, 'any', 'all'), - var CLASS_ROOT = "tile"; + // 6. Let dateTimeFormat be the result of creating a new object as if by the + // expression new Intl.DateTimeFormat(locales, options) where + // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3. + dateTimeFormat = new DateTimeFormatConstructor(locales, options); - var Tile = React.createClass({displayName: "Tile", + // 7. Return the result of calling the FormatDateTime abstract operation (defined + // in 12.3.2) with arguments dateTimeFormat and x. + return FormatDateTime(dateTimeFormat, x); + }; - propTypes: { - onClick: React.PropTypes.func, - selected: React.PropTypes.bool, - status: React.PropTypes.string, - wide: React.PropTypes.bool - }, + /** + * When the toLocaleDateString method is called with optional arguments locales and + * options, the following steps are taken: + */ + /* 13.3.2 */ls.Date.toLocaleDateString = function () { + // Satisfy test 13.3.0_1 + if (Object.prototype.toString.call(this) !== '[object Date]') + throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleDateString()'); - render: function() { - var classes = [CLASS_ROOT]; - if (this.props.status) { - classes.push(CLASS_ROOT = "--status-" + this.props.status.toLowerCase()); - } - if (this.props.wide) { - classes.push(CLASS_ROOT + "--wide"); - } - if (this.props.onClick) { - classes.push(CLASS_ROOT + "--selectable"); - } - if (this.props.selected) { - classes.push(CLASS_ROOT + "--selected"); - } - if (this.props.className) { - classes.push(this.props.className); - } + var + // 1. Let x be this time value (as defined in ES5, 15.9.5). + x = +this; - return ( - React.createElement("div", {className: classes.join(' '), onClick: this.props.onClick}, - this.props.children - ) - ); - } + // 2. If x is NaN, then return "Invalid Date". + if (isNaN(x)) + return 'Invalid Date'; - }); + var + // 3. If locales is not provided, then let locales be undefined. + locales = arguments[0], - module.exports = Tile; + // 4. If options is not provided, then let options be undefined. + options = arguments[1], + // 5. Let options be the result of calling the ToDateTimeOptions abstract + // operation (defined in 12.1.1) with arguments options, "date", and "date". + options = ToDateTimeOptions(options, 'date', 'date'), -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { + // 6. Let dateTimeFormat be the result of creating a new object as if by the + // expression new Intl.DateTimeFormat(locales, options) where + // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3. + dateTimeFormat = new DateTimeFormatConstructor(locales, options); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // 7. Return the result of calling the FormatDateTime abstract operation (defined + // in 12.3.2) with arguments dateTimeFormat and x. + return FormatDateTime(dateTimeFormat, x); + }; - var React = __webpack_require__(42); + /** + * When the toLocaleTimeString method is called with optional arguments locales and + * options, the following steps are taken: + */ + /* 13.3.3 */ls.Date.toLocaleTimeString = function () { + // Satisfy test 13.3.0_1 + if (Object.prototype.toString.call(this) !== '[object Date]') + throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleTimeString()'); - var Title = React.createClass({displayName: "Title", + var + // 1. Let x be this time value (as defined in ES5, 15.9.5). + x = +this; - propTypes: { - onClick: React.PropTypes.func - }, + // 2. If x is NaN, then return "Invalid Date". + if (isNaN(x)) + return 'Invalid Date'; - render: function() { - var classes = ["title"]; - if (this.props.onClick) { - classes.push("title--interactive"); - } + var + // 3. If locales is not provided, then let locales be undefined. + locales = arguments[0], - return ( - React.createElement("div", {className: classes.join(' '), onClick: this.props.onClick}, - this.props.children - ) - ); - } + // 4. If options is not provided, then let options be undefined. + options = arguments[1], - }); + // 5. Let options be the result of calling the ToDateTimeOptions abstract + // operation (defined in 12.1.1) with arguments options, "time", and "time". + options = ToDateTimeOptions(options, 'time', 'time'), - module.exports = Title; + // 6. Let dateTimeFormat be the result of creating a new object as if by the + // expression new Intl.DateTimeFormat(locales, options) where + // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3. + dateTimeFormat = new DateTimeFormatConstructor(locales, options); + // 7. Return the result of calling the FormatDateTime abstract operation (defined + // in 12.3.2) with arguments dateTimeFormat and x. + return FormatDateTime(dateTimeFormat, x); + }; -/***/ }, -/* 23 */ -/***/ function(module, exports, __webpack_require__) { + defineProperty(Intl, '__applyLocaleSensitivePrototypes', { + writable: true, + configurable: true, + value: function () { + defineProperty(Number.prototype, 'toLocaleString', { writable: true, configurable: true, value: ls.Number.toLocaleString }); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + for (var k in ls.Date) { + if (hop.call(ls.Date, k)) + defineProperty(Date.prototype, k, { writable: true, configurable: true, value: ls.Date[k] }); + } + } + }); - var React = __webpack_require__(42); - var IntlMixin = __webpack_require__(43); + /** + * Can't really ship a single script with data for hundreds of locales, so we provide + * this __addLocaleData method as a means for the developer to add the data on an + * as-needed basis + */ + defineProperty(Intl, '__addLocaleData', { + value: function (data) { + if (!IsStructurallyValidLanguageTag(data.locale)) + throw new Error("Object passed doesn't identify itself with a valid language tag"); - var CLASS_ROOT = "object"; + addLocaleData(data, data.locale); + } + }); - var GrommetObject = React.createClass({displayName: "GrommetObject", + function addLocaleData (data, tag) { + // Both NumberFormat and DateTimeFormat require number data, so throw if it isn't present + if (!data.number) + throw new Error("Object passed doesn't contain locale data for Intl.NumberFormat"); - mixins: [IntlMixin], + var locale, + locales = [ tag ], + parts = tag.split('-'); - propTypes: { - data: React.PropTypes.object - }, + // Create fallbacks for locale data with scripts, e.g. Latn, Hans, Vaii, etc + if (parts.length > 2 && parts[1].length == 4) + arrPush.call(locales, parts[0] + '-' + parts[2]); - _renderArray: function (array) { - return array.map(function (item, index) { - var itemContent = item; - if ('object' === typeof(item)) { - itemContent = this._renderObject(item); - } - return ( - React.createElement("li", {key: 'i_' + index, className: "list-item"}, itemContent) - ); - }, this); - }, + while (locale = arrShift.call(locales)) { + // Add to NumberFormat internal properties as per 11.2.3 + arrPush.call(internals.NumberFormat['[[availableLocales]]'], locale); + internals.NumberFormat['[[localeData]]'][locale] = data.number; - _renderObject: function (obj) { - var attrs = []; - for (var name in obj) { - if (obj.hasOwnProperty(name)) { - var value = obj[name]; - var classes = [CLASS_ROOT + "__attribute"]; - if (null === value) { - value = 'null'; - classes.push(CLASS_ROOT + "__attribute--unset"); - } else if (Array.isArray(value)) { - var items = this._renderArray(value); - value = ( - React.createElement("ol", null, items) - ); - classes.push(CLASS_ROOT + "__attribute--array"); - } else if ('object' === typeof value) { - value = this._renderObject(value); - classes.push(CLASS_ROOT + "__attribute--container"); - } else { - value = value.toString(); + // ...and DateTimeFormat internal properties as per 12.2.3 + if (data.date) { + data.date.nu = data.number.nu; + arrPush.call(internals.DateTimeFormat['[[availableLocales]]'], locale); + internals.DateTimeFormat['[[localeData]]'][locale] = data.date; } - attrs.push( - React.createElement("li", {key: 'n_' + name, className: classes.join(' ')}, - React.createElement("span", {className: CLASS_ROOT + "__attribute-name"}, this.getGrommetIntlMessage(name)), - React.createElement("span", {className: CLASS_ROOT + "__attribute-value"}, this.getGrommetIntlMessage(value)) - ) - ); - } } - return ( - React.createElement("ul", null, attrs) - ); - }, - - render: function() { - return ( - React.createElement("div", {className: CLASS_ROOT}, - React.createElement("div", {className: CLASS_ROOT + "__container"}, - this._renderObject(this.props.data) - ) - ) - ); - } + // If this is the first set of locale data added, make it the default + if (defaultLocale === undefined) + defaultLocale = tag; - }); + // 11.3 (the NumberFormat prototype object is an Intl.NumberFormat instance) + if (!numberFormatProtoInitialised) { + InitializeNumberFormat(Intl.NumberFormat.prototype); + numberFormatProtoInitialised = true; + } - module.exports = GrommetObject; + // 11.3 (the NumberFormat prototype object is an Intl.NumberFormat instance) + if (data.date && !dateTimeFormatProtoInitialised) { + InitializeDateTimeFormat(Intl.DateTimeFormat.prototype); + dateTimeFormatProtoInitialised = true; + } + } + // Helper functions + // ================ -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { + /** + * A function to deal with the inaccuracy of calculating log10 in pre-ES6 + * JavaScript environments. Math.log(num) / Math.LN10 was responsible for + * causing issue #62. + */ + function log10Floor (n) { + // ES6 provides the more accurate Math.log10 + if (typeof Math.log10 === 'function') + return Math.floor(Math.log10(n)); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + var x = Math.round(Math.log(n) * Math.LOG10E); + return x - (Number('1e' + x) > n); + } - var React = __webpack_require__(42); + /** + * A merge of the Intl.{Constructor}.supportedLocalesOf functions + * To make life easier, the function should be bound to the constructor's internal + * properties object. + */ + function supportedLocalesOf(locales) { + /*jshint validthis:true */ - var TBD = React.createClass({displayName: "TBD", + // Bound functions only have the `this` value altered if being used as a constructor, + // this lets us imitate a native function that has no constructor + if (!hop.call(this, '[[availableLocales]]')) + throw new TypeError('supportedLocalesOf() is not a constructor'); - render: function() { - return ( - React.createElement("div", {className: "tbd"}, - 'TBD' - ) - ); - } + var + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(), - }); + // 1. If options is not provided, then let options be undefined. + options = arguments[1], - module.exports = TBD; + // 2. Let availableLocales be the value of the [[availableLocales]] internal + // property of the standard built-in object that is the initial value of + // Intl.NumberFormat. + availableLocales = this['[[availableLocales]]'], -/***/ }, -/* 25 */ -/***/ function(module, exports, __webpack_require__) { + // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList + // abstract operation (defined in 9.2.1) with argument locales. + requestedLocales = CanonicalizeLocaleList(locales); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); - var React = __webpack_require__(42); + // 4. Return the result of calling the SupportedLocales abstract operation + // (defined in 9.2.8) with arguments availableLocales, requestedLocales, + // and options. + return SupportedLocales(availableLocales, requestedLocales, options); + } - var Clear = React.createClass({displayName: "Clear", + /** + * Returns a string for a date component, resolved using multiple inheritance as specified + * as specified in the Unicode Technical Standard 35. + */ + function resolveDateString(data, ca, component, width, key) { + // From http://www.unicode.org/reports/tr35/tr35.html#Multiple_Inheritance: + // 'In clearly specified instances, resources may inherit from within the same locale. + // For example, ... the Buddhist calendar inherits from the Gregorian calendar.' + var obj = data[ca] && data[ca][component] + ? data[ca][component] + : data.gregory[component], - render: function() { - var className = 'control-icon control-icon-clear'; - if (this.props.className) { - className += ' ' + this.props.className; + // "sideways" inheritance resolves strings when a key doesn't exist + alts = { + narrow: ['short', 'long'], + short: ['long', 'narrow'], + long: ['short', 'narrow'] + }, + + // + resolved = hop.call(obj, width) + ? obj[width] + : hop.call(obj, alts[width][0]) + ? obj[alts[width][0]] + : obj[alts[width][1]]; + + // `key` wouldn't be specified for components 'dayPeriods' + return key != null ? resolved[key] : resolved; + } + + /** + * A map that doesn't contain Object in its prototype chain + */ + Record.prototype = objCreate(null); + function Record (obj) { + // Copy only own properties over unless this object is already a Record instance + for (var k in obj) { + if (obj instanceof Record || hop.call(obj, k)) + defineProperty(this, k, { value: obj[k], enumerable: true, writable: true, configurable: true }); } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("line", {strokeWidth: "2", x1: "12", y1: "12", x2: "36", y2: "36"}), - React.createElement("line", {strokeWidth: "2", x1: "12", y1: "36", x2: "36", y2: "12"}) - ) - ) - ); - } + } - }); + /** + * An ordered list + */ + List.prototype = objCreate(null); + function List() { + defineProperty(this, 'length', { writable:true, value: 0 }); - module.exports = Clear; + if (arguments.length) + arrPush.apply(this, arrSlice.call(arguments)); + } + /** + * Constructs a regular expression to restore tainted RegExp properties + */ + function createRegExpRestore () { + var esc = /[.?*+^$[\]\\(){}|-]/g, + lm = RegExp.lastMatch, + ml = RegExp.multiline ? 'm' : '', + ret = { input: RegExp.input }, + reg = new List(), + has = false, + cap = {}; -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { + // Create a snapshot of all the 'captured' properties + for (var i = 1; i <= 9; i++) + has = (cap['$'+i] = RegExp['$'+i]) || has; - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + // Now we've snapshotted some properties, escape the lastMatch string + lm = lm.replace(esc, '\\$&'); - var React = __webpack_require__(42); + // If any of the captured strings were non-empty, iterate over them all + if (has) { + for (var i = 1; i <= 9; i++) { + var m = cap['$'+i]; - var DragHandle = React.createClass({displayName: "DragHandle", + // If it's empty, add an empty capturing group + if (!m) + lm = '()' + lm; - render: function() { - var className = 'control-icon control-icon-drag-handle'; - if (this.props.className) { - className += ' ' + this.props.className; + // Else find the string in lm and escape & wrap it to capture it + else { + m = m.replace(esc, '\\$&'); + lm = lm.replace(m, '(' + m + ')'); + } + + // Push it to the reg and chop lm to make sure further groups come after + arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1)); + lm = lm.slice(lm.indexOf('(') + 1); + } } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {stroke: "none", strokeWidth: "1", fill: "#cccccc", fillRule: "evenodd"}, - React.createElement("rect", {x: "12", y: "12", width: "3", height: "3"}), - React.createElement("rect", {x: "18", y: "12", width: "3", height: "3"}), - React.createElement("rect", {x: "12", y: "18", width: "3", height: "3"}), - React.createElement("rect", {x: "18", y: "18", width: "3", height: "3"}), - React.createElement("rect", {x: "12", y: "24", width: "3", height: "3"}), - React.createElement("rect", {x: "18", y: "24", width: "3", height: "3"}), - React.createElement("rect", {x: "12", y: "30", width: "3", height: "3"}), - React.createElement("rect", {x: "18", y: "30", width: "3", height: "3"}) - ) - ) - ); - } - }); + // Create the regular expression that will reconstruct the RegExp properties + ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml); - module.exports = DragHandle; + return ret; + } + /** + * Convert only a-z to uppercase as per section 6.1 of the spec + */ + function toLatinUpperCase (str) { + var i = str.length; -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { + while (i--) { + var ch = str.charAt(i); - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + if (ch >= "a" && ch <= "z") + str = str.slice(0, i) + ch.toUpperCase() + str.slice(i+1); + } - var React = __webpack_require__(42); + return str; + } - var Edit = React.createClass({displayName: "Edit", + /** + * Mimics ES5's abstract ToObject() function + */ + function toObject (arg) { + if (arg == null) + throw new TypeError('Cannot convert null or undefined to object'); - render: function() { - var className = 'control-icon control-icon-edit'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("circle", {strokeWidth: "2", cx: "24", cy: "24", r: "9"}), - React.createElement("line", {strokeWidth: "2", x1: "24", y1: "11", x2: "24", y2: "15"}), - React.createElement("line", {strokeWidth: "2", x1: "33.2", y1: "14.8", x2: "30.3", y2: "17.6"}), - React.createElement("line", {strokeWidth: "2", x1: "37", y1: "24", x2: "33", y2: "24"}), - React.createElement("line", {strokeWidth: "2", x1: "33.2", y1: "33.2", x2: "30.3", y2: "30.4"}), - React.createElement("line", {strokeWidth: "2", x1: "24", y1: "37", x2: "24", y2: "33"}), - React.createElement("line", {strokeWidth: "2", x1: "14.8", y1: "33.2", x2: "17.7", y2: "30.4"}), - React.createElement("line", {strokeWidth: "2", x1: "11", y1: "24", x2: "15.2", y2: "24"}), - React.createElement("line", {strokeWidth: "2", x1: "14.8", y1: "14.8", x2: "17.7", y2: "17.6"}) - ) - ) - ); - } + return Object(arg); + } - }); + /** + * Returns "internal" properties for an object + */ + function getInternalProperties (obj) { + if (hop.call(obj, '__getInternalProperties')) + return obj.__getInternalProperties(secret); + else + return objCreate(null); + } - module.exports = Edit; + return Intl; + }); + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Filter = React.createClass({displayName: "Filter", - - propTypes: { - notifications: React.PropTypes.number - }, - - render: function() { - var className = 'control-icon control-icon-filter'; - if (this.props.className) { - className += ' ' + this.props.className; - } - - var badge = null; - if (this.props.notifications) { - badge = ( - React.createElement("g", {className: "control-icon__badge"}, - React.createElement("circle", {stroke: "none", cx: "37", cy: "11", r: "10"}), - React.createElement("text", {x: "33.5", y: "16", fontSize: 16}, this.props.notifications) - ) - ); - } - - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("polygon", {strokeWidth: "2", points: "14,15 24,27 34,15 "}), - React.createElement("line", {strokeWidth: "2", x1: "24", y1: "27", x2: "24", y2: "36"}) - ), - badge - ) - ); - } - - }); - - module.exports = Filter; - - -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Help = React.createClass({displayName: "Help", - - render: function() { - var className = 'control-icon control-icon-help'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("path", {strokeWidth: "2", d: "M17,18c0-4,3.4-7,7-7c3.5,0,7,2.7,7,7s-3.6,7-7,7v6"}), - React.createElement("line", {strokeWidth: "2", x1: "24", y1: "37", x2: "24", y2: "35"}) - ) - ) - ); - } - - }); - - module.exports = Help; - - -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Left = React.createClass({displayName: "Left", - - render: function() { - var className = 'control-icon control-icon-left'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("polyline", {strokeWidth: "2", points: "20.9,34 13,24 21,14 "}), - React.createElement("path", {strokeWidth: "2", d: "M13.3,24C36,24,36,24,36,24"}) - ) - ) - ); - } - - }); - - module.exports = Left; - - -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var More = React.createClass({displayName: "More", - - render: function() { - var className = 'control-icon control-icon-more'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("rect", {x: "23", y: "23", strokeWidth: "2", width: "2", height: "2"}), - React.createElement("rect", {x: "15", y: "23", strokeWidth: "2", width: "2", height: "2"}), - React.createElement("rect", {x: "31", y: "23", strokeWidth: "2", width: "2", height: "2"}) - ) - ) - ); - } - - }); - - module.exports = More; - - -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Right = React.createClass({displayName: "Right", - - render: function() { - var className = 'control-icon control-icon-right'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("polyline", {strokeWidth: "2", points: "27.1,14 35,24 27,34"}), - React.createElement("path", {strokeWidth: "2", d: "M34.7,24C12,24,12,24,12,24"}) - ) - ) - ); - } - - }); - - module.exports = Right; - - -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Search = React.createClass({displayName: "Search", - - render: function() { - var className = 'control-icon control-icon-search'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("circle", {strokeWidth: "2", cx: "21.5", cy: "21.5", r: "9"}), - React.createElement("line", {strokeWidth: "2", x1: "35.5", y1: "35.5", x2: "27.8", y2: "27.8"}) - ) - ) - ); - } - - }); - - module.exports = Search; - - -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var SearchPlus = React.createClass({displayName: "SearchPlus", - - render: function() { - var className = 'control-icon control-icon-search-plus'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {strokeWidth: "4", fill: "none", fillRule: "evenodd"}, - React.createElement("circle", {strokeWidth: "4", cx: "21", cy: "21", r: "7"}), - React.createElement("path", {d: "M27.2,27 L34.2,36", strokeWidth: "4", strokeLinecap: "round"}), - React.createElement("path", {d: "M34,13 L34,19", strokeWidth: "2", strokeLinecap: "round"}), - React.createElement("path", {d: "M37,16 L31,16", strokeWidth: "2", strokeLinecap: "round"}) - ) - ) - ); - } - - }); - - module.exports = SearchPlus; - - -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var CLASS_ROOT = "icon-spinning"; - - var Spinning = React.createClass({displayName: "Spinning", - - render: function() { - var classes = [CLASS_ROOT]; - if (this.props.small) { - classes.push(CLASS_ROOT + "--small"); - } - if (this.props.className) { - classes.push(this.props.className); - } - return ( - React.createElement("svg", {className: classes.join(' '), viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("circle", {stroke: "#ddd", strokeWidth: "4", strokeDasharray: "24px 8px", fill: "none", cx: "24", cy: "24", r: "20"}), - React.createElement("circle", {stroke: "#333", strokeWidth: "4", strokeDasharray: "24px 104px", fill: "none", cx: "24", cy: "24", r: "20"}) - ) - ); - } - - }); - - module.exports = Spinning; - - -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - var OK = __webpack_require__(50); - var ErrorStatus = __webpack_require__(51); - var Warning = __webpack_require__(52); - var Disabled = __webpack_require__(53); - var Unknown = __webpack_require__(54); - var Label = __webpack_require__(55); - - var CLASS_ROOT = "status-icon"; - - var Status = React.createClass({displayName: "Status", - - propType: { - large: React.PropTypes.bool, - small: React.PropTypes.bool, - value: React.PropTypes.oneOf(['error', 'warning', 'ok', 'unknown', 'disabled']) - }, - - getDefaultProps: function () { - return {value: 'unknown'}; - }, - - render: function() { - var classes = [CLASS_ROOT]; - if (this.props.className) { - classes.push(this.props.className); - } - if (this.props.small) { - classes.push(CLASS_ROOT + "--small"); - } - if (this.props.large) { - classes.push(CLASS_ROOT + "--large"); - } - var className = classes.join(' '); - var icon = (React.createElement("span", null, '?')); - switch (this.props.value.toLowerCase()) { - case 'ok': - case 'normal': - icon = (React.createElement(OK, {className: className})); - break; - case 'warning': - icon = (React.createElement(Warning, {className: className})); - break; - case 'error': - case 'critical': - icon = (React.createElement(ErrorStatus, {className: className})); - break; - case 'disabled': - icon = (React.createElement(Disabled, {className: className})); - break; - case 'unknown': - icon = (React.createElement(Unknown, {className: className})); - break; - case 'label': - icon = (React.createElement(Label, {className: className})); - break; - } - return icon; - } - - }); - - module.exports = Status; - - -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. - - // Allow callers to use key labels instead of key code numbers. - // This makes their code easier to read. - var KEYS = { - backspace: 8, - tab: 9, - enter: 13, - esc: 27, - escape: 27, - space: 32, - left: 37, - up: 38, - right: 39, - down: 40, - comma: 188 - }; - - // KeyboardAccelerators is a mixin for handling keyboard events. - // Add listeners using startListeningToKeyboard(). - // Remove listeners using stopListeningToKeyboard(). - // When the component that includes this is unmounted, the keyboard event - // listener is removed automatically. - var KeyboardAccelerators = { - - _keyboardAcceleratorHandlers: {}, - _keyboardAcceleratorListening: false, - - _onKeyboardAcceleratorKeyPress: function (e) { - var key = (e.keyCode ? e.keyCode : e.which); - if (this._keyboardAcceleratorHandlers.hasOwnProperty(key)) { - this._keyboardAcceleratorHandlers[key](e); - } - }, - - // Add handlers for specific keys. - // This function can be called multiple times, existing handlers will - // be replaced, new handlers will be added. - startListeningToKeyboard: function (handlers) { - var keys = 0; - for (var key in handlers) { - if (handlers.hasOwnProperty(key)) { - var keyCode = key; - if (KEYS.hasOwnProperty(key)) { - keyCode = KEYS[key]; - } - keys += 1; - this._keyboardAcceleratorHandlers[keyCode] = handlers[key]; - } - } - - if (keys > 0 && ! this._keyboardAcceleratorListening) { - window.addEventListener("keydown", this._onKeyboardAcceleratorKeyPress); - this._keyboardAcceleratorListening = true; - } - }, - - // Remove handlers for all keys or specific keys. - // If no argument is passed in, all handlers are removed. - // This function can be called multiple times, only the handlers - // specified will be removed. - stopListeningToKeyboard: function (handlers) { - if (handlers) { - for (var key in handlers) { - if (handlers.hasOwnProperty(key)) { - var keyCode = key; - if (KEYS.hasOwnProperty(key)) { - keyCode = KEYS[key]; - } - delete this._keyboardAcceleratorHandlers[keyCode]; - } - } - } - - var keyCount = 0; - for (var keyHandler in this._keyboardAcceleratorHandlers) { - if (this._keyboardAcceleratorHandlers.hasOwnProperty(keyHandler)) { - keyCount += 1; - } - } - - if (! handlers || 0 === keyCount) { - window.removeEventListener("keydown", this._onKeyboardAcceleratorKeyPress); - this._keyboardAcceleratorHandlers = {}; - this._keyboardAcceleratorListening = false; - } - }, - - componentWillUnmount: function () { - this.stopListeningToKeyboard(); - } - }; - - module.exports = KeyboardAccelerators; - - -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - // http://jsfiddle.net/LBAr8/ - - var React = __webpack_require__(42); - - var ReactLayeredComponent = { - - componentWillUnmount: function() { - this._unrenderLayer(); - document.body.removeChild(this._target); - }, - componentDidUpdate: function() { - this._renderLayer(); - }, - componentDidMount: function() { - // Appending to the body is easier than managing the z-index of everything on the page. - // It's also better for accessibility and makes stacking a snap (since components will stack - // in mount order). - this._target = document.createElement('div'); - document.body.appendChild(this._target); - this._renderLayer(); - }, - _renderLayer: function() { - // By calling this method in componentDidMount() and componentDidUpdate(), you're effectively - // creating a "wormhole" that funnels React's hierarchical updates through to a DOM node on an - // entirely different part of the page. - React.render(this.renderLayer(), this._target); - }, - _unrenderLayer: function() { - React.unmountComponentAtNode(this._target); - } - }; - - module.exports = ReactLayeredComponent; - - -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var Reflux = __webpack_require__(56); - var Rest = __webpack_require__(41); - - var Actions = Reflux.createActions({ - // Session - 'login': {asyncResult: true}, - 'logout': {} - }); - - Actions.login.listen(function(userName, password) { - if (!userName || !password) { - return this.failed(400, { message: 'loginInvalidPassword'}); - } - - var thisAction = this; - Rest.post('/rest/login-sessions', - {authLoginDomain: 'LOCAL', userName: userName, password: password, loginMsgAck: true}) - .end(function(err, res) { - if (err || !res.ok) { - return thisAction.failed(err, res.body); - } - thisAction.completed(userName, res.body.sessionID); - }); - }); - - module.exports = Actions; - - -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var Reflux = __webpack_require__(56); - var Actions = __webpack_require__(39); - var Cookies = __webpack_require__(49); - - var TOKEN = "token"; - var USER = "user"; - var LOGIN_TIME = "loginTime"; - var EMAIL = "email"; - - var SessionStore = Reflux.createStore({ - - _data: { - id: null, - name: null, - created: null, - email: null, - loginError: null // {message: , resolution: } - }, - - init: function () { - this._data.id = Cookies.get(TOKEN); - this._data.name = Cookies.get(USER); - this._data.created = Cookies.get(LOGIN_TIME); - this._data.email = Cookies.get(EMAIL); - - this.listenTo(Actions.login.completed, this._onLoginCompleted); - this.listenTo(Actions.login.failed, this._onLoginFailed); - this.listenTo(Actions.logout, this._onLogout); - }, - - _onLoginCompleted: function (username, id) { - this._data.id = id; - this._data.name = username; - this._data.created = new Date(); - this._data.loginError = null; - if (username.indexOf('@') !== -1) { - this._data.email = username; - } - Cookies.set(TOKEN, this._data.id); - Cookies.set(USER, this._data.name); - Cookies.set(LOGIN_TIME, this._data.created); - Cookies.set(EMAIL, this._data.email); - this.trigger(this._data); - }, - - _onLoginFailed: function (error, response) { - this._data.loginError = { - message: response.message, - resolution: response.resolution - }; - this.trigger(this._data); - }, - - _onLogout: function () { - this._data.id = null; - this._data.name = null; - this._data.created = null; - this._data.email = null; - Cookies.remove(TOKEN); - Cookies.remove(USER); - Cookies.remove(LOGIN_TIME); - Cookies.remove(EMAIL); - this.trigger(this._data); - }, - - getInitialState: function () { - return this._data; - } - }); - - module.exports = SessionStore; - - -/***/ }, -/* 41 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var request = __webpack_require__(62); - - var _headers = {}; - - var _timeout = 10000; // 10s - - // convert params to string, to deal with array values - function buildQueryParams(params) { - var result = []; - for (var property in params) { - if (params.hasOwnProperty(property)) { - var value = params[property]; - if (null !== value && undefined !== value) { - if (Array.isArray(value)) { - for (var i = 0; i < value.length; i++) { - result.push(property + '=' + value[i]); - } - } else { - result.push(property + '=' + value); - } - } - } - } - return result.join('&'); - } - - var Rest = { - - setTimeout: function (timeout) { - _timeout = timeout; - }, - - setHeaders: function (headers) { - _headers = headers; - }, - - setHeader: function (name, value) { - _headers[name] = value; - }, - - head: function (uri, params) { - var op = request.head(uri).query(buildQueryParams(params)); - op.timeout(_timeout); - op.set(_headers); - return op; - }, - - get: function (uri, params) { - var op = request.get(uri).query(buildQueryParams(params)); - op.timeout(_timeout); - op.set(_headers); - return op; - }, - - patch: function (uri, data) { - var op = request.patch(uri).send(data); - op.timeout(_timeout); - op.set(_headers); - return op; - }, - - post: function (uri, data) { - var op = request.post(uri).send(data); - op.timeout(_timeout); - op.set(_headers); - return op; - }, - - put: function (uri, data) { - var op = request.put(uri).send(data); - op.timeout(_timeout); - op.set(_headers); - return op; - }, - - del: function (uri) { - var op = request.del(uri); - op.timeout(_timeout); - op.set(_headers); - return op; - } - }; - - module.exports = Rest; - - -/***/ }, -/* 42 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = React; - -/***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {// (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var supportedLocales = ['en-US', 'pt-BR']; - - function localesSupported() { - return global.Intl && supportedLocales.every(function (locale) { - return Intl.NumberFormat.supportedLocalesOf(locale)[0] === locale && - Intl.DateTimeFormat.supportedLocalesOf(locale)[0] === locale; - }); - } - - if (! localesSupported()) { - __webpack_require__(63); - IntlPolyfill.__addLocaleData(__webpack_require__(65)); - IntlPolyfill.__addLocaleData(__webpack_require__(66)); - Intl.NumberFormat = IntlPolyfill.NumberFormat; - Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; - } - - var React = __webpack_require__(42); - var ReactIntl = __webpack_require__(60); - var IntlMixin = ReactIntl.IntlMixin; - var FormattedDate = ReactIntl.FormattedDate; - - module.exports = { - mixins: [IntlMixin], - - getChildContext: function () { - if (!this.props.locales && !this.context.locales) { - this.context.locales = 'en-US'; - } - - if (!this.props.messages && !this.context.messages) { - try { - this.context.messages = __webpack_require__(57)("./" + (this.props.locales || this.context.locales || 'en-US')); - } catch (e) { - this.context.messages = __webpack_require__(58); - } - } - }, - - getGrommetFormattedDate: function (date) { - return ( - React.createElement(FormattedDate, { - value: new Date(date), - day: "numeric", - month: "numeric", - year: "numeric", - hour: "numeric", - minute: "numeric", - second: "numeric"}) - ); - }, - - getGrommetIntlMessage: function(messageKey) { - var message = messageKey; - if (messageKey) { - try { - message = this.getIntlMessage(messageKey); - } catch (e) { - message = messageKey; - } - } - return message; - } - }; - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - var IntlMixin = __webpack_require__(43); - - var CLASS_ROOT = "legend"; - - var Legend = React.createClass({displayName: "Legend", - - mixins: [IntlMixin], - - propTypes: { - activeIndex: React.PropTypes.number, - onActive: React.PropTypes.func, - series: React.PropTypes.arrayOf(React.PropTypes.shape({ - label: React.PropTypes.string, - value: React.PropTypes.number, - units: React.PropTypes.string, - colorIndex: React.PropTypes.oneOfType([ - React.PropTypes.number, // 1-6 - React.PropTypes.string // status - ]), - onClick: React.PropTypes.func - })).isRequired, - total: React.PropTypes.bool, - units: React.PropTypes.string, - value: React.PropTypes.number - }, - - _onActive: function (index) { - this.setState({activeIndex: index}); - if (this.props.onActive) { - this.props.onActive(index); - } - }, - - getInitialState: function () { - return {activeIndex: this.props.activeIndex}; - }, - - componentWillReceiveProps: function (newProps) { - this.setState({activeIndex: newProps.activeIndex}); - }, - - _itemColorIndex: function (item, index) { - return item.colorIndex || ('graph-' + (index + 1)); - }, - - render: function () { - var classes = [CLASS_ROOT]; - if (this.props.series.length === 1) { - classes.push(CLASS_ROOT + "--single"); - } - if (this.props.className) { - classes.push(this.props.className); - } - - var totalValue = 0; - var items = this.props.series.map(function (item, index) { - var legendClasses = [CLASS_ROOT + "__item"]; - if (index === this.state.activeIndex) { - legendClasses.push(CLASS_ROOT + "__item--active"); - } - var colorIndex = this._itemColorIndex(item, index); - totalValue += item.value; - - var valueClasses = [CLASS_ROOT + "__item-value"]; - if (1 === this.props.series.length) { - valueClasses.push("large-number-font"); - } - - return ( - React.createElement("li", {key: item.label, className: legendClasses.join(' '), - onClick: item.onClick, - onMouseOver: this._onActive.bind(this, index), - onMouseOut: this._onActive.bind(this, this.props.activeIndex)}, - React.createElement("svg", {className: CLASS_ROOT + "__item-swatch color-index-" + colorIndex, - viewBox: "0 0 12 12"}, - React.createElement("path", {className: item.className, d: "M 5 0 l 0 12"}) - ), - React.createElement("span", {className: CLASS_ROOT + "__item-label"}, item.label), - React.createElement("span", {className: valueClasses.join(' ')}, - item.value, - React.createElement("span", {className: CLASS_ROOT + "__item-units"}, this.props.units) - ) - ) - ); - }, this); - - var total = null; - if (this.props.total) { - total = ( - React.createElement("li", {className: CLASS_ROOT + "__total"}, - React.createElement("span", {className: CLASS_ROOT + "__total-label"}, - this.getGrommetIntlMessage('Total') - ), - React.createElement("span", {className: CLASS_ROOT + "__total-value"}, - totalValue, - React.createElement("span", {className: CLASS_ROOT + "__total-units"}, this.props.units) - ) - ) - ); - } - - return ( - React.createElement("ol", {className: classes.join(' ')}, - items.reverse(), - total - ) - ); - } - - }); - - module.exports = Legend; - - -/***/ }, -/* 45 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Top = React.createClass({displayName: "Top", - - render: function() { - var className = 'control-icon control-icon-top'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {fill: "none"}, - React.createElement("polyline", {strokeWidth: "2", points: "14,20.9 24,13 34,21 "}), - React.createElement("path", {strokeWidth: "2", d: "M24,13.3C24,36,24,36,24,36"}), - React.createElement("line", {strokeWidth: "2", x1: "13", y1: "11", x2: "35", y2: "11"}) - ) - ) - ); - } - - }); - - module.exports = Top; - - -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. - - var DOM = __webpack_require__(59); - - // Overlay is a mixin for ensuring components layerd on top align with their initiating controls underneath. - var Overlay = { - - _overlay: { - controlElement: null, - layerElement: null, - align: null, - scrollParents: [] - }, - - startOverlay: function (controlElement, layerElement, align) { - this._overlay.controlElement = controlElement; - this._overlay.layerElement = layerElement; - this._overlay.align = align; - this._overlay.scrollParents = DOM.findScrollParents(this._overlay.controlElement); - this._overlay.scrollParents.forEach(function (parent) { - parent.addEventListener('scroll', this.positionOverlay); - }, this); - window.addEventListener('resize', this.positionOverlay); - - this.positionOverlay(); - }, - - stopOverlay: function () { - if (this._overlay.controlElement) { - this._overlay.scrollParents.forEach(function (parent) { - parent.removeEventListener('scroll', this.positionOverlay); - }, this); - window.removeEventListener('resize', this.positionOverlay); - this._overlay.controlElement = null; - this._overlay.layerElement = null; - this._overlay.align = null; - this._overlay.scrollParents = []; - } - }, - - positionOverlay: function () { - var controlElement = this._overlay.controlElement; - var layerElement = this._overlay.layerElement; - - var controlRect = controlElement.getBoundingClientRect(); - var windowWidth = window.innerWidth; - - // clear prior styling - layerElement.style.left = ''; - layerElement.style.width = ''; - layerElement.style.top = ''; - - var width = Math.min( - Math.max(controlRect.width, layerElement.offsetWidth), - windowWidth); - // align right edge and make at least as wide as the control - var left = (controlRect.left + layerElement.offsetWidth) - width; - if ('right' === this._overlay.align) { - // align right edge - left = (controlRect.left + controlRect.width) - - layerElement.offsetWidth; - } else { - // align left edge - left = controlRect.left; - } - if ((left + width) > windowWidth) { - left -= ((left + width) - windowWidth); - } else if (left < 0) { - left = 0; - } - - var top = controlRect.top; - if ('up' === this.props.direction) { - // align bottom edge - top = (controlRect.top + controlRect.height) - - layerElement.offsetHeight; - } else if ('below' === this._overlay.align) { - // align top of layer to bottom of control - top = (controlRect.top + controlRect.height); - } - - // ensure height is within viewport - var maxHeight = window.innerHeight - top; - - layerElement.style.left = '' + left + 'px'; - layerElement.style.width = '' + width + 'px'; - layerElement.style.top = '' + top + 'px'; - layerElement.style.maxHeight = '' + maxHeight + 'px'; - }, - - componentWillUnmount: function () { - this.stopOverlay(); - } - }; - - module.exports = Overlay; - - -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var DropCaret = React.createClass({displayName: "DropCaret", - - render: function() { - var className = 'control-icon control-icon-drop-caret'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, - React.createElement("g", {stroke: "none"}, - React.createElement("polygon", {points: "33.4,19.7 24.1,30.3 14.8,19.7"}) - ) - ) - ); - } - - }); - - module.exports = DropCaret; - - -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. - - var DOM = __webpack_require__(59); - - var SCROLL_MORE_DELAY = 2000; // when the user scrolls - var SCROLL_MORE_INITIAL_DELAY = 200; // when we start out at the bottom already - - var InfiniteScroll = { - - _infiniteScroll: { - indicatorElement: null, - scrollParent: null, - onEnd: null - }, - - _onScroll: function () { - // delay a bit to ride out quick users - clearTimeout(this._infiniteScroll.scrollTimer); - this._infiniteScroll.scrollTimer = setTimeout(function () { - // are we at the bottom? - var parentRect = this._infiniteScroll.scrollParent.getBoundingClientRect(); - var indicatorRect = this._infiniteScroll.indicatorElement.getBoundingClientRect(); - if (indicatorRect.bottom <= parentRect.bottom) { - this._infiniteScroll.onEnd(); - } - }.bind(this), SCROLL_MORE_DELAY); - }, - - startListeningForScroll: function (indicatorElement, onEnd) { - this._infiniteScroll.onEnd = onEnd; - this._infiniteScroll.indicatorElement = indicatorElement; - this._infiniteScroll.scrollParent = DOM.findScrollParents(indicatorElement)[0]; - this._infiniteScroll.scrollParent.addEventListener("scroll", this._onScroll); - // check in case we're already at the bottom - if (this._infiniteScroll.scrollParent === document) { - this._infiniteScroll.scrollTimer = setTimeout(onEnd, SCROLL_MORE_INITIAL_DELAY); - } - }, - - stopListeningForScroll: function () { - if (this._infiniteScroll.scrollParent) { - clearTimeout(this._infiniteScroll.scrollTimer); - this._infiniteScroll.scrollParent.removeEventListener("scroll", this._onScroll); - this._infiniteScroll.scrollParent = null; - } - }, - - componentWillUnmount: function () { - this.stopListeningForScroll(); - } - }; - - module.exports = InfiniteScroll; - - -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2015 Hewlett-Packard Development Company, L.P. - - // Slightly modified version of the Mozilla Developer Network version. - // renamed the module and the functions. - - /*\ - |*| - |*| :: cookies.js :: - |*| - |*| A complete cookies reader/writer framework with full unicode support. - |*| - |*| Revision #1 - September 4, 2014 - |*| - |*| https://developer.mozilla.org/en-US/docs/Web/API/document.cookie - |*| https://developer.mozilla.org/User:fusionchess - |*| - |*| This framework is released under the GNU Public License, version 3 or later. - |*| http://www.gnu.org/licenses/gpl-3.0-standalone.html - |*| - |*| Syntaxes: - |*| - |*| * Cookies.set(name, value[, end[, path[, domain[, secure]]]]) - |*| * Cookies.get(name) - |*| * Cookies.remove(name[, path[, domain]]) - |*| * Cookies.has(name) - |*| * Cookies.keys() - |*| - \*/ - - var Cookies = { - get: function (sKey) { - if (!sKey) { return null; } - return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; - }, - set: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) { - if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; } - var sExpires = ""; - if (vEnd) { - switch (vEnd.constructor) { - case Number: - sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd; - break; - case String: - sExpires = "; expires=" + vEnd; - break; - case Date: - sExpires = "; expires=" + vEnd.toUTCString(); - break; - } - } - document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : ""); - return true; - }, - remove: function (sKey, sPath, sDomain) { - if (!this.has(sKey)) { return false; } - document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : ""); - return true; - }, - has: function (sKey) { - if (!sKey) { return false; } - return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); - }, - keys: function () { - var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/); - for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) { aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]); } - return aKeys; - } - }; - - module.exports = Cookies; - - -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var OK = React.createClass({displayName: "OK", - - render: function() { - var className = 'status-icon status-icon-ok'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, - React.createElement("g", {className: "status-icon__base", fill: "#43A547"}, - React.createElement("path", {d: "M0,4.4058651 L0,19.657478 C0,21.7548387 2.41428571,23.9929619 4.68571429,23.9929619 L19.4571429,23.9929619 C21.7285714,23.9929619 24,21.8956012 24,19.657478 L24,4.4058651 C24,2.3085044 21.7285714,0.0703812317 19.4571429,0.0703812317 L4.68571429,0.0703812317 C2.27142857,0.0703812317 0,2.16774194 0,4.4058651 L0,4.4058651 Z"}) - ), - React.createElement("g", {className: "status-icon__detail", fill: "#FFFFFF", transform: "translate(4.214286, 3.519062)"}, - React.createElement("path", {d: "M0.0428571429,6.76363636 L0.0428571429,10.5431085 L6.86428571,15.4416422 L15.6642857,4.80703812 L15.6642857,0.0492668622 L6.15,11.2469208 L0.0428571429,6.76363636 Z"}) - ) - ) - ); - } - - }); - - module.exports = OK; - - -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var ErrorStatus = React.createClass({displayName: "ErrorStatus", - - render: function() { - var className = 'status-icon status-icon-error'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, - React.createElement("g", {className: "status-icon__base", fill: "#DC462F"}, - React.createElement("circle", {cx: "12", cy: "12", r: "12"}) - ), - React.createElement("g", {className: "status-icon__detail", fill: "#FFFFFF"}, - React.createElement("rect", {x: "4", y: "10", width: "16", height: "4"}) - ) - ) - ); - } - - }); - - module.exports = ErrorStatus; - - -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Warning = React.createClass({displayName: "Warning", - - render: function() { - var className = 'status-icon status-icon-warning'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 27 24", version: "1.1"}, - React.createElement("g", {className: "status-icon__base", fill: "#F3B51D"}, - React.createElement("path", {d: "M26.758209,22.8752239 L14.1062687,0.494328358 C13.8268657,-0.071641791 13.2608955,-0.071641791 12.838209,0.494328358 L0.179104478,22.8752239 C-0.100298507,23.441194 0.179104478,24 0.745074627,24 L26.0561194,24 C26.758209,24 27.0376119,23.5773134 26.758209,22.8752239 L26.758209,22.8752239 Z"}) - ), - React.createElement("g", {className: "status-icon__detail", fill: "#FFFFFF", transform: "translate(12.250746, 7.307463)"}, - React.createElement("path", {d: "M2.69373134,9.01970149 L0.0214925373,9.01970149 L0.0214925373,0.0143283582 L2.69373134,0.0143283582 L2.69373134,9.01970149 L2.69373134,9.01970149 Z M2.69373134,10.9898507 L0.0214925373,10.9898507 L0.0214925373,13.6620896 L2.69373134,13.6620896 L2.69373134,10.9898507 L2.69373134,10.9898507 Z"}) - ) - ) - ); - } - - }); - - module.exports = Warning; - - -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Disabled = React.createClass({displayName: "Disabled", - - render: function() { - var className = 'status-icon status-icon-disabled'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, - React.createElement("g", {className: "status-icon__base", fill: "#848484"}, - React.createElement("path", {d: "M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"}) - ), - React.createElement("g", {className: "status-icon__detail", fill: "#FFFFFF"}, - React.createElement("circle", {cx: "12", cy: "12", r: "5.5"}) - ) - ) - ); - } - - }); - - module.exports = Disabled; - - -/***/ }, -/* 54 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Unknown = React.createClass({displayName: "Unknown", - - render: function() { - var className = 'status-icon status-icon-unknown'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, - React.createElement("g", {className: "status-icon__base", fill: "#848484"}, - React.createElement("path", {d: "M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"}) - ), - React.createElement("g", {className: "status-icon__detail", fill: "#FFFFFF", transform: "translate(7.524324, 4.994595)"}, - React.createElement("path", {d: "M8.89945946,3.97621622 C8.89945946,4.48216216 8.64648649,4.98810811 8.39351351,5.49405405 C8.0172973,5.87027027 7.51135135,6.62918919 6.49945946,7.38810811 C5.99351351,7.76432432 5.74054054,8.14702703 5.6172973,8.4 L5.6172973,8.77621622 C5.49405405,9.02918919 5.49405405,9.53513514 5.49405405,10.1643243 L3.47027027,10.1643243 L3.47027027,9.53513514 C3.47027027,8.90594595 3.59351351,8.0172973 3.84648649,7.51135135 C3.96972973,7.13513514 4.47567568,6.62918919 5.23459459,5.99351351 C5.99351351,5.36432432 6.36972973,4.98162162 6.49945946,4.85837838 C6.75243243,4.60540541 6.87567568,4.35243243 6.87567568,3.97621622 C6.87567568,3.6 6.6227027,3.2172973 6.24648649,2.84108108 C5.87027027,2.46486486 5.23459459,2.33513514 4.60540541,2.33513514 C3.97621622,2.33513514 3.47027027,2.45837838 2.96432432,2.71135135 C2.58810811,2.96432432 2.20540541,3.34054054 2.08216216,3.84648649 L0.0583783784,3.84648649 C0.0583783784,2.83459459 0.564324324,1.95243243 1.32324324,1.19351351 C2.20540541,0.434594595 3.2172973,0.0583783784 4.48216216,0.0583783784 C5.87027027,0.0583783784 7.00540541,0.434594595 7.76432432,1.19351351 C8.51675676,1.95891892 8.89945946,2.96432432 8.89945946,3.97621622 L8.89945946,3.97621622 Z M4.47567568,10.9232432 C3.71675676,10.9232432 2.95783784,11.6821622 2.95783784,12.4410811 C2.95783784,13.2 3.71675676,13.9589189 4.47567568,13.9589189 C5.23459459,13.9589189 5.99351351,13.2 5.99351351,12.4410811 C5.99351351,11.6821622 5.23459459,10.9232432 4.47567568,10.9232432 L4.47567568,10.9232432 Z"}) - ) - ) - ); - } - - }); - - module.exports = Unknown; - - -/***/ }, -/* 55 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - var React = __webpack_require__(42); - - var Label = React.createClass({displayName: "Label", - - render: function() { - var className = 'status-icon status-icon-label'; - if (this.props.className) { - className += ' ' + this.props.className; - } - return ( - React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, - React.createElement("g", {className: "status-icon__base", fill: "#CCCCCC"}, - React.createElement("circle", {cx: "12", cy: "12", r: "12"}) - ) - ) - ); - } - - }); - - module.exports = Label; - - -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(64); - - -/***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { - - var map = { - "./en-US": 58, - "./en-US.js": 58, - "./pt-BR": 61, - "./pt-BR.js": 61 - }; - function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); - }; - function webpackContextResolve(req) { - return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); - }; - webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); - }; - webpackContext.resolve = webpackContextResolve; - module.exports = webpackContext; - webpackContext.id = 57; - - -/***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - module.exports = { - IndexFilters: { - filters: '{quantity, plural,\n =0 {Filters}\n =1 {one filter}\n other {# filters}\n}' - }, - Active: 'Active', - Alerts: 'Alerts', - All: 'All', - Category: 'Category', - Cleared: 'Cleared', - Completed: 'Completed', - created: 'Created', - Critical: 'Critical', - Disabled: 'Disabled', - Error: 'Error', - loginInvalidPassword: 'Please provide Username and Password.', - 'Log In': 'Log In', - Logout: 'Logout', - model: 'Model', - modified: 'Modified', - Name: 'Name', - OK: 'OK', - Password: 'Password', - 'Remember me': 'Remember me', - Resource: 'Resource', - Running: 'Running', - Search: 'Search', - State: 'State', - Status: 'Status', - Tasks: 'Tasks', - Time: 'Time', - Total: 'Total', - Unknown: 'Unknown', - Username: 'Username', - uri: 'URI', - Warning: 'Warning' - }; - - -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - module.exports = { - findScrollParents: function (element) { - var result = []; - var parent = element.parentNode; - while (parent) { - // account for border the lazy way for now - if (parent.scrollHeight > (parent.offsetHeight + 10)) { - result.push(parent); - } - parent = parent.parentNode; - } - if (result.length === 0) { - result.push(document); - } - return result; - } - }; - - -/***/ }, -/* 60 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {/* jshint node:true */ - 'use strict'; - - // Expose `React` as a global, because the ReactIntlMixin assumes it's global. - var oldReact = global.React; - global.React = __webpack_require__(42); - - // Require the lib and add all locale data to `ReactIntl`. This module will be - // ignored when bundling for the browser with Browserify/Webpack. - var ReactIntl = __webpack_require__(68); - __webpack_require__(67); - - // Export the Mixin as the default export for back-compat with v1.0.0. This will - // be changed to simply re-exporting `ReactIntl` as the default export in v2.0. - exports = module.exports = ReactIntl.IntlMixin; - - // Define non-enumerable expandos for each named export on the default export -- - // which is the Mixin for back-compat with v1.0.0. - Object.keys(ReactIntl).forEach(function (namedExport) { - Object.defineProperty(exports, namedExport, { - enumerable: true, - value : ReactIntl[namedExport] - }); - }); - - // Put back `global.React` to how it was. - if (oldReact) { - global.React = oldReact; - } else { - // IE < 9 will throw when trying to delete something off the global object, - // `window`, so this does the next best thing as sets it to `undefined`. - try { - delete global.React; - } catch (e) { - global.React = undefined; - } - } - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 61 */ -/***/ function(module, exports, __webpack_require__) { - - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - - module.exports = { - IndexFilters: { - filters: '{quantity, plural,\n =0 {Filtros}\n =1 {um filtro}\n other {# filtros}\n}' - }, - Active: 'Ativos', - Alerts: 'Alertas', - All: 'Todos', - Category: 'Categoria', - Cleared: 'Livre', - Completed: 'Completado', - created: 'Criado', - Critical: 'Crítico', - Disabled: 'Desabilitado', - Error: 'Erro', - loginInvalidPassword: 'Por favor, informe Usuário e Senha.', - 'Log In': 'Logar', - Logout: 'Deslogar', - model: 'Modelo', - modified: 'Modificado', - Name: 'Nome', - OK: 'OK', - Password: 'Senha', - 'Remember me': 'Lembrar Usuário', - Resource: 'Recurso', - Running: 'Executando', - Search: 'Buscar', - State: 'Estado', - Status: 'Situaçāo', - Tasks: 'Tarefas', - Time: 'Data', - Total: 'Total', - Unknown: 'Desconhecido', - Username: 'Usuário', - uri: 'URI', - Warning: 'Alerta' - }; - - -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Module dependencies. - */ - - var Emitter = __webpack_require__(83); - var reduce = __webpack_require__(84); - - /** - * Root reference for iframes. - */ - - var root = 'undefined' == typeof window - ? (this || self) - : window; - - /** - * Noop. - */ - - function noop(){}; - - /** - * Check if `obj` is a host object, - * we don't want to serialize these :) - * - * TODO: future proof, move to compoent land - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ - - function isHost(obj) { - var str = {}.toString.call(obj); - - switch (str) { - case '[object File]': - case '[object Blob]': - case '[object FormData]': - return true; - default: - return false; - } - } - - /** - * Determine XHR. - */ - - request.getXHR = function () { - if (root.XMLHttpRequest - && (!root.location || 'file:' != root.location.protocol - || !root.ActiveXObject)) { - return new XMLHttpRequest; - } else { - try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} - try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {} - try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {} - try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} - } - return false; - }; - - /** - * Removes leading and trailing whitespace, added to support IE. - * - * @param {String} s - * @return {String} - * @api private - */ - - var trim = ''.trim - ? function(s) { return s.trim(); } - : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); }; - - /** - * Check if `obj` is an object. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ - - function isObject(obj) { - return obj === Object(obj); - } - - /** - * Serialize the given `obj`. - * - * @param {Object} obj - * @return {String} - * @api private - */ - - function serialize(obj) { - if (!isObject(obj)) return obj; - var pairs = []; - for (var key in obj) { - if (null != obj[key]) { - pairs.push(encodeURIComponent(key) - + '=' + encodeURIComponent(obj[key])); - } - } - return pairs.join('&'); - } - - /** - * Expose serialization method. - */ - - request.serializeObject = serialize; - - /** - * Parse the given x-www-form-urlencoded `str`. - * - * @param {String} str - * @return {Object} - * @api private - */ - - function parseString(str) { - var obj = {}; - var pairs = str.split('&'); - var parts; - var pair; - - for (var i = 0, len = pairs.length; i < len; ++i) { - pair = pairs[i]; - parts = pair.split('='); - obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); - } - - return obj; - } - - /** - * Expose parser. - */ - - request.parseString = parseString; - - /** - * Default MIME type map. - * - * superagent.types.xml = 'application/xml'; - * - */ - - request.types = { - html: 'text/html', - json: 'application/json', - xml: 'application/xml', - urlencoded: 'application/x-www-form-urlencoded', - 'form': 'application/x-www-form-urlencoded', - 'form-data': 'application/x-www-form-urlencoded' - }; - - /** - * Default serialization map. - * - * superagent.serialize['application/xml'] = function(obj){ - * return 'generated xml here'; - * }; - * - */ - - request.serialize = { - 'application/x-www-form-urlencoded': serialize, - 'application/json': JSON.stringify - }; - - /** - * Default parsers. - * - * superagent.parse['application/xml'] = function(str){ - * return { object parsed from str }; - * }; - * - */ - - request.parse = { - 'application/x-www-form-urlencoded': parseString, - 'application/json': JSON.parse - }; - - /** - * Parse the given header `str` into - * an object containing the mapped fields. - * - * @param {String} str - * @return {Object} - * @api private - */ - - function parseHeader(str) { - var lines = str.split(/\r?\n/); - var fields = {}; - var index; - var line; - var field; - var val; - - lines.pop(); // trailing CRLF - - for (var i = 0, len = lines.length; i < len; ++i) { - line = lines[i]; - index = line.indexOf(':'); - field = line.slice(0, index).toLowerCase(); - val = trim(line.slice(index + 1)); - fields[field] = val; - } - - return fields; - } - - /** - * Return the mime type for the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - - function type(str){ - return str.split(/ *; */).shift(); - }; - - /** - * Return header field parameters. - * - * @param {String} str - * @return {Object} - * @api private - */ - - function params(str){ - return reduce(str.split(/ *; */), function(obj, str){ - var parts = str.split(/ *= */) - , key = parts.shift() - , val = parts.shift(); - - if (key && val) obj[key] = val; - return obj; - }, {}); - }; - - /** - * Initialize a new `Response` with the given `xhr`. - * - * - set flags (.ok, .error, etc) - * - parse header - * - * Examples: - * - * Aliasing `superagent` as `request` is nice: - * - * request = superagent; - * - * We can use the promise-like API, or pass callbacks: - * - * request.get('/').end(function(res){}); - * request.get('/', function(res){}); - * - * Sending data can be chained: - * - * request - * .post('/user') - * .send({ name: 'tj' }) - * .end(function(res){}); - * - * Or passed to `.send()`: - * - * request - * .post('/user') - * .send({ name: 'tj' }, function(res){}); - * - * Or passed to `.post()`: - * - * request - * .post('/user', { name: 'tj' }) - * .end(function(res){}); - * - * Or further reduced to a single call for simple cases: - * - * request - * .post('/user', { name: 'tj' }, function(res){}); - * - * @param {XMLHTTPRequest} xhr - * @param {Object} options - * @api private - */ - - function Response(req, options) { - options = options || {}; - this.req = req; - this.xhr = this.req.xhr; - // responseText is accessible only if responseType is '' or 'text' and on older browsers - this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined') - ? this.xhr.responseText - : null; - this.statusText = this.req.xhr.statusText; - this.setStatusProperties(this.xhr.status); - this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders()); - // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but - // getResponseHeader still works. so we get content-type even if getting - // other headers fails. - this.header['content-type'] = this.xhr.getResponseHeader('content-type'); - this.setHeaderProperties(this.header); - this.body = this.req.method != 'HEAD' - ? this.parseBody(this.text ? this.text : this.xhr.response) - : null; - } - - /** - * Get case-insensitive `field` value. - * - * @param {String} field - * @return {String} - * @api public - */ - - Response.prototype.get = function(field){ - return this.header[field.toLowerCase()]; - }; - - /** - * Set header related properties: - * - * - `.type` the content type without params - * - * A response of "Content-Type: text/plain; charset=utf-8" - * will provide you with a `.type` of "text/plain". - * - * @param {Object} header - * @api private - */ - - Response.prototype.setHeaderProperties = function(header){ - // content-type - var ct = this.header['content-type'] || ''; - this.type = type(ct); - - // params - var obj = params(ct); - for (var key in obj) this[key] = obj[key]; - }; - - /** - * Parse the given body `str`. - * - * Used for auto-parsing of bodies. Parsers - * are defined on the `superagent.parse` object. - * - * @param {String} str - * @return {Mixed} - * @api private - */ - - Response.prototype.parseBody = function(str){ - var parse = request.parse[this.type]; - return parse && str && (str.length || str instanceof Object) - ? parse(str) - : null; - }; - - /** - * Set flags such as `.ok` based on `status`. - * - * For example a 2xx response will give you a `.ok` of __true__ - * whereas 5xx will be __false__ and `.error` will be __true__. The - * `.clientError` and `.serverError` are also available to be more - * specific, and `.statusType` is the class of error ranging from 1..5 - * sometimes useful for mapping respond colors etc. - * - * "sugar" properties are also defined for common cases. Currently providing: - * - * - .noContent - * - .badRequest - * - .unauthorized - * - .notAcceptable - * - .notFound - * - * @param {Number} status - * @api private - */ - - Response.prototype.setStatusProperties = function(status){ - // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request - if (status === 1223) { - status = 204; - } - - var type = status / 100 | 0; - - // status / class - this.status = status; - this.statusType = type; - - // basics - this.info = 1 == type; - this.ok = 2 == type; - this.clientError = 4 == type; - this.serverError = 5 == type; - this.error = (4 == type || 5 == type) - ? this.toError() - : false; - - // sugar - this.accepted = 202 == status; - this.noContent = 204 == status; - this.badRequest = 400 == status; - this.unauthorized = 401 == status; - this.notAcceptable = 406 == status; - this.notFound = 404 == status; - this.forbidden = 403 == status; - }; - - /** - * Return an `Error` representative of this response. - * - * @return {Error} - * @api public - */ - - Response.prototype.toError = function(){ - var req = this.req; - var method = req.method; - var url = req.url; - - var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')'; - var err = new Error(msg); - err.status = this.status; - err.method = method; - err.url = url; - - return err; - }; - - /** - * Expose `Response`. - */ - - request.Response = Response; - - /** - * Initialize a new `Request` with the given `method` and `url`. - * - * @param {String} method - * @param {String} url - * @api public - */ - - function Request(method, url) { - var self = this; - Emitter.call(this); - this._query = this._query || []; - this.method = method; - this.url = url; - this.header = {}; - this._header = {}; - this.on('end', function(){ - var err = null; - var res = null; - - try { - res = new Response(self); - } catch(e) { - err = new Error('Parser is unable to parse the response'); - err.parse = true; - err.original = e; - return self.callback(err); - } - - self.emit('response', res); - - if (err) { - return self.callback(err, res); - } - - if (res.status >= 200 && res.status < 300) { - return self.callback(err, res); - } - - var new_err = new Error(res.statusText || 'Unsuccessful HTTP response'); - new_err.original = err; - new_err.response = res; - new_err.status = res.status; - - self.callback(err || new_err, res); - }); - } - - /** - * Mixin `Emitter`. - */ - - Emitter(Request.prototype); - - /** - * Allow for extension - */ - - Request.prototype.use = function(fn) { - fn(this); - return this; - } - - /** - * Set timeout to `ms`. - * - * @param {Number} ms - * @return {Request} for chaining - * @api public - */ - - Request.prototype.timeout = function(ms){ - this._timeout = ms; - return this; - }; - - /** - * Clear previous timeout. - * - * @return {Request} for chaining - * @api public - */ - - Request.prototype.clearTimeout = function(){ - this._timeout = 0; - clearTimeout(this._timer); - return this; - }; - - /** - * Abort the request, and clear potential timeout. - * - * @return {Request} - * @api public - */ - - Request.prototype.abort = function(){ - if (this.aborted) return; - this.aborted = true; - this.xhr.abort(); - this.clearTimeout(); - this.emit('abort'); - return this; - }; - - /** - * Set header `field` to `val`, or multiple fields with one object. - * - * Examples: - * - * req.get('/') - * .set('Accept', 'application/json') - * .set('X-API-Key', 'foobar') - * .end(callback); - * - * req.get('/') - * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) - * .end(callback); - * - * @param {String|Object} field - * @param {String} val - * @return {Request} for chaining - * @api public - */ - - Request.prototype.set = function(field, val){ - if (isObject(field)) { - for (var key in field) { - this.set(key, field[key]); - } - return this; - } - this._header[field.toLowerCase()] = val; - this.header[field] = val; - return this; - }; - - /** - * Remove header `field`. - * - * Example: - * - * req.get('/') - * .unset('User-Agent') - * .end(callback); - * - * @param {String} field - * @return {Request} for chaining - * @api public - */ - - Request.prototype.unset = function(field){ - delete this._header[field.toLowerCase()]; - delete this.header[field]; - return this; - }; - - /** - * Get case-insensitive header `field` value. - * - * @param {String} field - * @return {String} - * @api private - */ - - Request.prototype.getHeader = function(field){ - return this._header[field.toLowerCase()]; - }; - - /** - * Set Content-Type to `type`, mapping values from `request.types`. - * - * Examples: - * - * superagent.types.xml = 'application/xml'; - * - * request.post('/') - * .type('xml') - * .send(xmlstring) - * .end(callback); - * - * request.post('/') - * .type('application/xml') - * .send(xmlstring) - * .end(callback); - * - * @param {String} type - * @return {Request} for chaining - * @api public - */ - - Request.prototype.type = function(type){ - this.set('Content-Type', request.types[type] || type); - return this; - }; - - /** - * Set Accept to `type`, mapping values from `request.types`. - * - * Examples: - * - * superagent.types.json = 'application/json'; - * - * request.get('/agent') - * .accept('json') - * .end(callback); - * - * request.get('/agent') - * .accept('application/json') - * .end(callback); - * - * @param {String} accept - * @return {Request} for chaining - * @api public - */ - - Request.prototype.accept = function(type){ - this.set('Accept', request.types[type] || type); - return this; - }; - - /** - * Set Authorization field value with `user` and `pass`. - * - * @param {String} user - * @param {String} pass - * @return {Request} for chaining - * @api public - */ - - Request.prototype.auth = function(user, pass){ - var str = btoa(user + ':' + pass); - this.set('Authorization', 'Basic ' + str); - return this; - }; - - /** - * Add query-string `val`. - * - * Examples: - * - * request.get('/shoes') - * .query('size=10') - * .query({ color: 'blue' }) - * - * @param {Object|String} val - * @return {Request} for chaining - * @api public - */ - - Request.prototype.query = function(val){ - if ('string' != typeof val) val = serialize(val); - if (val) this._query.push(val); - return this; - }; - - /** - * Write the field `name` and `val` for "multipart/form-data" - * request bodies. - * - * ``` js - * request.post('/upload') - * .field('foo', 'bar') - * .end(callback); - * ``` - * - * @param {String} name - * @param {String|Blob|File} val - * @return {Request} for chaining - * @api public - */ - - Request.prototype.field = function(name, val){ - if (!this._formData) this._formData = new root.FormData(); - this._formData.append(name, val); - return this; - }; - - /** - * Queue the given `file` as an attachment to the specified `field`, - * with optional `filename`. - * - * ``` js - * request.post('/upload') - * .attach(new Blob(['hey!'], { type: "text/html"})) - * .end(callback); - * ``` - * - * @param {String} field - * @param {Blob|File} file - * @param {String} filename - * @return {Request} for chaining - * @api public - */ - - Request.prototype.attach = function(field, file, filename){ - if (!this._formData) this._formData = new root.FormData(); - this._formData.append(field, file, filename); - return this; - }; - - /** - * Send `data`, defaulting the `.type()` to "json" when - * an object is given. - * - * Examples: - * - * // querystring - * request.get('/search') - * .end(callback) - * - * // multiple data "writes" - * request.get('/search') - * .send({ search: 'query' }) - * .send({ range: '1..5' }) - * .send({ order: 'desc' }) - * .end(callback) - * - * // manual json - * request.post('/user') - * .type('json') - * .send('{"name":"tj"}) - * .end(callback) - * - * // auto json - * request.post('/user') - * .send({ name: 'tj' }) - * .end(callback) - * - * // manual x-www-form-urlencoded - * request.post('/user') - * .type('form') - * .send('name=tj') - * .end(callback) - * - * // auto x-www-form-urlencoded - * request.post('/user') - * .type('form') - * .send({ name: 'tj' }) - * .end(callback) - * - * // defaults to x-www-form-urlencoded - * request.post('/user') - * .send('name=tobi') - * .send('species=ferret') - * .end(callback) - * - * @param {String|Object} data - * @return {Request} for chaining - * @api public - */ - - Request.prototype.send = function(data){ - var obj = isObject(data); - var type = this.getHeader('Content-Type'); - - // merge - if (obj && isObject(this._data)) { - for (var key in data) { - this._data[key] = data[key]; - } - } else if ('string' == typeof data) { - if (!type) this.type('form'); - type = this.getHeader('Content-Type'); - if ('application/x-www-form-urlencoded' == type) { - this._data = this._data - ? this._data + '&' + data - : data; - } else { - this._data = (this._data || '') + data; - } - } else { - this._data = data; - } - - if (!obj || isHost(data)) return this; - if (!type) this.type('json'); - return this; - }; - - /** - * Invoke the callback with `err` and `res` - * and handle arity check. - * - * @param {Error} err - * @param {Response} res - * @api private - */ - - Request.prototype.callback = function(err, res){ - var fn = this._callback; - this.clearTimeout(); - fn(err, res); - }; - - /** - * Invoke callback with x-domain error. - * - * @api private - */ - - Request.prototype.crossDomainError = function(){ - var err = new Error('Origin is not allowed by Access-Control-Allow-Origin'); - err.crossDomain = true; - this.callback(err); - }; - - /** - * Invoke callback with timeout error. - * - * @api private - */ - - Request.prototype.timeoutError = function(){ - var timeout = this._timeout; - var err = new Error('timeout of ' + timeout + 'ms exceeded'); - err.timeout = timeout; - this.callback(err); - }; - - /** - * Enable transmission of cookies with x-domain requests. - * - * Note that for this to work the origin must not be - * using "Access-Control-Allow-Origin" with a wildcard, - * and also must set "Access-Control-Allow-Credentials" - * to "true". - * - * @api public - */ - - Request.prototype.withCredentials = function(){ - this._withCredentials = true; - return this; - }; - - /** - * Initiate request, invoking callback `fn(res)` - * with an instanceof `Response`. - * - * @param {Function} fn - * @return {Request} for chaining - * @api public - */ - - Request.prototype.end = function(fn){ - var self = this; - var xhr = this.xhr = request.getXHR(); - var query = this._query.join('&'); - var timeout = this._timeout; - var data = this._formData || this._data; - - // store callback - this._callback = fn || noop; - - // state change - xhr.onreadystatechange = function(){ - if (4 != xhr.readyState) return; - - // In IE9, reads to any property (e.g. status) off of an aborted XHR will - // result in the error "Could not complete the operation due to error c00c023f" - var status; - try { status = xhr.status } catch(e) { status = 0; } - - if (0 == status) { - if (self.timedout) return self.timeoutError(); - if (self.aborted) return; - return self.crossDomainError(); - } - self.emit('end'); - }; - - // progress - var handleProgress = function(e){ - if (e.total > 0) { - e.percent = e.loaded / e.total * 100; - } - self.emit('progress', e); - }; - if (this.hasListeners('progress')) { - xhr.onprogress = handleProgress; - } - try { - if (xhr.upload && this.hasListeners('progress')) { - xhr.upload.onprogress = handleProgress; - } - } catch(e) { - // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. - // Reported here: - // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context - } - - // timeout - if (timeout && !this._timer) { - this._timer = setTimeout(function(){ - self.timedout = true; - self.abort(); - }, timeout); - } - - // querystring - if (query) { - query = request.serializeObject(query); - this.url += ~this.url.indexOf('?') - ? '&' + query - : '?' + query; - } - - // initiate request - xhr.open(this.method, this.url, true); - - // CORS - if (this._withCredentials) xhr.withCredentials = true; - - // body - if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) { - // serialize stuff - var serialize = request.serialize[this.getHeader('Content-Type')]; - if (serialize) data = serialize(data); - } - - // set header fields - for (var field in this.header) { - if (null == this.header[field]) continue; - xhr.setRequestHeader(field, this.header[field]); - } - - // send stuff - this.emit('request', this); - xhr.send(data); - return this; - }; - - /** - * Expose `Request`. - */ - - request.Request = Request; - - /** - * Issue a request: - * - * Examples: - * - * request('GET', '/users').end(callback) - * request('/users').end(callback) - * request('/users', callback) - * - * @param {String} method - * @param {String|Function} url or callback - * @return {Request} - * @api public - */ - - function request(method, url) { - // callback - if ('function' == typeof url) { - return new Request('GET', method).end(url); - } - - // url first - if (1 == arguments.length) { - return new Request('GET', method); - } - - return new Request(method, url); - } - - /** - * GET `url` with optional callback `fn(res)`. - * - * @param {String} url - * @param {Mixed|Function} data or fn - * @param {Function} fn - * @return {Request} - * @api public - */ - - request.get = function(url, data, fn){ - var req = request('GET', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.query(data); - if (fn) req.end(fn); - return req; - }; - - /** - * HEAD `url` with optional callback `fn(res)`. - * - * @param {String} url - * @param {Mixed|Function} data or fn - * @param {Function} fn - * @return {Request} - * @api public - */ - - request.head = function(url, data, fn){ - var req = request('HEAD', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; - }; - - /** - * DELETE `url` with optional callback `fn(res)`. - * - * @param {String} url - * @param {Function} fn - * @return {Request} - * @api public - */ - - request.del = function(url, fn){ - var req = request('DELETE', url); - if (fn) req.end(fn); - return req; - }; - - /** - * PATCH `url` with optional `data` and callback `fn(res)`. - * - * @param {String} url - * @param {Mixed} data - * @param {Function} fn - * @return {Request} - * @api public - */ - - request.patch = function(url, data, fn){ - var req = request('PATCH', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; - }; - - /** - * POST `url` with optional `data` and callback `fn(res)`. - * - * @param {String} url - * @param {Mixed} data - * @param {Function} fn - * @return {Request} - * @api public - */ - - request.post = function(url, data, fn){ - var req = request('POST', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; - }; - - /** - * PUT `url` with optional `data` and callback `fn(res)`. - * - * @param {String} url - * @param {Mixed|Function} data or fn - * @param {Function} fn - * @return {Request} - * @api public - */ - - request.put = function(url, data, fn){ - var req = request('PUT', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; - }; - - /** - * Expose `request`. - */ - - module.exports = request; - - -/***/ }, -/* 63 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {/** - * @license Copyright 2013 Andy Earnshaw, MIT License - * - * Implements the ECMAScript Internationalization API in ES5-compatible environments, - * following the ECMA-402 specification as closely as possible - * - * ECMA-402: http://ecma-international.org/ecma-402/1.0/ - * - * CLDR format locale data should be provided using IntlPolyfill.__addLocaleData(). - */ - /*jshint proto:true, eqnull:true, boss:true, laxbreak:true, newcap:false, shadow:true, funcscope:true */ - /*globals global, define, exports, module, window*/ - - (function (global, factory) { - var IntlPolyfill = factory(); - - // register in -all- the module systems (at once) - if (true) - !(__WEBPACK_AMD_DEFINE_FACTORY__ = (IntlPolyfill), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - if (true) - module.exports = IntlPolyfill; - - if (!global.Intl) { - global.Intl = IntlPolyfill; - IntlPolyfill.__applyLocaleSensitivePrototypes(); - } - - global.IntlPolyfill = IntlPolyfill; - - })(typeof global !== 'undefined' ? global : this, function() { - "use strict"; - var - Intl = {}, - - realDefineProp = (function () { - try { return !!Object.defineProperty({}, 'a', {}); } - catch (e) { return false; } - })(), - - // Need a workaround for getters in ES3 - es3 = !realDefineProp && !Object.prototype.__defineGetter__, - - // We use this a lot (and need it for proto-less objects) - hop = Object.prototype.hasOwnProperty, - - // Naive defineProperty for compatibility - defineProperty = realDefineProp ? Object.defineProperty : function (obj, name, desc) { - if ('get' in desc && obj.__defineGetter__) - obj.__defineGetter__(name, desc.get); - - else if (!hop.call(obj, name) || 'value' in desc) - obj[name] = desc.value; - }, - - // Array.prototype.indexOf, as good as we need it to be - arrIndexOf = Array.prototype.indexOf || function (search) { - /*jshint validthis:true */ - var t = this; - if (!t.length) - return -1; - - for (var i = arguments[1] || 0, max = t.length; i < max; i++) { - if (t[i] === search) - return i; - } - - return -1; - }, - - // Create an object with the specified prototype (2nd arg required for Record) - objCreate = Object.create || function (proto, props) { - var obj; - - function F() {} - F.prototype = proto; - obj = new F(); - - for (var k in props) { - if (hop.call(props, k)) - defineProperty(obj, k, props[k]); - } - - return obj; - }, - - // Snapshot some (hopefully still) native built-ins - arrSlice = Array.prototype.slice, - arrConcat = Array.prototype.concat, - arrPush = Array.prototype.push, - arrJoin = Array.prototype.join, - arrShift = Array.prototype.shift, - arrUnshift= Array.prototype.unshift, - - // Naive Function.prototype.bind for compatibility - fnBind = Function.prototype.bind || function (thisObj) { - var fn = this, - args = arrSlice.call(arguments, 1); - - // All our (presently) bound functions have either 1 or 0 arguments. By returning - // different function signatures, we can pass some tests in ES3 environments - if (fn.length === 1) { - return function (a) { - return fn.apply(thisObj, arrConcat.call(args, arrSlice.call(arguments))); - }; - } - else { - return function () { - return fn.apply(thisObj, arrConcat.call(args, arrSlice.call(arguments))); - }; - } - }, - - // Default locale is the first-added locale data for us - defaultLocale, - - // Object housing internal properties for constructors - internals = objCreate(null), - - // Keep internal properties internal - secret = Math.random(), - - // An object map of date component keys, saves using a regex later - dateWidths = objCreate(null, { narrow:{}, short:{}, long:{} }), - - // Each constructor prototype should be an instance of the constructor itself, but we - // can't initialise them as such until some locale data has been added, so this is how - // we keep track - numberFormatProtoInitialised = false, - dateTimeFormatProtoInitialised = false, - - // Some regular expressions we're using - expCurrencyCode = /^[A-Z]{3}$/, - expUnicodeExSeq = /-u(?:-[0-9a-z]{2,8})+/gi, // See `extension` below - - expBCP47Syntax, - expExtSequences, - expVariantDupes, - expSingletonDupes, - - // IANA Subtag Registry redundant tag and subtag maps - redundantTags = { - tags: { - "art-lojban": "jbo", "i-ami": "ami", "i-bnn": "bnn", "i-hak": "hak", - "i-klingon": "tlh", "i-lux": "lb", "i-navajo": "nv", "i-pwn": "pwn", - "i-tao": "tao", "i-tay": "tay", "i-tsu": "tsu", "no-bok": "nb", - "no-nyn": "nn", "sgn-BE-FR": "sfb", "sgn-BE-NL": "vgt", "sgn-CH-DE": "sgg", - "zh-guoyu": "cmn", "zh-hakka": "hak", "zh-min-nan": "nan", "zh-xiang": "hsn", - "sgn-BR": "bzs", "sgn-CO": "csn", "sgn-DE": "gsg", "sgn-DK": "dsl", - "sgn-ES": "ssp", "sgn-FR": "fsl", "sgn-GB": "bfi", "sgn-GR": "gss", - "sgn-IE": "isg", "sgn-IT": "ise", "sgn-JP": "jsl", "sgn-MX": "mfs", - "sgn-NI": "ncs", "sgn-NL": "dse", "sgn-NO": "nsl", "sgn-PT": "psr", - "sgn-SE": "swl", "sgn-US": "ase", "sgn-ZA": "sfs", "zh-cmn": "cmn", - "zh-cmn-Hans": "cmn-Hans", "zh-cmn-Hant": "cmn-Hant", "zh-gan": "gan", "zh-wuu": "wuu", - "zh-yue": "yue" - }, - subtags: { - BU: "MM", DD: "DE", FX: "FR", TP: "TL", YD: "YE", ZR: "CD", heploc: "alalc97", - 'in': "id", iw: "he", ji: "yi", jw: "jv", mo: "ro", ayx: "nun", bjd: "drl", - ccq: "rki", cjr: "mom", cka: "cmr", cmk: "xch", drh: "khk", drw: "prs", gav: "dev", - hrr: "jal", ibi: "opa", kgh: "kml", lcq: "ppr", mst: "mry", myt: "mry", sca: "hle", - tie: "ras", tkk: "twm", tlw: "weo", tnf: "prs", ybd: "rki", yma: "lrr" - }, - extLang: { - aao: [ "aao", "ar" ], abh: [ "abh", "ar" ], abv: [ "abv", "ar" ], acm: [ "acm", "ar" ], - acq: [ "acq", "ar" ], acw: [ "acw", "ar" ], acx: [ "acx", "ar" ], acy: [ "acy", "ar" ], - adf: [ "adf", "ar" ], ads: [ "ads", "sgn" ], aeb: [ "aeb", "ar" ], aec: [ "aec", "ar" ], - aed: [ "aed", "sgn" ], aen: [ "aen", "sgn" ], afb: [ "afb", "ar" ], afg: [ "afg", "sgn" ], - ajp: [ "ajp", "ar" ], apc: [ "apc", "ar" ], apd: [ "apd", "ar" ], arb: [ "arb", "ar" ], - arq: [ "arq", "ar" ], ars: [ "ars", "ar" ], ary: [ "ary", "ar" ], arz: [ "arz", "ar" ], - ase: [ "ase", "sgn" ], asf: [ "asf", "sgn" ], asp: [ "asp", "sgn" ], asq: [ "asq", "sgn" ], - asw: [ "asw", "sgn" ], auz: [ "auz", "ar" ], avl: [ "avl", "ar" ], ayh: [ "ayh", "ar" ], - ayl: [ "ayl", "ar" ], ayn: [ "ayn", "ar" ], ayp: [ "ayp", "ar" ], bbz: [ "bbz", "ar" ], - bfi: [ "bfi", "sgn" ], bfk: [ "bfk", "sgn" ], bjn: [ "bjn", "ms" ], bog: [ "bog", "sgn" ], - bqn: [ "bqn", "sgn" ], bqy: [ "bqy", "sgn" ], btj: [ "btj", "ms" ], bve: [ "bve", "ms" ], - bvl: [ "bvl", "sgn" ], bvu: [ "bvu", "ms" ], bzs: [ "bzs", "sgn" ], cdo: [ "cdo", "zh" ], - cds: [ "cds", "sgn" ], cjy: [ "cjy", "zh" ], cmn: [ "cmn", "zh" ], coa: [ "coa", "ms" ], - cpx: [ "cpx", "zh" ], csc: [ "csc", "sgn" ], csd: [ "csd", "sgn" ], cse: [ "cse", "sgn" ], - csf: [ "csf", "sgn" ], csg: [ "csg", "sgn" ], csl: [ "csl", "sgn" ], csn: [ "csn", "sgn" ], - csq: [ "csq", "sgn" ], csr: [ "csr", "sgn" ], czh: [ "czh", "zh" ], czo: [ "czo", "zh" ], - doq: [ "doq", "sgn" ], dse: [ "dse", "sgn" ], dsl: [ "dsl", "sgn" ], dup: [ "dup", "ms" ], - ecs: [ "ecs", "sgn" ], esl: [ "esl", "sgn" ], esn: [ "esn", "sgn" ], eso: [ "eso", "sgn" ], - eth: [ "eth", "sgn" ], fcs: [ "fcs", "sgn" ], fse: [ "fse", "sgn" ], fsl: [ "fsl", "sgn" ], - fss: [ "fss", "sgn" ], gan: [ "gan", "zh" ], gds: [ "gds", "sgn" ], gom: [ "gom", "kok" ], - gse: [ "gse", "sgn" ], gsg: [ "gsg", "sgn" ], gsm: [ "gsm", "sgn" ], gss: [ "gss", "sgn" ], - gus: [ "gus", "sgn" ], hab: [ "hab", "sgn" ], haf: [ "haf", "sgn" ], hak: [ "hak", "zh" ], - hds: [ "hds", "sgn" ], hji: [ "hji", "ms" ], hks: [ "hks", "sgn" ], hos: [ "hos", "sgn" ], - hps: [ "hps", "sgn" ], hsh: [ "hsh", "sgn" ], hsl: [ "hsl", "sgn" ], hsn: [ "hsn", "zh" ], - icl: [ "icl", "sgn" ], ils: [ "ils", "sgn" ], inl: [ "inl", "sgn" ], ins: [ "ins", "sgn" ], - ise: [ "ise", "sgn" ], isg: [ "isg", "sgn" ], isr: [ "isr", "sgn" ], jak: [ "jak", "ms" ], - jax: [ "jax", "ms" ], jcs: [ "jcs", "sgn" ], jhs: [ "jhs", "sgn" ], jls: [ "jls", "sgn" ], - jos: [ "jos", "sgn" ], jsl: [ "jsl", "sgn" ], jus: [ "jus", "sgn" ], kgi: [ "kgi", "sgn" ], - knn: [ "knn", "kok" ], kvb: [ "kvb", "ms" ], kvk: [ "kvk", "sgn" ], kvr: [ "kvr", "ms" ], - kxd: [ "kxd", "ms" ], lbs: [ "lbs", "sgn" ], lce: [ "lce", "ms" ], lcf: [ "lcf", "ms" ], - liw: [ "liw", "ms" ], lls: [ "lls", "sgn" ], lsg: [ "lsg", "sgn" ], lsl: [ "lsl", "sgn" ], - lso: [ "lso", "sgn" ], lsp: [ "lsp", "sgn" ], lst: [ "lst", "sgn" ], lsy: [ "lsy", "sgn" ], - ltg: [ "ltg", "lv" ], lvs: [ "lvs", "lv" ], lzh: [ "lzh", "zh" ], max: [ "max", "ms" ], - mdl: [ "mdl", "sgn" ], meo: [ "meo", "ms" ], mfa: [ "mfa", "ms" ], mfb: [ "mfb", "ms" ], - mfs: [ "mfs", "sgn" ], min: [ "min", "ms" ], mnp: [ "mnp", "zh" ], mqg: [ "mqg", "ms" ], - mre: [ "mre", "sgn" ], msd: [ "msd", "sgn" ], msi: [ "msi", "ms" ], msr: [ "msr", "sgn" ], - mui: [ "mui", "ms" ], mzc: [ "mzc", "sgn" ], mzg: [ "mzg", "sgn" ], mzy: [ "mzy", "sgn" ], - nan: [ "nan", "zh" ], nbs: [ "nbs", "sgn" ], ncs: [ "ncs", "sgn" ], nsi: [ "nsi", "sgn" ], - nsl: [ "nsl", "sgn" ], nsp: [ "nsp", "sgn" ], nsr: [ "nsr", "sgn" ], nzs: [ "nzs", "sgn" ], - okl: [ "okl", "sgn" ], orn: [ "orn", "ms" ], ors: [ "ors", "ms" ], pel: [ "pel", "ms" ], - pga: [ "pga", "ar" ], pks: [ "pks", "sgn" ], prl: [ "prl", "sgn" ], prz: [ "prz", "sgn" ], - psc: [ "psc", "sgn" ], psd: [ "psd", "sgn" ], pse: [ "pse", "ms" ], psg: [ "psg", "sgn" ], - psl: [ "psl", "sgn" ], pso: [ "pso", "sgn" ], psp: [ "psp", "sgn" ], psr: [ "psr", "sgn" ], - pys: [ "pys", "sgn" ], rms: [ "rms", "sgn" ], rsi: [ "rsi", "sgn" ], rsl: [ "rsl", "sgn" ], - sdl: [ "sdl", "sgn" ], sfb: [ "sfb", "sgn" ], sfs: [ "sfs", "sgn" ], sgg: [ "sgg", "sgn" ], - sgx: [ "sgx", "sgn" ], shu: [ "shu", "ar" ], slf: [ "slf", "sgn" ], sls: [ "sls", "sgn" ], - sqk: [ "sqk", "sgn" ], sqs: [ "sqs", "sgn" ], ssh: [ "ssh", "ar" ], ssp: [ "ssp", "sgn" ], - ssr: [ "ssr", "sgn" ], svk: [ "svk", "sgn" ], swc: [ "swc", "sw" ], swh: [ "swh", "sw" ], - swl: [ "swl", "sgn" ], syy: [ "syy", "sgn" ], tmw: [ "tmw", "ms" ], tse: [ "tse", "sgn" ], - tsm: [ "tsm", "sgn" ], tsq: [ "tsq", "sgn" ], tss: [ "tss", "sgn" ], tsy: [ "tsy", "sgn" ], - tza: [ "tza", "sgn" ], ugn: [ "ugn", "sgn" ], ugy: [ "ugy", "sgn" ], ukl: [ "ukl", "sgn" ], - uks: [ "uks", "sgn" ], urk: [ "urk", "ms" ], uzn: [ "uzn", "uz" ], uzs: [ "uzs", "uz" ], - vgt: [ "vgt", "sgn" ], vkk: [ "vkk", "ms" ], vkt: [ "vkt", "ms" ], vsi: [ "vsi", "sgn" ], - vsl: [ "vsl", "sgn" ], vsv: [ "vsv", "sgn" ], wuu: [ "wuu", "zh" ], xki: [ "xki", "sgn" ], - xml: [ "xml", "sgn" ], xmm: [ "xmm", "ms" ], xms: [ "xms", "sgn" ], yds: [ "yds", "sgn" ], - ysl: [ "ysl", "sgn" ], yue: [ "yue", "zh" ], zib: [ "zib", "sgn" ], zlm: [ "zlm", "ms" ], - zmi: [ "zmi", "ms" ], zsl: [ "zsl", "sgn" ], zsm: [ "zsm", "ms" ] - } - }, - - // Currency minor units output from tools/getISO4217data.js, formatted - currencyMinorUnits = { - BHD: 3, BYR: 0, XOF: 0, BIF: 0, XAF: 0, CLF: 0, CLP: 0, KMF: 0, DJF: 0, - XPF: 0, GNF: 0, ISK: 0, IQD: 3, JPY: 0, JOD: 3, KRW: 0, KWD: 3, LYD: 3, - OMR: 3, PYG: 0, RWF: 0, TND: 3, UGX: 0, UYI: 0, VUV: 0, VND: 0 - }; - - /** - * Defines regular expressions for various operations related to the BCP 47 syntax, - * as defined at http://tools.ietf.org/html/bcp47#section-2.1 - */ - (function () { - var - // extlang = 3ALPHA ; selected ISO 639 codes - // *2("-" 3ALPHA) ; permanently reserved - extlang = '[a-z]{3}(?:-[a-z]{3}){0,2}', - - // language = 2*3ALPHA ; shortest ISO 639 code - // ["-" extlang] ; sometimes followed by - // ; extended language subtags - // / 4ALPHA ; or reserved for future use - // / 5*8ALPHA ; or registered language subtag - language = '(?:[a-z]{2,3}(?:-' + extlang + ')?|[a-z]{4}|[a-z]{5,8})', - - // script = 4ALPHA ; ISO 15924 code - script = '[a-z]{4}', - - // region = 2ALPHA ; ISO 3166-1 code - // / 3DIGIT ; UN M.49 code - region = '(?:[a-z]{2}|\\d{3})', - - // variant = 5*8alphanum ; registered variants - // / (DIGIT 3alphanum) - variant = '(?:[a-z0-9]{5,8}|\\d[a-z0-9]{3})', - - // ; Single alphanumerics - // ; "x" reserved for private use - // singleton = DIGIT ; 0 - 9 - // / %x41-57 ; A - W - // / %x59-5A ; Y - Z - // / %x61-77 ; a - w - // / %x79-7A ; y - z - singleton = '[0-9a-wy-z]', - - // extension = singleton 1*("-" (2*8alphanum)) - extension = singleton + '(?:-[a-z0-9]{2,8})+', - - // privateuse = "x" 1*("-" (1*8alphanum)) - privateuse = 'x(?:-[a-z0-9]{1,8})+', - - // irregular = "en-GB-oed" ; irregular tags do not match - // / "i-ami" ; the 'langtag' production and - // / "i-bnn" ; would not otherwise be - // / "i-default" ; considered 'well-formed' - // / "i-enochian" ; These tags are all valid, - // / "i-hak" ; but most are deprecated - // / "i-klingon" ; in favor of more modern - // / "i-lux" ; subtags or subtag - // / "i-mingo" ; combination - // / "i-navajo" - // / "i-pwn" - // / "i-tao" - // / "i-tay" - // / "i-tsu" - // / "sgn-BE-FR" - // / "sgn-BE-NL" - // / "sgn-CH-DE" - irregular = '(?:en-GB-oed' - + '|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)' - + '|sgn-(?:BE-FR|BE-NL|CH-DE))', - - // regular = "art-lojban" ; these tags match the 'langtag' - // / "cel-gaulish" ; production, but their subtags - // / "no-bok" ; are not extended language - // / "no-nyn" ; or variant subtags: their meaning - // / "zh-guoyu" ; is defined by their registration - // / "zh-hakka" ; and all of these are deprecated - // / "zh-min" ; in favor of a more modern - // / "zh-min-nan" ; subtag or sequence of subtags - // / "zh-xiang" - regular = '(?:art-lojban|cel-gaulish|no-bok|no-nyn' - + '|zh-(?:guoyu|hakka|min|min-nan|xiang))', - - // grandfathered = irregular ; non-redundant tags registered - // / regular ; during the RFC 3066 era - grandfathered = '(?:' + irregular + '|' + regular + ')', - - // langtag = language - // ["-" script] - // ["-" region] - // *("-" variant) - // *("-" extension) - // ["-" privateuse] - langtag = language + '(?:-' + script + ')?(?:-' + region + ')?(?:-' - + variant + ')*(?:-' + extension + ')*(?:-' + privateuse + ')?'; - - // Language-Tag = langtag ; normal language tags - // / privateuse ; private use tag - // / grandfathered ; grandfathered tags - expBCP47Syntax = RegExp('^(?:'+langtag+'|'+privateuse+'|'+grandfathered+')$', 'i'); - - // Match duplicate variants in a language tag - expVariantDupes = RegExp('^(?!x).*?-('+variant+')-(?:\\w{4,8}-(?!x-))*\\1\\b', 'i'); - - // Match duplicate singletons in a language tag (except in private use) - expSingletonDupes = RegExp('^(?!x).*?-('+singleton+')-(?:\\w+-(?!x-))*\\1\\b', 'i'); - - // Match all extension sequences - expExtSequences = RegExp('-'+extension, 'ig'); - })(); - - // Sect 6.2 Language Tags - // ====================== - - /** - * The IsStructurallyValidLanguageTag abstract operation verifies that the locale - * argument (which must be a String value) - * - * - represents a well-formed BCP 47 language tag as specified in RFC 5646 section - * 2.1, or successor, - * - does not include duplicate variant subtags, and - * - does not include duplicate singleton subtags. - * - * The abstract operation returns true if locale can be generated from the ABNF - * grammar in section 2.1 of the RFC, starting with Language-Tag, and does not - * contain duplicate variant or singleton subtags (other than as a private use - * subtag). It returns false otherwise. Terminal value characters in the grammar are - * interpreted as the Unicode equivalents of the ASCII octet values given. - */ - function /* 6.2.2 */IsStructurallyValidLanguageTag(locale) { - // represents a well-formed BCP 47 language tag as specified in RFC 5646 - if (!expBCP47Syntax.test(locale)) - return false; - - // does not include duplicate variant subtags, and - if (expVariantDupes.test(locale)) - return false; - - // does not include duplicate singleton subtags. - if (expSingletonDupes.test(locale)) - return false; - - return true; - } - - /** - * The CanonicalizeLanguageTag abstract operation returns the canonical and case- - * regularized form of the locale argument (which must be a String value that is - * a structurally valid BCP 47 language tag as verified by the - * IsStructurallyValidLanguageTag abstract operation). It takes the steps - * specified in RFC 5646 section 4.5, or successor, to bring the language tag - * into canonical form, and to regularize the case of the subtags, but does not - * take the steps to bring a language tag into “extlang form” and to reorder - * variant subtags. - - * The specifications for extensions to BCP 47 language tags, such as RFC 6067, - * may include canonicalization rules for the extension subtag sequences they - * define that go beyond the canonicalization rules of RFC 5646 section 4.5. - * Implementations are allowed, but not required, to apply these additional rules. - */ - function /* 6.2.3 */CanonicalizeLanguageTag (locale) { - var match, parts; - - // A language tag is in 'canonical form' when the tag is well-formed - // according to the rules in Sections 2.1 and 2.2 - - // Section 2.1 says all subtags use lowercase... - locale = locale.toLowerCase(); - - // ...with 2 exceptions: 'two-letter and four-letter subtags that neither - // appear at the start of the tag nor occur after singletons. Such two-letter - // subtags are all uppercase (as in the tags "en-CA-x-ca" or "sgn-BE-FR") and - // four-letter subtags are titlecase (as in the tag "az-Latn-x-latn"). - parts = locale.split('-'); - for (var i = 1, max = parts.length; i < max; i++) { - // Two-letter subtags are all uppercase - if (parts[i].length === 2) - parts[i] = parts[i].toUpperCase(); - - // Four-letter subtags are titlecase - else if (parts[i].length === 4) - parts[i] = parts[i].charAt(0).toUpperCase() + parts[i].slice(1); - - // Is it a singleton? - else if (parts[i].length === 1 && parts[i] != 'x') - break; - } - locale = arrJoin.call(parts, '-'); - - // The steps laid out in RFC 5646 section 4.5 are as follows: - - // 1. Extension sequences are ordered into case-insensitive ASCII order - // by singleton subtag. - if ((match = locale.match(expExtSequences)) && match.length > 1) { - // The built-in sort() sorts by ASCII order, so use that - match.sort(); - - // Replace all extensions with the joined, sorted array - locale = locale.replace( - RegExp('(?:' + expExtSequences.source + ')+', 'i'), - arrJoin.call(match, '') - ); - } - - // 2. Redundant or grandfathered tags are replaced by their 'Preferred- - // Value', if there is one. - if (hop.call(redundantTags.tags, locale)) - locale = redundantTags.tags[locale]; - - // 3. Subtags are replaced by their 'Preferred-Value', if there is one. - // For extlangs, the original primary language subtag is also - // replaced if there is a primary language subtag in the 'Preferred- - // Value'. - parts = locale.split('-'); - - for (var i = 1, max = parts.length; i < max; i++) { - if (hop.call(redundantTags.subtags, parts[i])) - parts[i] = redundantTags.subtags[parts[i]]; - - else if (hop.call(redundantTags.extLang, parts[i])) { - parts[i] = redundantTags.extLang[parts[i]][0]; - - // For extlang tags, the prefix needs to be removed if it is redundant - if (i === 1 && redundantTags.extLang[parts[1]][1] === parts[0]) { - parts = arrSlice.call(parts, i++); - max -= 1; - } - } - } - - return arrJoin.call(parts, '-'); - } - - /** - * The DefaultLocale abstract operation returns a String value representing the - * structurally valid (6.2.2) and canonicalized (6.2.3) BCP 47 language tag for the - * host environment’s current locale. - */ - function /* 6.2.4 */DefaultLocale () { - return defaultLocale; - } - - // Sect 6.3 Currency Codes - // ======================= - - /** - * The IsWellFormedCurrencyCode abstract operation verifies that the currency argument - * (after conversion to a String value) represents a well-formed 3-letter ISO currency - * code. The following steps are taken: - */ - function /* 6.3.1 */IsWellFormedCurrencyCode(currency) { - var - // 1. Let `c` be ToString(currency) - c = String(currency), - - // 2. Let `normalized` be the result of mapping c to upper case as described - // in 6.1. - normalized = toLatinUpperCase(c); - - // 3. If the string length of normalized is not 3, return false. - // 4. If normalized contains any character that is not in the range "A" to "Z" - // (U+0041 to U+005A), return false. - if (expCurrencyCode.test(normalized) === false) - return false; - - // 5. Return true - return true; - } - - // Sect 9.2 Abstract Operations - // ============================ - function /* 9.2.1 */CanonicalizeLocaleList (locales) { - // The abstract operation CanonicalizeLocaleList takes the following steps: - - // 1. If locales is undefined, then a. Return a new empty List - if (locales === undefined) - return new List(); - - var - // 2. Let seen be a new empty List. - seen = new List(), - - // 3. If locales is a String value, then - // a. Let locales be a new array created as if by the expression new - // Array(locales) where Array is the standard built-in constructor with - // that name and locales is the value of locales. - locales = typeof locales === 'string' ? [ locales ] : locales, - - // 4. Let O be ToObject(locales). - O = toObject(locales), - - // 5. Let lenValue be the result of calling the [[Get]] internal method of - // O with the argument "length". - // 6. Let len be ToUint32(lenValue). - len = O.length, - - // 7. Let k be 0. - k = 0; - - // 8. Repeat, while k < len - while (k < len) { - var - // a. Let Pk be ToString(k). - Pk = String(k), - - // b. Let kPresent be the result of calling the [[HasProperty]] internal - // method of O with argument Pk. - kPresent = Pk in O; - - // c. If kPresent is true, then - if (kPresent) { - var - // i. Let kValue be the result of calling the [[Get]] internal - // method of O with argument Pk. - kValue = O[Pk]; - - // ii. If the type of kValue is not String or Object, then throw a - // TypeError exception. - if (kValue == null || (typeof kValue !== 'string' && typeof kValue !== 'object')) - throw new TypeError('String or Object type expected'); - - var - // iii. Let tag be ToString(kValue). - tag = String(kValue); - - // iv. If the result of calling the abstract operation - // IsStructurallyValidLanguageTag (defined in 6.2.2), passing tag as - // the argument, is false, then throw a RangeError exception. - if (!IsStructurallyValidLanguageTag(tag)) - throw new RangeError("'" + tag + "' is not a structurally valid language tag"); - - // v. Let tag be the result of calling the abstract operation - // CanonicalizeLanguageTag (defined in 6.2.3), passing tag as the - // argument. - tag = CanonicalizeLanguageTag(tag); - - // vi. If tag is not an element of seen, then append tag as the last - // element of seen. - if (arrIndexOf.call(seen, tag) === -1) - arrPush.call(seen, tag); - } - - // d. Increase k by 1. - k++; - } - - // 9. Return seen. - return seen; - } - - /** - * The BestAvailableLocale abstract operation compares the provided argument - * locale, which must be a String value with a structurally valid and - * canonicalized BCP 47 language tag, against the locales in availableLocales and - * returns either the longest non-empty prefix of locale that is an element of - * availableLocales, or undefined if there is no such element. It uses the - * fallback mechanism of RFC 4647, section 3.4. The following steps are taken: - */ - function /* 9.2.2 */BestAvailableLocale (availableLocales, locale) { - var - // 1. Let candidate be locale - candidate = locale; - - // 2. Repeat - while (true) { - // a. If availableLocales contains an element equal to candidate, then return - // candidate. - if (arrIndexOf.call(availableLocales, candidate) > -1) - return candidate; - - var - // b. Let pos be the character index of the last occurrence of "-" - // (U+002D) within candidate. If that character does not occur, return - // undefined. - pos = candidate.lastIndexOf('-'); - - if (pos < 0) - return; - - // c. If pos ≥ 2 and the character "-" occurs at index pos-2 of candidate, - // then decrease pos by 2. - if (pos >= 2 && candidate.charAt(pos - 2) == '-') - pos -= 2; - - // d. Let candidate be the substring of candidate from position 0, inclusive, - // to position pos, exclusive. - candidate = candidate.substring(0, pos); - } - } - - /** - * The LookupMatcher abstract operation compares requestedLocales, which must be - * a List as returned by CanonicalizeLocaleList, against the locales in - * availableLocales and determines the best available language to meet the - * request. The following steps are taken: - */ - function /* 9.2.3 */LookupMatcher (availableLocales, requestedLocales) { - var - // 1. Let i be 0. - i = 0, - - // 2. Let len be the number of elements in requestedLocales. - len = requestedLocales.length, - - // 3. Let availableLocale be undefined. - availableLocale; - - // 4. Repeat while i < len and availableLocale is undefined: - while (i < len && !availableLocale) { - var - // a. Let locale be the element of requestedLocales at 0-origined list - // position i. - locale = requestedLocales[i], - - // b. Let noExtensionsLocale be the String value that is locale with all - // Unicode locale extension sequences removed. - noExtensionsLocale = String(locale).replace(expUnicodeExSeq, ''), - - // c. Let availableLocale be the result of calling the - // BestAvailableLocale abstract operation (defined in 9.2.2) with - // arguments availableLocales and noExtensionsLocale. - availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale); - - // d. Increase i by 1. - i++; - } - - var - // 5. Let result be a new Record. - result = new Record(); - - // 6. If availableLocale is not undefined, then - if (availableLocale !== undefined) { - // a. Set result.[[locale]] to availableLocale. - result['[[locale]]'] = availableLocale; - - // b. If locale and noExtensionsLocale are not the same String value, then - if (String(locale) !== String(noExtensionsLocale)) { - var - // i. Let extension be the String value consisting of the first - // substring of locale that is a Unicode locale extension sequence. - extension = locale.match(expUnicodeExSeq)[0], - - // ii. Let extensionIndex be the character position of the initial - // "-" of the first Unicode locale extension sequence within locale. - extensionIndex = locale.indexOf('-u-'); - - // iii. Set result.[[extension]] to extension. - result['[[extension]]'] = extension; - - // iv. Set result.[[extensionIndex]] to extensionIndex. - result['[[extensionIndex]]'] = extensionIndex; - } - } - // 7. Else - else - // a. Set result.[[locale]] to the value returned by the DefaultLocale abstract - // operation (defined in 6.2.4). - result['[[locale]]'] = DefaultLocale(); - - // 8. Return result - return result; - } - - /** - * The BestFitMatcher abstract operation compares requestedLocales, which must be - * a List as returned by CanonicalizeLocaleList, against the locales in - * availableLocales and determines the best available language to meet the - * request. The algorithm is implementation dependent, but should produce results - * that a typical user of the requested locales would perceive as at least as - * good as those produced by the LookupMatcher abstract operation. Options - * specified through Unicode locale extension sequences must be ignored by the - * algorithm. Information about such subsequences is returned separately. - * The abstract operation returns a record with a [[locale]] field, whose value - * is the language tag of the selected locale, which must be an element of - * availableLocales. If the language tag of the request locale that led to the - * selected locale contained a Unicode locale extension sequence, then the - * returned record also contains an [[extension]] field whose value is the first - * Unicode locale extension sequence, and an [[extensionIndex]] field whose value - * is the index of the first Unicode locale extension sequence within the request - * locale language tag. - */ - function /* 9.2.4 */BestFitMatcher (availableLocales, requestedLocales) { - return LookupMatcher(availableLocales, requestedLocales); - } - - /** - * The ResolveLocale abstract operation compares a BCP 47 language priority list - * requestedLocales against the locales in availableLocales and determines the - * best available language to meet the request. availableLocales and - * requestedLocales must be provided as List values, options as a Record. - */ - function /* 9.2.5 */ResolveLocale (availableLocales, requestedLocales, options, relevantExtensionKeys, localeData) { - if (availableLocales.length === 0) { - throw new ReferenceError('No locale data has been provided for this object yet.'); - } - - // The following steps are taken: - var - // 1. Let matcher be the value of options.[[localeMatcher]]. - matcher = options['[[localeMatcher]]']; - - // 2. If matcher is "lookup", then - if (matcher === 'lookup') - var - // a. Let r be the result of calling the LookupMatcher abstract operation - // (defined in 9.2.3) with arguments availableLocales and - // requestedLocales. - r = LookupMatcher(availableLocales, requestedLocales); - - // 3. Else - else - var - // a. Let r be the result of calling the BestFitMatcher abstract - // operation (defined in 9.2.4) with arguments availableLocales and - // requestedLocales. - r = BestFitMatcher(availableLocales, requestedLocales); - - var - // 4. Let foundLocale be the value of r.[[locale]]. - foundLocale = r['[[locale]]']; - - // 5. If r has an [[extension]] field, then - if (hop.call(r, '[[extension]]')) - var - // a. Let extension be the value of r.[[extension]]. - extension = r['[[extension]]'], - // b. Let extensionIndex be the value of r.[[extensionIndex]]. - extensionIndex = r['[[extensionIndex]]'], - // c. Let split be the standard built-in function object defined in ES5, - // 15.5.4.14. - split = String.prototype.split, - // d. Let extensionSubtags be the result of calling the [[Call]] internal - // method of split with extension as the this value and an argument - // list containing the single item "-". - extensionSubtags = split.call(extension, '-'), - // e. Let extensionSubtagsLength be the result of calling the [[Get]] - // internal method of extensionSubtags with argument "length". - extensionSubtagsLength = extensionSubtags.length; - - var - // 6. Let result be a new Record. - result = new Record(); - - // 7. Set result.[[dataLocale]] to foundLocale. - result['[[dataLocale]]'] = foundLocale; - - var - // 8. Let supportedExtension be "-u". - supportedExtension = '-u', - // 9. Let i be 0. - i = 0, - // 10. Let len be the result of calling the [[Get]] internal method of - // relevantExtensionKeys with argument "length". - len = relevantExtensionKeys.length; - - // 11 Repeat while i < len: - while (i < len) { - var - // a. Let key be the result of calling the [[Get]] internal method of - // relevantExtensionKeys with argument ToString(i). - key = relevantExtensionKeys[i], - // b. Let foundLocaleData be the result of calling the [[Get]] internal - // method of localeData with the argument foundLocale. - foundLocaleData = localeData[foundLocale], - // c. Let keyLocaleData be the result of calling the [[Get]] internal - // method of foundLocaleData with the argument key. - keyLocaleData = foundLocaleData[key], - // d. Let value be the result of calling the [[Get]] internal method of - // keyLocaleData with argument "0". - value = keyLocaleData['0'], - // e. Let supportedExtensionAddition be "". - supportedExtensionAddition = '', - // f. Let indexOf be the standard built-in function object defined in - // ES5, 15.4.4.14. - indexOf = arrIndexOf; - - // g. If extensionSubtags is not undefined, then - if (extensionSubtags !== undefined) { - var - // i. Let keyPos be the result of calling the [[Call]] internal - // method of indexOf with extensionSubtags as the this value and - // an argument list containing the single item key. - keyPos = indexOf.call(extensionSubtags, key); - - // ii. If keyPos ≠ -1, then - if (keyPos !== -1) { - // 1. If keyPos + 1 < extensionSubtagsLength and the length of the - // result of calling the [[Get]] internal method of - // extensionSubtags with argument ToString(keyPos +1) is greater - // than 2, then - if (keyPos + 1 < extensionSubtagsLength - && extensionSubtags[keyPos + 1].length > 2) { - var - // a. Let requestedValue be the result of calling the [[Get]] - // internal method of extensionSubtags with argument - // ToString(keyPos + 1). - requestedValue = extensionSubtags[keyPos + 1], - // b. Let valuePos be the result of calling the [[Call]] - // internal method of indexOf with keyLocaleData as the - // this value and an argument list containing the single - // item requestedValue. - valuePos = indexOf.call(keyLocaleData, requestedValue); - - // c. If valuePos ≠ -1, then - if (valuePos !== -1) - var - // i. Let value be requestedValue. - value = requestedValue, - // ii. Let supportedExtensionAddition be the - // concatenation of "-", key, "-", and value. - supportedExtensionAddition = '-' + key + '-' + value; - } - // 2. Else - else { - var - // a. Let valuePos be the result of calling the [[Call]] - // internal method of indexOf with keyLocaleData as the this - // value and an argument list containing the single item - // "true". - valuePos = indexOf(keyLocaleData, 'true'); - - // b. If valuePos ≠ -1, then - if (valuePos !== -1) - var - // i. Let value be "true". - value = 'true'; - } - } - } - // h. If options has a field [[]], then - if (hop.call(options, '[[' + key + ']]')) { - var - // i. Let optionsValue be the value of options.[[]]. - optionsValue = options['[[' + key + ']]']; - - // ii. If the result of calling the [[Call]] internal method of indexOf - // with keyLocaleData as the this value and an argument list - // containing the single item optionsValue is not -1, then - if (indexOf.call(keyLocaleData, optionsValue) !== -1) { - // 1. If optionsValue is not equal to value, then - if (optionsValue !== value) { - // a. Let value be optionsValue. - value = optionsValue; - // b. Let supportedExtensionAddition be "". - supportedExtensionAddition = ''; - } - } - } - // i. Set result.[[]] to value. - result['[[' + key + ']]'] = value; - - // j. Append supportedExtensionAddition to supportedExtension. - supportedExtension += supportedExtensionAddition; - - // k. Increase i by 1. - i++; - } - // 12. If the length of supportedExtension is greater than 2, then - if (supportedExtension.length > 2) { - var - // a. Let preExtension be the substring of foundLocale from position 0, - // inclusive, to position extensionIndex, exclusive. - preExtension = foundLocale.substring(0, extensionIndex), - // b. Let postExtension be the substring of foundLocale from position - // extensionIndex to the end of the string. - postExtension = foundLocale.substring(extensionIndex), - // c. Let foundLocale be the concatenation of preExtension, - // supportedExtension, and postExtension. - foundLocale = preExtension + supportedExtension + postExtension; - } - // 13. Set result.[[locale]] to foundLocale. - result['[[locale]]'] = foundLocale; - - // 14. Return result. - return result; - } - - /** - * The LookupSupportedLocales abstract operation returns the subset of the - * provided BCP 47 language priority list requestedLocales for which - * availableLocales has a matching locale when using the BCP 47 Lookup algorithm. - * Locales appear in the same order in the returned list as in requestedLocales. - * The following steps are taken: - */ - function /* 9.2.6 */LookupSupportedLocales (availableLocales, requestedLocales) { - var - // 1. Let len be the number of elements in requestedLocales. - len = requestedLocales.length, - // 2. Let subset be a new empty List. - subset = new List(), - // 3. Let k be 0. - k = 0; - - // 4. Repeat while k < len - while (k < len) { - var - // a. Let locale be the element of requestedLocales at 0-origined list - // position k. - locale = requestedLocales[k], - // b. Let noExtensionsLocale be the String value that is locale with all - // Unicode locale extension sequences removed. - noExtensionsLocale = String(locale).replace(expUnicodeExSeq, ''), - // c. Let availableLocale be the result of calling the - // BestAvailableLocale abstract operation (defined in 9.2.2) with - // arguments availableLocales and noExtensionsLocale. - availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale); - - // d. If availableLocale is not undefined, then append locale to the end of - // subset. - if (availableLocale !== undefined) - arrPush.call(subset, locale); - - // e. Increment k by 1. - k++; - } - - var - // 5. Let subsetArray be a new Array object whose elements are the same - // values in the same order as the elements of subset. - subsetArray = arrSlice.call(subset); - - // 6. Return subsetArray. - return subsetArray; - } - - /** - * The BestFitSupportedLocales abstract operation returns the subset of the - * provided BCP 47 language priority list requestedLocales for which - * availableLocales has a matching locale when using the Best Fit Matcher - * algorithm. Locales appear in the same order in the returned list as in - * requestedLocales. The steps taken are implementation dependent. - */ - function /*9.2.7 */BestFitSupportedLocales (availableLocales, requestedLocales) { - // ###TODO: implement this function as described by the specification### - return LookupSupportedLocales(availableLocales, requestedLocales); - } - - /** - * The SupportedLocales abstract operation returns the subset of the provided BCP - * 47 language priority list requestedLocales for which availableLocales has a - * matching locale. Two algorithms are available to match the locales: the Lookup - * algorithm described in RFC 4647 section 3.4, and an implementation dependent - * best-fit algorithm. Locales appear in the same order in the returned list as - * in requestedLocales. The following steps are taken: - */ - function /*9.2.8 */SupportedLocales (availableLocales, requestedLocales, options) { - // 1. If options is not undefined, then - if (options !== undefined) { - var - // a. Let options be ToObject(options). - options = new Record(toObject(options)), - // b. Let matcher be the result of calling the [[Get]] internal method of - // options with argument "localeMatcher". - matcher = options.localeMatcher; - - // c. If matcher is not undefined, then - if (matcher !== undefined) { - // i. Let matcher be ToString(matcher). - matcher = String(matcher); - - // ii. If matcher is not "lookup" or "best fit", then throw a RangeError - // exception. - if (matcher !== 'lookup' && matcher !== 'best fit') - throw new RangeError('matcher should be "lookup" or "best fit"'); - } - } - // 2. If matcher is undefined or "best fit", then - if (matcher === undefined || matcher === 'best fit') - var - // a. Let subset be the result of calling the BestFitSupportedLocales - // abstract operation (defined in 9.2.7) with arguments - // availableLocales and requestedLocales. - subset = BestFitSupportedLocales(availableLocales, requestedLocales); - // 3. Else - else - var - // a. Let subset be the result of calling the LookupSupportedLocales - // abstract operation (defined in 9.2.6) with arguments - // availableLocales and requestedLocales. - subset = LookupSupportedLocales(availableLocales, requestedLocales); - - // 4. For each named own property name P of subset, - for (var P in subset) { - if (!hop.call(subset, P)) - continue; - - // a. Let desc be the result of calling the [[GetOwnProperty]] internal - // method of subset with P. - // b. Set desc.[[Writable]] to false. - // c. Set desc.[[Configurable]] to false. - // d. Call the [[DefineOwnProperty]] internal method of subset with P, desc, - // and true as arguments. - defineProperty(subset, P, { - writable: false, configurable: false, value: subset[P] - }); - } - // "Freeze" the array so no new elements can be added - defineProperty(subset, 'length', { writable: false }); - - // 5. Return subset - return subset; - } - - /** - * The GetOption abstract operation extracts the value of the property named - * property from the provided options object, converts it to the required type, - * checks whether it is one of a List of allowed values, and fills in a fallback - * value if necessary. - */ - function /*9.2.9 */GetOption (options, property, type, values, fallback) { - var - // 1. Let value be the result of calling the [[Get]] internal method of - // options with argument property. - value = options[property]; - - // 2. If value is not undefined, then - if (value !== undefined) { - // a. Assert: type is "boolean" or "string". - // b. If type is "boolean", then let value be ToBoolean(value). - // c. If type is "string", then let value be ToString(value). - value = type === 'boolean' ? Boolean(value) - : (type === 'string' ? String(value) : value); - - // d. If values is not undefined, then - if (values !== undefined) { - // i. If values does not contain an element equal to value, then throw a - // RangeError exception. - if (arrIndexOf.call(values, value) === -1) - throw new RangeError("'" + value + "' is not an allowed value for `" + property +'`'); - } - - // e. Return value. - return value; - } - // Else return fallback. - return fallback; - } - - /** - * The GetNumberOption abstract operation extracts a property value from the - * provided options object, converts it to a Number value, checks whether it is - * in the allowed range, and fills in a fallback value if necessary. - */ - function /* 9.2.10 */GetNumberOption (options, property, minimum, maximum, fallback) { - var - // 1. Let value be the result of calling the [[Get]] internal method of - // options with argument property. - value = options[property]; - - // 2. If value is not undefined, then - if (value !== undefined) { - // a. Let value be ToNumber(value). - value = Number(value); - - // b. If value is NaN or less than minimum or greater than maximum, throw a - // RangeError exception. - if (isNaN(value) || value < minimum || value > maximum) - throw new RangeError('Value is not a number or outside accepted range'); - - // c. Return floor(value). - return Math.floor(value); - } - // 3. Else return fallback. - return fallback; - } - - // 11.1 The Intl.NumberFormat constructor - // ====================================== - - // Define the NumberFormat constructor internally so it cannot be tainted - function NumberFormatConstructor () { - var locales = arguments[0]; - var options = arguments[1]; - - if (!this || this === Intl) { - return new Intl.NumberFormat(locales, options); - } - - return InitializeNumberFormat(toObject(this), locales, options); - } - - defineProperty(Intl, 'NumberFormat', { - configurable: true, - writable: true, - value: NumberFormatConstructor - }); - - // Must explicitly set prototypes as unwritable - defineProperty(Intl.NumberFormat, 'prototype', { - writable: false - }); - - /** - * The abstract operation InitializeNumberFormat accepts the arguments - * numberFormat (which must be an object), locales, and options. It initializes - * numberFormat as a NumberFormat object. - */ - function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, options) { - var - // This will be a internal properties object if we're not already initialized - internal = getInternalProperties(numberFormat), - - // Create an object whose props can be used to restore the values of RegExp props - regexpState = createRegExpRestore(); - - // 1. If numberFormat has an [[initializedIntlObject]] internal property with - // value true, throw a TypeError exception. - if (internal['[[initializedIntlObject]]'] === true) - throw new TypeError('`this` object has already been initialized as an Intl object'); - - // Need this to access the `internal` object - defineProperty(numberFormat, '__getInternalProperties', { - value: function () { - // NOTE: Non-standard, for internal use only - if (arguments[0] === secret) - return internal; - } - }); - - // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true. - internal['[[initializedIntlObject]]'] = true; - - var - // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList - // abstract operation (defined in 9.2.1) with argument locales. - requestedLocales = CanonicalizeLocaleList(locales); - - // 4. If options is undefined, then - if (options === undefined) - // a. Let options be the result of creating a new object as if by the - // expression new Object() where Object is the standard built-in constructor - // with that name. - options = {}; - - // 5. Else - else - // a. Let options be ToObject(options). - options = toObject(options); - - var - // 6. Let opt be a new Record. - opt = new Record(), - - // 7. Let matcher be the result of calling the GetOption abstract operation - // (defined in 9.2.9) with the arguments options, "localeMatcher", "string", - // a List containing the two String values "lookup" and "best fit", and - // "best fit". - matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit'); - - // 8. Set opt.[[localeMatcher]] to matcher. - opt['[[localeMatcher]]'] = matcher; - - var - // 9. Let NumberFormat be the standard built-in object that is the initial value - // of Intl.NumberFormat. - // 10. Let localeData be the value of the [[localeData]] internal property of - // NumberFormat. - localeData = internals.NumberFormat['[[localeData]]'], - - // 11. Let r be the result of calling the ResolveLocale abstract operation - // (defined in 9.2.5) with the [[availableLocales]] internal property of - // NumberFormat, requestedLocales, opt, the [[relevantExtensionKeys]] - // internal property of NumberFormat, and localeData. - r = ResolveLocale( - internals.NumberFormat['[[availableLocales]]'], requestedLocales, - opt, internals.NumberFormat['[[relevantExtensionKeys]]'], localeData - ); - - // 12. Set the [[locale]] internal property of numberFormat to the value of - // r.[[locale]]. - internal['[[locale]]'] = r['[[locale]]']; - - // 13. Set the [[numberingSystem]] internal property of numberFormat to the value - // of r.[[nu]]. - internal['[[numberingSystem]]'] = r['[[nu]]']; - - // The specification doesn't tell us to do this, but it's helpful later on - internal['[[dataLocale]]'] = r['[[dataLocale]]']; - - var - // 14. Let dataLocale be the value of r.[[dataLocale]]. - dataLocale = r['[[dataLocale]]'], - - // 15. Let s be the result of calling the GetOption abstract operation with the - // arguments options, "style", "string", a List containing the three String - // values "decimal", "percent", and "currency", and "decimal". - s = GetOption(options, 'style', 'string', new List('decimal', 'percent', 'currency'), 'decimal'); - - // 16. Set the [[style]] internal property of numberFormat to s. - internal['[[style]]'] = s; - - var - // 17. Let c be the result of calling the GetOption abstract operation with the - // arguments options, "currency", "string", undefined, and undefined. - c = GetOption(options, 'currency', 'string'); - - // 18. If c is not undefined and the result of calling the - // IsWellFormedCurrencyCode abstract operation (defined in 6.3.1) with - // argument c is false, then throw a RangeError exception. - if (c !== undefined && !IsWellFormedCurrencyCode(c)) - throw new RangeError("'" + c + "' is not a valid currency code"); - - // 19. If s is "currency" and c is undefined, throw a TypeError exception. - if (s === 'currency' && c === undefined) - throw new TypeError('Currency code is required when style is currency'); - - // 20. If s is "currency", then - if (s === 'currency') { - // a. Let c be the result of converting c to upper case as specified in 6.1. - c = c.toUpperCase(); - - // b. Set the [[currency]] internal property of numberFormat to c. - internal['[[currency]]'] = c; - - var - // c. Let cDigits be the result of calling the CurrencyDigits abstract - // operation (defined below) with argument c. - cDigits = CurrencyDigits(c); - } - - var - // 21. Let cd be the result of calling the GetOption abstract operation with the - // arguments options, "currencyDisplay", "string", a List containing the - // three String values "code", "symbol", and "name", and "symbol". - cd = GetOption(options, 'currencyDisplay', 'string', new List('code', 'symbol', 'name'), 'symbol'); - - // 22. If s is "currency", then set the [[currencyDisplay]] internal property of - // numberFormat to cd. - if (s === 'currency') - internal['[[currencyDisplay]]'] = cd; - - var - // 23. Let mnid be the result of calling the GetNumberOption abstract operation - // (defined in 9.2.10) with arguments options, "minimumIntegerDigits", 1, 21, - // and 1. - mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1); - - // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid. - internal['[[minimumIntegerDigits]]'] = mnid; - - var - // 25. If s is "currency", then let mnfdDefault be cDigits; else let mnfdDefault - // be 0. - mnfdDefault = s === 'currency' ? cDigits : 0, - - // 26. Let mnfd be the result of calling the GetNumberOption abstract operation - // with arguments options, "minimumFractionDigits", 0, 20, and mnfdDefault. - mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault); - - // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd. - internal['[[minimumFractionDigits]]'] = mnfd; - - var - // 28. If s is "currency", then let mxfdDefault be max(mnfd, cDigits); else if s - // is "percent", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault - // be max(mnfd, 3). - mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits) - : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3)), - - // 29. Let mxfd be the result of calling the GetNumberOption abstract operation - // with arguments options, "maximumFractionDigits", mnfd, 20, and mxfdDefault. - mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault); - - // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd. - internal['[[maximumFractionDigits]]'] = mxfd; - - var - // 31. Let mnsd be the result of calling the [[Get]] internal method of options - // with argument "minimumSignificantDigits". - mnsd = options.minimumSignificantDigits, - - // 32. Let mxsd be the result of calling the [[Get]] internal method of options - // with argument "maximumSignificantDigits". - mxsd = options.maximumSignificantDigits; - - // 33. If mnsd is not undefined or mxsd is not undefined, then: - if (mnsd !== undefined || mxsd !== undefined) { - // a. Let mnsd be the result of calling the GetNumberOption abstract - // operation with arguments options, "minimumSignificantDigits", 1, 21, - // and 1. - mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1); - - // b. Let mxsd be the result of calling the GetNumberOption abstract - // operation with arguments options, "maximumSignificantDigits", mnsd, - // 21, and 21. - mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21); - - // c. Set the [[minimumSignificantDigits]] internal property of numberFormat - // to mnsd, and the [[maximumSignificantDigits]] internal property of - // numberFormat to mxsd. - internal['[[minimumSignificantDigits]]'] = mnsd; - internal['[[maximumSignificantDigits]]'] = mxsd; - } - var - // 34. Let g be the result of calling the GetOption abstract operation with the - // arguments options, "useGrouping", "boolean", undefined, and true. - g = GetOption(options, 'useGrouping', 'boolean', undefined, true); - - // 35. Set the [[useGrouping]] internal property of numberFormat to g. - internal['[[useGrouping]]'] = g; - - var - // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of - // localeData with argument dataLocale. - dataLocaleData = localeData[dataLocale], - - // 37. Let patterns be the result of calling the [[Get]] internal method of - // dataLocaleData with argument "patterns". - patterns = dataLocaleData.patterns; - - // 38. Assert: patterns is an object (see 11.2.3) - - var - // 39. Let stylePatterns be the result of calling the [[Get]] internal method of - // patterns with argument s. - stylePatterns = patterns[s]; - - // 40. Set the [[positivePattern]] internal property of numberFormat to the - // result of calling the [[Get]] internal method of stylePatterns with the - // argument "positivePattern". - internal['[[positivePattern]]'] = stylePatterns.positivePattern; - - // 41. Set the [[negativePattern]] internal property of numberFormat to the - // result of calling the [[Get]] internal method of stylePatterns with the - // argument "negativePattern". - internal['[[negativePattern]]'] = stylePatterns.negativePattern; - - // 42. Set the [[boundFormat]] internal property of numberFormat to undefined. - internal['[[boundFormat]]'] = undefined; - - // 43. Set the [[initializedNumberFormat]] internal property of numberFormat to - // true. - internal['[[initializedNumberFormat]]'] = true; - - // In ES3, we need to pre-bind the format() function - if (es3) - numberFormat.format = GetFormatNumber.call(numberFormat); - - // Restore the RegExp properties - regexpState.exp.test(regexpState.input); - - // Return the newly initialised object - return numberFormat; - } - - function CurrencyDigits(currency) { - // When the CurrencyDigits abstract operation is called with an argument currency - // (which must be an upper case String value), the following steps are taken: - - // 1. If the ISO 4217 currency and funds code list contains currency as an - // alphabetic code, then return the minor unit value corresponding to the - // currency from the list; else return 2. - return currencyMinorUnits[currency] !== undefined - ? currencyMinorUnits[currency] - : 2; - } - - /* 11.2.3 */internals.NumberFormat = { - '[[availableLocales]]': [], - '[[relevantExtensionKeys]]': ['nu'], - '[[localeData]]': {} - }; - - /** - * When the supportedLocalesOf method of Intl.NumberFormat is called, the - * following steps are taken: - */ - /* 11.2.2 */defineProperty(Intl.NumberFormat, 'supportedLocalesOf', { - configurable: true, - writable: true, - value: fnBind.call(supportedLocalesOf, internals.NumberFormat) - }); - - /** - * This named accessor property returns a function that formats a number - * according to the effective locale and the formatting options of this - * NumberFormat object. - */ - /* 11.3.2 */defineProperty(Intl.NumberFormat.prototype, 'format', { - configurable: true, - get: GetFormatNumber - }); - - function GetFormatNumber() { - var internal = this != null && typeof this === 'object' && getInternalProperties(this); - - // Satisfy test 11.3_b - if (!internal || !internal['[[initializedNumberFormat]]']) - throw new TypeError('`this` value for format() is not an initialized Intl.NumberFormat object.'); - - // The value of the [[Get]] attribute is a function that takes the following - // steps: - - // 1. If the [[boundFormat]] internal property of this NumberFormat object - // is undefined, then: - if (internal['[[boundFormat]]'] === undefined) { - var - // a. Let F be a Function object, with internal properties set as - // specified for built-in functions in ES5, 15, or successor, and the - // length property set to 1, that takes the argument value and - // performs the following steps: - F = function (value) { - // i. If value is not provided, then let value be undefined. - // ii. Let x be ToNumber(value). - // iii. Return the result of calling the FormatNumber abstract - // operation (defined below) with arguments this and x. - return FormatNumber(this, /* x = */Number(value)); - }, - - // b. Let bind be the standard built-in function object defined in ES5, - // 15.3.4.5. - // c. Let bf be the result of calling the [[Call]] internal method of - // bind with F as the this value and an argument list containing - // the single item this. - bf = fnBind.call(F, this); - - // d. Set the [[boundFormat]] internal property of this NumberFormat - // object to bf. - internal['[[boundFormat]]'] = bf; - } - // Return the value of the [[boundFormat]] internal property of this - // NumberFormat object. - return internal['[[boundFormat]]']; - } - - /** - * When the FormatNumber abstract operation is called with arguments numberFormat - * (which must be an object initialized as a NumberFormat) and x (which must be a - * Number value), it returns a String value representing x according to the - * effective locale and the formatting options of numberFormat. - */ - function FormatNumber (numberFormat, x) { - var n, - - // Create an object whose props can be used to restore the values of RegExp props - regexpState = createRegExpRestore(), - - internal = getInternalProperties(numberFormat), - locale = internal['[[dataLocale]]'], - nums = internal['[[numberingSystem]]'], - data = internals.NumberFormat['[[localeData]]'][locale], - ild = data.symbols[nums] || data.symbols.latn, - - // 1. Let negative be false. - negative = false; - - // 2. If the result of isFinite(x) is false, then - if (isFinite(x) === false) { - // a. If x is NaN, then let n be an ILD String value indicating the NaN value. - if (isNaN(x)) - n = ild.nan; - - // b. Else - else { - // a. Let n be an ILD String value indicating infinity. - n = ild.infinity; - // b. If x < 0, then let negative be true. - if (x < 0) - negative = true; - } - } - // 3. Else - else { - // a. If x < 0, then - if (x < 0) { - // i. Let negative be true. - negative = true; - // ii. Let x be -x. - x = -x; - } - - // b. If the value of the [[style]] internal property of numberFormat is - // "percent", let x be 100 × x. - if (internal['[[style]]'] === 'percent') - x *= 100; - - // c. If the [[minimumSignificantDigits]] and [[maximumSignificantDigits]] - // internal properties of numberFormat are present, then - if (hop.call(internal, '[[minimumSignificantDigits]]') && - hop.call(internal, '[[maximumSignificantDigits]]')) - // i. Let n be the result of calling the ToRawPrecision abstract operation - // (defined below), passing as arguments x and the values of the - // [[minimumSignificantDigits]] and [[maximumSignificantDigits]] - // internal properties of numberFormat. - n = ToRawPrecision(x, - internal['[[minimumSignificantDigits]]'], - internal['[[maximumSignificantDigits]]']); - // d. Else - else - // i. Let n be the result of calling the ToRawFixed abstract operation - // (defined below), passing as arguments x and the values of the - // [[minimumIntegerDigits]], [[minimumFractionDigits]], and - // [[maximumFractionDigits]] internal properties of numberFormat. - n = ToRawFixed(x, - internal['[[minimumIntegerDigits]]'], - internal['[[minimumFractionDigits]]'], - internal['[[maximumFractionDigits]]']); - - // e. If the value of the [[numberingSystem]] internal property of - // numberFormat matches one of the values in the “Numbering System” column - // of Table 2 below, then - if (numSys[nums]) { - // i. Let digits be an array whose 10 String valued elements are the - // UTF-16 string representations of the 10 digits specified in the - // “Digits” column of Table 2 in the row containing the value of the - // [[numberingSystem]] internal property. - var digits = numSys[internal['[[numberingSystem]]']]; - // ii. Replace each digit in n with the value of digits[digit]. - n = String(n).replace(/\d/g, function (digit) { - return digits[digit]; - }); - } - // f. Else use an implementation dependent algorithm to map n to the - // appropriate representation of n in the given numbering system. - else - n = String(n); // ###TODO### - - // g. If n contains the character ".", then replace it with an ILND String - // representing the decimal separator. - n = n.replace(/\./g, ild.decimal); - - // h. If the value of the [[useGrouping]] internal property of numberFormat - // is true, then insert an ILND String representing a grouping separator - // into an ILND set of locations within the integer part of n. - if (internal['[[useGrouping]]'] === true) { - var - parts = n.split(ild.decimal), - igr = parts[0], - - // Primary group represents the group closest to the decimal - pgSize = data.patterns.primaryGroupSize || 3, - - // Secondary group is every other group - sgSize = data.patterns.secondaryGroupSize || pgSize; - - // Group only if necessary - if (igr.length > pgSize) { - var - groups = new List(), - - // Index of the primary grouping separator - end = igr.length - pgSize, - - // Starting index for our loop - idx = end % sgSize, - - start = igr.slice(0, idx); - - if (start.length) - arrPush.call(groups, start); - - // Loop to separate into secondary grouping digits - while (idx < end) { - arrPush.call(groups, igr.slice(idx, idx + sgSize)); - idx += sgSize; - } - - // Add the primary grouping digits - arrPush.call(groups, igr.slice(end)); - - parts[0] = arrJoin.call(groups, ild.group); - } - - n = arrJoin.call(parts, ild.decimal); - } - } - - var - // 4. If negative is true, then let result be the value of the [[negativePattern]] - // internal property of numberFormat; else let result be the value of the - // [[positivePattern]] internal property of numberFormat. - result = internal[negative === true ? '[[negativePattern]]' : '[[positivePattern]]']; - - // 5. Replace the substring "{number}" within result with n. - result = result.replace('{number}', n); - - // 6. If the value of the [[style]] internal property of numberFormat is - // "currency", then: - if (internal['[[style]]'] === 'currency') { - var cd, - // a. Let currency be the value of the [[currency]] internal property of - // numberFormat. - currency = internal['[[currency]]'], - - // Shorthand for the currency data - cData = data.currencies[currency]; - - // b. If the value of the [[currencyDisplay]] internal property of - // numberFormat is "code", then let cd be currency. - // c. Else if the value of the [[currencyDisplay]] internal property of - // numberFormat is "symbol", then let cd be an ILD string representing - // currency in short form. If the implementation does not have such a - // representation of currency, then use currency itself. - // d. Else if the value of the [[currencyDisplay]] internal property of - // numberFormat is "name", then let cd be an ILD string representing - // currency in long form. If the implementation does not have such a - // representation of currency, then use currency itself. - switch (internal['[[currencyDisplay]]']) { - case 'symbol': - cd = cData || currency; - break; - - default: - case 'code': - case 'name': - cd = currency; - } - - // e. Replace the substring "{currency}" within result with cd. - result = result.replace('{currency}', cd); - } - - // Restore the RegExp properties - regexpState.exp.test(regexpState.input); - - // 7. Return result. - return result; - } - - /** - * When the ToRawPrecision abstract operation is called with arguments x (which - * must be a finite non-negative number), minPrecision, and maxPrecision (both - * must be integers between 1 and 21) the following steps are taken: - */ - function ToRawPrecision (x, minPrecision, maxPrecision) { - var - // 1. Let p be maxPrecision. - p = maxPrecision; - - // 2. If x = 0, then - if (x === 0) { - var - // a. Let m be the String consisting of p occurrences of the character "0". - m = arrJoin.call(Array (p + 1), '0'), - // b. Let e be 0. - e = 0; - } - // 3. Else - else { - // a. Let e and n be integers such that 10ᵖ⁻¹ ≤ n < 10ᵖ and for which the - // exact mathematical value of n × 10ᵉ⁻ᵖ⁺¹ – x is as close to zero as - // possible. If there are two such sets of e and n, pick the e and n for - // which n × 10ᵉ⁻ᵖ⁺¹ is larger. - var - e = log10Floor(Math.abs(x)), - - // Easier to get to m from here - f = Math.round(Math.exp((Math.abs(e - p + 1)) * Math.LN10)), - - // b. Let m be the String consisting of the digits of the decimal - // representation of n (in order, with no leading zeroes) - m = String(Math.round(e - p + 1 < 0 ? x * f : x / f)); - } - - // 4. If e ≥ p, then - if (e >= p) - // a. Return the concatenation of m and e-p+1 occurrences of the character "0". - return m + arrJoin.call(Array(e-p+1 + 1), '0'); - - // 5. If e = p-1, then - else if (e === p - 1) - // a. Return m. - return m; - - // 6. If e ≥ 0, then - else if (e >= 0) - // a. Let m be the concatenation of the first e+1 characters of m, the character - // ".", and the remaining p–(e+1) characters of m. - m = m.slice(0, e + 1) + '.' + m.slice(e + 1); - - // 7. If e < 0, then - else if (e < 0) - // a. Let m be the concatenation of the String "0.", –(e+1) occurrences of the - // character "0", and the string m. - m = '0.' + arrJoin.call(Array (-(e+1) + 1), '0') + m; - - // 8. If m contains the character ".", and maxPrecision > minPrecision, then - if (m.indexOf(".") >= 0 && maxPrecision > minPrecision) { - var - // a. Let cut be maxPrecision – minPrecision. - cut = maxPrecision - minPrecision; - - // b. Repeat while cut > 0 and the last character of m is "0": - while (cut > 0 && m.charAt(m.length-1) === '0') { - // i. Remove the last character from m. - m = m.slice(0, -1); - - // ii. Decrease cut by 1. - cut--; - } - - // c. If the last character of m is ".", then - if (m.charAt(m.length-1) === '.') - // i. Remove the last character from m. - m = m.slice(0, -1); - } - // 9. Return m. - return m; - } - - /** - * When the ToRawFixed abstract operation is called with arguments x (which must - * be a finite non-negative number), minInteger (which must be an integer between - * 1 and 21), minFraction, and maxFraction (which must be integers between 0 and - * 20) the following steps are taken: - */ - function ToRawFixed (x, minInteger, minFraction, maxFraction) { - // (or not because Number.toPrototype.toFixed does a lot of it for us) - var idx, - - // We can pick up after the fixed formatted string (m) is created - m = Number.prototype.toFixed.call(x, maxFraction), - - // 4. If [maxFraction] ≠ 0, then - // ... - // e. Let int be the number of characters in a. - // - // 5. Else let int be the number of characters in m. - igr = m.split(".")[0].length, // int is a reserved word - - // 6. Let cut be maxFraction – minFraction. - cut = maxFraction - minFraction, - - exp = (idx = m.indexOf('e')) > -1 ? m.slice(idx + 1) : 0; - - if (exp) { - m = m.slice(0, idx).replace('.', ''); - m += arrJoin.call(Array(exp - (m.length - 1) + 1), '0') - + '.' + arrJoin.call(Array(maxFraction + 1), '0'); - - igr = m.length; - } - - // 7. Repeat while cut > 0 and the last character of m is "0": - while (cut > 0 && m.slice(-1) === "0") { - // a. Remove the last character from m. - m = m.slice(0, -1); - - // b. Decrease cut by 1. - cut--; - } - - // 8. If the last character of m is ".", then - if (m.slice(-1) === ".") - // a. Remove the last character from m. - m = m.slice(0, -1); - - // 9. If int < minInteger, then - if (igr < minInteger) - // a. Let z be the String consisting of minInteger–int occurrences of the - // character "0". - var z = arrJoin.call(Array(minInteger - igr + 1), '0'); - - // 10. Let m be the concatenation of Strings z and m. - // 11. Return m. - return (z ? z : '') + m; - } - - // Sect 11.3.2 Table 2, Numbering systems - // ====================================== - var numSys = { - arab: [ '\u0660', '\u0661', '\u0662', '\u0663', '\u0664', '\u0665', '\u0666', '\u0667', '\u0668', '\u0669' ], - arabext: [ '\u06F0', '\u06F1', '\u06F2', '\u06F3', '\u06F4', '\u06F5', '\u06F6', '\u06F7', '\u06F8', '\u06F9' ], - bali: [ '\u1B50', '\u1B51', '\u1B52', '\u1B53', '\u1B54', '\u1B55', '\u1B56', '\u1B57', '\u1B58', '\u1B59' ], - beng: [ '\u09E6', '\u09E7', '\u09E8', '\u09E9', '\u09EA', '\u09EB', '\u09EC', '\u09ED', '\u09EE', '\u09EF' ], - deva: [ '\u0966', '\u0967', '\u0968', '\u0969', '\u096A', '\u096B', '\u096C', '\u096D', '\u096E', '\u096F' ], - fullwide:[ '\uFF10', '\uFF11', '\uFF12', '\uFF13', '\uFF14', '\uFF15', '\uFF16', '\uFF17', '\uFF18', '\uFF19' ], - gujr: [ '\u0AE6', '\u0AE7', '\u0AE8', '\u0AE9', '\u0AEA', '\u0AEB', '\u0AEC', '\u0AED', '\u0AEE', '\u0AEF' ], - guru: [ '\u0A66', '\u0A67', '\u0A68', '\u0A69', '\u0A6A', '\u0A6B', '\u0A6C', '\u0A6D', '\u0A6E', '\u0A6F' ], - hanidec: [ '\u3007', '\u4E00', '\u4E8C', '\u4E09', '\u56DB', '\u4E94', '\u516D', '\u4E03', '\u516B', '\u4E5D' ], - khmr: [ '\u17E0', '\u17E1', '\u17E2', '\u17E3', '\u17E4', '\u17E5', '\u17E6', '\u17E7', '\u17E8', '\u17E9' ], - knda: [ '\u0CE6', '\u0CE7', '\u0CE8', '\u0CE9', '\u0CEA', '\u0CEB', '\u0CEC', '\u0CED', '\u0CEE', '\u0CEF' ], - laoo: [ '\u0ED0', '\u0ED1', '\u0ED2', '\u0ED3', '\u0ED4', '\u0ED5', '\u0ED6', '\u0ED7', '\u0ED8', '\u0ED9' ], - latn: [ '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039' ], - limb: [ '\u1946', '\u1947', '\u1948', '\u1949', '\u194A', '\u194B', '\u194C', '\u194D', '\u194E', '\u194F' ], - mlym: [ '\u0D66', '\u0D67', '\u0D68', '\u0D69', '\u0D6A', '\u0D6B', '\u0D6C', '\u0D6D', '\u0D6E', '\u0D6F' ], - mong: [ '\u1810', '\u1811', '\u1812', '\u1813', '\u1814', '\u1815', '\u1816', '\u1817', '\u1818', '\u1819' ], - mymr: [ '\u1040', '\u1041', '\u1042', '\u1043', '\u1044', '\u1045', '\u1046', '\u1047', '\u1048', '\u1049' ], - orya: [ '\u0B66', '\u0B67', '\u0B68', '\u0B69', '\u0B6A', '\u0B6B', '\u0B6C', '\u0B6D', '\u0B6E', '\u0B6F' ], - tamldec: [ '\u0BE6', '\u0BE7', '\u0BE8', '\u0BE9', '\u0BEA', '\u0BEB', '\u0BEC', '\u0BED', '\u0BEE', '\u0BEF' ], - telu: [ '\u0C66', '\u0C67', '\u0C68', '\u0C69', '\u0C6A', '\u0C6B', '\u0C6C', '\u0C6D', '\u0C6E', '\u0C6F' ], - thai: [ '\u0E50', '\u0E51', '\u0E52', '\u0E53', '\u0E54', '\u0E55', '\u0E56', '\u0E57', '\u0E58', '\u0E59' ], - tibt: [ '\u0F20', '\u0F21', '\u0F22', '\u0F23', '\u0F24', '\u0F25', '\u0F26', '\u0F27', '\u0F28', '\u0F29' ] - }; - - /** - * This function provides access to the locale and formatting options computed - * during initialization of the object. - * - * The function returns a new object whose properties and attributes are set as - * if constructed by an object literal assigning to each of the following - * properties the value of the corresponding internal property of this - * NumberFormat object (see 11.4): locale, numberingSystem, style, currency, - * currencyDisplay, minimumIntegerDigits, minimumFractionDigits, - * maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, and - * useGrouping. Properties whose corresponding internal properties are not present - * are not assigned. - */ - /* 11.3.3 */defineProperty(Intl.NumberFormat.prototype, 'resolvedOptions', { - configurable: true, - writable: true, - value: function () { - var prop, - descs = new Record(), - props = [ - 'locale', 'numberingSystem', 'style', 'currency', 'currencyDisplay', - 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits', - 'minimumSignificantDigits', 'maximumSignificantDigits', 'useGrouping' - ], - internal = this != null && typeof this === 'object' && getInternalProperties(this); - - // Satisfy test 11.3_b - if (!internal || !internal['[[initializedNumberFormat]]']) - throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.'); - - for (var i = 0, max = props.length; i < max; i++) { - if (hop.call(internal, prop = '[['+ props[i] +']]')) - descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true }; - } - - return objCreate({}, descs); - } - }); - - // 12.1 The Intl.DateTimeFormat constructor - // ================================== - - // Define the DateTimeFormat constructor internally so it cannot be tainted - function DateTimeFormatConstructor () { - var locales = arguments[0]; - var options = arguments[1]; - - if (!this || this === Intl) { - return new Intl.DateTimeFormat(locales, options); - } - return InitializeDateTimeFormat(toObject(this), locales, options); - } - - defineProperty(Intl, 'DateTimeFormat', { - configurable: true, - writable: true, - value: DateTimeFormatConstructor - }); - - // Must explicitly set prototypes as unwritable - defineProperty(DateTimeFormatConstructor, 'prototype', { - writable: false - }); - - /** - * The abstract operation InitializeDateTimeFormat accepts the arguments dateTimeFormat - * (which must be an object), locales, and options. It initializes dateTimeFormat as a - * DateTimeFormat object. - */ - function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales, options) { - var - // This will be a internal properties object if we're not already initialized - internal = getInternalProperties(dateTimeFormat), - - // Create an object whose props can be used to restore the values of RegExp props - regexpState = createRegExpRestore(); - - // 1. If dateTimeFormat has an [[initializedIntlObject]] internal property with - // value true, throw a TypeError exception. - if (internal['[[initializedIntlObject]]'] === true) - throw new TypeError('`this` object has already been initialized as an Intl object'); - - // Need this to access the `internal` object - defineProperty(dateTimeFormat, '__getInternalProperties', { - value: function () { - // NOTE: Non-standard, for internal use only - if (arguments[0] === secret) - return internal; - } - }); - - // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true. - internal['[[initializedIntlObject]]'] = true; - - var - // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList - // abstract operation (defined in 9.2.1) with argument locales. - requestedLocales = CanonicalizeLocaleList(locales), - - // 4. Let options be the result of calling the ToDateTimeOptions abstract - // operation (defined below) with arguments options, "any", and "date". - options = ToDateTimeOptions(options, 'any', 'date'), - - // 5. Let opt be a new Record. - opt = new Record(); - - // 6. Let matcher be the result of calling the GetOption abstract operation - // (defined in 9.2.9) with arguments options, "localeMatcher", "string", a List - // containing the two String values "lookup" and "best fit", and "best fit". - matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit'); - - // 7. Set opt.[[localeMatcher]] to matcher. - opt['[[localeMatcher]]'] = matcher; - - var - // 8. Let DateTimeFormat be the standard built-in object that is the initial - // value of Intl.DateTimeFormat. - DateTimeFormat = internals.DateTimeFormat, // This is what we *really* need - - // 9. Let localeData be the value of the [[localeData]] internal property of - // DateTimeFormat. - localeData = DateTimeFormat['[[localeData]]'], - - // 10. Let r be the result of calling the ResolveLocale abstract operation - // (defined in 9.2.5) with the [[availableLocales]] internal property of - // DateTimeFormat, requestedLocales, opt, the [[relevantExtensionKeys]] - // internal property of DateTimeFormat, and localeData. - r = ResolveLocale(DateTimeFormat['[[availableLocales]]'], requestedLocales, - opt, DateTimeFormat['[[relevantExtensionKeys]]'], localeData); - - // 11. Set the [[locale]] internal property of dateTimeFormat to the value of - // r.[[locale]]. - internal['[[locale]]'] = r['[[locale]]']; - - // 12. Set the [[calendar]] internal property of dateTimeFormat to the value of - // r.[[ca]]. - internal['[[calendar]]'] = r['[[ca]]']; - - // 13. Set the [[numberingSystem]] internal property of dateTimeFormat to the value of - // r.[[nu]]. - internal['[[numberingSystem]]'] = r['[[nu]]']; - - // The specification doesn't tell us to do this, but it's helpful later on - internal['[[dataLocale]]'] = r['[[dataLocale]]']; - - var - // 14. Let dataLocale be the value of r.[[dataLocale]]. - dataLocale = r['[[dataLocale]]'], - - // 15. Let tz be the result of calling the [[Get]] internal method of options with - // argument "timeZone". - tz = options.timeZone; - - // 16. If tz is not undefined, then - if (tz !== undefined) { - // a. Let tz be ToString(tz). - // b. Convert tz to upper case as described in 6.1. - // NOTE: If an implementation accepts additional time zone values, as permitted - // under certain conditions by the Conformance clause, different casing - // rules apply. - tz = toLatinUpperCase(tz); - - // c. If tz is not "UTC", then throw a RangeError exception. - // ###TODO: accept more time zones### - if (tz !== 'UTC') - throw new RangeError('timeZone is not supported.'); - } - - // 17. Set the [[timeZone]] internal property of dateTimeFormat to tz. - internal['[[timeZone]]'] = tz; - - // 18. Let opt be a new Record. - opt = new Record(); - - // 19. For each row of Table 3, except the header row, do: - for (var prop in dateTimeComponents) { - if (!hop.call(dateTimeComponents, prop)) - continue; - - var - // 20. Let prop be the name given in the Property column of the row. - // 21. Let value be the result of calling the GetOption abstract operation, - // passing as argument options, the name given in the Property column of the - // row, "string", a List containing the strings given in the Values column of - // the row, and undefined. - value = GetOption(options, prop, 'string', dateTimeComponents[prop]); - - // 22. Set opt.[[]] to value. - opt['[['+prop+']]'] = value; - } - - var - // Assigned a value below - bestFormat, - - // 23. Let dataLocaleData be the result of calling the [[Get]] internal method of - // localeData with argument dataLocale. - dataLocaleData = localeData[dataLocale], - - // 24. Let formats be the result of calling the [[Get]] internal method of - // dataLocaleData with argument "formats". - formats = dataLocaleData.formats, - // 25. Let matcher be the result of calling the GetOption abstract operation with - // arguments options, "formatMatcher", "string", a List containing the two String - // values "basic" and "best fit", and "best fit". - matcher = GetOption(options, 'formatMatcher', 'string', new List('basic', 'best fit'), 'best fit'); - - // 26. If matcher is "basic", then - if (matcher === 'basic') - // 27. Let bestFormat be the result of calling the BasicFormatMatcher abstract - // operation (defined below) with opt and formats. - bestFormat = BasicFormatMatcher(opt, formats); - - // 28. Else - else - // 29. Let bestFormat be the result of calling the BestFitFormatMatcher - // abstract operation (defined below) with opt and formats. - bestFormat = BestFitFormatMatcher(opt, formats); - - // 30. For each row in Table 3, except the header row, do - for (var prop in dateTimeComponents) { - if (!hop.call(dateTimeComponents, prop)) - continue; - - // a. Let prop be the name given in the Property column of the row. - // b. Let pDesc be the result of calling the [[GetOwnProperty]] internal method of - // bestFormat with argument prop. - // c. If pDesc is not undefined, then - if (hop.call(bestFormat, prop)) { - var - // i. Let p be the result of calling the [[Get]] internal method of bestFormat - // with argument prop. - p = bestFormat[prop]; - - // ii. Set the [[]] internal property of dateTimeFormat to p. - internal['[['+prop+']]'] = p; - } - } - - var - // Assigned a value below - pattern, - - // 31. Let hr12 be the result of calling the GetOption abstract operation with - // arguments options, "hour12", "boolean", undefined, and undefined. - hr12 = GetOption(options, 'hour12', 'boolean'/*, undefined, undefined*/); - - // 32. If dateTimeFormat has an internal property [[hour]], then - if (internal['[[hour]]']) { - // a. If hr12 is undefined, then let hr12 be the result of calling the [[Get]] - // internal method of dataLocaleData with argument "hour12". - hr12 = hr12 === undefined ? dataLocaleData.hour12 : hr12; - - // b. Set the [[hour12]] internal property of dateTimeFormat to hr12. - internal['[[hour12]]'] = hr12; - - // c. If hr12 is true, then - if (hr12 === true) { - var - // i. Let hourNo0 be the result of calling the [[Get]] internal method of - // dataLocaleData with argument "hourNo0". - hourNo0 = dataLocaleData.hourNo0; - - // ii. Set the [[hourNo0]] internal property of dateTimeFormat to hourNo0. - internal['[[hourNo0]]'] = hourNo0; - - // iii. Let pattern be the result of calling the [[Get]] internal method of - // bestFormat with argument "pattern12". - pattern = bestFormat.pattern12; - } - - // d. Else - else - // i. Let pattern be the result of calling the [[Get]] internal method of - // bestFormat with argument "pattern". - pattern = bestFormat.pattern; - } - - // 33. Else - else - // a. Let pattern be the result of calling the [[Get]] internal method of - // bestFormat with argument "pattern". - pattern = bestFormat.pattern; - - // 34. Set the [[pattern]] internal property of dateTimeFormat to pattern. - internal['[[pattern]]'] = pattern; - - // 35. Set the [[boundFormat]] internal property of dateTimeFormat to undefined. - internal['[[boundFormat]]'] = undefined; - - // 36. Set the [[initializedDateTimeFormat]] internal property of dateTimeFormat to - // true. - internal['[[initializedDateTimeFormat]]'] = true; - - // In ES3, we need to pre-bind the format() function - if (es3) - dateTimeFormat.format = GetFormatDateTime.call(dateTimeFormat); - - // Restore the RegExp properties - regexpState.exp.test(regexpState.input); - - // Return the newly initialised object - return dateTimeFormat; - } - - /** - * Several DateTimeFormat algorithms use values from the following table, which provides - * property names and allowable values for the components of date and time formats: - */ - var dateTimeComponents = { - weekday: [ "narrow", "short", "long" ], - era: [ "narrow", "short", "long" ], - year: [ "2-digit", "numeric" ], - month: [ "2-digit", "numeric", "narrow", "short", "long" ], - day: [ "2-digit", "numeric" ], - hour: [ "2-digit", "numeric" ], - minute: [ "2-digit", "numeric" ], - second: [ "2-digit", "numeric" ], - timeZoneName: [ "short", "long" ] - }; - - /** - * When the ToDateTimeOptions abstract operation is called with arguments options, - * required, and defaults, the following steps are taken: - */ - function ToDateTimeOptions (options, required, defaults) { - // 1. If options is undefined, then let options be null, else let options be - // ToObject(options). - if (options === undefined) - options = null; - - else { - // (#12) options needs to be a Record, but it also needs to inherit properties - var opt2 = toObject(options); - options = new Record(); - - for (var k in opt2) - options[k] = opt2[k]; - } - - var - // 2. Let create be the standard built-in function object defined in ES5, 15.2.3.5. - create = objCreate, - - // 3. Let options be the result of calling the [[Call]] internal method of create with - // undefined as the this value and an argument list containing the single item - // options. - options = create(options), - - // 4. Let needDefaults be true. - needDefaults = true; - - // 5. If required is "date" or "any", then - if (required === 'date' || required === 'any') { - // a. For each of the property names "weekday", "year", "month", "day": - // i. If the result of calling the [[Get]] internal method of options with the - // property name is not undefined, then let needDefaults be false. - if (options.weekday !== undefined || options.year !== undefined - || options.month !== undefined || options.day !== undefined) - needDefaults = false; - } - - // 6. If required is "time" or "any", then - if (required === 'time' || required === 'any') { - // a. For each of the property names "hour", "minute", "second": - // i. If the result of calling the [[Get]] internal method of options with the - // property name is not undefined, then let needDefaults be false. - if (options.hour !== undefined || options.minute !== undefined || options.second !== undefined) - needDefaults = false; - } - - // 7. If needDefaults is true and defaults is either "date" or "all", then - if (needDefaults && (defaults === 'date' || defaults === 'all')) - // a. For each of the property names "year", "month", "day": - // i. Call the [[DefineOwnProperty]] internal method of options with the - // property name, Property Descriptor {[[Value]]: "numeric", [[Writable]]: - // true, [[Enumerable]]: true, [[Configurable]]: true}, and false. - options.year = options.month = options.day = 'numeric'; - - // 8. If needDefaults is true and defaults is either "time" or "all", then - if (needDefaults && (defaults === 'time' || defaults === 'all')) - // a. For each of the property names "hour", "minute", "second": - // i. Call the [[DefineOwnProperty]] internal method of options with the - // property name, Property Descriptor {[[Value]]: "numeric", [[Writable]]: - // true, [[Enumerable]]: true, [[Configurable]]: true}, and false. - options.hour = options.minute = options.second = 'numeric'; - - // 9. Return options. - return options; - } - - /** - * When the BasicFormatMatcher abstract operation is called with two arguments options and - * formats, the following steps are taken: - */ - function BasicFormatMatcher (options, formats) { - return calculateScore(options, formats); - } - - /** - * Calculates score for BestFitFormatMatcher and BasicFormatMatcher. - * Abstracted from BasicFormatMatcher section. - */ - function calculateScore (options, formats, bestFit) { - var - // Additional penalty type when bestFit === true - diffDataTypePenalty = 8, - - // 1. Let removalPenalty be 120. - removalPenalty = 120, - - // 2. Let additionPenalty be 20. - additionPenalty = 20, - - // 3. Let longLessPenalty be 8. - longLessPenalty = 8, - - // 4. Let longMorePenalty be 6. - longMorePenalty = 6, - - // 5. Let shortLessPenalty be 6. - shortLessPenalty = 6, - - // 6. Let shortMorePenalty be 3. - shortMorePenalty = 3, - - // 7. Let bestScore be -Infinity. - bestScore = -Infinity, - - // 8. Let bestFormat be undefined. - bestFormat, - - // 9. Let i be 0. - i = 0, - - // 10. Let len be the result of calling the [[Get]] internal method of formats with argument "length". - len = formats.length; - - // 11. Repeat while i < len: - while (i < len) { - var - // a. Let format be the result of calling the [[Get]] internal method of formats with argument ToString(i). - format = formats[i], - - // b. Let score be 0. - score = 0; - - // c. For each property shown in Table 3: - for (var property in dateTimeComponents) { - if (!hop.call(dateTimeComponents, property)) - continue; - - var - // i. Let optionsProp be options.[[]]. - optionsProp = options['[['+ property +']]'], - - // ii. Let formatPropDesc be the result of calling the [[GetOwnProperty]] internal method of format - // with argument property. - // iii. If formatPropDesc is not undefined, then - // 1. Let formatProp be the result of calling the [[Get]] internal method of format with argument property. - formatProp = hop.call(format, property) ? format[property] : undefined; - - // iv. If optionsProp is undefined and formatProp is not undefined, then decrease score by - // additionPenalty. - if (optionsProp === undefined && formatProp !== undefined) - score -= additionPenalty; - - // v. Else if optionsProp is not undefined and formatProp is undefined, then decrease score by - // removalPenalty. - else if (optionsProp !== undefined && formatProp === undefined) - score -= removalPenalty; - - // vi. Else - else { - var - // 1. Let values be the array ["2-digit", "numeric", "narrow", "short", - // "long"]. - values = [ '2-digit', 'numeric', 'narrow', 'short', 'long' ], - - // 2. Let optionsPropIndex be the index of optionsProp within values. - optionsPropIndex = arrIndexOf.call(values, optionsProp), - - // 3. Let formatPropIndex be the index of formatProp within values. - formatPropIndex = arrIndexOf.call(values, formatProp), - - // 4. Let delta be max(min(formatPropIndex - optionsPropIndex, 2), -2). - delta = Math.max(Math.min(formatPropIndex - optionsPropIndex, 2), -2); - - // When the bestFit argument is true, subtract additional penalty where data types are not the same - if (bestFit && ( - ((optionsProp === 'numeric' || optionsProp === '2-digit') && (formatProp !== 'numeric' && formatProp !== '2-digit')) - || ((optionsProp !== 'numeric' && optionsProp !== '2-digit') && (formatProp === '2-digit' || formatProp === 'numeric')) - )) - score -= diffDataTypePenalty; - - // 5. If delta = 2, decrease score by longMorePenalty. - if (delta === 2) - score -= longMorePenalty; - - // 6. Else if delta = 1, decrease score by shortMorePenalty. - else if (delta === 1) - score -= shortMorePenalty; - - // 7. Else if delta = -1, decrease score by shortLessPenalty. - else if (delta === -1) - score -= shortLessPenalty; - - // 8. Else if delta = -2, decrease score by longLessPenalty. - else if (delta === -2) - score -= longLessPenalty; - } - } - - // d. If score > bestScore, then - if (score > bestScore) { - // i. Let bestScore be score. - bestScore = score; - - // ii. Let bestFormat be format. - bestFormat = format; - } - - // e. Increase i by 1. - i++; - } - - // 12. Return bestFormat. - return bestFormat; - } - - /** - * When the BestFitFormatMatcher abstract operation is called with two arguments options - * and formats, it performs implementation dependent steps, which should return a set of - * component representations that a typical user of the selected locale would perceive as - * at least as good as the one returned by BasicFormatMatcher. - * - * This polyfill defines the algorithm to be the same as BasicFormatMatcher, - * with the addition of bonus points awarded where the requested format is of - * the same data type as the potentially matching format. - * - * For example, - * - * { month: 'numeric', day: 'numeric' } - * - * should match - * - * { month: '2-digit', day: '2-digit' } - * - * rather than - * - * { month: 'short', day: 'numeric' } - * - * This makes sense because a user requesting a formatted date with numeric parts would - * not expect to see the returned format containing narrow, short or long part names - */ - function BestFitFormatMatcher (options, formats) { - return calculateScore(options, formats, true); - } - - /* 12.2.3 */internals.DateTimeFormat = { - '[[availableLocales]]': [], - '[[relevantExtensionKeys]]': ['ca', 'nu'], - '[[localeData]]': {} - }; - - /** - * When the supportedLocalesOf method of Intl.DateTimeFormat is called, the - * following steps are taken: - */ - /* 12.2.2 */defineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', { - configurable: true, - writable: true, - value: fnBind.call(supportedLocalesOf, internals.DateTimeFormat) - }); - - /** - * This named accessor property returns a function that formats a number - * according to the effective locale and the formatting options of this - * DateTimeFormat object. - */ - /* 12.3.2 */defineProperty(Intl.DateTimeFormat.prototype, 'format', { - configurable: true, - get: GetFormatDateTime - }); - - function GetFormatDateTime() { - var internal = this != null && typeof this === 'object' && getInternalProperties(this); - - // Satisfy test 12.3_b - if (!internal || !internal['[[initializedDateTimeFormat]]']) - throw new TypeError('`this` value for format() is not an initialized Intl.DateTimeFormat object.'); - - // The value of the [[Get]] attribute is a function that takes the following - // steps: - - // 1. If the [[boundFormat]] internal property of this DateTimeFormat object - // is undefined, then: - if (internal['[[boundFormat]]'] === undefined) { - var - // a. Let F be a Function object, with internal properties set as - // specified for built-in functions in ES5, 15, or successor, and the - // length property set to 0, that takes the argument date and - // performs the following steps: - F = function () { - // i. If date is not provided or is undefined, then let x be the - // result as if by the expression Date.now() where Date.now is - // the standard built-in function defined in ES5, 15.9.4.4. - // ii. Else let x be ToNumber(date). - // iii. Return the result of calling the FormatDateTime abstract - // operation (defined below) with arguments this and x. - var x = Number(arguments.length === 0 ? Date.now() : arguments[0]); - return FormatDateTime(this, x); - }, - // b. Let bind be the standard built-in function object defined in ES5, - // 15.3.4.5. - // c. Let bf be the result of calling the [[Call]] internal method of - // bind with F as the this value and an argument list containing - // the single item this. - bf = fnBind.call(F, this); - // d. Set the [[boundFormat]] internal property of this NumberFormat - // object to bf. - internal['[[boundFormat]]'] = bf; - } - // Return the value of the [[boundFormat]] internal property of this - // NumberFormat object. - return internal['[[boundFormat]]']; - } - - /** - * When the FormatDateTime abstract operation is called with arguments dateTimeFormat - * (which must be an object initialized as a DateTimeFormat) and x (which must be a Number - * value), it returns a String value representing x (interpreted as a time value as - * specified in ES5, 15.9.1.1) according to the effective locale and the formatting - * options of dateTimeFormat. - */ - function FormatDateTime(dateTimeFormat, x) { - // 1. If x is not a finite Number, then throw a RangeError exception. - if (!isFinite(x)) - throw new RangeError('Invalid valid date passed to format'); - - var - internal = dateTimeFormat.__getInternalProperties(secret), - - // Creating restore point for properties on the RegExp object... please wait - regexpState = createRegExpRestore(), - - // 2. Let locale be the value of the [[locale]] internal property of dateTimeFormat. - locale = internal['[[locale]]'], - - // 3. Let nf be the result of creating a new NumberFormat object as if by the - // expression new Intl.NumberFormat([locale], {useGrouping: false}) where - // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. - nf = new Intl.NumberFormat([locale], {useGrouping: false}), - - // 4. Let nf2 be the result of creating a new NumberFormat object as if by the - // expression new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: - // false}) where Intl.NumberFormat is the standard built-in constructor defined in - // 11.1.3. - nf2 = new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: false}), - - // 5. Let tm be the result of calling the ToLocalTime abstract operation (defined - // below) with x, the value of the [[calendar]] internal property of dateTimeFormat, - // and the value of the [[timeZone]] internal property of dateTimeFormat. - tm = ToLocalTime(x, internal['[[calendar]]'], internal['[[timeZone]]']), - - // 6. Let result be the value of the [[pattern]] internal property of dateTimeFormat. - result = internal['[[pattern]]'], - - // Need the locale minus any extensions - dataLocale = internal['[[dataLocale]]'], - - // Need the calendar data from CLDR - localeData = internals.DateTimeFormat['[[localeData]]'][dataLocale].calendars, - ca = internal['[[calendar]]']; - - // 7. For each row of Table 3, except the header row, do: - for (var p in dateTimeComponents) { - // a. If dateTimeFormat has an internal property with the name given in the - // Property column of the row, then: - if (hop.call(internal, '[['+ p +']]')) { - var - // Assigned values below - pm, fv, - - // i. Let p be the name given in the Property column of the row. - // ii. Let f be the value of the [[

]] internal property of dateTimeFormat. - f = internal['[['+ p +']]'], - - // iii. Let v be the value of tm.[[

]]. - v = tm['[['+ p +']]']; - - // iv. If p is "year" and v ≤ 0, then let v be 1 - v. - if (p === 'year' && v <= 0) - v = 1 - v; - - // v. If p is "month", then increase v by 1. - else if (p === 'month') - v++; - - // vi. If p is "hour" and the value of the [[hour12]] internal property of - // dateTimeFormat is true, then - else if (p === 'hour' && internal['[[hour12]]'] === true) { - // 1. Let v be v modulo 12. - v = v % 12; - - // 2. If v is equal to the value of tm.[[

]], then let pm be false; else - // let pm be true. - pm = v !== tm['[['+ p +']]']; - - // 3. If v is 0 and the value of the [[hourNo0]] internal property of - // dateTimeFormat is true, then let v be 12. - if (v === 0 && internal['[[hourNo0]]'] === true) - v = 12; - } - - // vii. If f is "numeric", then - if (f === 'numeric') - // 1. Let fv be the result of calling the FormatNumber abstract operation - // (defined in 11.3.2) with arguments nf and v. - fv = FormatNumber(nf, v); - - // viii. Else if f is "2-digit", then - else if (f === '2-digit') { - // 1. Let fv be the result of calling the FormatNumber abstract operation - // with arguments nf2 and v. - fv = FormatNumber(nf2, v); - - // 2. If the length of fv is greater than 2, let fv be the substring of fv - // containing the last two characters. - if (fv.length > 2) - fv = fv.slice(-2); - } - - // ix. Else if f is "narrow", "short", or "long", then let fv be a String - // value representing f in the desired form; the String value depends upon - // the implementation and the effective locale and calendar of - // dateTimeFormat. If p is "month", then the String value may also depend - // on whether dateTimeFormat has a [[day]] internal property. If p is - // "timeZoneName", then the String value may also depend on the value of - // the [[inDST]] field of tm. - else if (f in dateWidths) { - switch (p) { - case 'month': - fv = resolveDateString(localeData, ca, 'months', f, tm['[['+ p +']]']); - break; - - case 'weekday': - try { - fv = resolveDateString(localeData, ca, 'days', f, tm['[['+ p +']]']); - // fv = resolveDateString(ca.days, f)[tm['[['+ p +']]']]; - } catch (e) { - throw new Error('Could not find weekday data for locale '+locale); - } - break; - - case 'timeZoneName': - fv = ''; // TODO - break; - - // TODO: Era - default: - fv = tm['[['+ p +']]']; - } - } - - // x. Replace the substring of result that consists of "{", p, and "}", with - // fv. - result = result.replace('{'+ p +'}', fv); - } - } - // 8. If dateTimeFormat has an internal property [[hour12]] whose value is true, then - if (internal['[[hour12]]'] === true) { - // a. If pm is true, then let fv be an implementation and locale dependent String - // value representing “post meridiem”; else let fv be an implementation and - // locale dependent String value representing “ante meridiem”. - fv = resolveDateString(localeData, ca, 'dayPeriods', pm ? 'pm' : 'am'); - - // b. Replace the substring of result that consists of "{ampm}", with fv. - result = result.replace('{ampm}', fv); - } - - // Restore properties of the RegExp object - regexpState.exp.test(regexpState.input); - - // 9. Return result. - return result; - } - - /** - * When the ToLocalTime abstract operation is called with arguments date, calendar, and - * timeZone, the following steps are taken: - */ - function ToLocalTime(date, calendar, timeZone) { - // 1. Apply calendrical calculations on date for the given calendar and time zone to - // produce weekday, era, year, month, day, hour, minute, second, and inDST values. - // The calculations should use best available information about the specified - // calendar and time zone. If the calendar is "gregory", then the calculations must - // match the algorithms specified in ES5, 15.9.1, except that calculations are not - // bound by the restrictions on the use of best available information on time zones - // for local time zone adjustment and daylight saving time adjustment imposed by - // ES5, 15.9.1.7 and 15.9.1.8. - // ###TODO### - var d = new Date(date), - m = 'get' + (timeZone || ''); - - // 2. Return a Record with fields [[weekday]], [[era]], [[year]], [[month]], [[day]], - // [[hour]], [[minute]], [[second]], and [[inDST]], each with the corresponding - // calculated value. - return new Record({ - '[[weekday]]': d[m + 'Day'](), - '[[era]]' : +(d[m + 'FullYear']() >= 0), - '[[year]]' : d[m + 'FullYear'](), - '[[month]]' : d[m + 'Month'](), - '[[day]]' : d[m + 'Date'](), - '[[hour]]' : d[m + 'Hours'](), - '[[minute]]' : d[m + 'Minutes'](), - '[[second]]' : d[m + 'Seconds'](), - '[[inDST]]' : false // ###TODO### - }); - } - - /** - * The function returns a new object whose properties and attributes are set as if - * constructed by an object literal assigning to each of the following properties the - * value of the corresponding internal property of this DateTimeFormat object (see 12.4): - * locale, calendar, numberingSystem, timeZone, hour12, weekday, era, year, month, day, - * hour, minute, second, and timeZoneName. Properties whose corresponding internal - * properties are not present are not assigned. - */ - /* 12.3.3 */defineProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions', { - writable: true, - configurable: true, - value: function () { - var prop, - descs = new Record(), - props = [ - 'locale', 'calendar', 'numberingSystem', 'timeZone', 'hour12', 'weekday', - 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName' - ], - internal = this != null && typeof this === 'object' && getInternalProperties(this); - - // Satisfy test 12.3_b - if (!internal || !internal['[[initializedDateTimeFormat]]']) - throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.'); - - for (var i = 0, max = props.length; i < max; i++) { - if (hop.call(internal, prop = '[[' + props[i] + ']]')) - descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true }; - } - - return objCreate({}, descs); - } - }); - - // Sect 13 Locale Sensitive Functions of the ECMAScript Language Specification - // =========================================================================== - - var ls = Intl.__localeSensitiveProtos = { - Number: {}, - Date: {} - }; - - /** - * When the toLocaleString method is called with optional arguments locales and options, - * the following steps are taken: - */ - /* 13.2.1 */ls.Number.toLocaleString = function () { - // Satisfy test 13.2.1_1 - if (Object.prototype.toString.call(this) !== '[object Number]') - throw new TypeError('`this` value must be a number for Number.prototype.toLocaleString()'); - - // 1. Let x be this Number value (as defined in ES5, 15.7.4). - // 2. If locales is not provided, then let locales be undefined. - // 3. If options is not provided, then let options be undefined. - // 4. Let numberFormat be the result of creating a new object as if by the - // expression new Intl.NumberFormat(locales, options) where - // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. - // 5. Return the result of calling the FormatNumber abstract operation - // (defined in 11.3.2) with arguments numberFormat and x. - return FormatNumber(new NumberFormatConstructor(arguments[0], arguments[1]), this); - }; - - /** - * When the toLocaleString method is called with optional arguments locales and options, - * the following steps are taken: - */ - /* 13.3.1 */ls.Date.toLocaleString = function () { - // Satisfy test 13.3.0_1 - if (Object.prototype.toString.call(this) !== '[object Date]') - throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleString()'); - - var - // 1. Let x be this time value (as defined in ES5, 15.9.5). - x = +this; - - // 2. If x is NaN, then return "Invalid Date". - if (isNaN(x)) - return 'Invalid Date'; - - var - // 3. If locales is not provided, then let locales be undefined. - locales = arguments[0], - - // 4. If options is not provided, then let options be undefined. - options = arguments[1], - - // 5. Let options be the result of calling the ToDateTimeOptions abstract - // operation (defined in 12.1.1) with arguments options, "any", and "all". - options = ToDateTimeOptions(options, 'any', 'all'), - - // 6. Let dateTimeFormat be the result of creating a new object as if by the - // expression new Intl.DateTimeFormat(locales, options) where - // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3. - dateTimeFormat = new DateTimeFormatConstructor(locales, options); - - // 7. Return the result of calling the FormatDateTime abstract operation (defined - // in 12.3.2) with arguments dateTimeFormat and x. - return FormatDateTime(dateTimeFormat, x); - }; - - /** - * When the toLocaleDateString method is called with optional arguments locales and - * options, the following steps are taken: - */ - /* 13.3.2 */ls.Date.toLocaleDateString = function () { - // Satisfy test 13.3.0_1 - if (Object.prototype.toString.call(this) !== '[object Date]') - throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleDateString()'); - - var - // 1. Let x be this time value (as defined in ES5, 15.9.5). - x = +this; - - // 2. If x is NaN, then return "Invalid Date". - if (isNaN(x)) - return 'Invalid Date'; - - var - // 3. If locales is not provided, then let locales be undefined. - locales = arguments[0], - - // 4. If options is not provided, then let options be undefined. - options = arguments[1], - - // 5. Let options be the result of calling the ToDateTimeOptions abstract - // operation (defined in 12.1.1) with arguments options, "date", and "date". - options = ToDateTimeOptions(options, 'date', 'date'), - - // 6. Let dateTimeFormat be the result of creating a new object as if by the - // expression new Intl.DateTimeFormat(locales, options) where - // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3. - dateTimeFormat = new DateTimeFormatConstructor(locales, options); - - // 7. Return the result of calling the FormatDateTime abstract operation (defined - // in 12.3.2) with arguments dateTimeFormat and x. - return FormatDateTime(dateTimeFormat, x); - }; - - /** - * When the toLocaleTimeString method is called with optional arguments locales and - * options, the following steps are taken: - */ - /* 13.3.3 */ls.Date.toLocaleTimeString = function () { - // Satisfy test 13.3.0_1 - if (Object.prototype.toString.call(this) !== '[object Date]') - throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleTimeString()'); - - var - // 1. Let x be this time value (as defined in ES5, 15.9.5). - x = +this; - - // 2. If x is NaN, then return "Invalid Date". - if (isNaN(x)) - return 'Invalid Date'; - - var - // 3. If locales is not provided, then let locales be undefined. - locales = arguments[0], - - // 4. If options is not provided, then let options be undefined. - options = arguments[1], - - // 5. Let options be the result of calling the ToDateTimeOptions abstract - // operation (defined in 12.1.1) with arguments options, "time", and "time". - options = ToDateTimeOptions(options, 'time', 'time'), - - // 6. Let dateTimeFormat be the result of creating a new object as if by the - // expression new Intl.DateTimeFormat(locales, options) where - // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3. - dateTimeFormat = new DateTimeFormatConstructor(locales, options); - - // 7. Return the result of calling the FormatDateTime abstract operation (defined - // in 12.3.2) with arguments dateTimeFormat and x. - return FormatDateTime(dateTimeFormat, x); - }; - - defineProperty(Intl, '__applyLocaleSensitivePrototypes', { - writable: true, - configurable: true, - value: function () { - defineProperty(Number.prototype, 'toLocaleString', { writable: true, configurable: true, value: ls.Number.toLocaleString }); - - for (var k in ls.Date) { - if (hop.call(ls.Date, k)) - defineProperty(Date.prototype, k, { writable: true, configurable: true, value: ls.Date[k] }); - } - } - }); - - /** - * Can't really ship a single script with data for hundreds of locales, so we provide - * this __addLocaleData method as a means for the developer to add the data on an - * as-needed basis - */ - defineProperty(Intl, '__addLocaleData', { - value: function (data) { - if (!IsStructurallyValidLanguageTag(data.locale)) - throw new Error("Object passed doesn't identify itself with a valid language tag"); - - addLocaleData(data, data.locale); - } - }); - - function addLocaleData (data, tag) { - // Both NumberFormat and DateTimeFormat require number data, so throw if it isn't present - if (!data.number) - throw new Error("Object passed doesn't contain locale data for Intl.NumberFormat"); - - var locale, - locales = [ tag ], - parts = tag.split('-'); - - // Create fallbacks for locale data with scripts, e.g. Latn, Hans, Vaii, etc - if (parts.length > 2 && parts[1].length == 4) - arrPush.call(locales, parts[0] + '-' + parts[2]); - - while (locale = arrShift.call(locales)) { - // Add to NumberFormat internal properties as per 11.2.3 - arrPush.call(internals.NumberFormat['[[availableLocales]]'], locale); - internals.NumberFormat['[[localeData]]'][locale] = data.number; - - // ...and DateTimeFormat internal properties as per 12.2.3 - if (data.date) { - data.date.nu = data.number.nu; - arrPush.call(internals.DateTimeFormat['[[availableLocales]]'], locale); - internals.DateTimeFormat['[[localeData]]'][locale] = data.date; - } - } - - // If this is the first set of locale data added, make it the default - if (defaultLocale === undefined) - defaultLocale = tag; - - // 11.3 (the NumberFormat prototype object is an Intl.NumberFormat instance) - if (!numberFormatProtoInitialised) { - InitializeNumberFormat(Intl.NumberFormat.prototype); - numberFormatProtoInitialised = true; - } - - // 11.3 (the NumberFormat prototype object is an Intl.NumberFormat instance) - if (data.date && !dateTimeFormatProtoInitialised) { - InitializeDateTimeFormat(Intl.DateTimeFormat.prototype); - dateTimeFormatProtoInitialised = true; - } - } - - // Helper functions - // ================ - - /** - * A function to deal with the inaccuracy of calculating log10 in pre-ES6 - * JavaScript environments. Math.log(num) / Math.LN10 was responsible for - * causing issue #62. - */ - function log10Floor (n) { - // ES6 provides the more accurate Math.log10 - if (typeof Math.log10 === 'function') - return Math.floor(Math.log10(n)); - - var x = Math.round(Math.log(n) * Math.LOG10E); - return x - (Number('1e' + x) > n); - } - - /** - * A merge of the Intl.{Constructor}.supportedLocalesOf functions - * To make life easier, the function should be bound to the constructor's internal - * properties object. - */ - function supportedLocalesOf(locales) { - /*jshint validthis:true */ - - // Bound functions only have the `this` value altered if being used as a constructor, - // this lets us imitate a native function that has no constructor - if (!hop.call(this, '[[availableLocales]]')) - throw new TypeError('supportedLocalesOf() is not a constructor'); - - var - // Create an object whose props can be used to restore the values of RegExp props - regexpState = createRegExpRestore(), - - // 1. If options is not provided, then let options be undefined. - options = arguments[1], - - // 2. Let availableLocales be the value of the [[availableLocales]] internal - // property of the standard built-in object that is the initial value of - // Intl.NumberFormat. - - availableLocales = this['[[availableLocales]]'], - - // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList - // abstract operation (defined in 9.2.1) with argument locales. - requestedLocales = CanonicalizeLocaleList(locales); - - // Restore the RegExp properties - regexpState.exp.test(regexpState.input); - - // 4. Return the result of calling the SupportedLocales abstract operation - // (defined in 9.2.8) with arguments availableLocales, requestedLocales, - // and options. - return SupportedLocales(availableLocales, requestedLocales, options); - } - - /** - * Returns a string for a date component, resolved using multiple inheritance as specified - * as specified in the Unicode Technical Standard 35. - */ - function resolveDateString(data, ca, component, width, key) { - // From http://www.unicode.org/reports/tr35/tr35.html#Multiple_Inheritance: - // 'In clearly specified instances, resources may inherit from within the same locale. - // For example, ... the Buddhist calendar inherits from the Gregorian calendar.' - var obj = data[ca] && data[ca][component] - ? data[ca][component] - : data.gregory[component], - - // "sideways" inheritance resolves strings when a key doesn't exist - alts = { - narrow: ['short', 'long'], - short: ['long', 'narrow'], - long: ['short', 'narrow'] - }, - - // - resolved = hop.call(obj, width) - ? obj[width] - : hop.call(obj, alts[width][0]) - ? obj[alts[width][0]] - : obj[alts[width][1]]; - - // `key` wouldn't be specified for components 'dayPeriods' - return key != null ? resolved[key] : resolved; - } - - /** - * A map that doesn't contain Object in its prototype chain - */ - Record.prototype = objCreate(null); - function Record (obj) { - // Copy only own properties over unless this object is already a Record instance - for (var k in obj) { - if (obj instanceof Record || hop.call(obj, k)) - defineProperty(this, k, { value: obj[k], enumerable: true, writable: true, configurable: true }); - } - } - - /** - * An ordered list - */ - List.prototype = objCreate(null); - function List() { - defineProperty(this, 'length', { writable:true, value: 0 }); - - if (arguments.length) - arrPush.apply(this, arrSlice.call(arguments)); - } - - /** - * Constructs a regular expression to restore tainted RegExp properties - */ - function createRegExpRestore () { - var esc = /[.?*+^$[\]\\(){}|-]/g, - lm = RegExp.lastMatch, - ml = RegExp.multiline ? 'm' : '', - ret = { input: RegExp.input }, - reg = new List(), - has = false, - cap = {}; - - // Create a snapshot of all the 'captured' properties - for (var i = 1; i <= 9; i++) - has = (cap['$'+i] = RegExp['$'+i]) || has; - - // Now we've snapshotted some properties, escape the lastMatch string - lm = lm.replace(esc, '\\$&'); - - // If any of the captured strings were non-empty, iterate over them all - if (has) { - for (var i = 1; i <= 9; i++) { - var m = cap['$'+i]; - - // If it's empty, add an empty capturing group - if (!m) - lm = '()' + lm; - - // Else find the string in lm and escape & wrap it to capture it - else { - m = m.replace(esc, '\\$&'); - lm = lm.replace(m, '(' + m + ')'); - } - - // Push it to the reg and chop lm to make sure further groups come after - arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1)); - lm = lm.slice(lm.indexOf('(') + 1); - } - } - - // Create the regular expression that will reconstruct the RegExp properties - ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml); - - return ret; - } - - /** - * Convert only a-z to uppercase as per section 6.1 of the spec - */ - function toLatinUpperCase (str) { - var i = str.length; - - while (i--) { - var ch = str.charAt(i); - - if (ch >= "a" && ch <= "z") - str = str.slice(0, i) + ch.toUpperCase() + str.slice(i+1); - } - - return str; - } - - /** - * Mimics ES5's abstract ToObject() function - */ - function toObject (arg) { - if (arg == null) - throw new TypeError('Cannot convert null or undefined to object'); - - return Object(arg); - } - - /** - * Returns "internal" properties for an object - */ - function getInternalProperties (obj) { - if (hop.call(obj, '__getInternalProperties')) - return obj.__getInternalProperties(secret); - else - return objCreate(null); - } - - return Intl; - }); - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { - - exports.ActionMethods = __webpack_require__(69); - - exports.ListenerMethods = __webpack_require__(70); - - exports.PublisherMethods = __webpack_require__(71); - - exports.StoreMethods = __webpack_require__(72); - - exports.createAction = __webpack_require__(73); - - exports.createStore = __webpack_require__(74); - - exports.connect = __webpack_require__(75); - - exports.connectFilter = __webpack_require__(76); - - exports.ListenerMixin = __webpack_require__(77); - - exports.listenTo = __webpack_require__(78); - - exports.listenToMany = __webpack_require__(79); - - - var maker = __webpack_require__(80).staticJoinCreator; - - exports.joinTrailing = exports.all = maker("last"); // Reflux.all alias for backward compatibility - - exports.joinLeading = maker("first"); - - exports.joinStrict = maker("strict"); - - exports.joinConcat = maker("all"); - - var _ = __webpack_require__(81); - - exports.EventEmitter = _.EventEmitter; - - exports.Promise = _.Promise; - - /** - * Convenience function for creating a set of actions - * - * @param definitions the definitions for the actions to be created - * @returns an object with actions of corresponding action names - */ - exports.createActions = function(definitions) { - var actions = {}; - for (var k in definitions){ - if (definitions.hasOwnProperty(k)) { - var val = definitions[k], - actionName = _.isObject(val) ? k : val; - - actions[actionName] = exports.createAction(val); - } - } - return actions; - }; - - /** - * Sets the eventmitter that Reflux uses - */ - exports.setEventEmitter = function(ctx) { - var _ = __webpack_require__(81); - exports.EventEmitter = _.EventEmitter = ctx; - }; - - - /** - * Sets the Promise library that Reflux uses - */ - exports.setPromise = function(ctx) { - var _ = __webpack_require__(81); - exports.Promise = _.Promise = ctx; - }; - - - /** - * Sets the Promise factory that creates new promises - * @param {Function} factory has the signature `function(resolver) { return [new Promise]; }` - */ - exports.setPromiseFactory = function(factory) { - var _ = __webpack_require__(81); - _.createPromise = factory; - }; - - - /** - * Sets the method used for deferring actions and stores - */ - exports.nextTick = function(nextTick) { - var _ = __webpack_require__(81); - _.nextTick = nextTick; - }; - - /** - * Provides the set of created actions and stores for introspection - */ - exports.__keep = __webpack_require__(82); - - /** - * Warn if Function.prototype.bind not available - */ - if (!Function.prototype.bind) { - console.error( - 'Function.prototype.bind not available. ' + - 'ES5 shim required. ' + - 'https://github.com/spoike/refluxjs#es5' - ); - } - - -/***/ }, -/* 65 */ +/* 6 */ /***/ function(module, exports, __webpack_require__) { module.exports = { @@ -10090,7 +4309,7 @@ var Grommet = } /***/ }, -/* 66 */ +/* 7 */ /***/ function(module, exports, __webpack_require__) { module.exports = { @@ -11186,4870 +5405,10826 @@ var Grommet = } } -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {/* jshint node:true */ + 'use strict'; + + // Expose `React` as a global, because the ReactIntlMixin assumes it's global. + var oldReact = global.React; + global.React = __webpack_require__(2); + + // Require the lib and add all locale data to `ReactIntl`. This module will be + // ignored when bundling for the browser with Browserify/Webpack. + var ReactIntl = __webpack_require__(9); + __webpack_require__(40); + + // Export the Mixin as the default export for back-compat with v1.0.0. This will + // be changed to simply re-exporting `ReactIntl` as the default export in v2.0. + exports = module.exports = ReactIntl.IntlMixin; + + // Define non-enumerable expandos for each named export on the default export -- + // which is the Mixin for back-compat with v1.0.0. + Object.keys(ReactIntl).forEach(function (namedExport) { + Object.defineProperty(exports, namedExport, { + enumerable: true, + value : ReactIntl[namedExport] + }); + }); + + // Put back `global.React` to how it was. + if (oldReact) { + global.React = oldReact; + } else { + // IE < 9 will throw when trying to delete something off the global object, + // `window`, so this does the next best thing as sets it to `undefined`. + try { + delete global.React; + } catch (e) { + global.React = undefined; + } + } + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext: true */ + + "use strict"; + exports.__addLocaleData = __addLocaleData; + var intl$messageformat$$ = __webpack_require__(13), intl$relativeformat$$ = __webpack_require__(23), src$en$$ = __webpack_require__(33), src$mixin$$ = __webpack_require__(12), src$components$date$$ = __webpack_require__(34), src$components$time$$ = __webpack_require__(10), src$components$relative$$ = __webpack_require__(35), src$components$number$$ = __webpack_require__(36), src$components$message$$ = __webpack_require__(37), src$components$html$message$$ = __webpack_require__(38); + function __addLocaleData(data) { + intl$messageformat$$["default"].__addLocaleData(data); + intl$relativeformat$$["default"].__addLocaleData(data); + } + + __addLocaleData(src$en$$["default"]); + exports.IntlMixin = src$mixin$$["default"], exports.FormattedDate = src$components$date$$["default"], exports.FormattedTime = src$components$time$$["default"], exports.FormattedRelative = src$components$relative$$["default"], exports.FormattedNumber = src$components$number$$["default"], exports.FormattedMessage = src$components$message$$["default"], exports.FormattedHTMLMessage = src$components$html$message$$["default"]; + + //# sourceMappingURL=react-intl.js.map + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), src$mixin$$ = __webpack_require__(12); + + var FormattedTime = src$react$$["default"].createClass({ + displayName: 'FormattedTime', + mixins : [src$mixin$$["default"]], + + statics: { + formatOptions: [ + 'localeMatcher', 'timeZone', 'hour12', 'formatMatcher', 'weekday', + 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', + 'timeZoneName' + ] + }, + + propTypes: { + format: src$react$$["default"].PropTypes.string, + value : src$react$$["default"].PropTypes.any.isRequired + }, + + render: function () { + var props = this.props; + var value = props.value; + var format = props.format; + var defaults = format && this.getNamedFormat('time', format); + var options = FormattedTime.filterFormatOptions(props, defaults); + + return src$react$$["default"].DOM.span(null, this.formatTime(value, options)); + } + }); + + exports["default"] = FormattedTime; + + //# sourceMappingURL=time.js.map + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + /* global React */ + /* jshint esnext:true */ + + // TODO: Remove the global `React` binding lookup once the ES6 Module Transpiler + // supports external modules. This is a hack for now that provides the local + // modules a referece to React. + "use strict"; + exports["default"] = React; + + //# sourceMappingURL=react.js.map + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), intl$messageformat$$ = __webpack_require__(13), intl$relativeformat$$ = __webpack_require__(23), intl$format$cache$$ = __webpack_require__(30); + + // ----------------------------------------------------------------------------- + + var typesSpec = { + locales: src$react$$["default"].PropTypes.oneOfType([ + src$react$$["default"].PropTypes.string, + src$react$$["default"].PropTypes.array + ]), + + formats : src$react$$["default"].PropTypes.object, + messages: src$react$$["default"].PropTypes.object + }; + + function assertIsDate(date, errMsg) { + // Determine if the `date` is valid by checking if it is finite, which is + // the same way that `Intl.DateTimeFormat#format()` checks. + if (!isFinite(date)) { + throw new TypeError(errMsg); + } + } + + exports["default"] = { + statics: { + filterFormatOptions: function (obj, defaults) { + if (!defaults) { defaults = {}; } + + return (this.formatOptions || []).reduce(function (opts, name) { + if (obj.hasOwnProperty(name)) { + opts[name] = obj[name]; + } else if (defaults.hasOwnProperty(name)) { + opts[name] = defaults[name]; + } + + return opts; + }, {}); + } + }, + + propTypes : typesSpec, + contextTypes : typesSpec, + childContextTypes: typesSpec, + + getNumberFormat : intl$format$cache$$["default"](Intl.NumberFormat), + getDateTimeFormat: intl$format$cache$$["default"](Intl.DateTimeFormat), + getMessageFormat : intl$format$cache$$["default"](intl$messageformat$$["default"]), + getRelativeFormat: intl$format$cache$$["default"](intl$relativeformat$$["default"]), + + getChildContext: function () { + var context = this.context; + var props = this.props; + + return { + locales: props.locales || context.locales, + formats: props.formats || context.formats, + messages: props.messages || context.messages + }; + }, + + formatDate: function (date, options) { + date = new Date(date); + assertIsDate(date, 'A date or timestamp must be provided to formatDate()'); + return this._format('date', date, options); + }, + + formatTime: function (date, options) { + date = new Date(date); + assertIsDate(date, 'A date or timestamp must be provided to formatTime()'); + return this._format('time', date, options); + }, + + formatRelative: function (date, options, formatOptions) { + date = new Date(date); + assertIsDate(date, 'A date or timestamp must be provided to formatRelative()'); + return this._format('relative', date, options, formatOptions); + }, + + formatNumber: function (num, options) { + return this._format('number', num, options); + }, + + formatMessage: function (message, values) { + var locales = this.props.locales || this.context.locales; + var formats = this.props.formats || this.context.formats; + + // When `message` is a function, assume it's an IntlMessageFormat + // instance's `format()` method passed by reference, and call it. This + // is possible because its `this` will be pre-bound to the instance. + if (typeof message === 'function') { + return message(values); + } + + if (typeof message === 'string') { + message = this.getMessageFormat(message, locales, formats); + } + + return message.format(values); + }, + + getIntlMessage: function (path) { + var messages = this.props.messages || this.context.messages; + var pathParts = path.split('.'); + + var message; + + try { + message = pathParts.reduce(function (obj, pathPart) { + return obj[pathPart]; + }, messages); + } finally { + if (message === undefined) { + throw new ReferenceError('Could not find Intl message: ' + path); + } + } + + return message; + }, + + getNamedFormat: function (type, name) { + var formats = this.props.formats || this.context.formats; + var format = null; + + try { + format = formats[type][name]; + } finally { + if (!format) { + throw new ReferenceError( + 'No ' + type + ' format named: ' + name + ); + } + } + + return format; + }, + + _format: function (type, value, options, formatOptions) { + var locales = this.props.locales || this.context.locales; + + if (options && typeof options === 'string') { + options = this.getNamedFormat(type, options); + } + + switch(type) { + case 'date': + case 'time': + return this.getDateTimeFormat(locales, options).format(value); + case 'number': + return this.getNumberFormat(locales, options).format(value); + case 'relative': + return this.getRelativeFormat(locales, options).format(value, formatOptions); + default: + throw new Error('Unrecognized format type: ' + type); + } + } + }; + + //# sourceMappingURL=mixin.js.map + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint node:true */ + + 'use strict'; + + var IntlMessageFormat = __webpack_require__(14)['default']; + + // Add all locale data to `IntlMessageFormat`. This module will be ignored when + // bundling for the browser with Browserify/Webpack. + __webpack_require__(22); + + // Re-export `IntlMessageFormat` as the CommonJS default exports with all the + // locale data registered, and with English set as the default locale. Define + // the `default` prop for use with other compiled ES6 Modules. + exports = module.exports = IntlMessageFormat; + exports['default'] = exports; + + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + /* jslint esnext: true */ + + "use strict"; + var src$core$$ = __webpack_require__(15), src$en$$ = __webpack_require__(21); + + src$core$$["default"].__addLocaleData(src$en$$["default"]); + src$core$$["default"].defaultLocale = 'en'; + + exports["default"] = src$core$$["default"]; + + //# sourceMappingURL=main.js.map + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + var src$utils$$ = __webpack_require__(16), src$es5$$ = __webpack_require__(17), src$compiler$$ = __webpack_require__(18), intl$messageformat$parser$$ = __webpack_require__(19); + exports["default"] = MessageFormat; + + // -- MessageFormat -------------------------------------------------------- + + function MessageFormat(message, locales, formats) { + // Parse string messages into an AST. + var ast = typeof message === 'string' ? + MessageFormat.__parse(message) : message; + + if (!(ast && ast.type === 'messageFormatPattern')) { + throw new TypeError('A message must be provided as a String or AST.'); + } + + // Creates a new object with the specified `formats` merged with the default + // formats. + formats = this._mergeFormats(MessageFormat.formats, formats); + + // Defined first because it's used to build the format pattern. + src$es5$$.defineProperty(this, '_locale', {value: this._resolveLocale(locales)}); + + // Compile the `ast` to a pattern that is highly optimized for repeated + // `format()` invocations. **Note:** This passes the `locales` set provided + // to the constructor instead of just the resolved locale. + var pluralFn = this._findPluralRuleFunction(this._locale); + var pattern = this._compilePattern(ast, locales, formats, pluralFn); + + // "Bind" `format()` method to `this` so it can be passed by reference like + // the other `Intl` APIs. + var messageFormat = this; + this.format = function (values) { + return messageFormat._format(pattern, values); + }; + } + + // Default format options used as the prototype of the `formats` provided to the + // constructor. These are used when constructing the internal Intl.NumberFormat + // and Intl.DateTimeFormat instances. + src$es5$$.defineProperty(MessageFormat, 'formats', { + enumerable: true, + + value: { + number: { + 'currency': { + style: 'currency' + }, + + 'percent': { + style: 'percent' + } + }, + + date: { + 'short': { + month: 'numeric', + day : 'numeric', + year : '2-digit' + }, + + 'medium': { + month: 'short', + day : 'numeric', + year : 'numeric' + }, + + 'long': { + month: 'long', + day : 'numeric', + year : 'numeric' + }, + + 'full': { + weekday: 'long', + month : 'long', + day : 'numeric', + year : 'numeric' + } + }, + + time: { + 'short': { + hour : 'numeric', + minute: 'numeric' + }, + + 'medium': { + hour : 'numeric', + minute: 'numeric', + second: 'numeric' + }, + + 'long': { + hour : 'numeric', + minute : 'numeric', + second : 'numeric', + timeZoneName: 'short' + }, + + 'full': { + hour : 'numeric', + minute : 'numeric', + second : 'numeric', + timeZoneName: 'short' + } + } + } + }); + + // Define internal private properties for dealing with locale data. + src$es5$$.defineProperty(MessageFormat, '__localeData__', {value: src$es5$$.objCreate(null)}); + src$es5$$.defineProperty(MessageFormat, '__addLocaleData', {value: function (data) { + if (!(data && data.locale)) { + throw new Error( + 'Locale data provided to IntlMessageFormat is missing a ' + + '`locale` property' + ); + } + + MessageFormat.__localeData__[data.locale.toLowerCase()] = data; + }}); + + // Defines `__parse()` static method as an exposed private. + src$es5$$.defineProperty(MessageFormat, '__parse', {value: intl$messageformat$parser$$["default"].parse}); + + // Define public `defaultLocale` property which defaults to English, but can be + // set by the developer. + src$es5$$.defineProperty(MessageFormat, 'defaultLocale', { + enumerable: true, + writable : true, + value : undefined + }); + + MessageFormat.prototype.resolvedOptions = function () { + // TODO: Provide anything else? + return { + locale: this._locale + }; + }; + + MessageFormat.prototype._compilePattern = function (ast, locales, formats, pluralFn) { + var compiler = new src$compiler$$["default"](locales, formats, pluralFn); + return compiler.compile(ast); + }; + + MessageFormat.prototype._findPluralRuleFunction = function (locale) { + var localeData = MessageFormat.__localeData__; + var data = localeData[locale.toLowerCase()]; + + // The locale data is de-duplicated, so we have to traverse the locale's + // hierarchy until we find a `pluralRuleFunction` to return. + while (data) { + if (data.pluralRuleFunction) { + return data.pluralRuleFunction; + } + + data = data.parentLocale && localeData[data.parentLocale.toLowerCase()]; + } + + throw new Error( + 'Locale data added to IntlMessageFormat is missing a ' + + '`pluralRuleFunction` for :' + locale + ); + }; + + MessageFormat.prototype._format = function (pattern, values) { + var result = '', + i, len, part, id, value; + + for (i = 0, len = pattern.length; i < len; i += 1) { + part = pattern[i]; + + // Exist early for string parts. + if (typeof part === 'string') { + result += part; + continue; + } + + id = part.id; + + // Enforce that all required values are provided by the caller. + if (!(values && src$utils$$.hop.call(values, id))) { + throw new Error('A value must be provided for: ' + id); + } + + value = values[id]; + + // Recursively format plural and select parts' option — which can be a + // nested pattern structure. The choosing of the option to use is + // abstracted-by and delegated-to the part helper object. + if (part.options) { + result += this._format(part.getOption(value), values); + } else { + result += part.format(value); + } + } + + return result; + }; + + MessageFormat.prototype._mergeFormats = function (defaults, formats) { + var mergedFormats = {}, + type, mergedType; + + for (type in defaults) { + if (!src$utils$$.hop.call(defaults, type)) { continue; } + + mergedFormats[type] = mergedType = src$es5$$.objCreate(defaults[type]); + + if (formats && src$utils$$.hop.call(formats, type)) { + src$utils$$.extend(mergedType, formats[type]); + } + } + + return mergedFormats; + }; + + MessageFormat.prototype._resolveLocale = function (locales) { + if (typeof locales === 'string') { + locales = [locales]; + } + + // Create a copy of the array so we can push on the default locale. + locales = (locales || []).concat(MessageFormat.defaultLocale); + + var localeData = MessageFormat.__localeData__; + var i, len, localeParts, data; + + // Using the set of locales + the default locale, we look for the first one + // which that has been registered. When data does not exist for a locale, we + // traverse its ancestors to find something that's been registered within + // its hierarchy of locales. Since we lack the proper `parentLocale` data + // here, we must take a naive approach to traversal. + for (i = 0, len = locales.length; i < len; i += 1) { + localeParts = locales[i].toLowerCase().split('-'); + + while (localeParts.length) { + data = localeData[localeParts.join('-')]; + if (data) { + // Return the normalized locale string; e.g., we return "en-US", + // instead of "en-us". + return data.locale; + } + + localeParts.pop(); + } + } + + var defaultLocale = locales.pop(); + throw new Error( + 'No locale data has been added to IntlMessageFormat for: ' + + locales.join(', ') + ', or the default locale: ' + defaultLocale + ); + }; + + //# sourceMappingURL=core.js.map + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + exports.extend = extend; + var hop = Object.prototype.hasOwnProperty; + + function extend(obj) { + var sources = Array.prototype.slice.call(arguments, 1), + i, len, source, key; + + for (i = 0, len = sources.length; i < len; i += 1) { + source = sources[i]; + if (!source) { continue; } + + for (key in source) { + if (hop.call(source, key)) { + obj[key] = source[key]; + } + } + } + + return obj; + } + exports.hop = hop; + + //# sourceMappingURL=utils.js.map + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + var src$utils$$ = __webpack_require__(16); + + // Purposely using the same implementation as the Intl.js `Intl` polyfill. + // Copyright 2013 Andy Earnshaw, MIT License + + var realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(); + + var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + + var defineProperty = realDefineProp ? Object.defineProperty : + function (obj, name, desc) { + + if ('get' in desc && obj.__defineGetter__) { + obj.__defineGetter__(name, desc.get); + } else if (!src$utils$$.hop.call(obj, name) || 'value' in desc) { + obj[name] = desc.value; + } + }; + + var objCreate = Object.create || function (proto, props) { + var obj, k; + + function F() {} + F.prototype = proto; + obj = new F(); + + for (k in props) { + if (src$utils$$.hop.call(props, k)) { + defineProperty(obj, k, props[k]); + } + } + + return obj; + }; + exports.defineProperty = defineProperty, exports.objCreate = objCreate; + + //# sourceMappingURL=es5.js.map + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + exports["default"] = Compiler; + + function Compiler(locales, formats, pluralFn) { + this.locales = locales; + this.formats = formats; + this.pluralFn = pluralFn; + } + + Compiler.prototype.compile = function (ast) { + this.pluralStack = []; + this.currentPlural = null; + this.pluralNumberFormat = null; + + return this.compileMessage(ast); + }; + + Compiler.prototype.compileMessage = function (ast) { + if (!(ast && ast.type === 'messageFormatPattern')) { + throw new Error('Message AST is not of type: "messageFormatPattern"'); + } + + var elements = ast.elements, + pattern = []; + + var i, len, element; + + for (i = 0, len = elements.length; i < len; i += 1) { + element = elements[i]; + + switch (element.type) { + case 'messageTextElement': + pattern.push(this.compileMessageText(element)); + break; + + case 'argumentElement': + pattern.push(this.compileArgument(element)); + break; + + default: + throw new Error('Message element does not have a valid type'); + } + } + + return pattern; + }; + + Compiler.prototype.compileMessageText = function (element) { + // When this `element` is part of plural sub-pattern and its value contains + // an unescaped '#', use a `PluralOffsetString` helper to properly output + // the number with the correct offset in the string. + if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) { + // Create a cache a NumberFormat instance that can be reused for any + // PluralOffsetString instance in this message. + if (!this.pluralNumberFormat) { + this.pluralNumberFormat = new Intl.NumberFormat(this.locales); + } + + return new PluralOffsetString( + this.currentPlural.id, + this.currentPlural.format.offset, + this.pluralNumberFormat, + element.value); + } + + // Unescape the escaped '#'s in the message text. + return element.value.replace(/\\#/g, '#'); + }; + + Compiler.prototype.compileArgument = function (element) { + var format = element.format; + + if (!format) { + return new StringFormat(element.id); + } + + var formats = this.formats, + locales = this.locales, + pluralFn = this.pluralFn, + options; + + switch (format.type) { + case 'numberFormat': + options = formats.number[format.style]; + return { + id : element.id, + format: new Intl.NumberFormat(locales, options).format + }; + + case 'dateFormat': + options = formats.date[format.style]; + return { + id : element.id, + format: new Intl.DateTimeFormat(locales, options).format + }; + + case 'timeFormat': + options = formats.time[format.style]; + return { + id : element.id, + format: new Intl.DateTimeFormat(locales, options).format + }; + + case 'pluralFormat': + options = this.compileOptions(element); + return new PluralFormat( + element.id, format.ordinal, format.offset, options, pluralFn + ); + + case 'selectFormat': + options = this.compileOptions(element); + return new SelectFormat(element.id, options); + + default: + throw new Error('Message element does not have a valid format type'); + } + }; + + Compiler.prototype.compileOptions = function (element) { + var format = element.format, + options = format.options, + optionsHash = {}; + + // Save the current plural element, if any, then set it to a new value when + // compiling the options sub-patterns. This conforms the spec's algorithm + // for handling `"#"` syntax in message text. + this.pluralStack.push(this.currentPlural); + this.currentPlural = format.type === 'pluralFormat' ? element : null; + + var i, len, option; + + for (i = 0, len = options.length; i < len; i += 1) { + option = options[i]; + + // Compile the sub-pattern and save it under the options's selector. + optionsHash[option.selector] = this.compileMessage(option.value); + } + + // Pop the plural stack to put back the original current plural value. + this.currentPlural = this.pluralStack.pop(); + + return optionsHash; + }; + + // -- Compiler Helper Classes -------------------------------------------------- + + function StringFormat(id) { + this.id = id; + } + + StringFormat.prototype.format = function (value) { + if (!value) { + return ''; + } + + return typeof value === 'string' ? value : String(value); + }; + + function PluralFormat(id, useOrdinal, offset, options, pluralFn) { + this.id = id; + this.useOrdinal = useOrdinal; + this.offset = offset; + this.options = options; + this.pluralFn = pluralFn; + } + + PluralFormat.prototype.getOption = function (value) { + var options = this.options; + + var option = options['=' + value] || + options[this.pluralFn(value - this.offset, this.useOrdinal)]; + + return option || options.other; + }; + + function PluralOffsetString(id, offset, numberFormat, string) { + this.id = id; + this.offset = offset; + this.numberFormat = numberFormat; + this.string = string; + } + + PluralOffsetString.prototype.format = function (value) { + var number = this.numberFormat.format(value - this.offset); + + return this.string + .replace(/(^|[^\\])#/g, '$1' + number) + .replace(/\\#/g, '#'); + }; + + function SelectFormat(id, options) { + this.id = id; + this.options = options; + } + + SelectFormat.prototype.getOption = function (value) { + var options = this.options; + return options[value] || options.other; + }; + + //# sourceMappingURL=compiler.js.map + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports = module.exports = __webpack_require__(20)['default']; + exports['default'] = exports; + + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + exports["default"] = (function() { + /* + * Generated by PEG.js 0.8.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(message, expected, found, offset, line, column) { + this.message = message; + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$FAILED = {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = [], + peg$c1 = function(elements) { + return { + type : 'messageFormatPattern', + elements: elements + }; + }, + peg$c2 = peg$FAILED, + peg$c3 = function(text) { + var string = '', + i, j, outerLen, inner, innerLen; + + for (i = 0, outerLen = text.length; i < outerLen; i += 1) { + inner = text[i]; + + for (j = 0, innerLen = inner.length; j < innerLen; j += 1) { + string += inner[j]; + } + } + + return string; + }, + peg$c4 = function(messageText) { + return { + type : 'messageTextElement', + value: messageText + }; + }, + peg$c5 = /^[^ \t\n\r,.+={}#]/, + peg$c6 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" }, + peg$c7 = "{", + peg$c8 = { type: "literal", value: "{", description: "\"{\"" }, + peg$c9 = null, + peg$c10 = ",", + peg$c11 = { type: "literal", value: ",", description: "\",\"" }, + peg$c12 = "}", + peg$c13 = { type: "literal", value: "}", description: "\"}\"" }, + peg$c14 = function(id, format) { + return { + type : 'argumentElement', + id : id, + format: format && format[2] + }; + }, + peg$c15 = "number", + peg$c16 = { type: "literal", value: "number", description: "\"number\"" }, + peg$c17 = "date", + peg$c18 = { type: "literal", value: "date", description: "\"date\"" }, + peg$c19 = "time", + peg$c20 = { type: "literal", value: "time", description: "\"time\"" }, + peg$c21 = function(type, style) { + return { + type : type + 'Format', + style: style && style[2] + }; + }, + peg$c22 = "plural", + peg$c23 = { type: "literal", value: "plural", description: "\"plural\"" }, + peg$c24 = function(pluralStyle) { + return { + type : pluralStyle.type, + ordinal: false, + offset : pluralStyle.offset || 0, + options: pluralStyle.options + }; + }, + peg$c25 = "selectordinal", + peg$c26 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" }, + peg$c27 = function(pluralStyle) { + return { + type : pluralStyle.type, + ordinal: true, + offset : pluralStyle.offset || 0, + options: pluralStyle.options + } + }, + peg$c28 = "select", + peg$c29 = { type: "literal", value: "select", description: "\"select\"" }, + peg$c30 = function(options) { + return { + type : 'selectFormat', + options: options + }; + }, + peg$c31 = "=", + peg$c32 = { type: "literal", value: "=", description: "\"=\"" }, + peg$c33 = function(selector, pattern) { + return { + type : 'optionalFormatPattern', + selector: selector, + value : pattern + }; + }, + peg$c34 = "offset:", + peg$c35 = { type: "literal", value: "offset:", description: "\"offset:\"" }, + peg$c36 = function(number) { + return number; + }, + peg$c37 = function(offset, options) { + return { + type : 'pluralFormat', + offset : offset, + options: options + }; + }, + peg$c38 = { type: "other", description: "whitespace" }, + peg$c39 = /^[ \t\n\r]/, + peg$c40 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, + peg$c41 = { type: "other", description: "optionalWhitespace" }, + peg$c42 = /^[0-9]/, + peg$c43 = { type: "class", value: "[0-9]", description: "[0-9]" }, + peg$c44 = /^[0-9a-f]/i, + peg$c45 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, + peg$c46 = "0", + peg$c47 = { type: "literal", value: "0", description: "\"0\"" }, + peg$c48 = /^[1-9]/, + peg$c49 = { type: "class", value: "[1-9]", description: "[1-9]" }, + peg$c50 = function(digits) { + return parseInt(digits, 10); + }, + peg$c51 = /^[^{}\\\0-\x1F \t\n\r]/, + peg$c52 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" }, + peg$c53 = "\\#", + peg$c54 = { type: "literal", value: "\\#", description: "\"\\\\#\"" }, + peg$c55 = function() { return '\\#'; }, + peg$c56 = "\\{", + peg$c57 = { type: "literal", value: "\\{", description: "\"\\\\{\"" }, + peg$c58 = function() { return '\u007B'; }, + peg$c59 = "\\}", + peg$c60 = { type: "literal", value: "\\}", description: "\"\\\\}\"" }, + peg$c61 = function() { return '\u007D'; }, + peg$c62 = "\\u", + peg$c63 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, + peg$c64 = function(digits) { + return String.fromCharCode(parseInt(digits, 16)); + }, + peg$c65 = function(chars) { return chars.join(''); }, + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function expected(description) { + throw peg$buildException( + null, + [{ type: "other", description: description }], + peg$reportedPos + ); + } + + function error(message) { + throw peg$buildException(message, null, peg$reportedPos); + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildException(message, expected, pos) { + function cleanupExpected(expected) { + var i = 1; + + expected.sort(function(a, b) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } else { + return 0; + } + }); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDescs = new Array(expected.length), + expectedDesc, foundDesc, i; + + for (i = 0; i < expected.length; i++) { + expectedDescs[i] = expected[i].description; + } + + expectedDesc = expected.length > 1 + ? expectedDescs.slice(0, -1).join(", ") + + " or " + + expectedDescs[expected.length - 1] + : expectedDescs[0]; + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + var posDetails = peg$computePosDetails(pos), + found = pos < input.length ? input.charAt(pos) : null; + + if (expected !== null) { + cleanupExpected(expected); + } + + return new SyntaxError( + message !== null ? message : buildMessage(expected, found), + expected, + found, + pos, + posDetails.line, + posDetails.column + ); + } + + function peg$parsestart() { + var s0; + + s0 = peg$parsemessageFormatPattern(); + + return s0; + } + + function peg$parsemessageFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsemessageFormatElement(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsemessageFormatElement(); + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c1(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsemessageFormatElement() { + var s0; + + s0 = peg$parsemessageTextElement(); + if (s0 === peg$FAILED) { + s0 = peg$parseargumentElement(); + } + + return s0; + } + + function peg$parsemessageText() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parsechars(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parsechars(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c3(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsews(); + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parsemessageTextElement() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsemessageText(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c4(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseargument() { + var s0, s1, s2; + + s0 = peg$parsenumber(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + if (peg$c5.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c5.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseargumentElement() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseargument(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s6 = peg$c10; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + s8 = peg$parseelementFormat(); + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$c2; + } + } else { + peg$currPos = s5; + s5 = peg$c2; + } + } else { + peg$currPos = s5; + s5 = peg$c2; + } + if (s5 === peg$FAILED) { + s5 = peg$c9; + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s7 = peg$c12; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c14(s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseelementFormat() { + var s0; + + s0 = peg$parsesimpleFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parsepluralFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parseselectOrdinalFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parseselectFormat(); + } + } + } + + return s0; + } + + function peg$parsesimpleFormat() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c15) { + s1 = peg$c15; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s1 === peg$FAILED) { + if (input.substr(peg$currPos, 4) === peg$c17) { + s1 = peg$c17; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 === peg$FAILED) { + if (input.substr(peg$currPos, 4) === peg$c19) { + s1 = peg$c19; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c10; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsechars(); + if (s6 !== peg$FAILED) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 === peg$FAILED) { + s3 = peg$c9; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c21(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralFormat() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c22) { + s1 = peg$c22; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c10; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsepluralStyle(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c24(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseselectOrdinalFormat() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 13) === peg$c25) { + s1 = peg$c25; + peg$currPos += 13; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c10; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsepluralStyle(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c27(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseselectFormat() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c28) { + s1 = peg$c28; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c29); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c10; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseoptionalFormatPattern(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseoptionalFormatPattern(); + } + } else { + s5 = peg$c2; + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c30(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseselector() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c31; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c32); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsenumber(); + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$parsechars(); + } + + return s0; + } + + function peg$parseoptionalFormatPattern() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseselector(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 123) { + s4 = peg$c7; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsemessageFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s8 = peg$c12; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s8 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseoffset() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 7) === peg$c34) { + s1 = peg$c34; + peg$currPos += 7; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c35); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsenumber(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c36(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralStyle() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseoffset(); + if (s1 === peg$FAILED) { + s1 = peg$c9; + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseoptionalFormatPattern(); + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseoptionalFormatPattern(); + } + } else { + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsews() { + var s0, s1; + + peg$silentFails++; + s0 = []; + if (peg$c39.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c40); } + } + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + if (peg$c39.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c40); } + } + } + } else { + s0 = peg$c2; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c38); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsews(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsews(); + } + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + + return s0; + } + + function peg$parsedigit() { + var s0; + + if (peg$c42.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + + return s0; + } + + function peg$parsehexDigit() { + var s0; + + if (peg$c44.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsenumber() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c46; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s1 === peg$FAILED) { + s1 = peg$currPos; + s2 = peg$currPos; + if (peg$c48.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsedigit(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsedigit(); + } + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c50(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsechar() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + if (peg$c51.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c53) { + s1 = peg$c53; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c55(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c56) { + s1 = peg$c56; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c58(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c59) { + s1 = peg$c59; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c61(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c62) { + s1 = peg$c62; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parsehexDigit(); + if (s4 !== peg$FAILED) { + s5 = peg$parsehexDigit(); + if (s5 !== peg$FAILED) { + s6 = peg$parsehexDigit(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehexDigit(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c64(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + } + + return s0; + } + + function peg$parsechars() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechar(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechar(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + s0 = s1; + + return s0; + } + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail({ type: "end", description: "end of input" }); + } + + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + } + } + + return { + SyntaxError: SyntaxError, + parse: parse + }; + })(); + + //# sourceMappingURL=parser.js.map + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + // GENERATED FILE + "use strict"; + exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}; + + //# sourceMappingURL=en.js.map + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + /* (ignored) */ + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint node:true */ + + 'use strict'; + + var IntlRelativeFormat = __webpack_require__(24)['default']; + + // Add all locale data to `IntlRelativeFormat`. This module will be ignored when + // bundling for the browser with Browserify/Webpack. + __webpack_require__(29); + + // Re-export `IntlRelativeFormat` as the CommonJS default exports with all the + // locale data registered, and with English set as the default locale. Define + // the `default` prop for use with other compiled ES6 Modules. + exports = module.exports = IntlRelativeFormat; + exports['default'] = exports; + + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + /* jslint esnext: true */ + + "use strict"; + var src$core$$ = __webpack_require__(25), src$en$$ = __webpack_require__(28); + + src$core$$["default"].__addLocaleData(src$en$$["default"]); + src$core$$["default"].defaultLocale = 'en'; + + exports["default"] = src$core$$["default"]; + + //# sourceMappingURL=main.js.map + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + var intl$messageformat$$ = __webpack_require__(13), src$diff$$ = __webpack_require__(26), src$es5$$ = __webpack_require__(27); + exports["default"] = RelativeFormat; + + // ----------------------------------------------------------------------------- + + var FIELDS = ['second', 'minute', 'hour', 'day', 'month', 'year']; + var STYLES = ['best fit', 'numeric']; + + // -- RelativeFormat ----------------------------------------------------------- + + function RelativeFormat(locales, options) { + options = options || {}; + + // Make a copy of `locales` if it's an array, so that it doesn't change + // since it's used lazily. + if (src$es5$$.isArray(locales)) { + locales = locales.concat(); + } + + src$es5$$.defineProperty(this, '_locale', {value: this._resolveLocale(locales)}); + src$es5$$.defineProperty(this, '_options', {value: { + style: this._resolveStyle(options.style), + units: this._isValidUnits(options.units) && options.units + }}); + + src$es5$$.defineProperty(this, '_locales', {value: locales}); + src$es5$$.defineProperty(this, '_fields', {value: this._findFields(this._locale)}); + src$es5$$.defineProperty(this, '_messages', {value: src$es5$$.objCreate(null)}); + + // "Bind" `format()` method to `this` so it can be passed by reference like + // the other `Intl` APIs. + var relativeFormat = this; + this.format = function format(date, options) { + return relativeFormat._format(date, options); + }; + } + + // Define internal private properties for dealing with locale data. + src$es5$$.defineProperty(RelativeFormat, '__localeData__', {value: src$es5$$.objCreate(null)}); + src$es5$$.defineProperty(RelativeFormat, '__addLocaleData', {value: function (data) { + if (!(data && data.locale)) { + throw new Error( + 'Locale data provided to IntlRelativeFormat is missing a ' + + '`locale` property value' + ); + } + + RelativeFormat.__localeData__[data.locale.toLowerCase()] = data; + + // Add data to IntlMessageFormat. + intl$messageformat$$["default"].__addLocaleData(data); + }}); + + // Define public `defaultLocale` property which can be set by the developer, or + // it will be set when the first RelativeFormat instance is created by + // leveraging the resolved locale from `Intl`. + src$es5$$.defineProperty(RelativeFormat, 'defaultLocale', { + enumerable: true, + writable : true, + value : undefined + }); + + // Define public `thresholds` property which can be set by the developer, and + // defaults to relative time thresholds from moment.js. + src$es5$$.defineProperty(RelativeFormat, 'thresholds', { + enumerable: true, + + value: { + second: 45, // seconds to minute + minute: 45, // minutes to hour + hour : 22, // hours to day + day : 26, // days to month + month : 11 // months to year + } + }); + + RelativeFormat.prototype.resolvedOptions = function () { + return { + locale: this._locale, + style : this._options.style, + units : this._options.units + }; + }; + + RelativeFormat.prototype._compileMessage = function (units) { + // `this._locales` is the original set of locales the user specified to the + // constructor, while `this._locale` is the resolved root locale. + var locales = this._locales; + var resolvedLocale = this._locale; + + var field = this._fields[units]; + var relativeTime = field.relativeTime; + var future = ''; + var past = ''; + var i; + + for (i in relativeTime.future) { + if (relativeTime.future.hasOwnProperty(i)) { + future += ' ' + i + ' {' + + relativeTime.future[i].replace('{0}', '#') + '}'; + } + } + + for (i in relativeTime.past) { + if (relativeTime.past.hasOwnProperty(i)) { + past += ' ' + i + ' {' + + relativeTime.past[i].replace('{0}', '#') + '}'; + } + } + + var message = '{when, select, future {{0, plural, ' + future + '}}' + + 'past {{0, plural, ' + past + '}}}'; + + // Create the synthetic IntlMessageFormat instance using the original + // locales value specified by the user when constructing the the parent + // IntlRelativeFormat instance. + return new intl$messageformat$$["default"](message, locales); + }; + + RelativeFormat.prototype._getMessage = function (units) { + var messages = this._messages; + + // Create a new synthetic message based on the locale data from CLDR. + if (!messages[units]) { + messages[units] = this._compileMessage(units); + } + + return messages[units]; + }; + + RelativeFormat.prototype._getRelativeUnits = function (diff, units) { + var field = this._fields[units]; + + if (field.relative) { + return field.relative[diff]; + } + }; + + RelativeFormat.prototype._findFields = function (locale) { + var localeData = RelativeFormat.__localeData__; + var data = localeData[locale.toLowerCase()]; + + // The locale data is de-duplicated, so we have to traverse the locale's + // hierarchy until we find `fields` to return. + while (data) { + if (data.fields) { + return data.fields; + } + + data = data.parentLocale && localeData[data.parentLocale.toLowerCase()]; + } + + throw new Error( + 'Locale data added to IntlRelativeFormat is missing `fields` for :' + + locale + ); + }; + + RelativeFormat.prototype._format = function (date, options) { + var now = options && options.now !== undefined ? options.now : src$es5$$.dateNow(); + + if (date === undefined) { + date = now; + } + + // Determine if the `date` and optional `now` values are valid, and throw a + // similar error to what `Intl.DateTimeFormat#format()` would throw. + if (!isFinite(now)) { + throw new RangeError( + 'The `now` option provided to IntlRelativeFormat#format() is not ' + + 'in valid range.' + ); + } + + if (!isFinite(date)) { + throw new RangeError( + 'The date value provided to IntlRelativeFormat#format() is not ' + + 'in valid range.' + ); + } + + var diffReport = src$diff$$["default"](now, date); + var units = this._options.units || this._selectUnits(diffReport); + var diffInUnits = diffReport[units]; + + if (this._options.style !== 'numeric') { + var relativeUnits = this._getRelativeUnits(diffInUnits, units); + if (relativeUnits) { + return relativeUnits; + } + } + + return this._getMessage(units).format({ + '0' : Math.abs(diffInUnits), + when: diffInUnits < 0 ? 'past' : 'future' + }); + }; + + RelativeFormat.prototype._isValidUnits = function (units) { + if (!units || src$es5$$.arrIndexOf.call(FIELDS, units) >= 0) { + return true; + } + + if (typeof units === 'string') { + var suggestion = /s$/.test(units) && units.substr(0, units.length - 1); + if (suggestion && src$es5$$.arrIndexOf.call(FIELDS, suggestion) >= 0) { + throw new Error( + '"' + units + '" is not a valid IntlRelativeFormat `units` ' + + 'value, did you mean: ' + suggestion + ); + } + } + + throw new Error( + '"' + units + '" is not a valid IntlRelativeFormat `units` value, it ' + + 'must be one of: "' + FIELDS.join('", "') + '"' + ); + }; + + RelativeFormat.prototype._resolveLocale = function (locales) { + if (typeof locales === 'string') { + locales = [locales]; + } + + // Create a copy of the array so we can push on the default locale. + locales = (locales || []).concat(RelativeFormat.defaultLocale); + + var localeData = RelativeFormat.__localeData__; + var i, len, localeParts, data; + + // Using the set of locales + the default locale, we look for the first one + // which that has been registered. When data does not exist for a locale, we + // traverse its ancestors to find something that's been registered within + // its hierarchy of locales. Since we lack the proper `parentLocale` data + // here, we must take a naive approach to traversal. + for (i = 0, len = locales.length; i < len; i += 1) { + localeParts = locales[i].toLowerCase().split('-'); + + while (localeParts.length) { + data = localeData[localeParts.join('-')]; + if (data) { + // Return the normalized locale string; e.g., we return "en-US", + // instead of "en-us". + return data.locale; + } + + localeParts.pop(); + } + } + + var defaultLocale = locales.pop(); + throw new Error( + 'No locale data has been added to IntlRelativeFormat for: ' + + locales.join(', ') + ', or the default locale: ' + defaultLocale + ); + }; + + RelativeFormat.prototype._resolveStyle = function (style) { + // Default to "best fit" style. + if (!style) { + return STYLES[0]; + } + + if (src$es5$$.arrIndexOf.call(STYLES, style) >= 0) { + return style; + } + + throw new Error( + '"' + style + '" is not a valid IntlRelativeFormat `style` value, it ' + + 'must be one of: "' + STYLES.join('", "') + '"' + ); + }; + + RelativeFormat.prototype._selectUnits = function (diffReport) { + var i, l, units; + + for (i = 0, l = FIELDS.length; i < l; i += 1) { + units = FIELDS[i]; + + if (Math.abs(diffReport[units]) < RelativeFormat.thresholds[units]) { + break; + } + } + + return units; + }; + + //# sourceMappingURL=core.js.map + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + + var round = Math.round; + + function daysToYears(days) { + // 400 years have 146097 days (taking into account leap year rules) + return days * 400 / 146097; + } + + exports["default"] = function (from, to) { + // Convert to ms timestamps. + from = +from; + to = +to; + + var millisecond = round(to - from), + second = round(millisecond / 1000), + minute = round(second / 60), + hour = round(minute / 60), + day = round(hour / 24), + week = round(day / 7); + + var rawYears = daysToYears(day), + month = round(rawYears * 12), + year = round(rawYears); + + return { + millisecond: millisecond, + second : second, + minute : minute, + hour : hour, + day : day, + week : week, + month : month, + year : year + }; + }; + + //# sourceMappingURL=diff.js.map + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + + // Purposely using the same implementation as the Intl.js `Intl` polyfill. + // Copyright 2013 Andy Earnshaw, MIT License + + var hop = Object.prototype.hasOwnProperty; + var toString = Object.prototype.toString; + + var realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(); + + var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + + var defineProperty = realDefineProp ? Object.defineProperty : + function (obj, name, desc) { + + if ('get' in desc && obj.__defineGetter__) { + obj.__defineGetter__(name, desc.get); + } else if (!hop.call(obj, name) || 'value' in desc) { + obj[name] = desc.value; + } + }; + + var objCreate = Object.create || function (proto, props) { + var obj, k; + + function F() {} + F.prototype = proto; + obj = new F(); + + for (k in props) { + if (hop.call(props, k)) { + defineProperty(obj, k, props[k]); + } + } + + return obj; + }; + + var arrIndexOf = Array.prototype.indexOf || function (search, fromIndex) { + /*jshint validthis:true */ + var arr = this; + if (!arr.length) { + return -1; + } + + for (var i = fromIndex || 0, max = arr.length; i < max; i++) { + if (arr[i] === search) { + return i; + } + } + + return -1; + }; + + var isArray = Array.isArray || function (obj) { + return toString.call(obj) === '[object Array]'; + }; + + var dateNow = Date.now || function () { + return new Date().getTime(); + }; + exports.defineProperty = defineProperty, exports.objCreate = objCreate, exports.arrIndexOf = arrIndexOf, exports.isArray = isArray, exports.dateNow = dateNow; + + //# sourceMappingURL=es5.js.map + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + // GENERATED FILE + "use strict"; + exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"Year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"month":{"displayName":"Month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"day":{"displayName":"Day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"Hour","relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"minute":{"displayName":"Minute","relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"second":{"displayName":"Second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}}}}; + + //# sourceMappingURL=en.js.map + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + /* (ignored) */ + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports = module.exports = __webpack_require__(31)['default']; + exports['default'] = exports; + + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var src$es5$$ = __webpack_require__(32); + exports["default"] = createFormatCache; + + // ----------------------------------------------------------------------------- + + function createFormatCache(FormatConstructor) { + var cache = src$es5$$.objCreate(null); + + return function () { + var args = Array.prototype.slice.call(arguments); + var cacheId = getCacheId(args); + var format = cacheId && cache[cacheId]; + + if (!format) { + format = src$es5$$.objCreate(FormatConstructor.prototype); + FormatConstructor.apply(format, args); + + if (cacheId) { + cache[cacheId] = format; + } + } + + return format; + }; + } + + // -- Utilities ---------------------------------------------------------------- + + function getCacheId(inputs) { + // When JSON is not available in the runtime, we will not create a cache id. + if (typeof JSON === 'undefined') { return; } + + var cacheId = []; + + var i, len, input; + + for (i = 0, len = inputs.length; i < len; i += 1) { + input = inputs[i]; + + if (input && typeof input === 'object') { + cacheId.push(orderedProps(input)); + } else { + cacheId.push(input); + } + } + + return JSON.stringify(cacheId); + } + + function orderedProps(obj) { + var props = [], + keys = []; + + var key, i, len, prop; + + for (key in obj) { + if (obj.hasOwnProperty(key)) { + keys.push(key); + } + } + + var orderedKeys = keys.sort(); + + for (i = 0, len = orderedKeys.length; i < len; i += 1) { + key = orderedKeys[i]; + prop = {}; + + prop[key] = obj[key]; + props[i] = prop; + } + + return props; + } + + //# sourceMappingURL=memoizer.js.map + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + // Purposely using the same implementation as the Intl.js `Intl` polyfill. + // Copyright 2013 Andy Earnshaw, MIT License + + var hop = Object.prototype.hasOwnProperty; + + var realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(); + + var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + + var defineProperty = realDefineProp ? Object.defineProperty : + function (obj, name, desc) { + + if ('get' in desc && obj.__defineGetter__) { + obj.__defineGetter__(name, desc.get); + } else if (!hop.call(obj, name) || 'value' in desc) { + obj[name] = desc.value; + } + }; + + var objCreate = Object.create || function (proto, props) { + var obj, k; + + function F() {} + F.prototype = proto; + obj = new F(); + + for (k in props) { + if (hop.call(props, k)) { + defineProperty(obj, k, props[k]); + } + } + + return obj; + }; + exports.defineProperty = defineProperty, exports.objCreate = objCreate; + + //# sourceMappingURL=es5.js.map + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + // GENERATED FILE + "use strict"; + exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"Year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"month":{"displayName":"Month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"day":{"displayName":"Day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"Hour","relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"minute":{"displayName":"Minute","relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"second":{"displayName":"Second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}}}}; + + //# sourceMappingURL=en.js.map + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), src$mixin$$ = __webpack_require__(12); + + var FormattedDate = src$react$$["default"].createClass({ + displayName: 'FormattedDate', + mixins : [src$mixin$$["default"]], + + statics: { + formatOptions: [ + 'localeMatcher', 'timeZone', 'hour12', 'formatMatcher', 'weekday', + 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', + 'timeZoneName' + ] + }, + + propTypes: { + format: src$react$$["default"].PropTypes.string, + value : src$react$$["default"].PropTypes.any.isRequired + }, + + render: function () { + var props = this.props; + var value = props.value; + var format = props.format; + var defaults = format && this.getNamedFormat('date', format); + var options = FormattedDate.filterFormatOptions(props, defaults); + + return src$react$$["default"].DOM.span(null, this.formatDate(value, options)); + } + }); + + exports["default"] = FormattedDate; + + //# sourceMappingURL=date.js.map + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), src$mixin$$ = __webpack_require__(12); + + var FormattedRelative = src$react$$["default"].createClass({ + displayName: 'FormattedRelative', + mixins : [src$mixin$$["default"]], + + statics: { + formatOptions: [ + 'style', 'units' + ] + }, + + propTypes: { + format: src$react$$["default"].PropTypes.string, + value : src$react$$["default"].PropTypes.any.isRequired, + now : src$react$$["default"].PropTypes.any + }, + + render: function () { + var props = this.props; + var value = props.value; + var format = props.format; + var defaults = format && this.getNamedFormat('relative', format); + var options = FormattedRelative.filterFormatOptions(props, defaults); + + var formattedRelativeTime = this.formatRelative(value, options, { + now: props.now + }); + + return src$react$$["default"].DOM.span(null, formattedRelativeTime); + } + }); + + exports["default"] = FormattedRelative; + + //# sourceMappingURL=relative.js.map + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), src$mixin$$ = __webpack_require__(12); + + var FormattedNumber = src$react$$["default"].createClass({ + displayName: 'FormattedNumber', + mixins : [src$mixin$$["default"]], + + statics: { + formatOptions: [ + 'localeMatcher', 'style', 'currency', 'currencyDisplay', + 'useGrouping', 'minimumIntegerDigits', 'minimumFractionDigits', + 'maximumFractionDigits', 'minimumSignificantDigits', + 'maximumSignificantDigits' + ] + }, + + propTypes: { + format: src$react$$["default"].PropTypes.string, + value : src$react$$["default"].PropTypes.any.isRequired + }, + + render: function () { + var props = this.props; + var value = props.value; + var format = props.format; + var defaults = format && this.getNamedFormat('number', format); + var options = FormattedNumber.filterFormatOptions(props, defaults); + + return src$react$$["default"].DOM.span(null, this.formatNumber(value, options)); + } + }); + + exports["default"] = FormattedNumber; + + //# sourceMappingURL=number.js.map + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), src$mixin$$ = __webpack_require__(12); + + var FormattedMessage = src$react$$["default"].createClass({ + displayName: 'FormattedMessage', + mixins : [src$mixin$$["default"]], + + propTypes: { + tagName: src$react$$["default"].PropTypes.string, + message: src$react$$["default"].PropTypes.string.isRequired + }, + + getDefaultProps: function () { + return {tagName: 'span'}; + }, + + render: function () { + var props = this.props; + var tagName = props.tagName; + var message = props.message; + + // Creates a token with a random guid that should not be guessable or + // conflict with other parts of the `message` string. + var guid = Math.floor(Math.random() * 0x10000000000).toString(16); + var tokenRegex = new RegExp('(@__ELEMENT-' + guid + '-\\d+__@)', 'g'); + var elements = {}; + + var generateToken = (function () { + var counter = 0; + return function () { + return '@__ELEMENT-' + guid + '-' + (counter += 1) + '__@'; + }; + }()); + + // Iterates over the `props` to keep track of any React Element values + // so they can be represented by the `token` as a placeholder when the + // `message` is formatted. This allows the formatted message to then be + // broken-up into parts with references to the React Elements inserted + // back in. + var values = Object.keys(props).reduce(function (values, name) { + var value = props[name]; + var token; + + if (src$react$$["default"].isValidElement(value)) { + token = generateToken(); + values[name] = token; + elements[token] = value; + } else { + values[name] = value; + } + + return values; + }, {}); + + // Formats the `message` with the `values`, including the `token` + // placeholders for React Element values. + var formattedMessage = this.formatMessage(message, values); + + // Split the message into parts so the React Element values captured + // above can be inserted back into the rendered message. This + // approach allows messages to render with React Elements while keeping + // React's virtual diffing working properly. + var children = formattedMessage.split(tokenRegex) + .filter(function (part) { + // Ignore empty string parts. + return !!part; + }) + .map(function (part) { + // When the `part` is a token, get a ref to the React Element. + return elements[part] || part; + }); + + var elementArgs = [tagName, null].concat(children); + return src$react$$["default"].createElement.apply(null, elementArgs); + } + }); + + exports["default"] = FormattedMessage; + + //# sourceMappingURL=message.js.map + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + // TODO: Use `import React from "react";` when external modules are supported. + "use strict"; + var src$react$$ = __webpack_require__(11), src$escape$$ = __webpack_require__(39), src$mixin$$ = __webpack_require__(12); + + var FormattedHTMLMessage = src$react$$["default"].createClass({ + displayName: 'FormattedHTMLMessage', + mixins : [src$mixin$$["default"]], + + propTypes: { + tagName: src$react$$["default"].PropTypes.string, + message: src$react$$["default"].PropTypes.string.isRequired + }, + + getDefaultProps: function () { + return {tagName: 'span'}; + }, + + render: function () { + var props = this.props; + var tagName = props.tagName; + var message = props.message; + + // Process all the props before they are used as values when formatting + // the ICU Message string. Since the formatted message will be injected + // via `innerHTML`, all String-based values need to be HTML-escaped. Any + // React Elements that are passed as props will be rendered to a static + // markup string that is presumed to be safe. + var values = Object.keys(props).reduce(function (values, name) { + var value = props[name]; + + if (typeof value === 'string') { + value = src$escape$$["default"](value); + } else if (src$react$$["default"].isValidElement(value)) { + value = src$react$$["default"].renderToStaticMarkup(value); + } + + values[name] = value; + return values; + }, {}); + + // Since the message presumably has HTML in it, we need to set + // `innerHTML` in order for it to be rendered and not escaped by React. + // To be safe, all string prop values were escaped before formatting the + // message. It is assumed that the message is not UGC, and came from + // the developer making it more like a template. + // + // Note: There's a perf impact of using this component since there's no + // way for React to do its virtual DOM diffing. + return src$react$$["default"].DOM[tagName]({ + dangerouslySetInnerHTML: { + __html: this.formatMessage(message, values) + } + }); + } + }); + + exports["default"] = FormattedHTMLMessage; + + //# sourceMappingURL=html-message.js.map + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + /* + HTML escaping implementation is the same as React's (on purpose.) Therefore, it + has the following Copyright and Licensing: + + Copyright 2013-2014, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the LICENSE + file in the root directory of React's source tree. + */ + "use strict"; + var ESCAPED_CHARS = { + '&' : '&', + '>' : '>', + '<' : '<', + '"' : '"', + '\'': ''' + }; + + var UNSAFE_CHARS_REGEX = /[&><"']/g; + + exports["default"] = function (str) { + return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) { + return ESCAPED_CHARS[match]; + }); + }; + + //# sourceMappingURL=escape.js.map + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + /* (ignored) */ + +/***/ }, +/* 41 */ +/***/ function(module, exports, __webpack_require__) { + + var map = { + "./en-US": 42, + "./en-US.js": 42, + "./pt-BR": 43, + "./pt-BR.js": 43 + }; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 41; + + +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + module.exports = { + IndexFilters: { + filters: '{quantity, plural,\n =0 {Filters}\n =1 {one filter}\n other {# filters}\n}' + }, + Active: 'Active', + Alerts: 'Alerts', + All: 'All', + Category: 'Category', + Cleared: 'Cleared', + Completed: 'Completed', + created: 'Created', + Critical: 'Critical', + Disabled: 'Disabled', + Error: 'Error', + loginInvalidPassword: 'Please provide Username and Password.', + 'Log In': 'Log In', + Logout: 'Logout', + model: 'Model', + modified: 'Modified', + Name: 'Name', + OK: 'OK', + Password: 'Password', + 'Remember me': 'Remember me', + Resource: 'Resource', + Running: 'Running', + Search: 'Search', + State: 'State', + Status: 'Status', + Tasks: 'Tasks', + Time: 'Time', + Total: 'Total', + Unknown: 'Unknown', + Username: 'Username', + uri: 'URI', + Warning: 'Warning' + }; + + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + module.exports = { + IndexFilters: { + filters: '{quantity, plural,\n =0 {Filtros}\n =1 {um filtro}\n other {# filtros}\n}' + }, + Active: 'Ativos', + Alerts: 'Alertas', + All: 'Todos', + Category: 'Categoria', + Cleared: 'Livre', + Completed: 'Completado', + created: 'Criado', + Critical: 'Crítico', + Disabled: 'Desabilitado', + Error: 'Erro', + loginInvalidPassword: 'Por favor, informe Usuário e Senha.', + 'Log In': 'Logar', + Logout: 'Deslogar', + model: 'Modelo', + modified: 'Modificado', + Name: 'Nome', + OK: 'OK', + Password: 'Senha', + 'Remember me': 'Lembrar Usuário', + Resource: 'Recurso', + Running: 'Executando', + Search: 'Buscar', + State: 'Estado', + Status: 'Situaçāo', + Tasks: 'Tarefas', + Time: 'Data', + Total: 'Total', + Unknown: 'Desconhecido', + Username: 'Usuário', + uri: 'URI', + Warning: 'Alerta' + }; + + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "button"; + + var Button = React.createClass({displayName: "Button", + + propTypes: { + alternate: React.PropTypes.bool, + label: React.PropTypes.string.isRequired, + large: React.PropTypes.bool, + onClick: React.PropTypes.func, + primary: React.PropTypes.bool, + small: React.PropTypes.bool, + strong: React.PropTypes.bool + }, + + render: function () { + var classes = [CLASS_ROOT]; + if (this.props.primary) { + classes.push(CLASS_ROOT + "--primary"); + } + if (this.props.alternate) { + classes.push(CLASS_ROOT + "--alternate"); + } + if (this.props.large) { + classes.push(CLASS_ROOT + "--large"); + } + if (this.props.small) { + classes.push(CLASS_ROOT + "--small"); + } + if (this.props.strong) { + classes.push(CLASS_ROOT + "--strong"); + } + if (! this.props.onClick) { + classes.push(CLASS_ROOT + "--disabled"); + } + if (this.props.className) { + classes.push(this.props.className); + } + return ( + React.createElement("button", {className: classes.join(' '), + onClick: this.props.onClick}, + this.props.label + ) + ); + } + + }); + + module.exports = Button; + + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "check-box"; + + var CheckBox = React.createClass({displayName: "CheckBox", + + propTypes: { + checked: React.PropTypes.bool, + defaultChecked: React.PropTypes.bool, + id: React.PropTypes.string.isRequired, + label: React.PropTypes.string.isRequired, + name: React.PropTypes.string, + onChange: React.PropTypes.func, + toggle: React.PropTypes.bool + }, + + render: function () { + var classes = [CLASS_ROOT]; + if (this.props.toggle) { + classes.push(CLASS_ROOT + "--toggle"); + } + if (this.props.className) { + classes.push(this.props.className); + } + return ( + React.createElement("label", {className: classes.join(' ')}, + React.createElement("input", {className: CLASS_ROOT + "__input", + id: this.props.id, name: this.props.name, type: "checkbox", + checked: this.props.checked, + defaultChecked: this.props.defaultChecked, + onChange: this.props.onChange}), + React.createElement("span", {className: CLASS_ROOT + "__control"}), + React.createElement("span", {className: CLASS_ROOT + "__label"}, + this.props.label + ) + ) + ); + } + + }); + + module.exports = CheckBox; + + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "document"; + + var GrommetDocument = React.createClass({displayName: "GrommetDocument", + + propTypes: { + colorIndex: React.PropTypes.string, + flush: React.PropTypes.bool + }, + + getDefaultProps: function () { + return { + flush: true + }; + }, + + render: function() { + var classes = [CLASS_ROOT]; + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); + } + if (this.props.colorIndex) { + classes.push("header-color-index-" + this.props.colorIndex); + } + + return ( + React.createElement("div", {ref: "document", className: classes.join(' ')}, + React.createElement("div", {className: CLASS_ROOT + "__content"}, + this.props.children + ) + ) + ); + } + }); + + module.exports = GrommetDocument; + + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + var Legend = __webpack_require__(48); + + var CLASS_ROOT = "donut"; + var BASE_SIZE = 192; + var PARTIAL_SIZE = 168; + + function polarToCartesian (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)) + }; + } + + function arcCommands (x, y, radius, startAngle, endAngle) { + var start = polarToCartesian(x, y, radius, endAngle); + var end = polarToCartesian(x, y, radius, startAngle); + var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; + var d = [ + "M", start.x, start.y, + "A", radius, radius, 0, arcSweep, 0, end.x, end.y + ].join(" "); + return d; + } + + function activeIndicatorCommands (x, y, radius, startAngle, endAngle) { + var midAngle = endAngle - ((endAngle - startAngle) / 2); + var point = polarToCartesian(x, y, radius - 24, midAngle); + var start = polarToCartesian(x, y, radius, midAngle - 10); + var end = polarToCartesian(x, y, radius, midAngle + 10); + //var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; + var d = ["M", point.x, point.y, + "L", start.x, start.y, + "A", radius, radius, 0, 0, 0, end.x, end.y, + "Z" + ].join(" "); + return d; + } + + var Donut = React.createClass({displayName: "Donut", + + propTypes: { + legend: React.PropTypes.bool, + partial: React.PropTypes.bool, + max: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + min: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + series: React.PropTypes.arrayOf(React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.number.isRequired, + units: React.PropTypes.string, + colorIndex: React.PropTypes.string, + important: React.PropTypes.bool, + onClick: React.PropTypes.func + })), + small: React.PropTypes.bool, + units: React.PropTypes.string, + value: React.PropTypes.number + }, + + getDefaultProps: function () { + return { + max: {value: 100}, + min: {value: 0} + }; + }, + + _initialTimeout: function () { + this.setState({ + initial: false, + activeIndex: this.state.importantIndex + }); + clearTimeout(this._timeout); + }, + + _onActive: function (index) { + this.setState({initial: false, activeIndex: index}); + }, + + _layout: function () { + // orientation based on available window orientation + var ratio = window.innerWidth / window.innerHeight; + if (ratio < 0.8) { + this.setState({orientation: 'portrait'}); + } else if (ratio > 1.2) { + this.setState({orientation: 'landscape'}); + } + // content based on avialable real estate + var parentElement = this.refs.donut.getDOMNode().parentNode; + var width = parentElement.offsetWidth; + var height = parentElement.offsetHeight; + var donutHeight = BASE_SIZE; + if (this.props.partial) { + donutHeight = PARTIAL_SIZE; + } + if (height < donutHeight || width < BASE_SIZE || + (width < (BASE_SIZE * 2) && height < (donutHeight * 2))) { + this.setState({size: 'small'}); + } else { + this.setState({size: null}); + } + }, + + _onResize: function() { + // debounce + clearTimeout(this._resizeTimer); + this._resizeTimer = setTimeout(this._layout, 50); + }, + + _generateSeries: function (props) { + var total = props.max.value - props.min.value; + var remaining = total - (props.value - props.min.value); + return [ + {value: props.value}, + {value: remaining, colorIndex: 'unset'} + ]; + }, + + _importantIndex: function (series) { + var result = 0; + series.some(function (data, index) { + if (data.important) { + result = index; + return true; + } + }); + return result; + }, + + getInitialState: function() { + var series = this.props.series || this._generateSeries(this.props); + var importantIndex = this._importantIndex(series); + return { + initial: true, + importantIndex: importantIndex, + activeIndex: importantIndex, + legend: false, + orientation: 'portrait', + series: series + }; + }, + + componentDidMount: function() { + console.log('Grommet Donut is deprecated. Please use Grommet Meter instead.'); + this._initialTimer = setTimeout(this._initialTimeout, 10); + this.setState({initial: true, activeIndex: 0}); + window.addEventListener('resize', this._onResize); + this._onResize(); + }, + + componentWillReceiveProps: function (newProps) { + var series = newProps.series || this._generateSeries(newProps); + var importantIndex = this._importantIndex(series); + this.setState({ + importantIndex: importantIndex, + activeIndex: importantIndex, + series: series + }); + }, + + componentWillUnmount: function() { + clearTimeout(this._initialTimer); + clearTimeout(this._resizeTimer); + window.removeEventListener('resize', this._onResize); + }, + + _itemColorIndex: function (item, index) { + return item.colorIndex || ('graph-' + (index + 1)); + }, + + render: function() { + var classes = [CLASS_ROOT, CLASS_ROOT + "--" + this.state.orientation]; + if (this.state.size) { + classes.push(CLASS_ROOT + "--" + this.state.size); + } + if (this.props.partial) { + classes.push(CLASS_ROOT + "--partial"); + } + if (this.props.small) { + classes.push(CLASS_ROOT + "--small"); + } + + var viewBoxHeight = BASE_SIZE; + if (this.props.partial) { + viewBoxHeight = PARTIAL_SIZE; + } + + var total = 0; + this.state.series.some(function (item) { + total += item.value; + }); + + var startAngle = 0; + var anglePer = 360.0 / total; + if (this.props.partial) { + startAngle = 60; + anglePer = 240.0 / total; + } + var value = null; + var units = null; + var label = null; + var activeIndicator = null; + + var paths = this.state.series.map(function (item, index) { + + var endAngle = Math.min(360, Math.max(10, startAngle + (anglePer * item.value))); + if (item.value > 0 && (startAngle + 360) === endAngle) { + // full use for this item, make sure we render it. + endAngle -= 0.1; + } + var radius = 84; + // start from the bottom + var commands = arcCommands(BASE_SIZE / 2, BASE_SIZE / 2, radius, + startAngle + 180, endAngle + 180); + var colorIndex = this._itemColorIndex(item, index); + + var sliceClasses = [CLASS_ROOT + "__slice"]; + sliceClasses.push("color-index-" + colorIndex); + if (this.state.activeIndex === index) { + sliceClasses.push(CLASS_ROOT + "__slice--active"); + value = item.value; + units = item.units || this.props.units; + label = item.label; + } + + if (index === this.state.activeIndex) { + var indicatorCommands = activeIndicatorCommands(BASE_SIZE / 2, BASE_SIZE / 2, radius, + startAngle + 180, endAngle + 180); + activeIndicator = ( + React.createElement("path", {stroke: "none", + className: CLASS_ROOT + "__slice-indicator color-index-" + colorIndex, + d: indicatorCommands}) + ); + } + + startAngle = endAngle; + + return ( + React.createElement("path", {key: item.label, fill: "none", className: sliceClasses.join(' '), d: commands, + onMouseOver: this._onActive.bind(this, index), + onMouseOut: this._onActive.bind(this, this.state.importantIndex), + onClick: item.onClick}) + ); + }, this); + + var minLabel; + var maxLabel; + if (this.props.partial) { + if (this.props.min) { + minLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__min-label"}, + this.props.min.value, " ", this.props.units + ) + ); + } + if (this.props.max) { + maxLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__max-label"}, + this.props.max.value, " ", this.props.units + ) + ); + } + } + + var legend = null; + if (this.props.legend) { + legend = ( + React.createElement(Legend, {className: CLASS_ROOT + "__legend", + series: this.props.series, + units: this.props.units, + value: this.props.value, + activeIndex: this.state.activeIndex, + onActive: this._onActive}) + ); + } + + return ( + React.createElement("div", {ref: "donut", className: classes.join(' ')}, + React.createElement("div", {className: CLASS_ROOT + "__graphic-container"}, + React.createElement("svg", {className: CLASS_ROOT + "__graphic", + viewBox: "0 0 " + BASE_SIZE + " " + viewBoxHeight, + preserveAspectRatio: "xMidYMid meet"}, + React.createElement("g", null, + activeIndicator, + paths + ) + ), + React.createElement("div", {className: CLASS_ROOT + "__active"}, + React.createElement("div", {className: CLASS_ROOT + "__active-value large-number-font"}, + value, + React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, units) + ), + React.createElement("div", {className: CLASS_ROOT + "__active-label"}, label) + ), + minLabel, + maxLabel + ), + legend + ) + ); + } + + }); + + module.exports = Donut; + + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + var IntlMixin = __webpack_require__(4); + + var CLASS_ROOT = "legend"; + + var Legend = React.createClass({displayName: "Legend", + + mixins: [IntlMixin], + + propTypes: { + activeIndex: React.PropTypes.number, + onActive: React.PropTypes.func, + series: React.PropTypes.arrayOf(React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.number, + units: React.PropTypes.string, + colorIndex: React.PropTypes.oneOfType([ + React.PropTypes.number, // 1-6 + React.PropTypes.string // status + ]), + onClick: React.PropTypes.func + })).isRequired, + total: React.PropTypes.bool, + units: React.PropTypes.string, + value: React.PropTypes.number + }, + + _onActive: function (index) { + this.setState({activeIndex: index}); + if (this.props.onActive) { + this.props.onActive(index); + } + }, + + getInitialState: function () { + return {activeIndex: this.props.activeIndex}; + }, + + componentWillReceiveProps: function (newProps) { + this.setState({activeIndex: newProps.activeIndex}); + }, + + _itemColorIndex: function (item, index) { + return item.colorIndex || ('graph-' + (index + 1)); + }, + + render: function () { + var classes = [CLASS_ROOT]; + if (this.props.series.length === 1) { + classes.push(CLASS_ROOT + "--single"); + } + if (this.props.className) { + classes.push(this.props.className); + } + + var totalValue = 0; + var items = this.props.series.map(function (item, index) { + var legendClasses = [CLASS_ROOT + "__item"]; + if (index === this.state.activeIndex) { + legendClasses.push(CLASS_ROOT + "__item--active"); + } + var colorIndex = this._itemColorIndex(item, index); + totalValue += item.value; + + var valueClasses = [CLASS_ROOT + "__item-value"]; + if (1 === this.props.series.length) { + valueClasses.push("large-number-font"); + } + + return ( + React.createElement("li", {key: item.label, className: legendClasses.join(' '), + onClick: item.onClick, + onMouseOver: this._onActive.bind(this, index), + onMouseOut: this._onActive.bind(this, this.props.activeIndex)}, + React.createElement("svg", {className: CLASS_ROOT + "__item-swatch color-index-" + colorIndex, + viewBox: "0 0 12 12"}, + React.createElement("path", {className: item.className, d: "M 5 0 l 0 12"}) + ), + React.createElement("span", {className: CLASS_ROOT + "__item-label"}, item.label), + React.createElement("span", {className: valueClasses.join(' ')}, + item.value, + React.createElement("span", {className: CLASS_ROOT + "__item-units"}, this.props.units) + ) + ) + ); + }, this); + + var total = null; + if (this.props.total && this.props.series.length > 1) { + total = ( + React.createElement("li", {className: CLASS_ROOT + "__total"}, + React.createElement("span", {className: CLASS_ROOT + "__total-label"}, + this.getGrommetIntlMessage('Total') + ), + React.createElement("span", {className: CLASS_ROOT + "__total-value"}, + totalValue, + React.createElement("span", {className: CLASS_ROOT + "__total-units"}, this.props.units) + ) + ) + ); + } + + return ( + React.createElement("ol", {className: classes.join(' ')}, + items.reverse(), + total + ) + ); + } + + }); + + module.exports = Legend; + + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + var Top = __webpack_require__(50); + + var CLASS_ROOT = "footer"; + + var Footer = React.createClass({displayName: "Footer", + + propTypes: { + centered: React.PropTypes.bool, + colorIndex: React.PropTypes.string, + flush: React.PropTypes.bool, + primary: React.PropTypes.bool, + scrollTop: React.PropTypes.bool + }, + + getDefaultProps: function () { + return { + flush: true + }; + }, + + _updateState: function () { + this.setState({scrolled: this._scrollable.scrollTop > 0}); + }, + + _onClickTop: function() { + this._scrollable.scrollTop = 0; + }, + + _onScroll: function() { + // debounce + clearTimeout(this._scrollTimer); + this._scrollTimer = setTimeout(this._updateState, 10); + }, + + getInitialState: function () { + return {scrolled: false}; + }, + + componentDidMount: function () { + this._scrollable = this.refs.footer.getDOMNode().parentNode.parentNode; + this._scrollable.addEventListener("scroll", this._onScroll); + }, + + componentWillUnmount: function () { + this._scrollable.removeEventListener("scroll", this._onScroll); + }, + + componentWillReceiveProps: function() { + this.setState({scrolled: false}); + }, + + componentDidUpdate: function() { + if (!this.state.scrolled) { + this._scrollable.scrollTop = 0; + } + }, + + render: function() { + var classes = [CLASS_ROOT]; + if (this.props.primary) { + classes.push(CLASS_ROOT + "--primary"); + } + if (this.props.centered) { + classes.push(CLASS_ROOT + "--centered"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); + } + if (this.props.colorIndex) { + classes.push("background-color-index-" + this.props.colorIndex); + } + if (this.props.className) { + classes.push(this.props.className); + } + + var top = null; + if (this.props.scrollTop && this.state.scrolled) { + top = ( + React.createElement("div", {className: CLASS_ROOT + "__top control-icon", + onClick: this._onClickTop}, + React.createElement(Top, null) + ) + ); + } + + return ( + React.createElement("div", {ref: "footer", className: classes.join(' ')}, + React.createElement("div", {className: CLASS_ROOT + "__content"}, + this.props.children, + top + ) + ) + ); + } + + }); + + module.exports = Footer; + + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var Top = React.createClass({displayName: "Top", + + render: function() { + var className = 'control-icon control-icon-top'; + if (this.props.className) { + className += ' ' + this.props.className; + } + return ( + React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, + React.createElement("g", {fill: "none"}, + React.createElement("polyline", {strokeWidth: "2", points: "14,20.9 24,13 34,21 "}), + React.createElement("path", {strokeWidth: "2", d: "M24,13.3C24,36,24,36,24,36"}), + React.createElement("line", {strokeWidth: "2", x1: "13", y1: "11", x2: "35", y2: "11"}) + ) + ) + ); + } + + }); + + module.exports = Top; + + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "form"; + + var Form = React.createClass({displayName: "Form", + + propTypes: { + compact: React.PropTypes.bool, + fill: React.PropTypes.bool, + flush: React.PropTypes.bool, + onSubmit: React.PropTypes.func, + className: React.PropTypes.string + }, + + getDefaultProps: function () { + return { + compact: false, + fill: false, + flush: true + }; + }, + + render: function () { + var classes = [CLASS_ROOT]; + if (this.props.compact) { + classes.push(CLASS_ROOT + "--compact"); + } + if (this.props.fill) { + classes.push(CLASS_ROOT + "--fill"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); + } + if (this.props.className) { + classes.push(this.props.className); + } + return ( + React.createElement("form", {className: classes.join(' '), onSubmit: this.props.onSubmit}, + this.props.children + ) + ); + } + + }); + + module.exports = Form; + + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "form-field"; + + var FormField = React.createClass({displayName: "FormField", + + propTypes: { + error: React.PropTypes.string, + help: React.PropTypes.node, + htmlFor: React.PropTypes.string, + label: React.PropTypes.string, + required: React.PropTypes.bool + }, + + _onFocus: function () { + this.setState({focus: true}); + }, + + _onBlur: function () { + this.setState({focus: false}); + }, + + _onClick: function () { + if (this._inputElement) { + this._inputElement.focus(); + } + }, + + getInitialState: function () { + return {focus: false}; + }, + + componentDidMount: function () { + var contentsElement = this.refs.contents.getDOMNode(); + var inputElements = contentsElement.querySelectorAll('input, textarea, select'); + if (inputElements.length === 1) { + this._inputElement = inputElements[0]; + this._inputElement.addEventListener('focus', this._onFocus); + this._inputElement.addEventListener('blur', this._onBlur); + } + }, + + componentWillUnmount: function () { + if (this._inputElement) { + this._inputElement.removeEventListener('focus', this._onFocus); + this._inputElement.removeEventListener('blur', this._onBlur); + delete this._inputElement; + } + }, + + render: function () { + var classes = [CLASS_ROOT]; + if (this.state.focus) { + classes.push(CLASS_ROOT + "--focus"); + } + if (this.props.required) { + classes.push(CLASS_ROOT + "--required"); + } + if (this.props.htmlFor) { + classes.push(CLASS_ROOT + "--text"); + } + + var error = null; + if (this.props.error) { + classes.push(CLASS_ROOT + "--error"); + error = React.createElement("span", {className: CLASS_ROOT + "__error"}, this.props.error); + } + var help = null; + if (this.props.help) { + help = React.createElement("span", {className: CLASS_ROOT + "__help"}, this.props.help); + } + + return ( + React.createElement("div", {className: classes.join(' '), onClick: this._onClick}, + error, + React.createElement("label", {className: CLASS_ROOT + "__label", htmlFor: this.props.htmlFor}, + this.props.label + ), + React.createElement("span", {ref: "contents", className: CLASS_ROOT + "__contents"}, + this.props.children + ), + help + ) + ); + } + + }); + + module.exports = FormField; + + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "header"; + + var Header = React.createClass({displayName: "Header", + + propTypes: { + colorIndex: React.PropTypes.string, + fixed: React.PropTypes.bool, + flush: React.PropTypes.bool, + large: React.PropTypes.bool, + primary: React.PropTypes.bool, + small: React.PropTypes.bool + }, + + getDefaultProps: function () { + return { + flush: true, + large: false, + primary: false, + small: false + }; + }, + + _onResize: function () { + this._alignMirror(); + }, + + _alignMirror: function () { + var contentElement = this.refs.content.getDOMNode(); + var mirrorElement = this.refs.mirror.getDOMNode(); + + // constrain fixed content to the width of the mirror + var mirrorRect = mirrorElement.getBoundingClientRect(); + contentElement.style.width = '' + Math.floor(mirrorRect.width) + 'px'; + + // align the mirror height with the content's height + var contentRect = contentElement.getBoundingClientRect(); + mirrorElement.style.height = '' + Math.floor(contentRect.height) + 'px'; + }, + + componentDidMount: function () { + if (this.props.fixed) { + this._alignMirror(); + window.addEventListener('resize', this._onResize); + } + }, + + componentDidUpdate: function () { + if (this.props.fixed) { + this._alignMirror(); + } + }, + + componentWillUnmount: function () { + if (this.props.fixed) { + window.removeEventListener('resize', this._onResize); + } + }, + + render: function() { + var classes = [CLASS_ROOT]; + if (this.props.primary) { + classes.push(CLASS_ROOT + "--primary"); + } + if (this.props.fixed) { + classes.push(CLASS_ROOT + "--fixed"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); + } + if (this.props.large) { + classes.push(CLASS_ROOT + "--large"); + } + if (this.props.small) { + classes.push(CLASS_ROOT + "--small"); + } + if (this.props.className) { + classes.push(this.props.className); + } + + var mirror = null; + if (this.props.fixed) { + mirror = React.createElement("div", {ref: "mirror", className: CLASS_ROOT + "__mirror"}); + } + + var content = ( + React.createElement("div", {ref: "content", className: CLASS_ROOT + "__content"}, + this.props.children + ) + ); + if (this.props.colorIndex || this.props.fixed) { + var wrapperClasses = [CLASS_ROOT + "__wrapper"]; + if (this.props.colorIndex) { + wrapperClasses.push("background-color-index-" + + this.props.colorIndex); + } + + content = ( + React.createElement("div", {className: wrapperClasses.join(' ')}, + content + ) + ); + } + + return ( + React.createElement("div", {className: classes.join(' ')}, + mirror, + content + ) + ); + } + + }); + + module.exports = Header; + + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var Label = React.createClass({displayName: "Label", + + propTypes: { + icon: React.PropTypes.node, + text: React.PropTypes.string + }, + + render: function() { + var icon = null; + var text = null; + if (this.props.icon) { + icon = (React.createElement("span", {className: "label__icon control-icon"}, this.props.icon)); + } + if (this.props.text) { + text = (React.createElement("span", {className: "label__text"}, this.props.text)); + } + return ( + React.createElement("div", {className: "label"}, + icon, + text + ) + ); + } + + }); + + module.exports = Label; + + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var Login = React.createClass({displayName: "Login", + + propTypes: { + background: React.PropTypes.string + }, + + _onResize: function() { + this.adjustBackground(); + }, + + adjustBackground: function() { + // make sure the background always fills the screen, preserve aspect ratio + var windowRatio = window.innerWidth / window.innerHeight; + var image = this.refs.background.getDOMNode(); + var imageRatio = image.scrollWidth / image.scrollHeight; + this.setState({orientation: (windowRatio < imageRatio) ? 'portrait' : 'landscape'}); + }, + + getInitialState: function() { + return { + orientation: null + }; + }, + + componentDidMount: function() { + window.addEventListener('resize', this._onResize); + setTimeout(this.adjustBackground, 300); + }, + + componentWillUnmount: function() { + window.removeEventListener('resize', this._onResize); + }, + + render: function() { + var background = null; + if (this.props.background) { + var classes = ['login__background']; + if (this.state.orientation) { + classes.push('login__background--' + this.state.orientation); + } + background = ( + React.createElement("img", {ref: "background", className: classes.join(' '), + src: this.props.background}) + ); + } + + return ( + React.createElement("div", {className: "login"}, + background, + React.createElement("div", {className: "login__container"}, + this.props.children + ) + ) + ); + } + + }); + + module.exports = Login; + + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + var Form = __webpack_require__(51); + var FormField = __webpack_require__(52); + var CheckBox = __webpack_require__(45); + var Button = __webpack_require__(44); + var IntlMixin = __webpack_require__(4); + var CLASS_ROOT = "login-form"; + + var LoginForm = React.createClass({displayName: "LoginForm", + + mixins: [IntlMixin], + + propTypes: { + logo: React.PropTypes.node, + title: React.PropTypes.string, + rememberMe: React.PropTypes.bool, + forgotPassword: React.PropTypes.node, + errors: React.PropTypes.arrayOf(React.PropTypes.string), + onSubmit: React.PropTypes.func + }, + + _onSubmit: function (event) { + event.preventDefault(); + var username = this.refs.username.getDOMNode().value.trim(); + var password = this.refs.password.getDOMNode().value.trim(); + if (this.props.onSubmit) { + this.props.onSubmit({username: username, password: password}); + } + }, + + getDefaultProps: function () { + return ({ + errors: [] + }); + }, + + componentDidMount: function() { + this.refs.username.getDOMNode().focus(); + }, + + render: function() { + var classes = [CLASS_ROOT]; + + var errors = this.props.errors.map(function (error, index) { + return (React.createElement("div", {key: index, className: CLASS_ROOT + "__error"}, this.getGrommetIntlMessage(error))); + }.bind(this)); + + var logo = null; + if (this.props.logo) { + logo = ( + React.createElement("div", {className: CLASS_ROOT + "__logo"}, + this.props.logo + ) + ); + } + + var title = null; + if (this.props.title) { + title = ( + React.createElement("h1", {className: CLASS_ROOT + "__title"}, + this.props.title + ) + ); + } + + var footer = null; + if (this.props.rememberMe || this.props.forgotPassword) { + var rememberMe = null; + if (this.props.rememberMe) { + rememberMe = ( + React.createElement(CheckBox, {className: CLASS_ROOT + "__remember-me", + id: "remember-me", label: this.getGrommetIntlMessage('Remember me')}) + ); + } + footer = ( + React.createElement("div", {className: CLASS_ROOT + "__footer"}, + rememberMe, + this.props.forgotPassword + ) + ); + } + + return ( + React.createElement(Form, {className: classes.join(' '), onSubmit: this._onSubmit}, + logo, + title, + React.createElement("fieldset", null, + React.createElement(FormField, {htmlFor: "username", label: this.getGrommetIntlMessage('Username')}, + React.createElement("input", {id: "username", ref: "username", type: "email"}) + ), + React.createElement(FormField, {htmlFor: "password", label: this.getGrommetIntlMessage('Password')}, + React.createElement("input", {id: "password", ref: "password", type: "password"}) + ) + ), + errors, + React.createElement(Button, {className: CLASS_ROOT + "__submit", primary: true, strong: true, + label: this.getGrommetIntlMessage('Log In'), + onClick: this._onSubmit}), + footer + ) + ); + } + + }); + + module.exports = LoginForm; + + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + var ReactLayeredComponent = __webpack_require__(60); + var KeyboardAccelerators = __webpack_require__(61); + var Overlay = __webpack_require__(58); + var MoreIcon = __webpack_require__(62); + var DropCaretIcon = __webpack_require__(63); + + var ROOT_CLASS = "menu"; + + var MenuLayer = React.createClass({displayName: "MenuLayer", + + propTypes: { + align: React.PropTypes.oneOf(['top', 'bottom', 'left', 'right']), + direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right', 'center']), + id: React.PropTypes.string.isRequired, + onClick: React.PropTypes.func.isRequired, + router: React.PropTypes.func + }, + + childContextTypes: { + router: React.PropTypes.func + }, + + getChildContext: function () { + return { router: this.props.router }; + }, + + render: function () { + var classes = [ROOT_CLASS + "__layer"]; + if (this.props.direction) { + classes.push(ROOT_CLASS + "__layer--" + this.props.direction); + } + if (this.props.align) { + classes.push(ROOT_CLASS + "__layer--align-" + this.props.align); + } + + return ( + React.createElement("div", {id: this.props.id, className: classes.join(' '), + onClick: this.props.onClick}, + this.props.children + ) + ); + } + }); + + var Menu = React.createClass({displayName: "Menu", + + propTypes: { + align: React.PropTypes.oneOf(['top', 'bottom', 'left', 'right']), + closeOnClick: React.PropTypes.bool, + collapse: React.PropTypes.bool, + direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right', 'center']), + icon: React.PropTypes.node, + label: React.PropTypes.string, + primary: React.PropTypes.bool, + small: React.PropTypes.bool + }, + + contextTypes: { + router: React.PropTypes.func + }, + + getDefaultProps: function () { + return { + align: 'left', + closeOnClick: true, + direction: 'down', + small: false + }; + }, + + mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay], + + _onOpen: function (event) { + event.preventDefault(); + this.setState({active: true}); + }, + + _onClose: function () { + this.setState({active: false}); + }, + + _onFocusControl: function () { + this.setState({controlFocused: true}); + }, + + _onBlurControl: function () { + this.setState({controlFocused: false}); + }, + + _onSink: function (event) { + event.stopPropagation(); + // need to go native to prevent closing via document + event.nativeEvent.stopImmediatePropagation(); + }, + + getInitialState: function () { + return { + controlFocused: false, + active: false, + inline: (! this.props.label && ! this.props.icon && ! this.props.collapse) + }; + }, + + componentDidMount: function () { + if (this.refs.control) { + var controlElement = this.refs.control.getDOMNode(); + this.setState({ + layerId: 'menu-layer-' + controlElement.getAttribute('data-reactid') + }); + } + }, + + componentDidUpdate: function (prevProps, prevState) { + // Set up keyboard listeners appropriate to the current state. + + var activeKeyboardHandlers = { + esc: this._onClose, + space: this._onClose, + tab: this._onClose + }; + var focusedKeyboardHandlers = { + space: this._onOpen, + down: this._onOpen + }; + + // the order here is important, need to turn off keys before turning on + + if (! this.state.controlFocused && prevState.controlFocused) { + this.stopListeningToKeyboard(focusedKeyboardHandlers); + } + + if (! this.state.active && prevState.active) { + document.removeEventListener('click', this._onClose); + this.stopListeningToKeyboard(activeKeyboardHandlers); + this.stopOverlay(); + } + + // re-arm the space key in case we used it when active + if (this.state.controlFocused && (! prevState.controlFocused || + (! this.state.active && prevState.active))) { + this.startListeningToKeyboard(focusedKeyboardHandlers); + } + + if (this.state.active && ! prevState.active) { + document.addEventListener('click', this._onClose); + this.startListeningToKeyboard(activeKeyboardHandlers); + + var controlElement = this.refs.control.getDOMNode(); + var layerElement = document.getElementById(this.state.layerId); + var layerControlElement = layerElement.querySelectorAll("." + ROOT_CLASS + "__control")[0]; + var layerControlIconElement = layerElement.querySelectorAll('svg, img')[0]; + + // give layer control element the same line height and font size as the control + var fontSize = window.getComputedStyle(controlElement).fontSize; + layerControlElement.style.fontSize = fontSize; + var height = controlElement.clientHeight; + if (layerControlIconElement && + height <= (layerControlIconElement.clientHeight + 1)) { + // adjust to align with underlying control when control uses all height + if ('down' === this.props.direction) { + layerControlElement.style.marginTop = '-1px'; + } else if ('up' === this.props.direction) { + layerControlElement.style.marginBottom = '1px'; + } + } + layerControlElement.style.height = height + 'px'; + layerControlElement.style.lineHeight = height + 'px'; + + this.startOverlay(controlElement, layerElement, this.props.align); + } + }, + + componentWillUnmount: function () { + document.removeEventListener('click', this._onClose); + }, + + _renderControl: function () { + var result = null; + var icon = null; + var controlClassName = ROOT_CLASS + "__control"; + + var classes = [controlClassName]; + + if (this.props.icon) { + classes.push(controlClassName + "--labelled"); + icon = this.props.icon; + } else { + classes.push(controlClassName + "--fixed-label"); + icon = React.createElement(MoreIcon, null); + } + + if (this.props.label) { + result = ( + React.createElement("div", {className: classes.join(' ')}, + React.createElement("div", {className: controlClassName + "-icon"}, + icon + ), + React.createElement("span", {className: controlClassName + "-label"}, this.props.label), + React.createElement(DropCaretIcon, {className: controlClassName + "-drop-icon"}) + ) + ); + } else { + result = ( + React.createElement("div", {className: controlClassName}, + icon + ) + ); + } + return result; + }, + + _classes: function (prefix) { + var classes = [prefix]; + + if (this.props.direction) { + classes.push(prefix + "--" + this.props.direction); + } + if (this.props.align) { + classes.push(prefix + "--align-" + this.props.align); + } + if (this.props.small) { + classes.push(prefix + "--small"); + } + if (this.props.primary) { + classes.push(prefix + "--primary"); + } + + return classes; + }, + + render: function () { + var classes = this._classes(ROOT_CLASS); + if (this.state.inline) { + classes.push(ROOT_CLASS + "--inline"); + } else { + classes.push(ROOT_CLASS + "--controlled"); + if (this.props.label) { + classes.push(ROOT_CLASS + "--labelled"); + } + } + if (this.props.className) { + classes.push(this.props.className); + } + + if (this.state.inline) { + + return ( + React.createElement("div", {className: classes.join(' '), onClick: this._onClose}, + this.props.children + ) + ); + + } else { + + var controlContents = this._renderControl(); + + return ( + React.createElement("div", {ref: "control", className: classes.join(' '), + tabIndex: "0", + onClick: this._onOpen, + onFocus: this._onFocusControl, + onBlur: this._onBlurControl}, + controlContents + ) + ); + + } + }, + + renderLayer: function() { + if (this.state.active) { + + var controlContents = ( + React.createElement("div", {onClick: this._onClose}, + this._renderControl() + ) + ); + + var first = null; + var second = null; + if ('up' === this.props.direction) { + first = this.props.children; + second = controlContents; + } else { + first = controlContents; + second = this.props.children; + } + + var onClick; + if (this.props.closeOnClick) { + onClick = this._onClose; + } else { + onClick = this._onSink; + } + + return ( + React.createElement(MenuLayer, {router: this.context.router, + align: this.props.align, + direction: this.props.direction, + onClick: onClick, + id: this.state.layerId}, + first, + second + ) + ); + + } else { + return (React.createElement("span", null)); + } + } + + }); + + module.exports = Menu; + + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + + var DOM = __webpack_require__(59); + + // Overlay is a mixin for ensuring components layerd on top align with their initiating controls underneath. + var Overlay = { + + _overlay: { + controlElement: null, + layerElement: null, + align: null, + scrollParents: [] + }, + + startOverlay: function (controlElement, layerElement, align) { + this._overlay.controlElement = controlElement; + this._overlay.layerElement = layerElement; + this._overlay.align = align; + this._overlay.scrollParents = DOM.findScrollParents(this._overlay.controlElement); + this._overlay.scrollParents.forEach(function (parent) { + parent.addEventListener('scroll', this.positionOverlay); + }, this); + window.addEventListener('resize', this.positionOverlay); + + this.positionOverlay(); + }, + + stopOverlay: function () { + if (this._overlay.controlElement) { + this._overlay.scrollParents.forEach(function (parent) { + parent.removeEventListener('scroll', this.positionOverlay); + }, this); + window.removeEventListener('resize', this.positionOverlay); + this._overlay.controlElement = null; + this._overlay.layerElement = null; + this._overlay.align = null; + this._overlay.scrollParents = []; + } + }, + + positionOverlay: function () { + var controlElement = this._overlay.controlElement; + var layerElement = this._overlay.layerElement; + + var controlRect = controlElement.getBoundingClientRect(); + var windowWidth = window.innerWidth; + + // clear prior styling + layerElement.style.left = ''; + layerElement.style.width = ''; + layerElement.style.top = ''; + + var width = Math.min( + Math.max(controlRect.width, layerElement.offsetWidth), + windowWidth); + // align right edge and make at least as wide as the control + var left = (controlRect.left + layerElement.offsetWidth) - width; + if ('right' === this._overlay.align) { + // align right edge + left = (controlRect.left + controlRect.width) - + layerElement.offsetWidth; + } else { + // align left edge + left = controlRect.left; + } + if ((left + width) > windowWidth) { + left -= ((left + width) - windowWidth); + } else if (left < 0) { + left = 0; + } + + var top = controlRect.top; + if ('up' === this.props.direction) { + // align bottom edge + top = (controlRect.top + controlRect.height) - + layerElement.offsetHeight; + } else if ('below' === this._overlay.align) { + // align top of layer to bottom of control + top = (controlRect.top + controlRect.height); + } + + // ensure height is within viewport + var maxHeight = window.innerHeight - top; + + layerElement.style.left = '' + left + 'px'; + layerElement.style.width = '' + width + 'px'; + layerElement.style.top = '' + top + 'px'; + layerElement.style.maxHeight = '' + maxHeight + 'px'; + }, + + componentWillUnmount: function () { + this.stopOverlay(); + } + }; + + module.exports = Overlay; + + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + module.exports = { + findScrollParents: function (element) { + var result = []; + var parent = element.parentNode; + while (parent) { + // account for border the lazy way for now + if (parent.scrollHeight > (parent.offsetHeight + 10)) { + result.push(parent); + } + parent = parent.parentNode; + } + if (result.length === 0) { + result.push(document); + } + return result; + } + }; + + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + // http://jsfiddle.net/LBAr8/ + + var React = __webpack_require__(2); + + var ReactLayeredComponent = { + + componentWillUnmount: function() { + this._unrenderLayer(); + document.body.removeChild(this._target); + }, + componentDidUpdate: function() { + this._renderLayer(); + }, + componentDidMount: function() { + // Appending to the body is easier than managing the z-index of everything on the page. + // It's also better for accessibility and makes stacking a snap (since components will stack + // in mount order). + this._target = document.createElement('div'); + document.body.appendChild(this._target); + this._renderLayer(); + }, + _renderLayer: function() { + // By calling this method in componentDidMount() and componentDidUpdate(), you're effectively + // creating a "wormhole" that funnels React's hierarchical updates through to a DOM node on an + // entirely different part of the page. + React.render(this.renderLayer(), this._target); + }, + _unrenderLayer: function() { + React.unmountComponentAtNode(this._target); + } + }; + + module.exports = ReactLayeredComponent; + + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + + // Allow callers to use key labels instead of key code numbers. + // This makes their code easier to read. + var KEYS = { + backspace: 8, + tab: 9, + enter: 13, + esc: 27, + escape: 27, + space: 32, + left: 37, + up: 38, + right: 39, + down: 40, + comma: 188 + }; + + // KeyboardAccelerators is a mixin for handling keyboard events. + // Add listeners using startListeningToKeyboard(). + // Remove listeners using stopListeningToKeyboard(). + // When the component that includes this is unmounted, the keyboard event + // listener is removed automatically. + var KeyboardAccelerators = { + + _keyboardAcceleratorHandlers: {}, + _keyboardAcceleratorListening: false, + + _onKeyboardAcceleratorKeyPress: function (e) { + var key = (e.keyCode ? e.keyCode : e.which); + if (this._keyboardAcceleratorHandlers.hasOwnProperty(key)) { + this._keyboardAcceleratorHandlers[key](e); + } + }, + + // Add handlers for specific keys. + // This function can be called multiple times, existing handlers will + // be replaced, new handlers will be added. + startListeningToKeyboard: function (handlers) { + var keys = 0; + for (var key in handlers) { + if (handlers.hasOwnProperty(key)) { + var keyCode = key; + if (KEYS.hasOwnProperty(key)) { + keyCode = KEYS[key]; + } + keys += 1; + this._keyboardAcceleratorHandlers[keyCode] = handlers[key]; + } + } + + if (keys > 0 && ! this._keyboardAcceleratorListening) { + window.addEventListener("keydown", this._onKeyboardAcceleratorKeyPress); + this._keyboardAcceleratorListening = true; + } + }, + + // Remove handlers for all keys or specific keys. + // If no argument is passed in, all handlers are removed. + // This function can be called multiple times, only the handlers + // specified will be removed. + stopListeningToKeyboard: function (handlers) { + if (handlers) { + for (var key in handlers) { + if (handlers.hasOwnProperty(key)) { + var keyCode = key; + if (KEYS.hasOwnProperty(key)) { + keyCode = KEYS[key]; + } + delete this._keyboardAcceleratorHandlers[keyCode]; + } + } + } + + var keyCount = 0; + for (var keyHandler in this._keyboardAcceleratorHandlers) { + if (this._keyboardAcceleratorHandlers.hasOwnProperty(keyHandler)) { + keyCount += 1; + } + } + + if (! handlers || 0 === keyCount) { + window.removeEventListener("keydown", this._onKeyboardAcceleratorKeyPress); + this._keyboardAcceleratorHandlers = {}; + this._keyboardAcceleratorListening = false; + } + }, + + componentWillUnmount: function () { + this.stopListeningToKeyboard(); + } + }; + + module.exports = KeyboardAccelerators; + + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var More = React.createClass({displayName: "More", + + render: function() { + var className = 'control-icon control-icon-more'; + if (this.props.className) { + className += ' ' + this.props.className; + } + return ( + React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, + React.createElement("g", {fill: "none"}, + React.createElement("rect", {x: "23", y: "23", strokeWidth: "2", width: "2", height: "2"}), + React.createElement("rect", {x: "15", y: "23", strokeWidth: "2", width: "2", height: "2"}), + React.createElement("rect", {x: "31", y: "23", strokeWidth: "2", width: "2", height: "2"}) + ) + ) + ); + } + + }); + + module.exports = More; + + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var DropCaret = React.createClass({displayName: "DropCaret", + + render: function() { + var className = 'control-icon control-icon-drop-caret'; + if (this.props.className) { + className += ' ' + this.props.className; + } + return ( + React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, + React.createElement("g", {stroke: "none"}, + React.createElement("polygon", {points: "33.4,19.7 24.1,30.3 14.8,19.7"}) + ) + ) + ); + } + + }); + + module.exports = DropCaret; + + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + var Legend = __webpack_require__(48); + + var CLASS_ROOT = "meter"; + + var BAR_LENGTH = 192; + var BAR_THICKNESS = 24; + var MID_BAR_THICKNESS = BAR_THICKNESS / 2; + + var CIRCLE_WIDTH = 192; + var CIRCLE_RADIUS = 84; + + var ARC_HEIGHT = 144; + + function polarToCartesian (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)) + }; + } + + function arcCommands (x, y, radius, startAngle, endAngle) { + var start = polarToCartesian(x, y, radius, endAngle); + var end = polarToCartesian(x, y, radius, startAngle); + var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; + var d = [ + "M", start.x, start.y, + "A", radius, radius, 0, arcSweep, 0, end.x, end.y + ].join(" "); + return d; + } + + function activeIndicatorCommands (x, y, radius, startAngle, endAngle) { + var point = polarToCartesian(x, y, radius - 30, endAngle - 1); + var start = polarToCartesian(x, y, radius, endAngle - 1); + var d = ["M", start.x, start.y, + "L", point.x, point.y + ].join(" "); + return d; + } + + var Meter = React.createClass({displayName: "Meter", + + propTypes: { + important: React.PropTypes.number, + large: React.PropTypes.bool, + legend: React.PropTypes.bool, + legendTotal: React.PropTypes.bool, + max: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number.isRequired, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + min: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number.isRequired, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + series: React.PropTypes.arrayOf(React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.number.isRequired, + colorIndex: React.PropTypes.string, + important: React.PropTypes.bool, + onClick: React.PropTypes.func + })), + small: React.PropTypes.bool, + threshold: React.PropTypes.number, + thresholds: React.PropTypes.arrayOf(React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.number.isRequired, + colorIndex: React.PropTypes.string + })), + type: React.PropTypes.oneOf(['bar', 'arc', 'circle']), + units: React.PropTypes.string, + value: React.PropTypes.number, + vertical: React.PropTypes.bool + }, + + getDefaultProps: function () { + return { + type: 'bar' + }; + }, + + _initialTimeout: function () { + this.setState({ + initial: false, + activeIndex: this.state.importantIndex + }); + clearTimeout(this._timeout); + }, + + _onActivate: function (index) { + this.setState({initial: false, activeIndex: index}); + }, + + _onResize: function() { + // debounce + clearTimeout(this._resizeTimer); + this._resizeTimer = setTimeout(this._layout, 50); + }, + + _layout: function () { + // legendPosition based on available window orientation + var ratio = window.innerWidth / window.innerHeight; + if (ratio < 0.8) { + this.setState({legendPosition: 'bottom'}); + } else if (ratio > 1.2) { + this.setState({legendPosition: 'right'}); + } + /* + // content based on available real estate + var parentElement = this.refs.donut.getDOMNode().parentNode; + var width = parentElement.offsetWidth; + var height = parentElement.offsetHeight; + var donutHeight = BASE_SIZE; + if (this.props.partial) { + donutHeight = PARTIAL_SIZE; + } + if (height < donutHeight || width < BASE_SIZE || + (width < (BASE_SIZE * 2) && height < (donutHeight * 2))) { + this.setState({size: 'small'}); + } else { + this.setState({size: null}); + } + */ + }, + + _normalizeSeries: function (props, min, max) { + var series = []; + if (props.series) { + series = props.series; + } else if (props.value) { + //var remaining = max.value - props.value; + series = [ + {value: props.value, important: true} //, + //{value: remaining, colorIndex: 'unset'} + ]; + } + return series; + }, + + _normalizeThresholds: function (props, min, max) { + var thresholds = []; + if (props.thresholds) { + // Convert thresholds from absolute values to cummulative, + // so we can re-use the series drawing code. + var total = 0; + for (var i = 0; i < props.thresholds.length; i += 1) { + var threshold = props.thresholds[i]; + thresholds.push({ + label: threshold.label, + colorIndex: threshold.colorIndex + }); + if (i > 0) { + thresholds[i - 1].value = threshold.value - total; + total += thresholds[i - 1].value; + } + if (i === (props.thresholds.length - 1)) { + thresholds[i].value = max.value - total; + } + } + } else if (props.threshold) { + var remaining = max.value - props.threshold; + thresholds = [ + {value: props.threshold, colorIndex: 'unset'}, + {value: remaining, colorIndex: 'error'} + ]; + } else { + thresholds = [ + {value: max.value, colorIndex: 'unset'} + ]; + } + return thresholds; + }, + + _importantIndex: function (series) { + var result = series.length - 1; + if (this.props.hasOwnProperty('important')) { + result = this.props.important; + } + series.some(function (data, index) { + if (data.important) { + result = index; + return true; + } + }); + return result; + }, + + // Normalize min or max to an object. + _terminal: function (terminal) { + if (typeof terminal === 'number') { + terminal = {value: terminal}; + } + return terminal; + }, + + _seriesTotal: function (series) { + var total = 0; + series.some(function (item) { + total += item.value; + }); + return total; + }, + + _viewBoxDimensions: function () { + var viewBoxHeight; + var viewBoxWidth; + if ('arc' === this.props.type) { + if (this.props.vertical) { + viewBoxWidth = ARC_HEIGHT; + viewBoxHeight = CIRCLE_WIDTH; + } else { + viewBoxWidth = CIRCLE_WIDTH; + viewBoxHeight = ARC_HEIGHT; + } + } else if ('circle' === this.props.type) { + viewBoxWidth = CIRCLE_WIDTH; + viewBoxHeight = CIRCLE_WIDTH; + } else if ('bar' === this.props.type) { + if (this.props.vertical) { + viewBoxWidth = BAR_THICKNESS; + viewBoxHeight = BAR_LENGTH; + } else { + viewBoxWidth = BAR_LENGTH; + viewBoxHeight = BAR_THICKNESS; + } + } + return [viewBoxWidth, viewBoxHeight]; + }, + + // Generates state based on the provided props. + _stateFromProps: function (props) { + var total; + if (props.series && props.series.length > 1) { + total = this._seriesTotal(props.series); + } else if (props.max && props.max.value) { + total = props.max.value; + } else { + total = 100; + } + // Normalize min and max + var min = this._terminal(props.min || 0); + // Max could be provided in props or come from the total of + // a multi-value series. + var max = this._terminal(props.max || total); + // Normalize simple value prop to a series, if needed. + var series = this._normalizeSeries(props, min, max); + // Normalize simple threshold prop to an array, if needed. + var thresholds = this._normalizeThresholds(props, min, max); + // Determine important index. + var importantIndex = this._importantIndex(series); + ///total = this._seriesTotal(series); + // Determine the viewBox dimensions + var viewBoxDimensions = this._viewBoxDimensions(); + + var state = { + importantIndex: importantIndex, + activeIndex: importantIndex, + series: series, + thresholds: thresholds, + min: min, + max: max, + total: total, + viewBoxWidth: viewBoxDimensions[0], + viewBoxHeight: viewBoxDimensions[1] + }; + + if ('arc' === this.props.type) { + state.startAngle = 60; + state.anglePer = 240.0 / total; + if (this.props.vertical) { + state.angleOffset = 90; + } else { + state.angleOffset = 180; + } + } else if ('circle' === this.props.type) { + state.startAngle = 1; + state.anglePer = 358.0 / total; + state.angleOffset = 180; + } else if ('bar' === this.props.type) { + state.scale = BAR_LENGTH / (max.value - min.value); + } + + return state; + }, + + getInitialState: function() { + var state = this._stateFromProps(this.props); + state.legendPosition = 'bottom'; + state.initial = true; + return state; + }, + + componentDidMount: function() { + this._initialTimer = setTimeout(this._initialTimeout, 10); + window.addEventListener('resize', this._onResize); + this._onResize(); + }, + + componentWillReceiveProps: function (newProps) { + var state = this._stateFromProps(newProps); + this.setState(state); + this._onResize(); + }, + + componentWillUnmount: function() { + clearTimeout(this._initialTimer); + clearTimeout(this._resizeTimer); + window.removeEventListener('resize', this._onResize); + }, + + _itemColorIndex: function (item, index) { + return item.colorIndex || ('graph-' + (index + 1)); + }, + + _translateBarWidth: function (value) { + return Math.round(this.state.scale * value); + }, + + _barCommands: function (start, distance) { + var commands; + if (this.props.vertical) { + commands = "M" + MID_BAR_THICKNESS + "," + (BAR_LENGTH - start) + + " L" + MID_BAR_THICKNESS + "," + (BAR_LENGTH - (start + distance)); + } else { + commands = "M" + start + "," + MID_BAR_THICKNESS + + " L" + (start + distance) + "," + MID_BAR_THICKNESS; + } + return commands; + }, + + _renderBar: function (series) { + var start = 0; + var minRemaining = this.state.min.value; + var classes; + var commands; + + var paths = series.map(function (item, index) { + var colorIndex = this._itemColorIndex(item, index); + classes = [CLASS_ROOT + "__bar"]; + if (index === this.state.activeIndex) { + classes.push(CLASS_ROOT + "__bar--active"); + } + classes.push("color-index-" + colorIndex); + + var value = item.value - minRemaining; + minRemaining = Math.max(0, minRemaining - item.value); + var distance = this._translateBarWidth(value); + commands = this._barCommands(start, distance); + start += distance; + + return ( + React.createElement("path", {key: index, className: classes.join(' '), d: commands, + onMouseOver: this._onActivate.bind(this, index), + onMouseOut: this._onActivate.bind(this, this.state.importantIndex), + onClick: item.onClick}) + ); + }, this); + + if (paths.length === 0) { + classes = [CLASS_ROOT + "__bar"]; + classes.push(CLASS_ROOT + "__bar--loading"); + classes.push("color-index-loading"); + commands = this._barCommands(0, BAR_LENGTH); + paths.push( + React.createElement("path", {key: "loading", className: classes.join(' '), d: commands}) + ); + } + + return paths; + }, + + _translateEndAngle: function (startAngle, value) { + return Math.min(360, Math.max(0, + startAngle + (this.state.anglePer * value))); + }, + + _arcCommands: function (startAngle, endAngle) { + return arcCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, + startAngle + this.state.angleOffset, + endAngle + this.state.angleOffset); + }, + + _renderArcOrCircle: function (series) { + var startAngle = this.state.startAngle; + var classes; + var endAngle; + var commands; + + var paths = series.map(function (item, index) { + var classes = [CLASS_ROOT + "__slice"]; + if (index === this.state.activeIndex) { + classes.push(CLASS_ROOT + "__slice--active"); + } + var colorIndex = this._itemColorIndex(item, index); + classes.push("color-index-" + colorIndex); + endAngle = this._translateEndAngle(startAngle, item.value); + commands = this._arcCommands(startAngle, endAngle); + + startAngle = endAngle; + + return ( + React.createElement("path", {key: item.label || index, fill: "none", + className: classes.join(' '), d: commands, + onMouseOver: this._onActivate.bind(this, index), + onMouseOut: this._onActivate.bind(this, this.state.importantIndex), + onClick: item.onClick}) + ); + }, this); + + if (paths.length === 0) { + classes = [CLASS_ROOT + "__slice"]; + classes.push(CLASS_ROOT + "__slice--loading"); + classes.push("color-index-loading"); + endAngle = this._translateEndAngle(this.state.startAngle, this.state.max.value); + commands = this._arcCommands(this.state.startAngle, endAngle); + paths.push( + React.createElement("path", {key: "loading", className: classes.join(' '), d: commands}) + ); + } + + return paths; + }, + + _renderActiveIndicator: function (series) { + var activeIndicator = null; + var startAngle = this.state.startAngle; + series.forEach(function (item, index) { + var colorIndex = this._itemColorIndex(item, index); + var endAngle = this._translateEndAngle(startAngle, item.value); + + if (index === this.state.activeIndex) { + var indicatorCommands = + activeIndicatorCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, + startAngle + this.state.angleOffset, + endAngle + this.state.angleOffset); + activeIndicator = ( + React.createElement("path", {fill: "none", + className: CLASS_ROOT + "__slice-indicator color-index-" + colorIndex, + d: indicatorCommands}) + ); + } + + startAngle = endAngle; + }, this); + + return activeIndicator; + }, + + _renderActive: function () { + var result; + var active = this.state.series[this.state.activeIndex]; + if ('arc' === this.props.type || 'circle' === this.props.type) { + result = ( + React.createElement("div", {className: CLASS_ROOT + "__active"}, + React.createElement("div", {className: CLASS_ROOT + "__active-value large-number-font"}, + active.value, + React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, + this.props.units + ) + ), + React.createElement("div", {className: CLASS_ROOT + "__active-label"}, + active.label + ) + ) + ); + } else if ('bar' === this.props.type) { + result = ( + React.createElement("span", {className: CLASS_ROOT + "__active"}, + React.createElement("span", {className: CLASS_ROOT + "__active-value large-number-font"}, + active.value + ), + React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, + this.props.units + ) + ) + ); + } + return result; + }, + + _renderLegend: function () { + return ( + React.createElement(Legend, {className: CLASS_ROOT + "__legend", + series: this.state.series, + units: this.props.units, + activeIndex: this.state.activeIndex, + onActive: this._onActive}) + ); + }, + + render: function() { + var classes = [CLASS_ROOT]; + classes.push(CLASS_ROOT + "--" + this.props.type); + classes.push(CLASS_ROOT + "--legend-" + this.state.legendPosition); + if (this.props.vertical) { + classes.push(CLASS_ROOT + "--vertical"); + } + if (this.props.small) { + classes.push(CLASS_ROOT + "--small"); + } + if (this.props.large) { + classes.push(CLASS_ROOT + "--large"); + } + if (this.state.series.length === 0) { + classes.push(CLASS_ROOT + "--loading"); + } + if (this.props.className) { + classes.push(this.props.className); + } + + var values = null; + var thresholds = null; + var activeIndicator = null; + if ('arc' === this.props.type || 'circle' === this.props.type) { + values = this._renderArcOrCircle(this.state.series); + thresholds = this._renderArcOrCircle(this.state.thresholds); + activeIndicator = this._renderActiveIndicator(this.state.series); + } else if ('bar' === this.props.type) { + values = this._renderBar(this.state.series); + thresholds = this._renderBar(this.state.thresholds); + } + + var minLabel = null; + if (this.state.min.label) { + minLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__label-min"}, + this.state.min.label + ) + ); + } + var maxLabel = null; + if (this.state.max.label) { + maxLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__label-max"}, + this.state.max.label + ) + ); + } + + var active = null; + if (this.state.activeIndex >= 0) { + active = this._renderActive(); + } + + var legend = null; + if (this.props.legend) { + legend = this._renderLegend(); + } + + return ( + React.createElement("div", {className: classes.join(' ')}, + React.createElement("div", {className: CLASS_ROOT + "__active-graphic"}, + React.createElement("div", {className: CLASS_ROOT + "__labeled-graphic"}, + React.createElement("svg", {className: CLASS_ROOT + "__graphic", + viewBox: "0 0 " + this.state.viewBoxWidth + + " " + this.state.viewBoxHeight, + preserveAspectRatio: "xMidYMid meet"}, + React.createElement("g", {className: CLASS_ROOT + "__thresholds"}, + thresholds + ), + React.createElement("g", {className: CLASS_ROOT + "__values"}, + values + ), + activeIndicator + ), + React.createElement("div", {className: CLASS_ROOT + "__labels-container"}, + React.createElement("div", {className: CLASS_ROOT + "__labels"}, + minLabel, + maxLabel + ) + ) + ), + active + ), + legend + ) + ); + } + + }); + + module.exports = Meter; - /* (ignored) */ /***/ }, -/* 68 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { - /* jshint esnext: true */ + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + var React = __webpack_require__(2); - "use strict"; - exports.__addLocaleData = __addLocaleData; - var intl$messageformat$$ = __webpack_require__(95), intl$relativeformat$$ = __webpack_require__(96), src$en$$ = __webpack_require__(85), src$mixin$$ = __webpack_require__(86), src$components$date$$ = __webpack_require__(87), src$components$time$$ = __webpack_require__(88), src$components$relative$$ = __webpack_require__(89), src$components$number$$ = __webpack_require__(90), src$components$message$$ = __webpack_require__(91), src$components$html$message$$ = __webpack_require__(92); - function __addLocaleData(data) { - intl$messageformat$$["default"].__addLocaleData(data); - intl$relativeformat$$["default"].__addLocaleData(data); - } + var Panel = React.createClass({displayName: "Panel", - __addLocaleData(src$en$$["default"]); - exports.IntlMixin = src$mixin$$["default"], exports.FormattedDate = src$components$date$$["default"], exports.FormattedTime = src$components$time$$["default"], exports.FormattedRelative = src$components$relative$$["default"], exports.FormattedNumber = src$components$number$$["default"], exports.FormattedMessage = src$components$message$$["default"], exports.FormattedHTMLMessage = src$components$html$message$$["default"]; + propTypes: { + direction: React.PropTypes.string, + index: React.PropTypes.oneOf([1, 2]) + }, + + render: function() { + var classes = ["panel"]; + if (this.props.direction === 'horizontal') { + classes.push("panel--horizontal"); + } + if (this.props.index) { + classes.push("panel--index-" + this.props.index); + } + + var title = null; + if (this.props.title) { + title = (React.createElement("h2", {className: "panel__title"}, this.props.title)); + } + + return ( + React.createElement("div", {className: classes.join(' ')}, + title, + this.props.children + ) + ); + } + }); + + module.exports = Panel; - //# sourceMappingURL=react-intl.js.map /***/ }, -/* 69 */ +/* 66 */ /***/ function(module, exports, __webpack_require__) { - /** - * A module of methods that you want to include in all actions. - * This module is consumed by `createAction`. - */ - module.exports = { - }; + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + + var React = __webpack_require__(2); + + var CLASS_ROOT = "radio-button"; + + var RadioButton = React.createClass({displayName: "RadioButton", + + propTypes: { + checked: React.PropTypes.bool, + defaultChecked: React.PropTypes.bool, + id: React.PropTypes.string.isRequired, + label: React.PropTypes.string.isRequired, + name: React.PropTypes.string, + onChange: React.PropTypes.func + }, + + render: function () { + var classes = [CLASS_ROOT]; + if (this.props.className) { + classes.push(this.props.className); + } + return ( + React.createElement("label", {className: classes.join(' ')}, + React.createElement("input", {className: CLASS_ROOT + "__input", + id: this.props.id, name: this.props.name, type: "radio", + checked: this.props.checked, + defaultChecked: this.props.defaultChecked, + onChange: this.props.onChange}), + React.createElement("span", {className: CLASS_ROOT + "__control"}), + React.createElement("span", {className: CLASS_ROOT + "__label"}, + this.props.label + ) + ) + ); + } + + }); + + module.exports = RadioButton; /***/ }, -/* 70 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { - var _ = __webpack_require__(81), - maker = __webpack_require__(80).instanceJoinCreator; + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - /** - * Extract child listenables from a parent from their - * children property and return them in a keyed Object - * - * @param {Object} listenable The parent listenable - */ - var mapChildListenables = function(listenable) { - var i = 0, children = {}, childName; - for (;i < (listenable.children||[]).length; ++i) { - childName = listenable.children[i]; - if(listenable[childName]){ - children[childName] = listenable[childName]; - } + var React = __webpack_require__(2); + var ReactLayeredComponent = __webpack_require__(60); + var KeyboardAccelerators = __webpack_require__(61); + var Overlay = __webpack_require__(58); + var SearchIcon = __webpack_require__(68); + var IntlMixin = __webpack_require__(4); + + var CLASS_ROOT = "search"; + + var Search = React.createClass({displayName: "Search", + + propTypes: { + align: React.PropTypes.oneOf(['left', 'right']), + defaultValue: React.PropTypes.string, + inline: React.PropTypes.bool, + onChange: React.PropTypes.func, + placeHolder: React.PropTypes.string, + suggestions: React.PropTypes.arrayOf(React.PropTypes.string) + }, + + getDefaultProps: function () { + return { + align: 'left', + inline: false, + placeHolder: 'Search' + }; + }, + + mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay, IntlMixin], + + _onAddLayer: function (event) { + event.preventDefault(); + this.setState({layer: true, activeSuggestionIndex: -1}); + }, + + _onRemoveLayer: function () { + this.setState({layer: false}); + }, + + _onFocusControl: function () { + this.setState({ + controlFocused: true, + layer: true, + activeSuggestionIndex: -1 + }); + }, + + _onBlurControl: function () { + this.setState({controlFocused: false}); + }, + + _onFocusInput: function () { + this.refs.input.getDOMNode().select(); + this.setState({ + layer: (! this.state.inline || this.props.suggestions), + activeSuggestionIndex: -1 + }); + }, + + _onBlurInput: function () { + //this.setState({layer: false}); + }, + + _onChangeInput: function (event) { + this.setState({activeSuggestionIndex: -1}); + if (this.props.onChange) { + this.props.onChange(event.target.value); } - return children; - }; + }, - /** - * Make a flat dictionary of all listenables including their - * possible children (recursively), concatenating names in camelCase. - * - * @param {Object} listenables The top-level listenables - */ - var flattenListenables = function(listenables) { - var flattened = {}; - for(var key in listenables){ - var listenable = listenables[key]; - var childMap = mapChildListenables(listenable); + _onNextSuggestion: function () { + var index = this.state.activeSuggestionIndex; + index = Math.min(index + 1, this.props.suggestions.length - 1); + this.setState({activeSuggestionIndex: index}); + }, + + _onPreviousSuggestion: function () { + var index = this.state.activeSuggestionIndex; + index = Math.max(index - 1, 0); + this.setState({activeSuggestionIndex: index}); + }, + + _onEnter: function () { + if (this.state.activeSuggestionIndex >= 0) { + var text = this.props.suggestions[this.state.activeSuggestionIndex]; + if (this.props.onChange) { + this.props.onChange(text); + } + } + this._onRemoveLayer(); + }, + + _onClickSuggestion: function (item) { + if (this.props.onChange) { + this.props.onChange(item); + } + this._onRemoveLayer(); + }, + + _onSink: function (event) { + event.stopPropagation(); + event.nativeEvent.stopImmediatePropagation(); + }, + + _layout: function () { + if (window.innerWidth < 600) { + this.setState({inline: false}); + } else { + this.setState({inline: this.props.inline}); + } + }, + + _onResize: function () { + // debounce + clearTimeout(this._resizeTimer); + this._resizeTimer = setTimeout(this._layout, 50); + }, + + getInitialState: function () { + return { + align: 'left', + controlFocused: false, + inline: this.props.inline, + layer: false, + activeSuggestionIndex: -1 + }; + }, - // recursively flatten children - var children = flattenListenables(childMap); + componentDidMount: function () { + window.addEventListener('resize', this._onResize); + this._layout(); + }, - // add the primary listenable and chilren - flattened[key] = listenable; - for(var childKey in children){ - var childListenable = children[childKey]; - flattened[key + _.capitalize(childKey)] = childListenable; - } - } + componentDidUpdate: function (prevProps, prevState) { - return flattened; - }; + // Set up keyboard listeners appropriate to the current state. - /** - * A module of methods related to listening. - */ - module.exports = { + var activeKeyboardHandlers = { + esc: this._onRemoveLayer, + tab: this._onRemoveLayer, + up: this._onPreviousSuggestion, + down: this._onNextSuggestion, + enter: this._onEnter + }; + var focusedKeyboardHandlers = { + space: this._onAddLayer + }; - /** - * An internal utility function used by `validateListening` - * - * @param {Action|Store} listenable The listenable we want to search for - * @returns {Boolean} The result of a recursive search among `this.subscriptions` - */ - hasListener: function(listenable) { - var i = 0, j, listener, listenables; - for (;i < (this.subscriptions||[]).length; ++i) { - listenables = [].concat(this.subscriptions[i].listenable); - for (j = 0; j < listenables.length; j++){ - listener = listenables[j]; - if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) { - return true; - } - } - } - return false; - }, + // the order here is important, need to turn off keys before turning on - /** - * A convenience method that listens to all listenables in the given object. - * - * @param {Object} listenables An object of listenables. Keys will be used as callback method names. - */ - listenToMany: function(listenables){ - var allListenables = flattenListenables(listenables); - for(var key in allListenables){ - var cbname = _.callbackName(key), - localname = this[cbname] ? cbname : this[key] ? key : undefined; - if (localname){ - this.listenTo(allListenables[key],localname,this[cbname+"Default"]||this[localname+"Default"]||localname); - } - } - }, + if (! this.state.controlFocused && prevState.controlFocused) { + this.stopListeningToKeyboard(focusedKeyboardHandlers); + } - /** - * Checks if the current context can listen to the supplied listenable - * - * @param {Action|Store} listenable An Action or Store that should be - * listened to. - * @returns {String|Undefined} An error message, or undefined if there was no problem. - */ - validateListening: function(listenable){ - if (listenable === this) { - return "Listener is not able to listen to itself"; - } - if (!_.isFunction(listenable.listen)) { - return listenable + " is missing a listen method"; - } - if (listenable.hasListener && listenable.hasListener(this)) { - return "Listener cannot listen to this listenable because of circular loop"; - } - }, + if (! this.state.layer && prevState.layer) { + document.removeEventListener('click', this._onRemoveLayer); + this.stopListeningToKeyboard(activeKeyboardHandlers); + this.stopOverlay(); + } - /** - * Sets up a subscription to the given listenable for the context object - * - * @param {Action|Store} listenable An Action or Store that should be - * listened to. - * @param {Function|String} callback The callback to register as event handler - * @param {Function|String} defaultCallback The callback to register as default handler - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to - */ - listenTo: function(listenable, callback, defaultCallback) { - var desub, unsubscriber, subscriptionobj, subs = this.subscriptions = this.subscriptions || []; - _.throwIf(this.validateListening(listenable)); - this.fetchInitialState(listenable, defaultCallback); - desub = listenable.listen(this[callback]||callback, this); - unsubscriber = function() { - var index = subs.indexOf(subscriptionobj); - _.throwIf(index === -1,'Tried to remove listen already gone from subscriptions list!'); - subs.splice(index, 1); - desub(); - }; - subscriptionobj = { - stop: unsubscriber, - listenable: listenable - }; - subs.push(subscriptionobj); - return subscriptionobj; - }, + if (this.state.controlFocused && ! prevState.controlFocused) { + this.startListeningToKeyboard(focusedKeyboardHandlers); + } - /** - * Stops listening to a single listenable - * - * @param {Action|Store} listenable The action or store we no longer want to listen to - * @returns {Boolean} True if a subscription was found and removed, otherwise false. - */ - stopListeningTo: function(listenable){ - var sub, i = 0, subs = this.subscriptions || []; - for(;i < subs.length; i++){ - sub = subs[i]; - if (sub.listenable === listenable){ - sub.stop(); - _.throwIf(subs.indexOf(sub)!==-1,'Failed to remove listen from subscriptions list!'); - return true; - } - } - return false; - }, + if (this.state.layer && ! prevState.layer) { + document.addEventListener('click', this._onRemoveLayer); + this.startListeningToKeyboard(activeKeyboardHandlers); - /** - * Stops all subscriptions and empties subscriptions array - */ - stopListeningToAll: function(){ - var remaining, subs = this.subscriptions || []; - while((remaining=subs.length)){ - subs[0].stop(); - _.throwIf(subs.length!==remaining-1,'Failed to remove listen from subscriptions list!'); - } - }, + var baseElement = + (this.refs.control ? this.refs.control : this.refs.input).getDOMNode(); + var layerElement = document.getElementById('search-layer'); + var layerControlElement = layerElement.querySelectorAll('.search__control')[0]; + var layerControlIconElement = layerElement.querySelectorAll('svg')[0]; + var inputElement = layerElement.querySelectorAll('.search__input')[0]; - /** - * Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method. - * @param {Action|Store} listenable The publisher we want to get initial state from - * @param {Function|String} defaultCallback The method to receive the data - */ - fetchInitialState: function (listenable, defaultCallback) { - defaultCallback = (defaultCallback && this[defaultCallback]) || defaultCallback; - var me = this; - if (_.isFunction(defaultCallback) && _.isFunction(listenable.getInitialState)) { - var data = listenable.getInitialState(); - if (data && _.isFunction(data.then)) { - data.then(function() { - defaultCallback.apply(me, arguments); - }); - } else { - defaultCallback.call(this, data); - } - } - }, + // give input element the same line height and font size as the control + var fontSize = window.getComputedStyle(baseElement).fontSize; + inputElement.style.fontSize = fontSize; + var height = baseElement.clientHeight; + if (layerControlIconElement && height <= layerControlIconElement.clientHeight) { + // adjust to align with underlying control when control uses all height + layerControlElement.style.marginTop = '-2px'; + } + inputElement.style.height = height + 'px'; + if (layerControlElement) { + layerControlElement.style.height = height + 'px'; + layerControlElement.style.lineHeight = height + 'px'; + } - /** - * The callback will be called once all listenables have triggered at least once. - * It will be invoked with the last emission from each listenable. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinTrailing: maker("last"), + this.startOverlay(baseElement, layerElement, this.props.align); + inputElement.focus(); + } + }, - /** - * The callback will be called once all listenables have triggered at least once. - * It will be invoked with the first emission from each listenable. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinLeading: maker("first"), + componentWillUnmount: function () { + document.removeEventListener('click', this._onRemoveLayer); + window.removeEventListener('resize', this._onResize); + }, - /** - * The callback will be called once all listenables have triggered at least once. - * It will be invoked with all emission from each listenable. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinConcat: maker("all"), + focus: function () { + var ref = this.refs.input || this.refs.control; + if (ref) { + ref.getDOMNode().focus(); + } + }, - /** - * The callback will be called once all listenables have triggered. - * If a callback triggers twice before that happens, an error is thrown. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinStrict: maker("strict") - }; + _createControl: function () { + var controlClassName = CLASS_ROOT + "__control"; + return ( + React.createElement("div", {className: controlClassName}, + React.createElement(SearchIcon, null) + ) + ); + }, + + _classes: function (prefix) { + var classes = [prefix]; + + if (this.state.inline) { + classes.push(prefix + "--inline"); + } else { + classes.push(prefix + "--controlled"); + } + if (this.props.align) { + classes.push(prefix + "--align-" + this.props.align); + } + return classes; + }, -/***/ }, -/* 71 */ -/***/ function(module, exports, __webpack_require__) { + render: function () { - var _ = __webpack_require__(81); + var classes = this._classes(CLASS_ROOT); + if (this.props.className) { + classes.push(this.props.className); + } - /** - * A module of methods for object that you want to be able to listen to. - * This module is consumed by `createStore` and `createAction` - */ - module.exports = { + if (this.state.inline) { - /** - * Hook used by the publisher that is invoked before emitting - * and before `shouldEmit`. The arguments are the ones that the action - * is invoked with. If this function returns something other than - * undefined, that will be passed on as arguments for shouldEmit and - * emission. - */ - preEmit: function() {}, + var readOnly = this.props.suggestions ? true : false; - /** - * Hook used by the publisher after `preEmit` to determine if the - * event should be emitted with given arguments. This may be overridden - * in your application, default implementation always returns true. - * - * @returns {Boolean} true if event should be emitted - */ - shouldEmit: function() { return true; }, + return ( + React.createElement("div", {className: classes.join(' ')}, + React.createElement("input", {ref: "input", type: "search", + placeholder: this.getGrommetIntlMessage(this.props.placeHolder), + value: this.props.defaultValue, + className: CLASS_ROOT + "__input", + readOnly: readOnly, + onFocus: this._onFocusInput, + onBlur: this._onBlurInput, + onChange: this._onChangeInput}) + ) + ); - /** - * Subscribes the given callback for action triggered - * - * @param {Function} callback The callback to register as event handler - * @param {Mixed} [optional] bindContext The context to bind the callback with - * @returns {Function} Callback that unsubscribes the registered event handler - */ - listen: function(callback, bindContext) { - bindContext = bindContext || this; - var eventHandler = function(args) { - if (aborted){ - return; - } - callback.apply(bindContext, args); - }, me = this, aborted = false; - this.emitter.addListener(this.eventLabel, eventHandler); - return function() { - aborted = true; - me.emitter.removeListener(me.eventLabel, eventHandler); - }; - }, + } else { - /** - * Attach handlers to promise that trigger the completed and failed - * child publishers, if available. - * - * @param {Object} The promise to attach to - */ - promise: function(promise) { - var me = this; + var controlContents = this._createControl(); - var canHandlePromise = - this.children.indexOf('completed') >= 0 && - this.children.indexOf('failed') >= 0; + return ( + React.createElement("div", {ref: "control", className: classes.join(' '), + tabIndex: "0", + onClick: this._onAddLayer, + onFocus: this._onFocusControl, + onBlur: this._onBlurControl}, + controlContents + ) + ); + } + }, - if (!canHandlePromise){ - throw new Error('Publisher must have "completed" and "failed" child publishers'); - } + renderLayer: function() { + if (this.state.layer) { - promise.then(function(response) { - return me.completed(response); - }, function(error) { - return me.failed(error); - }); - }, + var classes = this._classes(CLASS_ROOT + "__layer"); - /** - * Subscribes the given callback for action triggered, which should - * return a promise that in turn is passed to `this.promise` - * - * @param {Function} callback The callback to register as event handler - */ - listenAndPromise: function(callback, bindContext) { - var me = this; - bindContext = bindContext || this; - this.willCallPromise = (this.willCallPromise || 0) + 1; + var suggestions = null; + if (this.props.suggestions) { + suggestions = this.props.suggestions.map(function (item, index) { + var classes = [CLASS_ROOT + "__suggestion"]; + if (index === this.state.activeSuggestionIndex) { + classes.push(CLASS_ROOT + "__suggestion--active"); + } + return ( + React.createElement("div", {key: item, + className: classes.join(' '), + onClick: this._onClickSuggestion.bind(this, item)}, + item + ) + ); + }, this); + } - var removeListen = this.listen(function() { + var contents = ( + React.createElement("div", {className: CLASS_ROOT + "__layer-contents", onClick: this._onSink}, + React.createElement("input", {type: "search", + defaultValue: this.props.defaultValue, + className: CLASS_ROOT + "__input", + onChange: this._onChangeInput}), + React.createElement("div", {className: CLASS_ROOT + "__suggestions"}, + suggestions + ) + ) + ); - if (!callback) { - throw new Error('Expected a function returning a promise but got ' + callback); - } + if (! this.state.inline) { + var control = this._createControl(); + var rightAlign = ('right' === this.props.align); + var first = rightAlign ? contents : control; + var second = rightAlign ? control : contents; - var args = arguments, - promise = callback.apply(bindContext, args); - return me.promise.call(me, promise); - }, bindContext); + contents = ( + React.createElement("div", {className: CLASS_ROOT + "__layer-header"}, + first, + second + ) + ); + } - return function () { - me.willCallPromise--; - removeListen.call(me); - }; + return ( + React.createElement("div", {id: "search-layer", className: classes.join(' ')}, + contents + ) + ); - }, + } else { // no layer + return (React.createElement("span", null)); + } + } - /** - * Publishes an event using `this.emitter` (if `shouldEmit` agrees) - */ - trigger: function() { - var args = arguments, - pre = this.preEmit.apply(this, args); - args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre); - if (this.shouldEmit.apply(this, args)) { - this.emitter.emit(this.eventLabel, args); - } - }, + }); - /** - * Tries to publish the event on the next tick - */ - triggerAsync: function(){ - var args = arguments,me = this; - _.nextTick(function() { - me.trigger.apply(me, args); - }); - }, + module.exports = Search; - /** - * Returns a Promise for the triggered action - * - * @return {Promise} - * Resolved by completed child action. - * Rejected by failed child action. - * If listenAndPromise'd, then promise associated to this trigger. - * Otherwise, the promise is for next child action completion. - */ - triggerPromise: function(){ - var me = this; - var args = arguments; - var canHandlePromise = - this.children.indexOf('completed') >= 0 && - this.children.indexOf('failed') >= 0; +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { - var promise = _.createPromise(function(resolve, reject) { - // If `listenAndPromise` is listening - // patch `promise` w/ context-loaded resolve/reject - if (me.willCallPromise) { - _.nextTick(function() { - var old_promise_method = me.promise; - me.promise = function (promise) { - promise.then(resolve, reject); - // Back to your regularly schedule programming. - me.promise = old_promise_method; - return me.promise.apply(me, arguments); - }; - me.trigger.apply(me, args); - }); - return; - } + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - if (canHandlePromise) { - var removeSuccess = me.completed.listen(function(args) { - removeSuccess(); - removeFailed(); - resolve(args); - }); + var React = __webpack_require__(2); - var removeFailed = me.failed.listen(function(args) { - removeSuccess(); - removeFailed(); - reject(args); - }); - } + var Search = React.createClass({displayName: "Search", - me.triggerAsync.apply(me, args); + render: function() { + var className = 'control-icon control-icon-search'; + if (this.props.className) { + className += ' ' + this.props.className; + } + return ( + React.createElement("svg", {className: className, viewBox: "0 0 48 48", version: "1.1"}, + React.createElement("g", {fill: "none"}, + React.createElement("circle", {strokeWidth: "2", cx: "21.5", cy: "21.5", r: "9"}), + React.createElement("line", {strokeWidth: "2", x1: "35.5", y1: "35.5", x2: "27.8", y2: "27.8"}) + ) + ) + ); + } - if (!canHandlePromise) { - resolve(); - } - }); + }); - return promise; - } - }; + module.exports = Search; /***/ }, -/* 72 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { - /** - * A module of methods that you want to include in all stores. - * This module is consumed by `createStore`. - */ - module.exports = { - }; + // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. + var React = __webpack_require__(2); + var ReactLayeredComponent = __webpack_require__(60); + var KeyboardAccelerators = __webpack_require__(61); + var Overlay = __webpack_require__(58); + var SearchIcon = __webpack_require__(68); -/***/ }, -/* 73 */ -/***/ function(module, exports, __webpack_require__) { + var CLASS_ROOT = "search-input"; - var _ = __webpack_require__(81), - Reflux = __webpack_require__(64), - Keep = __webpack_require__(82), - allowed = {preEmit:1,shouldEmit:1}; + var SearchInput = React.createClass({displayName: "SearchInput", - /** - * Creates an action functor object. It is mixed in with functions - * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may - * be overridden in the definition object. - * - * @param {Object} definition The action object definition - */ - var createAction = function(definition) { + propTypes: { + defaultValue: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.string + }), + React.PropTypes.string + ]), + id: React.PropTypes.string, + name: React.PropTypes.string, + onChange: React.PropTypes.func, + onSearch: React.PropTypes.func, + suggestions: React.PropTypes.arrayOf( + React.PropTypes.oneOfType([ + React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.string + }), + React.PropTypes.string + ]) + ), + value: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.string + }), + React.PropTypes.string + ]) + }, - definition = definition || {}; - if (!_.isObject(definition)){ - definition = {actionName: definition}; - } + mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay], - for(var a in Reflux.ActionMethods){ - if (!allowed[a] && Reflux.PublisherMethods[a]) { - throw new Error("Cannot override API method " + a + - " in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead." - ); - } - } + _onInputChange: function (event) { + this.props.onChange(event.target.value); + }, - for(var d in definition){ - if (!allowed[d] && Reflux.PublisherMethods[d]) { - throw new Error("Cannot override API method " + d + - " in action creation. Use another method name or override it on Reflux.PublisherMethods instead." - ); - } - } + _onOpen: function (event) { + event.preventDefault(); + this.setState({active: true, activeSuggestionIndex: -1}); + }, - definition.children = definition.children || []; - if (definition.asyncResult){ - definition.children = definition.children.concat(["completed","failed"]); - } + _onClose: function () { + this.setState({active: false}); + }, - var i = 0, childActions = {}; - for (; i < definition.children.length; i++) { - var name = definition.children[i]; - childActions[name] = createAction(name); + _onSearchChange: function (event) { + this.setState({activeSuggestionIndex: -1}); + this.props.onSearch(event.target.value); + }, + + _onNextSuggestion: function () { + var index = this.state.activeSuggestionIndex; + index = Math.min(index + 1, this.props.suggestions.length - 1); + this.setState({activeSuggestionIndex: index}); + }, + + _onPreviousSuggestion: function () { + var index = this.state.activeSuggestionIndex; + index = Math.max(index - 1, 0); + this.setState({activeSuggestionIndex: index}); + }, + + _onEnter: function () { + this.setState({active: false}); + this._activation(false); + if (this.state.activeSuggestionIndex >= 0) { + var suggestion = this.props.suggestions[this.state.activeSuggestionIndex]; + this.setState({value: suggestion}); + this.props.onChange(suggestion); } + }, - var context = _.extend({ - eventLabel: "action", - emitter: new _.EventEmitter(), - _isAction: true - }, Reflux.PublisherMethods, Reflux.ActionMethods, definition); + _onClickSuggestion: function (suggestion) { + this.setState({value: suggestion}); + this._activation(false); + this.props.onChange(suggestion); + }, - var functor = function() { - return functor[functor.sync?"trigger":"triggerPromise"].apply(functor, arguments); + _activation: function (active) { + + var listeners = { + esc: this._onClose, + tab: this._onClose, + up: this._onPreviousSuggestion, + down: this._onNextSuggestion, + enter: this._onEnter }; - _.extend(functor,childActions,context); + if (active) { - Keep.createdActions.push(functor); + document.addEventListener('click', this._onClose); + this.startListeningToKeyboard(listeners); - return functor; + var element = this.refs.component.getDOMNode(); + var layerElement = document.getElementById(CLASS_ROOT + '-layer'); + this.startOverlay(element, layerElement, 'below'); - }; + // focus on search + var searchInputElement = layerElement.querySelectorAll('input')[0]; + searchInputElement.focus(); - module.exports = createAction; + } else { + document.removeEventListener('click', this._onClose); + this.stopListeningToKeyboard(listeners); + this.stopOverlay(); -/***/ }, -/* 74 */ -/***/ function(module, exports, __webpack_require__) { + } + }, - var _ = __webpack_require__(81), - Reflux = __webpack_require__(64), - Keep = __webpack_require__(82), - mixer = __webpack_require__(93), - allowed = {preEmit:1,shouldEmit:1}, - bindMethods = __webpack_require__(94); + getInitialState: function () { + return { + active: false, + defaultValue: this.props.defaultValue, + value: this.props.value, + activeSuggestionIndex: -1 + }; + }, - /** - * Creates an event emitting Data Store. It is mixed in with functions - * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit` - * and `shouldEmit` may be overridden in the definition object. - * - * @param {Object} definition The data store object definition - * @returns {Store} A data store instance - */ - module.exports = function(definition) { + componentDidMount: function () { + if (this.state.active) { + this._activation(this.state.active); + } + }, - definition = definition || {}; + componentDidUpdate: function (prevProps, prevState) { + // Set up keyboard listeners appropriate to the current state. + if (! this.state.active && prevState.active) { + this._activation(this.state.active); + } + if (this.state.active && ! prevState.active) { + this._activation(this.state.active); + } + }, - for(var a in Reflux.StoreMethods){ - if (!allowed[a] && (Reflux.PublisherMethods[a] || Reflux.ListenerMethods[a])){ - throw new Error("Cannot override API method " + a + - " in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." - ); - } + componentWillUnmount: function () { + this._activation(false); + }, + + _valueText: function (value) { + var text = ''; + if (value) { + if ('string' === typeof value) { + text = value; + } else { + text = value.label || value.value; + } } + return text; + }, - for(var d in definition){ - if (!allowed[d] && (Reflux.PublisherMethods[d] || Reflux.ListenerMethods[d])){ - throw new Error("Cannot override API method " + d + - " in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." - ); - } + render: function() { + var classes = [CLASS_ROOT]; + if (this.state.active) { + classes.push(CLASS_ROOT + "--active"); + } + if (this.props.className) { + classes.push(this.props.className); } - definition = mixer(definition); + return ( + React.createElement("div", {ref: "component", className: classes.join(' ')}, + React.createElement("input", {className: CLASS_ROOT + "__input", + id: this.props.id, name: this.props.name, + value: this._valueText(this.props.value), + defaultValue: this._valueText(this.props.defaultValue), + onChange: this._onInputChange}), + React.createElement("div", {className: CLASS_ROOT + "__control", onClick: this._onOpen}, + React.createElement(SearchIcon, null) + ) + ) + ); + }, + + renderLayer: function() { + if (this.state.active) { + + var suggestions = null; + if (this.props.suggestions) { + suggestions = this.props.suggestions.map(function (suggestion, index) { + var classes = [CLASS_ROOT + "__layer-suggestion"]; + if (index === this.state.activeSuggestionIndex) { + classes.push(CLASS_ROOT + "__layer-suggestion--active"); + } + return ( + React.createElement("div", {key: this._valueText(suggestion), + className: classes.join(' '), + onClick: this._onClickSuggestion.bind(this, suggestion)}, + this._valueText(suggestion) + ) + ); + }, this); + } - function Store() { - var i=0, arr; - this.subscriptions = []; - this.emitter = new _.EventEmitter(); - this.eventLabel = "change"; - bindMethods(this, definition); - if (this.init && _.isFunction(this.init)) { - this.init(); - } - if (this.listenables){ - arr = [].concat(this.listenables); - for(;i < arr.length;i++){ - this.listenToMany(arr[i]); - } - } + return ( + React.createElement("div", {id: CLASS_ROOT + "-layer", className: CLASS_ROOT + "__layer", + onClick: this._onClose}, + React.createElement("input", {type: "search", + defaultValue: "", + placeholder: "Search", + className: CLASS_ROOT + "__layer-input", + onChange: this._onSearchChange}), + React.createElement("div", {className: CLASS_ROOT + "__layer-suggestions"}, + suggestions + ) + ) + ); + } else { + return (React.createElement("span", null)); } + } - _.extend(Store.prototype, Reflux.ListenerMethods, Reflux.PublisherMethods, Reflux.StoreMethods, definition); - - var store = new Store(); - Keep.createdStores.push(store); + }); - return store; - }; + module.exports = SearchInput; /***/ }, -/* 75 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { - var Reflux = __webpack_require__(64), - _ = __webpack_require__(81); + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - module.exports = function(listenable,key){ - return { - getInitialState: function(){ - if (!_.isFunction(listenable.getInitialState)) { - return {}; - } else if (key === undefined) { - return listenable.getInitialState(); - } else { - return _.object([key],[listenable.getInitialState()]); - } - }, - componentDidMount: function(){ - _.extend(this,Reflux.ListenerMethods); - var me = this, cb = (key === undefined ? this.setState : function(v){me.setState(_.object([key],[v]));}); - this.listenTo(listenable,cb); - }, - componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount - }; - }; + var React = __webpack_require__(2); + var CLASS_ROOT = "section"; -/***/ }, -/* 76 */ -/***/ function(module, exports, __webpack_require__) { + var Section = React.createClass({displayName: "Section", - var Reflux = __webpack_require__(64), - _ = __webpack_require__(81); + propTypes: { + centered: React.PropTypes.bool, + compact: React.PropTypes.bool, + colorIndex: React.PropTypes.string, + direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right']), + flush: React.PropTypes.bool, + texture: React.PropTypes.string + }, - module.exports = function(listenable, key, filterFunc) { - filterFunc = _.isFunction(key) ? key : filterFunc; + getDefaultProps: function () { return { - getInitialState: function() { - if (!_.isFunction(listenable.getInitialState)) { - return {}; - } else if (_.isFunction(key)) { - return filterFunc.call(this, listenable.getInitialState()); - } else { - // Filter initial payload from store. - var result = filterFunc.call(this, listenable.getInitialState()); - if (result) { - return _.object([key], [result]); - } else { - return {}; - } - } - }, - componentDidMount: function() { - _.extend(this, Reflux.ListenerMethods); - var me = this; - var cb = function(value) { - if (_.isFunction(key)) { - me.setState(filterFunc.call(me, value)); - } else { - var result = filterFunc.call(me, value); - me.setState(_.object([key], [result])); - } - }; - - this.listenTo(listenable, cb); - }, - componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount + colored: false, + direction: 'down', + flush: true, + small: false }; - }; - + }, + render: function() { + var classes = [CLASS_ROOT]; + var contentClasses = [CLASS_ROOT + "__content"]; -/***/ }, -/* 77 */ -/***/ function(module, exports, __webpack_require__) { + if (this.props.compact) { + classes.push(CLASS_ROOT + "--compact"); + } + if (this.props.centered) { + classes.push(CLASS_ROOT + "--centered"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); + } + if (this.props.direction) { + classes.push(CLASS_ROOT + "--" + this.props.direction); + } + if (this.props.colorIndex) { + classes.push("background-color-index-" + this.props.colorIndex); + } + if (this.props.className) { + classes.push(this.props.className); + } - var _ = __webpack_require__(81), - ListenerMethods = __webpack_require__(70); + var style = {}; + if (this.props.texture) { + style.backgroundImage = this.props.texture; + } - /** - * A module meant to be consumed as a mixin by a React component. Supplies the methods from - * `ListenerMethods` mixin and takes care of teardown of subscriptions. - * Note that if you're using the `connect` mixin you don't need this mixin, as connect will - * import everything this mixin contains! - */ - module.exports = _.extend({ + return ( + React.createElement("div", {className: classes.join(' '), style: style}, + React.createElement("div", {className: contentClasses.join(' ')}, + this.props.children + ) + ) + ); + } - /** - * Cleans up all listener previously registered. - */ - componentWillUnmount: ListenerMethods.stopListeningToAll + }); - }, ListenerMethods); + module.exports = Section; /***/ }, -/* 78 */ +/* 71 */ /***/ function(module, exports, __webpack_require__) { - var Reflux = __webpack_require__(64); + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + var React = __webpack_require__(2); + var SpinningIcon = __webpack_require__(72); + var InfiniteScroll = __webpack_require__(73); - /** - * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`, - * without having to manually set listeners in the `componentDidMount` method. - * - * @param {Action|Store} listenable An Action or Store that should be - * listened to. - * @param {Function|String} callback The callback to register as event handler - * @param {Function|String} defaultCallback The callback to register as default handler - * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable. - */ - module.exports = function(listenable,callback,initial){ - return { - /** - * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` - * and then make the call to `listenTo` with the arguments provided to the factory function - */ - componentDidMount: function() { - for(var m in Reflux.ListenerMethods){ - if (this[m] !== Reflux.ListenerMethods[m]){ - if (this[m]){ - throw "Can't have other property '"+m+"' when using Reflux.listenTo!"; - } - this[m] = Reflux.ListenerMethods[m]; - } - } - this.listenTo(listenable,callback,initial); - }, - /** - * Cleans up all listener previously registered. - */ - componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll - }; - }; + var CLASS_ROOT = "table"; + var Table = React.createClass({displayName: "Table", -/***/ }, -/* 79 */ -/***/ function(module, exports, __webpack_require__) { + propTypes: { + selection: React.PropTypes.number, + onMore: React.PropTypes.func, + scrollable: React.PropTypes.bool, + selectable: React.PropTypes.bool + }, - var Reflux = __webpack_require__(64); + mixins: [InfiniteScroll], - /** - * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`, - * without having to manually set listeners in the `componentDidMount` method. This version is used - * to automatically set up a `listenToMany` call. - * - * @param {Object} listenables An object of listenables - * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables. - */ - module.exports = function(listenables){ + getDefaultProps: function () { return { - /** - * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` - * and then make the call to `listenTo` with the arguments provided to the factory function - */ - componentDidMount: function() { - for(var m in Reflux.ListenerMethods){ - if (this[m] !== Reflux.ListenerMethods[m]){ - if (this[m]){ - throw "Can't have other property '"+m+"' when using Reflux.listenToMany!"; - } - this[m] = Reflux.ListenerMethods[m]; - } - } - this.listenToMany(listenables); - }, - /** - * Cleans up all listener previously registered. - */ - componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll + selection: null, + scrollable: false, + selectable: false }; - }; + }, + _clearSelection: function () { + var rows = this.refs.table.getDOMNode() + .querySelectorAll("." + CLASS_ROOT + "__row--selected"); + for (var i = 0; i < rows.length; i++) { + rows[i].classList.remove(CLASS_ROOT + "__row--selected"); + } + }, -/***/ }, -/* 80 */ -/***/ function(module, exports, __webpack_require__) { + _markSelection: function () { + this._clearSelection(); + if (null !== this.state.selection) { + var tbody = this.refs.table.getDOMNode().querySelectorAll('tbody')[0]; + tbody.childNodes[this.state.selection].classList. + add(CLASS_ROOT + "__row--selected"); + } + }, - /** - * Internal module used to create static and instance join methods - */ + _onClick: function (event) { + var element = event.target; + while (element.nodeName !== 'TR') { + element = element.parentNode; + } + if (element && element.parentNode.nodeName === 'TBODY') { + this._clearSelection(); + element.classList.add(CLASS_ROOT + "__row--selected"); + } + }, - var slice = Array.prototype.slice, - _ = __webpack_require__(81), - createStore = __webpack_require__(74), - strategyMethodNames = { - strict: "joinStrict", - first: "joinLeading", - last: "joinTrailing", - all: "joinConcat" - }; + _onResize: function () { + this._alignMirror(); + }, - /** - * Used in `index.js` to create the static join methods - * @param {String} strategy Which strategy to use when tracking listenable trigger arguments - * @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy - */ - exports.staticJoinCreator = function(strategy){ - return function(/* listenables... */) { - var listenables = slice.call(arguments); - return createStore({ - init: function(){ - this[strategyMethodNames[strategy]].apply(this,listenables.concat("triggerAsync")); - } - }); - }; - }; + _buildMirror: function () { + var tableElement = this.refs.table.getDOMNode(); + var cells = tableElement.querySelectorAll('thead tr th'); + var mirrorElement = this.refs.mirror.getDOMNode(); + var mirrorRow = mirrorElement.querySelectorAll('thead tr')[0]; + for (var i = 0; i < cells.length; i++) { + mirrorRow.appendChild(cells[i].cloneNode(true)); + } + }, - /** - * Used in `ListenerMethods.js` to create the instance join methods - * @param {String} strategy Which strategy to use when tracking listenable trigger arguments - * @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy - */ - exports.instanceJoinCreator = function(strategy){ - return function(/* listenables..., callback*/){ - _.throwIf(arguments.length < 3,'Cannot create a join with less than 2 listenables!'); - var listenables = slice.call(arguments), - callback = listenables.pop(), - numberOfListenables = listenables.length, - join = { - numberOfListenables: numberOfListenables, - callback: this[callback]||callback, - listener: this, - strategy: strategy - }, i, cancels = [], subobj; - for (i = 0; i < numberOfListenables; i++) { - _.throwIf(this.validateListening(listenables[i])); - } - for (i = 0; i < numberOfListenables; i++) { - cancels.push(listenables[i].listen(newListener(i,join),this)); - } - reset(join); - subobj = {listenable: listenables}; - subobj.stop = makeStopper(subobj,cancels,this); - this.subscriptions = (this.subscriptions || []).concat(subobj); - return subobj; - }; - }; + _alignMirror: function () { + var tableElement = this.refs.table.getDOMNode(); + var cells = tableElement.querySelectorAll('thead tr th'); + var mirrorElement = this.refs.mirror.getDOMNode(); + var mirrorCells = mirrorElement.querySelectorAll('thead tr th'); - // ---- internal join functions ---- + var rect = tableElement.getBoundingClientRect(); + mirrorElement.style.width = '' + Math.floor(rect.right - rect.left) + 'px'; - function makeStopper(subobj,cancels,context){ - return function() { - var i, subs = context.subscriptions, - index = (subs ? subs.indexOf(subobj) : -1); - _.throwIf(index === -1,'Tried to remove join already gone from subscriptions list!'); - for(i=0;i < cancels.length; i++){ - cancels[i](); - } - subs.splice(index, 1); - }; - } + var height = 0; + for (var i = 0; i < cells.length; i++) { + rect = cells[i].getBoundingClientRect(); + mirrorCells[i].style.width = '' + Math.floor(rect.right - rect.left) + 'px'; + mirrorCells[i].style.height = '' + Math.floor(rect.bottom - rect.top) + 'px'; + height = Math.max(height, Math.floor(rect.bottom - rect.top)); + } + mirrorElement.style.height = '' + height + 'px'; + }, - function reset(join) { - join.listenablesEmitted = new Array(join.numberOfListenables); - join.args = new Array(join.numberOfListenables); - } + getInitialState: function () { + return {selection: this.props.selection}; + }, - function newListener(i,join) { - return function() { - var callargs = slice.call(arguments); - if (join.listenablesEmitted[i]){ - switch(join.strategy){ - case "strict": throw new Error("Strict join failed because listener triggered twice."); - case "last": join.args[i] = callargs; break; - case "all": join.args[i].push(callargs); - } - } else { - join.listenablesEmitted[i] = true; - join.args[i] = (join.strategy==="all"?[callargs]:callargs); - } - emitIfAllListenablesEmitted(join); - }; - } + componentDidMount: function () { + this._markSelection(); + if (this.props.scrollable) { + this._buildMirror(); + this._alignMirror(); + } + if (this.props.onMore) { + this.startListeningForScroll(this.refs.more.getDOMNode(), this.props.onMore); + } + window.addEventListener('resize', this._onResize); + }, - function emitIfAllListenablesEmitted(join) { - for (var i = 0; i < join.numberOfListenables; i++) { - if (!join.listenablesEmitted[i]) { - return; - } + componentWillReceiveProps: function (newProps) { + if (newProps.hasOwnProperty('selection')) { + this.setState({selection: newProps.selection}); } - join.callback.apply(join.listener,join.args); - reset(join); - } + }, + componentDidUpdate: function (prevProps, prevState) { + if (this.state.selection !== prevState.selection) { + this._markSelection(); + } + if (this.props.scrollable) { + this._alignMirror(); + } + this.stopListeningForScroll(); + if (this.props.onMore) { + this.startListeningForScroll(this.refs.more.getDOMNode(), this.props.onMore); + } + }, -/***/ }, -/* 81 */ -/***/ function(module, exports, __webpack_require__) { + componentWillUnmount: function () { + if (this.props.onMore) { + this.stopListeningForScroll(); + } + window.removeEventListener('resize', this._onResize); + }, - /* - * isObject, extend, isFunction, isArguments are taken from undescore/lodash in - * order to remove the dependency - */ - var isObject = exports.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; + render: function () { + var classes = [CLASS_ROOT]; + if (this.props.selectable) { + classes.push(CLASS_ROOT + "--selectable"); + } + if (this.props.scrollable) { + classes.push(CLASS_ROOT + "--scrollable"); + } + if (this.props.className) { + classes.push(this.props.className); + } - exports.extend = function(obj) { - if (!isObject(obj)) { - return obj; + var mirror = null; + if (this.props.scrollable) { + mirror = ( + React.createElement("table", {ref: "mirror", className: CLASS_ROOT + "__mirror"}, + React.createElement("thead", null, + React.createElement("tr", null) + ) + ) + ); } - var source, prop; - for (var i = 1, length = arguments.length; i < length; i++) { - source = arguments[i]; - for (prop in source) { - if (Object.getOwnPropertyDescriptor && Object.defineProperty) { - var propertyDescriptor = Object.getOwnPropertyDescriptor(source, prop); - Object.defineProperty(obj, prop, propertyDescriptor); - } else { - obj[prop] = source[prop]; - } - } + + var more = null; + if (this.props.onMore) { + more = ( + React.createElement("div", {ref: "more", className: CLASS_ROOT + "__more"}, + React.createElement(SpinningIcon, null) + ) + ); } - return obj; - }; - exports.isFunction = function(value) { - return typeof value === 'function'; - }; + return ( + React.createElement("div", {ref: "container", className: classes.join(' ')}, + mirror, + React.createElement("table", {ref: "table", className: CLASS_ROOT + "__table", onClick: this._onClick}, + this.props.children + ), + more + ) + ); + } - exports.EventEmitter = __webpack_require__(97); + }); - exports.nextTick = function(callback) { - setTimeout(callback, 0); - }; + module.exports = Table; - exports.capitalize = function(string){ - return string.charAt(0).toUpperCase()+string.slice(1); - }; - exports.callbackName = function(string){ - return "on"+exports.capitalize(string); - }; +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { - exports.object = function(keys,vals){ - var o={}, i=0; - for(;i 1) { - updated.init = function () { - var args = arguments; - composed.init.forEach(function (init) { - init.apply(this, args); - }, this); - }; - } - if (composed.preEmit.length > 1) { - updated.preEmit = function () { - return composed.preEmit.reduce(function (args, preEmit) { - var newValue = preEmit.apply(this, args); - return newValue === undefined ? args : [newValue]; - }.bind(this), arguments); - }; - } - if (composed.shouldEmit.length > 1) { - updated.shouldEmit = function () { - var args = arguments; - return !composed.shouldEmit.some(function (shouldEmit) { - return !shouldEmit.apply(this, args); - }, this); - }; + render: function() { + var className = 'status-icon status-icon-unknown'; + if (this.props.className) { + className += ' ' + this.props.className; } - Object.keys(composed).forEach(function (composable) { - if (composed[composable].length === 1) { - updated[composable] = composed[composable][0]; - } - }); + return ( + React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, + React.createElement("g", {className: "status-icon__base", fill: "#848484"}, + React.createElement("path", {d: "M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"}) + ), + React.createElement("g", {className: "status-icon__detail", fill: "#FFFFFF", transform: "translate(7.524324, 4.994595)"}, + React.createElement("path", {d: "M8.89945946,3.97621622 C8.89945946,4.48216216 8.64648649,4.98810811 8.39351351,5.49405405 C8.0172973,5.87027027 7.51135135,6.62918919 6.49945946,7.38810811 C5.99351351,7.76432432 5.74054054,8.14702703 5.6172973,8.4 L5.6172973,8.77621622 C5.49405405,9.02918919 5.49405405,9.53513514 5.49405405,10.1643243 L3.47027027,10.1643243 L3.47027027,9.53513514 C3.47027027,8.90594595 3.59351351,8.0172973 3.84648649,7.51135135 C3.96972973,7.13513514 4.47567568,6.62918919 5.23459459,5.99351351 C5.99351351,5.36432432 6.36972973,4.98162162 6.49945946,4.85837838 C6.75243243,4.60540541 6.87567568,4.35243243 6.87567568,3.97621622 C6.87567568,3.6 6.6227027,3.2172973 6.24648649,2.84108108 C5.87027027,2.46486486 5.23459459,2.33513514 4.60540541,2.33513514 C3.97621622,2.33513514 3.47027027,2.45837838 2.96432432,2.71135135 C2.58810811,2.96432432 2.20540541,3.34054054 2.08216216,3.84648649 L0.0583783784,3.84648649 C0.0583783784,2.83459459 0.564324324,1.95243243 1.32324324,1.19351351 C2.20540541,0.434594595 3.2172973,0.0583783784 4.48216216,0.0583783784 C5.87027027,0.0583783784 7.00540541,0.434594595 7.76432432,1.19351351 C8.51675676,1.95891892 8.89945946,2.96432432 8.89945946,3.97621622 L8.89945946,3.97621622 Z M4.47567568,10.9232432 C3.71675676,10.9232432 2.95783784,11.6821622 2.95783784,12.4410811 C2.95783784,13.2 3.71675676,13.9589189 4.47567568,13.9589189 C5.23459459,13.9589189 5.99351351,13.2 5.99351351,12.4410811 C5.99351351,11.6821622 5.23459459,10.9232432 4.47567568,10.9232432 L4.47567568,10.9232432 Z"}) + ) + ) + ); + } - return updated; - }; + }); + + module.exports = Unknown; /***/ }, -/* 94 */ +/* 92 */ /***/ function(module, exports, __webpack_require__) { - module.exports = function(store, definition) { - for (var name in definition) { - if (Object.getOwnPropertyDescriptor && Object.defineProperty) { - var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name); - - if (!propertyDescriptor.value || typeof propertyDescriptor.value !== 'function' || !definition.hasOwnProperty(name)) { - continue; - } + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - store[name] = definition[name].bind(store); - } else { - var property = definition[name]; + var React = __webpack_require__(2); - if (typeof property !== 'function' || !definition.hasOwnProperty(name)) { - continue; - } + var Label = React.createClass({displayName: "Label", - store[name] = property.bind(store); + render: function() { + var className = 'status-icon status-icon-label'; + if (this.props.className) { + className += ' ' + this.props.className; } + return ( + React.createElement("svg", {className: className, viewBox: "0 0 24 24", version: "1.1"}, + React.createElement("g", {className: "status-icon__base", fill: "#CCCCCC"}, + React.createElement("circle", {cx: "12", cy: "12", r: "12"}) + ) + ) + ); } - return store; - }; + }); + + module.exports = Label; /***/ }, -/* 95 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { - /* jshint node:true */ + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - 'use strict'; + var Reflux = __webpack_require__(94); + var Rest = __webpack_require__(117); - var IntlMessageFormat = __webpack_require__(105)['default']; + var Actions = Reflux.createActions({ + // Session + 'login': {asyncResult: true}, + 'logout': {} + }); - // Add all locale data to `IntlMessageFormat`. This module will be ignored when - // bundling for the browser with Browserify/Webpack. - __webpack_require__(101); + Actions.login.listen(function(userName, password) { + if (!userName || !password) { + return this.failed(400, { message: 'loginInvalidPassword'}); + } - // Re-export `IntlMessageFormat` as the CommonJS default exports with all the - // locale data registered, and with English set as the default locale. Define - // the `default` prop for use with other compiled ES6 Modules. - exports = module.exports = IntlMessageFormat; - exports['default'] = exports; + var thisAction = this; + Rest.post('/rest/login-sessions', + {authLoginDomain: 'LOCAL', userName: userName, password: password, loginMsgAck: true}) + .end(function(err, res) { + if (err || !res.ok) { + return thisAction.failed(err, res.body); + } + thisAction.completed(userName, res.body.sessionID); + }); + }); + + module.exports = Actions; /***/ }, -/* 96 */ +/* 94 */ /***/ function(module, exports, __webpack_require__) { - /* jshint node:true */ - - 'use strict'; - - var IntlRelativeFormat = __webpack_require__(103)['default']; - - // Add all locale data to `IntlRelativeFormat`. This module will be ignored when - // bundling for the browser with Browserify/Webpack. - __webpack_require__(102); - - // Re-export `IntlRelativeFormat` as the CommonJS default exports with all the - // locale data registered, and with English set as the default locale. Define - // the `default` prop for use with other compiled ES6 Modules. - exports = module.exports = IntlRelativeFormat; - exports['default'] = exports; + module.exports = __webpack_require__(95); /***/ }, -/* 97 */ +/* 95 */ /***/ function(module, exports, __webpack_require__) { - 'use strict'; + exports.ActionMethods = __webpack_require__(97); - /** - * Representation of a single EventEmitter function. - * - * @param {Function} fn Event handler to be called. - * @param {Mixed} context Context for function execution. - * @param {Boolean} once Only emit once - * @api private - */ - function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; - } + exports.ListenerMethods = __webpack_require__(98); - /** - * Minimal EventEmitter interface that is molded against the Node.js - * EventEmitter interface. - * - * @constructor - * @api public - */ - function EventEmitter() { /* Nothing to set */ } + exports.PublisherMethods = __webpack_require__(110); - /** - * Holds the assigned EventEmitters by name. - * - * @type {Object} - * @private - */ - EventEmitter.prototype._events = undefined; + exports.StoreMethods = __webpack_require__(111); - /** - * Return a list of assigned event listeners. - * - * @param {String} event The events that should be listed. - * @returns {Array} - * @api public - */ - EventEmitter.prototype.listeners = function listeners(event) { - if (!this._events || !this._events[event]) return []; - if (this._events[event].fn) return [this._events[event].fn]; + exports.createAction = __webpack_require__(112); - for (var i = 0, l = this._events[event].length, ee = new Array(l); i < l; i++) { - ee[i] = this._events[event][i].fn; - } + exports.createStore = __webpack_require__(106); - return ee; - }; + exports.connect = __webpack_require__(113); - /** - * Emit an event to all registered event listeners. - * - * @param {String} event The name of the event. - * @returns {Boolean} Indication if we've emitted an event. - * @api public - */ - EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - if (!this._events || !this._events[event]) return false; + exports.connectFilter = __webpack_require__(114); - var listeners = this._events[event] - , len = arguments.length - , args - , i; + exports.ListenerMixin = __webpack_require__(115); - if ('function' === typeof listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, true); + exports.listenTo = __webpack_require__(96); - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } + exports.listenToMany = __webpack_require__(116); - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; + var maker = __webpack_require__(105).staticJoinCreator; - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, true); + exports.joinTrailing = exports.all = maker("last"); // Reflux.all alias for backward compatibility - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } + exports.joinLeading = maker("first"); - listeners[i].fn.apply(listeners[i].context, args); - } - } - } + exports.joinStrict = maker("strict"); - return true; - }; + exports.joinConcat = maker("all"); - /** - * Register a new EventListener for the given event. - * - * @param {String} event Name of the event. - * @param {Functon} fn Callback function. - * @param {Mixed} context The context of the function. - * @api public - */ - EventEmitter.prototype.on = function on(event, fn, context) { - var listener = new EE(fn, context || this); + var _ = __webpack_require__(99); - if (!this._events) this._events = {}; - if (!this._events[event]) this._events[event] = listener; - else { - if (!this._events[event].fn) this._events[event].push(listener); - else this._events[event] = [ - this._events[event], listener - ]; - } + exports.EventEmitter = _.EventEmitter; - return this; - }; + exports.Promise = _.Promise; /** - * Add an EventListener that's only called once. + * Convenience function for creating a set of actions * - * @param {String} event Name of the event. - * @param {Function} fn Callback function. - * @param {Mixed} context The context of the function. - * @api public + * @param definitions the definitions for the actions to be created + * @returns an object with actions of corresponding action names */ - EventEmitter.prototype.once = function once(event, fn, context) { - var listener = new EE(fn, context || this, true); - - if (!this._events) this._events = {}; - if (!this._events[event]) this._events[event] = listener; - else { - if (!this._events[event].fn) this._events[event].push(listener); - else this._events[event] = [ - this._events[event], listener - ]; - } + exports.createActions = function(definitions) { + var actions = {}; + for (var k in definitions){ + if (definitions.hasOwnProperty(k)) { + var val = definitions[k], + actionName = _.isObject(val) ? k : val; - return this; + actions[actionName] = exports.createAction(val); + } + } + return actions; }; /** - * Remove event listeners. - * - * @param {String} event The event we want to remove. - * @param {Function} fn The listener that we need to find. - * @param {Boolean} once Only remove once listeners. - * @api public + * Sets the eventmitter that Reflux uses */ - EventEmitter.prototype.removeListener = function removeListener(event, fn, once) { - if (!this._events || !this._events[event]) return this; - - var listeners = this._events[event] - , events = []; - - if (fn) { - if (listeners.fn && (listeners.fn !== fn || (once && !listeners.once))) { - events.push(listeners); - } - if (!listeners.fn) for (var i = 0, length = listeners.length; i < length; i++) { - if (listeners[i].fn !== fn || (once && !listeners[i].once)) { - events.push(listeners[i]); - } - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) { - this._events[event] = events.length === 1 ? events[0] : events; - } else { - delete this._events[event]; - } - - return this; + exports.setEventEmitter = function(ctx) { + var _ = __webpack_require__(99); + exports.EventEmitter = _.EventEmitter = ctx; }; + /** - * Remove all listeners or only the listeners for the specified event. - * - * @param {String} event The event want to remove all listeners for. - * @api public + * Sets the Promise library that Reflux uses */ - EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - if (!this._events) return this; - - if (event) delete this._events[event]; - else this._events = {}; - - return this; + exports.setPromise = function(ctx) { + var _ = __webpack_require__(99); + exports.Promise = _.Promise = ctx; }; - // - // Alias methods names because people roll like that. - // - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - // - // This function doesn't apply anymore. - // - EventEmitter.prototype.setMaxListeners = function setMaxListeners() { - return this; + /** + * Sets the Promise factory that creates new promises + * @param {Function} factory has the signature `function(resolver) { return [new Promise]; }` + */ + exports.setPromiseFactory = function(factory) { + var _ = __webpack_require__(99); + _.createPromise = factory; }; - // - // Expose the module. - // - EventEmitter.EventEmitter = EventEmitter; - EventEmitter.EventEmitter2 = EventEmitter; - EventEmitter.EventEmitter3 = EventEmitter; - - // - // Expose the module. - // - module.exports = EventEmitter; - -/***/ }, -/* 98 */ -/***/ function(module, exports, __webpack_require__) { + /** + * Sets the method used for deferring actions and stores + */ + exports.nextTick = function(nextTick) { + var _ = __webpack_require__(99); + _.nextTick = nextTick; + }; - /* global React */ - /* jshint esnext:true */ + /** + * Provides the set of created actions and stores for introspection + */ + exports.__keep = __webpack_require__(107); - // TODO: Remove the global `React` binding lookup once the ES6 Module Transpiler - // supports external modules. This is a hack for now that provides the local - // modules a referece to React. - "use strict"; - exports["default"] = React; + /** + * Warn if Function.prototype.bind not available + */ + if (!Function.prototype.bind) { + console.error( + 'Function.prototype.bind not available. ' + + 'ES5 shim required. ' + + 'https://github.com/spoike/refluxjs#es5' + ); + } - //# sourceMappingURL=react.js.map /***/ }, -/* 99 */ +/* 96 */ /***/ function(module, exports, __webpack_require__) { - /* jshint esnext:true */ - - /* - HTML escaping implementation is the same as React's (on purpose.) Therefore, it - has the following Copyright and Licensing: - - Copyright 2013-2014, Facebook, Inc. - All rights reserved. - - This source code is licensed under the BSD-style license found in the LICENSE - file in the root directory of React's source tree. - */ - "use strict"; - var ESCAPED_CHARS = { - '&' : '&', - '>' : '>', - '<' : '<', - '"' : '"', - '\'': ''' - }; + var Reflux = __webpack_require__(95); - var UNSAFE_CHARS_REGEX = /[&><"']/g; - exports["default"] = function (str) { - return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) { - return ESCAPED_CHARS[match]; - }); + /** + * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`, + * without having to manually set listeners in the `componentDidMount` method. + * + * @param {Action|Store} listenable An Action or Store that should be + * listened to. + * @param {Function|String} callback The callback to register as event handler + * @param {Function|String} defaultCallback The callback to register as default handler + * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable. + */ + module.exports = function(listenable,callback,initial){ + return { + /** + * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` + * and then make the call to `listenTo` with the arguments provided to the factory function + */ + componentDidMount: function() { + for(var m in Reflux.ListenerMethods){ + if (this[m] !== Reflux.ListenerMethods[m]){ + if (this[m]){ + throw "Can't have other property '"+m+"' when using Reflux.listenTo!"; + } + this[m] = Reflux.ListenerMethods[m]; + } + } + this.listenTo(listenable,callback,initial); + }, + /** + * Cleans up all listener previously registered. + */ + componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll + }; }; - //# sourceMappingURL=escape.js.map /***/ }, -/* 100 */ +/* 97 */ /***/ function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! Native Promise Only - v0.7.6-a (c) Kyle Simpson - MIT License: http://getify.mit-license.org - */ - !function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"=="function"&&__webpack_require__(109)&&!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return n[t]}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n?n:!1}function e(){for(var t=0;t0&&t(e,a))}catch(s){i.call(u||new f(a),s)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r= 0) { - return true; - } + /** + * Register a new EventListener for the given event. + * + * @param {String} event Name of the event. + * @param {Functon} fn Callback function. + * @param {Mixed} context The context of the function. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this); - if (typeof units === 'string') { - var suggestion = /s$/.test(units) && units.substr(0, units.length - 1); - if (suggestion && src$es5$$.arrIndexOf.call(FIELDS, suggestion) >= 0) { - throw new Error( - '"' + units + '" is not a valid IntlRelativeFormat `units` ' + - 'value, did you mean: ' + suggestion - ); - } - } + if (!this._events) this._events = {}; + if (!this._events[event]) this._events[event] = listener; + else { + if (!this._events[event].fn) this._events[event].push(listener); + else this._events[event] = [ + this._events[event], listener + ]; + } - throw new Error( - '"' + units + '" is not a valid IntlRelativeFormat `units` value, it ' + - 'must be one of: "' + FIELDS.join('", "') + '"' - ); + return this; }; - RelativeFormat.prototype._resolveLocale = function (locales) { - if (typeof locales === 'string') { - locales = [locales]; - } + /** + * Add an EventListener that's only called once. + * + * @param {String} event Name of the event. + * @param {Function} fn Callback function. + * @param {Mixed} context The context of the function. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true); - // Create a copy of the array so we can push on the default locale. - locales = (locales || []).concat(RelativeFormat.defaultLocale); + if (!this._events) this._events = {}; + if (!this._events[event]) this._events[event] = listener; + else { + if (!this._events[event].fn) this._events[event].push(listener); + else this._events[event] = [ + this._events[event], listener + ]; + } - var localeData = RelativeFormat.__localeData__; - var i, len, localeParts, data; + return this; + }; - // Using the set of locales + the default locale, we look for the first one - // which that has been registered. When data does not exist for a locale, we - // traverse its ancestors to find something that's been registered within - // its hierarchy of locales. Since we lack the proper `parentLocale` data - // here, we must take a naive approach to traversal. - for (i = 0, len = locales.length; i < len; i += 1) { - localeParts = locales[i].toLowerCase().split('-'); + /** + * Remove event listeners. + * + * @param {String} event The event we want to remove. + * @param {Function} fn The listener that we need to find. + * @param {Boolean} once Only remove once listeners. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, once) { + if (!this._events || !this._events[event]) return this; - while (localeParts.length) { - data = localeData[localeParts.join('-')]; - if (data) { - // Return the normalized locale string; e.g., we return "en-US", - // instead of "en-us". - return data.locale; - } + var listeners = this._events[event] + , events = []; - localeParts.pop(); - } + if (fn) { + if (listeners.fn && (listeners.fn !== fn || (once && !listeners.once))) { + events.push(listeners); + } + if (!listeners.fn) for (var i = 0, length = listeners.length; i < length; i++) { + if (listeners[i].fn !== fn || (once && !listeners[i].once)) { + events.push(listeners[i]); + } } + } - var defaultLocale = locales.pop(); - throw new Error( - 'No locale data has been added to IntlRelativeFormat for: ' + - locales.join(', ') + ', or the default locale: ' + defaultLocale - ); + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) { + this._events[event] = events.length === 1 ? events[0] : events; + } else { + delete this._events[event]; + } + + return this; }; - RelativeFormat.prototype._resolveStyle = function (style) { - // Default to "best fit" style. - if (!style) { - return STYLES[0]; - } + /** + * Remove all listeners or only the listeners for the specified event. + * + * @param {String} event The event want to remove all listeners for. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + if (!this._events) return this; - if (src$es5$$.arrIndexOf.call(STYLES, style) >= 0) { - return style; - } + if (event) delete this._events[event]; + else this._events = {}; - throw new Error( - '"' + style + '" is not a valid IntlRelativeFormat `style` value, it ' + - 'must be one of: "' + STYLES.join('", "') + '"' - ); + return this; }; - RelativeFormat.prototype._selectUnits = function (diffReport) { - var i, l, units; + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; - for (i = 0, l = FIELDS.length; i < l; i += 1) { - units = FIELDS[i]; + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; - if (Math.abs(diffReport[units]) < RelativeFormat.thresholds[units]) { - break; - } - } + // + // Expose the module. + // + EventEmitter.EventEmitter = EventEmitter; + EventEmitter.EventEmitter2 = EventEmitter; + EventEmitter.EventEmitter3 = EventEmitter; - return units; - }; + // + // Expose the module. + // + module.exports = EventEmitter; - //# sourceMappingURL=core.js.map /***/ }, -/* 107 */ +/* 101 */ /***/ function(module, exports, __webpack_require__) { - // GENERATED FILE - "use strict"; - exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"Year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"month":{"displayName":"Month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"day":{"displayName":"Day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"Hour","relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"minute":{"displayName":"Minute","relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"second":{"displayName":"Second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}}}}; + var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! Native Promise Only + v0.7.6-a (c) Kyle Simpson + MIT License: http://getify.mit-license.org + */ + !function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"=="function"&&__webpack_require__(104)&&!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return n[t]}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n?n:!1}function e(){for(var t=0;t0&&t(e,a))}catch(s){i.call(u||new f(a),s)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; - var orderedKeys = keys.sort(); + // That's not how node.js implements it but the exposed api is the same. + exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); - for (i = 0, len = orderedKeys.length; i < len; i += 1) { - key = orderedKeys[i]; - prop = {}; + immediateIds[id] = true; - prop[key] = obj[key]; - props[i] = prop; + nextTick(function onNextTick() { + if (immediateIds[id]) { + // fn.call() is faster so we optimize for the common use-case + // @see http://jsperf.com/call-apply-segu + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + // Prevent ids from leaking + exports.clearImmediate(id); } + }); - return props; - } + return id; + }; - //# sourceMappingURL=memoizer.js.map + exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { + delete immediateIds[id]; + }; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(102).setImmediate, __webpack_require__(102).clearImmediate)) /***/ }, -/* 109 */ +/* 103 */ /***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; + // shim for using process in browser - /* WEBPACK VAR INJECTION */}.call(exports, {})) + var process = module.exports = {}; + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; -/***/ }, -/* 110 */ -/***/ function(module, exports, __webpack_require__) { + function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } - /* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {var nextTick = __webpack_require__(120).nextTick; - var apply = Function.prototype.apply; - var slice = Array.prototype.slice; - var immediateIds = {}; - var nextImmediateId = 0; + function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; - // DOM APIs, for completeness + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + currentQueue[queueIndex].run(); + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); + } - exports.setTimeout = function() { - return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } }; - exports.setInterval = function() { - return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); }; - exports.clearTimeout = - exports.clearInterval = function(timeout) { timeout.close(); }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; - function Timeout(id, clearFn) { - this._id = id; - this._clearFn = clearFn; - } - Timeout.prototype.unref = Timeout.prototype.ref = function() {}; - Timeout.prototype.close = function() { - this._clearFn.call(window, this._id); + process.binding = function (name) { + throw new Error('process.binding is not supported'); }; - // Does not start the time, just sets up the members needed. - exports.enroll = function(item, msecs) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = msecs; + // TODO(shtylman) + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); }; + process.umask = function() { return 0; }; - exports.unenroll = function(item) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = -1; - }; - exports._unrefActive = exports.active = function(item) { - clearTimeout(item._idleTimeoutId); +/***/ }, +/* 104 */ +/***/ function(module, exports, __webpack_require__) { - var msecs = item._idleTimeout; - if (msecs >= 0) { - item._idleTimeoutId = setTimeout(function onTimeout() { - if (item._onTimeout) - item._onTimeout(); - }, msecs); - } - }; + /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; - // That's not how node.js implements it but the exposed api is the same. - exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { - var id = nextImmediateId++; - var args = arguments.length < 2 ? false : slice.call(arguments, 1); + /* WEBPACK VAR INJECTION */}.call(exports, {})) - immediateIds[id] = true; +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { - nextTick(function onNextTick() { - if (immediateIds[id]) { - // fn.call() is faster so we optimize for the common use-case - // @see http://jsperf.com/call-apply-segu - if (args) { - fn.apply(null, args); - } else { - fn.call(null); - } - // Prevent ids from leaking - exports.clearImmediate(id); - } - }); + /** + * Internal module used to create static and instance join methods + */ - return id; + var slice = Array.prototype.slice, + _ = __webpack_require__(99), + createStore = __webpack_require__(106), + strategyMethodNames = { + strict: "joinStrict", + first: "joinLeading", + last: "joinTrailing", + all: "joinConcat" + }; + + /** + * Used in `index.js` to create the static join methods + * @param {String} strategy Which strategy to use when tracking listenable trigger arguments + * @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy + */ + exports.staticJoinCreator = function(strategy){ + return function(/* listenables... */) { + var listenables = slice.call(arguments); + return createStore({ + init: function(){ + this[strategyMethodNames[strategy]].apply(this,listenables.concat("triggerAsync")); + } + }); + }; }; - exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { - delete immediateIds[id]; + /** + * Used in `ListenerMethods.js` to create the instance join methods + * @param {String} strategy Which strategy to use when tracking listenable trigger arguments + * @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy + */ + exports.instanceJoinCreator = function(strategy){ + return function(/* listenables..., callback*/){ + _.throwIf(arguments.length < 3,'Cannot create a join with less than 2 listenables!'); + var listenables = slice.call(arguments), + callback = listenables.pop(), + numberOfListenables = listenables.length, + join = { + numberOfListenables: numberOfListenables, + callback: this[callback]||callback, + listener: this, + strategy: strategy + }, i, cancels = [], subobj; + for (i = 0; i < numberOfListenables; i++) { + _.throwIf(this.validateListening(listenables[i])); + } + for (i = 0; i < numberOfListenables; i++) { + cancels.push(listenables[i].listen(newListener(i,join),this)); + } + reset(join); + subobj = {listenable: listenables}; + subobj.stop = makeStopper(subobj,cancels,this); + this.subscriptions = (this.subscriptions || []).concat(subobj); + return subobj; + }; }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(110).setImmediate, __webpack_require__(110).clearImmediate)) -/***/ }, -/* 111 */ -/***/ function(module, exports, __webpack_require__) { + // ---- internal join functions ---- - /* - Copyright (c) 2014, Yahoo! Inc. All rights reserved. - Copyrights licensed under the New BSD License. - See the accompanying LICENSE file for terms. - */ + function makeStopper(subobj,cancels,context){ + return function() { + var i, subs = context.subscriptions, + index = (subs ? subs.indexOf(subobj) : -1); + _.throwIf(index === -1,'Tried to remove join already gone from subscriptions list!'); + for(i=0;i < cancels.length; i++){ + cancels[i](); + } + subs.splice(index, 1); + }; + } - /* jslint esnext: true */ + function reset(join) { + join.listenablesEmitted = new Array(join.numberOfListenables); + join.args = new Array(join.numberOfListenables); + } - "use strict"; - var src$utils$$ = __webpack_require__(115), src$es5$$ = __webpack_require__(116), src$compiler$$ = __webpack_require__(117), intl$messageformat$parser$$ = __webpack_require__(119); - exports["default"] = MessageFormat; + function newListener(i,join) { + return function() { + var callargs = slice.call(arguments); + if (join.listenablesEmitted[i]){ + switch(join.strategy){ + case "strict": throw new Error("Strict join failed because listener triggered twice."); + case "last": join.args[i] = callargs; break; + case "all": join.args[i].push(callargs); + } + } else { + join.listenablesEmitted[i] = true; + join.args[i] = (join.strategy==="all"?[callargs]:callargs); + } + emitIfAllListenablesEmitted(join); + }; + } - // -- MessageFormat -------------------------------------------------------- + function emitIfAllListenablesEmitted(join) { + for (var i = 0; i < join.numberOfListenables; i++) { + if (!join.listenablesEmitted[i]) { + return; + } + } + join.callback.apply(join.listener,join.args); + reset(join); + } - function MessageFormat(message, locales, formats) { - // Parse string messages into an AST. - var ast = typeof message === 'string' ? - MessageFormat.__parse(message) : message; - if (!(ast && ast.type === 'messageFormatPattern')) { - throw new TypeError('A message must be provided as a String or AST.'); - } +/***/ }, +/* 106 */ +/***/ function(module, exports, __webpack_require__) { - // Creates a new object with the specified `formats` merged with the default - // formats. - formats = this._mergeFormats(MessageFormat.formats, formats); + var _ = __webpack_require__(99), + Reflux = __webpack_require__(95), + Keep = __webpack_require__(107), + mixer = __webpack_require__(108), + allowed = {preEmit:1,shouldEmit:1}, + bindMethods = __webpack_require__(109); - // Defined first because it's used to build the format pattern. - src$es5$$.defineProperty(this, '_locale', {value: this._resolveLocale(locales)}); + /** + * Creates an event emitting Data Store. It is mixed in with functions + * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit` + * and `shouldEmit` may be overridden in the definition object. + * + * @param {Object} definition The data store object definition + * @returns {Store} A data store instance + */ + module.exports = function(definition) { - // Compile the `ast` to a pattern that is highly optimized for repeated - // `format()` invocations. **Note:** This passes the `locales` set provided - // to the constructor instead of just the resolved locale. - var pluralFn = this._findPluralRuleFunction(this._locale); - var pattern = this._compilePattern(ast, locales, formats, pluralFn); + definition = definition || {}; - // "Bind" `format()` method to `this` so it can be passed by reference like - // the other `Intl` APIs. - var messageFormat = this; - this.format = function (values) { - return messageFormat._format(pattern, values); - }; - } + for(var a in Reflux.StoreMethods){ + if (!allowed[a] && (Reflux.PublisherMethods[a] || Reflux.ListenerMethods[a])){ + throw new Error("Cannot override API method " + a + + " in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." + ); + } + } - // Default format options used as the prototype of the `formats` provided to the - // constructor. These are used when constructing the internal Intl.NumberFormat - // and Intl.DateTimeFormat instances. - src$es5$$.defineProperty(MessageFormat, 'formats', { - enumerable: true, + for(var d in definition){ + if (!allowed[d] && (Reflux.PublisherMethods[d] || Reflux.ListenerMethods[d])){ + throw new Error("Cannot override API method " + d + + " in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." + ); + } + } - value: { - number: { - 'currency': { - style: 'currency' - }, + definition = mixer(definition); - 'percent': { - style: 'percent' + function Store() { + var i=0, arr; + this.subscriptions = []; + this.emitter = new _.EventEmitter(); + this.eventLabel = "change"; + bindMethods(this, definition); + if (this.init && _.isFunction(this.init)) { + this.init(); + } + if (this.listenables){ + arr = [].concat(this.listenables); + for(;i < arr.length;i++){ + this.listenToMany(arr[i]); } - }, - - date: { - 'short': { - month: 'numeric', - day : 'numeric', - year : '2-digit' - }, + } + } - 'medium': { - month: 'short', - day : 'numeric', - year : 'numeric' - }, + _.extend(Store.prototype, Reflux.ListenerMethods, Reflux.PublisherMethods, Reflux.StoreMethods, definition); - 'long': { - month: 'long', - day : 'numeric', - year : 'numeric' - }, + var store = new Store(); + Keep.createdStores.push(store); - 'full': { - weekday: 'long', - month : 'long', - day : 'numeric', - year : 'numeric' - } - }, + return store; + }; - time: { - 'short': { - hour : 'numeric', - minute: 'numeric' - }, - 'medium': { - hour : 'numeric', - minute: 'numeric', - second: 'numeric' - }, +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { - 'long': { - hour : 'numeric', - minute : 'numeric', - second : 'numeric', - timeZoneName: 'short' - }, + exports.createdStores = []; - 'full': { - hour : 'numeric', - minute : 'numeric', - second : 'numeric', - timeZoneName: 'short' - } - } - } - }); + exports.createdActions = []; - // Define internal private properties for dealing with locale data. - src$es5$$.defineProperty(MessageFormat, '__localeData__', {value: src$es5$$.objCreate(null)}); - src$es5$$.defineProperty(MessageFormat, '__addLocaleData', {value: function (data) { - if (!(data && data.locale)) { - throw new Error( - 'Locale data provided to IntlMessageFormat is missing a ' + - '`locale` property' - ); + exports.reset = function() { + while(exports.createdStores.length) { + exports.createdStores.pop(); + } + while(exports.createdActions.length) { + exports.createdActions.pop(); } + }; - MessageFormat.__localeData__[data.locale.toLowerCase()] = data; - }}); - // Defines `__parse()` static method as an exposed private. - src$es5$$.defineProperty(MessageFormat, '__parse', {value: intl$messageformat$parser$$["default"].parse}); +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { - // Define public `defaultLocale` property which defaults to English, but can be - // set by the developer. - src$es5$$.defineProperty(MessageFormat, 'defaultLocale', { - enumerable: true, - writable : true, - value : undefined - }); + var _ = __webpack_require__(99); - MessageFormat.prototype.resolvedOptions = function () { - // TODO: Provide anything else? - return { - locale: this._locale + module.exports = function mix(def) { + var composed = { + init: [], + preEmit: [], + shouldEmit: [] }; - }; - - MessageFormat.prototype._compilePattern = function (ast, locales, formats, pluralFn) { - var compiler = new src$compiler$$["default"](locales, formats, pluralFn); - return compiler.compile(ast); - }; - MessageFormat.prototype._findPluralRuleFunction = function (locale) { - var localeData = MessageFormat.__localeData__; - var data = localeData[locale.toLowerCase()]; - - // The locale data is de-duplicated, so we have to traverse the locale's - // hierarchy until we find a `pluralRuleFunction` to return. - while (data) { - if (data.pluralRuleFunction) { - return data.pluralRuleFunction; + var updated = (function mixDef(mixin) { + var mixed = {}; + if (mixin.mixins) { + mixin.mixins.forEach(function (subMixin) { + _.extend(mixed, mixDef(subMixin)); + }); } + _.extend(mixed, mixin); + Object.keys(composed).forEach(function (composable) { + if (mixin.hasOwnProperty(composable)) { + composed[composable].push(mixin[composable]); + } + }); + return mixed; + }(def)); - data = data.parentLocale && localeData[data.parentLocale.toLowerCase()]; + if (composed.init.length > 1) { + updated.init = function () { + var args = arguments; + composed.init.forEach(function (init) { + init.apply(this, args); + }, this); + }; + } + if (composed.preEmit.length > 1) { + updated.preEmit = function () { + return composed.preEmit.reduce(function (args, preEmit) { + var newValue = preEmit.apply(this, args); + return newValue === undefined ? args : [newValue]; + }.bind(this), arguments); + }; + } + if (composed.shouldEmit.length > 1) { + updated.shouldEmit = function () { + var args = arguments; + return !composed.shouldEmit.some(function (shouldEmit) { + return !shouldEmit.apply(this, args); + }, this); + }; } + Object.keys(composed).forEach(function (composable) { + if (composed[composable].length === 1) { + updated[composable] = composed[composable][0]; + } + }); - throw new Error( - 'Locale data added to IntlMessageFormat is missing a ' + - '`pluralRuleFunction` for :' + locale - ); + return updated; }; - MessageFormat.prototype._format = function (pattern, values) { - var result = '', - i, len, part, id, value; - for (i = 0, len = pattern.length; i < len; i += 1) { - part = pattern[i]; +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { - // Exist early for string parts. - if (typeof part === 'string') { - result += part; + module.exports = function(store, definition) { + for (var name in definition) { + if (Object.getOwnPropertyDescriptor && Object.defineProperty) { + var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name); + + if (!propertyDescriptor.value || typeof propertyDescriptor.value !== 'function' || !definition.hasOwnProperty(name)) { continue; } - id = part.id; + store[name] = definition[name].bind(store); + } else { + var property = definition[name]; - // Enforce that all required values are provided by the caller. - if (!(values && src$utils$$.hop.call(values, id))) { - throw new Error('A value must be provided for: ' + id); + if (typeof property !== 'function' || !definition.hasOwnProperty(name)) { + continue; } - value = values[id]; - - // Recursively format plural and select parts' option — which can be a - // nested pattern structure. The choosing of the option to use is - // abstracted-by and delegated-to the part helper object. - if (part.options) { - result += this._format(part.getOption(value), values); - } else { - result += part.format(value); - } + store[name] = property.bind(store); } + } - return result; + return store; }; - MessageFormat.prototype._mergeFormats = function (defaults, formats) { - var mergedFormats = {}, - type, mergedType; - for (type in defaults) { - if (!src$utils$$.hop.call(defaults, type)) { continue; } +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + var _ = __webpack_require__(99); + + /** + * A module of methods for object that you want to be able to listen to. + * This module is consumed by `createStore` and `createAction` + */ + module.exports = { + + /** + * Hook used by the publisher that is invoked before emitting + * and before `shouldEmit`. The arguments are the ones that the action + * is invoked with. If this function returns something other than + * undefined, that will be passed on as arguments for shouldEmit and + * emission. + */ + preEmit: function() {}, + + /** + * Hook used by the publisher after `preEmit` to determine if the + * event should be emitted with given arguments. This may be overridden + * in your application, default implementation always returns true. + * + * @returns {Boolean} true if event should be emitted + */ + shouldEmit: function() { return true; }, + + /** + * Subscribes the given callback for action triggered + * + * @param {Function} callback The callback to register as event handler + * @param {Mixed} [optional] bindContext The context to bind the callback with + * @returns {Function} Callback that unsubscribes the registered event handler + */ + listen: function(callback, bindContext) { + bindContext = bindContext || this; + var eventHandler = function(args) { + if (aborted){ + return; + } + callback.apply(bindContext, args); + }, me = this, aborted = false; + this.emitter.addListener(this.eventLabel, eventHandler); + return function() { + aborted = true; + me.emitter.removeListener(me.eventLabel, eventHandler); + }; + }, + + /** + * Attach handlers to promise that trigger the completed and failed + * child publishers, if available. + * + * @param {Object} The promise to attach to + */ + promise: function(promise) { + var me = this; - mergedFormats[type] = mergedType = src$es5$$.objCreate(defaults[type]); + var canHandlePromise = + this.children.indexOf('completed') >= 0 && + this.children.indexOf('failed') >= 0; - if (formats && src$utils$$.hop.call(formats, type)) { - src$utils$$.extend(mergedType, formats[type]); + if (!canHandlePromise){ + throw new Error('Publisher must have "completed" and "failed" child publishers'); } - } - - return mergedFormats; - }; - - MessageFormat.prototype._resolveLocale = function (locales) { - if (typeof locales === 'string') { - locales = [locales]; - } - // Create a copy of the array so we can push on the default locale. - locales = (locales || []).concat(MessageFormat.defaultLocale); + promise.then(function(response) { + return me.completed(response); + }, function(error) { + return me.failed(error); + }); + }, - var localeData = MessageFormat.__localeData__; - var i, len, localeParts, data; + /** + * Subscribes the given callback for action triggered, which should + * return a promise that in turn is passed to `this.promise` + * + * @param {Function} callback The callback to register as event handler + */ + listenAndPromise: function(callback, bindContext) { + var me = this; + bindContext = bindContext || this; + this.willCallPromise = (this.willCallPromise || 0) + 1; - // Using the set of locales + the default locale, we look for the first one - // which that has been registered. When data does not exist for a locale, we - // traverse its ancestors to find something that's been registered within - // its hierarchy of locales. Since we lack the proper `parentLocale` data - // here, we must take a naive approach to traversal. - for (i = 0, len = locales.length; i < len; i += 1) { - localeParts = locales[i].toLowerCase().split('-'); + var removeListen = this.listen(function() { - while (localeParts.length) { - data = localeData[localeParts.join('-')]; - if (data) { - // Return the normalized locale string; e.g., we return "en-US", - // instead of "en-us". - return data.locale; + if (!callback) { + throw new Error('Expected a function returning a promise but got ' + callback); } - localeParts.pop(); - } - } - - var defaultLocale = locales.pop(); - throw new Error( - 'No locale data has been added to IntlMessageFormat for: ' + - locales.join(', ') + ', or the default locale: ' + defaultLocale - ); - }; - - //# sourceMappingURL=core.js.map - -/***/ }, -/* 112 */ -/***/ function(module, exports, __webpack_require__) { + var args = arguments, + promise = callback.apply(bindContext, args); + return me.promise.call(me, promise); + }, bindContext); - // GENERATED FILE - "use strict"; - exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}; + return function () { + me.willCallPromise--; + removeListen.call(me); + }; - //# sourceMappingURL=en.js.map + }, -/***/ }, -/* 113 */ -/***/ function(module, exports, __webpack_require__) { + /** + * Publishes an event using `this.emitter` (if `shouldEmit` agrees) + */ + trigger: function() { + var args = arguments, + pre = this.preEmit.apply(this, args); + args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre); + if (this.shouldEmit.apply(this, args)) { + this.emitter.emit(this.eventLabel, args); + } + }, - /* - Copyright (c) 2014, Yahoo! Inc. All rights reserved. - Copyrights licensed under the New BSD License. - See the accompanying LICENSE file for terms. - */ + /** + * Tries to publish the event on the next tick + */ + triggerAsync: function(){ + var args = arguments,me = this; + _.nextTick(function() { + me.trigger.apply(me, args); + }); + }, - /* jslint esnext: true */ + /** + * Returns a Promise for the triggered action + * + * @return {Promise} + * Resolved by completed child action. + * Rejected by failed child action. + * If listenAndPromise'd, then promise associated to this trigger. + * Otherwise, the promise is for next child action completion. + */ + triggerPromise: function(){ + var me = this; + var args = arguments; - "use strict"; + var canHandlePromise = + this.children.indexOf('completed') >= 0 && + this.children.indexOf('failed') >= 0; - var round = Math.round; + var promise = _.createPromise(function(resolve, reject) { + // If `listenAndPromise` is listening + // patch `promise` w/ context-loaded resolve/reject + if (me.willCallPromise) { + _.nextTick(function() { + var old_promise_method = me.promise; + me.promise = function (promise) { + promise.then(resolve, reject); + // Back to your regularly schedule programming. + me.promise = old_promise_method; + return me.promise.apply(me, arguments); + }; + me.trigger.apply(me, args); + }); + return; + } - function daysToYears(days) { - // 400 years have 146097 days (taking into account leap year rules) - return days * 400 / 146097; - } + if (canHandlePromise) { + var removeSuccess = me.completed.listen(function(args) { + removeSuccess(); + removeFailed(); + resolve(args); + }); - exports["default"] = function (from, to) { - // Convert to ms timestamps. - from = +from; - to = +to; + var removeFailed = me.failed.listen(function(args) { + removeSuccess(); + removeFailed(); + reject(args); + }); + } - var millisecond = round(to - from), - second = round(millisecond / 1000), - minute = round(second / 60), - hour = round(minute / 60), - day = round(hour / 24), - week = round(day / 7); + me.triggerAsync.apply(me, args); - var rawYears = daysToYears(day), - month = round(rawYears * 12), - year = round(rawYears); + if (!canHandlePromise) { + resolve(); + } + }); - return { - millisecond: millisecond, - second : second, - minute : minute, - hour : hour, - day : day, - week : week, - month : month, - year : year - }; + return promise; + } }; - //# sourceMappingURL=diff.js.map /***/ }, -/* 114 */ +/* 111 */ /***/ function(module, exports, __webpack_require__) { - /* - Copyright (c) 2014, Yahoo! Inc. All rights reserved. - Copyrights licensed under the New BSD License. - See the accompanying LICENSE file for terms. - */ - - /* jslint esnext: true */ - - "use strict"; - - // Purposely using the same implementation as the Intl.js `Intl` polyfill. - // Copyright 2013 Andy Earnshaw, MIT License + /** + * A module of methods that you want to include in all stores. + * This module is consumed by `createStore`. + */ + module.exports = { + }; - var hop = Object.prototype.hasOwnProperty; - var toString = Object.prototype.toString; - var realDefineProp = (function () { - try { return !!Object.defineProperty({}, 'a', {}); } - catch (e) { return false; } - })(); +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { - var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + var _ = __webpack_require__(99), + Reflux = __webpack_require__(95), + Keep = __webpack_require__(107), + allowed = {preEmit:1,shouldEmit:1}; - var defineProperty = realDefineProp ? Object.defineProperty : - function (obj, name, desc) { + /** + * Creates an action functor object. It is mixed in with functions + * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may + * be overridden in the definition object. + * + * @param {Object} definition The action object definition + */ + var createAction = function(definition) { - if ('get' in desc && obj.__defineGetter__) { - obj.__defineGetter__(name, desc.get); - } else if (!hop.call(obj, name) || 'value' in desc) { - obj[name] = desc.value; + definition = definition || {}; + if (!_.isObject(definition)){ + definition = {actionName: definition}; } - }; - - var objCreate = Object.create || function (proto, props) { - var obj, k; - - function F() {} - F.prototype = proto; - obj = new F(); - for (k in props) { - if (hop.call(props, k)) { - defineProperty(obj, k, props[k]); + for(var a in Reflux.ActionMethods){ + if (!allowed[a] && Reflux.PublisherMethods[a]) { + throw new Error("Cannot override API method " + a + + " in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead." + ); } } - return obj; - }; + for(var d in definition){ + if (!allowed[d] && Reflux.PublisherMethods[d]) { + throw new Error("Cannot override API method " + d + + " in action creation. Use another method name or override it on Reflux.PublisherMethods instead." + ); + } + } - var arrIndexOf = Array.prototype.indexOf || function (search, fromIndex) { - /*jshint validthis:true */ - var arr = this; - if (!arr.length) { - return -1; + definition.children = definition.children || []; + if (definition.asyncResult){ + definition.children = definition.children.concat(["completed","failed"]); } - for (var i = fromIndex || 0, max = arr.length; i < max; i++) { - if (arr[i] === search) { - return i; - } + var i = 0, childActions = {}; + for (; i < definition.children.length; i++) { + var name = definition.children[i]; + childActions[name] = createAction(name); } - return -1; - }; + var context = _.extend({ + eventLabel: "action", + emitter: new _.EventEmitter(), + _isAction: true + }, Reflux.PublisherMethods, Reflux.ActionMethods, definition); - var isArray = Array.isArray || function (obj) { - return toString.call(obj) === '[object Array]'; - }; + var functor = function() { + return functor[functor.sync?"trigger":"triggerPromise"].apply(functor, arguments); + }; - var dateNow = Date.now || function () { - return new Date().getTime(); - }; - exports.defineProperty = defineProperty, exports.objCreate = objCreate, exports.arrIndexOf = arrIndexOf, exports.isArray = isArray, exports.dateNow = dateNow; + _.extend(functor,childActions,context); - //# sourceMappingURL=es5.js.map + Keep.createdActions.push(functor); -/***/ }, -/* 115 */ -/***/ function(module, exports, __webpack_require__) { + return functor; - /* - Copyright (c) 2014, Yahoo! Inc. All rights reserved. - Copyrights licensed under the New BSD License. - See the accompanying LICENSE file for terms. - */ + }; - /* jslint esnext: true */ + module.exports = createAction; - "use strict"; - exports.extend = extend; - var hop = Object.prototype.hasOwnProperty; - function extend(obj) { - var sources = Array.prototype.slice.call(arguments, 1), - i, len, source, key; +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { - for (i = 0, len = sources.length; i < len; i += 1) { - source = sources[i]; - if (!source) { continue; } + var Reflux = __webpack_require__(95), + _ = __webpack_require__(99); - for (key in source) { - if (hop.call(source, key)) { - obj[key] = source[key]; + module.exports = function(listenable,key){ + return { + getInitialState: function(){ + if (!_.isFunction(listenable.getInitialState)) { + return {}; + } else if (key === undefined) { + return listenable.getInitialState(); + } else { + return _.object([key],[listenable.getInitialState()]); } - } - } - - return obj; - } - exports.hop = hop; + }, + componentDidMount: function(){ + _.extend(this,Reflux.ListenerMethods); + var me = this, cb = (key === undefined ? this.setState : function(v){me.setState(_.object([key],[v]));}); + this.listenTo(listenable,cb); + }, + componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount + }; + }; - //# sourceMappingURL=utils.js.map /***/ }, -/* 116 */ +/* 114 */ /***/ function(module, exports, __webpack_require__) { - /* - Copyright (c) 2014, Yahoo! Inc. All rights reserved. - Copyrights licensed under the New BSD License. - See the accompanying LICENSE file for terms. - */ + var Reflux = __webpack_require__(95), + _ = __webpack_require__(99); - /* jslint esnext: true */ + module.exports = function(listenable, key, filterFunc) { + filterFunc = _.isFunction(key) ? key : filterFunc; + return { + getInitialState: function() { + if (!_.isFunction(listenable.getInitialState)) { + return {}; + } else if (_.isFunction(key)) { + return filterFunc.call(this, listenable.getInitialState()); + } else { + // Filter initial payload from store. + var result = filterFunc.call(this, listenable.getInitialState()); + if (result) { + return _.object([key], [result]); + } else { + return {}; + } + } + }, + componentDidMount: function() { + _.extend(this, Reflux.ListenerMethods); + var me = this; + var cb = function(value) { + if (_.isFunction(key)) { + me.setState(filterFunc.call(me, value)); + } else { + var result = filterFunc.call(me, value); + me.setState(_.object([key], [result])); + } + }; - "use strict"; - var src$utils$$ = __webpack_require__(115); + this.listenTo(listenable, cb); + }, + componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount + }; + }; - // Purposely using the same implementation as the Intl.js `Intl` polyfill. - // Copyright 2013 Andy Earnshaw, MIT License - var realDefineProp = (function () { - try { return !!Object.defineProperty({}, 'a', {}); } - catch (e) { return false; } - })(); - var es3 = !realDefineProp && !Object.prototype.__defineGetter__; +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { - var defineProperty = realDefineProp ? Object.defineProperty : - function (obj, name, desc) { + var _ = __webpack_require__(99), + ListenerMethods = __webpack_require__(98); - if ('get' in desc && obj.__defineGetter__) { - obj.__defineGetter__(name, desc.get); - } else if (!src$utils$$.hop.call(obj, name) || 'value' in desc) { - obj[name] = desc.value; - } - }; + /** + * A module meant to be consumed as a mixin by a React component. Supplies the methods from + * `ListenerMethods` mixin and takes care of teardown of subscriptions. + * Note that if you're using the `connect` mixin you don't need this mixin, as connect will + * import everything this mixin contains! + */ + module.exports = _.extend({ - var objCreate = Object.create || function (proto, props) { - var obj, k; + /** + * Cleans up all listener previously registered. + */ + componentWillUnmount: ListenerMethods.stopListeningToAll - function F() {} - F.prototype = proto; - obj = new F(); + }, ListenerMethods); - for (k in props) { - if (src$utils$$.hop.call(props, k)) { - defineProperty(obj, k, props[k]); - } - } - return obj; +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + var Reflux = __webpack_require__(95); + + /** + * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`, + * without having to manually set listeners in the `componentDidMount` method. This version is used + * to automatically set up a `listenToMany` call. + * + * @param {Object} listenables An object of listenables + * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables. + */ + module.exports = function(listenables){ + return { + /** + * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` + * and then make the call to `listenTo` with the arguments provided to the factory function + */ + componentDidMount: function() { + for(var m in Reflux.ListenerMethods){ + if (this[m] !== Reflux.ListenerMethods[m]){ + if (this[m]){ + throw "Can't have other property '"+m+"' when using Reflux.listenToMany!"; + } + this[m] = Reflux.ListenerMethods[m]; + } + } + this.listenToMany(listenables); + }, + /** + * Cleans up all listener previously registered. + */ + componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll + }; }; - exports.defineProperty = defineProperty, exports.objCreate = objCreate; - //# sourceMappingURL=es5.js.map /***/ }, /* 117 */ /***/ function(module, exports, __webpack_require__) { - /* - Copyright (c) 2014, Yahoo! Inc. All rights reserved. - Copyrights licensed under the New BSD License. - See the accompanying LICENSE file for terms. - */ + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - /* jslint esnext: true */ + var request = __webpack_require__(118); - "use strict"; - exports["default"] = Compiler; + var _headers = {}; - function Compiler(locales, formats, pluralFn) { - this.locales = locales; - this.formats = formats; - this.pluralFn = pluralFn; - } + var _timeout = 10000; // 10s - Compiler.prototype.compile = function (ast) { - this.pluralStack = []; - this.currentPlural = null; - this.pluralNumberFormat = null; + // convert params to string, to deal with array values + function buildQueryParams(params) { + var result = []; + for (var property in params) { + if (params.hasOwnProperty(property)) { + var value = params[property]; + if (null !== value && undefined !== value) { + if (Array.isArray(value)) { + for (var i = 0; i < value.length; i++) { + result.push(property + '=' + value[i]); + } + } else { + result.push(property + '=' + value); + } + } + } + } + return result.join('&'); + } - return this.compileMessage(ast); - }; + var Rest = { - Compiler.prototype.compileMessage = function (ast) { - if (!(ast && ast.type === 'messageFormatPattern')) { - throw new Error('Message AST is not of type: "messageFormatPattern"'); - } + setTimeout: function (timeout) { + _timeout = timeout; + }, - var elements = ast.elements, - pattern = []; + setHeaders: function (headers) { + _headers = headers; + }, - var i, len, element; + setHeader: function (name, value) { + _headers[name] = value; + }, - for (i = 0, len = elements.length; i < len; i += 1) { - element = elements[i]; + head: function (uri, params) { + var op = request.head(uri).query(buildQueryParams(params)); + op.timeout(_timeout); + op.set(_headers); + return op; + }, - switch (element.type) { - case 'messageTextElement': - pattern.push(this.compileMessageText(element)); - break; + get: function (uri, params) { + var op = request.get(uri).query(buildQueryParams(params)); + op.timeout(_timeout); + op.set(_headers); + return op; + }, - case 'argumentElement': - pattern.push(this.compileArgument(element)); - break; + patch: function (uri, data) { + var op = request.patch(uri).send(data); + op.timeout(_timeout); + op.set(_headers); + return op; + }, - default: - throw new Error('Message element does not have a valid type'); - } - } + post: function (uri, data) { + var op = request.post(uri).send(data); + op.timeout(_timeout); + op.set(_headers); + return op; + }, - return pattern; + put: function (uri, data) { + var op = request.put(uri).send(data); + op.timeout(_timeout); + op.set(_headers); + return op; + }, + + del: function (uri) { + var op = request.del(uri); + op.timeout(_timeout); + op.set(_headers); + return op; + } }; - Compiler.prototype.compileMessageText = function (element) { - // When this `element` is part of plural sub-pattern and its value contains - // an unescaped '#', use a `PluralOffsetString` helper to properly output - // the number with the correct offset in the string. - if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) { - // Create a cache a NumberFormat instance that can be reused for any - // PluralOffsetString instance in this message. - if (!this.pluralNumberFormat) { - this.pluralNumberFormat = new Intl.NumberFormat(this.locales); - } + module.exports = Rest; - return new PluralOffsetString( - this.currentPlural.id, - this.currentPlural.format.offset, - this.pluralNumberFormat, - element.value); - } - // Unescape the escaped '#'s in the message text. - return element.value.replace(/\\#/g, '#'); - }; +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { - Compiler.prototype.compileArgument = function (element) { - var format = element.format; + /** + * Module dependencies. + */ - if (!format) { - return new StringFormat(element.id); - } + var Emitter = __webpack_require__(119); + var reduce = __webpack_require__(120); - var formats = this.formats, - locales = this.locales, - pluralFn = this.pluralFn, - options; + /** + * Root reference for iframes. + */ - switch (format.type) { - case 'numberFormat': - options = formats.number[format.style]; - return { - id : element.id, - format: new Intl.NumberFormat(locales, options).format - }; + var root = 'undefined' == typeof window + ? (this || self) + : window; - case 'dateFormat': - options = formats.date[format.style]; - return { - id : element.id, - format: new Intl.DateTimeFormat(locales, options).format - }; + /** + * Noop. + */ - case 'timeFormat': - options = formats.time[format.style]; - return { - id : element.id, - format: new Intl.DateTimeFormat(locales, options).format - }; + function noop(){}; - case 'pluralFormat': - options = this.compileOptions(element); - return new PluralFormat( - element.id, format.ordinal, format.offset, options, pluralFn - ); + /** + * Check if `obj` is a host object, + * we don't want to serialize these :) + * + * TODO: future proof, move to compoent land + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ - case 'selectFormat': - options = this.compileOptions(element); - return new SelectFormat(element.id, options); + function isHost(obj) { + var str = {}.toString.call(obj); - default: - throw new Error('Message element does not have a valid format type'); - } + switch (str) { + case '[object File]': + case '[object Blob]': + case '[object FormData]': + return true; + default: + return false; + } + } + + /** + * Determine XHR. + */ + + request.getXHR = function () { + if (root.XMLHttpRequest + && (!root.location || 'file:' != root.location.protocol + || !root.ActiveXObject)) { + return new XMLHttpRequest; + } else { + try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} + } + return false; }; - Compiler.prototype.compileOptions = function (element) { - var format = element.format, - options = format.options, - optionsHash = {}; + /** + * Removes leading and trailing whitespace, added to support IE. + * + * @param {String} s + * @return {String} + * @api private + */ - // Save the current plural element, if any, then set it to a new value when - // compiling the options sub-patterns. This conforms the spec's algorithm - // for handling `"#"` syntax in message text. - this.pluralStack.push(this.currentPlural); - this.currentPlural = format.type === 'pluralFormat' ? element : null; + var trim = ''.trim + ? function(s) { return s.trim(); } + : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); }; - var i, len, option; + /** + * Check if `obj` is an object. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ - for (i = 0, len = options.length; i < len; i += 1) { - option = options[i]; + function isObject(obj) { + return obj === Object(obj); + } - // Compile the sub-pattern and save it under the options's selector. - optionsHash[option.selector] = this.compileMessage(option.value); - } + /** + * Serialize the given `obj`. + * + * @param {Object} obj + * @return {String} + * @api private + */ - // Pop the plural stack to put back the original current plural value. - this.currentPlural = this.pluralStack.pop(); + function serialize(obj) { + if (!isObject(obj)) return obj; + var pairs = []; + for (var key in obj) { + if (null != obj[key]) { + pairs.push(encodeURIComponent(key) + + '=' + encodeURIComponent(obj[key])); + } + } + return pairs.join('&'); + } - return optionsHash; - }; + /** + * Expose serialization method. + */ - // -- Compiler Helper Classes -------------------------------------------------- + request.serializeObject = serialize; - function StringFormat(id) { - this.id = id; - } + /** + * Parse the given x-www-form-urlencoded `str`. + * + * @param {String} str + * @return {Object} + * @api private + */ - StringFormat.prototype.format = function (value) { - if (!value) { - return ''; - } + function parseString(str) { + var obj = {}; + var pairs = str.split('&'); + var parts; + var pair; - return typeof value === 'string' ? value : String(value); - }; + for (var i = 0, len = pairs.length; i < len; ++i) { + pair = pairs[i]; + parts = pair.split('='); + obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); + } - function PluralFormat(id, useOrdinal, offset, options, pluralFn) { - this.id = id; - this.useOrdinal = useOrdinal; - this.offset = offset; - this.options = options; - this.pluralFn = pluralFn; + return obj; } - PluralFormat.prototype.getOption = function (value) { - var options = this.options; + /** + * Expose parser. + */ - var option = options['=' + value] || - options[this.pluralFn(value - this.offset, this.useOrdinal)]; + request.parseString = parseString; - return option || options.other; - }; + /** + * Default MIME type map. + * + * superagent.types.xml = 'application/xml'; + * + */ - function PluralOffsetString(id, offset, numberFormat, string) { - this.id = id; - this.offset = offset; - this.numberFormat = numberFormat; - this.string = string; - } + request.types = { + html: 'text/html', + json: 'application/json', + xml: 'application/xml', + urlencoded: 'application/x-www-form-urlencoded', + 'form': 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' + }; - PluralOffsetString.prototype.format = function (value) { - var number = this.numberFormat.format(value - this.offset); + /** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ - return this.string - .replace(/(^|[^\\])#/g, '$1' + number) - .replace(/\\#/g, '#'); - }; + request.serialize = { + 'application/x-www-form-urlencoded': serialize, + 'application/json': JSON.stringify + }; - function SelectFormat(id, options) { - this.id = id; - this.options = options; - } + /** + * Default parsers. + * + * superagent.parse['application/xml'] = function(str){ + * return { object parsed from str }; + * }; + * + */ - SelectFormat.prototype.getOption = function (value) { - var options = this.options; - return options[value] || options.other; + request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse }; - //# sourceMappingURL=compiler.js.map + /** + * Parse the given header `str` into + * an object containing the mapped fields. + * + * @param {String} str + * @return {Object} + * @api private + */ -/***/ }, -/* 118 */ -/***/ function(module, exports, __webpack_require__) { + function parseHeader(str) { + var lines = str.split(/\r?\n/); + var fields = {}; + var index; + var line; + var field; + var val; - "use strict"; + lines.pop(); // trailing CRLF - // Purposely using the same implementation as the Intl.js `Intl` polyfill. - // Copyright 2013 Andy Earnshaw, MIT License + for (var i = 0, len = lines.length; i < len; ++i) { + line = lines[i]; + index = line.indexOf(':'); + field = line.slice(0, index).toLowerCase(); + val = trim(line.slice(index + 1)); + fields[field] = val; + } - var hop = Object.prototype.hasOwnProperty; + return fields; + } - var realDefineProp = (function () { - try { return !!Object.defineProperty({}, 'a', {}); } - catch (e) { return false; } - })(); + /** + * Return the mime type for the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ - var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + function type(str){ + return str.split(/ *; */).shift(); + }; - var defineProperty = realDefineProp ? Object.defineProperty : - function (obj, name, desc) { + /** + * Return header field parameters. + * + * @param {String} str + * @return {Object} + * @api private + */ - if ('get' in desc && obj.__defineGetter__) { - obj.__defineGetter__(name, desc.get); - } else if (!hop.call(obj, name) || 'value' in desc) { - obj[name] = desc.value; - } + function params(str){ + return reduce(str.split(/ *; */), function(obj, str){ + var parts = str.split(/ *= */) + , key = parts.shift() + , val = parts.shift(); + + if (key && val) obj[key] = val; + return obj; + }, {}); }; - var objCreate = Object.create || function (proto, props) { - var obj, k; + /** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * Examples: + * + * Aliasing `superagent` as `request` is nice: + * + * request = superagent; + * + * We can use the promise-like API, or pass callbacks: + * + * request.get('/').end(function(res){}); + * request.get('/', function(res){}); + * + * Sending data can be chained: + * + * request + * .post('/user') + * .send({ name: 'tj' }) + * .end(function(res){}); + * + * Or passed to `.send()`: + * + * request + * .post('/user') + * .send({ name: 'tj' }, function(res){}); + * + * Or passed to `.post()`: + * + * request + * .post('/user', { name: 'tj' }) + * .end(function(res){}); + * + * Or further reduced to a single call for simple cases: + * + * request + * .post('/user', { name: 'tj' }, function(res){}); + * + * @param {XMLHTTPRequest} xhr + * @param {Object} options + * @api private + */ - function F() {} - F.prototype = proto; - obj = new F(); + function Response(req, options) { + options = options || {}; + this.req = req; + this.xhr = this.req.xhr; + // responseText is accessible only if responseType is '' or 'text' and on older browsers + this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined') + ? this.xhr.responseText + : null; + this.statusText = this.req.xhr.statusText; + this.setStatusProperties(this.xhr.status); + this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but + // getResponseHeader still works. so we get content-type even if getting + // other headers fails. + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + this.setHeaderProperties(this.header); + this.body = this.req.method != 'HEAD' + ? this.parseBody(this.text ? this.text : this.xhr.response) + : null; + } - for (k in props) { - if (hop.call(props, k)) { - defineProperty(obj, k, props[k]); - } - } + /** + * Get case-insensitive `field` value. + * + * @param {String} field + * @return {String} + * @api public + */ - return obj; + Response.prototype.get = function(field){ + return this.header[field.toLowerCase()]; }; - exports.defineProperty = defineProperty, exports.objCreate = objCreate; - - //# sourceMappingURL=es5.js.map -/***/ }, -/* 119 */ -/***/ function(module, exports, __webpack_require__) { + /** + * Set header related properties: + * + * - `.type` the content type without params + * + * A response of "Content-Type: text/plain; charset=utf-8" + * will provide you with a `.type` of "text/plain". + * + * @param {Object} header + * @api private + */ - 'use strict'; + Response.prototype.setHeaderProperties = function(header){ + // content-type + var ct = this.header['content-type'] || ''; + this.type = type(ct); - exports = module.exports = __webpack_require__(121)['default']; - exports['default'] = exports; + // params + var obj = params(ct); + for (var key in obj) this[key] = obj[key]; + }; + /** + * Parse the given body `str`. + * + * Used for auto-parsing of bodies. Parsers + * are defined on the `superagent.parse` object. + * + * @param {String} str + * @return {Mixed} + * @api private + */ -/***/ }, -/* 120 */ -/***/ function(module, exports, __webpack_require__) { + Response.prototype.parseBody = function(str){ + var parse = request.parse[this.type]; + return parse && str && (str.length || str instanceof Object) + ? parse(str) + : null; + }; - // shim for using process in browser + /** + * Set flags such as `.ok` based on `status`. + * + * For example a 2xx response will give you a `.ok` of __true__ + * whereas 5xx will be __false__ and `.error` will be __true__. The + * `.clientError` and `.serverError` are also available to be more + * specific, and `.statusType` is the class of error ranging from 1..5 + * sometimes useful for mapping respond colors etc. + * + * "sugar" properties are also defined for common cases. Currently providing: + * + * - .noContent + * - .badRequest + * - .unauthorized + * - .notAcceptable + * - .notFound + * + * @param {Number} status + * @api private + */ - var process = module.exports = {}; - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; + Response.prototype.setStatusProperties = function(status){ + // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + if (status === 1223) { + status = 204; + } - function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } + var type = status / 100 | 0; - function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; + // status / class + this.status = status; + this.statusType = type; - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - currentQueue[queueIndex].run(); - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); - } + // basics + this.info = 1 == type; + this.ok = 2 == type; + this.clientError = 4 == type; + this.serverError = 5 == type; + this.error = (4 == type || 5 == type) + ? this.toError() + : false; - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } + // sugar + this.accepted = 202 == status; + this.noContent = 204 == status; + this.badRequest = 400 == status; + this.unauthorized = 401 == status; + this.notAcceptable = 406 == status; + this.notFound = 404 == status; + this.forbidden = 403 == status; }; - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; + /** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ - function noop() {} + Response.prototype.toError = function(){ + var req = this.req; + var method = req.method; + var url = req.url; - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; + var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')'; + var err = new Error(msg); + err.status = this.status; + err.method = method; + err.url = url; - process.binding = function (name) { - throw new Error('process.binding is not supported'); + return err; }; - // TODO(shtylman) - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; + /** + * Expose `Response`. + */ + request.Response = Response; -/***/ }, -/* 121 */ -/***/ function(module, exports, __webpack_require__) { + /** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String} url + * @api public + */ - "use strict"; + function Request(method, url) { + var self = this; + Emitter.call(this); + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; + this._header = {}; + this.on('end', function(){ + var err = null; + var res = null; - exports["default"] = (function() { - /* - * Generated by PEG.js 0.8.0. - * - * http://pegjs.majda.cz/ - */ + try { + res = new Response(self); + } catch(e) { + err = new Error('Parser is unable to parse the response'); + err.parse = true; + err.original = e; + return self.callback(err); + } - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - } + self.emit('response', res); - function SyntaxError(message, expected, found, offset, line, column) { - this.message = message; - this.expected = expected; - this.found = found; - this.offset = offset; - this.line = line; - this.column = column; + if (err) { + return self.callback(err, res); + } - this.name = "SyntaxError"; - } + if (res.status >= 200 && res.status < 300) { + return self.callback(err, res); + } - peg$subclass(SyntaxError, Error); + var new_err = new Error(res.statusText || 'Unsuccessful HTTP response'); + new_err.original = err; + new_err.response = res; + new_err.status = res.status; - function parse(input) { - var options = arguments.length > 1 ? arguments[1] : {}, + self.callback(err || new_err, res); + }); + } - peg$FAILED = {}, + /** + * Mixin `Emitter`. + */ - peg$startRuleFunctions = { start: peg$parsestart }, - peg$startRuleFunction = peg$parsestart, + Emitter(Request.prototype); + + /** + * Allow for extension + */ - peg$c0 = [], - peg$c1 = function(elements) { - return { - type : 'messageFormatPattern', - elements: elements - }; - }, - peg$c2 = peg$FAILED, - peg$c3 = function(text) { - var string = '', - i, j, outerLen, inner, innerLen; + Request.prototype.use = function(fn) { + fn(this); + return this; + } - for (i = 0, outerLen = text.length; i < outerLen; i += 1) { - inner = text[i]; + /** + * Set timeout to `ms`. + * + * @param {Number} ms + * @return {Request} for chaining + * @api public + */ - for (j = 0, innerLen = inner.length; j < innerLen; j += 1) { - string += inner[j]; - } - } + Request.prototype.timeout = function(ms){ + this._timeout = ms; + return this; + }; - return string; - }, - peg$c4 = function(messageText) { - return { - type : 'messageTextElement', - value: messageText - }; - }, - peg$c5 = /^[^ \t\n\r,.+={}#]/, - peg$c6 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" }, - peg$c7 = "{", - peg$c8 = { type: "literal", value: "{", description: "\"{\"" }, - peg$c9 = null, - peg$c10 = ",", - peg$c11 = { type: "literal", value: ",", description: "\",\"" }, - peg$c12 = "}", - peg$c13 = { type: "literal", value: "}", description: "\"}\"" }, - peg$c14 = function(id, format) { - return { - type : 'argumentElement', - id : id, - format: format && format[2] - }; - }, - peg$c15 = "number", - peg$c16 = { type: "literal", value: "number", description: "\"number\"" }, - peg$c17 = "date", - peg$c18 = { type: "literal", value: "date", description: "\"date\"" }, - peg$c19 = "time", - peg$c20 = { type: "literal", value: "time", description: "\"time\"" }, - peg$c21 = function(type, style) { - return { - type : type + 'Format', - style: style && style[2] - }; - }, - peg$c22 = "plural", - peg$c23 = { type: "literal", value: "plural", description: "\"plural\"" }, - peg$c24 = function(pluralStyle) { - return { - type : pluralStyle.type, - ordinal: false, - offset : pluralStyle.offset || 0, - options: pluralStyle.options - }; - }, - peg$c25 = "selectordinal", - peg$c26 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" }, - peg$c27 = function(pluralStyle) { - return { - type : pluralStyle.type, - ordinal: true, - offset : pluralStyle.offset || 0, - options: pluralStyle.options - } - }, - peg$c28 = "select", - peg$c29 = { type: "literal", value: "select", description: "\"select\"" }, - peg$c30 = function(options) { - return { - type : 'selectFormat', - options: options - }; - }, - peg$c31 = "=", - peg$c32 = { type: "literal", value: "=", description: "\"=\"" }, - peg$c33 = function(selector, pattern) { - return { - type : 'optionalFormatPattern', - selector: selector, - value : pattern - }; - }, - peg$c34 = "offset:", - peg$c35 = { type: "literal", value: "offset:", description: "\"offset:\"" }, - peg$c36 = function(number) { - return number; - }, - peg$c37 = function(offset, options) { - return { - type : 'pluralFormat', - offset : offset, - options: options - }; - }, - peg$c38 = { type: "other", description: "whitespace" }, - peg$c39 = /^[ \t\n\r]/, - peg$c40 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, - peg$c41 = { type: "other", description: "optionalWhitespace" }, - peg$c42 = /^[0-9]/, - peg$c43 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c44 = /^[0-9a-f]/i, - peg$c45 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, - peg$c46 = "0", - peg$c47 = { type: "literal", value: "0", description: "\"0\"" }, - peg$c48 = /^[1-9]/, - peg$c49 = { type: "class", value: "[1-9]", description: "[1-9]" }, - peg$c50 = function(digits) { - return parseInt(digits, 10); - }, - peg$c51 = /^[^{}\\\0-\x1F \t\n\r]/, - peg$c52 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" }, - peg$c53 = "\\#", - peg$c54 = { type: "literal", value: "\\#", description: "\"\\\\#\"" }, - peg$c55 = function() { return '\\#'; }, - peg$c56 = "\\{", - peg$c57 = { type: "literal", value: "\\{", description: "\"\\\\{\"" }, - peg$c58 = function() { return '\u007B'; }, - peg$c59 = "\\}", - peg$c60 = { type: "literal", value: "\\}", description: "\"\\\\}\"" }, - peg$c61 = function() { return '\u007D'; }, - peg$c62 = "\\u", - peg$c63 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, - peg$c64 = function(digits) { - return String.fromCharCode(parseInt(digits, 16)); - }, - peg$c65 = function(chars) { return chars.join(''); }, + /** + * Clear previous timeout. + * + * @return {Request} for chaining + * @api public + */ - peg$currPos = 0, - peg$reportedPos = 0, - peg$cachedPos = 0, - peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, + Request.prototype.clearTimeout = function(){ + this._timeout = 0; + clearTimeout(this._timer); + return this; + }; - peg$result; + /** + * Abort the request, and clear potential timeout. + * + * @return {Request} + * @api public + */ - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } + Request.prototype.abort = function(){ + if (this.aborted) return; + this.aborted = true; + this.xhr.abort(); + this.clearTimeout(); + this.emit('abort'); + return this; + }; - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } + /** + * Set header `field` to `val`, or multiple fields with one object. + * + * Examples: + * + * req.get('/') + * .set('Accept', 'application/json') + * .set('X-API-Key', 'foobar') + * .end(callback); + * + * req.get('/') + * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) + * .end(callback); + * + * @param {String|Object} field + * @param {String} val + * @return {Request} for chaining + * @api public + */ - function text() { - return input.substring(peg$reportedPos, peg$currPos); + Request.prototype.set = function(field, val){ + if (isObject(field)) { + for (var key in field) { + this.set(key, field[key]); } + return this; + } + this._header[field.toLowerCase()] = val; + this.header[field] = val; + return this; + }; - function offset() { - return peg$reportedPos; - } + /** + * Remove header `field`. + * + * Example: + * + * req.get('/') + * .unset('User-Agent') + * .end(callback); + * + * @param {String} field + * @return {Request} for chaining + * @api public + */ - function line() { - return peg$computePosDetails(peg$reportedPos).line; - } + Request.prototype.unset = function(field){ + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; + }; - function column() { - return peg$computePosDetails(peg$reportedPos).column; - } + /** + * Get case-insensitive header `field` value. + * + * @param {String} field + * @return {String} + * @api private + */ + + Request.prototype.getHeader = function(field){ + return this._header[field.toLowerCase()]; + }; - function expected(description) { - throw peg$buildException( - null, - [{ type: "other", description: description }], - peg$reportedPos - ); - } + /** + * Set Content-Type to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.xml = 'application/xml'; + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('application/xml') + * .send(xmlstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ - function error(message) { - throw peg$buildException(message, null, peg$reportedPos); - } + Request.prototype.type = function(type){ + this.set('Content-Type', request.types[type] || type); + return this; + }; - function peg$computePosDetails(pos) { - function advance(details, startPos, endPos) { - var p, ch; + /** + * Set Accept to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ - for (p = startPos; p < endPos; p++) { - ch = input.charAt(p); - if (ch === "\n") { - if (!details.seenCR) { details.line++; } - details.column = 1; - details.seenCR = false; - } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { - details.line++; - details.column = 1; - details.seenCR = true; - } else { - details.column++; - details.seenCR = false; - } - } - } + Request.prototype.accept = function(type){ + this.set('Accept', request.types[type] || type); + return this; + }; - if (peg$cachedPos !== pos) { - if (peg$cachedPos > pos) { - peg$cachedPos = 0; - peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; - } - advance(peg$cachedPosDetails, peg$cachedPos, pos); - peg$cachedPos = pos; - } + /** + * Set Authorization field value with `user` and `pass`. + * + * @param {String} user + * @param {String} pass + * @return {Request} for chaining + * @api public + */ - return peg$cachedPosDetails; - } + Request.prototype.auth = function(user, pass){ + var str = btoa(user + ':' + pass); + this.set('Authorization', 'Basic ' + str); + return this; + }; - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } + /** + * Add query-string `val`. + * + * Examples: + * + * request.get('/shoes') + * .query('size=10') + * .query({ color: 'blue' }) + * + * @param {Object|String} val + * @return {Request} for chaining + * @api public + */ - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } + Request.prototype.query = function(val){ + if ('string' != typeof val) val = serialize(val); + if (val) this._query.push(val); + return this; + }; - peg$maxFailExpected.push(expected); - } + /** + * Write the field `name` and `val` for "multipart/form-data" + * request bodies. + * + * ``` js + * request.post('/upload') + * .field('foo', 'bar') + * .end(callback); + * ``` + * + * @param {String} name + * @param {String|Blob|File} val + * @return {Request} for chaining + * @api public + */ - function peg$buildException(message, expected, pos) { - function cleanupExpected(expected) { - var i = 1; + Request.prototype.field = function(name, val){ + if (!this._formData) this._formData = new root.FormData(); + this._formData.append(name, val); + return this; + }; - expected.sort(function(a, b) { - if (a.description < b.description) { - return -1; - } else if (a.description > b.description) { - return 1; - } else { - return 0; - } - }); + /** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `filename`. + * + * ``` js + * request.post('/upload') + * .attach(new Blob(['hey!'], { type: "text/html"})) + * .end(callback); + * ``` + * + * @param {String} field + * @param {Blob|File} file + * @param {String} filename + * @return {Request} for chaining + * @api public + */ - while (i < expected.length) { - if (expected[i - 1] === expected[i]) { - expected.splice(i, 1); - } else { - i++; - } - } - } + Request.prototype.attach = function(field, file, filename){ + if (!this._formData) this._formData = new root.FormData(); + this._formData.append(field, file, filename); + return this; + }; - function buildMessage(expected, found) { - function stringEscape(s) { - function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + /** + * Send `data`, defaulting the `.type()` to "json" when + * an object is given. + * + * Examples: + * + * // querystring + * request.get('/search') + * .end(callback) + * + * // multiple data "writes" + * request.get('/search') + * .send({ search: 'query' }) + * .send({ range: '1..5' }) + * .send({ order: 'desc' }) + * .end(callback) + * + * // manual json + * request.post('/user') + * .type('json') + * .send('{"name":"tj"}) + * .end(callback) + * + * // auto json + * request.post('/user') + * .send({ name: 'tj' }) + * .end(callback) + * + * // manual x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send('name=tj') + * .end(callback) + * + * // auto x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send({ name: 'tj' }) + * .end(callback) + * + * // defaults to x-www-form-urlencoded + * request.post('/user') + * .send('name=tobi') + * .send('species=ferret') + * .end(callback) + * + * @param {String|Object} data + * @return {Request} for chaining + * @api public + */ - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\x08/g, '\\b') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\f/g, '\\f') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) - .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) - .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); - } + Request.prototype.send = function(data){ + var obj = isObject(data); + var type = this.getHeader('Content-Type'); - var expectedDescs = new Array(expected.length), - expectedDesc, foundDesc, i; + // merge + if (obj && isObject(this._data)) { + for (var key in data) { + this._data[key] = data[key]; + } + } else if ('string' == typeof data) { + if (!type) this.type('form'); + type = this.getHeader('Content-Type'); + if ('application/x-www-form-urlencoded' == type) { + this._data = this._data + ? this._data + '&' + data + : data; + } else { + this._data = (this._data || '') + data; + } + } else { + this._data = data; + } - for (i = 0; i < expected.length; i++) { - expectedDescs[i] = expected[i].description; - } + if (!obj || isHost(data)) return this; + if (!type) this.type('json'); + return this; + }; - expectedDesc = expected.length > 1 - ? expectedDescs.slice(0, -1).join(", ") - + " or " - + expectedDescs[expected.length - 1] - : expectedDescs[0]; + /** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ - foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + Request.prototype.callback = function(err, res){ + var fn = this._callback; + this.clearTimeout(); + fn(err, res); + }; - return "Expected " + expectedDesc + " but " + foundDesc + " found."; - } + /** + * Invoke callback with x-domain error. + * + * @api private + */ - var posDetails = peg$computePosDetails(pos), - found = pos < input.length ? input.charAt(pos) : null; + Request.prototype.crossDomainError = function(){ + var err = new Error('Origin is not allowed by Access-Control-Allow-Origin'); + err.crossDomain = true; + this.callback(err); + }; - if (expected !== null) { - cleanupExpected(expected); - } + /** + * Invoke callback with timeout error. + * + * @api private + */ - return new SyntaxError( - message !== null ? message : buildMessage(expected, found), - expected, - found, - pos, - posDetails.line, - posDetails.column - ); - } + Request.prototype.timeoutError = function(){ + var timeout = this._timeout; + var err = new Error('timeout of ' + timeout + 'ms exceeded'); + err.timeout = timeout; + this.callback(err); + }; - function peg$parsestart() { - var s0; + /** + * Enable transmission of cookies with x-domain requests. + * + * Note that for this to work the origin must not be + * using "Access-Control-Allow-Origin" with a wildcard, + * and also must set "Access-Control-Allow-Credentials" + * to "true". + * + * @api public + */ - s0 = peg$parsemessageFormatPattern(); + Request.prototype.withCredentials = function(){ + this._withCredentials = true; + return this; + }; - return s0; - } + /** + * Initiate request, invoking callback `fn(res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ - function peg$parsemessageFormatPattern() { - var s0, s1, s2; + Request.prototype.end = function(fn){ + var self = this; + var xhr = this.xhr = request.getXHR(); + var query = this._query.join('&'); + var timeout = this._timeout; + var data = this._formData || this._data; - s0 = peg$currPos; - s1 = []; - s2 = peg$parsemessageFormatElement(); - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parsemessageFormatElement(); - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c1(s1); - } - s0 = s1; + // store callback + this._callback = fn || noop; - return s0; - } + // state change + xhr.onreadystatechange = function(){ + if (4 != xhr.readyState) return; - function peg$parsemessageFormatElement() { - var s0; + // In IE9, reads to any property (e.g. status) off of an aborted XHR will + // result in the error "Could not complete the operation due to error c00c023f" + var status; + try { status = xhr.status } catch(e) { status = 0; } - s0 = peg$parsemessageTextElement(); - if (s0 === peg$FAILED) { - s0 = peg$parseargumentElement(); - } + if (0 == status) { + if (self.timedout) return self.timeoutError(); + if (self.aborted) return; + return self.crossDomainError(); + } + self.emit('end'); + }; - return s0; + // progress + var handleProgress = function(e){ + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; } + self.emit('progress', e); + }; + if (this.hasListeners('progress')) { + xhr.onprogress = handleProgress; + } + try { + if (xhr.upload && this.hasListeners('progress')) { + xhr.upload.onprogress = handleProgress; + } + } catch(e) { + // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. + // Reported here: + // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context + } - function peg$parsemessageText() { - var s0, s1, s2, s3, s4, s5; + // timeout + if (timeout && !this._timer) { + this._timer = setTimeout(function(){ + self.timedout = true; + self.abort(); + }, timeout); + } - s0 = peg$currPos; - s1 = []; - s2 = peg$currPos; - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parsechars(); - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s3 = [s3, s4, s5]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$c2; - } - } else { - peg$currPos = s2; - s2 = peg$c2; - } - } else { - peg$currPos = s2; - s2 = peg$c2; - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$currPos; - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parsechars(); - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s3 = [s3, s4, s5]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$c2; - } - } else { - peg$currPos = s2; - s2 = peg$c2; - } - } else { - peg$currPos = s2; - s2 = peg$c2; - } - } - } else { - s1 = peg$c2; - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c3(s1); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parsews(); - if (s1 !== peg$FAILED) { - s1 = input.substring(s0, peg$currPos); - } - s0 = s1; - } + // querystring + if (query) { + query = request.serializeObject(query); + this.url += ~this.url.indexOf('?') + ? '&' + query + : '?' + query; + } + + // initiate request + xhr.open(this.method, this.url, true); - return s0; - } + // CORS + if (this._withCredentials) xhr.withCredentials = true; - function peg$parsemessageTextElement() { - var s0, s1; + // body + if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) { + // serialize stuff + var serialize = request.serialize[this.getHeader('Content-Type')]; + if (serialize) data = serialize(data); + } - s0 = peg$currPos; - s1 = peg$parsemessageText(); - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c4(s1); - } - s0 = s1; + // set header fields + for (var field in this.header) { + if (null == this.header[field]) continue; + xhr.setRequestHeader(field, this.header[field]); + } - return s0; - } + // send stuff + this.emit('request', this); + xhr.send(data); + return this; + }; - function peg$parseargument() { - var s0, s1, s2; + /** + * Expose `Request`. + */ - s0 = peg$parsenumber(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = []; - if (peg$c5.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - if (peg$c5.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - } - } else { - s1 = peg$c2; - } - if (s1 !== peg$FAILED) { - s1 = input.substring(s0, peg$currPos); - } - s0 = s1; - } + request.Request = Request; - return s0; - } + /** + * Issue a request: + * + * Examples: + * + * request('GET', '/users').end(callback) + * request('/users').end(callback) + * request('/users', callback) + * + * @param {String} method + * @param {String|Function} url or callback + * @return {Request} + * @api public + */ - function peg$parseargumentElement() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8; + function request(method, url) { + // callback + if ('function' == typeof url) { + return new Request('GET', method).end(url); + } - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 123) { - s1 = peg$c7; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parseargument(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 44) { - s6 = peg$c10; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parseelementFormat(); - if (s8 !== peg$FAILED) { - s6 = [s6, s7, s8]; - s5 = s6; - } else { - peg$currPos = s5; - s5 = peg$c2; - } - } else { - peg$currPos = s5; - s5 = peg$c2; - } - } else { - peg$currPos = s5; - s5 = peg$c2; - } - if (s5 === peg$FAILED) { - s5 = peg$c9; - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 125) { - s7 = peg$c12; - peg$currPos++; - } else { - s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } - } - if (s7 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c14(s3, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + // url first + if (1 == arguments.length) { + return new Request('GET', method); + } + + return new Request(method, url); + } + + /** + * GET `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} data or fn + * @param {Function} fn + * @return {Request} + * @api public + */ + + request.get = function(url, data, fn){ + var req = request('GET', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.query(data); + if (fn) req.end(fn); + return req; + }; + + /** + * HEAD `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} data or fn + * @param {Function} fn + * @return {Request} + * @api public + */ + + request.head = function(url, data, fn){ + var req = request('HEAD', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + /** + * DELETE `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Function} fn + * @return {Request} + * @api public + */ + + request.del = function(url, fn){ + var req = request('DELETE', url); + if (fn) req.end(fn); + return req; + }; + + /** + * PATCH `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} data + * @param {Function} fn + * @return {Request} + * @api public + */ + + request.patch = function(url, data, fn){ + var req = request('PATCH', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + /** + * POST `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} data + * @param {Function} fn + * @return {Request} + * @api public + */ - return s0; - } + request.post = function(url, data, fn){ + var req = request('POST', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; - function peg$parseelementFormat() { - var s0; + /** + * PUT `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} data or fn + * @param {Function} fn + * @return {Request} + * @api public + */ - s0 = peg$parsesimpleFormat(); - if (s0 === peg$FAILED) { - s0 = peg$parsepluralFormat(); - if (s0 === peg$FAILED) { - s0 = peg$parseselectOrdinalFormat(); - if (s0 === peg$FAILED) { - s0 = peg$parseselectFormat(); - } - } - } + request.put = function(url, data, fn){ + var req = request('PUT', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; - return s0; - } + /** + * Expose `request`. + */ - function peg$parsesimpleFormat() { - var s0, s1, s2, s3, s4, s5, s6; + module.exports = request; - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c15) { - s1 = peg$c15; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c17) { - s1 = peg$c17; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c18); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c19) { - s1 = peg$c19; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c20); } - } - } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 44) { - s4 = peg$c10; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s6 = peg$parsechars(); - if (s6 !== peg$FAILED) { - s4 = [s4, s5, s6]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$c2; - } - } else { - peg$currPos = s3; - s3 = peg$c2; - } - } else { - peg$currPos = s3; - s3 = peg$c2; - } - if (s3 === peg$FAILED) { - s3 = peg$c9; - } - if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c21(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - return s0; - } +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { - function peg$parsepluralFormat() { - var s0, s1, s2, s3, s4, s5; + + /** + * Expose `Emitter`. + */ - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c22) { - s1 = peg$c22; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c23); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s3 = peg$c10; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parsepluralStyle(); - if (s5 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c24(s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + module.exports = Emitter; - return s0; - } + /** + * Initialize a new `Emitter`. + * + * @api public + */ - function peg$parseselectOrdinalFormat() { - var s0, s1, s2, s3, s4, s5; + function Emitter(obj) { + if (obj) return mixin(obj); + }; - s0 = peg$currPos; - if (input.substr(peg$currPos, 13) === peg$c25) { - s1 = peg$c25; - peg$currPos += 13; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c26); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s3 = peg$c10; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parsepluralStyle(); - if (s5 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c27(s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + /** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ - return s0; - } + function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; + } - function peg$parseselectFormat() { - var s0, s1, s2, s3, s4, s5, s6; + /** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c28) { - s1 = peg$c28; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c29); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s3 = peg$c10; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$parseoptionalFormatPattern(); - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$parseoptionalFormatPattern(); - } - } else { - s5 = peg$c2; - } - if (s5 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c30(s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + Emitter.prototype.on = + Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks[event] = this._callbacks[event] || []) + .push(fn); + return this; + }; - return s0; - } + /** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ - function peg$parseselector() { - var s0, s1, s2, s3; + Emitter.prototype.once = function(event, fn){ + var self = this; + this._callbacks = this._callbacks || {}; - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 61) { - s2 = peg$c31; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c32); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$c2; - } - } else { - peg$currPos = s1; - s1 = peg$c2; - } - if (s1 !== peg$FAILED) { - s1 = input.substring(s0, peg$currPos); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$parsechars(); - } + function on() { + self.off(event, on); + fn.apply(this, arguments); + } - return s0; - } + on.fn = fn; + this.on(event, on); + return this; + }; - function peg$parseoptionalFormatPattern() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8; + /** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parseselector(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 123) { - s4 = peg$c7; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s6 = peg$parsemessageFormatPattern(); - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 125) { - s8 = peg$c12; - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } - } - if (s8 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c33(s2, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + Emitter.prototype.off = + Emitter.prototype.removeListener = + Emitter.prototype.removeAllListeners = + Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; - return s0; - } + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } - function peg$parseoffset() { - var s0, s1, s2, s3; + // specific event + var callbacks = this._callbacks[event]; + if (!callbacks) return this; - s0 = peg$currPos; - if (input.substr(peg$currPos, 7) === peg$c34) { - s1 = peg$c34; - peg$currPos += 7; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c35); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c36(s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks[event]; + return this; + } - return s0; + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; } + } + return this; + }; - function peg$parsepluralStyle() { - var s0, s1, s2, s3, s4; + /** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ - s0 = peg$currPos; - s1 = peg$parseoffset(); - if (s1 === peg$FAILED) { - s1 = peg$c9; - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$parseoptionalFormatPattern(); - if (s4 !== peg$FAILED) { - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseoptionalFormatPattern(); - } - } else { - s3 = peg$c2; - } - if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c37(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } + Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks[event]; - return s0; + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); } + } - function peg$parsews() { - var s0, s1; + return this; + }; - peg$silentFails++; - s0 = []; - if (peg$c39.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c40); } - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c39.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c40); } - } - } - } else { - s0 = peg$c2; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c38); } - } + /** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ - return s0; - } + Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks[event] || []; + }; - function peg$parse_() { - var s0, s1, s2; + /** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ - peg$silentFails++; - s0 = peg$currPos; - s1 = []; - s2 = peg$parsews(); - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parsews(); - } - if (s1 !== peg$FAILED) { - s1 = input.substring(s0, peg$currPos); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c41); } - } + Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; + }; - return s0; - } - function peg$parsedigit() { - var s0; +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { - if (peg$c42.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } + + /** + * Reduce `arr` with `fn`. + * + * @param {Array} arr + * @param {Function} fn + * @param {Mixed} initial + * + * TODO: combatible error handling? + */ - return s0; - } + module.exports = function(arr, fn, initial){ + var idx = 0; + var len = arr.length; + var curr = arguments.length == 3 + ? initial + : arr[idx++]; - function peg$parsehexDigit() { - var s0; + while (idx < len) { + curr = fn.call(null, curr, arr[idx], ++idx, arr); + } + + return curr; + }; - if (peg$c44.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c45); } - } +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { - return s0; - } + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. - function peg$parsenumber() { - var s0, s1, s2, s3, s4, s5; + var Reflux = __webpack_require__(94); + var Actions = __webpack_require__(93); + var Cookies = __webpack_require__(122); - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 48) { - s1 = peg$c46; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } - } - if (s1 === peg$FAILED) { - s1 = peg$currPos; - s2 = peg$currPos; - if (peg$c48.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } - } - if (s3 !== peg$FAILED) { - s4 = []; - s5 = peg$parsedigit(); - while (s5 !== peg$FAILED) { - s4.push(s5); - s5 = peg$parsedigit(); - } - if (s4 !== peg$FAILED) { - s3 = [s3, s4]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$c2; - } - } else { - peg$currPos = s2; - s2 = peg$c2; - } - if (s2 !== peg$FAILED) { - s2 = input.substring(s1, peg$currPos); - } - s1 = s2; - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c50(s1); - } - s0 = s1; + var TOKEN = "token"; + var USER = "user"; + var LOGIN_TIME = "loginTime"; + var EMAIL = "email"; + + var SessionStore = Reflux.createStore({ + + _data: { + id: null, + name: null, + created: null, + email: null, + loginError: null // {message: , resolution: } + }, + + init: function () { + this._data.id = Cookies.get(TOKEN); + this._data.name = Cookies.get(USER); + this._data.created = Cookies.get(LOGIN_TIME); + this._data.email = Cookies.get(EMAIL); - return s0; + this.listenTo(Actions.login.completed, this._onLoginCompleted); + this.listenTo(Actions.login.failed, this._onLoginFailed); + this.listenTo(Actions.logout, this._onLogout); + }, + + _onLoginCompleted: function (username, id) { + this._data.id = id; + this._data.name = username; + this._data.created = new Date(); + this._data.loginError = null; + if (username.indexOf('@') !== -1) { + this._data.email = username; } + Cookies.set(TOKEN, this._data.id); + Cookies.set(USER, this._data.name); + Cookies.set(LOGIN_TIME, this._data.created); + Cookies.set(EMAIL, this._data.email); + this.trigger(this._data); + }, - function peg$parsechar() { - var s0, s1, s2, s3, s4, s5, s6, s7; + _onLoginFailed: function (error, response) { + this._data.loginError = { + message: response.message, + resolution: response.resolution + }; + this.trigger(this._data); + }, - if (peg$c51.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c53) { - s1 = peg$c53; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c54); } - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c55(); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c56) { - s1 = peg$c56; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c58(); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c59) { - s1 = peg$c59; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c61(); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c62) { - s1 = peg$c62; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } - } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - s3 = peg$currPos; - s4 = peg$parsehexDigit(); - if (s4 !== peg$FAILED) { - s5 = peg$parsehexDigit(); - if (s5 !== peg$FAILED) { - s6 = peg$parsehexDigit(); - if (s6 !== peg$FAILED) { - s7 = peg$parsehexDigit(); - if (s7 !== peg$FAILED) { - s4 = [s4, s5, s6, s7]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$c2; - } - } else { - peg$currPos = s3; - s3 = peg$c2; - } - } else { - peg$currPos = s3; - s3 = peg$c2; - } - } else { - peg$currPos = s3; - s3 = peg$c2; - } - if (s3 !== peg$FAILED) { - s3 = input.substring(s2, peg$currPos); - } - s2 = s3; - if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c64(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } else { - peg$currPos = s0; - s0 = peg$c2; - } - } - } - } - } + _onLogout: function () { + this._data.id = null; + this._data.name = null; + this._data.created = null; + this._data.email = null; + Cookies.remove(TOKEN); + Cookies.remove(USER); + Cookies.remove(LOGIN_TIME); + Cookies.remove(EMAIL); + this.trigger(this._data); + }, - return s0; - } + getInitialState: function () { + return this._data; + } + }); - function peg$parsechars() { - var s0, s1, s2; + module.exports = SessionStore; - s0 = peg$currPos; - s1 = []; - s2 = peg$parsechar(); - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parsechar(); - } - } else { - s1 = peg$c2; - } - if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c65(s1); - } - s0 = s1; - return s0; - } +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { - peg$result = peg$startRuleFunction(); + // (C) Copyright 2015 Hewlett-Packard Development Company, L.P. - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail({ type: "end", description: "end of input" }); - } + // Slightly modified version of the Mozilla Developer Network version. + // renamed the module and the functions. - throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + /*\ + |*| + |*| :: cookies.js :: + |*| + |*| A complete cookies reader/writer framework with full unicode support. + |*| + |*| Revision #1 - September 4, 2014 + |*| + |*| https://developer.mozilla.org/en-US/docs/Web/API/document.cookie + |*| https://developer.mozilla.org/User:fusionchess + |*| + |*| This framework is released under the GNU Public License, version 3 or later. + |*| http://www.gnu.org/licenses/gpl-3.0-standalone.html + |*| + |*| Syntaxes: + |*| + |*| * Cookies.set(name, value[, end[, path[, domain[, secure]]]]) + |*| * Cookies.get(name) + |*| * Cookies.remove(name[, path[, domain]]) + |*| * Cookies.has(name) + |*| * Cookies.keys() + |*| + \*/ + + var Cookies = { + get: function (sKey) { + if (!sKey) { return null; } + return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; + }, + set: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) { + if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; } + var sExpires = ""; + if (vEnd) { + switch (vEnd.constructor) { + case Number: + sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd; + break; + case String: + sExpires = "; expires=" + vEnd; + break; + case Date: + sExpires = "; expires=" + vEnd.toUTCString(); + break; + } } + document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : ""); + return true; + }, + remove: function (sKey, sPath, sDomain) { + if (!this.has(sKey)) { return false; } + document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : ""); + return true; + }, + has: function (sKey) { + if (!sKey) { return false; } + return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); + }, + keys: function () { + var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/); + for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) { aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]); } + return aKeys; } + }; - return { - SyntaxError: SyntaxError, - parse: parse - }; - })(); + module.exports = Cookies; - //# sourceMappingURL=parser.js.map /***/ } /******/ ]); \ No newline at end of file diff --git a/grommet.min.js b/grommet.min.js index 66cf1fb..c258ac0 100644 --- a/grommet.min.js +++ b/grommet.min.js @@ -1,6 +1,4 @@ -var Grommet=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r={App:n(1),CheckBox:n(2),Document:n(3),Donut:n(4),Footer:n(5),Form:n(6),FormField:n(7),Header:n(8),Label:n(9),Login:n(10),LoginForm:n(11),Menu:n(12),Meter:n(13),Panel:n(14),RadioButton:n(15),Search:n(16),SearchInput:n(17),Section:n(18),Table:n(19),Tiles:n(20),Tile:n(21),Title:n(22),Object:n(23),TBD:n(24),Icons:{Clear:n(25),DragHandle:n(26),Edit:n(27),Filter:n(28),Help:n(29),Left:n(30),More:n(31),Right:n(32),Search:n(33),SearchPlus:n(34),Spinning:n(35),Status:n(36)},Mixins:{KeyboardAccelerators:n(37),ReactLayeredComponent:n(38)},Actions:n(39),SessionStore:n(40),Rest:n(41)};e.exports=r},function(e,t,n){var r=n(42),i=n(43),a=r.createClass({displayName:"App",mixins:[i],propTypes:{centered:r.PropTypes.bool},getDefaultProps:function(){return{centered:!0}},render:function(){var e=["app"];this.props.centered&&e.push("app--centered"),this.props.inline&&e.push("app--inline"),this.props.className&&e.push(this.props.className);var t=r.Children.map(this.props.children,function(e){return e?r.cloneElement(e,this.getChildContext()):null}.bind(this));return r.createElement("div",{className:e.join(" ")},t)}});e.exports=a},function(e,t,n){var r=n(42),i="check-box",a=r.createClass({displayName:"CheckBox",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func,toggle:r.PropTypes.bool},render:function(){var e=[i];return this.props.toggle&&e.push(i+"--toggle"),this.props.className&&e.push(this.props.className),r.createElement("label",{className:e.join(" ")},r.createElement("input",{className:i+"__input",id:this.props.id,name:this.props.name,type:"checkbox",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("span",{className:i+"__control"}),r.createElement("span",{className:i+"__label"},this.props.label))}});e.exports=a},function(e,t,n){var r=n(42),i="document",a=r.createClass({displayName:"GrommetDocument",propTypes:{colorIndex:r.PropTypes.string,flush:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0}},render:function(){var e=[i];return this.props.flush&&e.push(i+"--flush"),this.props.colorIndex&&e.push("header-color-index-"+this.props.colorIndex),r.createElement("div",{ref:"document",className:e.join(" ")},r.createElement("div",{className:i+"__content"},this.props.children))}});e.exports=a},function(e,t,n){function r(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function i(e,t,n,i,a){var s=r(e,t,n,a),o=r(e,t,n,i),l=180>=a-i?"0":"1",c=["M",s.x,s.y,"A",n,n,0,l,0,o.x,o.y].join(" ");return c}function a(e,t,n,i,a){var s=a-(a-i)/2,o=r(e,t,n-24,s),l=r(e,t,n,s-10),c=r(e,t,n,s+10),u=["M",o.x,o.y,"L",l.x,l.y,"A",n,n,0,0,0,c.x,c.y,"Z"].join(" ");return u}var s=n(42),o=n(44),l="donut",c=192,u=168,p=s.createClass({displayName:"Donut",propTypes:{legend:s.PropTypes.bool,partial:s.PropTypes.bool,max:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number,label:s.PropTypes.string}),s.PropTypes.number]),min:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number,label:s.PropTypes.string}),s.PropTypes.number]),series:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,units:s.PropTypes.string,colorIndex:s.PropTypes.string,important:s.PropTypes.bool,onClick:s.PropTypes.func})),small:s.PropTypes.bool,units:s.PropTypes.string,value:s.PropTypes.number},getDefaultProps:function(){return{max:{value:100},min:{value:0}}},_initialTimeout:function(){this.setState({initial:!1,activeIndex:this.state.importantIndex}),clearTimeout(this._timeout)},_onActive:function(e){this.setState({initial:!1,activeIndex:e})},_layout:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({orientation:"portrait"}):e>1.2&&this.setState({orientation:"landscape"});var t=this.refs.donut.getDOMNode().parentNode,n=t.offsetWidth,r=t.offsetHeight,i=c;this.props.partial&&(i=u),i>r||c>n||2*c>n&&2*i>r?this.setState({size:"small"}):this.setState({size:null})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},_generateSeries:function(e){var t=e.max.value-e.min.value,n=t-(e.value-e.min.value);return[{value:e.value},{value:n,colorIndex:"unset"}]},_importantIndex:function(e){var t=0;return e.some(function(e,n){return e.important?(t=n,!0):void 0}),t},getInitialState:function(){var e=this.props.series||this._generateSeries(this.props),t=this._importantIndex(e);return{initial:!0,importantIndex:t,activeIndex:t,legend:!1,orientation:"portrait",series:e}},componentDidMount:function(){console.log("Grommet Donut is deprecated. Please use Grommet Meter instead."),this._initialTimer=setTimeout(this._initialTimeout,10),this.setState({initial:!0,activeIndex:0}),window.addEventListener("resize",this._onResize),this._onResize()},componentWillReceiveProps:function(e){var t=e.series||this._generateSeries(e),n=this._importantIndex(t);this.setState({importantIndex:n,activeIndex:n,series:t})},componentWillUnmount:function(){clearTimeout(this._initialTimer),clearTimeout(this._resizeTimer),window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},render:function(){var e=[l,l+"--"+this.state.orientation];this.state.size&&e.push(l+"--"+this.state.size),this.props.partial&&e.push(l+"--partial"),this.props.small&&e.push(l+"--small");var t=c;this.props.partial&&(t=u);var n=0;this.state.series.some(function(e){n+=e.value});var r=0,p=360/n;this.props.partial&&(r=60,p=240/n);var h,m,d=null,f=null,g=null,y=null,v=this.state.series.map(function(e,t){var n=Math.min(360,Math.max(10,r+p*e.value));e.value>0&&r+360===n&&(n-=.1);var o=84,u=i(c/2,c/2,o,r+180,n+180),h=this._itemColorIndex(e,t),m=[l+"__slice"];if(m.push("color-index-"+h),this.state.activeIndex===t&&(m.push(l+"__slice--active"),d=e.value,f=e.units||this.props.units,g=e.label),t===this.state.activeIndex){var v=a(c/2,c/2,o,r+180,n+180);y=s.createElement("path",{stroke:"none",className:l+"__slice-indicator color-index-"+h,d:v})}return r=n,s.createElement("path",{key:e.label,fill:"none",className:m.join(" "),d:u,onMouseOver:this._onActive.bind(this,t),onMouseOut:this._onActive.bind(this,this.state.importantIndex),onClick:e.onClick})},this);this.props.partial&&(this.props.min&&(h=s.createElement("div",{className:l+"__min-label"},this.props.min.value," ",this.props.units)),this.props.max&&(m=s.createElement("div",{className:l+"__max-label"},this.props.max.value," ",this.props.units)));var b=null;return this.props.legend&&(b=s.createElement(o,{className:l+"__legend",series:this.props.series,units:this.props.units,value:this.props.value,activeIndex:this.state.activeIndex,onActive:this._onActive})),s.createElement("div",{ref:"donut",className:e.join(" ")},s.createElement("div",{className:l+"__graphic-container"},s.createElement("svg",{className:l+"__graphic",viewBox:"0 0 "+c+" "+t,preserveAspectRatio:"xMidYMid meet"},s.createElement("g",null,y,v)),s.createElement("div",{className:l+"__active"},s.createElement("div",{className:l+"__active-value large-number-font"},d,s.createElement("span",{className:l+"__active-units large-number-font"},f)),s.createElement("div",{className:l+"__active-label"},g)),h,m),b)}});e.exports=p},function(e,t,n){var r=n(42),i=n(45),a="footer",s=r.createClass({displayName:"Footer",propTypes:{centered:r.PropTypes.bool,colorIndex:r.PropTypes.string,flush:r.PropTypes.bool,primary:r.PropTypes.bool,scrollTop:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0}},_updateState:function(){this.setState({scrolled:this._scrollable.scrollTop>0})},_onClickTop:function(){this._scrollable.scrollTop=0},_onScroll:function(){clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(this._updateState,10)},getInitialState:function(){return{scrolled:!1}},componentDidMount:function(){this._scrollable=this.refs.footer.getDOMNode().parentNode.parentNode,this._scrollable.addEventListener("scroll",this._onScroll)},componentWillUnmount:function(){this._scrollable.removeEventListener("scroll",this._onScroll)},componentWillReceiveProps:function(){this.setState({scrolled:!1})},componentDidUpdate:function(){this.state.scrolled||(this._scrollable.scrollTop=0)},render:function(){var e=[a];this.props.primary&&e.push(a+"--primary"),this.props.centered&&e.push(a+"--centered"),this.props.flush&&e.push(a+"--flush"),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var t=null;return this.props.scrollTop&&this.state.scrolled&&(t=r.createElement("div",{className:a+"__top control-icon",onClick:this._onClickTop},r.createElement(i,null))),r.createElement("div",{ref:"footer",className:e.join(" ")},r.createElement("div",{className:a+"__content"},this.props.children,t))}});e.exports=s},function(e,t,n){var r=n(42),i="form",a=r.createClass({displayName:"Form",propTypes:{compact:r.PropTypes.bool,fill:r.PropTypes.bool,flush:r.PropTypes.bool,onSubmit:r.PropTypes.func,className:r.PropTypes.string},getDefaultProps:function(){return{compact:!1,fill:!1,flush:!0}},render:function(){var e=[i];return this.props.compact&&e.push(i+"--compact"),this.props.fill&&e.push(i+"--fill"),this.props.flush&&e.push(i+"--flush"),this.props.className&&e.push(this.props.className),r.createElement("form",{className:e.join(" "),onSubmit:this.props.onSubmit},this.props.children)}});e.exports=a},function(e,t,n){var r=n(42),i="form-field",a=r.createClass({displayName:"FormField",propTypes:{error:r.PropTypes.string,help:r.PropTypes.node,htmlFor:r.PropTypes.string,label:r.PropTypes.string,required:r.PropTypes.bool},_onFocus:function(){this.setState({focus:!0})},_onBlur:function(){this.setState({focus:!1})},_onClick:function(){this._inputElement&&this._inputElement.focus()},getInitialState:function(){return{focus:!1}},componentDidMount:function(){var e=this.refs.contents.getDOMNode(),t=e.querySelectorAll("input, textarea, select");1===t.length&&(this._inputElement=t[0],this._inputElement.addEventListener("focus",this._onFocus),this._inputElement.addEventListener("blur",this._onBlur))},componentWillUnmount:function(){this._inputElement&&(this._inputElement.removeEventListener("focus",this._onFocus),this._inputElement.removeEventListener("blur",this._onBlur),delete this._inputElement)},render:function(){var e=[i];this.state.focus&&e.push(i+"--focus"),this.props.required&&e.push(i+"--required"),this.props.htmlFor&&e.push(i+"--text");var t=null;this.props.error&&(e.push(i+"--error"),t=r.createElement("span",{className:i+"__error"},this.props.error));var n=null;return this.props.help&&(n=r.createElement("span",{className:i+"__help"},this.props.help)),r.createElement("div",{className:e.join(" "),onClick:this._onClick},t,r.createElement("label",{className:i+"__label",htmlFor:this.props.htmlFor},this.props.label),r.createElement("span",{ref:"contents",className:i+"__contents"},this.props.children),n)}});e.exports=a},function(e,t,n){var r=n(42),i="header",a=r.createClass({displayName:"Header",propTypes:{colorIndex:r.PropTypes.string,fixed:r.PropTypes.bool,flush:r.PropTypes.bool,large:r.PropTypes.bool,primary:r.PropTypes.bool,small:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0,large:!1,primary:!1,small:!1}},_onResize:function(){this._alignMirror()},_alignMirror:function(){var e=this.refs.content.getDOMNode(),t=this.refs.mirror.getDOMNode(),n=t.getBoundingClientRect();e.style.width=""+Math.floor(n.width)+"px";var r=e.getBoundingClientRect();t.style.height=""+Math.floor(r.height)+"px"},componentDidMount:function(){this.props.fixed&&(this._alignMirror(),window.addEventListener("resize",this._onResize))},componentDidUpdate:function(){this.props.fixed&&this._alignMirror()},componentWillUnmount:function(){this.props.fixed&&window.removeEventListener("resize",this._onResize)},render:function(){var e=[i];this.props.primary&&e.push(i+"--primary"),this.props.fixed&&e.push(i+"--fixed"),this.props.flush&&e.push(i+"--flush"),this.props.large&&e.push(i+"--large"),this.props.small&&e.push(i+"--small"),this.props.className&&e.push(this.props.className);var t=null;this.props.fixed&&(t=r.createElement("div",{ref:"mirror",className:i+"__mirror"}));var n=r.createElement("div",{ref:"content",className:i+"__content"},this.props.children);if(this.props.colorIndex||this.props.fixed){var a=[i+"__wrapper"];this.props.colorIndex&&a.push("background-color-index-"+this.props.colorIndex),n=r.createElement("div",{className:a.join(" ")},n)}return r.createElement("div",{className:e.join(" ")},t,n)}});e.exports=a},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Label",propTypes:{icon:r.PropTypes.node,text:r.PropTypes.string},render:function(){var e=null,t=null;return this.props.icon&&(e=r.createElement("span",{className:"label__icon control-icon"},this.props.icon)),this.props.text&&(t=r.createElement("span",{className:"label__text"},this.props.text)),r.createElement("div",{className:"label"},e,t)}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Login",propTypes:{background:r.PropTypes.string},_onResize:function(){this.adjustBackground()},adjustBackground:function(){var e=window.innerWidth/window.innerHeight,t=this.refs.background.getDOMNode(),n=t.scrollWidth/t.scrollHeight;this.setState({orientation:n>e?"portrait":"landscape"})},getInitialState:function(){return{orientation:null}},componentDidMount:function(){window.addEventListener("resize",this._onResize),setTimeout(this.adjustBackground,300)},componentWillUnmount:function(){window.removeEventListener("resize",this._onResize)},render:function(){var e=null;if(this.props.background){var t=["login__background"];this.state.orientation&&t.push("login__background--"+this.state.orientation),e=r.createElement("img",{ref:"background",className:t.join(" "),src:this.props.background})}return r.createElement("div",{className:"login"},e,r.createElement("div",{className:"login__container"},this.props.children))}});e.exports=i},function(e,t,n){var r=n(42),i=n(6),a=n(7),s=n(2),o=n(43),l="login-form",c=r.createClass({displayName:"LoginForm",mixins:[o],propTypes:{logo:r.PropTypes.node,title:r.PropTypes.string,rememberMe:r.PropTypes.bool,forgotPassword:r.PropTypes.node,errors:r.PropTypes.arrayOf(r.PropTypes.string),onSubmit:r.PropTypes.func},_onSubmit:function(e){e.preventDefault();var t=this.refs.username.getDOMNode().value.trim(),n=this.refs.password.getDOMNode().value.trim();this.props.onSubmit&&this.props.onSubmit({username:t,password:n})},getDefaultProps:function(){return{errors:[]}},componentDidMount:function(){this.refs.username.getDOMNode().focus()},render:function(){var e=[l],t=this.props.errors.map(function(e,t){return r.createElement("div",{key:t,className:l+"__error"},this.getGrommetIntlMessage(e))}.bind(this)),n=null;this.props.logo&&(n=r.createElement("div",{className:l+"__logo"},this.props.logo));var o=null;this.props.title&&(o=r.createElement("h1",{className:l+"__title"},this.props.title));var c=null;if(this.props.rememberMe||this.props.forgotPassword){var u=null;this.props.rememberMe&&(u=r.createElement(s,{className:l+"__remember-me",id:"remember-me",label:this.getGrommetIntlMessage("Remember me")})),c=r.createElement("div",{className:l+"__footer"},u,this.props.forgotPassword)}return r.createElement(i,{className:e.join(" "),onSubmit:this._onSubmit},n,o,r.createElement("fieldset",null,r.createElement(a,{htmlFor:"username",label:this.getGrommetIntlMessage("Username")},r.createElement("input",{id:"username",ref:"username",type:"email"})),r.createElement(a,{htmlFor:"password",label:this.getGrommetIntlMessage("Password")},r.createElement("input",{id:"password",ref:"password",type:"password"}))),t,r.createElement("input",{type:"submit",className:l+"__submit primary call-to-action",value:this.getGrommetIntlMessage("Log In")}),c)}});e.exports=c},function(e,t,n){var r=n(42),i=n(38),a=n(37),s=n(46),o=n(31),l=n(47),c="menu",u=r.createClass({displayName:"MenuLayer",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),direction:r.PropTypes.oneOf(["up","down","left","right","center"]),onClick:r.PropTypes.func.isRequired,router:r.PropTypes.func},childContextTypes:{router:r.PropTypes.func},getChildContext:function(){return{router:this.props.router}},render:function(){var e=[c+"__layer"];return this.props.direction&&e.push(c+"__layer--"+this.props.direction),this.props.align&&e.push(c+"__layer--align-"+this.props.align),r.createElement("div",{id:"menu-layer",className:e.join(" "),onClick:this.props.onClick},this.props.children)}}),p=r.createClass({displayName:"Menu",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),collapse:r.PropTypes.bool,direction:r.PropTypes.oneOf(["up","down","left","right","center"]),icon:r.PropTypes.node,label:r.PropTypes.string,primary:r.PropTypes.bool,small:r.PropTypes.bool},contextTypes:{router:r.PropTypes.func},getDefaultProps:function(){return{align:"left",direction:"down",small:!1}},mixins:[i,a,s],_onOpen:function(e){e.preventDefault(),this.setState({active:!0})},_onClose:function(){this.setState({active:!1})},_onFocusControl:function(){this.setState({controlFocused:!0})},_onBlurControl:function(){this.setState({controlFocused:!1})},getInitialState:function(){return{controlFocused:!1,active:!1,inline:!this.props.label&&!this.props.icon&&!this.props.collapse}},componentDidUpdate:function(e,t){var n={esc:this._onClose,space:this._onClose,tab:this._onClose},r={space:this._onOpen,down:this._onOpen};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.active&&t.active&&(document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&(!t.controlFocused||!this.state.active&&t.active)&&this.startListeningToKeyboard(r),this.state.active&&!t.active){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(n);var i=this.refs.control.getDOMNode(),a=document.getElementById("menu-layer"),s=a.querySelectorAll("."+c+"__control")[0],o=a.querySelectorAll("svg, img")[0],l=window.getComputedStyle(i).fontSize;s.style.fontSize=l;var u=i.clientHeight;o&&u<=o.clientHeight+1&&("down"===this.props.direction?s.style.marginTop="-1px":"up"===this.props.direction&&(s.style.marginBottom="1px")),s.style.height=u+"px",s.style.lineHeight=u+"px",this.startOverlay(i,a,this.props.align)}},componentWillUnmount:function(){document.removeEventListener("click",this._onClose)},_renderControl:function(){var e=null,t=null,n=c+"__control",i=[n];return this.props.icon?(i.push(n+"--labelled"),t=this.props.icon):(i.push(n+"--fixed-label"),t=r.createElement(o,null)),e=this.props.label?r.createElement("div",{className:i.join(" ")},r.createElement("div",{className:n+"-icon"},t),r.createElement("span",{className:n+"-label"},this.props.label),r.createElement(l,{className:n+"-drop-icon"})):r.createElement("div",{className:n},t)},_classes:function(e){var t=[e];return this.props.direction&&t.push(e+"--"+this.props.direction),this.props.align&&t.push(e+"--align-"+this.props.align),this.props.small&&t.push(e+"--small"),this.props.primary&&t.push(e+"--primary"),t},render:function(){var e=this._classes(c);if(this.state.inline?e.push(c+"--inline"):(e.push(c+"--controlled"),this.props.label&&e.push(c+"--labelled")),this.props.className&&e.push(this.props.className),this.state.inline)return r.createElement("div",{className:e.join(" "),onClick:this._onClose},this.props.children);var t=this._renderControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onOpen,onFocus:this._onFocusControl,onBlur:this._onBlurControl},t)},renderLayer:function(){if(this.state.active){var e=this._renderControl(),t=null,n=null;return"up"===this.props.direction?(t=this.props.children,n=e):(t=e,n=this.props.children),r.createElement(u,{router:this.context.router,align:this.props.align,direction:this.props.direction,onClick:this._onClose},t,n)}return r.createElement("span",null)}});e.exports=p},function(e,t,n){function r(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function i(e,t,n,i,a){var s=r(e,t,n,a),o=r(e,t,n,i),l=180>=a-i?"0":"1",c=["M",s.x,s.y,"A",n,n,0,l,0,o.x,o.y].join(" ");return c}function a(e,t,n,i,a){var s=a-(a-i)/2,o=r(e,t,n-24,s),l=r(e,t,n,s-10),c=r(e,t,n,s+10),u=["M",o.x,o.y,"L",l.x,l.y,"A",n,n,0,0,0,c.x,c.y,"Z"].join(" ");return u}var s=n(42),o=n(44),l="meter",c=192,u=24,p=u/2,h=192,m=84,d=144,f=s.createClass({displayName:"Meter",propTypes:{important:s.PropTypes.number,large:s.PropTypes.bool,legend:s.PropTypes.bool,legendTotal:s.PropTypes.bool,max:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number.isRequired,label:s.PropTypes.string}),s.PropTypes.number]),min:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number.isRequired,label:s.PropTypes.string}),s.PropTypes.number]),series:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,colorIndex:s.PropTypes.string,important:s.PropTypes.bool,onClick:s.PropTypes.func})),small:s.PropTypes.bool,threshold:s.PropTypes.number,type:s.PropTypes.oneOf(["bar","arc","circle"]),units:s.PropTypes.string,value:s.PropTypes.number,vertical:s.PropTypes.bool},getDefaultProps:function(){return{type:"bar"}},_initialTimeout:function(){this.setState({initial:!1,activeIndex:this.state.importantIndex}),clearTimeout(this._timeout)},_onActivate:function(e){this.setState({initial:!1,activeIndex:e})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},_layout:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({legendPosition:"bottom"}):e>1.2&&this.setState({legendPosition:"right"})},_generateSeries:function(e,t,n){var r=n.value-e.value;return[{value:e.value,important:!0},{value:r,colorIndex:"unset"}]},_importantIndex:function(e){var t=e.length-1;return this.props.hasOwnProperty("important")&&(t=this.props.important),e.some(function(e,n){return e.important?(t=n,!0):void 0}),t},_terminal:function(e){return"number"==typeof e&&(e={value:e}),e},_seriesTotal:function(e){var t=0;return e.some(function(e){t+=e.value}),t},_stateFromProps:function(e){var t;t=e.series&&e.series.length>1?this._seriesTotal(e.series):100;var n=this._terminal(e.min||0),r=this._terminal(e.max||t),i=e.series||this._generateSeries(e,n,r),a=this._importantIndex(i);t=this._seriesTotal(i);var s={importantIndex:a,activeIndex:a,legendPosition:"bottom",series:i,min:n,max:r,total:t};return"arc"===this.props.type?(s.startAngle=60,s.anglePer=240/t,this.props.vertical?s.angleOffset=90:s.angleOffset=180):"circle"===this.props.type?(s.startAngle=1,s.anglePer=358/t,s.angleOffset=180):"bar"===this.props.type&&(s.scale=c/(r.value-n.value)),s},getInitialState:function(){var e=this._stateFromProps(this.props);return e.initial=!0,e},componentDidMount:function(){this._initialTimer=setTimeout(this._initialTimeout,10),window.addEventListener("resize",this._onResize),this._onResize()},componentWillReceiveProps:function(e){var t=this._stateFromProps(e);this.setState(t)},componentWillUnmount:function(){clearTimeout(this._initialTimer),clearTimeout(this._resizeTimer),window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},_translateBarWidth:function(e){return Math.round(this.state.scale*e)},_renderBar:function(){var e=0,t=this.state.min.value,n=this.state.series.map(function(n,r){var i=this._itemColorIndex(n,r),a=[l+"__bar"];r===this.state.activeIndex&&a.push(l+"__bar--active"),a.push("color-index-"+i);var o=n.value-t;t=Math.max(0,t-n.value);var u,h=this._translateBarWidth(o);return u=this.props.vertical?"M"+p+","+(c-e)+" L"+p+","+(c-(e+h)):"M"+e+","+p+" L"+(e+h)+","+p,e+=h,s.createElement("path",{key:r,className:a.join(" "),d:u,onMouseOver:this._onActivate.bind(this,r),onMouseOut:this._onActivate.bind(this,this.state.importantIndex),onClick:n.onClick})},this);return n},_renderArcOrCircle:function(){var e=this.state.startAngle,t=null,n=this.state.series.map(function(n,r){var o=[l+"__slice"];r===this.state.activeIndex&&o.push(l+"__slice--active");var c=this._itemColorIndex(n,r);o.push("color-index-"+c);var u=Math.min(360,Math.max(0,e+this.state.anglePer*n.value)),p=i(h/2,h/2,m,e+this.state.angleOffset,u+this.state.angleOffset);if(r===this.state.activeIndex){var d=a(h/2,h/2,m,e+this.state.angleOffset,u+this.state.angleOffset);t=s.createElement("path",{stroke:"none",className:l+"__slice-indicator color-index-"+c,d:d})}return e=u,s.createElement("path",{key:n.label,fill:"none",className:o.join(" "),d:p,onMouseOver:this._onActivate.bind(this,r),onMouseOut:this._onActivate.bind(this,this.state.importantIndex),onClick:n.onClick})},this);return s.createElement("g",null,t,n)},_renderCurrent:function(){var e,t=this.state.series[this.state.activeIndex];return"arc"===this.props.type||"circle"===this.props.type?e=s.createElement("div",{className:l+"__active"},s.createElement("div",{className:l+"__active-value large-number-font"},t.value,s.createElement("span",{className:l+"__active-units large-number-font"},this.props.units)),s.createElement("div",{className:l+"__active-label"},t.label)):"bar"===this.props.type&&(e=s.createElement("span",{className:l+"__active"},s.createElement("span",{className:l+"__active-value large-number-font"},t.value),s.createElement("span",{className:l+"__active-units large-number-font"},this.props.units))),e},_renderBarThreshold:function(){var e,t=this._translateBarWidth(this.props.threshold-this.state.min.value);return e=this.props.vertical?"M0,"+(c-t)+" L"+u+","+(c-t):"M"+t+",0 L"+t+","+u,s.createElement("path",{className:l+"__threshold",d:e})},_renderCircleOrArcThreshold:function(){var e=this.state.startAngle+this.state.anglePer*this.props.threshold,t=Math.min(360,Math.max(0,e+1)),n=i(h/2,h/2,m,e+180,t+180);return s.createElement("path",{className:l+"__threshold",d:n})},_renderLegend:function(){return s.createElement(o,{className:l+"__legend",series:this.state.series,units:this.props.units,activeIndex:this.state.activeIndex,onActive:this._onActive})},render:function(){var e=[l];e.push(l+"--"+this.props.type),e.push(l+"--legend-"+this.state.legendPosition),this.props.vertical&&e.push(l+"--vertical"),this.props.small&&e.push(l+"--small"),this.props.large&&e.push(l+"--large"),this.props.className&&e.push(this.props.className);var t,n;"arc"===this.props.type?this.props.vertical?(n=d,t=h):(n=h,t=d):"circle"===this.props.type?(n=h,t=h):"bar"===this.props.type&&(this.props.vertical?(n=u,t=c):(n=c,t=u));var r=null;"arc"===this.props.type||"circle"===this.props.type?r=this._renderArcOrCircle():"bar"===this.props.type&&(r=this._renderBar());var i=null;this.props.threshold&&("arc"===this.props.type||"circle"===this.props.type?i=this._renderCircleOrArcThreshold():"bar"===this.props.type&&(i=this._renderBarThreshold()));var a=null;this.state.min.label&&(a=s.createElement("div",{className:l+"__label-min"},this.state.min.label));var o=null;this.state.max.label&&(o=s.createElement("div",{className:l+"__label-max"},this.state.max.label));var p=null;this.state.activeIndex>=0&&(p=this._renderCurrent());var m=null;return this.props.legend&&(m=this._renderLegend()),s.createElement("div",{className:e.join(" ")},s.createElement("svg",{className:l+"__graphic",viewBox:"0 0 "+n+" "+t,preserveAspectRatio:"xMidYMid meet"},s.createElement("g",null,r,i)),p,s.createElement("div",{className:l+"__labels"},a,o),m)}});e.exports=f},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Panel",propTypes:{direction:r.PropTypes.string,index:r.PropTypes.oneOf([1,2])},render:function(){var e=["panel"];"horizontal"===this.props.direction&&e.push("panel--horizontal"),this.props.index&&e.push("panel--index-"+this.props.index);var t=null;return this.props.title&&(t=r.createElement("h2",{className:"panel__title"},this.props.title)),r.createElement("div",{className:e.join(" ")},t,this.props.children)}});e.exports=i},function(e,t,n){var r=n(42),i="radio-button",a=r.createClass({displayName:"RadioButton",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func},render:function(){var e=[i];return this.props.className&&e.push(this.props.className),r.createElement("label",{className:e.join(" ")},r.createElement("input",{className:i+"__input",id:this.props.id,name:this.props.name,type:"radio",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("span",{className:i+"__control"}),r.createElement("span",{className:i+"__label"},this.props.label))}});e.exports=a},function(e,t,n){var r=n(42),i=n(38),a=n(37),s=n(46),o=n(33),l=n(43),c="search",u=r.createClass({displayName:"Search",propTypes:{align:r.PropTypes.oneOf(["left","right"]),defaultValue:r.PropTypes.string,inline:r.PropTypes.bool,onChange:r.PropTypes.func,placeHolder:r.PropTypes.string,suggestions:r.PropTypes.arrayOf(r.PropTypes.string)},getDefaultProps:function(){return{align:"left",inline:!1,placeHolder:"Search"}},mixins:[i,a,s,l],_onAddLayer:function(e){e.preventDefault(),this.setState({layer:!0,activeSuggestionIndex:-1})},_onRemoveLayer:function(){this.setState({layer:!1})},_onFocusControl:function(){this.setState({controlFocused:!0,layer:!0,activeSuggestionIndex:-1})},_onBlurControl:function(){this.setState({controlFocused:!1})},_onFocusInput:function(){this.refs.input.getDOMNode().select(),this.setState({layer:!this.state.inline||this.props.suggestions,activeSuggestionIndex:-1})},_onBlurInput:function(){},_onChangeInput:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onChange&&this.props.onChange(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.props.onChange&&this.props.onChange(e)}this._onRemoveLayer()},_onClickSuggestion:function(e){this.props.onChange&&this.props.onChange(e),this._onRemoveLayer()},_onSink:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},_layout:function(){window.innerWidth<600?this.setState({inline:!1}):this.setState({inline:this.props.inline})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},getInitialState:function(){return{align:"left",controlFocused:!1,inline:this.props.inline,layer:!1,activeSuggestionIndex:-1}},componentDidMount:function(){window.addEventListener("resize",this._onResize),this._layout()},componentDidUpdate:function(e,t){var n={esc:this._onRemoveLayer,tab:this._onRemoveLayer,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter},r={space:this._onAddLayer};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.layer&&t.layer&&(document.removeEventListener("click",this._onRemoveLayer),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&!t.controlFocused&&this.startListeningToKeyboard(r),this.state.layer&&!t.layer){document.addEventListener("click",this._onRemoveLayer),this.startListeningToKeyboard(n);var i=(this.refs.control?this.refs.control:this.refs.input).getDOMNode(),a=document.getElementById("search-layer"),s=a.querySelectorAll(".search__control")[0],o=a.querySelectorAll("svg")[0],l=a.querySelectorAll(".search__input")[0],c=window.getComputedStyle(i).fontSize; -l.style.fontSize=c;var u=i.clientHeight;o&&u<=o.clientHeight&&(s.style.marginTop="-2px"),l.style.height=u+"px",s&&(s.style.height=u+"px",s.style.lineHeight=u+"px"),this.startOverlay(i,a,this.props.align),l.focus()}},componentWillUnmount:function(){document.removeEventListener("click",this._onRemoveLayer),window.removeEventListener("resize",this._onResize)},focus:function(){var e=this.refs.input||this.refs.control;e&&e.getDOMNode().focus()},_createControl:function(){var e=c+"__control";return r.createElement("div",{className:e},r.createElement(o,null))},_classes:function(e){var t=[e];return this.state.inline?t.push(e+"--inline"):t.push(e+"--controlled"),this.props.align&&t.push(e+"--align-"+this.props.align),t},render:function(){var e=this._classes(c);if(this.props.className&&e.push(this.props.className),this.state.inline){var t=this.props.suggestions?!0:!1;return r.createElement("div",{className:e.join(" ")},r.createElement("input",{ref:"input",type:"search",placeholder:this.getGrommetIntlMessage(this.props.placeHolder),value:this.props.defaultValue,className:c+"__input",readOnly:t,onFocus:this._onFocusInput,onBlur:this._onBlurInput,onChange:this._onChangeInput}))}var n=this._createControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onAddLayer,onFocus:this._onFocusControl,onBlur:this._onBlurControl},n)},renderLayer:function(){if(this.state.layer){var e=this._classes(c+"__layer"),t=null;this.props.suggestions&&(t=this.props.suggestions.map(function(e,t){var n=[c+"__suggestion"];return t===this.state.activeSuggestionIndex&&n.push(c+"__suggestion--active"),r.createElement("div",{key:e,className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},e)},this));var n=r.createElement("div",{className:c+"__layer-contents",onClick:this._onSink},r.createElement("input",{type:"search",defaultValue:this.props.defaultValue,className:c+"__input",onChange:this._onChangeInput}),r.createElement("div",{className:c+"__suggestions"},t));if(!this.state.inline){var i=this._createControl(),a="right"===this.props.align,s=a?n:i,o=a?i:n;n=r.createElement("div",{className:c+"__layer-header"},s,o)}return r.createElement("div",{id:"search-layer",className:e.join(" ")},n)}return r.createElement("span",null)}});e.exports=u},function(e,t,n){var r=n(42),i=n(38),a=n(37),s=n(46),o=n(33),l="search-input",c=r.createClass({displayName:"SearchInput",propTypes:{defaultValue:r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string]),id:r.PropTypes.string,name:r.PropTypes.string,onChange:r.PropTypes.func,onSearch:r.PropTypes.func,suggestions:r.PropTypes.arrayOf(r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string])),value:r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string])},mixins:[i,a,s],_onInputChange:function(e){this.props.onChange(e.target.value)},_onOpen:function(e){e.preventDefault(),this.setState({active:!0,activeSuggestionIndex:-1})},_onClose:function(){this.setState({active:!1})},_onSearchChange:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onSearch(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.setState({active:!1}),this._activation(!1),this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.setState({value:e}),this.props.onChange(e)}},_onClickSuggestion:function(e){this.setState({value:e}),this._activation(!1),this.props.onChange(e)},_activation:function(e){var t={esc:this._onClose,tab:this._onClose,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter};if(e){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(t);var n=this.refs.component.getDOMNode(),r=document.getElementById(l+"-layer");this.startOverlay(n,r,"below");var i=r.querySelectorAll("input")[0];i.focus()}else document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(t),this.stopOverlay()},getInitialState:function(){return{active:!1,defaultValue:this.props.defaultValue,value:this.props.value,activeSuggestionIndex:-1}},componentDidMount:function(){this.state.active&&this._activation(this.state.active)},componentDidUpdate:function(e,t){!this.state.active&&t.active&&this._activation(this.state.active),this.state.active&&!t.active&&this._activation(this.state.active)},componentWillUnmount:function(){this._activation(!1)},_valueText:function(e){var t="";return e&&(t="string"==typeof e?e:e.label||e.value),t},render:function(){var e=[l];return this.state.active&&e.push(l+"--active"),this.props.className&&e.push(this.props.className),r.createElement("div",{ref:"component",className:e.join(" ")},r.createElement("input",{className:l+"__input",id:this.props.id,name:this.props.name,value:this._valueText(this.props.value),defaultValue:this._valueText(this.props.defaultValue),onChange:this._onInputChange}),r.createElement("div",{className:l+"__control",onClick:this._onOpen},r.createElement(o,null)))},renderLayer:function(){if(this.state.active){var e=null;return this.props.suggestions&&(e=this.props.suggestions.map(function(e,t){var n=[l+"__layer-suggestion"];return t===this.state.activeSuggestionIndex&&n.push(l+"__layer-suggestion--active"),r.createElement("div",{key:this._valueText(e),className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},this._valueText(e))},this)),r.createElement("div",{id:l+"-layer",className:l+"__layer",onClick:this._onClose},r.createElement("input",{type:"search",defaultValue:"",placeholder:"Search",className:l+"__layer-input",onChange:this._onSearchChange}),r.createElement("div",{className:l+"__layer-suggestions"},e))}return r.createElement("span",null)}});e.exports=c},function(e,t,n){var r=n(42),i="section",a=r.createClass({displayName:"Section",propTypes:{centered:r.PropTypes.bool,compact:r.PropTypes.bool,colorIndex:r.PropTypes.string,direction:r.PropTypes.oneOf(["up","down","left","right"]),flush:r.PropTypes.bool,texture:r.PropTypes.string},getDefaultProps:function(){return{colored:!1,direction:"down",flush:!0,small:!1}},render:function(){var e=[i],t=[i+"__content"];this.props.compact&&e.push(i+"--compact"),this.props.centered&&e.push(i+"--centered"),this.props.flush&&e.push(i+"--flush"),this.props.direction&&e.push(i+"--"+this.props.direction),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var n={};return this.props.texture&&(n.backgroundImage=this.props.texture),r.createElement("div",{className:e.join(" "),style:n},r.createElement("div",{className:t.join(" ")},this.props.children))}});e.exports=a},function(e,t,n){var r=n(42),i=n(35),a=n(48),s="table",o=r.createClass({displayName:"Table",propTypes:{selection:r.PropTypes.number,onMore:r.PropTypes.func,scrollable:r.PropTypes.bool,selectable:r.PropTypes.bool},mixins:[a],getDefaultProps:function(){return{selection:null,scrollable:!1,selectable:!1}},_clearSelection:function(){for(var e=this.refs.table.getDOMNode().querySelectorAll("."+s+"__row--selected"),t=0;t0&&!this._keyboardAcceleratorListening&&(window.addEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorListening=!0)},stopListeningToKeyboard:function(e){if(e)for(var t in e)if(e.hasOwnProperty(t)){var n=t;r.hasOwnProperty(t)&&(n=r[t]),delete this._keyboardAcceleratorHandlers[n]}var i=0;for(var a in this._keyboardAcceleratorHandlers)this._keyboardAcceleratorHandlers.hasOwnProperty(a)&&(i+=1);e&&0!==i||(window.removeEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorHandlers={},this._keyboardAcceleratorListening=!1)},componentWillUnmount:function(){this.stopListeningToKeyboard()}};e.exports=i},function(e,t,n){var r=n(42),i={componentWillUnmount:function(){this._unrenderLayer(),document.body.removeChild(this._target)},componentDidUpdate:function(){this._renderLayer()},componentDidMount:function(){this._target=document.createElement("div"),document.body.appendChild(this._target),this._renderLayer()},_renderLayer:function(){r.render(this.renderLayer(),this._target)},_unrenderLayer:function(){r.unmountComponentAtNode(this._target)}};e.exports=i},function(e,t,n){var r=n(56),i=n(41),a=r.createActions({login:{asyncResult:!0},logout:{}});a.login.listen(function(e,t){if(!e||!t)return this.failed(400,{message:"loginInvalidPassword"});var n=this;i.post("/rest/login-sessions",{authLoginDomain:"LOCAL",userName:e,password:t,loginMsgAck:!0}).end(function(t,r){return t||!r.ok?n.failed(t,r.body):void n.completed(e,r.body.sessionID)})}),e.exports=a},function(e,t,n){var r=n(56),i=n(39),a=n(49),s="token",o="user",l="loginTime",c="email",u=r.createStore({_data:{id:null,name:null,created:null,email:null,loginError:null},init:function(){this._data.id=a.get(s),this._data.name=a.get(o),this._data.created=a.get(l),this._data.email=a.get(c),this.listenTo(i.login.completed,this._onLoginCompleted),this.listenTo(i.login.failed,this._onLoginFailed),this.listenTo(i.logout,this._onLogout)},_onLoginCompleted:function(e,t){this._data.id=t,this._data.name=e,this._data.created=new Date,this._data.loginError=null,-1!==e.indexOf("@")&&(this._data.email=e),a.set(s,this._data.id),a.set(o,this._data.name),a.set(l,this._data.created),a.set(c,this._data.email),this.trigger(this._data)},_onLoginFailed:function(e,t){this._data.loginError={message:t.message,resolution:t.resolution},this.trigger(this._data)},_onLogout:function(){this._data.id=null,this._data.name=null,this._data.created=null,this._data.email=null,a.remove(s),a.remove(o),a.remove(l),a.remove(c),this.trigger(this._data)},getInitialState:function(){return this._data}});e.exports=u},function(e,t,n){function r(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(null!==r&&void 0!==r)if(Array.isArray(r))for(var i=0;ir?a-=a+i-r:0>a&&(a=0);var s=n.top;"up"===this.props.direction?s=n.top+n.height-t.offsetHeight:"below"===this._overlay.align&&(s=n.top+n.height);var o=window.innerHeight-s;t.style.left=""+a+"px",t.style.width=""+i+"px",t.style.top=""+s+"px",t.style.maxHeight=""+o+"px"},componentWillUnmount:function(){this.stopOverlay()}};e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"DropCaret",render:function(){var e="control-icon control-icon-drop-caret";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{stroke:"none"},r.createElement("polygon",{points:"33.4,19.7 24.1,30.3 14.8,19.7"})))}});e.exports=i},function(e,t,n){var r=n(59),i=2e3,a=200,s={_infiniteScroll:{indicatorElement:null,scrollParent:null,onEnd:null},_onScroll:function(){clearTimeout(this._infiniteScroll.scrollTimer),this._infiniteScroll.scrollTimer=setTimeout(function(){var e=this._infiniteScroll.scrollParent.getBoundingClientRect(),t=this._infiniteScroll.indicatorElement.getBoundingClientRect();t.bottom<=e.bottom&&this._infiniteScroll.onEnd()}.bind(this),i)},startListeningForScroll:function(e,t){this._infiniteScroll.onEnd=t,this._infiniteScroll.indicatorElement=e,this._infiniteScroll.scrollParent=r.findScrollParents(e)[0],this._infiniteScroll.scrollParent.addEventListener("scroll",this._onScroll),this._infiniteScroll.scrollParent===document&&(this._infiniteScroll.scrollTimer=setTimeout(t,a))},stopListeningForScroll:function(){this._infiniteScroll.scrollParent&&(clearTimeout(this._infiniteScroll.scrollTimer),this._infiniteScroll.scrollParent.removeEventListener("scroll",this._onScroll),this._infiniteScroll.scrollParent=null)},componentWillUnmount:function(){this.stopListeningForScroll()}};e.exports=s},function(e,t,n){var r={get:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},set:function(e,t,n,r,i,a){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(n)switch(n.constructor){case Number:s=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:s="; expires="+n;break;case Date:s="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+s+(i?"; domain="+i:"")+(r?"; path="+r:"")+(a?"; secure":""), -!0},remove:function(e,t,n){return this.has(e)?(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0):!1},has:function(e){return e?new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie):!1},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;t>n;n++)e[n]=decodeURIComponent(e[n]);return e}};e.exports=r},function(e,t,n){var r=n(42),i=r.createClass({displayName:"OK",render:function(){var e="status-icon status-icon-ok";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#43A547"},r.createElement("path",{d:"M0,4.4058651 L0,19.657478 C0,21.7548387 2.41428571,23.9929619 4.68571429,23.9929619 L19.4571429,23.9929619 C21.7285714,23.9929619 24,21.8956012 24,19.657478 L24,4.4058651 C24,2.3085044 21.7285714,0.0703812317 19.4571429,0.0703812317 L4.68571429,0.0703812317 C2.27142857,0.0703812317 0,2.16774194 0,4.4058651 L0,4.4058651 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(4.214286, 3.519062)"},r.createElement("path",{d:"M0.0428571429,6.76363636 L0.0428571429,10.5431085 L6.86428571,15.4416422 L15.6642857,4.80703812 L15.6642857,0.0492668622 L6.15,11.2469208 L0.0428571429,6.76363636 Z"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"ErrorStatus",render:function(){var e="status-icon status-icon-error";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#DC462F"},r.createElement("circle",{cx:"12",cy:"12",r:"12"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF"},r.createElement("rect",{x:"4",y:"10",width:"16",height:"4"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Warning",render:function(){var e="status-icon status-icon-warning";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 27 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#F3B51D"},r.createElement("path",{d:"M26.758209,22.8752239 L14.1062687,0.494328358 C13.8268657,-0.071641791 13.2608955,-0.071641791 12.838209,0.494328358 L0.179104478,22.8752239 C-0.100298507,23.441194 0.179104478,24 0.745074627,24 L26.0561194,24 C26.758209,24 27.0376119,23.5773134 26.758209,22.8752239 L26.758209,22.8752239 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(12.250746, 7.307463)"},r.createElement("path",{d:"M2.69373134,9.01970149 L0.0214925373,9.01970149 L0.0214925373,0.0143283582 L2.69373134,0.0143283582 L2.69373134,9.01970149 L2.69373134,9.01970149 Z M2.69373134,10.9898507 L0.0214925373,10.9898507 L0.0214925373,13.6620896 L2.69373134,13.6620896 L2.69373134,10.9898507 L2.69373134,10.9898507 Z"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Disabled",render:function(){var e="status-icon status-icon-disabled";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#848484"},r.createElement("path",{d:"M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF"},r.createElement("circle",{cx:"12",cy:"12",r:"5.5"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Unknown",render:function(){var e="status-icon status-icon-unknown";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#848484"},r.createElement("path",{d:"M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(7.524324, 4.994595)"},r.createElement("path",{d:"M8.89945946,3.97621622 C8.89945946,4.48216216 8.64648649,4.98810811 8.39351351,5.49405405 C8.0172973,5.87027027 7.51135135,6.62918919 6.49945946,7.38810811 C5.99351351,7.76432432 5.74054054,8.14702703 5.6172973,8.4 L5.6172973,8.77621622 C5.49405405,9.02918919 5.49405405,9.53513514 5.49405405,10.1643243 L3.47027027,10.1643243 L3.47027027,9.53513514 C3.47027027,8.90594595 3.59351351,8.0172973 3.84648649,7.51135135 C3.96972973,7.13513514 4.47567568,6.62918919 5.23459459,5.99351351 C5.99351351,5.36432432 6.36972973,4.98162162 6.49945946,4.85837838 C6.75243243,4.60540541 6.87567568,4.35243243 6.87567568,3.97621622 C6.87567568,3.6 6.6227027,3.2172973 6.24648649,2.84108108 C5.87027027,2.46486486 5.23459459,2.33513514 4.60540541,2.33513514 C3.97621622,2.33513514 3.47027027,2.45837838 2.96432432,2.71135135 C2.58810811,2.96432432 2.20540541,3.34054054 2.08216216,3.84648649 L0.0583783784,3.84648649 C0.0583783784,2.83459459 0.564324324,1.95243243 1.32324324,1.19351351 C2.20540541,0.434594595 3.2172973,0.0583783784 4.48216216,0.0583783784 C5.87027027,0.0583783784 7.00540541,0.434594595 7.76432432,1.19351351 C8.51675676,1.95891892 8.89945946,2.96432432 8.89945946,3.97621622 L8.89945946,3.97621622 Z M4.47567568,10.9232432 C3.71675676,10.9232432 2.95783784,11.6821622 2.95783784,12.4410811 C2.95783784,13.2 3.71675676,13.9589189 4.47567568,13.9589189 C5.23459459,13.9589189 5.99351351,13.2 5.99351351,12.4410811 C5.99351351,11.6821622 5.23459459,10.9232432 4.47567568,10.9232432 L4.47567568,10.9232432 Z"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Label",render:function(){var e="status-icon status-icon-label";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#CCCCCC"},r.createElement("circle",{cx:"12",cy:"12",r:"12"})))}});e.exports=i},function(e,t,n){e.exports=n(64)},function(e,t,n){function r(e){return n(i(e))}function i(e){return a[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var a={"./en-US":58,"./en-US.js":58,"./pt-BR":61,"./pt-BR.js":61};r.keys=function(){return Object.keys(a)},r.resolve=i,e.exports=r,r.id=57},function(e,t,n){e.exports={IndexFilters:{filters:"{quantity, plural,\n =0 {Filters}\n =1 {one filter}\n other {# filters}\n}"},Active:"Active",Alerts:"Alerts",All:"All",Category:"Category",Cleared:"Cleared",Completed:"Completed",created:"Created",Critical:"Critical",Disabled:"Disabled",Error:"Error",loginInvalidPassword:"Please provide Username and Password.","Log In":"Log In",Logout:"Logout",model:"Model",modified:"Modified",Name:"Name",OK:"OK",Password:"Password","Remember me":"Remember me",Resource:"Resource",Running:"Running",Search:"Search",State:"State",Status:"Status",Tasks:"Tasks",Time:"Time",Total:"Total",Unknown:"Unknown",Username:"Username",uri:"URI",Warning:"Warning"}},function(e,t,n){e.exports={findScrollParents:function(e){for(var t=[],n=e.parentNode;n;)n.scrollHeight>n.offsetHeight+10&&t.push(n),n=n.parentNode;return 0===t.length&&t.push(document),t}}},function(e,t,n){(function(r){"use strict";var i=r.React;r.React=n(42);var a=n(68);if(n(67),t=e.exports=a.IntlMixin,Object.keys(a).forEach(function(e){Object.defineProperty(t,e,{enumerable:!0,value:a[e]})}),i)r.React=i;else try{delete r.React}catch(s){r.React=void 0}}).call(t,function(){return this}())},function(e,t,n){e.exports={IndexFilters:{filters:"{quantity, plural,\n =0 {Filtros}\n =1 {um filtro}\n other {# filtros}\n}"},Active:"Ativos",Alerts:"Alertas",All:"Todos",Category:"Categoria",Cleared:"Livre",Completed:"Completado",created:"Criado",Critical:"Crítico",Disabled:"Desabilitado",Error:"Erro",loginInvalidPassword:"Por favor, informe Usuário e Senha.","Log In":"Logar",Logout:"Deslogar",model:"Modelo",modified:"Modificado",Name:"Nome",OK:"OK",Password:"Senha","Remember me":"Lembrar Usuário",Resource:"Recurso",Running:"Executando",Search:"Buscar",State:"Estado",Status:"Situaçāo",Tasks:"Tarefas",Time:"Data",Total:"Total",Unknown:"Desconhecido",Username:"Usuário",uri:"URI",Warning:"Alerta"}},function(e,t,n){function r(){}function i(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function a(e){return e===Object(e)}function s(e){if(!a(e))return e;var t=[];for(var n in e)null!=e[n]&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function o(e){for(var t,n,r={},i=e.split("&"),a=0,s=i.length;s>a;++a)n=i[a],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function l(e){var t,n,r,i,a=e.split(/\r?\n/),s={};a.pop();for(var o=0,l=a.length;l>o;++o)n=a[o],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),i=y(n.slice(t+1)),s[r]=i;return s}function c(e){return e.split(/ *; */).shift()}function u(e){return f(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})}function p(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=l(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var n=this;d.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new p(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(e||i,t)})}function m(e,t){return"function"==typeof t?new h("GET",e).end(t):1==arguments.length?new h("GET",e):new h(e,t)}var d=n(83),f=n(84),g="undefined"==typeof window?this||self:window;m.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var y="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};m.serializeObject=s,m.parseString=o,m.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},m.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=c(t);var n=u(t);for(var r in n)this[r]=n[r]},p.prototype.parseBody=function(e){var t=m.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},m.Response=p,d(h.prototype),h.prototype.use=function(e){return e(this),this},h.prototype.timeout=function(e){return this._timeout=e,this},h.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.set=function(e,t){if(a(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},h.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},h.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},h.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},h.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},h.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},h.prototype.query=function(e){return"string"!=typeof e&&(e=s(e)),e&&this._query.push(e),this},h.prototype.field=function(e,t){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t),this},h.prototype.attach=function(e,t,n){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t,n),this},h.prototype.send=function(e){var t=a(e),n=this.getHeader("Content-Type");if(t&&a(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(n||this.type("json"),this)},h.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,n=this.xhr=m.getXHR(),a=this._query.join("&"),s=this._timeout,o=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var l=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=l);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=l)}catch(c){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),a&&(a=m.serializeObject(a),this.url+=~this.url.indexOf("?")?"&"+a:"?"+a),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof o&&!i(o)){var u=m.serialize[this.getHeader("Content-Type")];u&&(o=u(o))}for(var p in this.header)null!=this.header[p]&&n.setRequestHeader(p,this.header[p]);return this.emit("request",this),n.send(o),this},m.Request=h,m.get=function(e,t,n){var r=m("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.head=function(e,t,n){var r=m("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.del=function(e,t){var n=m("DELETE",e);return t&&n.end(t),n},m.patch=function(e,t,n){var r=m("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.post=function(e,t,n){var r=m("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.put=function(e,t,n){var r=m("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},e.exports=m},function(e,t,n){var r,i;(function(a){/** +var Grommet=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r={App:n(3),Button:n(44),CheckBox:n(45),Document:n(46),Donut:n(47),Footer:n(49),Form:n(51),FormField:n(52),Header:n(53),Label:n(54),Login:n(55),LoginForm:n(56),Menu:n(57),Meter:n(64),Panel:n(65),RadioButton:n(66),Search:n(67),SearchInput:n(69),Section:n(70),Table:n(71),Tiles:n(74),Tile:n(1),Title:n(75),Object:n(76),TBD:n(77),Icons:{Clear:n(78),DragHandle:n(79),Edit:n(80),Filter:n(81),Help:n(82),Left:n(83),More:n(62),Right:n(84),Search:n(68),SearchPlus:n(85),Spinning:n(72),Status:n(86)},Mixins:{KeyboardAccelerators:n(61),ReactLayeredComponent:n(60)},Actions:n(93),SessionStore:n(121),Rest:n(117)};e.exports=r},function(e,t,n){var r=n(2),i="tile",a=r.createClass({displayName:"Tile",propTypes:{onClick:r.PropTypes.func,selected:r.PropTypes.bool,status:r.PropTypes.string,wide:r.PropTypes.bool},render:function(){var e=[i];return this.props.status&&e.push(i="--status-"+this.props.status.toLowerCase()),this.props.wide&&e.push(i+"--wide"),this.props.onClick&&e.push(i+"--selectable"),this.props.selected&&e.push(i+"--selected"),this.props.className&&e.push(this.props.className),r.createElement("div",{className:e.join(" "),onClick:this.props.onClick},this.props.children)}});e.exports=a},function(e,t,n){e.exports=React},function(e,t,n){var r=n(2),i=n(4),a=r.createClass({displayName:"App",mixins:[i],propTypes:{centered:r.PropTypes.bool},getDefaultProps:function(){return{centered:!0}},render:function(){var e=["app"];this.props.centered&&e.push("app--centered"),this.props.inline&&e.push("app--inline"),this.props.className&&e.push(this.props.className);var t=r.Children.map(this.props.children,function(e){return e?r.cloneElement(e,this.getChildContext()):null}.bind(this));return r.createElement("div",{className:e.join(" ")},t)}});e.exports=a},function(e,t,n){(function(t){function r(){return t.Intl&&i.every(function(e){return Intl.NumberFormat.supportedLocalesOf(e)[0]===e&&Intl.DateTimeFormat.supportedLocalesOf(e)[0]===e})}var i=["en-US","pt-BR"];r()||(n(5),IntlPolyfill.__addLocaleData(n(6)),IntlPolyfill.__addLocaleData(n(7)),Intl.NumberFormat=IntlPolyfill.NumberFormat,Intl.DateTimeFormat=IntlPolyfill.DateTimeFormat);var a=n(2),s=n(8),o=s.IntlMixin,l=s.FormattedDate;e.exports={mixins:[o],getChildContext:function(){if(this.props.locales||this.context.locales||(this.context.locales="en-US"),!this.props.messages&&!this.context.messages)try{this.context.messages=n(41)("./"+(this.props.locales||this.context.locales||"en-US"))}catch(e){this.context.messages=n(42)}},getGrommetFormattedDate:function(e){return a.createElement(l,{value:new Date(e),day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})},getGrommetIntlMessage:function(e){var t=e;if(e)try{t=this.getIntlMessage(e)}catch(n){t=e}return t}}}).call(t,function(){return this}())},function(e,t,n){var r,i;(function(a){/** * @license Copyright 2013 Andy Earnshaw, MIT License * * Implements the ECMAScript Internationalization API in ES5-compatible environments, @@ -10,10 +8,12 @@ l.style.fontSize=c;var u=i.clientHeight;o&&u<=o.clientHeight&&(s.style.marginTop * * CLDR format locale data should be provided using IntlPolyfill.__addLocaleData(). */ -!function(a,s){var o=s();r=o,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)),e.exports=o,a.Intl||(a.Intl=o,o.__applyLocaleSensitivePrototypes()),a.IntlPolyfill=o}("undefined"!=typeof a?a:this,function(){"use strict";function e(e){return B.test(e)?G.test(e)?!1:U.test(e)?!1:!0:!1}function t(e){var t,n;e=e.toLowerCase(),n=e.split("-");for(var r=1,i=n.length;i>r;r++)if(2===n[r].length)n[r]=n[r].toUpperCase();else if(4===n[r].length)n[r]=n[r].charAt(0).toUpperCase()+n[r].slice(1);else if(1===n[r].length&&"x"!=n[r])break;e=te.call(n,"-"),(t=e.match(H))&&t.length>1&&(t.sort(),e=e.replace(RegExp("(?:"+H.source+")+","i"),te.call(t,""))),$.call(pe.tags,e)&&(e=pe.tags[e]),n=e.split("-");for(var r=1,i=n.length;i>r;r++)$.call(pe.subtags,n[r])?n[r]=pe.subtags[n[r]]:$.call(pe.extLang,n[r])&&(n[r]=pe.extLang[n[r]][0],1===r&&pe.extLang[n[1]][1]===n[0]&&(n=V.call(n,r++),i-=1));return te.call(n,"-")}function n(){return z}function r(e){var t=String(e),n=K(t);return ce.test(n)===!1?!1:!0}function i(n){if(void 0===n)return new D;for(var r=new D,n="string"==typeof n?[n]:n,i=O(n),a=i.length,s=0;a>s;){var o=String(s),l=o in i;if(l){var c=i[o];if(null==c||"string"!=typeof c&&"object"!=typeof c)throw new TypeError("String or Object type expected");var u=String(c);if(!e(u))throw new RangeError("'"+u+"' is not a structurally valid language tag");u=t(u),-1===X.call(r,u)&&ee.call(r,u)}s++}return r}function a(e,t){for(var n=t;;){if(X.call(e,n)>-1)return n;var r=n.lastIndexOf("-");if(0>r)return;r>=2&&"-"==n.charAt(r-2)&&(r-=2),n=n.substring(0,r)}}function s(e,t){for(var r,i=0,s=t.length;s>i&&!r;){var o=t[i],l=String(o).replace(ue,""),r=a(e,l);i++}var c=new A;if(void 0!==r){if(c["[[locale]]"]=r,String(o)!==String(l)){var u=o.match(ue)[0],p=o.indexOf("-u-");c["[[extension]]"]=u,c["[[extensionIndex]]"]=p}}else c["[[locale]]"]=n();return c}function o(e,t){return s(e,t)}function l(e,t,n,r,i){if(0===e.length)throw new ReferenceError("No locale data has been provided for this object yet.");var a=n["[[localeMatcher]]"];if("lookup"===a)var l=s(e,t);else var l=o(e,t);var c=l["[[locale]]"];if($.call(l,"[[extension]]"))var u=l["[[extension]]"],p=l["[[extensionIndex]]"],h=String.prototype.split,m=h.call(u,"-"),d=m.length;var f=new A;f["[[dataLocale]]"]=c;for(var g="-u",y=0,v=r.length;v>y;){var b=r[y],_=i[c],T=_[b],k=T[0],E="",w=X;if(void 0!==m){var x=w.call(m,b);if(-1!==x)if(d>x+1&&m[x+1].length>2){var N=m[x+1],S=w.call(T,N);if(-1!==S)var k=N,E="-"+b+"-"+k}else{var S=w(T,"true");if(-1!==S)var k="true"}}if($.call(n,"[["+b+"]]")){var P=n["[["+b+"]]"];-1!==w.call(T,P)&&P!==k&&(k=P,E="")}f["[["+b+"]]"]=k,g+=E,y++}if(g.length>2)var C=c.substring(0,p),M=c.substring(p),c=C+g+M;return f["[[locale]]"]=c,f}function c(e,t){for(var n=t.length,r=new D,i=0;n>i;){var s=t[i],o=String(s).replace(ue,""),l=a(e,o);void 0!==l&&ee.call(r,s),i++}var c=V.call(r);return c}function u(e,t){return c(e,t)}function p(e,t,n){if(void 0!==n){var n=new A(O(n)),r=n.localeMatcher;if(void 0!==r&&(r=String(r),"lookup"!==r&&"best fit"!==r))throw new RangeError('matcher should be "lookup" or "best fit"')}if(void 0===r||"best fit"===r)var i=u(e,t);else var i=c(e,t);for(var a in i)$.call(i,a)&&Z(i,a,{writable:!1,configurable:!1,value:i[a]});return Z(i,"length",{writable:!1}),i}function h(e,t,n,r,i){var a=e[t];if(void 0!==a){if(a="boolean"===n?Boolean(a):"string"===n?String(a):a,void 0!==r&&-1===X.call(r,a))throw new RangeError("'"+a+"' is not an allowed value for `"+t+"`");return a}return i}function m(e,t,n,r,i){var a=e[t];if(void 0!==a){if(a=Number(a),isNaN(a)||n>a||a>r)throw new RangeError("Value is not a number or outside accepted range");return Math.floor(a)}return i}function d(){var e=arguments[0],t=arguments[1];return this&&this!==W?f(O(this),e,t):new W.NumberFormat(e,t)}function f(e,t,n){var a=R(e),s=I();if(a["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");Z(e,"__getInternalProperties",{value:function(){return arguments[0]===ae?a:void 0}}),a["[[initializedIntlObject]]"]=!0;var o=i(t);n=void 0===n?{}:O(n);var c=new A,u=h(n,"localeMatcher","string",new D("lookup","best fit"),"best fit");c["[[localeMatcher]]"]=u;var p=ie.NumberFormat["[[localeData]]"],d=l(ie.NumberFormat["[[availableLocales]]"],o,c,ie.NumberFormat["[[relevantExtensionKeys]]"],p);a["[[locale]]"]=d["[[locale]]"],a["[[numberingSystem]]"]=d["[[nu]]"],a["[[dataLocale]]"]=d["[[dataLocale]]"];var f=d["[[dataLocale]]"],v=h(n,"style","string",new D("decimal","percent","currency"),"decimal");a["[[style]]"]=v;var b=h(n,"currency","string");if(void 0!==b&&!r(b))throw new RangeError("'"+b+"' is not a valid currency code");if("currency"===v&&void 0===b)throw new TypeError("Currency code is required when style is currency");if("currency"===v){b=b.toUpperCase(),a["[[currency]]"]=b;var _=g(b)}var T=h(n,"currencyDisplay","string",new D("code","symbol","name"),"symbol");"currency"===v&&(a["[[currencyDisplay]]"]=T);var k=m(n,"minimumIntegerDigits",1,21,1);a["[[minimumIntegerDigits]]"]=k;var E="currency"===v?_:0,w=m(n,"minimumFractionDigits",0,20,E);a["[[minimumFractionDigits]]"]=w;var x="currency"===v?Math.max(w,_):"percent"===v?Math.max(w,0):Math.max(w,3),N=m(n,"maximumFractionDigits",w,20,x);a["[[maximumFractionDigits]]"]=N;var S=n.minimumSignificantDigits,P=n.maximumSignificantDigits;(void 0!==S||void 0!==P)&&(S=m(n,"minimumSignificantDigits",1,21,1),P=m(n,"maximumSignificantDigits",S,21,21),a["[[minimumSignificantDigits]]"]=S,a["[[maximumSignificantDigits]]"]=P);var C=h(n,"useGrouping","boolean",void 0,!0);a["[[useGrouping]]"]=C;var M=p[f],j=M.patterns,L=j[v];return a["[[positivePattern]]"]=L.positivePattern,a["[[negativePattern]]"]=L.negativePattern,a["[[boundFormat]]"]=void 0,a["[[initializedNumberFormat]]"]=!0,J&&(e.format=y.call(e)),s.exp.test(s.input),e}function g(e){return void 0!==he[e]?he[e]:2}function y(){var e=null!=this&&"object"==typeof this&&R(this);if(!e||!e["[[initializedNumberFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.NumberFormat object.");if(void 0===e["[[boundFormat]]"]){var t=function(e){return v(this,Number(e))},n=re.call(t,this);e["[[boundFormat]]"]=n}return e["[[boundFormat]]"]}function v(e,t){var n,r=I(),i=R(e),a=i["[[dataLocale]]"],s=i["[[numberingSystem]]"],o=ie.NumberFormat["[[localeData]]"][a],l=o.symbols[s]||o.symbols.latn,c=!1;if(isFinite(t)===!1)isNaN(t)?n=l.nan:(n=l.infinity,0>t&&(c=!0));else{if(0>t&&(c=!0,t=-t),"percent"===i["[[style]]"]&&(t*=100),n=$.call(i,"[[minimumSignificantDigits]]")&&$.call(i,"[[maximumSignificantDigits]]")?b(t,i["[[minimumSignificantDigits]]"],i["[[maximumSignificantDigits]]"]):_(t,i["[[minimumIntegerDigits]]"],i["[[minimumFractionDigits]]"],i["[[maximumFractionDigits]]"]),me[s]){var u=me[i["[[numberingSystem]]"]];n=String(n).replace(/\d/g,function(e){return u[e]})}else n=String(n);if(n=n.replace(/\./g,l.decimal),i["[[useGrouping]]"]===!0){var p=n.split(l.decimal),h=p[0],m=o.patterns.primaryGroupSize||3,d=o.patterns.secondaryGroupSize||m;if(h.length>m){var f=new D,g=h.length-m,y=g%d,v=h.slice(0,y);for(v.length&&ee.call(f,v);g>y;)ee.call(f,h.slice(y,y+d)),y+=d;ee.call(f,h.slice(g)),p[0]=te.call(f,l.group)}n=te.call(p,l.decimal)}}var T=i[c===!0?"[[negativePattern]]":"[[positivePattern]]"];if(T=T.replace("{number}",n),"currency"===i["[[style]]"]){var k,E=i["[[currency]]"],w=o.currencies[E];switch(i["[[currencyDisplay]]"]){case"symbol":k=w||E;break;default:case"code":case"name":k=E}T=T.replace("{currency}",k)}return r.exp.test(r.input),T}function b(e,t,n){var r=n;if(0===e)var i=te.call(Array(r+1),"0"),a=0;else var a=j(Math.abs(e)),s=Math.round(Math.exp(Math.abs(a-r+1)*Math.LN10)),i=String(Math.round(0>a-r+1?e*s:e/s));if(a>=r)return i+te.call(Array(a-r+1+1),"0");if(a===r-1)return i;if(a>=0?i=i.slice(0,a+1)+"."+i.slice(a+1):0>a&&(i="0."+te.call(Array(-(a+1)+1),"0")+i),i.indexOf(".")>=0&&n>t){for(var o=n-t;o>0&&"0"===i.charAt(i.length-1);)i=i.slice(0,-1),o--;"."===i.charAt(i.length-1)&&(i=i.slice(0,-1))}return i}function _(e,t,n,r){var i,a=Number.prototype.toFixed.call(e,r),s=a.split(".")[0].length,o=r-n,l=(i=a.indexOf("e"))>-1?a.slice(i+1):0;for(l&&(a=a.slice(0,i).replace(".",""),a+=te.call(Array(l-(a.length-1)+1),"0")+"."+te.call(Array(r+1),"0"),s=a.length);o>0&&"0"===a.slice(-1);)a=a.slice(0,-1),o--;if("."===a.slice(-1)&&(a=a.slice(0,-1)),t>s)var c=te.call(Array(t-s+1),"0");return(c?c:"")+a}function T(){var e=arguments[0],t=arguments[1];return this&&this!==W?k(O(this),e,t):new W.DateTimeFormat(e,t)}function k(e,t,n){var r=R(e),a=I();if(r["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");Z(e,"__getInternalProperties",{value:function(){return arguments[0]===ae?r:void 0}}),r["[[initializedIntlObject]]"]=!0;var s=i(t),n=E(n,"any","date"),o=new A;_=h(n,"localeMatcher","string",new D("lookup","best fit"),"best fit"),o["[[localeMatcher]]"]=_;var c=ie.DateTimeFormat,u=c["[[localeData]]"],p=l(c["[[availableLocales]]"],s,o,c["[[relevantExtensionKeys]]"],u);r["[[locale]]"]=p["[[locale]]"],r["[[calendar]]"]=p["[[ca]]"],r["[[numberingSystem]]"]=p["[[nu]]"],r["[[dataLocale]]"]=p["[[dataLocale]]"];var m=p["[[dataLocale]]"],d=n.timeZone;if(void 0!==d&&(d=K(d),"UTC"!==d))throw new RangeError("timeZone is not supported.");r["[[timeZone]]"]=d,o=new A;for(var f in de)if($.call(de,f)){var g=h(n,f,"string",de[f]);o["[["+f+"]]"]=g}var y,v=u[m],b=v.formats,_=h(n,"formatMatcher","string",new D("basic","best fit"),"best fit");y="basic"===_?w(o,b):N(o,b);for(var f in de)if($.call(de,f)&&$.call(y,f)){var T=y[f];r["[["+f+"]]"]=T}var k,x=h(n,"hour12","boolean");if(r["[[hour]]"])if(x=void 0===x?v.hour12:x,r["[[hour12]]"]=x,x===!0){var P=v.hourNo0;r["[[hourNo0]]"]=P,k=y.pattern12}else k=y.pattern;else k=y.pattern;return r["[[pattern]]"]=k,r["[[boundFormat]]"]=void 0,r["[[initializedDateTimeFormat]]"]=!0,J&&(e.format=S.call(e)),a.exp.test(a.input),e}function E(e,t,n){if(void 0===e)e=null;else{var r=O(e);e=new A;for(var i in r)e[i]=r[i]}var a=Y,e=a(e),s=!0;return("date"===t||"any"===t)&&(void 0!==e.weekday||void 0!==e.year||void 0!==e.month||void 0!==e.day)&&(s=!1),("time"===t||"any"===t)&&(void 0!==e.hour||void 0!==e.minute||void 0!==e.second)&&(s=!1),!s||"date"!==n&&"all"!==n||(e.year=e.month=e.day="numeric"),!s||"time"!==n&&"all"!==n||(e.hour=e.minute=e.second="numeric"),e}function w(e,t){return x(e,t)}function x(e,t,n){for(var r,i=8,a=120,s=20,o=8,l=6,c=6,u=3,p=-(1/0),h=0,m=t.length;m>h;){var d=t[h],f=0;for(var g in de)if($.call(de,g)){var y=e["[["+g+"]]"],v=$.call(d,g)?d[g]:void 0;if(void 0===y&&void 0!==v)f-=s;else if(void 0!==y&&void 0===v)f-=a;else{var b=["2-digit","numeric","narrow","short","long"],_=X.call(b,y),T=X.call(b,v),k=Math.max(Math.min(T-_,2),-2);!n||("numeric"!==y&&"2-digit"!==y||"numeric"===v||"2-digit"===v)&&("numeric"===y||"2-digit"===y||"2-digit"!==v&&"numeric"!==v)||(f-=i),2===k?f-=l:1===k?f-=u:-1===k?f-=c:-2===k&&(f-=o)}}f>p&&(p=f,r=d),h++}return r}function N(e,t){return x(e,t,!0)}function S(){var e=null!=this&&"object"==typeof this&&R(this);if(!e||!e["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.DateTimeFormat object.");if(void 0===e["[[boundFormat]]"]){var t=function(){var e=Number(0===arguments.length?Date.now():arguments[0]);return P(this,e)},n=re.call(t,this);e["[[boundFormat]]"]=n}return e["[[boundFormat]]"]}function P(e,t){if(!isFinite(t))throw new RangeError("Invalid valid date passed to format");var n=e.__getInternalProperties(ae),r=I(),i=n["[[locale]]"],a=new W.NumberFormat([i],{useGrouping:!1}),s=new W.NumberFormat([i],{minimumIntegerDigits:2,useGrouping:!1}),o=C(t,n["[[calendar]]"],n["[[timeZone]]"]),l=n["[[pattern]]"],c=n["[[dataLocale]]"],u=ie.DateTimeFormat["[[localeData]]"][c].calendars,p=n["[[calendar]]"];for(var h in de)if($.call(n,"[["+h+"]]")){var m,d,f=n["[["+h+"]]"],g=o["[["+h+"]]"];if("year"===h&&0>=g?g=1-g:"month"===h?g++:"hour"===h&&n["[[hour12]]"]===!0&&(g%=12,m=g!==o["[["+h+"]]"],0===g&&n["[[hourNo0]]"]===!0&&(g=12)),"numeric"===f)d=v(a,g);else if("2-digit"===f)d=v(s,g),d.length>2&&(d=d.slice(-2));else if(f in se)switch(h){case"month":d=F(u,p,"months",f,o["[["+h+"]]"]);break;case"weekday":try{d=F(u,p,"days",f,o["[["+h+"]]"])}catch(y){throw new Error("Could not find weekday data for locale "+i)}break;case"timeZoneName":d="";break;default:d=o["[["+h+"]]"]}l=l.replace("{"+h+"}",d)}return n["[[hour12]]"]===!0&&(d=F(u,p,"dayPeriods",m?"pm":"am"),l=l.replace("{ampm}",d)),r.exp.test(r.input),l}function C(e,t,n){var r=new Date(e),i="get"+(n||"");return new A({"[[weekday]]":r[i+"Day"](),"[[era]]":+(r[i+"FullYear"]()>=0),"[[year]]":r[i+"FullYear"](),"[[month]]":r[i+"Month"](),"[[day]]":r[i+"Date"](),"[[hour]]":r[i+"Hours"](),"[[minute]]":r[i+"Minutes"](),"[[second]]":r[i+"Seconds"](),"[[inDST]]":!1})}function M(e,t){if(!e.number)throw new Error("Object passed doesn't contain locale data for Intl.NumberFormat");var n,r=[t],i=t.split("-");for(i.length>2&&4==i[1].length&&ee.call(r,i[0]+"-"+i[2]);n=ne.call(r);)ee.call(ie.NumberFormat["[[availableLocales]]"],n),ie.NumberFormat["[[localeData]]"][n]=e.number,e.date&&(e.date.nu=e.number.nu,ee.call(ie.DateTimeFormat["[[availableLocales]]"],n),ie.DateTimeFormat["[[localeData]]"][n]=e.date);void 0===z&&(z=t),oe||(f(W.NumberFormat.prototype),oe=!0),e.date&&!le&&(k(W.DateTimeFormat.prototype),le=!0)}function j(e){if("function"==typeof Math.log10)return Math.floor(Math.log10(e));var t=Math.round(Math.log(e)*Math.LOG10E);return t-(Number("1e"+t)>e)}function L(e){if(!$.call(this,"[[availableLocales]]"))throw new TypeError("supportedLocalesOf() is not a constructor");var t=I(),n=arguments[1],r=this["[[availableLocales]]"],a=i(e);return t.exp.test(t.input),p(r,a,n)}function F(e,t,n,r,i){var a=e[t]&&e[t][n]?e[t][n]:e.gregory[n],s={narrow:["short","long"],"short":["long","narrow"],"long":["short","narrow"]},o=$.call(a,r)?a[r]:$.call(a,s[r][0])?a[s[r][0]]:a[s[r][1]];return null!=i?o[i]:o}function A(e){for(var t in e)(e instanceof A||$.call(e,t))&&Z(this,t,{value:e[t],enumerable:!0,writable:!0,configurable:!0})}function D(){Z(this,"length",{writable:!0,value:0}),arguments.length&&ee.apply(this,V.call(arguments))}function I(){for(var e=/[.?*+^$[\]\\(){}|-]/g,t=RegExp.lastMatch,n=RegExp.multiline?"m":"",r={input:RegExp.input},i=new D,a=!1,s={},o=1;9>=o;o++)a=(s["$"+o]=RegExp["$"+o])||a;if(t=t.replace(e,"\\$&"),a)for(var o=1;9>=o;o++){var l=s["$"+o];l?(l=l.replace(e,"\\$&"),t=t.replace(l,"("+l+")")):t="()"+t,ee.call(i,t.slice(0,t.indexOf("(")+1)),t=t.slice(t.indexOf("(")+1)}return r.exp=new RegExp(te.call(i,"")+t,n),r}function K(e){for(var t=e.length;t--;){var n=e.charAt(t);n>="a"&&"z">=n&&(e=e.slice(0,t)+n.toUpperCase()+e.slice(t+1))}return e}function O(e){if(null==e)throw new TypeError("Cannot convert null or undefined to object");return Object(e)}function R(e){return $.call(e,"__getInternalProperties")?e.__getInternalProperties(ae):Y(null)}var z,B,H,G,U,W={},q=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),J=!q&&!Object.prototype.__defineGetter__,$=Object.prototype.hasOwnProperty,Z=q?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!$.call(e,t)||"value"in n)&&(e[t]=n.value)},X=Array.prototype.indexOf||function(e){var t=this;if(!t.length)return-1;for(var n=arguments[1]||0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},Y=Object.create||function(e,t){function n(){}var r;n.prototype=e,r=new n;for(var i in t)$.call(t,i)&&Z(r,i,t[i]);return r},V=Array.prototype.slice,Q=Array.prototype.concat,ee=Array.prototype.push,te=Array.prototype.join,ne=Array.prototype.shift,re=(Array.prototype.unshift,Function.prototype.bind||function(e){var t=this,n=V.call(arguments,1);return 1===t.length?function(r){return t.apply(e,Q.call(n,V.call(arguments)))}:function(){return t.apply(e,Q.call(n,V.call(arguments)))}}),ie=Y(null),ae=Math.random(),se=Y(null,{narrow:{},"short":{},"long":{}}),oe=!1,le=!1,ce=/^[A-Z]{3}$/,ue=/-u(?:-[0-9a-z]{2,8})+/gi,pe={tags:{"art-lojban":"jbo","i-ami":"ami","i-bnn":"bnn","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","no-bok":"nb","no-nyn":"nn","sgn-BE-FR":"sfb","sgn-BE-NL":"vgt","sgn-CH-DE":"sgg","zh-guoyu":"cmn","zh-hakka":"hak","zh-min-nan":"nan","zh-xiang":"hsn","sgn-BR":"bzs","sgn-CO":"csn","sgn-DE":"gsg","sgn-DK":"dsl","sgn-ES":"ssp","sgn-FR":"fsl","sgn-GB":"bfi","sgn-GR":"gss","sgn-IE":"isg","sgn-IT":"ise","sgn-JP":"jsl","sgn-MX":"mfs","sgn-NI":"ncs","sgn-NL":"dse","sgn-NO":"nsl","sgn-PT":"psr","sgn-SE":"swl","sgn-US":"ase","sgn-ZA":"sfs","zh-cmn":"cmn","zh-cmn-Hans":"cmn-Hans","zh-cmn-Hant":"cmn-Hant","zh-gan":"gan","zh-wuu":"wuu","zh-yue":"yue"},subtags:{BU:"MM",DD:"DE",FX:"FR",TP:"TL",YD:"YE",ZR:"CD",heploc:"alalc97","in":"id",iw:"he",ji:"yi",jw:"jv",mo:"ro",ayx:"nun",bjd:"drl",ccq:"rki",cjr:"mom",cka:"cmr",cmk:"xch",drh:"khk",drw:"prs",gav:"dev",hrr:"jal",ibi:"opa",kgh:"kml",lcq:"ppr",mst:"mry",myt:"mry",sca:"hle",tie:"ras",tkk:"twm",tlw:"weo",tnf:"prs",ybd:"rki",yma:"lrr"},extLang:{aao:["aao","ar"],abh:["abh","ar"],abv:["abv","ar"],acm:["acm","ar"],acq:["acq","ar"],acw:["acw","ar"],acx:["acx","ar"],acy:["acy","ar"],adf:["adf","ar"],ads:["ads","sgn"],aeb:["aeb","ar"],aec:["aec","ar"],aed:["aed","sgn"],aen:["aen","sgn"],afb:["afb","ar"],afg:["afg","sgn"],ajp:["ajp","ar"],apc:["apc","ar"],apd:["apd","ar"],arb:["arb","ar"],arq:["arq","ar"],ars:["ars","ar"],ary:["ary","ar"],arz:["arz","ar"],ase:["ase","sgn"],asf:["asf","sgn"],asp:["asp","sgn"],asq:["asq","sgn"],asw:["asw","sgn"],auz:["auz","ar"],avl:["avl","ar"],ayh:["ayh","ar"],ayl:["ayl","ar"],ayn:["ayn","ar"],ayp:["ayp","ar"],bbz:["bbz","ar"],bfi:["bfi","sgn"],bfk:["bfk","sgn"],bjn:["bjn","ms"],bog:["bog","sgn"],bqn:["bqn","sgn"],bqy:["bqy","sgn"],btj:["btj","ms"],bve:["bve","ms"],bvl:["bvl","sgn"],bvu:["bvu","ms"],bzs:["bzs","sgn"],cdo:["cdo","zh"],cds:["cds","sgn"],cjy:["cjy","zh"],cmn:["cmn","zh"],coa:["coa","ms"],cpx:["cpx","zh"],csc:["csc","sgn"],csd:["csd","sgn"],cse:["cse","sgn"],csf:["csf","sgn"],csg:["csg","sgn"],csl:["csl","sgn"],csn:["csn","sgn"],csq:["csq","sgn"],csr:["csr","sgn"],czh:["czh","zh"],czo:["czo","zh"],doq:["doq","sgn"],dse:["dse","sgn"],dsl:["dsl","sgn"],dup:["dup","ms"],ecs:["ecs","sgn"],esl:["esl","sgn"],esn:["esn","sgn"],eso:["eso","sgn"],eth:["eth","sgn"],fcs:["fcs","sgn"],fse:["fse","sgn"],fsl:["fsl","sgn"],fss:["fss","sgn"],gan:["gan","zh"],gds:["gds","sgn"],gom:["gom","kok"],gse:["gse","sgn"],gsg:["gsg","sgn"],gsm:["gsm","sgn"],gss:["gss","sgn"],gus:["gus","sgn"],hab:["hab","sgn"],haf:["haf","sgn"],hak:["hak","zh"],hds:["hds","sgn"],hji:["hji","ms"],hks:["hks","sgn"],hos:["hos","sgn"],hps:["hps","sgn"],hsh:["hsh","sgn"],hsl:["hsl","sgn"],hsn:["hsn","zh"],icl:["icl","sgn"],ils:["ils","sgn"],inl:["inl","sgn"],ins:["ins","sgn"],ise:["ise","sgn"],isg:["isg","sgn"],isr:["isr","sgn"],jak:["jak","ms"],jax:["jax","ms"],jcs:["jcs","sgn"],jhs:["jhs","sgn"],jls:["jls","sgn"],jos:["jos","sgn"],jsl:["jsl","sgn"],jus:["jus","sgn"],kgi:["kgi","sgn"],knn:["knn","kok"],kvb:["kvb","ms"],kvk:["kvk","sgn"],kvr:["kvr","ms"],kxd:["kxd","ms"],lbs:["lbs","sgn"],lce:["lce","ms"],lcf:["lcf","ms"],liw:["liw","ms"],lls:["lls","sgn"],lsg:["lsg","sgn"],lsl:["lsl","sgn"],lso:["lso","sgn"],lsp:["lsp","sgn"],lst:["lst","sgn"],lsy:["lsy","sgn"],ltg:["ltg","lv"],lvs:["lvs","lv"],lzh:["lzh","zh"],max:["max","ms"],mdl:["mdl","sgn"],meo:["meo","ms"],mfa:["mfa","ms"],mfb:["mfb","ms"],mfs:["mfs","sgn"],min:["min","ms"],mnp:["mnp","zh"],mqg:["mqg","ms"],mre:["mre","sgn"],msd:["msd","sgn"],msi:["msi","ms"],msr:["msr","sgn"],mui:["mui","ms"],mzc:["mzc","sgn"],mzg:["mzg","sgn"],mzy:["mzy","sgn"],nan:["nan","zh"],nbs:["nbs","sgn"],ncs:["ncs","sgn"],nsi:["nsi","sgn"],nsl:["nsl","sgn"],nsp:["nsp","sgn"],nsr:["nsr","sgn"],nzs:["nzs","sgn"],okl:["okl","sgn"],orn:["orn","ms"],ors:["ors","ms"],pel:["pel","ms"],pga:["pga","ar"],pks:["pks","sgn"],prl:["prl","sgn"],prz:["prz","sgn"],psc:["psc","sgn"],psd:["psd","sgn"],pse:["pse","ms"],psg:["psg","sgn"],psl:["psl","sgn"],pso:["pso","sgn"],psp:["psp","sgn"],psr:["psr","sgn"],pys:["pys","sgn"],rms:["rms","sgn"],rsi:["rsi","sgn"],rsl:["rsl","sgn"],sdl:["sdl","sgn"],sfb:["sfb","sgn"],sfs:["sfs","sgn"],sgg:["sgg","sgn"],sgx:["sgx","sgn"],shu:["shu","ar"],slf:["slf","sgn"],sls:["sls","sgn"],sqk:["sqk","sgn"],sqs:["sqs","sgn"],ssh:["ssh","ar"],ssp:["ssp","sgn"],ssr:["ssr","sgn"],svk:["svk","sgn"],swc:["swc","sw"],swh:["swh","sw"],swl:["swl","sgn"],syy:["syy","sgn"],tmw:["tmw","ms"],tse:["tse","sgn"],tsm:["tsm","sgn"],tsq:["tsq","sgn"],tss:["tss","sgn"],tsy:["tsy","sgn"],tza:["tza","sgn"],ugn:["ugn","sgn"],ugy:["ugy","sgn"],ukl:["ukl","sgn"],uks:["uks","sgn"],urk:["urk","ms"],uzn:["uzn","uz"],uzs:["uzs","uz"],vgt:["vgt","sgn"],vkk:["vkk","ms"],vkt:["vkt","ms"],vsi:["vsi","sgn"],vsl:["vsl","sgn"],vsv:["vsv","sgn"],wuu:["wuu","zh"],xki:["xki","sgn"],xml:["xml","sgn"],xmm:["xmm","ms"],xms:["xms","sgn"],yds:["yds","sgn"],ysl:["ysl","sgn"],yue:["yue","zh"],zib:["zib","sgn"],zlm:["zlm","ms"],zmi:["zmi","ms"],zsl:["zsl","sgn"],zsm:["zsm","ms"]}},he={BHD:3,BYR:0,XOF:0,BIF:0,XAF:0,CLF:0,CLP:0,KMF:0,DJF:0,XPF:0,GNF:0,ISK:0,IQD:3,JPY:0,JOD:3,KRW:0,KWD:3,LYD:3,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,VUV:0,VND:0};!function(){var e="[a-z]{3}(?:-[a-z]{3}){0,2}",t="(?:[a-z]{2,3}(?:-"+e+")?|[a-z]{4}|[a-z]{5,8})",n="[a-z]{4}",r="(?:[a-z]{2}|\\d{3})",i="(?:[a-z0-9]{5,8}|\\d[a-z0-9]{3})",a="[0-9a-wy-z]",s=a+"(?:-[a-z0-9]{2,8})+",o="x(?:-[a-z0-9]{1,8})+",l="(?:en-GB-oed|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)|sgn-(?:BE-FR|BE-NL|CH-DE))",c="(?:art-lojban|cel-gaulish|no-bok|no-nyn|zh-(?:guoyu|hakka|min|min-nan|xiang))",u="(?:"+l+"|"+c+")",p=t+"(?:-"+n+")?(?:-"+r+")?(?:-"+i+")*(?:-"+s+")*(?:-"+o+")?";B=RegExp("^(?:"+p+"|"+o+"|"+u+")$","i"),G=RegExp("^(?!x).*?-("+i+")-(?:\\w{4,8}-(?!x-))*\\1\\b","i"),U=RegExp("^(?!x).*?-("+a+")-(?:\\w+-(?!x-))*\\1\\b","i"),H=RegExp("-"+s,"ig")}(),Z(W,"NumberFormat",{configurable:!0,writable:!0,value:d}),Z(W.NumberFormat,"prototype",{writable:!1}),ie.NumberFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["nu"],"[[localeData]]":{}},Z(W.NumberFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:re.call(L,ie.NumberFormat)}),Z(W.NumberFormat.prototype,"format",{configurable:!0,get:y});var me={arab:["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],arabext:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],bali:["᭐","᭑","᭒","᭓","᭔","᭕","᭖","᭗","᭘","᭙"],beng:["০","১","২","৩","৪","৫","৬","৭","৮","৯"],deva:["०","१","२","३","४","५","६","७","८","९"],fullwide:["0","1","2","3","4","5","6","7","8","9"],gujr:["૦","૧","૨","૩","૪","૫","૬","૭","૮","૯"],guru:["੦","੧","੨","੩","੪","੫","੬","੭","੮","੯"],hanidec:["〇","一","二","三","四","五","六","七","八","九"],khmr:["០","១","២","៣","៤","៥","៦","៧","៨","៩"],knda:["೦","೧","೨","೩","೪","೫","೬","೭","೮","೯"],laoo:["໐","໑","໒","໓","໔","໕","໖","໗","໘","໙"],latn:["0","1","2","3","4","5","6","7","8","9"],limb:["᥆","᥇","᥈","᥉","᥊","᥋","᥌","᥍","᥎","᥏"],mlym:["൦","൧","൨","൩","൪","൫","൬","൭","൮","൯"],mong:["᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"],mymr:["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],orya:["୦","୧","୨","୩","୪","୫","୬","୭","୮","୯"],tamldec:["௦","௧","௨","௩","௪","௫","௬","௭","௮","௯"],telu:["౦","౧","౨","౩","౪","౫","౬","౭","౮","౯"],thai:["๐","๑","๒","๓","๔","๕","๖","๗","๘","๙"],tibt:["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"]};Z(W.NumberFormat.prototype,"resolvedOptions",{configurable:!0,writable:!0,value:function(){var e,t=new A,n=["locale","numberingSystem","style","currency","currencyDisplay","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","useGrouping"],r=null!=this&&"object"==typeof this&&R(this);if(!r||!r["[[initializedNumberFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.");for(var i=0,a=n.length;a>i;i++)$.call(r,e="[["+n[i]+"]]")&&(t[n[i]]={value:r[e],writable:!0,configurable:!0,enumerable:!0});return Y({},t)}}),Z(W,"DateTimeFormat",{configurable:!0,writable:!0,value:T}),Z(T,"prototype",{writable:!1});var de={weekday:["narrow","short","long"],era:["narrow","short","long"],year:["2-digit","numeric"],month:["2-digit","numeric","narrow","short","long"],day:["2-digit","numeric"],hour:["2-digit","numeric"],minute:["2-digit","numeric"],second:["2-digit","numeric"],timeZoneName:["short","long"]};ie.DateTimeFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["ca","nu"],"[[localeData]]":{}},Z(W.DateTimeFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:re.call(L,ie.DateTimeFormat)}),Z(W.DateTimeFormat.prototype,"format",{configurable:!0,get:S}),Z(W.DateTimeFormat.prototype,"resolvedOptions",{writable:!0,configurable:!0,value:function(){var e,t=new A,n=["locale","calendar","numberingSystem","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"],r=null!=this&&"object"==typeof this&&R(this);if(!r||!r["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.");for(var i=0,a=n.length;a>i;i++)$.call(r,e="[["+n[i]+"]]")&&(t[n[i]]={value:r[e],writable:!0,configurable:!0,enumerable:!0});return Y({},t)}});var fe=W.__localeSensitiveProtos={Number:{},Date:{}};return fe.Number.toLocaleString=function(){if("[object Number]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a number for Number.prototype.toLocaleString()");return v(new d(arguments[0],arguments[1]),this)},fe.Date.toLocaleString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"any","all"),r=new T(t,n);return P(r,e)},fe.Date.toLocaleDateString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleDateString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"date","date"),r=new T(t,n);return P(r,e)},fe.Date.toLocaleTimeString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleTimeString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"time","time"),r=new T(t,n);return P(r,e)},Z(W,"__applyLocaleSensitivePrototypes",{writable:!0,configurable:!0,value:function(){Z(Number.prototype,"toLocaleString",{writable:!0,configurable:!0,value:fe.Number.toLocaleString});for(var e in fe.Date)$.call(fe.Date,e)&&Z(Date.prototype,e,{writable:!0,configurable:!0,value:fe.Date[e]})}}),Z(W,"__addLocaleData",{value:function(t){if(!e(t.locale))throw new Error("Object passed doesn't identify itself with a valid language tag");M(t,t.locale)}}),A.prototype=Y(null),D.prototype=Y(null),W})}).call(t,function(){return this}())},function(e,t,n){t.ActionMethods=n(69),t.ListenerMethods=n(70),t.PublisherMethods=n(71),t.StoreMethods=n(72),t.createAction=n(73),t.createStore=n(74),t.connect=n(75),t.connectFilter=n(76),t.ListenerMixin=n(77),t.listenTo=n(78),t.listenToMany=n(79);var r=n(80).staticJoinCreator;t.joinTrailing=t.all=r("last"),t.joinLeading=r("first"),t.joinStrict=r("strict"),t.joinConcat=r("all");var i=n(81);t.EventEmitter=i.EventEmitter,t.Promise=i.Promise,t.createActions=function(e){var n={};for(var r in e)if(e.hasOwnProperty(r)){var a=e[r],s=i.isObject(a)?r:a;n[s]=t.createAction(a)}return n},t.setEventEmitter=function(e){var r=n(81);t.EventEmitter=r.EventEmitter=e},t.setPromise=function(e){var r=n(81);t.Promise=r.Promise=e},t.setPromiseFactory=function(e){var t=n(81);t.createPromise=e},t.nextTick=function(e){var t=n(81);t.nextTick=e},t.__keep=n(82),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5")},function(e,t,n){e.exports={locale:"en-US",date:{ca:["gregory","buddhist","chinese","coptic","ethioaa","ethiopic","generic","hebrew","indian","islamic","japanese","persian","roc"],hourNo0:!0,hour12:!0,formats:[{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{weekday}, {month} {day}, {year}, {hour}:{minute}:{second}",pattern12:"{weekday}, {month} {day}, {year}, {hour}:{minute}:{second} {ampm}"},{weekday:"long",month:"long",day:"numeric",year:"numeric",pattern:"{weekday}, {month} {day}, {year}"},{month:"long",day:"numeric",year:"numeric",pattern:"{month} {day}, {year}"},{month:"numeric",day:"numeric",year:"numeric",pattern:"{month}/{day}/{year}"},{month:"numeric",year:"numeric",pattern:"{month}/{year}"},{month:"long",year:"numeric",pattern:"{month} {year}"},{month:"long",day:"numeric",pattern:"{month} {day}"},{month:"numeric",day:"numeric",pattern:"{month}/{day}"},{hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{hour}:{minute}:{second}",pattern12:"{hour}:{minute}:{second} {ampm}"},{hour:"numeric",minute:"2-digit",pattern:"{hour}:{minute}",pattern12:"{hour}:{minute} {ampm}"}],calendars:{buddhist:{eras:{"short":["BE"]}},chinese:{months:{"short":["Mo1","Mo2","Mo3","Mo4","Mo5","Mo6","Mo7","Mo8","Mo9","Mo10","Mo11","Mo12"],"long":["Month1","Month2","Month3","Month4","Month5","Month6","Month7","Month8","Month9","Month10","Month11","Month12"]}},coptic:{months:{"long":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},eras:{"short":["ERA0","ERA1"]}},ethiopic:{months:{"long":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},eras:{"short":["ERA0","ERA1"]}},ethioaa:{eras:{"short":["ERA0"]}},generic:{months:{"long":["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},eras:{"short":["ERA0","ERA1"]}},gregory:{months:{"short":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"long":["January","February","March","April","May","June","July","August","September","October","November","December"]},days:{narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],"short":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"long":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},eras:{narrow:["B","A"],"short":["BC","AD","BCE","CE"],"long":["Before Christ","Anno Domini","Before Common Era","Common Era"]},dayPeriods:{am:"AM",pm:"PM"}},hebrew:{months:{"long":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},eras:{"short":["AM"]}},indian:{months:{"long":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},eras:{"short":["Saka"]}},islamic:{months:{"short":["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],"long":["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},eras:{"short":["AH"]}},japanese:{eras:{narrow:["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchũ (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchũ (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","M","T","S","H"], -"short":["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchū (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchū (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","Meiji","Taishō","Shōwa","Heisei"]}},persian:{months:{"long":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},eras:{"short":["AP"]}},roc:{eras:{"short":["Before R.O.C.","Minguo"]}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"-{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"-{currency}{number}"},percent:{positivePattern:"{number}%",negativePattern:"-{number}%"}},symbols:{latn:{decimal:".",group:",",nan:"NaN",percent:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",THB:"฿",TWD:"NT$",USD:"$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}},function(e,t,n){e.exports={locale:"pt-BR",date:{ca:["gregory","buddhist","chinese","coptic","ethioaa","ethiopic","generic","hebrew","indian","islamic","japanese","persian","roc"],hourNo0:!0,hour12:!1,formats:[{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{weekday}, {day} de {month} de {year} {hour}:{minute}:{second}",pattern12:"{weekday}, {day} de {month} de {year} {hour}:{minute}:{second} {ampm}"},{weekday:"long",day:"numeric",month:"long",year:"numeric",pattern:"{weekday}, {day} de {month} de {year}"},{day:"numeric",month:"long",year:"numeric",pattern:"{day} de {month} de {year}"},{day:"2-digit",month:"2-digit",year:"numeric",pattern:"{day}/{month}/{year}"},{month:"2-digit",year:"numeric",pattern:"{month}/{year}"},{month:"long",year:"numeric",pattern:"{month} de {year}"},{day:"numeric",month:"long",pattern:"{day} de {month}"},{day:"numeric",month:"numeric",pattern:"{day}/{month}"},{hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{hour}:{minute}:{second}",pattern12:"{hour}:{minute}:{second} {ampm}"},{hour:"numeric",minute:"2-digit",pattern:"{hour}:{minute}",pattern12:"{hour}:{minute} {ampm}"}],calendars:{buddhist:{eras:{"short":["BE"]}},chinese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["1","2","3","4","5","6","7","8","9","10","11","12"],"long":["Mês 1","Mês 2","Mês 3","Mês 4","Mês 5","Mês 6","Mês 7","Mês 8","Mês 9","Mês 10","Mês 11","Mês 12"]}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],"short":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],"long":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},eras:{"short":["ERA0","ERA1"]}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],"short":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],"long":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},eras:{"short":["ERA0","ERA1"]}},ethioaa:{eras:{"short":["ERA0"]}},generic:{months:{"long":["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},eras:{"short":["ERA0","ERA1"]}},gregory:{months:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],"short":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],"long":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},days:{narrow:["dom","seg","ter","qua","qui","sex","sáb"],"short":["dom","seg","ter","qua","qui","sex","sáb"],"long":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},eras:{"short":["a.C.","d.C."],"long":["Antes de Cristo","Ano do Senhor"]},dayPeriods:{am:"AM",pm:"PM"}},hebrew:{months:{"short":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],"long":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},eras:{"short":["AM"]}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],"long":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},eras:{"short":["Saka"]}},islamic:{months:{"short":["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],"long":["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},eras:{"short":["AH"]}},japanese:{eras:{narrow:["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchũ (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchũ (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","M","T","S","H"],"short":["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchū (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchū (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","Meiji","Taishō","Shōwa","Heisei"]}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],"long":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},eras:{"short":["AP"]}},roc:{eras:{"short":["Antes de R.O.C.","R.O.C."]}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"-{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"-{currency}{number}"},percent:{positivePattern:"{number}%",negativePattern:"-{number}%"}},symbols:{latn:{decimal:",",group:".",nan:"NaN",percent:"%",infinity:"∞"}},currencies:{AUD:"AU$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",PTE:"Esc.",THB:"฿",TWD:"NT$",USD:"US$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}},function(e,t,n){},function(e,t,n){"use strict";function r(e){i["default"].__addLocaleData(e),a["default"].__addLocaleData(e)}t.__addLocaleData=r;var i=n(95),a=n(96),s=n(85),o=n(86),l=n(87),c=n(88),u=n(89),p=n(90),h=n(91),m=n(92);r(s["default"]),t.IntlMixin=o["default"],t.FormattedDate=l["default"],t.FormattedTime=c["default"],t.FormattedRelative=u["default"],t.FormattedNumber=p["default"],t.FormattedMessage=h["default"],t.FormattedHTMLMessage=m["default"]},function(e,t,n){e.exports={}},function(e,t,n){var r=n(81),i=n(80).instanceJoinCreator,a=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},s=function(e){var t={};for(var n in e){var i=e[n],o=a(i),l=s(o);t[n]=i;for(var c in l){var u=l[c];t[n+r.capitalize(c)]=u}}return t};e.exports={hasListener:function(e){for(var t,n,r,i=0;i<(this.subscriptions||[]).length;++i)for(r=[].concat(this.subscriptions[i].listenable),t=0;t=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,a){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,a),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var s=e.completed.listen(function(e){s(),o(),i(e)}),o=e.failed.listen(function(e){s(),o(),a(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){e.exports={}},function(e,t,n){var r=n(81),i=n(64),a=n(82),s={preEmit:1,shouldEmit:1},o=function(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i.ActionMethods)if(!s[t]&&i.PublisherMethods[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&i.PublisherMethods[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,c={};lt;t++)l.throwIf(this.validateListening(s[t]));for(t=0;u>t;t++)h.push(s[t].listen(a(t,p),this));return i(p),n={listenable:s},n.stop=r(n,h,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){var r=t.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e};t.extend=function(e){if(!r(e))return e;for(var t,n,i=1,a=arguments.length;a>i;i++){t=arguments[i];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s)}else e[n]=t[n]}return e},t.isFunction=function(e){return"function"==typeof e},t.EventEmitter=n(97),t.nextTick=function(e){setTimeout(e,0)},t.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.callbackName=function(e){return"on"+t.capitalize(e)},t.object=function(e,t){for(var n={},r=0;rr;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){e.exports=function(e,t,n){for(var r=0,i=e.length,a=3==arguments.length?n:e[r++];i>r;)a=t.call(null,a,e[r],++r,e);return a}},function(e,t,n){"use strict";t["default"]={locale:"en",pluralRuleFunction:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":3==a&&13!=s?"few":"other":1==e&&r?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago" -}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}}},function(e,t,n){"use strict";function r(e,t){if(!isFinite(e))throw new TypeError(t)}var i=n(98),a=n(95),s=n(96),o=n(104),l={locales:i["default"].PropTypes.oneOfType([i["default"].PropTypes.string,i["default"].PropTypes.array]),formats:i["default"].PropTypes.object,messages:i["default"].PropTypes.object};t["default"]={statics:{filterFormatOptions:function(e,t){return t||(t={}),(this.formatOptions||[]).reduce(function(n,r){return e.hasOwnProperty(r)?n[r]=e[r]:t.hasOwnProperty(r)&&(n[r]=t[r]),n},{})}},propTypes:l,contextTypes:l,childContextTypes:l,getNumberFormat:o["default"](Intl.NumberFormat),getDateTimeFormat:o["default"](Intl.DateTimeFormat),getMessageFormat:o["default"](a["default"]),getRelativeFormat:o["default"](s["default"]),getChildContext:function(){var e=this.context,t=this.props;return{locales:t.locales||e.locales,formats:t.formats||e.formats,messages:t.messages||e.messages}},formatDate:function(e,t){return e=new Date(e),r(e,"A date or timestamp must be provided to formatDate()"),this._format("date",e,t)},formatTime:function(e,t){return e=new Date(e),r(e,"A date or timestamp must be provided to formatTime()"),this._format("time",e,t)},formatRelative:function(e,t,n){return e=new Date(e),r(e,"A date or timestamp must be provided to formatRelative()"),this._format("relative",e,t,n)},formatNumber:function(e,t){return this._format("number",e,t)},formatMessage:function(e,t){var n=this.props.locales||this.context.locales,r=this.props.formats||this.context.formats;return"function"==typeof e?e(t):("string"==typeof e&&(e=this.getMessageFormat(e,n,r)),e.format(t))},getIntlMessage:function(e){var t,n=this.props.messages||this.context.messages,r=e.split(".");try{t=r.reduce(function(e,t){return e[t]},n)}finally{if(void 0===t)throw new ReferenceError("Could not find Intl message: "+e)}return t},getNamedFormat:function(e,t){var n=this.props.formats||this.context.formats,r=null;try{r=n[e][t]}finally{if(!r)throw new ReferenceError("No "+e+" format named: "+t)}return r},_format:function(e,t,n,r){var i=this.props.locales||this.context.locales;switch(n&&"string"==typeof n&&(n=this.getNamedFormat(e,n)),e){case"date":case"time":return this.getDateTimeFormat(i,n).format(t);case"number":return this.getNumberFormat(i,n).format(t);case"relative":return this.getRelativeFormat(i,n).format(t,r);default:throw new Error("Unrecognized format type: "+e)}}}},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedDate",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("date",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatDate(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedTime",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("time",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatTime(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedRelative",mixins:[i["default"]],statics:{formatOptions:["style","units"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired,now:r["default"].PropTypes.any},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("relative",n),s=a.filterFormatOptions(e,i),o=this.formatRelative(t,s,{now:e.now});return r["default"].DOM.span(null,o)}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedNumber",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("number",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatNumber(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedMessage",mixins:[i["default"]],propTypes:{tagName:r["default"].PropTypes.string,message:r["default"].PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var e=this.props,t=e.tagName,n=e.message,i=Math.floor(1099511627776*Math.random()).toString(16),a=new RegExp("(@__ELEMENT-"+i+"-\\d+__@)","g"),s={},o=function(){var e=0;return function(){return"@__ELEMENT-"+i+"-"+(e+=1)+"__@"}}(),l=Object.keys(e).reduce(function(t,n){var i,a=e[n];return r["default"].isValidElement(a)?(i=o(),t[n]=i,s[i]=a):t[n]=a,t},{}),c=this.formatMessage(n,l),u=c.split(a).filter(function(e){return!!e}).map(function(e){return s[e]||e}),p=[t,null].concat(u);return r["default"].createElement.apply(null,p)}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(99),a=n(86),s=r["default"].createClass({displayName:"FormattedHTMLMessage",mixins:[a["default"]],propTypes:{tagName:r["default"].PropTypes.string,message:r["default"].PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var e=this.props,t=e.tagName,n=e.message,a=Object.keys(e).reduce(function(t,n){var a=e[n];return"string"==typeof a?a=i["default"](a):r["default"].isValidElement(a)&&(a=r["default"].renderToStaticMarkup(a)),t[n]=a,t},{});return r["default"].DOM[t]({dangerouslySetInnerHTML:{__html:this.formatMessage(n,a)}})}});t["default"]=s},function(e,t,n){var r=n(81);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function i(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,i(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t,n){e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t,n){"use strict";var r=n(105)["default"];n(101),t=e.exports=r,t["default"]=t},function(e,t,n){"use strict";var r=n(103)["default"];n(102),t=e.exports=r,t["default"]=t},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}i.prototype._events=void 0,i.prototype.listeners=function(e){if(!this._events||!this._events[e])return[];if(this._events[e].fn)return[this._events[e].fn];for(var t=0,n=this._events[e].length,r=new Array(n);n>t;t++)r[t]=this._events[e][t].fn;return r},i.prototype.emit=function(e,t,n,r,i,a){if(!this._events||!this._events[e])return!1;var s,o,l=this._events[e],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(e,l.fn,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,i),!0;case 6:return l.fn.call(l.context,t,n,r,i,a),!0}for(o=1,s=new Array(c-1);c>o;o++)s[o-1]=arguments[o];l.fn.apply(l.context,s)}else{var u,p=l.length;for(o=0;p>o;o++)switch(l[o].once&&this.removeListener(e,l[o].fn,!0),c){case 1:l[o].fn.call(l[o].context);break;case 2:l[o].fn.call(l[o].context,t);break;case 3:l[o].fn.call(l[o].context,t,n);break;default:if(!s)for(u=1,s=new Array(c-1);c>u;u++)s[u-1]=arguments[u];l[o].fn.apply(l[o].context,s)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],i]:this._events[e].push(i):this._events[e]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],i]:this._events[e].push(i):this._events[e]=i,this},i.prototype.removeListener=function(e,t,n){if(!this._events||!this._events[e])return this;var r=this._events[e],i=[];if(t&&(r.fn&&(r.fn!==t||n&&!r.once)&&i.push(r),!r.fn))for(var a=0,s=r.length;s>a;a++)(r[a].fn!==t||n&&!r[a].once)&&i.push(r[a]);return i.length?this._events[e]=1===i.length?i[0]:i:delete this._events[e],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[e]:this._events={},this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.EventEmitter=i,i.EventEmitter2=i,i.EventEmitter3=i,e.exports=i},function(e,t,n){"use strict";t["default"]=React},function(e,t,n){"use strict";var r={"&":"&",">":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;t["default"]=function(e){return(""+e).replace(i,function(e){return r[e]})}},function(e,t,n){var r;(function(i,a){/*! Native Promise Only +!function(a,s){var o=s();r=o,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)),e.exports=o,a.Intl||(a.Intl=o,o.__applyLocaleSensitivePrototypes()),a.IntlPolyfill=o}("undefined"!=typeof a?a:this,function(){"use strict";function e(e){return z.test(e)?G.test(e)?!1:U.test(e)?!1:!0:!1}function t(e){var t,n;e=e.toLowerCase(),n=e.split("-");for(var r=1,i=n.length;i>r;r++)if(2===n[r].length)n[r]=n[r].toUpperCase();else if(4===n[r].length)n[r]=n[r].charAt(0).toUpperCase()+n[r].slice(1);else if(1===n[r].length&&"x"!=n[r])break;e=te.call(n,"-"),(t=e.match(H))&&t.length>1&&(t.sort(),e=e.replace(RegExp("(?:"+H.source+")+","i"),te.call(t,""))),$.call(pe.tags,e)&&(e=pe.tags[e]),n=e.split("-");for(var r=1,i=n.length;i>r;r++)$.call(pe.subtags,n[r])?n[r]=pe.subtags[n[r]]:$.call(pe.extLang,n[r])&&(n[r]=pe.extLang[n[r]][0],1===r&&pe.extLang[n[1]][1]===n[0]&&(n=V.call(n,r++),i-=1));return te.call(n,"-")}function n(){return B}function r(e){var t=String(e),n=K(t);return ce.test(n)===!1?!1:!0}function i(n){if(void 0===n)return new I;for(var r=new I,n="string"==typeof n?[n]:n,i=O(n),a=i.length,s=0;a>s;){var o=String(s),l=o in i;if(l){var c=i[o];if(null==c||"string"!=typeof c&&"object"!=typeof c)throw new TypeError("String or Object type expected");var u=String(c);if(!e(u))throw new RangeError("'"+u+"' is not a structurally valid language tag");u=t(u),-1===Z.call(r,u)&&ee.call(r,u)}s++}return r}function a(e,t){for(var n=t;;){if(Z.call(e,n)>-1)return n;var r=n.lastIndexOf("-");if(0>r)return;r>=2&&"-"==n.charAt(r-2)&&(r-=2),n=n.substring(0,r)}}function s(e,t){for(var r,i=0,s=t.length;s>i&&!r;){var o=t[i],l=String(o).replace(ue,""),r=a(e,l);i++}var c=new A;if(void 0!==r){if(c["[[locale]]"]=r,String(o)!==String(l)){var u=o.match(ue)[0],p=o.indexOf("-u-");c["[[extension]]"]=u,c["[[extensionIndex]]"]=p}}else c["[[locale]]"]=n();return c}function o(e,t){return s(e,t)}function l(e,t,n,r,i){if(0===e.length)throw new ReferenceError("No locale data has been provided for this object yet.");var a=n["[[localeMatcher]]"];if("lookup"===a)var l=s(e,t);else var l=o(e,t);var c=l["[[locale]]"];if($.call(l,"[[extension]]"))var u=l["[[extension]]"],p=l["[[extensionIndex]]"],h=String.prototype.split,m=h.call(u,"-"),d=m.length;var f=new A;f["[[dataLocale]]"]=c;for(var g="-u",y=0,v=r.length;v>y;){var b=r[y],_=i[c],T=_[b],k=T[0],E="",x=Z;if(void 0!==m){var w=x.call(m,b);if(-1!==w)if(d>w+1&&m[w+1].length>2){var N=m[w+1],P=x.call(T,N);if(-1!==P)var k=N,E="-"+b+"-"+k}else{var P=x(T,"true");if(-1!==P)var k="true"}}if($.call(n,"[["+b+"]]")){var S=n["[["+b+"]]"];-1!==x.call(T,S)&&S!==k&&(k=S,E="")}f["[["+b+"]]"]=k,g+=E,y++}if(g.length>2)var C=c.substring(0,p),M=c.substring(p),c=C+g+M;return f["[[locale]]"]=c,f}function c(e,t){for(var n=t.length,r=new I,i=0;n>i;){var s=t[i],o=String(s).replace(ue,""),l=a(e,o);void 0!==l&&ee.call(r,s),i++}var c=V.call(r);return c}function u(e,t){return c(e,t)}function p(e,t,n){if(void 0!==n){var n=new A(O(n)),r=n.localeMatcher;if(void 0!==r&&(r=String(r),"lookup"!==r&&"best fit"!==r))throw new RangeError('matcher should be "lookup" or "best fit"')}if(void 0===r||"best fit"===r)var i=u(e,t);else var i=c(e,t);for(var a in i)$.call(i,a)&&X(i,a,{writable:!1,configurable:!1,value:i[a]});return X(i,"length",{writable:!1}),i}function h(e,t,n,r,i){var a=e[t];if(void 0!==a){if(a="boolean"===n?Boolean(a):"string"===n?String(a):a,void 0!==r&&-1===Z.call(r,a))throw new RangeError("'"+a+"' is not an allowed value for `"+t+"`");return a}return i}function m(e,t,n,r,i){var a=e[t];if(void 0!==a){if(a=Number(a),isNaN(a)||n>a||a>r)throw new RangeError("Value is not a number or outside accepted range");return Math.floor(a)}return i}function d(){var e=arguments[0],t=arguments[1];return this&&this!==W?f(O(this),e,t):new W.NumberFormat(e,t)}function f(e,t,n){var a=R(e),s=D();if(a["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");X(e,"__getInternalProperties",{value:function(){return arguments[0]===ae?a:void 0}}),a["[[initializedIntlObject]]"]=!0;var o=i(t);n=void 0===n?{}:O(n);var c=new A,u=h(n,"localeMatcher","string",new I("lookup","best fit"),"best fit");c["[[localeMatcher]]"]=u;var p=ie.NumberFormat["[[localeData]]"],d=l(ie.NumberFormat["[[availableLocales]]"],o,c,ie.NumberFormat["[[relevantExtensionKeys]]"],p);a["[[locale]]"]=d["[[locale]]"],a["[[numberingSystem]]"]=d["[[nu]]"],a["[[dataLocale]]"]=d["[[dataLocale]]"];var f=d["[[dataLocale]]"],v=h(n,"style","string",new I("decimal","percent","currency"),"decimal");a["[[style]]"]=v;var b=h(n,"currency","string");if(void 0!==b&&!r(b))throw new RangeError("'"+b+"' is not a valid currency code");if("currency"===v&&void 0===b)throw new TypeError("Currency code is required when style is currency");if("currency"===v){b=b.toUpperCase(),a["[[currency]]"]=b;var _=g(b)}var T=h(n,"currencyDisplay","string",new I("code","symbol","name"),"symbol");"currency"===v&&(a["[[currencyDisplay]]"]=T);var k=m(n,"minimumIntegerDigits",1,21,1);a["[[minimumIntegerDigits]]"]=k;var E="currency"===v?_:0,x=m(n,"minimumFractionDigits",0,20,E);a["[[minimumFractionDigits]]"]=x;var w="currency"===v?Math.max(x,_):"percent"===v?Math.max(x,0):Math.max(x,3),N=m(n,"maximumFractionDigits",x,20,w);a["[[maximumFractionDigits]]"]=N;var P=n.minimumSignificantDigits,S=n.maximumSignificantDigits;(void 0!==P||void 0!==S)&&(P=m(n,"minimumSignificantDigits",1,21,1),S=m(n,"maximumSignificantDigits",P,21,21),a["[[minimumSignificantDigits]]"]=P,a["[[maximumSignificantDigits]]"]=S);var C=h(n,"useGrouping","boolean",void 0,!0);a["[[useGrouping]]"]=C;var M=p[f],j=M.patterns,L=j[v];return a["[[positivePattern]]"]=L.positivePattern,a["[[negativePattern]]"]=L.negativePattern,a["[[boundFormat]]"]=void 0,a["[[initializedNumberFormat]]"]=!0,J&&(e.format=y.call(e)),s.exp.test(s.input),e}function g(e){return void 0!==he[e]?he[e]:2}function y(){var e=null!=this&&"object"==typeof this&&R(this);if(!e||!e["[[initializedNumberFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.NumberFormat object.");if(void 0===e["[[boundFormat]]"]){var t=function(e){return v(this,Number(e))},n=re.call(t,this);e["[[boundFormat]]"]=n}return e["[[boundFormat]]"]}function v(e,t){var n,r=D(),i=R(e),a=i["[[dataLocale]]"],s=i["[[numberingSystem]]"],o=ie.NumberFormat["[[localeData]]"][a],l=o.symbols[s]||o.symbols.latn,c=!1;if(isFinite(t)===!1)isNaN(t)?n=l.nan:(n=l.infinity,0>t&&(c=!0));else{if(0>t&&(c=!0,t=-t),"percent"===i["[[style]]"]&&(t*=100),n=$.call(i,"[[minimumSignificantDigits]]")&&$.call(i,"[[maximumSignificantDigits]]")?b(t,i["[[minimumSignificantDigits]]"],i["[[maximumSignificantDigits]]"]):_(t,i["[[minimumIntegerDigits]]"],i["[[minimumFractionDigits]]"],i["[[maximumFractionDigits]]"]),me[s]){var u=me[i["[[numberingSystem]]"]];n=String(n).replace(/\d/g,function(e){return u[e]})}else n=String(n);if(n=n.replace(/\./g,l.decimal),i["[[useGrouping]]"]===!0){var p=n.split(l.decimal),h=p[0],m=o.patterns.primaryGroupSize||3,d=o.patterns.secondaryGroupSize||m;if(h.length>m){var f=new I,g=h.length-m,y=g%d,v=h.slice(0,y);for(v.length&&ee.call(f,v);g>y;)ee.call(f,h.slice(y,y+d)),y+=d;ee.call(f,h.slice(g)),p[0]=te.call(f,l.group)}n=te.call(p,l.decimal)}}var T=i[c===!0?"[[negativePattern]]":"[[positivePattern]]"];if(T=T.replace("{number}",n),"currency"===i["[[style]]"]){var k,E=i["[[currency]]"],x=o.currencies[E];switch(i["[[currencyDisplay]]"]){case"symbol":k=x||E;break;default:case"code":case"name":k=E}T=T.replace("{currency}",k)}return r.exp.test(r.input),T}function b(e,t,n){var r=n;if(0===e)var i=te.call(Array(r+1),"0"),a=0;else var a=j(Math.abs(e)),s=Math.round(Math.exp(Math.abs(a-r+1)*Math.LN10)),i=String(Math.round(0>a-r+1?e*s:e/s));if(a>=r)return i+te.call(Array(a-r+1+1),"0");if(a===r-1)return i;if(a>=0?i=i.slice(0,a+1)+"."+i.slice(a+1):0>a&&(i="0."+te.call(Array(-(a+1)+1),"0")+i),i.indexOf(".")>=0&&n>t){for(var o=n-t;o>0&&"0"===i.charAt(i.length-1);)i=i.slice(0,-1),o--;"."===i.charAt(i.length-1)&&(i=i.slice(0,-1))}return i}function _(e,t,n,r){var i,a=Number.prototype.toFixed.call(e,r),s=a.split(".")[0].length,o=r-n,l=(i=a.indexOf("e"))>-1?a.slice(i+1):0;for(l&&(a=a.slice(0,i).replace(".",""),a+=te.call(Array(l-(a.length-1)+1),"0")+"."+te.call(Array(r+1),"0"),s=a.length);o>0&&"0"===a.slice(-1);)a=a.slice(0,-1),o--;if("."===a.slice(-1)&&(a=a.slice(0,-1)),t>s)var c=te.call(Array(t-s+1),"0");return(c?c:"")+a}function T(){var e=arguments[0],t=arguments[1];return this&&this!==W?k(O(this),e,t):new W.DateTimeFormat(e,t)}function k(e,t,n){var r=R(e),a=D();if(r["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");X(e,"__getInternalProperties",{value:function(){return arguments[0]===ae?r:void 0}}),r["[[initializedIntlObject]]"]=!0;var s=i(t),n=E(n,"any","date"),o=new A;_=h(n,"localeMatcher","string",new I("lookup","best fit"),"best fit"),o["[[localeMatcher]]"]=_;var c=ie.DateTimeFormat,u=c["[[localeData]]"],p=l(c["[[availableLocales]]"],s,o,c["[[relevantExtensionKeys]]"],u);r["[[locale]]"]=p["[[locale]]"],r["[[calendar]]"]=p["[[ca]]"],r["[[numberingSystem]]"]=p["[[nu]]"],r["[[dataLocale]]"]=p["[[dataLocale]]"];var m=p["[[dataLocale]]"],d=n.timeZone;if(void 0!==d&&(d=K(d),"UTC"!==d))throw new RangeError("timeZone is not supported.");r["[[timeZone]]"]=d,o=new A;for(var f in de)if($.call(de,f)){var g=h(n,f,"string",de[f]);o["[["+f+"]]"]=g}var y,v=u[m],b=v.formats,_=h(n,"formatMatcher","string",new I("basic","best fit"),"best fit");y="basic"===_?x(o,b):N(o,b);for(var f in de)if($.call(de,f)&&$.call(y,f)){var T=y[f];r["[["+f+"]]"]=T}var k,w=h(n,"hour12","boolean");if(r["[[hour]]"])if(w=void 0===w?v.hour12:w,r["[[hour12]]"]=w,w===!0){var S=v.hourNo0;r["[[hourNo0]]"]=S,k=y.pattern12}else k=y.pattern;else k=y.pattern;return r["[[pattern]]"]=k,r["[[boundFormat]]"]=void 0,r["[[initializedDateTimeFormat]]"]=!0,J&&(e.format=P.call(e)),a.exp.test(a.input),e}function E(e,t,n){if(void 0===e)e=null;else{var r=O(e);e=new A;for(var i in r)e[i]=r[i]}var a=Y,e=a(e),s=!0;return("date"===t||"any"===t)&&(void 0!==e.weekday||void 0!==e.year||void 0!==e.month||void 0!==e.day)&&(s=!1),("time"===t||"any"===t)&&(void 0!==e.hour||void 0!==e.minute||void 0!==e.second)&&(s=!1),!s||"date"!==n&&"all"!==n||(e.year=e.month=e.day="numeric"),!s||"time"!==n&&"all"!==n||(e.hour=e.minute=e.second="numeric"),e}function x(e,t){return w(e,t)}function w(e,t,n){for(var r,i=8,a=120,s=20,o=8,l=6,c=6,u=3,p=-(1/0),h=0,m=t.length;m>h;){var d=t[h],f=0;for(var g in de)if($.call(de,g)){var y=e["[["+g+"]]"],v=$.call(d,g)?d[g]:void 0;if(void 0===y&&void 0!==v)f-=s;else if(void 0!==y&&void 0===v)f-=a;else{var b=["2-digit","numeric","narrow","short","long"],_=Z.call(b,y),T=Z.call(b,v),k=Math.max(Math.min(T-_,2),-2);!n||("numeric"!==y&&"2-digit"!==y||"numeric"===v||"2-digit"===v)&&("numeric"===y||"2-digit"===y||"2-digit"!==v&&"numeric"!==v)||(f-=i),2===k?f-=l:1===k?f-=u:-1===k?f-=c:-2===k&&(f-=o)}}f>p&&(p=f,r=d),h++}return r}function N(e,t){return w(e,t,!0)}function P(){var e=null!=this&&"object"==typeof this&&R(this);if(!e||!e["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.DateTimeFormat object.");if(void 0===e["[[boundFormat]]"]){var t=function(){var e=Number(0===arguments.length?Date.now():arguments[0]);return S(this,e)},n=re.call(t,this);e["[[boundFormat]]"]=n}return e["[[boundFormat]]"]}function S(e,t){if(!isFinite(t))throw new RangeError("Invalid valid date passed to format");var n=e.__getInternalProperties(ae),r=D(),i=n["[[locale]]"],a=new W.NumberFormat([i],{useGrouping:!1}),s=new W.NumberFormat([i],{minimumIntegerDigits:2,useGrouping:!1}),o=C(t,n["[[calendar]]"],n["[[timeZone]]"]),l=n["[[pattern]]"],c=n["[[dataLocale]]"],u=ie.DateTimeFormat["[[localeData]]"][c].calendars,p=n["[[calendar]]"];for(var h in de)if($.call(n,"[["+h+"]]")){var m,d,f=n["[["+h+"]]"],g=o["[["+h+"]]"];if("year"===h&&0>=g?g=1-g:"month"===h?g++:"hour"===h&&n["[[hour12]]"]===!0&&(g%=12,m=g!==o["[["+h+"]]"],0===g&&n["[[hourNo0]]"]===!0&&(g=12)),"numeric"===f)d=v(a,g);else if("2-digit"===f)d=v(s,g),d.length>2&&(d=d.slice(-2));else if(f in se)switch(h){case"month":d=F(u,p,"months",f,o["[["+h+"]]"]);break;case"weekday":try{d=F(u,p,"days",f,o["[["+h+"]]"])}catch(y){throw new Error("Could not find weekday data for locale "+i)}break;case"timeZoneName":d="";break;default:d=o["[["+h+"]]"]}l=l.replace("{"+h+"}",d)}return n["[[hour12]]"]===!0&&(d=F(u,p,"dayPeriods",m?"pm":"am"),l=l.replace("{ampm}",d)),r.exp.test(r.input),l}function C(e,t,n){var r=new Date(e),i="get"+(n||"");return new A({"[[weekday]]":r[i+"Day"](),"[[era]]":+(r[i+"FullYear"]()>=0),"[[year]]":r[i+"FullYear"](),"[[month]]":r[i+"Month"](),"[[day]]":r[i+"Date"](),"[[hour]]":r[i+"Hours"](),"[[minute]]":r[i+"Minutes"](),"[[second]]":r[i+"Seconds"](),"[[inDST]]":!1})}function M(e,t){if(!e.number)throw new Error("Object passed doesn't contain locale data for Intl.NumberFormat");var n,r=[t],i=t.split("-");for(i.length>2&&4==i[1].length&&ee.call(r,i[0]+"-"+i[2]);n=ne.call(r);)ee.call(ie.NumberFormat["[[availableLocales]]"],n),ie.NumberFormat["[[localeData]]"][n]=e.number,e.date&&(e.date.nu=e.number.nu,ee.call(ie.DateTimeFormat["[[availableLocales]]"],n),ie.DateTimeFormat["[[localeData]]"][n]=e.date);void 0===B&&(B=t),oe||(f(W.NumberFormat.prototype),oe=!0),e.date&&!le&&(k(W.DateTimeFormat.prototype),le=!0)}function j(e){if("function"==typeof Math.log10)return Math.floor(Math.log10(e));var t=Math.round(Math.log(e)*Math.LOG10E);return t-(Number("1e"+t)>e)}function L(e){if(!$.call(this,"[[availableLocales]]"))throw new TypeError("supportedLocalesOf() is not a constructor");var t=D(),n=arguments[1],r=this["[[availableLocales]]"],a=i(e);return t.exp.test(t.input),p(r,a,n)}function F(e,t,n,r,i){var a=e[t]&&e[t][n]?e[t][n]:e.gregory[n],s={narrow:["short","long"],"short":["long","narrow"],"long":["short","narrow"]},o=$.call(a,r)?a[r]:$.call(a,s[r][0])?a[s[r][0]]:a[s[r][1]];return null!=i?o[i]:o}function A(e){for(var t in e)(e instanceof A||$.call(e,t))&&X(this,t,{value:e[t],enumerable:!0,writable:!0,configurable:!0})}function I(){X(this,"length",{writable:!0,value:0}),arguments.length&&ee.apply(this,V.call(arguments))}function D(){for(var e=/[.?*+^$[\]\\(){}|-]/g,t=RegExp.lastMatch,n=RegExp.multiline?"m":"",r={input:RegExp.input},i=new I,a=!1,s={},o=1;9>=o;o++)a=(s["$"+o]=RegExp["$"+o])||a;if(t=t.replace(e,"\\$&"),a)for(var o=1;9>=o;o++){var l=s["$"+o];l?(l=l.replace(e,"\\$&"),t=t.replace(l,"("+l+")")):t="()"+t,ee.call(i,t.slice(0,t.indexOf("(")+1)),t=t.slice(t.indexOf("(")+1)}return r.exp=new RegExp(te.call(i,"")+t,n),r}function K(e){for(var t=e.length;t--;){var n=e.charAt(t);n>="a"&&"z">=n&&(e=e.slice(0,t)+n.toUpperCase()+e.slice(t+1))}return e}function O(e){if(null==e)throw new TypeError("Cannot convert null or undefined to object");return Object(e)}function R(e){return $.call(e,"__getInternalProperties")?e.__getInternalProperties(ae):Y(null)}var B,z,H,G,U,W={},q=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),J=!q&&!Object.prototype.__defineGetter__,$=Object.prototype.hasOwnProperty,X=q?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!$.call(e,t)||"value"in n)&&(e[t]=n.value)},Z=Array.prototype.indexOf||function(e){var t=this;if(!t.length)return-1;for(var n=arguments[1]||0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},Y=Object.create||function(e,t){function n(){}var r;n.prototype=e,r=new n;for(var i in t)$.call(t,i)&&X(r,i,t[i]);return r},V=Array.prototype.slice,Q=Array.prototype.concat,ee=Array.prototype.push,te=Array.prototype.join,ne=Array.prototype.shift,re=(Array.prototype.unshift,Function.prototype.bind||function(e){var t=this,n=V.call(arguments,1);return 1===t.length?function(r){return t.apply(e,Q.call(n,V.call(arguments)))}:function(){return t.apply(e,Q.call(n,V.call(arguments)))}}),ie=Y(null),ae=Math.random(),se=Y(null,{narrow:{},"short":{},"long":{}}),oe=!1,le=!1,ce=/^[A-Z]{3}$/,ue=/-u(?:-[0-9a-z]{2,8})+/gi,pe={tags:{"art-lojban":"jbo","i-ami":"ami","i-bnn":"bnn","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","no-bok":"nb","no-nyn":"nn","sgn-BE-FR":"sfb","sgn-BE-NL":"vgt","sgn-CH-DE":"sgg","zh-guoyu":"cmn","zh-hakka":"hak","zh-min-nan":"nan","zh-xiang":"hsn","sgn-BR":"bzs","sgn-CO":"csn","sgn-DE":"gsg","sgn-DK":"dsl","sgn-ES":"ssp","sgn-FR":"fsl","sgn-GB":"bfi","sgn-GR":"gss","sgn-IE":"isg","sgn-IT":"ise","sgn-JP":"jsl","sgn-MX":"mfs","sgn-NI":"ncs","sgn-NL":"dse","sgn-NO":"nsl","sgn-PT":"psr","sgn-SE":"swl","sgn-US":"ase","sgn-ZA":"sfs","zh-cmn":"cmn","zh-cmn-Hans":"cmn-Hans","zh-cmn-Hant":"cmn-Hant","zh-gan":"gan","zh-wuu":"wuu","zh-yue":"yue"},subtags:{BU:"MM",DD:"DE",FX:"FR",TP:"TL",YD:"YE",ZR:"CD",heploc:"alalc97","in":"id",iw:"he",ji:"yi",jw:"jv",mo:"ro",ayx:"nun",bjd:"drl",ccq:"rki",cjr:"mom",cka:"cmr",cmk:"xch",drh:"khk",drw:"prs",gav:"dev",hrr:"jal",ibi:"opa",kgh:"kml",lcq:"ppr",mst:"mry",myt:"mry",sca:"hle",tie:"ras",tkk:"twm",tlw:"weo",tnf:"prs",ybd:"rki",yma:"lrr"},extLang:{aao:["aao","ar"],abh:["abh","ar"],abv:["abv","ar"],acm:["acm","ar"],acq:["acq","ar"],acw:["acw","ar"],acx:["acx","ar"],acy:["acy","ar"],adf:["adf","ar"],ads:["ads","sgn"],aeb:["aeb","ar"],aec:["aec","ar"],aed:["aed","sgn"],aen:["aen","sgn"],afb:["afb","ar"],afg:["afg","sgn"],ajp:["ajp","ar"],apc:["apc","ar"],apd:["apd","ar"],arb:["arb","ar"],arq:["arq","ar"],ars:["ars","ar"],ary:["ary","ar"],arz:["arz","ar"],ase:["ase","sgn"],asf:["asf","sgn"],asp:["asp","sgn"],asq:["asq","sgn"],asw:["asw","sgn"],auz:["auz","ar"],avl:["avl","ar"],ayh:["ayh","ar"],ayl:["ayl","ar"],ayn:["ayn","ar"],ayp:["ayp","ar"],bbz:["bbz","ar"],bfi:["bfi","sgn"],bfk:["bfk","sgn"],bjn:["bjn","ms"],bog:["bog","sgn"],bqn:["bqn","sgn"],bqy:["bqy","sgn"],btj:["btj","ms"],bve:["bve","ms"],bvl:["bvl","sgn"],bvu:["bvu","ms"],bzs:["bzs","sgn"],cdo:["cdo","zh"],cds:["cds","sgn"],cjy:["cjy","zh"],cmn:["cmn","zh"],coa:["coa","ms"],cpx:["cpx","zh"],csc:["csc","sgn"],csd:["csd","sgn"],cse:["cse","sgn"],csf:["csf","sgn"],csg:["csg","sgn"],csl:["csl","sgn"],csn:["csn","sgn"],csq:["csq","sgn"],csr:["csr","sgn"],czh:["czh","zh"],czo:["czo","zh"],doq:["doq","sgn"],dse:["dse","sgn"],dsl:["dsl","sgn"],dup:["dup","ms"],ecs:["ecs","sgn"],esl:["esl","sgn"],esn:["esn","sgn"],eso:["eso","sgn"],eth:["eth","sgn"],fcs:["fcs","sgn"],fse:["fse","sgn"],fsl:["fsl","sgn"],fss:["fss","sgn"],gan:["gan","zh"],gds:["gds","sgn"],gom:["gom","kok"],gse:["gse","sgn"],gsg:["gsg","sgn"],gsm:["gsm","sgn"],gss:["gss","sgn"],gus:["gus","sgn"],hab:["hab","sgn"],haf:["haf","sgn"],hak:["hak","zh"],hds:["hds","sgn"],hji:["hji","ms"],hks:["hks","sgn"],hos:["hos","sgn"],hps:["hps","sgn"],hsh:["hsh","sgn"],hsl:["hsl","sgn"],hsn:["hsn","zh"],icl:["icl","sgn"],ils:["ils","sgn"],inl:["inl","sgn"],ins:["ins","sgn"],ise:["ise","sgn"],isg:["isg","sgn"],isr:["isr","sgn"],jak:["jak","ms"],jax:["jax","ms"],jcs:["jcs","sgn"],jhs:["jhs","sgn"],jls:["jls","sgn"],jos:["jos","sgn"],jsl:["jsl","sgn"],jus:["jus","sgn"],kgi:["kgi","sgn"],knn:["knn","kok"],kvb:["kvb","ms"],kvk:["kvk","sgn"],kvr:["kvr","ms"],kxd:["kxd","ms"],lbs:["lbs","sgn"],lce:["lce","ms"],lcf:["lcf","ms"],liw:["liw","ms"],lls:["lls","sgn"],lsg:["lsg","sgn"],lsl:["lsl","sgn"],lso:["lso","sgn"],lsp:["lsp","sgn"],lst:["lst","sgn"],lsy:["lsy","sgn"],ltg:["ltg","lv"],lvs:["lvs","lv"],lzh:["lzh","zh"],max:["max","ms"],mdl:["mdl","sgn"],meo:["meo","ms"],mfa:["mfa","ms"],mfb:["mfb","ms"],mfs:["mfs","sgn"],min:["min","ms"],mnp:["mnp","zh"],mqg:["mqg","ms"],mre:["mre","sgn"],msd:["msd","sgn"],msi:["msi","ms"],msr:["msr","sgn"],mui:["mui","ms"],mzc:["mzc","sgn"],mzg:["mzg","sgn"],mzy:["mzy","sgn"],nan:["nan","zh"],nbs:["nbs","sgn"],ncs:["ncs","sgn"],nsi:["nsi","sgn"],nsl:["nsl","sgn"],nsp:["nsp","sgn"],nsr:["nsr","sgn"],nzs:["nzs","sgn"],okl:["okl","sgn"],orn:["orn","ms"],ors:["ors","ms"],pel:["pel","ms"],pga:["pga","ar"],pks:["pks","sgn"],prl:["prl","sgn"],prz:["prz","sgn"],psc:["psc","sgn"],psd:["psd","sgn"],pse:["pse","ms"],psg:["psg","sgn"],psl:["psl","sgn"],pso:["pso","sgn"],psp:["psp","sgn"],psr:["psr","sgn"],pys:["pys","sgn"],rms:["rms","sgn"],rsi:["rsi","sgn"],rsl:["rsl","sgn"],sdl:["sdl","sgn"],sfb:["sfb","sgn"],sfs:["sfs","sgn"],sgg:["sgg","sgn"],sgx:["sgx","sgn"],shu:["shu","ar"],slf:["slf","sgn"],sls:["sls","sgn"],sqk:["sqk","sgn"],sqs:["sqs","sgn"],ssh:["ssh","ar"],ssp:["ssp","sgn"],ssr:["ssr","sgn"],svk:["svk","sgn"],swc:["swc","sw"],swh:["swh","sw"],swl:["swl","sgn"],syy:["syy","sgn"],tmw:["tmw","ms"],tse:["tse","sgn"],tsm:["tsm","sgn"],tsq:["tsq","sgn"],tss:["tss","sgn"],tsy:["tsy","sgn"],tza:["tza","sgn"],ugn:["ugn","sgn"],ugy:["ugy","sgn"],ukl:["ukl","sgn"],uks:["uks","sgn"],urk:["urk","ms"],uzn:["uzn","uz"],uzs:["uzs","uz"],vgt:["vgt","sgn"],vkk:["vkk","ms"],vkt:["vkt","ms"],vsi:["vsi","sgn"],vsl:["vsl","sgn"],vsv:["vsv","sgn"],wuu:["wuu","zh"],xki:["xki","sgn"],xml:["xml","sgn"],xmm:["xmm","ms"],xms:["xms","sgn"],yds:["yds","sgn"],ysl:["ysl","sgn"],yue:["yue","zh"],zib:["zib","sgn"],zlm:["zlm","ms"],zmi:["zmi","ms"],zsl:["zsl","sgn"],zsm:["zsm","ms"]}},he={BHD:3,BYR:0,XOF:0,BIF:0,XAF:0,CLF:0,CLP:0,KMF:0,DJF:0,XPF:0,GNF:0,ISK:0,IQD:3,JPY:0,JOD:3,KRW:0,KWD:3,LYD:3,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,VUV:0,VND:0};!function(){var e="[a-z]{3}(?:-[a-z]{3}){0,2}",t="(?:[a-z]{2,3}(?:-"+e+")?|[a-z]{4}|[a-z]{5,8})",n="[a-z]{4}",r="(?:[a-z]{2}|\\d{3})",i="(?:[a-z0-9]{5,8}|\\d[a-z0-9]{3})",a="[0-9a-wy-z]",s=a+"(?:-[a-z0-9]{2,8})+",o="x(?:-[a-z0-9]{1,8})+",l="(?:en-GB-oed|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)|sgn-(?:BE-FR|BE-NL|CH-DE))",c="(?:art-lojban|cel-gaulish|no-bok|no-nyn|zh-(?:guoyu|hakka|min|min-nan|xiang))",u="(?:"+l+"|"+c+")",p=t+"(?:-"+n+")?(?:-"+r+")?(?:-"+i+")*(?:-"+s+")*(?:-"+o+")?";z=RegExp("^(?:"+p+"|"+o+"|"+u+")$","i"),G=RegExp("^(?!x).*?-("+i+")-(?:\\w{4,8}-(?!x-))*\\1\\b","i"),U=RegExp("^(?!x).*?-("+a+")-(?:\\w+-(?!x-))*\\1\\b","i"),H=RegExp("-"+s,"ig")}(),X(W,"NumberFormat",{configurable:!0,writable:!0,value:d}),X(W.NumberFormat,"prototype",{writable:!1}),ie.NumberFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["nu"],"[[localeData]]":{}},X(W.NumberFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:re.call(L,ie.NumberFormat)}),X(W.NumberFormat.prototype,"format",{configurable:!0,get:y});var me={arab:["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],arabext:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],bali:["᭐","᭑","᭒","᭓","᭔","᭕","᭖","᭗","᭘","᭙"],beng:["০","১","২","৩","৪","৫","৬","৭","৮","৯"],deva:["०","१","२","३","४","५","६","७","८","९"],fullwide:["0","1","2","3","4","5","6","7","8","9"],gujr:["૦","૧","૨","૩","૪","૫","૬","૭","૮","૯"],guru:["੦","੧","੨","੩","੪","੫","੬","੭","੮","੯"],hanidec:["〇","一","二","三","四","五","六","七","八","九"],khmr:["០","១","២","៣","៤","៥","៦","៧","៨","៩"],knda:["೦","೧","೨","೩","೪","೫","೬","೭","೮","೯"],laoo:["໐","໑","໒","໓","໔","໕","໖","໗","໘","໙"],latn:["0","1","2","3","4","5","6","7","8","9"],limb:["᥆","᥇","᥈","᥉","᥊","᥋","᥌","᥍","᥎","᥏"],mlym:["൦","൧","൨","൩","൪","൫","൬","൭","൮","൯"],mong:["᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"],mymr:["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],orya:["୦","୧","୨","୩","୪","୫","୬","୭","୮","୯"],tamldec:["௦","௧","௨","௩","௪","௫","௬","௭","௮","௯"],telu:["౦","౧","౨","౩","౪","౫","౬","౭","౮","౯"],thai:["๐","๑","๒","๓","๔","๕","๖","๗","๘","๙"],tibt:["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"]};X(W.NumberFormat.prototype,"resolvedOptions",{configurable:!0,writable:!0,value:function(){var e,t=new A,n=["locale","numberingSystem","style","currency","currencyDisplay","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","useGrouping"],r=null!=this&&"object"==typeof this&&R(this);if(!r||!r["[[initializedNumberFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.");for(var i=0,a=n.length;a>i;i++)$.call(r,e="[["+n[i]+"]]")&&(t[n[i]]={value:r[e],writable:!0,configurable:!0,enumerable:!0});return Y({},t)}}),X(W,"DateTimeFormat",{configurable:!0,writable:!0,value:T}),X(T,"prototype",{writable:!1});var de={weekday:["narrow","short","long"],era:["narrow","short","long"],year:["2-digit","numeric"],month:["2-digit","numeric","narrow","short","long"],day:["2-digit","numeric"],hour:["2-digit","numeric"],minute:["2-digit","numeric"],second:["2-digit","numeric"],timeZoneName:["short","long"]};ie.DateTimeFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["ca","nu"],"[[localeData]]":{}},X(W.DateTimeFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:re.call(L,ie.DateTimeFormat)}),X(W.DateTimeFormat.prototype,"format",{configurable:!0,get:P}),X(W.DateTimeFormat.prototype,"resolvedOptions",{writable:!0,configurable:!0,value:function(){var e,t=new A,n=["locale","calendar","numberingSystem","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"],r=null!=this&&"object"==typeof this&&R(this);if(!r||!r["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.");for(var i=0,a=n.length;a>i;i++)$.call(r,e="[["+n[i]+"]]")&&(t[n[i]]={value:r[e],writable:!0,configurable:!0,enumerable:!0});return Y({},t)}});var fe=W.__localeSensitiveProtos={Number:{},Date:{}};return fe.Number.toLocaleString=function(){if("[object Number]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a number for Number.prototype.toLocaleString()");return v(new d(arguments[0],arguments[1]),this)},fe.Date.toLocaleString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"any","all"),r=new T(t,n);return S(r,e)},fe.Date.toLocaleDateString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleDateString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"date","date"),r=new T(t,n);return S(r,e)},fe.Date.toLocaleTimeString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleTimeString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"time","time"),r=new T(t,n);return S(r,e)},X(W,"__applyLocaleSensitivePrototypes",{writable:!0,configurable:!0,value:function(){X(Number.prototype,"toLocaleString",{writable:!0,configurable:!0,value:fe.Number.toLocaleString});for(var e in fe.Date)$.call(fe.Date,e)&&X(Date.prototype,e,{writable:!0,configurable:!0,value:fe.Date[e]})}}),X(W,"__addLocaleData",{value:function(t){if(!e(t.locale))throw new Error("Object passed doesn't identify itself with a valid language tag");M(t,t.locale)}}),A.prototype=Y(null),I.prototype=Y(null),W})}).call(t,function(){return this}())},function(e,t,n){e.exports={locale:"en-US",date:{ca:["gregory","buddhist","chinese","coptic","ethioaa","ethiopic","generic","hebrew","indian","islamic","japanese","persian","roc"],hourNo0:!0,hour12:!0,formats:[{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{weekday}, {month} {day}, {year}, {hour}:{minute}:{second}",pattern12:"{weekday}, {month} {day}, {year}, {hour}:{minute}:{second} {ampm}"},{weekday:"long",month:"long",day:"numeric",year:"numeric",pattern:"{weekday}, {month} {day}, {year}"},{month:"long",day:"numeric",year:"numeric",pattern:"{month} {day}, {year}"},{month:"numeric",day:"numeric",year:"numeric",pattern:"{month}/{day}/{year}"},{month:"numeric",year:"numeric",pattern:"{month}/{year}"},{month:"long",year:"numeric",pattern:"{month} {year}"},{month:"long",day:"numeric",pattern:"{month} {day}"},{month:"numeric",day:"numeric",pattern:"{month}/{day}"},{hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{hour}:{minute}:{second}",pattern12:"{hour}:{minute}:{second} {ampm}"},{hour:"numeric",minute:"2-digit",pattern:"{hour}:{minute}",pattern12:"{hour}:{minute} {ampm}"}],calendars:{buddhist:{eras:{"short":["BE"]}},chinese:{months:{"short":["Mo1","Mo2","Mo3","Mo4","Mo5","Mo6","Mo7","Mo8","Mo9","Mo10","Mo11","Mo12"],"long":["Month1","Month2","Month3","Month4","Month5","Month6","Month7","Month8","Month9","Month10","Month11","Month12"]}},coptic:{months:{"long":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},eras:{"short":["ERA0","ERA1"]}},ethiopic:{months:{"long":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},eras:{"short":["ERA0","ERA1"]}},ethioaa:{eras:{"short":["ERA0"]}},generic:{months:{"long":["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},eras:{"short":["ERA0","ERA1"]}},gregory:{months:{"short":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"long":["January","February","March","April","May","June","July","August","September","October","November","December"]},days:{narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],"short":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"long":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},eras:{narrow:["B","A"],"short":["BC","AD","BCE","CE"],"long":["Before Christ","Anno Domini","Before Common Era","Common Era"]},dayPeriods:{am:"AM",pm:"PM"}},hebrew:{months:{"long":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},eras:{"short":["AM"]}},indian:{months:{"long":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},eras:{"short":["Saka"]}},islamic:{months:{"short":["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],"long":["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},eras:{"short":["AH"]}},japanese:{eras:{narrow:["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchũ (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchũ (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","M","T","S","H"], +"short":["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchū (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchū (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","Meiji","Taishō","Shōwa","Heisei"]}},persian:{months:{"long":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},eras:{"short":["AP"]}},roc:{eras:{"short":["Before R.O.C.","Minguo"]}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"-{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"-{currency}{number}"},percent:{positivePattern:"{number}%",negativePattern:"-{number}%"}},symbols:{latn:{decimal:".",group:",",nan:"NaN",percent:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",THB:"฿",TWD:"NT$",USD:"$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}},function(e,t,n){e.exports={locale:"pt-BR",date:{ca:["gregory","buddhist","chinese","coptic","ethioaa","ethiopic","generic","hebrew","indian","islamic","japanese","persian","roc"],hourNo0:!0,hour12:!1,formats:[{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{weekday}, {day} de {month} de {year} {hour}:{minute}:{second}",pattern12:"{weekday}, {day} de {month} de {year} {hour}:{minute}:{second} {ampm}"},{weekday:"long",day:"numeric",month:"long",year:"numeric",pattern:"{weekday}, {day} de {month} de {year}"},{day:"numeric",month:"long",year:"numeric",pattern:"{day} de {month} de {year}"},{day:"2-digit",month:"2-digit",year:"numeric",pattern:"{day}/{month}/{year}"},{month:"2-digit",year:"numeric",pattern:"{month}/{year}"},{month:"long",year:"numeric",pattern:"{month} de {year}"},{day:"numeric",month:"long",pattern:"{day} de {month}"},{day:"numeric",month:"numeric",pattern:"{day}/{month}"},{hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{hour}:{minute}:{second}",pattern12:"{hour}:{minute}:{second} {ampm}"},{hour:"numeric",minute:"2-digit",pattern:"{hour}:{minute}",pattern12:"{hour}:{minute} {ampm}"}],calendars:{buddhist:{eras:{"short":["BE"]}},chinese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["1","2","3","4","5","6","7","8","9","10","11","12"],"long":["Mês 1","Mês 2","Mês 3","Mês 4","Mês 5","Mês 6","Mês 7","Mês 8","Mês 9","Mês 10","Mês 11","Mês 12"]}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],"short":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],"long":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},eras:{"short":["ERA0","ERA1"]}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],"short":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],"long":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},eras:{"short":["ERA0","ERA1"]}},ethioaa:{eras:{"short":["ERA0"]}},generic:{months:{"long":["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},eras:{"short":["ERA0","ERA1"]}},gregory:{months:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],"short":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],"long":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},days:{narrow:["dom","seg","ter","qua","qui","sex","sáb"],"short":["dom","seg","ter","qua","qui","sex","sáb"],"long":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},eras:{"short":["a.C.","d.C."],"long":["Antes de Cristo","Ano do Senhor"]},dayPeriods:{am:"AM",pm:"PM"}},hebrew:{months:{"short":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],"long":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},eras:{"short":["AM"]}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],"long":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},eras:{"short":["Saka"]}},islamic:{months:{"short":["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],"long":["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},eras:{"short":["AH"]}},japanese:{eras:{narrow:["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchũ (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchũ (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","M","T","S","H"],"short":["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchū (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchū (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","Meiji","Taishō","Shōwa","Heisei"]}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],"long":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},eras:{"short":["AP"]}},roc:{eras:{"short":["Antes de R.O.C.","R.O.C."]}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"-{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"-{currency}{number}"},percent:{positivePattern:"{number}%",negativePattern:"-{number}%"}},symbols:{latn:{decimal:",",group:".",nan:"NaN",percent:"%",infinity:"∞"}},currencies:{AUD:"AU$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",PTE:"Esc.",THB:"฿",TWD:"NT$",USD:"US$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}},function(e,t,n){(function(r){"use strict";var i=r.React;r.React=n(2);var a=n(9);if(n(40),t=e.exports=a.IntlMixin,Object.keys(a).forEach(function(e){Object.defineProperty(t,e,{enumerable:!0,value:a[e]})}),i)r.React=i;else try{delete r.React}catch(s){r.React=void 0}}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){i["default"].__addLocaleData(e),a["default"].__addLocaleData(e)}t.__addLocaleData=r;var i=n(13),a=n(23),s=n(33),o=n(12),l=n(34),c=n(10),u=n(35),p=n(36),h=n(37),m=n(38);r(s["default"]),t.IntlMixin=o["default"],t.FormattedDate=l["default"],t.FormattedTime=c["default"],t.FormattedRelative=u["default"],t.FormattedNumber=p["default"],t.FormattedMessage=h["default"],t.FormattedHTMLMessage=m["default"]},function(e,t,n){"use strict";var r=n(11),i=n(12),a=r["default"].createClass({displayName:"FormattedTime",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("time",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatTime(t,s))}});t["default"]=a},function(e,t,n){"use strict";t["default"]=React},function(e,t,n){"use strict";function r(e,t){if(!isFinite(e))throw new TypeError(t)}var i=n(11),a=n(13),s=n(23),o=n(30),l={locales:i["default"].PropTypes.oneOfType([i["default"].PropTypes.string,i["default"].PropTypes.array]),formats:i["default"].PropTypes.object,messages:i["default"].PropTypes.object};t["default"]={statics:{filterFormatOptions:function(e,t){return t||(t={}),(this.formatOptions||[]).reduce(function(n,r){return e.hasOwnProperty(r)?n[r]=e[r]:t.hasOwnProperty(r)&&(n[r]=t[r]),n},{})}},propTypes:l,contextTypes:l,childContextTypes:l,getNumberFormat:o["default"](Intl.NumberFormat),getDateTimeFormat:o["default"](Intl.DateTimeFormat),getMessageFormat:o["default"](a["default"]),getRelativeFormat:o["default"](s["default"]),getChildContext:function(){var e=this.context,t=this.props;return{locales:t.locales||e.locales,formats:t.formats||e.formats,messages:t.messages||e.messages}},formatDate:function(e,t){return e=new Date(e),r(e,"A date or timestamp must be provided to formatDate()"),this._format("date",e,t)},formatTime:function(e,t){return e=new Date(e),r(e,"A date or timestamp must be provided to formatTime()"),this._format("time",e,t)},formatRelative:function(e,t,n){return e=new Date(e),r(e,"A date or timestamp must be provided to formatRelative()"),this._format("relative",e,t,n)},formatNumber:function(e,t){return this._format("number",e,t)},formatMessage:function(e,t){var n=this.props.locales||this.context.locales,r=this.props.formats||this.context.formats;return"function"==typeof e?e(t):("string"==typeof e&&(e=this.getMessageFormat(e,n,r)),e.format(t))},getIntlMessage:function(e){var t,n=this.props.messages||this.context.messages,r=e.split(".");try{t=r.reduce(function(e,t){return e[t]},n)}finally{if(void 0===t)throw new ReferenceError("Could not find Intl message: "+e)}return t},getNamedFormat:function(e,t){var n=this.props.formats||this.context.formats,r=null;try{r=n[e][t]}finally{if(!r)throw new ReferenceError("No "+e+" format named: "+t)}return r},_format:function(e,t,n,r){var i=this.props.locales||this.context.locales;switch(n&&"string"==typeof n&&(n=this.getNamedFormat(e,n)),e){case"date":case"time":return this.getDateTimeFormat(i,n).format(t);case"number":return this.getNumberFormat(i,n).format(t);case"relative":return this.getRelativeFormat(i,n).format(t,r);default:throw new Error("Unrecognized format type: "+e)}}}},function(e,t,n){"use strict";var r=n(14)["default"];n(22),t=e.exports=r,t["default"]=t},function(e,t,n){"use strict";var r=n(15),i=n(21);r["default"].__addLocaleData(i["default"]),r["default"].defaultLocale="en",t["default"]=r["default"]},function(e,t,n){"use strict";function r(e,t,n){var i="string"==typeof e?r.__parse(e):e;if(!i||"messageFormatPattern"!==i.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(r.formats,n),a.defineProperty(this,"_locale",{value:this._resolveLocale(t)});var s=this._findPluralRuleFunction(this._locale),o=this._compilePattern(i,t,n,s),l=this;this.format=function(e){return l._format(o,e)}}var i=n(16),a=n(17),s=n(18),o=n(19);t["default"]=r,a.defineProperty(r,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{"short":{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},"long":{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{"short":{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},"long":{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),a.defineProperty(r,"__localeData__",{value:a.objCreate(null)}),a.defineProperty(r,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");r.__localeData__[e.locale.toLowerCase()]=e}}),a.defineProperty(r,"__parse",{value:o["default"].parse}),a.defineProperty(r,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),r.prototype.resolvedOptions=function(){return{locale:this._locale}},r.prototype._compilePattern=function(e,t,n,r){var i=new s["default"](t,n,r);return i.compile(e)},r.prototype._findPluralRuleFunction=function(e){for(var t=r.__localeData__,n=t[e.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&t[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+e)},r.prototype._format=function(e,t){var n,r,a,s,o,l="";for(n=0,r=e.length;r>n;n+=1)if(a=e[n],"string"!=typeof a){if(s=a.id,!t||!i.hop.call(t,s))throw new Error("A value must be provided for: "+s);o=t[s],l+=a.options?this._format(a.getOption(o),t):a.format(o)}else l+=a;return l},r.prototype._mergeFormats=function(e,t){var n,r,s={};for(n in e)i.hop.call(e,n)&&(s[n]=r=a.objCreate(e[n]),t&&i.hop.call(t,n)&&i.extend(r,t[n]));return s},r.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(r.defaultLocale);var t,n,i,a,s=r.__localeData__;for(t=0,n=e.length;n>t;t+=1)for(i=e[t].toLowerCase().split("-");i.length;){if(a=s[i.join("-")])return a.locale;i.pop()}var o=e.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+e.join(", ")+", or the default locale: "+o)}},function(e,t,n){"use strict";function r(e){var t,n,r,a,s=Array.prototype.slice.call(arguments,1);for(t=0,n=s.length;n>t;t+=1)if(r=s[t])for(a in r)i.call(r,a)&&(e[a]=r[a]);return e}t.extend=r;var i=Object.prototype.hasOwnProperty;t.hop=i},function(e,t,n){"use strict";var r=n(16),i=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),a=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.hop.call(e,t)||"value"in n)&&(e[t]=n.value)}),s=Object.create||function(e,t){function n(){}var i,s;n.prototype=e,i=new n;for(s in t)r.hop.call(t,s)&&a(i,s,t[s]);return i};t.defineProperty=a,t.objCreate=s},function(e,t,n){"use strict";function r(e,t,n){this.locales=e,this.formats=t,this.pluralFn=n}function i(e){this.id=e}function a(e,t,n,r,i){this.id=e,this.useOrdinal=t,this.offset=n,this.options=r,this.pluralFn=i}function s(e,t,n,r){this.id=e,this.offset=t,this.numberFormat=n,this.string=r}function o(e,t){this.id=e,this.options=t}t["default"]=r,r.prototype.compile=function(e){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(e)},r.prototype.compileMessage=function(e){if(!e||"messageFormatPattern"!==e.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var t,n,r,i=e.elements,a=[];for(t=0,n=i.length;n>t;t+=1)switch(r=i[t],r.type){case"messageTextElement":a.push(this.compileMessageText(r));break;case"argumentElement":a.push(this.compileArgument(r));break;default:throw new Error("Message element does not have a valid type")}return a},r.prototype.compileMessageText=function(e){return this.currentPlural&&/(^|[^\\])#/g.test(e.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new s(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,e.value)):e.value.replace(/\\#/g,"#")},r.prototype.compileArgument=function(e){var t=e.format;if(!t)return new i(e.id);var n,r=this.formats,s=this.locales,l=this.pluralFn;switch(t.type){case"numberFormat":return n=r.number[t.style],{id:e.id,format:new Intl.NumberFormat(s,n).format};case"dateFormat":return n=r.date[t.style],{id:e.id,format:new Intl.DateTimeFormat(s,n).format};case"timeFormat":return n=r.time[t.style],{id:e.id,format:new Intl.DateTimeFormat(s,n).format};case"pluralFormat":return n=this.compileOptions(e),new a(e.id,t.ordinal,t.offset,n,l);case"selectFormat":return n=this.compileOptions(e),new o(e.id,n);default:throw new Error("Message element does not have a valid format type")}},r.prototype.compileOptions=function(e){var t=e.format,n=t.options,r={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===t.type?e:null;var i,a,s;for(i=0,a=n.length;a>i;i+=1)s=n[i],r[s.selector]=this.compileMessage(s.value);return this.currentPlural=this.pluralStack.pop(),r},i.prototype.format=function(e){return e?"string"==typeof e?e:String(e):""},a.prototype.getOption=function(e){var t=this.options,n=t["="+e]||t[this.pluralFn(e-this.offset,this.useOrdinal)];return n||t.other},s.prototype.format=function(e){var t=this.numberFormat.format(e-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+t).replace(/\\#/g,"#")},o.prototype.getOption=function(e){var t=this.options;return t[e]||t.other}},function(e,t,n){"use strict";t=e.exports=n(20)["default"],t["default"]=t},function(e,t,n){"use strict";t["default"]=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i,a){this.message=e,this.expected=t,this.found=n,this.offset=r,this.line=i,this.column=a,this.name="SyntaxError"}function n(e){function n(t){function n(t,n,r){var i,a;for(i=n;r>i;i++)a=e.charAt(i),"\n"===a?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}return qe!==t&&(qe>t&&(qe=0,Je={line:1,column:1,seenCR:!1}),n(Je,qe,t),qe=t),Je}function r(e){$e>Ue||(Ue>$e&&($e=Ue,Xe=[]),Xe.push(e))}function i(r,i,a){function s(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?s.slice(0,-1).join(", ")+" or "+s[e.length-1]:s[0],i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}var l=n(a),c=a1?arguments[1]:{},M={},j={start:a},L=a,F=function(e){return{type:"messageFormatPattern",elements:e}},A=M,I=function(e){var t,n,r,i,a,s="";for(t=0,r=e.length;r>t;t+=1)for(i=e[t],n=0,a=i.length;a>n;n+=1)s+=i[n];return s},D=function(e){return{type:"messageTextElement",value:e}},K=/^[^ \t\n\r,.+={}#]/,O={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},R="{",B={type:"literal",value:"{",description:'"{"'},z=null,H=",",G={type:"literal",value:",",description:'","'},U="}",W={type:"literal",value:"}",description:'"}"'},q=function(e,t){return{type:"argumentElement",id:e,format:t&&t[2]}},J="number",$={type:"literal",value:"number",description:'"number"'},X="date",Z={type:"literal",value:"date",description:'"date"'},Y="time",V={type:"literal",value:"time",description:'"time"'},Q=function(e,t){return{type:e+"Format",style:t&&t[2]}},ee="plural",te={type:"literal",value:"plural",description:'"plural"'},ne=function(e){return{type:e.type,ordinal:!1,offset:e.offset||0,options:e.options}},re="selectordinal",ie={type:"literal",value:"selectordinal",description:'"selectordinal"'},ae=function(e){return{type:e.type,ordinal:!0,offset:e.offset||0,options:e.options}},se="select",oe={type:"literal",value:"select",description:'"select"'},le=function(e){return{type:"selectFormat",options:e}},ce="=",ue={type:"literal",value:"=",description:'"="'},pe=function(e,t){return{type:"optionalFormatPattern",selector:e,value:t}},he="offset:",me={type:"literal",value:"offset:",description:'"offset:"'},de=function(e){return e},fe=function(e,t){return{type:"pluralFormat",offset:e,options:t}},ge={type:"other",description:"whitespace"},ye=/^[ \t\n\r]/,ve={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},be={type:"other",description:"optionalWhitespace"},_e=/^[0-9]/,Te={type:"class",value:"[0-9]",description:"[0-9]"},ke=/^[0-9a-f]/i,Ee={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},xe="0",we={type:"literal",value:"0",description:'"0"'},Ne=/^[1-9]/,Pe={type:"class",value:"[1-9]",description:"[1-9]"},Se=function(e){return parseInt(e,10)},Ce=/^[^{}\\\0-\x1F \t\n\r]/,Me={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},je="\\#",Le={type:"literal",value:"\\#",description:'"\\\\#"'},Fe=function(){return"\\#"},Ae="\\{",Ie={type:"literal",value:"\\{",description:'"\\\\{"'},De=function(){return"{"},Ke="\\}",Oe={type:"literal",value:"\\}",description:'"\\\\}"'},Re=function(){return"}"},Be="\\u",ze={type:"literal",value:"\\u",description:'"\\\\u"'},He=function(e){return String.fromCharCode(parseInt(e,16))},Ge=function(e){return e.join("")},Ue=0,We=0,qe=0,Je={line:1,column:1,seenCR:!1},$e=0,Xe=[],Ze=0;if("startRule"in C){if(!(C.startRule in j))throw new Error("Can't start parsing from rule \""+C.startRule+'".');L=j[C.startRule]}if(S=L(),S!==M&&Ue===e.length)return S;throw S!==M&&Ueo?"past":"future"})},r.prototype._isValidUnits=function(e){if(!e||s.arrIndexOf.call(o,e)>=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&s.arrIndexOf.call(o,t)>=0)throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+t)}throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+o.join('", "')+'"')},r.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(r.defaultLocale);var t,n,i,a,s=r.__localeData__;for(t=0,n=e.length;n>t;t+=1)for(i=e[t].toLowerCase().split("-");i.length;){if(a=s[i.join("-")])return a.locale;i.pop()}var o=e.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+e.join(", ")+", or the default locale: "+o)},r.prototype._resolveStyle=function(e){if(!e)return l[0];if(s.arrIndexOf.call(l,e)>=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+l.join('", "')+'"')},r.prototype._selectUnits=function(e){var t,n,i;for(t=0,n=o.length;n>t&&(i=o[t],!(Math.abs(e[i])r;r++)if(n[r]===e)return r;return-1},c=Array.isArray||function(e){return"[object Array]"===i.call(e)},u=Date.now||function(){return(new Date).getTime()};t.defineProperty=s,t.objCreate=o,t.arrIndexOf=l,t.isArray=c,t.dateNow=u},function(e,t,n){"use strict";t["default"]={locale:"en",pluralRuleFunction:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":3==a&&13!=s?"few":"other":1==e&&r?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}}},function(e,t,n){},function(e,t,n){"use strict";t=e.exports=n(31)["default"],t["default"]=t},function(e,t,n){"use strict";function r(e){var t=s.objCreate(null);return function(){var n=Array.prototype.slice.call(arguments),r=i(n),a=r&&t[r];return a||(a=s.objCreate(e.prototype),e.apply(a,n),r&&(t[r]=a)),a}}function i(e){if("undefined"!=typeof JSON){var t,n,r,i=[];for(t=0,n=e.length;n>t;t+=1)r=e[t],r&&"object"==typeof r?i.push(a(r)):i.push(r);return JSON.stringify(i)}}function a(e){var t,n,r,i,a=[],s=[];for(t in e)e.hasOwnProperty(t)&&s.push(t);var o=s.sort();for(n=0,r=o.length;r>n;n+=1)t=o[n],i={},i[t]=e[t],a[n]=i;return a}var s=n(32);t["default"]=r},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),a=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.call(e,t)||"value"in n)&&(e[t]=n.value)}),s=Object.create||function(e,t){function n(){}var i,s;n.prototype=e,i=new n;for(s in t)r.call(t,s)&&a(i,s,t[s]);return i};t.defineProperty=a,t.objCreate=s},function(e,t,n){"use strict";t["default"]={locale:"en",pluralRuleFunction:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":3==a&&13!=s?"few":"other":1==e&&r?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}}},function(e,t,n){"use strict";var r=n(11),i=n(12),a=r["default"].createClass({displayName:"FormattedDate",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("date",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatDate(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(11),i=n(12),a=r["default"].createClass({displayName:"FormattedRelative",mixins:[i["default"]],statics:{formatOptions:["style","units"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired,now:r["default"].PropTypes.any},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("relative",n),s=a.filterFormatOptions(e,i),o=this.formatRelative(t,s,{now:e.now});return r["default"].DOM.span(null,o)}});t["default"]=a},function(e,t,n){"use strict";var r=n(11),i=n(12),a=r["default"].createClass({displayName:"FormattedNumber",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("number",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatNumber(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(11),i=n(12),a=r["default"].createClass({displayName:"FormattedMessage",mixins:[i["default"]],propTypes:{tagName:r["default"].PropTypes.string,message:r["default"].PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var e=this.props,t=e.tagName,n=e.message,i=Math.floor(1099511627776*Math.random()).toString(16),a=new RegExp("(@__ELEMENT-"+i+"-\\d+__@)","g"),s={},o=function(){var e=0;return function(){return"@__ELEMENT-"+i+"-"+(e+=1)+"__@"}}(),l=Object.keys(e).reduce(function(t,n){var i,a=e[n];return r["default"].isValidElement(a)?(i=o(),t[n]=i,s[i]=a):t[n]=a,t},{}),c=this.formatMessage(n,l),u=c.split(a).filter(function(e){return!!e}).map(function(e){return s[e]||e}),p=[t,null].concat(u);return r["default"].createElement.apply(null,p)}});t["default"]=a},function(e,t,n){"use strict";var r=n(11),i=n(39),a=n(12),s=r["default"].createClass({displayName:"FormattedHTMLMessage",mixins:[a["default"]],propTypes:{tagName:r["default"].PropTypes.string,message:r["default"].PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var e=this.props,t=e.tagName,n=e.message,a=Object.keys(e).reduce(function(t,n){var a=e[n];return"string"==typeof a?a=i["default"](a):r["default"].isValidElement(a)&&(a=r["default"].renderToStaticMarkup(a)),t[n]=a,t},{});return r["default"].DOM[t]({dangerouslySetInnerHTML:{__html:this.formatMessage(n,a)}})}});t["default"]=s},function(e,t,n){"use strict";var r={"&":"&",">":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;t["default"]=function(e){return(""+e).replace(i,function(e){return r[e]})}},function(e,t,n){},function(e,t,n){function r(e){return n(i(e))}function i(e){return a[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var a={"./en-US":42,"./en-US.js":42,"./pt-BR":43,"./pt-BR.js":43};r.keys=function(){return Object.keys(a)},r.resolve=i,e.exports=r,r.id=41},function(e,t,n){e.exports={IndexFilters:{filters:"{quantity, plural,\n =0 {Filters}\n =1 {one filter}\n other {# filters}\n}"},Active:"Active",Alerts:"Alerts",All:"All",Category:"Category",Cleared:"Cleared",Completed:"Completed",created:"Created",Critical:"Critical",Disabled:"Disabled",Error:"Error",loginInvalidPassword:"Please provide Username and Password.","Log In":"Log In",Logout:"Logout",model:"Model",modified:"Modified",Name:"Name",OK:"OK",Password:"Password","Remember me":"Remember me",Resource:"Resource",Running:"Running",Search:"Search",State:"State",Status:"Status",Tasks:"Tasks",Time:"Time",Total:"Total",Unknown:"Unknown",Username:"Username",uri:"URI",Warning:"Warning"}},function(e,t,n){e.exports={IndexFilters:{filters:"{quantity, plural,\n =0 {Filtros}\n =1 {um filtro}\n other {# filtros}\n}"},Active:"Ativos",Alerts:"Alertas",All:"Todos",Category:"Categoria",Cleared:"Livre",Completed:"Completado",created:"Criado",Critical:"Crítico",Disabled:"Desabilitado",Error:"Erro",loginInvalidPassword:"Por favor, informe Usuário e Senha.","Log In":"Logar",Logout:"Deslogar",model:"Modelo",modified:"Modificado",Name:"Nome",OK:"OK",Password:"Senha","Remember me":"Lembrar Usuário",Resource:"Recurso",Running:"Executando",Search:"Buscar",State:"Estado",Status:"Situaçāo",Tasks:"Tarefas",Time:"Data",Total:"Total",Unknown:"Desconhecido",Username:"Usuário",uri:"URI",Warning:"Alerta"}},function(e,t,n){var r=n(2),i="button",a=r.createClass({displayName:"Button",propTypes:{alternate:r.PropTypes.bool,label:r.PropTypes.string.isRequired,large:r.PropTypes.bool,onClick:r.PropTypes.func,primary:r.PropTypes.bool,small:r.PropTypes.bool,strong:r.PropTypes.bool},render:function(){var e=[i];return this.props.primary&&e.push(i+"--primary"),this.props.alternate&&e.push(i+"--alternate"),this.props.large&&e.push(i+"--large"),this.props.small&&e.push(i+"--small"),this.props.strong&&e.push(i+"--strong"),this.props.onClick||e.push(i+"--disabled"),this.props.className&&e.push(this.props.className),r.createElement("button",{className:e.join(" "),onClick:this.props.onClick},this.props.label)}});e.exports=a},function(e,t,n){var r=n(2),i="check-box",a=r.createClass({displayName:"CheckBox",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func,toggle:r.PropTypes.bool},render:function(){var e=[i];return this.props.toggle&&e.push(i+"--toggle"),this.props.className&&e.push(this.props.className),r.createElement("label",{className:e.join(" ")},r.createElement("input",{className:i+"__input",id:this.props.id,name:this.props.name,type:"checkbox",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("span",{className:i+"__control"}),r.createElement("span",{className:i+"__label"},this.props.label))}});e.exports=a},function(e,t,n){var r=n(2),i="document",a=r.createClass({displayName:"GrommetDocument",propTypes:{colorIndex:r.PropTypes.string,flush:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0}},render:function(){var e=[i];return this.props.flush&&e.push(i+"--flush"),this.props.colorIndex&&e.push("header-color-index-"+this.props.colorIndex),r.createElement("div",{ref:"document",className:e.join(" ")},r.createElement("div",{className:i+"__content"},this.props.children))}});e.exports=a},function(e,t,n){function r(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function i(e,t,n,i,a){var s=r(e,t,n,a),o=r(e,t,n,i),l=180>=a-i?"0":"1",c=["M",s.x,s.y,"A",n,n,0,l,0,o.x,o.y].join(" ");return c}function a(e,t,n,i,a){var s=a-(a-i)/2,o=r(e,t,n-24,s),l=r(e,t,n,s-10),c=r(e,t,n,s+10),u=["M",o.x,o.y,"L",l.x,l.y,"A",n,n,0,0,0,c.x,c.y,"Z"].join(" ");return u}var s=n(2),o=n(48),l="donut",c=192,u=168,p=s.createClass({displayName:"Donut",propTypes:{legend:s.PropTypes.bool,partial:s.PropTypes.bool,max:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number,label:s.PropTypes.string}),s.PropTypes.number]),min:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number,label:s.PropTypes.string}),s.PropTypes.number]),series:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,units:s.PropTypes.string,colorIndex:s.PropTypes.string,important:s.PropTypes.bool,onClick:s.PropTypes.func})),small:s.PropTypes.bool,units:s.PropTypes.string,value:s.PropTypes.number},getDefaultProps:function(){return{max:{value:100},min:{value:0}}},_initialTimeout:function(){this.setState({initial:!1,activeIndex:this.state.importantIndex}),clearTimeout(this._timeout)},_onActive:function(e){this.setState({initial:!1,activeIndex:e})},_layout:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({orientation:"portrait"}):e>1.2&&this.setState({orientation:"landscape"});var t=this.refs.donut.getDOMNode().parentNode,n=t.offsetWidth,r=t.offsetHeight,i=c;this.props.partial&&(i=u),i>r||c>n||2*c>n&&2*i>r?this.setState({size:"small"}):this.setState({size:null})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},_generateSeries:function(e){var t=e.max.value-e.min.value,n=t-(e.value-e.min.value);return[{value:e.value},{value:n,colorIndex:"unset"}]},_importantIndex:function(e){var t=0;return e.some(function(e,n){return e.important?(t=n,!0):void 0}),t},getInitialState:function(){var e=this.props.series||this._generateSeries(this.props),t=this._importantIndex(e);return{initial:!0,importantIndex:t,activeIndex:t,legend:!1,orientation:"portrait",series:e}},componentDidMount:function(){console.log("Grommet Donut is deprecated. Please use Grommet Meter instead."),this._initialTimer=setTimeout(this._initialTimeout,10),this.setState({initial:!0,activeIndex:0}),window.addEventListener("resize",this._onResize),this._onResize()},componentWillReceiveProps:function(e){var t=e.series||this._generateSeries(e),n=this._importantIndex(t);this.setState({importantIndex:n,activeIndex:n,series:t})},componentWillUnmount:function(){clearTimeout(this._initialTimer),clearTimeout(this._resizeTimer),window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},render:function(){var e=[l,l+"--"+this.state.orientation];this.state.size&&e.push(l+"--"+this.state.size),this.props.partial&&e.push(l+"--partial"),this.props.small&&e.push(l+"--small");var t=c;this.props.partial&&(t=u);var n=0;this.state.series.some(function(e){n+=e.value});var r=0,p=360/n;this.props.partial&&(r=60,p=240/n);var h,m,d=null,f=null,g=null,y=null,v=this.state.series.map(function(e,t){var n=Math.min(360,Math.max(10,r+p*e.value));e.value>0&&r+360===n&&(n-=.1);var o=84,u=i(c/2,c/2,o,r+180,n+180),h=this._itemColorIndex(e,t),m=[l+"__slice"];if(m.push("color-index-"+h),this.state.activeIndex===t&&(m.push(l+"__slice--active"),d=e.value,f=e.units||this.props.units,g=e.label),t===this.state.activeIndex){var v=a(c/2,c/2,o,r+180,n+180);y=s.createElement("path",{stroke:"none",className:l+"__slice-indicator color-index-"+h,d:v})}return r=n,s.createElement("path",{key:e.label,fill:"none",className:m.join(" "),d:u,onMouseOver:this._onActive.bind(this,t),onMouseOut:this._onActive.bind(this,this.state.importantIndex),onClick:e.onClick})},this);this.props.partial&&(this.props.min&&(h=s.createElement("div",{className:l+"__min-label"},this.props.min.value," ",this.props.units)),this.props.max&&(m=s.createElement("div",{className:l+"__max-label"},this.props.max.value," ",this.props.units)));var b=null;return this.props.legend&&(b=s.createElement(o,{className:l+"__legend",series:this.props.series,units:this.props.units,value:this.props.value,activeIndex:this.state.activeIndex,onActive:this._onActive})),s.createElement("div",{ref:"donut",className:e.join(" ")},s.createElement("div",{className:l+"__graphic-container"},s.createElement("svg",{className:l+"__graphic",viewBox:"0 0 "+c+" "+t,preserveAspectRatio:"xMidYMid meet"},s.createElement("g",null,y,v)),s.createElement("div",{className:l+"__active"},s.createElement("div",{className:l+"__active-value large-number-font"},d,s.createElement("span",{className:l+"__active-units large-number-font"},f)),s.createElement("div",{className:l+"__active-label"},g)),h,m),b)}});e.exports=p},function(e,t,n){var r=n(2),i=n(4),a="legend",s=r.createClass({displayName:"Legend",mixins:[i],propTypes:{activeIndex:r.PropTypes.number,onActive:r.PropTypes.func,series:r.PropTypes.arrayOf(r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.number,units:r.PropTypes.string,colorIndex:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]),onClick:r.PropTypes.func})).isRequired,total:r.PropTypes.bool,units:r.PropTypes.string,value:r.PropTypes.number},_onActive:function(e){this.setState({activeIndex:e}),this.props.onActive&&this.props.onActive(e)},getInitialState:function(){return{activeIndex:this.props.activeIndex}},componentWillReceiveProps:function(e){this.setState({activeIndex:e.activeIndex})},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},render:function(){var e=[a];1===this.props.series.length&&e.push(a+"--single"),this.props.className&&e.push(this.props.className);var t=0,n=this.props.series.map(function(e,n){var i=[a+"__item"];n===this.state.activeIndex&&i.push(a+"__item--active");var s=this._itemColorIndex(e,n);t+=e.value;var o=[a+"__item-value"];return 1===this.props.series.length&&o.push("large-number-font"),r.createElement("li",{key:e.label,className:i.join(" "),onClick:e.onClick,onMouseOver:this._onActive.bind(this,n),onMouseOut:this._onActive.bind(this,this.props.activeIndex)},r.createElement("svg",{className:a+"__item-swatch color-index-"+s,viewBox:"0 0 12 12"},r.createElement("path",{className:e.className,d:"M 5 0 l 0 12"})),r.createElement("span",{className:a+"__item-label"},e.label),r.createElement("span",{className:o.join(" ")},e.value,r.createElement("span",{className:a+"__item-units"},this.props.units)))},this),i=null;return this.props.total&&this.props.series.length>1&&(i=r.createElement("li",{className:a+"__total"},r.createElement("span",{className:a+"__total-label"},this.getGrommetIntlMessage("Total")),r.createElement("span",{className:a+"__total-value"},t,r.createElement("span",{className:a+"__total-units"},this.props.units)))),r.createElement("ol",{className:e.join(" ")},n.reverse(),i)}});e.exports=s},function(e,t,n){var r=n(2),i=n(50),a="footer",s=r.createClass({displayName:"Footer",propTypes:{centered:r.PropTypes.bool,colorIndex:r.PropTypes.string,flush:r.PropTypes.bool,primary:r.PropTypes.bool,scrollTop:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0}},_updateState:function(){this.setState({scrolled:this._scrollable.scrollTop>0})},_onClickTop:function(){this._scrollable.scrollTop=0},_onScroll:function(){clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(this._updateState,10)},getInitialState:function(){return{scrolled:!1}},componentDidMount:function(){this._scrollable=this.refs.footer.getDOMNode().parentNode.parentNode,this._scrollable.addEventListener("scroll",this._onScroll)},componentWillUnmount:function(){this._scrollable.removeEventListener("scroll",this._onScroll)},componentWillReceiveProps:function(){ +this.setState({scrolled:!1})},componentDidUpdate:function(){this.state.scrolled||(this._scrollable.scrollTop=0)},render:function(){var e=[a];this.props.primary&&e.push(a+"--primary"),this.props.centered&&e.push(a+"--centered"),this.props.flush&&e.push(a+"--flush"),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var t=null;return this.props.scrollTop&&this.state.scrolled&&(t=r.createElement("div",{className:a+"__top control-icon",onClick:this._onClickTop},r.createElement(i,null))),r.createElement("div",{ref:"footer",className:e.join(" ")},r.createElement("div",{className:a+"__content"},this.props.children,t))}});e.exports=s},function(e,t,n){var r=n(2),i=r.createClass({displayName:"Top",render:function(){var e="control-icon control-icon-top";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{fill:"none"},r.createElement("polyline",{strokeWidth:"2",points:"14,20.9 24,13 34,21 "}),r.createElement("path",{strokeWidth:"2",d:"M24,13.3C24,36,24,36,24,36"}),r.createElement("line",{strokeWidth:"2",x1:"13",y1:"11",x2:"35",y2:"11"})))}});e.exports=i},function(e,t,n){var r=n(2),i="form",a=r.createClass({displayName:"Form",propTypes:{compact:r.PropTypes.bool,fill:r.PropTypes.bool,flush:r.PropTypes.bool,onSubmit:r.PropTypes.func,className:r.PropTypes.string},getDefaultProps:function(){return{compact:!1,fill:!1,flush:!0}},render:function(){var e=[i];return this.props.compact&&e.push(i+"--compact"),this.props.fill&&e.push(i+"--fill"),this.props.flush&&e.push(i+"--flush"),this.props.className&&e.push(this.props.className),r.createElement("form",{className:e.join(" "),onSubmit:this.props.onSubmit},this.props.children)}});e.exports=a},function(e,t,n){var r=n(2),i="form-field",a=r.createClass({displayName:"FormField",propTypes:{error:r.PropTypes.string,help:r.PropTypes.node,htmlFor:r.PropTypes.string,label:r.PropTypes.string,required:r.PropTypes.bool},_onFocus:function(){this.setState({focus:!0})},_onBlur:function(){this.setState({focus:!1})},_onClick:function(){this._inputElement&&this._inputElement.focus()},getInitialState:function(){return{focus:!1}},componentDidMount:function(){var e=this.refs.contents.getDOMNode(),t=e.querySelectorAll("input, textarea, select");1===t.length&&(this._inputElement=t[0],this._inputElement.addEventListener("focus",this._onFocus),this._inputElement.addEventListener("blur",this._onBlur))},componentWillUnmount:function(){this._inputElement&&(this._inputElement.removeEventListener("focus",this._onFocus),this._inputElement.removeEventListener("blur",this._onBlur),delete this._inputElement)},render:function(){var e=[i];this.state.focus&&e.push(i+"--focus"),this.props.required&&e.push(i+"--required"),this.props.htmlFor&&e.push(i+"--text");var t=null;this.props.error&&(e.push(i+"--error"),t=r.createElement("span",{className:i+"__error"},this.props.error));var n=null;return this.props.help&&(n=r.createElement("span",{className:i+"__help"},this.props.help)),r.createElement("div",{className:e.join(" "),onClick:this._onClick},t,r.createElement("label",{className:i+"__label",htmlFor:this.props.htmlFor},this.props.label),r.createElement("span",{ref:"contents",className:i+"__contents"},this.props.children),n)}});e.exports=a},function(e,t,n){var r=n(2),i="header",a=r.createClass({displayName:"Header",propTypes:{colorIndex:r.PropTypes.string,fixed:r.PropTypes.bool,flush:r.PropTypes.bool,large:r.PropTypes.bool,primary:r.PropTypes.bool,small:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0,large:!1,primary:!1,small:!1}},_onResize:function(){this._alignMirror()},_alignMirror:function(){var e=this.refs.content.getDOMNode(),t=this.refs.mirror.getDOMNode(),n=t.getBoundingClientRect();e.style.width=""+Math.floor(n.width)+"px";var r=e.getBoundingClientRect();t.style.height=""+Math.floor(r.height)+"px"},componentDidMount:function(){this.props.fixed&&(this._alignMirror(),window.addEventListener("resize",this._onResize))},componentDidUpdate:function(){this.props.fixed&&this._alignMirror()},componentWillUnmount:function(){this.props.fixed&&window.removeEventListener("resize",this._onResize)},render:function(){var e=[i];this.props.primary&&e.push(i+"--primary"),this.props.fixed&&e.push(i+"--fixed"),this.props.flush&&e.push(i+"--flush"),this.props.large&&e.push(i+"--large"),this.props.small&&e.push(i+"--small"),this.props.className&&e.push(this.props.className);var t=null;this.props.fixed&&(t=r.createElement("div",{ref:"mirror",className:i+"__mirror"}));var n=r.createElement("div",{ref:"content",className:i+"__content"},this.props.children);if(this.props.colorIndex||this.props.fixed){var a=[i+"__wrapper"];this.props.colorIndex&&a.push("background-color-index-"+this.props.colorIndex),n=r.createElement("div",{className:a.join(" ")},n)}return r.createElement("div",{className:e.join(" ")},t,n)}});e.exports=a},function(e,t,n){var r=n(2),i=r.createClass({displayName:"Label",propTypes:{icon:r.PropTypes.node,text:r.PropTypes.string},render:function(){var e=null,t=null;return this.props.icon&&(e=r.createElement("span",{className:"label__icon control-icon"},this.props.icon)),this.props.text&&(t=r.createElement("span",{className:"label__text"},this.props.text)),r.createElement("div",{className:"label"},e,t)}});e.exports=i},function(e,t,n){var r=n(2),i=r.createClass({displayName:"Login",propTypes:{background:r.PropTypes.string},_onResize:function(){this.adjustBackground()},adjustBackground:function(){var e=window.innerWidth/window.innerHeight,t=this.refs.background.getDOMNode(),n=t.scrollWidth/t.scrollHeight;this.setState({orientation:n>e?"portrait":"landscape"})},getInitialState:function(){return{orientation:null}},componentDidMount:function(){window.addEventListener("resize",this._onResize),setTimeout(this.adjustBackground,300)},componentWillUnmount:function(){window.removeEventListener("resize",this._onResize)},render:function(){var e=null;if(this.props.background){var t=["login__background"];this.state.orientation&&t.push("login__background--"+this.state.orientation),e=r.createElement("img",{ref:"background",className:t.join(" "),src:this.props.background})}return r.createElement("div",{className:"login"},e,r.createElement("div",{className:"login__container"},this.props.children))}});e.exports=i},function(e,t,n){var r=n(2),i=n(51),a=n(52),s=n(45),o=n(44),l=n(4),c="login-form",u=r.createClass({displayName:"LoginForm",mixins:[l],propTypes:{logo:r.PropTypes.node,title:r.PropTypes.string,rememberMe:r.PropTypes.bool,forgotPassword:r.PropTypes.node,errors:r.PropTypes.arrayOf(r.PropTypes.string),onSubmit:r.PropTypes.func},_onSubmit:function(e){e.preventDefault();var t=this.refs.username.getDOMNode().value.trim(),n=this.refs.password.getDOMNode().value.trim();this.props.onSubmit&&this.props.onSubmit({username:t,password:n})},getDefaultProps:function(){return{errors:[]}},componentDidMount:function(){this.refs.username.getDOMNode().focus()},render:function(){var e=[c],t=this.props.errors.map(function(e,t){return r.createElement("div",{key:t,className:c+"__error"},this.getGrommetIntlMessage(e))}.bind(this)),n=null;this.props.logo&&(n=r.createElement("div",{className:c+"__logo"},this.props.logo));var l=null;this.props.title&&(l=r.createElement("h1",{className:c+"__title"},this.props.title));var u=null;if(this.props.rememberMe||this.props.forgotPassword){var p=null;this.props.rememberMe&&(p=r.createElement(s,{className:c+"__remember-me",id:"remember-me",label:this.getGrommetIntlMessage("Remember me")})),u=r.createElement("div",{className:c+"__footer"},p,this.props.forgotPassword)}return r.createElement(i,{className:e.join(" "),onSubmit:this._onSubmit},n,l,r.createElement("fieldset",null,r.createElement(a,{htmlFor:"username",label:this.getGrommetIntlMessage("Username")},r.createElement("input",{id:"username",ref:"username",type:"email"})),r.createElement(a,{htmlFor:"password",label:this.getGrommetIntlMessage("Password")},r.createElement("input",{id:"password",ref:"password",type:"password"}))),t,r.createElement(o,{className:c+"__submit",primary:!0,strong:!0,label:this.getGrommetIntlMessage("Log In"),onClick:this._onSubmit}),u)}});e.exports=u},function(e,t,n){var r=n(2),i=n(60),a=n(61),s=n(58),o=n(62),l=n(63),c="menu",u=r.createClass({displayName:"MenuLayer",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),direction:r.PropTypes.oneOf(["up","down","left","right","center"]),id:r.PropTypes.string.isRequired,onClick:r.PropTypes.func.isRequired,router:r.PropTypes.func},childContextTypes:{router:r.PropTypes.func},getChildContext:function(){return{router:this.props.router}},render:function(){var e=[c+"__layer"];return this.props.direction&&e.push(c+"__layer--"+this.props.direction),this.props.align&&e.push(c+"__layer--align-"+this.props.align),r.createElement("div",{id:this.props.id,className:e.join(" "),onClick:this.props.onClick},this.props.children)}}),p=r.createClass({displayName:"Menu",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),closeOnClick:r.PropTypes.bool,collapse:r.PropTypes.bool,direction:r.PropTypes.oneOf(["up","down","left","right","center"]),icon:r.PropTypes.node,label:r.PropTypes.string,primary:r.PropTypes.bool,small:r.PropTypes.bool},contextTypes:{router:r.PropTypes.func},getDefaultProps:function(){return{align:"left",closeOnClick:!0,direction:"down",small:!1}},mixins:[i,a,s],_onOpen:function(e){e.preventDefault(),this.setState({active:!0})},_onClose:function(){this.setState({active:!1})},_onFocusControl:function(){this.setState({controlFocused:!0})},_onBlurControl:function(){this.setState({controlFocused:!1})},_onSink:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},getInitialState:function(){return{controlFocused:!1,active:!1,inline:!this.props.label&&!this.props.icon&&!this.props.collapse}},componentDidMount:function(){if(this.refs.control){var e=this.refs.control.getDOMNode();this.setState({layerId:"menu-layer-"+e.getAttribute("data-reactid")})}},componentDidUpdate:function(e,t){var n={esc:this._onClose,space:this._onClose,tab:this._onClose},r={space:this._onOpen,down:this._onOpen};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.active&&t.active&&(document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&(!t.controlFocused||!this.state.active&&t.active)&&this.startListeningToKeyboard(r),this.state.active&&!t.active){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(n);var i=this.refs.control.getDOMNode(),a=document.getElementById(this.state.layerId),s=a.querySelectorAll("."+c+"__control")[0],o=a.querySelectorAll("svg, img")[0],l=window.getComputedStyle(i).fontSize;s.style.fontSize=l;var u=i.clientHeight;o&&u<=o.clientHeight+1&&("down"===this.props.direction?s.style.marginTop="-1px":"up"===this.props.direction&&(s.style.marginBottom="1px")),s.style.height=u+"px",s.style.lineHeight=u+"px",this.startOverlay(i,a,this.props.align)}},componentWillUnmount:function(){document.removeEventListener("click",this._onClose)},_renderControl:function(){var e=null,t=null,n=c+"__control",i=[n];return this.props.icon?(i.push(n+"--labelled"),t=this.props.icon):(i.push(n+"--fixed-label"),t=r.createElement(o,null)),e=this.props.label?r.createElement("div",{className:i.join(" ")},r.createElement("div",{className:n+"-icon"},t),r.createElement("span",{className:n+"-label"},this.props.label),r.createElement(l,{className:n+"-drop-icon"})):r.createElement("div",{className:n},t)},_classes:function(e){var t=[e];return this.props.direction&&t.push(e+"--"+this.props.direction),this.props.align&&t.push(e+"--align-"+this.props.align),this.props.small&&t.push(e+"--small"),this.props.primary&&t.push(e+"--primary"),t},render:function(){var e=this._classes(c);if(this.state.inline?e.push(c+"--inline"):(e.push(c+"--controlled"),this.props.label&&e.push(c+"--labelled")),this.props.className&&e.push(this.props.className),this.state.inline)return r.createElement("div",{className:e.join(" "),onClick:this._onClose},this.props.children);var t=this._renderControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onOpen,onFocus:this._onFocusControl,onBlur:this._onBlurControl},t)},renderLayer:function(){if(this.state.active){var e=r.createElement("div",{onClick:this._onClose},this._renderControl()),t=null,n=null;"up"===this.props.direction?(t=this.props.children,n=e):(t=e,n=this.props.children);var i;return i=this.props.closeOnClick?this._onClose:this._onSink,r.createElement(u,{router:this.context.router,align:this.props.align,direction:this.props.direction,onClick:i,id:this.state.layerId},t,n)}return r.createElement("span",null)}});e.exports=p},function(e,t,n){var r=n(59),i={_overlay:{controlElement:null,layerElement:null,align:null,scrollParents:[]},startOverlay:function(e,t,n){this._overlay.controlElement=e,this._overlay.layerElement=t,this._overlay.align=n,this._overlay.scrollParents=r.findScrollParents(this._overlay.controlElement),this._overlay.scrollParents.forEach(function(e){e.addEventListener("scroll",this.positionOverlay)},this),window.addEventListener("resize",this.positionOverlay),this.positionOverlay()},stopOverlay:function(){this._overlay.controlElement&&(this._overlay.scrollParents.forEach(function(e){e.removeEventListener("scroll",this.positionOverlay)},this),window.removeEventListener("resize",this.positionOverlay),this._overlay.controlElement=null,this._overlay.layerElement=null,this._overlay.align=null,this._overlay.scrollParents=[])},positionOverlay:function(){var e=this._overlay.controlElement,t=this._overlay.layerElement,n=e.getBoundingClientRect(),r=window.innerWidth;t.style.left="",t.style.width="",t.style.top="";var i=Math.min(Math.max(n.width,t.offsetWidth),r),a=n.left+t.offsetWidth-i;a="right"===this._overlay.align?n.left+n.width-t.offsetWidth:n.left,a+i>r?a-=a+i-r:0>a&&(a=0);var s=n.top;"up"===this.props.direction?s=n.top+n.height-t.offsetHeight:"below"===this._overlay.align&&(s=n.top+n.height);var o=window.innerHeight-s;t.style.left=""+a+"px",t.style.width=""+i+"px",t.style.top=""+s+"px",t.style.maxHeight=""+o+"px"},componentWillUnmount:function(){this.stopOverlay()}};e.exports=i},function(e,t,n){e.exports={findScrollParents:function(e){for(var t=[],n=e.parentNode;n;)n.scrollHeight>n.offsetHeight+10&&t.push(n),n=n.parentNode;return 0===t.length&&t.push(document),t}}},function(e,t,n){var r=n(2),i={componentWillUnmount:function(){this._unrenderLayer(),document.body.removeChild(this._target)},componentDidUpdate:function(){this._renderLayer()},componentDidMount:function(){this._target=document.createElement("div"),document.body.appendChild(this._target),this._renderLayer()},_renderLayer:function(){r.render(this.renderLayer(),this._target)},_unrenderLayer:function(){r.unmountComponentAtNode(this._target)}};e.exports=i},function(e,t,n){var r={backspace:8,tab:9,enter:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,comma:188},i={_keyboardAcceleratorHandlers:{},_keyboardAcceleratorListening:!1,_onKeyboardAcceleratorKeyPress:function(e){var t=e.keyCode?e.keyCode:e.which;this._keyboardAcceleratorHandlers.hasOwnProperty(t)&&this._keyboardAcceleratorHandlers[t](e)},startListeningToKeyboard:function(e){var t=0;for(var n in e)if(e.hasOwnProperty(n)){var i=n;r.hasOwnProperty(n)&&(i=r[n]),t+=1,this._keyboardAcceleratorHandlers[i]=e[n]}t>0&&!this._keyboardAcceleratorListening&&(window.addEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorListening=!0)},stopListeningToKeyboard:function(e){if(e)for(var t in e)if(e.hasOwnProperty(t)){var n=t;r.hasOwnProperty(t)&&(n=r[t]),delete this._keyboardAcceleratorHandlers[n]}var i=0;for(var a in this._keyboardAcceleratorHandlers)this._keyboardAcceleratorHandlers.hasOwnProperty(a)&&(i+=1);e&&0!==i||(window.removeEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorHandlers={},this._keyboardAcceleratorListening=!1)},componentWillUnmount:function(){this.stopListeningToKeyboard()}};e.exports=i},function(e,t,n){var r=n(2),i=r.createClass({displayName:"More",render:function(){var e="control-icon control-icon-more";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{fill:"none"},r.createElement("rect",{x:"23",y:"23",strokeWidth:"2",width:"2",height:"2"}),r.createElement("rect",{x:"15",y:"23",strokeWidth:"2",width:"2",height:"2"}),r.createElement("rect",{x:"31",y:"23",strokeWidth:"2",width:"2",height:"2"})))}});e.exports=i},function(e,t,n){var r=n(2),i=r.createClass({displayName:"DropCaret",render:function(){var e="control-icon control-icon-drop-caret";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{stroke:"none"},r.createElement("polygon",{points:"33.4,19.7 24.1,30.3 14.8,19.7"})))}});e.exports=i},function(e,t,n){function r(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function i(e,t,n,i,a){var s=r(e,t,n,a),o=r(e,t,n,i),l=180>=a-i?"0":"1",c=["M",s.x,s.y,"A",n,n,0,l,0,o.x,o.y].join(" ");return c}function a(e,t,n,i,a){var s=r(e,t,n-30,a-1),o=r(e,t,n,a-1),l=["M",o.x,o.y,"L",s.x,s.y].join(" ");return l}var s=n(2),o=n(48),l="meter",c=192,u=24,p=u/2,h=192,m=84,d=144,f=s.createClass({displayName:"Meter",propTypes:{important:s.PropTypes.number,large:s.PropTypes.bool,legend:s.PropTypes.bool,legendTotal:s.PropTypes.bool,max:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number.isRequired,label:s.PropTypes.string}),s.PropTypes.number]),min:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number.isRequired,label:s.PropTypes.string}),s.PropTypes.number]),series:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,colorIndex:s.PropTypes.string,important:s.PropTypes.bool,onClick:s.PropTypes.func})),small:s.PropTypes.bool,threshold:s.PropTypes.number,thresholds:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,colorIndex:s.PropTypes.string})),type:s.PropTypes.oneOf(["bar","arc","circle"]),units:s.PropTypes.string,value:s.PropTypes.number,vertical:s.PropTypes.bool},getDefaultProps:function(){return{type:"bar"}},_initialTimeout:function(){this.setState({initial:!1,activeIndex:this.state.importantIndex}),clearTimeout(this._timeout)},_onActivate:function(e){this.setState({initial:!1,activeIndex:e})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},_layout:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({legendPosition:"bottom"}):e>1.2&&this.setState({legendPosition:"right"})},_normalizeSeries:function(e,t,n){var r=[];return e.series?r=e.series:e.value&&(r=[{value:e.value,important:!0}]),r},_normalizeThresholds:function(e,t,n){var r=[];if(e.thresholds)for(var i=0,a=0;a0&&(r[a-1].value=s.value-i,i+=r[a-1].value),a===e.thresholds.length-1&&(r[a].value=n.value-i)}else if(e.threshold){var o=n.value-e.threshold;r=[{value:e.threshold,colorIndex:"unset"},{value:o,colorIndex:"error"}]}else r=[{value:n.value,colorIndex:"unset"}];return r},_importantIndex:function(e){var t=e.length-1;return this.props.hasOwnProperty("important")&&(t=this.props.important),e.some(function(e,n){return e.important?(t=n,!0):void 0}),t},_terminal:function(e){return"number"==typeof e&&(e={value:e}),e},_seriesTotal:function(e){var t=0;return e.some(function(e){t+=e.value}),t},_viewBoxDimensions:function(){var e,t;return"arc"===this.props.type?this.props.vertical?(t=d,e=h):(t=h,e=d):"circle"===this.props.type?(t=h,e=h):"bar"===this.props.type&&(this.props.vertical?(t=u,e=c):(t=c,e=u)),[t,e]},_stateFromProps:function(e){var t;t=e.series&&e.series.length>1?this._seriesTotal(e.series):e.max&&e.max.value?e.max.value:100;var n=this._terminal(e.min||0),r=this._terminal(e.max||t),i=this._normalizeSeries(e,n,r),a=this._normalizeThresholds(e,n,r),s=this._importantIndex(i),o=this._viewBoxDimensions(),l={importantIndex:s,activeIndex:s,series:i,thresholds:a,min:n,max:r,total:t,viewBoxWidth:o[0],viewBoxHeight:o[1]};return"arc"===this.props.type?(l.startAngle=60,l.anglePer=240/t,this.props.vertical?l.angleOffset=90:l.angleOffset=180):"circle"===this.props.type?(l.startAngle=1,l.anglePer=358/t,l.angleOffset=180):"bar"===this.props.type&&(l.scale=c/(r.value-n.value)),l},getInitialState:function(){var e=this._stateFromProps(this.props);return e.legendPosition="bottom",e.initial=!0,e},componentDidMount:function(){this._initialTimer=setTimeout(this._initialTimeout,10),window.addEventListener("resize",this._onResize),this._onResize()},componentWillReceiveProps:function(e){var t=this._stateFromProps(e);this.setState(t),this._onResize()},componentWillUnmount:function(){clearTimeout(this._initialTimer),clearTimeout(this._resizeTimer),window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},_translateBarWidth:function(e){return Math.round(this.state.scale*e)},_barCommands:function(e,t){var n;return n=this.props.vertical?"M"+p+","+(c-e)+" L"+p+","+(c-(e+t)):"M"+e+","+p+" L"+(e+t)+","+p},_renderBar:function(e){var t,n,r=0,i=this.state.min.value,a=e.map(function(e,a){var o=this._itemColorIndex(e,a);t=[l+"__bar"],a===this.state.activeIndex&&t.push(l+"__bar--active"),t.push("color-index-"+o);var c=e.value-i;i=Math.max(0,i-e.value);var u=this._translateBarWidth(c);return n=this._barCommands(r,u),r+=u,s.createElement("path",{key:a,className:t.join(" "),d:n,onMouseOver:this._onActivate.bind(this,a),onMouseOut:this._onActivate.bind(this,this.state.importantIndex),onClick:e.onClick})},this);return 0===a.length&&(t=[l+"__bar"],t.push(l+"__bar--loading"),t.push("color-index-loading"),n=this._barCommands(0,c),a.push(s.createElement("path",{key:"loading",className:t.join(" "),d:n}))),a},_translateEndAngle:function(e,t){return Math.min(360,Math.max(0,e+this.state.anglePer*t))},_arcCommands:function(e,t){return i(h/2,h/2,m,e+this.state.angleOffset,t+this.state.angleOffset)},_renderArcOrCircle:function(e){var t,n,r,i=this.state.startAngle,a=e.map(function(e,t){var a=[l+"__slice"];t===this.state.activeIndex&&a.push(l+"__slice--active");var o=this._itemColorIndex(e,t);return a.push("color-index-"+o),n=this._translateEndAngle(i,e.value),r=this._arcCommands(i,n),i=n,s.createElement("path",{key:e.label||t,fill:"none",className:a.join(" "),d:r,onMouseOver:this._onActivate.bind(this,t),onMouseOut:this._onActivate.bind(this,this.state.importantIndex),onClick:e.onClick})},this);return 0===a.length&&(t=[l+"__slice"],t.push(l+"__slice--loading"),t.push("color-index-loading"),n=this._translateEndAngle(this.state.startAngle,this.state.max.value),r=this._arcCommands(this.state.startAngle,n),a.push(s.createElement("path",{key:"loading",className:t.join(" "),d:r}))),a},_renderActiveIndicator:function(e){var t=null,n=this.state.startAngle;return e.forEach(function(e,r){var i=this._itemColorIndex(e,r),o=this._translateEndAngle(n,e.value);if(r===this.state.activeIndex){var c=a(h/2,h/2,m,n+this.state.angleOffset,o+this.state.angleOffset);t=s.createElement("path",{fill:"none",className:l+"__slice-indicator color-index-"+i,d:c})}n=o},this),t},_renderActive:function(){var e,t=this.state.series[this.state.activeIndex];return"arc"===this.props.type||"circle"===this.props.type?e=s.createElement("div",{className:l+"__active"},s.createElement("div",{className:l+"__active-value large-number-font"},t.value,s.createElement("span",{className:l+"__active-units large-number-font"},this.props.units)),s.createElement("div",{className:l+"__active-label"},t.label)):"bar"===this.props.type&&(e=s.createElement("span",{className:l+"__active"},s.createElement("span",{className:l+"__active-value large-number-font"},t.value),s.createElement("span",{className:l+"__active-units large-number-font"},this.props.units))),e},_renderLegend:function(){return s.createElement(o,{className:l+"__legend",series:this.state.series,units:this.props.units,activeIndex:this.state.activeIndex,onActive:this._onActive})},render:function(){var e=[l];e.push(l+"--"+this.props.type),e.push(l+"--legend-"+this.state.legendPosition),this.props.vertical&&e.push(l+"--vertical"),this.props.small&&e.push(l+"--small"),this.props.large&&e.push(l+"--large"),0===this.state.series.length&&e.push(l+"--loading"),this.props.className&&e.push(this.props.className);var t=null,n=null,r=null;"arc"===this.props.type||"circle"===this.props.type?(t=this._renderArcOrCircle(this.state.series),n=this._renderArcOrCircle(this.state.thresholds),r=this._renderActiveIndicator(this.state.series)):"bar"===this.props.type&&(t=this._renderBar(this.state.series),n=this._renderBar(this.state.thresholds));var i=null;this.state.min.label&&(i=s.createElement("div",{className:l+"__label-min"},this.state.min.label));var a=null;this.state.max.label&&(a=s.createElement("div",{className:l+"__label-max"},this.state.max.label));var o=null;this.state.activeIndex>=0&&(o=this._renderActive());var c=null;return this.props.legend&&(c=this._renderLegend()),s.createElement("div",{className:e.join(" ")},s.createElement("div",{className:l+"__active-graphic"},s.createElement("div",{className:l+"__labeled-graphic"},s.createElement("svg",{className:l+"__graphic",viewBox:"0 0 "+this.state.viewBoxWidth+" "+this.state.viewBoxHeight,preserveAspectRatio:"xMidYMid meet"},s.createElement("g",{className:l+"__thresholds"},n),s.createElement("g",{className:l+"__values"},t),r),s.createElement("div",{className:l+"__labels-container"},s.createElement("div",{className:l+"__labels"},i,a))),o),c)}});e.exports=f},function(e,t,n){var r=n(2),i=r.createClass({displayName:"Panel",propTypes:{direction:r.PropTypes.string,index:r.PropTypes.oneOf([1,2])},render:function(){var e=["panel"];"horizontal"===this.props.direction&&e.push("panel--horizontal"),this.props.index&&e.push("panel--index-"+this.props.index);var t=null;return this.props.title&&(t=r.createElement("h2",{className:"panel__title"},this.props.title)),r.createElement("div",{className:e.join(" ")},t,this.props.children)}});e.exports=i},function(e,t,n){var r=n(2),i="radio-button",a=r.createClass({displayName:"RadioButton",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func},render:function(){var e=[i];return this.props.className&&e.push(this.props.className),r.createElement("label",{className:e.join(" ")},r.createElement("input",{className:i+"__input",id:this.props.id,name:this.props.name,type:"radio",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("span",{className:i+"__control"}),r.createElement("span",{className:i+"__label"},this.props.label))}});e.exports=a},function(e,t,n){var r=n(2),i=n(60),a=n(61),s=n(58),o=n(68),l=n(4),c="search",u=r.createClass({displayName:"Search",propTypes:{align:r.PropTypes.oneOf(["left","right"]),defaultValue:r.PropTypes.string,inline:r.PropTypes.bool,onChange:r.PropTypes.func,placeHolder:r.PropTypes.string,suggestions:r.PropTypes.arrayOf(r.PropTypes.string)},getDefaultProps:function(){return{align:"left",inline:!1,placeHolder:"Search"}},mixins:[i,a,s,l],_onAddLayer:function(e){e.preventDefault(),this.setState({layer:!0,activeSuggestionIndex:-1})},_onRemoveLayer:function(){this.setState({layer:!1})},_onFocusControl:function(){this.setState({controlFocused:!0,layer:!0,activeSuggestionIndex:-1})},_onBlurControl:function(){this.setState({controlFocused:!1})},_onFocusInput:function(){this.refs.input.getDOMNode().select(),this.setState({layer:!this.state.inline||this.props.suggestions,activeSuggestionIndex:-1})},_onBlurInput:function(){},_onChangeInput:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onChange&&this.props.onChange(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.props.onChange&&this.props.onChange(e)}this._onRemoveLayer()},_onClickSuggestion:function(e){this.props.onChange&&this.props.onChange(e),this._onRemoveLayer()},_onSink:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},_layout:function(){window.innerWidth<600?this.setState({inline:!1}):this.setState({inline:this.props.inline})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},getInitialState:function(){return{align:"left",controlFocused:!1,inline:this.props.inline,layer:!1,activeSuggestionIndex:-1}},componentDidMount:function(){window.addEventListener("resize",this._onResize),this._layout()},componentDidUpdate:function(e,t){var n={esc:this._onRemoveLayer,tab:this._onRemoveLayer,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter},r={space:this._onAddLayer};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.layer&&t.layer&&(document.removeEventListener("click",this._onRemoveLayer),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&!t.controlFocused&&this.startListeningToKeyboard(r),this.state.layer&&!t.layer){document.addEventListener("click",this._onRemoveLayer),this.startListeningToKeyboard(n);var i=(this.refs.control?this.refs.control:this.refs.input).getDOMNode(),a=document.getElementById("search-layer"),s=a.querySelectorAll(".search__control")[0],o=a.querySelectorAll("svg")[0],l=a.querySelectorAll(".search__input")[0],c=window.getComputedStyle(i).fontSize;l.style.fontSize=c;var u=i.clientHeight;o&&u<=o.clientHeight&&(s.style.marginTop="-2px"),l.style.height=u+"px",s&&(s.style.height=u+"px",s.style.lineHeight=u+"px"),this.startOverlay(i,a,this.props.align),l.focus()}},componentWillUnmount:function(){document.removeEventListener("click",this._onRemoveLayer),window.removeEventListener("resize",this._onResize)},focus:function(){var e=this.refs.input||this.refs.control;e&&e.getDOMNode().focus()},_createControl:function(){var e=c+"__control";return r.createElement("div",{className:e},r.createElement(o,null))},_classes:function(e){var t=[e];return this.state.inline?t.push(e+"--inline"):t.push(e+"--controlled"),this.props.align&&t.push(e+"--align-"+this.props.align),t},render:function(){var e=this._classes(c);if(this.props.className&&e.push(this.props.className),this.state.inline){var t=this.props.suggestions?!0:!1;return r.createElement("div",{className:e.join(" ")},r.createElement("input",{ref:"input",type:"search",placeholder:this.getGrommetIntlMessage(this.props.placeHolder),value:this.props.defaultValue,className:c+"__input",readOnly:t,onFocus:this._onFocusInput,onBlur:this._onBlurInput,onChange:this._onChangeInput}))}var n=this._createControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onAddLayer,onFocus:this._onFocusControl,onBlur:this._onBlurControl},n)},renderLayer:function(){if(this.state.layer){var e=this._classes(c+"__layer"),t=null;this.props.suggestions&&(t=this.props.suggestions.map(function(e,t){var n=[c+"__suggestion"];return t===this.state.activeSuggestionIndex&&n.push(c+"__suggestion--active"),r.createElement("div",{key:e,className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},e)},this));var n=r.createElement("div",{className:c+"__layer-contents",onClick:this._onSink +},r.createElement("input",{type:"search",defaultValue:this.props.defaultValue,className:c+"__input",onChange:this._onChangeInput}),r.createElement("div",{className:c+"__suggestions"},t));if(!this.state.inline){var i=this._createControl(),a="right"===this.props.align,s=a?n:i,o=a?i:n;n=r.createElement("div",{className:c+"__layer-header"},s,o)}return r.createElement("div",{id:"search-layer",className:e.join(" ")},n)}return r.createElement("span",null)}});e.exports=u},function(e,t,n){var r=n(2),i=r.createClass({displayName:"Search",render:function(){var e="control-icon control-icon-search";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{fill:"none"},r.createElement("circle",{strokeWidth:"2",cx:"21.5",cy:"21.5",r:"9"}),r.createElement("line",{strokeWidth:"2",x1:"35.5",y1:"35.5",x2:"27.8",y2:"27.8"})))}});e.exports=i},function(e,t,n){var r=n(2),i=n(60),a=n(61),s=n(58),o=n(68),l="search-input",c=r.createClass({displayName:"SearchInput",propTypes:{defaultValue:r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string]),id:r.PropTypes.string,name:r.PropTypes.string,onChange:r.PropTypes.func,onSearch:r.PropTypes.func,suggestions:r.PropTypes.arrayOf(r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string])),value:r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string])},mixins:[i,a,s],_onInputChange:function(e){this.props.onChange(e.target.value)},_onOpen:function(e){e.preventDefault(),this.setState({active:!0,activeSuggestionIndex:-1})},_onClose:function(){this.setState({active:!1})},_onSearchChange:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onSearch(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.setState({active:!1}),this._activation(!1),this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.setState({value:e}),this.props.onChange(e)}},_onClickSuggestion:function(e){this.setState({value:e}),this._activation(!1),this.props.onChange(e)},_activation:function(e){var t={esc:this._onClose,tab:this._onClose,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter};if(e){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(t);var n=this.refs.component.getDOMNode(),r=document.getElementById(l+"-layer");this.startOverlay(n,r,"below");var i=r.querySelectorAll("input")[0];i.focus()}else document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(t),this.stopOverlay()},getInitialState:function(){return{active:!1,defaultValue:this.props.defaultValue,value:this.props.value,activeSuggestionIndex:-1}},componentDidMount:function(){this.state.active&&this._activation(this.state.active)},componentDidUpdate:function(e,t){!this.state.active&&t.active&&this._activation(this.state.active),this.state.active&&!t.active&&this._activation(this.state.active)},componentWillUnmount:function(){this._activation(!1)},_valueText:function(e){var t="";return e&&(t="string"==typeof e?e:e.label||e.value),t},render:function(){var e=[l];return this.state.active&&e.push(l+"--active"),this.props.className&&e.push(this.props.className),r.createElement("div",{ref:"component",className:e.join(" ")},r.createElement("input",{className:l+"__input",id:this.props.id,name:this.props.name,value:this._valueText(this.props.value),defaultValue:this._valueText(this.props.defaultValue),onChange:this._onInputChange}),r.createElement("div",{className:l+"__control",onClick:this._onOpen},r.createElement(o,null)))},renderLayer:function(){if(this.state.active){var e=null;return this.props.suggestions&&(e=this.props.suggestions.map(function(e,t){var n=[l+"__layer-suggestion"];return t===this.state.activeSuggestionIndex&&n.push(l+"__layer-suggestion--active"),r.createElement("div",{key:this._valueText(e),className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},this._valueText(e))},this)),r.createElement("div",{id:l+"-layer",className:l+"__layer",onClick:this._onClose},r.createElement("input",{type:"search",defaultValue:"",placeholder:"Search",className:l+"__layer-input",onChange:this._onSearchChange}),r.createElement("div",{className:l+"__layer-suggestions"},e))}return r.createElement("span",null)}});e.exports=c},function(e,t,n){var r=n(2),i="section",a=r.createClass({displayName:"Section",propTypes:{centered:r.PropTypes.bool,compact:r.PropTypes.bool,colorIndex:r.PropTypes.string,direction:r.PropTypes.oneOf(["up","down","left","right"]),flush:r.PropTypes.bool,texture:r.PropTypes.string},getDefaultProps:function(){return{colored:!1,direction:"down",flush:!0,small:!1}},render:function(){var e=[i],t=[i+"__content"];this.props.compact&&e.push(i+"--compact"),this.props.centered&&e.push(i+"--centered"),this.props.flush&&e.push(i+"--flush"),this.props.direction&&e.push(i+"--"+this.props.direction),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var n={};return this.props.texture&&(n.backgroundImage=this.props.texture),r.createElement("div",{className:e.join(" "),style:n},r.createElement("div",{className:t.join(" ")},this.props.children))}});e.exports=a},function(e,t,n){var r=n(2),i=n(72),a=n(73),s="table",o=r.createClass({displayName:"Table",propTypes:{selection:r.PropTypes.number,onMore:r.PropTypes.func,scrollable:r.PropTypes.bool,selectable:r.PropTypes.bool},mixins:[a],getDefaultProps:function(){return{selection:null,scrollable:!1,selectable:!1}},_clearSelection:function(){for(var e=this.refs.table.getDOMNode().querySelectorAll("."+s+"__row--selected"),t=0;ti;i++){t=arguments[i];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s)}else e[n]=t[n]}return e},t.isFunction=function(e){return"function"==typeof e},t.EventEmitter=n(100),t.nextTick=function(e){setTimeout(e,0)},t.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.callbackName=function(e){return"on"+t.capitalize(e)},t.object=function(e,t){for(var n={},r=0;rt;t++)r[t]=this._events[e][t].fn;return r},i.prototype.emit=function(e,t,n,r,i,a){if(!this._events||!this._events[e])return!1;var s,o,l=this._events[e],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(e,l.fn,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,i),!0;case 6:return l.fn.call(l.context,t,n,r,i,a),!0}for(o=1,s=new Array(c-1);c>o;o++)s[o-1]=arguments[o];l.fn.apply(l.context,s)}else{var u,p=l.length;for(o=0;p>o;o++)switch(l[o].once&&this.removeListener(e,l[o].fn,!0),c){case 1:l[o].fn.call(l[o].context);break;case 2:l[o].fn.call(l[o].context,t);break;case 3:l[o].fn.call(l[o].context,t,n);break;default:if(!s)for(u=1,s=new Array(c-1);c>u;u++)s[u-1]=arguments[u];l[o].fn.apply(l[o].context,s)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],i]:this._events[e].push(i):this._events[e]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],i]:this._events[e].push(i):this._events[e]=i,this},i.prototype.removeListener=function(e,t,n){if(!this._events||!this._events[e])return this;var r=this._events[e],i=[];if(t&&(r.fn&&(r.fn!==t||n&&!r.once)&&i.push(r),!r.fn))for(var a=0,s=r.length;s>a;a++)(r[a].fn!==t||n&&!r[a].once)&&i.push(r[a]);return i.length?this._events[e]=1===i.length?i[0]:i:delete this._events[e],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[e]:this._events={},this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.EventEmitter=i,i.EventEmitter2=i,i.EventEmitter3=i,e.exports=i},function(e,t,n){var r;(function(i,a){/*! Native Promise Only v0.7.6-a (c) Kyle Simpson MIT License: http://getify.mit-license.org */ -!function(i,a,s){a[i]=a[i]||s(),"undefined"!=typeof e&&e.exports?e.exports=a[i]:!0&&n(109)&&(r=function(){return a[i]}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}("Promise","undefined"!=typeof i?i:this,function(){"use strict";function e(e,t){m.add(e,t),h||(h=f(m.drain))}function t(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t?t:!1}function n(){for(var e=0;e0&&e(n,c))}catch(u){s.call(o||new l(c),u)}}}function s(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&e(n,r))}function o(e,t,n,r){for(var i=0;io?"past":"future"})},r.prototype._isValidUnits=function(e){if(!e||s.arrIndexOf.call(o,e)>=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&s.arrIndexOf.call(o,t)>=0)throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+t)}throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+o.join('", "')+'"')},r.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(r.defaultLocale);var t,n,i,a,s=r.__localeData__;for(t=0,n=e.length;n>t;t+=1)for(i=e[t].toLowerCase().split("-");i.length;){if(a=s[i.join("-")])return a.locale;i.pop()}var o=e.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+e.join(", ")+", or the default locale: "+o)},r.prototype._resolveStyle=function(e){if(!e)return l[0];if(s.arrIndexOf.call(l,e)>=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+l.join('", "')+'"')},r.prototype._selectUnits=function(e){var t,n,i;for(t=0,n=o.length;n>t&&(i=o[t],!(Math.abs(e[i])t;t+=1)r=e[t],r&&"object"==typeof r?i.push(a(r)):i.push(r);return JSON.stringify(i)}}function a(e){var t,n,r,i,a=[],s=[];for(t in e)e.hasOwnProperty(t)&&s.push(t);var o=s.sort();for(n=0,r=o.length;r>n;n+=1)t=o[n],i={},i[t]=e[t],a[n]=i;return a}var s=n(118);t["default"]=r},function(e,t,n){(function(t){e.exports=t}).call(t,{})},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var a=n(120).nextTick,s=Function.prototype.apply,o=Array.prototype.slice,l={},c=0;t.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:o.call(arguments,1);return l[n]=!0,a(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(110).setImmediate,n(110).clearImmediate)},function(e,t,n){"use strict";function r(e,t,n){var i="string"==typeof e?r.__parse(e):e;if(!i||"messageFormatPattern"!==i.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(r.formats,n),a.defineProperty(this,"_locale",{value:this._resolveLocale(t)});var s=this._findPluralRuleFunction(this._locale),o=this._compilePattern(i,t,n,s),l=this;this.format=function(e){return l._format(o,e)}}var i=n(115),a=n(116),s=n(117),o=n(119);t["default"]=r,a.defineProperty(r,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{"short":{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},"long":{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{"short":{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},"long":{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),a.defineProperty(r,"__localeData__",{value:a.objCreate(null)}),a.defineProperty(r,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");r.__localeData__[e.locale.toLowerCase()]=e}}),a.defineProperty(r,"__parse",{value:o["default"].parse}),a.defineProperty(r,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),r.prototype.resolvedOptions=function(){return{locale:this._locale}},r.prototype._compilePattern=function(e,t,n,r){var i=new s["default"](t,n,r);return i.compile(e)},r.prototype._findPluralRuleFunction=function(e){for(var t=r.__localeData__,n=t[e.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&t[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+e)},r.prototype._format=function(e,t){var n,r,a,s,o,l="";for(n=0,r=e.length;r>n;n+=1)if(a=e[n],"string"!=typeof a){if(s=a.id,!t||!i.hop.call(t,s))throw new Error("A value must be provided for: "+s);o=t[s],l+=a.options?this._format(a.getOption(o),t):a.format(o)}else l+=a;return l},r.prototype._mergeFormats=function(e,t){var n,r,s={};for(n in e)i.hop.call(e,n)&&(s[n]=r=a.objCreate(e[n]),t&&i.hop.call(t,n)&&i.extend(r,t[n]));return s},r.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(r.defaultLocale);var t,n,i,a,s=r.__localeData__;for(t=0,n=e.length;n>t;t+=1)for(i=e[t].toLowerCase().split("-");i.length;){if(a=s[i.join("-")])return a.locale;i.pop()}var o=e.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+e.join(", ")+", or the default locale: "+o)}},function(e,t,n){"use strict";t["default"]={locale:"en",pluralRuleFunction:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":3==a&&13!=s?"few":"other":1==e&&r?"one":"other"}}},function(e,t,n){"use strict";function r(e){return 400*e/146097}var i=Math.round;t["default"]=function(e,t){e=+e,t=+t;var n=i(t-e),a=i(n/1e3),s=i(a/60),o=i(s/60),l=i(o/24),c=i(l/7),u=r(l),p=i(12*u),h=i(u);return{millisecond:n,second:a,minute:s,hour:o,day:l,week:c,month:p,year:h}}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),s=(!a&&!Object.prototype.__defineGetter__,a?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.call(e,t)||"value"in n)&&(e[t]=n.value)}),o=Object.create||function(e,t){function n(){}var i,a;n.prototype=e,i=new n;for(a in t)r.call(t,a)&&s(i,a,t[a]);return i},l=Array.prototype.indexOf||function(e,t){var n=this;if(!n.length)return-1;for(var r=t||0,i=n.length;i>r;r++)if(n[r]===e)return r;return-1},c=Array.isArray||function(e){return"[object Array]"===i.call(e)},u=Date.now||function(){return(new Date).getTime()};t.defineProperty=s,t.objCreate=o,t.arrIndexOf=l,t.isArray=c,t.dateNow=u},function(e,t,n){"use strict";function r(e){var t,n,r,a,s=Array.prototype.slice.call(arguments,1);for(t=0,n=s.length;n>t;t+=1)if(r=s[t])for(a in r)i.call(r,a)&&(e[a]=r[a]);return e}t.extend=r;var i=Object.prototype.hasOwnProperty;t.hop=i},function(e,t,n){"use strict";var r=n(115),i=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),a=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.hop.call(e,t)||"value"in n)&&(e[t]=n.value)}),s=Object.create||function(e,t){function n(){}var i,s;n.prototype=e,i=new n;for(s in t)r.hop.call(t,s)&&a(i,s,t[s]);return i};t.defineProperty=a,t.objCreate=s},function(e,t,n){"use strict";function r(e,t,n){this.locales=e,this.formats=t,this.pluralFn=n}function i(e){this.id=e}function a(e,t,n,r,i){this.id=e,this.useOrdinal=t,this.offset=n,this.options=r,this.pluralFn=i}function s(e,t,n,r){this.id=e,this.offset=t,this.numberFormat=n,this.string=r}function o(e,t){this.id=e,this.options=t}t["default"]=r,r.prototype.compile=function(e){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(e)},r.prototype.compileMessage=function(e){if(!e||"messageFormatPattern"!==e.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var t,n,r,i=e.elements,a=[];for(t=0,n=i.length;n>t;t+=1)switch(r=i[t],r.type){case"messageTextElement":a.push(this.compileMessageText(r));break;case"argumentElement":a.push(this.compileArgument(r));break;default:throw new Error("Message element does not have a valid type")}return a},r.prototype.compileMessageText=function(e){return this.currentPlural&&/(^|[^\\])#/g.test(e.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new s(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,e.value)):e.value.replace(/\\#/g,"#")},r.prototype.compileArgument=function(e){var t=e.format;if(!t)return new i(e.id);var n,r=this.formats,s=this.locales,l=this.pluralFn;switch(t.type){case"numberFormat":return n=r.number[t.style],{id:e.id,format:new Intl.NumberFormat(s,n).format};case"dateFormat":return n=r.date[t.style],{id:e.id,format:new Intl.DateTimeFormat(s,n).format};case"timeFormat":return n=r.time[t.style],{id:e.id,format:new Intl.DateTimeFormat(s,n).format};case"pluralFormat":return n=this.compileOptions(e),new a(e.id,t.ordinal,t.offset,n,l);case"selectFormat":return n=this.compileOptions(e),new o(e.id,n);default:throw new Error("Message element does not have a valid format type")}},r.prototype.compileOptions=function(e){var t=e.format,n=t.options,r={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===t.type?e:null;var i,a,s;for(i=0,a=n.length;a>i;i+=1)s=n[i],r[s.selector]=this.compileMessage(s.value);return this.currentPlural=this.pluralStack.pop(),r},i.prototype.format=function(e){return e?"string"==typeof e?e:String(e):""},a.prototype.getOption=function(e){var t=this.options,n=t["="+e]||t[this.pluralFn(e-this.offset,this.useOrdinal)];return n||t.other},s.prototype.format=function(e){var t=this.numberFormat.format(e-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+t).replace(/\\#/g,"#")},o.prototype.getOption=function(e){var t=this.options;return t[e]||t.other}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),a=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.call(e,t)||"value"in n)&&(e[t]=n.value)}),s=Object.create||function(e,t){function n(){}var i,s;n.prototype=e,i=new n;for(s in t)r.call(t,s)&&a(i,s,t[s]);return i};t.defineProperty=a,t.objCreate=s},function(e,t,n){"use strict";t=e.exports=n(121)["default"],t["default"]=t},function(e,t,n){function r(){u=!1,o.length?c=o.concat(c):p=-1,c.length&&i()}function i(){if(!u){var e=setTimeout(r);u=!0;for(var t=c.length;t;){for(o=c,c=[];++p1)for(var n=1;ni;i++)a=e.charAt(i),"\n"===a?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}return qe!==t&&(qe>t&&(qe=0,Je={line:1,column:1,seenCR:!1}),n(Je,qe,t),qe=t),Je}function r(e){$e>Ue||(Ue>$e&&($e=Ue,Ze=[]),Ze.push(e))}function i(r,i,a){function s(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?s.slice(0,-1).join(", ")+" or "+s[e.length-1]:s[0],i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}var l=n(a),c=a1?arguments[1]:{},M={},j={start:a},L=a,F=function(e){return{type:"messageFormatPattern",elements:e}},A=M,D=function(e){var t,n,r,i,a,s="";for(t=0,r=e.length;r>t;t+=1)for(i=e[t],n=0,a=i.length;a>n;n+=1)s+=i[n];return s},I=function(e){return{type:"messageTextElement",value:e}},K=/^[^ \t\n\r,.+={}#]/,O={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},R="{",z={type:"literal",value:"{",description:'"{"'},B=null,H=",",G={type:"literal",value:",",description:'","'},U="}",W={type:"literal",value:"}",description:'"}"'},q=function(e,t){return{type:"argumentElement",id:e,format:t&&t[2]}},J="number",$={type:"literal",value:"number",description:'"number"'},Z="date",X={type:"literal",value:"date",description:'"date"'},Y="time",V={type:"literal",value:"time",description:'"time"'},Q=function(e,t){return{type:e+"Format",style:t&&t[2]}},ee="plural",te={type:"literal",value:"plural",description:'"plural"'},ne=function(e){return{type:e.type,ordinal:!1,offset:e.offset||0,options:e.options}},re="selectordinal",ie={type:"literal",value:"selectordinal",description:'"selectordinal"'},ae=function(e){return{type:e.type,ordinal:!0,offset:e.offset||0,options:e.options}},se="select",oe={type:"literal",value:"select",description:'"select"'},le=function(e){return{type:"selectFormat",options:e}},ce="=",ue={type:"literal",value:"=",description:'"="'},pe=function(e,t){return{type:"optionalFormatPattern",selector:e,value:t}},he="offset:",me={type:"literal",value:"offset:",description:'"offset:"'},de=function(e){return e},fe=function(e,t){return{type:"pluralFormat",offset:e,options:t}},ge={type:"other",description:"whitespace"},ye=/^[ \t\n\r]/,ve={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},be={type:"other",description:"optionalWhitespace"},_e=/^[0-9]/,Te={type:"class",value:"[0-9]",description:"[0-9]"},ke=/^[0-9a-f]/i,Ee={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},we="0",xe={type:"literal",value:"0",description:'"0"'},Ne=/^[1-9]/,Se={type:"class",value:"[1-9]",description:"[1-9]"},Pe=function(e){return parseInt(e,10)},Ce=/^[^{}\\\0-\x1F \t\n\r]/,Me={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},je="\\#",Le={type:"literal",value:"\\#",description:'"\\\\#"'},Fe=function(){return"\\#"},Ae="\\{",De={type:"literal",value:"\\{",description:'"\\\\{"'},Ie=function(){return"{"},Ke="\\}",Oe={type:"literal",value:"\\}",description:'"\\\\}"'},Re=function(){return"}"},ze="\\u",Be={type:"literal",value:"\\u",description:'"\\\\u"'},He=function(e){return String.fromCharCode(parseInt(e,16))},Ge=function(e){return e.join("")},Ue=0,We=0,qe=0,Je={line:1,column:1,seenCR:!1},$e=0,Ze=[],Xe=0;if("startRule"in C){if(!(C.startRule in j))throw new Error("Can't start parsing from rule \""+C.startRule+'".');L=j[C.startRule]}if(P=L(),P!==M&&Ue===e.length)return P;throw P!==M&&Ue0&&e(n,c))}catch(u){s.call(o||new l(c),u)}}}function s(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&e(n,r))}function o(e,t,n,r){for(var i=0;i=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:o.call(arguments,1);return l[n]=!0,a(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(102).setImmediate,n(102).clearImmediate)},function(e,t,n){function r(){u=!1,o.length?c=o.concat(c):p=-1,c.length&&i()}function i(){if(!u){var e=setTimeout(r);u=!0;for(var t=c.length;t;){for(o=c,c=[];++p1)for(var n=1;nt;t++)l.throwIf(this.validateListening(s[t]));for(t=0;u>t;t++)h.push(s[t].listen(a(t,p),this));return i(p),n={listenable:s},n.stop=r(n,h,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){var r=n(99),i=n(95),a=n(107),s=n(108),o={preEmit:1,shouldEmit:1},l=n(109);e.exports=function(e){function t(){var t,n=0;if(this.subscriptions=[],this.emitter=new r.EventEmitter,this.eventLabel="change",l(this,e),this.init&&r.isFunction(this.init)&&this.init(),this.listenables)for(t=[].concat(this.listenables);n1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t,n){e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t,n){var r=n(99);e.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(e,t){t=t||this;var n=function(n){i||e.apply(t,n)},r=this,i=!1;return this.emitter.addListener(this.eventLabel,n),function(){i=!0,r.emitter.removeListener(r.eventLabel,n)}},promise:function(e){var t=this,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,a){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,a),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var s=e.completed.listen(function(e){s(),o(),i(e)}),o=e.failed.listen(function(e){s(),o(),a(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){e.exports={}},function(e,t,n){var r=n(99),i=n(95),a=n(107),s={preEmit:1,shouldEmit:1},o=function(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i.ActionMethods)if(!s[t]&&i.PublisherMethods[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&i.PublisherMethods[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,c={};la;++a)n=i[a],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function l(e){var t,n,r,i,a=e.split(/\r?\n/),s={};a.pop();for(var o=0,l=a.length;l>o;++o)n=a[o],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),i=y(n.slice(t+1)),s[r]=i;return s}function c(e){return e.split(/ *; */).shift()}function u(e){return f(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})}function p(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=l(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var n=this;d.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new p(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(e||i,t)})}function m(e,t){return"function"==typeof t?new h("GET",e).end(t):1==arguments.length?new h("GET",e):new h(e,t)}var d=n(119),f=n(120),g="undefined"==typeof window?this||self:window;m.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var y="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};m.serializeObject=s,m.parseString=o,m.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},m.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=c(t);var n=u(t);for(var r in n)this[r]=n[r]},p.prototype.parseBody=function(e){var t=m.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},m.Response=p,d(h.prototype),h.prototype.use=function(e){return e(this),this},h.prototype.timeout=function(e){return this._timeout=e,this},h.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.set=function(e,t){if(a(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},h.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},h.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},h.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},h.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},h.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},h.prototype.query=function(e){return"string"!=typeof e&&(e=s(e)),e&&this._query.push(e),this},h.prototype.field=function(e,t){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t),this},h.prototype.attach=function(e,t,n){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t,n),this},h.prototype.send=function(e){var t=a(e),n=this.getHeader("Content-Type");if(t&&a(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(n||this.type("json"),this)},h.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,n=this.xhr=m.getXHR(),a=this._query.join("&"),s=this._timeout,o=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var l=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=l);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=l)}catch(c){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),a&&(a=m.serializeObject(a),this.url+=~this.url.indexOf("?")?"&"+a:"?"+a),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof o&&!i(o)){var u=m.serialize[this.getHeader("Content-Type")];u&&(o=u(o))}for(var p in this.header)null!=this.header[p]&&n.setRequestHeader(p,this.header[p]);return this.emit("request",this),n.send(o),this},m.Request=h,m.get=function(e,t,n){var r=m("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.head=function(e,t,n){var r=m("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.del=function(e,t){var n=m("DELETE",e);return t&&n.end(t),n},m.patch=function(e,t,n){var r=m("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.post=function(e,t,n){var r=m("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.put=function(e,t,n){var r=m("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},e.exports=m},function(e,t,n){function r(e){return e?i(e):void 0}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;ir;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){e.exports=function(e,t,n){for(var r=0,i=e.length,a=3==arguments.length?n:e[r++];i>r;)a=t.call(null,a,e[r],++r,e);return a}},function(e,t,n){var r=n(94),i=n(93),a=n(122),s="token",o="user",l="loginTime",c="email",u=r.createStore({_data:{id:null,name:null,created:null,email:null,loginError:null},init:function(){this._data.id=a.get(s),this._data.name=a.get(o),this._data.created=a.get(l),this._data.email=a.get(c),this.listenTo(i.login.completed,this._onLoginCompleted),this.listenTo(i.login.failed,this._onLoginFailed),this.listenTo(i.logout,this._onLogout)},_onLoginCompleted:function(e,t){this._data.id=t,this._data.name=e,this._data.created=new Date,this._data.loginError=null,-1!==e.indexOf("@")&&(this._data.email=e),a.set(s,this._data.id),a.set(o,this._data.name),a.set(l,this._data.created),a.set(c,this._data.email),this.trigger(this._data)},_onLoginFailed:function(e,t){this._data.loginError={message:t.message,resolution:t.resolution},this.trigger(this._data)},_onLogout:function(){this._data.id=null,this._data.name=null,this._data.created=null,this._data.email=null,a.remove(s),a.remove(o),a.remove(l),a.remove(c),this.trigger(this._data)},getInitialState:function(){return this._data}});e.exports=u},function(e,t,n){var r={get:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},set:function(e,t,n,r,i,a){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(n)switch(n.constructor){case Number:s=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:s="; expires="+n;break;case Date:s="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+s+(i?"; domain="+i:"")+(r?"; path="+r:"")+(a?"; secure":""),!0},remove:function(e,t,n){return this.has(e)?(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0):!1},has:function(e){return e?new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie):!1},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;t>n;n++)e[n]=decodeURIComponent(e[n]);return e}};e.exports=r}]); \ No newline at end of file