webpackJsonp([3],{769:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={},r={};Object.keys(t).forEach(function(t){r[t]=c.default.findDOMNode(e.refs[t]).value}),Object.keys(t).forEach(function(e){var i=r[e],a=o(i,t[e],r);a&&(n[e]=a)});var i={value:r};return Object.keys(n).length>0&&(i.errors=n),i}function o(e,t,n){var r=void 0===e||null===e||""===e;if(r)return t.required?l.default.NotNull:null;if("string"==typeof e){var i=a(e,t);if(i)return i}if(t.email&&!d.test(e))return l.default.NotValidEmail;if(t.password&&!p.test(e)){var o=l.default.NotValidPassword;if(o)return o}if(t.validate){var s=t.validate.call(n,n);if(s)return s}return null}function a(e,t){return t.min&&e.lengtht.max?l.default.maxValue(t.max):null}Object.defineProperty(t,"__esModule",{value:!0}),t.validateForm=i;var s=n(770),l=r(s),u=n(341),c=r(u),d=/^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$/,p=/((?=.*\d)(?=.*[a-zA-Z]).{6,20})/},861:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0;){var r=e["p"+n];r&&t.push(r.name),n--}return t.join(", ")}}]),s(t,[{key:"serverRequest",value:function(e,t,n){return this.skipReq?(delete this.skipReq,null):this.props.schema.readOnly||t===this.props.value&&(this.props.resources||n)?null:{cmd:"adminUnit",params:{value:t}}}},{key:"onChange",value:function(e){var t=this;if(!this.props.onChange)return null;var n=this;return function(r){var i=n.updateResources(e,r);t.props.onChange({value:i,schema:n.props.schema})}}},{key:"updateResources",value:function(e,t){var n=t?t.id:null;if(n)e.selected=n,0===t.unitsCount&&(this.skipReq=!0);else{if(e.level>1){var r=this.props.resources[e.level-2];n=r.selected}e.selected=null,this.skipReq=!0}for(var i=e.level;i<5;i++){var o=this.props.resources[i];o&&(o.selected=null,o.list=null)}return n}},{key:"compRender",value:function(e){var t=this.props.schema||{},n="cb"+e.level,r=this,i=p.default.labelRender(e.label,t.required),o=1===e.level?this.props.errors:null,a=e.selected?e.list.find(function(t){return t.id===e.selected}):null;return u.default.createElement("div",{key:e.level},u.default.createElement(c.SelectionBox,{ref:n,help:o,bsStyle:o?"error":null,value:a,optionDisplay:"name",type:"select",label:i,onChange:r.onChange(e),noSelectionLabel:"-",options:e.list}),e.fetching&&u.default.createElement(c.WaitIcon,{type:"field"}))}},{key:"readOnlyRender",value:function(e){var n=this.props.value,r=t.displayText(n);return p.default.readOnlyRender(r,e.label)}},{key:"render",value:function(){var e=this.props.schema||{};if(e.readOnly)return this.readOnlyRender(e);if(!this.props.resources)return null;var t=this,n=this.props.resources.filter(function(e){return e.list&&e.list.length>0}).map(function(e){return t.compRender(e)});return u.default.createElement("div",null,n)}}]),t}(u.default.Component);t.default=f},864:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0}):null}},{key:"render",value:function(){var e=this.props.schema||{},t=p.default.labelRender(e.label,e.required),n=this.adjustValues();return u.default.createElement(c.SelectionBox,{ref:"selbox",value:n,errors:this.props.errors,label:t,optionDisplay:"name",mode:"multiple",options:this.props.resources,onChange:this.onChange})}}]),t}(u.default.Component);t.default=f},867:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;ne.max){var r=m.default.maxListQtt(e.max);return this.setState({qttError:r}),r}this.setState({qttError:null});var i,o=null;for(i=0;i0;n?this.refs.popup.show():this.refs.popup.hide();var r=this;n&&p.server.post("/api/session/search",{key:t,maxResults:10}).then(function(e){r.setState({items:e,fetching:!1,sel:e.length>0?e[0]:null})}).catch(function(){return r.clearKey()}),this.setState({key:t,fetching:!0})}},{key:"keyDown",value:function(e){var t=this.state.items;if(t&&0!==t.length){var n=this.state.sel?t.indexOf(this.state.sel):-1;switch(e.keyCode){case 38:return n>0&&this.setState({sel:t[n-1]}),void e.preventDefault();case 40:return n0&&t[i-1].type.startsWith("CASE");i>0&&o!==a&&n.push(u.default.createElement(c.MenuItem,{key:"s"+r.id,divider:!0})),n.push(u.default.createElement(c.MenuItem,{key:r.id,eventKey:r,active:e.state.sel===r,onSelect:e.select},u.default.createElement(d.Profile,{size:"small",type:m[r.type],title:r.title,subtitle:r.subtitle})))}),n}},{key:"render",value:function(){var e=this.state.key?this.state.key:"";return u.default.createElement("div",{className:"tb-search"},u.default.createElement(c.FormGroup,{bsClass:"form-group"},u.default.createElement(c.InputGroup,null,u.default.createElement(c.FormControl,{type:"text",value:e,placeholder:"Pesquisar...",onChange:this.keyPressed,onKeyDown:this.keyDown}),u.default.createElement(c.InputGroup.Addon,null,e?u.default.createElement("a",{onClick:this.clearKey,className:"clearbtn"},u.default.createElement(d.Fa,{icon:"close"})):u.default.createElement("i",{className:"fa fa-search"}))),u.default.createElement(d.Popup,{ref:"popup",onHide:this._popupHide},this.renderPopup())))}}]),t}(u.default.Component);t.default=y},881:function(e,t,n){var r=n(882);"string"==typeof r&&(r=[[e.id,r,""]]);n(790)(r,{});r.locals&&(e.exports=r.locals)},882:function(e,t,n){t=e.exports=n(789)(),t.push([e.id,".tb-search .form-group ::-webkit-input-placeholder{color:#333}.tb-search .form-group ::-moz-placeholder{color:#333}.tb-search .form-group :-ms-input-placeholder{color:#333}.tb-search .form-group .form-control{width:100%;background-color:#889987;border:none;box-shadow:none;color:#fff}.tb-search .form-group .clearbtn,.tb-search .form-group .input-group-addon{width:30px;background-color:#889987;color:#333;border:none}.tb-search .form-group .clearbtn{cursor:pointer}.tb-search .dropdown-menu>li.active>a{background-color:#cad4ca}.tb-search .dropdown-menu>li>a{white-space:normal!important;min-width:300px}@media (max-width:767px){.tb-search .form-group,.tb-search .input-group{width:100%}.tb-user{max-idth:100%}}@media (min-width:768px) and (max-width:991px){.tb-search .form-group,.tb-search .input-group{width:180px!important}.tb-user{max-width:150px}.navbar-brand{max-width:45px;overflow:hidden}}@media (min-width:992px) and (max-width:1199px){.tb-search .form-group,.tb-search .input-group{width:250px!important}.tb-user{max-width:200px}.navbar-brand{max-width:45px;overflow:hidden}}@media (min-width:1200px){.tb-search .form-group,.tb-search .input-group{width:380px!important}.tb-user{max-width:250px}}",""])},883:function(e,t,n){var r=n(884);"string"==typeof r&&(r=[[e.id,r,""]]);n(790)(r,{});r.locals&&(e.exports=r.locals)},884:function(e,t,n){t=e.exports=n(789)(),t.push([e.id,".toolbar{box-shadow:0 4px 6px #a0a0a0}.tb-user a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-bottom:0!important;outline:none}.tb-icon{display:block;width:28px;height:28px;border-radius:14px;background-color:#889987;float:left;margin-right:4px;position:relative;top:-4px}.tb-icon i{width:28px;text-align:center;font-size:1.2em;padding-top:5px;color:#fff}.navbar-nav a:hover .tb-icon{background-color:#f0f0f0}.navbar-nav a:hover .tb-icon i{color:#889987}@media (max-width:767px){.tb-user{max-idth:100%}}@media (min-width:768px) and (max-width:991px){.tb-user{max-width:150px}}@media (min-width:992px) and (max-width:1199px){.tb-user{max-width:200px}}@media (min-width:1200px){.tb-user{max-width:250px}}",""])},885:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;nr&&(r=e.level)}),n.setState({cslist:t.csList,maxlevel:r})}return t.list})}},{key:"onEditorEvent",value:function(e){"ok"===e.type?this.onSave():this.onCancelEditor()}},{key:"onSave",value:function(){var e=this,t=this,n=this.state.doc,r={name:n.name,parentId:n.parentId&&n.parentId.p0?n.parentId.p0.id:null,countryStructure:n.countryStructure,customId:n.customId},i=void 0;return n.level=this.state.level,n.parent=this.state.parent,i=n.id?E.update(n.id,r).then(function(){return t.tvhandler.updateNode(e.state.item,n)}):E.create(r).then(function(r){n.id=r,n.unitsCount=0,n.countryStructure=e.state.cslist.find(function(e){return e.id===n.countryStructure}),t.tvhandler.addNode(t.state.parent,n)}),i.then(function(){return t.setState({editing:!1})})}},{key:"onCancelEditor",value:function(){this.setState({editing:!1})}},{key:"onCsToggle",value:function(){this.setState({showcs:!this.state.showcs})}},{key:"getEditorDef",value:function(){return{controls:[{property:"name",required:!0,type:"string",max:200,label:"Nome",size:{md:6}},{property:"parentId",type:"adminUnit",label:"Parent unit",readOnly:!0,size:{md:6}},{property:"countryStructure",type:"select",label:"Unidade admin.",options:this.getCsOptions(this.state.level),required:!0,size:{md:6,newLine:!0}},{property:"customId",type:"string",max:50,label:"Identificação personalizada",size:{md:6}}],title:function(e){return e&&e.id?"Editar dados da unidade administrativa":"Nova unidade administrativa"}}}},{key:"render",value:function(){var e=this.state?this.state:{},t=u.default.createElement(c.Row,{key:"title",className:"title"},u.default.createElement("div",{style:{textWeight:"bold"}},u.default.createElement(c.Col,{xs:7},"Nome"),u.default.createElement(c.Col,{xs:3},"Localização"))),n=e.editing,r=this.state.showcs?"Esconder estrutura do país":"Exibir estrutura do país",i=u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:7},u.default.createElement("h4",null,"Unidades administrativas")),u.default.createElement(c.Col,{sm:5},u.default.createElement(c.Button,{block:!0,onClick:this.onCsToggle},r)));return u.default.createElement("div",null,e.showcs&&u.default.createElement(g.default,null),n&&u.default.createElement(c.Collapse,{in:!0,transitionAppear:!0},u.default.createElement("div",null,u.default.createElement(d.FormDialog,{schema:this.getEditorDef(),onConfirm:this.onSave,onCancel:this.onCancelEditor,doc:this.state.doc,wrapType:"card"}))),u.default.createElement(d.Card,{header:i},u.default.createElement(c.Grid,{fluid:!0},u.default.createElement(m.default,{key:e.root?e.root.key:-1,onGetNodes:this.loadNodes,root:[e.root],innerRender:this.renderNode,outerRender:this.nodeWrapper,nodeInfo:this.nodeInfo,onInit:this.onInitTree,title:t}))))}}]),t}(u.default.Component);t.default=k},890:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0&&u.default.createElement("div",{className:"pull-left"},u.default.createElement(C.default,{controller:e,counterOnly:!0}))),n&&u.default.createElement(c.Col,{sm:2},u.default.createElement("div",{className:"pull-right"},n)))}},{key:"render",value:function(){var e=this.state.controller;return u.default.createElement("div",null,u.default.createElement(k.default,{controller:e,openOnNew:!0,wrapType:this.props.modal?"modal":"card"}),u.default.createElement(d.Card,{header:this.headerRender(),padding:this.props.combine?"combine":"default"},u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:12},u.default.createElement("div",null,u.default.createElement(h.default,{controller:e}),this.props.pageSize&&u.default.createElement("span",null,u.default.createElement(C.default,{controller:e,className:"pull-right"}),u.default.createElement(y.default,{controller:e})),u.default.createElement(b.default,{controller:e,cellSize:this.props.cellSize,options:this.props.options,onRender:this.props.onCellRender,onExpandRender:this.props.onDetailRender,modal:this.props.modal}),this.props.pageSize&&u.default.createElement(y.default,{controller:e}))))))}}]),t}(u.default.Component);t.default=S,S.defaultProps={search:!1,modal:!1,paging:!1,cellSize:{md:6}}},893:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;nn.options.pageSize&&s.pop(),n.result.list=s,r._raise(a.list,n.result);else{var l=s.findIndex(function(t){return e===r.resolveId(t)});s[l]=o,r._raise(a.itemUpdated,{id:e,item:o})}var u=e?"Informações atualizadas com sucesso":"Registro criado com sucesso";r.showMessage(u)})}},{key:"showMessage",value:function(e,t){this._raise(a.showMsg,{msg:e,type:t})}},{key:"hideMessage",value:function(){this.showMessage(null)}},{key:"isFormOpen",value:function(){return!!this.frm}},{key:"isNewForm",value:function(){return!(this.frm&&this.frm.item)}},{key:"getFormItemId",value:function(){return this.frm?this.frm.id:null}},{key:"getFormSchema",value:function(){return this.frm?this.frm.schema:null}},{key:"initDelete",value:function(e){this.item=e;var t={item:e,title:"Excluir",msg:"Confirma exclusão?"};this.hideMessage(),this._raise(a.confirmDelete,t)}},{key:"confirmDelete",value:function(){var e=this;return this.crud.delete(this.item.id).then(function(t){return t.errors?e.showMessage(t.errors,"error"):e.refreshList().then(function(){return e.showMessage("Registro excluído com sucesso")})})}},{key:"gotoPage",value:function(e){this.frm&&this.closeForm();var t=Object.assign(this.result.query,{pageSize:this.options.pageSize,page:e});return this._queryList(t)}},{key:"isPaging",value:function(){return!!this.options.pageSize}},{key:"getPage",value:function(){return this.result&&this.result.page}},{key:"getPageIni",value:function(){return this.result.page*this.options.pageSize}},{key:"getPageEnd",value:function(){return this.getPageIni()+this.options.pageSize-1}},{key:"getPageCount",value:function(){return this.result&&this.result.pageCount}},{key:"getCount",value:function(){return this.result&&this.result.count}},{key:"getList",value:function(){return this.result&&this.result.list}},{key:"isFetching",value:function(){return this.state===a.fetchingList}},{key:"getState",value:function(){return this.state}},{key:"getServerResult",value:function(){return this.result&&this.result.serverData}},{key:"_raise",value:function(e,t){this.state=e,this.listeners.forEach(function(n){return n(e,t)})}},{key:"_queryList",value:function(e){var t=this;this._raise(a.fetchingList);var n=this;return this.crud.query(e).then(function(r){var i=!!n.options.pageSize,o={count:r.count,list:r.list,pageCount:i?Math.ceil(r.count/t.options.pageSize):null,page:e.page,query:e,serverData:r};return n.result=o,i&&n._raise(a.page,o),n._raise(a.list,o),n.hideMessage(),o}).catch(function(e){n._raise(a.error,e)})}}]),e}();t.default=s},899:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?e.getCount():"-");if(!e.getCount())return u.default.createElement(c.Alert,{bsStyle:"warning"},"Nenhum registro encontrado");var t=" Registro(s) encontrado(s)",n=this.props.className?this.props.className:"text-muted";return e.isPaging()&&e.getCount()>e.options.pageSize?u.default.createElement("div",{className:n},u.default.createElement("b",null,e.getPageIni()+1)," - ",u.default.createElement("b",null,e.getPageEnd()+1)," of ",u.default.createElement("b",null,e.getCount()),t):u.default.createElement("span",{className:n},u.default.createElement("b",null,e.getCount()),t)}}]),t}(u.default.Component);t.default=(0,p.default)(f)},901:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?u.default.createElement("span",null,u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:6},u.default.createElement(g.default,{controller:e,className:"mtop-2x text-muted"})),u.default.createElement(c.Col,{sm:6},u.default.createElement(v.default,{controller:this.state.controller,showCounter:!0,className:"pull-right"}))),u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:12,className:"mtop-2x"},u.default.createElement(d.ReactGrid,{values:e.getList(),onCollapseRender:this.cellRender,onReactCellClick:this.onCellClick}))),u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:12},u.default.createElement(v.default,{controller:this.state.controller,showCounter:!0,className:"pull-right"})))):null)}}]),t}(u.default.Component);t.default=C},929:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n{point.name}: {point.percentage:.1f} %",style:{color:p.theme&&p.theme.contrastTextColor||"black"}}}},series:t,xAxis:{categories:this.props.series[0].values.map(function(e){return e.name})}};return"pie"===e&&(n.tooltip={pointFormat:"{series.name}: {point.percentage:.1f}%"}),n}},{key:"render",value:function(){var e=this.config();return u.default.createElement("div",{style:{marginTop:"0"}},u.default.createElement(d.default,{config:e}))}}]),t}(u.default.Component);t.default=f},934:function(e,t,n){!function(t,r){e.exports=r(n(314),n(935))}(this,function(e,t){return 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){e.exports=n(3)},function(t,n){t.exports=e},function(e,t,n){(function(t){"use strict";var r=Object.assign||function(e){for(var t=1;tparseInt(n.split("Firefox/")[1],10);return e.Highcharts?e.Highcharts.error(16,!0):{product:"Highcharts",version:"5.0.7",deg2rad:2*Math.PI/360,doc:t,hasBidiBug:s,hasTouch:t&&void 0!==t.documentElement.ontouchstart,isMS:i,isWebKit:/AppleWebKit/.test(n),isFirefox:a,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(n),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:r,vml:o,win:e,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}(),function(e){var t=[],n=e.charts,r=e.doc,i=e.win;e.error=function(t,n){if(t=e.isNumber(t)?"Highcharts error #"+t+": www.highcharts.com/errors/"+t:t,n)throw Error(t);i.console&&console.log(t)},e.Fx=function(e,t,n){this.options=t,this.elem=e,this.prop=n},e.Fx.prototype={dSetter:function(){var e,t=this.paths[0],n=this.paths[1],r=[],i=this.now,o=t.length;if(1===i)r=this.toD;else if(o===n.length&&1>i)for(;o--;)e=parseFloat(t[o]),r[o]=isNaN(e)?t[o]:i*parseFloat(n[o]-e)+e;else r=n;this.elem.attr("d",r,null,!0)},update:function(){var e=this.elem,t=this.prop,n=this.now,r=this.options.step;this[t+"Setter"]?this[t+"Setter"]():e.attr?e.element&&e.attr(t,n,null,!0):e.style[t]=n+this.unit,r&&r.call(e,n,this)},run:function(e,n,r){var i,o=this,a=function(e){return!a.stopped&&o.step(e)};this.startTime=+new Date,this.start=e,this.end=n,this.unit=r,this.now=this.start,this.pos=0,a.elem=this.elem,a.prop=this.prop,a()&&1===t.push(a)&&(a.timerId=setInterval(function(){for(i=0;i=a+this.startTime){this.now=this.end,this.pos=1,this.update(),e=s[this.prop]=!0;for(i in s)!0!==s[i]&&(e=!1);e&&o&&o.call(t),t=!1}else this.pos=r.easing((n-this.startTime)/a),this.now=this.start+(this.end-this.start)*this.pos,this.update(),t=!0;return t},initPath:function(t,n,r){function i(e){var t,n;for(c=e.length;c--;)t="M"===e[c]||"L"===e[c],n=/[a-zA-Z]/.test(e[c+3]),t&&n&&e.splice(c+1,0,e[c+1],e[c+2],e[c+1],e[c+2])}function o(e,t){for(;e.lengths?"AM":"PM",P:12>s?"am":"pm",S:m(a.getSeconds()),L:m(Math.round(n%1e3),3)},e.dateFormats);for(i in o)for(;-1!==t.indexOf("%"+i);)t=t.replace("%"+i,"function"==typeof o[i]?o[i](n):o[i]);return r?t.substr(0,1).toUpperCase()+t.substr(1):t},e.formatSingle=function(t,n){var r=/\.([0-9])/,i=e.defaultOptions.lang;return/f$/.test(t)?(r=(r=t.match(r))?r[1]:-1,null!==n&&(n=e.numberFormat(n,r,i.decimalPoint,-1=r&&(n=[1/r]))),i=0;i=t||!o&&a<=(n[i]+(n[i+1]||n[i]))/2));i++);return s=e.correctFloat(s*r,-Math.round(Math.log(.001)/Math.LN10))},e.stableSort=function(e,t){var n,r,i=e.length;for(r=0;rn&&(n=e[t]);return n},e.destroyObjectProperties=function(e,t){for(var n in e)e[n]&&e[n]!==t&&e[n].destroy&&e[n].destroy(),delete e[n]},e.discardElement=function(t){var n=e.garbageBin;n||(n=e.createElement("div")),t&&n.appendChild(t),n.innerHTML=""},e.correctFloat=function(e,t){return parseFloat(e.toPrecision(t||14))},e.setAnimation=function(t,n){n.renderer.globalAnimation=e.pick(t,n.options.chart.animation,!0)},e.animObject=function(t){return e.isObject(t)?e.merge(t):{duration:t?500:0}},e.timeUnits={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},e.numberFormat=function(t,n,r,i){t=+t||0,n=+n;var o,a,s=e.defaultOptions.lang,l=(t.toString().split(".")[1]||"").length;return-1===n?n=Math.min(l,20):e.isNumber(n)||(n=2),a=(Math.abs(t)+Math.pow(10,-Math.max(n,l)-1)).toFixed(n),l=String(e.pInt(a)),o=3t?"-":"")+(o?l.substr(0,o)+i:""),t+=l.substr(o).replace(/(\d{3})(?=\d)/g,"$1"+i),n&&(t+=r+a.slice(-n)),t},Math.easeInOutSine=function(e){return-.5*(Math.cos(Math.PI*e)-1)},e.getStyle=function(t,n){return"width"===n?Math.min(t.offsetWidth,t.scrollWidth)-e.getStyle(t,"padding-left")-e.getStyle(t,"padding-right"):"height"===n?Math.min(t.offsetHeight,t.scrollHeight)-e.getStyle(t,"padding-top")-e.getStyle(t,"padding-bottom"):(t=i.getComputedStyle(t,void 0))&&e.pInt(t.getPropertyValue(n))},e.inArray=function(e,t){return t.indexOf?t.indexOf(e):[].indexOf.call(t,e)},e.grep=function(e,t){return[].filter.call(e,t)},e.find=function(e,t){return[].find.call(e,t)},e.map=function(e,t){for(var n=[],r=0,i=e.length;rr;r++)i[r]+=o(255*e),0>i[r]&&(i[r]=0),255n.width)&&(n={width:0,height:0})}else n=this.htmlGetBBox();if(s.isSVG&&(e=n.width,s=n.height,u&&"11px"===u.fontSize&&17===Math.round(s)&&(n.height=s=14),t&&(n.width=Math.abs(s*Math.sin(r))+Math.abs(e*Math.cos(r)),n.height=Math.abs(s*Math.cos(r))+Math.abs(e*Math.sin(r)))),a&&0]*>/g,"")))},textSetter:function(e){e!==this.textStr&&(delete this.bBox,this.textStr=e,this.added&&this.renderer.buildText(this))},fillSetter:function(e,t,n){"string"==typeof e?n.setAttribute(t,e):e&&this.colorGradient(e,t,n)},visibilitySetter:function(e,t,n){"inherit"===e?n.removeAttribute(t):n.setAttribute(t,e)},zIndexSetter:function(e,t){var n,r,i=this.renderer,o=this.parentGroup,a=(o||i).element||i.box,s=this.element;n=this.added;var l;if(c(e)&&(s.zIndex=e,e=+e,this[t]===e&&(n=!1),this[t]=e),n){for((e=this.zIndex)&&o&&(o.handleZ=!0),t=a.childNodes,l=0;le||!c(e)&&c(n)||0>e&&!c(n)&&a!==i.box)&&(a.insertBefore(s,o),r=!0);r||a.appendChild(s)}return r},_defaultSetter:function(e,t,n){n.setAttribute(t,e)}},t.prototype.yGetter=t.prototype.xGetter,t.prototype.translateXSetter=t.prototype.translateYSetter=t.prototype.rotationSetter=t.prototype.verticalAlignSetter=t.prototype.scaleXSetter=t.prototype.scaleYSetter=function(e,t){this[t]=e,this.doTransform=!0},t.prototype["stroke-widthSetter"]=t.prototype.strokeSetter=function(e,n,r){this[n]=e,this.stroke&&this["stroke-width"]?(t.prototype.fillSetter.call(this,this.stroke,"stroke",r),r.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===n&&0===e&&this.hasStroke&&(r.removeAttribute("stroke"),this.hasStroke=!1)},n=e.SVGRenderer=function(){this.init.apply(this,arguments)},n.prototype={Element:t,SVG_NS:N,init:function(e,t,n,i,a,s){var u;i=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"}).css(this.getStyle(i)),u=i.element,e.appendChild(u),-1===e.innerHTML.indexOf("xmlns")&&o(u,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=u,this.boxWrapper=i,this.alignedObjects=[],this.url=(E||O)&&f.getElementsByTagName("base").length?A.location.href.replace(/#.*?$/,"").replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(f.createTextNode("Created with Highcharts 5.0.7")),this.defs=this.createElement("defs").add(),this.allowHTML=s,this.forExport=a,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(t,n,!1);var c;E&&e.getBoundingClientRect&&(t=function(){l(e,{left:0,top:0}),c=e.getBoundingClientRect(),l(e,{left:Math.ceil(c.left)-c.left+"px",top:Math.ceil(c.top)-c.top+"px"})},t(),this.unSubPixelFix=r(A,"resize",t))},getStyle:function(e){return this.style=m({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},e)},setStyle:function(e){this.boxWrapper.css(this.getStyle(e))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var e=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),p(this.gradients||{}),this.gradients=null,e&&(this.defs=e.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},createElement:function(e){var t=new this.Element;return t.init(this,e),t},draw:S,getRadialAttr:function(e,t){return{cx:e[0]-e[2]/2+t.cx*e[2],cy:e[1]-e[2]/2+t.cy*e[2],r:t.r*e[2]}},buildText:function(e){var t,n,r,i,a,s=e.element,u=this,c=u.forExport,d=P(e.textStr,"").toString(),p=-1!==d.indexOf("<"),m=s.childNodes,y=o(s,"x"),b=e.styles,g=e.textWidth,w=b&&b.lineHeight,E=b&&b.textOutline,k=b&&"ellipsis"===b.textOverflow,x=b&&"nowrap"===b.whiteSpace,C=b&&b.fontSize,O=m.length,b=g&&!e.added&&this.box,_=function(e){var t;return t=/(px|em)$/.test(e&&e.style.fontSize)?e.style.fontSize:C||u.style.fontSize||12,w?T(w):u.fontMetrics(t,e.getAttribute("style")?e:s).h};if(a=[d,k,x,w,E,C,g].join(),a!==e.textCache){for(e.textCache=a;O--;)s.removeChild(m[O]);p||E||k||g||-1!==d.indexOf(" ")?(t=/<.*class="([^"]+)".*>/,n=/<.*style="([^"]+)".*>/,r=/<.*href="(http[^"]+)".*>/,b&&b.appendChild(s),d=p?d.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,'').replace(//g,"").split(//g):[d],d=v(d,function(e){return""!==e}),h(d,function(a,d){var p,m=0;a=a.replace(/^\s+|\s+$/g,"").replace(//g,"|||"),p=a.split("|||"),h(p,function(a){if(""!==a||1===p.length){var h,v,b={},w=f.createElementNS(u.SVG_NS,"tspan");if(t.test(a)&&(h=a.match(t)[1],o(w,"class",h)),n.test(a)&&(v=a.match(n)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),o(w,"style",v)),r.test(a)&&!c&&(o(w,"onclick",'location.href="'+a.match(r)[1]+'"'),l(w,{cursor:"pointer"})),a=(a.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">")," "!==a){if(w.appendChild(f.createTextNode(a)),m?b.dx=0:d&&null!==y&&(b.x=y),o(w,b),s.appendChild(w),!m&&d&&(!j&&c&&l(w,{display:"block"}),o(w,"dy",_(w))),g){b=a.replace(/([^\^])-/g,"$1- ").split(" "),h=1g,void 0===i&&(i=E),k&&i?(M/=2,""===T||!E&&.5>M?b=[]:(T=a.substring(0,T.length+(E?-1:1)*Math.ceil(M)),b=[T+(3g&&(g=C)),b.length&&w.appendChild(f.createTextNode(b.join(" ").replace(/- /g,"-")));e.rotation=P}m++}}})}),i&&e.attr("title",e.textStr),b&&b.removeChild(s),E&&e.applyTextOutline&&e.applyTextOutline(E)):s.appendChild(f.createTextNode(d.replace(/</g,"<").replace(/>/g,">")))}},getContrast:function(e){return e=s(e).rgba,510n?i>t+a&&is?i>t+a&&ir&&s>e+a&&si&&s>e+a&&se?e+3:Math.round(1.2*e),{h:t,b:Math.round(.8*t),f:e}},rotCorr:function(e,t,n){var r=e;return t&&n&&(r=Math.max(r*Math.cos(t*d),4)),{x:-e/3*Math.sin(t*d),y:r}},label:function(e,n,r,i,o,a,s,l,u){var d,p,f,y,v,b,g,w,E,k,x,C,O,S=this,P=S.g("button"!==u&&"label"),T=P.text=S.text("",0,0,s).attr({zIndex:1}),R=0,j=3,N=0,I={},A=/^url\((.*?)\)$/.test(i),D=A;u&&P.addClass("highcharts-"+u),D=A,k=function(){return(w||0)%2/2},x=function(){var e=T.element.style,t={};p=(void 0===f||void 0===y||g)&&c(T.textStr)&&T.getBBox(),P.width=(f||p.width||0)+2*j+N,P.height=(y||p.height||0)+2*j,E=j+S.fontMetrics(e&&e.fontSize,T).b,D&&(d||(P.box=d=S.symbols[i]||A?S.symbol(i):S.rect(),d.addClass(("button"===u?"":"highcharts-label-box")+(u?" highcharts-"+u+"-box":"")), d.add(P),e=k(),t.x=e,t.y=(l?-E:0)+e),t.width=Math.round(P.width),t.height=Math.round(P.height),d.attr(m(t,I)),I={})},C=function(){var e,t=N+j;e=l?0:E,c(f)&&p&&("center"===g||"right"===g)&&(t+={center:.5,right:1}[g]*(f-p.width)),t===T.x&&e===T.y||(T.attr("x",t),void 0!==e&&T.attr("y",e)),T.x=t,T.y=e},O=function(e,t){d?d.attr(e,t):I[e]=t},P.onAdd=function(){T.add(P),P.attr({text:e||0===e?e:"",x:n,y:r}),d&&c(o)&&P.attr({anchorX:o,anchorY:a})},P.widthSetter=function(e){f=e},P.heightSetter=function(e){y=e},P["text-alignSetter"]=function(e){g=e},P.paddingSetter=function(e){c(e)&&e!==j&&(j=P.padding=e,C())},P.paddingLeftSetter=function(e){c(e)&&e!==N&&(N=e,C())},P.alignSetter=function(e){e={left:0,center:.5,right:1}[e],e!==R&&(R=e,p&&P.attr({x:v}))},P.textSetter=function(e){void 0!==e&&T.textSetter(e),x(),C()},P["stroke-widthSetter"]=function(e,t){e&&(D=!0),w=this["stroke-width"]=e,O(t,e)},P.strokeSetter=P.fillSetter=P.rSetter=function(e,t){"fill"===t&&e&&(D=!0),O(t,e)},P.anchorXSetter=function(e,t){o=e,O(t,Math.round(e)-k()-v)},P.anchorYSetter=function(e,t){a=e,O(t,e-b)},P.xSetter=function(e){P.x=e,R&&(e-=R*((f||p.width)+2*j)),v=Math.round(e),P.attr("translateX",v)},P.ySetter=function(e){b=P.y=Math.round(e),P.attr("translateY",b)};var z=P.css;return m(P,{css:function(e){if(e){var t={};e=_(e),h(P.textProps,function(n){void 0!==e[n]&&(t[n]=e[n],delete e[n])}),T.css(t)}return z.call(P,e)},getBBox:function(){return{width:p.width+2*j,height:p.height+2*j,x:p.x-j,y:p.y-j}},shadow:function(e){return e&&(x(),d&&d.shadow(e)),P},destroy:function(){M(P.element,"mouseenter"),M(P.element,"mouseleave"),T&&(T=T.destroy()),d&&(d=d.destroy()),t.prototype.destroy.call(P),P=S=x=C=O=null}})}},e.Renderer=n}(e),function(e){var t=e.attr,n=e.createElement,r=e.css,i=e.defined,o=e.each,a=e.extend,s=e.isFirefox,l=e.isMS,u=e.isWebKit,c=e.pInt,d=e.SVGRenderer,p=e.win,f=e.wrap;a(e.SVGElement.prototype,{htmlCss:function(e){var t=this.element;return(t=e&&"SPAN"===t.tagName&&e.width)&&(delete e.width,this.textWidth=t,this.updateTransform()),e&&"ellipsis"===e.textOverflow&&(e.whiteSpace="nowrap",e.overflow="hidden"),this.styles=a(this.styles,e),r(this.element,e),this},htmlGetBBox:function(){var e=this.element;return"text"===e.nodeName&&(e.style.position="absolute"),{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var e=this.renderer,t=this.element,n=this.translateX||0,a=this.translateY||0,s=this.x||0,l=this.y||0,d=this.textAlign||"left",p={left:0,center:.5,right:1}[d],f=this.styles;if(r(t,{marginLeft:n,marginTop:a}),this.shadows&&o(this.shadows,function(e){r(e,{marginLeft:n+1,marginTop:a+1})}),this.inverted&&o(t.childNodes,function(n){e.invertChild(n,t)}),"SPAN"===t.tagName){var h=this.rotation,m=c(this.textWidth),y=f&&f.whiteSpace,v=[h,d,t.innerHTML,this.textWidth,this.textAlign].join();v!==this.cTT&&(f=e.fontMetrics(t.style.fontSize).b,i(h)&&this.setSpanRotation(h,p,f),r(t,{width:"",whiteSpace:y||"nowrap"}),t.offsetWidth>m&&/[ \-]/.test(t.textContent||t.innerText)&&r(t,{width:m+"px",display:"block",whiteSpace:y||"normal"}),this.getSpanCorrection(t.offsetWidth,f,p,h,d)),r(t,{left:s+(this.xCorr||0)+"px",top:l+(this.yCorr||0)+"px"}),u&&(f=t.offsetHeight),this.cTT=v}}else this.alignOnAdd=!0},setSpanRotation:function(e,t,n){var i={},o=l?"-ms-transform":u?"-webkit-transform":s?"MozTransform":p.opera?"-o-transform":"";i[o]=i.transform="rotate("+e+"deg)",i[o+(s?"Origin":"-origin")]=i.transformOrigin=100*t+"% "+n+"px",r(this.element,i)},getSpanCorrection:function(e,t,n){this.xCorr=-e*n,this.yCorr=-t}}),a(d.prototype,{html:function(e,r,i){var s=this.createElement("span"),l=s.element,u=s.renderer,c=u.isSVG,d=function(e,t){o(["opacity","visibility"],function(n){f(e,n+"Setter",function(e,n,r,i){e.call(this,n,r,i),t[r]=n})})};return s.textSetter=function(e){e!==l.innerHTML&&delete this.bBox,l.innerHTML=this.textStr=e,s.htmlUpdateTransform()},c&&d(s,s.element.style),s.xSetter=s.ySetter=s.alignSetter=s.rotationSetter=function(e,t){"align"===t&&(t="textAlign"),s[t]=e,s.htmlUpdateTransform()},s.attr({text:e,x:Math.round(r),y:Math.round(i)}).css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize,position:"absolute"}),l.style.whiteSpace="nowrap",s.css=s.htmlCss,c&&(s.add=function(e){var r,i=u.box.parentNode,c=[];if(this.parentGroup=e){if(r=e.div,!r){for(;e;)c.push(e),e=e.parentGroup;o(c.reverse(),function(e){var o,l=t(e.element,"class");l&&(l={className:l}),r=e.div=e.div||n("div",l,{position:"absolute",left:(e.translateX||0)+"px",top:(e.translateY||0)+"px",display:e.display,opacity:e.opacity,pointerEvents:e.styles&&e.styles.pointerEvents},r||i),o=r.style,a(e,{on:function(){return s.on.apply({element:c[0].div},arguments),e},translateXSetter:function(t,n){o.left=t+"px",e[n]=t,e.doTransform=!0},translateYSetter:function(t,n){o.top=t+"px",e[n]=t,e.doTransform=!0}}),d(e,o)})}}else r=i;return r.appendChild(l),s.added=!0,s.alignOnAdd&&s.htmlUpdateTransform(),s}),s}})}(e),function(e){var t,n,r=e.createElement,i=e.css,o=e.defined,a=e.deg2rad,s=e.discardElement,l=e.doc,u=e.each,c=e.erase,d=e.extend;t=e.extendClass;var p=e.isArray,f=e.isNumber,h=e.isObject,m=e.merge;n=e.noop;var y=e.pick,v=e.pInt,b=e.SVGElement,g=e.SVGRenderer,w=e.win;e.svg||(n={docMode8:l&&8===l.documentMode,init:function(e,t){var n=["<",t,' filled="f" stroked="f"'],i=["position: ","absolute",";"],o="div"===t;("shape"===t||o)&&i.push("left:0;top:0;width:1px;height:1px;"),i.push("visibility: ",o?"hidden":"visible"),n.push(' style="',i.join(""),'"/>'),t&&(n=o||"span"===t||"img"===t?n.join(""):e.prepVML(n),this.element=r(n)),this.renderer=e},add:function(e){var t=this.renderer,n=this.element,r=t.box,i=e&&e.inverted,r=e?e.element||e:r;return e&&(this.parentGroup=e),i&&t.invertChild(n,r),r.appendChild(n),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this.className&&this.attr("class",this.className),this},updateTransform:b.prototype.htmlUpdateTransform,setSpanRotation:function(){var e=this.rotation,t=Math.cos(e*a),n=Math.sin(e*a);i(this.element,{filter:e?["progid:DXImageTransform.Microsoft.Matrix(M11=",t,", M12=",-n,", M21=",n,", M22=",t,", sizingMethod='auto expand')"].join(""):"none"})},getSpanCorrection:function(e,t,n,r,o){var s,l=r?Math.cos(r*a):1,u=r?Math.sin(r*a):0,c=y(this.elemHeight,this.element.offsetHeight);this.xCorr=0>l&&-e,this.yCorr=0>u&&-c,s=0>l*u,this.xCorr+=u*t*(s?1-n:n),this.yCorr-=l*t*(r?s?n:1-n:1),o&&"left"!==o&&(this.xCorr-=e*n*(0>l?-1:1),r&&(this.yCorr-=c*n*(0>u?-1:1)),i(this.element,{textAlign:o}))},pathToVML:function(e){for(var t=e.length,n=[];t--;)f(e[t])?n[t]=Math.round(10*e[t])-5:"Z"===e[t]?n[t]="x":(n[t]=e[t],!e.isArc||"wa"!==e[t]&&"at"!==e[t]||(n[t+5]===n[t+7]&&(n[t+7]+=e[t+7]>e[t+5]?1:-1),n[t+6]===n[t+8]&&(n[t+8]+=e[t+8]>e[t+6]?1:-1)));return n.join(" ")||"x"},clip:function(e){var t,n=this;return e?(t=e.members,c(t,n),t.push(n),n.destroyClip=function(){c(t,n)},e=e.getCSS(n)):(n.destroyClip&&n.destroyClip(),e={clip:n.docMode8?"inherit":"rect(auto)"}),n.css(e)},css:b.prototype.htmlCss,safeRemoveChild:function(e){e.parentNode&&s(e)},destroy:function(){return this.destroyClip&&this.destroyClip(),b.prototype.destroy.apply(this)},on:function(e,t){return this.element["on"+e]=function(){var e=w.event;e.target=e.srcElement,t(e)},this},cutOffPath:function(e,t){var n;return e=e.split(/[ ,]/),n=e.length,9!==n&&11!==n||(e[n-4]=e[n-2]=v(e[n-2])-10*t),e.join(" ")},shadow:function(e,t,n){var i,o,a,s,l,u,c,d=[],p=this.element,f=this.renderer,h=p.style,m=p.path;if(m&&"string"!=typeof m.value&&(m="x"),l=m,e){for(u=y(e.width,3),c=(e.opacity||.15)/u,i=1;3>=i;i++)s=2*u+1-2*i,n&&(l=this.cutOffPath(m.value,s+.5)),a=[''],o=r(f.prepVML(a),null,{left:v(h.left)+y(e.offsetX,1),top:v(h.top)+y(e.offsetY,1)}),n&&(o.cutOff=s+1),a=[''],r(f.prepVML(a),null,null,o),t?t.element.appendChild(o):p.parentNode.insertBefore(o,p),d.push(o);this.shadows=d}return this},updateShadows:n,setAttr:function(e,t){this.docMode8?this.element[e]=t:this.element.setAttribute(e,t)},classSetter:function(e){(this.added?this.element:this).className=e},dashstyleSetter:function(e,t,n){(n.getElementsByTagName("stroke")[0]||r(this.renderer.prepVML([""]),null,null,n))[t]=e||"solid",this[t]=e},dSetter:function(e,t,n){var r=this.shadows;if(e=e||[],this.d=e.join&&e.join(" "),n.path=e=this.pathToVML(e),r)for(n=r.length;n--;)r[n].path=r[n].cutOff?this.cutOffPath(e,r[n].cutOff):e;this.setAttr(t,e)},fillSetter:function(e,t,n){var r=n.nodeName;"SPAN"===r?n.style.color=e:"IMG"!==r&&(n.filled="none"!==e,this.setAttr("fillcolor",this.renderer.color(e,n,t,this)))},"fill-opacitySetter":function(e,t,n){r(this.renderer.prepVML(["<",t.split("-")[0],' opacity="',e,'"/>']),null,null,n)},opacitySetter:n,rotationSetter:function(e,t,n){n=n.style,this[t]=n[t]=e,n.left=-Math.round(Math.sin(e*a)+1)+"px",n.top=Math.round(Math.cos(e*a))+"px"},strokeSetter:function(e,t,n){this.setAttr("strokecolor",this.renderer.color(e,n,t,this))},"stroke-widthSetter":function(e,t,n){n.stroked=!!e,this[t]=e,f(e)&&(e+="px"),this.setAttr("strokeweight",e)},titleSetter:function(e,t){this.setAttr(t,e)},visibilitySetter:function(e,t,n){"inherit"===e&&(e="visible"),this.shadows&&u(this.shadows,function(n){n.style[t]=e}),"DIV"===n.nodeName&&(e="hidden"===e?"-999em":0,this.docMode8||(n.style[t]=e?"visible":"hidden"),t="top"),n.style[t]=e},xSetter:function(e,t,n){this[t]=e,"x"===t?t="left":"y"===t&&(t="top"),this.updateClipping?(this[t]=e,this.updateClipping()):n.style[t]=e},zIndexSetter:function(e,t,n){n.style[t]=e}},n["stroke-opacitySetter"]=n["fill-opacitySetter"],e.VMLElement=n=t(b,n),n.prototype.ySetter=n.prototype.widthSetter=n.prototype.heightSetter=n.prototype.xSetter,n={Element:n,isIE8:-1'],r(c.prepVML(s),null,null,n)};if(m=t[0],k=t[t.length-1],0k[0]&&t.push([1,k[1]]),u(t,function(t,n){d.test(t[1])?(a=e.color(t[1]),f=a.get("rgb"),h=a.get("a")):(f=t[1],h=1),x.push(100*t[0]+"% "+f),n?(v=h,b=f):(y=h,g=f)}),"fill"===i)if("gradient"===l)i=w.x1||w[0]||0,t=w.y1||w[1]||0,m=w.x2||w[2]||0,w=w.y2||w[3]||0,E='angle="'+(90-180*Math.atan((w-t)/(m-i))/Math.PI)+'"',C();else{var O,p=w.r,_=2*p,S=2*p,P=w.cx,T=w.cy,M=n.radialReference,p=function(){M&&(O=o.getBBox(),P+=(M[0]-O.x)/O.width-.5,T+=(M[1]-O.y)/O.height-.5,_*=M[2]/O.width,S*=M[2]/O.height),E='src="'+e.getOptions().global.VMLRadialGradientURL+'" size="'+_+","+S+'" origin="0.5,0.5" position="'+P+","+T+'" color2="'+g+'" ',C()};o.added?p():o.onAdd=p,p=b}else p=f}else d.test(t)&&"IMG"!==n.tagName?(a=e.color(t),o[i+"-opacitySetter"](a.get("a"),i,n),p=a.get("rgb")):(p=n.getElementsByTagName(i),p.length&&(p[0].opacity=1,p[0].type="solid"),p=t);return p},prepVML:function(e){var t=this.isIE8;return e=e.join(""),t?(e=e.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),e=-1===e.indexOf('style="')?e.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):e.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):e=e.replace("<","{point.key}
',pointFormat:' {series.name}: {point.y}
',shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}},e.setOptions=function(t){return e.defaultOptions=a(!0,e.defaultOptions,t),n(),e.defaultOptions},e.getOptions=function(){return e.defaultOptions},e.defaultPlotOptions=e.defaultOptions.plotOptions,n()}(e),function(e){var t=e.arrayMax,n=e.arrayMin,r=e.defined,i=e.destroyObjectProperties,o=e.each,a=e.erase,s=e.merge,l=e.pick;e.PlotLineOrBand=function(e,t){this.axis=e,t&&(this.options=t,this.id=t.id)},e.PlotLineOrBand.prototype={render:function(){var e,t=this,n=t.axis,i=n.horiz,o=t.options,a=o.label,u=t.label,c=o.to,d=o.from,p=o.value,f=r(d)&&r(c),h=r(p),m=t.svgElem,y=!m,v=[],b=o.color,g=l(o.zIndex,0),w=o.events,v={class:"highcharts-plot-"+(f?"band ":"line ")+(o.className||"")},E={},k=n.chart.renderer,x=f?"bands":"lines",C=n.log2lin;if(n.isLog&&(d=C(d),c=C(c),p=C(p)),h?(v={stroke:b,"stroke-width":o.width},o.dashStyle&&(v.dashstyle=o.dashStyle)):f&&(b&&(v.fill=b),o.borderWidth&&(v.stroke=o.borderColor,v["stroke-width"]=o.borderWidth)),E.zIndex=g,x+="-"+g,(b=n[x])||(n[x]=b=k.g("plot-"+x).attr(E).add()),y&&(t.svgElem=m=k.path().attr(v).add(b)),h)v=n.getPlotLinePath(p,m.strokeWidth());else{if(!f)return;v=n.getPlotBandPath(d,c,o)}if(y&&v&&v.length){if(m.attr({d:v}),w)for(e in o=function(e){m.on(e,function(n){w[e].apply(t,[n])})},w)o(e)}else m&&(v?(m.show(),m.animate({d:v})):(m.hide(),u&&(t.label=u=u.destroy())));return a&&r(a.text)&&v&&v.length&&0c&&r-d*po&&(t=Math.round((i-r)/Math.cos(c*s))):(i=r+(1-d)*p,r-d*po&&(h=o-e.x+h*d,m=-1),h=Math.min(f,h),hh||n.autoRotation&&(u.styles||{}).width)&&(t=h)),t&&(y.width=t,(n.options.labels.style||{}).textOverflow||(y.textOverflow="ellipsis"),u.css(y))},getPosition:function(e,t,n,r){var i=this.axis,o=i.chart,a=r&&o.oldChartHeight||o.chartHeight;return{x:e?i.translate(t+n,null,null,r)+i.transB:i.left+i.offset+(i.opposite?(r&&o.oldChartWidth||o.chartWidth)-i.right-i.left:0),y:e?a-i.bottom+i.offset-(i.opposite?i.height:0):a-i.translate(t+n,null,null,r)-i.transB}},getLabelPosition:function(e,t,r,i,o,a,l,u){var c=this.axis,d=c.transA,p=c.reversed,f=c.staggerLines,h=c.tickRotCorr||{x:0,y:0},m=o.y;return n(m)||(m=0===c.side?r.rotation?-8:-r.getBBox().height:2===c.side?h.y+8:Math.cos(r.rotation*s)*(h.y-r.getBBox(!1,0).height/2)),e=e+o.x+h.x-(a&&i?a*d*(p?-1:1):0),t=t+m-(a&&!i?a*d*(p?1:-1):0),f&&(r=l/(u||1)%f,c.opposite&&(r=f-r-1),t+=c.labelOffset/f*r),{x:e,y:Math.round(t)}},getMarkPath:function(e,t,n,r,i,o){return o.crispLine(["M",e,t,"L",e+(i?0:-n),t+(i?n:0)],r)},render:function(e,t,n){var r=this.axis,o=r.options,s=r.chart.renderer,l=r.horiz,u=this.type,c=this.label,d=this.pos,p=o.labels,f=this.gridLine,h=u?u+"Tick":"tick",m=r.tickSize(h),y=this.mark,v=!y,b=p.step,g={},w=!0,E=r.tickmarkOffset,k=this.getPosition(l,d,E,t),x=k.x,k=k.y,C=l&&x===r.pos+r.len||!l&&k===r.pos?-1:1,O=u?u+"Grid":"grid",_=o[O+"LineWidth"],S=o[O+"LineColor"],P=o[O+"LineDashStyle"],O=a(o[h+"Width"],!u&&r.isXAxis?1:0),h=o[h+"Color"];n=a(n,1),this.isActive=!0,f||(g.stroke=S,g["stroke-width"]=_,P&&(g.dashstyle=P),u||(g.zIndex=1),t&&(g.opacity=0),this.gridLine=f=s.path().attr(g).addClass("highcharts-"+(u?u+"-":"")+"grid-line").add(r.gridGroup)),!t&&f&&(d=r.getPlotLinePath(d+E,f.strokeWidth()*C,t,!0))&&f[this.isNew?"attr":"animate"]({d:d,opacity:n}),m&&(r.opposite&&(m[0]=-m[0]),v&&(this.mark=y=s.path().addClass("highcharts-"+(u?u+"-":"")+"tick").add(r.axisGroup),y.attr({stroke:h,"stroke-width":O})),y[v?"attr":"animate"]({d:this.getMarkPath(x,k,m[0],y.strokeWidth()*C,l,s),opacity:n})),c&&i(x)&&(c.xy=k=this.getLabelPosition(x,k,c,l,p,E,e,b),this.isFirst&&!this.isLast&&!a(o.showFirstLabel,1)||this.isLast&&!this.isFirst&&!a(o.showLastLabel,1)?w=!1:!l||r.isRadial||p.step||p.rotation||t||0===n||this.handleOverflow(k),b&&e%b&&(w=!1),w&&i(k.y)?(k.opacity=n,c[this.isNew?"attr":"animate"](k)):c.attr("y",-9999),this.isNew=!1)},destroy:function(){r(this,this.axis)}}}(e),function(e){var t=e.addEvent,n=e.animObject,r=e.arrayMax,i=e.arrayMin,o=e.AxisPlotLineOrBandExtension,a=e.color,s=e.correctFloat,l=e.defaultOptions,u=e.defined,c=e.deg2rad,d=e.destroyObjectProperties,p=e.each,f=e.extend,h=e.fireEvent,m=e.format,y=e.getMagnitude,v=e.grep,b=e.inArray,g=e.isArray,w=e.isNumber,E=e.isString,k=e.merge,x=e.normalizeTickInterval,C=e.pick,O=e.PlotLineOrBand,_=e.removeEvent,S=e.splat,P=e.syncTimeout,T=e.Tick;e.Axis=function(){this.init.apply(this,arguments)},e.Axis.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,labels:{enabled:!0,style:{color:"#666666",cursor:"default",fontSize:"11px"},x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return e.numberFormat(this.total,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"#000000",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(e,n){var r=n.isX;this.chart=e,this.horiz=e.inverted?!r:r,this.isXAxis=r,this.coll=this.coll||(r?"xAxis":"yAxis"),this.opposite=n.opposite,this.side=n.side||(this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(n);var i=this.options,o=i.type;this.labelFormatter=i.labels.formatter||this.defaultLabelFormatter,this.userOptions=n,this.minPixelPadding=0,this.reversed=i.reversed,this.visible=!1!==i.visible,this.zoomEnabled=!1!==i.zoomEnabled,this.hasNames="category"===o||!0===i.categories,this.categories=i.categories||this.hasNames,this.names=this.names||[],this.isLog="logarithmic"===o,this.isDatetimeAxis="datetime"===o,this.isLinked=u(i.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=i.minRange||i.maxZoom,this.range=i.range,this.offset=i.offset||0,this.stacks={},this.oldStacks={},this.stacksTouched=0,this.min=this.max=null,this.crosshair=C(i.crosshair,S(e.options.tooltip.crosshairs)[r?0:1],!1);var a;n=this.options.events,-1===b(this,e.axes)&&(r?e.axes.splice(e.xAxis.length,0,this):e.axes.push(this),e[this.coll].push(this)),this.series=this.series||[],e.inverted&&r&&void 0===this.reversed&&(this.reversed=!0),this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(a in n)t(this,a,n[a]);this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(e){this.options=k(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],k(l[this.coll],e))},defaultLabelFormatter:function(){var t,n=this.axis,r=this.value,i=n.categories,o=this.dateTimeLabelFormat,a=l.lang,s=a.numericSymbols,a=a.numericSymbolMagnitude||1e3,u=s&&s.length,c=n.options.labels.format,n=n.isLog?r:n.tickInterval;if(c)t=m(c,this);else if(i)t=r;else if(o)t=e.dateFormat(o,r);else if(u&&1e3<=n)for(;u--&&void 0===t;)i=Math.pow(a,u+1),n>=i&&0===10*r%i&&null!==s[u]&&0!==r&&(t=e.numberFormat(r/i,-1)+s[u]);return void 0===t&&(t=1e4<=Math.abs(r)?e.numberFormat(r,-1):e.numberFormat(r,-1,void 0,"")),t},getSeriesExtremes:function(){var e=this,t=e.chart;e.hasVisibleSeries=!1,e.dataMin=e.dataMax=e.threshold=null,e.softThreshold=!e.isXAxis,e.buildStacks&&e.buildStacks(),p(e.series,function(n){if(n.visible||!t.options.chart.ignoreHiddenSeries){var o,a=n.options,s=a.threshold;e.hasVisibleSeries=!0,e.isLog&&0>=s&&(s=null),e.isXAxis?(a=n.xData,a.length&&(n=i(a),w(n)||n instanceof Date||(a=v(a,function(e){return w(e)}),n=i(a)),e.dataMin=Math.min(C(e.dataMin,a[0]),n),e.dataMax=Math.max(C(e.dataMax,a[0]),r(a)))):(n.getExtremes(),o=n.dataMax,n=n.dataMin,u(n)&&u(o)&&(e.dataMin=Math.min(C(e.dataMin,n),n),e.dataMax=Math.max(C(e.dataMax,o),o)),u(s)&&(e.threshold=s),(!a.softThreshold||e.isLog)&&(e.softThreshold=!1))}})},translate:function(e,t,n,r,i,o){var a=this.linkedParent||this,s=1,l=0,u=r?a.oldTransA:a.transA;r=r?a.oldMin:a.min;var c=a.minPixelPadding;return i=(a.isOrdinal||a.isBroken||a.isLog&&i)&&a.lin2val,u||(u=a.transA),n&&(s*=-1,l=a.len),a.reversed&&(s*=-1,l-=s*(a.sector||a.len)),t?(e=(e*s+l-c)/u+r,i&&(e=a.lin2val(e))):(i&&(e=a.val2lin(e)),e=s*(e-r)*u+l+s*c+(w(o)?u*o:0)),e},toPixels:function(e,t){return this.translate(e,!1,!this.horiz,null,!0)+(t?0:this.pos)},toValue:function(e,t){return this.translate(e-(t?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(e,t,n,r,i){var o,a,s,l=this.chart,u=this.left,c=this.top,d=n&&l.oldChartHeight||l.chartHeight,p=n&&l.oldChartWidth||l.chartWidth;o=this.transB;var f=function(e,t,n){return(en)&&(r?e=Math.min(Math.max(t,e),n):s=!0),e};return i=C(i,this.translate(e,null,null,n)),e=n=Math.round(i+o),o=a=Math.round(d-i-o),w(i)?this.horiz?(o=c,a=d-this.bottom,e=n=f(e,u,u+this.width)):(e=u,n=p-this.right,o=a=f(o,c,c+this.height)):s=!0,s&&!r?null:l.renderer.crispLine(["M",e,o,"L",n,a],t||1)},getLinearTickPositions:function(e,t,n){var r,i=s(Math.floor(t/e)*e),o=s(Math.ceil(n/e)*e),a=[];if(t===n&&w(t))return[t];for(t=i;t<=o&&(a.push(t),t=s(t+e),t!==r);)r=t;return a},getMinorTickPositions:function(){var e,t=this.options,n=this.tickPositions,r=this.minorTickInterval,i=[],o=this.pointRangePadding||0;e=this.min-o;var o=this.max+o,a=o-e;if(a&&a/r=this.minRange;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(u(c.min)||u(c.max)?this.minRange=null:(p(this.series,function(e){for(a=e.xData,n=s=e.xIncrement?1:a.length-1;0=S?(n=S,E=0):a.dataMax<=S&&(r=S,g=0)),a.min=C(i,n,a.dataMin),a.max=C(o,r,a.dataMax)),d&&(!t&&0>=Math.min(a.min,C(a.dataMin,a.min))&&e.error(10,1),a.min=s(f(a.min),15),a.max=s(f(a.max),15)),a.range&&u(a.max)&&(a.userMin=a.min=i=Math.max(a.min,a.minFromRange()),a.userMax=o=a.max,a.range=null),h(a,"foundExtremes"),a.beforePadding&&a.beforePadding(),a.adjustForMinRange(),!(_||a.axisPointRange||a.usePercentage||b)&&u(a.min)&&u(a.max)&&(f=a.max-a.min)&&(!u(i)&&E&&(a.min-=f*E),!u(o)&&g&&(a.max+=f*g)),w(c.floor)?a.min=Math.max(a.min,c.floor):w(c.softMin)&&(a.min=Math.min(a.min,c.softMin)),w(c.ceiling)?a.max=Math.min(a.max,c.ceiling):w(c.softMax)&&(a.max=Math.max(a.max,c.softMax)),P&&u(a.dataMin)&&(S=S||0,!u(i)&&a.min=S?a.min=S:!u(o)&&a.max>S&&a.dataMax<=S&&(a.max=S)),a.tickInterval=a.min===a.max||void 0===a.min||void 0===a.max?1:b&&!k&&O===a.linkedParent.options.tickPixelInterval?k=a.linkedParent.tickInterval:C(k,this.tickAmount?(a.max-a.min)/Math.max(this.tickAmount-1,1):void 0,_?1:(a.max-a.min)*O/Math.max(a.len,O)),v&&!t&&p(a.series,function(e){e.processData(a.min!==a.oldMin||a.max!==a.oldMax)}),a.setAxisTranslation(!0),a.beforeSetTickPositions&&a.beforeSetTickPositions(),a.postProcessTickInterval&&(a.tickInterval=a.postProcessTickInterval(a.tickInterval)),a.pointRange&&!k&&(a.tickInterval=Math.max(a.pointRange,a.tickInterval)),t=C(c.minTickInterval,a.isDatetimeAxis&&a.closestPointRange),!k&&a.tickIntervala.tickInterval&&1e3a.max)),!!this.tickAmount)),this.tickAmount||(a.tickInterval=a.unsquish()),this.setTickPositions()},setTickPositions:function(){var e,t,n=this.options,r=n.tickPositions,i=n.tickPositioner,o=n.startOnTick,a=n.endOnTick;this.tickmarkOffset=this.categories&&"between"===n.tickmarkPlacement&&1===this.tickInterval?.5:0,this.minorTickInterval="auto"===n.minorTickInterval&&this.tickInterval?this.tickInterval/5:n.minorTickInterval,this.tickPositions=e=r&&r.slice(),!e&&(e=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,n.units),this.min,this.max,n.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),e.length>this.len&&(e=[e[0],e.pop()]),this.tickPositions=e,i&&(i=i.apply(this,[this.min,this.max])))&&(this.tickPositions=e=i),this.trimTicks(e,o,a),this.isLinked||(this.min===this.max&&u(this.min)&&!this.tickAmount&&(t=!0,this.min-=.5,this.max+=.5),this.single=t,r||i||this.adjustTickAmount())},trimTicks:function(e,t,n){var r=e[0],i=e[e.length-1],o=this.minPointOffset||0;if(!this.isLinked){if(t)this.min=r;else for(;this.min-o>e[0];)e.shift();if(n)this.max=i;else for(;this.max+ot&&(this.finalTickAmt=t,t=5),this.tickAmount=t},adjustTickAmount:function(){var e=this.tickInterval,t=this.tickPositions,n=this.tickAmount,r=this.finalTickAmt,i=t&&t.length;if(in&&(this.tickInterval*=2,this.setTickPositions());if(u(r)){for(e=n=t.length;e--;)(3===r&&1===e%2||2>=r&&0i&&(e=i)),u(r)&&(ti&&(t=i))),this.displayBtn=void 0!==e||void 0!==t,this.setExtremes(e,t,!1,void 0,{trigger:"zoom"})),!0},setAxisSize:function(){var e=this.chart,t=this.options,n=t.offsets||[0,0,0,0],r=this.horiz,i=C(t.width,e.plotWidth-n[3]+n[1]),o=C(t.height,e.plotHeight-n[0]+n[2]),a=C(t.top,e.plotTop+n[0]),t=C(t.left,e.plotLeft+n[3]),n=/%$/;n.test(o)&&(o=Math.round(parseFloat(o)/100*e.plotHeight)),n.test(a)&&(a=Math.round(parseFloat(a)/100*e.plotHeight+e.plotTop)),this.left=t,this.top=a,this.width=i,this.height=o,this.bottom=e.chartHeight-o-a,this.right=e.chartWidth-i-t,this.len=Math.max(r?i:o,0),this.pos=r?t:a},getExtremes:function(){var e=this.isLog,t=this.lin2log;return{min:e?s(t(this.min)):this.min,max:e?s(t(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(e){var t=this.isLog,n=this.lin2log,r=t?n(this.min):this.min,t=t?n(this.max):this.max;return null===e?e=r:r>e?e=r:te?"right":195e?"left":"center"},tickSize:function(e){var t=this.options,n=t[e+"Length"],r=C(t[e+"Width"],"tick"===e&&this.isXAxis?1:0);if(r&&n)return"inside"===t[e+"Position"]&&(n=-n),[n,r]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var e,t,n,r=this.options.labels,i=this.horiz,o=this.tickInterval,a=o,s=this.len/(((this.categories?1:0)+this.max-this.min)/o),l=r.rotation,d=this.labelMetrics(),f=Number.MAX_VALUE,h=function(e){return e/=s||1,e=1=n)&&(t=h(Math.abs(d.h/Math.sin(c*n))),r=t+Math.abs(n/360),r(n.step||0)&&!n.rotation&&(this.staggerLines||1)*this.len/r||!t&&(i&&i-e.spacing[3]||.33*e.chartWidth)},renderUnsquish:function(){var e,t,n,r=this.chart,i=r.renderer,o=this.tickPositions,a=this.ticks,s=this.options.labels,l=this.horiz,u=this.getSlotWidth(),c=Math.max(1,Math.round(u-2*(s.padding||5))),d={},f=this.labelMetrics(),h=s.style&&s.style.textOverflow,m=0;if(E(s.rotation)||(d.rotation=s.rotation||0),p(o,function(e){(e=a[e])&&e.labelLength>m&&(m=e.labelLength)}),this.maxLabelLength=m,this.autoRotation)m>c&&m>f.h?d.rotation=this.labelRotation:this.labelRotation=0;else if(u&&(e={width:c+"px"},!h))for(e.textOverflow="clip",t=o.length;!l&&t--;)n=o[t],(c=a[n].label)&&(c.styles&&"ellipsis"===c.styles.textOverflow?c.css({textOverflow:"clip"}):a[n].labelLength>u&&c.css({width:u+"px"}),c.getBBox().height>this.len/o.length-(f.h-f.f)&&(c.specCss={textOverflow:"ellipsis"}));d.rotation&&(e={width:(m>.5*r.chartHeight?.33*r.chartHeight:r.chartHeight)+"px"},h||(e.textOverflow="ellipsis")),(this.labelAlign=s.align||this.autoLabelAlign(this.labelRotation))&&(d.align=this.labelAlign),p(o,function(t){var n=(t=a[t])&&t.label;n&&(n.attr(d),e&&n.css(k(e,n.specCss)),delete n.specCss,t.rotation=d.rotation)}),this.tickRotCorr=i.rotCorr(f.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||u(this.min)&&u(this.max)&&!!this.tickPositions},addTitle:function(e){var t,n=this.chart.renderer,r=this.horiz,i=this.opposite,o=this.options.title;this.axisTitle||((t=o.textAlign)||(t=(r?{low:"left",middle:"center",high:"right"}:{low:i?"right":"left",middle:"center",high:i?"left":"right"})[o.align]),this.axisTitle=n.text(o.text,0,0,o.useHTML).attr({zIndex:7,rotation:o.rotation||0,align:t}).addClass("highcharts-axis-title").css(o.style).add(this.axisGroup),this.axisTitle.isNew=!0),this.axisTitle[e?"show":"hide"](!0)},generateTick:function(e){var t=this.ticks;t[e]?t[e].addLabel():t[e]=new T(this,e)},getOffset:function(){var e,t,n,r,i=this,o=i.chart,a=o.renderer,s=i.options,l=i.tickPositions,c=i.ticks,d=i.horiz,f=i.side,h=o.inverted?[1,0,3,2][f]:f,m=0,y=0,v=s.title,b=s.labels,g=0,w=o.axisOffset,o=o.clipOffset,E=[-1,1,1,-1][f],k=s.className,x=i.axisParent,O=this.tickSize("tick");if(e=i.hasData(),i.showAxis=t=e||C(s.showEmpty,!0),i.staggerLines=i.horiz&&b.staggerLines,i.axisGroup||(i.gridGroup=a.g("grid").attr({zIndex:s.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(k||"")).add(x),i.axisGroup=a.g("axis").attr({zIndex:s.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(k||"")).add(x),i.labelGroup=a.g("axis-labels").attr({zIndex:b.zIndex||7}).addClass("highcharts-"+i.coll.toLowerCase()+"-labels "+(k||"")).add(x)),e||i.isLinked)p(l,function(e,t){i.generateTick(e,t)}),i.renderUnsquish(),!1===b.reserveSpace||0!==f&&2!==f&&{1:"left",3:"right"}[f]!==i.labelAlign&&"center"!==i.labelAlign||p(l,function(e){g=Math.max(c[e].getLabelSize(),g)}),i.staggerLines&&(g*=i.staggerLines,i.labelOffset=g*(i.opposite?-1:1));else for(r in c)c[r].destroy(),delete c[r];v&&v.text&&!1!==v.enabled&&(i.addTitle(t),t&&(m=i.axisTitle.getBBox()[d?"height":"width"],n=v.offset,y=u(n)?0:C(v.margin,d?5:10))),i.renderLine(),i.offset=E*C(s.offset,w[f]),i.tickRotCorr=i.tickRotCorr||{x:0,y:0},a=0===f?-i.labelMetrics().h:2===f?i.tickRotCorr.y:0,y=Math.abs(g)+y,g&&(y=y-a+E*(d?C(b.y,i.tickRotCorr.y+8*E):b.x)),i.axisTitleMargin=C(n,y),w[f]=Math.max(w[f],i.axisTitleMargin+m+E*i.offset,y,e&&l.length&&O?O[0]:0),s=s.offset?0:2*Math.floor(i.axisLine.strokeWidth()/2),o[h]=Math.max(o[h],s)},getLinePath:function(e){var t=this.chart,n=this.opposite,r=this.offset,i=this.horiz,o=this.left+(n?this.width:0)+r,r=t.chartHeight-this.bottom-(n?this.height:0)+r;return n&&(e*=-1),t.renderer.crispLine(["M",i?this.left:o,i?r:this.top,"L",i?t.chartWidth-this.right:o,i?r:t.chartHeight-this.bottom],e)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var e=this.horiz,t=this.left,n=this.top,r=this.len,i=this.options.title,o=e?t:n,a=this.opposite,s=this.offset,l=i.x||0,u=i.y||0,c=this.chart.renderer.fontMetrics(i.style&&i.style.fontSize,this.axisTitle).f,r={low:o+(e?0:r),middle:o+r/2,high:o+(e?r:0)}[i.align],t=(e?n+this.height:t)+(e?1:-1)*(a?-1:1)*this.axisTitleMargin+(2===this.side?c:0);return{x:e?r+l:t+(a?this.width:0)+s+l,y:e?t+u-(a?this.height:0)+s:r+u}},renderMinorTick:function(e){var t=this.chart.hasRendered&&w(this.oldMin),n=this.minorTicks;n[e]||(n[e]=new T(this,e,"minor")),t&&n[e].isNew&&n[e].render(null,!0),n[e].render(null,!1,1)},renderTick:function(e,t){var n=this.isLinked,r=this.ticks,i=this.chart.hasRendered&&w(this.oldMin);(!n||e>=this.min&&e<=this.max)&&(r[e]||(r[e]=new T(this,e)),i&&r[e].isNew&&r[e].render(t,!0,.1),r[e].render(t))},render:function(){var e,t,r=this,i=r.chart,o=r.options,a=r.isLog,s=r.lin2log,l=r.isLinked,u=r.tickPositions,c=r.axisTitle,d=r.ticks,f=r.minorTicks,h=r.alternateBands,m=o.stackLabels,y=o.alternateGridColor,v=r.tickmarkOffset,b=r.axisLine,g=r.showAxis,w=n(i.renderer.globalAnimation);r.labelEdge.length=0,r.overlap=!1,p([d,f,h],function(e){for(var t in e)e[t].isActive=!1}),(r.hasData()||l)&&(r.minorTickInterval&&!r.categories&&p(r.getMinorTickPositions(),function(e){r.renderMinorTick(e)}),u.length&&(p(u,function(e,t){r.renderTick(e,t)}),v&&(0===r.min||r.single)&&(d[-1]||(d[-1]=new T(r,-1,null,!0)),d[-1].render(-1))),y&&p(u,function(n,o){t=void 0!==u[o+1]?u[o+1]+v:r.max-v,0===o%2&&n=p.second?0:E*Math.floor(b.getMilliseconds()/E)),w>=p.second&&b[n.hcSetSeconds](w>=p.minute?0:E*Math.floor(b.getSeconds()/E)),w>=p.minute&&b[n.hcSetMinutes](w>=p.hour?0:E*Math.floor(b[n.hcGetMinutes]()/E)),w>=p.hour&&b[n.hcSetHours](w>=p.day?0:E*Math.floor(b[n.hcGetHours]()/E)),w>=p.day&&b[n.hcSetDate](w>=p.month?1:E*Math.floor(b[n.hcGetDate]()/E)),w>=p.month&&(b[n.hcSetMonth](w>=p.year?0:E*Math.floor(b[n.hcGetMonth]()/E)),f=b[n.hcGetFullYear]()),w>=p.year&&b[n.hcSetFullYear](f-f%E),w===p.week&&b[n.hcSetDate](b[n.hcGetDate]()-b[n.hcGetDay]()+d(c,1)),f=b[n.hcGetFullYear](),c=b[n.hcGetMonth]();var k=b[n.hcGetDate](),x=b[n.hcGetHours]();for((n.hcTimezoneOffset||n.hcGetTimezoneOffset)&&(h=(!v||!!n.hcGetTimezoneOffset)&&(l-t>4*p.month||u(t)!==u(l)),b=b.getTime(),b=new n(b+u(b))),v=b.getTime(),t=1;vm.length&&a(m,function(e){0===e%18e5&&"000000000"===r("%H%M%S%L",e)&&(y[e]="day")})}return m.info=s(e,{higherRanks:y,totalRange:w*E}),m},t.prototype.normalizeTimeTickInterval=function(e,t){var n=t||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];t=n[n.length-1];var r,i=p[t[0]],o=t[1];for(r=0;rt&&(!s||y<=a)&&void 0!==y&&p.push(y),y>a&&(v=!0),y=m;else t=c(t),a=c(a),e=l[s?"minorTickInterval":"tickInterval"],e=o("auto"===e?null:e,this._minorAutoInterval,l.tickPixelInterval/(s?5:1)*(a-t)/((s?u/this.tickPositions.length:u)||1)),e=i(e,null,n(e)),p=r(this.getLinearTickPositions(e,t,a),d),s||(this._minorAutoInterval=e/5);return s||(this.tickInterval=e),p},t.prototype.log2lin=function(e){return Math.log(e)/Math.LN10},t.prototype.lin2log=function(e){return Math.pow(10,e)}}(e),function(e){var t=e.dateFormat,n=e.each,r=e.extend,i=e.format,o=e.isNumber,a=e.map,s=e.merge,l=e.pick,u=e.splat,c=e.syncTimeout,d=e.timeUnits;e.Tooltip=function(){this.init.apply(this,arguments)},e.Tooltip.prototype={init:function(e,t){this.chart=e,this.options=t,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.split=t.split&&!e.inverted,this.shared=t.shared||this.split},cleanSplit:function(e){n(this.chart.series,function(t){var n=t&&t.tt;n&&(!n.isActive||e?t.tt=n.destroy():n.isActive=!1)})},getLabel:function(){var e=this.chart.renderer,t=this.options;return this.label||(this.split?this.label=e.g("tooltip"):(this.label=e.label("",0,0,t.shape||"callout",null,null,t.useHTML,null,"tooltip").attr({padding:t.padding,r:t.borderRadius}),this.label.attr({fill:t.backgroundColor,"stroke-width":t.borderWidth}).css(t.style).shadow(t.shadow)),this.label.attr({zIndex:8}).add()),this.label},update:function(e){this.destroy(),this.init(this.chart,s(!0,this.options,e))},destroy:function(){this.label&&(this.label=this.label.destroy()),this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy()),clearTimeout(this.hideTimer),clearTimeout(this.tooltipTimeout)},move:function(e,t,n,i){var o=this,a=o.now,s=!1!==o.options.animation&&!o.isHidden&&(1p-s?p:p-s);else{if(!c)return!1;a[e]=Math.max(i,r+s+n>t?r:r+s)}},f=function(e,t,n,r){var i;return rt-o?i=!1:a[e]=rt-n/2?t-n-2:r-n/2,i},h=function(e){var t=u;u=c,c=t,r=e},m=function(){!1!==p.apply(0,u)?!1!==f.apply(0,c)||r||(h(!0),m()):r?a.x=a.y=0:(h(!0),m())};return(i.inverted||1h&&(c=!1),e=(t.series&&t.series.yAxis&&t.series.yAxis.pos)+(t.plotY||0),e-=s.plotTop,a.push({target:t.isHeader?s.plotHeight+i:e,rank:t.isHeader?1:0,size:n.tt.getBBox().height+1,point:t,x:h,tt:f})}),this.cleanSplit(),e.distribute(a,s.plotHeight+i),n(a,function(e){var t=e.point,n=t.series;e.tt.attr({visibility:void 0===e.pos?"hidden":"inherit",x:c||t.isHeader?e.x:t.plotX+s.plotLeft+l(d.distance,16),y:e.pos+s.plotTop,anchorX:t.isHeader?t.plotX+s.plotLeft:t.plotX+n.xAxis.pos,anchorY:t.isHeader?e.pos+s.plotTop-15:t.plotY+n.yAxis.pos})})},updatePosition:function(e){var t=this.chart,n=this.getLabel(),n=(this.options.positioner||this.getPosition).call(this,n.width,n.height,e);this.move(Math.round(n.x),Math.round(n.y||0),e.plotX+t.plotLeft,e.plotY+t.plotTop)},getDateFormat:function(e,n,r,i){var o,a,s=t("%m-%d %H:%M:%S.%L",n),l={millisecond:15,second:12,minute:9,hour:6,day:3},u="millisecond";for(a in d){if(e===d.week&&+t("%w",n)===r&&"00:00:00.000"===s.substr(6)){a="week";break}if(d[a]>e){a=u;break}if(l[a]&&s.substr(l[a])!=="01-01 00:00:00.000".substr(l[a]))break;"week"!==a&&(u=a)}return a&&(o=i[a]),o},getXDateFormat:function(e,t,n){t=t.dateTimeLabelFormats;var r=n&&n.closestPointRange;return(r?this.getDateFormat(r,e.x,n.options.startOfWeek,t):t.day)||t.year},tooltipFooterHeaderFormatter:function(e,t){var n=t?"footer":"header";t=e.series;var r=t.tooltipOptions,a=r.xDateFormat,s=t.xAxis,l=s&&"datetime"===s.options.type&&o(e.key),n=r[n+"Format"];return l&&!a&&(a=this.getXDateFormat(e,r,s)),l&&a&&(n=n.replace("{point.key}","{point.key:"+a+"}")),i(n,{point:e,series:t})},bodyFormatter:function(e){return a(e,function(e){var t=e.series.tooltipOptions;return(t.pointFormatter||e.point.tooltipFormatter).call(e.point,t.pointFormat)})}}}(e),function(e){var t=e.addEvent,n=e.attr,r=e.charts,i=e.color,o=e.css,a=e.defined,s=e.doc,l=e.each,u=e.extend,c=e.fireEvent,d=e.offset,p=e.pick,f=e.removeEvent,h=e.splat,m=e.Tooltip,y=e.win;e.Pointer=function(e,t){this.init(e,t)},e.Pointer.prototype={init:function(e,t){this.options=t,this.chart=e,this.runChartClick=t.chart.events&&!!t.chart.events.click,this.pinchDown=[],this.lastValidTouch={},m&&t.tooltip.enabled&&(e.tooltip=new m(e,t.tooltip),this.followTouchMove=p(t.tooltip.followTouchMove,!0)),this.setDOMEvents()},zoomOption:function(e){var t=this.chart,n=t.options.chart,r=n.zoomType||"",t=t.inverted;/touch/.test(e.type)&&(r=p(n.pinchType,r)),this.zoomX=e=/x/.test(r),this.zoomY=r=/y/.test(r),this.zoomHor=e&&!t||r&&t,this.zoomVert=r&&!t||e&&t,this.hasZoom=e||r},normalize:function(e,t){var n,r;return e=e||y.event,e.target||(e.target=e.srcElement),r=e.touches?e.touches.length?e.touches.item(0):e.changedTouches[0]:e,t||(this.chartPosition=t=d(this.chart.container)),void 0===r.pageX?(n=Math.max(e.x,e.clientX-t.left),t=e.y):(n=r.pageX-t.left,t=r.pageY-t.top),u(e,{chartX:Math.round(n),chartY:Math.round(t)})},getCoordinates:function(e){var t={xAxis:[],yAxis:[]};return l(this.chart.axes,function(n){t[n.isXAxis?"xAxis":"yAxis"].push({axis:n,value:n.toValue(e[n.horiz?"chartX":"chartY"])})}),t},runPointActions:function(n){var i,o,a,u,c=this.chart,d=c.series,f=c.tooltip,h=!!f&&f.shared,m=!0,y=c.hoverPoint,v=c.hoverSeries,b=[];if(!h&&!v)for(i=0;it.series.index?-1:1})),h)for(i=b.length;i--;)(b[i].x!==b[0].x||b[i].series.noSharedTooltip)&&b.splice(i,1);if(b[0]&&(b[0]!==this.prevKDPoint||f&&f.isHidden)){if(h&&!b[0].series.noSharedTooltip){for(i=0;iu+d&&(o=u+d),ac+p&&(a=c+p),this.hasDragged=Math.sqrt(Math.pow(h-o,2)+Math.pow(m-a,2)),10g.max&&(t=g.max-l,c=!0),c?(k-=.8*(k-a[p][0]),w||(C-=.8*(C-a[p][1])),n()):a[p]=[k,C],b||(o[p]=u-y,o[m]=l),o=b?1/v:v,i[m]=l,i[p]=t,r[b?e?"scaleY":"scaleX":"scale"+f]=v,r["translate"+f]=o*y+(k-o*E)},pinch:function(e){var t=this,s=t.chart,l=t.pinchDown,u=e.touches,c=u.length,d=t.lastValidTouch,p=t.hasZoom,f=t.selectionMarker,h={},m=1===c&&(t.inClass(e.target,"highcharts-tracker")&&s.runTrackerClick||t.runChartClick),y={};1t-6&&s(h||t.chartWidth-2*u-v-r.x)&&(this.itemX=v,this.itemY+=y+this.lastLineHeight+m,this.lastLineHeight=0),this.maxItemWidth=Math.max(this.maxItemWidth,o),this.lastItemY=y+this.itemY+m,this.lastLineHeight=Math.max(a,this.lastLineHeight),e._legendItemPos=[this.itemX,this.itemY],i?this.itemX+=o:(this.itemY+=y+a+m,this.lastLineHeight=a),this.offsetWidth=h||Math.max((i?this.itemX-v-p:o)+u,this.offsetWidth)},getAllItems:function(){var e=[];return a(this.chart.series,function(t){var n=t&&t.options;t&&d(n.showInLegend,!o(n.linkedTo)&&void 0,!0)&&(e=e.concat(t.legendItems||("point"===n.legendType?t.data:t)))}),e},adjustMargins:function(e,t){var n=this.chart,r=this.options,i=r.align.charAt(0)+r.verticalAlign.charAt(0)+r.layout.charAt(0);r.floating||a([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(a,s){a.test(i)&&!o(e[s])&&(n[u[s]]=Math.max(n[u[s]],n.legend[(s+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][s]*r[s%2?"x":"y"]+d(r.margin,12)+t[s]))})},render:function(){var e,t,n,r,i=this,o=i.chart,l=o.renderer,u=i.group,c=i.box,d=i.options,p=i.padding;i.itemX=i.initialItemX,i.itemY=i.initialItemY,i.offsetWidth=0,i.lastItemY=0,u||(i.group=u=l.g("legend").attr({zIndex:7}).add(),i.contentGroup=l.g().attr({zIndex:1}).add(u),i.scrollGroup=l.g().add(i.contentGroup)),i.renderTitle(),e=i.getAllItems(),f(e,function(e,t){return(e.options&&e.options.legendIndex||0)-(t.options&&t.options.legendIndex||0)}),d.reversed&&e.reverse(),i.allItems=e,i.display=t=!!e.length,i.lastLineHeight=0,a(e,function(e){i.renderItem(e)}),n=(d.width||i.offsetWidth)+p,r=i.lastItemY+i.lastLineHeight+i.titleHeight,r=i.handleOverflow(r),r+=p,c||(i.box=c=l.rect().addClass("highcharts-legend-box").attr({r:d.borderRadius}).add(u),c.isNew=!0),c.attr({stroke:d.borderColor,"stroke-width":d.borderWidth||0,fill:d.backgroundColor||"none"}).shadow(d.shadow),0i&&!1!==c.enabled?(this.clipHeight=t=Math.max(i-20-this.titleHeight-y,0),this.currentPage=d(this.currentPage,1),this.fullHeight=e,a(v,function(e,r){var i=e._legendItemPos[1];e=Math.round(e.legendItem.getBBox().height);var o=m.length;(!o||i-m[o-1]>t&&(n||i)!==m[o-1])&&(m.push(n||i),o++),r===v.length-1&&i+e-m[o-1]>t&&m.push(i),i!==n&&(n=i)}),u||(u=r.clipRect=o.clipRect(0,y,9999,0),r.contentGroup.clip(u)),b(t),h||(this.nav=h=o.g().attr({zIndex:1}).add(this.group),this.up=o.symbol("triangle",0,0,f,f).on("click",function(){r.scroll(-1,p)}).add(h),this.pager=o.text("",15,10).addClass("highcharts-legend-navigation").css(c.style).add(h),this.down=o.symbol("triangle-down",0,0,f,f).on("click",function(){r.scroll(1,p)}).add(h)),r.scroll(0),e=i):h&&(b(),h.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),e},scroll:function(e,t){var n=this.pages,r=n.length;e=this.currentPage+e;var i=this.clipHeight,o=this.options.navigation,a=this.pager,s=this.padding;e>r&&(e=r),0o&&(n=typeof e[0],"string"===n?t.name=e[0]:"number"===n&&(t.x=e[0]),a++);u=e.value;)e=n[++r];return e&&e.color&&!this.options.color&&(this.color=e.color),e},destroy:function(){var e,t=this.series.chart,n=t.hoverPoints;t.pointCount--,n&&(this.setState(),i(n,this),n.length||(t.hoverPoints=null)),this===t.hoverPoint&&this.onMouseOut(),(this.graphic||this.dataLabel)&&(c(this),this.destroyElements()),this.legendItem&&t.legend.destroyItem(this);for(e in this)this[e]=null},destroyElements:function(){for(var e,t=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],n=6;n--;)e=t[n],this[e]&&(this[e]=this[e].destroy())},getLabelConfig:function(){ return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(e){var t=this.series,r=t.tooltipOptions,i=u(r.valueDecimals,""),o=r.valuePrefix||"",s=r.valueSuffix||"";return n(t.pointArrayMap||["y"],function(t){t="{point."+t,(o||s)&&(e=e.replace(t+"}",o+t+"}"+s)),e=e.replace(t+"}",t+":,."+i+"f}")}),a(e,{point:this,series:this.series})},firePointEvent:function(e,t,n){var r=this,i=this.series.options;(i.point.events[e]||r.options&&r.options.events&&r.options.events[e])&&this.importEvents(),"click"===e&&i.allowPointSelect&&(n=function(e){r.select&&r.select(null,e.ctrlKey||e.metaKey||e.shiftKey)}),o(this,e,t,n)},visible:!0}}(e),function(e){var t=e.addEvent,n=e.animObject,r=e.arrayMax,i=e.arrayMin,o=e.correctFloat,a=e.Date,s=e.defaultOptions,l=e.defaultPlotOptions,u=e.defined,c=e.each,d=e.erase,p=e.extend,f=e.fireEvent,h=e.grep,m=e.isArray,y=e.isNumber,v=e.isString,b=e.merge,g=e.pick,w=e.removeEvent,E=e.splat,k=e.SVGElement,x=e.syncTimeout,C=e.win;e.Series=e.seriesType("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1e3},events:{},marker:{lineWidth:0,lineColor:"#ffffff",radius:4,states:{hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":e.numberFormat(this.y,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1e3},{isCartesian:!0,pointClass:e.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(e,n){var r,i,o,a=this,s=e.series;a.chart=e,a.options=n=a.setOptions(n),a.linkedSeries=[],a.bindAxes(),p(a,{name:n.name,state:"",visible:!1!==n.visible,selected:!0===n.selected}),i=n.events;for(r in i)t(a,r,i[r]);(i&&i.click||n.point&&n.point.events&&n.point.events.click||n.allowPointSelect)&&(e.runTrackerClick=!0),a.getColor(),a.getSymbol(),c(a.parallelArrays,function(e){a[e+"Data"]=[]}),a.setData(n.data,!1),a.isCartesian&&(e.hasCartesianSeries=!0),s.length&&(o=s[s.length-1]),a._i=g(o&&o._i,-1)+1,e.orderSeries(this.insert(s))},insert:function(e){var t,n=this.options.index;if(y(n)){for(t=e.length;t--;)if(n>=g(e[t].options.index,e[t]._i)){e.splice(t+1,0,this);break}-1===t&&e.unshift(this),t+=1}else e.push(this);return g(t,e.length-1)},bindAxes:function(){var t,n=this,r=n.options,i=n.chart;c(n.axisTypes||[],function(o){c(i[o],function(e){t=e.options,(r[o]===t.index||void 0!==r[o]&&r[o]===t.id||void 0===r[o]&&0===t.index)&&(n.insert(e.series),n[o]=e,e.isDirty=!0)}),n[o]||n.optionalAxis===o||e.error(18,!0)})},updateParallelArrays:function(e,t){var n=e.series,r=arguments,i=y(t)?function(r){var i="y"===r&&n.toYData?n.toYData(e):e[r];n[r+"Data"][t]=i}:function(e){Array.prototype[t].apply(n[e+"Data"],Array.prototype.slice.call(r,2))};c(n.parallelArrays,i)},autoIncrement:function(){var e,t=this.options,n=this.xIncrement,r=t.pointIntervalUnit,n=g(n,t.pointStart,0);return this.pointInterval=e=g(this.pointInterval,t.pointInterval,1),r&&(t=new a(n),"day"===r?t=+t[a.hcSetDate](t[a.hcGetDate]()+e):"month"===r?t=+t[a.hcSetMonth](t[a.hcGetMonth]()+e):"year"===r&&(t=+t[a.hcSetFullYear](t[a.hcGetFullYear]()+e)),e=t-n),this.xIncrement=n+e,n},setOptions:function(e){var t=this.chart,n=t.options.plotOptions,t=t.userOptions||{},r=t.plotOptions||{},i=n[this.type];return this.userOptions=e,n=b(i,n.series,e),this.tooltipOptions=b(s.tooltip,s.plotOptions[this.type].tooltip,t.tooltip,r.series&&r.series.tooltip,r[this.type]&&r[this.type].tooltip,e.tooltip),null===i.marker&&delete n.marker,this.zoneAxis=n.zoneAxis,e=this.zones=(n.zones||[]).slice(),!n.negativeColor&&!n.negativeFillColor||n.zones||e.push({value:n[this.zoneAxis+"Threshold"]||n.threshold||0,className:"highcharts-negative",color:n.negativeColor,fillColor:n.negativeFillColor}),e.length&&u(e[e.length-1].value)&&e.push({color:this.color,fillColor:this.fillColor}),n},getCyclic:function(e,t,n){var r,i=this.chart,o=this.userOptions,a=e+"Index",s=e+"Counter",l=n?n.length:g(i.options.chart[e+"Count"],i[e+"Count"]);t||(r=g(o[a],o["_"+a]),u(r)||(i.series.length||(i[s]=0),o["_"+a]=r=i[s]%l,i[s]+=1),n&&(t=n[r])),void 0!==r&&(this[a]=r),this[e]=t},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||l[this.type].color,this.chart.options.colors)},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},drawLegendSymbol:e.LegendSymbolMixin.drawLineMarker,setData:function(t,n,r,i){var o,a=this,s=a.points,l=s&&s.length||0,u=a.options,d=a.chart,p=null,f=a.xAxis,h=u.turboThreshold,b=this.xData,w=this.yData,E=(o=a.pointArrayMap)&&o.length;if(t=t||[],o=t.length,n=g(n,!0),!1!==i&&o&&l===o&&!a.cropped&&!a.hasGroupedData&&a.visible)c(t,function(e,t){s[t].update&&e!==u.data[t]&&s[t].update(e,!1,null,!1)});else{if(a.xIncrement=null,a.colorCounter=0,c(this.parallelArrays,function(e){a[e+"Data"].length=0}),h&&o>h){for(r=0;null===p&&rl||this.forceCrop)&&(r[o-1]p?(r=[],i=[]):(r[0]p)&&(n=this.cropData(this.xData,this.yData,d,p),r=n.xData,i=n.yData,n=n.start,a=!0)),l=r.length||1;--l;)o=m?c(r[l])-c(r[l-1]):r[l]-r[l-1],0o&&this.requireSorting&&e.error(15);this.cropped=a,this.cropStart=n,this.processedXData=r,this.processedYData=i,this.closestPointRange=s},cropData:function(e,t,n,r){var i,o=e.length,a=0,s=o,l=g(this.cropShoulder,1);for(i=0;i=n){a=Math.max(0,i-l);break}for(n=i;nr){s=n+l;break}return{xData:e.slice(a,s),yData:t.slice(a,s),start:a,end:s}},generatePoints:function(){var e,t,n,r,i=this.options.data,o=this.data,a=this.processedXData,s=this.processedYData,l=this.pointClass,u=a.length,c=this.cropStart||0,d=this.hasGroupedData,p=[];for(o||d||(o=[],o.length=i.length,o=this.data=o),r=0;r=p&&(o[d-1]||u)<=f,l&&u)if(l=c.length)for(;l--;)null!==c[l]&&(a[s++]=c[l]);else a[s++]=c;this.dataMin=i(a),this.dataMax=r(a)},translate:function(){this.processedXData||this.processData(),this.generatePoints();var e,t,n,r,i=this.options,a=i.stacking,s=this.xAxis,l=s.categories,c=this.yAxis,d=this.points,p=d.length,f=!!this.modifyValue,h=i.pointPlacement,m="between"===h||y(h),v=i.threshold,b=i.startFromThreshold?v:0,w=Number.MAX_VALUE;for("between"===h&&(h=.5),y(h)&&(h*=g(i.pointRange||s.pointRange)),i=0;i=x&&(E.isNull=!0),E.plotX=e=o(Math.min(Math.max(-1e5,s.translate(k,0,0,0,1,h,"flags"===this.type)),1e5)),a&&this.visible&&!E.isNull&&O&&O[k]&&(r=this.getStackIndicator(r,k,this.index),C=O[k],x=C.points[r.key],t=x[0],x=x[1],t===b&&r.key===O[k].base&&(t=g(v,c.min)),c.isLog&&0>=t&&(t=null),E.total=E.stackTotal=C.total,E.percentage=C.total&&E.y/C.total*100,E.stackY=x,C.setOffset(this.pointXOffset||0,this.barW||0)),E.yBottom=u(t)?c.translate(t,0,1,0,1):null,f&&(x=this.modifyValue(x,E)),E.plotY=t="number"==typeof x&&1/0!==x?Math.min(Math.max(-1e5,c.translate(x,0,1,0,1)),1e5):void 0,E.isInside=void 0!==t&&0<=t&&t<=c.len&&0<=e&&e<=s.len,E.clientX=m?o(s.translate(k,0,0,0,1,h)):e,E.negative=E.y<(v||0),E.category=l&&void 0!==l[E.x]?l[E.x]:E.x,E.isNull||(void 0!==n&&(w=Math.min(w,Math.abs(e-n))),n=e),E.zone=this.zones.length&&E.getZone()}this.closestPointRangePx=w},getValidPoints:function(e,t){var n=this.chart;return h(e||this.points||[],function(e){return!(t&&!n.isInsidePlot(e.plotX,e.plotY,n.inverted))&&!e.isNull})},setClip:function(e){var t=this.chart,n=this.options,r=t.renderer,i=t.inverted,o=this.clipBox,a=o||t.clipBox,s=this.sharedClipKey||["_sharedClip",e&&e.duration,e&&e.easing,a.height,n.xAxis,n.yAxis].join(),l=t[s],u=t[s+"m"];l||(e&&(a.width=0,t[s+"m"]=u=r.clipRect(-99,i?-t.plotLeft:-t.plotTop,99,i?t.chartWidth:t.chartHeight)),t[s]=l=r.clipRect(a),l.count={length:0}),e&&!l.count[this.index]&&(l.count[this.index]=!0,l.count.length+=1),!1!==n.clip&&(this.group.clip(e||o?l:t.clipRect),this.markerGroup.clip(u),this.sharedClipKey=s),e||(l.count[this.index]&&(delete l.count[this.index],--l.count.length),0===l.count.length&&s&&t[s]&&(o||(t[s]=t[s].destroy()),t[s+"m"]&&(this.markerGroup.clip(),t[s+"m"]=t[s+"m"].destroy())))},animate:function(e){var t,r=this.chart,i=n(this.options.animation);e?this.setClip(i):(t=this.sharedClipKey,(e=r[t])&&e.animate({width:r.plotSizeX},i),r[t+"m"]&&r[t+"m"].animate({width:r.plotSizeX+99},i),this.animate=null)},afterAnimate:function(){this.setClip(),f(this,"afterAnimate")},drawPoints:function(){var e,t,n,r,i,o,a,s,l=this.points,u=this.chart,c=this.options.marker,d=this.markerGroup,p=g(c.enabled,!!this.xAxis.isRadial||null,this.closestPointRangePx>2*c.radius);if(!1!==c.enabled||this._hasPointMarkers)for(t=0;ti&&t.shadow)),a&&(a.startX=n.xMap,a.isArea=n.isArea)})},applyZones:function(){var e,t,n,r,i,o,a,s,l,u=this,d=this.chart,p=d.renderer,f=this.zones,h=this.clips||[],m=this.graph,y=this.area,v=Math.max(d.chartWidth,d.chartHeight),b=this[(this.zoneAxis||"y")+"Axis"],w=d.inverted,E=!1;f.length&&(m||y)&&b&&void 0!==b.min&&(i=b.reversed,o=b.horiz,m&&m.hide(),y&&y.hide(),r=b.getExtremes(),c(f,function(c,f){e=i?o?d.plotWidth:0:o?0:b.toPixels(r.min),e=Math.min(Math.max(g(t,e),0),v),t=Math.min(Math.max(Math.round(b.toPixels(g(c.value,r.max),!0)),0),v),E&&(e=t=b.toPixels(r.max)),a=Math.abs(e-t),s=Math.min(e,t),l=Math.max(e,t),b.isXAxis?(n={x:w?l:s,y:0,width:a,height:v},o||(n.x=d.plotHeight-n.x)):(n={x:0,y:w?l:s,width:v,height:a},o&&(n.y=d.plotWidth-n.y)),w&&p.isVML&&(n=b.isXAxis?{x:0,y:i?s:l,height:n.width,width:d.chartWidth}:{x:n.y-d.plotLeft-d.spacingBox.x,y:0,width:n.height,height:d.chartHeight}),h[f]?h[f].animate(n):(h[f]=p.clipRect(n),m&&u["zone-graph-"+f].clip(h[f]),y&&u["zone-area-"+f].clip(h[f])),E=c.value>r.max}),this.clips=h)},invertGroups:function(e){function n(){c(["group","markerGroup"],function(t){i[t]&&(i[t].width=i.yAxis.len,i[t].height=i.xAxis.len,i[t].invert(e))})}var r,i=this;i.xAxis&&(r=t(i.chart,"resize",n),t(i,"destroy",r),n(e),i.invertGroups=n)},plotGroup:function(e,t,n,r,i){var o=this[e],a=!o;return a&&(this[e]=o=this.chart.renderer.g(t).attr({zIndex:r||.1}).add(i),o.addClass("highcharts-series-"+this.index+" highcharts-"+this.type+"-series highcharts-color-"+this.colorIndex+" "+(this.options.className||""))),o.attr({visibility:n})[a?"attr":"animate"](this.getPlotBox()),o},getPlotBox:function(){var e=this.chart,t=this.xAxis,n=this.yAxis;return e.inverted&&(t=n,n=this.xAxis),{translateX:t?t.left:e.plotLeft,translateY:n?n.top:e.plotTop,scaleX:1,scaleY:1}},render:function(){var e,t=this,r=t.chart,i=t.options,o=!!t.animate&&r.renderer.isSVG&&n(i.animation).duration,a=t.visible?"inherit":"hidden",s=i.zIndex,l=t.hasRendered,u=r.seriesGroup,c=r.inverted;e=t.plotGroup("group","series",a,s,u),t.markerGroup=t.plotGroup("markerGroup","markers",a,s,u),o&&t.animate(!0),e.inverted=!!t.isCartesian&&c,t.drawGraph&&(t.drawGraph(),t.applyZones()),t.drawDataLabels&&t.drawDataLabels(),t.visible&&t.drawPoints(),t.drawTracker&&!1!==t.options.enableMouseTracking&&t.drawTracker(),t.invertGroups(c),!1===i.clip||t.sharedClipKey||l||e.clip(r.clipRect),o&&t.animate(),l||(t.animationTimeout=x(function(){t.afterAnimate()},o)),t.isDirty=!1,t.hasRendered=!0},redraw:function(){var e=this.chart,t=this.isDirty||this.isDirtyData,n=this.group,r=this.xAxis,i=this.yAxis;n&&(e.inverted&&n.attr({width:e.plotWidth,height:e.plotHeight}),n.animate({translateX:g(r&&r.left,e.plotLeft),translateY:g(i&&i.top,e.plotTop)})),this.translate(),this.render(),t&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(e,t){var n=this.xAxis,r=this.yAxis,i=this.chart.inverted;return this.searchKDTree({clientX:i?n.len-e.chartY+n.pos:e.chartX-n.pos,plotY:i?r.len-e.chartX+r.pos:e.chartY-r.pos},t)},buildKDTree:function(){function e(n,r,i){var o,a;if(a=n&&n.length)return o=t.kdAxisArray[r%i],n.sort(function(e,t){return e[o]-t[o]}),a=Math.floor(a/2),{point:n[a],left:e(n.slice(0,a),r+1,i),right:e(n.slice(a+1),r+1,i)}}this.buildingKdTree=!0;var t=this,n=t.kdDimensions;delete t.kdTree,x(function(){t.kdTree=e(t.getValidPoints(null,!t.directTouch),n,n),t.buildingKdTree=!1},t.options.kdNow?0:1)},searchKDTree:function(e,t){function n(e,t,s,l){var c,d,p=t.point,f=r.kdAxisArray[s%l],h=p;return d=u(e[i])&&u(p[i])?Math.pow(e[i]-p[i],2):null,c=u(e[o])&&u(p[o])?Math.pow(e[o]-p[o],2):null,c=(d||0)+(c||0),p.dist=u(c)?Math.sqrt(c):Number.MAX_VALUE,p.distX=u(d)?Math.sqrt(d):Number.MAX_VALUE,f=e[f]-p[f],c=0>f?"left":"right",d=0>f?"right":"left",t[c]&&(c=n(e,t[c],s+1,l),h=c[a]s;)a--;this.updateParallelArrays(i,"splice",a,0,0),this.updateParallelArrays(i,a),d&&i.name&&(d[s]=i.name),p.splice(a,0,e),o&&(this.data.splice(a,0,null),this.processData()),"point"===l.legendType&&this.generatePoints(),n&&(u[0]&&u[0].remove?u[0].remove(!1):(u.shift(),this.updateParallelArrays(i,"shift"),p.shift())),this.isDirtyData=this.isDirty=!0,t&&c.redraw(r)},removePoint:function(e,t,n){var r=this,i=r.data,o=i[e],a=r.points,s=r.chart,l=function(){a&&a.length===i.length&&a.splice(e,1),i.splice(e,1),r.options.data.splice(e,1),r.updateParallelArrays(o||{series:r},"splice",e,1),o&&o.destroy(),r.isDirty=!0,r.isDirtyData=!0,t&&s.redraw()};g(n,s),t=m(t,!0),o?o.firePointEvent("remove",null,l):l()},remove:function(e,t,n){function r(){i.destroy(),o.isDirtyLegend=o.isDirtyBox=!0,o.linkSeries(),m(e,!0)&&o.redraw(t)}var i=this,o=i.chart;!1!==n?c(i,"remove",null,r):r()},update:function(e,t){var n,r=this,i=this.chart,o=this.userOptions,a=this.type,l=e.type||o.type||i.options.chart.type,c=b[a].prototype,d=["group","markerGroup","dataLabelsGroup"];(l&&l!==a||void 0!==e.zIndex)&&(d.length=0),s(d,function(e){d[e]=r[e],delete r[e]}),e=h(o,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},e),this.remove(!1,null,!1);for(n in c)this[n]=void 0;u(this,b[l||a].prototype),s(d,function(e){r[e]=d[e]}),this.init(i,e),i.linkSeries(),m(t,!0)&&i.redraw(!1)}}),u(r.prototype,{update:function(e,t){var n=this.chart;e=n.options[this.coll][this.options.index]=h(this.userOptions,e),this.destroy(!0),this.init(n,u(e,{events:void 0})),n.isDirtyBox=!0,m(t,!0)&&n.redraw()},remove:function(e){for(var t=this.chart,n=this.coll,r=this.series,i=r.length;i--;)r[i]&&r[i].remove(!1);l(t.axes,this),l(t[n],this),t.options[n].splice(this.options.index,1),s(t[n],function(e,t){e.options.index=t}),this.destroy(),t.isDirtyBox=!0,m(e,!0)&&t.redraw()},setTitle:function(e,t){this.update({title:e},t)},setCategories:function(e,t){this.update({categories:e},t)}})}(e),function(e){var t=e.color,n=e.each,r=e.map,i=e.pick,o=e.Series,a=e.seriesType;a("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(){var e,t,o,a=[],s=[],l=this.xAxis,u=this.yAxis,c=u.stacks[this.stackKey],d={},p=this.points,f=this.index,h=u.series,m=h.length,y=i(u.options.reversedStacks,!0)?1:-1;if(this.options.stacking){for(t=0;te&&l>o?(l=Math.max(e,o),c=2*o-l):lr&&c>o?(c=Math.max(r,o),l=2*o-c):c=Math.abs(t)&&.5e.closestPointRange*e.xAxis.transA,i=e.borderWidth=s(n.borderWidth,i?0:1),o=e.yAxis,a=e.translatedThreshold=o.getThreshold(n.threshold),u=s(n.minPointLength,5),c=e.getColumnMetrics(),d=c.width,p=e.barW=Math.max(d,1+2*i),f=e.pointXOffset=c.offset;t.inverted&&(a-=.5),n.pointPadding&&(p=Math.ceil(p)),l.prototype.translate.apply(e),r(e.points,function(n){var r,i=s(n.yBottom,a),l=999+Math.abs(i),l=Math.min(Math.max(-l,n.plotY),o.len+l),c=n.plotX+f,h=p,m=Math.min(l,i),y=Math.max(l,i)-m;Math.abs(y)u?i-u:a-(r?u:0)),n.barX=c,n.pointWidth=d,n.tooltipPos=t.inverted?[o.len+o.pos-t.plotLeft-l,e.xAxis.len-c-h/2,y]:[c+h/2,l+o.pos-t.plotTop,y],n.shapeType="rect",n.shapeArgs=e.crispCol.apply(e,n.isNull?[n.plotX,o.len/2,0,0]:[c,m,h,y])})},getSymbol:e.noop,drawLegendSymbol:e.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(e,t){var r,i=this.options,o=this.pointAttrToOptions||{};r=o.stroke||"borderColor";var a=o["stroke-width"]||"borderWidth",s=e&&e.color||this.color,l=e[r]||i[r]||this.color||s,u=e[a]||i[a]||this[a]||0,o=i.dashStyle;return e&&this.zones.length&&(s=(s=e.getZone())&&s.color||e.options.color||this.color),t&&(e=i.states[t],t=e.brightness,s=e.color||void 0!==t&&n(s).brighten(e.brightness).get()||s,l=e[r]||l,u=e[a]||u,o=e.dashStyle||o),r={fill:s,stroke:l,"stroke-width":u},i.borderRadius&&(r.r=i.borderRadius),o&&(r.dashstyle=o),r},drawPoints:function(){var e,t=this,n=this.chart,i=t.options,s=n.renderer,l=i.animationLimit||250;r(t.points,function(r){var u=r.graphic;o(r.plotY)&&null!==r.y?(e=r.shapeArgs,u?u[n.pointCount {series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&t.prototype.drawGraph.call(this)}})}(e),function(e){var t=e.pick,n=e.relativeLength;e.CenteredSeriesMixin={getCenter:function(){var e,r,i=this.options,o=this.chart,a=2*(i.slicedOffset||0),s=o.plotWidth-2*a,o=o.plotHeight-2*a,l=i.center,l=[t(l[0],"50%"),t(l[1],"50%"),i.size||"100%",i.innerSize||0],u=Math.min(s,o);for(e=0;4>e;++e)r=l[e],i=2>e||2===e&&/%$/.test(r),l[e]=n(r,[s,o,u,l[2]][e])+(i?a:0);return l[3]>l[2]&&(l[3]=l[2]),l}}}(e),function(e){var t=e.addEvent,n=e.defined,r=e.each,i=e.extend,o=e.inArray,a=e.noop,s=e.pick,l=e.Point,u=e.Series,c=e.seriesType,d=e.setAnimation;c("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,states:{hover:{brightness:.1,shadow:!1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:e.seriesTypes.column.prototype.pointAttribs,animate:function(e){var t=this,n=t.points,i=t.startAngleRad;e||(r(n,function(e){var n=e.graphic,r=e.shapeArgs;n&&(n.attr({r:e.startR||t.center[3]/2,start:i,end:i}),n.animate({r:r.r,start:r.start,end:r.end},t.options.animation))}),t.animate=null)},updateTotals:function(){var e,t,n=0,r=this.points,i=r.length,o=this.options.ignoreHiddenPoint;for(e=0;et.y&&(t.y=null),n+=o&&!t.visible?0:t.y;for(this.total=n,e=0;e1.5*Math.PI?r-=2*Math.PI:r<-Math.PI/2&&(r+=2*Math.PI),o.slicedTranslation={translateX:Math.round(Math.cos(r)*u),translateY:Math.round(Math.sin(r)*u)},t=Math.cos(r)*e[2]/2,n=Math.sin(r)*e[2]/2,o.tooltipPos=[e[0]+.7*t,e[1]+.7*n],o.half=r<-Math.PI/2||r>Math.PI/2?1:0,o.angle=r,c=Math.min(c,h/5),o.labelPos=[e[0]+t+Math.cos(r)*h,e[1]+n+Math.sin(r)*h,e[0]+t+Math.cos(r)*c,e[1]+n+Math.sin(r)*c,e[0]+t,e[1]+n,0>h?"center":o.half?"right":"left",r]},drawGraph:null,drawPoints:function(){var e,t,n,o,a=this,s=a.chart.renderer,l=a.options.shadow;l&&!a.shadowGroup&&(a.shadowGroup=s.g("shadow").add(a.group)),r(a.points,function(r){if(null!==r.y){t=r.graphic,o=r.shapeArgs,e=r.sliced?r.slicedTranslation:{};var u=r.shadowGroup;l&&!u&&(u=r.shadowGroup=s.g("shadow").add(a.shadowGroup)),u&&u.attr(e),n=a.pointAttribs(r,r.selected&&"select"),t?t.setRadialReference(a.center).attr(n).animate(i(o,e)):(r.graphic=t=s[r.shapeType](o).addClass(r.getClassName()).setRadialReference(a.center).attr(e).add(a.group),r.visible||t.attr({visibility:"hidden"}),t.attr(n).attr({"stroke-linejoin":"round"}).shadow(l,u))}})},searchPoint:a,sortByAngle:function(e,t){e.sort(function(e,n){return void 0!==e.angle&&(n.angle-e.angle)*t})},drawLegendSymbol:e.LegendSymbolMixin.drawRectangle,getCenter:e.CenteredSeriesMixin.getCenter,getSymbol:a},{init:function(){l.prototype.init.apply(this,arguments);var e,n=this;return n.name=s(n.name,"Slice"),e=function(e){n.slice("select"===e.type)},t(n,"select",e),t(n,"unselect",e),n},setVisible:function(e,t){var n=this,i=n.series,a=i.chart,l=i.options.ignoreHiddenPoint;t=s(t,l),e!==n.visible&&(n.visible=n.options.visible=e=void 0===e?!n.visible:e,i.options.data[o(n,i.data)]=n.options,r(["graphic","dataLabel","connector","shadowGroup"],function(t){n[t]&&n[t][e?"show":"hide"](!0)}),n.legendItem&&a.legend.colorizeItem(n,e),e||"hover"!==n.state||n.setState(""),l&&(i.isDirty=!0),t&&a.redraw())},slice:function(e,t,r){var i=this.series;d(r,i.chart),s(t,!0),this.sliced=this.options.sliced=e=n(e)?e:!this.sliced,i.options.data[o(this,i.data)]=this.options,e=e?this.slicedTranslation:{translateX:0,translateY:0},this.graphic.animate(e),this.shadowGroup&&this.shadowGroup.animate(e)},haloPath:function(e){var t=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(t.x,t.y,t.r+e,t.r+e,{innerR:this.shapeArgs.r,start:t.start,end:t.end})}})}(e),function(e){var t=e.addEvent,n=e.arrayMax,r=e.defined,i=e.each,o=e.extend,a=e.format,s=e.map,l=e.merge,u=e.noop,c=e.pick,d=e.relativeLength,p=e.Series,f=e.seriesTypes,h=e.stableSort;e.distribute=function(e,t){function n(e,t){return e.target-t.target}var r,o,a=!0,l=e,u=[];for(o=0,r=e.length;r--;)o+=e[r].size;if(o>t){for(h(e,function(e,t){return(t.rank||0)-(e.rank||0)}),o=r=0;o<=t;)o+=e[r].size,r++;u=e.splice(r-1,e.length)}for(h(e,n),e=s(e,function(e){return{size:e.size,targets:[e.target]}});a;){for(r=e.length;r--;)a=e[r],o=(Math.min.apply(0,a.targets)+Math.max.apply(0,a.targets))/2,a.pos=Math.min(Math.max(0,o-a.size/2),t-a.size);for(r=e.length,a=!1;r--;)0e[r].pos&&(e[r-1].size+=e[r].size,e[r-1].targets=e[r-1].targets.concat(e[r].targets),e[r-1].pos+e[r-1].size>t&&(e[r-1].pos=t-e[r-1].size),e.splice(r,1),a=!0)}r=0,i(e,function(e){var t=0;i(e.targets,function(){l[r].pos=e.pos+t,t+=l[r].size,r++})}),l.push.apply(l,u),h(l,n)},p.prototype.drawDataLabels=function(){var e,n,o,s,u=this,d=u.options,p=d.dataLabels,f=u.points,h=u.hasRendered||0,m=c(p.defer,!0),y=u.chart.renderer;(p.enabled||u._hasPointLabels)&&(u.dlProcessOptions&&u.dlProcessOptions(p),s=u.plotGroup("dataLabelsGroup","data-labels",m&&!h?"hidden":"visible",p.zIndex||6),m&&(s.attr({opacity:+h}),h||t(u,"afterAnimate",function(){u.visible&&s.show(!0),s[d.animation?"animate":"attr"]({opacity:1},{duration:200})})),n=p,i(f,function(t){var i,f,h,m,v,b=t.dataLabel,g=t.connector,w=!b;if(e=t.dlOptions||t.options&&t.options.dataLabels,i=c(e&&e.enabled,n.enabled)&&null!==t.y)for(h in p=l(n,e),f=t.getLabelConfig(),o=p.format?a(p.format,f):p.formatter.call(f,p),v=p.style,m=p.rotation,v.color=c(p.color,v.color,u.color,"#000000"),"contrast"===v.color&&(v.color=p.inside||0>p.distance||d.stacking?y.getContrast(t.color||u.color):"#000000"),d.cursor&&(v.cursor=d.cursor),f={fill:p.backgroundColor,stroke:p.borderColor,"stroke-width":p.borderWidth,r:p.borderRadius||0,rotation:m,padding:p.padding,zIndex:1})void 0===f[h]&&delete f[h];!b||i&&r(o)?i&&r(o)&&(b?f.text=o:(b=t.dataLabel=y[m?"text":"label"](o,0,-9999,p.shape,null,null,p.useHTML,null,"data-label"),b.addClass("highcharts-data-label-color-"+t.colorIndex+" "+(p.className||"")+(p.useHTML?"highcharts-tracker":""))),b.attr(f),b.css(v).shadow(p.shadow),b.added||b.add(s),u.alignDataLabel(t,b,p,null,w)):(t.dataLabel=b.destroy(),g&&(t.connector=g.destroy()))}))},p.prototype.alignDataLabel=function(e,t,n,r,i){var a,s=this.chart,l=s.inverted,u=c(e.plotX,-9999),d=c(e.plotY,-9999),p=t.getBBox(),f=n.rotation,h=n.align,m=this.visible&&(e.series.forceDL||s.isInsidePlot(u,Math.round(d),l)||r&&s.isInsidePlot(u,l?r.x+1:r.y+r.height-1,l)),y="justify"===c(n.overflow,"justify");m&&(a=n.style.fontSize,a=s.renderer.fontMetrics(a,t).b,r=o({x:l?s.plotWidth-d:u,y:Math.round(l?s.plotHeight-u:d),width:0,height:0},r),o(n,{width:p.width,height:p.height}),f?(y=!1,l=s.renderer.rotCorr(a,f),l={x:r.x+n.x+r.width/2+l.x,y:r.y+n.y+{top:0,middle:.5,bottom:1}[n.verticalAlign]*r.height},t[i?"attr":"animate"](l).attr({align:h}),u=(f+720)%360,u=180u,"left"===h?l.y-=u?p.height:0:"center"===h?(l.x-=p.width/2,l.y-=p.height/2):"right"===h&&(l.x-=p.width,l.y-=u?0:p.height)):(t.align(n,null,r),l=t.alignAttr),y?this.justifyDataLabel(t,n,l,p,r,i):c(n.crop,!0)&&(m=s.isInsidePlot(l.x,l.y)&&s.isInsidePlot(l.x+p.width,l.y+p.height)),n.shape&&!f&&t.attr({anchorX:e.plotX,anchorY:e.plotY})),m||(t.attr({y:-9999}),t.placed=!1)},p.prototype.justifyDataLabel=function(e,t,n,r,i,o){var a,s,l=this.chart,u=t.align,c=t.verticalAlign,d=e.box?0:e.padding||0;a=n.x+d,0>a&&("right"===u?t.align="left":t.x=-a,s=!0),a=n.x+r.width-d,a>l.plotWidth&&("left"===u?t.align="right":t.x=l.plotWidth-a,s=!0),a=n.y+d,0>a&&("bottom"===c?t.verticalAlign="top":t.y=-a,s=!0),a=n.y+r.height-d,a>l.plotHeight&&("top"===c?t.verticalAlign="bottom":t.y=l.plotHeight-a,s=!0),s&&(e.placed=!o,e.align(t,null,i))},f.pie&&(f.pie.prototype.drawDataLabels=function(){var t,r,o,a,l,u,d,f,h,m,y=this,v=y.data,b=y.chart,g=y.options.dataLabels,w=c(g.connectorPadding,10),E=c(g.connectorWidth,1),k=b.plotWidth,x=b.plotHeight,C=g.distance,O=y.center,_=O[2]/2,S=O[1],P=0c-2?v:f,r),o._attr={visibility:h,align:l[6]},o._pos={x:d+g.x+({left:w,right:-w}[l[6]]||0),y:f+g.y-10},l.x=d,l.y=f,null===y.options.size&&(a=o.width,d-ak-w&&(M[1]=Math.max(Math.round(d+a-k+w),M[1])),0>f-u/2?M[0]=Math.max(Math.round(-f+u/2),M[0]):f+u/2>x&&(M[2]=Math.max(Math.round(f+u/2-x),M[2])))}),0===n(M)||this.verifyDataLabelOverflow(M))&&(this.placeDataLabels(),P&&E&&i(this.points,function(e){var t;r=e.connector,(o=e.dataLabel)&&o._pos&&e.visible?(h=o._attr.visibility,(t=!r)&&(e.connector=r=b.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+e.colorIndex).add(y.dataLabelsGroup),r.attr({"stroke-width":E,stroke:g.connectorColor||e.color||"#666666"})),r[t?"attr":"animate"]({d:y.connectorPath(e.labelPos)}),r.attr("visibility",h)):r&&(e.connector=r.destroy())}))},f.pie.prototype.connectorPath=function(e){var t=e.x,n=e.y;return c(this.options.dataLabels.softConnector,!0)?["M",t+("left"===e[6]?5:-5),n,"C",t,n,2*e[2]-e[4],2*e[3]-e[5],e[2],e[3],"L",e[4],e[5]]:["M",t+("left"===e[6]?5:-5),n,"L",e[2],e[3],"L",e[4],e[5]]},f.pie.prototype.placeDataLabels=function(){i(this.points,function(e){var t=e.dataLabel;t&&e.visible&&((e=t._pos)?(t.attr(t._attr),t[t.moved?"animate":"attr"](e),t.moved=!0):t&&t.attr({y:-9999}))})},f.pie.prototype.alignDataLabel=u,f.pie.prototype.verifyDataLabelOverflow=function(e){var t,n,r=this.center,i=this.options,o=i.center,a=i.minSize||80;return null!==o[0]?t=Math.max(r[2]-Math.max(e[1],e[3]),a):(t=Math.max(r[2]-e[1]-e[3],a),r[0]+=(e[3]-e[1])/2),null!==o[1]?t=Math.max(Math.min(t,r[2]-Math.max(e[0],e[2])),a):(t=Math.max(Math.min(t,r[2]-e[0]-e[2]),a),r[1]+=(e[0]-e[2])/2),tc(this.translatedThreshold,a.yAxis.len)),d=c(n.inside,!!this.options.stacking);s&&(r=l(s),0>r.y&&(r.height+=r.y,r.y=0),s=r.y+r.height-a.yAxis.len,0e+n||i+at+r||o+sthis.pointCount))},pan:function(e,t){var n,r=this,o=r.hoverPoints;o&&s(o,function(e){e.setState()}),s("xy"===t?[1,0]:[1],function(t){t=r[t?"xAxis":"yAxis"][0];var i=t.horiz,o=e[i?"chartX":"chartY"],i=i?"mouseDownX":"mouseDownY",a=r[i],s=(t.pointRange||0)/2,l=t.getExtremes(),u=t.toValue(a-o,!0)+s,s=t.toValue(a+t.len-o,!0)-s,c=ss&&0>l&&(t.setExtremes(a,u,!1,!1,{trigger:"pan"}),n=!0),r[i]=o}),n&&r.redraw(!1),i(r.container,{cursor:"move"})}}),l(y.prototype,{select:function(e,t){var n=this,r=n.series,i=r.chart;e=m(e,!n.selected),n.firePointEvent(e?"select":"unselect",{accumulate:t},function(){n.selected=n.options.selected=e,r.options.data[d(n,r.data)]=n.options,n.setState(e&&"select"),t||s(i.getSelectedPoints(),function(e){e.selected&&e!==n&&(e.selected=e.options.selected=!1,r.options.data[d(e,r.data)]=e.options,e.setState(""),e.firePointEvent("unselect"))})})},onMouseOver:function(e,t){var n=this.series,r=n.chart,i=r.tooltip,o=r.hoverPoint;this.series&&(t||(o&&o!==this&&o.onMouseOut(),r.hoverSeries!==n&&n.onMouseOver(),r.hoverPoint=this),!i||i.shared&&!n.noSharedTooltip?i||this.setState("hover"):(this.setState("hover"),i.refresh(this,e)),this.firePointEvent("mouseOver"))},onMouseOut:function(){var e=this.series.chart,t=e.hoverPoints;this.firePointEvent("mouseOut"),t&&-1!==d(this,t)||(this.setState(),e.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var e,n=h(this.series.options.point,this.options).events;this.events=n;for(e in n)t(this,e,n[e]);this.hasImportedEvents=!0}},setState:function(e,t){var n,r=Math.floor(this.plotX),i=this.plotY,o=this.series,s=o.options.states[e]||{},u=a[o.type].marker&&o.options.marker,c=u&&!1===u.enabled,d=u&&u.states&&u.states[e]||{},p=!1===d.enabled,f=o.stateMarkerGraphic,h=this.marker||{},y=o.chart,v=o.halo,b=u&&o.markerAttribs;e=e||"",e===this.state&&!t||this.selected&&"select"!==e||!1===s.enabled||e&&(p||c&&!1===d.enabled)||e&&h.states&&h.states[e]&&!1===h.states[e].enabled||(b&&(n=o.markerAttribs(this,e)),this.graphic?(this.state&&this.graphic.removeClass("highcharts-point-"+this.state),e&&this.graphic.addClass("highcharts-point-"+e),this.graphic.attr(o.pointAttribs(this,e)),n&&this.graphic.animate(n,m(y.options.chart.animation,d.animation,u.animation)),f&&f.hide()):(e&&d&&(u=h.symbol||o.symbol,f&&f.currentSymbol!==u&&(f=f.destroy()),f?f[t?"animate":"attr"]({x:n.x,y:n.y}):u&&(o.stateMarkerGraphic=f=y.renderer.symbol(u,n.x,n.y,n.width,n.height).add(o.markerGroup),f.currentSymbol=u),f&&f.attr(o.pointAttribs(this,e))),f&&(f[e&&y.isInsidePlot(r,i,y.inverted)?"show":"hide"](),f.element.point=this)),(r=s.halo)&&r.size?(v||(o.halo=v=y.renderer.path().add(b?o.markerGroup:o.group)),v[t?"animate":"attr"]({d:this.haloPath(r.size)}),v.attr({class:"highcharts-halo highcharts-color-"+m(this.colorIndex,o.colorIndex)}),v.point=this,v.attr(l({fill:this.color||o.color,"fill-opacity":r.opacity,zIndex:-1},r.attributes))):v&&v.point&&v.point.haloPath&&v.animate({d:v.point.haloPath(0)}),this.state=e)},haloPath:function(e){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-e,this.plotY-e,2*e,2*e)}}),l(v.prototype,{onMouseOver:function(){var e=this.chart,t=e.hoverSeries;t&&t!==this&&t.onMouseOut(),this.options.events.mouseOver&&u(this,"mouseOver"),this.setState("hover"),e.hoverSeries=this},onMouseOut:function(){var e=this.options,t=this.chart,n=t.tooltip,r=t.hoverPoint;t.hoverSeries=null,r&&r.onMouseOut(),this&&e.events.mouseOut&&u(this,"mouseOut"),!n||e.stickyTracking||n.shared&&!this.noSharedTooltip||n.hide(),this.setState()},setState:function(e){var t=this,n=t.options,r=t.graph,i=n.states,o=n.lineWidth,n=0;if(e=e||"",t.state!==e&&(s([t.group,t.markerGroup],function(n){n&&(t.state&&n.removeClass("highcharts-series-"+t.state),e&&n.addClass("highcharts-series-"+e))}),t.state=e,!i[e]||!1!==i[e].enabled)&&(e&&(o=i[e].lineWidth||o+(i[e].lineWidthPlus||0)),r&&!r.dashstyle))for(i={"stroke-width":o},r.attr(i);t["zone-graph-"+n];)t["zone-graph-"+n].attr(i),n+=1},setVisible:function(e,t){var n,r=this,i=r.chart,o=r.legendItem,a=i.options.chart.ignoreHiddenSeries,l=r.visible;n=(r.visible=e=r.options.visible=r.userOptions.visible=void 0===e?!l:e)?"show":"hide",s(["group","dataLabelsGroup","markerGroup","tracker","tt"],function(e){r[e]&&r[e][n]()}),i.hoverSeries!==r&&(i.hoverPoint&&i.hoverPoint.series)!==r||r.onMouseOut(),o&&i.legend.colorizeItem(r,e),r.isDirty=!0,r.options.stacking&&s(i.series,function(e){e.options.stacking&&e.visible&&(e.isDirty=!0)}),s(r.linkedSeries,function(t){t.setVisible(e,!1)}),a&&(i.isDirtyBox=!0),!1!==t&&i.redraw(),u(r,n)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(e){this.selected=e=void 0===e?!this.selected:e,this.checkbox&&(this.checkbox.checked=e),u(this,e?"select":"unselect")},drawTracker:e.drawTrackerGraph})}(e),function(e){var t=e.Chart,n=e.each,r=e.inArray,i=e.isObject,o=e.pick,a=e.splat;t.prototype.setResponsive=function(e){var t=this.options.responsive;t&&t.rules&&n(t.rules,function(t){this.matchResponsiveRule(t,e)},this)},t.prototype.matchResponsiveRule=function(t,n){var r,i=this.respRules,a=t.condition;r=a.callback||function(){return this.chartWidth<=o(a.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=o(a.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=o(a.minWidth,0)&&this.chartHeight>=o(a.minHeight,0)},void 0===t._id&&(t._id=e.uniqueKey()),r=r.call(this),!i[t._id]&&r?t.chartOptions&&(i[t._id]=this.currentOptions(t.chartOptions),this.update(t.chartOptions,n)):i[t._id]&&!r&&(this.update(i[t._id],n),delete i[t._id])},t.prototype.currentOptions=function(e){function t(e,n,o,s){var l,u;for(l in e)if(!s&&-10)r.push({title:"Etiquetas de casos"}),n.tags.forEach(function(e){r.push({title:e.name,count:e.count,path:"/tag?tag="+e.id+i,className:"tag-link-"+e.type.toLowerCase()})});else{var o={noResultMsg:"Nenhuma etiqueta",title:"Etiquetas de casos",icon:"tags"};r.push(o)}return r}},{key:"render",value:function(){var e=this.state;if(!e.data)return null;var t=this.props.scope;return u.default.createElement("div",null,u.default.createElement(c.Card,null,"UNIT"===t&&u.default.createElement(c.CommandBar,{commands:this.state.cmds}),u.default.createElement(c.Sideview,{route:this.props.route,views:this.generateViews()})))}}]),t}(u.default.Component);t.default=_},942:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?u.default.createElement("span",null,u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:6},u.default.createElement(v.default,{controller:e,className:"mtop-=2x text-muted"})),u.default.createElement(c.Col,{sm:6},u.default.createElement(m.default,{controller:e,showCounter:!0,className:"pull-right"}))),u.default.createElement(d.ReactTable,{className:"mtop-2x",columns:[{title:"Patient",size:{sm:4},content:function(e){return u.default.createElement(d.Profile,{type:e.gender.toLowerCase(),size:"small",title:f.default.nameDisplay(e.name),subtitle:e.caseCode})}},{title:"Case Info",size:{sm:2},content:function(e){return u.default.createElement("div",null,f.default.classifDisplay(e.classification,e.diagnosisType),u.default.createElement("br",null),u.default.createElement("div",{className:"sub-text"},f.default.caseStateDisplay(e.state)))}},{title:"Unit",size:{sm:6},content:function(e){return u.default.createElement("div",null,e.unit.name,u.default.createElement("br",null),u.default.createElement("div",{className:"sub-text"},f.default.adminUnitDisplay(e.unit.adminUnit,!1,!0)))}}],values:e.getList(),onClick:this._caseClick}),u.default.createElement(m.default,{controller:this.props.controller,showCounter:!0,className:"mtop"})):null)}}]),t}(u.default.Component);t.default=b},953:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?u.default.createElement("span",null,u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:6},u.default.createElement(b.default,{controller:t,className:"mtop-2x text-muted"})),u.default.createElement(c.Col,{sm:6},u.default.createElement(y.default,{controller:this.state.controller,showCounter:!0,className:"pull-right"}))),u.default.createElement(d.ReactTable,{columns:[{title:"Patient",size:{sm:4},content:function(e){return u.default.createElement(d.Profile,{type:e.gender.toLowerCase(),size:"small",title:h.default.nameDisplay(e.name),subtitle:e.caseCode})}},{title:"Case Info",size:{sm:2},content:function(t){return u.default.createElement("div",null,e.getClassificatonLabel(t.classification,t.diagnosisType),u.default.createElement("br",null),u.default.createElement("div",{className:"sub-text"},t.state.name))}},{title:"Unit",size:{sm:6},content:function(e){return u.default.createElement("div",null,e.ownerUnit.name,u.default.createElement("br",null),u.default.createElement("div",{className:"sub-text"},h.default.adminUnitDisplay(e.ownerUnit.adminUnit,!1,!0)))}}],values:t.getList(),onClick:this.caseClick}),u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:12},u.default.createElement(y.default,{controller:this.state.controller,showCounter:!0,className:"pull-right"})))):null)}}]),t}(u.default.Component);t.default=x},954:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?n(this.indicators[e]):null}}]),e}();t.default=u},958:function(e,t,n){var r=n(959);"string"==typeof r&&(r=[[e.id,r,""]]);n(790)(r,{});r.locals&&(e.exports=r.locals)},959:function(e,t,n){t=e.exports=n(789)(),t.push([e.id,".report .title{font-size:1.5em;color:#606060;font-weight:400;width:100%}.report .title.display{cursor:pointer}.report .title.edit{border:1px solid #d9dbda;border-radius:4px}.report .title.edit:focus{box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.report .var-selector{background-color:#f8f8f8;padding:8px;margin:8px -8px}.report .var-selector .vars-box{display:table}.report .var-selector .vars-box .var-del{display:table-cell;padding-right:12px}.report .var-selector .vars-box .var-control{display:table-cell;width:100%}",""])},960:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0||(e===-1?r.push(n.id):r[e]=n.id,t.props.onChange(r))}}},{key:"renderVar",value:function(e,t){return u.default.createElement("div",{className:"vars-box",key:t},u.default.createElement("div",{className:"var-del"},u.default.createElement(p.LinkTooltip,{toolTip:"Remove filtro",onClick:this.varRemove(t),icon:"minus",className:"remove-link"})),u.default.createElement("div",{className:"var-control"},u.default.createElement(d.default,{variables:this.props.variables,value:this.variableById(e),onChange:this.varChange(t)})))}},{key:"render",value:function(){var e=this,t=this.props.values;return u.default.createElement("div",null,t&&t.map(function(t,n){return e.renderVar(t,n)}),this.renderVar(null,-1))}}]),t}(u.default.Component);t.default=f},965:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?0:1})})}}},{key:"listCount",value:function(e){var t=e.length>0?e.length:"-";return u.default.createElement("div",{className:"value-big text-success"},t)}},{key:"tbCasesRender",value:function(){var e=this.state.cases.tbCases;return this.confirmRender(e)}},{key:"drtbCasesRender",value:function(){var e=this.state.cases.drtbCases;return this.confirmRender(e)}},{key:"confirmRender",value:function(e){return 0===e.length?this.noRecFoundRender():u.default.createElement(d.ReactTable,{className:"mtop-2x",columns:[{title:"Paciente",size:{sm:4},content:function(e){return u.default.createElement(d.Profile,{type:e.gender.toLowerCase(),size:"small",title:y.default.nameDisplay(e.name),subtitle:e.caseNumber})}},{title:"Data de notificação",size:{sm:2},content:function(e){var t=(0,h.default)(e.registrationDate);return u.default.createElement("div",null,t.format("L"),u.default.createElement("div",{className:"sub-text"},t.fromNow()))}},{title:"Tipo de paciente",size:{sm:2},content:function(e){return u.default.createElement("div",null,(0,v.getOptionName)("registrationGroup",e.registrationGroup),u.default.createElement("br",null),e.infectionSite?e.infectionSite.name:null)}},{title:"Data de início do tratamento",size:{sm:2},content:function(e){if(!e.iniTreatmentDate)return u.default.createElement("div",null,"-");var t=(0,h.default)(e.iniTreatmentDate);return u.default.createElement("div",null,t.format("L"),u.default.createElement("div",{className:"sub-text"},t.fromNow()))}},{title:"Evolução do tratamento",size:{sm:2},align:"center",content:function(e){return e.treatmentProgress?u.default.createElement(g.default,{value:e.treatmentProgress,width:45,height:45}):"-"}}],values:e,onClick:this.caseClick})}},{key:"presumptiveRender",value:function(){var e=this.state.cases.presumptives;return 0===e.length?this.noRecFoundRender():u.default.createElement(d.ReactTable,{columns:[{title:"Paciente",size:{sm:4},content:function(e){return u.default.createElement(d.Profile,{type:e.gender.toLowerCase(),size:"small",title:y.default.nameDisplay(e.name),subtitle:e.caseNumber})}},{title:"Data de notificação",size:{sm:3},content:function(e){var t=(0,h.default)(e.registrationDate);return u.default.createElement("div",null,t.format("L"),u.default.createElement("div",{className:"sub-text"},t.fromNow()))}},{title:"Exame Xpert",size:{sm:2},content:function(e){return e.xpertResult?e.xpertResult.name:"-"}},{title:"Microscopy",size:{sm:2},content:function(e){return e.microscopyResult?e.microscopyResult.name:"-"}}],values:e,className:"mtop-2x",onClick:this.caseClick})}},{key:"noRecFoundRender",value:function(){return u.default.createElement("div",{className:"card-default mtop-2x"},u.default.createElement("div",{className:"card-content"},u.default.createElement(c.Alert,{bsStyle:"warning"},"Nenhum registro encontrado")))}},{key:"caseClick",value:function(e){window.location.hash=y.default.caseHash(e.id)}},{key:"tabSelect",value:function(e){this.setState({sel:e})}},{key:"render",value:function(){var e=this.state.cases;if(!e)return u.default.createElement(d.WaitIcon,{type:"card"});var t=u.default.createElement(c.Nav,{bsStyle:"tabs",activeKey:this.state.sel,justified:!0,className:"app-tabs2",onSelect:this.tabSelect},e.presumptives.length>0&&u.default.createElement(c.NavItem,{key:0,eventKey:0},this.listCount(e.presumptives),"Suspeitos"),u.default.createElement(c.NavItem,{key:1,eventKey:1},this.listCount(e.tbCases),"Casos de TB"),u.default.createElement(c.NavItem,{key:2,eventKey:2},this.listCount(e.drtbCases),"Casos de TB-DR"));return u.default.createElement(d.Card,{padding:"none"},t,0===this.state.sel?this.presumptiveRender():null,1===this.state.sel?this.tbCasesRender():null,2===this.state.sel?this.drtbCasesRender():null)}}]),t}(u.default.Component);t.default=w},973:function(e,t,n){"use strict";function r(e,t){if(!e||!t)return null;var n=o.find(function(t){return t.id===e});if(void 0===n||null===n)return null;var r=n.options.find(function(e){return e.id===t});return r?r.name:t}function i(e){if(!e)return null;var t=o.find(function(t){return t.id===e});return t?t.options:null}Object.defineProperty(t,"__esModule",{value:!0}),t.getOptionName=r,t.getOptionList=i;var o=[{id:"advReactions",options:[{id:"adv1",name:"Abdominal Pain"},{id:"adv2",name:"Anorexia"},{id:"adv3",name:"Cardiac Arrythmias"},{id:"adv4",name:"Change in Skin Texture"}]},{id:"contactType",options:[{id:"household",name:"Household"},{id:"institutional",name:"Institutional (asylum, shelter, orphanage, etc.)"},{id:"nosocomial",name:"Nosocomial"}]},{id:"contactConduct",options:[{id:"conduct1",name:"Guidance/clarification"},{id:"conduct2",name:"Start TB treatment"},{id:"conduct3",name:"Start Chemoprophylaxis"},{id:"conduct4",name:"Other"}]},{id:"registrationGroup",options:[{id:"NEW",name:"New"},{id:"RELAPSE",name:"Relapse"},{id:"AFTER_DEFAULT",name:"After loss to follow-up"},{id:"FAILURE_FT",name:"After failure of first treatment with first-line drugs"},{id:"FAILURE_RT",name:"After failure of retreatment with first-line drugs"},{id:"PREVIOUSLY_TREATED",name:"Previously treated"},{id:"TREATMENT_AFTER_FAILURE",name:"Treatment after failure"},{id:"TREATMENT_AFTER_LOSS_FOLLOW_UP",name:"Treatment after loss to follow-up"},{id:"OTHER_PREVIOUSLY_TREATED",name:"Other previously treated"},{id:"UNKNOWN_PREVIOUS_TB_TREAT",name:"Unknown previous TB treatment history"},{id:"OTHER",name:"Other"}]},{id:"prevTbTreatOutcome",options:[{id:"prevOutcome01",name:"Completo"},{id:"prevOutcome02",name:"Curado"},{id:"prevOutcome03",name:"Abandono"},{id:"prevOutcome04",name:"Mudança de diagnóstico"},{id:"prevOutcome05",name:"Falência"},{id:"prevOutcome07",name:"Em andamento"},{id:"prevOutcome08",name:"Outro"},{id:"prevOutcome09",name:"Mudança de esquema"},{id:"prevOutcome10",name:"TBDR"},{id:"prevOutcome10",name:"Transferência"},{id:"prevOutcome11",name:"Desconhecido"}]}]},974:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0;return n||this.state.showComments?u.default.createElement(d.Card,{className:"comment-box"},u.default.createElement("div",null,t&&t.map(function(t){return u.default.createElement("div",{key:t.id,className:"media"},u.default.createElement("div",{className:"media-left"},u.default.createElement(d.Profile,{size:"small",type:"user"})),u.default.createElement("div",{className:"media-body"},u.default.createElement("div",{className:"pull-right"},t.id.indexOf("fakeid")<0&&t.id.indexOf("error")<0&&u.default.createElement("span",{className:"text-small"},u.default.createElement("a",{className:"lnk-muted",onClick:e.editClick(t)},u.default.createElement(d.Fa,{icon:"pencil"}),"Editar"),u.default.createElement(c.OverlayTrigger,{placement:"top",overlay:u.default.createElement(c.Tooltip,{id:"actdel"},"Excluir")},u.default.createElement("a",{className:"lnk-muted",onClick:e.removeClick(t)},u.default.createElement(d.Fa,{icon:"remove"})))),t.id.indexOf("fakeid")>=0&&u.default.createElement("span",{className:"lnk-muted"},u.default.createElement(d.Fa,{icon:"circle-o-notch",spin:!0}),"Salvando ..."),t.id.indexOf("error")>=0&&u.default.createElement("span",{className:"bs-error"},"Erro - as mudanças não foram salvas")),u.default.createElement("div",{className:"text-muted text-small"},u.default.createElement("b",null,t.user.name)," escreveu em ",u.default.createElement("b",null,(0,f.default)(t.date).format("lll"))),t.comment.split("\n").map(function(e,t){return u.default.createElement("span",{key:t},e,u.default.createElement("br",null))})))}),u.default.createElement("div",{className:"media"},u.default.createElement("div",{className:"media-left"},u.default.createElement(d.Profile,{size:"small",type:"user"})),u.default.createElement("div",{className:"media-body"},u.default.createElement("div",{className:"form-group no-margin-bottom"},u.default.createElement(d.AutoheightInput,{ref:"input",onChange:this.textChange}),u.default.createElement(c.Button,{bsStyle:"success",disabled:this.state.disabled,onClick:this.addComment,bsSize:"small",style:{marginTop:"6px"}},"Adicionar")))),u.default.createElement(c.Modal,{show:!!this.state.edtitem,onHide:this.modalClose},u.default.createElement(c.Modal.Header,{closeButton:!0},u.default.createElement(c.Modal.Title,null,"Edit comment")),u.default.createElement(c.Modal.Body,null,this.state.edtitem&&u.default.createElement("div",{className:"form-group"},u.default.createElement(d.AutoheightInput,{defaultValue:this.state.edtitem.comment,onChange:this.editTextChange,ref:"edtinput"})),u.default.createElement(c.ButtonToolbar,null,u.default.createElement(c.Button,{disabled:this.state.edtdisabled,bsStyle:"success",onClick:this.editConfirm},"Salvar"),u.default.createElement(c.Button,{bsStyle:"link",onClick:this.modalClose},"Cancelar")))),u.default.createElement(d.MessageDlg,{show:this.state.showRemoveConf,title:"Excluir",message:"Confirma exclusão?",type:"YesNo",onClose:this.closeRemoveConfDlg}))):this.emptyRender()}}]),t}(u.default.Component);t.default=h},986:function(e,t,n){var r=n(987);"string"==typeof r&&(r=[[e.id,r,""]]);n(790)(r,{});r.locals&&(e.exports=r.locals)},987:function(e,t,n){t=e.exports=n(789)(),t.push([e.id,".comment-box{background-color:#f8f8f8;border-top:1px solid #e8e8e8}.comments-link{cursor:pointer;color:#a0a0a0;transition:color .5s ease}.comments-link:hover{color:#505050;text-decoration:none}",""])},988:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?this.state.uidata.length:"-")),n&&u.default.createElement(c.Col,{sm:2},u.default.createElement("div",{className:"pull-right"},n)))}},{key:"showForm",value:function(e){var t=this;return function(){return t.setState({showForm:e})}}},{key:"save",value:function(){var e=this;return this.update(this.props.tbcase.id,this.state.doc).then(function(){var t=[];m.controls.forEach(function(n){e.state.doc[n.property]&&t.push(n)}),e.setState({uidata:t,showForm:!1})})}},{key:"update",value:function(e,t){return h.server.post("/api/cases/case/comorbidity/"+e,t).then(function(e){return e.success?e.result:Promise.reject(e.errors)})}},{key:"render",value:function(){var e=this.props.tbcase,t=this.state.uidata,n=[],r=[];return t.forEach(function(e,i){r.push(u.default.createElement(c.Col,{md:6,key:e.field+""+i},u.default.createElement(f.Card,null,u.default.createElement("span",null,u.default.createElement(f.Fa,{icon:"check"}),u.default.createElement("span",null,e.label))))),2!==r.length&&i!==t.length-1||(n.push(u.default.createElement(c.Row,{key:i},r)),r=[])}),u.default.createElement("span",null,u.default.createElement(f.FormDialog,{schema:m,doc:this.state.doc,onConfirm:this.save,onCancel:this.showForm(!1),wrapType:"modal",modalShow:this.state.showForm}),u.default.createElement(p.default,{tbcase:e,group:"COMORBIDITIES"},u.default.createElement(f.Card,{header:this.headerRender(),padding:"combine"},n)))}}]),t}(u.default.Component);t.default=y},991:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0&&t.refreshFollowups().then(function(){n&&(t.setState({successMsg:n}),setTimeout(function(){t.setState({successMsg:null})},4e3))})}},{key:"closeDel",value:function(e){var t=this,n=this.state.operation;return"yes"===e?n.crud.delete(n.followUpId).then(function(){return t.endOperation("successDel")}):(this.endOperation(),null)}},{key:"onFilterChange",value:function(){var e=this;return function(t){var n={};n.filter=t,e.setState(n)}}},{key:"isSelected",value:function(e){if(!this.state||!this.state.filter||0===this.state.filter.length)return!0;for(var t=0;tn.endDay)return!0}return!1}},{key:"_dayClick",value:function(e,t){this.isDisabledDay(t)||this.props.onDayClick&&this.props.onDayClick(t)}},{key:"render",value:function(){var e=this,t=this.props.data,n=t.year,r=t.month,i=t.iniDay?t.iniDay:1,o=new Date(n,r,i,0,0),a={dots:function(t){return"DOTS"===e._dayStatus(t)},selfadmin:function(t){return"SELF_ADMIN"===e._dayStatus(t)},nottaken:function(t){return"NOT_TAKEN"===e._dayStatus(t)}};return u.default.createElement("div",{className:this.props.className,onClick:this._calendarClick},u.default.createElement(d.default,{canChangeMonth:!1,initialMonth:o,modifiers:a,renderDay:this._renderDay,disabledDays:this.isDisabledDay,onDayClick:this._dayClick}),this.props.children)}}]),t}(u.default.Component);t.default=p},1007:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;ndiv{width:100%}.treat-followup .treat-table .treat-cal{float:left;border:1px solid #f0f0f0;position:relative;text-align:center;width:100%}.treat-followup .treat-table .DayPicker-Day{font-size:1.2em;padding:4px 8px}.treat-followup .treat-table .dropdown-menu{width:100%;box-shadow:0 0 32px #606060}}.treat-table.readonly:hover .treat-cal{background-color:transparent!important;cursor:default}.treat-table.readonly:hover .DayPicker-Day:hover{cursor:default}.DayPicker-Day .day{border-radius:12px;width:24px;height:24px;line-height:2;color:#a0a0a0}.DayPicker-Day--dots .day,.DayPicker-Day--nottaken .day,.DayPicker-Day--selfadmin .day{color:#fff;font-size:.8em;padding:1px 0 0}.DayPicker-Day--dots .day{background-color:#48aa8a}.DayPicker-Day--selfadmin .day{background-color:#4073a0}.DayPicker-Day--nottaken .day{background-color:#b0b0b0}",""])},1010:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0&&u.default.createElement("span",{className:"lnk-muted"},u.default.createElement(d.Fa,{icon:"circle-o-notch",spin:!0}),"Salvando ..."),e.id.indexOf("error")>=0&&u.default.createElement("span",{className:"bs-error"},"Erro - as mudanças não foram salvas")),e.closed?u.default.createElement("span",{className:"status-box bg-default2 mright"},"Fechada"):u.default.createElement("span",{className:"status-box bg-danger2 mright"},"Aberta"),u.default.createElement("div",{className:"inlineb"},u.default.createElement("b",null,e.title)),u.default.createElement("div",{className:"text-muted"},u.default.createElement("b",null,e.user.name)," escreveu em ",u.default.createElement("b",null,(0,f.default)(e.creationDate).format("lll"))),u.default.createElement("div",{className:"sub-text mbottom"},e.unit.name),e.description.split("\n").map(function(e,t){return u.default.createElement("span",{key:t},e,u.default.createElement("br",null))}),u.default.createElement(y.default,{issue:e,onEvent:this.onFollowupEvent}))))}}]),t}(u.default.Component);t.default=w},1017:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0&&u.default.createElement("span",{className:"lnk-muted"},u.default.createElement(d.Fa,{icon:"circle-o-notch",spin:!0}),"Salvando ..."),e.id.indexOf("error")>=0&&u.default.createElement("span",{className:"bs-error"},"Erro - as mudanças não foram salvas")),u.default.createElement("div",{className:"text-muted"},u.default.createElement("b",null,e.user.name)," escreveu em ",u.default.createElement("b",null,(0,f.default)(e.followupDate).format("lll"))),u.default.createElement("div",{className:"sub-text"},e.unit.name),e.text.split("\n").map(function(e,t){return u.default.createElement("span",{key:t},e,u.default.createElement("br",null))})))}):null}},{key:"render",value:function(){var e=this.props.issue.followups;return u.default.createElement("div",null,this.followUpsRender(e),this.props.issue.closed===!1&&u.default.createElement("div",{className:"mtop"},u.default.createElement(d.AutoheightInput,{ref:"input",onChange:this.textChange}),u.default.createElement(c.Button,{bsStyle:"primary",disabled:this.state.disabled,onClick:this.addAnswer,bsSize:"small",style:{marginTop:"6px"}},"Answer")),u.default.createElement(d.FormDialog,{schema:m,doc:this.state.doc,onCancel:this.modalClose,onConfirm:this.editConfirm,wrapType:"modal",modalShow:!!this.state.edtitem}))}}]),t}(u.default.Component);t.default=y},1018:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?u.default.createElement("span",{style:{fontSize:"1.0em",color:"#a0a0a0"}},"O paciente não foi encontrado na lista acima"):null;return u.default.createElement("div",null,u.default.createElement(d.Card,{className:"no-margin-bottom"},u.default.createElement(x.default,{controller:t}),u.default.createElement(E.default,{controller:t,showCounter:!0,className:"mtop"}),n.length>0&&u.default.createElement(d.ReactTable,{values:n,onClick:this.selectPatient,columns:[{title:"Paciente",size:{sm:4},content:function(e){return u.default.createElement(d.Profile,{type:e.patient.gender.toLowerCase(),size:"small",title:m.default.nameDisplay(e.patient.name),subtitle:e.caseNumber})}},{title:"Data de nascimento",size:{sm:2},content:function(e){return(0,S.default)(e.patient.birthDate).format("ll")}},{title:"Caso mais recente",size:{sm:6},content:function(t){return e.latestCaseRender(t)}}]}),u.default.createElement(E.default,{controller:t,showCounter:!0,className:"mtop"})),u.default.createElement(d.Card,{header:r,className:"no-padding",style:{backgroundColor:"#f6f6f6"}},u.default.createElement(c.Button,{bsStyle:"success",onClick:this.selectPatient},"Novo paciente")))}},{key:"render",value:function(){return u.default.createElement(c.Grid,{fluid:!0},u.default.createElement(c.Row,null,u.default.createElement(c.Col,{mdOffset:2,md:9},u.default.createElement(d.Card,{title:"Busca obrigatória de pacientes antes da nova notificação",className:"mtop"},u.default.createElement("div",null,u.default.createElement(f.default,{ref:"form",schema:P,doc:this.state.doc,errors:this.state.errors}),u.default.createElement(c.Row,null,u.default.createElement(c.Col,{sm:12},u.default.createElement(c.ButtonToolbar,null,u.default.createElement(d.AsyncButton,{fetching:this.state.fetching,onClick:this.searchClick,bsStyle:"primary"},"Search"),u.default.createElement(c.Button,{bsStyle:"link",onClick:this.props.onCancel},"Cancelar")))))),this.patientListRender())))}}]),t}(u.default.Component);t.default=T},1022:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n