window.Bokeh=Bokeh=function(){var t=void 0;return function e(t,r,n){function o(i){if(!r[i]){if(!t[i]){var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var a=r[i]={exports:{}},l=function(e){var r=t[i][1][e];return o(r?r:e)};l.modules=o.modules,t[i][0].call(a.exports,l,a,a.exports,e,t,r,n)}return r[i].exports}o.modules=t;for(var i=null,s=0;s0&&(f.debug("Sending "+n.events.length+" changes from model construction back to server"),i=u.create("PATCH-DOC",{},n),t.send(i)),t.session=new o(t,r,t.id),f.debug("Created a new session from new pulled doc"),null!=t._on_have_session_hook?(t._on_have_session_hook(t.session),t._on_have_session_hook=null):void 0)}}(this),function(t){throw t})["catch"](function(t){return null!=console.trace&&console.trace(t),f.error("Failed to repull session "+t)})},t.prototype._on_open=function(t,e){return f.info("Websocket connection "+this._number+" is now open"),this._pending_ack=[t,e],this._current_handler=function(t){return function(e){return t._awaiting_ack_handler(e)}}(this)},t.prototype._on_message=function(t){var e,r;try{return this._on_message_unchecked(t)}catch(r){return e=r,f.error("Error handling message: "+e+", "+t)}},t.prototype._on_message_unchecked=function(t){var e,r;if(null==this._current_handler&&f.error("got a message but haven't set _current_handler"),t.data instanceof ArrayBuffer?null==this._partial||this._partial.complete()?this._close_bad_protocol("Got binary from websocket but we were expecting text"):this._partial.add_buffer(t.data):null!=this._partial?this._close_bad_protocol("Got text from websocket but we were expecting binary"):(this._fragments.push(t.data),3===this._fragments.length&&(this._partial=u.assemble(this._fragments[0],this._fragments[1],this._fragments[2]),this._fragments=[],r=this._partial.problem(),null!==r&&this._close_bad_protocol(r))),null!=this._partial&&this._partial.complete())return e=this._partial,this._partial=null,this._current_handler(e)},t.prototype._on_close=function(t){var e,r;for(f.info("Lost websocket "+this._number+" connection, "+t.code+" ("+t.reason+")"),this.socket=null,null!=this._pending_ack&&(this._pending_ack[1](new Error("Lost websocket connection, "+t.code+" ("+t.reason+")")),this._pending_ack=null),e=function(){var t,e,r;e=this._pending_replies;for(r in e)return t=e[r],delete this._pending_replies[r],t;return null},r=e();null!==r;)r[1]("Disconnected"),r=e();if(!this.closed_permanently)return this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){return f.debug("Websocket error on socket "+this._number),t(new Error("Could not open websocket"))},t.prototype._close_bad_protocol=function(t){if(f.error("Closing connection: "+t),null!=this.socket)return this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){return"ACK"!==t.msgtype()?this._close_bad_protocol("First message was not an ACK"):(this._current_handler=function(t){return function(e){return t._steady_state_handler(e)}}(this),this._repull_session_doc(),null!=this._pending_ack?(this._pending_ack[0](this),this._pending_ack=null):void 0)},t.prototype._steady_state_handler=function(t){var e;return t.reqid()in this._pending_replies?(e=this._pending_replies[t.reqid()],delete this._pending_replies[t.reqid()],e[0](t)):t.msgtype()in m?m[t.msgtype()](this,t):f.debug("Doing nothing with message "+t.msgtype())},t}(),o=function(){function t(t,e,r){this._connection=t,this.document=e,this.id=r,this._current_patch=null,this.document_listener=function(t){return function(e){return t._document_changed(e)}}(this),this.document.on_change(this.document_listener)}return t.prototype.close=function(){return this._connection.close()},t.prototype._connection_closed=function(){return this.document.remove_on_change(this.document_listener)},t.prototype.request_server_info=function(){var t,e;return t=u.create("SERVER-INFO-REQ",{}),e=this._connection.send_with_reply(t),e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._should_suppress_on_change=function(t,e){var r,n,o,i,s,a,u,c,f,m,g,y,v,b;if(e instanceof h){for(g=t.content.events,n=0,a=g.length;na;o=0<=a?++s:--s)u=r[o],c=n[o],hi&&(r=[i,o],o=r[0],i=r[1]),s>a&&(n=[a,s],s=n[0],a=n[1]),{minX:o,minY:s,maxX:i,maxY:a}},c=function(t){return t*t},s=function(t,e,r,n){return c(t-r)+c(e-n)},l=function(t,e,r){var n,o;return n=s(e.x,e.y,r.x,r.y),0===n?s(t.x,t.y,e.x,e.y):(o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n,o<0?s(t.x,t.y,e.x,e.y):o>1?s(t.x,t.y,r.x,r.y):s(t.x,t.y,e.x+o*(r.x-e.x),e.y+o*(r.y-e.y)))},a=function(t,e,r){return Math.sqrt(l(t,e,r))},o=function(t,e,r,n,o,i,s,a){var l,u,h,c,p,_,d;return h=(a-i)*(r-t)-(s-o)*(n-e),0===h?{hit:!1,x:null,y:null}:(l=e-i,u=t-o,c=(s-o)*l-(a-i)*u,p=(r-t)*l-(n-e)*u,l=c/h,u=p/h,_=t+l*(r-t),d=e+l*(n-e),{hit:l>0&&l<1&&u>0&&u<1,x:_,y:d})},e.exports={point_in_poly:h,HitTestResult:n,create_hit_test_result:i,dist_2_pts:s,dist_to_segment:a,check_2_segments_intersect:o,validate_bbox_coords:p}},{}],"common/models":[function(t,e,r){e.exports={SelectionManager:t("./selection_manager"),Selector:t("./selector"),ToolEvents:t("./tool_events"),Arrow:t("../models/annotations/arrow"),BoxAnnotation:t("../models/annotations/box_annotation"),ColorBar:t("../models/annotations/color_bar"),Label:t("../models/annotations/label"),LabelSet:t("../models/annotations/label_set"),Legend:t("../models/annotations/legend"),PolyAnnotation:t("../models/annotations/poly_annotation"),Span:t("../models/annotations/span"),Title:t("../models/annotations/title"),Tooltip:t("../models/annotations/tooltip"),OpenHead:t("../models/annotations/arrow_head").OpenHead,NormalHead:t("../models/annotations/arrow_head").NormalHead,VeeHead:t("../models/annotations/arrow_head").VeeHead,CategoricalAxis:t("../models/axes/categorical_axis"),DatetimeAxis:t("../models/axes/datetime_axis"),LinearAxis:t("../models/axes/linear_axis"),LogAxis:t("../models/axes/log_axis"),CustomJS:t("../models/callbacks/customjs"),OpenURL:t("../models/callbacks/open_url"),Canvas:t("../models/canvas/canvas"),CartesianFrame:t("../models/canvas/cartesian_frame"),BasicTickFormatter:t("../models/formatters/basic_tick_formatter"),CategoricalTickFormatter:t("../models/formatters/categorical_tick_formatter"),DatetimeTickFormatter:t("../models/formatters/datetime_tick_formatter"),LogTickFormatter:t("../models/formatters/log_tick_formatter"),FuncTickFormatter:t("../models/formatters/func_tick_formatter"),NumeralTickFormatter:t("../models/formatters/numeral_tick_formatter"),PrintfTickFormatter:t("../models/formatters/printf_tick_formatter"),AnnularWedge:t("../models/glyphs/annular_wedge"),Annulus:t("../models/glyphs/annulus"),Arc:t("../models/glyphs/arc"),Bezier:t("../models/glyphs/bezier"),Circle:t("../models/glyphs/circle"),Ellipse:t("../models/glyphs/ellipse"),Gear:t("../models/glyphs/gear"),HBar:t("../models/glyphs/hbar"),Image:t("../models/glyphs/image"),ImageRGBA:t("../models/glyphs/image_rgba"),ImageURL:t("../models/glyphs/image_url"),Line:t("../models/glyphs/line"),MultiLine:t("../models/glyphs/multi_line"),Oval:t("../models/glyphs/oval"),Patch:t("../models/glyphs/patch"),Patches:t("../models/glyphs/patches"),Quad:t("../models/glyphs/quad"),Quadratic:t("../models/glyphs/quadratic"),Ray:t("../models/glyphs/ray"),Rect:t("../models/glyphs/rect"),Segment:t("../models/glyphs/segment"),Text:t("../models/glyphs/text"),VBar:t("../models/glyphs/vbar"),Wedge:t("../models/glyphs/wedge"),Grid:t("../models/grids/grid"),Column:t("../models/layouts/column"),Row:t("../models/layouts/row"),Spacer:t("../models/layouts/spacer"),WidgetBox:t("../models/layouts/widget_box"),CategoricalMapper:t("../models/mappers/categorical_mapper"),GridMapper:t("../models/mappers/grid_mapper"),LinearColorMapper:t("../models/mappers/linear_color_mapper"),LinearMapper:t("../models/mappers/linear_mapper"),LogColorMapper:t("../models/mappers/log_color_mapper"),LogMapper:t("../models/mappers/log_mapper"),Transform:t("../models/transforms/transform"),Jitter:t("../models/transforms/jitter"),Interpolator:t("../models/transforms/interpolator"),LinearInterpolator:t("../models/transforms/linear_interpolator"),StepInterpolator:t("../models/transforms/step_interpolator"),Asterisk:t("../models/markers/index").Asterisk,CircleCross:t("../models/markers/index").CircleCross,CircleX:t("../models/markers/index").CircleX,Cross:t("../models/markers/index").Cross,Diamond:t("../models/markers/index").Diamond,DiamondCross:t("../models/markers/index").DiamondCross,InvertedTriangle:t("../models/markers/index").InvertedTriangle,Square:t("../models/markers/index").Square,SquareCross:t("../models/markers/index").SquareCross,SquareX:t("../models/markers/index").SquareX,Triangle:t("../models/markers/index").Triangle,X:t("../models/markers/index").X,Plot:t("../models/plots/plot"),GMapPlot:t("../models/plots/gmap_plot"),DataRange1d:t("../models/ranges/data_range1d"),FactorRange:t("../models/ranges/factor_range"),Range1d:t("../models/ranges/range1d"),GlyphRenderer:t("../models/renderers/glyph_renderer"),AjaxDataSource:t("../models/sources/ajax_data_source"),ColumnDataSource:t("../models/sources/column_data_source"),GeoJSONDataSource:t("../models/sources/geojson_data_source"),AdaptiveTicker:t("../models/tickers/adaptive_ticker"),BasicTicker:t("../models/tickers/basic_ticker"),CategoricalTicker:t("../models/tickers/categorical_ticker"),CompositeTicker:t("../models/tickers/composite_ticker"),ContinuousTicker:t("../models/tickers/continuous_ticker"),DatetimeTicker:t("../models/tickers/datetime_ticker"),DaysTicker:t("../models/tickers/days_ticker"),FixedTicker:t("../models/tickers/fixed_ticker"),LogTicker:t("../models/tickers/log_ticker"),MonthsTicker:t("../models/tickers/months_ticker"),SingleIntervalTicker:t("../models/tickers/single_interval_ticker"),YearsTicker:t("../models/tickers/years_ticker"),TileRenderer:t("../models/tiles/tile_renderer"),TileSource:t("../models/tiles/tile_source"),TMSTileSource:t("../models/tiles/tms_tile_source"),WMTSTileSource:t("../models/tiles/wmts_tile_source"),QUADKEYTileSource:t("../models/tiles/quadkey_tile_source"),BBoxTileSource:t("../models/tiles/bbox_tile_source"),DynamicImageRenderer:t("../models/tiles/dynamic_image_renderer"),ImageSource:t("../models/tiles/image_source"),Toolbar:t("../models/tools/toolbar"),ToolbarBox:t("../models/tools/toolbar_box"),ButtonTool:t("../models/tools/button_tool"),ActionTool:t("../models/tools/actions/action_tool"),SaveTool:t("../models/tools/actions/save_tool"),UndoTool:t("../models/tools/actions/undo_tool"),RedoTool:t("../models/tools/actions/redo_tool"),ResetTool:t("../models/tools/actions/reset_tool"),HelpTool:t("../models/tools/actions/help_tool"),BoxSelectTool:t("../models/tools/gestures/box_select_tool"),BoxZoomTool:t("../models/tools/gestures/box_zoom_tool"),GestureTool:t("../models/tools/gestures/gesture_tool"),LassoSelectTool:t("../models/tools/gestures/lasso_select_tool"),PanTool:t("../models/tools/gestures/pan_tool"),PolySelectTool:t("../models/tools/gestures/poly_select_tool"),SelectTool:t("../models/tools/gestures/select_tool"),ResizeTool:t("../models/tools/gestures/resize_tool"),TapTool:t("../models/tools/gestures/tap_tool"),WheelZoomTool:t("../models/tools/gestures/wheel_zoom_tool"),CrosshairTool:t("../models/tools/inspectors/crosshair_tool"),HoverTool:t("../models/tools/inspectors/hover_tool"),InspectTool:t("../models/tools/inspectors/inspect_tool")}},{"../models/annotations/arrow":"models/annotations/arrow","../models/annotations/arrow_head":"models/annotations/arrow_head","../models/annotations/box_annotation":"models/annotations/box_annotation","../models/annotations/color_bar":"models/annotations/color_bar","../models/annotations/label":"models/annotations/label","../models/annotations/label_set":"models/annotations/label_set","../models/annotations/legend":"models/annotations/legend","../models/annotations/poly_annotation":"models/annotations/poly_annotation","../models/annotations/span":"models/annotations/span","../models/annotations/title":"models/annotations/title","../models/annotations/tooltip":"models/annotations/tooltip","../models/axes/categorical_axis":"models/axes/categorical_axis","../models/axes/datetime_axis":"models/axes/datetime_axis","../models/axes/linear_axis":"models/axes/linear_axis","../models/axes/log_axis":"models/axes/log_axis","../models/callbacks/customjs":"models/callbacks/customjs","../models/callbacks/open_url":"models/callbacks/open_url","../models/canvas/canvas":"models/canvas/canvas","../models/canvas/cartesian_frame":"models/canvas/cartesian_frame","../models/formatters/basic_tick_formatter":"models/formatters/basic_tick_formatter","../models/formatters/categorical_tick_formatter":"models/formatters/categorical_tick_formatter","../models/formatters/datetime_tick_formatter":"models/formatters/datetime_tick_formatter","../models/formatters/func_tick_formatter":"models/formatters/func_tick_formatter","../models/formatters/log_tick_formatter":"models/formatters/log_tick_formatter","../models/formatters/numeral_tick_formatter":"models/formatters/numeral_tick_formatter","../models/formatters/printf_tick_formatter":"models/formatters/printf_tick_formatter","../models/glyphs/annular_wedge":"models/glyphs/annular_wedge","../models/glyphs/annulus":"models/glyphs/annulus","../models/glyphs/arc":"models/glyphs/arc","../models/glyphs/bezier":"models/glyphs/bezier","../models/glyphs/circle":"models/glyphs/circle","../models/glyphs/ellipse":"models/glyphs/ellipse","../models/glyphs/gear":"models/glyphs/gear","../models/glyphs/hbar":"models/glyphs/hbar","../models/glyphs/image":"models/glyphs/image","../models/glyphs/image_rgba":"models/glyphs/image_rgba","../models/glyphs/image_url":"models/glyphs/image_url","../models/glyphs/line":"models/glyphs/line","../models/glyphs/multi_line":"models/glyphs/multi_line","../models/glyphs/oval":"models/glyphs/oval","../models/glyphs/patch":"models/glyphs/patch","../models/glyphs/patches":"models/glyphs/patches","../models/glyphs/quad":"models/glyphs/quad","../models/glyphs/quadratic":"models/glyphs/quadratic","../models/glyphs/ray":"models/glyphs/ray","../models/glyphs/rect":"models/glyphs/rect","../models/glyphs/segment":"models/glyphs/segment","../models/glyphs/text":"models/glyphs/text","../models/glyphs/vbar":"models/glyphs/vbar","../models/glyphs/wedge":"models/glyphs/wedge","../models/grids/grid":"models/grids/grid","../models/layouts/column":"models/layouts/column","../models/layouts/row":"models/layouts/row","../models/layouts/spacer":"models/layouts/spacer","../models/layouts/widget_box":"models/layouts/widget_box","../models/mappers/categorical_mapper":"models/mappers/categorical_mapper","../models/mappers/grid_mapper":"models/mappers/grid_mapper","../models/mappers/linear_color_mapper":"models/mappers/linear_color_mapper","../models/mappers/linear_mapper":"models/mappers/linear_mapper","../models/mappers/log_color_mapper":"models/mappers/log_color_mapper","../models/mappers/log_mapper":"models/mappers/log_mapper","../models/markers/index":"models/markers/index","../models/plots/gmap_plot":"models/plots/gmap_plot","../models/plots/plot":"models/plots/plot","../models/ranges/data_range1d":"models/ranges/data_range1d","../models/ranges/factor_range":"models/ranges/factor_range","../models/ranges/range1d":"models/ranges/range1d","../models/renderers/glyph_renderer":"models/renderers/glyph_renderer","../models/sources/ajax_data_source":"models/sources/ajax_data_source","../models/sources/column_data_source":"models/sources/column_data_source","../models/sources/geojson_data_source":"models/sources/geojson_data_source","../models/tickers/adaptive_ticker":"models/tickers/adaptive_ticker","../models/tickers/basic_ticker":"models/tickers/basic_ticker","../models/tickers/categorical_ticker":"models/tickers/categorical_ticker","../models/tickers/composite_ticker":"models/tickers/composite_ticker","../models/tickers/continuous_ticker":"models/tickers/continuous_ticker","../models/tickers/datetime_ticker":"models/tickers/datetime_ticker","../models/tickers/days_ticker":"models/tickers/days_ticker","../models/tickers/fixed_ticker":"models/tickers/fixed_ticker","../models/tickers/log_ticker":"models/tickers/log_ticker","../models/tickers/months_ticker":"models/tickers/months_ticker","../models/tickers/single_interval_ticker":"models/tickers/single_interval_ticker","../models/tickers/years_ticker":"models/tickers/years_ticker","../models/tiles/bbox_tile_source":"models/tiles/bbox_tile_source","../models/tiles/dynamic_image_renderer":"models/tiles/dynamic_image_renderer","../models/tiles/image_source":"models/tiles/image_source","../models/tiles/quadkey_tile_source":"models/tiles/quadkey_tile_source","../models/tiles/tile_renderer":"models/tiles/tile_renderer","../models/tiles/tile_source":"models/tiles/tile_source","../models/tiles/tms_tile_source":"models/tiles/tms_tile_source","../models/tiles/wmts_tile_source":"models/tiles/wmts_tile_source","../models/tools/actions/action_tool":"models/tools/actions/action_tool","../models/tools/actions/help_tool":"models/tools/actions/help_tool","../models/tools/actions/redo_tool":"models/tools/actions/redo_tool","../models/tools/actions/reset_tool":"models/tools/actions/reset_tool","../models/tools/actions/save_tool":"models/tools/actions/save_tool","../models/tools/actions/undo_tool":"models/tools/actions/undo_tool","../models/tools/button_tool":"models/tools/button_tool","../models/tools/gestures/box_select_tool":"models/tools/gestures/box_select_tool","../models/tools/gestures/box_zoom_tool":"models/tools/gestures/box_zoom_tool","../models/tools/gestures/gesture_tool":"models/tools/gestures/gesture_tool","../models/tools/gestures/lasso_select_tool":"models/tools/gestures/lasso_select_tool","../models/tools/gestures/pan_tool":"models/tools/gestures/pan_tool","../models/tools/gestures/poly_select_tool":"models/tools/gestures/poly_select_tool","../models/tools/gestures/resize_tool":"models/tools/gestures/resize_tool","../models/tools/gestures/select_tool":"models/tools/gestures/select_tool","../models/tools/gestures/tap_tool":"models/tools/gestures/tap_tool","../models/tools/gestures/wheel_zoom_tool":"models/tools/gestures/wheel_zoom_tool","../models/tools/inspectors/crosshair_tool":"models/tools/inspectors/crosshair_tool","../models/tools/inspectors/hover_tool":"models/tools/inspectors/hover_tool","../models/tools/inspectors/inspect_tool":"models/tools/inspectors/inspect_tool","../models/tools/toolbar":"models/tools/toolbar","../models/tools/toolbar_box":"models/tools/toolbar_box","../models/transforms/interpolator":"models/transforms/interpolator","../models/transforms/jitter":"models/transforms/jitter","../models/transforms/linear_interpolator":"models/transforms/linear_interpolator","../models/transforms/step_interpolator":"models/transforms/step_interpolator","../models/transforms/transform":"models/transforms/transform","./selection_manager":"common/selection_manager","./selector":"common/selector","./tool_events":"common/tool_events"}],"common/selection_manager":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;s=t("underscore"),n=t("../core/has_props"),l=t("../core/logging").logger,i=t("./selector"),a=t("./hittest"),u=t("../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="SelectionManager",e.internal({source:[u.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.selectors={},this.inspectors={},this.last_inspection_was_empty={}},e.prototype.select=function(t,e,r,n,o){var i,s,a;return null==o&&(o=!1),a=this.get("source"),a!==e.mget("data_source")&&l.warn("select called with mis-matched data sources"),i=e.hit_test(r),null!=i&&(s=this._get_selector(e),s.update(i,n,o),this.get("source").set({selected:s.get("indices")}),a.trigger("select"),a.trigger("select-"+e.mget("id")),!i.is_empty())},e.prototype.inspect=function(t,e,r,n){var o,i,s,a;if(a=this.get("source"),a!==e.mget("data_source")&&l.warn("inspect called with mis-matched data sources"),o=e.hit_test(r),null!=o){if(s=e.model.id,o.is_empty()){if(null==this.last_inspection_was_empty[s]&&(this.last_inspection_was_empty[s]=!1),this.last_inspection_was_empty[s])return;this.last_inspection_was_empty[s]=!0}else this.last_inspection_was_empty[s]=!1;return i=this._get_inspector(e),i.update(o,!0,!1,!0),this.get("source").set({inspected:i.get("indices")},{silent:!0}),a.trigger("inspect",o,t,e,a,n),a.trigger("inspect"+e.mget("id"),o,t,e,a,n),!o.is_empty()}return!1},e.prototype.clear=function(t){var e,r,n,o;if(null!=t)o=this._get_selector(t),o.clear();else{r=this.selectors;for(e in r)n=r[e],n.clear()}return this.get("source").set({selected:a.create_hit_test_result()})},e.prototype._get_selector=function(t){return s.setdefault(this.selectors,t.model.id,new i),this.selectors[t.model.id]},e.prototype._get_inspector=function(t){return s.setdefault(this.inspectors,t.model.id,new i),this.inspectors[t.model.id]},e}(n),e.exports=o},{"../core/has_props":"core/has_props","../core/logging":"core/logging","../core/properties":"core/properties","./hittest":"common/hittest","./selector":"common/selector",underscore:"underscore"}],"common/selector":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;i=t("underscore"),n=t("../core/has_props"),s=t("./hittest"),a=t("../core/logging").logger,l=t("../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="Selector",e.prototype.update=function(t,e,r,n){return null==n&&(n=!1),this.set("timestamp",new Date,{silent:n}),this.set("final",e,{silent:n}),r&&(t["0d"].indices=i.union(this.get("indices")["0d"].indices,t["0d"].indices), t["0d"].glyph=this.get("indices")["0d"].glyph||t["0d"].glyph,t["1d"].indices=i.union(this.get("indices")["1d"].indices,t["1d"].indices),t["2d"].indices=i.union(this.get("indices")["2d"].indices,t["2d"].indices)),this.set("indices",t,{silent:n})},e.prototype.clear=function(){return this.set("timestamp",new Date),this.set("final",!0),this.set("indices",s.create_hit_test_result())},e.internal({indices:[l.Any,function(){return s.create_hit_test_result()}],"final":[l.Boolean],timestamp:[l.Any]}),e}(n),e.exports=o},{"../core/has_props":"core/has_props","../core/logging":"core/logging","../core/properties":"core/properties","./hittest":"common/hittest",underscore:"underscore"}],"common/tool_events":[function(t,e,r){var n,o,i,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;i=t("underscore"),n=t("../model"),s=t("../core/logging").logger,a=t("../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="ToolEvents",e.define({geometries:[a.Array,[]]}),e}(n),e.exports={Model:o}},{"../core/logging":"core/logging","../core/properties":"core/properties","../model":"model",underscore:"underscore"}],"common/ui_events":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;n=t("jquery"),o=t("backbone"),i=t("hammerjs"),l=t("jquery-mousewheel")(n),a=t("../core/logging").logger,s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._hammer_element()},e.prototype._hammer_element=function(){var t;return t=this.get("hit_area"),this.hammer=new i(t[0]),this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",function(t){return function(e){return t._doubletap(e)}}(this)),this.hammer.on("tap",function(t){return function(e){return t._tap(e)}}(this)),this.hammer.on("press",function(t){return function(e){return t._press(e)}}(this)),this.hammer.get("pan").set({direction:i.DIRECTION_ALL}),this.hammer.on("panstart",function(t){return function(e){return t._pan_start(e)}}(this)),this.hammer.on("pan",function(t){return function(e){return t._pan(e)}}(this)),this.hammer.on("panend",function(t){return function(e){return t._pan_end(e)}}(this)),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",function(t){return function(e){return t._pinch_start(e)}}(this)),this.hammer.on("pinch",function(t){return function(e){return t._pinch(e)}}(this)),this.hammer.on("pinchend",function(t){return function(e){return t._pinch_end(e)}}(this)),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",function(t){return function(e){return t._rotate_start(e)}}(this)),this.hammer.on("rotate",function(t){return function(e){return t._rotate(e)}}(this)),this.hammer.on("rotateend",function(t){return function(e){return t._rotate_end(e)}}(this)),t.mousemove(function(t){return function(e){return t._mouse_move(e)}}(this)),t.mouseenter(function(t){return function(e){return t._mouse_enter(e)}}(this)),t.mouseleave(function(t){return function(e){return t._mouse_exit(e)}}(this)),t.mousewheel(function(t){return function(e,r){return t._mouse_wheel(e,r)}}(this)),n(document).keydown(function(t){return function(e){return t._key_down(e)}}(this)),n(document).keyup(function(t){return function(e){return t._key_up(e)}}(this))},e.prototype.register_tool=function(t){var e,r,n;return e=t.model.event_type,r=t.model.id,n=t.model.type,null==e?void a.debug("Button tool: "+n):("pan"===e||"pinch"===e||"rotate"===e?(a.debug("Registering tool: "+n+" for event '"+e+"'"),null!=t["_"+e+"_start"]&&t.listenTo(this,e+":start:"+r,t["_"+e+"_start"]),t["_"+e]&&t.listenTo(this,e+":"+r,t["_"+e]),t["_"+e+"_end"]&&t.listenTo(this,e+":end:"+r,t["_"+e+"_end"])):"move"===e?(a.debug("Registering tool: "+n+" for event '"+e+"'"),null!=t._move_enter&&t.listenTo(this,"move:enter",t._move_enter),t.listenTo(this,"move",t._move),null!=t._move_exit&&t.listenTo(this,"move:exit",t._move_exit)):(a.debug("Registering tool: "+n+" for event '"+e+"'"),t.listenTo(this,e+":"+r,t["_"+e])),null!=t._keydown&&(a.debug("Registering tool: "+n+" for event 'keydown'"),t.listenTo(this,"keydown",t._keydown)),null!=t._keyup&&(a.debug("Registering tool: "+n+" for event 'keyup'"),t.listenTo(this,"keyup",t._keyup)),null!=t._doubletap&&(a.debug("Registering tool: "+n+" for event 'doubletap'"),t.listenTo(this,"doubletap",t._doubletap)),("ontouchstart"in window||navigator.maxTouchPoints>0)&&"pinch"===e?(a.debug("Registering scroll on touch screen"),t.listenTo(this,"scroll:"+r,t._scroll)):void 0)},e.prototype._trigger=function(t,e){var r,n,o,i;if(i=this.get("toolbar"),n=t.split(":")[0],("ontouchstart"in window||navigator.maxTouchPoints>0)&&"scroll"===t&&(n="pinch"),o=i.get("gestures"),r=o[n].active,null!=r)return this._trigger_event(t,r,e)},e.prototype._trigger_event=function(t,e,r){if(e.get("active")===!0)return"scroll"===t&&(r.preventDefault(),r.stopPropagation()),this.trigger(t+":"+e.id,r)},e.prototype._bokify_hammer=function(t){var e,r,o,i,s,a,l;return"mouse"===t.pointerType?(a=t.srcEvent.pageX,l=t.srcEvent.pageY):(a=t.pointers[0].pageX,l=t.pointers[0].pageY),r=n(t.target).offset(),e=null!=(o=r.left)?o:0,s=null!=(i=r.top)?i:0,t.bokeh={sx:a-e,sy:l-s}},e.prototype._bokify_jq=function(t){var e,r,o,i,s;return r=n(t.currentTarget).offset(),e=null!=(o=r.left)?o:0,s=null!=(i=r.top)?i:0,t.bokeh={sx:t.pageX-e,sy:t.pageY-s}},e.prototype._tap=function(t){return this._bokify_hammer(t),this._trigger("tap",t)},e.prototype._doubletap=function(t){return this._bokify_hammer(t),this.trigger("doubletap",t)},e.prototype._press=function(t){return this._bokify_hammer(t),this._trigger("press",t)},e.prototype._pan_start=function(t){return this._bokify_hammer(t),t.bokeh.sx-=t.deltaX,t.bokeh.sy-=t.deltaY,this._trigger("pan:start",t)},e.prototype._pan=function(t){return this._bokify_hammer(t),this._trigger("pan",t)},e.prototype._pan_end=function(t){return this._bokify_hammer(t),this._trigger("pan:end",t)},e.prototype._pinch_start=function(t){return this._bokify_hammer(t),this._trigger("pinch:start",t)},e.prototype._pinch=function(t){return this._bokify_hammer(t),this._trigger("pinch",t)},e.prototype._pinch_end=function(t){return this._bokify_hammer(t),this._trigger("pinch:end",t)},e.prototype._rotate_start=function(t){return this._bokify_hammer(t),this._trigger("rotate:start",t)},e.prototype._rotate=function(t){return this._bokify_hammer(t),this._trigger("rotate",t)},e.prototype._rotate_end=function(t){return this._bokify_hammer(t),this._trigger("rotate:end",t)},e.prototype._mouse_enter=function(t){return this._bokify_jq(t),this.trigger("move:enter",t)},e.prototype._mouse_move=function(t){return this._bokify_jq(t),this.trigger("move",t)},e.prototype._mouse_exit=function(t){return this._bokify_jq(t),this.trigger("move:exit",t)},e.prototype._mouse_wheel=function(t,e){return this._bokify_jq(t),t.bokeh.delta=e,this._trigger("scroll",t)},e.prototype._key_down=function(t){return this.trigger("keydown",t)},e.prototype._key_up=function(t){return this.trigger("keyup",t)},e}(o.Model),e.exports=s},{"../core/logging":"core/logging",backbone:"backbone",hammerjs:"hammerjs/hammer",jquery:"jquery","jquery-mousewheel":"jquery-mousewheel"}],"core/bokeh_view":[function(t,e,r){var n,o,i,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("underscore"),n=t("backbone"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t){if(!i.has(t,"id"))return this.id=i.uniqueId("BokehView")},e.prototype.bind_bokeh_events=function(){},e.prototype.remove=function(){var t,r,n;if(i.has(this,"eventers")){t=this.eventers;for(r in t)a.call(t,r)&&(n=t[r],n.off(null,null,this))}return this.trigger("remove",this),e.__super__.remove.call(this)},e.prototype.mget=function(){return this.model.get.apply(this.model,arguments)},e.prototype.mset=function(){return this.model.set.apply(this.model,arguments)},e}(n.View),e.exports=o},{backbone:"backbone",underscore:"underscore"}],"core/enums":[function(t,e,r){e.exports={AngleUnits:["deg","rad"],Dimension:["width","height"],Direction:["clock","anticlock"],FontStyle:["normal","italic","bold"],LineCap:["butt","round","square"],LineJoin:["miter","round","bevel"],Location:["above","below","left","right"],LegendLocation:["top_left","top_center","top_right","left_center","center","right_center","bottom_left","bottom_center","bottom_right"],Orientation:["vertical","horizontal"],RenderLevel:["image","underlay","glyph","annotation","overlay","tool"],RenderMode:["canvas","css"],Side:["left","right"],SpatialUnits:["screen","data"],StartEnd:["start","end"],TextAlign:["left","right","center"],TextBaseline:["top","middle","bottom","alphabetic","hanging","ideographic"],DistributionTypes:["uniform","normal"],TransformStepModes:["after","before","center"],SizingMode:["stretch_both","scale_width","scale_height","scale_both","fixed"]}},{}],"core/has_props":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty,p=[].slice;n=t("jquery"),s=t("underscore"),o=t("backbone"),a=t("./logging").logger,l=t("./property_mixins"),u=t("./util/refs"),i=function(t){function e(t,e){var r,n,o,i,a,l;this.document=null,r=t||{},e||(e={}),this.cid=s.uniqueId("c"),this.attributes={},this.properties={},i=this.props;for(o in i){if(a=i[o],l=a.type,n=a.default_value,null==l)throw new Error("undefined property type for "+this.type+"."+o);this.properties[o]=new l({obj:this,attr:o,default_value:n})}e.parse&&(r=this.parse(r,e)||{}),this._set_after_defaults={},this.set(r,e),this.changed={},this._computed={},s.has(r,this.idAttribute)||(this.id=s.uniqueId(this.type),this.attributes[this.idAttribute]=this.id),e.defer_initialization||this.initialize.apply(this,arguments)}return h(e,t),e.prototype.props={},e.prototype.mixins=[],e.define=function(t){var e,r,n;n=[];for(e in t)r=t[e],n.push(function(t){return function(e,r){var n,o,i,a,l;if(null!=t.prototype.props[e])throw new Error("attempted to redefine property '"+t.name+"."+e+"'");if(null!=t.prototype[e]&&"url"!==e)throw new Error("attempted to redefine attribute '"+t.name+"."+e+"'");return Object.defineProperty(t.prototype,e,{get:function(){return this.get(e)},set:function(t){return this.set(e,t)}},{configurable:!1,enumerable:!0}),l=r[0],n=r[1],o=r[2],a={type:l,default_value:n,internal:null!=o&&o},i=s.clone(t.prototype.props),i[e]=a,t.prototype.props=i}}(this)(e,r));return n},e.internal=function(t){var e,r,n,o;e={},r=function(t){return function(t,r){var n,o;return o=r[0],n=r[1],e[t]=[o,n,!0]}}(this);for(n in t)o=t[n],r(n,o);return this.define(e)},e.mixin=function(){var t,e;return e=1<=arguments.length?p.call(arguments,0):[],this.define(l.create(e)),t=this.prototype.mixins.concat(e),this.prototype.mixins=t},e.mixins=function(t){return this.mixin.apply(this,t)},e.override=function(t,e){var r,n,o;s.isString(t)?(n={},n[r]=e):n=t,o=[];for(r in n)e=n[r],o.push(function(t){return function(e,r){var n,o;if(o=t.prototype.props[e],null==o)throw new Error("attempted to override nonexistent '"+t.name+"."+e+"'");return n=s.clone(t.prototype.props),n[e]=s.extend({},o,{default_value:r}),t.prototype.props=n}}(this)(r,e));return o},e.prototype.toString=function(){return this.type+"("+this.id+")"},e.prototype.destroy=function(t){return e.__super__.destroy.call(this,t),this.stopListening()},e.prototype.set=function(t,r,n){var o,i,a,l,u;s.isObject(t)||null===t?(o=t,n=r):(o={},o[t]=r);for(t in o)if(c.call(o,t)){if(u=o[t],a=t,"id"!==a&&!this.props[a])throw new Error(this.type+".set('"+a+"'): "+a+" wasn't declared");null!=n&&n.defaults||(this._set_after_defaults[t]=!0)}if(!s.isEmpty(o)){i={};for(t in o)r=o[t],i[t]=this.get(t);if(e.__super__.set.call(this,o,n),null==(null!=n?n.silent:void 0)){l=[];for(t in o)r=o[t],l.push(this._tell_document_about_change(t,i[t],this.get(t)));return l}}},e.prototype.add_dependencies=function(t,e,r){var n,o,i,a,l;for(s.isArray(r)||(r=[r]),a=this._computed[t],a.dependencies=a.dependencies.concat({obj:e,fields:r}),l=[],o=0,i=r.length;o0&&(n="middle",r=y[o]),t.textBaseline=n,t.textAlign=r,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.get("side"),v[e][t]},e}(h.Model),e.exports={Model:_,update_constraints:j}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./layout_canvas":"core/layout/layout_canvas","./solver":"core/layout/solver",underscore:"underscore"}],"core/layout/solver":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_;h=t("underscore"),n=t("backbone"),_=t("kiwi"),u=_.Variable,i=_.Expression,o=_.Constraint,s=_.Operator,l=_.Strength,c=function(t){return function(e){return function(){var e;return e=Object.create(i.prototype),i.apply(e,arguments),new o(e,t)}}(this)},p=function(t){return function(){var e,r,n,s;for(r=[null],n=0,s=arguments.length;ne;r=0<=e?++t:--t)o.push(i);return o}();return null!=this.spec.transform&&(o=this.spec.transform.v_compute(o)),o},e.prototype._init=function(t){var e,r,n,o;if(null==t&&(t=!0),o=this.get("obj"),null==o)throw new Error("missing property object");if(null==o.properties)throw new Error("property object must be a HasProps");if(e=this.get("attr"),null==e)throw new Error("missing property attr");if(r=o.get(e),B.isUndefined(r)&&(n=this.get("default_value"),r=function(){switch(!1){case!B.isUndefined(n):return null;case!B.isArray(n):return B.clone(n);case!B.isFunction(n):return n(o);default:return n}}(),o.set(e,r,{silent:!0,defaults:!0})),B.isArray(r)?this.spec={value:r}:B.isObject(r)&&1===B.size(B.pick.apply(null,[r].concat(this.specifiers)))?this.spec=r:this.spec={value:r},null!=this.spec.field&&!B.isString(this.spec.field))throw new Error("field value for property '"+e+"' is not a string");if(null!=this.spec.value&&this.validate(this.spec.value),this.init(),t)return this.trigger("change")},e}(u.Model),V=function(t,e){var r;return r=function(r){function n(){return n.__super__.constructor.apply(this,arguments)}return X(n,r),n.prototype.toString=function(){return t+"(obj: "+this.get(obj).id+", spec: "+JSON.stringify(this.spec)+")"},n.prototype.validate=function(r){var n;if(!e(r))throw n=this.get("attr"),new Error(t+" property '"+n+"' given invalid value: "+r)},n}(E)},a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("Any",function(t){return!0})),l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("Array",function(t){return B.isArray(t)||t instanceof Float64Array})),h=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("Bool",B.isBoolean)),c=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("Color",function(t){return null!=U[t.toLowerCase()]||"#"===t.substring(0,1)||H(t)})),w=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("Instance",function(t){return null!=t.properties})),S=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("Number",function(t){return B.isNumber(t)||B.isBoolean(t)})),q=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(V("String",B.isString)),v=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(q),L=function(t,e){var r;return r=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return X(r,e),r.prototype.toString=function(){return t+"(obj: "+this.get(obj).id+", spec: "+JSON.stringify(this.spec)+")"},r}(V(t,function(t){return W.call(e,t)>=0}))},n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("Anchor",G.LegendLocation)),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("AngleUnits",G.AngleUnits)),d=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.transform=function(t){var e,r,n,o;for(o=new Uint8Array(t.length),e=r=0,n=t.length;0<=n?rn;e=0<=n?++r:--r)switch(t[e]){case"clock":o[e]=!1;break;case"anticlock":o[e]=!0}return o},e}(L("Direction",G.Direction)),_=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("Dimension",G.Dimension)),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("FontStyle",G.FontStyle)),k=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("LineCap",G.LineCap)),j=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("LineJoin",G.LineJoin)),M=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("LegendLocation",G.LegendLocation)),T=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("Location",G.Location)),P=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("Orientation",G.Orientation)),I=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("TextAlign",G.TextAlign)),R=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("TextBaseline",G.TextBaseline)),A=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("RenderLevel",G.RenderLevel)), C=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("RenderMode",G.RenderMode)),N=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("SizingMode",G.SizingMode)),O=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("SpatialUnits",G.SpatialUnits)),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("Distribution",G.DistributionTypes)),F=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("TransformStepMode",G.TransformStepModes)),Y=function(t,e,r){var n;return n=function(n){function o(){return o.__super__.constructor.apply(this,arguments)}return X(o,n),o.prototype.toString=function(){return t+"(obj: "+this.get(obj).id+", spec: "+JSON.stringify(this.spec)+")"},o.prototype.init=function(){var n;if(null==this.spec.units&&(this.spec.units=r),this.units=this.spec.units,n=this.spec.units,W.call(e,n)<0)throw new Error(t+" units must be one of "+e+", given invalid value: "+n)},o}(S)},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.transform=function(t){var r;return"deg"===this.spec.units&&(t=function(){var e,n,o;for(o=[],e=0,n=t.length;e=0)throw new Error("color expects rgb to have value between 0 and 255");return!0},e.exports={color2hex:o,color2rgba:i,valid_rgb:a}},{"./svg_colors":"core/util/svg_colors"}],"core/util/data_structures":[function(t,e,r){var n,o,i;i=t("underscore"),n=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var r;if(null===e)throw new Error("Can't put null in this dict");if(i.isArray(e))throw new Error("Can't put arrays in this dict");return r=this._existing(t),null===r?this._dict[t]=e:i.isArray(r)?r.push(e):this._dict[t]=[r,e]},t.prototype.remove_value=function(t,e){var r,n;return r=this._existing(t),i.isArray(r)?(n=i.without(r,e),n.length>0?this._dict[t]=n:delete this._dict[t]):i.isEqual(r,e)?delete this._dict[t]:void 0},t.prototype.get_one=function(t,e){var r;if(r=this._existing(t),i.isArray(r)){if(1===r.length)return r[0];throw new Error(e)}return r},t}(),o=function(){function t(e){if(e){if(e.constructor===t)return new t(e.values);e.constructor===Array?this.values=t.compact(e):this.values=[e]}else this.values=[]}return t.compact=function(t){var e,r,n,o;for(o=[],r=0,n=t.length;rr&&(r=n);return r},i=function(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t},o=function(t,e){return Math.abs(i(t-e))},n=function(t,e,r,n){var s;return t=i(t),s=o(e,r),"anticlock"===n?o(e,t)<=s&&o(t,r)<=s:!(o(e,t)<=s&&o(t,r)<=s)},u=function(){return Math.random()},l=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},h=function(t,e){var r,n,o;for(r=null,n=null;;)if(r=u(),n=u(),n=(2*n-1)*Math.sqrt(2*(1/Math.E)),-4*r*r*Math.log(r)>=n*n)break;return o=n/r,o=t+e*o},e.exports={array_min:a,array_max:s,angle_norm:i,angle_dist:o,angle_between:n,atan2:l,rnorm:h,random:u}},{}],"core/util/refs":[function(t,e,r){var n,o,i,s,a;o=t("underscore"),n=t("../has_props"),s=function(t){var e;if(!(t instanceof n.constructor))throw new Error("can only create refs for HasProps subclasses");return e={type:t.type,id:t.id},null!=t._subtype&&(e.subtype=t._subtype),e},a=function(t){var e;if(o.isObject(t)){if(e=o.keys(t).sort(),2===e.length)return"id"===e[0]&&"type"===e[1];if(3===e.length)return"id"===e[0]&&"subtype"===e[1]&&"type"===e[2]}return!1},i=function(t){return o.isArray(t)?o.map(t,i):t instanceof n.constructor?t.ref():void 0},e.exports={convert_to_ref:i,create_ref:s,is_ref:a}},{"../has_props":"core/has_props",underscore:"underscore"}],"core/util/svg_colors":[function(t,e,r){e.exports={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",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",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",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",silver:"#C0C0C0",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",gray:"#808080",grey:"#808080",dimgray:"#696969",dimgrey:"#696969",lightslategray:"#778899",lightslategrey:"#778899",slategray:"#708090",slategrey:"#708090",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",black:"#000000"}},{}],"core/util/text":[function(t,e,r){var n,o,i;n=t("jquery"),o={},i=function(t){var e,r,i,s,a;if(null!=o[t])return o[t];a=n("Hg").css({font:t}),e=n('
'),i=n("
"),i.append(a,e),r=n("body"),r.append(i);try{s={},e.css({verticalAlign:"baseline"}),s.ascent=e.offset().top-a.offset().top,e.css({verticalAlign:"bottom"}),s.height=e.offset().top-a.offset().top,s.descent=s.height-s.ascent}finally{i.remove()}return o[t]=s,s},e.exports={get_text_height:i}},{jquery:"jquery"}],"core/util/throttle":[function(t,e,r){var n,o,i;n=function(t){return t()},o=("undefined"!=typeof window&&null!==window?window.requestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.mozRequestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.webkitRequestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.msRequestAnimationFrame:void 0)||n,i=function(t,e){var r,n,i,s,a,l,u,h;return l=[null,null,null,null],n=l[0],r=l[1],h=l[2],u=l[3],a=0,s=!1,i=function(){return a=new Date,h=null,s=!1,u=t.apply(n,r)},function(){var t,l;return t=new Date,l=e-(t-a),n=this,r=arguments,l<=0&&!s?(clearTimeout(h),s=!0,o(i)):h||s||(h=setTimeout(function(){return o(i)},l)),u}},e.exports={throttle:i}},{}],"core/util/underscore":[function(t,e,r){var n,o;n=t("underscore"),o=function(){return n.uniqueId=function(t){var e,r,n,o,i;for(o=[],e="0123456789ABCDEF",r=n=0;n<=31;r=++n)o[r]=e.substr(Math.floor(16*Math.random()),1);return o[12]="4",o[16]=e.substr(3&o[16]|8,1),i=o.join(""),t?t+"-"+i:i}},n.isNullOrUndefined=function(t){return n.isNull(t)||n.isUndefined(t)},n.setdefault=function(t,e,r){return n.has(t,e)?t[e]:(t[e]=r,r)},e.exports={patch:o}},{underscore:"underscore"}],document:[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j=function(t,e){function r(){this.constructor=t}for(var n in e)T.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},T={}.hasOwnProperty,S=[].indexOf||function(t){for(var e=0,r=this.length;e0;)t.push(this.remove_root(this._roots[0]));return t}finally{this._pop_all_models_freeze()}},t.prototype._destructively_move=function(t){var e,r,n,o,i,s;if(t===this)throw new Error("Attempted to overwrite a document with itself");t.clear(),s=[],this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0]),s.push(i)}finally{this._pop_all_models_freeze()}for(e=0,n=s.length;e=0)){this._push_all_models_freeze();try{this._roots.push(t),t._is_root=!0}finally{this._pop_all_models_freeze()}return this._init_solver(),this._trigger_on_change(new _(this,t))}},t.prototype.remove_root=function(t){var e;if(e=this._roots.indexOf(t),!(e<0)){this._push_all_models_freeze();try{this._roots.splice(e,1),t._is_root=!1}finally{this._pop_all_models_freeze()}return this._init_solver(),this._trigger_on_change(new d(this,t))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t){if(t!==this._title)return this._title=t,this._trigger_on_change(new g(this,t))},t.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},t.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,"Multiple models are named '"+t+"'")},t.prototype.on_change=function(t){if(!(S.call(this._callbacks,t)>=0))return this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e;if(e=this._callbacks.indexOf(t),e>=0)return this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){var e,r,n,o,i;for(o=this._callbacks,i=[],r=0,n=o.length;r0||v.difference(w,i).length>0)throw new Error("Not implemented: computing add/remove of document roots");j={},n=[],g=r._all_models;for(a in g)_=g[a],a in o&&(k=t._events_to_sync_objects(o[a],x[a],r,j),n=n.concat(k));return{events:n,references:t._references_json(v.values(j),l=!1)}},t.prototype.to_json_string=function(t){return null==t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){var r,n,o,i,s,a;for(null==e&&(e=!0),s=[],i=this._roots,r=0,n=i.length;r"),n("body").append(e)},z=function(t){var e;return e=n("