/**
 * almond 0.2.6 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/almond for details
 */

//     Underscore.js 1.5.2
//     http://underscorejs.org
//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.

/*!
 * jQuery JavaScript Library v2.0.3
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2013-07-03T13:30Z
 */

/*!
 * Sizzle CSS Selector Engine v1.9.4-pre
 * http://sizzlejs.com/
 *
 * Copyright 2013 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2013-06-03
 */

//     (c) 2010-2011 Jeremy Ashkenas, DocumentCloud Inc.
//     (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
//     http://backbonejs.org

/*! sprintf.js | Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro> | 3 clause BSD license */

/* ===================================================
 * bootstrap-transition.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */

/* =========================================================
 * bootstrap-modal.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#modals
 * =========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================= */

/* ============================================================
 * bootstrap-dropdown.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
 * ============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */

/* =============================================================
 * bootstrap-scrollspy.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
 * =============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================== */

/* ========================================================
 * bootstrap-tab.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#tabs
 * ========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ======================================================== */

/* ===========================================================
 * bootstrap-tooltip.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#tooltips
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ===========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */

/* ===========================================================
 * bootstrap-popover.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#popovers
 * ===========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================================================== */

/* ==========================================================
 * bootstrap-alert.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#alerts
 * ==========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */

/* ============================================================
 * bootstrap-button.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#buttons
 * ============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */

/* =============================================================
 * bootstrap-collapse.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#collapse
 * =============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */

/* ==========================================================
 * bootstrap-carousel.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#carousel
 * ==========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */

/* =============================================================
 * bootstrap-typeahead.js v2.0.4
 * http://twitter.github.com/bootstrap/javascript.html#typeahead
 * =============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */

!function(t,e){t.Bokeh=e()}(this,function(){var t,e,s;return function(i){function n(t,e){return w.call(t,e)}function r(t,e){var i,s,n,r,o,a,l,h,p,u,c=e&&e.split("/"),_=m.map,d=_&&_["*"]||{};if(t&&"."===t.charAt(0))if(e){for(c=c.slice(0,c.length-1),t=c.concat(t.split("/")),h=0;h<t.length;h+=1)if(u=t[h],"."===u)t.splice(h,1),h-=1;else if(".."===u){if(1===h&&(".."===t[2]||".."===t[0]))break;h>0&&(t.splice(h-1,2),h-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((c||d)&&_){for(i=t.split("/"),h=i.length;h>0;h-=1){if(s=i.slice(0,h).join("/"),c)for(p=c.length;p>0;p-=1)if(n=_[c.slice(0,p).join("/")],n&&(n=n[s])){r=n,o=h;break}if(r)break;!a&&d&&d[s]&&(a=d[s],l=h)}!r&&a&&(r=a,o=l),r&&(i.splice(0,o,r),t=i.join("/"))}return t}function o(t,e){return function(){return _.apply(i,x.call(arguments,0).concat([t,e]))}}function a(t){return function(e){return r(e,t)}}function l(t){return function(e){g[t]=e}}function h(t){if(n(y,t)){var e=y[t];delete y[t],v[t]=!0,c.apply(i,e)}if(!n(g,t)&&!n(v,t))throw new Error("No "+t);return g[t]}function p(t){var e,i=t?t.indexOf("!"):-1;return i>-1&&(e=t.substring(0,i),t=t.substring(i+1,t.length)),[e,t]}function u(t){return function(){return m&&m.config&&m.config[t]||{}}}var c,_,d,f,g={},y={},m={},v={},w=Object.prototype.hasOwnProperty,x=[].slice;d=function(t,e){var i,s=p(t),n=s[0];return t=s[1],n&&(n=r(n,e),i=h(n)),n?t=i&&i.normalize?i.normalize(t,a(e)):r(t,e):(t=r(t,e),s=p(t),n=s[0],t=s[1],n&&(i=h(n))),{f:n?n+"!"+t:t,n:t,pr:n,p:i}},f={require:function(t){return o(t)},exports:function(t){var e=g[t];return"undefined"!=typeof e?e:g[t]={}},module:function(t){return{id:t,uri:"",exports:g[t],config:u(t)}}},c=function(t,e,s,r){var a,p,u,c,_,m,w=[];if(r=r||t,"function"==typeof s){for(e=!e.length&&s.length?["require","exports","module"]:e,_=0;_<e.length;_+=1)if(c=d(e[_],r),p=c.f,"require"===p)w[_]=f.require(t);else if("exports"===p)w[_]=f.exports(t),m=!0;else if("module"===p)a=w[_]=f.module(t);else if(n(g,p)||n(y,p)||n(v,p))w[_]=h(p);else{if(!c.p)throw new Error(t+" missing "+p);c.p.load(c.n,o(r,!0),l(p),{}),w[_]=g[p]}u=s.apply(g[t],w),t&&(a&&a.exports!==i&&a.exports!==g[t]?g[t]=a.exports:u===i&&m||(g[t]=u))}else t&&(g[t]=s)},t=e=_=function(t,e,s,n,r){return"string"==typeof t?f[t]?f[t](e):h(d(t,e).f):(t.splice||(m=t,e.splice?(t=e,e=s,s=null):t=i),e=e||function(){},"function"==typeof s&&(s=n,n=r),n?c(i,t,e,s):setTimeout(function(){c(i,t,e,s)},4),_)},_.config=function(t){return m=t,m.deps&&_(m.deps,m.callback),_},t._defined=g,s=function(t,e,i){e.splice||(i=e,e=[]),n(g,t)||n(y,t)||(y[t]=[t,e,i])},s.amd={jQuery:!0}}(),s("vendor/almond/almond",function(){}),function(){var t=this,e=t._,i={},n=Array.prototype,r=Object.prototype,o=Function.prototype,a=n.push,l=n.slice,h=n.concat,p=r.toString,u=r.hasOwnProperty,c=n.forEach,_=n.map,d=n.reduce,f=n.reduceRight,g=n.filter,y=n.every,m=n.some,v=n.indexOf,w=n.lastIndexOf,x=Array.isArray,b=Object.keys,k=o.bind,T=function(t){return t instanceof T?t:this instanceof T?(this._wrapped=t,void 0):new T(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=T),exports._=T):t._=T,T.VERSION="1.5.2";var C=T.each=T.forEach=function(t,e,s){if(null!=t)if(c&&t.forEach===c)t.forEach(e,s);else if(t.length===+t.length){for(var n=0,r=t.length;r>n;n++)if(e.call(s,t[n],n,t)===i)return}else for(var o=T.keys(t),n=0,r=o.length;r>n;n++)if(e.call(s,t[o[n]],o[n],t)===i)return};T.map=T.collect=function(t,e,i){var s=[];return null==t?s:_&&t.map===_?t.map(e,i):(C(t,function(t,n,r){s.push(e.call(i,t,n,r))}),s)};var M="Reduce of empty array with no initial value";T.reduce=T.foldl=T.inject=function(t,e,i,s){var n=arguments.length>2;if(null==t&&(t=[]),d&&t.reduce===d)return s&&(e=T.bind(e,s)),n?t.reduce(e,i):t.reduce(e);if(C(t,function(t,r,o){n?i=e.call(s,i,t,r,o):(i=t,n=!0)}),!n)throw new TypeError(M);return i},T.reduceRight=T.foldr=function(t,e,i,s){var n=arguments.length>2;if(null==t&&(t=[]),f&&t.reduceRight===f)return s&&(e=T.bind(e,s)),n?t.reduceRight(e,i):t.reduceRight(e);var r=t.length;if(r!==+r){var o=T.keys(t);r=o.length}if(C(t,function(a,l,h){l=o?o[--r]:--r,n?i=e.call(s,i,t[l],l,h):(i=t[l],n=!0)}),!n)throw new TypeError(M);return i},T.find=T.detect=function(t,e,i){var s;return z(t,function(t,n,r){return e.call(i,t,n,r)?(s=t,!0):void 0}),s},T.filter=T.select=function(t,e,i){var s=[];return null==t?s:g&&t.filter===g?t.filter(e,i):(C(t,function(t,n,r){e.call(i,t,n,r)&&s.push(t)}),s)},T.reject=function(t,e,i){return T.filter(t,function(t,s,n){return!e.call(i,t,s,n)},i)},T.every=T.all=function(t,e,s){e||(e=T.identity);var n=!0;return null==t?n:y&&t.every===y?t.every(e,s):(C(t,function(t,r,o){return(n=n&&e.call(s,t,r,o))?void 0:i}),!!n)};var z=T.some=T.any=function(t,e,s){e||(e=T.identity);var n=!1;return null==t?n:m&&t.some===m?t.some(e,s):(C(t,function(t,r,o){return n||(n=e.call(s,t,r,o))?i:void 0}),!!n)};T.contains=T.include=function(t,e){return null==t?!1:v&&t.indexOf===v?-1!=t.indexOf(e):z(t,function(t){return t===e})},T.invoke=function(t,e){var i=l.call(arguments,2),s=T.isFunction(e);return T.map(t,function(t){return(s?e:t[e]).apply(t,i)})},T.pluck=function(t,e){return T.map(t,function(t){return t[e]})},T.where=function(t,e,i){return T.isEmpty(e)?i?void 0:[]:T[i?"find":"filter"](t,function(t){for(var i in e)if(e[i]!==t[i])return!1;return!0})},T.findWhere=function(t,e){return T.where(t,e,!0)},T.max=function(t,e,i){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&T.isEmpty(t))return-1/0;var s={computed:-1/0,value:-1/0};return C(t,function(t,n,r){var o=e?e.call(i,t,n,r):t;o>s.computed&&(s={value:t,computed:o})}),s.value},T.min=function(t,e,i){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&T.isEmpty(t))return 1/0;var s={computed:1/0,value:1/0};return C(t,function(t,n,r){var o=e?e.call(i,t,n,r):t;o<s.computed&&(s={value:t,computed:o})}),s.value},T.shuffle=function(t){var e,i=0,s=[];return C(t,function(t){e=T.random(i++),s[i-1]=s[e],s[e]=t}),s},T.sample=function(t,e,i){return arguments.length<2||i?t[T.random(t.length-1)]:T.shuffle(t).slice(0,Math.max(0,e))};var P=function(t){return T.isFunction(t)?t:function(e){return e[t]}};T.sortBy=function(t,e,i){var s=P(e);return T.pluck(T.map(t,function(t,e,n){return{value:t,index:e,criteria:s.call(i,t,e,n)}}).sort(function(t,e){var i=t.criteria,s=e.criteria;if(i!==s){if(i>s||void 0===i)return 1;if(s>i||void 0===s)return-1}return t.index-e.index}),"value")};var j=function(t){return function(e,i,s){var n={},r=null==i?T.identity:P(i);return C(e,function(i,o){var a=r.call(s,i,o,e);t(n,a,i)}),n}};T.groupBy=j(function(t,e,i){(T.has(t,e)?t[e]:t[e]=[]).push(i)}),T.indexBy=j(function(t,e,i){t[e]=i}),T.countBy=j(function(t,e){T.has(t,e)?t[e]++:t[e]=1}),T.sortedIndex=function(t,e,i,s){i=null==i?T.identity:P(i);for(var n=i.call(s,e),r=0,o=t.length;o>r;){var a=r+o>>>1;i.call(s,t[a])<n?r=a+1:o=a}return r},T.toArray=function(t){return t?T.isArray(t)?l.call(t):t.length===+t.length?T.map(t,T.identity):T.values(t):[]},T.size=function(t){return null==t?0:t.length===+t.length?t.length:T.keys(t).length},T.first=T.head=T.take=function(t,e,i){return null==t?void 0:null==e||i?t[0]:l.call(t,0,e)},T.initial=function(t,e,i){return l.call(t,0,t.length-(null==e||i?1:e))},T.last=function(t,e,i){return null==t?void 0:null==e||i?t[t.length-1]:l.call(t,Math.max(t.length-e,0))},T.rest=T.tail=T.drop=function(t,e,i){return l.call(t,null==e||i?1:e)},T.compact=function(t){return T.filter(t,T.identity)};var N=function(t,e,i){return e&&T.every(t,T.isArray)?h.apply(i,t):(C(t,function(t){T.isArray(t)||T.isArguments(t)?e?a.apply(i,t):N(t,e,i):i.push(t)}),i)};T.flatten=function(t,e){return N(t,e,[])},T.without=function(t){return T.difference(t,l.call(arguments,1))},T.uniq=T.unique=function(t,e,i,s){T.isFunction(e)&&(s=i,i=e,e=!1);var n=i?T.map(t,i,s):t,r=[],o=[];return C(n,function(i,s){(e?s&&o[o.length-1]===i:T.contains(o,i))||(o.push(i),r.push(t[s]))}),r},T.union=function(){return T.uniq(T.flatten(arguments,!0))},T.intersection=function(t){var e=l.call(arguments,1);return T.filter(T.uniq(t),function(t){return T.every(e,function(e){return T.indexOf(e,t)>=0})})},T.difference=function(t){var e=h.apply(n,l.call(arguments,1));return T.filter(t,function(t){return!T.contains(e,t)})},T.zip=function(){for(var t=T.max(T.pluck(arguments,"length").concat(0)),e=new Array(t),i=0;t>i;i++)e[i]=T.pluck(arguments,""+i);return e},T.object=function(t,e){if(null==t)return{};for(var i={},s=0,n=t.length;n>s;s++)e?i[t[s]]=e[s]:i[t[s][0]]=t[s][1];return i},T.indexOf=function(t,e,i){if(null==t)return-1;var s=0,n=t.length;if(i){if("number"!=typeof i)return s=T.sortedIndex(t,e),t[s]===e?s:-1;s=0>i?Math.max(0,n+i):i}if(v&&t.indexOf===v)return t.indexOf(e,i);for(;n>s;s++)if(t[s]===e)return s;return-1},T.lastIndexOf=function(t,e,i){if(null==t)return-1;var s=null!=i;if(w&&t.lastIndexOf===w)return s?t.lastIndexOf(e,i):t.lastIndexOf(e);for(var n=s?i:t.length;n--;)if(t[n]===e)return n;return-1},T.range=function(t,e,i){arguments.length<=1&&(e=t||0,t=0),i=arguments[2]||1;for(var s=Math.max(Math.ceil((e-t)/i),0),n=0,r=new Array(s);s>n;)r[n++]=t,t+=i;return r};var $=function(){};T.bind=function(t,e){var i,s;if(k&&t.bind===k)return k.apply(t,l.call(arguments,1));if(!T.isFunction(t))throw new TypeError;return i=l.call(arguments,2),s=function(){if(!(this instanceof s))return t.apply(e,i.concat(l.call(arguments)));$.prototype=t.prototype;var n=new $;$.prototype=null;var r=t.apply(n,i.concat(l.call(arguments)));return Object(r)===r?r:n}},T.partial=function(t){var e=l.call(arguments,1);return function(){return t.apply(this,e.concat(l.call(arguments)))}},T.bindAll=function(t){var e=l.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return C(e,function(e){t[e]=T.bind(t[e],t)}),t},T.memoize=function(t,e){var i={};return e||(e=T.identity),function(){var s=e.apply(this,arguments);return T.has(i,s)?i[s]:i[s]=t.apply(this,arguments)}},T.delay=function(t,e){var i=l.call(arguments,2);return setTimeout(function(){return t.apply(null,i)},e)},T.defer=function(t){return T.delay.apply(T,[t,1].concat(l.call(arguments,1)))},T.throttle=function(t,e,i){var s,n,r,o=null,a=0;i||(i={});var l=function(){a=i.leading===!1?0:new Date,o=null,r=t.apply(s,n)};return function(){var h=new Date;a||i.leading!==!1||(a=h);var p=e-(h-a);return s=this,n=arguments,0>=p?(clearTimeout(o),o=null,a=h,r=t.apply(s,n)):o||i.trailing===!1||(o=setTimeout(l,p)),r}},T.debounce=function(t,e,i){var s,n,r,o,a;return function(){r=this,n=arguments,o=new Date;var l=function(){var h=new Date-o;e>h?s=setTimeout(l,e-h):(s=null,i||(a=t.apply(r,n)))},h=i&&!s;return s||(s=setTimeout(l,e)),h&&(a=t.apply(r,n)),a}},T.once=function(t){var e,i=!1;return function(){return i?e:(i=!0,e=t.apply(this,arguments),t=null,e)}},T.wrap=function(t,e){return function(){var i=[t];return a.apply(i,arguments),e.apply(this,i)}},T.compose=function(){var t=arguments;return function(){for(var e=arguments,i=t.length-1;i>=0;i--)e=[t[i].apply(this,e)];return e[0]}},T.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},T.keys=b||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var i in t)T.has(t,i)&&e.push(i);return e},T.values=function(t){for(var e=T.keys(t),i=e.length,s=new Array(i),n=0;i>n;n++)s[n]=t[e[n]];return s},T.pairs=function(t){for(var e=T.keys(t),i=e.length,s=new Array(i),n=0;i>n;n++)s[n]=[e[n],t[e[n]]];return s},T.invert=function(t){for(var e={},i=T.keys(t),s=0,n=i.length;n>s;s++)e[t[i[s]]]=i[s];return e},T.functions=T.methods=function(t){var e=[];for(var i in t)T.isFunction(t[i])&&e.push(i);return e.sort()},T.extend=function(t){return C(l.call(arguments,1),function(e){if(e)for(var i in e)t[i]=e[i]}),t},T.pick=function(t){var e={},i=h.apply(n,l.call(arguments,1));return C(i,function(i){i in t&&(e[i]=t[i])}),e},T.omit=function(t){var e={},i=h.apply(n,l.call(arguments,1));for(var s in t)T.contains(i,s)||(e[s]=t[s]);return e},T.defaults=function(t){return C(l.call(arguments,1),function(e){if(e)for(var i in e)void 0===t[i]&&(t[i]=e[i])}),t},T.clone=function(t){return T.isObject(t)?T.isArray(t)?t.slice():T.extend({},t):t},T.tap=function(t,e){return e(t),t};var S=function(t,e,i,s){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof T&&(t=t._wrapped),e instanceof T&&(e=e._wrapped);var n=p.call(t);if(n!=p.call(e))return!1;switch(n){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var r=i.length;r--;)if(i[r]==t)return s[r]==e;var o=t.constructor,a=e.constructor;if(o!==a&&!(T.isFunction(o)&&o instanceof o&&T.isFunction(a)&&a instanceof a))return!1;i.push(t),s.push(e);var l=0,h=!0;if("[object Array]"==n){if(l=t.length,h=l==e.length)for(;l--&&(h=S(t[l],e[l],i,s)););}else{for(var u in t)if(T.has(t,u)&&(l++,!(h=T.has(e,u)&&S(t[u],e[u],i,s))))break;if(h){for(u in e)if(T.has(e,u)&&!l--)break;h=!l}}return i.pop(),s.pop(),h};T.isEqual=function(t,e){return S(t,e,[],[])},T.isEmpty=function(t){if(null==t)return!0;if(T.isArray(t)||T.isString(t))return 0===t.length;for(var e in t)if(T.has(t,e))return!1;return!0},T.isElement=function(t){return!(!t||1!==t.nodeType)},T.isArray=x||function(t){return"[object Array]"==p.call(t)},T.isObject=function(t){return t===Object(t)},C(["Arguments","Function","String","Number","Date","RegExp"],function(t){T["is"+t]=function(e){return p.call(e)=="[object "+t+"]"}}),T.isArguments(arguments)||(T.isArguments=function(t){return!(!t||!T.has(t,"callee"))}),"function"!=typeof/./&&(T.isFunction=function(t){return"function"==typeof t}),T.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},T.isNaN=function(t){return T.isNumber(t)&&t!=+t},T.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==p.call(t)},T.isNull=function(t){return null===t},T.isUndefined=function(t){return void 0===t},T.has=function(t,e){return u.call(t,e)},T.noConflict=function(){return t._=e,this},T.identity=function(t){return t},T.times=function(t,e,i){for(var s=Array(Math.max(0,t)),n=0;t>n;n++)s[n]=e.call(i,n);return s},T.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var A={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};A.unescape=T.invert(A.escape);var E={escape:new RegExp("["+T.keys(A.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(A.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(t){T[t]=function(e){return null==e?"":(""+e).replace(E[t],function(e){return A[t][e]})}}),T.result=function(t,e){if(null==t)return void 0;var i=t[e];return T.isFunction(i)?i.call(t):i},T.mixin=function(t){C(T.functions(t),function(e){var i=T[e]=t[e];T.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),B.call(this,i.apply(T,t))}})};var F=0;T.uniqueId=function(t){var e=++F+"";return t?t+e:e},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(t,e,i){var s;i=T.defaults({},i,T.templateSettings);var n=new RegExp([(i.escape||D).source,(i.interpolate||D).source,(i.evaluate||D).source].join("|")+"|$","g"),r=0,o="__p+='";t.replace(n,function(e,i,s,n,a){return o+=t.slice(r,a).replace(O,function(t){return"\\"+q[t]}),i&&(o+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),s&&(o+="'+\n((__t=("+s+"))==null?'':__t)+\n'"),n&&(o+="';\n"+n+"\n__p+='"),r=a+e.length,e}),o+="';\n",i.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{s=new Function(i.variable||"obj","_",o)}catch(a){throw a.source=o,a}if(e)return s(e,T);var l=function(t){return s.call(this,t,T)};return l.source="function("+(i.variable||"obj")+"){\n"+o+"}",l},T.chain=function(t){return T(t).chain()};var B=function(t){return this._chain?T(t).chain():t};T.mixin(T),C(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=n[t];T.prototype[t]=function(){var i=this._wrapped;return e.apply(i,arguments),"shift"!=t&&"splice"!=t||0!==i.length||delete i[0],B.call(this,i)}}),C(["concat","join","slice"],function(t){var e=n[t];T.prototype[t]=function(){return B.call(this,e.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof s&&s.amd&&s("underscore",[],function(){return T})}.call(this),function(){s("common/custom",["underscore"],function(t){var e;return e=function(){return t.uniqueId=function(t){var e,i,s,n,r;for(s=[],e="0123456789ABCDEF",i=r=0;31>=r;i=++r)s[i]=e.substr(Math.floor(16*Math.random()),1);return s[12]="4",s[16]=e.substr(8|3&s[16],1),n=s.join(""),t?t+"-"+n:n}},t.isNullOrUndefined=function(e){return t.isNull(e)||t.isUndefined(e)},t.setdefault=function(e,i,s){return t.has(e,i)?e[i]:(e[i]=s,s)},{monkey_patch:e}})}.call(this),function(t,e){function i(t){var e=t.length,i=oe.type(t);return oe.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===i||"function"!==i&&(0===e||"number"==typeof e&&e>0&&e-1 in t)}function n(t){var e=fe[t]={};return oe.each(t.match(le)||[],function(t,i){e[i]=!0}),e}function r(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=oe.expando+Math.random()}function o(t,i,s){var n;if(s===e&&1===t.nodeType)if(n="data-"+i.replace(ve,"-$1").toLowerCase(),s=t.getAttribute(n),"string"==typeof s){try{s="true"===s?!0:"false"===s?!1:"null"===s?null:+s+""===s?+s:me.test(s)?JSON.parse(s):s}catch(r){}ge.set(t,i,s)}else s=e;return s}function a(){return!0}function l(){return!1}function h(){try{return G.activeElement}catch(t){}}function p(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function u(t,e,i){if(oe.isFunction(e))return oe.grep(t,function(t,s){return!!e.call(t,s,t)!==i});if(e.nodeType)return oe.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(je.test(e))return oe.filter(e,t,i);e=oe.filter(e,t)}return oe.grep(t,function(t){return ie.call(e,t)>=0!==i})}function c(t,e){return oe.nodeName(t,"table")&&oe.nodeName(1===e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function _(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=Re.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function f(t,e){for(var i=t.length,s=0;i>s;s++)ye.set(t[s],"globalEval",!e||ye.get(e[s],"globalEval"))}function g(t,e){var i,s,n,r,o,a,l,h;if(1===e.nodeType){if(ye.hasData(t)&&(r=ye.access(t),o=ye.set(e,r),h=r.events)){delete o.handle,o.events={};for(n in h)for(i=0,s=h[n].length;s>i;i++)oe.event.add(e,n,h[n][i])}ge.hasData(t)&&(a=ge.access(t),l=oe.extend({},a),ge.set(e,l))}}function y(t,i){var s=t.getElementsByTagName?t.getElementsByTagName(i||"*"):t.querySelectorAll?t.querySelectorAll(i||"*"):[];return i===e||i&&oe.nodeName(t,i)?oe.merge([t],s):s}function m(t,e){var i=e.nodeName.toLowerCase();"input"===i&&qe.test(t.type)?e.checked=t.checked:("input"===i||"textarea"===i)&&(e.defaultValue=t.defaultValue)}function v(t,e){if(e in t)return e;for(var i=e.charAt(0).toUpperCase()+e.slice(1),s=e,n=ti.length;n--;)if(e=ti[n]+i,e in t)return e;return s}function w(t,e){return t=e||t,"none"===oe.css(t,"display")||!oe.contains(t.ownerDocument,t)}function x(e){return t.getComputedStyle(e,null)}function b(t,e){for(var i,s,n,r=[],o=0,a=t.length;a>o;o++)s=t[o],s.style&&(r[o]=ye.get(s,"olddisplay"),i=s.style.display,e?(r[o]||"none"!==i||(s.style.display=""),""===s.style.display&&w(s)&&(r[o]=ye.access(s,"olddisplay",M(s.nodeName)))):r[o]||(n=w(s),(i&&"none"!==i||!n)&&ye.set(s,"olddisplay",n?i:oe.css(s,"display"))));for(o=0;a>o;o++)s=t[o],s.style&&(e&&"none"!==s.style.display&&""!==s.style.display||(s.style.display=e?r[o]||"":"none"));return t}function k(t,e,i){var s=We.exec(e);return s?Math.max(0,s[1]-(i||0))+(s[2]||"px"):e}function T(t,e,i,s,n){for(var r=i===(s?"border":"content")?4:"width"===e?1:0,o=0;4>r;r+=2)"margin"===i&&(o+=oe.css(t,i+Ke[r],!0,n)),s?("content"===i&&(o-=oe.css(t,"padding"+Ke[r],!0,n)),"margin"!==i&&(o-=oe.css(t,"border"+Ke[r]+"Width",!0,n))):(o+=oe.css(t,"padding"+Ke[r],!0,n),"padding"!==i&&(o+=oe.css(t,"border"+Ke[r]+"Width",!0,n)));return o}function C(t,e,i){var s=!0,n="width"===e?t.offsetWidth:t.offsetHeight,r=x(t),o=oe.support.boxSizing&&"border-box"===oe.css(t,"boxSizing",!1,r);if(0>=n||null==n){if(n=He(t,e,r),(0>n||null==n)&&(n=t.style[e]),Ye.test(n))return n;s=o&&(oe.support.boxSizingReliable||n===t.style[e]),n=parseFloat(n)||0}return n+T(t,e,i||(o?"border":"content"),s,r)+"px"}function M(t){var e=G,i=Je[t];return i||(i=z(t,e),"none"!==i&&i||(Ie=(Ie||oe("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(e.documentElement),e=(Ie[0].contentWindow||Ie[0].contentDocument).document,e.write("<!doctype html><html><body>"),e.close(),i=z(t,e),Ie.detach()),Je[t]=i),i}function z(t,e){var i=oe(e.createElement(t)).appendTo(e.body),s=oe.css(i[0],"display");return i.remove(),s}function P(t,e,i,s){var n;if(oe.isArray(e))oe.each(e,function(e,n){i||ii.test(t)?s(t,n):P(t+"["+("object"==typeof n?e:"")+"]",n,i,s)});else if(i||"object"!==oe.type(e))s(t,e);else for(n in e)P(t+"["+n+"]",e[n],i,s)}function j(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var s,n=0,r=e.toLowerCase().match(le)||[];if(oe.isFunction(i))for(;s=r[n++];)"+"===s[0]?(s=s.slice(1)||"*",(t[s]=t[s]||[]).unshift(i)):(t[s]=t[s]||[]).push(i)}}function N(t,e,i,s){function n(a){var l;return r[a]=!0,oe.each(t[a]||[],function(t,a){var h=a(e,i,s);return"string"!=typeof h||o||r[h]?o?!(l=h):void 0:(e.dataTypes.unshift(h),n(h),!1)}),l}var r={},o=t===vi;return n(e.dataTypes[0])||!r["*"]&&n("*")}function $(t,i){var s,n,r=oe.ajaxSettings.flatOptions||{};for(s in i)i[s]!==e&&((r[s]?t:n||(n={}))[s]=i[s]);return n&&oe.extend(!0,t,n),t}function S(t,i,s){for(var n,r,o,a,l=t.contents,h=t.dataTypes;"*"===h[0];)h.shift(),n===e&&(n=t.mimeType||i.getResponseHeader("Content-Type"));if(n)for(r in l)if(l[r]&&l[r].test(n)){h.unshift(r);break}if(h[0]in s)o=h[0];else{for(r in s){if(!h[0]||t.converters[r+" "+h[0]]){o=r;break}a||(a=r)}o=o||a}return o?(o!==h[0]&&h.unshift(o),s[o]):void 0}function A(t,e,i,s){var n,r,o,a,l,h={},p=t.dataTypes.slice();if(p[1])for(o in t.converters)h[o.toLowerCase()]=t.converters[o];for(r=p.shift();r;)if(t.responseFields[r]&&(i[t.responseFields[r]]=e),!l&&s&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=p.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(o=h[l+" "+r]||h["* "+r],!o)for(n in h)if(a=n.split(" "),a[1]===r&&(o=h[l+" "+a[0]]||h["* "+a[0]])){o===!0?o=h[n]:h[n]!==!0&&(r=a[0],p.unshift(a[1]));break}if(o!==!0)if(o&&t["throws"])e=o(e);else try{e=o(e)}catch(u){return{state:"parsererror",error:o?u:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}function E(){return setTimeout(function(){Pi=e}),Pi=oe.now()}function F(t,e,i){for(var s,n=(Ei[e]||[]).concat(Ei["*"]),r=0,o=n.length;o>r;r++)if(s=n[r].call(i,e,t))return s}function D(t,e,i){var s,n,r=0,o=Ai.length,a=oe.Deferred().always(function(){delete l.elem}),l=function(){if(n)return!1;for(var e=Pi||E(),i=Math.max(0,h.startTime+h.duration-e),s=i/h.duration||0,r=1-s,o=0,l=h.tweens.length;l>o;o++)h.tweens[o].run(r);return a.notifyWith(t,[h,r,i]),1>r&&l?i:(a.resolveWith(t,[h]),!1)},h=a.promise({elem:t,props:oe.extend({},e),opts:oe.extend(!0,{specialEasing:{}},i),originalProperties:e,originalOptions:i,startTime:Pi||E(),duration:i.duration,tweens:[],createTween:function(e,i){var s=oe.Tween(t,h.opts,e,i,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(s),s},stop:function(e){var i=0,s=e?h.tweens.length:0;if(n)return this;for(n=!0;s>i;i++)h.tweens[i].run(1);return e?a.resolveWith(t,[h,e]):a.rejectWith(t,[h,e]),this}}),p=h.props;for(q(p,h.opts.specialEasing);o>r;r++)if(s=Ai[r].call(h,t,p,h.opts))return s;return oe.map(p,F,h),oe.isFunction(h.opts.start)&&h.opts.start.call(t,h),oe.fx.timer(oe.extend(l,{elem:t,anim:h,queue:h.opts.queue})),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always)}function q(t,e){var i,s,n,r,o;for(i in t)if(s=oe.camelCase(i),n=e[s],r=t[i],oe.isArray(r)&&(n=r[1],r=t[i]=r[0]),i!==s&&(t[s]=r,delete t[i]),o=oe.cssHooks[s],o&&"expand"in o){r=o.expand(r),delete t[s];for(i in r)i in t||(t[i]=r[i],e[i]=n)}else e[s]=n}function O(t,i,s){var n,r,o,a,l,h,p=this,u={},c=t.style,_=t.nodeType&&w(t),d=ye.get(t,"fxshow");s.queue||(l=oe._queueHooks(t,"fx"),null==l.unqueued&&(l.unqueued=0,h=l.empty.fire,l.empty.fire=function(){l.unqueued||h()}),l.unqueued++,p.always(function(){p.always(function(){l.unqueued--,oe.queue(t,"fx").length||l.empty.fire()})})),1===t.nodeType&&("height"in i||"width"in i)&&(s.overflow=[c.overflow,c.overflowX,c.overflowY],"inline"===oe.css(t,"display")&&"none"===oe.css(t,"float")&&(c.display="inline-block")),s.overflow&&(c.overflow="hidden",p.always(function(){c.overflow=s.overflow[0],c.overflowX=s.overflow[1],c.overflowY=s.overflow[2]}));for(n in i)if(r=i[n],Ni.exec(r)){if(delete i[n],o=o||"toggle"===r,r===(_?"hide":"show")){if("show"!==r||!d||d[n]===e)continue;_=!0}u[n]=d&&d[n]||oe.style(t,n)}if(!oe.isEmptyObject(u)){d?"hidden"in d&&(_=d.hidden):d=ye.access(t,"fxshow",{}),o&&(d.hidden=!_),_?oe(t).show():p.done(function(){oe(t).hide()}),p.done(function(){var e;ye.remove(t,"fxshow");for(e in u)oe.style(t,e,u[e])});for(n in u)a=F(_?d[n]:0,n,p),n in d||(d[n]=a.start,_&&(a.end=a.start,a.start="width"===n||"height"===n?1:0))}}function B(t,e,i,s,n){return new B.prototype.init(t,e,i,s,n)}function R(t,e){var i,s={height:t},n=0;for(e=e?1:0;4>n;n+=2-e)i=Ke[n],s["margin"+i]=s["padding"+i]=t;return e&&(s.opacity=s.width=t),s}function U(t){return oe.isWindow(t)?t:9===t.nodeType&&t.defaultView}var L,H,I=typeof e,V=t.location,G=t.document,W=G.documentElement,Y=t.jQuery,X=t.$,J={},Q=[],Z="2.0.3",K=Q.concat,te=Q.push,ee=Q.slice,ie=Q.indexOf,se=J.toString,ne=J.hasOwnProperty,re=Z.trim,oe=function(t,e){return new oe.fn.init(t,e,L)},ae=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,le=/\S+/g,he=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,pe=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ue=/^-ms-/,ce=/-([\da-z])/gi,_e=function(t,e){return e.toUpperCase()},de=function(){G.removeEventListener("DOMContentLoaded",de,!1),t.removeEventListener("load",de,!1),oe.ready()};oe.fn=oe.prototype={jquery:Z,constructor:oe,init:function(t,i,s){var n,r;if(!t)return this;if("string"==typeof t){if(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:he.exec(t),!n||!n[1]&&i)return!i||i.jquery?(i||s).find(t):this.constructor(i).find(t);if(n[1]){if(i=i instanceof oe?i[0]:i,oe.merge(this,oe.parseHTML(n[1],i&&i.nodeType?i.ownerDocument||i:G,!0)),pe.test(n[1])&&oe.isPlainObject(i))for(n in i)oe.isFunction(this[n])?this[n](i[n]):this.attr(n,i[n]);return this}return r=G.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=G,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):oe.isFunction(t)?s.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),oe.makeArray(t,this))},selector:"",length:0,toArray:function(){return ee.call(this)},get:function(t){return null==t?this.toArray():0>t?this[this.length+t]:this[t]},pushStack:function(t){var e=oe.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return oe.each(this,t,e)},ready:function(t){return oe.ready.promise().done(t),this},slice:function(){return this.pushStack(ee.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,i=+t+(0>t?e:0);return this.pushStack(i>=0&&e>i?[this[i]]:[])},map:function(t){return this.pushStack(oe.map(this,function(e,i){return t.call(e,i,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:te,sort:[].sort,splice:[].splice},oe.fn.init.prototype=oe.fn,oe.extend=oe.fn.extend=function(){var t,i,s,n,r,o,a=arguments[0]||{},l=1,h=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),"object"==typeof a||oe.isFunction(a)||(a={}),h===l&&(a=this,--l);h>l;l++)if(null!=(t=arguments[l]))for(i in t)s=a[i],n=t[i],a!==n&&(p&&n&&(oe.isPlainObject(n)||(r=oe.isArray(n)))?(r?(r=!1,o=s&&oe.isArray(s)?s:[]):o=s&&oe.isPlainObject(s)?s:{},a[i]=oe.extend(p,o,n)):n!==e&&(a[i]=n));return a},oe.extend({expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noConflict:function(e){return t.$===oe&&(t.$=X),e&&t.jQuery===oe&&(t.jQuery=Y),oe},isReady:!1,readyWait:1,holdReady:function(t){t?oe.readyWait++:oe.ready(!0)},ready:function(t){(t===!0?--oe.readyWait:oe.isReady)||(oe.isReady=!0,t!==!0&&--oe.readyWait>0||(H.resolveWith(G,[oe]),oe.fn.trigger&&oe(G).trigger("ready").off("ready")))},isFunction:function(t){return"function"===oe.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?String(t):"object"==typeof t||"function"==typeof t?J[se.call(t)]||"object":typeof t},isPlainObject:function(t){if("object"!==oe.type(t)||t.nodeType||oe.isWindow(t))return!1;try{if(t.constructor&&!ne.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}return!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw new Error(t)},parseHTML:function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||G;var s=pe.exec(t),n=!i&&[];return s?[e.createElement(s[1])]:(s=oe.buildFragment([t],e,n),n&&oe(n).remove(),oe.merge([],s.childNodes))},parseJSON:JSON.parse,parseXML:function(t){var i,s;if(!t||"string"!=typeof t)return null;try{s=new DOMParser,i=s.parseFromString(t,"text/xml")}catch(n){i=e}return(!i||i.getElementsByTagName("parsererror").length)&&oe.error("Invalid XML: "+t),i},noop:function(){},globalEval:function(t){var e,i=eval;t=oe.trim(t),t&&(1===t.indexOf("use strict")?(e=G.createElement("script"),e.text=t,G.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(ue,"ms-").replace(ce,_e)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,s){var n,r=0,o=t.length,a=i(t);if(s){if(a)for(;o>r&&(n=e.apply(t[r],s),n!==!1);r++);else for(r in t)if(n=e.apply(t[r],s),n===!1)break}else if(a)for(;o>r&&(n=e.call(t[r],r,t[r]),n!==!1);r++);else for(r in t)if(n=e.call(t[r],r,t[r]),n===!1)break;return t},trim:function(t){return null==t?"":re.call(t)},makeArray:function(t,e){var s=e||[];return null!=t&&(i(Object(t))?oe.merge(s,"string"==typeof t?[t]:t):te.call(s,t)),s},inArray:function(t,e,i){return null==e?-1:ie.call(e,t,i)},merge:function(t,i){var s=i.length,n=t.length,r=0;if("number"==typeof s)for(;s>r;r++)t[n++]=i[r];else for(;i[r]!==e;)t[n++]=i[r++];return t.length=n,t},grep:function(t,e,i){var s,n=[],r=0,o=t.length;for(i=!!i;o>r;r++)s=!!e(t[r],r),i!==s&&n.push(t[r]);return n},map:function(t,e,s){var n,r=0,o=t.length,a=i(t),l=[];if(a)for(;o>r;r++)n=e(t[r],r,s),null!=n&&(l[l.length]=n);else for(r in t)n=e(t[r],r,s),null!=n&&(l[l.length]=n);return K.apply([],l)},guid:1,proxy:function(t,i){var s,n,r;return"string"==typeof i&&(s=t[i],i=t,t=s),oe.isFunction(t)?(n=ee.call(arguments,2),r=function(){return t.apply(i||this,n.concat(ee.call(arguments)))},r.guid=t.guid=t.guid||oe.guid++,r):e},access:function(t,i,s,n,r,o,a){var l=0,h=t.length,p=null==s;if("object"===oe.type(s)){r=!0;for(l in s)oe.access(t,i,l,s[l],!0,o,a)}else if(n!==e&&(r=!0,oe.isFunction(n)||(a=!0),p&&(a?(i.call(t,n),i=null):(p=i,i=function(t,e,i){return p.call(oe(t),i)})),i))for(;h>l;l++)i(t[l],s,a?n:n.call(t[l],l,i(t[l],s)));return r?t:p?i.call(t):h?i(t[0],s):o},now:Date.now,swap:function(t,e,i,s){var n,r,o={};
for(r in e)o[r]=t.style[r],t.style[r]=e[r];n=i.apply(t,s||[]);for(r in e)t.style[r]=o[r];return n}}),oe.ready.promise=function(e){return H||(H=oe.Deferred(),"complete"===G.readyState?setTimeout(oe.ready):(G.addEventListener("DOMContentLoaded",de,!1),t.addEventListener("load",de,!1))),H.promise(e)},oe.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){J["[object "+e+"]"]=e.toLowerCase()}),L=oe(G),function(t,e){function i(t,e,i,s){var n,r,o,a,l,h,p,u,d,f;if((e?e.ownerDocument||e:R)!==S&&$(e),e=e||S,i=i||[],!t||"string"!=typeof t)return i;if(1!==(a=e.nodeType)&&9!==a)return[];if(E&&!s){if(n=ve.exec(t))if(o=n[1]){if(9===a){if(r=e.getElementById(o),!r||!r.parentNode)return i;if(r.id===o)return i.push(r),i}else if(e.ownerDocument&&(r=e.ownerDocument.getElementById(o))&&O(e,r)&&r.id===o)return i.push(r),i}else{if(n[2])return te.apply(i,e.getElementsByTagName(t)),i;if((o=n[3])&&k.getElementsByClassName&&e.getElementsByClassName)return te.apply(i,e.getElementsByClassName(o)),i}if(k.qsa&&(!F||!F.test(t))){if(u=p=B,d=e,f=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(h=c(t),(p=e.getAttribute("id"))?u=p.replace(be,"\\$&"):e.setAttribute("id",u),u="[id='"+u+"'] ",l=h.length;l--;)h[l]=u+_(h[l]);d=_e.test(t)&&e.parentNode||e,f=h.join(",")}if(f)try{return te.apply(i,d.querySelectorAll(f)),i}catch(g){}finally{p||e.removeAttribute("id")}}}return x(t.replace(pe,"$1"),e,i,s)}function s(){function t(i,s){return e.push(i+=" ")>C.cacheLength&&delete t[e.shift()],t[i]=s}var e=[];return t}function n(t){return t[B]=!0,t}function r(t){var e=S.createElement("div");try{return!!t(e)}catch(i){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var i=t.split("|"),s=t.length;s--;)C.attrHandle[i[s]]=e}function a(t,e){var i=e&&t,s=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||X)-(~t.sourceIndex||X);if(s)return s;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function l(t){return function(e){var i=e.nodeName.toLowerCase();return"input"===i&&e.type===t}}function h(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function p(t){return n(function(e){return e=+e,n(function(i,s){for(var n,r=t([],i.length,e),o=r.length;o--;)i[n=r[o]]&&(i[n]=!(s[n]=i[n]))})})}function u(){}function c(t,e){var s,n,r,o,a,l,h,p=I[t+" "];if(p)return e?0:p.slice(0);for(a=t,l=[],h=C.preFilter;a;){(!s||(n=ue.exec(a)))&&(n&&(a=a.slice(n[0].length)||a),l.push(r=[])),s=!1,(n=ce.exec(a))&&(s=n.shift(),r.push({value:s,type:n[0].replace(pe," ")}),a=a.slice(s.length));for(o in C.filter)!(n=ye[o].exec(a))||h[o]&&!(n=h[o](n))||(s=n.shift(),r.push({value:s,type:o,matches:n}),a=a.slice(s.length));if(!s)break}return e?a.length:a?i.error(t):I(t,l).slice(0)}function _(t){for(var e=0,i=t.length,s="";i>e;e++)s+=t[e].value;return s}function d(t,e,i){var s=e.dir,n=i&&"parentNode"===s,r=L++;return e.first?function(e,i,r){for(;e=e[s];)if(1===e.nodeType||n)return t(e,i,r)}:function(e,i,o){var a,l,h,p=U+" "+r;if(o){for(;e=e[s];)if((1===e.nodeType||n)&&t(e,i,o))return!0}else for(;e=e[s];)if(1===e.nodeType||n)if(h=e[B]||(e[B]={}),(l=h[s])&&l[0]===p){if((a=l[1])===!0||a===T)return a===!0}else if(l=h[s]=[p],l[1]=t(e,i,o)||T,l[1]===!0)return!0}}function f(t){return t.length>1?function(e,i,s){for(var n=t.length;n--;)if(!t[n](e,i,s))return!1;return!0}:t[0]}function g(t,e,i,s,n){for(var r,o=[],a=0,l=t.length,h=null!=e;l>a;a++)(r=t[a])&&(!i||i(r,s,n))&&(o.push(r),h&&e.push(a));return o}function y(t,e,i,s,r,o){return s&&!s[B]&&(s=y(s)),r&&!r[B]&&(r=y(r,o)),n(function(n,o,a,l){var h,p,u,c=[],_=[],d=o.length,f=n||w(e||"*",a.nodeType?[a]:a,[]),y=!t||!n&&e?f:g(f,c,t,a,l),m=i?r||(n?t:d||s)?[]:o:y;if(i&&i(y,m,a,l),s)for(h=g(m,_),s(h,[],a,l),p=h.length;p--;)(u=h[p])&&(m[_[p]]=!(y[_[p]]=u));if(n){if(r||t){if(r){for(h=[],p=m.length;p--;)(u=m[p])&&h.push(y[p]=u);r(null,m=[],h,l)}for(p=m.length;p--;)(u=m[p])&&(h=r?ie.call(n,u):c[p])>-1&&(n[h]=!(o[h]=u))}}else m=g(m===o?m.splice(d,m.length):m),r?r(null,o,m,l):te.apply(o,m)})}function m(t){for(var e,i,s,n=t.length,r=C.relative[t[0].type],o=r||C.relative[" "],a=r?1:0,l=d(function(t){return t===e},o,!0),h=d(function(t){return ie.call(e,t)>-1},o,!0),p=[function(t,i,s){return!r&&(s||i!==j)||((e=i).nodeType?l(t,i,s):h(t,i,s))}];n>a;a++)if(i=C.relative[t[a].type])p=[d(f(p),i)];else{if(i=C.filter[t[a].type].apply(null,t[a].matches),i[B]){for(s=++a;n>s&&!C.relative[t[s].type];s++);return y(a>1&&f(p),a>1&&_(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(pe,"$1"),i,s>a&&m(t.slice(a,s)),n>s&&m(t=t.slice(s)),n>s&&_(t))}p.push(i)}return f(p)}function v(t,e){var s=0,r=e.length>0,o=t.length>0,a=function(n,a,l,h,p){var u,c,_,d=[],f=0,y="0",m=n&&[],v=null!=p,w=j,x=n||o&&C.find.TAG("*",p&&a.parentNode||a),b=U+=null==w?1:Math.random()||.1;for(v&&(j=a!==S&&a,T=s);null!=(u=x[y]);y++){if(o&&u){for(c=0;_=t[c++];)if(_(u,a,l)){h.push(u);break}v&&(U=b,T=++s)}r&&((u=!_&&u)&&f--,n&&m.push(u))}if(f+=y,r&&y!==f){for(c=0;_=e[c++];)_(m,d,a,l);if(n){if(f>0)for(;y--;)m[y]||d[y]||(d[y]=Z.call(h));d=g(d)}te.apply(h,d),v&&!n&&d.length>0&&f+e.length>1&&i.uniqueSort(h)}return v&&(U=b,j=w),m};return r?n(a):a}function w(t,e,s){for(var n=0,r=e.length;r>n;n++)i(t,e[n],s);return s}function x(t,e,i,s){var n,r,o,a,l,h=c(t);if(!s&&1===h.length){if(r=h[0]=h[0].slice(0),r.length>2&&"ID"===(o=r[0]).type&&k.getById&&9===e.nodeType&&E&&C.relative[r[1].type]){if(e=(C.find.ID(o.matches[0].replace(ke,Te),e)||[])[0],!e)return i;t=t.slice(r.shift().value.length)}for(n=ye.needsContext.test(t)?0:r.length;n--&&(o=r[n],!C.relative[a=o.type]);)if((l=C.find[a])&&(s=l(o.matches[0].replace(ke,Te),_e.test(r[0].type)&&e.parentNode||e))){if(r.splice(n,1),t=s.length&&_(r),!t)return te.apply(i,s),i;break}}return P(t,h)(s,e,!E,i,_e.test(t)),i}var b,k,T,C,M,z,P,j,N,$,S,A,E,F,D,q,O,B="sizzle"+-new Date,R=t.document,U=0,L=0,H=s(),I=s(),V=s(),G=!1,W=function(t,e){return t===e?(G=!0,0):0},Y=typeof e,X=1<<31,J={}.hasOwnProperty,Q=[],Z=Q.pop,K=Q.push,te=Q.push,ee=Q.slice,ie=Q.indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(this[e]===t)return e;return-1},se="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ae=re.replace("w","w#"),le="\\["+ne+"*("+re+")"+ne+"*(?:([*^$|!~]?=)"+ne+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+ae+")|)|)"+ne+"*\\]",he=":("+re+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+le.replace(3,8)+")*)|.*)\\)|)",pe=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),_e=new RegExp(ne+"*[+~]"),de=new RegExp("="+ne+"*([^\\]'\"]*)"+ne+"*\\]","g"),fe=new RegExp(he),ge=new RegExp("^"+ae+"$"),ye={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+le),PSEUDO:new RegExp("^"+he),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+se+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,we=/^(?:input|select|textarea|button)$/i,xe=/^h\d$/i,be=/'|\\/g,ke=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Te=function(t,e,i){var s="0x"+e-65536;return s!==s||i?e:0>s?String.fromCharCode(s+65536):String.fromCharCode(55296|s>>10,56320|1023&s)};try{te.apply(Q=ee.call(R.childNodes),R.childNodes),Q[R.childNodes.length].nodeType}catch(Ce){te={apply:Q.length?function(t,e){K.apply(t,ee.call(e))}:function(t,e){for(var i=t.length,s=0;t[i++]=e[s++];);t.length=i-1}}}z=i.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},k=i.support={},$=i.setDocument=function(t){var e=t?t.ownerDocument||t:R,i=e.defaultView;return e!==S&&9===e.nodeType&&e.documentElement?(S=e,A=e.documentElement,E=!z(e),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){$()}),k.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),k.getElementsByTagName=r(function(t){return t.appendChild(e.createComment("")),!t.getElementsByTagName("*").length}),k.getElementsByClassName=r(function(t){return t.innerHTML="<div class='a'></div><div class='a i'></div>",t.firstChild.className="i",2===t.getElementsByClassName("i").length}),k.getById=r(function(t){return A.appendChild(t).id=B,!e.getElementsByName||!e.getElementsByName(B).length}),k.getById?(C.find.ID=function(t,e){if(typeof e.getElementById!==Y&&E){var i=e.getElementById(t);return i&&i.parentNode?[i]:[]}},C.filter.ID=function(t){var e=t.replace(ke,Te);return function(t){return t.getAttribute("id")===e}}):(delete C.find.ID,C.filter.ID=function(t){var e=t.replace(ke,Te);return function(t){var i=typeof t.getAttributeNode!==Y&&t.getAttributeNode("id");return i&&i.value===e}}),C.find.TAG=k.getElementsByTagName?function(t,e){return typeof e.getElementsByTagName!==Y?e.getElementsByTagName(t):void 0}:function(t,e){var i,s=[],n=0,r=e.getElementsByTagName(t);if("*"===t){for(;i=r[n++];)1===i.nodeType&&s.push(i);return s}return r},C.find.CLASS=k.getElementsByClassName&&function(t,e){return typeof e.getElementsByClassName!==Y&&E?e.getElementsByClassName(t):void 0},D=[],F=[],(k.qsa=me.test(e.querySelectorAll))&&(r(function(t){t.innerHTML="<select><option selected=''></option></select>",t.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+se+")"),t.querySelectorAll(":checked").length||F.push(":checked")}),r(function(t){var i=e.createElement("input");i.setAttribute("type","hidden"),t.appendChild(i).setAttribute("t",""),t.querySelectorAll("[t^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),t.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),F.push(",.*:")})),(k.matchesSelector=me.test(q=A.webkitMatchesSelector||A.mozMatchesSelector||A.oMatchesSelector||A.msMatchesSelector))&&r(function(t){k.disconnectedMatch=q.call(t,"div"),q.call(t,"[s!='']:x"),D.push("!=",he)}),F=F.length&&new RegExp(F.join("|")),D=D.length&&new RegExp(D.join("|")),O=me.test(A.contains)||A.compareDocumentPosition?function(t,e){var i=9===t.nodeType?t.documentElement:t,s=e&&e.parentNode;return t===s||!(!s||1!==s.nodeType||!(i.contains?i.contains(s):t.compareDocumentPosition&&16&t.compareDocumentPosition(s)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},W=A.compareDocumentPosition?function(t,i){if(t===i)return G=!0,0;var s=i.compareDocumentPosition&&t.compareDocumentPosition&&t.compareDocumentPosition(i);return s?1&s||!k.sortDetached&&i.compareDocumentPosition(t)===s?t===e||O(R,t)?-1:i===e||O(R,i)?1:N?ie.call(N,t)-ie.call(N,i):0:4&s?-1:1:t.compareDocumentPosition?-1:1}:function(t,i){var s,n=0,r=t.parentNode,o=i.parentNode,l=[t],h=[i];if(t===i)return G=!0,0;if(!r||!o)return t===e?-1:i===e?1:r?-1:o?1:N?ie.call(N,t)-ie.call(N,i):0;if(r===o)return a(t,i);for(s=t;s=s.parentNode;)l.unshift(s);for(s=i;s=s.parentNode;)h.unshift(s);for(;l[n]===h[n];)n++;return n?a(l[n],h[n]):l[n]===R?-1:h[n]===R?1:0},e):S},i.matches=function(t,e){return i(t,null,null,e)},i.matchesSelector=function(t,e){if((t.ownerDocument||t)!==S&&$(t),e=e.replace(de,"='$1']"),!(!k.matchesSelector||!E||D&&D.test(e)||F&&F.test(e)))try{var s=q.call(t,e);if(s||k.disconnectedMatch||t.document&&11!==t.document.nodeType)return s}catch(n){}return i(e,S,null,[t]).length>0},i.contains=function(t,e){return(t.ownerDocument||t)!==S&&$(t),O(t,e)},i.attr=function(t,i){(t.ownerDocument||t)!==S&&$(t);var s=C.attrHandle[i.toLowerCase()],n=s&&J.call(C.attrHandle,i.toLowerCase())?s(t,i,!E):e;return n===e?k.attributes||!E?t.getAttribute(i):(n=t.getAttributeNode(i))&&n.specified?n.value:null:n},i.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},i.uniqueSort=function(t){var e,i=[],s=0,n=0;if(G=!k.detectDuplicates,N=!k.sortStable&&t.slice(0),t.sort(W),G){for(;e=t[n++];)e===t[n]&&(s=i.push(n));for(;s--;)t.splice(i[s],1)}return t},M=i.getText=function(t){var e,i="",s=0,n=t.nodeType;if(n){if(1===n||9===n||11===n){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=M(t)}else if(3===n||4===n)return t.nodeValue}else for(;e=t[s];s++)i+=M(e);return i},C=i.selectors={cacheLength:50,createPseudo:n,match:ye,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(ke,Te),t[3]=(t[4]||t[5]||"").replace(ke,Te),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||i.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&i.error(t[0]),t},PSEUDO:function(t){var i,s=!t[5]&&t[2];return ye.CHILD.test(t[0])?null:(t[3]&&t[4]!==e?t[2]=t[4]:s&&fe.test(s)&&(i=c(s,!0))&&(i=s.indexOf(")",s.length-i)-s.length)&&(t[0]=t[0].slice(0,i),t[2]=s.slice(0,i)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(ke,Te).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=H[t+" "];return e||(e=new RegExp("(^|"+ne+")"+t+"("+ne+"|$)"))&&H(t,function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Y&&t.getAttribute("class")||"")})},ATTR:function(t,e,s){return function(n){var r=i.attr(n,t);return null==r?"!="===e:e?(r+="","="===e?r===s:"!="===e?r!==s:"^="===e?s&&0===r.indexOf(s):"*="===e?s&&r.indexOf(s)>-1:"$="===e?s&&r.slice(-s.length)===s:"~="===e?(" "+r+" ").indexOf(s)>-1:"|="===e?r===s||r.slice(0,s.length+1)===s+"-":!1):!0}},CHILD:function(t,e,i,s,n){var r="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===s&&0===n?function(t){return!!t.parentNode}:function(e,i,l){var h,p,u,c,_,d,f=r!==o?"nextSibling":"previousSibling",g=e.parentNode,y=a&&e.nodeName.toLowerCase(),m=!l&&!a;if(g){if(r){for(;f;){for(u=e;u=u[f];)if(a?u.nodeName.toLowerCase()===y:1===u.nodeType)return!1;d=f="only"===t&&!d&&"nextSibling"}return!0}if(d=[o?g.firstChild:g.lastChild],o&&m){for(p=g[B]||(g[B]={}),h=p[t]||[],_=h[0]===U&&h[1],c=h[0]===U&&h[2],u=_&&g.childNodes[_];u=++_&&u&&u[f]||(c=_=0)||d.pop();)if(1===u.nodeType&&++c&&u===e){p[t]=[U,_,c];break}}else if(m&&(h=(e[B]||(e[B]={}))[t])&&h[0]===U)c=h[1];else for(;(u=++_&&u&&u[f]||(c=_=0)||d.pop())&&((a?u.nodeName.toLowerCase()!==y:1!==u.nodeType)||!++c||(m&&((u[B]||(u[B]={}))[t]=[U,c]),u!==e)););return c-=n,c===s||0===c%s&&c/s>=0}}},PSEUDO:function(t,e){var s,r=C.pseudos[t]||C.setFilters[t.toLowerCase()]||i.error("unsupported pseudo: "+t);return r[B]?r(e):r.length>1?(s=[t,t,"",e],C.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,i){for(var s,n=r(t,e),o=n.length;o--;)s=ie.call(t,n[o]),t[s]=!(i[s]=n[o])}):function(t){return r(t,0,s)}):r}},pseudos:{not:n(function(t){var e=[],i=[],s=P(t.replace(pe,"$1"));return s[B]?n(function(t,e,i,n){for(var r,o=s(t,null,n,[]),a=t.length;a--;)(r=o[a])&&(t[a]=!(e[a]=r))}):function(t,n,r){return e[0]=t,s(e,null,r,i),!i.pop()}}),has:n(function(t){return function(e){return i(t,e).length>0}}),contains:n(function(t){return function(e){return(e.textContent||e.innerText||M(e)).indexOf(t)>-1}}),lang:n(function(t){return ge.test(t||"")||i.error("unsupported lang: "+t),t=t.replace(ke,Te).toLowerCase(),function(e){var i;do if(i=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return i=i.toLowerCase(),i===t||0===i.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===A},focus:function(t){return t===S.activeElement&&(!S.hasFocus||S.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeName>"@"||3===t.nodeType||4===t.nodeType)return!1;return!0},parent:function(t){return!C.pseudos.empty(t)},header:function(t){return xe.test(t.nodeName)},input:function(t){return we.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||e.toLowerCase()===t.type)},first:p(function(){return[0]}),last:p(function(t,e){return[e-1]}),eq:p(function(t,e,i){return[0>i?i+e:i]}),even:p(function(t,e){for(var i=0;e>i;i+=2)t.push(i);return t}),odd:p(function(t,e){for(var i=1;e>i;i+=2)t.push(i);return t}),lt:p(function(t,e,i){for(var s=0>i?i+e:i;--s>=0;)t.push(s);return t}),gt:p(function(t,e,i){for(var s=0>i?i+e:i;++s<e;)t.push(s);return t})}},C.pseudos.nth=C.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[b]=l(b);for(b in{submit:!0,reset:!0})C.pseudos[b]=h(b);u.prototype=C.filters=C.pseudos,C.setFilters=new u,P=i.compile=function(t,e){var i,s=[],n=[],r=V[t+" "];if(!r){for(e||(e=c(t)),i=e.length;i--;)r=m(e[i]),r[B]?s.push(r):n.push(r);r=V(t,v(n,s))}return r},k.sortStable=B.split("").sort(W).join("")===B,k.detectDuplicates=G,$(),k.sortDetached=r(function(t){return 1&t.compareDocumentPosition(S.createElement("div"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,i){return i?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),k.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,i){return i||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(se,function(t,e,i){var s;return i?void 0:(s=t.getAttributeNode(e))&&s.specified?s.value:t[e]===!0?e.toLowerCase():null}),oe.find=i,oe.expr=i.selectors,oe.expr[":"]=oe.expr.pseudos,oe.unique=i.uniqueSort,oe.text=i.getText,oe.isXMLDoc=i.isXML,oe.contains=i.contains}(t);var fe={};oe.Callbacks=function(t){t="string"==typeof t?fe[t]||n(t):oe.extend({},t);var i,s,r,o,a,l,h=[],p=!t.once&&[],u=function(e){for(i=t.memory&&e,s=!0,l=o||0,o=0,a=h.length,r=!0;h&&a>l;l++)if(h[l].apply(e[0],e[1])===!1&&t.stopOnFalse){i=!1;break}r=!1,h&&(p?p.length&&u(p.shift()):i?h=[]:c.disable())},c={add:function(){if(h){var e=h.length;!function s(e){oe.each(e,function(e,i){var n=oe.type(i);"function"===n?t.unique&&c.has(i)||h.push(i):i&&i.length&&"string"!==n&&s(i)})}(arguments),r?a=h.length:i&&(o=e,u(i))}return this},remove:function(){return h&&oe.each(arguments,function(t,e){for(var i;(i=oe.inArray(e,h,i))>-1;)h.splice(i,1),r&&(a>=i&&a--,l>=i&&l--)}),this},has:function(t){return t?oe.inArray(t,h)>-1:!(!h||!h.length)},empty:function(){return h=[],a=0,this},disable:function(){return h=p=i=e,this},disabled:function(){return!h},lock:function(){return p=e,i||c.disable(),this},locked:function(){return!p},fireWith:function(t,e){return!h||s&&!p||(e=e||[],e=[t,e.slice?e.slice():e],r?p.push(e):u(e)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!s}};return c},oe.extend({Deferred:function(t){var e=[["resolve","done",oe.Callbacks("once memory"),"resolved"],["reject","fail",oe.Callbacks("once memory"),"rejected"],["notify","progress",oe.Callbacks("memory")]],i="pending",s={state:function(){return i},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var t=arguments;return oe.Deferred(function(i){oe.each(e,function(e,r){var o=r[0],a=oe.isFunction(t[e])&&t[e];n[r[1]](function(){var t=a&&a.apply(this,arguments);t&&oe.isFunction(t.promise)?t.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[o+"With"](this===s?i.promise():this,a?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?oe.extend(t,s):s}},n={};return s.pipe=s.then,oe.each(e,function(t,r){var o=r[2],a=r[3];s[r[1]]=o.add,a&&o.add(function(){i=a},e[1^t][2].disable,e[2][2].lock),n[r[0]]=function(){return n[r[0]+"With"](this===n?s:this,arguments),this},n[r[0]+"With"]=o.fireWith}),s.promise(n),t&&t.call(n,n),n},when:function(t){var e,i,s,n=0,r=ee.call(arguments),o=r.length,a=1!==o||t&&oe.isFunction(t.promise)?o:0,l=1===a?t:oe.Deferred(),h=function(t,i,s){return function(n){i[t]=this,s[t]=arguments.length>1?ee.call(arguments):n,s===e?l.notifyWith(i,s):--a||l.resolveWith(i,s)}};if(o>1)for(e=new Array(o),i=new Array(o),s=new Array(o);o>n;n++)r[n]&&oe.isFunction(r[n].promise)?r[n].promise().done(h(n,s,r)).fail(l.reject).progress(h(n,i,e)):--a;return a||l.resolveWith(s,r),l.promise()}}),oe.support=function(e){var i=G.createElement("input"),s=G.createDocumentFragment(),n=G.createElement("div"),r=G.createElement("select"),o=r.appendChild(G.createElement("option"));return i.type?(i.type="checkbox",e.checkOn=""!==i.value,e.optSelected=o.selected,e.reliableMarginRight=!0,e.boxSizingReliable=!0,e.pixelPosition=!1,i.checked=!0,e.noCloneChecked=i.cloneNode(!0).checked,r.disabled=!0,e.optDisabled=!o.disabled,i=G.createElement("input"),i.value="t",i.type="radio",e.radioValue="t"===i.value,i.setAttribute("checked","t"),i.setAttribute("name","t"),s.appendChild(i),e.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,e.focusinBubbles="onfocusin"in t,n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",e.clearCloneStyle="content-box"===n.style.backgroundClip,oe(function(){var i,s,r="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",o=G.getElementsByTagName("body")[0];o&&(i=G.createElement("div"),i.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",o.appendChild(i).appendChild(n),n.innerHTML="",n.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",oe.swap(o,null!=o.style.zoom?{zoom:1}:{},function(){e.boxSizing=4===n.offsetWidth}),t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(n,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(n,null)||{width:"4px"}).width,s=n.appendChild(G.createElement("div")),s.style.cssText=n.style.cssText=r,s.style.marginRight=s.style.width="0",n.style.width="1px",e.reliableMarginRight=!parseFloat((t.getComputedStyle(s,null)||{}).marginRight)),o.removeChild(i))}),e):e}({});var ge,ye,me=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,ve=/([A-Z])/g;r.uid=1,r.accepts=function(t){return t.nodeType?1===t.nodeType||9===t.nodeType:!0},r.prototype={key:function(t){if(!r.accepts(t))return 0;var e={},i=t[this.expando];if(!i){i=r.uid++;try{e[this.expando]={value:i},Object.defineProperties(t,e)}catch(s){e[this.expando]=i,oe.extend(t,e)}}return this.cache[i]||(this.cache[i]={}),i},set:function(t,e,i){var s,n=this.key(t),r=this.cache[n];if("string"==typeof e)r[e]=i;else if(oe.isEmptyObject(r))oe.extend(this.cache[n],e);else for(s in e)r[s]=e[s];return r},get:function(t,i){var s=this.cache[this.key(t)];return i===e?s:s[i]},access:function(t,i,s){var n;return i===e||i&&"string"==typeof i&&s===e?(n=this.get(t,i),n!==e?n:this.get(t,oe.camelCase(i))):(this.set(t,i,s),s!==e?s:i)},remove:function(t,i){var s,n,r,o=this.key(t),a=this.cache[o];if(i===e)this.cache[o]={};else{oe.isArray(i)?n=i.concat(i.map(oe.camelCase)):(r=oe.camelCase(i),i in a?n=[i,r]:(n=r,n=n in a?[n]:n.match(le)||[])),s=n.length;for(;s--;)delete a[n[s]]}},hasData:function(t){return!oe.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}},ge=new r,ye=new r,oe.extend({acceptData:r.accepts,hasData:function(t){return ge.hasData(t)||ye.hasData(t)},data:function(t,e,i){return ge.access(t,e,i)},removeData:function(t,e){ge.remove(t,e)},_data:function(t,e,i){return ye.access(t,e,i)},_removeData:function(t,e){ye.remove(t,e)}}),oe.fn.extend({data:function(t,i){var s,n,r=this[0],a=0,l=null;if(t===e){if(this.length&&(l=ge.get(r),1===r.nodeType&&!ye.get(r,"hasDataAttrs"))){for(s=r.attributes;a<s.length;a++)n=s[a].name,0===n.indexOf("data-")&&(n=oe.camelCase(n.slice(5)),o(r,n,l[n]));ye.set(r,"hasDataAttrs",!0)}return l}return"object"==typeof t?this.each(function(){ge.set(this,t)}):oe.access(this,function(i){var s,n=oe.camelCase(t);if(r&&i===e){if(s=ge.get(r,t),s!==e)return s;if(s=ge.get(r,n),s!==e)return s;if(s=o(r,n,e),s!==e)return s}else this.each(function(){var s=ge.get(this,n);ge.set(this,n,i),-1!==t.indexOf("-")&&s!==e&&ge.set(this,t,i)})},null,i,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){ge.remove(this,t)})}}),oe.extend({queue:function(t,e,i){var s;return t?(e=(e||"fx")+"queue",s=ye.get(t,e),i&&(!s||oe.isArray(i)?s=ye.access(t,e,oe.makeArray(i)):s.push(i)),s||[]):void 0},dequeue:function(t,e){e=e||"fx";var i=oe.queue(t,e),s=i.length,n=i.shift(),r=oe._queueHooks(t,e),o=function(){oe.dequeue(t,e)};"inprogress"===n&&(n=i.shift(),s--),n&&("fx"===e&&i.unshift("inprogress"),delete r.stop,n.call(t,o,r)),!s&&r&&r.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return ye.get(t,i)||ye.access(t,i,{empty:oe.Callbacks("once memory").add(function(){ye.remove(t,[e+"queue",i])})})}}),oe.fn.extend({queue:function(t,i){var s=2;return"string"!=typeof t&&(i=t,t="fx",s--),arguments.length<s?oe.queue(this[0],t):i===e?this:this.each(function(){var e=oe.queue(this,t,i);oe._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&oe.dequeue(this,t)})},dequeue:function(t){return this.each(function(){oe.dequeue(this,t)})},delay:function(t,e){return t=oe.fx?oe.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,i){var s=setTimeout(e,t);i.stop=function(){clearTimeout(s)}})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,i){var s,n=1,r=oe.Deferred(),o=this,a=this.length,l=function(){--n||r.resolveWith(o,[o])};for("string"!=typeof t&&(i=t,t=e),t=t||"fx";a--;)s=ye.get(o[a],t+"queueHooks"),s&&s.empty&&(n++,s.empty.add(l));return l(),r.promise(i)}});var we,xe,be=/[\t\r\n\f]/g,ke=/\r/g,Te=/^(?:input|select|textarea|button)$/i;oe.fn.extend({attr:function(t,e){return oe.access(this,oe.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){oe.removeAttr(this,t)})},prop:function(t,e){return oe.access(this,oe.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[oe.propFix[t]||t]})},addClass:function(t){var e,i,s,n,r,o=0,a=this.length,l="string"==typeof t&&t;if(oe.isFunction(t))return this.each(function(e){oe(this).addClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(le)||[];a>o;o++)if(i=this[o],s=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(be," "):" ")){for(r=0;n=e[r++];)s.indexOf(" "+n+" ")<0&&(s+=n+" ");i.className=oe.trim(s)}return this},removeClass:function(t){var e,i,s,n,r,o=0,a=this.length,l=0===arguments.length||"string"==typeof t&&t;if(oe.isFunction(t))return this.each(function(e){oe(this).removeClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(le)||[];a>o;o++)if(i=this[o],s=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(be," "):"")){for(r=0;n=e[r++];)for(;s.indexOf(" "+n+" ")>=0;)s=s.replace(" "+n+" "," ");i.className=t?oe.trim(s):""}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):oe.isFunction(t)?this.each(function(i){oe(this).toggleClass(t.call(this,i,this.className,e),e)}):this.each(function(){if("string"===i)for(var e,s=0,n=oe(this),r=t.match(le)||[];e=r[s++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else(i===I||"boolean"===i)&&(this.className&&ye.set(this,"__className__",this.className),this.className=this.className||t===!1?"":ye.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",i=0,s=this.length;s>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(be," ").indexOf(e)>=0)return!0;return!1},val:function(t){var i,s,n,r=this[0];{if(arguments.length)return n=oe.isFunction(t),this.each(function(s){var r;1===this.nodeType&&(r=n?t.call(this,s,oe(this).val()):t,null==r?r="":"number"==typeof r?r+="":oe.isArray(r)&&(r=oe.map(r,function(t){return null==t?"":t+""})),i=oe.valHooks[this.type]||oe.valHooks[this.nodeName.toLowerCase()],i&&"set"in i&&i.set(this,r,"value")!==e||(this.value=r))});if(r)return i=oe.valHooks[r.type]||oe.valHooks[r.nodeName.toLowerCase()],i&&"get"in i&&(s=i.get(r,"value"))!==e?s:(s=r.value,"string"==typeof s?s.replace(ke,""):null==s?"":s)}}}),oe.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){for(var e,i,s=t.options,n=t.selectedIndex,r="select-one"===t.type||0>n,o=r?null:[],a=r?n+1:s.length,l=0>n?a:r?n:0;a>l;l++)if(i=s[l],!(!i.selected&&l!==n||(oe.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&oe.nodeName(i.parentNode,"optgroup"))){if(e=oe(i).val(),r)return e;o.push(e)}return o},set:function(t,e){for(var i,s,n=t.options,r=oe.makeArray(e),o=n.length;o--;)s=n[o],(s.selected=oe.inArray(oe(s).val(),r)>=0)&&(i=!0);return i||(t.selectedIndex=-1),r}}},attr:function(t,i,s){var n,r,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return typeof t.getAttribute===I?oe.prop(t,i,s):(1===o&&oe.isXMLDoc(t)||(i=i.toLowerCase(),n=oe.attrHooks[i]||(oe.expr.match.bool.test(i)?xe:we)),s===e?n&&"get"in n&&null!==(r=n.get(t,i))?r:(r=oe.find.attr(t,i),null==r?e:r):null!==s?n&&"set"in n&&(r=n.set(t,s,i))!==e?r:(t.setAttribute(i,s+""),s):(oe.removeAttr(t,i),void 0))},removeAttr:function(t,e){var i,s,n=0,r=e&&e.match(le);if(r&&1===t.nodeType)for(;i=r[n++];)s=oe.propFix[i]||i,oe.expr.match.bool.test(i)&&(t[s]=!1),t.removeAttribute(i)},attrHooks:{type:{set:function(t,e){if(!oe.support.radioValue&&"radio"===e&&oe.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(t,i,s){var n,r,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return o=1!==a||!oe.isXMLDoc(t),o&&(i=oe.propFix[i]||i,r=oe.propHooks[i]),s!==e?r&&"set"in r&&(n=r.set(t,s,i))!==e?n:t[i]=s:r&&"get"in r&&null!==(n=r.get(t,i))?n:t[i]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||Te.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),xe={set:function(t,e,i){return e===!1?oe.removeAttr(t,i):t.setAttribute(i,i),i}},oe.each(oe.expr.match.bool.source.match(/\w+/g),function(t,i){var s=oe.expr.attrHandle[i]||oe.find.attr;oe.expr.attrHandle[i]=function(t,i,n){var r=oe.expr.attrHandle[i],o=n?e:(oe.expr.attrHandle[i]=e)!=s(t,i,n)?i.toLowerCase():null;return oe.expr.attrHandle[i]=r,o}}),oe.support.optSelected||(oe.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),oe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){oe.propFix[this.toLowerCase()]=this}),oe.each(["radio","checkbox"],function(){oe.valHooks[this]={set:function(t,e){return oe.isArray(e)?t.checked=oe.inArray(oe(t).val(),e)>=0:void 0}},oe.support.checkOn||(oe.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Ce=/^key/,Me=/^(?:mouse|contextmenu)|click/,ze=/^(?:focusinfocus|focusoutblur)$/,Pe=/^([^.]*)(?:\.(.+)|)$/;oe.event={global:{},add:function(t,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g,y=ye.get(t);if(y){for(s.handler&&(o=s,s=o.handler,r=o.selector),s.guid||(s.guid=oe.guid++),(h=y.events)||(h=y.events={}),(a=y.handle)||(a=y.handle=function(t){return typeof oe===I||t&&oe.event.triggered===t.type?e:oe.event.dispatch.apply(a.elem,arguments)
},a.elem=t),i=(i||"").match(le)||[""],p=i.length;p--;)l=Pe.exec(i[p])||[],d=g=l[1],f=(l[2]||"").split(".").sort(),d&&(c=oe.event.special[d]||{},d=(r?c.delegateType:c.bindType)||d,c=oe.event.special[d]||{},u=oe.extend({type:d,origType:g,data:n,handler:s,guid:s.guid,selector:r,needsContext:r&&oe.expr.match.needsContext.test(r),namespace:f.join(".")},o),(_=h[d])||(_=h[d]=[],_.delegateCount=0,c.setup&&c.setup.call(t,n,f,a)!==!1||t.addEventListener&&t.addEventListener(d,a,!1)),c.add&&(c.add.call(t,u),u.handler.guid||(u.handler.guid=s.guid)),r?_.splice(_.delegateCount++,0,u):_.push(u),oe.event.global[d]=!0);t=null}},remove:function(t,e,i,s,n){var r,o,a,l,h,p,u,c,_,d,f,g=ye.hasData(t)&&ye.get(t);if(g&&(l=g.events)){for(e=(e||"").match(le)||[""],h=e.length;h--;)if(a=Pe.exec(e[h])||[],_=f=a[1],d=(a[2]||"").split(".").sort(),_){for(u=oe.event.special[_]||{},_=(s?u.delegateType:u.bindType)||_,c=l[_]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=r=c.length;r--;)p=c[r],!n&&f!==p.origType||i&&i.guid!==p.guid||a&&!a.test(p.namespace)||s&&s!==p.selector&&("**"!==s||!p.selector)||(c.splice(r,1),p.selector&&c.delegateCount--,u.remove&&u.remove.call(t,p));o&&!c.length&&(u.teardown&&u.teardown.call(t,d,g.handle)!==!1||oe.removeEvent(t,_,g.handle),delete l[_])}else for(_ in l)oe.event.remove(t,_+e[h],i,s,!0);oe.isEmptyObject(l)&&(delete g.handle,ye.remove(t,"events"))}},trigger:function(i,s,n,r){var o,a,l,h,p,u,c,_=[n||G],d=ne.call(i,"type")?i.type:i,f=ne.call(i,"namespace")?i.namespace.split("."):[];if(a=l=n=n||G,3!==n.nodeType&&8!==n.nodeType&&!ze.test(d+oe.event.triggered)&&(d.indexOf(".")>=0&&(f=d.split("."),d=f.shift(),f.sort()),p=d.indexOf(":")<0&&"on"+d,i=i[oe.expando]?i:new oe.Event(d,"object"==typeof i&&i),i.isTrigger=r?2:3,i.namespace=f.join("."),i.namespace_re=i.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,i.result=e,i.target||(i.target=n),s=null==s?[i]:oe.makeArray(s,[i]),c=oe.event.special[d]||{},r||!c.trigger||c.trigger.apply(n,s)!==!1)){if(!r&&!c.noBubble&&!oe.isWindow(n)){for(h=c.delegateType||d,ze.test(h+d)||(a=a.parentNode);a;a=a.parentNode)_.push(a),l=a;l===(n.ownerDocument||G)&&_.push(l.defaultView||l.parentWindow||t)}for(o=0;(a=_[o++])&&!i.isPropagationStopped();)i.type=o>1?h:c.bindType||d,u=(ye.get(a,"events")||{})[i.type]&&ye.get(a,"handle"),u&&u.apply(a,s),u=p&&a[p],u&&oe.acceptData(a)&&u.apply&&u.apply(a,s)===!1&&i.preventDefault();return i.type=d,r||i.isDefaultPrevented()||c._default&&c._default.apply(_.pop(),s)!==!1||!oe.acceptData(n)||p&&oe.isFunction(n[d])&&!oe.isWindow(n)&&(l=n[p],l&&(n[p]=null),oe.event.triggered=d,n[d](),oe.event.triggered=e,l&&(n[p]=l)),i.result}},dispatch:function(t){t=oe.event.fix(t);var i,s,n,r,o,a=[],l=ee.call(arguments),h=(ye.get(this,"events")||{})[t.type]||[],p=oe.event.special[t.type]||{};if(l[0]=t,t.delegateTarget=this,!p.preDispatch||p.preDispatch.call(this,t)!==!1){for(a=oe.event.handlers.call(this,t,h),i=0;(r=a[i++])&&!t.isPropagationStopped();)for(t.currentTarget=r.elem,s=0;(o=r.handlers[s++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(o.namespace))&&(t.handleObj=o,t.data=o.data,n=((oe.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,l),n!==e&&(t.result=n)===!1&&(t.preventDefault(),t.stopPropagation()));return p.postDispatch&&p.postDispatch.call(this,t),t.result}},handlers:function(t,i){var s,n,r,o,a=[],l=i.delegateCount,h=t.target;if(l&&h.nodeType&&(!t.button||"click"!==t.type))for(;h!==this;h=h.parentNode||this)if(h.disabled!==!0||"click"!==t.type){for(n=[],s=0;l>s;s++)o=i[s],r=o.selector+" ",n[r]===e&&(n[r]=o.needsContext?oe(r,this).index(h)>=0:oe.find(r,this,null,[h]).length),n[r]&&n.push(o);n.length&&a.push({elem:h,handlers:n})}return l<i.length&&a.push({elem:this,handlers:i.slice(l)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,i){var s,n,r,o=i.button;return null==t.pageX&&null!=i.clientX&&(s=t.target.ownerDocument||G,n=s.documentElement,r=s.body,t.pageX=i.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),t.pageY=i.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)),t.which||o===e||(t.which=1&o?1:2&o?3:4&o?2:0),t}},fix:function(t){if(t[oe.expando])return t;var e,i,s,n=t.type,r=t,o=this.fixHooks[n];for(o||(this.fixHooks[n]=o=Me.test(n)?this.mouseHooks:Ce.test(n)?this.keyHooks:{}),s=o.props?this.props.concat(o.props):this.props,t=new oe.Event(r),e=s.length;e--;)i=s[e],t[i]=r[i];return t.target||(t.target=G),3===t.target.nodeType&&(t.target=t.target.parentNode),o.filter?o.filter(t,r):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==h()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===h()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&oe.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(t){return oe.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){t.result!==e&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,i,s){var n=oe.extend(new oe.Event,i,{type:t,isSimulated:!0,originalEvent:{}});s?oe.event.trigger(n,null,e):oe.event.dispatch.call(e,n),n.isDefaultPrevented()&&i.preventDefault()}},oe.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i,!1)},oe.Event=function(t,e){return this instanceof oe.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||t.getPreventDefault&&t.getPreventDefault()?a:l):this.type=t,e&&oe.extend(this,e),this.timeStamp=t&&t.timeStamp||oe.now(),this[oe.expando]=!0,void 0):new oe.Event(t,e)},oe.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=a,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=a,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()}},oe.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(t,e){oe.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,s=this,n=t.relatedTarget,r=t.handleObj;return(!n||n!==s&&!oe.contains(s,n))&&(t.type=r.origType,i=r.handler.apply(this,arguments),t.type=e),i}}}),oe.support.focusinBubbles||oe.each({focus:"focusin",blur:"focusout"},function(t,e){var i=0,s=function(t){oe.event.simulate(e,t.target,oe.event.fix(t),!0)};oe.event.special[e]={setup:function(){0===i++&&G.addEventListener(t,s,!0)},teardown:function(){0===--i&&G.removeEventListener(t,s,!0)}}}),oe.fn.extend({on:function(t,i,s,n,r){var o,a;if("object"==typeof t){"string"!=typeof i&&(s=s||i,i=e);for(a in t)this.on(a,i,s,t[a],r);return this}if(null==s&&null==n?(n=i,s=i=e):null==n&&("string"==typeof i?(n=s,s=e):(n=s,s=i,i=e)),n===!1)n=l;else if(!n)return this;return 1===r&&(o=n,n=function(t){return oe().off(t),o.apply(this,arguments)},n.guid=o.guid||(o.guid=oe.guid++)),this.each(function(){oe.event.add(this,t,n,s,i)})},one:function(t,e,i,s){return this.on(t,e,i,s,1)},off:function(t,i,s){var n,r;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,oe(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(r in t)this.off(r,i,t[r]);return this}return(i===!1||"function"==typeof i)&&(s=i,i=e),s===!1&&(s=l),this.each(function(){oe.event.remove(this,t,s,i)})},trigger:function(t,e){return this.each(function(){oe.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];return i?oe.event.trigger(t,e,i,!0):void 0}});var je=/^.[^:#\[\.,]*$/,Ne=/^(?:parents|prev(?:Until|All))/,$e=oe.expr.match.needsContext,Se={children:!0,contents:!0,next:!0,prev:!0};oe.fn.extend({find:function(t){var e,i=[],s=this,n=s.length;if("string"!=typeof t)return this.pushStack(oe(t).filter(function(){for(e=0;n>e;e++)if(oe.contains(s[e],this))return!0}));for(e=0;n>e;e++)oe.find(t,s[e],i);return i=this.pushStack(n>1?oe.unique(i):i),i.selector=this.selector?this.selector+" "+t:t,i},has:function(t){var e=oe(t,this),i=e.length;return this.filter(function(){for(var t=0;i>t;t++)if(oe.contains(this,e[t]))return!0})},not:function(t){return this.pushStack(u(this,t||[],!0))},filter:function(t){return this.pushStack(u(this,t||[],!1))},is:function(t){return!!u(this,"string"==typeof t&&$e.test(t)?oe(t):t||[],!1).length},closest:function(t,e){for(var i,s=0,n=this.length,r=[],o=$e.test(t)||"string"!=typeof t?oe(t,e||this.context):0;n>s;s++)for(i=this[s];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&oe.find.matchesSelector(i,t))){i=r.push(i);break}return this.pushStack(r.length>1?oe.unique(r):r)},index:function(t){return t?"string"==typeof t?ie.call(oe(t),this[0]):ie.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){var i="string"==typeof t?oe(t,e):oe.makeArray(t&&t.nodeType?[t]:t),s=oe.merge(this.get(),i);return this.pushStack(oe.unique(s))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),oe.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return oe.dir(t,"parentNode")},parentsUntil:function(t,e,i){return oe.dir(t,"parentNode",i)},next:function(t){return p(t,"nextSibling")},prev:function(t){return p(t,"previousSibling")},nextAll:function(t){return oe.dir(t,"nextSibling")},prevAll:function(t){return oe.dir(t,"previousSibling")},nextUntil:function(t,e,i){return oe.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return oe.dir(t,"previousSibling",i)},siblings:function(t){return oe.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return oe.sibling(t.firstChild)},contents:function(t){return t.contentDocument||oe.merge([],t.childNodes)}},function(t,e){oe.fn[t]=function(i,s){var n=oe.map(this,e,i);return"Until"!==t.slice(-5)&&(s=i),s&&"string"==typeof s&&(n=oe.filter(s,n)),this.length>1&&(Se[t]||oe.unique(n),Ne.test(t)&&n.reverse()),this.pushStack(n)}}),oe.extend({filter:function(t,e,i){var s=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===s.nodeType?oe.find.matchesSelector(s,t)?[s]:[]:oe.find.matches(t,oe.grep(e,function(t){return 1===t.nodeType}))},dir:function(t,i,s){for(var n=[],r=s!==e;(t=t[i])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&oe(t).is(s))break;n.push(t)}return n},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}});var Ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ee=/<([\w:]+)/,Fe=/<|&#?\w+;/,De=/<(?:script|style|link)/i,qe=/^(?:checkbox|radio)$/i,Oe=/checked\s*(?:[^=]|=\s*.checked.)/i,Be=/^$|\/(?:java|ecma)script/i,Re=/^true\/(.*)/,Ue=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Le={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Le.optgroup=Le.option,Le.tbody=Le.tfoot=Le.colgroup=Le.caption=Le.thead,Le.th=Le.td,oe.fn.extend({text:function(t){return oe.access(this,function(t){return t===e?oe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||G).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=c(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=c(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var i,s=t?oe.filter(t,this):this,n=0;null!=(i=s[n]);n++)e||1!==i.nodeType||oe.cleanData(y(i)),i.parentNode&&(e&&oe.contains(i.ownerDocument,i)&&f(y(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(oe.cleanData(y(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return oe.clone(this,t,e)})},html:function(t){return oe.access(this,function(t){var i=this[0]||{},s=0,n=this.length;if(t===e&&1===i.nodeType)return i.innerHTML;if("string"==typeof t&&!De.test(t)&&!Le[(Ee.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Ae,"<$1></$2>");try{for(;n>s;s++)i=this[s]||{},1===i.nodeType&&(oe.cleanData(y(i,!1)),i.innerHTML=t);i=0}catch(r){}}i&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=oe.map(this,function(t){return[t.nextSibling,t.parentNode]}),e=0;return this.domManip(arguments,function(i){var s=t[e++],n=t[e++];n&&(s&&s.parentNode!==n&&(s=this.nextSibling),oe(this).remove(),n.insertBefore(i,s))},!0),e?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e,i){t=K.apply([],t);var s,n,r,o,a,l,h=0,p=this.length,u=this,c=p-1,f=t[0],g=oe.isFunction(f);if(g||!(1>=p||"string"!=typeof f||oe.support.checkClone)&&Oe.test(f))return this.each(function(s){var n=u.eq(s);g&&(t[0]=f.call(this,s,n.html())),n.domManip(t,e,i)});if(p&&(s=oe.buildFragment(t,this[0].ownerDocument,!1,!i&&this),n=s.firstChild,1===s.childNodes.length&&(s=n),n)){for(r=oe.map(y(s,"script"),_),o=r.length;p>h;h++)a=s,h!==c&&(a=oe.clone(a,!0,!0),o&&oe.merge(r,y(a,"script"))),e.call(this[h],a,h);if(o)for(l=r[r.length-1].ownerDocument,oe.map(r,d),h=0;o>h;h++)a=r[h],Be.test(a.type||"")&&!ye.access(a,"globalEval")&&oe.contains(l,a)&&(a.src?oe._evalUrl(a.src):oe.globalEval(a.textContent.replace(Ue,"")))}return this}}),oe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){oe.fn[t]=function(t){for(var i,s=[],n=oe(t),r=n.length-1,o=0;r>=o;o++)i=o===r?this:this.clone(!0),oe(n[o])[e](i),te.apply(s,i.get());return this.pushStack(s)}}),oe.extend({clone:function(t,e,i){var s,n,r,o,a=t.cloneNode(!0),l=oe.contains(t.ownerDocument,t);if(!(oe.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||oe.isXMLDoc(t)))for(o=y(a),r=y(t),s=0,n=r.length;n>s;s++)m(r[s],o[s]);if(e)if(i)for(r=r||y(t),o=o||y(a),s=0,n=r.length;n>s;s++)g(r[s],o[s]);else g(t,a);return o=y(a,"script"),o.length>0&&f(o,!l&&y(t,"script")),a},buildFragment:function(t,e,i,s){for(var n,r,o,a,l,h,p=0,u=t.length,c=e.createDocumentFragment(),_=[];u>p;p++)if(n=t[p],n||0===n)if("object"===oe.type(n))oe.merge(_,n.nodeType?[n]:n);else if(Fe.test(n)){for(r=r||c.appendChild(e.createElement("div")),o=(Ee.exec(n)||["",""])[1].toLowerCase(),a=Le[o]||Le._default,r.innerHTML=a[1]+n.replace(Ae,"<$1></$2>")+a[2],h=a[0];h--;)r=r.lastChild;oe.merge(_,r.childNodes),r=c.firstChild,r.textContent=""}else _.push(e.createTextNode(n));for(c.textContent="",p=0;n=_[p++];)if((!s||-1===oe.inArray(n,s))&&(l=oe.contains(n.ownerDocument,n),r=y(c.appendChild(n),"script"),l&&f(r),i))for(h=0;n=r[h++];)Be.test(n.type||"")&&i.push(n);return c},cleanData:function(t){for(var i,s,n,o,a,l,h=oe.event.special,p=0;(s=t[p])!==e;p++){if(r.accepts(s)&&(a=s[ye.expando],a&&(i=ye.cache[a]))){if(n=Object.keys(i.events||{}),n.length)for(l=0;(o=n[l])!==e;l++)h[o]?oe.event.remove(s,o):oe.removeEvent(s,o,i.handle);ye.cache[a]&&delete ye.cache[a]}delete ge.cache[s[ge.expando]]}},_evalUrl:function(t){return oe.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),oe.fn.extend({wrapAll:function(t){var e;return oe.isFunction(t)?this.each(function(e){oe(this).wrapAll(t.call(this,e))}):(this[0]&&(e=oe(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return oe.isFunction(t)?this.each(function(e){oe(this).wrapInner(t.call(this,e))}):this.each(function(){var e=oe(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=oe.isFunction(t);return this.each(function(i){oe(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){oe.nodeName(this,"body")||oe(this).replaceWith(this.childNodes)}).end()}});var He,Ie,Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^margin/,We=new RegExp("^("+ae+")(.*)$","i"),Ye=new RegExp("^("+ae+")(?!px)[a-z%]+$","i"),Xe=new RegExp("^([+-])=("+ae+")","i"),Je={BODY:"block"},Qe={position:"absolute",visibility:"hidden",display:"block"},Ze={letterSpacing:0,fontWeight:400},Ke=["Top","Right","Bottom","Left"],ti=["Webkit","O","Moz","ms"];oe.fn.extend({css:function(t,i){return oe.access(this,function(t,i,s){var n,r,o={},a=0;if(oe.isArray(i)){for(n=x(t),r=i.length;r>a;a++)o[i[a]]=oe.css(t,i[a],!1,n);return o}return s!==e?oe.style(t,i,s):oe.css(t,i)},t,i,arguments.length>1)},show:function(){return b(this,!0)},hide:function(){return b(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){w(this)?oe(this).show():oe(this).hide()})}}),oe.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=He(t,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,i,s,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,l=oe.camelCase(i),h=t.style;return i=oe.cssProps[l]||(oe.cssProps[l]=v(h,l)),a=oe.cssHooks[i]||oe.cssHooks[l],s===e?a&&"get"in a&&(r=a.get(t,!1,n))!==e?r:h[i]:(o=typeof s,"string"===o&&(r=Xe.exec(s))&&(s=(r[1]+1)*r[2]+parseFloat(oe.css(t,i)),o="number"),null==s||"number"===o&&isNaN(s)||("number"!==o||oe.cssNumber[l]||(s+="px"),oe.support.clearCloneStyle||""!==s||0!==i.indexOf("background")||(h[i]="inherit"),a&&"set"in a&&(s=a.set(t,s,n))===e||(h[i]=s)),void 0)}},css:function(t,i,s,n){var r,o,a,l=oe.camelCase(i);return i=oe.cssProps[l]||(oe.cssProps[l]=v(t.style,l)),a=oe.cssHooks[i]||oe.cssHooks[l],a&&"get"in a&&(r=a.get(t,!0,s)),r===e&&(r=He(t,i,n)),"normal"===r&&i in Ze&&(r=Ze[i]),""===s||s?(o=parseFloat(r),s===!0||oe.isNumeric(o)?o||0:r):r}}),He=function(t,i,s){var n,r,o,a=s||x(t),l=a?a.getPropertyValue(i)||a[i]:e,h=t.style;return a&&(""!==l||oe.contains(t.ownerDocument,t)||(l=oe.style(t,i)),Ye.test(l)&&Ge.test(i)&&(n=h.width,r=h.minWidth,o=h.maxWidth,h.minWidth=h.maxWidth=h.width=l,l=a.width,h.width=n,h.minWidth=r,h.maxWidth=o)),l},oe.each(["height","width"],function(t,e){oe.cssHooks[e]={get:function(t,i,s){return i?0===t.offsetWidth&&Ve.test(oe.css(t,"display"))?oe.swap(t,Qe,function(){return C(t,e,s)}):C(t,e,s):void 0},set:function(t,i,s){var n=s&&x(t);return k(t,i,s?T(t,e,s,oe.support.boxSizing&&"border-box"===oe.css(t,"boxSizing",!1,n),n):0)}}}),oe(function(){oe.support.reliableMarginRight||(oe.cssHooks.marginRight={get:function(t,e){return e?oe.swap(t,{display:"inline-block"},He,[t,"marginRight"]):void 0}}),!oe.support.pixelPosition&&oe.fn.position&&oe.each(["top","left"],function(t,e){oe.cssHooks[e]={get:function(t,i){return i?(i=He(t,e),Ye.test(i)?oe(t).position()[e]+"px":i):void 0}}})}),oe.expr&&oe.expr.filters&&(oe.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},oe.expr.filters.visible=function(t){return!oe.expr.filters.hidden(t)}),oe.each({margin:"",padding:"",border:"Width"},function(t,e){oe.cssHooks[t+e]={expand:function(i){for(var s=0,n={},r="string"==typeof i?i.split(" "):[i];4>s;s++)n[t+Ke[s]+e]=r[s]||r[s-2]||r[0];return n}},Ge.test(t)||(oe.cssHooks[t+e].set=k)});var ei=/%20/g,ii=/\[\]$/,si=/\r?\n/g,ni=/^(?:submit|button|image|reset|file)$/i,ri=/^(?:input|select|textarea|keygen)/i;oe.fn.extend({serialize:function(){return oe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=oe.prop(this,"elements");return t?oe.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!oe(this).is(":disabled")&&ri.test(this.nodeName)&&!ni.test(t)&&(this.checked||!qe.test(t))}).map(function(t,e){var i=oe(this).val();return null==i?null:oe.isArray(i)?oe.map(i,function(t){return{name:e.name,value:t.replace(si,"\r\n")}}):{name:e.name,value:i.replace(si,"\r\n")}}).get()}}),oe.param=function(t,i){var s,n=[],r=function(t,e){e=oe.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(i===e&&(i=oe.ajaxSettings&&oe.ajaxSettings.traditional),oe.isArray(t)||t.jquery&&!oe.isPlainObject(t))oe.each(t,function(){r(this.name,this.value)});else for(s in t)P(s,t[s],i,r);return n.join("&").replace(ei,"+")},oe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){oe.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),oe.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,s){return this.on(e,t,i,s)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)}});var oi,ai,li=oe.now(),hi=/\?/,pi=/#.*$/,ui=/([?&])_=[^&]*/,ci=/^(.*?):[ \t]*([^\r\n]*)$/gm,_i=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,di=/^(?:GET|HEAD)$/,fi=/^\/\//,gi=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,yi=oe.fn.load,mi={},vi={},wi="*/".concat("*");try{ai=V.href}catch(xi){ai=G.createElement("a"),ai.href="",ai=ai.href}oi=gi.exec(ai.toLowerCase())||[],oe.fn.load=function(t,i,s){if("string"!=typeof t&&yi)return yi.apply(this,arguments);var n,r,o,a=this,l=t.indexOf(" ");return l>=0&&(n=t.slice(l),t=t.slice(0,l)),oe.isFunction(i)?(s=i,i=e):i&&"object"==typeof i&&(r="POST"),a.length>0&&oe.ajax({url:t,type:r,dataType:"html",data:i}).done(function(t){o=arguments,a.html(n?oe("<div>").append(oe.parseHTML(t)).find(n):t)}).complete(s&&function(t,e){a.each(s,o||[t.responseText,e,t])}),this},oe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){oe.fn[e]=function(t){return this.on(e,t)}}),oe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ai,type:"GET",isLocal:_i.test(oi[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wi,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":oe.parseJSON,"text xml":oe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?$($(t,oe.ajaxSettings),e):$(oe.ajaxSettings,t)},ajaxPrefilter:j(mi),ajaxTransport:j(vi),ajax:function(t,i){function s(t,i,s,a){var h,u,m,v,x,k=i;2!==w&&(w=2,l&&clearTimeout(l),n=e,o=a||"",b.readyState=t>0?4:0,h=t>=200&&300>t||304===t,s&&(v=S(c,b,s)),v=A(c,v,b,h),h?(c.ifModified&&(x=b.getResponseHeader("Last-Modified"),x&&(oe.lastModified[r]=x),x=b.getResponseHeader("etag"),x&&(oe.etag[r]=x)),204===t||"HEAD"===c.type?k="nocontent":304===t?k="notmodified":(k=v.state,u=v.data,m=v.error,h=!m)):(m=k,(t||!k)&&(k="error",0>t&&(t=0))),b.status=t,b.statusText=(i||k)+"",h?f.resolveWith(_,[u,k,b]):f.rejectWith(_,[b,k,m]),b.statusCode(y),y=e,p&&d.trigger(h?"ajaxSuccess":"ajaxError",[b,c,h?u:m]),g.fireWith(_,[b,k]),p&&(d.trigger("ajaxComplete",[b,c]),--oe.active||oe.event.trigger("ajaxStop")))}"object"==typeof t&&(i=t,t=e),i=i||{};var n,r,o,a,l,h,p,u,c=oe.ajaxSetup({},i),_=c.context||c,d=c.context&&(_.nodeType||_.jquery)?oe(_):oe.event,f=oe.Deferred(),g=oe.Callbacks("once memory"),y=c.statusCode||{},m={},v={},w=0,x="canceled",b={readyState:0,getResponseHeader:function(t){var e;if(2===w){if(!a)for(a={};e=ci.exec(o);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===w?o:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return w||(t=v[i]=v[i]||t,m[t]=e),this},overrideMimeType:function(t){return w||(c.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>w)for(e in t)y[e]=[y[e],t[e]];else b.always(t[b.status]);return this},abort:function(t){var e=t||x;return n&&n.abort(e),s(0,e),this}};if(f.promise(b).complete=g.add,b.success=b.done,b.error=b.fail,c.url=((t||c.url||ai)+"").replace(pi,"").replace(fi,oi[1]+"//"),c.type=i.method||i.type||c.method||c.type,c.dataTypes=oe.trim(c.dataType||"*").toLowerCase().match(le)||[""],null==c.crossDomain&&(h=gi.exec(c.url.toLowerCase()),c.crossDomain=!(!h||h[1]===oi[1]&&h[2]===oi[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(oi[3]||("http:"===oi[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=oe.param(c.data,c.traditional)),N(mi,c,i,b),2===w)return b;p=c.global,p&&0===oe.active++&&oe.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!di.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(hi.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=ui.test(r)?r.replace(ui,"$1_="+li++):r+(hi.test(r)?"&":"?")+"_="+li++)),c.ifModified&&(oe.lastModified[r]&&b.setRequestHeader("If-Modified-Since",oe.lastModified[r]),oe.etag[r]&&b.setRequestHeader("If-None-Match",oe.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||i.contentType)&&b.setRequestHeader("Content-Type",c.contentType),b.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+wi+"; q=0.01":""):c.accepts["*"]);for(u in c.headers)b.setRequestHeader(u,c.headers[u]);if(c.beforeSend&&(c.beforeSend.call(_,b,c)===!1||2===w))return b.abort();x="abort";for(u in{success:1,error:1,complete:1})b[u](c[u]);if(n=N(vi,c,i,b)){b.readyState=1,p&&d.trigger("ajaxSend",[b,c]),c.async&&c.timeout>0&&(l=setTimeout(function(){b.abort("timeout")},c.timeout));try{w=1,n.send(m,s)}catch(k){if(!(2>w))throw k;s(-1,k)}}else s(-1,"No Transport");return b},getJSON:function(t,e,i){return oe.get(t,e,i,"json")},getScript:function(t,i){return oe.get(t,e,i,"script")}}),oe.each(["get","post"],function(t,i){oe[i]=function(t,s,n,r){return oe.isFunction(s)&&(r=r||n,n=s,s=e),oe.ajax({url:t,type:i,dataType:r,data:s,success:n})}}),oe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return oe.globalEval(t),t}}}),oe.ajaxPrefilter("script",function(t){t.cache===e&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),oe.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(s,n){e=oe("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&n("error"===t.type?404:200,t.type)}),G.head.appendChild(e[0])},abort:function(){i&&i()}}}});var bi=[],ki=/(=)\?(?=&|$)|\?\?/;oe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=bi.pop()||oe.expando+"_"+li++;return this[t]=!0,t}}),oe.ajaxPrefilter("json jsonp",function(i,s,n){var r,o,a,l=i.jsonp!==!1&&(ki.test(i.url)?"url":"string"==typeof i.data&&!(i.contentType||"").indexOf("application/x-www-form-urlencoded")&&ki.test(i.data)&&"data");return l||"jsonp"===i.dataTypes[0]?(r=i.jsonpCallback=oe.isFunction(i.jsonpCallback)?i.jsonpCallback():i.jsonpCallback,l?i[l]=i[l].replace(ki,"$1"+r):i.jsonp!==!1&&(i.url+=(hi.test(i.url)?"&":"?")+i.jsonp+"="+r),i.converters["script json"]=function(){return a||oe.error(r+" was not called"),a[0]},i.dataTypes[0]="json",o=t[r],t[r]=function(){a=arguments},n.always(function(){t[r]=o,i[r]&&(i.jsonpCallback=s.jsonpCallback,bi.push(r)),a&&oe.isFunction(o)&&o(a[0]),a=o=e}),"script"):void 0}),oe.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var Ti=oe.ajaxSettings.xhr(),Ci={0:200,1223:204},Mi=0,zi={};t.ActiveXObject&&oe(t).on("unload",function(){for(var t in zi)zi[t]();zi=e}),oe.support.cors=!!Ti&&"withCredentials"in Ti,oe.support.ajax=Ti=!!Ti,oe.ajaxTransport(function(t){var i;return oe.support.cors||Ti&&!t.crossDomain?{send:function(s,n){var r,o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest");for(r in s)a.setRequestHeader(r,s[r]);i=function(t){return function(){i&&(delete zi[o],i=a.onload=a.onerror=null,"abort"===t?a.abort():"error"===t?n(a.status||404,a.statusText):n(Ci[a.status]||a.status,a.statusText,"string"==typeof a.responseText?{text:a.responseText}:e,a.getAllResponseHeaders()))}},a.onload=i(),a.onerror=i("error"),i=zi[o=Mi++]=i("abort"),a.send(t.hasContent&&t.data||null)},abort:function(){i&&i()}}:void 0});var Pi,ji,Ni=/^(?:toggle|show|hide)$/,$i=new RegExp("^(?:([+-])=|)("+ae+")([a-z%]*)$","i"),Si=/queueHooks$/,Ai=[O],Ei={"*":[function(t,e){var i=this.createTween(t,e),s=i.cur(),n=$i.exec(e),r=n&&n[3]||(oe.cssNumber[t]?"":"px"),o=(oe.cssNumber[t]||"px"!==r&&+s)&&$i.exec(oe.css(i.elem,t)),a=1,l=20;if(o&&o[3]!==r){r=r||o[3],n=n||[],o=+s||1;do a=a||".5",o/=a,oe.style(i.elem,t,o+r);while(a!==(a=i.cur()/s)&&1!==a&&--l)}return n&&(o=i.start=+o||+s||0,i.unit=r,i.end=n[1]?o+(n[1]+1)*n[2]:+n[2]),i}]};oe.Animation=oe.extend(D,{tweener:function(t,e){oe.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var i,s=0,n=t.length;n>s;s++)i=t[s],Ei[i]=Ei[i]||[],Ei[i].unshift(e)},prefilter:function(t,e){e?Ai.unshift(t):Ai.push(t)}}),oe.Tween=B,B.prototype={constructor:B,init:function(t,e,i,s,n,r){this.elem=t,this.prop=i,this.easing=n||"swing",this.options=e,this.start=this.now=this.cur(),this.end=s,this.unit=r||(oe.cssNumber[i]?"":"px")},cur:function(){var t=B.propHooks[this.prop];return t&&t.get?t.get(this):B.propHooks._default.get(this)},run:function(t){var e,i=B.propHooks[this.prop];return this.pos=e=this.options.duration?oe.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):B.propHooks._default.set(this),this}},B.prototype.init.prototype=B.prototype,B.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=oe.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){oe.fx.step[t.prop]?oe.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[oe.cssProps[t.prop]]||oe.cssHooks[t.prop])?oe.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},B.propHooks.scrollTop=B.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},oe.each(["toggle","show","hide"],function(t,e){var i=oe.fn[e];oe.fn[e]=function(t,s,n){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(R(e,!0),t,s,n)}}),oe.fn.extend({fadeTo:function(t,e,i,s){return this.filter(w).css("opacity",0).show().end().animate({opacity:e},t,i,s)},animate:function(t,e,i,s){var n=oe.isEmptyObject(t),r=oe.speed(e,i,s),o=function(){var e=D(this,oe.extend({},t),r);(n||ye.get(this,"finish"))&&e.stop(!0)};return o.finish=o,n||r.queue===!1?this.each(o):this.queue(r.queue,o)},stop:function(t,i,s){var n=function(t){var e=t.stop;delete t.stop,e(s)};return"string"!=typeof t&&(s=i,i=t,t=e),i&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",r=oe.timers,o=ye.get(this);
if(i)o[i]&&o[i].stop&&n(o[i]);else for(i in o)o[i]&&o[i].stop&&Si.test(i)&&n(o[i]);for(i=r.length;i--;)r[i].elem!==this||null!=t&&r[i].queue!==t||(r[i].anim.stop(s),e=!1,r.splice(i,1));(e||!s)&&oe.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,i=ye.get(this),s=i[t+"queue"],n=i[t+"queueHooks"],r=oe.timers,o=s?s.length:0;for(i.finish=!0,oe.queue(this,t,[]),n&&n.stop&&n.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===t&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;o>e;e++)s[e]&&s[e].finish&&s[e].finish.call(this);delete i.finish})}}),oe.each({slideDown:R("show"),slideUp:R("hide"),slideToggle:R("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){oe.fn[t]=function(t,i,s){return this.animate(e,t,i,s)}}),oe.speed=function(t,e,i){var s=t&&"object"==typeof t?oe.extend({},t):{complete:i||!i&&e||oe.isFunction(t)&&t,duration:t,easing:i&&e||e&&!oe.isFunction(e)&&e};return s.duration=oe.fx.off?0:"number"==typeof s.duration?s.duration:s.duration in oe.fx.speeds?oe.fx.speeds[s.duration]:oe.fx.speeds._default,(null==s.queue||s.queue===!0)&&(s.queue="fx"),s.old=s.complete,s.complete=function(){oe.isFunction(s.old)&&s.old.call(this),s.queue&&oe.dequeue(this,s.queue)},s},oe.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},oe.timers=[],oe.fx=B.prototype.init,oe.fx.tick=function(){var t,i=oe.timers,s=0;for(Pi=oe.now();s<i.length;s++)t=i[s],t()||i[s]!==t||i.splice(s--,1);i.length||oe.fx.stop(),Pi=e},oe.fx.timer=function(t){t()&&oe.timers.push(t)&&oe.fx.start()},oe.fx.interval=13,oe.fx.start=function(){ji||(ji=setInterval(oe.fx.tick,oe.fx.interval))},oe.fx.stop=function(){clearInterval(ji),ji=null},oe.fx.speeds={slow:600,fast:200,_default:400},oe.fx.step={},oe.expr&&oe.expr.filters&&(oe.expr.filters.animated=function(t){return oe.grep(oe.timers,function(e){return t===e.elem}).length}),oe.fn.offset=function(t){if(arguments.length)return t===e?this:this.each(function(e){oe.offset.setOffset(this,t,e)});var i,s,n=this[0],r={top:0,left:0},o=n&&n.ownerDocument;if(o)return i=o.documentElement,oe.contains(i,n)?(typeof n.getBoundingClientRect!==I&&(r=n.getBoundingClientRect()),s=U(o),{top:r.top+s.pageYOffset-i.clientTop,left:r.left+s.pageXOffset-i.clientLeft}):r},oe.offset={setOffset:function(t,e,i){var s,n,r,o,a,l,h,p=oe.css(t,"position"),u=oe(t),c={};"static"===p&&(t.style.position="relative"),a=u.offset(),r=oe.css(t,"top"),l=oe.css(t,"left"),h=("absolute"===p||"fixed"===p)&&(r+l).indexOf("auto")>-1,h?(s=u.position(),o=s.top,n=s.left):(o=parseFloat(r)||0,n=parseFloat(l)||0),oe.isFunction(e)&&(e=e.call(t,i,a)),null!=e.top&&(c.top=e.top-a.top+o),null!=e.left&&(c.left=e.left-a.left+n),"using"in e?e.using.call(t,c):u.css(c)}},oe.fn.extend({position:function(){if(this[0]){var t,e,i=this[0],s={top:0,left:0};return"fixed"===oe.css(i,"position")?e=i.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),oe.nodeName(t[0],"html")||(s=t.offset()),s.top+=oe.css(t[0],"borderTopWidth",!0),s.left+=oe.css(t[0],"borderLeftWidth",!0)),{top:e.top-s.top-oe.css(i,"marginTop",!0),left:e.left-s.left-oe.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||W;t&&!oe.nodeName(t,"html")&&"static"===oe.css(t,"position");)t=t.offsetParent;return t||W})}}),oe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(i,s){var n="pageYOffset"===s;oe.fn[i]=function(r){return oe.access(this,function(i,r,o){var a=U(i);return o===e?a?a[s]:i[r]:(a?a.scrollTo(n?t.pageXOffset:o,n?o:t.pageYOffset):i[r]=o,void 0)},i,r,arguments.length,null)}}),oe.each({Height:"height",Width:"width"},function(t,i){oe.each({padding:"inner"+t,content:i,"":"outer"+t},function(s,n){oe.fn[n]=function(n,r){var o=arguments.length&&(s||"boolean"!=typeof n),a=s||(n===!0||r===!0?"margin":"border");return oe.access(this,function(i,s,n){var r;return oe.isWindow(i)?i.document.documentElement["client"+t]:9===i.nodeType?(r=i.documentElement,Math.max(i.body["scroll"+t],r["scroll"+t],i.body["offset"+t],r["offset"+t],r["client"+t])):n===e?oe.css(i,s,a):oe.style(i,s,n,a)},i,o?n:e,o,null)}})}),oe.fn.size=function(){return this.length},oe.fn.andSelf=oe.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=oe:"function"==typeof s&&s.amd&&s("jquery",[],function(){return oe}),"object"==typeof t&&"object"==typeof t.document&&(t.jQuery=t.$=oe)}(window),function(t,i){"undefined"!=typeof exports?i(t,exports,e("underscore")):"function"==typeof s&&s.amd?s("backbone",["underscore","jquery","exports"],function(e,s,n){t.Backbone=i(t,n,e,s)}):t.Backbone=i(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,i,s){var n=t.Backbone,r=[];r.push;var o=r.slice;r.splice,e.VERSION="1.1.0",e.$=s,e.noConflict=function(){return t.Backbone=n,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=e.Events={on:function(t,e,i){if(!h(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var s=this._events[t]||(this._events[t]=[]);return s.push({callback:e,context:i,ctx:i||this}),this},once:function(t,e,s){if(!h(this,"once",t,[e,s])||!e)return this;var n=this,r=i.once(function(){n.off(t,r),e.apply(this,arguments)});return r._callback=e,this.on(t,r,s)},off:function(t,e,s){var n,r,o,a,l,p,u,c;if(!this._events||!h(this,"off",t,[e,s]))return this;if(!t&&!e&&!s)return this._events={},this;for(a=t?[t]:i.keys(this._events),l=0,p=a.length;p>l;l++)if(t=a[l],o=this._events[t]){if(this._events[t]=n=[],e||s)for(u=0,c=o.length;c>u;u++)r=o[u],(e&&e!==r.callback&&e!==r.callback._callback||s&&s!==r.context)&&n.push(r);n.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!h(this,"trigger",t,e))return this;var i=this._events[t],s=this._events.all;return i&&p(i,e),s&&p(s,arguments),this},stopListening:function(t,e,s){var n=this._listeningTo;if(!n)return this;var r=!e&&!s;s||"object"!=typeof e||(s=this),t&&((n={})[t._listenId]=t);for(var o in n)t=n[o],t.off(e,s,this),(r||i.isEmpty(t._events))&&delete this._listeningTo[o];return this}},l=/\s+/,h=function(t,e,i,s){if(!i)return!0;if("object"==typeof i){for(var n in i)t[e].apply(t,[n,i[n]].concat(s));return!1}if(l.test(i)){for(var r=i.split(l),o=0,a=r.length;a>o;o++)t[e].apply(t,[r[o]].concat(s));return!1}return!0},p=function(t,e){var i,s=-1,n=t.length,r=e[0],o=e[1],a=e[2];switch(e.length){case 0:for(;++s<n;)(i=t[s]).callback.call(i.ctx);return;case 1:for(;++s<n;)(i=t[s]).callback.call(i.ctx,r);return;case 2:for(;++s<n;)(i=t[s]).callback.call(i.ctx,r,o);return;case 3:for(;++s<n;)(i=t[s]).callback.call(i.ctx,r,o,a);return;default:for(;++s<n;)(i=t[s]).callback.apply(i.ctx,e)}},u={listenTo:"on",listenToOnce:"once"};i.each(u,function(t,e){a[e]=function(e,s,n){var r=this._listeningTo||(this._listeningTo={}),o=e._listenId||(e._listenId=i.uniqueId("l"));return r[o]=e,n||"object"!=typeof s||(n=this),e[t](s,n,this),this}}),a.bind=a.on,a.unbind=a.off,i.extend(e,a);var c=e.Model=function(t,e){var s=t||{};e||(e={}),this.cid=i.uniqueId("c"),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(s=this.parse(s,e)||{}),s=i.defaults({},s,i.result(this,"defaults")),this.set(s,e),this.changed={},this.initialize.apply(this,arguments)};i.extend(c.prototype,a,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,s){var n,r,o,a,l,h,p,u;if(null==t)return this;if("object"==typeof t?(r=t,s=e):(r={})[t]=e,s||(s={}),!this._validate(r,s))return!1;o=s.unset,l=s.silent,a=[],h=this._changing,this._changing=!0,h||(this._previousAttributes=i.clone(this.attributes),this.changed={}),u=this.attributes,p=this._previousAttributes,this.idAttribute in r&&(this.id=r[this.idAttribute]);for(n in r)e=r[n],i.isEqual(u[n],e)||a.push(n),i.isEqual(p[n],e)?delete this.changed[n]:this.changed[n]=e,o?delete u[n]:u[n]=e;if(!l){a.length&&(this._pending=!0);for(var c=0,_=a.length;_>c;c++)this.trigger("change:"+a[c],this,u[a[c]],s)}if(h)return this;if(!l)for(;this._pending;)this._pending=!1,this.trigger("change",this,s);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var s in this.attributes)e[s]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):!1;var e,s=!1,n=this._changing?this._previousAttributes:this.attributes;for(var r in t)i.isEqual(n[r],e=t[r])||((s||(s={}))[r]=e);return s},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=this,s=t.success;return t.success=function(i){return e.set(e.parse(i,t),t)?(s&&s(e,i,t),e.trigger("sync",e,i,t),void 0):!1},q(this,t),this.sync("read",this,t)},save:function(t,e,s){var n,r,o,a=this.attributes;if(null==t||"object"==typeof t?(n=t,s=e):(n={})[t]=e,s=i.extend({validate:!0},s),n&&!s.wait){if(!this.set(n,s))return!1}else if(!this._validate(n,s))return!1;n&&s.wait&&(this.attributes=i.extend({},a,n)),void 0===s.parse&&(s.parse=!0);var l=this,h=s.success;return s.success=function(t){l.attributes=a;var e=l.parse(t,s);return s.wait&&(e=i.extend(n||{},e)),i.isObject(e)&&!l.set(e,s)?!1:(h&&h(l,t,s),l.trigger("sync",l,t,s),void 0)},q(this,s),r=this.isNew()?"create":s.patch?"patch":"update","patch"===r&&(s.attrs=n),o=this.sync(r,this,s),n&&s.wait&&(this.attributes=a),o},destroy:function(t){t=t?i.clone(t):{};var e=this,s=t.success,n=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(i){(t.wait||e.isNew())&&n(),s&&s(e,i,t),e.isNew()||e.trigger("sync",e,i,t)},this.isNew())return t.success(),!1;q(this,t);var r=this.sync("delete",this,t);return t.wait||n(),r},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||D();return this.isNew()?t:t+("/"===t.charAt(t.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(t){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(t){return this._validate({},i.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var s=this.validationError=this.validate(t,e)||null;return s?(this.trigger("invalid",this,s,i.extend(e,{validationError:s})),!1):!0}});var _=["keys","values","pairs","invert","pick","omit"];i.each(_,function(t){c.prototype[t]=function(){var e=o.call(arguments);return e.unshift(this.attributes),i[t].apply(i,e)}});var d=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},f={add:!0,remove:!0,merge:!0},g={add:!0,remove:!1};i.extend(d.prototype,a,{model:c,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,g))},remove:function(t,e){var s=!i.isArray(t);t=s?[t]:i.clone(t),e||(e={});var n,r,o,a;for(n=0,r=t.length;r>n;n++)a=t[n]=this.get(t[n]),a&&(delete this._byId[a.id],delete this._byId[a.cid],o=this.indexOf(a),this.models.splice(o,1),this.length--,e.silent||(e.index=o,a.trigger("remove",a,this,e)),this._removeReference(a));return s?t[0]:t},set:function(t,e){e=i.defaults({},e,f),e.parse&&(t=this.parse(t,e));var s=!i.isArray(t);t=s?t?[t]:[]:i.clone(t);var n,r,o,a,l,h,p,u=e.at,_=this.model,d=this.comparator&&null==u&&e.sort!==!1,g=i.isString(this.comparator)?this.comparator:null,y=[],m=[],v={},w=e.add,x=e.merge,b=e.remove,k=!d&&w&&b?[]:!1;for(n=0,r=t.length;r>n;n++){if(l=t[n],o=l instanceof c?a=l:l[_.prototype.idAttribute],h=this.get(o))b&&(v[h.cid]=!0),x&&(l=l===a?a.attributes:l,e.parse&&(l=h.parse(l,e)),h.set(l,e),d&&!p&&h.hasChanged(g)&&(p=!0)),t[n]=h;else if(w){if(a=t[n]=this._prepareModel(l,e),!a)continue;y.push(a),a.on("all",this._onModelEvent,this),this._byId[a.cid]=a,null!=a.id&&(this._byId[a.id]=a)}k&&k.push(h||a)}if(b){for(n=0,r=this.length;r>n;++n)v[(a=this.models[n]).cid]||m.push(a);m.length&&this.remove(m,e)}if(y.length||k&&k.length)if(d&&(p=!0),this.length+=y.length,null!=u)for(n=0,r=y.length;r>n;n++)this.models.splice(u+n,0,y[n]);else{k&&(this.models.length=0);var T=k||y;for(n=0,r=T.length;r>n;n++)this.models.push(T[n])}if(p&&this.sort({silent:!0}),!e.silent){for(n=0,r=y.length;r>n;n++)(a=y[n]).trigger("add",a,this,e);(p||k&&k.length)&&this.trigger("sort",this,e)}return s?t[0]:t},reset:function(t,e){e||(e={});for(var s=0,n=this.models.length;n>s;s++)this._removeReference(this.models[s]);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(){return o.apply(this.models,arguments)},get:function(t){return null==t?void 0:this._byId[t.id]||this._byId[t.cid]||this._byId[t]},at:function(t){return this.models[t]},where:function(t,e){return i.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){for(var i in t)if(t[i]!==e.get(i))return!1;return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),i.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(i.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=t.success,s=this;return t.success=function(i){var n=t.reset?"reset":"set";s[n](i,t),e&&e(s,i,t),s.trigger("sync",s,i,t)},q(this,t),this.sync("read",this,t)},create:function(t,e){if(e=e?i.clone(e):{},!(t=this._prepareModel(t,e)))return!1;e.wait||this.add(t,e);var s=this,n=e.success;return e.success=function(t,e,i){i.wait&&s.add(t,i),n&&n(t,e,i)},t.save(null,e),t},parse:function(t){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof c)return t.collection||(t.collection=this),t;e=e?i.clone(e):{},e.collection=this;var s=new this.model(t,e);return s.validationError?(this.trigger("invalid",this,s.validationError,e),!1):s},_removeReference:function(t){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,s){("add"!==t&&"remove"!==t||i===this)&&("destroy"===t&&this.remove(e,s),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}});var y=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain"];i.each(y,function(t){d.prototype[t]=function(){var e=o.call(arguments);return e.unshift(this.models),i[t].apply(i,e)}});var m=["groupBy","countBy","sortBy"];i.each(m,function(t){d.prototype[t]=function(e,s){var n=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,n,s)}});var v=e.View=function(t){this.cid=i.uniqueId("view"),t||(t={}),i.extend(this,i.pick(t,x)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},w=/^(\S+)\s*(.*)$/,x=["model","collection","el","id","attributes","className","tagName","events"];i.extend(v.prototype,a,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(t){if(!t&&!(t=i.result(this,"events")))return this;this.undelegateEvents();for(var e in t){var s=t[e];if(i.isFunction(s)||(s=this[t[e]]),s){var n=e.match(w),r=n[1],o=n[2];s=i.bind(s,this),r+=".delegateEvents"+this.cid,""===o?this.$el.on(r,s):this.$el.on(r,o,s)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"),!1);else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t["class"]=i.result(this,"className"));var s=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(s,!1)}}}),e.sync=function(t,s,n){var r=k[t];i.defaults(n||(n={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var o={type:r,dataType:"json"};if(n.url||(o.url=i.result(s,"url")||D()),null!=n.data||!s||"create"!==t&&"update"!==t&&"patch"!==t||(o.contentType="application/json",o.data=JSON.stringify(n.attrs||s.toJSON(n))),n.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),n.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){o.type="POST",n.emulateJSON&&(o.data._method=r);var a=n.beforeSend;n.beforeSend=function(t){return t.setRequestHeader("X-HTTP-Method-Override",r),a?a.apply(this,arguments):void 0}}"GET"===o.type||n.emulateJSON||(o.processData=!1),"PATCH"===o.type&&b&&(o.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var l=n.xhr=e.ajax(i.extend(o,n));return s.trigger("request",s,l,n),l};var b=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var T=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},C=/\((.*?)\)/g,M=/(\(\?)?:\w+/g,z=/\*\w+/g,P=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(T.prototype,a,{initialize:function(){},route:function(t,s,n){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(s)&&(n=s,s=""),n||(n=this[s]);var r=this;return e.history.route(t,function(i){var o=r._extractParameters(t,i);n&&n.apply(r,o),r.trigger.apply(r,["route:"+s].concat(o)),r.trigger("route",s,o),e.history.trigger("route",r,s,o)}),this},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(P,"\\$&").replace(C,"(?:$1)?").replace(M,function(t,e){return e?t:"([^/]+)"}).replace(z,"(.*?)"),new RegExp("^"+t+"$")},_extractParameters:function(t,e){var s=t.exec(e).slice(1);return i.map(s,function(t){return t?decodeURIComponent(t):null})}});var j=e.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},N=/^[#\/]|\s+$/g,$=/^\/+|\/+$/g,S=/msie [\w.]+/,A=/\/$/,E=/[?#].*$/;j.started=!1,i.extend(j.prototype,a,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(A,"");t.indexOf(i)||(t=t.slice(i.length))}else t=this.getHash();return t.replace(N,"")},start:function(t){if(j.started)throw new Error("Backbone.history has already been started");j.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var s=this.getFragment(),n=document.documentMode,r=S.exec(navigator.userAgent.toLowerCase())&&(!n||7>=n);this.root=("/"+this.root+"/").replace($,"/"),r&&this._wantsHashChange&&(this.iframe=e.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(s)),this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=s;var o=this.location,a=o.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!a)return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0;this._hasPushState&&a&&o.hash&&(this.fragment=this.getHash().replace(N,""),this.history.replaceState({},document.title,this.root+this.fragment+o.search))}return this.options.silent?void 0:this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),j.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(){var t=this.getFragment();return t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe))),t===this.fragment?!1:(this.iframe&&this.navigate(t),this.loadUrl(),void 0)},loadUrl:function(t){return t=this.fragment=this.getFragment(t),i.any(this.handlers,function(e){return e.route.test(t)?(e.callback(t),!0):void 0})},navigate:function(t,e){if(!j.started)return!1;e&&e!==!0||(e={trigger:!!e});var i=this.root+(t=this.getFragment(t||""));if(t=t.replace(E,""),this.fragment!==t){if(this.fragment=t,""===t&&"/"!==i&&(i=i.slice(0,-1)),this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){if(i){var s=t.href.replace(/(javascript:|#).*$/,"");t.replace(s+"#"+e)}else t.hash="#"+e}}),e.history=new j;var F=function(t,e){var s,n=this;s=t&&i.has(t,"constructor")?t.constructor:function(){return n.apply(this,arguments)},i.extend(s,n,e);var r=function(){this.constructor=s};return r.prototype=n.prototype,s.prototype=new r,t&&i.extend(s.prototype,t),s.__super__=n.prototype,s};c.extend=d.extend=T.extend=v.extend=j.extend=F;var D=function(){throw new Error('A "url" property or function must be specified')},q=function(t,e){var i=e.error;e.error=function(s){i&&i(t,s,e),t.trigger("error",t,s,e)}};return e}),function(){s("common/build_views",["underscore"],function(t){var e;return e=function(e,i,s,n){var r,o,a,l,h,p,u,c,_,d,f,g;null==n&&(n=[]),r=[];try{p=t.filter(i,function(i){return!t.has(e,i.id)})}catch(y){throw o=y,console.log(o),o}for(a=_=0,f=p.length;f>_;a=++_){h=p[a],c=t.extend({},s,{model:h});try{e[h.id]=a<n.length?new n[a](c):new h.default_view(c)}catch(y){throw o=y,console.log("error on model of",h,o),o}r.push(e[h.id])}for(u=t.difference(t.keys(e),t.pluck(i,"id")),d=0,g=u.length;g>d;d++)l=u[d],e[l].remove(),delete e[l];return r}})}.call(this),function(){s("common/safebind",["underscore"],function(t){var e;return e=function(e,i,s,n){var r;t.has(e,"eventers")||(e.eventers={});try{e.eventers[i.id]=i}catch(o){r=o}return null!=i?(i.on(s,n,e),i.on("destroy remove",function(){return delete e.eventers[i]},e)):console.log("error with binder",e,s),null}})}.call(this),function(){s("common/load_models",["require","./base"],function(t){var e;return e=function(e){var i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m;for(a=[],l=[],i=t("./base").Collections,h=0,_=e.length;_>h;h++)o=e[h],n=i(o.type),s=o.attributes,n&&n.get(s.id)?l.push([n,s]):a.push([n,s]);for(p=0,d=a.length;d>p;p++)r=a[p],n=r[0],s=r[1],n&&n.add(s,{silent:!0});for(u=0,f=a.length;f>u;u++)r=a[u],n=r[0],s=r[1],n&&n.get(s.id).dinitialize(s);for(c=0,g=a.length;g>c;c++)r=a[c],n=r[0],s=r[1],n&&(o=n.get(s.id),o.trigger("add",o,n,{}));for(m=0,y=l.length;y>m;m++)r=l[m],n=r[0],s=r[1],n&&n.get(s.id).set(s);return null}})}.call(this),function(){s("common/bulk_save",["underscore","jquery","require","./base","./load_models"],function(t,e,i,s,n){var r;return r=function(s){var r,o,a,l,h,p;return r=i("./base").Config,o=s[0].get("doc"),a=function(){var e,i,n;for(n=[],e=0,i=s.length;i>e;e++)l=s[e],n.push({type:l.type,attributes:t.clone(l.attributes)});return n}(),a=JSON.stringify(a),h=r.prefix+"/bokeh/bb/"+o+"/bulkupsert",p=e.ajax({type:"POST",url:h,contentType:"application/json",data:a,header:{client:"javascript"}}),p.done(function(t){return n(t.modelspecs)}),p}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("common/continuum_view",["underscore","backbone"],function(i,s){var n,r;return n=function(s){function n(){return r=n.__super__.constructor.apply(this,arguments)}return e(n,s),n.prototype.initialize=function(t){return i.has(t,"id")?void 0:this.id=i.uniqueId("ContinuumView")},n.prototype.bind_bokeh_events=function(){return"pass"},n.prototype.delegateEvents=function(t){return n.__super__.delegateEvents.call(this,t)},n.prototype.remove=function(){var e,s,r;if(i.has(this,"eventers")){r=this.eventers;for(e in r)t.call(r,e)&&(s=r[e],s.off(null,null,this))}return this.trigger("remove"),n.__super__.remove.call(this)},n.prototype.mget=function(){return this.model.get.apply(this.model,arguments)},n.prototype.mset=function(){return this.model.set.apply(this.model,arguments)},n.prototype.mget_obj=function(t){return this.model.get_obj(t)},n.prototype.render_end=function(){return"pass"},n}(s.View),{View:n}})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("common/has_properties",["underscore","backbone","require","./base","./safebind"],function(s,n,r,o,a){var l,h;return l=function(n){function l(){return this.rpc=t(this.rpc,this),this.get_obj=t(this.get_obj,this),this.resolve_ref=t(this.resolve_ref,this),this.convert_to_ref=t(this.convert_to_ref,this),h=l.__super__.constructor.apply(this,arguments)}return i(l,n),l.prototype.destroy=function(t){var i,n,r,o;if(l.__super__.destroy.call(this,t),s.has(this,"eventers")){r=this.eventers,o=[];for(i in r)e.call(r,i)&&(n=r[i],o.push(n.off(null,null,this)));return o}},l.prototype.isNew=function(){return!1},l.prototype.initialize=function(t,e){var i=this;return t||(t={}),e||(e={}),l.__super__.initialize.call(this,t,e),this.properties={},this.property_cache={},s.has(t,this.idAttribute)||(this.id=s.uniqueId(this.type),this.attributes[this.idAttribute]=this.id),s.defer(function(){return i.inited?void 0:i.dinitialize(t,e)})},l.prototype.dinitialize=function(){return this.inited=!0},l.prototype.set_obj=function(t,i,n){var r,o;s.isObject(t)||null===t?(r=t,n=i):(r={},r[t]=i);for(t in r)e.call(r,t)&&(o=r[t],r[t]=this.convert_to_ref(o));return this.set(r,n)},l.prototype.set=function(t,i,n){var r,o,a,h,p;s.isObject(t)||null===t?(r=t,n=i):(r={},r[t]=i),o=[];for(t in r)e.call(r,t)&&(a=r[t],s.has(this,"properties")&&s.has(this.properties,t)&&this.properties[t].setter&&(this.properties[t].setter.call(this,a),o.push(t)));for(h=0,p=o.length;p>h;h++)t=o[h],delete r[t];return s.isEmpty(r)?void 0:l.__super__.set.call(this,r,n)},l.prototype.convert_to_ref=function(t){return s.isArray(t)?s.map(t,this.convert_to_ref):t instanceof l?t.ref():void 0},l.prototype.add_dependencies=function(t,e,i){var n,r,o,l,h;for(s.isArray(i)||(i=[i]),r=this.properties[t],r.dependencies=r.dependencies.concat({obj:e,fields:i}),h=[],o=0,l=i.length;l>o;o++)n=i[o],h.push(a(this,e,"change:"+n,r.callbacks.changedep));return h},l.prototype.register_setter=function(t,e){var i;return i=this.properties[t],i.setter=e},l.prototype.register_property=function(t,e,i){var n,r,o,l=this;return s.isUndefined(i)&&(i=!0),s.has(this.properties,t)&&this.remove_property(t),n=function(){return l.trigger("changedep:"+t)},o=function(){var e,i,s;return e=!0,r.use_cache&&(s=l.get_cache(t),l.clear_cache(t),i=l.get(t),e=i!==s),e?(l.trigger("change:"+t,l,l.get(t)),l.trigger("change",l)):void 0},r={getter:e,dependencies:[],use_cache:i,setter:null,callbacks:{changedep:n,propchange:o}},this.properties[t]=r,a(this,this,"changedep:"+t,r.callbacks.propchange),r},l.prototype.remove_property=function(t){var e,i,s,n,r,o,a,l,h,p;for(r=this.properties[t],i=r.dependencies,o=0,l=i.length;l>o;o++)for(e=i[o],n=e.obj,p=e.fields,a=0,h=p.length;h>a;a++)s=p[a],n.off("change:"+s,r.callbacks.changedep,this);return this.off("changedep:"+e),delete this.properties[t],r.use_cache?this.clear_cache(t):void 0},l.prototype.has_cache=function(t){return s.has(this.property_cache,t)},l.prototype.add_cache=function(t,e){return this.property_cache[t]=e},l.prototype.clear_cache=function(t){return delete this.property_cache[t]},l.prototype.get_cache=function(t){return this.property_cache[t]},l.prototype.get=function(t){var e,i,n;return s.has(this.properties,t)?(n=this.properties[t],n.use_cache&&this.has_cache(t)?this.property_cache[t]:(i=n.getter,e=i.apply(this),this.properties[t].use_cache&&this.add_cache(t,e),e)):l.__super__.get.call(this,t)},l.prototype.ref=function(){return{type:this.type,id:this.id}},l.prototype.resolve_ref=function(t){return s.isArray(t)?s.map(t,this.resolve_ref):(t||console.log("ERROR, null reference"),t.type===this.type&&t.id===this.id?this:(o=r("./base"),o.Collections(t.type).get(t.id)))},l.prototype.get_obj=function(t){var e;return e=this.get(t),e?this.resolve_ref(e):void 0},l.prototype.url=function(){var t;return o=r("./base"),t=o.Config.prefix+"/bokeh/bb/"+this.get("doc")+"/"+this.type+"/",this.isNew()?t:t+this.get("id")+"/"},l.prototype.sync=function(t,e,i){return i.success(e,null,{})},l.prototype.defaults=function(){return{}},l.prototype.rpc=function(t,e,i){var s,n,r,a,l,h,p;return a=o.Config.prefix,n=this.get("doc"),r=this.get("id"),h=this.type,p=""+a+"/bokeh/bb/rpc/"+n+"/"+h+"/"+r+"/"+t+"/",s={args:e,kwargs:i},l=$.ajax({type:"POST",url:p,data:JSON.stringify(s),contentType:"application/json",xhrFields:{withCredentials:!0}})},l}(n.Model)})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("common/has_parent",["underscore","./has_properties"],function(t,i){var s,n;return s=function(i){function s(){return n=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.get_fallback=function(e){return this.get_obj("parent")&&t.indexOf(this.get_obj("parent").parent_properties,e)>=0&&!t.isUndefined(this.get_obj("parent").get(e))?this.get_obj("parent").get(e):t.isFunction(this.display_defaults)?this.display_defaults()[e]:this.display_defaults[e]},s.prototype.get=function(e){var i;return i=s.__super__.get.call(this,e),t.isUndefined(i)?"parent"!==e?this.get_fallback(e):void 0:i},s.prototype.display_defaults={},s}(i)})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e
}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("range/range1d",["underscore","backbone","common/has_properties"],function(t,i,s){var n,r,o,a;return n=function(t){function i(){return o=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.type="Range1d",i.prototype.initialize=function(t,e){return i.__super__.initialize.call(this,t,e),this.register_property("min",function(){return Math.min(this.get("start"),this.get("end"))},!0),this.add_dependencies("min",this,["start","end"]),this.register_property("max",function(){return Math.max(this.get("start"),this.get("end"))},!0),this.add_dependencies("max",this,["start","end"])},i.prototype.defaults=function(){return{start:0,end:1}},i}(s),r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=n,i}(i.Collection),{Model:n,Collection:new r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("common/view_state",["./has_properties","range/range1d"],function(t,i){var s,n;return s=function(t){function s(){return n=s.__super__.constructor.apply(this,arguments)}return e(s,t),s.prototype.initialize=function(t,e){var n,r;return s.__super__.initialize.call(this,t,e),this.register_property("border_top",function(){return Math.max(this.get("min_border_top"),this.get("requested_border_top"))},!1),this.add_dependencies("border_top",this,["min_border_top","requested_border_top"]),this.register_property("border_bottom",function(){return Math.max(this.get("min_border_bottom"),this.get("requested_border_bottom"))},!1),this.add_dependencies("border_bottom",this,["min_border_bottom","requested_border_bottom"]),this.register_property("border_left",function(){return Math.max(this.get("min_border_left"),this.get("requested_border_left"))},!1),this.add_dependencies("border_left",this,["min_border_left","requested_border_left"]),this.register_property("border_right",function(){return Math.max(this.get("min_border_right"),this.get("requested_border_right"))},!1),this.add_dependencies("border_right",this,["min_border_right","requested_border_right"]),this.register_property("canvas_aspect",function(){return this.get("canvas_height")/this.get("canvas_width")},!0),this.add_dependencies("canvas_aspect",this,["canvas_height","canvas_width"]),this.register_property("outer_aspect",function(){return this.get("outer_height")/this.get("outer_width")},!0),this.add_dependencies("outer_aspect",this,["outer_height","outer_width"]),this.register_property("inner_width",function(){return this.get("outer_width")-this.get("border_left")-this.get("border_right")},!0),this.add_dependencies("inner_width",this,["outer_width","border_left","border_right"]),this.register_property("inner_height",function(){return this.get("outer_height")-this.get("border_top")-this.get("border_bottom")},!0),this.add_dependencies("inner_height",this,["outer_height","border_top","border_bottom"]),this.register_property("inner_aspect",function(){return this.get("inner_height")/this.get("inner_width")},!0),this.add_dependencies("inner_aspect",this,["inner_height","inner_width"]),n=new i.Model({start:this.get("border_left"),end:this.get("border_left")+this.get("inner_width")}),this.register_property("inner_range_horizontal",function(){return n.set("start",this.get("border_left")),n.set("end",this.get("border_left")+this.get("inner_width")),n},!0),this.add_dependencies("inner_range_horizontal",this,["border_left","inner_width"]),r=new i.Model({start:this.get("border_bottom"),end:this.get("border_bottom")+this.get("inner_height")}),this.register_property("inner_range_vertical",function(){return r.set("start",this.get("border_bottom")),r.set("end",this.get("border_bottom")+this.get("inner_height")),r},!0),this.add_dependencies("inner_range_vertical",this,["border_bottom","inner_height"])},s.prototype.sx_to_device=function(t){return t},s.prototype.sy_to_device=function(t){return this.get("canvas_height")-t},s.prototype.v_sx_to_device=function(t){var e,i,s,n;for(e=s=0,n=t.length;n>s;e=++s)i=t[e],t[e]=i;return t},s.prototype.v_sy_to_device=function(t){var e,i,s,n,r;for(e=this.get("canvas_height"),i=n=0,r=t.length;r>n;i=++n)s=t[i],t[i]=e-s;return t},s.prototype.device_to_sx=function(t){return t},s.prototype.device_to_sy=function(t){return this.get("canvas_height")-t},s.prototype.v_device_to_sx=function(t){var e,i,s,n;for(e=s=0,n=t.length;n>s;e=++s)i=t[e],t[e]=i;return t},s.prototype.v_device_to_sy=function(t){var e,i,s,n,r;for(e=this.get("canvas_height"),i=n=0,r=t.length;r>n;i=++n)s=t[i],t[i]=s-e;return t},s}(t)})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("mapper/1d/linear_mapper",["common/has_properties"],function(t){var i,s;return i=function(t){function i(){return s=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t,e){return i.__super__.initialize.call(this,t,e),this.register_property("mapper_state",this._mapper_state,!0),this.add_dependencies("mapper_state",this,["source_range","target_range"]),this.add_dependencies("mapper_state",this.get("source_range"),["start","end"]),this.add_dependencies("mapper_state",this.get("target_range"),["start","end"])},i.prototype.map_to_target=function(t){var e,i,s;return s=this.get("mapper_state"),i=s[0],e=s[1],i*t+e},i.prototype.v_map_to_target=function(t){var e,i,s,n,r,o,a,l;for(l=this.get("mapper_state"),n=l[0],i=l[1],s=new Float32Array(t.length),e=o=0,a=t.length;a>o;e=++o)r=t[e],s[e]=n*r+i;return s},i.prototype.map_from_target=function(t){var e,i,s;return s=this.get("mapper_state"),i=s[0],e=s[1],(t-e)/i},i.prototype.v_map_from_target=function(t){var e,i,s,n,r,o,a,l;for(l=this.get("mapper_state"),n=l[0],i=l[1],s=new Float32Array(t.length),e=o=0,a=t.length;a>o;e=++o)r=t[e],s[e]=(r-i)/n;return s},i.prototype._mapper_state=function(){var t,e,i,s,n,r;return s=this.get("source_range").get("start"),i=this.get("source_range").get("end"),r=this.get("target_range").get("start"),n=this.get("target_range").get("end"),e=(n-r)/(i-s),t=-(e*s)+r,[e,t]},i}(t)})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("mapper/2d/grid_mapper",["common/has_properties"],function(t){var i,s;return i=function(t){function i(){return s=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.map_to_target=function(t,e){var i,s;return i=this.get("domain_mapper").map_to_target(t),s=this.get("codomain_mapper").map_to_target(e),[i,s]},i.prototype.v_map_to_target=function(t,e){var i,s;return i=this.get("domain_mapper").v_map_to_target(t),s=this.get("codomain_mapper").v_map_to_target(e),[i,s]},i.prototype.map_from_target=function(t,e){var i,s;return i=this.get("domain_mapper").map_from_target(t),s=this.get("codomain_mapper").map_from_target(e),[i,s]},i.prototype.v_map_from_target=function(t,e){var i,s;return i=this.get("domain_mapper").v_map_from_target(t),s=this.get("codomain_mapper").v_map_from_target(e),[i,s]},i}(t)})}.call(this),function(){s("common/svg_colors",[],function(){var t;return t={indianred:"#CD5C5C",lightcoral:"#F08080",salmon:"#FA8072",darksalmon:"#E9967A",lightsalmon:"#FFA07A",crimson:"#DC143C",red:"#FF0000",firebrick:"#B22222",darkred:"#8B0000",pink:"#FFC0CB",lightpink:"#FFB6C1",hotpink:"#FF69B4",deeppink:"#FF1493",mediumvioletred:"#C71585",palevioletred:"#DB7093",lightsalmon:"#FFA07A",coral:"#FF7F50",tomato:"#FF6347",orangered:"#FF4500",darkorange:"#FF8C00",orange:"#FFA500",gold:"#FFD700",yellow:"#FFFF00",lightyellow:"#FFFFE0",lemonchiffon:"#FFFACD",lightgoldenrodyellow:"#FAFAD2",papayawhip:"#FFEFD5",moccasin:"#FFE4B5",peachpuff:"#FFDAB9",palegoldenrod:"#EEE8AA",khaki:"#F0E68C",darkkhaki:"#BDB76B",lavender:"#E6E6FA",thistle:"#D8BFD8",plum:"#DDA0DD",violet:"#EE82EE",orchid:"#DA70D6",fuchsia:"#FF00FF",magenta:"#FF00FF",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",blueviolet:"#8A2BE2",darkviolet:"#9400D3",darkorchid:"#9932CC",darkmagenta:"#8B008B",purple:"#800080",indigo:"#4B0082",slateblue:"#6A5ACD",darkslateblue:"#483D8B",mediumslateblue:"#7B68EE",greenyellow:"#ADFF2F",chartreuse:"#7FFF00",lawngreen:"#7CFC00",lime:"#00FF00",limegreen:"#32CD32",palegreen:"#98FB98",lightgreen:"#90EE90",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",mediumseagreen:"#3CB371",seagreen:"#2E8B57",forestgreen:"#228B22",green:"#008000",darkgreen:"#006400",yellowgreen:"#9ACD32",olivedrab:"#6B8E23",olive:"#808000",darkolivegreen:"#556B2F",mediumaquamarine:"#66CDAA",darkseagreen:"#8FBC8F",lightseagreen:"#20B2AA",darkcyan:"#008B8B",teal:"#008080",aqua:"#00FFFF",cyan:"#00FFFF",lightcyan:"#E0FFFF",paleturquoise:"#AFEEEE",aquamarine:"#7FFFD4",turquoise:"#40E0D0",mediumturquoise:"#48D1CC",darkturquoise:"#00CED1",cadetblue:"#5F9EA0",steelblue:"#4682B4",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",lightblue:"#ADD8E6",skyblue:"#87CEEB",lightskyblue:"#87CEFA",deepskyblue:"#00BFFF",dodgerblue:"#1E90FF",cornflowerblue:"#6495ED",mediumslateblue:"#7B68EE",royalblue:"#4169E1",blue:"#0000FF",mediumblue:"#0000CD",darkblue:"#00008B",navy:"#000080",midnightblue:"#191970",cornsilk:"#FFF8DC",blanchedalmond:"#FFEBCD",bisque:"#FFE4C4",navajowhite:"#FFDEAD",wheat:"#F5DEB3",burlywood:"#DEB887",tan:"#D2B48C",rosybrown:"#BC8F8F",sandybrown:"#F4A460",goldenrod:"#DAA520",darkgoldenrod:"#B8860B",peru:"#CD853F",chocolate:"#D2691E",saddlebrown:"#8B4513",sienna:"#A0522D",brown:"#A52A2A",maroon:"#800000",white:"#FFFFFF",snow:"#FFFAFA",honeydew:"#F0FFF0",mintcream:"#F5FFFA",azure:"#F0FFFF",aliceblue:"#F0F8FF",ghostwhite:"#F8F8FF",whitesmoke:"#F5F5F5",seashell:"#FFF5EE",beige:"#F5F5DC",oldlace:"#FDF5E6",floralwhite:"#FFFAF0",ivory:"#FFFFF0",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lavenderblush:"#FFF0F5",mistyrose:"#FFE4E1",gainsboro:"#DCDCDC",lightgrey:"#D3D3D3",silver:"#C0C0C0",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",gray:"#808080",grey:"#808080",dimgray:"#696969",dimgrey:"#696969",lightslategray:"#778899",lightslategrey:"#778899",slategray:"#708090",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",black:"#000000"}})}.call(this),function(){var t=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("renderer/properties",["underscore","common/svg_colors"],function(e,s){var n,r,o,a,l;return a=function(){function i(){}return i.prototype.string=function(t,i,s){var n,r;return this[s]={},n=t.mget(s),null==n||(e.isString(n)?this[s]["default"]=n:console.log("string property '"+s+"' given invalid default value: "+n)),null!=i&&s in i?(r=i[s],e.isString(r)?this[s].value=r:e.isObject(r)?this[s]=e.extend(this[s],r):console.log("string property '"+s+"' given invalid glyph value: "+r)):void 0},i.prototype.number=function(t,i,s){var n,r,o,a;return this[s]={typed:!0},n=t.mget(s),null==n||(e.isNumber(n)?this[s]["default"]=n:console.log("number property '"+s+"' given invalid default value: "+n)),o=null!=(a=t.mget(s+"_units"))?a:"data",null!=i&&s+"_units"in i&&(o=i[s+"_units"]),this[s].units=o,null!=i&&s in i?(r=i[s],e.isString(r)?this[s].field=r:e.isNumber(r)?this[s].value=r:e.isObject(r)?this[s]=e.extend(this[s],r):console.log("number property '"+s+"' given invalid glyph value: "+r)):void 0},i.prototype.color=function(t,i,n){var r,o;return this[n]={},r=t.mget(n),e.isUndefined(r)?this[n]["default"]=null:e.isString(r)&&(null!=s[r]||"#"===r.substring(0,1))||e.isNull(r)?this[n]["default"]=r:console.log("color property '"+n+"' given invalid default value: "+r),null!=i&&n in i?(o=i[n],e.isNull(o)?this[n].value=null:e.isString(o)?null!=s[o]||"#"===o.substring(0,1)?this[n].value=o:this[n].field=o:e.isObject(o)?this[n]=e.extend(this[n],o):console.log("color property '"+n+"' given invalid glyph value: "+o)):void 0},i.prototype.array=function(t,i,s){var n,r,o,a;return this[s]={},n=t.mget(s),null==n||(e.isArray(n)?this[s]["default"]=n:console.log("array property '"+s+"' given invalid default value: "+n)),o=null!=(a=t.mget(s+"_units"))?a:"data",null!=i&&s+"_units"in i&&(o=i[s+"_units"]),this[s].units=o,null!=i&&s in i?(r=i[s],e.isString(r)?this[s].field=r:e.isArray(r)?this[s].value=r:e.isObject(r)?this[s]=e.extend(this[s],r):console.log("array property '"+s+"' given invalid glyph value: "+r)):void 0},i.prototype["enum"]=function(i,s,n,r){var o,a,l;return this[n]={},l=r.split(" "),o=i.mget(n),e.isNull(o)||(e.isString(o)&&t.call(l,o)>=0?this[n]={"default":o}:(console.log("enum property '"+n+"' given invalid default value: "+o),console.log("    acceptable values:"+l))),null!=s&&n in s?(a=s[n],e.isString(a)?t.call(l,a)>=0?this[n].value=a:this[n].field=a:e.isObject(a)?this[n]=e.extend(this[n],a):(console.log("enum property '"+n+"' given invalid glyph value: "+a),console.log("    acceptable values:"+l))):void 0},i.prototype.setattr=function(t,e,i,s){var n,r;return n=null,s.indexOf(":")>-1&&(r=s.split(":"),s=r[0],n=r[1]),"string"===s?this.string(t,e,i):"number"===s?this.number(t,e,i):"color"===s?this.color(t,e,i):"array"===s?this.array(t,e,i):"enum"===s&&n?this["enum"](t,e,i,n):console.log("Unknown type '"+s+"' for glyph property: "+i)},i.prototype.select=function(t,e){return t in this?null!=this[t].field&&this[t].field in e?e[this[t].field]:null!=this[t].value?this[t].value:null!=e[t]?e[t]:null!=this[t]["default"]?this[t]["default"]:console.log("selection for attribute '"+t+"' failed on object: "+e):(console.log("requested selection of unknown property '"+t+"' on object: "+e),void 0)},i.prototype.v_select=function(t,e){var i,s,n,r,o;if(!(t in this))return console.log("requested vector selection of unknown property '"+t+"' on objects"),void 0;for(n=null!=this[t].typed?new Float32Array(e.length):new Array(e.length),i=r=0,o=e.length-1;o>=0?o>=r:r>=o;i=o>=0?++r:--r)if(s=e[i],null!=this[t].field&&this[t].field in s)n[i]=s[this[t].field];else if(null!=this[t].value)n[i]=this[t].value;else if(null!=s[t])n[i]=s[t];else{if(null==this[t]["default"])return console.log("vector selection for attribute '"+t+"' failed on object: "+s),void 0;n[i]=this[t]["default"]}return n},i}(),o=function(t){function s(t,i,s){null==s&&(s=""),this.line_color_name=""+s+"line_color",this.line_width_name=""+s+"line_width",this.line_alpha_name=""+s+"line_alpha",this.line_join_name=""+s+"line_join",this.line_cap_name=""+s+"line_cap",this.line_dash_name=""+s+"line_dash",this.line_dash_offset_name=""+s+"line_dash_offset",this.color(t,i,this.line_color_name),this.number(t,i,this.line_width_name),this.number(t,i,this.line_alpha_name),this["enum"](t,i,this.line_join_name,"miter round bevel"),this["enum"](t,i,this.line_cap_name,"butt round square"),this.array(t,i,this.line_dash_name),this.number(t,i,this.line_dash_offset_name),this.do_stroke=!0,e.isUndefined(this[this.line_color_name].value)?e.isNull(this[this.line_color_name]["default"])&&(this.do_stroke=!1):e.isNull(this[this.line_color_name].value)&&(this.do_stroke=!1)}return i(s,t),s.prototype.set=function(t,e){return t.strokeStyle=this.select(this.line_color_name,e),t.globalAlpha=this.select(this.line_alpha_name,e),t.lineWidth=this.select(this.line_width_name,e),t.lineJoin=this.select(this.line_join_name,e),t.lineCap=this.select(this.line_cap_name,e),t.setLineDash(this.select(this.line_dash_name,e)),t.setLineDashOffset(this.select(this.line_dash_offset_name,e))},s}(a),n=function(t){function s(t,i,s){null==s&&(s=""),this.fill_color_name=""+s+"fill_color",this.fill_alpha_name=""+s+"fill_alpha",this.color(t,i,this.fill_color_name),this.number(t,i,this.fill_alpha_name),this.do_fill=!0,e.isUndefined(this[this.fill_color_name].value)?e.isNull(this[this.fill_color_name]["default"])&&(this.do_fill=!1):e.isNull(this[this.fill_color_name].value)&&(this.do_fill=!1)}return i(s,t),s.prototype.set=function(t,e){return t.fillStyle=this.select(this.fill_color_name,e),t.globalAlpha=this.select(this.fill_alpha_name,e)},s}(a),l=function(t){function e(t,e,i){null==i&&(i=""),this.text_font_name=""+i+"text_font",this.text_font_size_name=""+i+"text_font_size",this.text_font_style_name=""+i+"text_font_style",this.text_color_name=""+i+"text_color",this.text_alpha_name=""+i+"text_alpha",this.text_align_name=""+i+"text_align",this.text_baseline_name=""+i+"text_baseline",this.string(t,e,this.text_font_name),this.string(t,e,this.text_font_size_name),this["enum"](t,e,this.text_font_style_name,"normal italic bold"),this.color(t,e,this.text_color_name),this.number(t,e,this.text_alpha_name),this["enum"](t,e,this.text_align_name,"left right center"),this["enum"](t,e,this.text_baseline_name,"top middle bottom alphabetic hanging")}return i(e,t),e.prototype.font=function(t,e){var i,s;return null==e&&(e=this.select(this.text_font_size_name,t)),i=this.select(this.text_font_name,t),s=this.select(this.text_font_style_name,t),i=s+" "+e+" "+i},e.prototype.set=function(t,e){return t.font=this.font(e),t.fillStyle=this.select(this.text_color_name,e),t.globalAlpha=this.select(this.text_alpha_name,e),t.textAlign=this.select(this.text_align_name,e),t.textBaseline=this.select(this.text_baseline_name,e)},e}(a),r=function(t){function e(t,e,i,s){var n,r,o,a,l,h;for(a=0,l=i.length;l>a;a++)n=i[a],r="number",n.indexOf(":")>-1&&(h=n.split(":"),n=h[0],r=h[1]),this.setattr(t,e,n,r);for(o in s)this[o]=s[o];this.fast_path=!1,"fast_path"in e&&(this.fast_path=e.fast_path)}return i(e,t),e}(a),{glyph_properties:r,fill_properties:n,line_properties:o,text_properties:l}})}.call(this),function(){s("tool/active_tool_manager",[],function(){var t;return t=function(){" This makes sure that only one tool is active at a time ";function t(t){this.event_sink=t,this.event_sink.active=null}return t.prototype.bind_bokeh_events=function(){var t=this;return this.event_sink.on("clear_active_tool",function(){return t.event_sink.trigger(""+t.event_sink.active+":deactivated"),t.event_sink.active=null}),this.event_sink.on("active_tool",function(e){return e!==t.event_sink.active?(t.event_sink.trigger(""+e+":activated"),t.event_sink.trigger(""+t.event_sink.active+":deactivated"),t.event_sink.active=e):void 0}),this.event_sink.on("try_active_tool",function(e){return null==t.event_sink.active?(t.event_sink.trigger(""+e+":activated"),t.event_sink.trigger(""+t.event_sink.active+":deactivated"),t.event_sink.active=e):void 0})},t}()})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("common/plot",["underscore","backbone","require","./build_views","./safebind","./bulk_save","./continuum_view","./has_parent","./view_state","mapper/1d/linear_mapper","mapper/2d/grid_mapper","renderer/properties","tool/active_tool_manager"],function(e,s,n,r,o,a,l,h,p,u,c,_,d){var f,g,y,m,v,w,x,b,k,T,C;return w=_.line_properties,x=_.text_properties,f=["image","underlay","glyph","overlay","annotation","tool"],v=function(t){return t()},v=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||v,b=function(t,e){var i,s,n,r,o,a,l,h;return h=[null,null,null,null],s=h[0],i=h[1],l=h[2],a=h[3],o=0,r=!1,n=function(){return o=new Date,l=null,r=!1,a=t.apply(s,i)},function(){var t,h;return t=new Date,h=e-(t-o),s=this,i=arguments,0>=h&&!r?(clearTimeout(l),r=!0,v(n)):l||(l=setTimeout(function(){return v(n)},h)),a}},y=function(n){function l(){return this._mousemove=t(this._mousemove,this),this._mousedown=t(this._mousedown,this),k=l.__super__.constructor.apply(this,arguments)}return i(l,n),l.prototype.className="bokeh plotview",l.prototype.events={"mousemove .bokeh_canvas_wrapper":"_mousemove","mousedown .bokeh_canvas_wrapper":"_mousedown"},l.prototype.view_options=function(){return e.extend({plot_model:this.model,plot_view:this},this.options)},l.prototype._mousedown=function(t){var e,i,s,n,r;for(n=this.mousedownCallbacks,r=[],i=0,s=n.length;s>i;i++)e=n[i],r.push(e(t,t.layerX,t.layerY));return r},l.prototype._mousemove=function(t){var e,i,s,n,r;for(n=this.moveCallbacks,r=[],i=0,s=n.length;s>i;i++)e=n[i],r.push(e(t,t.layerX,t.layerY));return r},l.prototype.pause=function(){return this.is_paused=!0},l.prototype.unpause=function(t){return null==t&&(t=!1),this.is_paused=!1,t?this.request_render_canvas(!0):this.request_render()},l.prototype.request_render=function(){this.is_paused||this.throttled_render()},l.prototype.request_render_canvas=function(t){this.is_paused||this.throttled_render_canvas(t)},l.prototype.initialize=function(t){var i,n,r,o,a,h,_,g,y,m,v,k,T,C,M,z,P,j,N,$;for(l.__super__.initialize.call(this,e.defaults(t,this.default_options)),this.throttled_render=b(this.render,15),this.throttled_render_canvas=b(this.render_canvas,15),this.outline_props=new w(this,{},"outline_"),this.title_props=new x(this,{},"title_"),this.view_state=new p({canvas_width:null!=(o=t.canvas_width)?o:this.mget("canvas_width"),canvas_height:null!=(T=t.canvas_height)?T:this.mget("canvas_height"),x_offset:null!=(C=t.x_offset)?C:this.mget("x_offset"),y_offset:null!=(M=t.y_offset)?M:this.mget("y_offset"),outer_width:null!=(z=t.outer_width)?z:this.mget("outer_width"),outer_height:null!=(P=t.outer_height)?P:this.mget("outer_height"),min_border_top:null!=(j=null!=(N=t.min_border_top)?N:this.mget("min_border_top"))?j:this.mget("min_border"),min_border_bottom:null!=($=null!=(a=t.min_border_bottom)?a:this.mget("min_border_bottom"))?$:this.mget("min_border"),min_border_left:null!=(h=null!=(_=t.min_border_left)?_:this.mget("min_border_left"))?h:this.mget("min_border"),min_border_right:null!=(g=null!=(y=t.min_border_right)?y:this.mget("min_border_right"))?g:this.mget("min_border"),requested_border_top:0,requested_border_bottom:0,requested_border_left:0,requested_border_right:0}),this.hidpi=null!=(m=t.hidpi)?m:this.mget("hidpi"),this.x_range=null!=(v=t.x_range)?v:this.mget_obj("x_range"),this.y_range=null!=(k=t.y_range)?k:this.mget_obj("y_range"),this.xmapper=new u({source_range:this.x_range,target_range:this.view_state.get("inner_range_horizontal")}),this.ymapper=new u({source_range:this.y_range,target_range:this.view_state.get("inner_range_vertical")}),this.mapper=new c({domain_mapper:this.xmapper,codomain_mapper:this.ymapper}),this.requested_padding={top:0,bottom:0,left:0,right:0},this.old_mapper_state={x:null,y:null},this.am_rendering=!1,this.renderers={},this.tools={},this.eventSink=e.extend({},s.Events),this.moveCallbacks=[],this.mousedownCallbacks=[],this.keydownCallbacks=[],this.render_init(),this.render_canvas(!1),this.atm=new d(this.eventSink),this.levels={},n=0,r=f.length;r>n;n++)i=f[n],this.levels[i]={};return this.build_levels(),this.request_render(),this.atm.bind_bokeh_events(),this.bind_bokeh_events(),this},l.prototype.map_to_screen=function(t,i,s){var n,r,o;return"screen"===i?(e.isArray(t)?n=t.slice(0):(n=new Float32Array(t.length),n.set(t)),e.isArray(s)?r=s.slice(0):(r=new Float32Array(s.length),r.set(s))):(o=this.mapper.v_map_to_target(t,s),n=o[0],r=o[1]),n=this.view_state.v_sx_to_device(n),r=this.view_state.v_sy_to_device(r),[n,r]},l.prototype.map_from_screen=function(t,i,s){var n,r,o,a,l;return e.isArray(t)?n=o.slice(0):(n=new Float32Array(t.length),sd.set(o)),e.isArray(i)?r=a.slice(0):(r=new Float32Array(i.length),r.set(a)),t=this.view_state.v_device_to_sx(n),i=this.view_state.v_device_to_sy(r),"screen"===s?(o=t,a=i):(l=this.mapper.v_map_from_target(t,i),o=l[0],a=l[1]),[o,a]},l.prototype.update_range=function(t){return this.pause(),this.x_range.set(t.xr),this.y_range.set(t.yr),this.unpause()},l.prototype.build_tools=function(){return r(this.tools,this.mget_obj("tools"),this.view_options())},l.prototype.build_views=function(){return r(this.renderers,this.mget_obj("renderers"),this.view_options())},l.prototype.build_levels=function(){var t,e,i,s,n,r,o,a,l;for(n=this.build_views(),i=this.build_tools(),r=0,a=n.length;a>r;r++)s=n[r],t=s.mget("level"),this.levels[t][s.model.id]=s,s.bind_bokeh_events();for(o=0,l=i.length;l>o;o++)e=i[o],t=e.mget("level"),this.levels[t][e.model.id]=e,e.bind_bokeh_events();return this},l.prototype.bind_bokeh_events=function(){var t=this;return o(this,this.view_state,"change",function(){return t.request_render_canvas(),t.request_render()}),o(this,this.x_range,"change",this.request_render),o(this,this.y_range,"change",this.request_render),o(this,this.model,"change:renderers",this.build_levels),o(this,this.model,"change:tool",this.build_levels),o(this,this.model,"change",this.request_render),o(this,this.model,"destroy",function(){return t.remove()})},l.prototype.render_init=function(){return this.$el.append($("<div class='button_bar btn-group pull-top'/>\n<div class='plotarea'>\n<div class='bokeh_canvas_wrapper'>\n  <canvas class='bokeh_canvas'></canvas>\n</div>\n</div>")),this.button_bar=this.$el.find(".button_bar"),this.canvas_wrapper=this.$el.find(".bokeh_canvas_wrapper"),this.canvas=this.$el.find("canvas.bokeh_canvas")},l.prototype.render_canvas=function(t){var e,i,s,n,r;return null==t&&(t=!0),this.ctx=this.canvas[0].getContext("2d"),this.hidpi?(i=window.devicePixelRatio||1,e=this.ctx.webkitBackingStorePixelRatio||this.ctx.mozBackingStorePixelRatio||this.ctx.msBackingStorePixelRatio||this.ctx.oBackingStorePixelRatio||this.ctx.backingStorePixelRatio||1,r=i/e):r=1,n=this.view_state.get("outer_width"),s=this.view_state.get("outer_height"),this.canvas.width=n*r,this.canvas.height=s*r,this.button_bar.attr("style","width:"+n+"px;"),this.canvas_wrapper.attr("style","width:"+n+"px; height:"+s+"px"),this.canvas.attr("style","width:"+n+"px;"),this.canvas.attr("style","height:"+s+"px;"),this.canvas.attr("width",n*r).attr("height",s*r),this.$el.attr("width",n).attr("height",s),this.ctx.scale(r,r),this.ctx.translate(.5,.5),t?this.render():void 0},l.prototype.save_png=function(){var t;return this.render(),t=this.canvas[0].toDataURL(),this.model.set("png",this.canvas[0].toDataURL()),a([this.model])},l.prototype.render=function(){var t,e,i,s,n,r,o,a,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T;for(l.__super__.render.call(this),this.requested_padding={top:0,bottom:0,left:0,right:0},x=["image","underlay","glyph","overlay","annotation","tool"],f=0,m=x.length;m>f;f++){s=x[f],r=this.levels[s];for(i in r)if(c=r[i],null!=c.padding_request){n=c.padding_request();for(i in n)c=n[i],this.requested_padding[i]+=c}}u=this.mget("title"),u&&(this.title_props.set(this.ctx,{}),p=this.ctx.measureText(this.mget("title")).ascent,this.requested_padding.top+=p+this.mget("title_standoff")),h=this.mget("border_symmetry"),(h.indexOf("h")>=0||h.indexOf("H")>=0)&&(e=Math.max(this.requested_padding.left,this.requested_padding.right),this.requested_padding.left=e,this.requested_padding.right=e),(h.indexOf("v")>=0||h.indexOf("V")>=0)&&(e=Math.max(this.requested_padding.top,this.requested_padding.bottom),this.requested_padding.top=e,this.requested_padding.bottom=e),this.is_paused=!0,b=this.requested_padding;for(i in b)c=b[i],this.view_state.set("requested_border_"+i,c);for(this.is_paused=!1,this.ctx.fillStyle=this.mget("border_fill"),this.ctx.fillRect(0,0,this.view_state.get("canvas_width"),this.view_state.get("canvas_height")),this.ctx.fillStyle=this.mget("background_fill"),this.ctx.fillRect(this.view_state.get("border_left"),this.view_state.get("border_top"),this.view_state.get("inner_width"),this.view_state.get("inner_height")),this.outline_props.do_stroke&&(this.outline_props.set(this.ctx,{}),this.ctx.strokeRect(this.view_state.get("border_left"),this.view_state.get("border_top"),this.view_state.get("inner_width"),this.view_state.get("inner_height"))),t=!1,_=this.xmapper.get("mapper_state")[0],d=this.ymapper.get("mapper_state")[0],(Math.abs(this.old_mapper_state.x-_)>1e-8||Math.abs(this.old_mapper_state.y-d)>1e-8)&&(this.old_mapper_state.x=_,this.old_mapper_state.y=d,t=!0),this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(this.view_state.get("border_left"),this.view_state.get("border_top"),this.view_state.get("inner_width"),this.view_state.get("inner_height")),this.ctx.clip(),this.ctx.beginPath(),k=["image","underlay","glyph"],g=0,v=k.length;v>g;g++){s=k[g],r=this.levels[s];for(i in r)c=r[i],c.render(t)}for(this.ctx.restore(),T=["overlay","annotation","tool"],y=0,w=T.length;w>y;y++){s=T[y],r=this.levels[s];for(i in r)c=r[i],c.render(t)}return u?(o=this.view_state.get("outer_width")/2,a=p,this.title_props.set(this.ctx,{}),this.ctx.fillText(u,o,a)):void 0},l}(l.View),g=function(t){function e(){return T=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="Plot",e.prototype.default_view=y,e.prototype.add_renderers=function(t){var e;return e=this.get("renderers"),e=e.concat(t),this.set("renderers",e)},e.prototype.parent_properties=["background_fill","border_fill","canvas_width","canvas_height","outer_width","outer_height","min_border","min_border_top","min_border_bottom","min_border_left","min_border_right"],e.prototype.defaults=function(){return{data_sources:{},renderers:[],tools:[],title:"Plot"}},e.prototype.display_defaults=function(){return{hidpi:!0,background_fill:"#fff",border_fill:"#fff",border_symmetry:"h",min_border:40,x_offset:0,y_offset:0,canvas_width:300,canvas_height:300,outer_width:300,outer_height:300,title_standoff:8,title_text_font:"helvetica",title_text_font_size:"20pt",title_text_font_style:"normal",title_text_color:"#444444",title_text_alpha:1,title_text_align:"center",title_text_baseline:"alphabetic",outline_line_color:"#aaaaaa",outline_line_width:1,outline_line_alpha:1,outline_line_join:"miter",outline_line_cap:"butt",outline_line_dash:[],outline_line_dash_offset:0}},e}(h),m=function(t){function e(){return C=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.model=g,e}(s.Collection),{Model:g,Collection:new m,View:y}})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("common/gmap_plot",["underscore","jquery","backbone","./build_views","./safebind","./bulk_save","./continuum_view","./has_parent","./view_state","mapper/1d/linear_mapper","mapper/2d/grid_mapper","renderer/properties","tool/active_tool_manager"],function(e,s,n,r,o,a,l,h,p,u,c,_,d){var f,g,y,m,v,w,x;return m=["image","underlay","glyph","overlay","annotation","tool"],g=function(l){function h(){return this.bounds_change=t(this.bounds_change,this),this._mousemove=t(this._mousemove,this),this._mousedown=t(this._mousedown,this),v=h.__super__.constructor.apply(this,arguments)}return i(h,l),h.prototype.events={"mousemove .bokeh_canvas_wrapper":"_mousemove","mousedown .bokeh_canvas_wrapper":"_mousedown"},h.prototype.className="bokeh",h.prototype.view_options=function(){return e.extend({plot_model:this.model,plot_view:this},this.options)},h.prototype._mousedown=function(t){var e,i,s,n,r;for(n=this.mousedownCallbacks,r=[],i=0,s=n.length;s>i;i++)e=n[i],r.push(e(t,t.layerX,t.layerY));return r},h.prototype._mousemove=function(t){var e,i,s,n,r;for(n=this.moveCallbacks,r=[],i=0,s=n.length;s>i;i++)e=n[i],r.push(e(t,t.layerX,t.layerY));return r},h.prototype.pause=function(){return this.is_paused=!0},h.prototype.unpause=function(t){return null==t&&(t=!1),this.is_paused=!1,t?this.request_render_canvas(!0):this.request_render()},h.prototype.request_render=function(){this.is_paused||this.throttled_render()},h.prototype.request_render_canvas=function(t){this.is_paused||this.throttled_render_canvas(t)},h.prototype.initialize=function(t){var i,s,r,o,a,l,f,g,y,v,w,x,b,k,T,C,M,z,P,j,N,$,S,A;
for(h.__super__.initialize.call(this,e.defaults(t,this.default_options)),this.throttled_render=e.throttle(this.render,100),this.throttled_render_canvas=e.throttle(this.render_canvas,100),this.outline_props=new _.line_properties(this,{},"title_"),this.title_props=new _.text_properties(this,{},"title_"),this.view_state=new p({canvas_width:null!=(f=t.canvas_width)?f:this.mget("canvas_width"),canvas_height:null!=(M=t.canvas_height)?M:this.mget("canvas_height"),x_offset:null!=(z=t.x_offset)?z:this.mget("x_offset"),y_offset:null!=(P=t.y_offset)?P:this.mget("y_offset"),outer_width:null!=(j=t.outer_width)?j:this.mget("outer_width"),outer_height:null!=(N=t.outer_height)?N:this.mget("outer_height"),min_border_top:null!=($=null!=(S=t.min_border_top)?S:this.mget("min_border_top"))?$:this.mget("min_border"),min_border_bottom:null!=(A=null!=(g=t.min_border_bottom)?g:this.mget("min_border_bottom"))?A:this.mget("min_border"),min_border_left:null!=(y=null!=(v=t.min_border_left)?v:this.mget("min_border_left"))?y:this.mget("min_border"),min_border_right:null!=(w=null!=(x=t.min_border_right)?x:this.mget("min_border_right"))?w:this.mget("min_border"),requested_border_top:0,requested_border_bottom:0,requested_border_left:0,requested_border_right:0}),this.hidpi=null!=(b=t.hidpi)?b:this.mget("hidpi"),this.x_range=null!=(k=t.x_range)?k:this.mget_obj("x_range"),this.y_range=null!=(T=t.y_range)?T:this.mget_obj("y_range"),this.xmapper=new u({source_range:this.x_range,target_range:this.view_state.get("inner_range_horizontal")}),this.ymapper=new u({source_range:this.y_range,target_range:this.view_state.get("inner_range_vertical")}),this.mapper=new c({domain_mapper:this.xmapper,codomain_mapper:this.ymapper}),C=this.mget_obj("tools"),r=0,a=C.length;a>r;r++)s=C[r],("PanTool"===s.type||"ZoomTool"===s.type)&&(s.set_obj("dataranges",[this.x_range,this.y_range]),s.set("dimensions",["width","height"]));for(this.requested_padding={top:0,bottom:0,left:0,right:0},this.old_mapper_state={x:null,y:null},this.am_rendering=!1,this.renderers={},this.tools={},this.zoom_count=null,this.eventSink=e.extend({},n.Events),this.moveCallbacks=[],this.mousedownCallbacks=[],this.keydownCallbacks=[],this.render_init(),this.render_canvas(!1),this.atm=new d(this.eventSink),this.levels={},o=0,l=m.length;l>o;o++)i=m[o],this.levels[i]={};return this.build_levels(),this.request_render(),this.atm.bind_bokeh_events(),this.bind_bokeh_events(),this},h.prototype.map_to_screen=function(t,e,i){var s,n,r;return"screen"===e?(s=t.slice(0),n=i.slice(0)):(r=this.mapper.v_map_to_target(t,i),s=r[0],n=r[1]),s=this.view_state.v_sx_to_device(s),n=this.view_state.v_sy_to_device(n),[s,n]},h.prototype.map_from_screen=function(t,e,i){var s,n,r;return t=this.view_state.v_device_sx(t.slice(0)),e=this.view_state.v_device_sx(e.slice(0)),"screen"===i?(s=t,n=e):(r=this.mapper.v_map_from_target(t,e),s=r[0],n=r[1]),[s,n]},h.prototype.update_range=function(t){var e,i,s,n,r;return this.pause(),null!=t.sdx?this.map.panBy(t.sdx,t.sdy):(r=Math.min(t.xr.start,t.xr.end),s=Math.max(t.xr.start,t.xr.end),n=Math.min(t.yr.start,t.yr.end),i=Math.max(t.yr.start,t.yr.end),e=new google.maps.LatLng((i+n)/2,(s+r)/2),t.factor>0?(this.zoom_count+=1,10===this.zoom_count&&(this.map.setZoom(this.map.getZoom()+1),this.zoom_count=0)):(this.zoom_count-=1,-10===this.zoom_count&&(this.map.setCenter(e),this.map.setZoom(this.map.getZoom()-1),this.map.setCenter(e),this.zoom_count=0))),this.unpause()},h.prototype.build_tools=function(){return r(this.tools,this.mget_obj("tools"),this.view_options())},h.prototype.build_views=function(){return r(this.renderers,this.mget_obj("renderers"),this.view_options())},h.prototype.build_levels=function(){var t,e,i,s,n,r,o,a,l;for(n=this.build_views(),i=this.build_tools(),r=0,a=n.length;a>r;r++)s=n[r],t=s.mget("level"),this.levels[t][s.model.id]=s,s.bind_bokeh_events();for(o=0,l=i.length;l>o;o++)e=i[o],t=e.mget("level"),this.levels[t][e.model.id]=e,e.bind_bokeh_events();return this},h.prototype.bind_bokeh_events=function(){var t=this;return o(this,this.view_state,"change",function(){return t.request_render_canvas(),t.request_render()}),o(this,this.x_range,"change",this.request_render),o(this,this.y_range,"change",this.request_render),o(this,this.model,"change:renderers",this.build_levels),o(this,this.model,"change:tool",this.build_levels),o(this,this.model,"change",this.request_render),o(this,this.model,"destroy",function(){return t.remove()})},h.prototype.render_init=function(){return this.$el.append(s("<div class='button_bar btn-group'/>\n<div class='plotarea'>\n<div class='bokeh_canvas_wrapper'>\n  <div class=\"bokeh_gmap\"></div>\n  <canvas class='bokeh_canvas'></canvas>\n</div>\n</div>")),this.button_bar=this.$el.find(".button_bar"),this.canvas_wrapper=this.$el.find(".bokeh_canvas_wrapper"),this.canvas=this.$el.find("canvas.bokeh_canvas"),this.gmap_div=this.$el.find(".bokeh_gmap")},h.prototype.render_canvas=function(t){var i,s,n,r,o,a,l,h,p,u,c=this;return null==t&&(t=!0),this.ctx=this.canvas[0].getContext("2d"),this.hidpi?(n=window.devicePixelRatio||1,i=this.ctx.webkitBackingStorePixelRatio||this.ctx.mozBackingStorePixelRatio||this.ctx.msBackingStorePixelRatio||this.ctx.oBackingStorePixelRatio||this.ctx.backingStorePixelRatio||1,p=n/i):p=1,l=this.view_state.get("outer_height"),h=this.view_state.get("outer_width"),this.canvas.width=h*p,this.canvas.height=l*p,this.button_bar.attr("style","width:"+h+"px;"),this.canvas_wrapper.attr("style","width:"+h+"px; height:"+l+"px"),this.canvas.attr("style","width:"+h+"px;"),this.canvas.attr("style","height:"+l+"px;"),this.canvas.attr("width",h*p).attr("height",l*p),this.$el.attr("width",h).attr("height",l),this.ctx.scale(p,p),this.ctx.translate(.5,.5),o=this.view_state.get("inner_width"),r=this.view_state.get("inner_height"),u=this.view_state.get("border_top"),a=this.view_state.get("border_left"),console.log(this.gmap_div),this.gmap_div.attr("style","top: "+u+"px; left: "+a+"px; position: absolute"),this.gmap_div.attr("style","width:"+o+"px;"),this.gmap_div.attr("style","height:"+r+"px;"),this.gmap_div.width(""+o+"px").height(""+r+"px"),s=function(){var t,e;return e=c.mget("map_options"),t={center:new google.maps.LatLng(e.lat,e.lng),zoom:e.zoom,disableDefaultUI:!0,mapTypeId:google.maps.MapTypeId.SATELLITE},console.log("FOO",c),console.log("FOO",c.gmap_div),console.log("FOO",c.gmap_div[0]),c.map=new google.maps.Map(c.gmap_div[0],t),google.maps.event.addListener(c.map,"bounds_changed",c.bounds_change)},e.defer(s),t?this.render():void 0},h.prototype.bounds_change=function(){var t,e,i;return t=this.map.getBounds(),e=t.getNorthEast(),i=t.getSouthWest(),this.x_range.set({start:i.lng(),end:e.lng(),silent:!0}),this.y_range.set({start:i.lat(),end:e.lat()})},h.prototype.save_png=function(){var t;return this.render(),t=this.canvas[0].toDataURL(),this.model.set("png",this.canvas[0].toDataURL()),a([this.model])},h.prototype.render=function(){var t,e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T,C,M,z,P,j;for(this.requested_padding={top:0,bottom:0,left:0,right:0},M=["image","underlay","glyph","overlay","annotation","tool"],w=0,k=M.length;k>w;w++){o=M[w],p=this.levels[o];for(n in p)if(y=p[n],null!=y.padding_request){h=y.padding_request();for(n in h)y=h[n],this.requested_padding[n]+=y}}f=this.mget("title"),f&&(this.title_props.set(this.ctx,{}),d=this.ctx.measureText(this.mget("title")).ascent,this.requested_padding.top+=d+this.mget("title_standoff")),_=this.mget("border_symmetry"),(_.indexOf("h")>=0||_.indexOf("H")>=0)&&(e=Math.max(this.requested_padding.left,this.requested_padding.right),this.requested_padding.left=e,this.requested_padding.right=e),(_.indexOf("v")>=0||_.indexOf("V")>=0)&&(e=Math.max(this.requested_padding.top,this.requested_padding.bottom),this.requested_padding.top=e,this.requested_padding.bottom=e),this.is_paused=!0,z=this.requested_padding;for(n in z)y=z[n],this.view_state.set("requested_border_"+n,y);for(this.is_paused=!1,a=this.view_state.get("outer_height"),l=this.view_state.get("outer_width"),s=this.view_state.get("inner_width"),i=this.view_state.get("inner_height"),g=this.view_state.get("border_top"),r=this.view_state.get("border_left"),this.gmap_div.attr("style","top: "+g+"px; left: "+r+"px;"),this.gmap_div.width(""+s+"px").height(""+i+"px"),this.ctx.clearRect(0,0,l,a),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(0,a),this.ctx.lineTo(l,a),this.ctx.lineTo(l,0),this.ctx.lineTo(0,0),this.ctx.moveTo(r,g),this.ctx.lineTo(r+s,g),this.ctx.lineTo(r+s,g+i),this.ctx.lineTo(r,g+i),this.ctx.lineTo(r,g),this.ctx.closePath(),this.ctx.fillStyle=this.mget("border_fill"),this.ctx.fill(),this.outline_props.do_stroke&&(this.outline_props.set(this.ctx,{}),this.ctx.strokeRect(this.view_state.get("border_left"),this.view_state.get("border_top"),this.view_state.get("inner_width"),this.view_state.get("inner_height"))),t=!1,m=this.xmapper.get("mapper_state")[0],v=this.xmapper.get("mapper_state")[0],(Math.abs(this.old_mapper_state.x-m)>1e-8||Math.abs(this.old_mapper_state.y-v)>1e-8)&&(this.old_mapper_state.x=m,this.old_mapper_state.y=v,t=!0),this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(this.view_state.get("border_left"),this.view_state.get("border_top"),this.view_state.get("inner_width"),this.view_state.get("inner_height")),this.ctx.clip(),this.ctx.beginPath(),P=["image","underlay","glyph"],x=0,T=P.length;T>x;x++){o=P[x],p=this.levels[o];for(n in p)y=p[n],y.render(t)}for(this.ctx.restore(),j=["overlay","annotation","tool"],b=0,C=j.length;C>b;b++){o=j[b],p=this.levels[o];for(n in p)y=p[n],y.render(t)}return f?(u=this.view_state.get("outer_width")/2,c=d,this.title_props.set(this.ctx,{}),this.ctx.fillText(f,u,c)):void 0},h}(l.View),f=function(t){function e(){return w=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="GMapPlot",e.prototype.default_view=g,e.prototype.add_renderers=function(t){var e;return e=this.get("renderers"),e=e.concat(t),this.set("renderers",e)},e.prototype.parent_properties=["border_fill","canvas_width","canvas_height","outer_width","outer_height","min_border","min_border_top","min_border_bottom","min_border_left","min_border_right"],e.prototype.defaults=function(){return{data_sources:{},renderers:[],tools:[],title:"GMapPlot"}},e.prototype.display_defaults=function(){return{hidpi:!0,border_fill:"#eee",border_symmetry:"h",min_border:40,x_offset:0,y_offset:0,canvas_width:300,canvas_height:300,outer_width:300,outer_height:300,title_standoff:8,title_text_font:"helvetica",title_text_font_size:"20pt",title_text_font_style:"normal",title_text_color:"#444444",title_text_alpha:1,title_text_align:"center",title_text_baseline:"alphabetic",outline_line_color:"#aaaaaa",outline_line_width:1,outline_line_alpha:1,outline_line_join:"miter",outline_line_cap:"butt",outline_line_dash:[],outline_line_dash_offset:0}},e}(h),y=function(t){function e(){return x=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.model=f,e}(n.Collection),{Model:f,Collection:new y,View:g}})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("common/grid_view_state",["underscore","./safebind","./view_state"],function(e,s,n){var r,o;return r=function(n){function r(){return this.layout_widths=t(this.layout_widths,this),this.layout_heights=t(this.layout_heights,this),this.setup_layout_properties=t(this.setup_layout_properties,this),o=r.__super__.constructor.apply(this,arguments)}return i(r,n),r.prototype.setup_layout_properties=function(){var t,e,i,s,n,r;for(this.register_property("layout_heights",this.layout_heights,!0),this.register_property("layout_widths",this.layout_widths,!0),n=this.get("childviewstates"),r=[],i=0,s=n.length;s>i;i++)t=n[i],r.push(function(){var i,s,n;for(n=[],i=0,s=t.length;s>i;i++)e=t[i],this.add_dependencies("layout_heights",e,"outer_height"),n.push(this.add_dependencies("layout_widths",e,"outer_width"));return n}.call(this));return r},r.prototype.initialize=function(t,i){return r.__super__.initialize.call(this,t,i),this.setup_layout_properties(),s(this,this,"change:childviewstates",this.setup_layout_properties),this.register_property("height",function(){return e.reduce(this.get("layout_heights"),function(t,e){return t+e},0)},!0),this.add_dependencies("height",this,"layout_heights"),this.register_property("width",function(){return e.reduce(this.get("layout_widths"),function(t,e){return t+e},0)},!0),this.add_dependencies("width",this,"layout_widths")},r.prototype.position_child_x=function(t){return t},r.prototype.position_child_y=function(t,e){return this.get("height")-t-e},r.prototype.maxdim=function(t,i){return 0===i.length?0:e.max(e.map(i,function(e){return e.get(t)}))},r.prototype.layout_heights=function(){var t,e;return e=function(){var e,i,s,n;for(s=this.get("childviewstates"),n=[],e=0,i=s.length;i>e;e++)t=s[e],n.push(this.maxdim("outer_height",t));return n}.call(this)},r.prototype.layout_widths=function(){var t,i,s,n,r,o;return r=this.get("childviewstates")[0].length,s=function(){var t,i,s,a;for(s=e.range(r),a=[],t=0,i=s.length;i>t;t++)n=s[t],a.push(function(){var t,e,i,s;for(i=this.get("childviewstates"),s=[],t=0,e=i.length;e>t;t++)o=i[t],s.push(o[n]);return s}.call(this));return a}.call(this),i=function(){var e,i,n;for(n=[],e=0,i=s.length;i>e;e++)t=s[e],n.push(this.maxdim("outer_width",t));return n}.call(this)},r.prototype.defaults=function(){return{childviewstates:[[]],border_space:0}},r}(n)})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("common/grid_plot",["underscore","backbone","./build_views","./safebind","./continuum_view","./has_parent","./grid_view_state","mapper/1d/linear_mapper","mapper/2d/grid_mapper","renderer/properties","tool/active_tool_manager"],function(t,i,s,n,r,o,a,l,h,p,u){var c,_,d,f,g,y;return _=function(r){function o(){return f=o.__super__.constructor.apply(this,arguments)}return e(o,r),o.prototype.tagName="div",o.prototype.className="bokeh grid_plot",o.prototype.default_options={scale:1},o.prototype.set_child_view_states=function(){var t,e,i,s,n,r,o;for(i=[],o=this.mget("children"),n=0,r=o.length;r>n;n++)t=o[n],e=function(){var e,i,n;for(n=[],e=0,i=t.length;i>e;e++)s=t[e],n.push(this.childviews[s.id].view_state);return n}.call(this),i.push(e);return this.viewstate.set("childviewstates",i)},o.prototype.initialize=function(e){return o.__super__.initialize.call(this,t.defaults(e,this.default_options)),this.viewstate=new a,this.toolbar_height=0,this.childviews={},this.build_children(),this.bind_bokeh_events(),this.render(),this},o.prototype.bind_bokeh_events=function(){var t=this;return n(this,this.model,"change:children",this.build_children),n(this,this.model,"change",this.render),n(this,this.viewstate,"change",this.render),n(this,this.model,"destroy",function(){return t.remove()})},o.prototype.b_events={"change:children model":"build_children","change model":"render","change viewstate":"render","destroy model":"remove"},o.prototype.build_children=function(){var t,e,i,n,r,o,a,l;for(t=[],l=this.mget_obj("children"),n=0,o=l.length;o>n;n++)for(i=l[n],r=0,a=i.length;a>r;r++)e=i[r],t.push(e);return s(this.childviews,t,{}),this.set_child_view_states()},o.prototype.makeButton=function(e,i,s,n){var r,o,a,l,h;return r=t.flatten(t.map(t.pluck(this.childviews,"tools"),t.values)),l=t.where(r,{constructor:i}),o=$("<button class='btn btn-small'>"+n+"</button>"),s.append(o),h=!1,a=!1,o.click(function(){return a?e.trigger("clear_active_tool"):e.trigger("active_tool",n)}),e.on(""+n+":deactivated",function(){return o.removeClass("active"),a=!1,t.each(l,function(t){var e;return e=t.evgen.toolName,t.evgen.eventSink.trigger(""+e+":deactivated")})}),e.on(""+n+":activated",function(){return o.addClass("active"),a=!0,t.each(l,function(t){var e;return e=t.evgen.toolName,t.evgen.eventSink.trigger(""+e+":activated")})})},o.prototype.addGridToolbar=function(){var e,s,n,r=this;return this.button_bar=$("<div class='grid_button_bar'/>"),this.button_bar.attr("style","position:absolute; left:10px; top:5px; "),this.toolEventSink=t.extend({},i.Events),this.atm=new u(this.toolEventSink),this.atm.bind_bokeh_events(),this.$el.append(this.button_bar),s=t.flatten(t.map(t.pluck(this.childviews,"tools"),t.values)),e=t.uniq(t.pluck(s,"constructor")),e.length>0&&(this.toolbar_height=20),n={},t.each(e,function(e){var i;return i=t.where(s,{constructor:e})[0].evgen_options.buttonText,n[i]=e}),t.map(n,function(t,e){return r.makeButton(r.toolEventSink,t,r.button_bar,e)}),t.map(s,function(t){return t.evgen.hide_button()})},o.prototype.render=function(){var e,i,s,n,r,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T,C,M,z;for(o.__super__.render.call(this),M=t.values(this.childviews),w=0,k=M.length;k>w;w++)d=M[w],d.$el.detach();for(this.$el.html(""),this.addGridToolbar(),c=this.viewstate.get("layout_heights"),s=this.viewstate.get("layout_widths"),m=[0],t.reduceRight(c.slice(1),function(t,e){var i;return i=t+e,m.push(i),i},0),m.reverse(),g=[0],t.reduce(s.slice(0),function(t,e){var i;return i=t+e,g.push(i),i},0),a=[],r=null,z=this.mget("children"),p=x=0,T=z.length;T>x;p=++x)for(u=z[p],i=b=0,C=u.length;C>b;i=++b)h=u[i],d=this.childviews[h.id],v=this.viewstate.position_child_y(m[p],d.view_state.get("outer_height")-this.toolbar_height),y=this.viewstate.position_child_x(g[i],d.view_state.get("outer_width")),l=$("<div class='gp_plotwrapper'></div>"),l.attr("style","position: absolute; left:"+y+"px; top:"+v+"px"),l.append(d.$el),this.$el.append(l);return e=function(t,e){return t+e},_=t.reduce(c,e,0),n=_+this.toolbar_height,f=this.viewstate.get("outerwidth"),this.$el.attr("style","position:relative; height:"+n+"px;width:"+f+"px"),this.render_end()},o}(r.View),c=function(t){function i(){return g=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.type="GridPlot",i.prototype.default_view=_,i.prototype.defaults=function(){return{children:[[]],border_space:0}},i}(o),d=function(t){function i(){return y=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=c,i}(i.Collection),{Model:c,Collection:new d,View:_}})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("common/plot_context",["underscore","backbone","./build_views","./safebind","./has_parent","./continuum_view"],function(s,n,r,o,a,l){var h,p,u,c,_,d;return p=function(n){function a(){return this.removeplot=t(this.removeplot,this),this.closeall=t(this.closeall,this),c=a.__super__.constructor.apply(this,arguments)}return i(a,n),a.prototype.initialize=function(t){return this.views={},this.views_rendered=[!1],this.child_models=[],a.__super__.initialize.call(this,t),this.render()},a.prototype.delegateEvents=function(){return o(this,this.model,"destroy",this.remove),o(this,this.model,"change",this.render),a.__super__.delegateEvents.call(this)},a.prototype.build_children=function(){var t;return t=r(this.views,this.mget_obj("children"),{}),window.pc_created_views=t,window.pc_views=this.views,null},a.prototype.events={"click .plotclose":"removeplot","click .closeall":"closeall"},a.prototype.size_textarea=function(t){var e;return e=$(t).height(0).prop("scrollHeight"),$(t).height(e)},a.prototype.closeall=function(){return this.mset("children",[]),this.model.save()},a.prototype.removeplot=function(t){var e,i,s,n,r;return i=parseInt($(t.currentTarget).parent().attr("data-plot_num")),s=this.model.resolve_ref(this.mget("children")[i]),n=this.views[s.get("id")],n.remove(),e=function(){var t,e,i,s;for(i=this.mget("children"),s=[],t=0,e=i.length;e>t;t++)r=i[t],r.id!==n.model.id&&s.push(r);return s}.call(this),this.mset("children",e),this.model.save(),!1},a.prototype.render=function(){var t,i,n,r,o,l,h,p,u,c,_,d,f,g=this;a.__super__.render.call(this),this.build_children(),d=this.views;for(i in d)e.call(d,i)&&(p=d[i],p.$el.detach());for(this.$el.html(""),o=s.keys(this.views).length,this.$el.append("<div>You have "+o+" plots</div>"),this.$el.append("<div><a class='closeall' href='#'>Close All Plots</a></div>"),this.$el.append("<br/>"),h=[],l={},f=this.mget("children"),t=c=0,_=f.length;_>c;t=++c)n=f[t],u=this.views[n.id],r=$("<div class='jsp' data-plot_num='"+t+"'></div>"),this.$el.append(r),r.append($("<a class='plotclose'>[close]</a>")),r.append(u.el);return s.defer(function(){var t,e,i,s,n;for(s=g.$el.find(".plottitle"),n=[],e=0,i=s.length;i>e;e++)t=s[e],n.push(g.size_textarea($(t)));return n}),null},a}(l.View),h=function(t){function e(){return _=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="PlotContext",e.prototype.default_view=p,e.prototype.url=function(){return e.__super__.url.call(this)},e.prototype.defaults=function(){return{children:[],render_loop:!0}},e}(a),u=function(t){function e(){return d=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.model=h,e}(n.Collection),{Model:h,Collection:new u,View:p}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("range/data_range1d",["underscore","backbone","range/range1d"],function(t,i,s){var n,r,o,a;return n=function(i){function s(){return o=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.type="DataRange1d",s.prototype._get_minmax=function(){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b;for(s=[],y=this.get("sources"),c=0,f=y.length;f>c;c++)for(h=y[c],p=this.resolve_ref(h.ref),m=h.columns,_=0,g=m.length;g>_;_++)i=m[_],s.push(p.getcolumn(i));if(s=t.reduce(s,function(t,e){return t.concat(e)},[]),s=t.filter(s,function(t){return"string"!=typeof t}),t.isArray(s[0])){for(o=Array(s.length),l=Array(s.length),n=d=0,w=s.length-1;w>=0?w>=d:d>=w;n=w>=0?++d:--d)s[n]=t.reject(s[n],function(t){return isNaN(t)}),o[n]=t.max(s[n]),l[n]=t.min(s[n]);x=[t.min(l),t.max(o)],a=x[0],r=x[1]}else s=t.reject(s,function(t){return isNaN(t)}),v=[t.min(s),t.max(s)],a=v[0],r=v[1];return u=r!==a?(r-a)*(1+this.get("rangepadding")):0!==r?r*(1+this.get("rangepadding")):2,e=(r+a)/2,b=[e-u/2,e+u/2],a=b[0],r=b[1],[a,r]},s.prototype._get_start=function(){return t.isNullOrUndefined(this.get("_start"))?this.get("minmax")[0]:this.get("_start")},s.prototype._set_start=function(t){return this.set("_start",t)},s.prototype._get_end=function(){return t.isNullOrUndefined(this.get("_end"))?this.get("minmax")[1]:this.get("_end")},s.prototype._set_end=function(t){return this.set("_end",t)},s.prototype.dinitialize=function(t,e){var i,n,r,o;for(this.register_property("minmax",this._get_minmax,!0),this.add_dependencies("minmax",this,["sources"],["rangepadding"]),o=this.get("sources"),n=0,r=o.length;r>n;n++)i=o[n],i=this.resolve_ref(i.ref),this.add_dependencies("minmax",i,"data");return this.register_property("start",this._get_start,!0),this.register_setter("start",this._set_start),this.add_dependencies("start",this,["minmax","_start"]),this.register_property("end",this._get_end,!0),this.register_setter("end",this._set_end),this.add_dependencies("end",this,["minmax","_end"]),s.__super__.dinitialize.call(this,t,e)},s.prototype.defaults=function(){return{sources:[],rangepadding:.1}},s}(s.Model),r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=n,i}(i.Collection),{Model:n,Collection:new r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("range/factor_range",["backbone","common/has_properties"],function(t,i){var s,n,r,o;return s=function(t){function i(){return r=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.type="FactorRange",i.prototype.defaults=function(){return{values:[]}},i}(i),n=function(t){function i(){return o=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=s,i}(t.Collection),{Model:s,Collection:new n}})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("range/data_factor_range",["underscore","backbone","range/factor_range"],function(e,s,n){var r,o,a,l;return r=function(s){function n(){return this._get_values=t(this._get_values,this),a=n.__super__.constructor.apply(this,arguments)}return i(n,s),n.prototype.type="DataFactorRange",n.prototype._get_values=function(){var t,i,s,n,r,o,a;for(t=function(){var t,e,i,s;for(i=this.get("columns"),s=[],t=0,e=i.length;e>t;t++)r=i[t],s.push(this.get_obj("data_source").getcolumn(r));return s}.call(this),t=e.reduce(t,function(t,e){return t.concat(e)},[]),i={},o=0,a=t.length;a>o;o++)n=t[o],i[n]=!0;return s=e.keys(i),s=e.sortBy(s,function(t){return t})},n.prototype.dinitialize=function(t,e){return n.__super__.dinitialize.call(this,t,e),this.register_property,this.register_property("values",this._get_values,!0),this.add_dependencies("values",this,["data_source","columns"]),this.add_dependencies("values",this.get_obj("data_source"),["data_source","columns"])},n.prototype.defaults=function(){return{values:[],columns:[],data_source:null}},n}(n.Model),o=function(t){function e(){return l=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.model=r,e}(s.Collection),{Model:r,Collection:new o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("common/plot_widget",["./continuum_view","./safebind"],function(t){var i,s;return i=function(t){function i(){return s=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.tagName="div",i.prototype.initialize=function(t){return this.plot_model=t.plot_model,this.plot_view=t.plot_view,this._fixup_line_dash(this.plot_view.ctx),this._fixup_line_dash_offset(this.plot_view.ctx),this._fixup_image_smoothing(this.plot_view.ctx),this._fixup_measure_text(this.plot_view.ctx),i.__super__.initialize.call(this,t)},i.prototype._fixup_line_dash=function(t){return t.setLineDash||(t.setLineDash=function(e){return t.mozDash=e,t.webkitLineDash=e}),t.getLineDash?void 0:t.getLineDash=function(){return t.mozDash}},i.prototype._fixup_line_dash_offset=function(t){return t.setLineDashOffset=function(e){return t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e}},i.prototype._fixup_image_smoothing=function(t){return t.setImageSmoothingEnabled=function(e){return t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e;return null!=(e=t.imageSmoothingEnabled)?e:!0}},i.prototype._fixup_measure_text=function(t){return t.measureText&&null==t.html5MeasureText?(t.html5MeasureText=t.measureText,t.measureText=function(e){var i;return i=t.html5MeasureText(e),i.ascent=1.6*t.html5MeasureText("m").width,i}):void 0},i.prototype.bind_bokeh_events=function(){},i.prototype.request_render=function(){return this.plot_view.request_render()},i}(t.View)})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/glyph",["underscore","common/has_parent","common/plot_widget"],function(t,i,s){var n,r,o,a;return r=function(i){function s(){return o=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){return s.__super__.initialize.call(this,t),this.need_set_data=!0},s.prototype.set_data=function(t){var e,i;return null==t&&(t=!0),i=this.mget_obj("data_source"),"ObjectArrayDataSource"===i.type?e=i.get("data"):"ColumnDataSource"===i.type?e=i.datapoints():"PandasPlotSource"===i.type?e=i.datapoints():console.log("Unknown data source type: "+i.type),this._set_data(e),t?this.request_render():void 0},s.prototype.render=function(t){return null==t&&(t=!0),this.need_set_data&&(this.set_data(!1),this.need_set_data=!1),this._render(this.plot_view,t)},s.prototype.select=function(){return"pass"},s.prototype.xrange=function(){return this.plot_view.x_range},s.prototype.yrange=function(){return this.plot_view.y_range},s.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.request_render),this.listenTo(this.mget_obj("data_source"),"change",this.set_data)},s.prototype.distance=function(t,e,i,s){var n,r,o,a,l,h,p,u,c,_,d;return p=this.glyph_props[e].units,c=this.glyph_props[i].units,"x"===e?a=this.plot_view.xmapper:"y"===e&&(a=this.plot_view.ymapper),i=this.glyph_props.v_select(i,t),"screen"===c?i:("center"===s?(r=function(){var t,e,s;for(s=[],t=0,e=i.length;e>t;t++)n=i[t],s.push(n/2);return s}(),u=this.glyph_props.v_select(e,t),"screen"===p&&(u=a.v_map_from_target(u)),l=function(){var t,e,i;for(i=[],o=t=0,e=u.length-1;e>=0?e>=t:t>=e;o=e>=0?++t:--t)i.push(u[o]-r[o]);return i}(),h=function(){var t,e,i;for(i=[],o=t=0,e=u.length-1;e>=0?e>=t:t>=e;o=e>=0?++t:--t)i.push(u[o]+r[o]);return i}()):(l=this.glyph_props.v_select(e,t),"screen"===p&&(l=a.v_map_from_target(l)),h=function(){var t,e,s;for(s=[],o=t=0,e=l.length-1;e>=0?e>=t:t>=e;o=e>=0?++t:--t)s.push(l[o]+i[o]);return s}()),_=a.v_map_to_target(l),d=a.v_map_to_target(h),function(){var t,e,i;for(i=[],o=t=0,e=_.length-1;e>=0?e>=t:t>=e;o=e>=0?++t:--t)i.push(d[o]-_[o]);return i}())},s.prototype.get_reference_point=function(){var e;return e=this.mget("reference_point"),t.isNumber(e)?this.data[e]:e},s.prototype.draw_legend=function(){},s}(s),n=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.defaults=function(){return{data_source:null}},i.prototype.display_defaults=function(){return{level:"glyph",radius_units:"screen",length_units:"screen",angle_units:"deg",start_angle_units:"deg",end_angle_units:"deg"}},i}(i),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/annular_wedge",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,e)},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","inner_radius","outer_radius","start_angle","end_angle","direction:string"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s,n,r,o,a,l,h,p,u,c;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),r=this.glyph_props.v_select("start_angle",t),this.start_angle=function(){var t,i,s;
for(s=[],t=0,i=r.length;i>t;t++)e=r[t],s.push(-e);return s}(),s=this.glyph_props.v_select("end_angle",t),this.end_angle=function(){var t,i,n;for(n=[],t=0,i=s.length;i>t;t++)e=s[t],n.push(-e);return n}(),this.angle=new Float32Array(this.start_angle.length),n=o=0,h=this.start_angle.length-1;h>=0?h>=o:o>=h;n=h>=0?++o:--o)this.angle[n]=this.end_angle[n]-this.start_angle[n];for(this.direction=new Uint8Array(this.data.length),n=a=0,p=this.data.length-1;p>=0?p>=a:a>=p;n=p>=0?++a:--a)i=this.glyph_props.select("direction",t[n]),this.direction[n]="clock"===i?!1:"anticlock"===i?!0:0/0;for(this.selected_mask=new Uint8Array(t.length),c=[],n=l=0,u=this.selected_mask.length-1;u>=0?u>=l:l>=u;n=u>=0?++l:--l)c.push(this.selected_mask[n]=!1);return c},s.prototype._render=function(){var t,e,i,s,n,r,o;for(o=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=o[0],this.sy=o[1],this.inner_radius=this.distance(this.data,"x","inner_radius","edge"),this.outer_radius=this.distance(this.data,"x","outer_radius","edge"),t=this.plot_view.ctx,t.save(),s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return this.glyph_props.fast_path?this._fast_path(t):s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(t,i,"selected"),this._full_path(t,this.nonselection_glyphprops,"unselected")):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r;if(this.do_fill)for(this.glyph_props.fill_properties.set(t,this.glyph_props),e=i=0,n=this.sx.length-1;n>=0?n>=i:i>=n;e=n>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.inner_radius[e]+this.outer_radius[e]+this.start_angle[e]+this.end_angle[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.start_angle[e]),t.moveTo(this.outer_radius[e],0),t.beginPath(),t.arc(0,0,this.outer_radius[e],0,this.angle[e],this.direction[e]),t.rotate(this.angle[e]),t.lineTo(this.inner_radius[e],0),t.arc(0,0,this.inner_radius[e],0,-this.angle[e],!this.direction[e]),t.closePath(),t.fill(),t.rotate(-this.angle[e]-this.start_angle[e]),t.translate(-this.sx[e],-this.sy[e]));if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.inner_radius[e]+this.outer_radius[e]+this.start_angle[e]+this.end_angle[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.start_angle[e]),t.moveTo(this.outer_radius[e],0),t.arc(0,0,this.outer_radius[e],0,this.angle[e],this.direction[e]),t.rotate(this.angle[e]),t.lineTo(this.inner_radius[e],0),t.arc(0,0,this.inner_radius[e],0,-this.angle[e],!this.direction[e]),t.closePath(),t.rotate(-this.angle[e]-this.start_angle[e]),t.translate(-this.sx[e],-this.sy[e]));return t.stroke()}},s.prototype._full_path=function(t,e,i){var s,n,r,o;for(e||(e=this.glyph_props),o=[],s=n=0,r=this.sx.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)isNaN(this.sx[s]+this.sy[s]+this.inner_radius[s]+this.outer_radius[s]+this.start_angle[s]+this.end_angle[s])||("selected"!==i||this.selected_mask[s])&&("unselected"===i&&this.selected_mask[s]||(t.translate(this.sx[s],this.sy[s]),t.rotate(this.start_angle[s]),t.moveTo(this.outer_radius[s],0),t.beginPath(),t.arc(0,0,this.outer_radius[s],0,this.angle[s],this.direction[s]),t.rotate(this.angle[s]),t.lineTo(this.inner_radius[s],0),t.arc(0,0,this.inner_radius[s],0,-this.angle[s],!this.direction[s]),t.closePath(),t.rotate(-this.angle[s]-this.start_angle[s]),t.translate(-this.sx[s],-this.sy[s]),this.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),this.do_stroke?(e.line_properties.set(t,this.data[s]),o.push(t.stroke())):o.push(void 0)));return o},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b;return c=this.glyph_props,f=c.line_properties,u=c.fill_properties,e.save(),v=this.get_reference_point(),null!=v?(_=v,g=this.distance([v],"x","outer_radius","edge"),g=g[0],d=this.distance([v],"x","inner_radius","edge"),d=d[0],w=-this.glyph_props.select("start_angle",v),p=-this.glyph_props.select("end_angle",v)):(_=c,w=-.1,p=-3.9),o=p-w,h=this.glyph_props.select("direction",_),h="clock"===h?!1:!0,a=f.select(f.line_width_name,_),l=t.min([Math.abs(s-i),Math.abs(r-n)]),l-=2*a,y=l/2,null!=g||null!=d?(m=y/g,g=y,d*=m):(g=y,d=y/2),x=(i+s)/2,b=(n+r)/2,e.translate(x,b),e.rotate(w),e.moveTo(g,0),e.beginPath(),e.arc(0,0,g,0,o,h),e.rotate(o),e.lineTo(d,0),e.arc(0,0,d,0,-o,!h),e.closePath(),u.do_fill&&(u.set(e,_),e.fill()),f.do_stroke&&(f.set(e,_),e.stroke()),e.restore()},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{direction:"anticlock",fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/annulus",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,e)},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","inner_radius","outer_radius"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s,n;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.selected_mask=new Uint8Array(t.length),n=[],e=i=0,s=this.selected_mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)n.push(this.selected_mask[e]=!1);return n},s.prototype._render=function(){var t,e,i,s,n,r,o;for(o=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=o[0],this.sy=o[1],this.inner_radius=this.distance(this.data,"x","inner_radius","edge"),this.outer_radius=this.distance(this.data,"x","outer_radius","edge"),t=this.plot_view.ctx,t.save(),s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return this.glyph_props.fast_path?this._fast_path(t):(s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(t,i,"selected"),this._full_path(t,this.nonselection_glyphprops,"unselected")):this._full_path(t),t.restore())},s.prototype._fast_path=function(t){var e,i,s,n,r,o;if(this.do_fill)for(this.glyph_props.fill_properties.set(t,this.glyph_props),e=i=0,n=this.sx.length-1;n>=0?n>=i:i>=n;e=n>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.inner_radius[e]+this.outer_radius[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.inner_radius[e],0,2*2*Math.PI,!1),t.arc(this.sx[e],this.sy[e],this.outer_radius[e],0,2*2*Math.PI,!0),t.fill());if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),o=[],e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.inner_radius[e]+this.outer_radius[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.inner_radius[e],0,2*2*Math.PI,!1),t.stroke(),t.beginPath(),t.arc(this.sx[e],this.sy[e],this.outer_radius[e],0,2*2*Math.PI,!0),o.push(t.stroke()));return o}},s.prototype._full_path=function(t,e,i){var s,n,r,o;for(e||(e=this.glyph_props),o=[],s=n=0,r=this.sx.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)isNaN(this.sx[s]+this.sy[s]+this.inner_radius[s]+this.outer_radius[s])||("selected"!==i||this.selected_mask[s])&&("unselected"===i&&this.selected_mask[s]||(t.beginPath(),t.arc(this.sx[s],this.sy[s],this.inner_radius[s],0,2*2*Math.PI,!1),t.moveTo(this.sx[s]+this.outer_radius[s],this.sy[s]),t.arc(this.sx[s],this.sy[s],this.outer_radius[s],0,2*2*Math.PI,!0),this.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),this.do_stroke?(e.line_properties.set(t,this.data[s]),o.push(t.stroke())):o.push(void 0)));return o},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g,y,m;return h=this.glyph_props,c=h.line_properties,l=h.fill_properties,e.save(),g=this.get_reference_point(),null!=g?(p=g,_=this.distance([g],"x","outer_radius","edge"),_=_[0],u=this.distance([g],"x","inner_radius","edge"),u=u[0]):p=h,o=c.select(c.line_width_name,p),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,d=a/2,null!=_||null!=u?(f=d/_,_=d,u*=f):(_=d,u=d/2),y=(i+s)/2,m=(n+r)/2,e.beginPath(),e.arc(y,m,u,0,2*2*Math.PI,!1),e.moveTo(y+_,m),e.arc(y,m,_,0,2*2*Math.PI,!0),l.do_fill&&(l.set(e,p),e.fill()),c.do_stroke&&(c.set(e,p),e.stroke()),e.restore()},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/arc",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(i){function s(){return l=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["x","y","radius","start_angle","end_angle","direction:string"],{line_properties:new a(this,e)}),this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,t)},s.prototype._set_data=function(t){var e,i,s,n,r,o,a,l;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),r=this.glyph_props.v_select("start_angle",t),this.start_angle=function(){var t,i,s;for(s=[],t=0,i=r.length;i>t;t++)e=r[t],s.push(-e);return s}(),s=this.glyph_props.v_select("end_angle",t),this.end_angle=function(){var t,i,n;for(n=[],t=0,i=s.length;i>t;t++)e=s[t],n.push(-e);return n}(),this.direction=new Uint8Array(this.data.length),l=[],n=o=0,a=this.data.length-1;a>=0?a>=o:o>=a;n=a>=0?++o:--o)i=this.glyph_props.select("direction",t[n]),"clock"===i?l.push(this.direction[n]=!1):"anticlock"===i?l.push(this.direction[n]=!0):l.push(this.direction[n]=0/0);return l},s.prototype._render=function(){var t,e;return e=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=e[0],this.sy=e[1],this.radius=this.distance(this.data,"x","radius","edge"),t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n;if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),n=[],e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.radius[e]+this.start_angle[e]+this.end_angle[e]+this.direction[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.radius[e],this.start_angle[e],this.end_angle[e],this.direction[e]),n.push(t.stroke()));return n}},s.prototype._full_path=function(t){var e,i,s,n;if(this.do_stroke){for(n=[],e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.radius[e]+this.start_angle[e]+this.end_angle[e]+this.direction[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.radius[e],this.start_angle[e],this.end_angle[e],this.direction[e]),this.glyph_props.line_properties.set(t,this.data[e]),n.push(t.stroke()));return n}},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g;return u=this.glyph_props,_=u.line_properties,e.save(),f=this.get_reference_point(),null!=f?(c=f,l=this.distance([f],"x","radius","edge")[0],g=-this.glyph_props.select("start_angle",f),p=-this.glyph_props.select("end_angle",f)):(c=u,g=-.1,p=-3.9),h=this.glyph_props.select("direction",c),h="clock"===h?!1:!0,o=_.select(_.line_width_name,c),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,d=a/2,null!=l&&(d=l>d?d:l),e.arc((i+s)/2,(n+r)/2,d,g,p,h),_.set(e,c),_.do_stroke&&(_.set(e,c),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{direction:"anticlock",line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/asterisk",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","size"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},s.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},s.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l;if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),l=[],s=o=0,a=this.sx.length-1;a>=0?a>=o:o>=a;s=a>=0?++o:--o)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,r=.65*n,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),t.moveTo(this.sx[s]-r,this.sy[s]+r),t.lineTo(this.sx[s]+r,this.sy[s]-r),t.moveTo(this.sx[s]-r,this.sy[s]-r),t.lineTo(this.sx[s]+r,this.sy[s]+r),l.push(t.stroke())));return l}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a,l;for(e||(e=this.glyph_props),l=[],s=o=0,a=this.sx.length-1;a>=0?a>=o:o>=a;s=a>=0?++o:--o)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,r=.65*n,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),t.moveTo(this.sx[s]-r,this.sy[s]+r),t.lineTo(this.sx[s]+r,this.sy[s]-r),t.moveTo(this.sx[s]-r,this.sy[s]-r),t.lineTo(this.sx[s]+r,this.sy[s]+r),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),l.push(t.stroke())):l.push(void 0)));return l},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g;return p=this.glyph_props,c=p.line_properties,h=p.fill_properties,e.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","edge")[0]):(u=p,l=p.select("size",p)["default"]),o=c.select(c.line_width_name,u),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,_=a/2,null!=l&&(_=l>_?_:l),_=.65*_,f=(i+s)/2,g=(n+r)/2,e.moveTo(f,g+_),e.lineTo(f,g-_),e.moveTo(f-_,g),e.lineTo(f+_,g),e.moveTo(f-r2,g+r2),e.lineTo(f+r2,g-r2),e.moveTo(f-r2,g-r2),e.lineTo(f+r2,g+r2),c.do_stroke&&(c.set(e,u),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/bezier",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["x0","y0","x1","y1","cx0","cy0","cx1","cy1"],{line_properties:new a(this,e)}),this.do_stroke=this.glyph_props.line_properties.do_stroke,i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){return this.data=t,this.x0=this.glyph_props.v_select("x0",t),this.y0=this.glyph_props.v_select("y0",t),this.x1=this.glyph_props.v_select("x1",t),this.y1=this.glyph_props.v_select("y1",t),this.cx0=this.glyph_props.v_select("cx0",t),this.cy0=this.glyph_props.v_select("cy0",t),this.cx1=this.glyph_props.v_select("cx1",t),this.cy1=this.glyph_props.v_select("cy1",t)},i.prototype._render=function(){var t,e,i,s,n;return e=this.plot_view.map_to_screen(this.x0,this.glyph_props.x0.units,this.y0,this.glyph_props.y0.units),this.sx0=e[0],this.sy0=e[1],i=this.plot_view.map_to_screen(this.x1,this.glyph_props.x1.units,this.y1,this.glyph_props.y1.units),this.sx1=i[0],this.sy1=i[1],s=this.plot_view.map_to_screen(this.cx0,this.glyph_props.cx0.units,this.cy0,this.glyph_props.cy0.units),this.scx0=s[0],this.scy0=s[1],n=this.plot_view.map_to_screen(this.cx1,this.glyph_props.cx1.units,this.cy1,this.glyph_props.cy1.units),this.scx1=n[0],this.scy1=n[1],t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},i.prototype._fast_path=function(t){var e,i,s;if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e]+this.scx0[e]+this.scy0[e]+this.scx1[e]+this.scy1[e])||(t.moveTo(this.sx0[e],this.sy0[e]),t.bezierCurveTo(this.scx0[e],this.scy0[e],this.scx1[e],this.scy1[e],this.sx1[e],this.sy1[e]));return t.stroke()}},i.prototype._full_path=function(t){var e,i,s,n;if(this.do_stroke){for(n=[],e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e]+this.scx0[e]+this.scy0[e]+this.scx1[e]+this.scy1[e])||(t.beginPath(),t.moveTo(this.sx0[e],this.sy0[e]),t.bezierCurveTo(this.scx0[e],this.scy0[e],this.scx1[e],this.scy1[e],this.sx1[e],this.sy1[e]),this.glyph_props.line_properties.set(t,this.data[e]),n.push(t.stroke()));return n}},i}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/circle",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","radius"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},s.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_,d;for(null==e&&(e=!0),_=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=_[0],this.sy=_[1],a=this.plot_view.view_state.get("outer_width"),o=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.radius=this.distance(this.data,"x","radius","edge"),this.have_new_data=!1),a=this.plot_view.view_state.get("outer_width"),o=this.plot_view.view_state.get("outer_height"),n=p=0,d=this.mask.length-1;d>=0?d>=p:p>=d;n=d>=0?++p:--p)this.mask[n]=this.sx[n]+this.radius[n]<0||this.sx[n]-this.radius[n]>a||this.sy[n]+this.radius[n]<0||this.sy[n]-this.radius[n]>o?!1:!0;for(s=this.mget_obj("data_source"),h=s.get("selected"),u=0,c=h.length;c>u;u++)r=h[u],this.selected_mask[r]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?h&&h.length&&this.nonselection_glyphprops?(l=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,l,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):h&&h.length&&this.nonselection_glyphprops?(l=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,l,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},s.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),s=n=0,o=this.sx.length-1;o>=0?o>=n:n>=o;s=o>=0?++n:--n)!isNaN(this.sx[s]+this.sy[s]+this.radius[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.moveTo(this.sx[s],this.sy[s]),t.arc(this.sx[s],this.sy[s],this.radius[s],0,2*Math.PI,!1)));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),l=[],s=r=0,a=this.sx.length-1;a>=0?a>=r:r>=a;s=a>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.radius[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.moveTo(this.sx[s],this.sy[s]),t.beginPath(),t.arc(this.sx[s],this.sy[s],this.radius[s],0,2*Math.PI,!1),l.push(t.stroke())));return l}},s.prototype._full_path=function(t,e,i){var s,n,r,o;for(e||(e=this.glyph_props),o=[],s=n=0,r=this.sx.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)!isNaN(this.sx[s]+this.sy[s]+this.radius[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.beginPath(),t.arc(this.sx[s],this.sy[s],this.radius[s],0,2*Math.PI,!1),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),o.push(t.stroke())):o.push(void 0)));return o},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d;return p=this.glyph_props,c=p.line_properties,h=p.fill_properties,e.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","radius","edge")[0]):(u=p,l=p.select("radius",p)["default"]),o=c.select(c.line_width_name,u),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,_=a/2,null!=l&&(_=l>_?_:l),e.arc((i+s)/2,(n+r)/2,_,2*Math.PI,!1),h.do_fill&&(h.set(e,u),e.fill()),c.do_stroke&&(c.set(e,u),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/circle_x",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","size"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},s.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},s.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l,h;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),s=r=0,a=this.sx.length-1;a>=0?a>=r:r>=a;s=a>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.moveTo(this.sx[s],this.sy[s]),t.arc(this.sx[s],this.sy[s],this.size[s],0,2*Math.PI,!1)));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),h=[],s=o=0,l=this.sx.length-1;l>=0?l>=o:o>=l;s=l>=0?++o:--o)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.moveTo(this.sx[s],this.sy[s]),t.beginPath(),n=this.size[s]/2,t.arc(this.sx[s],this.sy[s],n,0,2*Math.PI,!1),t.moveTo(this.sx[s]-n,this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]-n),t.lineTo(this.sx[s]+n,this.sy[s]+n),h.push(t.stroke())));
return h}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.beginPath(),n=this.size[s]/2,t.arc(this.sx[s],this.sy[s],n,0,2*Math.PI,!1),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),t.moveTo(this.sx[s]-n,this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]-n),t.lineTo(this.sx[s]+n,this.sy[s]+n),a.push(t.stroke())):a.push(void 0)));return a},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d;return p=this.glyph_props,c=p.line_properties,h=p.fill_properties,e.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","edge")[0]):(u=p,l=p.select("size",p)["default"]),o=c.select(c.line_width_name,u),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,_=a/2,null!=l&&(_=l>_?_:l),e.arc((i+s)/2,(n+r)/2,_,2*Math.PI,!1),h.do_fill&&(h.set(e,u),e.fill()),c.do_stroke&&(c.set(e,u),e.moveTo(x-_,y+_),e.lineTo(x+_,y-_),e.moveTo(x-_,y-_),e.lineTo(x+_,y+_),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/circle_cross",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","size"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},s.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},s.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l,h;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),s=r=0,a=this.sx.length-1;a>=0?a>=r:r>=a;s=a>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.moveTo(this.sx[s],this.sy[s]),t.arc(this.sx[s],this.sy[s],this.size[s],0,2*Math.PI,!1)));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),h=[],s=o=0,l=this.sx.length-1;l>=0?l>=o:o>=l;s=l>=0?++o:--o)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.moveTo(this.sx[s],this.sy[s]),t.beginPath(),n=this.size[s]/2,t.arc(this.sx[s],this.sy[s],n,0,2*Math.PI,!1),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),h.push(t.stroke())));return h}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(t.beginPath(),n=this.size[s]/2,t.arc(this.sx[s],this.sy[s],n,0,2*Math.PI,!1),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),a.push(t.stroke())):a.push(void 0)));return a},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d;return p=this.glyph_props,c=p.line_properties,h=p.fill_properties,e.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","edge")[0]):(u=p,l=p.select("size",p)["default"]),o=c.select(c.line_width_name,u),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,_=a/2,null!=l&&(_=l>_?_:l),e.arc((i+s)/2,(n+r)/2,_,2*Math.PI,!1),h.do_fill&&(h.set(e,u),e.fill()),c.do_stroke&&(c.set(e,u),e.moveTo(x,y+_),e.lineTo(x,y-_),e.moveTo(x-_,y),e.lineTo(x+_,y),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/diamond",["underscore","renderer/properties","./glyph"],function(t,s,n){var r,o,a,l,h,p,u;return l=s.glyph_properties,h=s.line_properties,a=s.fill_properties,o=function(s){function n(){return p=n.__super__.constructor.apply(this,arguments)}return e(n,s),n.prototype.initialize=function(e){var i;return n.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},n.prototype.init_glyph=function(t){var e;return e=new l(this,t,["x","y","size"],{fill_properties:new a(this,t),line_properties:new h(this,t)})},n.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},n.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},n.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l,h;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),s=r=0,a=this.sx.length-1;a>=0?a>=r:r>=a;s=a>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]),t.lineTo(this.sx[s],this.sy[s]-n),t.lineTo(this.sx[s]-n,this.sy[s]),t.closePath()));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),h=[],s=o=0,l=this.sx.length-1;l>=0?l>=o:o>=l;s=l>=0?++o:--o)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]),t.lineTo(this.sx[s],this.sy[s]-n),t.lineTo(this.sx[s]-n,this.sy[s]),t.closePath(),h.push(t.stroke())));return h}},n.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]),t.lineTo(this.sx[s],this.sy[s]-n),t.lineTo(this.sx[s]-n,this.sy[s]),t.closePath(),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),a.push(t.stroke())):a.push(void 0)));return a},n.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},n.prototype.draw_legend=function(e,s,n,r,o){var a,l,h,p,u,c,_,d,f,g,y;return u=this.glyph_props,_=u.line_properties,p=u.fill_properties,e.save(),f=this.get_reference_point(),null!=f?(c=f,h=this.distance([f],"x","size","edge")[0]):(c=u,h=u.select("size",u)["default"]),a=_.select(_.line_width_name,c),l=t.min([Math.abs(n-s),Math.abs(o-r)]),l-=2*a,d=l/2,null!=h&&(d=h>d?d:h),d=this.size[i]/2,g=(s+n)/2,y=(r+o)/2,e.beginPath(),e.moveTo(g,y+d),e.lineTo(g+d,y),e.lineTo(g,y-d),e.lineTo(g-d,y),e.closePath(),p.do_fill&&(p.set(e,c),e.fill()),_.do_stroke&&(_.set(e,c),e.stroke()),e.restore()},n}(n.View),r=function(i){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=o,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(n.Model),{Model:r,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/diamond_cross",["underscore","renderer/properties","./glyph"],function(t,s,n){var r,o,a,l,h,p,u;return l=s.glyph_properties,h=s.line_properties,a=s.fill_properties,o=function(s){function n(){return p=n.__super__.constructor.apply(this,arguments)}return e(n,s),n.prototype.initialize=function(e){var i;return n.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},n.prototype.init_glyph=function(t){var e;return e=new l(this,t,["x","y","size"],{fill_properties:new a(this,t),line_properties:new h(this,t)})},n.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},n.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},n.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l,h;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),s=r=0,a=this.sx.length-1;a>=0?a>=r:r>=a;s=a>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]),t.lineTo(this.sx[s],this.sy[s]-n),t.lineTo(this.sx[s]-n,this.sy[s]),t.closePath()));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),h=[],s=o=0,l=this.sx.length-1;l>=0?l>=o:o>=l;s=l>=0?++o:--o)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]),t.lineTo(this.sx[s],this.sy[s]-n),t.lineTo(this.sx[s]-n,this.sy[s]),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),t.closePath(),h.push(t.stroke())));return h}},n.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]),t.lineTo(this.sx[s],this.sy[s]-n),t.lineTo(this.sx[s]-n,this.sy[s]),t.closePath(),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),a.push(t.stroke())):a.push(void 0)));return a},n.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},n.prototype.draw_legend=function(e,s,n,r,o){var a,l,h,p,u,c,_,d,f,g,y;return u=this.glyph_props,_=u.line_properties,p=u.fill_properties,e.save(),f=this.get_reference_point(),null!=f?(c=f,h=this.distance([f],"x","size","edge")[0]):(c=u,h=u.select("size",u)["default"]),a=_.select(_.line_width_name,c),l=t.min([Math.abs(n-s),Math.abs(o-r)]),l-=2*a,d=l/2,null!=h&&(d=h>d?d:h),d=this.size[i]/2,g=(s+n)/2,y=(r+o)/2,e.beginPath(),e.moveTo(g,y+d),e.lineTo(g+d,y),e.lineTo(g,y-d),e.lineTo(g-d,y),e.closePath(),p.do_fill&&(p.set(e,c),e.fill()),_.do_stroke&&(_.set(e,c),e.moveTo(g,y+d),e.lineTo(g,y-d),e.moveTo(g-d,y),e.lineTo(g+d,y)),e.stroke(),e.restore()},n}(n.View),r=function(i){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=o,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(n.Model),{Model:r,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("mapper/color/linear_color_mapper",["common/has_properties"],function(t){var i,s;return i=function(t){function i(){return s=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t,e){return i.__super__.initialize.call(this,t,e),this.low=e.low,this.high=e.high,this.palette=this._build_palette(e.palette),this.little_endian=this._is_little_endian()},i.prototype.v_map_screen=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m;for(i=new ArrayBuffer(4*t.length),s=new Uint32Array(i),l=-1/0,h=1/0,c=0,o=_=0,g=t.length-1;g>=0?g>=_:_>=g;o=g>=0?++_:--_)c=t[o],c>l&&(l=c),h>c&&(h=c);if(a=null!=this.low?this.low:h,r=null!=this.high?this.high:l,e=this.palette.length-1,u=e/(r-a),p=-u*a,this.little_endian)for(o=d=0,y=t.length-1;y>=0?y>=d:d>=y;o=y>=0?++d:--d)n=t[o],n>r&&(n=r),a>n&&(n=a),c=this.palette[Math.floor(n*u+p)],s[o]=255<<24|(16711680&c)>>16|65280&c|(255&c)<<16;else for(o=f=0,m=t.length-1;m>=0?m>=f:f>=m;o=m>=0?++f:--f)n=t[o],n>r&&(n=r),a>n&&(n=a),c=this.palette[Math.floor(n*u+p)],s[o]=255|c<<8;return i},i.prototype._is_little_endian=function(){var t,e,i,s;return t=new ArrayBuffer(4),i=new Uint8ClampedArray(t),e=new Uint32Array(t),e[1]=168496141,s=!0,10===i[4]&&11===i[5]&&12===i[6]&&13===i[7]&&(s=!1),s},i.prototype._build_palette=function(t){var e,i,s,n;for(i=new Uint32Array(t.length+1),e=s=0,n=t.length-1;n>=0?n>=s:s>=n;e=n>=0?++s:--s)i[e]=t[e];return i[i.length-1]=t[t.length-1],i},i}(t)})}.call(this),function(){s("palettes/colorbrewer",[],function(){var t;return t={YlGn:{3:[16252089,11394446,3253076],4:[16777164,12773017,7915129,2327619],5:[16777164,12773017,7915129,3253076,26679],6:[16777164,14282915,11394446,7915129,3253076,26679],7:[16777164,14282915,11394446,7915129,4303709,2327619,23090],8:[16777189,16252089,14282915,11394446,7915129,4303709,2327619,23090],9:[16777189,16252089,14282915,11394446,7915129,4303709,2327619,26679,17705]},YlGnBu:{3:[15595697,8375739,2916280],4:[16777164,10607284,4306628,2252456],5:[16777164,10607284,4306628,2916280,2438292],6:[16777164,13101492,8375739,4306628,2916280,2438292],7:[16777164,13101492,8375739,4306628,1937856,2252456,797828],8:[16777177,15595697,13101492,8375739,4306628,1937856,2252456,797828],9:[16777177,15595697,13101492,8375739,4306628,1937856,2252456,2438292,531800]},GnBu:{3:[14742491,11066805,4432586],4:[15792616,12248252,8113348,2854078],5:[15792616,12248252,8113348,4432586,551084],6:[15792616,13429701,11066805,8113348,4432586,551084],7:[15792616,13429701,11066805,8113348,5157843,2854078,546974],8:[16252144,14742491,13429701,11066805,8113348,5157843,2854078,546974],9:[16252144,14742491,13429701,11066805,8113348,5157843,2854078,551084,540801]},BuGn:{3:[15070713,10082505,2925151],4:[15595771,11723490,6734500,2329413],5:[15595771,11723490,6734500,2925151,27948],6:[15595771,13429990,10082505,6734500,2925151,27948],7:[15595771,13429990,10082505,6734500,4304502,2329413,22564],8:[16252157,15070713,13429990,10082505,6734500,4304502,2329413,22564],9:[16252157,15070713,13429990,10082505,6734500,4304502,2329413,27948,17435]},PuBuGn:{3:[15524592,10927579,1872025],4:[16183287,12437985,6793679,164234],5:[16183287,12437985,6793679,1872025,93273],6:[16183287,13685222,10927579,6793679,1872025,93273],7:[16183287,13685222,10927579,6793679,3576e3,164234,91216],8:[16775163,15524592,13685222,10927579,6793679,3576e3,164234,91216],9:[16775163,15524592,13685222,10927579,6793679,3576e3,164234,93273,83510]},PuBu:{3:[15525874,10927579,2854078],4:[15855350,12437985,7645647,356528],5:[15855350,12437985,7645647,2854078,285325],6:[15855350,13685222,10927579,7645647,2854078,285325],7:[15855350,13685222,10927579,7645647,3576e3,356528,216699],8:[16775163,15525874,13685222,10927579,7645647,3576e3,356528,216699],9:[16775163,15525874,13685222,10927579,7645647,3576e3,356528,285325,145496]},BuPu:{3:[14740724,10403034,8935079],4:[15595771,11783651,9213638,8929693],5:[15595771,11783651,9213638,8935079,8458108],6:[15595771,12571622,10403034,9213638,8935079,8458108],7:[15595771,12571622,10403034,9213638,9202609,8929693,7209323],8:[16252157,14740724,12571622,10403034,9213638,9202609,8929693,7209323],9:[16252157,14740724,12571622,10403034,9213638,9202609,8929693,8458108,5046347]},RdPu:{3:[16638173,16424885,12917642],4:[16706530,16495801,16214177,11403646],5:[16706530,16495801,16214177,12917642,7995767],6:[16706530,16565696,16424885,16214177,12917642,7995767],7:[16706530,16565696,16424885,16214177,14496919,11403646,7995767],8:[16775155,16638173,16565696,16424885,16214177,14496919,11403646,7995767],9:[16775155,16638173,16565696,16424885,16214177,14496919,11403646,7995767,4784234]},PuRd:{3:[15196655,13210823,14490743],4:[15855350,14136792,14640560,13505110],5:[15855350,14136792,14640560,14490743,9961539],6:[15855350,13941210,13210823,14640560,14490743,9961539],7:[15855350,13941210,13210823,14640560,15149450,13505110,9502783],8:[16250105,15196655,13941210,13210823,14640560,15149450,13505110,9502783],9:[16250105,15196655,13941210,13210823,14640560,15149450,13505110,9961539,6750239]},OrRd:{3:[16705736,16628612,14895667],4:[16707801,16632970,16551257,14102559],5:[16707801,16632970,16551257,14895667,11730944],6:[16707801,16635038,16628612,16551257,14895667,11730944],7:[16707801,16635038,16628612,16551257,15689032,14102559,10027008],8:[16775148,16705736,16635038,16628612,16551257,15689032,14102559,10027008],9:[16775148,16705736,16635038,16628612,16551257,15689032,14102559,11730944,8323072]},YlOrRd:{3:[16772512,16691788,15743776],4:[16777138,16698460,16616764,14883356],5:[16777138,16698460,16616764,15743776,12386342],6:[16777138,16701814,16691788,16616764,15743776,12386342],7:[16777138,16701814,16691788,16616764,16535082,14883356,11599910],8:[16777164,16772512,16701814,16691788,16616764,16535082,14883356,11599910],9:[16777164,16772512,16701814,16691788,16616764,16535082,14883356,12386342,8388646]},YlOrBr:{3:[16775100,16696399,14245646],4:[16777172,16701838,16685353,13388802],5:[16777172,16701838,16685353,14245646,10040324],6:[16777172,16704401,16696399,16685353,14245646,10040324],7:[16777172,16704401,16696399,16685353,15495188,13388802,9186564],8:[16777189,16775100,16704401,16696399,16685353,15495188,13388802,9186564],9:[16777189,16775100,16704401,16696399,16685353,15495188,13388802,10040324,6694150]},Purples:{3:[15724021,12369372,7695281],4:[15921399,13355490,10394312,6967715],5:[15921399,13355490,10394312,7695281,5515151],6:[15921399,14342891,12369372,10394312,7695281,5515151],7:[15921399,14342891,12369372,10394312,8420794,6967715,4854918],8:[16579581,15724021,14342891,12369372,10394312,8420794,6967715,4854918],9:[16579581,15724021,14342891,12369372,10394312,8420794,6967715,5515151,4128893]},Blues:{3:[14609399,10406625,3244733],4:[15725567,12441575,7057110,2191797],5:[15725567,12441575,7057110,3244733,545180],6:[15725567,13032431,10406625,7057110,3244733,545180],7:[15725567,13032431,10406625,7057110,4362950,2191797,542100],8:[16251903,14609399,13032431,10406625,7057110,4362950,2191797,542100],9:[16251903,14609399,13032431,10406625,7057110,4362950,2191797,545180,536683]},Greens:{3:[15070688,10607003,3253076],4:[15595753,12248243,7652470,2329413],5:[15595753,12248243,7652470,3253076,27948],6:[15595753,13101504,10607003,7652470,3253076,27948],7:[15595753,13101504,10607003,7652470,4303709,2329413,23090],8:[16252149,15070688,13101504,10607003,7652470,4303709,2329413,23090],9:[16252149,15070688,13101504,10607003,7652470,4303709,2329413,27948,17435]},Oranges:{3:[16705230,16625259,15095053],4:[16707038,16629381,16616764,14239489],5:[16707038,16629381,16616764,15095053,10892803],6:[16707038,16634018,16625259,16616764,15095053,10892803],7:[16707038,16634018,16625259,16616764,15821075,14239745,9186564],8:[16774635,16705230,16634018,16625259,16616764,15821075,14239745,9186564],9:[16774635,16705230,16634018,16625259,16616764,15821075,14239745,10892803,8333060]},Reds:{3:[16703698,16552562,14560550],4:[16704985,16559761,16476746,13309981],5:[16704985,16559761,16476746,14560550,10817301],6:[16704985,16563105,16552562,16476746,14560550,10817301],7:[16704985,16563105,16552562,16476746,15678252,13309981,10027021],8:[16774640,16703698,16563105,16552562,16476746,15678252,13309981,10027021],9:[16774640,16703698,16563105,16552562,16476746,15678252,13309981,10817301,6750221]},Greys:{3:[15790320,12434877,6513507],4:[16250871,13421772,9868950,5395026],5:[16250871,13421772,9868950,6513507,2434341],6:[16250871,14277081,12434877,9868950,6513507,2434341],7:[16250871,14277081,12434877,9868950,7566195,5395026,2434341],8:[16777215,15790320,14277081,12434877,9868950,7566195,5395026,2434341],9:[16777215,15790320,14277081,12434877,9868950,7566195,5395026,2434341,0]},PuOr:{3:[15835968,16250871,10063555],4:[15098113,16627811,11709394,6175897],5:[15098113,16627811,16250871,11709394,6175897],6:[11753478,15835968,16703670,14211819,10063555,5515144],7:[11753478,15835968,16703670,16250871,14211819,10063555,5515144],8:[11753478,14713364,16627811,16703670,14211819,11709394,8418220,5515144],9:[11753478,14713364,16627811,16703670,16250871,14211819,11709394,8418220,5515144],10:[8338184,11753478,14713364,16627811,16703670,14211819,11709394,8418220,5515144,2949195],11:[8338184,11753478,14713364,16627811,16703670,16250871,14211819,11709394,8418220,5515144,2949195]},BrBG:{3:[14201701,16119285,5944492],4:[10903834,14664317,8441281,99697],5:[10903834,14664317,16119285,8441281,99697],6:[9195786,14201701,16181443,13101797,5944492,91742],7:[9195786,14201701,16181443,16119285,13101797,5944492,91742],8:[9195786,12550445,14664317,16181443,13101797,8441281,3512207,91742],9:[9195786,12550445,14664317,16181443,16119285,13101797,8441281,3512207,91742],10:[5517317,9195786,12550445,14664317,16181443,13101797,8441281,3512207,91742,15408],11:[5517317,9195786,12550445,14664317,16181443,16119285,13101797,8441281,3512207,91742,15408]},PRGn:{3:[11505091,16250871,8372091],4:[8073876,12756431,10935200,34871],5:[8073876,12756431,16250871,10935200,34871],6:[7744131,11505091,15193320,14282963,8372091,1800247],7:[7744131,11505091,15193320,16250871,14282963,8372091,1800247],8:[7744131,10055851,12756431,15193320,14282963,10935200,5942881,1800247],9:[7744131,10055851,12756431,15193320,16250871,14282963,10935200,5942881,1800247],10:[4194379,7744131,10055851,12756431,15193320,14282963,10935200,5942881,1800247,17435],11:[4194379,7744131,10055851,12756431,15193320,16250871,14282963,10935200,5942881,1800247,17435]},PiYG:{3:[15311817,16250871,10606442],4:[13638795,15840986,12116358,5090342],5:[13638795,15840986,16250871,12116358,5090342],6:[12917629,15311817,16638191,15136208,10606442,5083681],7:[12917629,15311817,16638191,16250871,15136208,10606442,5083681],8:[12917629,14579630,15840986,16638191,15136208,12116358,8371265,5083681],9:[12917629,14579630,15840986,16638191,16250871,15136208,12116358,8371265,5083681],10:[9306450,12917629,14579630,15840986,16638191,15136208,12116358,8371265,5083681,2581529],11:[9306450,12917629,14579630,15840986,16638191,16250871,15136208,12116358,8371265,5083681,2581529]},RdBu:{3:[15698530,16250871,6793679],4:[13238304,16033154,9618910,356784],5:[13238304,16033154,16250871,9618910,356784],6:[11671595,15698530,16636871,13755888,6793679,2188972],7:[11671595,15698530,16636871,16250871,13755888,6793679,2188972],8:[11671595,14049357,16033154,16636871,13755888,9618910,4428739,2188972],9:[11671595,14049357,16033154,16636871,16250871,13755888,9618910,4428739,2188972],10:[6750239,11671595,14049357,16033154,16636871,13755888,9618910,4428739,2188972,340065],11:[6750239,11671595,14049357,16033154,16636871,16250871,13755888,9618910,4428739,2188972,340065]},RdGy:{3:[15698530,16777215,10066329],4:[13238304,16033154,12237498,4210752],5:[13238304,16033154,16777215,12237498,4210752],6:[11671595,15698530,16636871,14737632,10066329,5066061],7:[11671595,15698530,16636871,16777215,14737632,10066329,5066061],8:[11671595,14049357,16033154,16636871,14737632,12237498,8882055,5066061],9:[11671595,14049357,16033154,16636871,16777215,14737632,12237498,8882055,5066061],10:[6750239,11671595,14049357,16033154,16636871,14737632,12237498,8882055,5066061,1710618],11:[6750239,11671595,14049357,16033154,16636871,16777215,14737632,12237498,8882055,5066061,1710618]},RdYlBu:{3:[16551257,16777151,9551835],4:[14096668,16625249,11262441,2915254],5:[14096668,16625249,16777151,11262441,2915254],6:[14102567,16551257,16703632,14742520,9551835,4552116],7:[14102567,16551257,16703632,16777151,14742520,9551835,4552116],8:[14102567,16018755,16625249,16703632,14742520,11262441,7646673,4552116],9:[14102567,16018755,16625249,16703632,16777151,14742520,11262441,7646673,4552116],10:[10813478,14102567,16018755,16625249,16703632,14742520,11262441,7646673,4552116,3225237],11:[10813478,14102567,16018755,16625249,16703632,16777151,14742520,11262441,7646673,4552116,3225237]},Spectral:{3:[16551257,16777151,10081684],4:[14096668,16625249,11263396,2851770],5:[14096668,16625249,16777151,11263396,2851770],6:[13975119,16551257,16703627,15136152,10081684,3311805],7:[13975119,16551257,16703627,16777151,15136152,10081684,3311805],8:[13975119,16018755,16625249,16703627,15136152,11263396,6734501,3311805],9:[13975119,16018755,16625249,16703627,16777151,15136152,11263396,6734501,3311805],10:[10355010,13975119,16018755,16625249,16703627,15136152,11263396,6734501,3311805,6180770],11:[10355010,13975119,16018755,16625249,16703627,16777151,15136152,11263396,6734501,3311805,6180770]},RdYlGn:{3:[16551257,16777151,9555808],4:[14096668,16625249,10934634,1742401],5:[14096668,16625249,16777151,10934634,1742401],6:[14102567,16551257,16703627,14282635,9555808,1742928],7:[14102567,16551257,16703627,16777151,14282635,9555808,1742928],8:[14102567,16018755,16625249,16703627,14282635,10934634,6733155,1742928],9:[14102567,16018755,16625249,16703627,16777151,14282635,10934634,6733155,1742928],10:[10813478,14102567,16018755,16625249,16703627,14282635,10934634,6733155,1742928,26679],11:[10813478,14102567,16018755,16625249,16703627,16777151,14282635,10934634,6733155,1742928,26679]}}
})}.call(this),function(){s("palettes/palettes",["./colorbrewer"],function(t){var e,i,s,n,r;e={};for(s in t){i=t[s];for(n in i)r=i[n],e[""+s+"-"+n]=r.reverse()}return{all_palettes:e}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/image",["underscore","renderer/properties","mapper/color/linear_color_mapper","palettes/palettes","./glyph"],function(t,i,s,n,r){var o,a,l,h,p,u,c,_;return p=i.glyph_properties,u=i.line_properties,h=i.fill_properties,l=n.all_palettes,a=function(t){function i(){return c=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new p(this,e,["image:array","width","height","x","y","dw","dh","palette:string"],[]),i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){var e,i,n,r,o,a,h,p,u,c,_,d,f,g,y,m,v;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),a=this.glyph_props.v_select("dh",t),p=f=0,y=this.y.length-1;y>=0?y>=f:f>=y;p=y>=0?++f:--f)this.y[p]+=a[p];for(this.pal=this.glyph_props.v_select("palette",t),d=this.glyph_props.v_select("width",t),h=this.glyph_props.v_select("height",t),c=function(){var e,i,s;for(s=[],e=0,i=t.length;i>e;e++)_=t[e],s.push(this.glyph_props.select("image",_));return s}.call(this),this.image_data=new Array(t.length),v=[],p=g=0,m=t.length-1;m>=0?m>=g:g>=m;p=m>=0?++g:--g)n=document.createElement("canvas"),n.width=d[p],n.height=h[p],o=n.getContext("2d"),u=o.getImageData(0,0,d[p],h[p]),r=new s({},{palette:l[this.pal[p]]}),e=r.v_map_screen(c[p]),i=new Uint8ClampedArray(e),u.data.set(i),o.putImageData(u,0,0),v.push(this.image_data[p]=n);return v},i.prototype._render=function(){var t,e,i,s,n,r,o;for(r=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=r[0],this.sy=r[1],this.sw=this.distance(this.data,"x","dw","edge"),this.sh=this.distance(this.data,"y","dh","edge"),t=this.plot_view.ctx,t.save(),i=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),e=n=0,o=this.sx.length-1;o>=0?o>=n:n>=o;e=o>=0?++n:--n)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e])||(s=this.sy[e]+this.sh[e]/2,t.translate(0,s),t.scale(1,-1),t.translate(0,-s),t.drawImage(this.image_data[e],0|this.sx[e],0|this.sy[e],this.sw[e],this.sh[e]),t.translate(0,s),t.scale(1,-1),t.translate(0,-s));return t.setImageSmoothingEnabled(i),t.restore()},i}(r.View),o=function(i){function s(){return _=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=a,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{level:"underlay"})},s}(r.Model),{Model:o,View:a}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/image_rgba",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l;return o=i.glyph_properties,r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["image:array","width","height","x","y","dw","dh"],[]),i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){var e,i,s,n,r,o,a,l,h,p,u,c;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),i=this.glyph_props.v_select("dh",t),n=l=0,p=this.y.length-1;p>=0?p>=l:l>=p;n=p>=0?++l:--l)this.y[n]+=i[n];for(a=this.glyph_props.v_select("width",t),s=this.glyph_props.v_select("height",t),r=function(){var e,i,s;for(s=[],e=0,i=t.length;i>e;e++)o=t[e],s.push(this.glyph_props.select("image",o));return s}.call(this),(null==this.image_data||this.image_data.length!==t.length)&&(this.image_data=new Array(t.length)),(null==this.image_canvas||this.image_canvas.length!==t.length)&&(this.image_canvas=new Array(t.length)),c=[],n=h=0,u=t.length-1;u>=0?u>=h:h>=u;n=u>=0?++h:--h)(null==this.image_canvas[n]||this.image_canvas[n].width!==a[n]||this.image_canvas[n].height!==s[n])&&(this.image_canvas[n]=document.createElement("canvas"),this.image_canvas[n].width=a[n],this.image_canvas[n].height=s[n],e=this.image_canvas[n].getContext("2d"),this.image_data[n]=e.createImageData(a[n],s[n])),e=this.image_canvas[n].getContext("2d"),this.image_data[n].data.set(new Uint8ClampedArray(r[n])),c.push(e.putImageData(this.image_data[n],0,0));return c},i.prototype._render=function(){var t,e,i,s,n,r,o;for(r=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=r[0],this.sy=r[1],this.sw=this.distance(this.data,"x","dw","edge"),this.sh=this.distance(this.data,"y","dh","edge"),t=this.plot_view.ctx,t.save(),i=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),e=n=0,o=this.sx.length-1;o>=0?o>=n:n>=o;e=o>=0?++n:--n)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e])||(s=this.sy[e]+this.sh[e]/2,t.translate(0,s),t.scale(1,-1),t.translate(0,-s),t.drawImage(this.image_canvas[e],0|this.sx[e],0|this.sy[e],this.sw[e],this.sh[e]),t.translate(0,s),t.scale(1,-1),t.translate(0,-s));return t.setImageSmoothingEnabled(i),t.restore()},i}(s.View),n=function(i){function s(){return l=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{level:"underlay"})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/image_uri",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l;return o=i.glyph_properties,r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["url:string","x","y","angle"],[]),i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){var e,i,s,n;return this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.url=function(){var e,i,s;for(s=[],e=0,i=t.length;i>e;e++)n=t[e],s.push(this.glyph_props.select("url",n));return s}.call(this),i=this.glyph_props.v_select("angle",t),this.angle=function(){var t,s,n;for(n=[],t=0,s=i.length;s>t;t++)e=i[t],n.push(-e);return n}(),this.image=function(){var t,e,i,n;for(i=this.url,n=[],t=0,e=i.length;e>t;t++)s=i[t],n.push(null);return n}.call(this),this.need_load=function(){var t,e,i,n;for(i=this.url,n=[],t=0,e=i.length;e>t;t++)s=i[t],n.push(!0);return n}.call(this),this.loaded=function(){var t,e,i,n;for(i=this.url,n=[],t=0,e=i.length;e>t;t++)s=i[t],n.push(!1);return n}.call(this)},i.prototype._render=function(){var t,e,i,s,n,r,o,a=this;for(r=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=r[0],this.sy=r[1],t=this.plot_view.ctx,s=this.plot_view.view_state,t.save(),e=n=0,o=this.sx.length-1;o>=0?o>=n:n>=o;e=o>=0?++n:--n)isNaN(this.sx[e]+this.sy[e]+this.angle[e])||(this.need_load[e]?(i=new Image,i.onload=function(e,i){return function(){return a.loaded[i]=!0,a.image[i]=e,t.save(),t.beginPath(),t.rect(s.get("border_left")+1,s.get("border_top")+1,s.get("inner_width")-2,s.get("inner_height")-2),t.clip(),a._render_image(t,s,i,e),t.restore()}}(i,e),i.src=this.url[e],this.need_load[e]=!1):this.loaded[e]&&this._render_image(t,s,e,this.image[e]));return t.restore()},i.prototype._render_image=function(t,e,i,s){return this.angle[i]?(t.translate(this.sx[i],this.sy[i]),t.rotate(this.angle[i]),t.drawImage(s,0,0),t.rotate(-this.angle[i]),t.translate(-this.sx[i],-this.sy[i])):t.drawImage(s,this.sx[i],this.sy[i])},i}(s.View),n=function(i){function s(){return l=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{level:"underlay"})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/inverted_triangle",["underscore","renderer/properties","./glyph"],function(t,s,n){var r,o,a,l,h,p,u;return l=s.glyph_properties,h=s.line_properties,a=s.fill_properties,o=function(s){function n(){return p=n.__super__.constructor.apply(this,arguments)}return e(n,s),n.prototype.initialize=function(e){var i;return n.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},n.prototype.init_glyph=function(t){var e;return e=new l(this,t,["x","y","size"],{fill_properties:new a(this,t),line_properties:new h(this,t)})},n.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},n.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},n.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l,h,p,u;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),r=a=0,h=this.sx.length-1;h>=0?h>=a:a>=h;r=h>=0?++a:--a)!isNaN(this.sx[r]+this.sy[r]+this.size[r])&&this.mask[r]&&(!i||this.selected_mask[r])&&(i===!1&&this.selected_mask[r]||(s=this.size[r]*Math.sqrt(3)/6,o=this.size[r]/2,n=this.size[r]*Math.sqrt(3)/2,t.beginPath(),t.moveTo(this.sx[r]-o,this.sy[r]-s),t.lineTo(this.sx[r]+o,this.sy[r]-s),t.lineTo(this.sx[r],this.sy[r]-s+n),t.closePath()));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),u=[],r=l=0,p=this.sx.length-1;p>=0?p>=l:l>=p;r=p>=0?++l:--l)!isNaN(this.sx[r]+this.sy[r]+this.size[r])&&this.mask[r]&&(!i||this.selected_mask[r])&&(i===!1&&this.selected_mask[r]||(s=this.size[r]*Math.sqrt(3)/6,o=this.size[r]/2,n=this.size[r]*Math.sqrt(3)/2,t.beginPath(),t.moveTo(this.sx[r]-o,this.sy[r]-s),t.lineTo(this.sx[r]+o,this.sy[r]-s),t.lineTo(this.sx[r],this.sy[r]-s+n),t.closePath(),u.push(t.stroke())));return u}},n.prototype._full_path=function(t,e,i){var s,n,r,o,a,l,h;for(e||(e=this.glyph_props),h=[],r=a=0,l=this.sx.length-1;l>=0?l>=a:a>=l;r=l>=0?++a:--a)!isNaN(this.sx[r]+this.sy[r]+this.size[r])&&this.mask[r]&&(!i||this.selected_mask[r])&&(i===!1&&this.selected_mask[r]||(s=this.size[r]*Math.sqrt(3)/6,o=this.size[r]/2,n=this.size[r]*Math.sqrt(3)/2,console.log(s,o,n),t.beginPath(),t.moveTo(this.sx[r]-o,this.sy[r]-s),t.lineTo(this.sx[r]+o,this.sy[r]-s),t.lineTo(this.sx[r],this.sy[r]-s+n),t.closePath(),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[r]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[r]),h.push(t.stroke())):h.push(void 0)));return h},n.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},n.prototype.draw_legend=function(e,s,n,r,o){var a,l,h,p,u,c,_,d,f,g,y,m,v;return c=this.glyph_props,f=c.line_properties,u=c.fill_properties,e.save(),y=this.get_reference_point(),null!=y?(_=y,p=this.distance([y],"x","size","edge")[0]):(_=c,p=c.select("size",c)["default"]),l=f.select(f.line_width_name,_),h=t.min([Math.abs(n-s),Math.abs(o-r)]),h-=2*l,g=h/2,null!=p&&(g=p>g?g:p),m=(s+n)/2,v=(r+o)/2,a=this.size[i]*Math.sqrt(3)/6,g=this.size[i]/2,d=this.size[i]*Math.sqrt(3)/2,e.beginPath(),e.moveTo(this.sx[i]-g,this.sy[i]-a),e.lineTo(this.sx[i]+g,this.sy[i]-a),e.lineTo(this.sx[i],this.sy[i]-a+d),e.closePath(),u.do_fill&&(u.set(e,_),e.fill()),f.do_stroke&&(f.set(e,_),e.stroke()),e.restore()},n}(n.View),r=function(i){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=o,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(n.Model),{Model:r,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/line",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(i){function s(){return l=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_stroke=this.glyph_props.line_properties.do_stroke},s.prototype.init_glyph=function(t){var e;return e=new o(this,t,["x:number","y:number"],{line_properties:new a(this,t)})},s.prototype._set_data=function(t){var e,i,s,n;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.selected_mask=new Uint8Array(t.length),n=[],e=i=0,s=this.selected_mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)n.push(this.selected_mask[e]=!1);return n},s.prototype._map_data=function(){var t;return t=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=t[0],this.sy=t[1],t},s.prototype._render=function(){var t,e,i,s,n,r;if(this.do_stroke){for(this._map_data(),t=this.plot_view.ctx,t.save(),s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._draw_path(t,this.nonselection_glyphprops,!1),this._draw_path(t,i,!0)):this._draw_path(t),t.restore()}},s.prototype._draw_path=function(t,e,i){var s,n,r,o,a,l,h;for(e||(e=this.glyph_props),e.line_properties.set(t,e),o=this.sx,a=this.sy,r=this.selected_mask,s=!1,n=l=0,h=o.length-1;h>=0?h>=l:l>=h;n=h>=0?++l:--l)isNaN(o[n]+a[n])||i&&!r[n]||!i&&r[n]?(s&&t.stroke(),s=!1):s?t.lineTo(o[n],a[n]):(t.beginPath(),t.moveTo(o[n],a[n]),s=!0);return s?t.stroke():void 0},s.prototype.draw_legend=function(t,e,i,s,n){var r,o,a,l;return t.save(),r=this.glyph_props,a=r.line_properties,l=this.get_reference_point(),o=null!=l?l:r,a.set(t,o),t.beginPath(),t.moveTo(e,(s+n)/2),t.lineTo(i,(s+n)/2),a.do_stroke&&(a.set(t,o),t.stroke()),t.restore()},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/multi_line",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["xs:array","ys:array"],{line_properties:new a(this,e)}),this.do_stroke=this.glyph_props.line_properties.do_stroke,i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){this.data=t},i.prototype._render=function(){var t;return t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},i.prototype._fast_path=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_;if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),p=this.data,_=[],a=0,h=p.length;h>a;a++){for(i=p[a],r=this.glyph_props.select("xs",i),o=this.glyph_props.select("ys",i),u=this.plot_view.map_to_screen(r,this.glyph_props.xs.units,o,this.glyph_props.ys.units),s=u[0],n=u[1],e=l=0,c=s.length-1;c>=0?c>=l:l>=c;e=c>=0?++l:--l)0!==e?isNaN(s[e])||isNaN(n[e])?(t.stroke(),t.beginPath()):t.lineTo(s[e],n[e]):(t.beginPath(),t.moveTo(s[e],n[e]));_.push(t.stroke())}return _}},i.prototype._full_path=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_;if(this.do_stroke){for(p=this.data,_=[],a=0,h=p.length;h>a;a++){for(i=p[a],r=this.glyph_props.select("xs",i),o=this.glyph_props.select("ys",i),u=this.plot_view.map_to_screen(r,this.glyph_props.xs.units,o,this.glyph_props.ys.units),s=u[0],n=u[1],this.glyph_props.line_properties.set(t,i),e=l=0,c=s.length-1;c>=0?c>=l:l>=c;e=c>=0?++l:--l)0!==e?isNaN(s[e])||isNaN(n[e])?(t.stroke(),t.beginPath()):t.lineTo(s[e],n[e]):(t.beginPath(),t.moveTo(s[e],n[e]));_.push(t.stroke())}return _}},i.prototype.draw_legend=function(t,e,i,s,n){var r,o,a,l;return r=this.glyph_props,a=r.line_properties,l=this.get_reference_point(),o=null!=l?l:r,t.beginPath(),t.moveTo(e,(s+n)/2),t.lineTo(i,(s+n)/2),a.do_stroke&&(a.set(t,o),t.stroke()),t.restore()},i}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/oval",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,e)},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","width","height","angle"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s,n,r,o;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),i=this.glyph_props.v_select("angle",t),this.angle=function(){var t,s,n;for(n=[],t=0,s=i.length;s>t;t++)e=i[t],n.push(-e);return n}(),this.selected_mask=new Uint8Array(t.length),o=[],s=n=0,r=this.selected_mask.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)o.push(this.selected_mask[s]=!1);return o},s.prototype._render=function(){var t,e,i,s,n,r,o;for(o=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=o[0],this.sy=o[1],this.sw=this.distance(this.data,"x","width","center"),this.sh=this.distance(this.data,"y","height","center"),t=this.plot_view.ctx,t.save(),s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return this.glyph_props.fast_path?this._fast_path(t):s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(t,i,"selected"),this._full_path(t,this.nonselection_glyphprops,"unselected")):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r;if(this.do_fill)for(this.glyph_props.fill_properties.set(t,this.glyph_props),e=i=0,n=this.sx.length-1;n>=0?n>=i:i>=n;e=n>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e]+this.angle[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.beginPath(),t.moveTo(0,-this.sh[e]/2),t.bezierCurveTo(this.sw[e]/2,-this.sh[e]/2,this.sw[e]/2,this.sh[e]/2,0,this.sh[e]/2),t.bezierCurveTo(-this.sw[e]/2,this.sh[e]/2,-this.sw[e]/2,-this.sh[e]/2,0,-this.sh[e]/2),t.closePath(),t.fill(),t.rotate(-this.angle[e]),t.translate(-this.sx[e],-this.sy[e]));if(this.do_fill){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e]+this.angle[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.moveTo(0,-this.sh[e]/2),t.bezierCurveTo(this.sw[e]/2,-this.sh[e]/2,this.sw[e]/2,this.sh[e]/2,0,this.sh[e]/2),t.bezierCurveTo(-this.sw[e]/2,this.sh[e]/2,-this.sw[e]/2,-this.sh[e]/2,0,-this.sh[e]/2),t.rotate(-this.angle[e]),t.translate(-this.sx[e],-this.sy[e]));return t.stroke()}},s.prototype._full_path=function(t,e,i){var s,n,r,o;for(e||(e=this.glyph_props),o=[],s=n=0,r=this.sx.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)isNaN(this.sx[s]+this.sy[s]+this.sw[s]+this.sh[s]+this.angle[s])||isNaN(this.sx[s]+this.sy[s]+this.sw[s]+this.sh[s]+this.angle[s])||("selected"!==i||this.selected_mask[s])&&("unselected"===i&&this.selected_mask[s]||(t.translate(this.sx[s],this.sy[s]),t.rotate(this.angle[s]),t.beginPath(),t.moveTo(0,-this.sh[s]/2),t.bezierCurveTo(this.sw[s]/2,-this.sh[s]/2,this.sw[s]/2,this.sh[s]/2,0,this.sh[s]/2),t.bezierCurveTo(-this.sw[s]/2,this.sh[s]/2,-this.sw[s]/2,-this.sh[s]/2,0,-this.sh[s]/2),t.closePath(),this.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),this.do_stroke&&(e.line_properties.set(t,this.data[s]),t.stroke()),t.rotate(-this.angle[s]),o.push(t.translate(-this.sx[s],-this.sy[s]))));return o},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g,y,m;return l=this.glyph_props,u=l.line_properties,a=l.fill_properties,e.save(),f=this.get_reference_point(),null!=f?(h=f,y=this.distance([f],"x","width","center")[0],g=this.distance([refrence_point],"y","height","center")[0]):(h=l,y=1,g=2),o=u.select(u.line_width_name,h),m=Math.abs(s-i),p=Math.abs(r-n),m-=2*o,p-=2*o,_=p/g,d=m/y,c=t.min([_,d]),p=g*c,m=y*c,e.translate((i+s)/2,(n+r)/2),e.beginPath(),e.moveTo(0,-p/2),e.bezierCurveTo(m/2,-p/2,m/2,p/2,0,p/2),e.bezierCurveTo(-m/2,p/2,-m/2,-p/2,0,-p/2),e.closePath(),a.do_fill&&(a.set(e,h),e.fill()),u.do_stroke&&(u.set(e,h),e.stroke()),e.restore()},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0,angle:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/patch",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new a(this,e,["x:number","y:number"],{fill_properties:new o(this,e),line_properties:new l(this,e)}),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){return this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t)},i.prototype._render=function(){var t,e,i,s,n,r,o,a,l;if(t=this.plot_view.ctx,t.save(),o=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),i=o[0],s=o[1],this.do_fill){for(this.glyph_props.fill_properties.set(t,this.glyph_props),e=n=0,a=i.length-1;a>=0?a>=n:n>=a;e=a>=0?++n:--n)0!==e?isNaN(i[e]+s[e])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(i[e],s[e]):(t.beginPath(),t.moveTo(i[e],s[e]));t.closePath(),t.fill()}if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),e=r=0,l=i.length-1;l>=0?l>=r:r>=l;e=l>=0?++r:--r)0!==e?isNaN(i[e]+s[e])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(i[e],s[e]):(t.beginPath(),t.moveTo(i[e],s[e]));t.closePath(),t.stroke()}return t.restore()},i}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/patches",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new a(this,e,["xs:array","ys:array"],{fill_properties:new o(this,e),line_properties:new l(this,e)}),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){this.data=t},i.prototype._render=function(){var t,e,i,s,n,r,o,a,l,h,p,u,c,_,d;for(t=this.plot_view.ctx,t.save(),u=this.data,a=0,p=u.length;p>a;a++){if(i=u[a],r=this.glyph_props.select("xs",i),o=this.glyph_props.select("ys",i),c=this.plot_view.map_to_screen(r,this.glyph_props.xs.units,o,this.glyph_props.ys.units),s=c[0],n=c[1],this.do_fill){for(this.glyph_props.fill_properties.set(t,i),e=l=0,_=s.length-1;_>=0?_>=l:l>=_;e=_>=0?++l:--l)0!==e?isNaN(s[e]+n[e])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(s[e],n[e]):(t.beginPath(),t.moveTo(s[e],n[e]));t.closePath(),t.fill()}if(this.do_stroke){for(this.glyph_props.line_properties.set(t,i),e=h=0,d=s.length-1;d>=0?d>=h:h>=d;e=d>=0?++h:--h)0!==e?isNaN(s[e]+n[e])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(s[e],n[e]):(t.beginPath(),t.moveTo(s[e],n[e]));t.closePath(),t.stroke()}}return t.restore()},i}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/cross",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","size"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;
return this.have_new_data=!0},s.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},s.prototype._fast_path=function(t,e,i){var s,n,r,o,a;if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),a.push(t.stroke())));return a}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s],this.sy[s]+n),t.lineTo(this.sx[s],this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]),t.lineTo(this.sx[s]+n,this.sy[s]),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),a.push(t.stroke())):a.push(void 0)));return a},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g;return p=this.glyph_props,c=p.line_properties,h=p.fill_properties,e.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","edge")[0]):(u=p,l=p.select("size",p)["default"]),o=c.select(c.line_width_name,u),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,_=a/2,null!=l&&(_=l>_?_:l),f=(i+s)/2,g=(n+r)/2,e.moveTo(f,g+_),e.lineTo(f,g-_),e.moveTo(f-_,g),e.lineTo(f+_,g),c.do_stroke&&(c.set(e,u),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/quad",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new a(this,e,["right","left","bottom","top"],{fill_properties:new o(this,e),line_properties:new l(this,e)}),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,t)},s.prototype._set_data=function(t){var e,i,s,n;for(this.data=t,this.left=this.glyph_props.v_select("left",t),this.top=this.glyph_props.v_select("top",t),this.right=this.glyph_props.v_select("right",t),this.bottom=this.glyph_props.v_select("bottom",t),this.mask=new Uint8Array(t.length),n=[],e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)n.push(this.mask[e]=!0);return n},s.prototype._render=function(){var t,e,i,s,n,r,o,a;for(r=this.plot_view.map_to_screen(this.left,this.glyph_props.left.units,this.top,this.glyph_props.top.units),this.sx0=r[0],this.sy0=r[1],o=this.plot_view.map_to_screen(this.right,this.glyph_props.right.units,this.bottom,this.glyph_props.bottom.units),this.sx1=o[0],this.sy1=o[1],s=this.plot_view.view_state.get("outer_width"),i=this.plot_view.view_state.get("outer_height"),e=n=0,a=this.mask.length-1;a>=0?a>=n:n>=a;e=a>=0?++n:--n)this.mask[e]=this.sx0[e]<0&&this.sx1[e]<0||this.sx0[e]>s&&this.sx1[e]>s||this.sy0[e]<0&&this.sy1[e]<0||this.sy0[e]>i&&this.sy1[e]>i?!1:!0;return t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r;if(this.do_fill){for(this.glyph_props.fill_properties.set(t,this.glyph_props),t.beginPath(),e=i=0,n=this.sx0.length-1;n>=0?n>=i:i>=n;e=n>=0?++i:--i)!isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e])&&this.mask[e]&&t.rect(this.sx0[e],this.sy0[e],this.sx1[e]-this.sx0[e],this.sy1[e]-this.sy0[e]);t.fill()}if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=s=0,r=this.sx0.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)!isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e])&&this.mask[e]&&t.rect(this.sx0[e],this.sy0[e],this.sx1[e]-this.sx0[e],this.sy1[e]-this.sy0[e]);return t.stroke()}},s.prototype._full_path=function(t){var e,i,s,n;for(n=[],e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)!isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e])&&this.mask[e]&&(t.beginPath(),t.rect(this.sx0[e],this.sy0[e],this.sx1[e]-this.sx0[e],this.sy1[e]-this.sy0[e]),this.do_fill&&(this.glyph_props.fill_properties.set(t,this.data[e]),t.fill()),this.do_stroke?(this.glyph_props.line_properties.set(t,this.data[e]),n.push(t.stroke())):n.push(void 0));return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T,C,M,z,P,j,N;return u=this.glyph_props,f=u.line_properties,p=u.fill_properties,e.save(),v=this.get_reference_point(),null!=v?(c=v,d=this.glyph_props.select("left",c),C=this.glyph_props.select("top",c),w=this.glyph_props.select("right",c),a=this.glyph_props.select("bottom",c),j=this.plot_view.map_to_screen([d],this.glyph_props.left.units,[C],this.glyph_props.top.units),x=j[0],k=j[1],N=this.plot_view.map_to_screen([w],this.glyph_props.right.units,[a],this.glyph_props.bottom.units),b=N[0],T=N[1],h=b[0]-x[0],l=T[0]-k[0]):(c=u,h=1,l=1),o=f.select(f.line_width_name,c),h-=2*o,l-=2*o,M=Math.abs(s-i),_=Math.abs(r-n),y=M/h,m=_/l,g=t.min([y,m]),M=g*h,_=g*l,z=(i+s)/2-M/2,P=(n+r)/2-_/2,e.beginPath(),e.rect(z,P,M,_),p.do_fill&&(p.set(e,c),e.fill()),f.do_stroke&&(f.set(e,c),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/quadratic",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["x0","y0","x1","y1","cx","cy"],{line_properties:new a(this,e)}),this.do_stroke=this.glyph_props.line_properties.do_stroke,i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){return this.data=t,this.x0=this.glyph_props.v_select("x0",t),this.y0=this.glyph_props.v_select("y0",t),this.x1=this.glyph_props.v_select("x1",t),this.y1=this.glyph_props.v_select("y1",t),this.cx=this.glyph_props.v_select("cx",t),this.cy=this.glyph_props.v_select("cy",t)},i.prototype._render=function(){var t,e,i,s;return e=this.plot_view.map_to_screen(this.x0,this.glyph_props.x0.units,this.y0,this.glyph_props.y0.units),this.sx0=e[0],this.sy0=e[1],i=this.plot_view.map_to_screen(this.x1,this.glyph_props.x1.units,this.y1,this.glyph_props.y1.units),this.sx1=i[0],this.sy1=i[1],s=this.plot_view.map_to_screen(this.cx,this.glyph_props.cx.units,this.cy,this.glyph_props.cy.units),this.scx=s[0],this.scy=s[1],t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},i.prototype._fast_path=function(t){var e,i,s;if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e]+this.scx[e]+this.scy[e])||(t.moveTo(this.sx0[e],this.sy0[e]),t.quadraticCurveTo(this.scx[e],this.scy[e],this.sx1[e],this.sy1[e]));return t.stroke()}},i.prototype._full_path=function(t){var e,i,s,n;if(this.do_stroke){for(n=[],e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e]+this.scx[e]+this.scy[e])||(t.beginPath(),t.moveTo(this.sx0[e],this.sy0[e]),t.quadraticCurveTo(this.scx[e],this.scy[e],this.sx1[e],this.sy1[e]),this.glyph_props.line_properties.set(t,this.data[e]),n.push(t.stroke()));return n}},i}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/ray",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(i){function s(){return l=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["x","y","angle","length"],{line_properties:new a(this,e)}),this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,t)},s.prototype._set_data=function(t){var e,i,s;return this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),i=function(){var e,i,n;for(n=[],e=0,i=t.length;i>e;e++)s=t[e],n.push(this.glyph_props.select("angle",s));return n}.call(this),this.angle=function(){var t,s,n;for(n=[],t=0,s=i.length;s>t;t++)e=i[t],n.push(-e);return n}(),this.length=this.glyph_props.v_select("length",t)},s.prototype._render=function(){var t,e,i,s,n,r,o,a;for(o=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=o[0],this.sy=o[1],n=this.plot_view.view_state.get("width"),e=this.plot_view.view_state.get("height"),s=2*(n+e),i=r=0,a=this.length.length-1;a>=0?a>=r:r>=a;i=a>=0?++r:--r)0===this.length[i]&&(this.length[i]=s);return t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s;if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.angle[e]+this.length[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.moveTo(0,0),t.lineTo(this.length[e],0),t.rotate(-this.angle[e]),t.translate(-this.sx[e],-this.sy[e]));return t.stroke()}},s.prototype._full_path=function(t){var e,i,s,n;if(this.do_stroke){for(n=[],e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.angle[e]+this.length[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.beginPath(),t.moveTo(0,0),t.lineTo(this.length[e],0),this.glyph_props.line_properties.set(t,this.data[e]),t.stroke(),t.rotate(-this.angle[e]),n.push(t.translate(-this.sx[e],-this.sy[e])));return n}},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_;return a=this.glyph_props,h=a.line_properties,u=this.get_reference_point(),l=null!=u?u:a,o=-this.glyph_props.select("angle",l),p=t.min([Math.abs(s-i),Math.abs(r-n)])/2,c=(i+s)/2,_=(n+r)/2,e.beginPath(),e.translate(c,_),e.rotate(o),e.moveTo(0,0),e.lineTo(p,0),e.rotate(-o),e.translate(-c,-_),h.do_stroke&&(h.set(e,l),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/rect",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke},s.prototype.init_glyph=function(t){var e,i,s;return e=new o(this,t),s=new l(this,t),i=new a(this,t,["x","y","width","height","angle"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s,n,r,o;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),i=this.glyph_props.v_select("angle",t),this.angle=function(){var t,s,n;for(n=[],t=0,s=i.length;s>t;t++)e=i[t],n.push(-e);return n}(),this.selected_mask=new Uint8Array(t.length),o=[],s=n=0,r=this.selected_mask.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)o.push(this.selected_mask[s]=!1);return o},s.prototype._map_data=function(){var t,e,i,s,n,r,o;for(n=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),e=n[0],i=n[1],this.sw=this.distance(this.data,"x","width","center"),this.sh=this.distance(this.data,"y","height","center"),this.sx=new Array(e.length),this.sy=new Array(e.length),o=[],t=s=0,r=e.length-1;r>=0?r>=s:s>=r;t=r>=0?++s:--s)this.sx[t]=Math.abs(e[t]-this.sw[t])<2?Math.round(e[t]):e[t],Math.abs(i[t]-this.sh[t])<2?o.push(this.sy[t]=Math.round(i[t])):o.push(this.sy[t]=i[t]);return o},s.prototype._render=function(){var t,e,i,s,n,r;for(this._map_data(),t=this.plot_view.ctx,s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return t.save(),this.glyph_props.fast_path?this._fast_path(t):s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(t,i,"selected"),this._full_path(t,this.nonselection_glyphprops,"unselected")):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r;if(this.do_fill){for(this.glyph_props.fill_properties.set(t,this.glyph_props),t.beginPath(),e=i=0,n=this.sx.length-1;n>=0?n>=i:i>=n;e=n>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e]+this.angle[e])||(this.angle[e]?(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.rect(-this.sw[e]/2,-this.sh[e]/2,this.sw[e],this.sh[e]),t.rotate(-this.angle[e]),t.translate(-this.sx[e],-this.sy[e])):t.rect(this.sx[e]-this.sw[e]/2,this.sy[e]-this.sh[e]/2,this.sw[e],this.sh[e]));t.fill()}if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e]+this.angle[e])||(this.angle[e]?(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.rect(-this.sw[e]/2,-this.sh[e]/2,this.sw[e],this.sh[e]),t.rotate(-this.angle[e]),t.translate(-this.sx[e],-this.sy[e])):t.rect(this.sx[e]-this.sw[e]/2,this.sy[e]-this.sh[e]/2,this.sw[e],this.sh[e]));return t.stroke()}},s.prototype.draw_legend=function(t,e,i,s,n){var r,o,a,l,h,p,u,c,_,d,f,g;return h=this.glyph_props,c=h.line_properties,l=h.fill_properties,t.save(),_=this.get_reference_point(),null!=_?(p=_,a=this.distance([_],"x","width","center")[0],o=this.distance([_],"y","height","center")[0]):p=h,r=c.select(c.line_width_name,p),t.beginPath(),d=Math.abs(i-e),u=Math.abs(n-s),d-=2*r,u-=2*r,null!=a&&(d=a>d?d:a),null!=o&&(u=o>u?u:o),f=(e+i)/2-d/2,g=(s+n)/2-u/2,t.rect(f,g,d,u),l.set(t,p),t.fill(),c.set(t,p),t.stroke(),t.restore()},s.prototype._full_path=function(t,e,i){var s,n,r,o;for(e||(e=this.glyph_props),o=[],s=n=0,r=this.sx.length-1;r>=0?r>=n:n>=r;s=r>=0?++n:--n)isNaN(this.sx[s]+this.sy[s]+this.sw[s]+this.sh[s]+this.angle[s])||("selected"!==i||this.selected_mask[s])&&("unselected"===i&&this.selected_mask[s]||(t.translate(this.sx[s],this.sy[s]),t.rotate(this.angle[s]),t.beginPath(),t.rect(-this.sw[s]/2,-this.sh[s]/2,this.sw[s],this.sh[s]),this.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),this.do_stroke&&(e.line_properties.set(t,this.data[s]),t.stroke()),t.rotate(-this.angle[s]),o.push(t.translate(-this.sx[s],-this.sy[s]))));return o},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0,angle:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/square",["underscore","renderer/properties","./rect"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","size","angle"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._map_data=function(){var t;return t=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=t[0],this.sy=t[1],this.sw=this.distance(this.data,"x","size","center"),this.sh=this.sw},s.prototype.draw_legend=function(t,e,i,s,n){var r,o,a,l,h,p,u,c,_,d,f,g;return h=this.glyph_props,c=h.line_properties,l=h.fill_properties,t.save(),_=this.get_reference_point(),null!=_?(p=_,a=this.distance([_],"x","size","center")[0],o=a):p=h,r=c.select(c.line_width_name,p),t.beginPath(),d=Math.abs(i-e),u=Math.abs(n-s),d-=2*r,u-=2*r,null!=a&&(d=a>d?d:a),null!=o&&(u=o>u?u:o),f=(e+i)/2-d/2,g=(s+n)/2-u/2,t.rect(f,g,d,u),l.do_fill&&(l.set(t,p),t.fill()),c.do_stroke&&(c.set(t,p),t.stroke()),t.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/square_x",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,o,a,l,h,p,u;return l=i.glyph_properties,h=i.line_properties,a=i.fill_properties,o=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke},s.prototype.init_glyph=function(t){var e;return e=new l(this,t,["x","y","size"],{fill_properties:new a(this,t),line_properties:new h(this,t)})},s.prototype._set_data=function(t){return this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t)},s.prototype._map_data=function(){var t;return t=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=t[0],this.sy=t[1],this.sw=this.distance(this.data,"x","size","center"),this.sh=this.sw},s.prototype._render=function(){var t,e,i,s,n,r;for(this._map_data(),t=this.plot_view.ctx,s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return t.save(),this.glyph_props.fast_path?this._fast_path(t):s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(t,i,"selected"),this._full_path(t,this.nonselection_glyphprops,"unselected")):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r,o;if(this.do_fill){for(this.glyph_props.fill_properties.set(t,this.glyph_props),t.beginPath(),e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e])||t.rect(this.sx[e]-this.sw[e]/2,this.sy[e]-this.sh[e]/2,this.sw[e],this.sh[e]);t.fill()}if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=n=0,o=this.sx.length-1;o>=0?o>=n:n>=o;e=o>=0?++n:--n)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e])||(t.rect(this.sx[e]-this.sw[e]/2,this.sy[e]-this.sh[e]/2,this.sw[e],this.sh[e]),i=this.sw[e]/2,t.moveTo(this.sx[e]-i,this.sy[e]+i),t.lineTo(this.sx[e]+i,this.sy[e]-i),t.moveTo(this.sx[e]-i,this.sy[e]-i),t.lineTo(this.sx[e]+i,this.sy[e]+i));return t.stroke()}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)isNaN(this.sx[s]+this.sy[s]+this.sw[s]+this.sh[s])||("selected"!==i||this.selected_mask[s])&&("unselected"===i&&this.selected_mask[s]||(t.translate(this.sx[s],this.sy[s]),t.beginPath(),t.rect(-this.sw[s]/2,-this.sh[s]/2,this.sw[s],this.sh[s]),this.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),this.do_stroke&&(e.line_properties.set(t,this.data[s]),n=this.sw[s]/2,t.moveTo(-n,+n),t.lineTo(+n,-n),t.moveTo(-n,-n),t.lineTo(+n,+n),t.stroke()),a.push(t.translate(-this.sx[s],-this.sy[s]))));return a},s.prototype.draw_legend=function(t,e,i,s,n){var o,a,l,h,p,u,c,_,d,f,g,y;return p=this.glyph_props,_=p.line_properties,h=p.fill_properties,t.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","center")[0],a=l):u=p,o=_.select(_.line_width_name,u),t.beginPath(),f=Math.abs(i-e),c=Math.abs(n-s),f-=2*o,c-=2*o,null!=l&&(f=l>f?f:l),null!=a&&(c=a>c?c:a),g=(e+i)/2-f/2,y=(s+n)/2-c/2,t.rect(g,y,f,c),h.do_fill&&(h.set(t,u),t.fill()),_.do_stroke&&(_.set(t,u),t.moveTo(g-r,y+r),t.lineTo(g+r,y-r),t.moveTo(g-r,y-r),t.lineTo(g+r,y+r),t.stroke()),t.restore()},s}(s.View),n=function(i){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=o,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/square_cross",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,o,a,l,h,p,u;return l=i.glyph_properties,h=i.line_properties,a=i.fill_properties,o=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke},s.prototype.init_glyph=function(t){var e;return e=new l(this,t,["x","y","size"],{fill_properties:new a(this,t),line_properties:new h(this,t)})},s.prototype._set_data=function(t){return this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t)},s.prototype._map_data=function(){var t;return t=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=t[0],this.sy=t[1],this.sw=this.distance(this.data,"x","size","center"),this.sh=this.sw},s.prototype._render=function(){var t,e,i,s,n,r;for(this._map_data(),t=this.plot_view.ctx,s=this.mget_obj("data_source").get("selected"),n=0,r=s.length;r>n;n++)e=s[n],this.selected_mask[e]=!0;return t.save(),this.glyph_props.fast_path?this._fast_path(t):s&&s.length&&this.nonselection_glyphprops?(i=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(t,i,"selected"),this._full_path(t,this.nonselection_glyphprops,"unselected")):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r,o;if(this.do_fill){for(this.glyph_props.fill_properties.set(t,this.glyph_props),t.beginPath(),e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e])||t.rect(this.sx[e]-this.sw[e]/2,this.sy[e]-this.sh[e]/2,this.sw[e],this.sh[e]);t.fill()}if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=n=0,o=this.sx.length-1;o>=0?o>=n:n>=o;e=o>=0?++n:--n)isNaN(this.sx[e]+this.sy[e]+this.sw[e]+this.sh[e])||(t.rect(this.sx[e]-this.sw[e]/2,this.sy[e]-this.sh[e]/2,this.sw[e],this.sh[e]),i=this.sw[e]/2,t.moveTo(this.sx[e],this.sy[e]+i),t.lineTo(this.sx[e],this.sy[e]-i),t.moveTo(this.sx[e]-i,this.sy[e]),t.lineTo(this.sx[e]+i,this.sy[e]));return t.stroke()}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)isNaN(this.sx[s]+this.sy[s]+this.sw[s]+this.sh[s])||("selected"!==i||this.selected_mask[s])&&("unselected"===i&&this.selected_mask[s]||(t.translate(this.sx[s],this.sy[s]),t.beginPath(),t.rect(-this.sw[s]/2,-this.sh[s]/2,this.sw[s],this.sh[s]),this.do_fill&&(e.fill_properties.set(t,this.data[s]),t.fill()),this.do_stroke&&(e.line_properties.set(t,this.data[s]),n=this.sw[s]/2,t.moveTo(0,+n),t.lineTo(0,-n),t.moveTo(-n,0),t.lineTo(+n,0),t.stroke()),a.push(t.translate(-this.sx[s],-this.sy[s]))));return a},s.prototype.draw_legend=function(t,e,i,s,n){var o,a,l,h,p,u,c,_,d,f,g,y;return p=this.glyph_props,_=p.line_properties,h=p.fill_properties,t.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","center")[0],a=l):u=p,o=_.select(_.line_width_name,u),t.beginPath(),f=Math.abs(i-e),c=Math.abs(n-s),f-=2*o,c-=2*o,null!=l&&(f=l>f?f:l),null!=a&&(c=a>c?c:a),g=(e+i)/2-f/2,y=(s+n)/2-c/2,t.rect(g,y,f,c),h.do_fill&&(h.set(t,u),t.fill()),_.do_stroke&&(_.set(t,u),t.moveTo(g,y+r),t.lineTo(g,y-r),t.moveTo(g-r,y),t.lineTo(g+r,y),t.stroke()),t.restore()},s}(s.View),n=function(i){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=o,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/segment",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.line_properties,r=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["x0","y0","x1","y1"],{line_properties:new a(this,e)}),this.do_stroke=this.glyph_props.line_properties.do_stroke,i.__super__.initialize.call(this,t)
},i.prototype._set_data=function(t){return this.data=t,this.x0=this.glyph_props.v_select("x0",t),this.y0=this.glyph_props.v_select("y0",t),this.x1=this.glyph_props.v_select("x1",t),this.y1=this.glyph_props.v_select("y1",t)},i.prototype._render=function(){var t,e,i;return e=this.plot_view.map_to_screen(this.x0,this.glyph_props.x0.units,this.y0,this.glyph_props.y0.units),this.sx0=e[0],this.sy0=e[1],i=this.plot_view.map_to_screen(this.x1,this.glyph_props.x1.units,this.y1,this.glyph_props.y1.units),this.sx1=i[0],this.sy1=i[1],t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},i.prototype._fast_path=function(t){var e,i,s;if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),t.beginPath(),e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e])||(t.moveTo(this.sx0[e],this.sy0[e]),t.lineTo(this.sx1[e],this.sy1[e]));return t.stroke()}},i.prototype._full_path=function(t){var e,i,s,n;if(this.do_stroke){for(n=[],e=i=0,s=this.sx0.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx0[e]+this.sy0[e]+this.sx1[e]+this.sy1[e])||(t.beginPath(),t.moveTo(this.sx0[e],this.sy0[e]),t.lineTo(this.sx1[e],this.sy1[e]),this.glyph_props.line_properties.set(t,this.data[e]),n.push(t.stroke()));return n}},i.prototype.draw_legend=function(t,e,i,s,n){var r,o,a,l;return r=this.glyph_props,a=r.line_properties,l=this.get_reference_point(),o=null!=l?l:r,a.set(t,o),t.beginPath(),t.moveTo(e,(s+n)/2),t.lineTo(i,(s+n)/2),a.do_stroke&&(a.set(t,o),t.stroke()),t.restore()},i}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/text",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h;return o=i.glyph_properties,a=i.text_properties,r=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new o(this,e,["x","y","angle","text:string"],{text_properties:new a(this,e)}),i.__super__.initialize.call(this,t)},i.prototype._set_data=function(t){var e,i,s;return this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),i=function(){var e,i,n;for(n=[],e=0,i=t.length;i>e;e++)s=t[e],n.push(this.glyph_props.select("angle",s));return n}.call(this),this.angle=function(){var t,s,n;for(n=[],t=0,s=i.length;s>t;t++)e=i[t],n.push(-e);return n}(),this.text=this.glyph_props.v_select("text",t)},i.prototype._render=function(){var t,e;return e=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=e[0],this.sy=e[1],t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},i.prototype._fast_path=function(t){var e,i,s,n;for(this.glyph_props.text_properties.set(t,this.glyph_props),n=[],e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.angle[e])||(angle[e]?(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),t.fillText(this.text[e],0,0),t.rotate(-this.angle[e]),n.push(t.translate(-this.sx[e],-this.sy[e]))):n.push(t.fillText(text[e],this.sx[e],this.sy[e])));return n},i.prototype._full_path=function(t){var e,i,s,n;for(n=[],e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.angle[e])||(t.translate(this.sx[e],this.sy[e]),t.rotate(this.angle[e]),this.glyph_props.text_properties.set(t,this.data[e]),t.fillText(this.text[e],0,0),t.rotate(-this.angle[e]),n.push(t.translate(-this.sx[e],-this.sy[e])));return n},i.prototype.draw_legend=function(t,e,i,s,n){var r,o,a,l;return r=this.glyph_props,l=r.text_properties,t.save(),a=this.get_reference_point(),o=null!=a?a:r,l.set(t,o),t.font=l.font(12),t.textAlign="right",t.textBaseline="middle",t.fillText("txt",i,(s+n)/2),t.restore()},i}(s.View),n=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{text_font:"helvetica",text_font_size:"12pt",text_font_style:"normal",text_color:"#444444",text_alpha:1,text_align:"left",text_baseline:"bottom"})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/triangle",["underscore","renderer/properties","./glyph"],function(t,s,n){var r,o,a,l,h,p,u;return l=s.glyph_properties,h=s.line_properties,a=s.fill_properties,o=function(s){function n(){return p=n.__super__.constructor.apply(this,arguments)}return e(n,s),n.prototype.initialize=function(e){var i;return n.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},n.prototype.init_glyph=function(t){var e;return e=new l(this,t,["x","y","size"],{fill_properties:new a(this,t),line_properties:new h(this,t)})},n.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},n.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},n.prototype._fast_path=function(t,e,i){var s,n,r,o,a,l,h,p,u;if(e||(e=this.glyph_props),e.fill_properties.do_fill){for(e.fill_properties.set(t,this.glyph_props),t.beginPath(),r=a=0,h=this.sx.length-1;h>=0?h>=a:a>=h;r=h>=0?++a:--a)!isNaN(this.sx[r]+this.sy[r]+this.size[r])&&this.mask[r]&&(!i||this.selected_mask[r])&&(i===!1&&this.selected_mask[r]||(s=this.size[r]*Math.sqrt(3)/6,o=this.size[r]/2,n=this.size[r]*Math.sqrt(3)/2,t.beginPath(),t.moveTo(this.sx[r]-o,this.sy[r]+s),t.lineTo(this.sx[r]+o,this.sy[r]+s),t.lineTo(this.sx[r],this.sy[r]+s-n),t.closePath()));t.fill()}if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),u=[],r=l=0,p=this.sx.length-1;p>=0?p>=l:l>=p;r=p>=0?++l:--l)!isNaN(this.sx[r]+this.sy[r]+this.size[r])&&this.mask[r]&&(!i||this.selected_mask[r])&&(i===!1&&this.selected_mask[r]||(s=this.size[r]*Math.sqrt(3)/6,o=this.size[r]/2,n=this.size[r]*Math.sqrt(3)/2,t.beginPath(),t.moveTo(this.sx[r]-o,this.sy[r]+s),t.lineTo(this.sx[r]+o,this.sy[r]+s),t.lineTo(this.sx[r],this.sy[r]+s-n),t.closePath(),u.push(t.stroke())));return u}},n.prototype._full_path=function(t,e,i){var s,n,r,o,a,l,h;for(e||(e=this.glyph_props),h=[],r=a=0,l=this.sx.length-1;l>=0?l>=a:a>=l;r=l>=0?++a:--a)!isNaN(this.sx[r]+this.sy[r]+this.size[r])&&this.mask[r]&&(!i||this.selected_mask[r])&&(i===!1&&this.selected_mask[r]||(s=this.size[r]*Math.sqrt(3)/6,o=this.size[r]/2,n=this.size[r]*Math.sqrt(3)/2,t.beginPath(),t.moveTo(this.sx[r]-o,this.sy[r]+s),t.lineTo(this.sx[r]+o,this.sy[r]+s),t.lineTo(this.sx[r],this.sy[r]+s-n),t.closePath(),e.fill_properties.do_fill&&(e.fill_properties.set(t,this.data[r]),t.fill()),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[r]),h.push(t.stroke())):h.push(void 0)));return h},n.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},n.prototype.draw_legend=function(e,s,n,r,o){var a,l,h,p,u,c,_,d,f,g,y,m,v;return c=this.glyph_props,f=c.line_properties,u=c.fill_properties,e.save(),y=this.get_reference_point(),null!=y?(_=y,p=this.distance([y],"x","size","edge")[0]):(_=c,p=c.select("size",c)["default"]),l=f.select(f.line_width_name,_),h=t.min([Math.abs(n-s),Math.abs(o-r)]),h-=2*l,g=h/2,null!=p&&(g=p>g?g:p),m=(s+n)/2,v=(r+o)/2,a=this.size[i]*Math.sqrt(3)/6,g=this.size[i]/2,d=this.size[i]*Math.sqrt(3)/2,e.beginPath(),e.moveTo(this.sx[i]-g,this.sy[i]+a),e.lineTo(this.sx[i]+g,this.sy[i]+a),e.lineTo(this.sx[i],this.sy[i]+a-d),e.closePath(),u.do_fill&&(u.set(e,_),e.fill()),f.do_stroke&&(f.set(e,_),e.stroke()),e.restore()},n}(n.View),r=function(i){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=o,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(n.Model),{Model:r,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/wedge",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){var e;return e=this.mget("glyphspec"),this.glyph_props=new a(this,e,["x","y","radius","start_angle","end_angle","direction:string"],{fill_properties:new o(this,e),line_properties:new l(this,e)}),this.do_fill=this.glyph_props.fill_properties.do_fill,this.do_stroke=this.glyph_props.line_properties.do_stroke,s.__super__.initialize.call(this,t)},s.prototype._set_data=function(t){var e,i,s,n,r,o,a,l;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),r=this.glyph_props.v_select("start_angle",t),this.start_angle=function(){var t,i,s;for(s=[],t=0,i=r.length;i>t;t++)e=r[t],s.push(-e);return s}(),s=this.glyph_props.v_select("end_angle",t),this.end_angle=function(){var t,i,n;for(n=[],t=0,i=s.length;i>t;t++)e=s[t],n.push(-e);return n}(),this.direction=new Uint8Array(this.data.length),l=[],n=o=0,a=this.data.length-1;a>=0?a>=o:o>=a;n=a>=0?++o:--o)i=this.glyph_props.select("direction",t[n]),"clock"===i?l.push(this.direction[n]=!1):"anticlock"===i?l.push(this.direction[n]=!0):l.push(this.direction[n]=0/0);return l},s.prototype._render=function(){var t,e;return e=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=e[0],this.sy=e[1],this.radius=this.distance(this.data,"x","radius","edge"),t=this.plot_view.ctx,t.save(),this.glyph_props.fast_path?this._fast_path(t):this._full_path(t),t.restore()},s.prototype._fast_path=function(t){var e,i,s,n,r,o;if(this.do_fill)for(this.glyph_props.fill_properties.set(t,this.glyph_props),e=i=0,n=this.sx.length-1;n>=0?n>=i:i>=n;e=n>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.radius[e]+this.start_angle[e]+this.end_angle[e]+this.direction[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.radius[e],this.start_angle[e],this.end_angle[e],this.direction[e]),t.lineTo(this.sx[e],this.sy[e]),t.closePath(),t.fill());if(this.do_stroke){for(this.glyph_props.line_properties.set(t,this.glyph_props),o=[],e=s=0,r=this.sx.length-1;r>=0?r>=s:s>=r;e=r>=0?++s:--s)isNaN(this.sx[e]+this.sy[e]+this.radius[e]+this.start_angle[e]+this.end_angle[e]+this.direction[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.radius[e],this.start_angle[e],this.end_angle[e],this.direction[e]),t.lineTo(this.sx[e],this.sy[e]),t.closePath(),o.push(t.stroke()));return o}},s.prototype._full_path=function(t){var e,i,s,n;for(n=[],e=i=0,s=this.sx.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)isNaN(this.sx[e]+this.sy[e]+this.radius[e]+this.start_angle[e]+this.end_angle[e]+this.direction[e])||(t.beginPath(),t.arc(this.sx[e],this.sy[e],this.radius[e],this.start_angle[e],this.end_angle[e],this.direction[e]),t.lineTo(this.sx[e],this.sy[e]),t.closePath(),this.do_fill&&(this.glyph_props.fill_properties.set(t,this.data[e]),t.fill()),this.do_stroke?(this.glyph_props.line_properties.set(t,this.data[e]),n.push(t.stroke())):n.push(void 0));return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g,y,m,v,w;return _=this.glyph_props,f=_.line_properties,c=_.fill_properties,e.save(),y=this.get_reference_point(),null!=y?(d=y,h=this.distance([y],"x","radius","edge")[0],m=-this.glyph_props.select("start_angle",y),u=-this.glyph_props.select("end_angle",y)):(d=_,m=-.1,u=-3.9),o=u-m,p=this.glyph_props.select("direction",d),p="clock"===p?!1:!0,a=f.select(f.line_width_name,d),l=t.min([Math.abs(s-i),Math.abs(r-n)]),l-=2*a,g=l/2,null!=h&&(g=h>g?g:h),e.beginPath(),v=(i+s)/2,w=(n+r)/2,e.arc(v,w,g,m,u,p),e.lineTo(v,w),e.closePath(),c.do_fill&&(c.set(e,d),e.fill()),f.do_stroke&&(f.set(e,d),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{direction:"anticlock",fill_color:"gray",fill_alpha:1,line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/x",["underscore","renderer/properties","./glyph"],function(t,i,s){var n,r,o,a,l,h,p;return a=i.glyph_properties,l=i.line_properties,o=i.fill_properties,r=function(i){function s(){return h=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){var i;return s.__super__.initialize.call(this,e),this.glyph_props=this.init_glyph(this.mget("glyphspec")),this.mget("selection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("selection_glyphspec")),this.selection_glyphprops=this.init_glyph(i)),this.mget("nonselection_glyphspec")&&(i=t.extend({},this.mget("glyphspec"),this.mget("nonselection_glyphspec")),this.nonselection_glyphprops=this.init_glyph(i)),this.have_new_data=!1},s.prototype.init_glyph=function(t){var e;return e=new a(this,t,["x","y","size"],{fill_properties:new o(this,t),line_properties:new l(this,t)})},s.prototype._set_data=function(t){var e,i,s;for(this.data=t,this.x=this.glyph_props.v_select("x",t),this.y=this.glyph_props.v_select("y",t),this.mask=new Uint8Array(t.length),this.selected_mask=new Uint8Array(t.length),e=i=0,s=this.mask.length-1;s>=0?s>=i:i>=s;e=s>=0?++i:--i)this.mask[e]=!0,this.selected_mask[e]=!1;return this.have_new_data=!0},s.prototype._render=function(t,e){var i,s,n,r,o,a,l,h,p,u,c,_;for(null==e&&(e=!0),c=this.plot_view.map_to_screen(this.x,this.glyph_props.x.units,this.y,this.glyph_props.y.units),this.sx=c[0],this.sy=c[1],o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),(this.have_new_data||e)&&(this.size=this.distance(this.data,"x","size","edge"),this.have_new_data=!1),o=this.plot_view.view_state.get("outer_width"),r=this.plot_view.view_state.get("outer_height"),s=h=0,_=this.mask.length-1;_>=0?_>=h:h>=_;s=_>=0?++h:--h)this.mask[s]=this.sx[s]+this.size[s]<0||this.sx[s]-this.size[s]>o||this.sy[s]+this.size[s]<0||this.sy[s]-this.size[s]>r?!1:!0;for(l=this.mget_obj("data_source").get("selected"),p=0,u=l.length;u>p;p++)n=l[p],this.selected_mask[n]=!0;return i=this.plot_view.ctx,i.save(),this.glyph_props.fast_path?l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._fast_path(i,a,!0),this._fast_path(i,this.nonselection_glyphprops,!1)):this._fast_path(i):l&&l.length&&this.nonselection_glyphprops?(a=this.selection_glyphprops?this.selection_glyphprops:this.glyph_props,this._full_path(i,a,!0),this._full_path(i,this.nonselection_glyphprops,!1)):this._full_path(i),i.restore()},s.prototype._fast_path=function(t,e,i){var s,n,r,o,a;if(e.line_properties.do_stroke){for(e.line_properties.set(t,this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s]-n,this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]-n),t.lineTo(this.sx[s]+n,this.sy[s]+n),a.push(t.stroke())));return a}},s.prototype._full_path=function(t,e,i){var s,n,r,o,a;for(e||(e=this.glyph_props),a=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)!isNaN(this.sx[s]+this.sy[s]+this.size[s])&&this.mask[s]&&(!i||this.selected_mask[s])&&(i===!1&&this.selected_mask[s]||(n=this.size[s]/2,t.beginPath(),t.moveTo(this.sx[s]-n,this.sy[s]+n),t.lineTo(this.sx[s]+n,this.sy[s]-n),t.moveTo(this.sx[s]-n,this.sy[s]-n),t.lineTo(this.sx[s]+n,this.sy[s]+n),e.line_properties.do_stroke?(e.line_properties.set(t,this.data[s]),a.push(t.stroke())):a.push(void 0)));return a},s.prototype.select=function(e,i){var s,n,r,o;for(e=[this.plot_view.view_state.sx_to_device(e[0]),this.plot_view.view_state.sx_to_device(e[1])],i=[this.plot_view.view_state.sy_to_device(i[0]),this.plot_view.view_state.sy_to_device(i[1])],e=[t.min(e),t.max(e)],i=[t.min(i),t.max(i)],n=[],s=r=0,o=this.sx.length-1;o>=0?o>=r:r>=o;s=o>=0?++r:--r)e&&(this.sx[s]<e[0]||this.sx[s]>e[1])||i&&(this.sy[s]<i[0]||this.sy[s]>i[1])||n.push(s);return n},s.prototype.draw_legend=function(e,i,s,n,r){var o,a,l,h,p,u,c,_,d,f,g;return p=this.glyph_props,c=p.line_properties,h=p.fill_properties,e.save(),d=this.get_reference_point(),null!=d?(u=d,l=this.distance([d],"x","size","edge")[0]):(u=p,l=p.select("size",p)["default"]),o=c.select(c.line_width_name,u),e.beginPath(),a=t.min([Math.abs(s-i),Math.abs(r-n)]),a-=2*o,_=a/2,null!=l&&(_=l>_?_:l),f=(i+s)/2,g=(n+r)/2,e.moveTo(f-_,g+_),e.lineTo(f+_,g-_),e.moveTo(f-_,g-_),e.lineTo(f+_,g+_),c.do_stroke&&(c.set(e,u),e.stroke()),e.restore()},s}(s.View),n=function(i){function s(){return p=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=r,s.prototype.type="Glyph",s.prototype.display_defaults=function(){return t.extend(s.__super__.display_defaults.call(this),{line_color:"red",line_width:1,line_alpha:1,line_join:"miter",line_cap:"butt",line_dash:[],line_dash_offset:0})},s}(s.Model),{Model:n,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/glyph/glyph_factory",["require","exports","module","underscore","common/has_parent","common/plot_widget","./annular_wedge","./annulus","./arc","./asterisk","./bezier","./circle","./circle_x","./circle_cross","./diamond","./diamond_cross","./image","./image_rgba","./image_uri","./inverted_triangle","./line","./multi_line","./oval","./patch","./patches","./cross","./quad","./quadratic","./ray","./rect","./square","./square_x","./square_cross","./segment","./text","./triangle","./wedge","./x"],function(t){var i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T,C,M,z,P,j,N,$,S,A,E,F,D,q,O,B;return O=t("underscore"),s=t("common/has_parent"),n=t("common/plot_widget"),r=t("./annular_wedge"),o=t("./annulus"),a=t("./arc"),l=t("./asterisk"),h=t("./bezier"),p=t("./circle"),c=t("./circle_x"),u=t("./circle_cross"),d=t("./diamond"),f=t("./diamond_cross"),y=t("./image"),m=t("./image_rgba"),v=t("./image_uri"),w=t("./inverted_triangle"),x=t("./line"),b=t("./multi_line"),k=t("./oval"),T=t("./patch"),C=t("./patches"),_=t("./cross"),M=t("./quad"),z=t("./quadratic"),P=t("./ray"),j=t("./rect"),$=t("./square"),A=t("./square_x"),S=t("./square_cross"),N=t("./segment"),E=t("./text"),F=t("./triangle"),D=t("./wedge"),q=t("./x"),g={annular_wedge:r.Model,annulus:o.Model,arc:a.Model,asterisk:l.Model,bezier:h.Model,circle:p.Model,circle_x:c.Model,circle_cross:u.Model,diamond:d.Model,diamond_cross:f.Model,image:y.Model,image_rgba:m.Model,image_uri:v.Model,inverted_triangle:w.Model,line:x.Model,multi_line:b.Model,oval:k.Model,patch:T.Model,patches:C.Model,cross:_.Model,quad:M.Model,quadratic:z.Model,ray:P.Model,square:$.Model,square_x:A.Model,square_cross:S.Model,rect:j.Model,segment:N.Model,text:E.Model,triangle:F.Model,wedge:D.Model,x:q.Model},i=function(t){function i(){return B=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=function(t,e){var i,s,n;return null==(null!=(n=t.glyphspec)?n.type:void 0)?(console.log("missing glyph type"),void 0):(s=t.glyphspec.type,s in g?(i=g[s],new i(t,e)):(console.log("unknown glyph type '"+s+"'"),void 0))},i}(Backbone.Collection),{Collection:new i}})}.call(this),!function(t){"object"==typeof module&&module.exports?module.exports=t():"function"==typeof s?s("timezone",t):this.tz=t()}(function(){function t(t,e,i){var s,n=e.day[1];do s=new Date(Date.UTC(i,e.month,Math.abs(n++)));while(e.day[0]<7&&s.getUTCDay()!=e.day[0]);return s={clock:e.clock,sort:s.getTime(),rule:e,save:6e4*e.save,offset:t.offset},s[s.clock]=s.sort+6e4*e.time,s.posix?s.wallclock=s[s.clock]+(t.offset+e.saved):s.posix=s[s.clock]-(t.offset+e.saved),s}function e(e,i,s){var n,r,o,a,l,h,p,u=e[e.zone],c=[],_=new Date(s).getUTCFullYear(),d=1;for(n=1,r=u.length;r>n&&!(u[n][i]<=s);n++);if(o=u[n],o.rules){for(h=e[o.rules],p=_+1;p>=_-d;--p)for(n=0,r=h.length;r>n;n++)h[n].from<=p&&p<=h[n].to?c.push(t(o,h[n],p)):h[n].to<p&&1==d&&(d=p-h[n].to);for(c.sort(function(t,e){return t.sort-e.sort}),n=0,r=c.length;r>n;n++)s>=c[n][i]&&c[n][c[n].clock]>o[c[n].clock]&&(a=c[n])}return a&&(a.abbrev=(l=/^(.*)\/(.*)$/.exec(o.format))?l[a.save?2:1]:o.format.replace(/%s/,a.rule.letter)),a||o}function i(t,i){return"UTC"==t.zone?i:(t.entry=e(t,"posix",i),i+t.entry.offset+t.entry.save)}function s(t,i){if("UTC"==t.zone)return i;var s,n;return t.entry=s=e(t,"wallclock",i),n=i-s.wallclock,n>0&&n<s.save?null:i-s.offset-s.save}function n(t,e,n){var r,o=+(n[1]+1),a=n[2]*o,l=h.indexOf(n[3].toLowerCase());if(l>9)e+=a*u[l-10];else{if(r=new Date(i(t,e)),7>l)for(;a;)r.setUTCDate(r.getUTCDate()+o),r.getUTCDay()==l&&(a-=o);else 7==l?r.setUTCFullYear(r.getUTCFullYear()+a):8==l?r.setUTCMonth(r.getUTCMonth()+a):r.setUTCDate(r.getUTCDate()+a);null==(e=s(t,r.getTime()))&&(e=s(t,r.getTime()+864e5*o)-864e5*o)}return e}function r(t){if(!t.length)return"0.0.23";var e,r,o,a,l,h=Object.create(this),u=[];for(e=0;e<t.length;e++)if(a=t[e],Array.isArray(a))e||isNaN(a[1])?a.splice.apply(t,[e--,1].concat(a)):l=a;else if(isNaN(a)){if(o=typeof a,"string"==o)~a.indexOf("%")?h.format=a:e||"*"!=a?!e&&(o=/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|(([+-])(\d{2}(:\d{2}){0,2})))?)?$/.exec(a))?(l=[],l.push.apply(l,o.slice(1,8)),o[9]?(l.push(o[10]+1),l.push.apply(l,o[11].split(/:/))):o[8]&&l.push(1)):/^\w{2,3}_\w{2}$/.test(a)?h.locale=a:(o=p.exec(a))?u.push(o):h.zone=a:l=a;else if("function"==o){if(o=a.call(h))return o}else if(/^\w{2,3}_\w{2}$/.test(a.name))h[a.name]=a;else if(a.zones){for(o in a.zones)h[o]=a.zones[o];for(o in a.rules)h[o]=a.rules[o]}}else e||(l=a);if(h[h.locale]||delete h.locale,h[h.zone]||delete h.zone,null!=l){if("*"==l)l=h.clock();else if(Array.isArray(l)){for(r=!l[7],e=0;11>e;e++)l[e]=+(l[e]||0);--l[1],l=Date.UTC.apply(Date.UTC,l.slice(0,8))+-l[7]*(36e5*l[8]+6e4*l[9]+1e3*l[10])}else l=Math.floor(l);if(!isNaN(l)){if(r&&(l=s(h,l)),null==l)return l;for(e=0,r=u.length;r>e;e++)l=n(h,l,u[e]);return h.format?(o=new Date(i(h,l)),h.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,function(t,e,i,s,n){var r,a,p="0";if(r=h[n]){for(t=String(r.call(h,o,l,e,i.length)),"_"==(e||r.style)&&(p=" "),a="-"==e?0:r.pad||0;t.length<a;)t=p+t;for(a="-"==e?0:s||r.pad;t.length<a;)t=p+t;"N"==n&&a<t.length&&(t=t.slice(0,a)),"^"==e&&(t=t.toUpperCase())}return t})):l}}return function(){return h.convert(arguments)}}function o(t,e){var i,s,n;return s=new Date(Date.UTC(t.getUTCFullYear(),0)),i=Math.floor((t.getTime()-s.getTime())/864e5),s.getUTCDay()==e?n=0:(n=7-s.getUTCDay()+e,8==n&&(n=1)),i>=n?Math.floor((i-n)/7)+1:0}function a(t){var e,i,s;return i=t.getUTCFullYear(),e=new Date(Date.UTC(i,0)).getUTCDay(),s=o(t,1)+(e>1&&4>=e?1:0),s?53!=s||4==e||3==e&&29==new Date(i,1,29).getDate()?[s,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(i=t.getUTCFullYear()-1,e=new Date(Date.UTC(i,0)).getUTCDay(),s=4==e||3==e&&29==new Date(i,1,29).getDate()?53:52,[s,t.getUTCFullYear()-1])}var l={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(t,e,i,s){var n,r,o=this.entry.offset+this.entry.save,a=Math.abs(o/1e3),l=[],h=3600;for(n=0;3>n;n++)l.push(("0"+Math.floor(a/h)).slice(-2)),a%=h,h/=60;return"^"!=i||o?("^"==i&&(s=3),3==s?(r=l.join(":"),r=r.replace(/:00$/,""),"^"!=i&&(r=r.replace(/:00$/,""))):s?(r=l.slice(0,s+1).join(":"),"^"==i&&(r=r.replace(/:00$/,""))):r=l.slice(0,2).join(""),r=(0>o?"-":"+")+r,r=r.replace(/([-+])(0)/,{_:" $1","-":"$1"}[i]||"$1$2")):"Z"},"%":function(){return"%"},n:function(){return"\n"},t:function(){return"	"},U:function(t){return o(t,0)},W:function(t){return o(t,1)},V:function(t){return a(t)[0]},G:function(t){return a(t)[1]},g:function(t){return a(t)[1]%100},j:function(t){return Math.floor((t.getTime()-Date.UTC(t.getUTCFullYear(),0))/864e5)+1},s:function(t){return Math.floor(t.getTime()/1e3)},C:function(t){return Math.floor(t.getUTCFullYear()/100)},N:function(t){return 1e6*(t.getTime()%1e3)},m:function(t){return t.getUTCMonth()+1},Y:function(t){return t.getUTCFullYear()},y:function(t){return t.getUTCFullYear()%100},H:function(t){return t.getUTCHours()},M:function(t){return t.getUTCMinutes()},S:function(t){return t.getUTCSeconds()},e:function(t){return t.getUTCDate()},d:function(t){return t.getUTCDate()},u:function(t){return t.getUTCDay()||7},w:function(t){return t.getUTCDay()},l:function(t){return t.getUTCHours()%12||12},I:function(t){return t.getUTCHours()%12||12},k:function(t){return t.getUTCHours()},Z:function(){return this.entry.abbrev},a:function(t){return this[this.locale].day.abbrev[t.getUTCDay()]},A:function(t){return this[this.locale].day.full[t.getUTCDay()]},h:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},b:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},B:function(t){return this[this.locale].month.full[t.getUTCMonth()]},P:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)].toLowerCase()},p:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)]},R:function(t,e){return this.convert([e,"%H:%M"])},T:function(t,e){return this.convert([e,"%H:%M:%S"])},D:function(t,e){return this.convert([e,"%m/%d/%y"])},F:function(t,e){return this.convert([e,"%Y-%m-%d"])},x:function(t,e){return this.convert([e,this[this.locale].date])},r:function(t,e){return this.convert([e,this[this.locale].time12||"%I:%M:%S"])},X:function(t,e){return this.convert([e,this[this.locale].time24])},c:function(t,e){return this.convert([e,this[this.locale].dateTime])},convert:r,locale:"en_US",en_US:{date:"%m/%d/%Y",time24:"%I:%M:%S %p",time12:"%I:%M:%S %p",dateTime:"%a %d %b %Y %I:%M:%S %p %Z",meridiem:["AM","PM"],month:{abbrev:"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|"),full:"January|February|March|April|May|June|July|August|September|October|November|December".split("|")},day:{abbrev:"Sun|Mon|Tue|Wed|Thu|Fri|Sat".split("|"),full:"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|")}}},h="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",p=new RegExp("^\\s*([+-])(\\d+)\\s+("+h+")s?\\s*$","i"),u=[36e5,6e4,1e3,1];return h=h.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,function(t){l[t].pad=2}),l.N.pad=9,l.j.pad=3,l.k.style="_",l.l.style="_",l.e.style="_",function(){return l.convert(arguments)}}),function(t){function e(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function i(t,e){for(var i=[];e>0;i[--e]=t);return i.join("")}var s=function(){return s.cache.hasOwnProperty(arguments[0])||(s.cache[arguments[0]]=s.parse(arguments[0])),s.format.call(null,s.cache[arguments[0]],arguments)};s.format=function(t,n){var r,o,a,l,h,p,u,c=1,_=t.length,d="",f=[];for(o=0;_>o;o++)if(d=e(t[o]),"string"===d)f.push(t[o]);else if("array"===d){if(l=t[o],l[2])for(r=n[c],a=0;a<l[2].length;a++){if(!r.hasOwnProperty(l[2][a]))throw s('[sprintf] property "%s" does not exist',l[2][a]);r=r[l[2][a]]}else r=l[1]?n[l[1]]:n[c++];if(/[^s]/.test(l[8])&&"number"!=e(r))throw s("[sprintf] expecting number but found %s",e(r));switch(l[8]){case"b":r=r.toString(2);break;case"c":r=String.fromCharCode(r);break;case"d":r=parseInt(r,10);break;case"e":r=l[7]?r.toExponential(l[7]):r.toExponential();break;case"f":r=l[7]?parseFloat(r).toFixed(l[7]):parseFloat(r);break;case"o":r=r.toString(8);break;case"s":r=(r=String(r))&&l[7]?r.substring(0,l[7]):r;break;case"u":r>>>=0;break;case"x":r=r.toString(16);break;case"X":r=r.toString(16).toUpperCase()}r=/[def]/.test(l[8])&&l[3]&&r>=0?"+"+r:r,p=l[4]?"0"==l[4]?"0":l[4].charAt(1):" ",u=l[6]-String(r).length,h=l[6]?i(p,u):"",f.push(l[5]?r+h:h+r)}return f.join("")},s.cache={},s.parse=function(t){for(var e=t,i=[],s=[],n=0;e;){if(null!==(i=/^[^\x25]+/.exec(e)))s.push(i[0]);else if(null!==(i=/^\x25{2}/.exec(e)))s.push("%");else{if(null===(i=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(e)))throw"[sprintf] huh?";if(i[2]){n|=1;var r=[],o=i[2],a=[];if(null===(a=/^([a-z_][a-z_\d]*)/i.exec(o)))throw"[sprintf] huh?";for(r.push(a[1]);""!==(o=o.substring(a[0].length));)if(null!==(a=/^\.([a-z_][a-z_\d]*)/i.exec(o)))r.push(a[1]);else{if(null===(a=/^\[(\d+)\]/.exec(o)))throw"[sprintf] huh?";r.push(a[1])}i[2]=r}else n|=2;if(3===n)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";s.push(i)}e=e.substring(i[0].length)
}return s};var n=function(t,e,i){return i=e.slice(0),i.splice(0,0,t),s.apply(null,i)};t.sprintf=s,t.vsprintf=n}("undefined"!=typeof exports?exports:window),s("sprintf",function(t){return function(){var e;return e||t.sprintf}}(this)),function(){s("common/ticking",["underscore","timezone","sprintf"],function(t,e,i){var s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T;return f=function(t){"Returns the base 10 logarithm of a number.";return 0===t&&(t+=1e-16),Math.log(t)/Math.LN10},g=function(t){"Returns the base 2 logarithm of a number.";return 0===t&&(t+=1e-16),Math.log(t)/Math.LN2},d=function(t){" Returns True if rng is a positive multiple of 2 ";var e;return 0>=t?!1:(e=g(t),e>0&&e===Math.floor(e))},m=function(t,e){var i,s,n;return null==e&&(e=!1),i=Math.floor(f(t)),s=t/Math.pow(10,i),n=e?1.5>s?1:3>s?2:7.5>s?5:10:1>=s?1:2>=s?2:5>=s?5:10,n*Math.pow(10,i)},y=function(t,e){var i;return null==e&&(e=!1),i=Math.floor(f(1.0001*t)),Math.pow(10,i)},_=function(t,e,i,s,n){var r,o,a,l;return null==i&&(i=8),null==s&&(s=m),null==n&&(n=!1),l=s(e-t),r=s(l/(i-1),!0),n?(a=Math.floor(t/r)*r,o=Math.ceil(e/r)*r):(a=Math.ceil(t/r)*r,o=Math.floor(e/r)*r),[a,o,r]},r=function(t,e,i){var s,n;if(null==e&&(e=!1),null==i&&(i=!1),e||(e=t,t=0),t>e&&i===!1&&(i=-1),i||(i=1),n=[],s=t,e>t)for(;e>s;)n.push(s),s+=i;else for(;s>e;)n.push(s),s+=i;return n},u=function(t,e,i,s,n,o,a){var l,p,u,c,_,f,g,y,m,v,w,x,b,k,T,C,M;if(null==o&&(o=!1),null==a&&(a=!0),y="auto"===i,g="auto"===s,m="string"==typeof i?t:i,k="string"==typeof s?e:s,"auto"===n||0===n)v=Math.abs(k-m),0===v?(n=.5,m=t-.5,k=e+.5):n=d(v)&&d(k)&&v>4?2===v?1:4===v?4:v/4:h(m,k);else if(0>n&&(f=-n,n=tick_intervals(m,k,f),y&&g)){for(y=g=!1,m=n*Math.floor(m/n);Math.abs(m)>=n&&m+n*(f-1)>=k;)m-=n;k=m+n*f}if((y||g)&&(u=.01*n*(t===e),C=auto_bounds(t-u,e+u,n),l=C[0],p=C[1],y&&(m=l),g&&(k=p)),w=Math.floor(m/n)*n,c=Math.floor(k/n)*n,w===c&&(m=w-=n,k=c=w-n),k>c&&(c+=n),b=r(w,c+n/2,n),a)for(_=T=0,M=b.length-1;M>=0?M>=T:T>=M;_=M>=0?++T:--T)Math.abs(b[_])<n/1e3&&(b[_]=0);return!y&&o&&(b[0]=m),!g&&o&&(b[b.length-1]=k),function(){var t,e,n;for(n=[],t=0,e=b.length;e>t;t++)x=b[t],x>=i&&s>=x&&n.push(x);return n}()},a=function(t,e){var i,s,n,r;for(i=[],n=0,r=e.length;r>n;n++)s=e[n],i.push(t/s);return i},l=function(t,e){var i,s,n,r,o;for(s=[],i=r=0,o=e.length;o>r;i=++r)n=e[i],s.push(t[i]/n);return s},o=function(e){var i,s,n,r,o,a;for(n=t.sortBy(e,t.identity),s=[],i=o=0,a=n.length;a>o;i=++o)r=n[i],s[i]=e.indexOf(r);return s},c=function(t){return t+0},p=function(e,i){" Calculates the tick interval for a range.\n\nThe boundaries for the data to be plotted on the axis are::\n\n    data_bounds = (data_low,data_high)\n\nThe function chooses the number of tick marks, which can be between\n3 and 9 marks (including end points), and chooses tick intervals at\n1, 2, 2.5, 5, 10, 20, ...\n\nReturns\n-------\ninterval: float\n    tick mark interval for axis";var s,n,r,h,p,u,_,d,g,y,m,v,w,x,b,k,T,C,M,z;for(b=c(i)-c(e),p=[8,7,6,5,4,3],r=a(b,p),m=r.map(function(t){return Math.pow(10,Math.floor(f(t)))}),w=l(r,m),g=[1,2,2.5,5,10],n=[],s=[],T=0,M=g.length;M>T;T++)x=g[T],h=w.map(function(t){return Math.abs(x-t)}),s.push(t.min(h));for(C=0,z=w.length;z>C;C++)_=w[C],h=g.map(function(t){return Math.abs(_-t)}),n.push(t.min(h));return d=o(s)[0],v=o(n)[0],u=g[d],y=m[v],k=u*y},h=p,s=function(){function e(t,e,i,s){this.precision=null!=t?t:"auto",this.use_scientific=null!=e?e:!0,this.power_limit_high=null!=i?i:5,this.power_limit_low=null!=s?s:-3,this.scientific_limit_low=Math.pow(10,s),this.scientific_limit_high=Math.pow(10,i),this.last_precision=3}return e.prototype.format=function(e){var i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x;if(0===e.length)return[];if(h=0,e.length>=2&&(h=Math.abs(e[1]-e[0])/1e4),r=!1,this.use_scientific)for(p=0,d=e.length;d>p;p++)if(o=e[p],a=Math.abs(o),a>h&&(a>=this.scientific_limit_high||a<=this.scientific_limit_low)){r=!0;break}if(t.isNumber(this.precision)){if(n=new Array(e.length),r)for(i=u=0,y=e.length-1;y>=0?y>=u:u>=y;i=y>=0?++u:--u)n[i]=e[i].toExponential(this.precision);else for(i=c=0,m=e.length-1;m>=0?m>=c:c>=m;i=m>=0?++c:--c)n[i]=e[i].toPrecision(this.precision).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");return n}if("auto"===this.precision)for(n=new Array(e.length),l=_=v=this.last_precision;15>=v?15>=_:_>=15;l=15>=v?++_:--_){if(s=!0,r){for(i=f=0,w=e.length-1;w>=0?w>=f:f>=w;i=w>=0?++f:--f)if(n[i]=e[i].toExponential(l),i>0&&n[i]===n[i-1]){s=!1;break}if(s)break}else{for(i=g=0,x=e.length-1;x>=0?x>=g:g>=x;i=x>=0?++g:--g)if(n[i]=e[i].toPrecision(l).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),i>0&&n[i]===n[i-1]){s=!1;break}if(s)break}if(s)return this.last_precision=l,n}return n},e}(),T=function(t){return i("%3dus",Math.floor(1e3*(t%1)))},x=function(t){var e,s;return e=Math.floor(1e3*(t/1e3%1)),s=Math.floor(1e3*(t%1)),i("%3d.%3dms",e,s)},k=function(t){var e,s;return e=new Date(t),s=e.getFullYear(),e.getMonth()>=7&&(s+=1),i("'%02d",s%100)},w=function(t){var e,s;return e=new Date(t),s=e.getFullYear(),e.getMonth()>=7&&(s+=1),i("%d",s)},v=function(t){return e(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})},b=function(i,s){return t.isFunction(s)?s(i):e(i,s)},n=function(){function t(){var t,i,s,n,r,o,a,l;this._formats={microseconds:[T,x],milliseconds:["%3Nms","%S.%3Ns"],seconds:[":%S","%Ss"],minsec:["%M:%S"],minutes:["%Mm"],hourmin:["%H:%M"],hours:["%Hh","%H:%M"],days:["%m/%d","%a%d"],months:["%m/%Y","%b%y"],years:["%Y",k,w]},this.formats={};for(i in this._formats){for(s=this._formats[i],r=[],o=e(new Date),a=0,l=s.length;l>a;a++)t=s[a],n=b(o,t).length,r.push(n);this.formats[i]=[r,s]}}return t.prototype.format_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],t.prototype.strip_leading_zeros=!0,t.prototype._get_resolution=function(t,e){var i,s,n;return i=t,n=e,s=5e-4>i?"microseconds":.5>i?"milliseconds":60>i?n>60?"minsec":"seconds":3600>i?n>3600?"hourmin":"minutes":86400>i?"hours":2592e3>i?"days":31536e3>i?"months":"years"},t.prototype.format=function(t,e,i,s,n){var r,o,a,l,h,p,u,c,_,d,f,g,y,m,w,x,k,T,C,M,z,P,j,N,$,S,A,E,F;if(null==e&&(e=null),null==i&&(i=null),null==s&&(s=.3),null==n&&(n=null),0===t.length)return[];if(x=Math.abs(t[t.length-1]-t[0])/1e3,g=n?n.resolution:x/(t.length-1),y=this._get_resolution(g,x),A=this.formats[y],z=A[0],h=A[1],l=h[0],i){for(p=[],c=P=0,E=z.length-1;E>=0?E>=P:P>=E;c=E>=0?++P:--P)z[c]*t.length<s*i&&p.push(this.formats[c]);p.length>0&&(l=p[t.length-1])}for(_=[],m=this.format_order.indexOf(y),C={},F=this.format_order,j=0,$=F.length;$>j;j++)a=F[j],C[a]=0;for(C.seconds=5,C.minsec=4,C.minutes=4,C.hourmin=3,C.hours=3,N=0,S=t.length;S>N;N++){T=t[N];try{r=Date(T),M=v(T),w=b(T,l)}catch(D){o=D,console.log(o),console.log("Unable to convert tick for timestamp "+T),_.push("ERR");continue}for(u=!1,f=m;0===M[C[this.format_order[f]]]&&(f+=1,f!==this.format_order.length);){if(("minsec"===y||"hourmin"===y)&&!u){if("minsec"===y&&0===M[4]&&0!==M[5]||"hourmin"===y&&0===M[3]&&0!==M[4]){d=this.formats[this.format_order[m-1]][1][0],w=b(T,d);break}u=!0}d=this.formats[this.format_order[f]][1][0],w=b(T,d)}this.strip_leading_zeros?(k=w.replace(/^0+/g,""),k===w||""!==k&&isFinite(k[0])||(k="0"+k),_.push(k)):_.push(w)}return _},t}(),{argsort:o,nice_2_5_10:m,nice_10:y,heckbert_interval:_,auto_ticks:u,auto_interval:h,BasicTickFormatter:s,DatetimeFormatter:n}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/guide/linear_axis",["underscore","backbone","common/safebind","common/has_parent","common/ticking","common/plot_widget","renderer/properties"],function(t,i,s,n,r,o,a){var l,h,p,u,c,_,d,f,g,y,m,v,w;return u=a.glyph_properties,c=a.line_properties,d=a.text_properties,_=function(t){var e;return null!=(e=null!=t?t:0>t)?e:-{1:{1:0}}},g={top:{parallel:0,normal:-Math.PI/2,horizontal:0,vertical:-Math.PI/2},bottom:{parallel:0,normal:Math.PI/2,horizontal:0,vertical:Math.PI/2},left:{parallel:-Math.PI/2,normal:0,horizontal:0,vertical:-Math.PI/2},right:{parallel:Math.PI/2,normal:0,horizontal:0,vertical:Math.PI/2}},y={top:{parallel:"alphabetic",normal:"middle",horizontal:"alphabetic",vertical:"middle"},bottom:{parallel:"hanging",normal:"middle",horizontal:"hanging",vertical:"middle"},left:{parallel:"alphabetic",normal:"middle",horizontal:"middle",vertical:"alphabetic"},right:{parallel:"alphabetic",normal:"middle",horizontal:"middle",vertical:"alphabetic"}},f={top:{parallel:"center",normal:"left",horizontal:"center",vertical:"left"},bottom:{parallel:"center",normal:"left",horizontal:"center",vertical:"right"},left:{parallel:"center",normal:"right",horizontal:"right",vertical:"center"},right:{parallel:"center",normal:"left",horizontal:"left",vertical:"center"}},p=function(i){function n(){return m=n.__super__.constructor.apply(this,arguments)}return e(n,i),n.prototype.initialize=function(t,e){return n.__super__.initialize.call(this,t,e),this.rule_props=new c(this,null,"axis_"),this.major_tick_props=new c(this,null,"major_tick_"),this.major_label_props=new d(this,null,"major_label_"),this.axis_label_props=new d(this,null,"axis_label_"),this.formatter=new r.BasicTickFormatter},n.prototype.render=function(){var t;return t=this.plot_view.ctx,t.save(),this._draw_rule(t),this._draw_major_ticks(t),this._draw_major_labels(t),this._draw_axis_label(t),t.restore()},n.prototype.bind_bokeh_events=function(){return s(this,this.model,"change",this.request_render)},n.prototype.padding_request=function(){return this._padding_request()},n.prototype._draw_rule=function(t){var e,i,s,n,r,o,a,l,h,p;if(this.rule_props.do_stroke){for(l=e=this.mget("rule_coords"),r=l[0],o=l[1],h=this.plot_view.map_to_screen(r,"data",o,"data"),s=h[0],n=h[1],this.rule_props.set(t,this),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(n[0])),i=a=1,p=s.length-1;p>=1?p>=a:a>=p;i=p>=1?++a:--a)t.lineTo(Math.round(s[i]),Math.round(n[i]));t.stroke()}},n.prototype._draw_major_ticks=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f;if(this.major_tick_props.do_stroke)for(c=e=this.mget("major_coords"),h=c[0],p=c[1],_=this.plot_view.map_to_screen(h,"data",p,"data"),r=_[0],o=_[1],d=this.mget("normals"),s=d[0],n=d[1],a=this.mget("major_tick_in"),l=this.mget("major_tick_out"),this.major_tick_props.set(t,this),i=u=0,f=r.length-1;f>=0?f>=u:u>=f;i=f>=0?++u:--u)t.beginPath(),t.moveTo(Math.round(r[i]+s*l),Math.round(o[i]+n*l)),t.lineTo(Math.round(r[i]-s*a),Math.round(o[i]-n*a)),t.stroke()},n.prototype._draw_major_labels=function(e){var i,s,n,r,o,a,l,h,p,u,c,_,d,f,y,m,v,w,x;for(m=s=this.mget("major_coords"),d=m[0],f=m[1],v=this.plot_view.map_to_screen(d,"data",f,"data"),c=v[0],_=v[1],w=this.mget("normals"),a=w[0],l=w[1],n=this.mget("dimension"),p=this.mget("side"),h=this.mget("major_label_orientation"),i=t.isString(h)?g[p][h]:-h,u=this._tick_extent()+this.mget("major_label_standoff"),o=this.formatter.format(s[n]),this.major_label_props.set(e,this),this._apply_location_heuristics(e,p,h),r=y=0,x=c.length-1;x>=0?x>=y:y>=x;r=x>=0?++y:--y)i?(e.translate(c[r]+a*u,_[r]+l*u),e.rotate(i),e.fillText(o[r],0,0),e.rotate(-i),e.translate(-c[r]-a*u,-_[r]-l*u)):e.fillText(o[r],Math.round(c[r]+a*u),Math.round(_[r]+l*u))},n.prototype._draw_axis_label=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_,d;i=this.mget("axis_label"),null!=i&&(c=this.mget("rule_coords"),p=c[0],u=c[1],_=this.plot_view.map_to_screen(p,"data",u,"data"),l=_[0],h=_[1],d=this.mget("normals"),s=d[0],n=d[1],o=this.mget("side"),r="parallel",e=g[o][r],a=this._tick_extent()+this._tick_label_extent()+this.mget("axis_label_standoff"),l=(l[0]+l[l.length-1])/2,h=(h[0]+h[h.length-1])/2,this.axis_label_props.set(t,this),this._apply_location_heuristics(t,o,r),e?(t.translate(l+s*a,h+n*a),t.rotate(e),t.fillText(i,0,0),t.rotate(-e),t.translate(-l-s*a,-h-n*a)):t.fillText(i,l+s*a,h+n*a))},n.prototype._apply_location_heuristics=function(e,i,s){var n,r;return t.isString(s)?(r=y[i][s],n=f[i][s]):0===s?(r=y[i][s],n=f[i][s]):0>s?(r="middle","top"===i?n="right":"bottom"===i?n="left":"left"===i?n="right":"right"===i&&(n="left")):s>0&&(r="middle","top"===i?n="left":"bottom"===i?n="right":"left"===i?n="right":"right"===i&&(n="left")),e.textBaseline=r,e.textAlign=n},n.prototype._tick_extent=function(){return this.mget("major_tick_out")},n.prototype._tick_label_extent=function(){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,y,m,v;if(r=0,n=this.mget("dimension"),s=this.mget("major_coords"),c=this.mget("side"),p=this.mget("major_label_orientation"),h=this.formatter.format(s[n]),this.major_label_props.set(this.plot_view.ctx,this),t.isString(p)?(o=1,e=g[c][p]):(o=2,e=-p),e=Math.abs(e),i=Math.cos(e),u=Math.sin(e),"top"===c||"bottom"===c)for(l=f=0,m=h.length-1;m>=0?m>=f:f>=m;l=m>=0?++f:--f)null!=h[l]&&(d=1.1*this.plot_view.ctx.measureText(h[l]).width,a=.9*this.plot_view.ctx.measureText(h[l]).ascent,_=d*u+a/o*i,_>r&&(r=_));else for(l=y=0,v=h.length-1;v>=0?v>=y:y>=v;l=v>=0?++y:--y)null!=h[l]&&(d=1.1*this.plot_view.ctx.measureText(h[l]).width,a=.9*this.plot_view.ctx.measureText(h[l]).ascent,_=d*i+a/o*u,_>r&&(r=_));return r>0&&(r+=this.mget("major_label_standoff")),r},n.prototype._axis_label_extent=function(){var t,e,i,s,n,r,o,a;return i=0,o=this.mget("side"),n="parallel",this.major_label_props.set(this.plot_view.ctx,this),t=Math.abs(g[o][n]),e=Math.cos(t),r=Math.sin(t),this.mget("axis_label")&&(i+=this.mget("axis_label_standoff"),this.axis_label_props.set(this.plot_view.ctx,this),a=1.1*this.plot_view.ctx.measureText(this.mget("axis_label")).width,s=.9*this.plot_view.ctx.measureText(this.mget("axis_label")).ascent,i+="top"===o||"bottom"===o?a*r+s*e:a*e+s*r),i},n.prototype._padding_request=function(){var e,i,s,n,r;return s={},n=this.mget("side"),e=null!=(r=this.mget("location"))?r:"min",t.isString(e)?(i=0,i+=this._tick_extent(),i+=this._tick_label_extent(),i+=this._axis_label_extent(),s[n]=i,s):s},n}(o),h=function(i){function s(){return v=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=p,s.prototype.type="LinearAxis",s.prototype.initialize=function(t,e){return s.__super__.initialize.call(this,t,e),this.register_property("computed_bounds",this._bounds,!1),this.add_dependencies("computed_bounds",this,["bounds"]),this.register_property("rule_coords",this._rule_coords,!1),this.add_dependencies("rule_coords",this,["computed_bounds","dimension","location"]),this.register_property("major_coords",this._major_coords,!1),this.add_dependencies("major_coords",this,["computed_bounds","dimension","location"]),this.register_property("normals",this._normals,!1),this.add_dependencies("normals",this,["computed_bounds","dimension","location"]),this.register_property("side",this._side,!1),this.add_dependencies("side",this,["normals"]),this.register_property("padding_request",this._padding_request,!1)},s.prototype.dinitialize=function(){return this.add_dependencies("computed_bounds",this.get_obj("plot"),["x_range","y_range"])},s.prototype._bounds=function(){var e,i,s,n,r,o,a,l;return i=this.get("dimension"),s=(i+1)%2,r=[this.get_obj("plot").get_obj("x_range"),this.get_obj("plot").get_obj("y_range")],a=null!=(l=this.get("bounds"))?l:"auto",n=[r[i].get("min"),r[i].get("max")],t.isArray(a)?Math.abs(a[0]-a[1])>Math.abs(n[0]-n[1])?(o=Math.max(Math.min(a[0],a[1]),n[0]),e=Math.min(Math.max(a[0],a[1]),n[1])):(o=Math.min(a[0],a[1]),e=Math.max(a[0],a[1])):(o=n[0],e=n[1]),[o,e]},s.prototype._rule_coords=function(){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g;return n=this.get("dimension"),r=(n+1)%2,p=[this.get_obj("plot").get_obj("x_range"),this.get_obj("plot").get_obj("y_range")],a=p[n],i=p[r],d=this.get("computed_bounds"),u=d[0],s=d[1],c=new Float64Array(2),_=new Float64Array(2),e=[c,_],o=null!=(f=this.get("location"))?f:"min",t.isString(o)&&("left"===o||"bottom"===o?o="start":("right"===o||"top"===o)&&(o="end"),o=i.get(o)),g=[a.get("min"),a.get("max")],h=g[0],l=g[1],e[n][0]=Math.max(u,h),e[n][1]=Math.min(s,l),e[r][0]=o,e[r][1]=o,e[n][0]>e[n][1]&&(e[n][0]=e[n][1]=0/0),e},s.prototype._major_coords=function(){var e,i,s,n,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b;for(n=this.get("dimension"),l=(n+1)%2,_=[this.get_obj("plot").get_obj("x_range"),this.get_obj("plot").get_obj("y_range")],p=_[n],i=_[l],v=this.get("computed_bounds"),d=v[0],s=v[1],a=r.auto_interval(d,s),f=r.auto_ticks(null,null,d,s,a),h=null!=(w=this.get("location"))?w:"min",t.isString(h)&&("left"===h||"bottom"===h?h="start":("right"===h||"top"===h)&&(h="end"),h=i.get(h)),g=[],y=[],e=[g,y],x=[p.get("min"),p.get("max")],c=x[0],u=x[1],o=m=0,b=f.length-1;b>=0?b>=m:m>=b;o=b>=0?++m:--m)f[o]<c||f[o]>u||(e[n].push(f[o]),e[l].push(h));return e},s.prototype._normals=function(){var e,i,s,n,r,o,a,l,h,p,u,c,_;return r=this.get("dimension"),o=(r+1)%2,p=[this.get_obj("plot").get_obj("x_range"),this.get_obj("plot").get_obj("y_range")],h=p[r],i=p[o],c=this.get("computed_bounds"),u=c[0],n=c[1],a=null!=(_=this.get("location"))?_:"min",s=i.get("start"),e=i.get("end"),l=[0,0],t.isString(a)?(l[o]=0>n-u?-1:1,0===r?("max"===a&&e>s||"min"===a&&s>e||"right"===a||"top"===a)&&(l[o]*=-1):1===r&&("min"===a&&e>s||"max"===a&&s>e||"left"===a||"bottom"===a)&&(l[o]*=-1)):l[o]=0===r?Math.abs(a-s)<=Math.abs(a-e)?1:-1:Math.abs(a-s)<=Math.abs(a-e)?-1:1,l},s.prototype._side=function(){var t,e;return t=this.get("normals"),-1===t[1]?e="top":1===t[1]?e="bottom":-1===t[0]?e="left":1===t[0]&&(e="right"),e},s.prototype.display_defaults=function(){return{level:"overlay",axis_line_color:"black",axis_line_width:1,axis_line_alpha:1,axis_line_join:"miter",axis_line_cap:"butt",axis_line_dash:[],axis_line_dash_offset:0,major_tick_in:2,major_tick_out:6,major_tick_line_color:"black",major_tick_line_width:1,major_tick_line_alpha:1,major_tick_line_join:"miter",major_tick_line_cap:"butt",major_tick_line_dash:[],major_tick_line_dash_offset:0,major_label_standoff:5,major_label_orientation:"horizontal",major_label_text_font:"helvetica",major_label_text_font_size:"10pt",major_label_text_font_style:"normal",major_label_text_color:"#444444",major_label_text_alpha:1,major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label:"",axis_label_standoff:5,axis_label_text_font:"helvetica",axis_label_text_font_size:"16pt",axis_label_text_font_style:"normal",axis_label_text_color:"#444444",axis_label_text_alpha:1,axis_label_text_align:"center",axis_label_text_baseline:"alphabetic"}},s}(n),l=function(t){function i(){return w=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=h,i}(i.Collection),{Model:h,Collection:new l,View:p}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/guide/datetime_axis",["backbone","./linear_axis","common/ticking"],function(t,i,s){var n,r,o,a,l,h;return o=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t,e){return i.__super__.initialize.call(this,t,e),this.formatter=new s.DatetimeFormatter},i}(i.View),r=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=o,i.prototype.initialize=function(t,e){return i.__super__.initialize.call(this,t,e)},i}(i.Model),n=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=r,i.prototype.type="DatetimeAxis",i}(t.Collection),{Model:r,Collection:new n,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/guide/grid",["underscore","common/safebind","common/has_parent","common/ticking","renderer/properties","common/plot_widget"],function(t,i,s,n,r,o){var a,l,h,p,u,c,_;return p=r.line_properties,l=function(t){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,t),s.prototype.initialize=function(t,e){return s.__super__.initialize.call(this,t,e),this.grid_props=new p(this,null,"grid_")},s.prototype.render=function(){var t;return t=this.plot_view.ctx,t.save(),this._draw_grids(t),t.restore()},s.prototype.bind_bokeh_events=function(){return i(this,this.model,"change",this.request_render)},s.prototype._draw_grids=function(t){var e,i,s,n,r,o,a,l,h,p,u;if(this.grid_props.do_stroke)for(l=this.mget("grid_coords"),n=l[0],r=l[1],this.grid_props.set(t,this),e=o=0,h=n.length-1;h>=0?h>=o:o>=h;e=h>=0?++o:--o){for(p=this.plot_view.map_to_screen(n[e],"data",r[e],"data"),i=p[0],s=p[1],t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(s[0])),e=a=1,u=i.length-1;u>=1?u>=a:a>=u;e=u>=1?++a:--a)t.lineTo(Math.round(i[e]),Math.round(s[e]));t.stroke()}},s}(o),a=function(i){function s(){return c=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.default_view=l,s.prototype.type="Grid",s.prototype.initialize=function(t,e){return s.__super__.initialize.call(this,t,e),this.register_property("computed_bounds",this._bounds,!1),this.add_dependencies("computed_bounds",this,["bounds"]),this.register_property("grid_coords",this._grid_coords,!1),this.add_dependencies("grid_coords",this,["computed_bounds","dimension"])},s.prototype._bounds=function(){var e,i,s,n,r,o,a,l;return i=this.get("dimension"),s=(i+1)%2,r=[this.get_obj("plot").get_obj("x_range"),this.get_obj("plot").get_obj("y_range")],a=null!=(l=this.get("bounds"))?l:"auto",n=[r[i].get("min"),r[i].get("max")],t.isArray(a)?(o=Math.min(a[0],a[1]),e=Math.max(a[0],a[1]),o<n[0]?o=n[0]:o>n[1]&&(o=null),e>n[1]?e=n[1]:e<n[0]&&(e=null)):(o=n[0],e=n[1]),[o,e]},s.prototype._grid_coords=function(){var t,e,i,s,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v,w,x,b,k,T,C,M;for(h=this.get("dimension"),c=(h+1)%2,m=[this.get_obj("plot").get_obj("x_range"),this.get_obj("plot").get_obj("y_range")],y=m[h],r=m[c],T=this.get("computed_bounds"),v=T[0],l=T[1],x=Math.min(v,l),l=Math.max(v,l),v=x,u=n.auto_interval(v,l),w=n.auto_ticks(null,null,v,l,u),f=y.get("min"),d=y.get("max"),i=r.get("min"),e=r.get("max"),s=[[],[]],p=b=0,C=w.length-1;C>=0?C>=b:b>=C;p=C>=0?++b:--b)if(w[p]!==f&&w[p]!==d){for(o=[],a=[],t=2,g=k=0,M=t-1;M>=0?M>=k:k>=M;g=M>=0?++k:--k)_=i+(e-i)/(t-1)*g,o.push(w[p]),a.push(_);s[h].push(o),s[c].push(a)}return s},s.prototype.display_defaults=function(){return{level:"underlay",grid_line_color:"#cccccc",grid_line_width:1,grid_line_alpha:1,grid_line_join:"miter",grid_line_cap:"butt",grid_line_dash:[],grid_line_dash_offset:0}},s}(s),h=function(t){function i(){return _=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=a,i}(Backbone.Collection),{Model:a,Collection:new h,View:l}})}.call(this),function(){s("common/textutils",[],function(){var t,e;return t={},e=function(e){var i,s,n,r,o;if(null!=t[e])return t[e];o=$("<span>Hg</span>").css({font:e}),i=$('<div style="display: inline-block; width: 1px; height: 0px;"></div>'),n=$("<div></div>"),n.append(o,i),s=$("body"),s.append(n);try{r={},i.css({verticalAlign:"baseline"}),r.ascent=i.offset().top-o.offset().top,i.css({verticalAlign:"bottom"}),r.height=i.offset().top-o.offset().top,r.descent=r.height-r.ascent}finally{n.remove()}return t[e]=r,r},{getTextHeight:e}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/annotation/legend",["underscore","common/has_parent","common/plot_widget","common/textutils","renderer/properties"],function(t,i,s,n,r){var o,a,l,h,p,u,c,_,d;return h=r.glyph_properties,p=r.line_properties,u=r.text_properties,a=function(i){function s(){return c=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(e){return s.__super__.initialize.call(this,e),this.label_props=new u(this,this.model,"label_"),this.border_props=new p(this,this.model,"border_"),this.mget("legend_names")?this.legend_names=this.mget("legend_names"):(this.legends=this.mget("legends"),this.legend_names=t.keys(this.mget("legends"))),this.calc_dims()},s.prototype.delegateEvents=function(t){return s.__super__.delegateEvents.call(this,t),this.listenTo(this.plot_view.view_state,"change",this.calc_dims)},s.prototype.calc_dims=function(){var e,i,s,r,o,a,l,h,p,u,c,_,d;return s=this.mget("label_height"),this.glyph_height=this.mget("glyph_height"),r=this.mget("label_width"),this.glyph_width=this.mget("glyph_width"),a=this.mget("legend_spacing"),this.label_height=t.max([n.getTextHeight(this.label_props.font(this)),s,this.glyph_height]),this.legend_height=this.label_height,this.legend_height=this.legend_names.length*this.legend_height+(1+this.legend_names.length)*a,e=this.plot_view.ctx,e.save(),this.label_props.set(e,this),p=t.map(this.legend_names,function(t){return e.measureText(t).width}),e.restore(),h=t.max(p),this.label_width=t.max([h,r]),this.legend_width=this.label_width+this.glyph_width+3*a,l=this.mget("orientation"),o=this.mget("legend_padding"),i=this.plot_view.view_state.get("inner_range_horizontal"),u=this.plot_view.view_state.get("inner_range_vertical"),"top_right"===l?(c=i.get("end")-o-this.legend_width,_=u.get("end")-o):"top_left"===l?(c=i.get("start")+o,_=u.get("end")-o):"bottom_left"===l?(c=i.get("start")+o,_=u.get("start")+o+this.legend_height):"bottom_right"===l?(c=i.get("end")-o-this.legend_width,_=u.get("start")+o+this.legend_height):"absolute"===l&&(d=this.absolute_coords,c=d[0],_=d[1]),c=this.plot_view.view_state.sx_to_device(c),_=this.plot_view.view_state.sy_to_device(_),this.box_coords=[c,_]},s.prototype.render=function(){var t,e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v;for(t=this.plot_view.ctx,t.save(),t.fillStyle=this.plot_model.get("background_fill"),this.border_props.set(t,this),t.beginPath(),t.rect(this.box_coords[0],this.box_coords[1],this.legend_width,this.legend_height),t.fill(),t.stroke(),this.label_props.set(t,this),s=this.mget("legend_spacing"),m=this.legend_names,e=d=0,g=m.length;g>d;e=++d)for(i=m[e],c=e*this.label_height,_=(1+e)*s,h=this.box_coords[1]+this.label_height/2+c+_,o=this.box_coords[0]+s,a=this.box_coords[0]+2*s+this.label_width,l=a+this.glyph_width,p=this.box_coords[1]+c+_,u=p+this.glyph_height,t.fillText(i,o,h),v=this.model.resolve_ref(this.legends[i]),f=0,y=v.length;y>f;f++)n=v[f],r=this.plot_view.renderers[n.id],r.draw_legend(t,a,l,p,u);return t.restore()},s}(s),o=function(t){function i(){return _=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=a,i.prototype.type="Legend",i.prototype.display_defaults=function(){return{level:"overlay",border_line_color:"black",border_line_width:1,border_line_alpha:1,border_line_join:"miter",border_line_cap:"butt",border_line_dash:[],border_line_dash_offset:0,label_standoff:15,label_text_font:"helvetica",label_text_font_size:"10pt",label_text_font_style:"normal",label_text_color:"#444444",label_text_alpha:1,label_text_align:"center",label_text_baseline:"middle",glyph_height:20,glyph_width:20,label_height:20,label_width:50,legend_padding:10,legend_spacing:3,orientation:"top_right",label_text_align:"left",label_text_baseline:"middle",datapoint:null}},i}(i),l=function(t){function i(){return d=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=o,i}(Backbone.Collection),{Model:o,Collection:new l,View:a}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("renderer/overlay/box_selection",["underscore","common/has_parent","common/plot_widget"],function(t,i,s){var n,r,o,a,l,h;return r=function(i){function s(){return a=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){return this.selecting=!1,this.xrange=[null,null],this.yrange=[null,null],s.__super__.initialize.call(this,t),this.plot_view.$el.find(".bokeh_canvas_wrapper").append(this.$el)},s.prototype.boxselect=function(t,e){return this.xrange=t,this.yrange=e,this.request_render()},s.prototype.startselect=function(){return this.selecting=!0,this.xrange=[null,null],this.yrange=[null,null],this.request_render()},s.prototype.stopselect=function(){return this.selecting=!1,this.xrange=[null,null],this.yrange=[null,null],this.request_render()},s.prototype.bind_bokeh_events=function(){return this.toolview=this.plot_view.tools[this.mget("tool").id],this.listenTo(this.toolview,"boxselect",this.boxselect),this.listenTo(this.toolview,"startselect",this.startselect),this.listenTo(this.toolview,"stopselect",this.stopselect)},s.prototype.render=function(){var e,i,s,n,r,o,a;return this.selecting?(r=this.xrange,a=this.yrange,t.any(t.map(r,t.isNullOrUndefined))||t.any(t.map(a,t.isNullOrUndefined))?(this.$el.removeClass("shading"),void 0):(i="",n=this.plot_view.view_state.sx_to_device(Math.min(r[0],r[1])),s=r?Math.abs(r[1]-r[0]):this.plot_view.view_state.get("width"),i+="; left:"+n+"px; width:"+s+"px; ",o=this.plot_view.view_state.sy_to_device(Math.max(a[0],a[1])),e=a?a[1]-a[0]:this.plot_view.view_state.get("height"),this.$el.addClass("shading"),i+="top:"+o+"px; height:"+e+"px",this.$el.attr("style",i))):(this.$el.removeClass("shading"),void 0)},s}(s),n=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=r,i.prototype.type="BoxSelection",i.prototype.defaults=function(){return{tool:null,level:"overlay"}},i}(i),o=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=n,i}(Backbone.Collection),{Model:n,Collection:new o,View:r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("source/object_array_data_source",["underscore","backbone","common/has_properties","range/range1d","range/factor_range"],function(t,i,s,n,r){var o,a,l,h;return o=function(i){function s(){return l=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.type="ObjectArrayDataSource",s.prototype.initialize=function(t,e){return s.__super__.initialize.call(this,t,e),this.cont_ranges={},this.discrete_ranges={}},s.prototype.getcolumn=function(t){var e;return function(){var i,s,n,r;for(n=this.get("data"),r=[],i=0,s=n.length;s>i;i++)e=n[i],r.push(e[t]);return r}.call(this)},s.prototype.compute_cont_range=function(e){var i;return i=this.getcolumn(e),[t.max(i),t.min(i)]},s.prototype.compute_discrete_factor=function(e){var i,s,n,r,o,a;for(i={},a=this.getcolumn(e),r=0,o=a.length;o>r;r++)n=a[r],i[n]=!0;return s=t.keys(i),s=t.sortBy(s,function(t){return t})},s.prototype.get_cont_range=function(e,i){var s,r,o,a,l,h,p=this;return t.isUndefined(i)&&(i=1),t.exists(this.cont_ranges,e)||(l=this.compute_cont_range(e),o=l[0],r=l[1],a=(r-o)*(1+i),s=(r+o)/2,h=[s-a/2,s+a/2],o=h[0],r=h[1],this.cont_ranges[e]=n.Collection.create({start:o,end:r}),this.on("change:data",function(){var t;return t=p.compute_cont_range(e),r=t[0],o=t[1],p.cont_ranges[e].set("start",o),p.cont_ranges[e].set("end",r)})),this.cont_ranges[e]},s.prototype.get_discrete_range=function(e){var i,s=this;return t.exists(this.discrete_ranges,e)||(i=this.compute_discrete_factor(e),this.discrete_ranges[e]=r.Collection.create({values:i}),this.on("change:data",function(){return i=s.compute_discrete_factor(e),s.discrete_ranges[e]=r.Collection.set("values",i)})),this.discrete_ranges[e]},s.prototype.select=function(t,e){var i,s,n,r,o,a,l,h;for(n=[],h=this.get("data"),s=a=0,l=h.length;l>a;s=++a)r=h[s],i=function(){var e,i,s;for(s=[],e=0,i=t.length;i>e;e++)o=t[e],s.push(r[o]);return s}(),e.apply(e,i)&&n.push(s);return n.sort(),n},s.prototype.defaults=function(){return{data:[{}],name:"data",selected:[],selecting:!1}},s}(s),a=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)
}return e(i,t),i.prototype.model=o,i}(i.Collection),{Model:o,Collection:new a}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("source/column_data_source",["underscore","backbone","./object_array_data_source"],function(t,i,s){var n,r,o,a;return n=function(i){function s(){return o=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.type="ColumnDataSource",s.prototype.initialize=function(t,e){return s.__super__.initialize.call(this,t,e),this.cont_ranges={},this.discrete_ranges={}},s.prototype.getcolumn=function(t){return this.get("data")[t]},s.prototype.datapoints=function(){var e,i,s,n,r,o,a,l,h,p;for(e=this.get("data"),s=t.keys(e),o=[],n=a=0,p=e[s[0]].length-1;p>=0?p>=a:a>=p;n=p>=0?++a:--a){for(r={},l=0,h=s.length;h>l;l++)i=s[l],r[i]=e[i][n];o.push(r)}return o},s.prototype.defaults=function(){return s.__super__.defaults.call(this)},s}(s.Model),r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=n,i}(i.Collection),{Model:n,Collection:new r}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/tool",["underscore","common/plot_widget","common/has_parent"],function(t,i,s){var n,r,o,a;return r=function(i){function s(){return o=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.initialize=function(t){return s.__super__.initialize.call(this,t)},s.prototype.bind_bokeh_events=function(){var e,i,s,n,r=this;return e=this.plot_view.eventSink,s={eventBasename:this.cid},n=t.extend(s,this.evgen_options),i=new this.eventGeneratorClass(n),i.bind_bokeh_events(this.plot_view,e),t.each(this.tool_events,function(t,i){var s,n;return s=""+r.cid+":"+i,n=function(e){return r[t](e)},e.on(s,n)}),this.evgen=i,{render:function(){}}},s}(i),n=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.display_defaults=function(){return{level:"tool"}},i}(s),{Model:n,View:r}})}.call(this),function(){s("tool/event_generators",[],function(){var t,e,i;return i=function(){function t(t){this.restrict_to_innercanvas=t.restrict_to_innercanvas,this.options=t,this.toolName=this.options.eventBasename,this.dragging=!1,this.basepoint_set=!1,this.button_activated=!1,this.tool_active=!1}return t.prototype.bind_bokeh_events=function(t,e){var i,s=this;return i=this.toolName,this.plotview=t,this.eventSink=e,this.plotview.moveCallbacks.push(function(t){var n;if(s.dragging&&s.tool_active)return n=$(t.currentTarget).offset(),t.bokehX=t.pageX-n.left,t.bokehY=t.pageY-n.top,s.basepoint_set?(e.trigger(""+i+":UpdatingMouseMove",t),t.preventDefault(),t.stopPropagation()):(s.dragging=!0,s.basepoint_set=!0,e.trigger(""+i+":SetBasepoint",t))}),this.plotview.moveCallbacks.push(function(t,e,i){var n,r,o,a,l,h,p;if(s.dragging){if(o=$(t.currentTarget).offset(),t.bokehX=t.pageX-o.left,t.bokehY=t.pageY-o.top,n=s.plotview.view_state.get("inner_range_horizontal"),r=s.plotview.view_state.get("inner_range_vertical"),e=s.plotview.view_state.device_to_sx(t.bokehX),i=s.plotview.view_state.device_to_sy(t.bokehY),s.restrict_to_innercanvas?(l=n.get("start"),a=n.get("end"),p=r.get("start"),h=r.get("end")):(l=0,a=s.plotview.view_state.get("outer_width"),p=0,h=s.plotview.view_state.get("outer_height")),l>e||e>a)return s._stop_drag(t),!1;if(p>i||i>h)return s._stop_drag(t),!1}}),$(document).bind("keydown",function(t){return t[s.options.keyName]&&s._start_drag(),27===t.keyCode?e.trigger("clear_active_tool"):void 0}),$(document).bind("keyup",function(t){return t[s.options.keyName]?void 0:s._stop_drag(t)}),this.plotview.canvas_wrapper.bind("mousedown",function(){return s.button_activated?(s._start_drag(),!1):void 0}),this.plotview.canvas_wrapper.bind("mouseup",function(t){return s.button_activated?(s._stop_drag(t),!1):void 0}),this.plotview.canvas_wrapper.bind("mouseleave",function(t){return s.button_activated?(s._stop_drag(t),!1):void 0}),this.$tool_button=$("<button class='btn btn-small'> "+this.options.buttonText+" </button>"),this.plotview,this.plotview.$el.find(".button_bar").append(this.$tool_button),this.$tool_button.click(function(){return s.button_activated?e.trigger("clear_active_tool"):e.trigger("active_tool",i)}),e.on(""+i+":deactivated",function(){return s.tool_active=!1,s.button_activated=!1,s.$tool_button.removeClass("active")}),e.on(""+i+":activated",function(){return s.tool_active=!0,s.$tool_button.addClass("active"),s.button_activated=!0}),e},t.prototype.hide_button=function(){return this.$tool_button.hide()},t.prototype._start_drag=function(){return this.eventSink.trigger("active_tool",this.toolName),this.dragging||(this.dragging=!0,this.button_activated)?void 0:this.$tool_button.addClass("active")},t.prototype._stop_drag=function(t){var e;return this.basepoint_set=!1,this.dragging?(this.dragging=!1,this.button_activated||this.$tool_button.removeClass("active"),e=$(t.currentTarget).offset(),t.bokehX=t.pageX,t.bokehY=t.pageY,this.eventSink.trigger(""+this.options.eventBasename+":DragEnd",t)):void 0},t}(),e=function(){function t(t){this.options=t,this.toolName=this.options.eventBasename,this.dragging=!1,this.basepoint_set=!1,this.button_activated=!1,this.tool_active=!1}return t.prototype.bind_bokeh_events=function(t,e){var i,s,n,r=this;return n=this.toolName,this.plotview=t,this.eventSink=e,this.plotview.canvas_wrapper.bind("mousewheel",function(t,i){var s;if(r.tool_active)return s=$(t.currentTarget).offset(),t.bokehX=t.pageX-s.left,t.bokehY=t.pageY-s.top,t.delta=i,e.trigger(""+n+":zoom",t),t.preventDefault(),t.stopPropagation()}),$(document).bind("keydown",function(t){return 27===t.keyCode?e.trigger("clear_active_tool"):void 0}),this.plotview.$el.bind("mousein",function(){return e.trigger("clear_active_tool")}),this.plotview.$el.bind("mouseover",function(){return r.mouseover_count+=1}),this.$tool_button=$("<button class='btn btn-small'> "+this.options.buttonText+" </button>"),this.plotview.$el.find(".button_bar").append(this.$tool_button),this.$tool_button.click(function(){return r.button_activated?e.trigger("clear_active_tool"):(e.trigger("active_tool",n),r.button_activated=!0)}),i=function(t){return t.setAttribute("old_overflow",t.style.overflow),t.style.overflow="hidden",t!==document.body?i(t.parentNode):void 0},s=function(t){return t.style.overflow=t.getAttribute("old_overflow"),t!==document.body?s(t.parentNode):void 0},e.on(""+n+":deactivated",function(){return r.tool_active=!1,r.button_activated=!1,r.$tool_button.removeClass("active"),document.body.style.overflow=r.old_overflow}),e.on(""+n+":activated",function(){return r.tool_active=!0,r.$tool_button.addClass("active")}),e},t.prototype.hide_button=function(){return this.$tool_button.hide()},t}(),t=function(){function t(t){this.options=t,this.toolName=this.options.eventBasename,this.button_activated=!1,this.tool_active=!1}return t.prototype.bind_bokeh_events=function(t,e){var i,s,n,r=this;return n=this.toolName,this.plotview=t,this.eventSink=e,$(document).bind("keydown",function(t){return 27===t.keyCode?e.trigger("clear_active_tool"):void 0}),this.plotview.$el.bind("mouseover",function(){return r.mouseover_count+=1}),this.$tool_button=$("<button class='btn btn-small'> "+this.options.buttonText+" </button>"),this.plotview.$el.find(".button_bar").append(this.$tool_button),this.$tool_button.click(function(){return r.button_activated?e.trigger("clear_active_tool"):(e.trigger("active_tool",n),r.button_activated=!0)}),i=function(t){return t.setAttribute("old_overflow",t.style.overflow),t.style.overflow="hidden",t!==document.body?i(t.parentNode):void 0},s=function(t){return t.style.overflow=t.getAttribute("old_overflow"),t!==document.body?s(t.parentNode):void 0},e.on(""+n+":deactivated",function(){return r.tool_active=!1,r.button_activated=!1,r.$tool_button.removeClass("active"),document.body.style.overflow=r.old_overflow}),e.on(""+n+":activated",function(){return r.tool_active=!0,r.$tool_button.addClass("active")}),e},t.prototype.hide_button=function(){return this.$tool_button.hide()},t}(),{TwoPointEventGenerator:i,OnePointWheelEventGenerator:e,ButtonEventGenerator:t}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/pan_tool",["underscore","backbone","./tool","./event_generators"],function(t,i,s,n){var r,o,a,l,h,p,u;return l=n.TwoPointEventGenerator,window.render_count=0,o=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){return i.__super__.initialize.call(this,t)},i.prototype.bind_bokeh_events=function(){return i.__super__.bind_bokeh_events.call(this)},i.prototype.toolType="PanTool",i.prototype.eventGeneratorClass=l,i.prototype.evgen_options={keyName:"shiftKey",buttonText:"Pan",restrict_to_innercanvas:!0},i.prototype.tool_events={UpdatingMouseMove:"_drag",SetBasepoint:"_set_base_point"},i.prototype.mouse_coords=function(t,e,i){var s,n,r;return r=[this.plot_view.view_state.device_to_sx(e),this.plot_view.view_state.device_to_sy(i)],s=r[0],n=r[1],[s,n]},i.prototype._set_base_point=function(t){var e;return e=this.mouse_coords(t,t.bokehX,t.bokehY),this.x=e[0],this.y=e[1],null},i.prototype._drag=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y;return g=this.mouse_coords(t,t.bokehX,t.bokehY),o=g[0],u=g[1],a=o-this.x,c=u-this.y,y=[o,u],this.x=y[0],this.y=y[1],h=this.plot_view.view_state.get("inner_range_horizontal"),s=h.get("start")-a,i=h.get("end")-a,d=this.plot_view.view_state.get("inner_range_vertical"),r=d.get("start")-c,n=d.get("end")-c,p=this.plot_view.xmapper.map_from_target(s),l=this.plot_view.xmapper.map_from_target(i),f=this.plot_view.ymapper.map_from_target(r),_=this.plot_view.ymapper.map_from_target(n),e={xr:{start:p,end:l},yr:{start:f,end:_},sdx:-a,sdy:c},this.plot_view.update_range(e),null},i}(s.View),r=function(t){function i(){return p=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=o,i.prototype.type="PanTool",i.prototype.defaults=function(){return{dimensions:[],dataranges:[]}},i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(s.Model),a=function(t){function i(){return u=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=r,i}(i.Collection),{Model:r,Collection:new a,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/zoom_tool",["underscore","backbone","./tool","./event_generators"],function(t,i,s,n){var r,o,a,l,h,p,u;return r=n.OnePointWheelEventGenerator,a=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){return i.__super__.initialize.call(this,t)},i.prototype.eventGeneratorClass=r,i.prototype.evgen_options={buttonText:"Zoom"},i.prototype.tool_events={zoom:"_zoom"},i.prototype.mouse_coords=function(t,e,i){var s,n,r;return r=[this.plot_view.view_state.device_to_sx(e),this.plot_view.view_state.device_to_sy(i)],s=r[0],n=r[1],[s,n]},i.prototype._zoom=function(t){var e,i,s,n,r,o,a,l,h,p,u,c,_,d,f,g,y,m,v;return e=t.originalEvent.wheelDelta,s=t.bokehX,n=t.bokehY,v=this.mouse_coords(t,s,n),p=v[0],d=v[1],r=this.mget("speed"),i=r*e,c=this.plot_view.view_state.get("inner_range_horizontal"),a=c.get("start"),o=c.get("end"),g=this.plot_view.view_state.get("inner_range_vertical"),h=g.get("start"),l=g.get("end"),_=this.plot_view.xmapper.map_from_target(a-(a-p)*i),u=this.plot_view.xmapper.map_from_target(o-(o-p)*i),y=this.plot_view.ymapper.map_from_target(h-(h-d)*i),f=this.plot_view.ymapper.map_from_target(l-(l-d)*i),m={xr:{start:_,end:u},yr:{start:y,end:f},factor:i},this.plot_view.update_range(m),null},i}(s.View),o=function(t){function i(){return p=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=a,i.prototype.type="ZoomTool",i.prototype.defaults=function(){return{dimensions:[],dataranges:[],speed:1/600}},i}(s.Model),l=function(t){function i(){return u=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=o,i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(i.Collection),{Model:o,Collection:new l,View:a}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/resize_tool",["underscore","backbone","./tool","./event_generators"],function(t,i,s,n){var r,o,a,l,h,p,u;return l=n.TwoPointEventGenerator,o=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){return i.__super__.initialize.call(this,t),this.active=!1},i.prototype.bind_events=function(t){return i.__super__.bind_events.call(this,t)},i.prototype.eventGeneratorClass=l,i.prototype.evgen_options={keyName:"",buttonText:"Resize"},i.prototype.tool_events={activated:"_activate",deactivated:"_deactivate",UpdatingMouseMove:"_drag",SetBasepoint:"_set_base_point"},i.prototype.render=function(){var t,e,i,s;if(this.active)return e=this.plot_view.ctx,i=this.plot_view.view_state.get("canvas_width"),t=this.plot_view.view_state.get("canvas_height"),s=8,e.save(),e.strokeStyle="grey",e.globalAlpha=.7,e.lineWidth=s,e.setLineDash([]),e.beginPath(),e.rect(s,s,i-2*s,t-2*s),e.moveTo(s,s),e.lineTo(i-s,t-s),e.moveTo(s,t-s),e.lineTo(i-s,s),e.stroke(),e.restore()},i.prototype.mouse_coords=function(t,e,i){return[e,i]},i.prototype._activate=function(){var t,e,i;return this.active=!0,this.popup=$('<div class="resize_popup pull-right" style="border-radius: 10px; background-color: lightgrey; padding:3px 8px; font-size: 14px"></div>'),t=this.plot_view.$el.find(".button_bar"),this.popup.appendTo(t),e=this.plot_view.view_state.get("outer_height"),i=this.plot_view.view_state.get("outer_width"),this.popup.text("width: "+i+" height: "+e),this.plot_view.request_render(),null},i.prototype._deactivate=function(){return this.active=!1,this.popup.remove(),this.plot_view.request_render(),null},i.prototype._set_base_point=function(t){var e;return e=this.mouse_coords(t,t.bokehX,t.bokehY),this.x=e[0],this.y=e[1],null},i.prototype._drag=function(t){var e,i,s,n,r,o,a,l;return this.plot_view.pause(),a=this.mouse_coords(t,t.bokehX,t.bokehY),s=a[0],r=a[1],n=s-this.x,o=r-this.y,l=[s,r],this.x=l[0],this.y=l[1],e=this.plot_view.view_state.get("outer_height"),i=this.plot_view.view_state.get("outer_width"),this.popup.text("width: "+i+" height: "+e),this.plot_view.view_state.set("outer_height",e+o,{silent:!0}),this.plot_view.view_state.set("outer_width",i+n,{silent:!0}),this.plot_view.view_state.set("canvas_height",e+o,{silent:!0}),this.plot_view.view_state.set("canvas_width",i+n,{silent:!0}),this.plot_view.view_state.trigger("change:outer_height",e+o),this.plot_view.view_state.trigger("change:outer_width",i+n),this.plot_view.view_state.trigger("change:canvas_height",e+o),this.plot_view.view_state.trigger("change:canvas_width",i+n),this.plot_view.view_state.trigger("change",this.plot_view.view_state),this.plot_view.unpause(!0),null},i}(s.View),r=function(t){function i(){return p=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=o,i.prototype.type="ResizeTool",i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(s.Model),a=function(t){function i(){return u=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=r,i}(i.Collection),{Model:r,Collection:new a,View:o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/box_select_tool",["underscore","backbone","./tool","./event_generators"],function(i,s,n,r){var o,a,l,h,p,u,c;return h=r.TwoPointEventGenerator,a=function(s){function n(){return p=n.__super__.constructor.apply(this,arguments)}return e(n,s),n.prototype.initialize=function(t){var e=this;return n.__super__.initialize.call(this,t),this.select_callback=i.debounce(function(){return e._select_data()},50),this.listenTo(this.model,"change",this.select_callback)},n.prototype.bind_bokeh_events=function(){var t,e,i,s,r,o;for(n.__super__.bind_bokeh_events.call(this),r=this.mget_obj("renderers"),o=[],i=0,s=r.length;s>i;i++)t=r[i],e=this.plot_view.renderers[t.id],this.listenTo(e.xrange(),"change",this.select_callback),this.listenTo(e.yrange(),"change",this.select_callback),this.listenTo(t,"change",this.select_callback),o.push(this.listenTo(t,"change",this.select_callback));return o},n.prototype.eventGeneratorClass=h,n.prototype.evgen_options={keyName:"ctrlKey",buttonText:"Select",restrict_to_innercanvas:!0},n.prototype.tool_events={SetBasepoint:"_start_selecting",UpdatingMouseMove:"_selecting",deactivated:"_stop_selecting"},n.prototype.pause=function(){return""},n.prototype.mouse_coords=function(t,e,i){var s;return s=[this.plot_view.view_state.device_to_sx(e),this.plot_view.view_state.device_to_sy(i)],e=s[0],i=s[1],[e,i]},n.prototype._stop_selecting=function(){return this.trigger("stopselect"),this.basepoint_set=!1},n.prototype._start_selecting=function(t){var e,i,s;return this.trigger("startselect"),s=this.mouse_coords(t,t.bokehX,t.bokehY),e=s[0],i=s[1],this.mset({start_x:e,start_y:i,current_x:null,current_y:null}),this.basepoint_set=!0},n.prototype._get_selection_range=function(){var t,e;return t=[this.mget("start_x"),this.mget("current_x")],e=[this.mget("start_y"),this.mget("current_y")],t=this.mget("select_x")?[i.min(t),i.max(t)]:null,e=this.mget("select_y")?[i.min(e),i.max(e)]:null,[t,e]},n.prototype._get_selection_range_fast=function(t,e){var s,n;return s=[this.mget("start_x"),t],n=[this.mget("start_y"),e],s=this.mget("select_x")?[i.min(s),i.max(s)]:null,n=this.mget("select_y")?[i.min(n),i.max(n)]:null,[s,n]},n.prototype._selecting=function(t){var e,i,s,n;return s=this.mouse_coords(t,t.bokehX,t.bokehY),e=s[0],i=s[1],this.mset({current_x:e,current_y:i}),n=this._get_selection_range(e,i),this.xrange=n[0],this.yrange=n[1],this.trigger("boxselect",this.xrange,this.yrange),null},n.prototype.box_selecting=function(t){var e,i,s,n;return s=this.mouse_coords(t,t.bokehX,t.bokehY),e=s[0],i=s[1],n=this._get_selection_range_fast(e,i),this.xrange=n[0],this.yrange=n[1],this.trigger("boxselect",this.xrange,this.yrange),null},n.prototype._select_data=function(){var e,s,n,r,o,a,l,h,p,u,c,_,d,f,g;if(this.basepoint_set){for(r={},n={},f=this.mget_obj("renderers"),u=0,_=f.length;_>u;u++)l=f[u],e=l.get_obj("data_source"),r[e.id]=e;for(g=this.mget_obj("renderers"),c=0,d=g.length;d>c;c++)l=g[c],s=l.get_obj("data_source").id,i.setdefault(n,s,[]),h=this.plot_view.renderers[l.id].select(this.xrange,this.yrange),n[s].push(h);for(a in n)t.call(n,a)&&(p=n[a],h=i.intersection.apply(i,p),o=r[a],o.save({selected:h},{patch:!0}));return null}},n}(n.View),o=function(t){function i(){return u=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=a,i.prototype.type="BoxSelectTool",i.prototype.defaults=function(){return{renderers:[],select_x:!0,select_y:!0,data_source_options:{}}},i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(n.Model),l=function(t){function i(){return c=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=o,i}(s.Collection),{Model:o,Collection:new l,View:a}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/data_range_box_select_tool",["underscore","backbone","./box_select_tool"],function(t,i,s){var n,r,o,a,l,h;return r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.bind_bokeh_events=function(){return tool.ToolView.prototype.bind_bokeh_events.call(this)},i.prototype._select_data=function(){var t,e,i,s,n,r;return n=this.plot_view.mapper.map_from_target(this.xrange[0],this.yrange[0]),e=n[0],s=n[1],r=this.plot_view.mapper.map_from_target(this.xrange[1],this.yrange[1]),t=r[0],i=r[1],this.mset("xselect",[e,t]),this.mset("yselect",[s,i]),this.model.save()},i}(s.View),n=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=r,i.prototype.type="DataRangeBoxSelectTool",i}(s.Model),o=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=r,i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(i.Collection),{Model:n,Collection:new o,View:r}})}.call(this),!function(t){t(function(){t.support.transition=function(){var t=function(){var t,e=document.createElement("bootstrap"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};for(t in i)if(void 0!==e.style[t])return i[t]}();return t&&{end:t}}()})}(window.jQuery),!function(t){function e(){var e=this,s=setTimeout(function(){e.$element.off(t.support.transition.end),i.call(e)},500);this.$element.one(t.support.transition.end,function(){clearTimeout(s),i.call(e)})}function i(){this.$element.hide().trigger("hidden"),s.call(this)}function s(e){var i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&i;this.$backdrop=t('<div class="modal-backdrop '+i+'" />').appendTo(document.body),"static"!=this.options.backdrop&&this.$backdrop.click(t.proxy(this.hide,this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),s?this.$backdrop.one(t.support.transition.end,e):e()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,t.proxy(n,this)):n.call(this)):e&&e()}function n(){this.$backdrop.remove(),this.$backdrop=null}function r(){var e=this;this.isShown&&this.options.keyboard?t(document).on("keyup.dismiss.modal",function(t){27==t.which&&e.hide()}):this.isShown||t(document).off("keyup.dismiss.modal")}var o=function(e,i){this.options=i,this.$element=t(e).delegate('[data-dismiss="modal"]',"click.dismiss.modal",t.proxy(this.hide,this))};o.prototype={constructor:o,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var e=this,i=t.Event("show");this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(t("body").addClass("modal-open"),this.isShown=!0,r.call(this),s.call(this,function(){var i=t.support.transition&&e.$element.hasClass("fade");e.$element.parent().length||e.$element.appendTo(document.body),e.$element.show(),i&&e.$element[0].offsetWidth,e.$element.addClass("in"),i?e.$element.one(t.support.transition.end,function(){e.$element.trigger("shown")}):e.$element.trigger("shown")}))},hide:function(s){s&&s.preventDefault(),s=t.Event("hide"),this.$element.trigger(s),this.isShown&&!s.isDefaultPrevented()&&(this.isShown=!1,t("body").removeClass("modal-open"),r.call(this),this.$element.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?e.call(this):i.call(this))}},t.fn.modal=function(e){return this.each(function(){var i=t(this),s=i.data("modal"),n=t.extend({},t.fn.modal.defaults,i.data(),"object"==typeof e&&e);s||i.data("modal",s=new o(this,n)),"string"==typeof e?s[e]():n.show&&s.show()})},t.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},t.fn.modal.Constructor=o,t(function(){t("body").on("click.modal.data-api",'[data-toggle="modal"]',function(e){var i,s=t(this),n=t(s.attr("data-target")||(i=s.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),r=n.data("modal")?"toggle":t.extend({},n.data(),s.data());e.preventDefault(),n.modal(r)})})}(window.jQuery),!function(t){function e(){t(i).parent().removeClass("open")}var i='[data-toggle="dropdown"]',s=function(e){var i=t(e).on("click.dropdown.data-api",this.toggle);t("html").on("click.dropdown.data-api",function(){i.parent().removeClass("open")})};s.prototype={constructor:s,toggle:function(){var i,s,n,r=t(this);if(!r.is(".disabled, :disabled"))return s=r.attr("data-target"),s||(s=r.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,"")),i=t(s),i.length||(i=r.parent()),n=i.hasClass("open"),e(),n||i.toggleClass("open"),!1}},t.fn.dropdown=function(e){return this.each(function(){var i=t(this),n=i.data("dropdown");n||i.data("dropdown",n=new s(this)),"string"==typeof e&&n[e].call(i)})},t.fn.dropdown.Constructor=s,t(function(){t("html").on("click.dropdown.data-api",e),t("body").on("click.dropdown",".dropdown form",function(t){t.stopPropagation()}).on("click.dropdown.data-api",i,s.prototype.toggle)})}(window.jQuery),!function(t){function e(e,i){var s,n=t.proxy(this.process,this),r=t(e).is("body")?t(window):t(e);this.options=t.extend({},t.fn.scrollspy.defaults,i),this.$scrollElement=r.on("scroll.scroll.data-api",n),this.selector=(this.options.target||(s=t(e).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=t("body"),this.refresh(),this.process()}e.prototype={constructor:e,refresh:function(){var e,i=this;this.offsets=t([]),this.targets=t([]),e=this.$body.find(this.selector).map(function(){var e=t(this),i=e.data("target")||e.attr("href"),s=/^#\w/.test(i)&&t(i);return s&&i.length&&[[s.position().top,i]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){i.offsets.push(this[0]),i.targets.push(this[1])})},process:function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,s=i-this.$scrollElement.height(),n=this.offsets,r=this.targets,o=this.activeTarget;if(e>=s)return o!=(t=r.last()[0])&&this.activate(t);for(t=n.length;t--;)o!=r[t]&&e>=n[t]&&(!n[t+1]||e<=n[t+1])&&this.activate(r[t])},activate:function(e){var i,s;this.activeTarget=e,t(this.selector).parent(".active").removeClass("active"),s=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',i=t(s).parent("li").addClass("active"),i.parent(".dropdown-menu")&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate")}},t.fn.scrollspy=function(i){return this.each(function(){var s=t(this),n=s.data("scrollspy"),r="object"==typeof i&&i;n||s.data("scrollspy",n=new e(this,r)),"string"==typeof i&&n[i]()})},t.fn.scrollspy.Constructor=e,t.fn.scrollspy.defaults={offset:10},t(function(){t('[data-spy="scroll"]').each(function(){var e=t(this);e.scrollspy(e.data())})})}(window.jQuery),!function(t){var e=function(e){this.element=t(e)};e.prototype={constructor:e,show:function(){var e,i,s,n=this.element,r=n.closest("ul:not(.dropdown-menu)"),o=n.attr("data-target");o||(o=n.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),n.parent("li").hasClass("active")||(e=r.find(".active a").last()[0],s=t.Event("show",{relatedTarget:e}),n.trigger(s),s.isDefaultPrevented()||(i=t(o),this.activate(n.parent("li"),r),this.activate(i,i.parent(),function(){n.trigger({type:"shown",relatedTarget:e})})))},activate:function(e,i,s){function n(){r.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),o?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),s&&s()}var r=i.find("> .active"),o=s&&t.support.transition&&r.hasClass("fade");o?r.one(t.support.transition.end,n):n(),r.removeClass("in")}},t.fn.tab=function(i){return this.each(function(){var s=t(this),n=s.data("tab");n||s.data("tab",n=new e(this)),"string"==typeof i&&n[i]()})},t.fn.tab.Constructor=e,t(function(){t("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault(),t(this).tab("show")})})}(window.jQuery),!function(t){var e=function(t,e){this.init("tooltip",t,e)};e.prototype={constructor:e,init:function(e,i,s){var n,r;this.type=e,this.$element=t(i),this.options=this.getOptions(s),this.enabled=!0,"manual"!=this.options.trigger&&(n="hover"==this.options.trigger?"mouseenter":"focus",r="hover"==this.options.trigger?"mouseleave":"blur",this.$element.on(n,this.options.selector,t.proxy(this.enter,this)),this.$element.on(r,this.options.selector,t.proxy(this.leave,this))),this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(e){return e=t.extend({},t.fn[this.type].defaults,e,this.$element.data()),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},enter:function(e){var i=t(e.currentTarget)[this.type](this._options).data(this.type);return i.options.delay&&i.options.delay.show?(clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show),void 0):i.show()},leave:function(e){var i=t(e.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),i.options.delay&&i.options.delay.hide?(i.hoverState="out",this.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide),void 0):i.hide()},show:function(){var t,e,i,s,n,r,o;if(this.hasContent()&&this.enabled){switch(t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),r="function"==typeof this.options.placement?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,e=/in/.test(r),t.remove().css({top:0,left:0,display:"block"}).appendTo(e?this.$element:document.body),i=this.getPosition(e),s=t[0].offsetWidth,n=t[0].offsetHeight,e?r.split(" ")[1]:r){case"bottom":o={top:i.top+i.height,left:i.left+i.width/2-s/2};break;case"top":o={top:i.top-n,left:i.left+i.width/2-s/2};break;case"left":o={top:i.top+i.height/2-n/2,left:i.left-s};break;case"right":o={top:i.top+i.height/2-n/2,left:i.left+i.width}}t.css(o).addClass(r).addClass("in")}},isHTML:function(t){return"string"!=typeof t||"<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(t)},setContent:function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.isHTML(e)?"html":"text"](e),t.removeClass("fade in top bottom left right")},hide:function(){function e(){var e=setTimeout(function(){i.off(t.support.transition.end).remove()},500);i.one(t.support.transition.end,function(){clearTimeout(e),i.remove()})}var i=this.tip();i.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?e():i.remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(e){return t.extend({},e?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},tip:function(){return this.$tip=this.$tip||t(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},t.fn.tooltip=function(i){return this.each(function(){var s=t(this),n=s.data("tooltip"),r="object"==typeof i&&i;n||s.data("tooltip",n=new e(this,r)),"string"==typeof i&&n[i]()
})},t.fn.tooltip.Constructor=e,t.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0}}(window.jQuery),!function(t){var e=function(t,e){this.init("popover",t,e)};e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype,{constructor:e,setContent:function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.isHTML(e)?"html":"text"](e),t.find(".popover-content > *")[this.isHTML(i)?"html":"text"](i),t.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var t,e=this.$element,i=this.options;return t=e.attr("data-content")||("function"==typeof i.content?i.content.call(e[0]):i.content)},tip:function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip}}),t.fn.popover=function(i){return this.each(function(){var s=t(this),n=s.data("popover"),r="object"==typeof i&&i;n||s.data("popover",n=new e(this,r)),"string"==typeof i&&n[i]()})},t.fn.popover.Constructor=e,t.fn.popover.defaults=t.extend({},t.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(t){var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.prototype.close=function(e){function i(){s.trigger("closed").remove()}var s,n=t(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),s=t(r),e&&e.preventDefault(),s.length||(s=n.hasClass("alert")?n:n.parent()),s.trigger(e=t.Event("close")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.on(t.support.transition.end,i):i())},t.fn.alert=function(e){return this.each(function(){var s=t(this),n=s.data("alert");n||s.data("alert",n=new i(this)),"string"==typeof e&&n[e].call(s)})},t.fn.alert.Constructor=i,t(function(){t("body").on("click.alert.data-api",e,i.prototype.close)})}(window.jQuery),!function(t){var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.button.defaults,i)};e.prototype.setState=function(t){var e="disabled",i=this.$element,s=i.data(),n=i.is("input")?"val":"html";t+="Text",s.resetText||i.data("resetText",i[n]()),i[n](s[t]||this.options[t]),setTimeout(function(){"loadingText"==t?i.addClass(e).attr(e,e):i.removeClass(e).removeAttr(e)},0)},e.prototype.toggle=function(){var t=this.$element.parent('[data-toggle="buttons-radio"]');t&&t.find(".active").removeClass("active"),this.$element.toggleClass("active")},t.fn.button=function(i){return this.each(function(){var s=t(this),n=s.data("button"),r="object"==typeof i&&i;n||s.data("button",n=new e(this,r)),"toggle"==i?n.toggle():i&&n.setState(i)})},t.fn.button.defaults={loadingText:"loading..."},t.fn.button.Constructor=e,t(function(){t("body").on("click.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle")})})}(window.jQuery),!function(t){var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.collapse.defaults,i),this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};e.prototype={constructor:e,dimension:function(){var t=this.$element.hasClass("width");return t?"width":"height"},show:function(){var e,i,s,n;if(!this.transitioning){if(e=this.dimension(),i=t.camelCase(["scroll",e].join("-")),s=this.$parent&&this.$parent.find("> .accordion-group > .in"),s&&s.length){if(n=s.data("collapse"),n&&n.transitioning)return;s.collapse("hide"),n||s.data("collapse",null)}this.$element[e](0),this.transition("addClass",t.Event("show"),"shown"),this.$element[e](this.$element[0][i])}},hide:function(){var e;this.transitioning||(e=this.dimension(),this.reset(this.$element[e]()),this.transition("removeClass",t.Event("hide"),"hidden"),this.$element[e](0))},reset:function(t){var e=this.dimension();return this.$element.removeClass("collapse")[e](t||"auto")[0].offsetWidth,this.$element[null!==t?"addClass":"removeClass"]("collapse"),this},transition:function(e,i,s){var n=this,r=function(){"show"==i.type&&n.reset(),n.transitioning=0,n.$element.trigger(s)};this.$element.trigger(i),i.isDefaultPrevented()||(this.transitioning=1,this.$element[e]("in"),t.support.transition&&this.$element.hasClass("collapse")?this.$element.one(t.support.transition.end,r):r())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},t.fn.collapse=function(i){return this.each(function(){var s=t(this),n=s.data("collapse"),r="object"==typeof i&&i;n||s.data("collapse",n=new e(this,r)),"string"==typeof i&&n[i]()})},t.fn.collapse.defaults={toggle:!0},t.fn.collapse.Constructor=e,t(function(){t("body").on("click.collapse.data-api","[data-toggle=collapse]",function(e){var i,s=t(this),n=s.attr("data-target")||e.preventDefault()||(i=s.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""),r=t(n).data("collapse")?"toggle":s.data();t(n).collapse(r)})})}(window.jQuery),!function(t){var e=function(e,i){this.$element=t(e),this.options=i,this.options.slide&&this.slide(this.options.slide),"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},to:function(e){var i=this.$element.find(".active"),s=i.parent().children(),n=s.index(i),r=this;if(!(e>s.length-1||0>e))return this.sliding?this.$element.one("slid",function(){r.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",t(s[e]))},pause:function(t){return t||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(e,i){var s=this.$element.find(".active"),n=i||s[e](),r=this.interval,o="next"==e?"left":"right",a="next"==e?"first":"last",l=this,h=t.Event("slide");if(this.sliding=!0,r&&this.pause(),n=n.length?n:this.$element.find(".item")[a](),!n.hasClass("active")){if(t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(h),h.isDefaultPrevented())return;n.addClass(e),n[0].offsetWidth,s.addClass(o),n.addClass(o),this.$element.one(t.support.transition.end,function(){n.removeClass([e,o].join(" ")).addClass("active"),s.removeClass(["active",o].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid")},0)})}else{if(this.$element.trigger(h),h.isDefaultPrevented())return;s.removeClass("active"),n.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return r&&this.cycle(),this}}},t.fn.carousel=function(i){return this.each(function(){var s=t(this),n=s.data("carousel"),r=t.extend({},t.fn.carousel.defaults,"object"==typeof i&&i);n||s.data("carousel",n=new e(this,r)),"number"==typeof i?n.to(i):"string"==typeof i||(i=r.slide)?n[i]():r.interval&&n.cycle()})},t.fn.carousel.defaults={interval:5e3,pause:"hover"},t.fn.carousel.Constructor=e,t(function(){t("body").on("click.carousel.data-api","[data-slide]",function(e){var i,s=t(this),n=t(s.attr("data-target")||(i=s.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),r=!n.data("modal")&&t.extend({},n.data(),s.data());n.carousel(r),e.preventDefault()})})}(window.jQuery),!function(t){var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.typeahead.defaults,i),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=t(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};e.prototype={constructor:e,select:function(){var t=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(t)).change(),this.hide()},updater:function(t){return t},show:function(){var e=t.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:e.top+e.height,left:e.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(){var e,i=this;return this.query=this.$element.val(),this.query?(e=t.grep(this.source,function(t){return i.matcher(t)}),e=this.sorter(e),e.length?this.render(e.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(t){return~t.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,i=[],s=[],n=[];e=t.shift();)e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?s.push(e):n.push(e):i.push(e);return i.concat(s,n)},highlighter:function(t){var e=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return t.replace(new RegExp("("+e+")","ig"),function(t,e){return"<strong>"+e+"</strong>"})},render:function(e){var i=this;return e=t(e).map(function(e,s){return e=t(i.options.item).attr("data-value",s),e.find("a").html(i.highlighter(s)),e[0]}),e.first().addClass("active"),this.$menu.html(e),this},next:function(){var e=this.$menu.find(".active").removeClass("active"),i=e.next();i.length||(i=t(this.$menu.find("li")[0])),i.addClass("active")},prev:function(){var t=this.$menu.find(".active").removeClass("active"),e=t.prev();e.length||(e=this.$menu.find("li").last()),e.addClass("active")},listen:function(){this.$element.on("blur",t.proxy(this.blur,this)).on("keypress",t.proxy(this.keypress,this)).on("keyup",t.proxy(this.keyup,this)),(t.browser.webkit||t.browser.msie)&&this.$element.on("keydown",t.proxy(this.keypress,this)),this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter","li",t.proxy(this.mouseenter,this))},keyup:function(t){switch(t.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}t.stopPropagation(),t.preventDefault()},keypress:function(t){if(this.shown){switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:if("keydown"!=t.type)break;t.preventDefault(),this.prev();break;case 40:if("keydown"!=t.type)break;t.preventDefault(),this.next()}t.stopPropagation()}},blur:function(){var t=this;setTimeout(function(){t.hide()},150)},click:function(t){t.stopPropagation(),t.preventDefault(),this.select()},mouseenter:function(e){this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")}},t.fn.typeahead=function(i){return this.each(function(){var s=t(this),n=s.data("typeahead"),r="object"==typeof i&&i;n||s.data("typeahead",n=new e(this,r)),"string"==typeof i&&n[i]()})},t.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},t.fn.typeahead.Constructor=e,t(function(){t("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var i=t(this);i.data("typeahead")||(e.preventDefault(),i.typeahead(i.data()))})})}(window.jQuery),s("bootstrap",function(){}),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/preview_save_tool",["underscore","jquery","backbone","common/bulk_save","./tool","./event_generators","bootstrap"],function(t,i,s,n,r,o){var a,l,h,p,u,c,_;return a=o.ButtonEventGenerator,h=function(t){function s(){return u=s.__super__.constructor.apply(this,arguments)}return e(s,t),s.prototype.initialize=function(t){return s.__super__.initialize.call(this,t)},s.prototype.eventGeneratorClass=a,s.prototype.evgen_options={buttonText:"Preview/Save"},s.prototype.tool_events={activated:"_activated"},s.prototype._activated=function(){var t,e;return t=this.plot_view.canvas[0].toDataURL(),this.plot_model.set("png",this.plot_view.canvas[0].toDataURL()),e='<div id=\'previewModal\' class=\'bokeh\'>\n  <div class="modal" role="dialog" aria-labelledby="previewLabel" aria-hidden="true">\n    <div class="modal-header">\n      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\n      <h3 id="dataConfirmLabel">Image Preview (right click to save)</h3></div><div class="modal-body">\n    <div class="modal-body">\n      <img src="'+t+'" style="max-height: 300px; max-width: 400px">\n    </div>\n    </div><div class="modal-footer">\n      <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>\n    </div>\n  </div>\n</div>',i("body").append(e),i("#previewModal .modal").on("hidden",function(){return i("#previewModal").remove(),i("#previewModal > .modal").remove()}),i("#previewModal > .modal").modal({show:!0})},s}(r.View),l=function(t){function i(){return c=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=h,i.prototype.type="PreviewSaveTool",i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(r.Model),p=function(t){function i(){return _=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=l,i}(s.Collection),{Model:l,Collection:new p,View:h}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("tool/embed_tool",["underscore","backbone","./tool","./event_generators"],function(t,i,s,n){var r,o,a,l,h,p,u,c;return r=n.ButtonEventGenerator,h=function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;")},a=function(t){function i(){return p=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){return i.__super__.initialize.call(this,t)},i.prototype.eventGeneratorClass=r,i.prototype.evgen_options={buttonText:"Embed Html"},i.prototype.tool_events={activated:"_activated"},i.prototype._activated=function(){var t,e,i,s,n,r;return console.log("EmbedToolView._activated"),window.tool_view=this,n=this.plot_model.get("id"),i=this.plot_model.get("doc"),e=this.plot_model.get("docapikey"),t=this.plot_model.get("baseurl"),r=h(this.plot_model.get("script_inject_snippet")),s='<div id="embedModal" class="bokeh">\n  <div  class="modal" role="dialog" aria-labelledby="embedLabel" aria-hidden="true">\n    <div class="modal-header">\n      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\n      <h3 id="dataConfirmLabel"> HTML Embed code</h3></div><div class="modal-body">\n      <div class="modal-body">\n        '+r+'\n      </div>\n    </div>\n    <div class="modal-footer">\n      <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>\n    </div>\n  </div>\n</div>',$("body").append(s),$("#embedModal > .modal").on("hidden",function(){return $("#embedModal").remove()}),$("#embedModal > .modal").modal({show:!0})},i}(s.View),o=function(t){function i(){return u=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=a,i.prototype.type="EmbedTool",i}(s.Model),l=function(t){function i(){return c=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=o,i.prototype.display_defaults=function(){return i.__super__.display_defaults.call(this)},i}(i.Collection),{Model:o,Collection:new l,View:a}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("widget/data_slider",["common/plot_widget","common/has_parent"],function(i,s){var n,r,o,a,l,h;return r=function(i){function s(){return a=s.__super__.constructor.apply(this,arguments)}return e(s,i),s.prototype.attributes={"class":"dataslider pull-left"},s.prototype.initialize=function(t){return s.__super__.initialize.call(this,t),this.render_init(),this.select=_.throttle(this._select,50)},s.prototype.delegateEvents=function(t){return s.__super__.delegateEvents.call(this,t),"pass"},s.prototype.label=function(t,e){return this.$(".minlabel").text(t),this.$(".maxlabel").text(e)},s.prototype.render_init=function(){var t,e,i,s,n=this;return this.$el.html(""),this.$el.append("<div class='maxlabel'></div>"),this.$el.append("<div class='slider'></div>"),this.$el.append("<div class='minlabel'></div>"),this.plot_view.$(".plotarea").append(this.$el),t=this.mget_obj("data_source").getcolumn(this.mget("field")),s=[_.min(t),_.max(t)],i=s[0],e=s[1],this.$el.find(".slider").slider({orientation:"vertical",animate:"fast",step:(e-i)/50,min:i,max:e,values:[i,e],slide:function(t,e){return n.set_selection_range(t,e),n.select(t,e)}}),this.label(i,e),this.$el.find(".slider").height(this.plot_view.view_state.get("inner_height"))},s.prototype.set_selection_range=function(t,e){var i,s,n,r;return r=_.min(e.values),n=_.max(e.values),this.label(r,n),i=this.mget_obj("data_source"),s=this.mget("field"),null==i.range_selections&&(i.range_selections={}),i.range_selections[s]=[r,n]},s.prototype._select=function(){var e,i,s,n,r,o,a,l,h,p,u,c,_,d;s=this.mget_obj("data_source"),i={},a=0,_=s.range_selections;for(e in _)t.call(_,e)&&(u=_[e],i[e]=s.getcolumn(e),a=i[e].length);for(h=[],n=c=0;a>=0?a>c:c>a;n=a>=0?++c:--c){l=!0,d=s.range_selections;for(e in d)if(t.call(d,e)&&(u=d[e],o=u[0],r=u[1],p=i[e][n],o>p||p>r)){l=!1;break}l&&h.push(n)}return s.save({selected:h},{patch:!0})},s}(i),n=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.type="DataSlider",i.prototype.default_view=r,i.prototype.defaults=function(){return{data_source:null,field:null}},i.prototype.display_defaults=function(){return{level:"tool"}},i}(s),o=function(t){function i(){return h=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=n,i}(Backbone.Collection),{Model:n,Collection:new o}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("widget/pandas/ipython_remote_data",["backbone","common/has_properties"],function(t,i){var s,n,r,o;return s=function(t){function i(){return r=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.type="IPythonRemoteData",i.prototype.defaults={computed_columns:[]},i}(i),n=function(t){function i(){return o=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=s,i}(t.Collection),{Model:s,Collection:new n}})}.call(this),s("widget/pandas/pandas_pivot_template",[],function(){var t=function(t){var e=function(t){"undefined"==typeof t&&null==t&&(t="");var e=new String(t);return e.ecoSafe=!0,e};return function(){var t=[],i=this,s=function(e){"undefined"!=typeof e&&null!=e&&t.push(e.ecoSafe?e:i.escape(e))};return function(){var t,i,n,r,o,a,l,h,p,u,c,d,f,g,y;if(s(e('<form class="form-inline tablecontrolform">\n<label>Transform </label>:  <select class="tablecontrolstate">\n    <option value="groupby" selected="selected">Group By</option>\n    <option value="filtering">Filtering</option>\n    <option value="computed">Computed Columns</option>\n  </select>\n  <br/>\n  ')),"groupby"===this.tablecontrolstate&&(s(e('\n  <label>GroupBy </label>\n  <input type="text" class="pandasgroup" value="')),s(this.group),s(e('"/>\n  <label>Aggregation</label>\n  <select class="pandasagg">\n    <option value="sum">sum</option>\n    <option value="mean">mean</option>\n    <option value="std">std</option>\n    <option value="max">max</option>\n    <option value="min">min</option>\n  </select>\n  '))),s(e("\n  ")),"filtering"===this.tablecontrolstate&&(s(e('\n  <label class="checkbox" >\n    ')),this.filterselected?s(e('\n    <input type="checkbox" class="filterselected" checked="checked"/>\n    ')):s(e('\n    <input type="checkbox" class="filterselected"/>\n    ')),s(e('\n    Filter Selection\n  </label>\n  <input type="button" class="clearselected btn btn-mini" value="Clear Selection"/>\n  <label>\n    Search\n  </label>\n  <input type="text" class="search input-large"/>\n  '))),s(e("\n  \n  ")),"computed"===this.tablecontrolstate){for(s(e('\n  <table class="table">\n    <thead>\n      <th>\n        Name\n      </th>\n      <th>\n        Value\n      </th>\n      <th>\n      </th>\n    </thead>\n    ')),d=this.computed_columns,r=0,h=d.length;h>r;r++)i=d[r],s(e("\n    <tr>\n      <td>\n        ")),s(i.name),s(e("\n      </td>\n      <td>\n        ")),s(i.code),s(e('\n      </td>\n      <td>\n        <a class="column_del" \n           name="')),s(i.name),s(e('" href="#">[delete]</a>\n      </td>\n    </tr>\n    '));s(e('\n    <tr>\n      <td>\n        <input type="text" class="computedname input-mini"/>\n      </td>\n      <td>\n        <input type="text" class="computedtxtbox input-medium"/>\n      </td>\n      <td>\n      </td>\n    </tr>\n  </table>\n  '))}for(s(e('\n  \n</form>\n\n<table class="bokehdatatable table table-bordered"\n')),this.width?(s(e('\n       style="max-height:')),s(this.height),s(e("px;max-width:")),s(this.width),s(e('px"\n'))):(s(e('\n       style="max-height:')),s(this.height),s(e('px"\n'))),s(e("\n       >\n  <thead>\n    ")),this.counts&&s(e("\n    <th>counts</th>\n    ")),s(e("\n    <th>index</th>\n    ")),f=this.columns,o=0,p=f.length;p>o;o++)t=f[o],s(e("\n    ")),this.skip[t]||(s(e('\n    <th><a class="pandascolumn">')),s(t),s(e("</a>\n      \n      ")),this.sort_ascendings[t]===!0?s(e('\n      <i class="icon-caret-up"></i>\n      ')):this.sort_ascendings[t]===!1&&s(e('\n      <i class="icon-caret-down"></i>\n      ')),s(e("\n      \n      "))),s(e("\n    </th>\n    "));for(s(e("\n  </thead>\n  ")),g=_.range(this.length),a=0,u=g.length;u>a;a++){for(n=g[a],s(e('\n  <tr class="pandasrow" rownum="')),s(n),s(e('">\n    ')),this.selected&&this.selected[n]?(s(e('\n      <td style="background-color:')),s(this.colors[n]),s(e('"> \n        ')),s(this.selected[n]),s(e("/")),s(this.counts[n]),s(e("\n      </td>      \n    "))):(s(e("\n      <td> ")),s(this.counts[n]),s(e(" </td>\n    "))),s(e("\n    <td> ")),s(this.index[n]),s(e(" </td>\n    ")),y=this.columns,l=0,c=y.length;c>l;l++)t=y[l],s(e("\n      ")),this.skip[t]||(s(e("    \n      <td> ")),s(this.data[t][n]),s(e(" </td>\n      "))),s(e("\n    "));s(e("\n  </tr>\n  "))}s(e('\n</table>\n<form>\n  <center>\n    <div class="btn-group pagination">\n      <button class="btn btn-mini">First</button>\n      <button class="btn btn-mini">Previous</button>\n      <button class="btn btn-mini">Next</button>\n      <button class="btn btn-mini">Last</button>  \n    </div>\n    <div class="paginatedisplay">\n      Show <input type="text" class="pandassize" value="')),s(this.length),s(e('"> records\n      From <input type="text" class="pandasoffset" value="')),s(this.offset),s(e('">\n      to ')),s(this.length+this.offset),s(e(" - \n      Total : ")),s(this.totallength),s(e("\n    </div>\n  </center>\n</form>\n"))}.call(this),t.join("")}.call(function(){var i,s={escape:function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},safe:e};for(i in t)s[i]=t[i];return s}())};return t}),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty,i=function(t,i){function s(){this.constructor=t}for(var n in i)e.call(i,n)&&(t[n]=i[n]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t};s("widget/pandas/pandas_pivot_table",["underscore","backbone","common/has_parent","common/continuum_view","./pandas_pivot_template"],function(e,s,n,r,o){var a,l,h,p,u,c,_;return a=13,p=function(s){function n(){return this.colors=t(this.colors,this),this.pandasend=t(this.pandasend,this),this.pandasnext=t(this.pandasnext,this),this.pandasback=t(this.pandasback,this),this.pandasbeginning=t(this.pandasbeginning,this),this.toggle_more_controls=t(this.toggle_more_controls,this),this.sort=t(this.sort,this),this.rowclick=t(this.rowclick,this),this.toggle_filterselected=t(this.toggle_filterselected,this),this.clearselected=t(this.clearselected,this),this.computedtxtbox=t(this.computedtxtbox,this),this.column_del=t(this.column_del,this),this.search=t(this.search,this),u=n.__super__.constructor.apply(this,arguments)}return i(n,s),n.prototype.template=o,n.prototype.initialize=function(t){return n.__super__.initialize.call(this,t),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model,"change",this.render),this.render()},n.prototype.events={"keyup .pandasgroup":"pandasgroup","keyup .pandasoffset":"pandasoffset","keyup .pandassize":"pandassize","change .pandasagg":"pandasagg","change .tablecontrolstate":"tablecontrolstate","click .pandasbeginning":"pandasbeginning","click .pandasback":"pandasback","click .pandasnext":"pandasnext","click .pandasend":"pandasend","click .controlsmore":"toggle_more_controls","click .pandascolumn":"sort","click .pandasrow":"rowclick","click .filterselected":"toggle_filterselected","click .clearselected":"clearselected","keyup .computedtxtbox":"computedtxtbox","click .column_del":"column_del","keyup .search":"search"},n.prototype.search=function(t){var e,i;return t.keyCode===a?(e=$(t.currentTarget).val(),i=this.model.get_obj("source"),i.rpc("search",[e]),t.preventDefault()):void 0},n.prototype.column_del=function(t){var i,s,n,r;return r=this.model.get_obj("source"),n=r.get("computed_columns"),s=$(t.currentTarget).attr("name"),i=e.filter(n,function(t){return t.name!==s}),r.rpc("set_computed_columns",[i])},n.prototype.computedtxtbox=function(t){var e,i,s,n;return t.keyCode===a?(i=this.$(".computedname").val(),e=this.$(".computedtxtbox").val(),n=this.model.get_obj("source"),s=n.get("computed_columns"),s.push({name:i,code:e}),n.rpc("set_computed_columns",[s]),t.preventDefault()):void 0},n.prototype.clearselected=function(){return this.model.rpc("setselect",[[]])},n.prototype.toggle_filterselected=function(){var t;return t=this.$(".filterselected").is(":checked"),this.mset("filterselected",t),this.model.save()},n.prototype.rowclick=function(t){var i,s,n,r,o,a,l,h,p,u;return s=this.counts(),u=this.selected(),a=function(){var t,n,r,o,a;for(r=e.zip(u,s),a=[],t=0,n=r.length;n>t;t++)o=r[t],p=o[0],i=o[1],a.push(p/i);return a}(),u=function(){var t,e,i;for(i=[],n=t=0,e=a.length;e>t;n=++t)o=a[n],o>.5&&i.push(n);return i}(),h=Number($(t.currentTarget).attr("rownum")),r=u.indexOf(h),l=-1===r?this.model.rpc("select",[[h]]):this.model.rpc("deselect",[[h]]),null},n.prototype.sort=function(t){var e;return e=$(t.currentTarget).text(),this.model.toggle_column_sort(e)},n.prototype.toggle_more_controls=function(){return this.controls_hide=this.controls_hide?!1:!0,this.render()},n.prototype.pandasbeginning=function(){return this.model.go_beginning()},n.prototype.pandasback=function(){return this.model.go_back()},n.prototype.pandasnext=function(){return this.model.go_forward()},n.prototype.pandasend=function(){return this.model.go_end()},n.prototype.pandasoffset=function(t){var i;return t.keyCode===a?(i=this.$el.find(".pandasoffset").val(),i=Number(i),e.isNaN(i)&&(i=this.model.defaults.offset),this.model.save("offset",i,{wait:!0}),t.preventDefault()):void 0},n.prototype.pandassize=function(t){var i,s;return t.keyCode===a?(s=this.$el.find(".pandassize").val(),i=Number(s),(e.isNaN(i)||""===s)&&(i=this.model.defaults.length),i+this.mget("offset")>this.mget("maxlength")&&(i=this.mget("maxlength")-this.mget("offset")),this.model.save("length",i,{wait:!0}),t.preventDefault()):void 0},n.prototype.tablecontrolstate=function(){return this.mset("tablecontrolstate",this.$(".tablecontrolstate").val())},n.prototype.pandasagg=function(){return this.model.save("agg",this.$el.find(".pandasagg").val(),{wait:!0})},n.prototype.fromcsv=function(t){return t?e.map(t.split(","),function(t){return t.trim()}):[]},n.prototype.pandasgroup=function(t){return t.keyCode===a?(this.model.set({group:this.fromcsv(this.$el.find(".pandasgroup").val()),offset:0}),this.model.save(),t.preventDefault(),!1):void 0},n.prototype.counts=function(){return this.mget("tabledata").data._counts},n.prototype.selected=function(){return this.mget("tabledata").data._selected},n.prototype.colors=function(){var t,i;return t=this.counts(),i=this.selected(),t&&i?e.map(e.zip(t,i),function(t){var e,s;return s=t[0],i=t[1],e=.3*i/s,"rgba(0,0,255,"+e+")"}):null},n.prototype.render=function(){var t,i,s,n,r,o,a,l,h,p,u;for(i=this.mget("group"),e.isArray(i)&&(i=i.join(",")),r=this.mget("sort"),e.isArray(r)&&(r=r.join(",")),t=this.colors(),o={},u=this.mget("sort"),h=0,p=u.length;p>h;h++)n=u[h],o[n.column]=n.ascending;return a=this.mget_obj("source"),l={skip:{_counts:!0,_selected:!0,index:!0},tablecontrolstate:this.mget("tablecontrolstate"),computed_columns:this.mget_obj("source").get("computed_columns"),columns:this.mget("tabledata").column_names,data:this.mget("tabledata").data,group:i,sort_ascendings:o,height:this.mget("height"),width:this.mget("width"),offset:this.mget("offset"),length:this.model.length(),filterselected:this.mget("filterselected"),totallength:this.mget("totallength"),counts:this.mget("tabledata").data._counts,selected:this.mget("tabledata").data._selected,controls_hide:this.controls_hide,colors:t,index:this.mget("tabledata").data.index},this.$el.empty(),s=this.template(l),this.$el.html(s),this.$(".pandasagg").find('option[value="'+this.mget("agg")+'"]').attr("selected","selected"),this.$(".tablecontrolstate").find('option[value="'+this.mget("tablecontrolstate")+'"]').attr("selected","selected"),this.$el.addClass("bokehtable")},n}(r.View),l=function(s){function n(){return this.toggle_column_sort=t(this.toggle_column_sort,this),this.dinitialize=t(this.dinitialize,this),c=n.__super__.constructor.apply(this,arguments)}return i(n,s),n.prototype.type="PandasPivotTable",n.prototype.initialize=function(t,i){var s=this;return n.__super__.initialize.call(this,t,i),this.throttled_fetch=e.throttle(function(){return s.fetch()},500)},n.prototype.dinitialize=function(t,e){return n.__super__.dinitialize.call(this,t,e)},n.prototype.fetch=function(t){return n.__super__.fetch.call(this,t)},n.prototype.length=function(){return e.values(this.get("tabledata").data)[0].length},n.prototype.toggle_column_sort=function(t){var i,s;return s=this.get("sort"),this.unset("sort",{silent:!0}),i=e.filter(s,function(e){return e.column===t}),i.length>0?(i=i[0],i.ascending?(i.ascending=!1,this.save("sort",s,{wait:!0})):(s=e.filter(s,function(e){return e.column!==t}),this.save("sort",s,{wait:!0})),void 0):(s=e.clone(s),s.push({column:t,ascending:!0}),this.save("sort",s,{wait:!0}),void 0)},n.prototype.go_beginning=function(){return this.set("offset",0),this.save()},n.prototype.go_back=function(){var t;return t=this.get("offset"),t-=this.length(),0>t&&(t=0),this.set("offset",t),this.save()},n.prototype.go_forward=function(){var t,e;return e=this.get("offset"),e+=this.length(),t=this.get("maxlength")-this.length(),e>t&&(e=t),this.set("offset",e),this.save()},n.prototype.go_end=function(){var t;return t=this.get("maxlength")-this.length(),this.set("offset",t),this.save()},n.prototype.default_view=p,n.prototype.defaults=function(){return{sort:[],group:[],agg:"sum",offset:0,length:100,maxlength:1e3,tabledata:null,columns_names:[],width:null,tablecontrolstate:"groupby"}},n}(n),h=function(t){function e(){return _=e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.model=l,e}(s.Collection),{Model:l,Collection:new h,View:p}})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("widget/pandas/pandas_plot_source",["backbone","source/column_data_source"],function(t,i){var s,n,r,o;return s=function(t){function i(){return r=i.__super__.constructor.apply(this,arguments)
}return e(i,t),i.prototype.type="PandasPlotSource",i}(i.Model),n=function(t){function i(){return o=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=s,i}(t.Collection),{Model:s,Collection:new n}})}.call(this),function(){s("common/base",["underscore","require","common/custom","common/plot","common/gmap_plot","common/grid_plot","common/plot_context","range/range1d","range/data_range1d","range/factor_range","range/data_factor_range","renderer/glyph/glyph_factory","renderer/guide/linear_axis","renderer/guide/datetime_axis","renderer/guide/grid","renderer/annotation/legend","renderer/overlay/box_selection","source/object_array_data_source","source/column_data_source","tool/pan_tool","tool/zoom_tool","tool/resize_tool","tool/box_select_tool","tool/data_range_box_select_tool","tool/preview_save_tool","tool/embed_tool","widget/data_slider","widget/pandas/ipython_remote_data","widget/pandas/pandas_pivot_table","widget/pandas/pandas_plot_source"],function(t,e){var i,s,n,r;return e("common/custom").monkey_patch(),s={prefix:""},n={Plot:"common/plot",GMapPlot:"common/gmap_plot",GridPlot:"common/grid_plot",CDXPlotContext:"common/plot_context",PlotContext:"common/plot_context",PlotList:"common/plot_context",Range1d:"range/range1d",DataRange1d:"range/data_range1d",FactorRange:"range/factor_range",DataFactorRange:"range/data_factor_range",Glyph:"renderer/glyph/glyph_factory",LinearAxis:"renderer/guide/linear_axis",DatetimeAxis:"renderer/guide/datetime_axis",Grid:"renderer/guide/grid",Legend:"renderer/annotation/legend",BoxSelection:"renderer/overlay/box_selection",ObjectArrayDataSource:"source/object_array_data_source",ColumnDataSource:"source/column_data_source",PanTool:"tool/pan_tool",ZoomTool:"tool/zoom_tool",ResizeTool:"tool/resize_tool",BoxSelectTool:"tool/box_select_tool",DataRangeBoxSelectTool:"tool/data_range_box_select_tool",PreviewSaveTool:"tool/preview_save_tool",EmbedTool:"tool/embed_tool",DataSlider:"widget/data_slider",IPythonRemoteData:"widget/pandas/ipython_remote_data",PandasPivotTable:"widget/pandas/pandas_pivot_table",PandasPlotSource:"widget/pandas/pandas_plot_source"},r={},i=function(t){var i;if(!n[t])throw"./base: Unknown Collection "+t;return i=n[t],null==r[i]&&(console.log("calling require",i),r[i]=e(i)),r[i].Collection},{mod_cache:r,locations:n,Collections:i,Config:s}})}.call(this),function(){s("common/plotting",["underscore","jquery","./plot","range/data_range1d","range/range1d","renderer/annotation/legend","renderer/glyph/glyph_factory","renderer/guide/linear_axis","renderer/guide/grid","renderer/overlay/box_selection","source/column_data_source","tool/box_select_tool","tool/pan_tool","tool/preview_save_tool","tool/resize_tool","tool/zoom_tool"],function(t,e,i,s,n,r,o,a,l,h,p,u,c,_,d,f){var g,y,m,v,w,x,b,k,T;return b=function(e){var i,s,n,r;for(t.isArray(e)||(e=[e]),s=[],n=0,r=e.length;r>n;n++)i=e[n],i instanceof p.Model?s.push(i):s.push(p.Collection.create({data:i}));return s},x=function(t,e,i){var r;return"auto"===t?s.Collection.create({sources:function(){var t,s,n;for(n=[],t=0,s=e.length;s>t;t++)r=e[t],n.push({ref:r.ref(),columns:i});return n}()}):t instanceof n.Model?t:n.Collection.create({start:t[0],end:t[1]})},w=function(e,i,s){var n,r,a,l,h,p,u,c,_,d;if(r=[],t.isArray(i)||(i=[i]),1===s.length)for(p=0,c=i.length;c>p;p++)l=i[p],n=o.Collection.create({data_source:s[0].ref(),parent:e.ref(),glyphspec:l,nonselection_glyphspec:{fill_alpha:.1,line_alpha:.1}}),r.push(n);else for(d=t.zip(i,s),u=0,_=d.length;_>u;u++)h=d[u],l=h[0],a=h[1],n=o.Collection.create({parent:e.ref(),data_source:a.ref(),glyphspec:l}),r.push(n);return r},g=function(e,i,s){var n,r,o,l,h,p,u,c;if(r=[],i)for(i===!0&&(i=["min","max"]),t.isArray(i)||(i=[i]),h=0,u=i.length;u>h;h++)l=i[h],o=a.Collection.create({dimension:0,axis_label:"x",location:l,parent:e.ref(),plot:e.ref()}),r.push(o);if(s)for(s===!0&&(s=["min","max"]),t.isArray(s)||(s=[s]),p=0,c=s.length;c>p;p++)l=s[p],o=a.Collection.create({dimension:1,axis_label:"y",location:l,parent:e.ref(),plot:e.ref()}),r.push(o);return e.add_renderers(function(){var t,e,i;for(i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(n.ref());return i}())},y=function(t,e,i){var s,n,r;return r=[],e&&(n=l.Collection.create({dimension:0,parent:t.ref(),plot:t.ref()}),r.push(n)),i?(n=l.Collection.create({dimension:1,parent:t.ref(),plot:t.ref()}),r.push(n),t.add_renderers(function(){var t,e,i;for(i=[],t=0,e=r.length;e>t;t++)s=r[t],i.push(s.ref());return i}())):void 0},v=function(t,e,i,s,n){var r,o,a,l,p,g,y,m;if(e!==!1)return e===!0&&(e="pan,zoom,select,resize,preview"),r=[],e.indexOf("pan")>-1&&(a=c.Collection.create({dataranges:[s.ref(),n.ref()],dimensions:["width","height"]}),r.push(a)),e.indexOf("zoom")>-1&&(m=f.Collection.create({dataranges:[s.ref(),n.ref()],dimensions:["width","height"]}),r.push(m)),e.indexOf("select")>-1&&(y=u.Collection.create({renderers:function(){var t,e,s;for(s=[],t=0,e=i.length;e>t;t++)o=i[t],s.push(o.ref());return s}()}),g=h.Collection.create({tool:y.ref()}),r.push(y),t.add_renderers([g.ref()])),e.indexOf("resize")>-1&&(p=d.Collection.create(),r.push(p)),e.indexOf("preview")>-1&&(l=_.Collection.create(),r.push(l)),t.set_obj("tools",r)},m=function(t,e,i){var s,n,o,a,l,h;if(e){for(a={},n=l=0,h=i.length;h>l;n=++l)s=i[n],a[e+String(n)]=[s.ref()];return o=r.Collection.create({parent:t.ref(),plot:t.ref(),orientation:"top_right",legends:a}),t.add_renderers([o.ref()])}},k=function(t,e,s){var n,r,o,a,l,h,p,u,c,_,d,f,k,T,C,M;return p=s.title,n=s.dims,f=s.xrange,M=s.yrange,c=s.xaxes,k=s.yaxes,d=s.xgrid,C=s.ygrid,_=s.xdr,T=s.ydr,u=s.tools,a=s.legend,null==p&&(p=""),null==n&&(n=[400,400]),null==f&&(f="auto"),null==M&&(M="auto"),null==c&&(c=!0),null==k&&(k=!0),null==d&&(d=!0),null==C&&(C=!0),null==u&&(u=!0),null==a&&(a=!1),h=b(e),_=x(f,h,["x"]),T=x(M,h,["y"]),l=i.Collection.create({x_range:_.ref(),y_range:T.ref(),canvas_width:n[0],canvas_height:n[1],outer_width:n[0],outer_height:n[1],title:p}),o=w(l,t,h),l.add_renderers(function(){var t,e,i;for(i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(r.ref());return i}()),g(l,c,k),y(l,d,C),v(l,u,o,_,T),m(l,a,o),l},T=function(i){var s,n;return s=e('<div class="plotdiv"></div>'),e("body").append(s),n=function(){var t;return t=new i.default_view({model:i}),s.append(t.$el),console.log("added plot: "+i.get("title"))},t.defer(n)},{make_plot:k,show:T}})}.call(this),function(){s("common/affine",[],function(){var t;return t=function(){function t(t,e,i,s,n,r){this.a=null!=t?t:1,this.b=null!=e?e:0,this.c=null!=i?i:0,this.d=null!=s?s:1,this.tx=null!=n?n:0,this.ty=null!=r?r:0}return t.prototype.apply=function(t,e){return[this.a*t+this.b*e+this.tx,this.c*t+this.d*e+this.ty]},t.prototype.v_apply=function(t,e){var i,s,n,r,o;for(s=new Float32Array(t.length),n=new Float32Array(e.length),i=r=0,o=t.length-1;o>=0?o>=r:r>=o;i=o>=0?++r:--r)s[i]=this.a*t[i]+this.b*e[i]+this.tx,n[i]=this.c*t[i]+this.d*e[i]+this.ty;return[s,n]},t.prototype.is_identity=function(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty},t.prototype.translate=function(t,e){return this.tx=this.a*t+this.b*e,this.ty=this.c*t+this.d*e},t.prototype.scale=function(t,e){return this.a*=t,this.b*=e,this.c*=t,this.d*=e},t.prototype.rotate=function(t){var e,i,s,n,r,o;return e=Math.cos(t),i=Math.sin(t),s=e*this.a+i*this.b,n=e*this.b-i*this.a,r=e*this.c+i*this.d,o=e*this.d-i*this.c,this.a=s,this.b=n,this.c=r,this.d=o},t.prototype.shear=function(t,e){var i,s,n,r;return i=this.a+t*this.c,s=this.b+t*this.d,n=this.c+e*this.a,r=this.d+e*this.b,this.a=i,this.b=s,this.c=n,this.d=r},t.prototype.reflect_x=function(t){return this.tx=2*this.a*t+this.tx,this.ty=2*this.c*t+this.ty,this.a=-this.a,this.c=-this.c},t.prototype.reflect_y=function(t){return this.tx=2*this.b*t+this.tx,this.ty=2*this.d*t+this.ty,this.b=-this.b,this.d=-this.d},t.prototype.reflect_xy=function(t,e){return this.tx=2*(this.a*t+this.b*e)+this.tx,this.ty=2*(this.c*t+this.d*e)+this.ty,this.a=-this.a,this.b=-this.b,this.c=-this.c,this.d=-this.d},t.prototype.compose_right=function(t){var e,i,s,n,r,o;return e=this.a*t.a+this.b*t.c,i=this.a*t.b+this.b*t.d,s=this.c*t.a+this.d*t.c,n=this.c*t.b+this.d*t.d,r=this.a*t.tx+this.b*t.ty+this.tx,o=this.c*t.tx+this.d*t.ty+this.ty,this.a=e,this.b=i,this.c=s,this.d=n,this.tx=r,this.ty=o},t.prototype.compose_left=function(t){var e,i,s,n,r,o;return e=t.a*this.a+t.b*this.c,i=t.a*this.b+t.b*this.d,s=t.c*this.a+t.d*this.c,n=t.c*this.b+t.d*this.d,r=t.a*this.tx+t.b*this.ty+t.tx,o=t.c*this.tx+t.d*this.ty+t.ty,this.a=e,this.b=i,this.c=s,this.d=n,this.tx=r,this.ty=o},t}()})}.call(this),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("common/png_view",["./continuum_view"],function(t){var i,s;return i=function(t){function i(){return s=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){return i.__super__.initialize.call(this,t),this.thumb_x=t.thumb_x||40,this.thumb_y=t.thumb_y||40,this.render(),this},i.prototype.render=function(){var t;return this.$el.html(""),t=this.model.get("png"),this.$el.append($("<p> "+this.model.get("title")+" </p>")),this.$el.append($("<img modeltype='"+this.model.type+"' modelid='"+this.model.get("id")+"' class='pngview' width='"+this.thumb_x+"'  height='"+this.thumb_y+"'  src='"+t+"'/>"))},i}(t.View)})}.call(this),function(){s("common/random",[],function(){var t;return t=function(){function t(t){this.seed=t,this.multiplier=1664525,this.modulo=4294967296,this.offset=1013904223,null!=this.seed&&t>=0&&t<this.modulo||(this.seed=(new Date).valueOf()*(new Date).getMilliseconds()%this.modulo)}return t.prototype.seed=function(t){return this.seed=t},t.prototype.randn=function(){return this.seed=(this.multiplier*this.seed+this.offset)%this.modulo},t.prototype.randf=function(){return this.randn()/this.modulo},t.prototype.rand=function(t){return Math.floor(this.randf()*t)},t.prototype.rand2=function(t,e){return t+this.rand(e-t)},t}()})}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};s("common/socket",["backbone","underscore","common/base","common/load_models"],function(e,i,s,n){var r,o,a,l;return r=s.Config,o=function(){function s(e){this.onmessage=t(this.onmessage,this);var i=this;this.auth={},this.ws_conn_string=e,this._connected=$.Deferred(),this.connected=this._connected.promise(),this.s=window.MozWebSocket?new MozWebSocket(e):new WebSocket(e),this.s.onopen=function(){return i._connected.resolve()},this.s.onmessage=this.onmessage}return i.extend(s.prototype,e.Events),s.prototype.onmessage=function(t){var e,i,s;return e=t.data,i=e.indexOf(":"),i=e.indexOf(":",i+1),s=e.substring(0,i),e=e.substring(i+1),this.trigger("msg:"+s,e),null},s.prototype.send=function(t){var e=this;return $.when(this.connected).done(function(){return e.s.send(t)})},s.prototype.subscribe=function(t,e){var i;return this.auth[t]=e,i=JSON.stringify({msgtype:"subscribe",topic:t,auth:e}),this.send(i)},s}(),l=function(t,e,i){return t.subscribe(e,i),t.on("msg:"+e,function(t){var e,i,s,o,a,l,h;if(s=JSON.parse(t),"modelpush"===s.msgtype)n(s.modelspecs);else if("modeldel"===s.msgtype)for(h=s.modelspecs,a=0,l=h.length;l>a;a++)o=h[a],i=resolve_ref(o.type,o.id),i&&i.destroy({local:!0});else"status"===s.msgtype&&"subscribesuccess"===s.status[0]?(e=s.status[2],r.clientid=e,$.ajaxSetup({headers:{"Continuum-Clientid":e}})):console.log(s);return null})},a={WebSocketWrapper:o,submodels:l}})}.call(this),function(){s("server/serverutils",["common/base","server/serverutils","common/socket","common/load_models"],function(t,i,s,n){var r,o,a,l,h,p;return r={},o={},l={},a=s.WebSocketWrapper,h=s.submodels,r._doc_loaded=$.Deferred(),r._doc_requested=$.Deferred(),o.doc_loaded=r._doc_loaded.promise(),o.doc_requested=r._doc_requested.promise(),o.doc_promises={},l.wswrapper=null,l.plotcontext=null,l.plotcontextview=null,l.Promises=o,p={load_user:function(){var t;return t=$.get("/bokeh/userinfo/",{})},load_doc_once:function(t){var e;return _.has(o.doc_promises,t)?(console.log("already found "+t+" in promises"),o.doc_promises[t]):(console.log(""+t+" not in promises, loading it"),e=p.load_doc(t),o.doc_promises[t]=e,e)},load_doc_by_title:function(t){var i,s;return i=e("common/base").Config,s=$.get(i.prefix+"/bokeh/doc",{title:t}).done(function(t){var e,i,s;return e=t.all_models,n(e),i=t.apikey,s=t.docid,h(l.wswrapper,"bokehplot:"+s,i)})},load_doc_static:function(t,e){" loads data without making a websocket connection ";var i;return load_data(e.all_models),i=jQuery.Deferred(),i.resolve(),i},load_doc:function(t){var i,s,r;return r=p.make_websocket(),i=e("common/base").Config,s=$.get(i.prefix+("/bokeh/bokehinfo/"+t+"/"),{}).done(function(e){var i,s;return i=e.all_models,n(i),s=e.apikey,h(l.wswrapper,"bokehplot:"+t,s)})},make_websocket:function(){var t,i;return t=e("common/base").Config,i=new a(t.ws_conn_string),l.wswrapper=i,i},render_plots:function(t,i,s){var n,r,o,a;return null==i&&(i=null),null==s&&(s={}),n=e("common/base").Collections,o=n(t.type).get(t.id),i||(i=o.default_view),r=_.extend(s,{model:o}),a=new i(r),o=o,a=a,a.render(),l.plotcontext=o,l.plotcontextview=a},bokeh_connection:function(t,e,i){return _.isUndefined(i)&&(i="https"),"pending"===o.doc_requested.state()?(r._doc_requested.resolve(),$.get(""+i+"://"+t+"/bokeh/publicbokehinfo/"+e,{},function(t){return console.log("instatiate_doc_single, docid",e),t=JSON.parse(t),n(t.all_models),r._doc_loaded.resolve(t)})):void 0}},l.utility=p,l})}.call(this),function(){var t=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1};s("server/embed_core",["common/base","common/load_models","server/serverutils"],function(e,i,s){var n,r,o,a,l,h,p,u,c,d,f,g,y;return y=s.utility,a=function(t,e){return o(t.bokeh_modelid,t.bokeh_modeltype,t.element,e)},o=function(t,s,n,r){var o,a,l;return o=_.keys(r)[0],!o!==t?(console.log("addPlot"),console.log(t,s,n),i(r[o]),a=e.Collections(s).get(t),l=new a.default_view({model:a}),l.render(),_.delay(function(){return $(n).replaceWith(l.$el)})):void 0},r=function(t){return console.log("addDirectPlotWrap"),n(t.bokeh_docid,t.bokeh_ws_conn_string,t.bokeh_docapikey,t.bokeh_root_url,t.bokeh_modelid,t.bokeh_modeltype,t.element)},f=function(t,i,s,n){var r,o;return console.log("serverLoad"),o={"BOKEH-API-KEY":s},$.ajaxSetup({headers:o}),r=e.Config,r.prefix=n,r.ws_conn_string=i,y.load_doc_once(t)},n=function(t,i,s,n,r,o,a){return f(t,i,s,n).done(function(){var t,i,s;return console.log("addPlot"),console.log(r,o,a),i=e.Collections(o),t=i.get(r),s=new t.default_view({model:t}),_.delay(function(){return $(a).replaceWith(s.$el)})})},u=function(t){var e,i;return e=[""+t+"css/bokeh.css",""+t+"css/continuum.css",""+t+"js/vendor/bootstrap/bootstrap-bokeh-2.0.4.css"],i=function(t){var e;return e=document.createElement("link"),e.href=t,e.rel="stylesheet",e.type="text/css",document.body.appendChild(e)},_.map(e,i)},p=[],c=function(t){"this takes a bokeh embed script element and returns the relvant\nattributes through to a dictionary, ";var e,i,s,n,r,o,a;for(i=t.attributes,n=/bokeh.*/,r={},s=0,o=0,a=i.length;a>o;o++)e=i[o],e.name.match(n)&&(r[e.name]=e.value,s++);return s>0?r:!1},g={},h=function(){var e,i,s,n,r,o,a,l,h,u,_;for(n=document.getElementsByTagName("script"),h=/.*embed.js.*/,l=[],u=0,_=n.length;_>u;u++)s=n[u],o=t.call(p,s)<0,a=s.src.match(h),o&&a&&(p.push(s),r=c(s),i=document.createElement("div"),e=document.createElement("div"),e.className="bokeh-container",s.parentNode.insertBefore(e,s),r.element=e,l.push(r));return l},d=function(t){var e,i;return i=function(e,i){var s;return"embeddata"!==e.bokeh_plottype?(r(e),delete g[i]):(s=_.keys(t)[0],i===s?(a(e,t),delete g[i]):void 0)},e=h(),_.each(e,function(t){return g[t.bokeh_modelid]=t}),_.map(g,i)},l={search_and_plot:d,injectCss:u}})}.call(this),s("server/usercontext/userdocstemplate",[],function(){var t=function(t){var e=function(t){"undefined"==typeof t&&null==t&&(t="");var e=new String(t);return e.ecoSafe=!0,e};return function(){var t=[],i=this,s=function(e){"undefined"!=typeof e&&null!=e&&t.push(e.ecoSafe?e:i.escape(e))};return function(){s(e('<div class="accordion">\n</div>\n'))}.call(this),t.join("")}.call(function(){var i,s={escape:function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},safe:e};for(i in t)s[i]=t[i];return s}())};return t}),s("server/usercontext/documentationtemplate",[],function(){var t=function(t){var e=function(t){"undefined"==typeof t&&null==t&&(t="");var e=new String(t);return e.ecoSafe=!0,e};return function(){var t=[],i=this,s=function(e){"undefined"!=typeof e&&null!=e&&t.push(e.ecoSafe?e:i.escape(e))};return function(){s(e("<p>\n  <b>\n    You have no Plots.  Follow the intsructions\n    below to create some\n  </b>\n</p>\n"))}.call(this),t.join("")}.call(function(){var i,s={escape:function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},safe:e};for(i in t)s[i]=t[i];return s}())};return t}),s("server/usercontext/wrappertemplate",[],function(){var t=function(t){var e=function(t){"undefined"==typeof t&&null==t&&(t="");var e=new String(t);return e.ecoSafe=!0,e};return function(){var t=[],i=this,s=function(e){"undefined"!=typeof e&&null!=e&&t.push(e.ecoSafe?e:i.escape(e))};return function(){s(e('<div class="accordion-heading bokehdocheading">\n  <a class="accordion-toggle bokehdoclabel" data-toggle="collapse" \n     href="#')),s(this.bodyid),s(e('">\n    Document: ')),s(this.model.get("title")),s(e('\n    <i class="bokehdelete icon-trash"></i>\n  </a>\n</div>\n<div id="')),s(this.bodyid),s(e('" class="accordion-body collapse">\n  <div class="accordion-inner plots">\n  </div>\n</div>\n\n\n'))}.call(this),t.join("")}.call(function(){var i,s={escape:function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},safe:e};for(i in t)s[i]=t[i];return s}())};return t}),function(){var t={}.hasOwnProperty,e=function(e,i){function s(){this.constructor=e}for(var n in i)t.call(i,n)&&(e[n]=i[n]);return s.prototype=i.prototype,e.prototype=new s,e.__super__=i.prototype,e};s("server/usercontext/usercontext",["common/base","../serverutils","common/continuum_view","./userdocstemplate","./documentationtemplate","./wrappertemplate","common/has_parent","common/build_views","common/load_models"],function(t,i,s,n,r,o,a,l){var h,p,u,c,d,f,g,y,m,v,w;return f={},h=s.View,g=i.utility,u=function(t){function i(){return y=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.template=o,i.prototype.attributes={"class":"accordion-group"},i.prototype.events={"click .bokehdoclabel":"loaddoc","click .bokehdelete":"deldoc"},i.prototype.deldoc=function(t){return console.log("foo"),t.preventDefault(),this.model.destroy(),!1},i.prototype.loaddoc=function(){return this.model.load()},i.prototype.initialize=function(t){return i.__super__.initialize.call(this,t),this.render_init()},i.prototype.delegateEvents=function(t){return i.__super__.delegateEvents.call(this,t),this.listenTo(this.model,"loaded",this.render)},i.prototype.render_init=function(){var t;return t=this.template({model:this.model,bodyid:_.uniqueId()}),this.$el.html(t)},i.prototype.render=function(){var t;return t=this.model.get_obj("plot_context"),this.plot_context_view=new t.default_view({model:t}),this.$el.find(".plots").append(this.plot_context_view.el),!0},i}(h),d=function(t){function i(){return m=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.initialize=function(t){return this.docs=t.docs,this.collection=t.collection,this.views={},i.__super__.initialize.call(this,t),this.render()},i.prototype.attributes={"class":"usercontext"},i.prototype.events={"click .bokehrefresh":function(){return this.collection.fetch({update:!0})}},i.prototype.delegateEvents=function(t){var e=this;return i.__super__.delegateEvents.call(this,t),this.listenTo(this.collection,"add",this.render),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"add",function(t){return e.listenTo(t,"loaded",function(){return e.listenTo(t.get_obj("plot_context"),"change",function(){return e.trigger("show")})})}),this.listenTo(this.collection,"remove",function(t){return e.stopListening(t)})},i.prototype.render_docs=function(){return this.$el.html(r()),this.$el.append(this.docs)},i.prototype.render=function(){var t,e,i,s,r;if(0===this.collection.models.length&&this.docs)return this.render_docs();for(t=n(),_.map(_.values(this.views),function(t){return t.$el.detach()}),i=this.collection.models.slice().reverse(),l(this.views,i,{}),this.$el.html(t),s=0,r=i.length;r>s;s++)e=i[s],this.$el.find(".accordion").append(this.views[e.id].el);return this},i}(h),p=function(t){function i(){return v=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.default_view=u,i.prototype.idAttribute="docid",i.prototype.defaults={docid:null,title:null,plot_context:null,apikey:null},i.prototype.sync=function(){},i.prototype.destroy=function(t){return i.__super__.destroy.call(this,t),$.ajax({url:"/bokeh/doc/"+this.get("docid")+"/",type:"delete"})},i.prototype.load=function(t){var e,i,s,n=this;if(!this.loaded)return t?(s=this.get("title"),i=g.load_doc_by_title(s)):(e=this.get("docid"),i=g.load_doc(e)),i.done(function(t){return n.set("docid",t.docid),n.set("apikey",t.apikey),n.set("plot_context",t.plot_context_ref),n.trigger("loaded"),n.loaded=!0})},i}(a),c=function(t){function i(){return w=i.__super__.constructor.apply(this,arguments)}return e(i,t),i.prototype.model=p,i.prototype.subscribe=function(t,e){return t.subscribe("bokehuser:"+e,null),this.listenTo(t,"msg:bokehuser:"+e,function(t){return t=JSON.parse(t),"docchange"===t.msgtype?this.fetch({update:!0}):void 0})},i.prototype.fetch=function(t){var e,i,s=this;return _.isUndefined(t)&&(t={}),e=i=$.get("/bokeh/userinfo/",{}),e.done(function(e){var i;return i=e.docs,t.update?s.update(i,t):s.reset(i,t)}),e},i}(Backbone.Collection),f.UserDocs=c,f.UserDocsView=d,f.Doc=p,f.DocView=u,f})}.call(this),function(){s("server/serverrun",["common/base","./serverutils","./usercontext/usercontext","common/has_properties"],function(t,e,i,s){var n,r,o,a;return n=t.Config,a=e.utility,r=e.Promises,n.ws_conn_string="ws://"+window.location.host+"/bokeh/sub",o=function(){return s.prototype.sync=Backbone.sync,$(function(){var t,e;return e=a.make_websocket(),t=new i.UserDocs,t.subscribe(e,"defaultuser"),window.userdocs=t,o=t.fetch(),o.done(function(){var e;return e=new i.UserDocsView({collection:t}),$("#PlotPane").append(e.el)})})},{load:o}})}.call(this),function(){e.config({paths:{jquery:"vendor/jquery/jquery",jquery_ui:"vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui",jquery_mousewheel:"vendor/jquery-mousewheel/jquery.mousewheel",underscore:"vendor/underscore-amd/underscore",backbone:"vendor/backbone-amd/backbone",bootstrap:"vendor/bootstrap/bootstrap-2.0.4",timezone:"vendor/timezone/src/timezone",sprintf:"vendor/sprintf/src/sprintf"},shim:{sprintf:{exports:"sprintf"}}}),s("main",["require","exports","module","common/base","common/base","common/gmap_plot","common/grid_plot","common/has_parent","common/has_properties","common/plot","common/plotting","common/affine","common/build_views","common/bulk_save","common/continuum_view","common/grid_view_state","common/load_models","common/plot_context","common/plot_widget","common/png_view","common/random","common/safebind","common/svg_colors","common/ticking","common/view_state","mapper/1d/linear_mapper","mapper/2d/grid_mapper","mapper/color/linear_color_mapper","palettes/palettes","renderer/annotation/legend","renderer/glyph/glyph","renderer/glyph/glyph_factory","renderer/guide/datetime_axis","renderer/guide/grid","renderer/guide/linear_axis","renderer/overlay/box_selection","renderer/properties","server/embed_core","server/serverrun","server/serverutils","source/column_data_source","source/object_array_data_source","tool/box_select_tool","tool/data_range_box_select_tool","tool/embed_tool","tool/pan_tool","tool/preview_save_tool","tool/resize_tool","tool/zoom_tool","widget/data_slider","server/serverrun"],function(t,e){var i,s;return i={},i.version="0.3.0",i.Collections=t("common/base").Collections,i.Config=t("common/base").Collections,i.GMapPlot=t("common/gmap_plot"),i.GridPlot=t("common/grid_plot"),i.HasParent=t("common/has_parent"),i.HasProperties=t("common/has_properties"),i.Plot=t("common/plot"),i.Plotting=t("common/plotting"),i.Affine=t("common/affine"),i.build_views=t("common/build_views"),i.bulk_save=t("common/bulk_save"),i.ContinuumView=t("common/continuum_view"),i.GridViewState=t("common/grid_view_state"),i.load_models=t("common/load_models"),i.PlotContext=t("common/plot_context"),i.PlotWidget=t("common/plot_widget"),i.PNGView=t("common/png_view"),i.Random=t("common/random"),i.safebind=t("common/safebind"),i.SVGColors=t("common/svg_colors"),i.ticking=t("common/ticking"),i.ViewState=t("common/view_state"),i.LinearMapper=t("mapper/1d/linear_mapper"),i.GridMapper=t("mapper/2d/grid_mapper"),i.LinearColorMapper=t("mapper/color/linear_color_mapper"),i.Palettes=t("palettes/palettes"),i.Legend=t("renderer/annotation/legend"),i.Glyph=t("renderer/glyph/glyph"),s=t("renderer/glyph/glyph_factory"),i.AnnularWedge=s.annular_wedge,i.Annulus=s.annulus,i.Arc=s.arc,i.Asterisk=s.asterisk,i.Bezier=s.bezier,i.Circle=s.circle,i.CircleCross=s.circle_cross,i.CircleX=s.circle_x,i.Cross=s.cross,i.Diamond=s.diamond,i.DiamondCross=s.diamond_cross,i.Image=s.image,i.ImageRGBA=s.image_rgba,i.ImageURI=s.image_uri,i.InvertedTriangle=s.inverted_triangle,i.Line=s.line,i.MultiLine=s.multi_line,i.Oval=s.oval,i.Patch=s.patch,i.Patches=s.patches,i.Quad=s.quad,i.Quadratic=s.quadratic,i.Ray=s.ray,i.Rect=s.rect,i.Segment=s.segment,i.Square=s.square,i.SquareCross=s.square_cross,i.SquareX=s.square_x,i.Text=s.text,i.Triangle=s.triangle,i.Wedge=s.wedge,i.X=s.x,i.DatetimeAxis=t("renderer/guide/datetime_axis"),i.Grid=t("renderer/guide/grid"),i.LinearAxis=t("renderer/guide/linear_axis"),i.BoxSelection=t("renderer/overlay/box_selection"),i.Properties=t("renderer/properties"),i.embed_core=t("server/embed_core"),i.serverrun=t("server/serverrun"),i.serverutils=t("server/serverutils"),i.ColumnDataSource=t("source/column_data_source"),i.ObjectArrayDataSource=t("source/object_array_data_source"),i.BoxSelectTool=t("tool/box_select_tool"),i.DataRangeBoxSelectTool=t("tool/data_range_box_select_tool"),i.EmbedTool=t("tool/embed_tool"),i.PanTool=t("tool/pan_tool"),i.PreviewSaveTool=t("tool/preview_save_tool"),i.ResizeTool=t("tool/resize_tool"),i.ZoomTool=t("tool/zoom_tool"),i.DataSlider=t("widget/data_slider"),i.server_page=t("server/serverrun").load,e.Bokeh=i,i})}.call(this),e("main")});var _oldJQ=$;jQuery.noConflict(),"undefined"==typeof $&&($=_oldJQ);