sjy-ecos/public/lib/bokeh/js/bokeh.min.js

274 lines
876 KiB
JavaScript

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;s<n.length;s++)i=o(n[s]);return i}({base:[function(t,e,r){var n,o,i,s,a,l,u,h,c,p={}.hasOwnProperty;o=t("underscore"),u=t("./core/logging").logger,t("./core/util/underscore").patch(),l=t("./common/models"),c={},h=function(t){var e,r,n,i,s,a,l,u,h;s={};for(n in t)if(a=t[n],o.isArray(a)){u=a[0],h=null!=(i=a[1])?i:"";for(l in u)e=u[l],r=l+h,s[r]=e}else s[n]=a;return s},s=null,i=function(){return null==s&&(s=h(l)),s},n=function(t){var e,r;if(r=i(),c[t])return c[t];if(e=r[t],null==e)throw new Error("Module `"+t+"' does not exists. The problem may be two fold. Either a model was requested that's available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn't registered before first usage.");return e.Model},n.register=function(t,e){return c[t]=e},n.unregister=function(t){return delete c[t]},n.register_locations=function(t,e,r){var n,o,s,a,l;null==e&&(e=!1),null==r&&(r=null),o=i(),n=h(t),l=[];for(a in n)p.call(n,a)&&(s=n[a],e||!o.hasOwnProperty(a)?l.push(o[a]=s):l.push("function"==typeof r?r(a):void 0));return l},n.registered_names=function(){return Object.keys(i())},a={},e.exports={overrides:c,index:a,Models:n}},{"./common/models":"common/models","./core/logging":"core/logging","./core/util/underscore":"core/util/underscore",underscore:"underscore"}],client:[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y;d=t("underscore"),c=t("es6-promise").Promise,l=t("./core/has_props"),f=t("./core/logging").logger,y=t("./document"),a=y.Document,h=y.ModelChangedEvent,p=y.RootAddedEvent,_=y.RootRemovedEvent,i="ws://localhost:5006/ws",s="default",u=function(){function t(t,e,r){this.header=t,this.metadata=e,this.content=r,this.buffers=[]}return t.assemble=function(e,r,n){var o,i,s,a,l;try{return a=JSON.parse(e),l=JSON.parse(r),o=JSON.parse(n),new t(a,l,o)}catch(s){throw i=s,f.error("Failure parsing json "+i+" "+e+" "+r+" "+n,i),i}},t.create_header=function(t,e){var r;return r={msgid:d.uniqueId(),msgtype:t},d.extend(r,e)},t.create=function(e,r,n){var o;return null==n&&(n={}),o=t.create_header(e,r),new t(o,{},n)},t.prototype.send=function(t){var e,r,n,o,i;try{return o=JSON.stringify(this.header),i=JSON.stringify(this.metadata),e=JSON.stringify(this.content),t.send(o),t.send(i),t.send(e)}catch(n){throw r=n,f.error("Error sending ",this,r),r}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!("num_buffers"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.add_buffer=function(t){return this.buffers.push(t)},t.prototype._header_field=function(t){return t in this.header?this.header[t]:null},t.prototype.msgid=function(){return this._header_field("msgid")},t.prototype.msgtype=function(){return this._header_field("msgtype")},t.prototype.sessid=function(){return this._header_field("sessid")},t.prototype.reqid=function(){return this._header_field("reqid")},t.prototype.problem=function(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"},t}(),m={"PATCH-DOC":function(t,e){return t._for_session(function(t){return t._handle_patch(e)})},OK:function(t,e){return f.debug("Unhandled OK reply to "+e.reqid())},ERROR:function(t,e){return f.error("Unhandled ERROR reply to "+e.reqid()+": "+e.content.text)}},n=function(){function t(e,r,n,o){this.url=e,this.id=r,this._on_have_session_hook=n,this._on_closed_permanently_hook=o,this._number=t._connection_count,t._connection_count=this._number+1,null==this.url&&(this.url=i),null==this.id&&(this.id=s),f.debug("Creating websocket "+this._number+" to '"+this.url+"' session '"+this.id+"'"),this.socket=null,this.closed_permanently=!1,this._fragments=[],this._partial=null,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this.session=null}return t._connection_count=0,t.prototype._for_session=function(t){if(null!==this.session)return t(this.session)},t.prototype.connect=function(){var t,e,r;if(this.closed_permanently)return c.reject(new Error("Cannot connect() a closed ClientConnection"));if(null!=this.socket)return c.reject(new Error("Already connected"));this._fragments=[],this._partial=null,this._pending_replies={},this._current_handler=null;try{return r=this.url+"?bokeh-protocol-version=1.0&bokeh-session-id="+this.id,null!=window.MozWebSocket?this.socket=new MozWebSocket(r):this.socket=new WebSocket(r),new c(function(t){return function(e,r){return t.socket.binarytype="arraybuffer",t.socket.onopen=function(){return t._on_open(e,r)},t.socket.onmessage=function(e){return t._on_message(e)},t.socket.onclose=function(e){return t._on_close(e)},t.socket.onerror=function(){return t._on_error(r)}}}(this))}catch(e){return t=e,f.error("websocket creation failed to url: "+this.url),f.error(" - "+t),c.reject(t)}},t.prototype.close=function(){if(!this.closed_permanently&&(f.debug("Permanently closing websocket connection "+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,"close method called on ClientConnection "+this._number),this._for_session(function(t){return t._connection_closed()}),null!=this._on_closed_permanently_hook))return this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null},t.prototype._schedule_reconnect=function(t){var e;return e=function(t){return function(){t.closed_permanently||f.info("Websocket connection "+t._number+" disconnected, will not attempt to reconnect")}}(this),setTimeout(e,t)},t.prototype.send=function(t){var e,r;try{if(null===this.socket)throw new Error("not connected so cannot send "+t);return t.send(this.socket)}catch(r){return e=r,f.error("Error sending message ",e,t)}},t.prototype.send_with_reply=function(t){var e;return e=new c(function(e){return function(r,n){return e._pending_replies[t.msgid()]=[r,n],e.send(t)}}(this)),e.then(function(t){if("ERROR"===t.msgtype())throw new Error("Error reply "+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t,e;return t=u.create("PULL-DOC-REQ",{}),e=this.send_with_reply(t),e.then(function(t){if(!("doc"in t.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){return null===this.session?f.debug("Pulling session for first time"):f.debug("Repulling session"),this._pull_doc_json().then(function(t){return function(e){var r,n,i;return null!==t.session?(t.session.document.replace_with_json(e),f.debug("Updated existing session with new pulled doc")):t.closed_permanently?f.debug("Got new document after connection was already closed"):(r=a.from_json(e),n=a._compute_patch_since_json(e,r),n.events.length>0&&(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;n<a;n++)if(r=g[n],"ModelChanged"===r.kind&&r.model.id===e.model.id&&r.attr===e.attr)if(m=r["new"],e.new_ instanceof l){if("object"==typeof m&&"id"in m&&m.id===e.new_.id)return!0}else if(d.isEqual(m,e.new_))return!0}else if(e instanceof p){for(y=t.content.events,o=0,u=y.length;o<u;o++)if(r=y[o],"RootAdded"===r.kind&&r.model.id===e.model.id)return!0}else if(e instanceof _){for(v=t.content.events,i=0,c=v.length;i<c;i++)if(r=v[i],"RootRemoved"===r.kind&&r.model.id===e.model.id)return!0}else if(e instanceof TitleChangedEvent)for(b=t.content.events,s=0,f=b.length;s<f;s++)if(r=b[s],"TitleChanged"===r.kind&&r.title===e.title)return!0;return!1},t.prototype._document_changed=function(t){var e;if(!(null!=this._current_patch&&this._should_suppress_on_change(this._current_patch,t)||t instanceof h&&!(t.attr in t.model.serializable_attributes())))return e=u.create("PATCH-DOC",{},this.document.create_json_patch([t])),this._connection.send(e)},t.prototype._handle_patch=function(t){this._current_patch=t;try{return this.document.apply_json_patch(t.content)}finally{this._current_patch=null}},t}(),g=function(t,e){var r,o,i;return i=null,r=null,o=new c(function(o,i){return r=new n(t,e,function(t){var e,r;try{return o(t)}catch(r){throw e=r,f.error("Promise handler threw an error, closing session "+error),t.close(),e}},function(){return i(new Error("Connection was closed before we successfully pulled a session"))}),r.connect().then(function(t){},function(t){throw f.error("Failed to connect to Bokeh server "+t),t})}),o.close=function(){return r.close()},o},e.exports={pull_session:g,DEFAULT_SERVER_WEBSOCKET_URL:i,DEFAULT_SESSION_ID:s}},{"./core/has_props":"core/has_props","./core/logging":"core/logging","./document":"document","es6-promise":"es6-promise",underscore:"underscore"}],"common/build_views":[function(t,e,r){var n,o,i;n=t("underscore"),o=function(t,e,r,o){var s,a,l,u,h,c,p,_,d,f,m;for(null==o&&(o=[]),s=[],d=n.filter(e,function(e){return!n.has(t,e.id)}),l=a=0,c=d.length;a<c;l=++a)_=d[l],m=n.extend({},r,{model:_}),l<o.length?t[_.id]=new o[l](m):t[_.id]=new _.default_view(m),t[_.id].$el.find("*[class*='ui-']").each(function(t,e){return e.className=i(e)}),s.push(t[_.id]);for(f=n.difference(n.keys(t),n.pluck(e,"id")),u=0,p=f.length;u<p;u++)h=f[u],t[h].remove(),delete t[h];return s},i=function(t){var e,r;if(null!=t.className)return e=t.className.split(" "),r=n.map(e,function(t){return t=t.trim(),0===t.indexOf("ui-")?"bk-"+t:t}),r.join(" ")},o.jQueryUIPrefixer=i,e.exports=o=o},{underscore:"underscore"}],"common/hittest":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p;h=function(t,e,r,n){var o,i,s,a,l,u,h,c;for(i=!1,l=r[r.length-1],h=n[n.length-1],o=s=0,a=r.length;0<=a?s<a:s>a;o=0<=a?++s:--s)u=r[o],c=n[o],h<e!=c<e&&l+(e-h)/(c-h)*(u-l)<t&&(i=!i),l=u,h=c;return i},u=function(){return null},n=function(){function t(){this["0d"]={glyph:null,get_view:u,indices:[]},this["1d"]={indices:[]},this["2d"]={}}return Object.defineProperty(t.prototype,"_0d",{get:function(){return this["0d"]}}),Object.defineProperty(t.prototype,"_1d",{get:function(){return this["1d"]}}),Object.defineProperty(t.prototype,"_2d",{get:function(){return this["2d"]}}),t.prototype.is_empty=function(){return 0===this._0d.indices.length&&0===this._1d.indices.length},t}(),i=function(){return new n},p=function(t,e){var r,n,o,i,s,a;return o=t[0],i=t[1],s=e[0],a=e[1],o>i&&(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;o<i;o++)n=r[o],l.push(this.listenTo(e,"change:"+n,a.callbacks.changedep));return l},e.prototype.define_computed_property=function(t,e,r){var n,o,i;if(null==r&&(r=!0),null!=this.props[t]&&console.log("attempted to redefine existing property "+this.type+"."+t),s.has(this._computed,t))throw new Error("attempted to redefine existing computed property "+this.type+"."+t);return n=function(e){return function(){return e.trigger("changedep:"+t)}}(this),i=function(e){return function(){var r,n,i;if(r=!0,o.use_cache&&(i=o.cache,o.cache=void 0,n=e.get(t),r=n!==i),r)return e.trigger("change:"+t,e,e.get(t)),e.trigger("change",e)}}(this),o={getter:e,dependencies:[],use_cache:r,callbacks:{changedep:n,propchange:i}},this._computed[t]=o,this.listenTo(this,"changedep:"+t,o.callbacks.propchange),o},e.prototype.override_computed_property=function(t,e,r){return null==r&&(r=!0),s.has(this._computed,t)&&this._remove_computed_property(t),this.define_computed_property(t,e,r)},e.prototype._remove_computed_property=function(t){var e,r,n,o,i,s,a,l,u,h;for(u=this._computed[t],r=u.dependencies,o=0,s=r.length;o<s;o++)for(e=r[o],l=e.obj,h=e.fields,i=0,a=h.length;i<a;i++)n=h[i],l.off("change:"+n,u.callbacks.changedep,this);return this.off("changedep:"+e),delete this._computed[t]},e.prototype.get=function(t){if(s.has(this._computed,t))return this._get_prop(t);if("id"!==t&&!this.props[t])throw new Error(this.type+".get('"+t+"'): "+t+" wasn't declared");return e.__super__.get.call(this,t)},e.prototype._get_prop=function(t){var e,r,n;return n=this._computed[t],n.use_cache&&n.cache?n.cache:(r=n.getter,e=r.apply(this,[t]),n.use_cache&&(n.cache=e),e)},e.prototype.ref=function(){return u.create_ref(this)},e.prototype.set_subtype=function(t){return this._subtype=t},e.prototype.sync=function(t,e,r){return r.success(e.attributes,null,{})},e.prototype.defaults=function(){throw new Error("don't use HasProps.defaults anymore")},e.prototype.attribute_is_serializable=function(t){var e;if("id"===t)return!0;if(e=this.props[t],null==e)throw new Error(this.type+".attribute_is_serializable('"+t+"'): "+t+" wasn't declared");return!e.internal},e.prototype.serializable_attributes=function(){var t,e,r,n;t={},r=this.attributes;for(e in r)n=r[e],this.attribute_is_serializable(e)&&(t[e]=n);return t},e.prototype.toJSON=function(t){throw new Error("bug: toJSON should not be called on "+this+", models require special serialization measures")},e._value_to_json=function(t,r,n){var o,i,a,l,u,h,p;if(r instanceof e)return r.ref();if(s.isArray(r)){for(l=[],o=i=0,a=r.length;i<a;o=++i)p=r[o],l.push(e._value_to_json(o,p,r));return l}if(s.isObject(r)){u={};for(h in r)c.call(r,h)&&(u[h]=e._value_to_json(h,r[h],r));return u}return r},e.prototype.attributes_as_json=function(t,r){var n,o,i,s;null==t&&(t=!0),null==r&&(r=e._value_to_json),n={},i=this.serializable_attributes();for(o in i)c.call(i,o)&&(s=i[o],t?n[o]=s:o in this._set_after_defaults&&(n[o]=s));return r("attributes",n,this)},e._json_record_references=function(t,r,n,o){var i,a,l,h,p,_,d;if(null===r);else if(u.is_ref(r)){if(!(r.id in n))return p=t.get_model_by_id(r.id),e._value_record_references(p,n,o)}else{if(s.isArray(r)){for(_=[],a=0,h=r.length;a<h;a++)i=r[a],_.push(e._json_record_references(t,i,n,o));return _}if(s.isObject(r)){d=[];for(l in r)c.call(r,l)&&(i=r[l],d.push(e._json_record_references(t,i,n,o)));return d}}},e._value_record_references=function(t,r,n){var o,i,a,l,u,h,p,_,d,f,m;if(null===t);else if(t instanceof e){if(!(t.id in r)&&(r[t.id]=t,n)){for(i=t._immediate_references(),d=[],a=0,h=i.length;a<h;a++)_=i[a],d.push(e._value_record_references(_,r,!0));return d}}else{if(s.isArray(t)){for(f=[],u=0,p=t.length;u<p;u++)o=t[u],f.push(e._value_record_references(o,r,n));return f}if(s.isObject(t)){m=[];for(l in t)c.call(t,l)&&(o=t[l],m.push(e._value_record_references(o,r,n)));return m}}},e.prototype._immediate_references=function(){var t,r,n,o;n={},t=this.serializable_attributes();for(r in t)o=t[r],e._value_record_references(o,n,!1);return s.values(n)},e.prototype.references=function(){var t;return t={},e._value_record_references(this,t,!0),s.values(t)},e.prototype.attach_document=function(t){var e,r,n;if(null!==this.document&&this.document!==t)throw new Error("models must be owned by only a single document");this.document=t,n=this.properties;for(e in n)r=n[e],r.update();if(null!=this._doc_attached)return this._doc_attached()},e.prototype.detach_document=function(){return this.document=null},e.prototype._tell_document_about_change=function(t,r,n){var o,i,s,a,l,u,h;if(this.attribute_is_serializable(t)&&null!==this.document){a={},e._value_record_references(n,a,!1),h={},e._value_record_references(r,h,!1),o=!1;for(i in a)if(s=a[i],!(i in h)){o=!0;break}if(!o)for(l in h)if(u=h[l],!(l in a)){o=!0;break}return o&&this.document._invalidate_all_models(),this.document._notify_change(this,t,r,n)}},e}(o.Model),e.exports=i},{"./logging":"core/logging","./property_mixins":"core/property_mixins","./util/refs":"core/util/refs",backbone:"backbone",jquery:"jquery",underscore:"underscore"}],"core/layout/layout_canvas":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;u=t("underscore"),c=t("./solver"),l=c.Variable,n=c.EQ,o=c.GE,a=c.Strength,s=t("../../model"),h=t("../properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.type="LayoutCanvas",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._top=new l("top "+this.id),this._left=new l("left "+this.id),this._width=new l("width "+this.id),this._height=new l("height "+this.id),this._right=new l("right "+this.id),this._bottom=new l("bottom "+this.id),this.define_computed_property("height",this._get_var,!1),this.define_computed_property("width",this._get_var,!1),this.define_computed_property("right",this._get_var,!1),this.define_computed_property("left",this._get_var,!1),this.define_computed_property("top",this._get_var,!1),this.define_computed_property("bottom",this._get_var,!1)},e.internal({layout_location:[h.Any]}),e.prototype.get_edit_variables=function(){var t;return t=[],t.push({edit_variable:this._top,strength:a.strong}),t.push({edit_variable:this._left,strength:a.strong}),t.push({edit_variable:this._width,strength:a.strong}),t.push({edit_variable:this._height,strength:a.strong}),t},e.prototype.get_constraints=function(){return[]},e.prototype._get_var=function(t){return this["_"+t].value()},e}(s),e.exports={Model:i}},{"../../model":"model","../properties":"core/properties","./solver":"core/layout/solver",underscore:"underscore"}],"core/layout/side_panel":[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,T=function(t,e){function r(){this.constructor=t}for(var n in e)S.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},S={}.hasOwnProperty;f=t("underscore"),k=t("./solver"),s=k.EQ,a=k.GE,h=t("./layout_canvas"),w=t("../../core/properties"),x=t("../../core/logging").logger,M=Math.PI/2,n="alphabetic",d="top",o="bottom",c="middle",l="hanging",u="left",p="right",i="center",v={above:{parallel:0,normal:-M,horizontal:0,vertical:-M},below:{parallel:0,normal:M,horizontal:0,vertical:M},left:{parallel:-M,normal:0,horizontal:0,vertical:-M},right:{parallel:M,normal:0,horizontal:0,vertical:M}},b={above:{justified:d,parallel:n,normal:c,horizontal:n,vertical:c},below:{justified:o,parallel:l,normal:c,horizontal:l,vertical:c},left:{justified:d,parallel:n,normal:c,horizontal:c,vertical:n},right:{justified:d,parallel:n,normal:c,horizontal:c,vertical:n}},m={above:{justified:i,parallel:i,normal:u,horizontal:i,vertical:u},below:{justified:i,parallel:i,normal:u,horizontal:i,vertical:p},left:{justified:i,parallel:i,normal:p,horizontal:p,vertical:i},right:{justified:i,parallel:i,normal:u,horizontal:u,vertical:i}},g={above:p,below:u,left:p,right:u},y={above:u,below:p,left:p,right:u},j=function(t){var e,r,n,o;if(o=t,(null==o.model.props.visible||o.mget("visible")!==!1)&&(n=o._get_size(),null==o._last_size&&(o._last_size=-1),n!==o._last_size))return e=o.model.document.solver(),o._last_size=n,null!=o._size_constraint&&e.remove_constraint(o._size_constraint),o._size_constraint=a(o.model.panel._size,-n),e.add_constraint(o._size_constraint),null==o._full_set&&(o._full_set=!1),o._full_set?void 0:(r=o.model.panel.get("side"),"above"!==r&&"below"!==r||e.add_constraint(s(o.model.panel._width,[-1,o.plot_model.canvas._width])),"left"!==r&&"right"!==r||e.add_constraint(s(o.model.panel._height,[-1,o.plot_model.canvas._height])),o._full_set=!0)},_=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return T(e,t),e.internal({side:[w.String],plot:[w.Instance]}),e.prototype.initialize=function(t,r){var n;return e.__super__.initialize.call(this,t,r),n=this.get("side"),"above"===n?(this._dim=0,this._normals=[0,-1],this._size=this._height,this._anchor=this._bottom):"below"===n?(this._dim=0,this._normals=[0,1],this._size=this._height,this._anchor=this._top):"left"===n?(this._dim=1,this._normals=[-1,0],this._size=this._width,this._anchor=this._right):"right"===n?(this._dim=1,this._normals=[1,0],this._size=this._width,this._anchor=this._left):x.error("unrecognized side: '"+n+"'")},e.prototype.get_constraints=function(){var t;return t=[],t.push(a(this._top)),t.push(a(this._bottom)),t.push(a(this._left)),t.push(a(this._right)),t.push(a(this._width)),t.push(a(this._height)),t.push(s(this._left,this._width,[-1,this._right])),t.push(s(this._bottom,this._height,[-1,this._top])),t},e.prototype.apply_label_text_heuristics=function(t,e){var r,n,o;return o=this.get("side"),f.isString(e)?(n=b[o][e],r=m[o][e]):0===e?(n=b[o][e],r=m[o][e]):e<0?(n="middle",r=g[o]):e>0&&(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;n<s;n++)e=arguments[n],r.push(e);return new o(new(Function.prototype.bind.apply(i,r)),t,_.Strength.weak)}},a=function(){function t(){this.solver=new _.Solver}return t.prototype.clear=function(){return this.solver=new _.Solver},t.prototype.toString=function(){return"Solver[num_constraints="+this.num_constraints()+", num_edit_variables="+this.num_edit_variables()+"]"},t.prototype.num_constraints=function(){return this.solver._cnMap._array.length},t.prototype.num_edit_variables=function(){return this.solver._editMap._array.length},t.prototype.update_variables=function(t){if(null==t&&(t=!0),this.solver.updateVariables(),t)return this.trigger("layout_update")},t.prototype.add_constraint=function(t){return this.solver.addConstraint(t)},t.prototype.remove_constraint=function(t){return this.solver.removeConstraint(t)},t.prototype.add_edit_variable=function(t,e){return this.solver.addEditVariable(t,e)},t.prototype.remove_edit_variable=function(t){return this.solver.removeEditVariable(t,strength)},t.prototype.suggest_value=function(t,e){return this.solver.suggestValue(t,e)},t}(),h.extend(a.prototype,n.Events),e.exports={Variable:u,Expression:i,Constraint:o,Operator:s,Strength:l,EQ:c(s.Eq),LE:c(s.Le),GE:c(s.Ge),WEAK_EQ:p(s.Eq),WEAK_LE:p(s.Le),WEAK_GE:p(s.Ge),Solver:a}},{backbone:"backbone",kiwi:"kiwi",underscore:"underscore"}],"core/logging":[function(t,e,r){var n,o,i,s;n=t("jsnlog").JL,i=n("Bokeh"),i.setOptions({appenders:[n.createConsoleAppender("consoleAppender")],level:n.getInfoLevel()}),o={trace:n.getTraceLevel(),debug:n.getDebugLevel(),info:n.getInfoLevel(),warn:n.getWarnLevel(),error:n.getErrorLevel(),fatal:n.getFatalLevel()},s=function(t){return t in o?(console.log("Bokeh: setting log level to: '"+t+"'"),i.setOptions({level:o[t]}),null):(console.log("Bokeh: Unrecognized logging level '"+t+"' passed to Bokeh.set_log_level, ignoring."),void console.log("Bokeh: Valid log levels are: "+Object.keys(o)))},e.exports={levels:o,logger:i,set_log_level:s}},{jsnlog:"jsnlog"}],"core/properties":[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,T,S,z,P,E,A,C,N,O,q,D,I,R,F,B,L,G,V,U,Y,H,X=function(t,e){function r(){this.constructor=t}for(var n in e)$.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},$={}.hasOwnProperty,W=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};B=t("underscore"),u=t("backbone"),G=t("./enums"),U=t("./util/svg_colors"),H=t("./util/color").valid_rgb,E=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!1,e.prototype.specifiers=["field","value"],e.prototype.initialize=function(t,r){var n,o;return e.__super__.initialize.call(this,t,r),this._init(!1),o=this.get("obj"),n=this.get("attr"),this.listenTo(o,"change:"+n,function(){return this._init(),o.trigger("propchange")}),this.listenTo(this,"change:obj",function(){throw new Error("attempted to reset 'obj' on Property")}),this.listenTo(this,"change:attr",function(){throw new Error("attempted to reset 'attr' on Property")})},e.prototype.update=function(){return this._init()},e.prototype.init=function(){},e.prototype.transform=function(t){return t},e.prototype.validate=function(t){},e.prototype.value=function(t){var e;if(null==t&&(t=!0),B.isUndefined(this.spec.value))throw new Error("attempted to retrieve property value for property without value specification");return e=this.transform([this.spec.value])[0],null!=this.spec.transform&&t&&(e=this.spec.transform.compute(e)),e},e.prototype.array=function(t){var e,r,n,o,i;if(!this.dataspec)throw new Error("attempted to retrieve property array for non-dataspec property");if(e=t.get("data"),null!=this.spec.field){if(!(this.spec.field in e))throw new Error("attempted to retrieve property array for nonexistent field '"+this.spec.field+"'");o=this.transform(t.get_column(this.spec.field))}else n=t.get_length(),null==n&&(n=1),i=this.value(!1),o=function(){var t,e,o;for(o=[],r=t=0,e=n;0<=e?t<e:t>e;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?r<n:r>n;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<n;e++)r=t[e],o.push(r*Math.PI/180);return o}()),t=function(){var e,n,o;for(o=[],e=0,n=t.length;e<n;e++)r=t[e],o.push(-r);return o}(),e.__super__.transform.call(this,t)},e}(Y("Angle",G.AngleUnits,"rad")),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(Y("Distance",G.SpatialUnits,"data")),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(o),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(c),f=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(m),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(m),b=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(q),z=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(S),D=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(q),e.exports={Property:E,simple_prop:V,enum_prop:L,units_prop:Y,Anchor:n,Any:a,Angle:o,AngleUnits:s,Array:l,Bool:h,Boolean:h,Color:c,Dimension:_,Direction:d,Distance:m,Font:v,FontStyle:x,Instance:w,LegendLocation:M,LineCap:k,LineJoin:j,Location:T,Number:S,Int:S,Orientation:P,RenderLevel:A,RenderMode:C,SizingMode:N,SpatialUnits:O,String:q,TextAlign:I,TextBaseline:R,Distribution:y,TransformStepMode:F,AngleSpec:i,ColorSpec:p,DirectionSpec:f,DistanceSpec:g,FontSizeSpec:b,NumberSpec:z,StringSpec:D}},{"./enums":"core/enums","./util/color":"core/util/color","./util/svg_colors":"core/util/svg_colors",backbone:"backbone",underscore:"underscore"}],"core/property_mixins":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p;n=t("underscore"),c=t("./properties"),i=function(t,e){var r,n,o;n={},null==e&&(e="");for(r in t)o=t[r],n[e+r]=o;return n},s={line_color:[c.ColorSpec,"black"],line_width:[c.NumberSpec,1],line_alpha:[c.NumberSpec,1],line_join:[c.LineJoin,"miter"],line_cap:[c.LineCap,"butt"],line_dash:[c.Array,[]],line_dash_offset:[c.Number,0]},h=function(t){return i(s,t)},o={fill_color:[c.ColorSpec,"gray"],fill_alpha:[c.NumberSpec,1]},u=function(t){return i(o,t)},a={text_font:[c.Font,"helvetica"],text_font_size:[c.FontSizeSpec,"12pt"],text_font_style:[c.FontStyle,"normal"],text_color:[c.ColorSpec,"#444444"],text_alpha:[c.NumberSpec,1],text_align:[c.TextAlign,"left"],text_baseline:[c.TextBaseline,"bottom"]},p=function(t){return i(a,t)},l=function(t){var e,r,o,i,s,a,l;for(l={},r=0,i=t.length;r<i;r++){if(e=t[r],a=e.split(":"),o=a[0],s=a[1],null==this[o])throw Error("Unknown property mixin kind '"+o+"'");l=n.extend(l,this[o](s))}return l},e.exports={line:h,fill:u,text:p,create:l}},{"./properties":"core/properties",underscore:"underscore"}],"core/util/bbox":[function(t,e,r){var n,o;n=function(){return{minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}},o=function(t,e){var r;return r={},r.minX=Math.min(t.minX,e.minX),r.maxX=Math.max(t.maxX,e.maxX),r.minY=Math.min(t.minY,e.minY),r.maxY=Math.max(t.maxY,e.maxY),r},e.exports={empty:n,union:o}},{}],"core/util/canvas":[function(t,e,r){var n,o,i,s,a,l;i=function(t){if(t.setLineDash||(t.setLineDash=function(e){return t.mozDash=e,t.webkitLineDash=e}),!t.getLineDash)return t.getLineDash=function(){return t.mozDash}},s=function(t){return t.setLineDashOffset=function(e){return t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}},o=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}},a=function(t){if(t.measureText&&null==t.html5MeasureText)return t.html5MeasureText=t.measureText,t.measureText=function(e){var r;return r=t.html5MeasureText(e),r.ascent=1.6*t.html5MeasureText("m").width,r}},l=function(t,e){var r,n;return e?(n=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,n/r):1},n=function(t){var e;if(e=function(e,r,n,o,i,s,a,l){var u,h,c;null==l&&(l=!1),u=.551784,t.translate(e,r),t.rotate(i),h=n,c=o,l&&(h=-n,c=-o),t.moveTo(-h,0),t.bezierCurveTo(-h,c*u,-h*u,c,0,c),t.bezierCurveTo(h*u,c,h,c*u,h,0),t.bezierCurveTo(h,-c*u,h*u,-c,0,-c),t.bezierCurveTo(-h*u,-c,-h,-c*u,-h,0),t.rotate(-i),t.translate(-e,-r)},!t.ellipse)return t.ellipse=e},e.exports={fixup_image_smoothing:o,fixup_line_dash:i,fixup_line_dash_offset:s,fixup_measure_text:a,get_scale_ratio:l,fixup_ellipse:n}},{}],"core/util/color":[function(t,e,r){var n,o,i,s,a,l=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};s=t("./svg_colors"),n=function(t){var e;return e=Number(t).toString(16),e=1===e.length?"0"+e:e},o=function(t){var e,r,o;return t+="",0===t.indexOf("#")?t:null!=s[t]?s[t]:0===t.indexOf("rgb")?(r=t.match(/\d+/g),e=function(){var t,e,i;for(i=[],t=0,e=r.length;t<e;t++)o=r[t],i.push(n(o));return i}().join(""),"#"+e.slice(0,8)):t},i=function(t,e){var r,n,i;if(null==e&&(e=1),!t)return[0,0,0,0];for(r=o(t),r=r.replace(/ |#/g,""),r.length<=4&&(r=r.replace(/(.)/g,"$1$1")),r=r.match(/../g),i=function(){var t,e,o;for(o=[],t=0,e=r.length;t<e;t++)n=r[t],o.push(parseInt(n,16)/255);return o}();i.length<3;)i.push(0);return i.length<4&&i.push(e),i.slice(0,4)},a=function(t){var e,r,n,o;switch(t.substring(0,4)){case"rgba":r={start:"rgba(",len:4,alpha:!0};break;case"rgb(":r={start:"rgb(",len:3,alpha:!1};break;default:return!1}if(new RegExp(".*?(\\.).*(,)").test(t))throw new Error("color expects integers for rgb in rgb/rgba tuple, received "+t);if(e=t.replace(r.start,"").replace(")","").split(",").map(parseFloat),e.length!==r.len)throw new Error("color expects rgba "+expect_len+"-tuple, received "+t);if(r.alpha&&!(0<=(n=e[3])&&n<=1))throw new Error("color expects rgba 4-tuple to have alpha value between 0 and 1");if(l.call(function(){var t,r,n,i;for(n=e.slice(0,3),i=[],t=0,r=n.length;t<r;t++)o=n[t],i.push(0<=o&&o<=255);return i}(),!1)>=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;r<n;r++)e=t[r],o.indexOf(e)===-1&&o.push(e);return o},t.prototype.push=function(t){if(this.missing(t))return this.values.push(t)},t.prototype.remove=function(t){var e;return e=this.values.indexOf(t),this.values=this.values.slice(0,e).concat(this.values.slice(e+1))},t.prototype.length=function(){return this.values.length},t.prototype.includes=function(t){return this.values.indexOf(t)!==-1},t.prototype.missing=function(t){return!this.includes(t)},t.prototype.slice=function(t,e){return this.values.slice(t,e)},t.prototype.join=function(t){return this.values.join(t)},t.prototype.toString=function(){return this.join(", ")},t.prototype.includes=function(t){return this.values.indexOf(t)!==-1},t.prototype.union=function(e){return e=new t(e),new t(this.values.concat(e.values))},t.prototype.intersect=function(e){var r,n,o,i,s;for(e=new t(e),i=new t,s=e.values,n=0,o=s.length;n<o;n++)r=s[n],this.includes(r)&&e.includes(r)&&i.push(r);return i},t.prototype.diff=function(e){var r,n,o,i,s;for(e=new t(e),i=new t,s=this.values,n=0,o=s.length;n<o;n++)r=s[n],e.missing(r)&&i.push(r);return i},t}(),e.exports={MultiDict:n,Set:o}},{underscore:"underscore"}],"core/util/math":[function(t,e,r){var n,o,i,s,a,l,u,h;a=function(t){var e,r,n;for(e=t.length,r=1/0;e--;)n=t[e],n<r&&(r=n);return r},s=function(t){var e,r,n;for(e=t.length,r=-(1/0);e--;)n=t[e],n>r&&(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("<span>Hg</span>").css({font:t}),e=n('<div style="display: inline-block; width: 1px; height: 0px;"> </div>'),i=n("<div></div>"),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;e<r;e++)if(e in this&&this[e]===t)return e;return-1};v=t("underscore"),n=t("jquery"),c=t("./base").Models,x=t("./version"),M=t("./core/layout/solver"),l=M.EQ,m=M.Solver,y=M.Variable,w=t("./core/logging").logger,u=t("./core/has_props"),b=t("./core/util/refs").is_ref,k=t("./core/util/data_structures"),p=k.MultiDict,f=k.Set,o=t("./models/sources/column_data_source"),a=function(){function t(t){this.document=t}return t}(),h=function(t){function e(t,r,n,o,i){this.document=t,this.model=r,this.attr=n,this.old=o,this.new_=i,e.__super__.constructor.call(this,this.document)}return j(e,t),e.prototype.json=function(t){var e,r,n,o;if("id"===this.attr)throw console.log("'id' field is immutable and should never be in a ModelChangedEvent ",this),new Error("'id' field should never change, whatever code just set it is wrong");r=this.new_,n=u._value_to_json("new_",r,this.model),o={},u._value_record_references(r,o,!0),this.model.id in o&&this.model!==r&&delete o[this.model.id];for(e in o)t[e]=o[e];return{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,"new":n}},e}(a),g=function(t){function e(t,r){this.document=t,this.title=r,e.__super__.constructor.call(this,this.document)}return j(e,t),e.prototype.json=function(t){return{kind:"TitleChanged",title:this.title}},e}(a),_=function(t){function e(t,r){this.document=t,this.model=r,e.__super__.constructor.call(this,this.document)}return j(e,t),e.prototype.json=function(t){return u._value_record_references(this.model,t,!0),{kind:"RootAdded",model:this.model.ref()}},e}(a),d=function(t){function e(t,r){this.document=t,this.model=r,e.__super__.constructor.call(this,this.document)}return j(e,t),e.prototype.json=function(t){return{kind:"RootRemoved",model:this.model.ref()}},e}(a),i="Bokeh Application",s=function(){function t(){this._title=i,this._roots=[],this._all_models={},this._all_models_by_name=new p,this._all_models_freeze_count=0,this._callbacks=[],this._doc_width=new y("document_width"),this._doc_height=new y("document_height"),this._solver=new m,this._init_solver(),n(window).on("resize",n.proxy(this.resize,this))}return t.prototype._init_solver=function(){var t,e,r,n,o;for(this._solver.clear(),this._solver.add_edit_variable(this._doc_width),this._solver.add_edit_variable(this._doc_height),n=this._roots,o=[],t=0,e=n.length;t<e;t++)r=n[t],r.layoutable?o.push(this._add_layoutable(r)):o.push(void 0);return o},t.prototype.solver=function(){return this._solver},t.prototype.resize=function(){return this._resize(),this._resize()},t.prototype._resize=function(){var t,e,r,o,i,s,a,l,u,h;for(i=this._roots,e=0,r=i.length;e<r;e++)if(s=i[e],s.layoutable===!0&&(u=s.get_constrained_variables(),null!=u.width||null!=u.height)){for(a=n("#modelid_"+s.id),l=0,o=a;0===l;)o=o.parent(),l=o.height();h=o.width(),t=l,null!=u.width&&(w.debug("Suggest width on Document -- "+h),this._solver.suggest_value(this._doc_width,h)),null!=u.height&&(w.debug("Suggest height on Document -- "+t),this._solver.suggest_value(this._doc_height,t))}return this._solver.update_variables(!1),this._solver.trigger("resize")},t.prototype.clear=function(){var t;this._push_all_models_freeze();try{for(t=[];this._roots.length>0;)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<n;e++)if(i=s[e],null!==i.document)throw new Error("Somehow we didn't detach "+i);if(0!==_all_models.length)throw new Error("_all_models still had stuff in it: "+this._all_models);for(r=0,o=s.length;r<o;r++)i=s[r],t.add_root(i);return t.set_title(this._title)},t.prototype._push_all_models_freeze=function(){return this._all_models_freeze_count+=1},t.prototype._pop_all_models_freeze=function(){if(this._all_models_freeze_count-=1,0===this._all_models_freeze_count)return this._recompute_all_models()},t.prototype._invalidate_all_models=function(){if(w.debug("invalidating document models"),0===this._all_models_freeze_count)return this._recompute_all_models()},t.prototype._recompute_all_models=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,m,g,y,b,x,w,M;for(c=new f,g=this._roots,r=0,o=g.length;r<o;r++)d=g[r],c=c.union(d.references());for(_=new f(v.values(this._all_models)),M=_.diff(c),w=c.diff(_),m={},y=c.values,n=0,i=y.length;n<i;n++)l=y[n],m[l.id]=l;for(b=M.values,u=0,s=b.length;u<s;u++)e=b[u],e.detach_document(),h=e.get("name"),null!==h&&this._all_models_by_name.remove_value(h,e);for(x=w.values,p=0,a=x.length;p<a;p++)t=x[p],t.attach_document(this),h=t.get("name"),null!==h&&this._all_models_by_name.add_value(h,t);return this._all_models=m},t.prototype.roots=function(){return this._roots},t.prototype._add_layoutable=function(t){var e,r,n,o,i,s,a,u,h,c,p;if(t.layoutable!==!0)throw new Error("Cannot add non-layoutable - "+t);for(o=t.get_edit_variables(),r=t.get_constraints(),p=t.get_constrained_variables(),i=0,a=o.length;i<a;i++)h=o[i],n=h.edit_variable,c=h.strength,this._solver.add_edit_variable(n,c);for(s=0,u=r.length;s<u;s++)e=r[s],this._solver.add_constraint(e);return null!=p.width&&this._solver.add_constraint(l(p.width,this._doc_width)),null!=p.height&&this._solver.add_constraint(l(p.height,this._doc_height)),this._solver.update_variables()},t.prototype.add_root=function(t){if(w.debug("Adding root: "+t),!(S.call(this._roots,t)>=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;r<n;r++)e=o[r],i.push(e(t));return i},t.prototype._notify_change=function(t,e,r,n){return"name"===e&&(this._all_models_by_name.remove_value(r,t),null!==n&&this._all_models_by_name.add_value(n,t)),this._trigger_on_change(new h(this,t,e,r,n))},t._references_json=function(t,e){var r,n,o,i,s;for(null==e&&(e=!0),s=[],r=0,n=t.length;r<n;r++)o=t[r],i=o.ref(),i.attributes=o.attributes_as_json(e),delete i.attributes.id,s.push(i);return s},t._instantiate_object=function(t,e,r){var n,o;return n=v.extend({},r,{id:t}),new(o=c(e))(n,{silent:!0,defer_initialization:!0})},t._instantiate_references_json=function(e,r){var n,o,i,s,a,l,u,h;for(h={},o=0,i=e.length;o<i;o++)s=e[o],l=s.id,u=s.type,a=s.attributes,l in r?n=r[l]:(n=t._instantiate_object(l,u,a),"subtype"in s&&n.set_subtype(s.subtype)),h[n.id]=n;return h},t._resolve_refs=function(t,e,r){var n,o,i;return i=function(t){if(b(t)){if(t.id in e)return e[t.id];if(t.id in r)return r[t.id];throw new Error("reference "+JSON.stringify(t)+" isn't known (not in Document?)")}return v.isArray(t)?n(t):v.isObject(t)?o(t):t},o=function(t){var e,r,n;r={};for(e in t)n=t[e],r[e]=i(n);return r},n=function(t){var e,r,n,o;for(n=[],e=0,r=t.length;e<r;e++)o=t[e],n.push(i(o));return n},i(t)},t._initialize_references_json=function(e,r,n){var o,i,s,a,l,h,c,p,_;for(p={},s=0,a=e.length;s<a;s++)l=e[s],c=l.id,h=l.attributes,_=!1,i=c in r?r[c]:(_=!0,n[c]),h=t._resolve_refs(h,r,n),p[i.id]=[i,h,_];return o=function(t,e){var r,n,o,i,s;r={},n=function(e,o){var i,s,a,l,h,c,p,d,f,m;if(e instanceof u){if(!(e.id in r)&&e.id in t){r[e.id]=!0,p=t[e.id],m=p[0],s=p[1],_=p[2];for(i in s)a=s[i],n(a,o);return o(e,s,_)}}else{if(v.isArray(e)){for(d=[],h=0,c=e.length;h<c;h++)a=e[h],d.push(n(a,o));return d}if(v.isObject(e)){f=[];for(l in e)a=e[l],f.push(n(a,o));return f}}},i=[];for(o in t)s=t[o],i.push(n(s[0],e));return i},o(p,function(t,e,r){if(r)return t.set(e)}),o(p,function(t,e,r){if(r)return t.initialize(e)})},t._event_for_attribute_change=function(t,e,r,n,o){var i,s;return i=n.get_model_by_id(t.id),i.attribute_is_serializable(e)?(s={kind:"ModelChanged",model:{id:t.id,type:t.type},attr:e,"new":r},u._json_record_references(n,r,o,!0),s):null},t._events_to_sync_objects=function(e,r,n,o){var i,s,a,l,u,h,c,p,_,d,f,m,g,y,b;for(a=Object.keys(e.attributes),b=Object.keys(r.attributes),g=v.difference(a,b),i=v.difference(b,a),y=v.intersection(a,b),s=[],l=0,c=g.length;l<c;l++)u=g[l],w.warn("Server sent key "+u+" but we don't seem to have it in our JSON");for(h=0,p=i.length;h<p;h++)u=i[h],f=r.attributes[u],s.push(t._event_for_attribute_change(e,u,f,n,o));for(d=0,_=y.length;d<_;d++)u=y[d],m=e.attributes[u],f=r.attributes[u],null===m&&null===f||(null===m||null===f?s.push(t._event_for_attribute_change(e,u,f,n,o)):v.isEqual(m,f)||s.push(t._event_for_attribute_change(e,u,f,n,o)));return v.filter(s,function(t){return null!==t})},t._compute_patch_since_json=function(e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,b,x,w,M,k,j;for(b=r.to_json(l=!1),y=function(t){var e,r,n,o,i;for(i={},o=t.roots.references,e=0,r=o.length;e<r;e++)n=o[e],i[n.id]=n;return i},o=y(e),s={},i=[],f=e.roots.root_ids,u=0,c=f.length;u<c;u++)d=f[u],s[d]=o[d],i.push(d);for(x=y(b),M={},w=[],m=b.roots.root_ids,h=0,p=m.length;h<p;h++)d=m[h],M[d]=x[d],w.push(d);if(i.sort(),w.sort(),v.difference(i,w).length>0||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;r++)o=i[r],s.push(o.id);return a=v.values(this._all_models),{title:this._title,roots:{root_ids:s,references:t._references_json(a,e)}}},t.from_json_string=function(e){var r;if(null===e||null==e)throw new Error("JSON string is "+typeof e);return r=JSON.parse(e),t.from_json(r)},t.from_json=function(e){var r,n,o,i,s,a,l,u,h,c;if(w.debug("Creating Document from JSON"),"object"!=typeof e)throw new Error("JSON object has wrong type "+typeof e);for(i=e.version,c="Library versions: JS ("+x+") / Python ("+i+")",i.indexOf("-")<0&&x!==i?(w.warn("JS/Python version mismatch"),w.warn(c)):w.debug(c),h=e.roots,u=h.root_ids,l=h.references,a=t._instantiate_references_json(l,{}),t._initialize_references_json(l,{},a),r=new t,n=0,o=u.length;n<o;n++)s=u[n],r.add_root(a[s]);return r.set_title(e.title),r},t.prototype.replace_with_json=function(e){var r;return r=t.from_json(e),r._destructively_move(this)},t.prototype.create_json_patch_string=function(t){return JSON.stringify(this.create_json_patch(t))},t.prototype.create_json_patch=function(e){var r,n,o,i,s,a;for(s={},o=[],n=0,i=e.length;n<i;n++){if(r=e[n],r.document!==this)throw console.log("Cannot create a patch using events from a different document, event had ",r.document," we are ",this),new Error("Cannot create a patch using events from a different document");o.push(r.json(s))}return a={events:o,references:t._references_json(v.values(s))}},t.prototype.apply_json_patch_string=function(t){return this.apply_json_patch(JSON.parse(t))},t.prototype.apply_json_patch=function(e){var r,n,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S;for(w=e.references,l=e.events,x=t._instantiate_references_json(w,this._all_models),h=0,p=l.length;h<p;h++)if(a=l[h],"model"in a)if(d=a.model.id,d in this._all_models)x[d]=this._all_models[d];else if(!(d in x))throw console.log("Got an event for unknown model ",a.model),new Error("event model wasn't known");g={},f={};for(u in x)S=x[u],u in this._all_models?g[u]=S:f[u]=S;for(t._initialize_references_json(w,g,f),M=[],c=0,_=l.length;c<_;c++)if(a=l[c],"ModelChanged"===a.kind){if(y=a.model.id,!(y in this._all_models))throw new Error("Cannot apply patch to "+y+" which is not in the document");v=this._all_models[y],r=a.attr,S=t._resolve_refs(a["new"],g,f),M.push(v.set((m={},m[""+r]=S,m)))}else if("ColumnsStreamed"===a.kind){if(i=a.column_source.id,!(i in this._all_models))throw new Error("Cannot stream to "+i+" which is not in the document");if(n=this._all_models[i],!(n instanceof o.Model))throw new Error("Cannot stream to non-ColumnDataSource");s=a.data,k=a.rollover,M.push(n.stream(s,k))}else if("ColumnsPatched"===a.kind){if(i=a.column_source.id,!(i in this._all_models))throw new Error("Cannot patch "+i+" which is not in the document");if(n=this._all_models[i],!(n instanceof o.Model))throw new Error("Cannot patch non-ColumnDataSource");b=a.patches,M.push(n.patch(b))}else if("RootAdded"===a.kind)j=a.model.id,T=x[j],M.push(this.add_root(T));else if("RootRemoved"===a.kind)j=a.model.id,T=x[j],M.push(this.remove_root(T));else{if("TitleChanged"!==a.kind)throw new Error("Unknown patch event "+JSON.stringify(a));M.push(this.set_title(a.title))}return M},t}(),e.exports={Document:s,DocumentChangedEvent:a,ModelChangedEvent:h,TitleChangedEvent:g,RootAddedEvent:_,RootRemovedEvent:d,DEFAULT_TITLE:i}},{"./base":"base","./core/has_props":"core/has_props","./core/layout/solver":"core/layout/solver","./core/logging":"core/logging","./core/util/data_structures":"core/util/data_structures","./core/util/refs":"core/util/refs","./models/sources/column_data_source":"models/sources/column_data_source","./version":"version",jquery:"jquery",underscore:"underscore"}],embed:[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,T,S,z,P,E,A,C,N;n=t("jquery"),c=t("underscore"),i=t("backbone"),a=t("es6-promise").Promise,k=t("./base"),E=t("./client").pull_session,A=t("./core/logging"),P=A.logger,N=A.set_log_level,C=t("./document"),s=C.Document,l=C.RootAddedEvent,u=C.RootRemovedEvent,h=C.TitleChangedEvent,o="bk-root",d=function(t){var e;if(P.debug("handling notebook comms"),e=JSON.parse(t.content.data),"events"in e&&"references"in e)return this.apply_json_patch(e);if("doc"in e)return this.replace_with_json(e.doc);throw new Error("handling notebook comms message: ",t)},y=function(t,e,r){if(t===r.target_name)return r.on_msg(c.bind(d,e))},f=function(t,e){var r,n,o,i,s,a,l;if("undefined"==typeof Jupyter||null===Jupyter||null==Jupyter.notebook.kernel)return console.warn("Jupyter notebooks comms not available. push_notebook() will not function");P.info("Registering Jupyter comms for target "+t),r=Jupyter.notebook.kernel.comm_manager,l=c.partial(y,t,e),a=r.comms;for(i in a)s=a[i],s.then(l);try{return r.register_target(t,function(r,n){return P.info("Registering Jupyter comms for target "+t),r.on_msg(c.bind(d,e))})}catch(o){return n=o,P.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+n+")")}},p=function(t){var e;return e=new t.default_view({model:t}),k.index[t.id]=e,e},m=function(t,e,r){
var o,i,s,a,c,_,d;d={},c=function(e){var r;return r=p(e),d[e.id]=r,n(t).append(r.$el)},_=function(e){var r;if(e.id in d)return r=d[e.id],n(t).remove(r.$el),delete d[e.id],delete k.index[e.id]},a=e.roots();for(o=0,i=a.length;o<i;o++)s=a[o],c(s);return r&&(window.document.title=e.title()),e.on_change(function(t){return t instanceof l?c(t.model):t instanceof u?_(t.model):r&&t instanceof h?window.document.title=t.title:void 0}),d},M=function(t,e,r){var o,i;if(o=r.get_model_by_id(e),null==o)throw new Error("Model "+e+" was not in document "+r);return i=p(o),c.delay(function(){return n(t).replaceWith(i.$el)})},x=function(t,e,r){return c.delay(function(){return m(n(t),e,r)})},b=function(t,e,r){return null==r&&(r=!1),m(n(e),t,r)},g={},_=function(t,e){var r;if(null==t||null===t)throw new Error("Missing websocket_url");return t in g||(g[t]={}),r=g[t],e in r||(r[e]=E(t,e)),r[e]},v=function(t,e,r,n){var o;return o=_(e,r),o.then(function(e){return m(t,e.document,n)},function(t){throw P.error("Failed to load Bokeh session "+r+": "+t),t})},w=function(t,e,r,o){var i;return i=_(e,o),i.then(function(e){var o,i;if(o=e.document.get_model_by_id(r),null==o)throw new Error("Did not find model "+r+" in session");return i=p(o),n(t).replaceWith(i.$el)},function(t){throw P.error("Failed to load Bokeh session "+o+": "+t),t})},S=function(t){var e;return e=n("<link href='"+t+"' rel='stylesheet' type='text/css'>"),n("body").append(e)},z=function(t){var e;return e=n("<style>").html(t),n("body").append(e)},T=function(t,e){var r;return r=t.data(),null!=r.bokehLogLevel&&r.bokehLogLevel.length>0&&N(r.bokehLogLevel),null!=r.bokehDocId&&r.bokehDocId.length>0&&(e.docid=r.bokehDocId),null!=r.bokehModelId&&r.bokehModelId.length>0&&(e.modelid=r.bokehModelId),null!=r.bokehSessionId&&r.bokehSessionId.length>0&&(e.sessionid=r.bokehSessionId),P.info("Will inject Bokeh script tag with params "+JSON.stringify(e))},j=function(t,e,r){var i,a,l,u,h,c,p,_,d,m,g;null==r&&(r=null),l={};for(a in t)l[a]=s.from_json(t[a]);for(m=[],c=0,_=e.length;c<_;c++){if(p=e[c],null!=p.notebook_comms_target&&f(p.notebook_comms_target,l[a]),h=p.elementid,u=n("#"+h),0===u.length)throw new Error("Error rendering Bokeh model: could not find tag with id: "+h);if(u.length>1)throw new Error("Error rendering Bokeh model: found too many tags with id: "+h);if(!document.body.contains(u[0]))throw new Error("Error rendering Bokeh model: element with id '"+h+"' must be under <body>");if("SCRIPT"===u.prop("tagName")&&(T(u,p),i=n("<div>",{"class":o}),u.replaceWith(i),u=i),g=null!=p.use_for_title&&p.use_for_title,d=null,null!=p.modelid)if(null!=p.docid)M(u,p.modelid,l[p.docid]);else{if(null==p.sessionid)throw new Error("Error rendering Bokeh model "+p.modelid+" to element "+h+": no document ID or session ID specified");d=w(u,r,p.modelid,p.sessionid)}else if(null!=p.docid)x(u,l[p.docid],g);else{if(null==p.sessionid)throw new Error("Error rendering Bokeh document to element "+h+": no document ID or session ID specified");d=v(u,r,p.sessionid,g)}null!==d?m.push(d.then(function(t){return console.log("Bokeh items were rendered successfully")},function(t){return console.log("Error rendering Bokeh items ",t)})):m.push(void 0)}return m},e.exports={embed_items:j,add_document_static:x,add_document_standalone:b,inject_css:S,inject_raw_css:z,BOKEH_ROOT:o}},{"./base":"base","./client":"client","./core/logging":"core/logging","./document":"document",backbone:"backbone","es6-promise":"es6-promise",jquery:"jquery",underscore:"underscore"}],main:[function(t,e,r){var n,o,i;o=t("underscore"),n={},n.require=t,n.version=t("./version"),n._=t("underscore"),n.$=t("jquery"),n.Backbone=t("backbone"),n.Backbone.$=n.$,i=t("./core/logging"),n.logger=i.logger,n.set_log_level=i.set_log_level,n.index=t("./base").index,n.embed=t("./embed"),n.safely=t("./safely"),n.Models=t("./base").Models,n.Bokeh=n,e.exports=n},{"./base":"base","./core/logging":"core/logging","./embed":"embed","./safely":"safely","./version":"version",backbone:"backbone",jquery:"jquery",underscore:"underscore"}],model:[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("./core/has_props"),s=t("./core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="Model",e.prototype._coords=[],e.coords=function(t){var e,r,n,o,i,a,l;for(e=this.prototype._coords.concat(t),this.prototype._coords=e,i={},r=0,n=t.length;r<n;r++)o=t[r],a=o[0],l=o[1],i[a]=[s.NumberSpec],i[l]=[s.NumberSpec];return this.define(i)},e.define({tags:[s.Array,[]],name:[s.String]}),e.prototype.select=function(t){if(t.prototype instanceof e)return this.references().filter(function(e){return e instanceof t});if(i.isString(t))return this.references().filter(function(e){return e.name===t});throw new Error("invalid selector")},e.prototype.select_one=function(t){var e;switch(e=this.select(t),e.length){case 0:return null;case 1:return e[0];default:throw new Error("found more than one object matching given selector")}},e}(n),e.exports=o},{"./core/has_props":"core/has_props","./core/properties":"core/properties",underscore:"underscore"}],"models/annotations/annotation":[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;a=t("underscore"),s=t("../../core/layout/side_panel"),l=t("../../core/properties"),i=t("../renderers/renderer"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._get_panel_offset=function(){var t,e;return t=this.model.panel._left._value,e=this.model.panel._bottom._value,{x:t,y:-e}},e.prototype._get_size=function(){return-1},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="Annotation",e.prototype.default_view=o,e.define({plot:[l.Instance]}),e.override({level:"annotation"}),e.prototype.add_panel=function(t){return this.panel=new s.Model({side:t}),this.panel.attach_document(this.document),this.level="overlay"},e}(i.Model),e.exports={Model:n,View:o}},{"../../core/layout/side_panel":"core/layout/side_panel","../../core/properties":"core/properties","../renderers/renderer":"models/renderers/renderer",underscore:"underscore"}],"models/annotations/arrow":[function(t,e,r){var n,o,i,s,a,l,u,h,c=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;l=t("underscore"),n=t("./annotation"),a=t("./arrow_head").OpenHead,s=t("../sources/column_data_source"),h=t("../../core/properties"),u=t("../../core/util/math").atan2,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),null==this.mget("source")&&this.mset("source",new s.Model),this.canvas=this.plot_model.get("canvas"),this.xmapper=this.plot_view.frame.get("x_mappers")[this.mget("x_range_name")],this.ymapper=this.plot_view.frame.get("y_mappers")[this.mget("y_range_name")],this.set_data()},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.plot_view.request_render),this.listenTo(this.mget("source"),"change",function(){return this.set_data(),this.plot_view.request_render()})},e.prototype.set_data=function(){return e.__super__.set_data.call(this,this.mget("source")),this.set_visuals(this.mget("source"))},e.prototype._map_data=function(){var t,e,r,n;return e="data"===this.mget("start_units")?this.plot_view.map_to_screen(this._x_start,this._y_start,r=this.mget("x_range_name"),n=this.mget("y_range_name")):[this.canvas.v_vx_to_sx(this._x_start),this.canvas.v_vy_to_sy(this._y_start)],t="data"===this.mget("end_units")?this.plot_view.map_to_screen(this._x_end,this._y_end,r=this.mget("x_range_name"),n=this.mget("y_range_name")):[this.canvas.v_vx_to_sx(this._x_end),this.canvas.v_vy_to_sy(this._y_end)],[e,t]},e.prototype.render=function(){var t;if(t=this._map_data(),this.start=t[0],this.end=t[1],this._draw_arrow_body(),null!=this.mget("end")&&this._draw_arrow_head(this.mget("end"),this.start,this.end),null!=this.mget("start"))return this._draw_arrow_head(this.mget("start"),this.end,this.start)},e.prototype._draw_arrow_body=function(){var t,e,r,n;for(t=this.plot_view.canvas_view.ctx,t.save(),e=r=0,n=this._x_start.length;0<=n?r<n:r>n;e=0<=n?++r:--r)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this.start[0][e],this.start[1][e]),t.lineTo(this.end[0][e],this.end[1][e]),this.visuals.line.doit&&t.stroke();return t.restore()},e.prototype._draw_arrow_head=function(t,e,r){var n,o,i,s,a,l;for(o=this.plot_view.canvas_view.ctx,l=[],i=s=0,a=this._x_start.length;0<=a?s<a:s>a;i=0<=a?++s:--s)n=Math.PI/2+u([e[0][i],e[1][i]],[r[0][i],r[1][i]]),o.save(),o.translate(r[0][i],r[1][i]),o.rotate(n),t.render(o,i),l.push(o.restore());return l},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.default_view=i,e.prototype.type="Arrow",e.mixins(["line"]),e.define({x_start:[h.NumberSpec],y_start:[h.NumberSpec],start_units:[h.String,"data"],start:[h.Instance,null],x_end:[h.NumberSpec],y_end:[h.NumberSpec],end_units:[h.String,"data"],end:[h.Instance,new a.Model({})],source:[h.Instance],x_range_name:[h.String,"default"],y_range_name:[h.String,"default"]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","../../core/util/math":"core/util/math","../sources/column_data_source":"models/sources/column_data_source","./annotation":"models/annotations/annotation","./arrow_head":"models/annotations/arrow_head",underscore:"underscore"}],"models/annotations/arrow_head":[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;n=t("./annotation"),a=t("../renderers/renderer"),u=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="ArrowHead",e.prototype.initialize=function(t){var r,n,o,i,s,l,u,h;for(e.__super__.initialize.call(this,t),this.visuals={},s=this.mixins,u=[],r=0,n=s.length;r<n;r++)h=s[r],l=h.split(":"),o=l[0],i=l[1],null==i&&(i=""),u.push(this.visuals[i+o]=new a.Visuals[o]({obj:this,prefix:i}));return u},e.prototype.render=function(t,e){return null},e}(n.Model),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="OpenHead",e.prototype.render=function(t,e){if(this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.get("size"),this.get("size")),t.lineTo(0,0),t.lineTo(-.5*this.get("size"),this.get("size")),t.stroke()},e.mixins(["line"]),e.define({size:[u.Number,25]}),e}(o),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="NormalHead",e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.get("size"),this.get("size")),t.lineTo(0,0),t.lineTo(-.5*this.get("size"),this.get("size")),t.closePath(),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.get("size"),this.get("size")),t.lineTo(0,0),t.lineTo(-.5*this.get("size"),this.get("size")),t.closePath(),t.stroke()},e.mixins(["line","fill"]),e.define({size:[u.Number,25]}),e.override({fill_color:"black"}),e}(o),l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="VeeHead",e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.get("size"),this.get("size")),t.lineTo(0,0),t.lineTo(-.5*this.get("size"),this.get("size")),t.lineTo(0,.5*this.get("size")),t.closePath(),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.get("size"),this.get("size")),t.lineTo(0,0),t.lineTo(-.5*this.get("size"),this.get("size")),t.lineTo(0,.5*this.get("size")),t.closePath(),t.stroke()},e.mixins(["line","fill"]),e.define({size:[u.Number,25]}),e.override({fill_color:"black"}),e}(o),e.exports={OpenHead:{Model:s},NormalHead:{Model:i},VeeHead:{Model:l}}},{"../../core/properties":"core/properties","../renderers/renderer":"models/renderers/renderer","./annotation":"models/annotations/annotation"}],"models/annotations/box_annotation":[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;s=t("underscore"),n=t("./annotation"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.$el.appendTo(this.plot_view.$el.find("div.bk-canvas-overlays")),this.$el.addClass("bk-shading"),this.$el.hide()},e.prototype.bind_bokeh_events=function(){return"css"===this.mget("render_mode")?(this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"data_update",this.render)):(this.listenTo(this.model,"change",this.plot_view.request_render),this.listenTo(this.model,"data_update",this.plot_view.request_render))},e.prototype.render=function(){var t,e,r,n;return null==this.mget("left")&&null==this.mget("right")&&null==this.mget("top")&&null==this.mget("bottom")?(this.$el.hide(),null):(this.frame=this.plot_model.get("frame"),this.canvas=this.plot_model.get("canvas"),this.xmapper=this.plot_view.frame.get("x_mappers")[this.mget("x_range_name")],this.ymapper=this.plot_view.frame.get("y_mappers")[this.mget("y_range_name")],e=this.canvas.vx_to_sx(this._calc_dim("left",this.xmapper,this.frame.get("h_range").get("start"))),r=this.canvas.vx_to_sx(this._calc_dim("right",this.xmapper,this.frame.get("h_range").get("end"))),t=this.canvas.vy_to_sy(this._calc_dim("bottom",this.ymapper,this.frame.get("v_range").get("start"))),n=this.canvas.vy_to_sy(this._calc_dim("top",this.ymapper,this.frame.get("v_range").get("end"))),"css"===this.mget("render_mode")?this._css_box(e,r,t,n):this._canvas_box(e,r,t,n))},e.prototype._css_box=function(t,e,r,n){var o,i,a,l,u,h,c,p;return p=Math.abs(e-t),h=Math.abs(r-n),u=this.mget("line_width").value,a=this.mget("line_color").value,i=this.mget("fill_color").value,o=this.mget("fill_alpha").value,c="left:"+t+"px; width:"+p+"px; top:"+n+"px; height:"+h+"px; border-width:"+u+"px; border-color:"+a+"; background-color:"+i+"; opacity:"+o+";",l=this.mget("line_dash"),s.isArray(l)&&(l=l.length<2?"solid":"dashed"),s.isString(l)&&(c+=" border-style:"+l+";"),this.$el.attr("style",c),this.$el.show()},e.prototype._canvas_box=function(t,e,r,n){var o;return o=this.plot_view.canvas_view.ctx,o.save(),o.beginPath(),o.rect(t,n,e-t,r-n),this.visuals.fill.set_value(o),o.fill(),this.visuals.line.set_value(o),o.stroke(),o.restore()},e.prototype._calc_dim=function(t,e,r){var n;return n=null!=this.mget(t)?"data"===this.mget(t+"_units")?e.map_to_target(this.mget(t)):this.mget(t):r},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="BoxAnnotation",e.mixins(["line","fill"]),e.define({render_mode:[a.RenderMode,"canvas"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],top:[a.Number,null],top_units:[a.SpatialUnits,"data"],bottom:[a.Number,null],bottom_units:[a.SpatialUnits,"data"],left:[a.Number,null],left_units:[a.SpatialUnits,"data"],right:[a.Number,null],right_units:[a.SpatialUnits,"data"]}),e.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3}),e.prototype.update=function(t){var e,r,n,o;return r=t.left,n=t.right,o=t.top,e=t.bottom,this.set({left:r,right:n,top:o,bottom:e},{silent:!0}),this.trigger("data_update")},e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./annotation":"models/annotations/annotation",underscore:"underscore"}],"models/annotations/color_bar":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y=function(t,e){function r(){this.constructor=t}for(var n in e)v.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},v={}.hasOwnProperty;f=t("underscore"),n=t("./annotation"),i=t("../tickers/basic_ticker"),o=t("../formatters/basic_tick_formatter"),h=t("../mappers/linear_color_mapper"),c=t("../mappers/linear_mapper"),p=t("../mappers/log_mapper"),_=t("../ranges/range1d"),m=t("../../core/properties"),g=t("../../core/util/text"),d=25,u=.3,l=.8,a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return y(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this._set_canvas_image()},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change:visible",this.plot_view.request_render),this.listenTo(this.model.ticker,"change",this.plot_view.request_render),this.listenTo(this.model.formatter,"change",this.plot_view.request_render),this.listenTo(this.model.color_mapper,"change",function(){return this._set_canvas_image(),this.plot_view.request_render()})},e.prototype._get_panel_offset=function(){var t,e;return t=this.model.panel._left._value,e=this.model.panel._top._value,{x:t,y:-e}},e.prototype._get_size=function(){var t,e;return t=this.compute_legend_dimensions(),e=this.model.panel.side,"above"===e||"below"===e?t.height:"left"===e||"right"===e?t.width:void 0},e.prototype._set_canvas_image=function(){var t,e,r,n,o,i,s,a,l,u,c,p,_;switch(a=this.model.color_mapper.palette,"vertical"===this.model.orientation&&(a=a.slice(0).reverse()),this.model.orientation){case"vertical":l=[1,a.length],_=l[0],o=l[1];break;case"horizontal":u=[a.length,1],_=u[0],o=u[1]}return r=document.createElement("canvas"),c=[_,o],r.width=c[0],r.height=c[1],i=r.getContext("2d"),s=i.getImageData(0,0,_,o),n=new h.Model({palette:a}),t=n.v_map_screen(function(){p=[];for(var t=0,e=a.length;0<=e?t<e:t>e;0<=e?t++:t--)p.push(t);return p}.apply(this)),e=new Uint8ClampedArray(t),s.data.set(e),i.putImageData(s,0,0),this.image=r},e.prototype.compute_legend_dimensions=function(){var t,e,r,n,o,i,s,a,l,u;switch(t=this.model._computed_image_dimensions(),a=[t.height,t.width],e=a[0],r=a[1],n=this._get_label_extent(),u=this.model._title_extent(),l=this.model._tick_extent(),s=this.model.padding,this.model.orientation){case"vertical":o=e+u+2*s,i=r+l+n+2*s;break;case"horizontal":o=e+u+l+n+2*s,i=r+2*s}return{height:o,width:i}},e.prototype.compute_legend_location=function(){var t,e,r,n,o,i,s,a,l,u,h,c;if(e=this.compute_legend_dimensions(),s=[e.height,e.width],r=s[0],o=s[1],n=this.model.margin,i=this.model.location,t=this.plot_view.frame.get("h_range"),u=this.plot_view.frame.get("v_range"),f.isString(i))switch(i){case"top_left":h=t.get("start")+n,c=u.get("end")-n;break;case"top_center":h=(t.get("end")+t.get("start"))/2-o/2,c=u.get("end")-n;break;case"top_right":h=t.get("end")-n-o,c=u.get("end")-n;break;case"right_center":h=t.get("end")-n-o,c=(u.get("end")+u.get("start"))/2+r/2;break;case"bottom_right":h=t.get("end")-n-o,c=u.get("start")+n+r;break;case"bottom_center":h=(t.get("end")+t.get("start"))/2-o/2,c=u.get("start")+n+r;break;case"bottom_left":h=t.get("start")+n,c=u.get("start")+n+r;break;case"left_center":h=t.get("start")+n,c=(u.get("end")+u.get("start"))/2+r/2;break;case"center":h=(t.get("end")+t.get("start"))/2-o/2,c=(u.get("end")+u.get("start"))/2+r/2}else f.isArray(i)&&2===i.length&&(h=i[0],c=i[1]);return a=this.plot_view.canvas.vx_to_sx(h),l=this.plot_view.canvas.vy_to_sy(c),{sx:a,sy:l}},e.prototype.render=function(){var t,e,r,n,o;if(this.model.visible!==!1)return t=this.plot_view.canvas_view.ctx,t.save(),null!=this.model.panel&&(o=this._get_panel_offset(),t.translate(o.x,o.y),e=this._get_frame_offset(),t.translate(e.x,e.y)),n=this.compute_legend_location(),t.translate(n.sx,n.sy),this._draw_bbox(t),r=this._get_image_offset(),t.translate(r.x,r.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high&&(this._draw_major_ticks(t),this._draw_minor_ticks(t),this._draw_major_labels(t)),this.model.title&&this._draw_title(t),t.restore()},e.prototype._draw_bbox=function(t){var e;return e=this.compute_legend_dimensions(),t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(0,0,e.width,e.height)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_image=function(t){var e;return e=this.model._computed_image_dimensions(),t.save(),t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.scale_alpha,t.drawImage(this.image,0,0,e.width,e.height),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_major_ticks=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f;if(this.visuals.major_tick_line.doit){for(s=this.model._normals(),o=s[0],i=s[1],r=this.model._computed_image_dimensions(),a=[r.width*o,r.height*i],d=a[0],f=a[1],l=this.model._tick_coordinates().major,h=l[0],c=l[1],p=this.model.major_tick_in,_=this.model.major_tick_out,t.save(),t.translate(d,f),this.visuals.major_tick_line.set_value(t),e=n=0,u=h.length;0<=u?n<u:n>u;e=0<=u?++n:--n)t.beginPath(),t.moveTo(Math.round(h[e]+o*_),Math.round(c[e]+i*_)),t.lineTo(Math.round(h[e]-o*p),Math.round(c[e]-i*p)),t.stroke();return t.restore()}},e.prototype._draw_minor_ticks=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f;if(this.visuals.minor_tick_line.doit){for(s=this.model._normals(),o=s[0],i=s[1],r=this.model._computed_image_dimensions(),a=[r.width*o,r.height*i],d=a[0],f=a[1],l=this.model._tick_coordinates().minor,h=l[0],c=l[1],p=this.model.minor_tick_in,_=this.model.minor_tick_out,t.save(),t.translate(d,f),this.visuals.minor_tick_line.set_value(t),e=n=0,u=h.length;0<=u?n<u:n>u;e=0<=u?++n:--n)t.beginPath(),t.moveTo(Math.round(h[e]+o*_),Math.round(c[e]+i*_)),t.lineTo(Math.round(h[e]-o*p),Math.round(c[e]-i*p)),t.stroke();return t.restore()}},e.prototype._draw_major_labels=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v;if(this.visuals.major_label_text.doit){for(l=this.model._normals(),s=l[0],a=l[1],n=this.model._computed_image_dimensions(),u=[n.width*s,n.height*a],m=u[0],y=u[1],_=this.model.label_standoff+this.model._tick_extent(),h=[_*s,_*a],g=h[0],v=h[1],c=this.model._tick_coordinates().major,d=c[0],f=c[1],i=this.model._tick_coordinates().major_labels,e=this.mget("formatter").doFormat(i),this.visuals.major_label_text.set_value(t),t.save(),t.translate(m+g,y+v),r=o=0,p=d.length;0<=p?o<p:o>p;r=0<=p?++o:--o)t.fillText(e[r],Math.round(d[r]+s*this.model.label_standoff),Math.round(f[r]+a*this.model.label_standoff));return t.restore()}},e.prototype._draw_title=function(t){if(this.visuals.title_text.doit)return t.save(),this.visuals.title_text.set_value(t),t.fillText(this.model.title,0,-this.model.title_standoff),t.restore()},e.prototype._get_label_extent=function(){var t,e,r,n;if(null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high){switch(t=this.plot_view.canvas_view.ctx,t.save(),this.visuals.major_label_text.set_value(t),this.model.orientation){case"vertical":e=this.model.formatter.doFormat(this.model._tick_coordinates().major_labels),n=f.max(function(){var n,o,i;for(i=[],n=0,o=e.length;n<o;n++)r=e[n],i.push(t.measureText(r.toString()).width);return i}());break;case"horizontal":n=g.get_text_height(this.visuals.major_label_text.font_value()).height}n+=this.model.label_standoff,t.restore()}else n=0;return n},e.prototype._get_frame_offset=function(){var t,e,r,n,o;switch(r=[0,0],n=r[0],o=r[1],e=this.model.panel,t=this.plot_view.frame,e.side){case"left":case"right":o=Math.abs(e.get("top")-t.get("top"));break;case"above":case"below":n=Math.abs(t.get("left"))}return{x:n,y:o}},e.prototype._get_image_offset=function(){var t,e;return t=this.model.padding,e=this.model.padding+this.model._title_extent(),{x:t,y:e}},e}(n.View),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return y(e,t),e.prototype.default_view=a,e.prototype.type="ColorBar",e.mixins(["text:major_label_","text:title_","line:major_tick_","line:minor_tick_","line:border_","line:bar_","fill:background_"]),e.define({location:[m.Any,"top_right"],orientation:[m.Orientation,"vertical"],title:[m.String],title_standoff:[m.Number,2],height:[m.Any,"auto"],width:[m.Any,"auto"],scale_alpha:[m.Number,1],ticker:[m.Instance,function(){return new i.Model}],formatter:[m.Instance,function(){return new o.Model}],color_mapper:[m.Instance],label_standoff:[m.Number,5],margin:[m.Number,30],padding:[m.Number,10],major_tick_in:[m.Number,5],major_tick_out:[m.Number,0],minor_tick_in:[m.Number,0],minor_tick_out:[m.Number,0]}),e.override({background_fill_color:"#ffffff",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_align:"center",major_label_text_baseline:"middle",major_label_text_font_size:"8pt",major_tick_line_color:"#ffffff",minor_tick_line_color:null,title_text_font_size:"10pt",title_text_font_style:"italic"}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r)},e.prototype._normals=function(){var t,e,r,n;return"vertical"===this.orientation?(r=[1,0],t=r[0],e=r[1]):(n=[0,1],t=n[0],e=n[1]),[t,e]},e.prototype._title_extent=function(){var t,e;return t=this.title_text_font+" "+this.title_text_font_size+" "+this.title_text_font_style,e=this.title?g.get_text_height(t).height+this.title_standoff:0},e.prototype._tick_extent=function(){var t;return t=null!=this.color_mapper.low&&null!=this.color_mapper.high?f.max([this.major_tick_out,this.minor_tick_out]):0},e.prototype._computed_image_dimensions=function(){var t,e,r,n,o;switch(t=this.plot.plot_canvas.frame.get("height"),e=this.plot.plot_canvas.frame.get("width"),n=this._title_extent(),this.orientation){case"vertical":"auto"===this.height?null!=this.panel?r=t-2*this.padding-n:(r=f.max([this.color_mapper.palette.length*d,t*u]),r=f.min([r,t*l-2*this.padding-n])):r=this.height,o="auto"===this.width?d:this.width;break;case"horizontal":r="auto"===this.height?d:this.height,"auto"===this.width?null!=this.panel?o=e-2*this.padding:(o=f.max([this.color_mapper.palette.length*d,e*u]),o=f.min([o,e*l-2*this.padding])):o=this.width}return{height:r,width:o}},e.prototype._tick_coordinate_mapper=function(t){var e,r;switch(r={source_range:new _.Model({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new _.Model({start:0,end:t})},this.color_mapper.type){case"LinearColorMapper":e=new c.Model(r);break;case"LogColorMapper":e=new p.Model(r)}return e},e.prototype._tick_coordinates=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b;switch(o=this._computed_image_dimensions(),this.orientation){case"vertical":y=o.height;break;case"horizontal":y=o.width}for(c=this._tick_coordinate_mapper(y),d=this._normals(),r=d[0],i=d[1],f=[this.color_mapper.low,this.color_mapper.high],v=f[0],e=f[1],b=this.ticker.get_ticks(v,e,null,this.ticker.desired_num_ticks),h=b.major,_=b.minor,l=[[],[]],p=[[],[]],n=s=0,m=h.length;0<=m?s<m:s>m;n=0<=m?++s:--s)h[n]<v||h[n]>e||(l[r].push(h[n]),l[i].push(0));for(n=a=0,g=_.length;0<=g?a<g:a>g;n=0<=g?++a:--a)_[n]<v||_[n]>e||(p[r].push(_[n]),p[i].push(0));return u=l[r].slice(0),l[r]=c.v_map_to_target(l[r]),p[r]=c.v_map_to_target(p[r]),"vertical"===this.orientation&&(l[r]=new Float64Array(function(){var e,n,o,i;for(o=l[r],i=[],n=0,e=o.length;n<e;n++)t=o[n],i.push(y-t);return i}()),p[r]=new Float64Array(function(){var e,n,o,i;for(o=p[r],i=[],n=0,e=o.length;n<e;n++)t=o[n],i.push(y-t);return i}())),{major:l,minor:p,major_labels:u}},e}(n.Model),e.exports={Model:s,View:a}},{"../../core/properties":"core/properties","../../core/util/text":"core/util/text","../formatters/basic_tick_formatter":"models/formatters/basic_tick_formatter","../mappers/linear_color_mapper":"models/mappers/linear_color_mapper","../mappers/linear_mapper":"models/mappers/linear_mapper","../mappers/log_mapper":"models/mappers/log_mapper","../ranges/range1d":"models/ranges/range1d","../tickers/basic_ticker":"models/tickers/basic_ticker","./annotation":"models/annotations/annotation",underscore:"underscore"}],"models/annotations/label":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("./text_annotation"),s=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.initialize=function(t){var r,n,o,i;e.__super__.initialize.call(this,t),this.canvas=this.plot_model.get("canvas"),this.xmapper=this.plot_view.frame.get("x_mappers")[this.mget("x_range_name")],this.ymapper=this.plot_view.frame.get("y_mappers")[this.mget("y_range_name")],o=this.visuals,i=[];for(r in o)n=o[r],i.push(n.warm_cache(null));return i},e.prototype._get_size=function(){var t,e,r,n;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),r=this.model.panel.side,"above"===r||"below"===r?e=t.measureText(this.mget("text")).ascent:"left"===r||"right"===r?n=t.measureText(this.mget("text")).width:void 0},e.prototype.render=function(){var t,e,r,n,o,i,s;switch(e=this.plot_view.canvas_view.ctx,this.mget("angle_units")){case"rad":t=-1*this.mget("angle");break;case"deg":t=-1*this.mget("angle")*Math.PI/180}return i="data"===this.mget("x_units")?this.xmapper.map_to_target(this.mget("x")):this.mget("x"),n=this.canvas.vx_to_sx(i),s="data"===this.mget("y_units")?this.ymapper.map_to_target(this.mget("y")):this.mget("y"),o=this.canvas.vy_to_sy(s),null!=this.model.panel&&(r=this._get_panel_offset(),n+=r.x,o+=r.y),"canvas"===this.mget("render_mode")?this._canvas_text(e,this.mget("text"),n+this.mget("x_offset"),o-this.mget("y_offset"),t):this._css_text(e,this.mget("text"),n+this.mget("x_offset"),o-this.mget("y_offset"),t)},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=o,e.prototype.type="Label",e.mixins(["text","line:border_","fill:background_"]),e.define({x:[s.Number],x_units:[s.SpatialUnits,"data"],y:[s.Number],y_units:[s.SpatialUnits,"data"],text:[s.String],angle:[s.Angle,0],angle_units:[s.AngleUnits,"rad"],x_offset:[s.Number,0],y_offset:[s.Number,0],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],render_mode:[s.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e}(i.Model),e.exports={Model:n,View:o}},{"../../core/properties":"core/properties","./text_annotation":"models/annotations/text_annotation"}],"models/annotations/label_set":[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;l=t("underscore"),n=t("jquery"),a=t("./text_annotation"),o=t("../sources/column_data_source"),u=t("../../core/properties"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.initialize=function(t){var r,o,i,s;if(e.__super__.initialize.call(this,t),this.xmapper=this.plot_view.frame.get("x_mappers")[this.model.x_range_name],this.ymapper=this.plot_view.frame.get("y_mappers")[this.model.y_range_name],this.set_data(),"css"===this.model.render_mode){for(s=[],r=o=0,i=this._text.length;0<=i?o<i:o>i;r=0<=i?++o:--o)this.title_div=n("<div>").addClass("bk-annotation-child").hide(),
s.push(this.title_div.appendTo(this.$el));return s}},e.prototype.bind_bokeh_events=function(){return"css"===this.model.render_mode?(this.listenTo(this.model,"change",function(){return this.set_data(),this.render()}),this.listenTo(this.model.source,"change",function(){return this.set_data(),this.render()})):(this.listenTo(this.model,"change",function(){return this.set_data(),this.plot_view.request_render()}),this.listenTo(this.model.source,"change",function(){return this.set_data(),this.plot_view.request_render()}))},e.prototype.set_data=function(){return e.__super__.set_data.call(this,this.model.source),this.set_visuals(this.model.source)},e.prototype._map_data=function(){var t,e,r,n;return r="data"===this.model.x_units?this.xmapper.v_map_to_target(this._x):this._x.slice(0),t=this.canvas.v_vx_to_sx(r),n="data"===this.model.y_units?this.ymapper.v_map_to_target(this._y):this._y.slice(0),e=this.canvas.v_vy_to_sy(n),[t,e]},e.prototype.render=function(){var t,e,r,n,o,i,s,a,l,u,h;if(t=this.plot_view.canvas_view.ctx,o=this._map_data(),u=o[0],h=o[1],"canvas"===this.model.render_mode){for(a=[],e=r=0,i=this._text.length;0<=i?r<i:r>i;e=0<=i?++r:--r)a.push(this._v_canvas_text(t,e,this._text[e],u[e]+this._x_offset[e],h[e]-this._y_offset[e],this._angle[e]));return a}for(l=[],e=n=0,s=this._text.length;0<=s?n<s:n>s;e=0<=s?++n:--n)l.push(this._v_css_text(t,e,this._text[e],u[e]+this._x_offset[e],h[e]-this._y_offset[e],this._angle[e]));return l},e.prototype._get_size=function(){var t,e,r,n;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),r=this.model.panel.side,"above"===r||"below"===r?e=t.measureText(this._text[0]).ascent:"left"===r||"right"===r?n=t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,r,n,o,i){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,r),t.save(),t.beginPath(),t.translate(n,o),t.rotate(i),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(r,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,r,n,o,i){var s,a,u,h;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,r),u=this.visuals.border_line.line_dash.value(),l.isArray(u)&&(h=u.length<2?"solid":"dashed"),l.isString(u)&&(h=u),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),a={position:"absolute",left:n+s[0]+"px",top:o+s[1]+"px",color:""+this.visuals.text.text_color.value(),opacity:""+this.visuals.text.text_alpha.value(),font:""+this.visuals.text.font_value(),"line-height":"normal"},i&&l.extend(a,{transform:"rotate("+i+"rad)"}),this.visuals.background_fill.doit&&l.extend(a,{"background-color":""+this.visuals.background_fill.color_value()}),this.visuals.border_line.doit&&l.extend(a,{"border-style":""+h,"border-width":""+this.visuals.border_line.line_width.value(),"border-color":""+this.visuals.border_line.color_value()}),this.$el.children().eq(e).html(r).css(a).show()},e}(a.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="Label",e.mixins(["text","line:border_","fill:background_"]),e.coords([["x","y"]]),e.define({x_units:[u.SpatialUnits,"data"],y_units:[u.SpatialUnits,"data"],text:[u.StringSpec,{field:"text"}],angle:[u.AngleSpec,0],x_offset:[u.NumberSpec,{value:0}],y_offset:[u.NumberSpec,{value:0}],source:[u.Instance,function(){return new o.Model}],x_range_name:[u.String,"default"],y_range_name:[u.String,"default"],render_mode:[u.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e}(a.Model),e.exports={Model:i,View:s}},{"../../core/properties":"core/properties","../sources/column_data_source":"models/sources/column_data_source","./text_annotation":"models/annotations/text_annotation",jquery:"jquery",underscore:"underscore"}],"models/annotations/legend":[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;s=t("underscore"),n=t("./annotation"),l=t("../../core/properties"),a=t("../../core/util/text").get_text_height,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t)},e.prototype.compute_legend_bbox=function(){var t,e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T;for(d=function(){var t,e,r,o,i;for(r=this.mget("legends"),i=[],t=0,e=r.length;t<e;t++)o=r[t],_=o[0],n=o[1],i.push(_);return i}.call(this),e=this.mget("glyph_height"),r=this.mget("glyph_width"),l=this.mget("label_height"),h=this.mget("label_width"),this.max_label_height=s.max([a(this.visuals.label_text.font_value()).height,l,e]),t=this.plot_view.canvas_view.ctx,t.save(),this.visuals.label_text.set_value(t),this.text_widths={},i=0,y=d.length;i<y;i++)x=d[i],this.text_widths[x]=s.max([t.measureText(x).width,h]);if(t.restore(),b=s.max(s.values(this.text_widths)),p=this.mget("legend_margin"),f=this.mget("legend_padding"),m=this.mget("legend_spacing"),u=this.mget("label_standoff"),"vertical"===this.mget("orientation"))c=d.length*this.max_label_height+(d.length-1)*m+2*f,g=b+r+u+2*f;else{g=2*f+(d.length-1)*m,w=this.text_widths;for(x in w)k=w[x],g+=s.max([k,h])+r+u;c=this.max_label_height+2*f}if(v=this.mget("location"),o=this.plot_view.frame.get("h_range"),M=this.plot_view.frame.get("v_range"),s.isString(v))switch(v){case"top_left":j=o.get("start")+p,T=M.get("end")-p;break;case"top_center":j=(o.get("end")+o.get("start"))/2-g/2,T=M.get("end")-p;break;case"top_right":j=o.get("end")-p-g,T=M.get("end")-p;break;case"right_center":j=o.get("end")-p-g,T=(M.get("end")+M.get("start"))/2+c/2;break;case"bottom_right":j=o.get("end")-p-g,T=M.get("start")+p+c;break;case"bottom_center":j=(o.get("end")+o.get("start"))/2-g/2,T=M.get("start")+p+c;break;case"bottom_left":j=o.get("start")+p,T=M.get("start")+p+c;break;case"left_center":j=o.get("start")+p,T=(M.get("end")+M.get("start"))/2+c/2;break;case"center":j=(o.get("end")+o.get("start"))/2-g/2,T=(M.get("end")+M.get("start"))/2+c/2}else s.isArray(v)&&2===v.length&&(j=v[0],T=v[1]);return j=this.plot_view.canvas.vx_to_sx(j),T=this.plot_view.canvas.vy_to_sy(T),{x:j,y:T,width:g,height:c}},e.prototype.render=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j;if(0!==this.model.legends.length){for(e=this.compute_legend_bbox(),n=this.mget("glyph_height"),o=this.mget("glyph_width"),d=this.mget("orientation"),r=this.plot_view.canvas_view.ctx,r.save(),null!=this.model.panel&&(f=this._get_panel_offset(),r.translate(f.x,f.y)),r.beginPath(),r.rect(e.x,e.y,e.width,e.height),this.visuals.background_fill.set_value(r),r.fill(),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(r),r.stroke()),t=this.mget("legends").length,c=this.mget("legend_spacing"),u=this.mget("label_standoff"),w=j=this.mget("legend_padding"),m=this.mget("legends"),a=s=0,p=m.length;s<p;a=++s)for(g=m[a],h=g[0],i=g[1],b=e.x+w,M=e.y+j,x=b+o,k=M+n,"vertical"===d?j+=this.max_label_height+c:w+=this.text_widths[h]+o+u+c,this.visuals.label_text.set_value(r),r.fillText(h,x+u,M+this.max_label_height/2),l=0,_=i.length;l<_;l++)y=i[l],v=this.plot_view.renderer_views[y.id],v.draw_legend(r,b,x,M,k);return r.restore()}},e.prototype._get_size=function(){var t,e;return t=this.compute_legend_bbox(),e=this.model.panel.side,"above"===e||"below"===e?t.height:"left"===e||"right"===e?t.width:void 0},e.prototype._get_panel_offset=function(){var t,e;return t=this.model.panel._left._value,e=this.model.panel._top._value,{x:t,y:-e}},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="Legend",e.mixins(["text:label_","line:border_","fill:background_"]),e.define({legends:[l.Array,[]],orientation:[l.Orientation,"vertical"],location:[l.Any,"top_right"],label_standoff:[l.Number,5],glyph_height:[l.Number,20],glyph_width:[l.Number,20],label_height:[l.Number,20],label_width:[l.Number,20],legend_margin:[l.Number,10],legend_padding:[l.Number,10],legend_spacing:[l.Number,3]}),e.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,label_text_font_size:"10pt",label_text_baseline:"middle"}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","../../core/util/text":"core/util/text","./annotation":"models/annotations/annotation",underscore:"underscore"}],"models/annotations/poly_annotation":[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;s=t("underscore"),n=t("./annotation"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.plot_view.request_render),this.listenTo(this.model,"data_update",this.plot_view.request_render)},e.prototype.render=function(t){var e,r,n,o,i,s,a,l,u,h;if(u=this.mget("xs"),h=this.mget("ys"),u.length!==h.length)return null;if(u.length<3||h.length<3)return null;for(e=this.plot_view.canvas,t=this.plot_view.canvas_view.ctx,r=n=0,o=u.length;0<=o?n<o:n>o;r=0<=o?++n:--n)"screen"===this.mget("xs_units")&&(a=u[r]),"screen"===this.mget("ys_units")&&(l=h[r]),i=e.vx_to_sx(a),s=e.vy_to_sy(l),0===r?(t.beginPath(),t.moveTo(i,s)):t.lineTo(i,s);return t.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),this.visuals.fill.doit?(this.visuals.fill.set_value(t),t.fill()):void 0},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="PolyAnnotation",e.mixins(["line","fill"]),e.define({xs:[a.Array,[]],xs_units:[a.SpatialUnits,"data"],ys:[a.Array,[]],ys_units:[a.SpatialUnits,"data"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),e.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3}),e.prototype.update=function(t){var e,r;return e=t.xs,r=t.ys,this.set({xs:e,ys:r},{silent:!0}),this.trigger("data_update")},e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./annotation":"models/annotations/annotation",underscore:"underscore"}],"models/annotations/span":[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;s=t("underscore"),n=t("./annotation"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.$el.appendTo(this.plot_view.$el.find("div.bk-canvas-overlays")),this.$el.css({position:"absolute"}),this.$el.hide()},e.prototype.bind_bokeh_events=function(){return this.mget("for_hover")?this.listenTo(this.model,"change:computed_location",this._draw_span):"canvas"===this.mget("render_mode")?this.listenTo(this.model,"change:location",this.plot_view.request_render):this.listenTo(this.model,"change:location",this._draw_span)},e.prototype.render=function(){return this._draw_span()},e.prototype._draw_span=function(){var t,e,r,n,o,i,s,a,l,u;return o=this.mget("for_hover")?this.mget("computed_location"):this.mget("location"),null==o?void this.$el.hide():(r=this.plot_model.get("frame"),t=this.plot_model.get("canvas"),l=this.plot_view.frame.get("x_mappers")[this.mget("x_range_name")],u=this.plot_view.frame.get("y_mappers")[this.mget("y_range_name")],"width"===this.mget("dimension")?(s=t.vy_to_sy(this._calc_dim(o,u)),i=t.vx_to_sx(r.get("left")),a=r.get("width"),n=this.model.properties.line_width.value()):(s=t.vy_to_sy(r.get("top")),i=t.vx_to_sx(this._calc_dim(o,l)),a=this.model.properties.line_width.value(),n=r.get("height")),"css"===this.mget("render_mode")?(this.$el.css({top:s,left:i,width:a+"px",height:n+"px","z-index":1e3,"background-color":this.model.properties.line_color.value(),opacity:this.model.properties.line_alpha.value()}),this.$el.show()):"canvas"===this.mget("render_mode")?(e=this.plot_view.canvas_view.ctx,e.save(),e.beginPath(),this.visuals.line.set_value(e),e.moveTo(i,s),"width"===this.mget("dimension")?e.lineTo(i+a,s):e.lineTo(i,s+n),e.stroke(),e.restore()):void 0)},e.prototype._calc_dim=function(t,e){var r;return r="data"===this.mget("location_units")?e.map_to_target(t):t},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Span",e.mixins(["line"]),e.define({render_mode:[a.RenderMode,"canvas"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],location:[a.Number,null],location_units:[a.SpatialUnits,"data"],dimension:[a.Dimension,"width"]}),e.override({line_color:"black"}),e.internal({for_hover:[a.Boolean,!1],computed_location:[a.Number,null]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./annotation":"models/annotations/annotation",underscore:"underscore"}],"models/annotations/text_annotation":[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;s=t("underscore"),n=t("./annotation"),l=t("../../core/properties"),a=t("../../core/util/text").get_text_height,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),this.canvas=this.plot_model.get("canvas"),this.frame=this.plot_model.get("frame"),"css"===this.mget("render_mode"))return this.$el.addClass("bk-annotation"),this.$el.appendTo(this.plot_view.$el.find("div.bk-canvas-overlays"))},e.prototype.bind_bokeh_events=function(){return"css"===this.mget("render_mode")?this.listenTo(this.model,"change",this.render):this.listenTo(this.model,"change",this.plot_view.request_render)},e.prototype._calculate_text_dimensions=function(t,e){var r,n;return n=t.measureText(e).width,r=a(this.visuals.text.font_value()).height,[n,r]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var r,n,o,i,s;switch(n=this._calculate_text_dimensions(t,e),o=n[0],r=n[1],t.textAlign){case"left":i=0;break;case"center":i=-o/2;break;case"right":i=-o}switch(t.textBaseline){case"top":s=0;break;case"middle":s=-.5*r;break;case"bottom":s=-1*r;break;case"alphabetic":s=-.8*r;break;case"hanging":s=-.17*r;break;case"ideographic":s=-.83*r}return[i,s,o,r]},e.prototype._get_size=function(){var t;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(this.mget("text")).ascent},e.prototype.render=function(){return null},e.prototype._canvas_text=function(t,e,r,n,o){var i;return this.visuals.text.set_value(t),i=this._calculate_bounding_box_dimensions(t,e),t.save(),t.beginPath(),t.translate(r,n),o&&t.rotate(o),t.rect(i[0],i[1],i[2],i[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_value(t),t.fillText(e,0,0)),t.restore()},e.prototype._css_text=function(t,e,r,n,o){var i,a,l,u;return this.$el.hide(),this.visuals.text.set_value(t),i=this._calculate_bounding_box_dimensions(t,e),l=this.visuals.border_line.line_dash.value(),s.isArray(l)&&(u=l.length<2?"solid":"dashed"),s.isString(l)&&(u=l),this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),a={position:"absolute",left:r+i[0]+"px",top:n+i[1]+"px",color:""+this.visuals.text.text_color.value(),opacity:""+this.visuals.text.text_alpha.value(),font:""+this.visuals.text.font_value(),"line-height":"normal"},o&&s.extend(a,{transform:"rotate("+o+"rad)"}),this.visuals.background_fill.doit&&s.extend(a,{"background-color":""+this.visuals.background_fill.color_value()}),this.visuals.border_line.doit&&s.extend(a,{"border-style":""+u,"border-width":""+this.visuals.border_line.line_width.value(),"border-color":""+this.visuals.border_line.color_value()}),this.$el.html(e).css(a).show()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="TextAnnotation",e.prototype.default_view=i,e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","../../core/util/text":"core/util/text","./annotation":"models/annotations/annotation",underscore:"underscore"}],"models/annotations/title":[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;n=t("./text_annotation"),a=t("../../core/properties"),s=t("../renderers/renderer").Visuals,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this.visuals.text=new s.text({obj:this.model,prefix:""}),r=this.plot_view.canvas_view.ctx,r.save(),this.model.panel.apply_label_text_heuristics(r,"justified"),this.model.text_baseline=r.textBaseline,this.model.text_align=this.model.align,r.restore()},e.prototype._get_computed_location=function(){var t,e,r,n,o,i,s;switch(e=this._calculate_text_dimensions(this.plot_view.canvas_view.ctx,this.text),s=e[0],t=e[1],this.model.panel.side){case"left":o=0,i=this._get_text_location(this.mget("align"),this.frame.get("v_range"))+this.mget("offset");break;case"right":o=this.canvas.get("right")-1,i=this.canvas.get("height")-this._get_text_location(this.mget("align"),this.frame.get("v_range"))-this.mget("offset");break;case"above":o=this._get_text_location(this.mget("align"),this.frame.get("h_range"))+this.mget("offset"),i=this.canvas.get("top")-10;break;case"below":o=this._get_text_location(this.mget("align"),this.frame.get("h_range"))+this.mget("offset"),i=0}return r=this.canvas.vx_to_sx(o),n=this.canvas.vy_to_sy(i),[r,n]},e.prototype._get_text_location=function(t,e){var r;switch(t){case"left":r=e.get("start");break;case"center":r=(e.get("end")+e.get("start"))/2;break;case"right":r=e.get("end")}return r},e.prototype.render=function(){var t,e,r,n,o;if(t=this.model.panel.get_label_angle_heuristic("parallel"),r=this._get_computed_location(),n=r[0],o=r[1],e=this.plot_view.canvas_view.ctx,""!==this.model.text&&null!==this.model.text)return"canvas"===this.model.render_mode?this._canvas_text(e,this.model.text,n,o,t):this._css_text(e,this.model.text,n,o,t)},e.prototype._get_size=function(){var t,e;return e=this.model.text,""===e||null===e?0:(t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(e).ascent+10)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Title",e.mixins(["line:border_","fill:background_"]),e.define({text:[a.String],text_font:[a.Font,"helvetica"],text_font_size:[a.FontSizeSpec,"10pt"],text_font_style:[a.FontStyle,"bold"],text_color:[a.ColorSpec,"#444444"],text_alpha:[a.NumberSpec,1],align:[a.TextAlign,"left"],offset:[a.Number,0],render_mode:[a.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e.internal({text_align:[a.TextAlign,"left"],text_baseline:[a.TextBaseline,"bottom"]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","../renderers/renderer":"models/renderers/renderer","./text_annotation":"models/annotations/text_annotation"}],"models/annotations/tooltip":[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;n=t("jquery"),a=t("underscore"),o=t("./annotation"),l=t("../../core/logging").logger,u=t("../../core/properties"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.className="bk-tooltip",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.$el.appendTo(this.plot_view.$el.find("div.bk-canvas-overlays")),this.$el.css({"z-index":1010}),this.$el.hide()},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change:data",this._draw_tips)},e.prototype.render=function(){return this._draw_tips()},e.prototype._draw_tips=function(){var t,e,r,o,i,s,l,u,h,c,p,_,d,f,m,g,y,v;if(i=this.model.data,this.$el.empty(),this.$el.hide(),this.$el.toggleClass("bk-tooltip-custom",this.mget("custom")),!a.isEmpty(i)){for(l=0,h=i.length;l<h;l++)m=i[l],g=m[0],y=m[1],o=m[2],this.mget("inner_only")&&!this.plot_view.frame.contains(g,y)||(d=n("<div />").appendTo(this.$el),d.append(o));switch(p=this.plot_view.mget("canvas").vx_to_sx(g),_=this.plot_view.mget("canvas").vy_to_sy(y),e=this.model.attachment){case"horizontal":v=this.plot_view.frame.get("width"),u=this.plot_view.frame.get("left"),c=g-u<v/2?"right":"left";break;case"vertical":s=this.plot_view.frame.get("height"),r=this.plot_view.frame.get("bottom"),c=y-r<s/2?"below":"above";break;default:c=e}switch(this.$el.removeClass("bk-right bk-left bk-above bk-below"),t=10,c){case"right":this.$el.addClass("bk-left"),u=p+(this.$el.outerWidth()-this.$el.innerWidth())+t,f=_-this.$el.outerHeight()/2;break;case"left":this.$el.addClass("bk-right"),u=p-this.$el.outerWidth()-t,f=_-this.$el.outerHeight()/2;break;case"above":this.$el.addClass("bk-above"),f=_+(this.$el.outerHeight()-this.$el.innerHeight())+t,u=Math.round(p-this.$el.outerWidth()/2);break;case"below":this.$el.addClass("bk-below"),f=_-this.$el.outerHeight()-t,u=Math.round(p-this.$el.outerWidth()/2)}return this.model.show_arrow&&this.$el.addClass("bk-tooltip-arrow"),this.$el.children().length>0?(this.$el.css({top:f,left:u}),this.$el.show()):void 0}},e}(o.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="Tooltip",e.define({attachment:[u.String,"horizontal"],inner_only:[u.Bool,!0],show_arrow:[u.Bool,!0]}),e.override({level:"overlay"}),e.internal({data:[u.Any,[]],custom:[u.Any]}),e.prototype.clear=function(){return this.data=[]},e.prototype.add=function(t,e,r){var n;return n=this.data,n.push([t,e,r]),this.data=n,this.trigger("change:data")},e}(o.Model),e.exports={Model:i,View:s}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./annotation":"models/annotations/annotation",jquery:"jquery",underscore:"underscore"}],"models/axes/axis":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;u=t("underscore"),l=t("../../core/layout/side_panel"),s=t("../renderers/guide_renderer"),a=t("../renderers/renderer"),i=t("../../core/layout/solver").GE,h=t("../../core/logging").logger,c=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this._x_range_name=this.mget("x_range_name"),this._y_range_name=this.mget("y_range_name")},e.prototype.render=function(){var t;if(this.model.visible!==!1)return t=this.plot_view.canvas_view.ctx,t.save(),this._draw_rule(t),this._draw_major_ticks(t),this._draw_minor_ticks(t),this._draw_major_labels(t),this._draw_axis_label(t),t.restore()},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.plot_view.request_render)},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype._draw_rule=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m;if(this.visuals.axis_line.doit){for(s=e=this.mget("rule_coords"),_=s[0],f=s[1],a=this.plot_view.map_to_screen(_,f,this._x_range_name,this._y_range_name),c=a[0],p=a[1],l=this.mget("normals"),o=l[0],i=l[1],u=this.mget("offsets"),d=u[0],m=u[1],this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(c[0]+o*d),Math.round(p[0]+i*m)),r=n=1,h=c.length;1<=h?n<h:n>h;r=1<=h?++n:--n)t.lineTo(Math.round(c[r]+o*d),Math.round(p[r]+i*m));return t.stroke()}},e.prototype._draw_major_ticks=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v;if(this.visuals.major_tick_line.doit){for(e=this.mget("tick_coords"),s=e.major,m=s[0],y=s[1],a=this.plot_view.map_to_screen(m,y,this._x_range_name,this._y_range_name),p=a[0],_=a[1],l=this.mget("normals"),o=l[0],i=l[1],u=this.mget("offsets"),g=u[0],v=u[1],d=this.mget("major_tick_in"),f=this.mget("major_tick_out"),this.visuals.major_tick_line.set_value(t),c=[],r=n=0,h=p.length;0<=h?n<h:n>h;r=0<=h?++n:--n)t.beginPath(),t.moveTo(Math.round(p[r]+o*f+o*g),Math.round(_[r]+i*f+i*v)),t.lineTo(Math.round(p[r]-o*d+o*g),Math.round(_[r]-i*d+i*v)),c.push(t.stroke());return c}},e.prototype._draw_minor_ticks=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v;if(this.visuals.minor_tick_line.doit){for(e=this.mget("tick_coords"),s=e.minor,m=s[0],y=s[1],a=this.plot_view.map_to_screen(m,y,this._x_range_name,this._y_range_name),p=a[0],_=a[1],l=this.mget("normals"),o=l[0],i=l[1],u=this.mget("offsets"),g=u[0],v=u[1],d=this.mget("minor_tick_in"),f=this.mget("minor_tick_out"),this.visuals.minor_tick_line.set_value(t),c=[],r=n=0,h=p.length;0<=h?n<h:n>h;r=0<=h?++n:--n)t.beginPath(),t.moveTo(Math.round(p[r]+o*f+o*g),Math.round(_[r]+i*f+i*v)),t.lineTo(Math.round(p[r]-o*d+o*g),Math.round(_[r]-i*d+i*v)),c.push(t.stroke());return c}},e.prototype._draw_major_labels=function(t){var e,r,n,o,i,s,a,l,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k;for(r=this.mget("tick_coords"),c=r.major,x=c[0],M=c[1],p=this.plot_view.map_to_screen(x,M,this._x_range_name,this._y_range_name),v=p[0],b=p[1],_=this.mget("normals"),a=_[0],l=_[1],d=this.mget("offsets"),w=d[0],k=d[1],n=this.mget("dimension"),g=this.mget("panel_side"),h=this.mget("major_label_orientation"),e=u.isString(h)?this.model.panel.get_label_angle_heuristic(h):-h,y=this._tick_extent()+this.mget("major_label_standoff"),s=this.mget("formatter").doFormat(r.major[n]),this.visuals.major_label_text.set_value(t),this.model.panel.apply_label_text_heuristics(t,h),m=[],o=i=0,f=v.length;0<=f?i<f:i>f;o=0<=f?++i:--i)e?(t.translate(v[o]+a*y+a*w,b[o]+l*y+l*k),t.rotate(e),t.fillText(s[o],0,0),t.rotate(-e),m.push(t.translate(-v[o]-a*y+a*w,-b[o]-l*y+l*k))):m.push(t.fillText(s[o],Math.round(v[o]+a*y+a*w),Math.round(b[o]+l*y+l*k)));return m},e.prototype._draw_axis_label=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g;if(r=this.mget("axis_label"),null!=r&&(s=this.mget("rule_coords"),d=s[0],m=s[1],a=this.plot_view.map_to_screen(d,m,this._x_range_name,this._y_range_name),p=a[0],_=a[1],l=this.mget("normals"),n=l[0],o=l[1],u=this.mget("offsets"),f=u[0],g=u[1],h=this.mget("panel_side"),i="parallel",e=this.model.panel.get_label_angle_heuristic(i),c=this._tick_extent()+this._tick_label_extent()+this.mget("axis_label_standoff"),p=(p[0]+p[p.length-1])/2,_=(_[0]+_[_.length-1])/2,this.visuals.axis_label_text.set_value(t),this.model.panel.apply_label_text_heuristics(t,i),d=p+n*c+n*f,m=_+o*c+o*g,!isNaN(d)&&!isNaN(m)))return e?(t.translate(d,m),t.rotate(e),t.fillText(r,0,0),t.rotate(-e),t.translate(-d,-m)):t.fillText(r,d,m)},e.prototype._tick_extent=function(){return this.mget("major_tick_out")},e.prototype._tick_label_extent=function(){var t,e,r,n,o,i,s,a,l,h,c,p,_,d,f,m,g,y,v;for(i=0,n=this.plot_view.canvas_view.ctx,o=this.mget("dimension"),r=this.mget("tick_coords").major,m=this.mget("panel_side"),_=this.mget("major_label_orientation"),p=this.mget("formatter").doFormat(r[o]),this.visuals.major_label_text.set_value(n),u.isString(_)?(l=1,t=this.model.panel.get_label_angle_heuristic(_)):(l=2,t=-_),t=Math.abs(t),e=Math.cos(t),f=Math.sin(t),"above"===m||"below"===m?(v=f,a=e):(v=e,a=f),h=c=0,d=p.length;0<=d?c<d:c>d;h=0<=d?++c:--c)null!=p[h]&&(y=1.1*n.measureText(p[h]).width,s=.9*n.measureText(p[h]).ascent,g=y*v+s/l*a,g>i&&(i=g));return i>0&&(i+=this.mget("major_label_standoff")),i},e.prototype._axis_label_extent=function(){var t,e,r,n,o,i,s,a,l,u;return o=0,l=this.mget("panel_side"),e=this.mget("axis_label"),s="parallel",n=this.plot_view.canvas_view.ctx,this.visuals.axis_label_text.set_value(n),t=Math.abs(this.model.panel.get_label_angle_heuristic(s)),r=Math.cos(t),a=Math.sin(t),e&&(o+=this.mget("axis_label_standoff"),this.visuals.axis_label_text.set_value(n),u=1.1*n.measureText(e).width,i=.9*n.measureText(e).ascent,o+="above"===l||"below"===l?u*a+i*r:u*r+i*a),o},e}(a.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.default_view=o,e.prototype.type="Axis",e.mixins(["line:axis_","line:major_tick_","line:minor_tick_","text:major_label_","text:axis_label_"]),e.define({bounds:[c.Any,"auto"],ticker:[c.Instance,null],formatter:[c.Instance,null],x_range_name:[c.String,"default"],y_range_name:[c.String,"default"],axis_label:[c.String,""],axis_label_standoff:[c.Int,5],major_label_standoff:[c.Int,5],major_label_orientation:[c.Any,"horizontal"],major_tick_in:[c.Number,2],major_tick_out:[c.Number,6],minor_tick_in:[c.Number,0],minor_tick_out:[c.Number,4]}),e.override({axis_line_color:"black",major_tick_line_color:"black",minor_tick_line_color:"black",major_label_text_font_size:"8pt",major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label_text_font_size:"10pt",axis_label_text_font_style:"italic"}),e.internal({panel_side:[c.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("computed_bounds",this._computed_bounds,!1),this.add_dependencies("computed_bounds",this,["bounds"]),this.add_dependencies("computed_bounds",this.get("plot"),["x_range","y_range"]),this.define_computed_property("rule_coords",this._rule_coords,!1),this.add_dependencies("rule_coords",this,["computed_bounds","side"]),this.define_computed_property("tick_coords",this._tick_coords,!1),this.add_dependencies("tick_coords",this,["computed_bounds","panel_side"]),this.define_computed_property("ranges",this._ranges,!0),this.define_computed_property("normals",function(){return this.panel._normals},!0),this.define_computed_property("dimension",function(){return this.panel._dim},!0),this.define_computed_property("offsets",this._offsets,!0)},e.prototype.add_panel=function(t){return this.panel=new l.Model({side:t}),this.panel.attach_document(this.document),this.set("panel_side",t)},e.prototype._offsets=function(){var t,e,r,n,o;return r=this.get("panel_side"),e=[0,0],n=e[0],o=e[1],t=this.plot.plot_canvas.get("frame"),"below"===r?o=Math.abs(this.panel.get("top")-t.get("bottom")):"above"===r?o=Math.abs(this.panel.get("bottom")-t.get("top")):"right"===r?n=Math.abs(this.panel.get("left")-t.get("right")):"left"===r&&(n=Math.abs(this.panel.get("right")-t.get("left"))),[n,o]},e.prototype._ranges=function(){var t,e,r,n;return e=this.get("dimension"),r=(e+1)%2,t=this.plot.plot_canvas.get("frame"),n=[t.get("x_ranges")[this.get("x_range_name")],t.get("y_ranges")[this.get("y_range_name")]],[n[e],n[r]]},e.prototype._computed_bounds=function(){var t,e,r,n,o,i,s,a;return o=this.get("ranges"),r=o[0],t=o[1],a=null!=(i=this.get("bounds"))?i:"auto",n=[r.get("min"),r.get("max")],"auto"===a?n:u.isArray(a)?(Math.abs(a[0]-a[1])>Math.abs(n[0]-n[1])?(s=Math.max(Math.min(a[0],a[1]),n[0]),e=Math.min(Math.max(a[0],a[1]),n[1])):(s=Math.min(a[0],a[1]),
e=Math.max(a[0],a[1])),[s,e]):(h.error("user bounds '"+a+"' not understood"),null)},e.prototype._rule_coords=function(){var t,e,r,n,o,i,s,a,l,u,h,c;return n=this.get("dimension"),o=(n+1)%2,a=this.get("ranges"),s=a[0],e=a[1],l=this.get("computed_bounds"),u=l[0],r=l[1],h=new Array(2),c=new Array(2),t=[h,c],i=this._get_loc(e),t[n][0]=Math.max(u,s.get("min")),t[n][1]=Math.min(r,s.get("max")),t[n][0]>t[n][1]&&(t[n][0]=t[n][1]=NaN),t[o][0]=i,t[o][1]=i,t},e.prototype._tick_coords=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S;if(n=this.get("dimension"),i=(n+1)%2,y=this.get("ranges"),f=y[0],e=y[1],v=this.get("computed_bounds"),k=v[0],r=v[1],j=this.get("ticker").get_ticks(k,r,f,{}),h=j.major,d=j.minor,l=this._get_loc(e),T=[],S=[],t=[T,S],p=[],_=[],c=[p,_],"FactorRange"===f.type)for(o=s=0,b=h.length;0<=b?s<b:s>b;o=0<=b?++s:--s)t[n].push(h[o]),t[i].push(l);else{for(x=[f.get("min"),f.get("max")],g=x[0],m=x[1],o=a=0,w=h.length;0<=w?a<w:a>w;o=0<=w?++a:--a)h[o]<g||h[o]>m||(t[n].push(h[o]),t[i].push(l));for(o=u=0,M=d.length;0<=M?u<M:u>M;o=0<=M?++u:--u)d[o]<g||d[o]>m||(c[n].push(d[o]),c[i].push(l))}return{major:t,minor:c}},e.prototype._get_loc=function(t){var e,r,n,o;return r=t.get("start"),e=t.get("end"),o=this.get("panel_side"),"left"===o||"below"===o?n="start":"right"!==o&&"above"!==o||(n="end"),t.get(n)},e}(s.Model),e.exports={Model:n,View:o}},{"../../core/layout/side_panel":"core/layout/side_panel","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../renderers/guide_renderer":"models/renderers/guide_renderer","../renderers/renderer":"models/renderers/renderer",underscore:"underscore"}],"models/axes/categorical_axis":[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;l=t("underscore"),n=t("./axis"),s=t("../formatters/categorical_tick_formatter"),a=t("../tickers/categorical_ticker"),u=t("../../core/logging").logger,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="CategoricalAxis",e.override({ticker:function(){return new a.Model},formatter:function(){return new s.Model}}),e.prototype._computed_bounds=function(){var t,e,r,n,o,i;return n=this.get("ranges"),e=n[0],t=n[1],i=null!=(o=this.get("bounds"))?o:"auto",r=[e.get("min"),e.get("max")],"auto"!==i&&u.warn("Categorical Axes only support user_bounds='auto', ignoring"),r},e}(n.Model),e.exports={Model:o,View:i}},{"../../core/logging":"core/logging","../formatters/categorical_tick_formatter":"models/formatters/categorical_tick_formatter","../tickers/categorical_ticker":"models/tickers/categorical_ticker","./axis":"models/axes/axis",underscore:"underscore"}],"models/axes/continuous_axis":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=t("./axis"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="ContinuousAxis",e}(n.Model),e.exports={Model:o}},{"./axis":"models/axes/axis"}],"models/axes/datetime_axis":[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;l=t("underscore"),a=t("./axis"),i=t("../formatters/datetime_tick_formatter"),s=t("../tickers/datetime_ticker"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e}(a.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="DatetimeAxis",e.override({ticker:function(){return new s.Model},formatter:function(){return new i.Model}}),e}(a.Model),e.exports={Model:n,View:o}},{"../formatters/datetime_tick_formatter":"models/formatters/datetime_tick_formatter","../tickers/datetime_ticker":"models/tickers/datetime_ticker","./axis":"models/axes/axis",underscore:"underscore"}],"models/axes/linear_axis":[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;u=t("underscore"),n=t("./axis"),s=t("./continuous_axis"),o=t("../formatters/basic_tick_formatter"),i=t("../tickers/basic_ticker"),l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(n.View),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=l,e.prototype.type="LinearAxis",e.override({ticker:function(){return new i.Model},formatter:function(){return new o.Model}}),e}(s.Model),e.exports={Model:a,View:l}},{"../formatters/basic_tick_formatter":"models/formatters/basic_tick_formatter","../tickers/basic_ticker":"models/tickers/basic_ticker","./axis":"models/axes/axis","./continuous_axis":"models/axes/continuous_axis",underscore:"underscore"}],"models/axes/log_axis":[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;u=t("underscore"),n=t("./axis"),o=t("./continuous_axis"),a=t("../formatters/log_tick_formatter"),l=t("../tickers/log_ticker"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(n.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="LogAxis",e.override({ticker:function(){return new l.Model},formatter:function(){return new a.Model}}),e}(o.Model),e.exports={Model:i,View:s}},{"../formatters/log_tick_formatter":"models/formatters/log_tick_formatter","../tickers/log_ticker":"models/tickers/log_ticker","./axis":"models/axes/axis","./continuous_axis":"models/axes/continuous_axis",underscore:"underscore"}],"models/callbacks/customjs":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty,u=[].slice;i=t("underscore"),s=t("../../core/properties"),o=t("../../model"),n=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return a(r,e),r.prototype.type="CustomJS",r.define({args:[s.Any,{}],code:[s.String,""],lang:[s.String,"javascript"]}),r.prototype.initialize=function(t,e){return r.__super__.initialize.call(this,t,e),this.define_computed_property("values",this._make_values,!0),this.add_dependencies("values",this,["args"]),this.define_computed_property("func",this._make_func,!0),this.add_dependencies("func",this,["args","code"])},r.prototype.execute=function(e,r){return this.get("func").apply(null,u.call(this.get("values")).concat([e],[r],[t]))},r.prototype._make_values=function(){return i.values(this.get("args"))},r.prototype._make_func=function(){var e,r;return e=this.get("code"),e=function(){switch(this.get("lang")){case"javascript":return e;case"coffeescript":return r=t("coffee-script"),r.compile(e,{bare:!0,shiftLine:!0})}}.call(this),function(t,e,r){r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return Object(o)===o?o:n}(Function,u.call(i.keys(this.get("args"))).concat(["cb_obj"],["cb_data"],["require"],[e]),function(){})},r}(o),e.exports={Model:n}},{"../../core/properties":"core/properties","../../model":"model","coffee-script":void 0,underscore:"underscore"}],"models/callbacks/open_url":[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;s=t("underscore"),a=t("../../core/properties"),n=t("../../model"),i=t("../../util/util"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="OpenURL",e.define({url:[a.String,"http://"]}),e.prototype.execute=function(t){var e,r,n,o,s;for(o=i.get_indices(t),r=0,n=o.length;r<n;r++)e=o[r],s=i.replace_placeholders(this.get("url"),t,e),window.open(s);return null},e}(n),e.exports={Model:o}},{"../../core/properties":"core/properties","../../model":"model","../../util/util":"util/util",underscore:"underscore"}],"models/canvas/canvas":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x=function(t,e){function r(){this.constructor=t}for(var n in e)w.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},w={}.hasOwnProperty;u=t("underscore"),h=t("./canvas_template"),l=t("../../core/layout/layout_canvas"),n=t("../../core/bokeh_view"),v=t("../../core/layout/solver"),a=v.GE,s=v.EQ,g=t("../../core/logging").logger,y=t("../../core/properties"),b=t("../../core/util/canvas"),p=b.fixup_image_smoothing,_=b.fixup_line_dash,d=b.fixup_line_dash_offset,f=b.fixup_measure_text,m=b.get_scale_ratio,c=b.fixup_ellipse,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.className="bk-canvas-wrapper",e.prototype.template=h,e.prototype.initialize=function(t){var r,n;return e.__super__.initialize.call(this,t),r=this.template({map:this.mget("map")}),this.$el.html(r),this.ctx=this.get_ctx(),this.ctx.glcanvas=null,_(this.ctx),d(this.ctx),p(this.ctx),f(this.ctx),c(this.ctx),this.map_div=null!=(n=this.$("div.bk-canvas-map"))?n:null,this.set_dims([this.model.initial_width,this.model.initial_height]),g.debug("CanvasView initialized")},e.prototype.get_canvas_element=function(){return this.$("canvas.bk-canvas")[0]},e.prototype.get_ctx=function(){var t,e;return t=this.$("canvas.bk-canvas"),e=t[0].getContext("2d")},e.prototype.prepare_canvas=function(t){var e,r,n,o,i;if(null==t&&(t=!1),i=this.model._width._value,n=this.model._height._value,r=window.devicePixelRatio,!u.isEqual(this.last_dims,[i,n,r])||t)return this.$el.css({width:i,height:n}),this.pixel_ratio=o=m(this.ctx,this.mget("use_hidpi")),e=this.$(".bk-canvas"),e.css({width:i,height:n}),e.attr("width",i*o),e.attr("height",n*o),g.debug("Rendering CanvasView [force="+t+"] with width: "+i+", height: "+n+", ratio: "+o),this.model.pixel_ratio=this.pixel_ratio,this.last_dims=[i,n,r]},e.prototype.set_dims=function(t,e){null==e&&(e=!0),this.requested_width=t[0],this.requested_height=t[1],this.update_constraints(e)},e.prototype.update_constraints=function(t){var e,r,n,o;if(null==t&&(t=!0),n=this.requested_width,r=this.requested_height,null!=n&&null!=r&&(e=50,!(n<e||r<e||u.isEqual(this.last_requested_dims,[n,r]))))return o=this.model.document.solver(),null!=this._width_constraint&&o.remove_constraint(this._width_constraint),this._width_constraint=s(this.model._width,-n),o.add_constraint(this._width_constraint),null!=this._height_constraint&&o.remove_constraint(this._height_constraint),this._height_constraint=s(this.model._height,-r),o.add_constraint(this._height_constraint),this.last_requested_dims=[n,r],o.update_variables(t)},e}(n),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.type="Canvas",e.prototype.default_view=i,e.internal({map:[y.Boolean,!1],initial_width:[y.Number],initial_height:[y.Number],use_hidpi:[y.Boolean,!0],pixel_ratio:[y.Number]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.panel=this},e.prototype.vx_to_sx=function(t){return t},e.prototype.vy_to_sy=function(t){return this._height._value-(t+1)},e.prototype.v_vx_to_sx=function(t){return new Float64Array(t)},e.prototype.v_vy_to_sy=function(t){var e,r,n,o,i,s;for(e=new Float64Array(t.length),r=this._height._value,o=n=0,i=t.length;n<i;o=++n)s=t[o],e[o]=r-(s+1);return e},e.prototype.sx_to_vx=function(t){return t},e.prototype.sy_to_vy=function(t){return this._height._value-(t+1)},e.prototype.v_sx_to_vx=function(t){return new Float64Array(t)},e.prototype.v_sy_to_vy=function(t){var e,r,n,o,i,s;for(e=new Float64Array(t.length),r=this._height._value,o=n=0,i=t.length;n<i;o=++n)s=t[o],e[o]=r-(s+1);return e},e.prototype.get_constraints=function(){var t;return t=e.__super__.get_constraints.call(this),t.push(a(this._top)),t.push(a(this._bottom)),t.push(a(this._left)),t.push(a(this._right)),t.push(a(this._width)),t.push(a(this._height)),t.push(s(this._width,[-1,this._right])),t.push(s(this._height,[-1,this._top])),t},e}(l.Model),e.exports={Model:o,View:i}},{"../../core/bokeh_view":"core/bokeh_view","../../core/layout/layout_canvas":"core/layout/layout_canvas","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../../core/util/canvas":"core/util/canvas","./canvas_template":"models/canvas/canvas_template",underscore:"underscore"}],"models/canvas/canvas_template":[function(t,e,r){e.exports=function(t){t||(t={});var e=[];return function(){(function(){this.map&&e.push('\n<div class="bk-canvas-map"></div>\n'),e.push('\n<div class="bk-canvas-events" />\n<div class="bk-canvas-overlays" />\n<canvas class=\'bk-canvas\'></canvas>')}).call(this)}.call(t),e.join("")}},{}],"models/canvas/cartesian_frame":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m=function(t,e){function r(){this.constructor=t}for(var n in e)g.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},g={}.hasOwnProperty;p=t("underscore"),o=t("../mappers/categorical_mapper"),a=t("../mappers/grid_mapper"),u=t("../mappers/linear_mapper"),h=t("../mappers/log_mapper"),c=t("../ranges/range1d"),f=t("../../core/layout/solver"),i=f.EQ,s=f.GE,l=t("../../core/layout/layout_canvas"),_=t("../../core/logging").logging,d=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return m(e,t),e.prototype.type="CartesianFrame",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.panel=this,this.define_computed_property("x_ranges",function(){return this._get_ranges("x")},!0),this.add_dependencies("x_ranges",this,["x_range","extra_x_ranges"]),this.define_computed_property("y_ranges",function(){return this._get_ranges("y")},!0),this.add_dependencies("y_ranges",this,["y_range","extra_y_ranges"]),this.define_computed_property("x_mappers",function(){return this._get_mappers("x",this.get("x_ranges"),this.get("h_range"))},!0),this.add_dependencies("x_ranges",this,["x_ranges","h_range"]),this.define_computed_property("y_mappers",function(){return this._get_mappers("y",this.get("y_ranges"),this.get("v_range"))},!0),this.add_dependencies("y_ranges",this,["y_ranges","v_range"]),this.define_computed_property("mapper",function(){return new a.Model({domain_mapper:this.get("x_mapper"),codomain_mapper:this.get("y_mapper")})},!0),this.add_dependencies("mapper",this,["x_mapper","y_mapper"]),this._h_range=new c.Model({start:this.get("left"),end:this.get("left")+this.get("width")}),this.define_computed_property("h_range",function(t){return function(){return t._h_range.set("start",t.get("left")),t._h_range.set("end",t.get("left")+t.get("width")),t._h_range}}(this),!1),this.add_dependencies("h_range",this,["left","width"]),this._v_range=new c.Model({start:this.get("bottom"),end:this.get("bottom")+this.get("height")}),this.define_computed_property("v_range",function(t){return function(){return t._v_range.set("start",t.get("bottom")),t._v_range.set("end",t.get("bottom")+t.get("height")),t._v_range}}(this),!1),this.add_dependencies("v_range",this,["bottom","height"]),null},e.prototype._doc_attached=function(){return this.listenTo(this.document.solver(),"layout_update",this._update_mappers),null},e.prototype.contains=function(t,e){return t>=this.get("left")&&t<=this.get("right")&&e>=this.get("bottom")&&e<=this.get("top")},e.prototype.map_to_screen=function(t,e,r,n,o){var i,s,a,l;return null==n&&(n="default"),null==o&&(o="default"),a=this.get("x_mappers")[n].v_map_to_target(t),i=r.v_vx_to_sx(a),l=this.get("y_mappers")[o].v_map_to_target(e),s=r.v_vy_to_sy(l),[i,s]},e.prototype._get_ranges=function(t){var e,r,n,o;if(o={},o["default"]=this.get(t+"_range"),e=this.get("extra_"+t+"_ranges"),null!=e)for(r in e)n=e[r],o[r]=n;return o},e.prototype._get_mappers=function(t,e,r){var n,i,s,a;i={};for(s in e){if(a=e[s],"Range1d"===a.type||"DataRange1d"===a.type)n="log"===this.get(t+"_mapper_type")?h.Model:u.Model;else{if("FactorRange"!==a.type)return logger.warn("unknown range type for range '"+s+"': "+a),null;n=o.Model}i[s]=new n({source_range:a,target_range:r})}return i},e.prototype._update_mappers=function(){var t,e,r,n;r=this.get("x_mappers");for(e in r)t=r[e],t.set("target_range",this.get("h_range"));n=this.get("y_mappers");for(e in n)t=n[e],t.set("target_range",this.get("v_range"));return null},e.internal({extra_x_ranges:[d.Any,{}],extra_y_ranges:[d.Any,{}],x_range:[d.Instance],y_range:[d.Instance],x_mapper_type:[d.Any],y_mapper_type:[d.Any]}),e.prototype.get_constraints=function(){var t;return t=[],t.push(s(this._top)),t.push(s(this._bottom)),t.push(s(this._left)),t.push(s(this._right)),t.push(s(this._width)),t.push(s(this._height)),t.push(i(this._left,this._width,[-1,this._right])),t.push(i(this._bottom,this._height,[-1,this._top])),t},e}(l.Model),e.exports={Model:n}},{"../../core/layout/layout_canvas":"core/layout/layout_canvas","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../mappers/categorical_mapper":"models/mappers/categorical_mapper","../mappers/grid_mapper":"models/mappers/grid_mapper","../mappers/linear_mapper":"models/mappers/linear_mapper","../mappers/log_mapper":"models/mappers/log_mapper","../ranges/range1d":"models/ranges/range1d",underscore:"underscore"}],"models/formatters/basic_tick_formatter":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./tick_formatter"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="BasicTickFormatter",e.define({precision:[s.Any,"auto"],use_scientific:[s.Bool,!0],power_limit_high:[s.Number,5],power_limit_low:[s.Number,-3]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("scientific_limit_low",function(){return Math.pow(10,this.get("power_limit_low"))},!0),this.add_dependencies("scientific_limit_low",this,["power_limit_low"]),this.define_computed_property("scientific_limit_high",function(){return Math.pow(10,this.get("power_limit_high"))},!0),this.add_dependencies("scientific_limit_high",this,["power_limit_high"]),this.last_precision=3},e.prototype.doFormat=function(t){var e,r,n,o,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w;if(0===t.length)return[];if(w=0,t.length>=2&&(w=Math.abs(t[1]-t[0])/1e4),c=!1,this.get("use_scientific"))for(n=0,l=t.length;n<l;n++)if(v=t[n],b=Math.abs(v),b>w&&(b>=this.get("scientific_limit_high")||b<=this.get("scientific_limit_low"))){c=!0;break}if(_=this.get("precision"),null==_||i.isNumber(_)){if(a=new Array(t.length),c)for(e=o=0,d=t.length;0<=d?o<d:o>d;e=0<=d?++o:--o)a[e]=t[e].toExponential(_||void 0);else for(e=s=0,f=t.length;0<=f?s<f:s>f;e=0<=f?++s:--s)a[e]=t[e].toFixed(_||void 0).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");return a}if("auto"===_)for(a=new Array(t.length),x=u=m=this.last_precision;m<=15?u<=15:u>=15;x=m<=15?++u:--u){if(r=!0,c){for(e=h=0,g=t.length;0<=g?h<g:h>g;e=0<=g?++h:--h)if(a[e]=t[e].toExponential(x),e>0&&a[e]===a[e-1]){r=!1;break}if(r)break}else{for(e=p=0,y=t.length;0<=y?p<y:p>y;e=0<=y?++p:--p)if(a[e]=t[e].toFixed(x).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),e>0&&a[e]===a[e-1]){r=!1;break}if(r)break}if(r)return this.last_precision=x,a}return a},e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./tick_formatter":"models/formatters/tick_formatter",underscore:"underscore"}],"models/formatters/categorical_tick_formatter":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;o=t("../formatters/tick_formatter"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="CategoricalTickFormatter",e.prototype.doFormat=function(t){return t},e}(o.Model),e.exports={Model:n}},{"../formatters/tick_formatter":"models/formatters/tick_formatter"}],"models/formatters/datetime_tick_formatter":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d=function(t,e){function r(){this.constructor=t}for(var n in e)f.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},f={}.hasOwnProperty;a=t("underscore"),i=t("sprintf"),_=t("timezone"),s=t("./tick_formatter"),c=t("../../core/logging").logger,p=t("../../core/properties"),h=function(t){return Math.round(t/1e3%1*1e6)},l=function(t){return _(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})},u=function(t,e){var r;return a.isFunction(e)?e(t):(r=i.sprintf("$1%06d",h(t)),e=e.replace(/((^|[^%])(%%)*)%f/,r),e.indexOf("%")===-1?e:_(t,e))},n={microseconds:["%fus"],milliseconds:["%3Nms","%S.%3Ns"],seconds:["%Ss"],minsec:[":%M:%S"],minutes:[":%M","%Mm"],hourmin:["%H:%M"],hours:["%Hh","%H:%M"],days:["%m/%d","%a%d"],months:["%m/%Y","%b%y"],years:["%Y"]},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return d(e,t),e.prototype.type="DatetimeTickFormatter",e.define({formats:[p.Any,n]}),e.prototype.format_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],e.prototype.strip_leading_zeros=!0,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._update_width_formats()},e.prototype._update_width_formats=function(){var t,e,r,n,o,i,s,l;n=_(new Date),this._width_formats={},o=this.formats,i=[];for(t in o)r=o[t],s=function(){var t,o,i;for(i=[],t=0,o=r.length;t<o;t++)e=r[t],i.push(u(n,e).length);return i}(),l=a.sortBy(a.zip(s,r),function(t){var e,r;return r=t[0],e=t[1],r}),i.push(this._width_formats[t]=a.zip.apply(a,l));return i},e.prototype._get_resolution_str=function(t,e){var r,n;return r=1.1*t,n=r<.001?"microseconds":r<1?"milliseconds":r<60?e>=60?"minsec":"seconds":r<3600?e>=3600?"hourmin":"minutes":r<86400?"hours":r<2678400?"days":r<31536e3?"months":"years"},e.prototype.doFormat=function(t,e,r,n,o){var i,s,h,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I;if(null==e&&(e=null),null==r&&(r=null),null==n&&(n=.3),null==o&&(o=null),0===t.length)return[];if(C=Math.abs(t[t.length-1]-t[0])/1e3,j=o?o.resolution:C/(t.length-1),P=this._get_resolution_str(j,C),T=this._width_formats[P],I=T[0],_=T[1],p=_[0],r){for(d=[],m=g=0,S=I.length;0<=S?g<S:g>S;m=0<=S?++g:--g)I[m]*t.length<n*r&&d.push(this._width_formats[m]);d.length>0&&(p=a.last(d))}for(b=[],E=this.format_order.indexOf(P),q={},z=this.format_order,y=0,x=z.length;y<x;y++)h=z[y],q[h]=0;for(q.seconds=5,q.minsec=4,q.minutes=4,q.hourmin=3,q.hours=3,v=0,w=t.length;v<w;v++){O=t[v];try{D=l(O),A=u(O,p)}catch(s){i=s,c.warn("unable to format tick for timestamp value "+O),c.warn(" - "+i),b.push("ERR");continue}for(f=!1,k=E;0===D[q[this.format_order[k]]]&&(k+=1,k!==this.format_order.length);){if(("minsec"===P||"hourmin"===P)&&!f){if("minsec"===P&&0===D[4]&&0!==D[5]||"hourmin"===P&&0===D[3]&&0!==D[4]){M=this._width_formats[this.format_order[E-1]][1][0],A=u(O,M);break}f=!0}M=this._width_formats[this.format_order[k]][1][0],A=u(O,M)}this.strip_leading_zeros?(N=A.replace(/^0+/g,""),N!==A&&isNaN(parseInt(N))&&(N="0"+N),b.push(N)):b.push(A)}return b},e}(s.Model),e.exports={Model:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./tick_formatter":"models/formatters/tick_formatter",sprintf:"sprintf",timezone:"timezone/index",underscore:"underscore"}],"models/formatters/func_tick_formatter":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),s=t("../../core/properties"),o=t("../formatters/tick_formatter"),n=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return a(r,e),r.prototype.type="FuncTickFormatter",r.define({code:[s.String,""],lang:[s.String,"javascript"]}),r.prototype.doFormat=function(e){var r,n,o;return r=this.get("code"),r=function(){switch(this.get("lang")){case"javascript":return r;case"coffeescript":return n=t("coffee-script"),n.compile(r,{bare:!0,shiftLine:!0})}}.call(this),o=new Function("tick","var func = "+r+"return func(tick)"),i.map(e,o)},r}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","../formatters/tick_formatter":"models/formatters/tick_formatter","coffee-script":void 0,underscore:"underscore"}],"models/formatters/log_tick_formatter":[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;s=t("underscore"),n=t("./basic_tick_formatter"),i=t("./tick_formatter"),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="LogTickFormatter",e.define({ticker:[l.Instance,null]}),e.prototype.initialize=function(t,r){if(e.__super__.initialize.call(this,t,r),this.basic_formatter=new n.Model,null==this.get("ticker"))return a.warn("LogTickFormatter not configured with a ticker, using default base of 10 (labels will be incorrect if ticker base is not 10)")},e.prototype.doFormat=function(t){var e,r,n,o,i,s;if(0===t.length)return[];for(e=null!=this.get("ticker")?this.get("ticker").get("base"):10,s=!1,o=new Array(t.length),r=n=0,i=t.length;0<=i?n<i:n>i;r=0<=i?++n:--n)if(o[r]=e+"^"+Math.round(Math.log(t[r])/Math.log(e)),r>0&&o[r]===o[r-1]){s=!0;break}return s&&(o=this.basic_formatter.doFormat(t)),o},e}(i.Model),e.exports={Model:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./basic_tick_formatter":"models/formatters/basic_tick_formatter","./tick_formatter":"models/formatters/tick_formatter",underscore:"underscore"}],"models/formatters/numeral_tick_formatter":[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;s=t("underscore"),n=t("numbro"),i=t("./tick_formatter"),a=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="NumeralTickFormatter",e.define({format:[a.String,"0,0"],language:[a.String,"en"],rounding:[a.String,"round"]}),e.prototype.doFormat=function(t){var e,r,o,i,s;return e=this.get("format"),o=this.get("language"),i=function(){switch(this.get("rounding")){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}.call(this),r=function(){var r,a,l;for(l=[],r=0,a=t.length;r<a;r++)s=t[r],l.push(n.format(s,e,o,i));return l}()},e}(i.Model),e.exports={Model:o}},{"../../core/properties":"core/properties","./tick_formatter":"models/formatters/tick_formatter",numbro:"numbro/numbro",underscore:"underscore"}],"models/formatters/printf_tick_formatter":[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;s=t("underscore"),o=t("sprintf"),i=t("./tick_formatter"),a=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="PrintfTickFormatter",e.define({format:[a.String,"%s"]}),e.prototype.doFormat=function(t){var e,r,n;return e=this.get("format"),r=function(){var r,i,s;for(s=[],r=0,i=t.length;r<i;r++)n=t[r],s.push(o.sprintf(e,n));return s}()},e}(i.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./tick_formatter":"models/formatters/tick_formatter",sprintf:"sprintf",underscore:"underscore"}],"models/formatters/tick_formatter":[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("../../model"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="TickFormatter",e.prototype.doFormat=function(t){},e}(n),e.exports={Model:o}},{"../../model":"model",underscore:"underscore"}],"models/glyphs/annular_wedge":[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"),i=t("./glyph"),l=t("../../common/hittest"),u=t("../../core/properties"),a=t("../../core/util/math").angle_between,o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){var t,e,r,n;for("data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xmapper,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,"data"===this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xmapper,this._x,this._outer_radius):this.souter_radius=this._outer_radius,this._angle=new Float32Array(this._start_angle.length),n=[],t=e=0,r=this._start_angle.length;0<=r?e<r:e>r;t=0<=r?++e:--e)n.push(this._angle[t]=this._end_angle[t]-this._start_angle[t]);return n},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_;for(p=r.sx,_=r.sy,o=r._start_angle,n=r._angle,h=r.sinner_radius,c=r.souter_radius,i=this.model.properties.direction.value(),u=[],a=0,l=e.length;a<l;a++)s=e[a],isNaN(p[s]+_[s]+h[s]+c[s]+o[s]+n[s])||(t.translate(p[s],_[s]),t.rotate(o[s]),t.moveTo(c[s],0),t.beginPath(),t.arc(0,0,c[s],0,n[s],i),t.rotate(n[s]),t.lineTo(h[s],0),t.arc(0,0,h[s],0,-n[s],!i),t.closePath(),t.rotate(-n[s]-o[s]),t.translate(-p[s],-_[s]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,s),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,s),u.push(t.stroke())):u.push(void 0));return u},e.prototype._hit_point=function(t){var e,r,n,o,i,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F,B,L;for(y=[t.vx,t.vy],E=y[0],N=y[1],D=this.renderer.xmapper.map_from_target(E,!0),F=this.renderer.ymapper.map_from_target(N,!0),"data"===this.model.properties.outer_radius.units?(I=D-this.max_outer_radius,R=D+this.max_outer_radius,B=F-this.max_outer_radius,L=F+this.max_outer_radius):(A=E-this.max_outer_radius,C=E+this.max_outer_radius,v=this.renderer.xmapper.v_map_from_target([A,C],!0),I=v[0],R=v[1],O=N-this.max_outer_radius,q=N+this.max_outer_radius,b=this.renderer.ymapper.v_map_from_target([O,q],!0),B=b[0],L=b[1]),n=[],r=l.validate_bbox_coords([I,R],[B,L]),x=function(){var t,e,n,o;for(n=this.index.search(r),o=[],t=0,e=n.length;t<e;t++)g=n[t],o.push(g.i);return o}.call(this),p=0,d=x.length;p<d;p++)h=x[p],
m=Math.pow(this.souter_radius[h],2),c=Math.pow(this.sinner_radius[h],2),j=this.renderer.xmapper.map_to_target(D,!0),T=this.renderer.xmapper.map_to_target(this._x[h],!0),z=this.renderer.ymapper.map_to_target(F,!0),P=this.renderer.ymapper.map_to_target(this._y[h],!0),i=Math.pow(j-T,2)+Math.pow(z-P,2),i<=m&&i>=c&&n.push([h,i]);for(o=this.model.properties.direction.value(),u=[],_=0,f=n.length;_<f;_++)w=n[_],h=w[0],i=w[1],k=this.renderer.plot_view.canvas.vx_to_sx(E),S=this.renderer.plot_view.canvas.vy_to_sy(N),e=Math.atan2(S-this.sy[h],k-this.sx[h]),a(-e,-this._start_angle[h],-this._end_angle[h],o)&&u.push([h,i]);return M=l.create_hit_test_result(),M["1d"].indices=s.chain(u).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),M},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e.prototype._scxy=function(t){var e,r;return r=(this.sinner_radius[t]+this.souter_radius[t])/2,e=(this._start_angle[t]+this._end_angle[t])/2,{x:this.sx[t]+r*Math.cos(e),y:this.sy[t]+r*Math.sin(e)}},e.prototype.scx=function(t){return this._scxy(t).x},e.prototype.scy=function(t){return this._scxy(t).y},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=o,e.prototype.type="AnnularWedge",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({direction:[u.Direction,"anticlock"],inner_radius:[u.DistanceSpec],outer_radius:[u.DistanceSpec],start_angle:[u.AngleSpec],end_angle:[u.AngleSpec]}),e}(i.Model),e.exports={Model:n,View:o}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../../core/util/math":"core/util/math","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/annulus":[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;s=t("underscore"),i=t("./glyph"),a=t("../../common/hittest"),l=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xmapper,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,"data"===this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xmapper,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f;for(d=r.sx,f=r.sy,p=r.sinner_radius,_=r.souter_radius,c=[],s=0,l=e.length;s<l;s++)if(o=e[s],!isNaN(d[o]+f[o]+p[o]+_[o])){if(i=navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0,this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,o),t.beginPath(),i)for(h=[!1,!0],a=0,u=h.length;a<u;a++)n=h[a],t.arc(d[o],f[o],p[o],0,Math.PI,n),t.arc(d[o],f[o],_[o],Math.PI,0,!n);else t.arc(d[o],f[o],p[o],0,2*Math.PI,!0),t.arc(d[o],f[o],_[o],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit?(this.visuals.line.set_vectorize(t,o),t.beginPath(),t.arc(d[o],f[o],p[o],0,2*Math.PI),t.moveTo(d[o]+_[o],f[o]),t.arc(d[o],f[o],_[o],0,2*Math.PI),c.push(t.stroke())):c.push(void 0)}return c},e.prototype._hit_point=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T;for(p=[t.vx,t.vy],v=p[0],b=p[1],x=this.renderer.xmapper.map_from_target(v,!0),w=x-this.max_radius,M=x+this.max_radius,k=this.renderer.ymapper.map_from_target(b,!0),j=k-this.max_radius,T=k+this.max_radius,n=[],e=a.validate_bbox_coords([w,M],[j,T]),_=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)c=n[t],o.push(c.i);return o}.call(this),l=0,u=_.length;l<u;l++)o=_[l],h=Math.pow(this.souter_radius[o],2),i=Math.pow(this.sinner_radius[o],2),f=this.renderer.xmapper.map_to_target(x),m=this.renderer.xmapper.map_to_target(this._x[o]),g=this.renderer.ymapper.map_to_target(k),y=this.renderer.ymapper.map_to_target(this._y[o]),r=Math.pow(f-m,2)+Math.pow(g-y,2),r<=h&&r>=i&&n.push([o,r]);return d=a.create_hit_test_result(),d["1d"].indices=s.chain(n).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),d},e.prototype.draw_legend=function(t,e,r,n,o){var i,s,a,l,u,h,c,p,_;return u=null!=(l=this.get_reference_point())?l:0,s=[u],p={},p[u]=(e+r)/2,_={},_[u]=(n+o)/2,a=.5*Math.min(Math.abs(r-e),Math.abs(o-n)),h={},h[u]=.4*a,c={},c[u]=.8*a,i={sx:p,sy:_,sinner_radius:h,souter_radius:c},this._render(t,s,i)},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="Annulus",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({inner_radius:[l.DistanceSpec],outer_radius:[l.DistanceSpec]}),e}(i.Model),e.exports={Model:n,View:o}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/arc":[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;s=t("underscore"),i=t("./glyph"),a=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xmapper,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;if(c=r.sx,p=r.sy,h=r.sradius,o=r._start_angle,n=r._end_angle,this.visuals.line.doit){for(i=this.model.properties.direction.value(),u=[],a=0,l=e.length;a<l;a++)s=e[a],isNaN(c[s]+p[s]+h[s]+o[s]+n[s])||(t.beginPath(),t.arc(c[s],p[s],h[s],o[s],n[s],i),this.visuals.line.set_vectorize(t,s),u.push(t.stroke()));return u}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=o,e.prototype.type="Arc",e.coords([["x","y"]]),e.mixins(["line"]),e.define({direction:[a.Direction,"anticlock"],radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]}),e}(i.Model),e.exports={Model:n,View:o}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/bezier":[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;s=t("underscore"),l=t("rbush"),i=t("./glyph"),a=function(t,e,r,n,o,i,s,a){var l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k;for(w=[],c=[[],[]],_=m=0;m<=2;_=++m)if(0===_?(u=6*t-12*r+6*o,l=-3*t+9*r-9*o+3*s,p=3*r-3*t):(u=6*e-12*n+6*i,l=-3*e+9*n-9*i+3*a,p=3*n-3*e),Math.abs(l)<1e-12){if(Math.abs(u)<1e-12)continue;v=-p/u,0<v&&v<1&&w.push(v)}else h=u*u-4*p*l,y=Math.sqrt(h),h<0||(b=(-u+y)/(2*l),0<b&&b<1&&w.push(b),x=(-u-y)/(2*l),0<x&&x<1&&w.push(x));for(d=w.length,f=d;d--;)v=w[d],g=1-v,M=g*g*g*t+3*g*g*v*r+3*g*v*v*o+v*v*v*s,c[0][d]=M,k=g*g*g*e+3*g*g*v*n+3*g*v*v*i+v*v*v*a,c[1][d]=k;return c[0][f]=t,c[1][f]=e,c[0][f+1]=s,c[1][f+1]=a,[Math.min.apply(null,c[0]),Math.max.apply(null,c[1]),Math.max.apply(null,c[0]),Math.min.apply(null,c[1])]},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._index_data=function(){var t,e,r,n,o,i,s,u,h,c;for(e=l(),n=[],t=r=0,o=this._x0.length;0<=o?r<o:r>o;t=0<=o?++r:--r)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx0[t]+this._cy0[t]+this._cx1[t]+this._cy1[t])||(i=a(this._x0[t],this._y0[t],this._x1[t],this._y1[t],this._cx0[t],this._cy0[t],this._cx1[t],this._cy1[t]),s=i[0],h=i[1],u=i[2],c=i[3],n.push({minX:s,minY:h,maxX:u,maxY:c,i:t}));return e.load(n),e},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f;if(p=r.sx0,d=r.sy0,_=r.sx1,f=r.sy1,a=r.scx,l=r.scx0,h=r.scy0,u=r.scx1,c=r.scy1,this.visuals.line.doit){for(s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(p[n]+d[n]+_[n]+f[n]+l[n]+h[n]+u[n]+c[n])||(t.beginPath(),t.moveTo(p[n],d[n]),t.bezierCurveTo(l[n],h[n],u[n],c[n],_[n],f[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="Bezier",e.coords([["x0","y0"],["x1","y1"],["cx0","cy0"],["cx1","cy1"]]),e.mixins(["line"]),e}(i.Model),e.exports={Model:n,View:o}},{"./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/circle":[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;s=t("underscore"),i=t("./glyph"),a=t("../../common/hittest"),l=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){var t,e;return null!=this._radius?"data"===this.model.properties.radius.spec.units?(t=this.model.properties.radius_dimension.spec.value,this.sradius=this.sdist(this.renderer[t+"mapper"],this["_"+t],this._radius)):(this.sradius=this._radius,this.max_size=2*this.max_radius):this.sradius=function(){var t,r,n,o;for(n=this._size,o=[],t=0,r=n.length;t<r;t++)e=n[t],o.push(e/2);return o}.call(this)},e.prototype._mask_data=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d,f,m,g;return r=this.renderer.plot_view.frame.get("h_range"),p=this.renderer.plot_view.frame.get("v_range"),null!=this._radius&&"data"===this.model.properties.radius.units?(l=r.get("start"),u=r.get("end"),n=this.renderer.xmapper.v_map_from_target([l,u],!0),d=n[0],f=n[1],d-=this.max_radius,f+=this.max_radius,h=p.get("start"),c=p.get("end"),o=this.renderer.ymapper.v_map_from_target([h,c],!0),m=o[0],g=o[1],m-=this.max_radius,g+=this.max_radius):(l=r.get("start")-this.max_size,u=r.get("end")+this.max_size,i=this.renderer.xmapper.v_map_from_target([l,u],!0),d=i[0],f=i[1],h=p.get("start")-this.max_size,c=p.get("end")+this.max_size,s=this.renderer.ymapper.v_map_from_target([h,c],!0),m=s[0],g=s[1]),e=a.validate_bbox_coords([d,f],[m,g]),function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)_=n[t],o.push(_.i);return o}.call(this)},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u;for(l=r.sx,u=r.sy,a=r.sradius,s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(l[n]+u[n]+a[n])||(t.beginPath(),t.arc(l[n],u[n],a[n],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I;if(d=[t.vx,t.vy],T=d[0],P=d[1],C=this.renderer.xmapper.map_from_target(T,!0),q=this.renderer.ymapper.map_from_target(P,!0),null!=this._radius&&"data"===this.model.properties.radius.units?(N=C-this.max_radius,O=C+this.max_radius,D=q-this.max_radius,I=q+this.max_radius):(S=T-this.max_size,z=T+this.max_size,f=this.renderer.xmapper.v_map_from_target([S,z],!0),N=f[0],O=f[1],m=[Math.min(N,O),Math.max(N,O)],N=m[0],O=m[1],E=P-this.max_size,A=P+this.max_size,g=this.renderer.ymapper.v_map_from_target([E,A],!0),D=g[0],I=g[1],y=[Math.min(D,I),Math.max(D,I)],D=y[0],I=y[1]),e=a.validate_bbox_coords([N,O],[D,I]),r=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)p=n[t],o.push(p.i);return o}.call(this),o=[],null!=this._radius&&"data"===this.model.properties.radius.units)for(l=0,h=r.length;l<h;l++)i=r[l],_=Math.pow(this.sradius[i],2),x=this.renderer.xmapper.map_to_target(C,!0),w=this.renderer.xmapper.map_to_target(this._x[i],!0),k=this.renderer.ymapper.map_to_target(q,!0),j=this.renderer.ymapper.map_to_target(this._y[i],!0),n=Math.pow(x-w,2)+Math.pow(k-j,2),n<=_&&o.push([i,n]);else for(b=this.renderer.plot_view.canvas.vx_to_sx(T),M=this.renderer.plot_view.canvas.vy_to_sy(P),u=0,c=r.length;u<c;u++)i=r[u],_=Math.pow(this.sradius[i],2),n=Math.pow(this.sx[i]-b,2)+Math.pow(this.sy[i]-M,2),n<=_&&o.push([i,n]);return o=s.chain(o).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),v=a.create_hit_test_result(),v["1d"].indices=o,v},e.prototype._hit_span=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T;return u=[t.vx,t.vy],m=u[0],v=u[1],h=this.bounds(),i=h.minX,s=h.minY,n=h.maxX,o=h.maxY,f=a.create_hit_test_result(),"h"===t.direction?(j=s,T=o,null!=this._radius&&"data"===this.model.properties.radius.units?(g=m-this.max_radius,y=m+this.max_radius,c=this.renderer.xmapper.v_map_from_target([g,y]),w=c[0],M=c[1]):(l=this.max_size/2,g=m-l,y=m+l,p=this.renderer.xmapper.v_map_from_target([g,y],!0),w=p[0],M=p[1])):(w=i,M=n,null!=this._radius&&"data"===this.model.properties.radius.units?(b=v-this.max_radius,x=v+this.max_radius,_=this.renderer.ymapper.v_map_from_target([b,x]),j=_[0],T=_[1]):(l=this.max_size/2,b=v-l,x=v+l,d=this.renderer.ymapper.v_map_from_target([b,x],!0),j=d[0],T=d[1])),e=a.validate_bbox_coords([w,M],[j,T]),r=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)k=n[t],o.push(k.i);return o}.call(this),f["1d"].indices=r,f},e.prototype._hit_rect=function(t){var e,r,n,o,i,s,l,u,h;return r=this.renderer.xmapper.v_map_from_target([t.vx0,t.vx1],!0),s=r[0],l=r[1],n=this.renderer.ymapper.v_map_from_target([t.vy0,t.vy1],!0),u=n[0],h=n[1],e=a.validate_bbox_coords([s,l],[u,h]),o=a.create_hit_test_result(),o["1d"].indices=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)i=n[t],o.push(i.i);return o}.call(this),o},e.prototype._hit_poly=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d;for(s=[t.vx,t.vy],_=s[0],d=s[1],c=this.renderer.plot_view.canvas.v_vx_to_sx(_),p=this.renderer.plot_view.canvas.v_vy_to_sy(d),e=function(){h=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)h.push(t);return h}.apply(this),r=[],n=i=0,l=e.length;0<=l?i<l:i>l;n=0<=l?++i:--i)o=e[n],a.point_in_poly(this.sx[n],this.sy[n],c,p)&&r.push(o);return u=a.create_hit_test_result(),u["1d"].indices=r,u},e.prototype.draw_legend=function(t,e,r,n,o){var i,s,a,l,u,h,c;return l=null!=(a=this.get_reference_point())?a:0,s=[l],h={},h[l]=(e+r)/2,c={},c[l]=(n+o)/2,u={},u[l]=.2*Math.min(Math.abs(r-e),Math.abs(o-n)),i={sx:h,sy:c,sradius:u},this._render(t,s,i)},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="Circle",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({angle:[l.AngleSpec,0],size:[l.DistanceSpec,{units:"screen",value:4}],radius:[l.DistanceSpec,null],radius_dimension:[l.String,"x"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.properties.radius.optional=!0},e}(i.Model),e.exports={Model:n,View:o}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/ellipse":[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;s=t("underscore"),i=t("./glyph"),a=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xmapper,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.ymapper,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;for(u=r.sx,h=r.sy,l=r.sw,a=r.sh,s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(u[n]+h[n]+l[n]+a[n]+this._angle[n])||(t.beginPath(),t.ellipse(u[n],h[n],l[n]/2,a[n]/2,this._angle[n],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype.draw_legend=function(t,e,r,n,o){var i,s,a,l,u,h,c,p,_,d;return u=null!=(l=this.get_reference_point())?l:0,a=[u],_={},_[u]=(e+r)/2,d={},d[u]=(n+o)/2,h=this.sw[u]/this.sh[u],i=.8*Math.min(Math.abs(r-e),Math.abs(o-n)),p={},c={},h>1?(p[u]=i,c[u]=i/h):(p[u]=i*h,c[u]=i),s={sx:_,sy:d,sw:p,sh:c},this._render(t,a,s)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=o,e.prototype.type="Ellipse",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({angle:[a.AngleSpec,0],width:[a.DistanceSpec],height:[a.DistanceSpec]}),e}(i.Model),e.exports={Model:n,View:o}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/gear":[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;l=t("underscore"),a=t("./glyph"),i=t("gear_utils"),u=t("../../core/properties"),n=t("../../util/bezier"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return this.smodule=this.sdist(this.renderer.xmapper,this._x,this._module,"edge")},e.prototype._render=function(t,e,r){var n,o,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z;for(j=r.sx,T=r.sy,k=r.smodule,o=r._angle,u=r._teeth,a=r._pressure_angle,l=r._shaft_size,s=r._internal,_=0,f=e.length;_<f;_++)if(c=e[_],!isNaN(j[c]+T[c]+o[c]+k[c]+u[c]+a[c]+l[c]+s[c])){for(m=k[c]*u[c]/2,h=s[c]?i.create_internal_gear_tooth:i.create_gear_tooth,w=h(k[c],u[c],a[c]),g=w.slice(0,3),n=g[0],S=g[1],z=g[2],x=w.slice(3),t.save(),t.translate(j[c],T[c]),t.rotate(o[c]),t.beginPath(),b=2*Math.PI/u[c],t.moveTo(S,z),p=d=0,y=u[c];0<=y?d<y:d>y;p=0<=y?++d:--d)this._render_seq(t,x),t.rotate(b);t.closePath(),s[c]?(v=m+2.75*k[c],t.moveTo(v,0),t.arc(0,0,v,0,2*Math.PI,!0)):l[c]>0&&(M=m*l[c],t.moveTo(M,0),t.arc(0,0,M,0,2*Math.PI,!0)),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke()),t.restore()}},e.prototype._render_seq=function(t,e){var r,o,i,s,a,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C;for(u=0;u<e.length;)switch(l.isString(e[u])&&(r=e[u],u+=1),r){case"M":f=e.slice(u,u+2),E=f[0],C=f[1],t.moveTo(E,C),m=[E,C],_=m[0],d=m[1],u+=2;break;case"L":y=e.slice(u,u+2),E=y[0],C=y[1],t.lineTo(E,C),v=[E,C],_=v[0],d=v[1],u+=2;break;case"C":b=e.slice(u,u+6),o=b[0],s=b[1],i=b[2],a=b[3],E=b[4],C=b[5],t.bezierCurveTo(o,s,i,a,E,C),x=[E,C],_=x[0],d=x[1],u+=6;break;case"Q":w=e.slice(u,u+4),o=w[0],s=w[1],E=w[2],C=w[3],t.quadraticCurveTo(o,s,E,C),M=[E,C],_=M[0],d=M[1],u+=4;break;case"A":for(k=e.slice(u,u+7),T=k[0],S=k[1],A=k[2],c=k[3],P=k[4],E=k[5],C=k[6],z=n.arc_to_bezier(_,d,T,S,-A,c,1-P,E,C),h=0,p=z.length;h<p;h++)j=z[h],o=j[0],s=j[1],i=j[2],a=j[3],E=j[4],C=j[5],t.bezierCurveTo(o,s,i,a,E,C);g=[E,C],_=g[0],d=g[1],u+=7;break;default:throw new Error("unexpected command: "+r)}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e}(a.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="Gear",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({angle:[u.AngleSpec,0],module:[u.NumberSpec,null],pressure_angle:[u.NumberSpec,20],shaft_size:[u.NumberSpec,.3],teeth:[u.NumberSpec,null],internal:[u.NumberSpec,!1]}),e}(a.Model),e.exports={Model:o,View:s}},{"../../core/properties":"core/properties","../../util/bezier":"util/bezier","./glyph":"models/glyphs/glyph",gear_utils:"gear_utils",underscore:"underscore"}],"models/glyphs/glyph":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_=function(t,e){function r(){this.constructor=t}for(var n in e)d.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},d={}.hasOwnProperty;l=t("underscore"),p=t("rbush"),n=t("../mappers/categorical_mapper"),a=t("../renderers/renderer"),c=t("../../core/properties"),u=t("../../core/util/bbox"),s=t("../../model"),h=t("./webgl/main"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return _(e,t),e.prototype.initialize=function(t){var r,n,o;if(e.__super__.initialize.call(this,t),this.renderer=t.renderer,null!=(null!=(o=this.renderer)?o.plot_view:void 0)&&(n=this.renderer.plot_view.canvas_view.ctx,null!=n.glcanvas&&(r=h[this.model.type+"GLGlyph"])))return this.glglyph=new r(n.glcanvas.gl,this)},e.prototype.render=function(t,e,r){if(this.mget("visible")){if(t.beginPath(),null!=this.glglyph&&this._render_gl(t,e,r))return;this._render(t,e,r)}},e.prototype._render_gl=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;return c=p=1,i=this.renderer.map_to_screen([0*c,1*c,2*c],[0*p,1*p,2*p]),n=i[0],o=i[1],c=100/Math.min(Math.max(Math.abs(n[1]-n[0]),1e-12),1e12),p=100/Math.min(Math.max(Math.abs(o[1]-o[0]),1e-12),1e12),s=this.renderer.map_to_screen([0*c,1*c,2*c],[0*p,1*p,2*p]),n=s[0],o=s[1],!(Math.abs(n[1]-n[0]-(n[2]-n[1]))>1e-6||Math.abs(o[1]-o[0]-(o[2]-o[1]))>1e-6)&&(a=[(n[1]-n[0])/c,(o[1]-o[0])/p],l=a[0],u=a[1],h={pixel_ratio:t.pixel_ratio,width:t.glcanvas.width,height:t.glcanvas.height,dx:n[0]/l,dy:o[0]/u,sx:l,sy:u},this.glglyph.draw(e,r,h),!0)},e.prototype.bounds=function(){var t,e;return null==this.index?u.empty():(e=this.index.data,t={minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY},this._bounds(t))},e.prototype.max_wh2_bounds=function(t){return{minX:t.minX-this.max_w2,maxX:t.maxX+this.max_w2,minY:t.minY-this.max_h2,maxY:t.maxY+this.max_h2}},e.prototype.get_anchor_point=function(t,e,r){var n,o;switch(n=r[0],o=r[1],t){case"center":return{x:this.scx(e,n,o),y:this.scy(e,n,o)};default:return null}},e.prototype.scx=function(t){return this.sx[t]},e.prototype.scy=function(t){return this.sy[t]},e.prototype._xy_index=function(){var t,e,r,o,i,s,a,l,u;for(e=p(),o=[],a=this.renderer.xmapper instanceof n.Model?this.renderer.xmapper.v_map_to_target(this._x,!0):this._x,u=this.renderer.ymapper instanceof n.Model?this.renderer.ymapper.v_map_to_target(this._y,!0):this._y,t=r=0,i=a.length;0<=i?r<i:r>i;t=0<=i?++r:--r)s=a[t],!isNaN(s)&&isFinite(s)&&(l=u[t],!isNaN(l)&&isFinite(l)&&o.push({minX:s,minY:l,maxX:s,maxY:l,i:t}));return e.load(o),e},e.prototype.sdist=function(t,e,r,n,o){var i,s,a,u,h,c,p;return null==n&&(n="edge"),null==o&&(o=!1),l.isString(e[0])&&(e=t.v_map_to_target(e)),"center"===n?(s=function(){var t,e,n;for(n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(i/2);return n}(),u=function(){var t,r,n;for(n=[],a=t=0,r=e.length;0<=r?t<r:t>r;a=0<=r?++t:--t)n.push(e[a]-s[a]);return n}(),h=function(){var t,r,n;for(n=[],a=t=0,r=e.length;0<=r?t<r:t>r;a=0<=r?++t:--t)n.push(e[a]+s[a]);return n}()):(u=e,h=function(){var t,e,n;for(n=[],a=t=0,e=u.length;0<=e?t<e:t>e;a=0<=e?++t:--t)n.push(u[a]+r[a]);return n}()),c=t.v_map_to_target(u),p=t.v_map_to_target(h),o?function(){var t,e,r;for(r=[],a=t=0,e=c.length;0<=e?t<e:t>e;a=0<=e?++t:--t)r.push(Math.ceil(Math.abs(p[a]-c[a])));return r}():function(){var t,e,r;for(r=[],a=t=0,e=c.length;0<=e?t<e:t>e;a=0<=e?++t:--t)r.push(Math.abs(p[a]-c[a]));return r}()},e.prototype.get_reference_point=function(){},e.prototype.draw_legend=function(t,e,r,n,o){return null},e.prototype._generic_line_legend=function(t,e,r,n,o){var i,s;return s=null!=(i=this.get_reference_point())?i:0,t.save(),t.beginPath(),t.moveTo(e,(n+o)/2),t.lineTo(r,(n+o)/2),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,s),t.stroke()),t.restore()},e.prototype._generic_area_legend=function(t,e,r,n,o){var i,s,a,l,u,h,c,p,_,d,f;if(h=null!=(u=this.get_reference_point())?u:0,l=[h],f=Math.abs(r-e),s=.1*f,a=Math.abs(o-n),i=.1*a,c=e+s,p=r-s,_=n+i,d=o-i,this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fillRect(c,_,p-c,d-_)),this.visuals.line.doit)return t.beginPath(),t.rect(c,_,p-c,d-_),this.visuals.line.set_vectorize(t,h),t.stroke()},e}(a.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return _(e,t),e.define({visible:[c.Bool,!0]}),e.internal({x_range_name:[c.String,"default"],y_range_name:[c.String,"default"]}),e}(s),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","../../core/util/bbox":"core/util/bbox","../../model":"model","../mappers/categorical_mapper":"models/mappers/categorical_mapper","../renderers/renderer":"models/renderers/renderer","./webgl/main":"models/glyphs/webgl/main",rbush:"rbush",underscore:"underscore"}],"models/glyphs/hbar":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;l=t("underscore"),c=t("rbush"),a=t("./quad"),o=t("./glyph"),n=t("../mappers/categorical_mapper"),u=t("../../common/hittest"),h=t("../../core/properties"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype._map_data=function(){var t,e,r,n,o,i;for(i=this.renderer.ymapper.v_map_to_target(this._y),this.sy=this.plot_view.canvas.v_vy_to_sy(i),o=this.renderer.xmapper.v_map_to_target(this._right),n=this.renderer.xmapper.v_map_to_target(this._left),this.sright=this.plot_view.canvas.v_vx_to_sx(o),this.sleft=this.plot_view.canvas.v_vx_to_sx(n),this.stop=[],this.sbottom=[],this.sh=this.sdist(this.renderer.ymapper,this._y,this._height,"center"),t=e=0,r=this.sy.length;0<=r?e<r:e>r;t=0<=r?++e:--e)this.stop.push(this.sy[t]-this.sh[t]/2),this.sbottom.push(this.sy[t]+this.sh[t]/2);return null},e.prototype._index_data=function(){var t,e,r,o,i,s,a,l,u,h,p,_,d,f;for(l=function(t,e){return t instanceof n.Model?t.v_map_to_target(e,!0):e},a=l(this.renderer.xmapper,this._left),_=l(this.renderer.xmapper,this._right),f=l(this.renderer.ymapper,this._y),e=l(this.renderer.ymapper,this._height),o=c(),u=[],r=i=0,p=f.length;0<=p?i<p:i>p;r=0<=p?++i:--i)s=a[r],h=_[r],d=f[r]+.5*e[r],t=f[r]-.5*e[r],!isNaN(s+h+d+t)&&isFinite(s+h+d+t)&&u.push({minX:s,minY:t,maxX:h,maxY:d,i:r});return o.load(u),o},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;for(l=r.sleft,u=r.sright,h=r.stop,a=r.sbottom,s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(l[n]+h[n]+u[n]+a[n])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fillRect(l[n],h[n],u[n]-l[n],a[n]-h[n])),this.visuals.line.doit?(t.beginPath(),t.rect(l[n],h[n],u[n]-l[n],a[n]-h[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,o,i,s,a;return r=[t.vx,t.vy],o=r[0],i=r[1],s=this.renderer.xmapper.map_from_target(o,!0),a=this.renderer.ymapper.map_from_target(i,!0),e=function(){var t,e,r,n;for(r=this.index.search({minX:s,minY:a,maxX:s,maxY:a}),n=[],t=0,e=r.length;t<e;t++)s=r[t],n.push(s.i);return n}.call(this),n=u.create_hit_test_result(),n["1d"].indices=e,n},e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e}(o.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.default_view=s,e.prototype.type="HBar",e.mixins(["line","fill"]),e.define({y:[h.NumberSpec],height:[h.DistanceSpec],left:[h.NumberSpec,0],right:[h.NumberSpec]}),e}(o.Model),e.exports={Model:i,View:s}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../mappers/categorical_mapper":"models/mappers/categorical_mapper","./glyph":"models/glyphs/glyph","./quad":"models/glyphs/quad",rbush:"rbush",underscore:"underscore"}],"models/glyphs/image":[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;l=t("underscore"),n=t("../glyphs/glyph"),a=t("../mappers/linear_color_mapper"),u=t("../../core/properties"),o=t("../../palettes/palettes").Greys,s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.model.color_mapper,"change",this._update_image)},e.prototype._update_image=function(){if(null!=this.image_data)return this._set_data(),this.plot_view.request_render()},e.prototype._index_data=function(){return this._xy_index()},e.prototype._set_data=function(){var t,e,r,n,o,i,s,a,u,h,c;for(null!=this.image_data&&this.image_data.length===this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length===this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length===this._image.length||(this._height=new Array(this._image.length)),c=[],i=u=0,h=this._image.length;0<=h?u<h:u>h;i=0<=h?++u:--u)null!=this._rows?(this._height[i]=this._rows[i],this._width[i]=this._cols[i]):(this._height[i]=this._image[i].length,this._width[i]=this._image[i][0].length),r=document.createElement("canvas"),r.width=this._width[i],r.height=this._height[i],o=r.getContext("2d"),s=o.getImageData(0,0,this._width[i],this._height[i]),n=this.mget("color_mapper"),a=null!=this._rows?this._image[i]:l.flatten(this._image[i]),t=n.v_map_screen(a),e=new Uint8ClampedArray(t),s.data.set(e),o.putImageData(s,0,0),this.image_data[i]=r,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=l.max(this._dw)),this.max_dh=0,"data"===this._dh.units&&(this.max_dh=l.max(this._dh)),c.push(this._xy_index());return c},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xmapper,this._x,this._dw,"edge",this.mget("dilate"));break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.ymapper,this._y,this._dh,"edge",this.mget("dilate"));case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;for(o=r.image_data,h=r.sx,c=r.sy,u=r.sw,l=r.sh,a=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),i=0,s=e.length;i<s;i++)n=e[i],null!=o[n]&&(isNaN(h[n]+c[n]+u[n]+l[n])||(p=c[n],t.translate(0,p),t.scale(1,-1),t.translate(0,-p),t.drawImage(o[n],0|h[n],0|c[n],u[n],l[n]),t.translate(0,p),t.scale(1,-1),t.translate(0,-p)));return t.setImageSmoothingEnabled(a)},e.prototype.bounds=function(){var t;return t=this.index.data,{minX:t.minX,minY:t.minY,maxX:t.maxX+this.max_dw,maxY:t.maxY+this.max_dh}},e}(n.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="Image",e.coords([["x","y"]]),e.mixins([]),e.define({image:[u.NumberSpec],dw:[u.DistanceSpec],dh:[u.DistanceSpec],dilate:[u.Bool,!1],color_mapper:[u.Instance,function(){return new a.Model({palette:o.Greys9})}]}),e}(n.Model),e.exports={Model:i,View:s}},{"../../core/properties":"core/properties","../../palettes/palettes":"palettes/palettes","../glyphs/glyph":"models/glyphs/glyph","../mappers/linear_color_mapper":"models/mappers/linear_color_mapper",
underscore:"underscore"}],"models/glyphs/image_rgba":[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;s=t("underscore"),n=t("./glyph"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._set_data=function(t,e){var r,n,o,i,a,l,u,h,c,p,_,d,f,m;for(null!=this.image_data&&this.image_data.length===this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length===this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length===this._image.length||(this._height=new Array(this._image.length)),m=[],u=p=0,d=this._image.length;0<=d?p<d:p>d;u=0<=d?++p:--p)if(null==e||u===e){if(null!=this._rows?(this._height[u]=this._rows[u],this._width[u]=this._cols[u]):(this._height[u]=this._image[u].length,this._width[u]=this._image[u][0].length),o=document.createElement("canvas"),o.width=this._width[u],o.height=this._height[u],a=o.getContext("2d"),h=a.getImageData(0,0,this._width[u],this._height[u]),null!=this._rows)h.data.set(new Uint8ClampedArray(this._image[u]));else{for(l=s.flatten(this._image[u]),r=new ArrayBuffer(4*l.length),i=new Uint32Array(r),c=_=0,f=l.length;0<=f?_<f:_>f;c=0<=f?++_:--_)i[c]=l[c];n=new Uint8ClampedArray(r),h.data.set(n)}a.putImageData(h,0,0),this.image_data[u]=o,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,"data"===this._dh.units?m.push(this.max_dh=s.max(this._dh)):m.push(void 0)}return m},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xmapper,this._x,this._dw,"edge",this.mget("dilate"));break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.ymapper,this._y,this._dh,"edge",this.mget("dilate"));case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;for(o=r.image_data,h=r.sx,c=r.sy,u=r.sw,l=r.sh,a=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),i=0,s=e.length;i<s;i++)n=e[i],isNaN(h[n]+c[n]+u[n]+l[n])||(p=c[n],t.translate(0,p),t.scale(1,-1),t.translate(0,-p),t.drawImage(o[n],0|h[n],0|c[n],u[n],l[n]),t.translate(0,p),t.scale(1,-1),t.translate(0,-p));return t.setImageSmoothingEnabled(a)},e.prototype.bounds=function(){var t;return t=this.index.data,{minX:t.minX,minY:t.minY,maxX:t.maxX+this.max_dw,maxY:t.maxY+this.max_dh}},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="ImageRGBA",e.coords([["x","y"]]),e.mixins([]),e.define({image:[a.NumberSpec],rows:[a.NumberSpec],cols:[a.NumberSpec],dw:[a.DistanceSpec],dh:[a.DistanceSpec],dilate:[a.Bool,!1]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.properties.rows.optional=!0,this.properties.cols.optional=!0},e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/image_url":[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;s=t("underscore"),n=t("./glyph"),a=t("../../core/logging").logger,l=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.model,"change:global_alpha",this.renderer.request_render)},e.prototype._index_data=function(){},e.prototype._set_data=function(){var t,e,r,n,o,i,s;for(null!=this.image&&this.image.length===this._url.length||(this.image=function(){var t,r,n,o;for(n=this._url,o=[],t=0,r=n.length;t<r;t++)e=n[t],o.push(null);return o}.call(this)),i=this.model.retry_attempts,s=this.model.retry_timeout,this.retries=function(){var t,r,n,o;for(n=this._url,o=[],t=0,r=n.length;t<r;t++)e=n[t],o.push(i);return o}.call(this),o=[],t=r=0,n=this._url.length;0<=n?r<n:r>n;t=0<=n?++r:--r)null!=this._url[t]&&(e=new Image,e.onerror=function(t){return function(e,r){return function(){return t.retries[e]>0?(a.trace("ImageURL failed to load "+t._url[e]+" image, retrying in "+s+" ms"),setTimeout(function(){return r.src=t._url[e]},s)):a.warn("ImageURL unable to load "+t._url[e]+" image after "+i+" retries"),t.retries[e]-=1}}}(this)(t,e),e.onload=function(t){return function(e,r){return function(){return t.image[r]=e,t.renderer.request_render()}}}(this)(e,t),o.push(e.src=this._url[t]));return o},e.prototype._map_data=function(){var t,e,r;switch(e=function(){var t,e,n,o;if(null!=this._w)return this._w;for(n=this._x,o=[],t=0,e=n.length;t<e;t++)r=n[t],o.push(NaN);return o}.call(this),t=function(){var t,e,n,o;if(null!=this._h)return this._h;for(n=this._x,o=[],t=0,e=n.length;t<e;t++)r=n[t],o.push(NaN);return o}.call(this),this.model.properties.w.units){case"data":this.sw=this.sdist(this.renderer.xmapper,this._x,e,"edge",this.model.dilate);break;case"screen":this.sw=e}switch(this.model.properties.h.units){case"data":return this.sh=this.sdist(this.renderer.ymapper,this._y,t,"edge",this.model.dilate);case"screen":return this.sh=t}},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d;for(o=r._url,a=r.image,_=r.sx,d=r.sy,p=r.sw,c=r.sh,n=r._angle,i=this.renderer.plot_view.frame,t.rect(i.get("left")+1,i.get("bottom")+1,i.get("width")-2,i.get("height")-2),t.clip(),h=[],l=0,u=e.length;l<u;l++)s=e[l],isNaN(_[s]+d[s]+n[s])||this.retries[s]!==-1&&null!=a[s]&&h.push(this._render_image(t,s,a[s],_,d,p,c,n));return h},e.prototype._final_sx_sy=function(t,e,r,n,o){switch(t){case"top_left":return[e,r];case"top_center":return[e-n/2,r];case"top_right":return[e-n,r];case"right_center":return[e-n,r-o/2];case"bottom_right":return[e-n,r-o];case"bottom_center":return[e-n/2,r-o];case"bottom_left":return[e,r-o];case"left_center":return[e,r-o/2];case"center":return[e-n/2,r-o/2]}},e.prototype._render_image=function(t,e,r,n,o,i,s,a){var l,u;return isNaN(i[e])&&(i[e]=r.width),isNaN(s[e])&&(s[e]=r.height),l=this.model.anchor,u=this._final_sx_sy(l,n[e],o[e],i[e],s[e]),n=u[0],o=u[1],t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(n,o),t.rotate(a[e]),t.drawImage(r,0,0,i[e],s[e]),t.rotate(-a[e]),t.translate(-n,-o)):t.drawImage(r,n,o,i[e],s[e]),t.restore()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="ImageURL",e.coords([["x","y"]]),e.mixins([]),e.define({url:[l.StringSpec],anchor:[l.Anchor,"top_left"],global_alpha:[l.Number,1],angle:[l.AngleSpec,0],w:[l.DistanceSpec],h:[l.DistanceSpec],dilate:[l.Bool,!1],retry_attempts:[l.Number,0],retry_timeout:[l.Number,0]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/line":[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;s=t("underscore"),n=t("./glyph"),a=t("../../common/hittest"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._render=function(t,e,r){var n,o,i,s,a,l;for(a=r.sx,l=r.sy,n=!1,this.visuals.line.set_value(t),i=0,s=e.length;i<s;i++)o=e[i],isFinite(a[o]+l[o])||!n?n?t.lineTo(a[o],l[o]):(t.beginPath(),t.moveTo(a[o],l[o]),n=!0):(t.stroke(),t.beginPath(),n=!1);if(n)return t.stroke()},e.prototype._hit_point=function(t){var e,r,n,o,i,s,l,u,h,c,p;for(h=a.create_hit_test_result(),s={x:this.renderer.plot_view.canvas.vx_to_sx(t.vx),y:this.renderer.plot_view.canvas.vy_to_sy(t.vy)},c=9999,p=Math.max(2,this.visuals.line.line_width.value()/2),r=n=0,l=this.sx.length-1;0<=l?n<l:n>l;r=0<=l?++n:--n)u=[{x:this.sx[r],y:this.sy[r]},{x:this.sx[r+1],y:this.sy[r+1]}],o=u[0],i=u[1],e=a.dist_to_segment(s,o,i),e<p&&e<c&&(c=e,h["0d"].glyph=this.model,h["0d"].get_view=function(){return this}.bind(this),h["0d"].flag=!0,h["0d"].indices=[r]);return h},e.prototype._hit_span=function(t){var e,r,n,o,i,s,l,u,h;for(n=[t.vx,t.vy],u=n[0],h=n[1],i=a.create_hit_test_result(),"v"===t.direction?(s=this.renderer.ymapper.map_from_target(h),l=this._y):(s=this.renderer.xmapper.map_from_target(u),l=this._x),e=r=0,o=l.length-1;0<=o?r<o:r>o;e=0<=o?++r:--r)l[e]<=s&&s<=l[e+1]&&(i["0d"].glyph=this.model,i["0d"].get_view=function(){return this}.bind(this),i["0d"].flag=!0,i["0d"].indices.push(e));return i},e.prototype.get_interpolation_hit=function(t,e){var r,n,o,i,s,l,u,h,c,p,_,d,f,m,g,y,v,b,x;return r=[e.vx,e.vy],p=r[0],_=r[1],n=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],m=n[0],b=n[1],g=n[2],x=n[3],"point"===e.type?(o=this.renderer.ymapper.v_map_from_target([_-1,_+1]),y=o[0],v=o[1],i=this.renderer.xmapper.v_map_from_target([p-1,p+1]),d=i[0],f=i[1]):"v"===e.direction?(s=this.renderer.ymapper.v_map_from_target([_,_]),y=s[0],v=s[1],l=[m,g],d=l[0],f=l[1]):(u=this.renderer.xmapper.v_map_from_target([p,p]),d=u[0],f=u[1],h=[b,x],y=h[0],v=h[1]),c=a.check_2_segments_intersect(d,y,f,v,m,b,g,x),[c.x,c.y]},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Line",e.coords([["x","y"]]),e.mixins(["line"]),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/multi_line":[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;s=t("underscore"),l=t("rbush"),a=t("../../common/hittest"),n=t("./glyph"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._index_data=function(){var t,e,r,n,o,i,a,u,h;for(e=l(),n=[],t=r=0,o=this._xs.length;0<=o?r<o:r>o;t=0<=o?++r:--r)a=function(){var e,r,n,o;for(n=this._xs[t],o=[],e=0,r=n.length;e<r;e++)i=n[e],s.isNaN(i)||o.push(i);return o}.call(this),h=function(){var e,r,n,o;for(n=this._ys[t],o=[],e=0,r=n.length;e<r;e++)u=n[e],s.isNaN(u)||o.push(u);return o}.call(this),0!==a.length&&n.push({minX:s.min(a),minY:s.min(h),maxX:s.max(a),maxY:s.max(h),i:t});return e.load(n),e},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d;for(p=r.sxs,d=r.sys,h=[],i=0,a=e.length;i<a;i++){for(n=e[i],l=[p[n],d[n]],c=l[0],_=l[1],this.visuals.line.set_vectorize(t,n),o=s=0,u=c.length;0<=u?s<u:s>u;o=0<=u?++s:--s)0!==o?isNaN(c[o])||isNaN(_[o])?(t.stroke(),t.beginPath()):t.lineTo(c[o],_[o]):(t.beginPath(),t.moveTo(c[o],_[o]));h.push(t.stroke())}return h},e.prototype._hit_point=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y;for(m=a.create_hit_test_result(),c={x:this.renderer.plot_view.canvas.vx_to_sx(t.vx),y:this.renderer.plot_view.canvas.vy_to_sy(t.vy)},g=9999,y=Math.max(2,this.visuals.line.line_width.value()/2),r={},n=i=0,_=this.sxs.length;0<=_?i<_:i>_;n=0<=_?++i:--i){for(p=null,o=l=0,d=this.sxs[n].length-1;0<=d?l<d:l>d;o=0<=d?++l:--l)f=[{x:this.sxs[n][o],y:this.sys[n][o]},{x:this.sxs[n][o+1],y:this.sys[n][o+1]}],u=f[0],h=f[1],e=a.dist_to_segment(c,u,h),e<y&&e<g&&(g=e,p=[o]);p&&(r[n]=p)}return m["1d"].indices=s.keys(r),m["2d"]=r,m},e.prototype._hit_span=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m;for(u=[t.vx,t.vy],f=u[0],m=u[1],p=a.create_hit_test_result(),"v"===t.direction?(_=this.renderer.ymapper.map_from_target(m),d=this._ys):(_=this.renderer.xmapper.map_from_target(f),d=this._xs),e={},r=o=0,h=d.length;0<=h?o<h:o>h;r=0<=h?++o:--o){for(l=[],n=i=0,c=d[r].length-1;0<=c?i<c:i>c;n=0<=c?++i:--i)d[r][n]<=_&&_<=d[r][n+1]&&l.push(n);l.length>0&&(e[r]=l)}return p["1d"].indices=s.keys(e),p["2d"]=e,p},e.prototype.get_interpolation_hit=function(t,e,r){var n,o,i,s,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w;return n=[r.vx,r.vy],_=n[0],d=n[1],o=[this._xs[t][e],this._ys[t][e],this._xs[t][e+1],this._ys[t][e+1]],g=o[0],x=o[1],y=o[2],w=o[3],"point"===r.type?(i=this.renderer.ymapper.v_map_from_target([d-1,d+1]),v=i[0],b=i[1],s=this.renderer.xmapper.v_map_from_target([_-1,_+1]),f=s[0],m=s[1]):"v"===r.direction?(l=this.renderer.ymapper.v_map_from_target([d,d]),v=l[0],b=l[1],u=[g,y],f=u[0],m=u[1]):(h=this.renderer.xmapper.v_map_from_target([_,_]),f=h[0],m=h[1],c=[x,w],v=c[0],b=c[1]),p=a.check_2_segments_intersect(f,v,m,b,g,x,y,w),[p.x,p.y]},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="MultiLine",e.coords([["xs","ys"]]),e.mixins(["line"]),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/oval":[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;s=t("underscore"),n=t("./glyph"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xmapper,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.ymapper,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;for(u=r.sx,h=r.sy,l=r.sw,a=r.sh,s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(u[n]+h[n]+l[n]+a[n]+this._angle[n])||(t.translate(u[n],h[n]),t.rotate(this._angle[n]),t.beginPath(),t.moveTo(0,-a[n]/2),t.bezierCurveTo(l[n]/2,-a[n]/2,l[n]/2,a[n]/2,0,a[n]/2),t.bezierCurveTo(-l[n]/2,a[n]/2,-l[n]/2,-a[n]/2,0,-a[n]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,n),t.stroke()),t.rotate(-this._angle[n]),s.push(t.translate(-u[n],-h[n])));return s},e.prototype.draw_legend=function(t,e,r,n,o){var i,s,a,l,u,h,c,p,_,d;return u=null!=(l=this.get_reference_point())?l:0,a=[u],_={},_[u]=(e+r)/2,d={},d[u]=(n+o)/2,h=this.sw[u]/this.sh[u],i=.8*Math.min(Math.abs(r-e),Math.abs(o-n)),p={},c={},h>1?(p[u]=i,c[u]=i/h):(p[u]=i*h,c[u]=i),s={sx:_,sy:d,sw:p,sh:c},this._render(t,a,s)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Oval",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({angle:[a.AngleSpec,0],width:[a.DistanceSpec],height:[a.DistanceSpec]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/patch":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=t("underscore"),n=t("./glyph"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u;if(l=r.sx,u=r.sy,this.visuals.fill.doit){for(this.visuals.fill.set_value(t),o=0,s=e.length;o<s;o++)n=e[o],0!==n?isNaN(l[n]+u[n])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(l[n],u[n]):(t.beginPath(),t.moveTo(l[n],u[n]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_value(t),i=0,a=e.length;i<a;i++)n=e[i],0!==n?isNaN(l[n]+u[n])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(l[n],u[n]):(t.beginPath(),t.moveTo(l[n],u[n]));return t.closePath(),t.stroke()}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=i,e.prototype.type="Patch",e.coords([["x","y"]]),e.mixins(["line","fill"]),e}(n.Model),e.exports={Model:o,View:i}},{"./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/patches":[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;s=t("underscore"),l=t("rbush"),n=t("./glyph"),a=t("../../common/hittest"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._build_discontinuous_object=function(t){var e,r,n,o,i,a,l,u,h;for(r={},n=o=0,h=t.length;0<=h?o<h:o>h;n=0<=h?++o:--o)for(r[n]=[],l=s.toArray(t[n]);l.length>0;)i=s.findLastIndex(l,function(t){return s.isNaN(t)}),i>=0?u=l.splice(i):(u=l,l=[]),e=function(){var t,e,r;for(r=[],t=0,e=u.length;t<e;t++)a=u[t],s.isNaN(a)||r.push(a);return r}(),r[n].push(e);return r},e.prototype._index_data=function(){var t,e,r,n,o,i,a,u,h,c,p,_;for(e=l(),i=[],c=this._build_discontinuous_object(this._xs),_=this._build_discontinuous_object(this._ys),t=n=0,a=this._xs.length;0<=a?n<a:n>a;t=0<=a?++n:--n)for(r=o=0,u=c[t].length;0<=u?o<u:o>u;r=0<=u?++o:--o)h=c[t][r],p=_[t][r],0!==h.length&&i.push({minX:s.min(h),minY:s.min(p),maxX:s.max(h),maxY:s.max(p),i:t});return e.load(i),e},e.prototype._mask_data=function(t){var e,r,n,o,i,s,l,u,h,c;return l=this.renderer.plot_view.x_range,r=[l.get("min"),l.get("max")],i=r[0],s=r[1],c=this.renderer.plot_view.y_range,n=[c.get("min"),c.get("max")],u=n[0],h=n[1],e=a.validate_bbox_coords([i,s],[u,h]),function(){var t,r,n,i;for(n=this.index.search(e),i=[],t=0,r=n.length;t<r;t++)o=n[t],i.push(o.i);return i}.call(this)},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m;for(d=r.sxs,m=r.sys,this.renderer.sxss=this._build_discontinuous_object(d),this.renderer.syss=this._build_discontinuous_object(m),p=[],i=0,a=e.length;i<a;i++){if(n=e[i],u=[d[n],m[n]],_=u[0],f=u[1],this.visuals.fill.doit){for(this.visuals.fill.set_vectorize(t,n),o=s=0,h=_.length;0<=h?s<h:s>h;o=0<=h?++s:--s)0!==o?isNaN(_[o]+f[o])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(_[o],f[o]):(t.beginPath(),t.moveTo(_[o],f[o]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_vectorize(t,n),o=l=0,c=_.length;0<=c?l<c:l>c;o=0<=c?++l:--l)0!==o?isNaN(_[o]+f[o])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(_[o],f[o]):(t.beginPath(),t.moveTo(_[o],f[o]));t.closePath(),p.push(t.stroke())}else p.push(void 0)}return p},e.prototype._hit_point=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d,f,m,g,y,v,b;for(u=[t.vx,t.vy],g=u[0],y=u[1],_=this.renderer.plot_view.canvas.vx_to_sx(g),f=this.renderer.plot_view.canvas.vy_to_sy(y),v=this.renderer.xmapper.map_from_target(g,!0),b=this.renderer.ymapper.map_from_target(y,!0),e=function(){var t,e,r,n;for(r=this.index.search({minX:v,minY:b,maxX:v,maxY:b}),n=[],t=0,e=r.length;t<e;t++)v=r[t],n.push(v.i);return n}.call(this),r=[],n=s=0,h=e.length;0<=h?s<h:s>h;n=0<=h?++s:--s)for(o=e[n],d=this.renderer.sxss[o],m=this.renderer.syss[o],i=l=0,c=d.length;0<=c?l<c:l>c;i=0<=c?++l:--l)a.point_in_poly(_,f,d[i],m[i])&&r.push(o);return p=a.create_hit_test_result(),p["1d"].indices=r,p},e.prototype._get_snap_coord=function(t){var e,r,n,o;for(o=0,e=0,r=t.length;e<r;e++)n=t[e],o+=n;return o/t.length},e.prototype.scx=function(t,e,r){var n,o,i,s,l;if(1===this.renderer.sxss[t].length)return this._get_snap_coord(this.sxs[t]);for(s=this.renderer.sxss[t],l=this.renderer.syss[t],n=o=0,i=s.length;0<=i?o<i:o>i;n=0<=i?++o:--o)if(a.point_in_poly(e,r,s[n],l[n]))return this._get_snap_coord(s[n]);return null},e.prototype.scy=function(t,e,r){var n,o,i,s,l;if(1===this.renderer.syss[t].length)return this._get_snap_coord(this.sys[t]);for(s=this.renderer.sxss[t],l=this.renderer.syss[t],n=o=0,i=s.length;0<=i?o<i:o>i;n=0<=i?++o:--o)if(a.point_in_poly(e,r,s[n],l[n]))return this._get_snap_coord(l[n])},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="Patches",e.coords([["xs","ys"]]),e.mixins(["line","fill"]),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/quad":[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;a=t("underscore"),u=t("rbush"),o=t("./glyph"),n=t("../mappers/categorical_mapper"),l=t("../../common/hittest"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._index_data=function(){var t,e,r,o,i,s,a,l,h,c,p,_,d,f;for(l=function(t,e){return t instanceof n.Model?t.v_map_to_target(e,!0):e},a=l(this.renderer.xmapper,this._left),_=l(this.renderer.xmapper,this._right),f=l(this.renderer.ymapper,this._top),e=l(this.renderer.ymapper,this._bottom),o=u(),h=[],r=i=0,p=a.length;0<=p?i<p:i>p;r=0<=p?++i:--i)s=a[r],c=_[r],d=f[r],t=e[r],!isNaN(s+c+d+t)&&isFinite(s+c+d+t)&&h.push({minX:s,minY:t,maxX:c,maxY:d,i:r});return o.load(h),o},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;for(l=r.sleft,u=r.sright,h=r.stop,a=r.sbottom,s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(l[n]+h[n]+u[n]+a[n])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fillRect(l[n],h[n],u[n]-l[n],a[n]-h[n])),this.visuals.line.doit?(t.beginPath(),t.rect(l[n],h[n],u[n]-l[n],a[n]-h[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,o,i,s,a;return r=[t.vx,t.vy],o=r[0],i=r[1],s=this.renderer.xmapper.map_from_target(o,!0),a=this.renderer.ymapper.map_from_target(i,!0),e=function(){var t,e,r,n;for(r=this.index.search({minX:s,minY:a,maxX:s,maxY:a}),n=[],t=0,e=r.length;t<e;t++)s=r[t],n.push(s.i);return n}.call(this),n=l.create_hit_test_result(),n["1d"].indices=e,n},e.prototype.get_anchor_point=function(t,e,r){var n,o,i,s;switch(o=Math.min(this.sleft[e],this.sright[e]),i=Math.max(this.sright[e],this.sleft[e]),s=Math.min(this.stop[e],this.sbottom[e]),n=Math.max(this.sbottom[e],this.stop[e]),t){case"top_left":return{x:o,y:s};case"top_center":return{x:(o+i)/2,y:s};case"top_right":return{x:i,y:s};case"right_center":return{x:i,y:(s+n)/2};case"bottom_right":return{x:i,y:n};case"bottom_center":return{x:(o+i)/2,y:n};case"bottom_left":return{x:o,y:n};case"left_center":return{x:o,y:(s+n)/2};case"center":return{x:(o+i)/2,y:(s+n)/2}}},e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e}(o.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="Quad",e.coords([["right","bottom"],["left","top"]]),e.mixins(["line","fill"]),e}(o.Model),e.exports={Model:i,View:s}},{"../../common/hittest":"common/hittest","../mappers/categorical_mapper":"models/mappers/categorical_mapper","./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/quadratic":[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;s=t("underscore"),l=t("rbush"),n=t("./glyph"),a=function(t,e,r){var n,o;return e===(t+r)/2?[t,r]:(o=(t-e)/(t-2*e+r),n=t*Math.pow(1-o,2)+2*e*(1-o)*o+r*Math.pow(o,2),[Math.min(t,r,n),Math.max(t,r,n)])},i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._index_data=function(){var t,e,r,n,o,i,s,u,h,c,p;for(e=l(),n=[],t=r=0,o=this._x0.length;0<=o?r<o:r>o;t=0<=o?++r:--r)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx[t]+this._cy[t])||(i=a(this._x0[t],this._cx[t],this._x1[t]),u=i[0],h=i[1],s=a(this._y0[t],this._cy[t],this._y1[t]),c=s[0],p=s[1],n.push({minX:u,minY:c,maxX:h,maxY:p,i:t}));return e.load(n),e},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;if(u=r.sx0,c=r.sy0,h=r.sx1,p=r.sy1,a=r.scx,l=r.scy,this.visuals.line.doit){for(s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(u[n]+c[n]+h[n]+p[n]+a[n]+l[n])||(t.beginPath(),t.moveTo(u[n],c[n]),t.quadraticCurveTo(a[n],l[n],h[n],p[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="Quadratic",e.coords([["x0","y0"],["x1","y1"],["cx","cy"]]),e.mixins(["line"]),e}(n.Model),e.exports={Model:o,View:i}},{"./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/ray":[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;s=t("underscore"),n=t("./glyph"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return this.slength=this.sdist(this.renderer.xmapper,this._x,this._length)},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f;if(_=r.sx,d=r.sy,p=r.slength,n=r._angle,this.visuals.line.doit){for(f=this.renderer.plot_view.frame.get("width"),o=this.renderer.plot_view.frame.get("height"),s=2*(f+o),i=a=0,h=p.length;0<=h?a<h:a>h;i=0<=h?++a:--a)0===p[i]&&(p[i]=s);for(c=[],l=0,u=e.length;l<u;l++)i=e[l],isNaN(_[i]+d[i]+n[i]+p[i])||(t.translate(_[i],d[i]),t.rotate(n[i]),t.beginPath(),t.moveTo(0,0),t.lineTo(p[i],0),this.visuals.line.set_vectorize(t,i),t.stroke(),t.rotate(-n[i]),c.push(t.translate(-_[i],-d[i])));return c}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Ray",e.coords([["x","y"]]),e.mixins(["line"]),e.define({length:[a.DistanceSpec],angle:[a.AngleSpec]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/rect":[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;s=t("underscore"),n=t("./glyph"),a=t("../../common/hittest"),l=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xmapper,this._x,this._width,"center",this.mget("dilate")):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.ymapper,this._y,this._height,"center",this.mget("dilate")):this.sh=this._height},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;if(c=r.sx,p=r.sy,h=r.sw,u=r.sh,n=r._angle,this.visuals.fill.doit)for(i=0,a=e.length;i<a;i++)o=e[i],isNaN(c[o]+p[o]+h[o]+u[o]+n[o])||(this.visuals.fill.set_vectorize(t,o),n[o]?(t.translate(c[o],p[o]),t.rotate(n[o]),t.fillRect(-h[o]/2,-u[o]/2,h[o],u[o]),t.rotate(-n[o]),t.translate(-c[o],-p[o])):t.fillRect(c[o]-h[o]/2,p[o]-u[o]/2,h[o],u[o]));if(this.visuals.line.doit){for(t.beginPath(),s=0,l=e.length;s<l;s++)o=e[s],isNaN(c[o]+p[o]+h[o]+u[o]+n[o])||0!==h[o]&&0!==u[o]&&(n[o]?(t.translate(c[o],p[o]),t.rotate(n[o]),t.rect(-h[o]/2,-u[o]/2,h[o],u[o]),t.rotate(-n[o]),t.translate(-c[o],-p[o])):t.rect(c[o]-h[o]/2,p[o]-u[o]/2,h[o],u[o]),this.visuals.line.set_vectorize(t,o),t.stroke(),t.beginPath());return t.stroke()}},e.prototype._hit_rect=function(t){var e,r,n,o,i,s,l,u,h;return r=this.renderer.xmapper.v_map_from_target([t.vx0,t.vx1],!0),s=r[0],l=r[1],n=this.renderer.ymapper.v_map_from_target([t.vy0,t.vy1],!0),u=n[0],h=n[1],e=a.validate_bbox_coords([s,l],[u,h]),o=a.create_hit_test_result(),o["1d"].indices=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)i=n[t],o.push(i.i);return o}.call(this),o},e.prototype._hit_point=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N;for(_=[t.vx,t.vy],x=_[0],k=_[1],z=this.renderer.xmapper.map_from_target(x,!0),A=this.renderer.ymapper.map_from_target(k,!0),"screen"===this.model.properties.width.units?(w=x-2*this.max_width,M=x+2*this.max_width,d=this.renderer.xmapper.v_map_from_target([w,M],!0),P=d[0],E=d[1]):(P=z-2*this.max_width,E=z+2*this.max_width),"screen"===this.model.properties.height.units?(j=k-2*this.max_height,T=k+2*this.max_height,f=this.renderer.ymapper.v_map_from_target([j,T],!0),C=f[0],N=f[1]):(C=A-2*this.max_height,N=A+2*this.max_height),i=[],e=a.validate_bbox_coords([P,E],[C,N]),m=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)h=n[t],o.push(h.i);return o}.call(this),l=0,u=m.length;l<u;l++)s=m[l],v=this.renderer.plot_view.canvas.vx_to_sx(x),b=this.renderer.plot_view.canvas.vy_to_sy(k),this._angle[s]&&(n=Math.sqrt(Math.pow(v-this.sx[s],2)+Math.pow(b-this.sy[s],2)),y=Math.sin(-this._angle[s]),r=Math.cos(-this._angle[s]),c=r*(v-this.sx[s])-y*(b-this.sy[s])+this.sx[s],p=y*(v-this.sx[s])+r*(b-this.sy[s])+this.sy[s],v=c,b=p),S=Math.abs(this.sx[s]-v)<=this.sw[s]/2,o=Math.abs(this.sy[s]-b)<=this.sh[s]/2,o&&S&&i.push(s);return g=a.create_hit_test_result(),g["1d"].indices=i,g},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="Rect",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({angle:[l.AngleSpec,0],width:[l.DistanceSpec],height:[l.DistanceSpec],dilate:[l.Bool,!1]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/segment":[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;s=t("underscore"),a=t("rbush"),n=t("./glyph"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){var t,e,r,n,o;for(e=a(),n=[],t=r=0,o=this._x0.length;0<=o?r<o:r>o;t=0<=o?++r:--r)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t])||n.push({minX:Math.min(this._x0[t],this._x1[t]),minY:Math.min(this._y0[t],this._y1[t]),maxX:Math.max(this._x0[t],this._x1[t]),maxY:Math.max(this._y0[t],this._y1[t]),i:t});return e.load(n),e},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;if(a=r.sx0,u=r.sy0,l=r.sx1,h=r.sy1,this.visuals.line.doit){for(s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(a[n]+u[n]+l[n]+h[n])||(t.beginPath(),t.moveTo(a[n],u[n]),t.lineTo(l[n],h[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Segment",e.coords([["x0","y0"],["x1","y1"]]),e.mixins(["line"]),e}(n.Model),e.exports={Model:o,View:i}},{"./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/text":[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;s=t("underscore"),n=t("./glyph"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;for(c=r.sx,p=r.sy,i=r._x_offset,s=r._y_offset,n=r._angle,o=r._text,h=[],l=0,u=e.length;l<u;l++)a=e[l],isNaN(c[a]+p[a]+i[a]+s[a]+n[a])||null==o[a]||(this.visuals.text.doit?(t.save(),t.translate(c[a]+i[a],p[a]+s[a]),t.rotate(n[a]),this.visuals.text.set_vectorize(t,a),t.fillText(o[a],0,0),h.push(t.restore())):h.push(void 0));return h},e.prototype.draw_legend=function(t,e,r,n,o){return t.save(),this.text_props.set_value(t),t.font=this.text_props.font_value(),t.font=t.font.replace(/\b[\d\.]+[\w]+\b/,"10pt"),t.textAlign="right",t.textBaseline="middle",t.fillText("text",r,(n+o)/2),t.restore()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Text",e.coords([["x","y"]]),e.mixins(["text"]),e.define({text:[a.StringSpec,{field:"text"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,0],y_offset:[a.NumberSpec,0]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/vbar":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;l=t("underscore"),c=t("rbush"),i=t("./quad"),o=t("./glyph"),n=t("../mappers/categorical_mapper"),u=t("../../common/hittest"),h=t("../../core/properties"),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype._map_data=function(){var t,e,r,n,o;for(this.sx=this.renderer.xmapper.v_map_to_target(this._x),o=this.renderer.ymapper.v_map_to_target(this._top),n=this.renderer.ymapper.v_map_to_target(this._bottom),this.stop=this.plot_view.canvas.v_vy_to_sy(o),this.sbottom=this.plot_view.canvas.v_vy_to_sy(n),this.sleft=[],this.sright=[],this.sw=this.sdist(this.renderer.xmapper,this._x,this._width,"center"),t=e=0,r=this.sx.length;0<=r?e<r:e>r;t=0<=r?++e:--e)this.sleft.push(this.sx[t]-this.sw[t]/2),this.sright.push(this.sx[t]+this.sw[t]/2);return null},e.prototype._index_data=function(){var t,e,r,o,i,s,a,l,u,h,p,_,d,f;for(a=function(t,e){return t instanceof n.Model?t.v_map_to_target(e,!0):e},f=a(this.renderer.xmapper,this._x),d=a(this.renderer.xmapper,this._width),_=a(this.renderer.ymapper,this._top),e=a(this.renderer.ymapper,this._bottom),o=c(),l=[],r=i=0,h=f.length;0<=h?i<h:i>h;r=0<=h?++i:--i)s=f[r]-d[r]/2,u=f[r]+d[r]/2,p=_[r],t=e[r],!isNaN(s+u+p+t)&&isFinite(s+u+p+t)&&l.push({minX:s,minY:t,maxX:u,maxY:p,i:r});return o.load(l),o},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;for(l=r.sleft,u=r.sright,h=r.stop,a=r.sbottom,s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(l[n]+h[n]+u[n]+a[n])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fillRect(l[n],h[n],u[n]-l[n],a[n]-h[n])),this.visuals.line.doit?(t.beginPath(),t.rect(l[n],h[n],u[n]-l[n],a[n]-h[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,o,i,s,a;return r=[t.vx,t.vy],o=r[0],i=r[1],s=this.renderer.xmapper.map_from_target(o,!0),a=this.renderer.ymapper.map_from_target(i,!0),e=function(){var t,e,r,n;for(r=this.index.search({minX:s,minY:a,maxX:s,maxY:a}),n=[],t=0,e=r.length;t<e;t++)s=r[t],n.push(s.i);return n}.call(this),n=u.create_hit_test_result(),n["1d"].indices=e,n},e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e}(o.View),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.default_view=a,e.prototype.type="VBar",e.mixins(["line","fill"]),e.define({x:[h.NumberSpec],width:[h.DistanceSpec],top:[h.NumberSpec],bottom:[h.NumberSpec,0]}),e}(o.Model),e.exports={Model:s,View:a}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../mappers/categorical_mapper":"models/mappers/categorical_mapper","./glyph":"models/glyphs/glyph","./quad":"models/glyphs/quad",rbush:"rbush",underscore:"underscore"}],"models/glyphs/webgl/base":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p;o=t("underscore"),a=t("../../../core/util/color"),l=a.color2rgba,n=function(){function t(t,e){this.gl=t,this.glyph=e,this.nvertices=0,this.size_changed=!1,this.data_changed=!1,this.visuals_changed=!1,this.init()}return t.prototype.GLYPH="",t.prototype.VERT="",t.prototype.FRAG="",t.prototype.set_data_changed=function(t){return t!==this.nvertices&&(this.nvertices=t,this.size_changed=!0),this.data_changed=!0},t.prototype.set_visuals_changed=function(){return this.visuals_changed=!0},t}(),c=function(t){return t<2&&(t=Math.sqrt(2*t)),t},u=function(t,e){var r,n,o,i;for(r=new Float32Array(t),n=o=0,i=t;0<=i?o<i:o>i;n=0<=i?++o:--o)r[n]=e;return r},h=function(t,e,r){var n,o,i,s,a,l,u;for(n=new Float32Array(t*e),o=s=0,l=t;0<=l?s<l:s>l;o=0<=l?++s:--s)for(i=a=0,u=e;0<=u?a<u:a>u;i=0<=u?++a:--a)n[o*e+i]=r[i];return n},p=function(t,e){return!o.isUndefined(t[e].spec.value)},s=function(t,e,r,n,o,i){var s;return o.doit?p(o,i)?(e.used=!1,t.set_attribute(r,"float",o[i].value())):(e.used=!0,s=new Float32Array(o.cache[i+"_array"]),e.set_size(4*n),e.set_data(0,s),t.set_attribute(r,"float",e)):(e.used=!1,t.set_attribute(r,"float",[0]))},i=function(t,e,r,n,o,i){var s,a,h,c,_,d,f,m,g,y,v,b,x;if(y=4,c=i+"_color",a=i+"_alpha",o.doit){if(p(o,c)&&p(o,a))return e.used=!1,x=l(o[c].value(),o[a].value()),t.set_attribute(r,"vec4",x);for(e.used=!0,_=p(o,c)?function(){var t,e,r;for(r=[],d=t=0,e=n;0<=e?t<e:t>e;d=0<=e?++t:--t)r.push(o[c].value());return r}():o.cache[c+"_array"],h=p(o,a)?u(n,o[a].value()):o.cache[a+"_array"],s=new Float32Array(n*y),d=m=0,v=n;0<=v?m<v:m>v;d=0<=v?++m:--m)for(x=l(_[d],h[d]),f=g=0,b=y;0<=b?g<b:g>b;f=0<=b?++g:--g)s[d*y+f]=x[f];return e.set_size(n*y*4),e.set_data(0,s),t.set_attribute(r,"vec4",e)}return e.used=!1,t.set_attribute(r,"vec4",[0,0,0,0])},e.exports={BaseGLGlyph:n,line_width:c,attach_float:s,attach_color:i,color2rgba:l}},{"../../../core/util/color":"core/util/color",underscore:"underscore"}],"models/glyphs/webgl/line":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_=function(t,e){function r(){this.constructor=t}for(var n in e)d.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},d={}.hasOwnProperty;u=t("gloo2"),c=t("../../../core/logging").logger,p=t("./base"),n=p.BaseGLGlyph,h=p.line_width,a=p.attach_float,s=p.attach_color,l=p.color2rgba,o=function(){function t(t){this._atlas={},this._index=0,this._width=256,this._height=256,this.tex=new u.Texture2D(t),this.tex.set_wrapping(t.REPEAT,t.REPEAT),this.tex.set_interpolation(t.NEAREST,t.NEAREST),this.tex.set_size([this._height,this._width],t.RGBA),this.tex.set_data([0,0],[this._height,this._width],new Uint8Array(this._height*this._width*4)),this.get_atlas_data([1])}return t.prototype.get_atlas_data=function(t){var e,r,n,o,i,s;return n=t.join("-"),r=this._atlas[n],void 0===r&&(i=this.make_pattern(t),e=i[0],o=i[1],this.tex.set_data([this._index,0],[1,this._width],new Uint8Array(function(){var t,r,n;for(n=[],t=0,r=e.length;t<r;t++)s=e[t],n.push(s+10);return n}())),this._atlas[n]=[this._index/this._height,o],this._index+=1),this._atlas[n]},t.prototype.make_pattern=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j;for(t.length>1&&t.length%2&&(t=t.concat(t)),m=0,p=0,_=t.length;p<_;p++)w=t[p],m+=w;for(e=[],i=0,u=f=0,v=t.length+2;f<v;u=f+=2)n=Math.max(1e-4,t[u%t.length]),o=Math.max(1e-4,t[(u+1)%t.length]),e.push.apply(e,[i,i+n]),i+=n+o;for(d=this._width,r=new Float32Array(4*d),u=g=0,b=d;0<=b?g<b:g>b;u=0<=b?++g:--g){for(j=m*u/(d-1),h=0,k=1e16,c=y=0,x=e.length;0<=x?y<x:y>x;c=0<=x?++y:--y)M=Math.abs(e[c]-j),M<k&&(h=c,k=M);h%2===0?(l=j<=e[h]?1:0,a=e[h],s=e[h+1]):(l=j>e[h]?-1:0,a=e[h-1],s=e[h]),r[4*u+0]=e[h],r[4*u+1]=l,r[4*u+2]=a,r[4*u+3]=s}return[r,m]},t}(),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return _(e,t),e.prototype.GLYPH="line",e.prototype.JOINS={miter:0,round:1,bevel:2},e.prototype.CAPS={"":0,none:0,".":0,round:1,")":1,"(":1,o:1,"triangle in":2,"<":2,"triangle out":3,">":3,square:4,"[":4,"]":4,"=":4,butt:5,"|":5},e.prototype.VERT="precision mediump float;\n\nconst float PI = 3.14159265358979323846264;\nconst float THETA = 15.0 * 3.14159265358979323846264/180.0;\n\nuniform float u_pixel_ratio;\nuniform vec2 u_canvas_size, u_offset;\nuniform vec2 u_scale_aspect;\nuniform float u_scale_length;\n\nuniform vec4 u_color;\nuniform float u_antialias;\nuniform float u_length;\nuniform float u_linewidth;\nuniform float u_dash_index;\nuniform float u_closed;\n\nattribute vec2 a_position;\nattribute vec4 a_tangents;\nattribute vec2 a_segment;\nattribute vec2 a_angles;\nattribute vec2 a_texcoord;\n\nvarying vec4 v_color;\nvarying vec2 v_segment;\nvarying vec2 v_angles;\nvarying vec2 v_texcoord;\nvarying vec2 v_miter;\nvarying float v_length;\nvarying float v_linewidth;\n\nfloat cross(in vec2 v1, in vec2 v2)\n{\n return v1.x*v2.y - v1.y*v2.x;\n}\n\nfloat signed_distance(in vec2 v1, in vec2 v2, in vec2 v3)\n{\n return cross(v2-v1,v1-v3) / length(v2-v1);\n}\n\nvoid rotate( in vec2 v, in float alpha, out vec2 result )\n{\n float c = cos(alpha);\n float s = sin(alpha);\n result = vec2( c*v.x - s*v.y,\n s*v.x + c*v.y );\n}\n\nvoid main()\n{\n bool closed = (u_closed > 0.0);\n\n // Attributes and uniforms to varyings\n v_color = u_color;\n v_linewidth = u_linewidth;\n v_segment = a_segment * u_scale_length;\n v_length = u_length * u_scale_length;\n\n // Scale to map to pixel coordinates. The original algorithm from the paper\n // assumed isotropic scale. We obviously do not have this.\n vec2 abs_scale_aspect = abs(u_scale_aspect);\n vec2 abs_scale = u_scale_length * abs_scale_aspect;\n\n // Correct angles for aspect ratio\n vec2 av;\n av = vec2(1.0, tan(a_angles.x)) / abs_scale_aspect;\n v_angles.x = atan(av.y, av.x);\n av = vec2(1.0, tan(a_angles.y)) / abs_scale_aspect;\n v_angles.y = atan(av.y, av.x);\n\n // Thickness below 1 pixel are represented using a 1 pixel thickness\n // and a modified alpha\n v_color.a = min(v_linewidth, v_color.a);\n v_linewidth = max(v_linewidth, 1.0);\n\n // If color is fully transparent we just will discard the fragment anyway\n if( v_color.a <= 0.0 ) {\n gl_Position = vec4(0.0,0.0,0.0,1.0);\n return;\n }\n\n // This is the actual half width of the line\n float w = ceil(u_antialias+v_linewidth)/2.0;\n\n vec2 position = (a_position + u_offset) * abs_scale;\n\n vec2 t1 = normalize(a_tangents.xy * abs_scale_aspect); // note the scaling for aspect ratio here\n vec2 t2 = normalize(a_tangents.zw * abs_scale_aspect);\n float u = a_texcoord.x;\n float v = a_texcoord.y;\n vec2 o1 = vec2( +t1.y, -t1.x);\n vec2 o2 = vec2( +t2.y, -t2.x);\n\n // This is a join\n // ----------------------------------------------------------------\n if( t1 != t2 ) {\n float angle = atan (t1.x*t2.y-t1.y*t2.x, t1.x*t2.x+t1.y*t2.y); // Angle needs recalculation for some reason\n vec2 t = normalize(t1+t2);\n vec2 o = vec2( + t.y, - t.x);\n\n if ( u_dash_index > 0.0 )\n {\n // Broken angle\n // ----------------------------------------------------------------\n if( (abs(angle) > THETA) ) {\n position += v * w * o / cos(angle/2.0);\n float s = sign(angle);\n if( angle < 0.0 ) {\n if( u == +1.0 ) {\n u = v_segment.y + v * w * tan(angle/2.0);\n if( v == 1.0 ) {\n position -= 2.0 * w * t1 / sin(angle);\n u -= 2.0 * w / sin(angle);\n }\n } else {\n u = v_segment.x - v * w * tan(angle/2.0);\n if( v == 1.0 ) {\n position += 2.0 * w * t2 / sin(angle);\n u += 2.0*w / sin(angle);\n }\n }\n } else {\n if( u == +1.0 ) {\n u = v_segment.y + v * w * tan(angle/2.0);\n if( v == -1.0 ) {\n position += 2.0 * w * t1 / sin(angle);\n u += 2.0 * w / sin(angle);\n }\n } else {\n u = v_segment.x - v * w * tan(angle/2.0);\n if( v == -1.0 ) {\n position -= 2.0 * w * t2 / sin(angle);\n u -= 2.0*w / sin(angle);\n }\n }\n }\n // Continuous angle\n // ------------------------------------------------------------\n } else {\n position += v * w * o / cos(angle/2.0);\n if( u == +1.0 ) u = v_segment.y;\n else u = v_segment.x;\n }\n }\n\n // Solid line\n // --------------------------------------------------------------------\n else\n {\n position.xy += v * w * o / cos(angle/2.0);\n if( angle < 0.0 ) {\n if( u == +1.0 ) {\n u = v_segment.y + v * w * tan(angle/2.0);\n } else {\n u = v_segment.x - v * w * tan(angle/2.0);\n }\n } else {\n if( u == +1.0 ) {\n u = v_segment.y + v * w * tan(angle/2.0);\n } else {\n u = v_segment.x - v * w * tan(angle/2.0);\n }\n }\n }\n\n // This is a line start or end (t1 == t2)\n // ------------------------------------------------------------------------\n } else {\n position += v * w * o1;\n if( u == -1.0 ) {\n u = v_segment.x - w;\n position -= w * t1;\n } else {\n u = v_segment.y + w;\n position += w * t2;\n }\n }\n\n // Miter distance\n // ------------------------------------------------------------------------\n vec2 t;\n vec2 curr = a_position * abs_scale;\n if( a_texcoord.x < 0.0 ) {\n vec2 next = curr + t2*(v_segment.y-v_segment.x);\n\n rotate( t1, +v_angles.x/2.0, t);\n v_miter.x = signed_distance(curr, curr+t, position);\n\n rotate( t2, +v_angles.y/2.0, t);\n v_miter.y = signed_distance(next, next+t, position);\n } else {\n vec2 prev = curr - t1*(v_segment.y-v_segment.x);\n\n rotate( t1, -v_angles.x/2.0,t);\n v_miter.x = signed_distance(prev, prev+t, position);\n\n rotate( t2, -v_angles.y/2.0,t);\n v_miter.y = signed_distance(curr, curr+t, position);\n }\n\n if (!closed && v_segment.x <= 0.0) {\n v_miter.x = 1e10;\n }\n if (!closed && v_segment.y >= v_length)\n {\n v_miter.y = 1e10;\n }\n\n v_texcoord = vec2( u, v*w );\n\n // Calculate position in device coordinates. Note that we\n // already scaled with abs scale above.\n vec2 normpos = position * sign(u_scale_aspect);\n normpos += 0.5; // make up for Bokeh's offset\n normpos /= u_canvas_size / u_pixel_ratio; // in 0..1\n gl_Position = vec4(normpos*2.0-1.0, 0.0, 1.0);\n gl_Position.y *= -1.0;\n}\n",e.prototype.FRAG_="// Fragment shader that can be convenient during debugging to show the line skeleton.\nprecision mediump float;\nuniform vec4 u_color;\nvoid main () {\n gl_FragColor = u_color;\n}",e.prototype.FRAG="precision mediump float;\n\nconst float PI = 3.14159265358979323846264;\nconst float THETA = 15.0 * 3.14159265358979323846264/180.0;\n\nuniform sampler2D u_dash_atlas;\n\nuniform vec2 u_linecaps;\nuniform float u_miter_limit;\nuniform float u_linejoin;\nuniform float u_antialias;\nuniform float u_dash_phase;\nuniform float u_dash_period;\nuniform float u_dash_index;\nuniform vec2 u_dash_caps;\nuniform float u_closed;\n\nvarying vec4 v_color;\nvarying vec2 v_segment;\nvarying vec2 v_angles;\nvarying vec2 v_texcoord;\nvarying vec2 v_miter;\nvarying float v_length;\nvarying float v_linewidth;\n\n// Compute distance to cap ----------------------------------------------------\nfloat cap( int type, float dx, float dy, float t, float linewidth )\n{\n float d = 0.0;\n dx = abs(dx);\n dy = abs(dy);\n if (type == 0) discard; // None\n else if (type == 1) d = sqrt(dx*dx+dy*dy); // Round\n else if (type == 3) d = (dx+abs(dy)); // Triangle in\n else if (type == 2) d = max(abs(dy),(t+dx-abs(dy))); // Triangle out\n else if (type == 4) d = max(dx,dy); // Square\n else if (type == 5) d = max(dx+t,dy); // Butt\n return d;\n}\n\n// Compute distance to join -------------------------------------------------\nfloat join( in int type, in float d, in vec2 segment, in vec2 texcoord, in vec2 miter,\n in float linewidth )\n{\n // texcoord.x is distance from start\n // texcoord.y is distance from centerline\n // segment.x and y indicate the limits (as for texcoord.x) for this segment\n\n float dx = texcoord.x;\n\n // Round join\n if( type == 1 ) {\n if (dx < segment.x) {\n d = max(d,length( texcoord - vec2(segment.x,0.0)));\n //d = length( texcoord - vec2(segment.x,0.0));\n } else if (dx > segment.y) {\n d = max(d,length( texcoord - vec2(segment.y,0.0)));\n //d = length( texcoord - vec2(segment.y,0.0));\n }\n }\n // Bevel join\n else if ( type == 2 ) {\n if (dx < segment.x) {\n vec2 x = texcoord - vec2(segment.x,0.0);\n d = max(d, max(abs(x.x), abs(x.y)));\n\n } else if (dx > segment.y) {\n vec2 x = texcoord - vec2(segment.y,0.0);\n d = max(d, max(abs(x.x), abs(x.y)));\n }\n /* Original code for bevel which does not work for us\n if( (dx < segment.x) || (dx > segment.y) )\n d = max(d, min(abs(x.x),abs(x.y)));\n */\n }\n\n return d;\n}\n\nvoid main()\n{\n // If color is fully transparent we just discard the fragment\n if( v_color.a <= 0.0 ) {\n discard;\n }\n\n // Test if dash pattern is the solid one (0)\n bool solid = (u_dash_index == 0.0);\n\n // Test if path is closed\n bool closed = (u_closed > 0.0);\n\n vec4 color = v_color;\n float dx = v_texcoord.x;\n float dy = v_texcoord.y;\n float t = v_linewidth/2.0-u_antialias;\n float width = 1.0; //v_linewidth; original code had dashes scale with line width, we do not\n float d = 0.0;\n\n vec2 linecaps = u_linecaps;\n vec2 dash_caps = u_dash_caps;\n float line_start = 0.0;\n float line_stop = v_length;\n\n // Apply miter limit; fragments too far into the miter are simply discarded\n if( (dx < v_segment.x) || (dx > v_segment.y) ) {\n float into_miter = max(v_segment.x - dx, dx - v_segment.y);\n if (into_miter > u_miter_limit*v_linewidth/2.0)\n discard;\n }\n\n // Solid line --------------------------------------------------------------\n if( solid ) {\n d = abs(dy);\n if( (!closed) && (dx < line_start) ) {\n d = cap( int(u_linecaps.x), abs(dx), abs(dy), t, v_linewidth );\n }\n else if( (!closed) && (dx > line_stop) ) {\n d = cap( int(u_linecaps.y), abs(dx)-line_stop, abs(dy), t, v_linewidth );\n }\n else {\n d = join( int(u_linejoin), abs(dy), v_segment, v_texcoord, v_miter, v_linewidth );\n }\n\n // Dash line --------------------------------------------------------------\n } else {\n float segment_start = v_segment.x;\n float segment_stop = v_segment.y;\n float segment_center= (segment_start+segment_stop)/2.0;\n float freq = u_dash_period*width;\n float u = mod( dx + u_dash_phase*width, freq);\n vec4 tex = texture2D(u_dash_atlas, vec2(u/freq, u_dash_index)) * 255.0 -10.0; // conversion to int-like\n float dash_center= tex.x * width;\n float dash_type = tex.y;\n float _start = tex.z * width;\n float _stop = tex.a * width;\n float dash_start = dx - u + _start;\n float dash_stop = dx - u + _stop;\n\n // Compute extents of the first dash (the one relative to v_segment.x)\n // Note: this could be computed in the vertex shader\n if( (dash_stop < segment_start) && (dash_caps.x != 5.0) ) {\n float u = mod(segment_start + u_dash_phase*width, freq);\n vec4 tex = texture2D(u_dash_atlas, vec2(u/freq, u_dash_index)) * 255.0 -10.0; // conversion to int-like\n dash_center= tex.x * width;\n //dash_type = tex.y;\n float _start = tex.z * width;\n float _stop = tex.a * width;\n dash_start = segment_start - u + _start;\n dash_stop = segment_start - u + _stop;\n }\n\n // Compute extents of the last dash (the one relatives to v_segment.y)\n // Note: This could be computed in the vertex shader\n else if( (dash_start > segment_stop) && (dash_caps.y != 5.0) ) {\n float u = mod(segment_stop + u_dash_phase*width, freq);\n vec4 tex = texture2D(u_dash_atlas, vec2(u/freq, u_dash_index)) * 255.0 -10.0; // conversion to int-like\n dash_center= tex.x * width;\n //dash_type = tex.y;\n float _start = tex.z * width;\n float _stop = tex.a * width;\n dash_start = segment_stop - u + _start;\n dash_stop = segment_stop - u + _stop;\n }\n\n // This test if the we are dealing with a discontinuous angle\n bool discontinuous = ((dx < segment_center) && abs(v_angles.x) > THETA) ||\n ((dx >= segment_center) && abs(v_angles.y) > THETA);\n //if( dx < line_start) discontinuous = false;\n //if( dx > line_stop) discontinuous = false;\n\n float d_join = join( int(u_linejoin), abs(dy),\n v_segment, v_texcoord, v_miter, v_linewidth );\n\n // When path is closed, we do not have room for linecaps, so we make room\n // by shortening the total length\n if (closed) {\n line_start += v_linewidth/2.0;\n line_stop -= v_linewidth/2.0;\n }\n\n // We also need to take antialias area into account\n //line_start += u_antialias;\n //line_stop -= u_antialias;\n\n // Check is dash stop is before line start\n if( dash_stop <= line_start ) {\n discard;\n }\n // Check is dash start is beyond line stop\n if( dash_start >= line_stop ) {\n discard;\n }\n\n // Check if current dash start is beyond segment stop\n if( discontinuous ) {\n // Dash start is beyond segment, we discard\n if( (dash_start > segment_stop) ) {\n discard;\n //gl_FragColor = vec4(1.0,0.0,0.0,.25); return;\n }\n\n // Dash stop is before segment, we discard\n if( (dash_stop < segment_start) ) {\n discard; //gl_FragColor = vec4(0.0,1.0,0.0,.25); return;\n }\n\n // Special case for round caps (nicer with this)\n if( dash_caps.x == 1.0 ) {\n if( (u > _stop) && (dash_stop > segment_stop ) && (abs(v_angles.y) < PI/2.0)) {\n discard;\n }\n }\n\n // Special case for round caps (nicer with this)\n if( dash_caps.y == 1.0 ) {\n if( (u < _start) && (dash_start < segment_start ) && (abs(v_angles.x) < PI/2.0)) {\n discard;\n }\n }\n\n // Special case for triangle caps (in & out) and square\n // We make sure the cap stop at crossing frontier\n if( (dash_caps.x != 1.0) && (dash_caps.x != 5.0) ) {\n if( (dash_start < segment_start ) && (abs(v_angles.x) < PI/2.0) ) {\n float a = v_angles.x/2.0;\n float x = (segment_start-dx)*cos(a) - dy*sin(a);\n float y = (segment_start-dx)*sin(a) + dy*cos(a);\n if( x > 0.0 ) discard;\n // We transform the cap into square to avoid holes\n dash_caps.x = 4.0;\n }\n }\n\n // Special case for triangle caps (in & out) and square\n // We make sure the cap stop at crossing frontier\n if( (dash_caps.y != 1.0) && (dash_caps.y != 5.0) ) {\n if( (dash_stop > segment_stop ) && (abs(v_angles.y) < PI/2.0) ) {\n float a = v_angles.y/2.0;\n float x = (dx-segment_stop)*cos(a) - dy*sin(a);\n float y = (dx-segment_stop)*sin(a) + dy*cos(a);\n if( x > 0.0 ) discard;\n // We transform the caps into square to avoid holes\n dash_caps.y = 4.0;\n }\n }\n }\n\n // Line cap at start\n if( (dx < line_start) && (dash_start < line_start) && (dash_stop > line_start) ) {\n d = cap( int(linecaps.x), dx-line_start, dy, t, v_linewidth);\n }\n // Line cap at stop\n else if( (dx > line_stop) && (dash_stop > line_stop) && (dash_start < line_stop) ) {\n d = cap( int(linecaps.y), dx-line_stop, dy, t, v_linewidth);\n }\n // Dash cap left - dash_type = -1, 0 or 1, but there may be roundoff errors\n else if( dash_type < -0.5 ) {\n d = cap( int(dash_caps.y), abs(u-dash_center), dy, t, v_linewidth);\n if( (dx > line_start) && (dx < line_stop) )\n d = max(d,d_join);\n }\n // Dash cap right\n else if( dash_type > 0.5 ) {\n d = cap( int(dash_caps.x), abs(dash_center-u), dy, t, v_linewidth);\n if( (dx > line_start) && (dx < line_stop) )\n d = max(d,d_join);\n }\n // Dash body (plain)\n else {// if( dash_type > -0.5 && dash_type < 0.5) {\n d = abs(dy);\n }\n\n // Line join\n if( (dx > line_start) && (dx < line_stop)) {\n if( (dx <= segment_start) && (dash_start <= segment_start)\n && (dash_stop >= segment_start) ) {\n d = d_join;\n // Antialias at outer border\n float angle = PI/2.+v_angles.x;\n float f = abs( (segment_start - dx)*cos(angle) - dy*sin(angle));\n d = max(f,d);\n }\n else if( (dx > segment_stop) && (dash_start <= segment_stop)\n && (dash_stop >= segment_stop) ) {\n d = d_join;\n // Antialias at outer border\n float angle = PI/2.+v_angles.y;\n float f = abs((dx - segment_stop)*cos(angle) - dy*sin(angle));\n d = max(f,d);\n }\n else if( dx < (segment_start - v_linewidth/2.)) {\n discard;\n }\n else if( dx > (segment_stop + v_linewidth/2.)) {\n discard;\n }\n }\n else if( dx < (segment_start - v_linewidth/2.)) {\n discard;\n }\n else if( dx > (segment_stop + v_linewidth/2.)) {\n discard;\n }\n }\n\n // Distance to border ------------------------------------------------------\n d = d - t;\n if( d < 0.0 ) {\n gl_FragColor = color;\n } else {\n d /= u_antialias;\n gl_FragColor = vec4(color.rgb, exp(-d*d)*color.a);\n }\n}",e.prototype.init=function(){var t;return t=this.gl,this._scale_aspect=0,this.prog=new u.Program(t),this.prog.set_shaders(this.VERT,this.FRAG),this.index_buffer=new u.IndexBuffer(t),this.vbo_position=new u.VertexBuffer(t),this.vbo_tangents=new u.VertexBuffer(t),this.vbo_segment=new u.VertexBuffer(t),this.vbo_angles=new u.VertexBuffer(t),this.vbo_texcoord=new u.VertexBuffer(t),this.dash_atlas=new o(t)},e.prototype.draw=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w;if(u=e.glglyph,u.data_changed){if(!isFinite(r.dx)||!isFinite(r.dy))return;u._baked_offset=[r.dx,r.dy],u._set_data(),u.data_changed=!1}if(this.visuals_changed&&(this._set_visuals(),this.visuals_changed=!1),v=r.sx,b=r.sy,y=Math.sqrt(v*v+b*b),v/=y,b/=y,Math.abs(this._scale_aspect-b/v)>Math.abs(.001*this._scale_aspect)&&(u._update_scale(v,b),this._scale_aspect=b/v),this.prog.set_attribute("a_position","vec2",u.vbo_position),this.prog.set_attribute("a_tangents","vec4",u.vbo_tangents),this.prog.set_attribute("a_segment","vec2",u.vbo_segment),this.prog.set_attribute("a_angles","vec2",u.vbo_angles),this.prog.set_attribute("a_texcoord","vec2",u.vbo_texcoord),this.prog.set_uniform("u_length","float",[u.cumsum]),this.prog.set_texture("u_dash_atlas",this.dash_atlas.tex),n=u._baked_offset,this.prog.set_uniform("u_pixel_ratio","float",[r.pixel_ratio]),this.prog.set_uniform("u_canvas_size","vec2",[r.width,r.height]),this.prog.set_uniform("u_offset","vec2",[r.dx-n[0],r.dy-n[1]]),this.prog.set_uniform("u_scale_aspect","vec2",[v,b]),this.prog.set_uniform("u_scale_length","float",[y]),this.I_triangles=u.I_triangles,this.I_triangles.length<65535)return this.index_buffer.set_size(2*this.I_triangles.length),this.index_buffer.set_data(0,new Uint16Array(this.I_triangles)),this.prog.draw(this.gl.TRIANGLES,this.index_buffer);for(t=this.I_triangles,h=this.I_triangles.length,s=64008,i=[],a=l=0,d=Math.ceil(h/s);0<=d?l<d:l>d;a=0<=d?++l:--l)i.push([]);for(a=p=0,f=t.length;0<=f?p<f:p>f;a=0<=f?++p:--p)w=t[a]%s,o=Math.floor(t[a]/s),i[o].push(w);for(g=[],o=_=0,m=i.length;0<=m?_<m:_>m;o=0<=m?++_:--_)x=new Uint16Array(i[o]),c=o*s*4,0!==x.length&&(this.prog.set_attribute("a_position","vec2",u.vbo_position,0,2*c),this.prog.set_attribute("a_tangents","vec4",u.vbo_tangents,0,4*c),this.prog.set_attribute("a_segment","vec2",u.vbo_segment,0,2*c),
this.prog.set_attribute("a_angles","vec2",u.vbo_angles,0,2*c),this.prog.set_attribute("a_texcoord","vec2",u.vbo_texcoord,0,2*c),this.index_buffer.set_size(2*x.length),this.index_buffer.set_data(0,x),g.push(this.prog.draw(this.gl.TRIANGLES,this.index_buffer)));return g},e.prototype._set_data=function(){return this._bake(),this.vbo_position.set_size(4*this.V_position.length),this.vbo_position.set_data(0,this.V_position),this.vbo_tangents.set_size(4*this.V_tangents.length),this.vbo_tangents.set_data(0,this.V_tangents),this.vbo_angles.set_size(4*this.V_angles.length),this.vbo_angles.set_data(0,this.V_angles),this.vbo_texcoord.set_size(4*this.V_texcoord.length),this.vbo_texcoord.set_data(0,this.V_texcoord)},e.prototype._set_visuals=function(){var t,e,r,n,o,i,s;return e=l(this.glyph.visuals.line.line_color.value(),this.glyph.visuals.line.line_alpha.value()),t=this.CAPS[this.glyph.visuals.line.line_cap.value()],i=this.JOINS[this.glyph.visuals.line.line_join.value()],this.prog.set_uniform("u_color","vec4",e),this.prog.set_uniform("u_linewidth","float",[this.glyph.visuals.line.line_width.value()]),this.prog.set_uniform("u_antialias","float",[.9]),this.prog.set_uniform("u_linecaps","vec2",[t,t]),this.prog.set_uniform("u_linejoin","float",[i]),this.prog.set_uniform("u_miter_limit","float",[10]),n=this.glyph.visuals.line.line_dash.value(),r=0,o=1,n.length&&(s=this.dash_atlas.get_atlas_data(n),r=s[0],o=s[1]),this.prog.set_uniform("u_dash_index","float",[r]),this.prog.set_uniform("u_dash_phase","float",[this.glyph.visuals.line.line_dash_offset.value()]),this.prog.set_uniform("u_dash_period","float",[o]),this.prog.set_uniform("u_dash_caps","vec2",[t,t]),this.prog.set_uniform("u_closed","float",[0])},e.prototype._bake=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F,B,L;for(x=this.nvertices,_=new Float64Array(this.glyph._x),d=new Float64Array(this.glyph._y),i=c=new Float32Array(2*x),n=new Float32Array(2*x),a=p=new Float32Array(4*x),u=new Float32Array(2*x),m=v=0,S=x;0<=S?v<S:v>S;m=0<=S?++v:--v)i[2*m+0]=_[m]+this._baked_offset[0],i[2*m+1]=d[m]+this._baked_offset[1];for(this.tangents=r=new Float32Array(2*x-2),m=k=0,z=x-1;0<=z?k<z:k>z;m=0<=z?++k:--k)r[2*m+0]=c[2*(m+1)+0]-c[2*m+0],r[2*m+1]=c[2*(m+1)+1]-c[2*m+1];for(m=j=0,P=x-1;0<=P?j<P:j>P;m=0<=P?++j:--j)a[4*(m+1)+0]=r[2*m+0],a[4*(m+1)+1]=r[2*m+1],a[4*m+2]=r[2*m+0],a[4*m+3]=r[2*m+1];for(a[0]=r[0],a[1]=r[1],a[4*(x-1)+2]=r[2*(x-2)+0],a[4*(x-1)+3]=r[2*(x-2)+1],t=new Float32Array(x),m=T=0,E=x;0<=E?T<E:T>E;m=0<=E?++T:--T)t[m]=Math.atan2(p[4*m+0]*p[4*m+3]-p[4*m+1]*p[4*m+2],p[4*m+0]*p[4*m+2]+p[4*m+1]*p[4*m+3]);for(m=D=0,A=x-1;0<=A?D<A:D>A;m=0<=A?++D:--D)n[2*m+0]=t[m],n[2*m+1]=t[m+1];for(b=4*x-4,this.V_position=s=new Float32Array(2*b),this.V_angles=o=new Float32Array(2*b),this.V_tangents=l=new Float32Array(4*b),this.V_texcoord=h=new Float32Array(2*b),M=2,m=I=0,C=x;0<=C?I<C:I>C;m=0<=C?++I:--I)for(g=R=0;R<4;g=++R){for(y=F=0;F<2;y=++F)s[2*(4*m+g-M)+y]=i[2*m+y],o[2*(4*m+g)+y]=n[2*m+y];for(y=B=0;B<4;y=++B)l[4*(4*m+g-M)+y]=a[4*m+y]}for(m=L=0,N=x;0<=N?L<=N:L>=N;m=0<=N?++L:--L)h[2*(4*m+0)+0]=-1,h[2*(4*m+1)+0]=-1,h[2*(4*m+2)+0]=1,h[2*(4*m+3)+0]=1,h[2*(4*m+0)+1]=-1,h[2*(4*m+1)+1]=1,h[2*(4*m+2)+1]=-1,h[2*(4*m+3)+1]=1;for(w=6*(x-1),this.I_triangles=e=new Uint32Array(w),q=[],m=f=0,O=x;0<=O?f<O:f>O;m=0<=O?++f:--f)e[6*m+0]=0+4*m,e[6*m+1]=1+4*m,e[6*m+2]=3+4*m,e[6*m+3]=2+4*m,e[6*m+4]=0+4*m,q.push(e[6*m+5]=3+4*m);return q},e.prototype._update_scale=function(t,e){var r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v;for(p=this.nvertices,c=4*p-4,n=this.tangents,r=new Float32Array(p-1),o=new Float32Array(2*p),this.V_segment=i=new Float32Array(2*c),a=h=0,m=p-1;0<=m?h<m:h>m;a=0<=m?++h:--h)r[a]=Math.sqrt(Math.pow(n[2*a+0]*t,2)+Math.pow(n[2*a+1]*e,2));for(s=0,a=_=0,g=p-1;0<=g?_<g:_>g;a=0<=g?++_:--_)s+=r[a],o[2*(a+1)+0]=s,o[2*a+1]=s;for(a=d=0,y=p;0<=y?d<y:d>y;a=0<=y?++d:--d)for(l=f=0;f<4;l=++f)for(u=v=0;v<2;u=++v)i[2*(4*a+l)+u]=o[2*a+u];return this.cumsum=s,this.vbo_segment.set_size(4*this.V_segment.length),this.vbo_segment.set_data(0,this.V_segment)},e}(n),e.exports={LineGLGlyph:i}},{"../../../core/logging":"core/logging","./base":"models/glyphs/webgl/base",gloo2:"gloo2"}],"models/glyphs/webgl/main":[function(t,e,r){var n,o;n=t("./line"),o=t("./markers"),e.exports={LineGLGlyph:n.LineGLGlyph,CircleGLGlyph:o.CircleGLGlyph,SquareGLGlyph:o.SquareGLGlyph,AnnulusGLGlyph:o.AnnulusGLGlyph,DiamondGLGlyph:o.DiamondGLGlyph,TriangleGLGlyph:o.TriangleGLGlyph,InvertedTriangleGLGlyph:o.InvertedTriangleGLGlyph,CrossGLGlyph:o.CrossGLGlyph,CircleCrossGLGlyph:o.CircleCrossGLGlyph,SquareCrossGLGlyph:o.SquareCrossGLGlyph,DiamondCrossGLGlyph:o.DiamondCrossGLGlyph,XGLGlyph:o.XGLGlyph,CircleXGLGlyph:o.CircleXGLGlyph,SquareXGLGlyph:o.SquareXGLGlyph,AsteriskGLGlyph:o.AsteriskGLGlyph}},{"./line":"models/glyphs/webgl/line","./markers":"models/glyphs/webgl/markers"}],"models/glyphs/webgl/markers":[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;x=t("gloo2"),M=t("../../../core/logging").logger,k=t("./base"),i=k.BaseGLGlyph,w=k.line_width,b=k.attach_float,v=k.attach_color,_=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.VERT="precision mediump float;\nconst float SQRT_2 = 1.4142135623730951;\n//\nuniform float u_pixel_ratio;\nuniform vec2 u_canvas_size;\nuniform vec2 u_offset;\nuniform vec2 u_scale;\nuniform float u_antialias;\n//\nattribute float a_x;\nattribute float a_y;\nattribute float a_size;\nattribute float a_angle; // in radians\nattribute float a_linewidth;\nattribute vec4 a_fg_color;\nattribute vec4 a_bg_color;\n//\nvarying float v_linewidth;\nvarying float v_size;\nvarying vec4 v_fg_color;\nvarying vec4 v_bg_color;\nvarying vec2 v_rotation;\n\nvoid main (void)\n{\n v_size = a_size * u_pixel_ratio;\n v_linewidth = a_linewidth * u_pixel_ratio;\n v_fg_color = a_fg_color;\n v_bg_color = a_bg_color;\n v_rotation = vec2(cos(-a_angle), sin(-a_angle));\n // Calculate position - the -0.5 is to correct for canvas origin\n vec2 pos = (vec2(a_x, a_y) + u_offset) * u_scale; // in pixels\n pos += 0.5; // make up for Bokeh's offset\n pos /= u_canvas_size / u_pixel_ratio; // in 0..1\n gl_Position = vec4(pos*2.0-1.0, 0.0, 1.0);\n gl_Position.y *= -1.0;\n gl_PointSize = SQRT_2 * v_size + 2.0 * (v_linewidth + 1.5*u_antialias);\n}",e.prototype.FRAG="precision mediump float;\nconst float SQRT_2 = 1.4142135623730951;\nconst float PI = 3.14159265358979323846264;\n//\nuniform float u_antialias;\n//\nvarying vec4 v_fg_color;\nvarying vec4 v_bg_color;\nvarying float v_linewidth;\nvarying float v_size;\nvarying vec2 v_rotation;\n\nMARKERCODE\n\nvec4 outline(float distance, float linewidth, float antialias, vec4 fg_color, vec4 bg_color)\n{\n vec4 frag_color;\n float t = linewidth/2.0 - antialias;\n float signed_distance = distance;\n float border_distance = abs(signed_distance) - t;\n float alpha = border_distance/antialias;\n alpha = exp(-alpha*alpha);\n\n // If fg alpha is zero, it probably means no outline. To avoid a dark outline\n // shining through due to aa, we set the fg color to the bg color. Avoid if (i.e. branching).\n float select = float(bool(fg_color.a));\n fg_color.rgb = select * fg_color.rgb + (1.0 - select) * bg_color.rgb;\n // Similarly, if we want a transparent bg\n select = float(bool(bg_color.a));\n bg_color.rgb = select * bg_color.rgb + (1.0 - select) * fg_color.rgb;\n\n if( border_distance < 0.0)\n frag_color = fg_color;\n else if( signed_distance < 0.0 ) {\n frag_color = mix(bg_color, fg_color, sqrt(alpha));\n } else {\n if( abs(signed_distance) < (linewidth/2.0 + antialias) ) {\n frag_color = vec4(fg_color.rgb, fg_color.a * alpha);\n } else {\n discard;\n }\n }\n return frag_color;\n}\n\nvoid main()\n{\n vec2 P = gl_PointCoord.xy - vec2(0.5, 0.5);\n P = vec2(v_rotation.x*P.x - v_rotation.y*P.y,\n v_rotation.y*P.x + v_rotation.x*P.y);\n float point_size = SQRT_2*v_size + 2.0 * (v_linewidth + 1.5*u_antialias);\n float distance = marker(P*point_size, v_size);\n gl_FragColor = outline(distance, v_linewidth, u_antialias, v_fg_color, v_bg_color);\n //gl_FragColor.rgb *= gl_FragColor.a; // pre-multiply alpha\n}",e.prototype.MARKERCODE="<defined in subclasses>",e.prototype.init=function(){var t,e;return e=this.gl,t=this.FRAG.replace(/MARKERCODE/,this.MARKERCODE),this.last_trans={},this.prog=new x.Program(e),this.prog.set_shaders(this.VERT,t),this.vbo_x=new x.VertexBuffer(e),this.prog.set_attribute("a_x","float",this.vbo_x),this.vbo_y=new x.VertexBuffer(e),this.prog.set_attribute("a_y","float",this.vbo_y),this.vbo_s=new x.VertexBuffer(e),this.prog.set_attribute("a_size","float",this.vbo_s),this.vbo_a=new x.VertexBuffer(e),this.prog.set_attribute("a_angle","float",this.vbo_a),this.vbo_linewidth=new x.VertexBuffer(e),this.vbo_fg_color=new x.VertexBuffer(e),this.vbo_bg_color=new x.VertexBuffer(e),this.index_buffer=new x.IndexBuffer(e)},e.prototype.draw=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x;if(c=e.glglyph,p=c.nvertices,c.data_changed){if(!isFinite(r.dx)||!isFinite(r.dy))return;c._baked_offset=[r.dx,r.dy],c._set_data(p),c.data_changed=!1}else null==this.glyph._radius||r.sx===this.last_trans.sx&&r.sy===this.last_trans.sy||(this.last_trans=r,this.vbo_s.set_data(0,new Float32Array(function(){var t,e,r,n;for(r=this.glyph.sradius,n=[],t=0,e=r.length;t<e;t++)y=r[t],n.push(2*y);return n}.call(this))));if(this.visuals_changed&&(this._set_visuals(p),this.visuals_changed=!1),n=c._baked_offset,this.prog.set_uniform("u_pixel_ratio","float",[r.pixel_ratio]),this.prog.set_uniform("u_canvas_size","vec2",[r.width,r.height]),this.prog.set_uniform("u_offset","vec2",[r.dx-n[0],r.dy-n[1]]),this.prog.set_uniform("u_scale","vec2",[r.sx,r.sy]),this.prog.set_attribute("a_x","float",c.vbo_x),this.prog.set_attribute("a_y","float",c.vbo_y),this.prog.set_attribute("a_size","float",c.vbo_s),this.prog.set_attribute("a_angle","float",c.vbo_a),0!==t.length){if(t.length===p)return this.prog.draw(this.gl.POINTS,[0,p]);if(p<65535)return b=window.navigator.userAgent,b.indexOf("MSIE ")+b.indexOf("Trident/")+b.indexOf("Edge/")>0&&M.warn("WebGL warning: IE is known to produce 1px sprites whith selections."),this.index_buffer.set_size(2*t.length),this.index_buffer.set_data(0,new Uint16Array(t)),this.prog.draw(this.gl.POINTS,this.index_buffer);for(s=64e3,i=[],a=l=0,d=Math.ceil(p/s);0<=d?l<d:l>d;a=0<=d?++l:--l)i.push([]);for(a=u=0,f=t.length;0<=f?u<f:u>f;a=0<=f?++u:--u)x=t[a]%s,o=Math.floor(t[a]/s),i[o].push(x);for(g=[],o=h=0,m=i.length;0<=m?h<m:h>m;o=0<=m?++h:--h)v=new Uint16Array(i[o]),_=o*s*4,0!==v.length&&(this.prog.set_attribute("a_x","float",c.vbo_x,0,_),this.prog.set_attribute("a_y","float",c.vbo_y,0,_),this.prog.set_attribute("a_size","float",c.vbo_s,0,_),this.prog.set_attribute("a_angle","float",c.vbo_a,0,_),this.vbo_linewidth.used&&this.prog.set_attribute("a_linewidth","float",this.vbo_linewidth,0,_),this.vbo_fg_color.used&&this.prog.set_attribute("a_fg_color","vec4",this.vbo_fg_color,0,4*_),this.vbo_bg_color.used&&this.prog.set_attribute("a_bg_color","vec4",this.vbo_bg_color,0,4*_),this.index_buffer.set_size(2*v.length),this.index_buffer.set_data(0,v),g.push(this.prog.draw(this.gl.POINTS,this.index_buffer)));return g}},e.prototype._set_data=function(t){var e,r,n,o,i,s,a;for(n=4*t,this.vbo_x.set_size(n),this.vbo_y.set_size(n),this.vbo_a.set_size(n),this.vbo_s.set_size(n),s=new Float64Array(this.glyph._x),a=new Float64Array(this.glyph._y),e=r=0,o=t;0<=o?r<o:r>o;e=0<=o?++r:--r)s[e]+=this._baked_offset[0],a[e]+=this._baked_offset[1];return this.vbo_x.set_data(0,new Float32Array(s)),this.vbo_y.set_data(0,new Float32Array(a)),null!=this.glyph._angle&&this.vbo_a.set_data(0,new Float32Array(this.glyph._angle)),null!=this.glyph._radius?this.vbo_s.set_data(0,new Float32Array(function(){var t,e,r,n;for(r=this.glyph.sradius,n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(2*i);return n}.call(this))):this.vbo_s.set_data(0,new Float32Array(this.glyph._size))},e.prototype._set_visuals=function(t){return b(this.prog,this.vbo_linewidth,"a_linewidth",t,this.glyph.visuals.line,"line_width"),v(this.prog,this.vbo_fg_color,"a_fg_color",t,this.glyph.visuals.line,"line"),v(this.prog,this.vbo_bg_color,"a_bg_color",t,this.glyph.visuals.fill,"fill"),this.prog.set_uniform("u_antialias","float",[.8])},e}(i),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="circle",e.prototype.MARKERCODE="// --- disc\nfloat marker(vec2 P, float size)\n{\n return length(P) - size/2.0;\n}",e}(_),f=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="square",e.prototype.MARKERCODE="// --- square\nfloat marker(vec2 P, float size)\n{\n return max(abs(P.x), abs(P.y)) - size/2.0;\n}",e}(_),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="annulus",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n float r1 = length(P) - size/2.0;\n float r2 = length(P) - size/4.0; // half width\n return max(r1, -r2);\n}",e}(_),c=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="diamond",e.prototype.MARKERCODE="// --- diamond\nfloat marker(vec2 P, float size)\n{\n float x = SQRT_2 / 2.0 * (P.x * 1.5 - P.y);\n float y = SQRT_2 / 2.0 * (P.x * 1.5 + P.y);\n float r1 = max(abs(x), abs(y)) - size / (2.0 * SQRT_2);\n return r1 / SQRT_2;\n}",e}(_),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="triangle",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n P.y -= size * 0.3;\n float x = SQRT_2 / 2.0 * (P.x * 1.7 - P.y);\n float y = SQRT_2 / 2.0 * (P.x * 1.7 + P.y);\n float r1 = max(abs(x), abs(y)) - size / 1.6;\n float r2 = P.y;\n return max(r1 / SQRT_2, r2); // Instersect diamond with rectangle\n}",e}(_),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="invertedtriangle",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n P.y += size * 0.3;\n float x = SQRT_2 / 2.0 * (P.x * 1.7 - P.y);\n float y = SQRT_2 / 2.0 * (P.x * 1.7 + P.y);\n float r1 = max(abs(x), abs(y)) - size / 1.6;\n float r2 = - P.y;\n return max(r1 / SQRT_2, r2); // Instersect diamond with rectangle\n}",e}(_),u=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="cross",e.prototype.MARKERCODE='float marker(vec2 P, float size)\n{\n float square = max(abs(P.x), abs(P.y)) - size / 2.5; // 2.5 is a tweak\n float cross = min(abs(P.x), abs(P.y)) - size / 100.0; // bit of "width" for aa\n return max(square, cross);\n}',e}(_),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="circlecross",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n // Define quadrants\n float qs = size / 2.0; // quadrant size\n float s1 = max(abs(P.x - qs), abs(P.y - qs)) - qs;\n float s2 = max(abs(P.x + qs), abs(P.y - qs)) - qs;\n float s3 = max(abs(P.x - qs), abs(P.y + qs)) - qs;\n float s4 = max(abs(P.x + qs), abs(P.y + qs)) - qs;\n // Intersect main shape with quadrants (to form cross)\n float circle = length(P) - size/2.0;\n float c1 = max(circle, s1);\n float c2 = max(circle, s2);\n float c3 = max(circle, s3);\n float c4 = max(circle, s4);\n // Union\n return min(min(min(c1, c2), c3), c4);\n}",e}(_),d=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="squarecross",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n // Define quadrants\n float qs = size / 2.0; // quadrant size\n float s1 = max(abs(P.x - qs), abs(P.y - qs)) - qs;\n float s2 = max(abs(P.x + qs), abs(P.y - qs)) - qs;\n float s3 = max(abs(P.x - qs), abs(P.y + qs)) - qs;\n float s4 = max(abs(P.x + qs), abs(P.y + qs)) - qs;\n // Intersect main shape with quadrants (to form cross)\n float square = max(abs(P.x), abs(P.y)) - size/2.0;\n float c1 = max(square, s1);\n float c2 = max(square, s2);\n float c3 = max(square, s3);\n float c4 = max(square, s4);\n // Union\n return min(min(min(c1, c2), c3), c4);\n}",e}(_),h=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="diamondcross",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n // Define quadrants\n float qs = size / 2.0; // quadrant size\n float s1 = max(abs(P.x - qs), abs(P.y - qs)) - qs;\n float s2 = max(abs(P.x + qs), abs(P.y - qs)) - qs;\n float s3 = max(abs(P.x - qs), abs(P.y + qs)) - qs;\n float s4 = max(abs(P.x + qs), abs(P.y + qs)) - qs;\n // Intersect main shape with quadrants (to form cross)\n float x = SQRT_2 / 2.0 * (P.x * 1.5 - P.y);\n float y = SQRT_2 / 2.0 * (P.x * 1.5 + P.y);\n float diamond = max(abs(x), abs(y)) - size / (2.0 * SQRT_2);\n diamond /= SQRT_2;\n float c1 = max(diamond, s1);\n float c2 = max(diamond, s2);\n float c3 = max(diamond, s3);\n float c4 = max(diamond, s4);\n // Union\n return min(min(min(c1, c2), c3), c4);\n}",e}(_),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="x",e.prototype.MARKERCODE='float marker(vec2 P, float size)\n{\n float circle = length(P) - size / 1.6;\n float X = min(abs(P.x - P.y), abs(P.x + P.y)) - size / 100.0; // bit of "width" for aa\n return max(circle, X);\n}',e}(_),l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="circlex",e.prototype.MARKERCODE='float marker(vec2 P, float size)\n{\n float x = P.x - P.y;\n float y = P.x + P.y;\n // Define quadrants\n float qs = size / 2.0; // quadrant size\n float s1 = max(abs(x - qs), abs(y - qs)) - qs;\n float s2 = max(abs(x + qs), abs(y - qs)) - qs;\n float s3 = max(abs(x - qs), abs(y + qs)) - qs;\n float s4 = max(abs(x + qs), abs(y + qs)) - qs;\n // Intersect main shape with quadrants (to form cross)\n float circle = length(P) - size/2.0;\n float c1 = max(circle, s1);\n float c2 = max(circle, s2);\n float c3 = max(circle, s3);\n float c4 = max(circle, s4);\n // Union\n float almost = min(min(min(c1, c2), c3), c4);\n // In this case, the X is also outside of the main shape\n float Xmask = length(P) - size / 1.6; // a circle\n float X = min(abs(P.x - P.y), abs(P.x + P.y)) - size / 100.0; // bit of "width" for aa\n return min(max(X, Xmask), almost);\n}',e}(_),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="squarex",e.prototype.MARKERCODE="float marker(vec2 P, float size)\n{\n float x = P.x - P.y;\n float y = P.x + P.y;\n // Define quadrants\n float qs = size / 2.0; // quadrant size\n float s1 = max(abs(x - qs), abs(y - qs)) - qs;\n float s2 = max(abs(x + qs), abs(y - qs)) - qs;\n float s3 = max(abs(x - qs), abs(y + qs)) - qs;\n float s4 = max(abs(x + qs), abs(y + qs)) - qs;\n // Intersect main shape with quadrants (to form cross)\n float square = max(abs(P.x), abs(P.y)) - size/2.0;\n float c1 = max(square, s1);\n float c2 = max(square, s2);\n float c3 = max(square, s3);\n float c4 = max(square, s4);\n // Union\n return min(min(min(c1, c2), c3), c4);\n}",e}(_),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return j(e,t),e.prototype.GLYPH="asterisk",e.prototype.MARKERCODE='float marker(vec2 P, float size)\n{\n // Masks\n float diamond = max(abs(SQRT_2 / 2.0 * (P.x - P.y)), abs(SQRT_2 / 2.0 * (P.x + P.y))) - size / (2.0 * SQRT_2);\n float square = max(abs(P.x), abs(P.y)) - size / (2.0 * SQRT_2);\n // Shapes\n float X = min(abs(P.x - P.y), abs(P.x + P.y)) - size / 100.0; // bit of "width" for aa\n float cross = min(abs(P.x), abs(P.y)) - size / 100.0; // bit of "width" for aa\n // Result is union of masked shapes\n return min(max(X, diamond), max(cross, square));\n}',e}(_),e.exports={CircleGLGlyph:a,SquareGLGlyph:f,AnnulusGLGlyph:n,DiamondGLGlyph:c,TriangleGLGlyph:g,InvertedTriangleGLGlyph:p,CrossGLGlyph:u,CircleCrossGLGlyph:s,SquareCrossGLGlyph:d,DiamondCrossGLGlyph:h,XGLGlyph:y,CircleXGLGlyph:l,SquareXGLGlyph:m,AsteriskGLGlyph:o}},{"../../../core/logging":"core/logging","./base":"models/glyphs/webgl/base",gloo2:"gloo2"}],"models/glyphs/wedge":[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("./glyph"),l=t("../../common/hittest"),u=t("../../core/properties"),a=t("../../core/util/math").angle_between,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xmapper,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;for(c=r.sx,p=r.sy,h=r.sradius,o=r._start_angle,n=r._end_angle,i=this.model.properties.direction.value(),u=[],a=0,l=e.length;a<l;a++)s=e[a],isNaN(c[s]+p[s]+h[s]+o[s]+n[s])||(t.beginPath(),t.arc(c[s],p[s],h[s],o[s],n[s],i),t.lineTo(c[s],p[s]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,s),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,s),u.push(t.stroke())):u.push(void 0));return u},e.prototype._hit_point=function(t){var e,r,n,o,i,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F,B;for(g=[t.vx,t.vy],P=g[0],C=g[1],q=this.renderer.xmapper.map_from_target(P,!0),R=this.renderer.ymapper.map_from_target(C,!0),"data"===this.model.properties.radius.units?(D=q-this.max_radius,I=q+this.max_radius,F=R-this.max_radius,B=R+this.max_radius):(E=P-this.max_radius,A=P+this.max_radius,y=this.renderer.xmapper.v_map_from_target([E,A],!0),D=y[0],I=y[1],N=C-this.max_radius,O=C+this.max_radius,v=this.renderer.ymapper.v_map_from_target([N,O],!0),F=v[0],B=v[1]),n=[],r=l.validate_bbox_coords([D,I],[F,B]),b=function(){var t,e,n,o;for(n=this.index.search(r),o=[],t=0,e=n.length;t<e;t++)f=n[t],o.push(f.i);return o}.call(this),c=0,_=b.length;c<_;c++)h=b[c],m=Math.pow(this.sradius[h],2),k=this.renderer.xmapper.map_to_target(q,!0),j=this.renderer.xmapper.map_to_target(this._x[h],!0),S=this.renderer.ymapper.map_to_target(R,!0),z=this.renderer.ymapper.map_to_target(this._y[h],!0),i=Math.pow(k-j,2)+Math.pow(S-z,2),i<=m&&n.push([h,i]);for(o=this.model.properties.direction.value(),u=[],p=0,d=n.length;p<d;p++)x=n[p],h=x[0],i=x[1],M=this.renderer.plot_view.canvas.vx_to_sx(P),T=this.renderer.plot_view.canvas.vy_to_sy(C),e=Math.atan2(T-this.sy[h],M-this.sx[h]),a(-e,-this._start_angle[h],-this._end_angle[h],o)&&u.push([h,i]);return w=l.create_hit_test_result(),w["1d"].indices=s.chain(u).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),w},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="Wedge",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({direction:[u.Direction,"anticlock"],radius:[u.DistanceSpec],start_angle:[u.AngleSpec],end_angle:[u.AngleSpec]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../../core/util/math":"core/util/math","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/grids/grid":[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;a=t("underscore"),i=t("../renderers/guide_renderer"),s=t("../renderers/renderer"),l=t("../../core/properties"),o=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._x_range_name=this.mget("x_range_name"),this._y_range_name=this.mget("y_range_name")},e.prototype.render=function(){var t;if(this.model.visible!==!1)return t=this.plot_view.canvas_view.ctx,t.save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.request_render)},e.prototype._draw_regions=function(t){var e,r,n,o,i,s,a,l,u,h,c,p;if(this.visuals.band_fill.doit)for(n=this.model.grid_coords("major",!1),c=n[0],p=n[1],this.visuals.band_fill.set_value(t),e=r=0,o=c.length-1;0<=o?r<o:r>o;e=0<=o?++r:--r)e%2===1&&(i=this.plot_view.map_to_screen(c[e],p[e],this._x_range_name,this._y_range_name),a=i[0],u=i[1],s=this.plot_view.map_to_screen(c[e+1],p[e+1],this._x_range_name,this._y_range_name),l=s[0],h=s[1],t.fillRect(a[0],u[0],l[1]-a[0],h[1]-u[0]),t.fill())},e.prototype._draw_grids=function(t){var e,r,n;if(this.visuals.grid_line.doit)return e=this.model.grid_coords("major"),r=e[0],n=e[1],this._draw_grid_helper(t,this.visuals.grid_line,r,n)},e.prototype._draw_minor_grids=function(t){var e,r,n;if(this.visuals.minor_grid_line.doit)return e=this.model.grid_coords("minor"),r=e[0],n=e[1],this._draw_grid_helper(t,this.visuals.minor_grid_line,r,n)},e.prototype._draw_grid_helper=function(t,e,r,n){var o,i,s,a,l,u,h,c;for(e.set_value(t),o=i=0,a=r.length;0<=a?i<a:i>a;o=0<=a?++i:--i){for(l=this.plot_view.map_to_screen(r[o],n[o],this._x_range_name,this._y_range_name),h=l[0],c=l[1],t.beginPath(),t.moveTo(Math.round(h[0]),Math.round(c[0])),o=s=1,u=h.length;1<=u?s<u:s>u;o=1<=u?++s:--s)t.lineTo(Math.round(h[o]),Math.round(c[o]));t.stroke()}},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="Grid",e.mixins(["line:grid_","line:minor_grid_","fill:band_"]),e.define({bounds:[l.Any,"auto"],dimension:[l.Number,0],ticker:[l.Instance],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"]}),e.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null}),e.prototype.ranges=function(){var t,e,r,n;return e=this.get("dimension"),r=(e+1)%2,t=this.plot.plot_canvas.get("frame"),n=[t.get("x_ranges")[this.get("x_range_name")],t.get("y_ranges")[this.get("y_range_name")]],[n[e],n[r]]},e.prototype.computed_bounds=function(){var t,e,r,n,o,i,s;return o=this.ranges(),r=o[0],t=o[1],s=this.get("bounds"),n=[r.get("min"),r.get("max")],a.isArray(s)?(i=Math.min(s[0],s[1]),e=Math.max(s[0],s[1]),i<n[0]?i=n[0]:i>n[1]&&(i=null),e>n[1]?e=n[1]:e<n[0]&&(e=null)):(i=n[0],e=n[1]),[i,e]},e.prototype.grid_coords=function(t,e){var r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T;for(null==e&&(e=!0),h=this.get("dimension"),p=(h+1)%2,b=this.ranges(),v=b[0],s=b[1],x=this.computed_bounds(),k=x[0],u=x[1],T=Math.min(k,u),u=Math.max(k,u),k=T,j=this.get("ticker").get_ticks(k,u,v,{})[t],g=v.get("min"),m=v.get("max"),o=s.get("min"),n=s.get("max"),i=[[],[]],c=_=0,w=j.length;0<=w?_<w:_>w;c=0<=w?++_:--_)if(j[c]!==g&&j[c]!==m||!e){for(a=[],l=[],r=2,y=d=0,M=r;0<=M?d<M:d>M;y=0<=M?++d:--d)f=o+(n-o)/(r-1)*y,a.push(j[c]),l.push(f);i[h].push(a),i[p].push(l)}return i},e}(i.Model),e.exports={Model:n,View:o}},{"../../core/properties":"core/properties","../renderers/guide_renderer":"models/renderers/guide_renderer","../renderers/renderer":"models/renderers/renderer",underscore:"underscore"}],"models/layouts/box":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d=function(t,e){function r(){this.constructor=t}for(var n in e)f.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},f={}.hasOwnProperty,m=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};c=t("underscore"),_=t("../../core/layout/solver"),i=_.EQ,s=_.GE,l=_.Strength,u=_.Variable,h=_.WEAK_EQ,p=t("../../core/properties"),a=t("./layout_dom"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return d(e,t),e.prototype.className="bk-grid",e.prototype.bind_bokeh_events=function(){return e.__super__.bind_bokeh_events.call(this),this.listenTo(this.model,"change:children",this.build_child_views)},e.prototype.get_height=function(){var t,e,r;return e=this.model.get_layoutable_children(),t=c.map(e,function(t){return t._height._value}),r=this.model._horizontal?c.reduce(t,function(t,e){return Math.max(t,e)}):c.reduce(t,function(t,e){return t+e})},e.prototype.get_width=function(){var t,e,r;return e=this.model.get_layoutable_children(),t=c.map(e,function(t){return t._width._value}),r=this.model._horizontal?c.reduce(t,function(t,e){return t+e}):c.reduce(t,function(t,e){return Math.max(t,e)})},e}(a.View),n=function(t){function e(t,r){e.__super__.constructor.call(this,t,r),this._child_equal_size_width=new u,this._child_equal_size_height=new u,this._box_equal_size_top=new u,this._box_equal_size_bottom=new u,this._box_equal_size_left=new u,this._box_equal_size_right=new u,this._box_cell_align_top=new u,this._box_cell_align_bottom=new u,this._box_cell_align_left=new u,this._box_cell_align_right=new u}return d(e,t),e.prototype.default_view=o,e.define({children:[p.Array,[]]}),e.internal({spacing:[p.Number,6]}),e.prototype.get_layoutable_children=function(){return this.get("children")},e.prototype.variables_updated=function(){var t,e,r,n;for(n=this.get_layoutable_children(),e=0,r=n.length;e<r;e++)t=n[e],t.trigger("change");return this.trigger("change")},e.prototype.get_edit_variables=function(){var t,r,n,o,i;for(r=e.__super__.get_edit_variables.call(this),i=this.get_layoutable_children(),n=0,o=i.length;n<o;n++)t=i[n],r=r.concat(t.get_edit_variables());return r},e.prototype.get_constrained_variables=function(){var t;return t=e.__super__.get_constrained_variables.call(this),t=c.extend(t,{"box-equal-size-top":this._box_equal_size_top,"box-equal-size-bottom":this._box_equal_size_bottom,"box-equal-size-left":this._box_equal_size_left,"box-equal-size-right":this._box_equal_size_right,"box-cell-align-top":this._box_cell_align_top,"box-cell-align-bottom":this._box_cell_align_bottom,"box-cell-align-left":this._box_cell_align_left,"box-cell-align-right":this._box_cell_align_right})},e.prototype.get_constraints=function(){var t,e,r,n,o,a,l,u,p,_,d,f,m;if(r=[],e=this.get_layoutable_children(),0===e.length)return r;for(o=0,u=e.length;o<u;o++)t=e[o],this._test_layoutable(t),m=t.get_constrained_variables(),f=c.keys(m),_=this._child_rect(m),this._horizontal?this._has_var("height",f)&&r.push(i(_.height,[-1,this._height])):this._has_var("width",f)&&r.push(i(_.width,[-1,this._width])),this._horizontal?this._has_var(["box-equal-size-left","box-equal-size-right","width"],f)&&r.push(i([-1,m["box-equal-size-left"]],[-1,m["box-equal-size-right"]],m.width,this._child_equal_size_width)):this._has_var(["box-equal-size-top","box-equal-size-bottom","height"],f)&&r.push(i([-1,m["box-equal-size-top"]],[-1,m["box-equal-size-bottom"]],m.height,this._child_equal_size_height)),r=r.concat(t.get_constraints());for(l=this._info(e[0].get_constrained_variables()),r.push(i(l.span.start,0)),n=a=1,d=e.length;1<=d?a<d:a>d;n=1<=d?++a:--a)p=this._info(e[n].get_constrained_variables()),l.span.size&&r.push(i(l.span.start,l.span.size,[-1,p.span.start])),
r.push(h(l.whitespace.after,p.whitespace.before,0-this.spacing)),r.push(s(l.whitespace.after,p.whitespace.before,0-this.spacing)),l=p;return this._horizontal?this._has_var("width",f)&&r.push(i(l.span.start,l.span.size,[-1,this._width])):this._has_var("height",f)&&r.push(i(l.span.start,l.span.size,[-1,this._height])),r=r.concat(this._align_outer_edges_constraints(!0)),r=r.concat(this._align_outer_edges_constraints(!1)),r=r.concat(this._align_inner_cell_edges_constraints()),r=r.concat(this._box_equal_size_bounds(!0)),r=r.concat(this._box_equal_size_bounds(!1)),r=r.concat(this._box_cell_align_bounds(!0)),r=r.concat(this._box_cell_align_bounds(!1)),r=r.concat(this._box_whitespace(!0)),r=r.concat(this._box_whitespace(!1))},e.prototype._has_var=function(t,e){var r;return r="string"==typeof t?[t]:t,c.every(r,function(t){return m.call(e,t)>=0})},e.prototype._test_layoutable=function(t){var e,r,n,o,i;if(o=["origin-x","origin-y","whitespace-top","whitespace-right","whitespace-bottom","whitespace-left"],null==t.get_constrained_variables)throw new Error(t+" is missing get_constrained_variables method");for(i=t.get_constrained_variables(),e=0,n=o.length;e<n;e++){if(r=o[e],m.call(c.keys(i),r)<0)throw new Error(t+" is missing constrained_variable "+r);if(!i[r]instanceof u)throw new Error(t+" "+r+" is not a solver Variable")}return!0},e.prototype._child_rect=function(t){var e,r,n,o,i;return n=t.width,e=t.height,r=[t["origin-x"],t["origin-y"]],o=r[0],i=r[1],{x:o,y:i,width:n,height:e}},e.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},e.prototype._info=function(t){var e,r;return r=this._horizontal?{before:t["whitespace-left"],after:t["whitespace-right"]}:{before:t["whitespace-top"],after:t["whitespace-bottom"]},e=this._span(this._child_rect(t)),{span:e,whitespace:r}},e.prototype._flatten_cell_edge_variables=function(t){var r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w;for(x=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,r=t!==this._horizontal,l=this.get_layoutable_children(),o=l.length,h={},i=0,c=0,f=l.length;c<f;c++){for(a=l[c],s=a instanceof e?a._flatten_cell_edge_variables(t):{},n=a.get_constrained_variables(),p=0,m=x.length;p<m;p++)g=x[p],g in n&&(s[g]=[n[g]]);for(_ in s)w=s[_],r?(v=_.split(" "),d=v[0],b=v.length>1?v[1]:"",u=this._horizontal?"row":"col",y=d+" "+u+"-"+o+"-"+i+"-"+b):y=_,y in h?h[y]=h[y].concat(w):h[y]=w;i+=1}return h},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,r,n,o,s,a,l;if(t=[],this._is_root){e=this._flatten_cell_edge_variables(this._horizontal);for(o in e)if(l=e[o],l.length>1)for(s=l[0],r=n=1,a=l.length;1<=a?n<a:n>a;r=1<=a?++n:--n)t.push(i(l[r],[-1,s]))}return t},e.prototype._find_edge_leaves=function(t){var r,n,o,i,s,a,l,u;if(o=this.get_layoutable_children(),a=[[],[]],o.length>0)if(this._horizontal===t)u=o[0],i=o[o.length-1],u instanceof e?a[0]=a[0].concat(u._find_edge_leaves(t)[0]):a[0].push(u),i instanceof e?a[1]=a[1].concat(i._find_edge_leaves(t)[1]):a[1].push(i);else for(s=0,l=o.length;s<l;s++)r=o[s],r instanceof e?(n=r._find_edge_leaves(t),a[0]=a[0].concat(n[0]),a[1]=a[1].concat(n[1])):(a[0].push(r),a[1].push(r));return a},e.prototype._align_outer_edges_constraints=function(t){var e,r,n,o,s,a,l,u,h,c;return a=this._find_edge_leaves(t),h=a[0],o=a[1],t?(c="on-edge-align-left",s="on-edge-align-right"):(c="on-edge-align-top",s="on-edge-align-bottom"),r=function(t,e){var r,n,o,i,s;for(r=[],n=0,i=t.length;n<i;n++)o=t[n],s=o.get_constrained_variables(),e in s&&r.push(s[e]);return r},u=r(h,c),n=r(o,s),l=[],e=function(t){var e,r,n,o,s;if(t.length>1){for(r=t[0],n=o=1,s=t.length;1<=s?o<s:o>s;n=1<=s?++o:--o)e=t[n],l.push(i([-1,r],e));return null}},e(u),e(n),l},e.prototype._box_insets_from_child_insets=function(t,e,r,n){var o,a,l,u,h,c,p,_,d;return c=this._find_edge_leaves(t),_=c[0],a=c[1],t?(d=e+"-left",l=e+"-right",h=this[r+"_left"],u=this[r+"_right"]):(d=e+"-top",l=e+"-bottom",h=this[r+"_top"],u=this[r+"_bottom"]),p=[],o=function(t,e,r){var o,a,l,u,h;for(o=[],a=0,u=e.length;a<u;a++)l=e[a],h=l.get_constrained_variables(),r in h&&(n?p.push(s([-1,t],h[r])):p.push(i([-1,t],h[r])));return null},o(h,_,d),o(u,a,l),p},e.prototype._box_equal_size_bounds=function(t){return this._box_insets_from_child_insets(t,"box-equal-size","_box_equal_size",!1)},e.prototype._box_cell_align_bounds=function(t){return this._box_insets_from_child_insets(t,"box-cell-align","_box_cell_align",!1)},e.prototype._box_whitespace=function(t){return this._box_insets_from_child_insets(t,"whitespace","_whitespace",!0)},e._left_right_inner_cell_edge_variables=["box-cell-align-left","box-cell-align-right"],e._top_bottom_inner_cell_edge_variables=["box-cell-align-top","box-cell-align-bottom"],e}(a.Model),e.exports={Model:n,View:o}},{"../../core/layout/solver":"core/layout/solver","../../core/properties":"core/properties","./layout_dom":"models/layouts/layout_dom",underscore:"underscore"}],"models/layouts/column":[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;n=t("./box"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.className="bk-grid-column",e}(n.View),o=function(t){function e(t,r){e.__super__.constructor.call(this,t,r),this._horizontal=!1}return s(e,t),e.prototype.type="Column",e.prototype.default_view=i,e}(n.Model),e.exports={View:i,Model:o}},{"./box":"models/layouts/box"}],"models/layouts/layout_dom":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g=function(t,e){function r(){this.constructor=t}for(var n in e)y.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},y={}.hasOwnProperty;p=t("underscore"),n=t("jquery"),u=t("../../model"),f=t("../../core/properties"),m=t("../../core/layout/solver"),s=m.GE,i=m.EQ,h=m.Strength,c=m.Variable,_=t("../../common/build_views"),o=t("../../core/bokeh_view"),d=t("../../core/logging").logger,l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return g(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.$el.attr("id","modelid_"+this.model.id),this.$el.addClass("bk-layout-"+this.model.sizing_mode),this.child_views={},this.build_child_views(!1)},e.prototype.build_child_views=function(t){var e,r,n,o,i;for(null==t&&(t=!0),this.unbind_bokeh_events(),t&&(this.model.document._invalidate_all_models(),this.model.document._init_solver()),n=this.model.get_layoutable_children(),this.child_views={},_(this.child_views,n),this.$el.empty(),o=0,i=n.length;o<i;o++)e=n[o],r=this.child_views[e.id],this.$el.append(r.$el);return this.bind_bokeh_events()},e.prototype.unbind_bokeh_events=function(){var t,e,r,n;this.stopListening(),e=this.child_views,r=[];for(t in e)n=e[t],n.stopListening(),r.push("function"==typeof n.unbind_bokeh_events?n.unbind_bokeh_events():void 0);return r},e.prototype.bind_bokeh_events=function(){var t;return this.listenTo(this.model,"change",this.render),"fixed"===this.model.sizing_mode?this.listenToOnce(this.model.document.solver(),"resize",function(t){return function(){return t.render()}}(this)):this.listenTo(this.model.document.solver(),"resize",function(t){return function(){return t.render()}}(this)),t="Changing sizing_mode after initialization is not currently supported.",this.listenTo(this.model,"change:sizing_mode",function(){return d.warn(t)})},e.prototype.render=function(){var t,e,r;if(e=this.model.document.solver(),"fixed"===this.model.sizing_mode&&(null!=this.model.width?r=this.model.width:(r=this.get_width(),this.model.width=r),null!=this.model.height?t=this.model.height:(t=this.get_height(),this.model.height=t),e.suggest_value(this.model._width,r),e.suggest_value(this.model._height,t),e.update_variables(),this.$el.css({width:r,height:t})),"scale_width"===this.model.sizing_mode&&(t=this.get_height(),e.suggest_value(this.model._height,t),e.update_variables(),this.$el.css({width:this.model._width._value,height:this.model._height._value})),"scale_height"===this.model.sizing_mode&&(r=this.get_width(),e.suggest_value(this.model._width,r),e.update_variables(),this.$el.css({width:this.model._width._value,height:this.model._height._value})),"stretch_both"===this.model.sizing_mode)return this.$el.css({position:"absolute",left:this.model._dom_left._value,top:this.model._dom_top._value,width:this.model._width._value,height:this.model._height._value})},e.prototype.get_height=function(){return null},e.prototype.get_width=function(){return null},e}(o),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return g(e,t),e.prototype.type="LayoutDOM",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._width=new c("_width "+this.id),this._height=new c("_height "+this.id),this._left=new c("_left "+this.id),this._right=new c("_right "+this.id),this._top=new c("_top "+this.id),this._bottom=new c("_bottom "+this.id),this._dom_top=new c("_dom_top "+this.id),this._dom_left=new c("_dom_left "+this.id),this._width_minus_right=new c("_width_minus_right "+this.id),this._height_minus_bottom=new c("_height_minus_bottom "+this.id),this._whitespace_top=new c,this._whitespace_bottom=new c,this._whitespace_left=new c,this._whitespace_right=new c},e.prototype.get_constraints=function(){var t;return t=[],t.push(s(this._dom_left)),t.push(s(this._dom_top)),t.push(s(this._left)),t.push(s(this._width,[-1,this._right])),t.push(s(this._top)),t.push(s(this._height,[-1,this._bottom])),t.push(i(this._width_minus_right,[-1,this._width],this._right)),t.push(i(this._height_minus_bottom,[-1,this._height],this._bottom)),t},e.prototype.get_layoutable_children=function(){return[]},e.prototype.get_edit_variables=function(){var t;return t=[],"fixed"===this.sizing_mode&&(t.push({edit_variable:this._height,strength:h.strong}),t.push({edit_variable:this._width,strength:h.strong})),"scale_width"===this.sizing_mode&&t.push({edit_variable:this._height,strength:h.strong}),"scale_height"===this.sizing_mode&&t.push({edit_variable:this._width,strength:h.strong}),t},e.prototype.get_constrained_variables=function(){var t;return t={"origin-x":this._dom_left,"origin-y":this._dom_top,"whitespace-top":this._whitespace_top,"whitespace-bottom":this._whitespace_bottom,"whitespace-left":this._whitespace_left,"whitespace-right":this._whitespace_right},"stretch_both"===this.sizing_mode&&(t=p.extend(t,{width:this._width,height:this._height})),"scale_width"===this.sizing_mode&&(t=p.extend(t,{width:this._width})),"scale_height"===this.sizing_mode&&(t=p.extend(t,{height:this._height})),t},e.define({height:[f.Number],width:[f.Number],disabled:[f.Bool,!1],sizing_mode:[f.SizingMode,"fixed"]}),e.internal({layoutable:[f.Bool,!0]}),e}(u),e.exports={Model:a,View:l}},{"../../common/build_views":"common/build_views","../../core/bokeh_view":"core/bokeh_view","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../../model":"model",jquery:"jquery",underscore:"underscore"}],"models/layouts/row":[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;n=t("./box"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.className="bk-grid-row",e}(n.View),o=function(t){function e(t,r){e.__super__.constructor.call(this,t,r),this._horizontal=!0}return s(e,t),e.prototype.type="Row",e.prototype.default_view=i,e}(n.Model),e.exports={View:i,Model:o}},{"./box":"models/layouts/box"}],"models/layouts/spacer":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=t("underscore"),n=t("./layout_dom"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.className="bk-spacer-box",e.prototype.render=function(){if(e.__super__.render.call(this),"fixed"===this.sizing_mode)return this.$el.css({width:this.model.width,height:this.model.height})},e.prototype.get_height=function(){return 1},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="Spacer",e.prototype.default_view=i,e.prototype.get_constrained_variables=function(){var t;return t=e.__super__.get_constrained_variables.call(this),t=s.extend(t,{"on-edge-align-top":this._top,"on-edge-align-bottom":this._height_minus_bottom,"on-edge-align-left":this._left,"on-edge-align-right":this._width_minus_right,"box-cell-align-top":this._top,"box-cell-align-bottom":this._height_minus_bottom,"box-cell-align-left":this._left,"box-cell-align-right":this._width_minus_right,"box-equal-size-top":this._top,"box-equal-size-bottom":this._height_minus_bottom,"box-equal-size-left":this._left,"box-equal-size-right":this._width_minus_right})},e}(n.Model),e.exports={Model:o}},{"./layout_dom":"models/layouts/layout_dom",underscore:"underscore"}],"models/layouts/widget_box":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y=function(t,e){function r(){this.constructor=t}for(var n in e)v.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},v={}.hasOwnProperty;_=t("underscore"),n=t("jquery"),d=t("../../common/build_views"),o=t("../../core/bokeh_view"),g=t("../../core/layout/solver"),h=g.WEAK_EQ,s=g.GE,i=g.EQ,l=g.Strength,u=g.Variable,f=t("../../core/logging").logger,m=t("../../core/properties"),a=t("../layouts/layout_dom"),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return y(e,t),e.prototype.className="bk-widget-box",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.render()},e.prototype.bind_bokeh_events=function(){return e.__super__.bind_bokeh_events.call(this),this.listenTo(this.model,"change:children",function(t){return function(){return t.build_child_views()}}(this))},e.prototype.render=function(){var t,e,r,n;return r=this.model.document.solver(),"fixed"!==this.model.sizing_mode&&"scale_height"!==this.model.sizing_mode||(n=this.get_width(),this.model._width._value!==n&&(r.suggest_value(this.model._width,n),r.update_variables())),"fixed"!==this.model.sizing_mode&&"scale_width"!==this.model.sizing_mode||(e=this.get_height(),this.model._height._value!==e&&(r.suggest_value(this.model._height,e),r.update_variables())),t=this.model._width._value-20>0?this.model._width._value-20:"100%","stretch_both"===this.model.sizing_mode?this.$el.css({position:"absolute",left:this.model._dom_left._value,top:this.model._dom_top._value,width:this.model._width._value,height:this.model._height._value}):this.$el.css({width:t})},e.prototype.get_height=function(){var t,e,r,n;e=0,n=this.child_views;for(r in n)v.call(n,r)&&(t=n[r],e+=t.el.scrollHeight);return e+20},e.prototype.get_width=function(){var t,e,r,n,o;if(null!=this.model.width)return this.model.width;o=this.el.scrollWidth+20,n=this.child_views;for(r in n)v.call(n,r)&&(t=n[r],e=t.el.scrollWidth,e>o&&(o=e));return o},e}(a.View),c=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return y(e,t),e.prototype.type="WidgetBox",e.prototype.default_view=p,e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),"fixed"===this.sizing_mode&&null===this.width&&(this.width=300,f.info("WidgetBox mode is fixed, but no width specified. Using default of 300.")),"scale_height"===this.sizing_mode)return f.warn("sizing_mode `scale_height` is not experimental for WidgetBox. Please report your results to the bokeh dev team so we can improve.")},e.prototype.get_edit_variables=function(){var t,r,n,o,i;for(r=e.__super__.get_edit_variables.call(this),i=this.get_layoutable_children(),n=0,o=i.length;n<o;n++)t=i[n],r=r.concat(t.get_edit_variables());return r},e.prototype.get_constraints=function(){var t,r,n,o,i;for(r=e.__super__.get_constraints.call(this),i=this.get_layoutable_children(),n=0,o=i.length;n<o;n++)t=i[n],r=r.concat(t.get_constraints());return r},e.prototype.get_constrained_variables=function(){var t;return t=e.__super__.get_constrained_variables.call(this),t=_.extend(t,{"on-edge-align-top":this._top,"on-edge-align-bottom":this._height_minus_bottom,"on-edge-align-left":this._left,"on-edge-align-right":this._width_minus_right,"box-cell-align-top":this._top,"box-cell-align-bottom":this._height_minus_bottom,"box-cell-align-left":this._left,"box-cell-align-right":this._width_minus_right,"box-equal-size-top":this._top,"box-equal-size-bottom":this._height_minus_bottom}),"fixed"!==this.sizing_mode&&(t=_.extend(t,{"box-equal-size-left":this._left,"box-equal-size-right":this._width_minus_right})),t},e.prototype.get_layoutable_children=function(){return this.children},e.define({children:[m.Array,[]]}),e}(a.Model),e.exports={Model:c}},{"../../common/build_views":"common/build_views","../../core/bokeh_view":"core/bokeh_view","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../layouts/layout_dom":"models/layouts/layout_dom",jquery:"jquery",underscore:"underscore"}],"models/mappers/categorical_mapper":[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"),o=t("./linear_mapper"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.map_to_target=function(t,r){var n,o,s,a,l,u;return null==r&&(r=!1),i.isNumber(t)?r?t:e.__super__.map_to_target.call(this,t):(a=this.get("source_range"),o=a.get("factors"),t.indexOf(":")>=0?(l=t.split(":"),n=l[0],s=l[1],s=parseFloat(s),u=o.indexOf(n)+.5+a.get("offset")+s):u=o.indexOf(t)+1+a.get("offset"),r?u:e.__super__.map_to_target.call(this,u))},e.prototype.v_map_to_target=function(t,r){var n,o,s,a,l,u,h,c,p,_;if(null==r&&(r=!1),i.isNumber(t[0]))return r?t:e.__super__.v_map_to_target.call(this,t);for(u=this.get("source_range"),o=u.get("factors"),p=Array(t.length),s=a=0,h=t.length;0<=h?a<h:a>h;s=0<=h?++a:--a)_=t[s],_.indexOf(":")>=0?(c=_.split(":"),n=c[0],l=c[1],l=parseFloat(l),p[s]=o.indexOf(n)+.5+u.get("offset")+l):p[s]=o.indexOf(_)+1+u.get("offset");return r?p:e.__super__.v_map_to_target.call(this,p)},e.prototype.map_from_target=function(t,r){var n,o;return null==r&&(r=!1),t=e.__super__.map_from_target.call(this,t),r?t:(o=this.get("source_range"),n=o.get("factors"),n[Math.floor(t-.5-o.get("offset"))])},e.prototype.v_map_from_target=function(t,r){var n,o,i,s,a,l,u,h,c;for(null==r&&(r=!1),c=e.__super__.v_map_from_target.call(this,t),o=i=0,l=c.length;0<=l?i<l:i>l;o=0<=l?++i:--i)c[o]=c[o];if(r)return c;for(h=Array(c),a=this.get("source_range"),n=a.get("factors"),o=s=0,u=t.length;0<=u?s<u:s>u;o=0<=u?++s:--s)h[o]=n[Math.floor(c[o]-.5-a.get("offset"))];return h},e}(o.Model),e.exports={Model:n}},{"./linear_mapper":"models/mappers/linear_mapper",underscore:"underscore"}],"models/mappers/color_mapper":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),s=t("../../core/properties"),o=t("../../model"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="ColorMapper",e.define({palette:[s.Any],high:[s.Number],low:[s.Number],nan_color:[s.Color,"gray"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._little_endian=this._is_little_endian(),this._palette=this._build_palette(this.palette),this.listenTo(this,"change",function(){return this._palette=this._build_palette(this.palette)})},e.prototype.v_map_screen=function(t){var e,r,n,o,i,s,a,l,u;if(u=this._get_values(t,this._palette),e=new ArrayBuffer(4*t.length),r=new Uint32Array(e),this._little_endian)for(n=o=0,s=t.length;0<=s?o<s:o>s;n=0<=s?++o:--o)l=u[n],r[n]=255<<24|(16711680&l)>>16|65280&l|(255&l)<<16;else for(n=i=0,a=t.length;0<=a?i<a:i>a;n=0<=a?++i:--i)l=u[n],r[n]=l<<8|255;return e},e.prototype.compute=function(t){return null},e.prototype.v_compute=function(t){var e;return e=this._get_values(t,this.palette)},e.prototype._get_values=function(t,e){return[]},e.prototype._is_little_endian=function(){var t,e,r,n;return t=new ArrayBuffer(4),r=new Uint8ClampedArray(t),e=new Uint32Array(t),e[1]=168496141,n=!0,10===r[4]&&11===r[5]&&12===r[6]&&13===r[7]&&(n=!1),n},e.prototype._build_palette=function(t){var e,r,n,o,s;for(o=new Uint32Array(t.length),e=function(t){return i.isNumber(t)?t:parseInt(t.slice(1),16)},r=n=0,s=t.length;0<=s?n<s:n>s;r=0<=s?++n:--n)o[r]=e(t[r]);return o},e}(o),e.exports={Model:n}},{"../../core/properties":"core/properties","../../model":"model",underscore:"underscore"}],"models/mappers/grid_mapper":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;o=t("../../model"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.map_to_target=function(t,e){var r,n;return r=this.get("domain_mapper").map_to_target(t),n=this.get("codomain_mapper").map_to_target(e),[r,n]},e.prototype.v_map_to_target=function(t,e){var r,n;return r=this.get("domain_mapper").v_map_to_target(t),n=this.get("codomain_mapper").v_map_to_target(e),[r,n]},e.prototype.map_from_target=function(t,e){var r,n;return r=this.get("domain_mapper").map_from_target(t),n=this.get("codomain_mapper").map_from_target(e),[r,n]},e.prototype.v_map_from_target=function(t,e){var r,n;return r=this.get("domain_mapper").v_map_from_target(t),n=this.get("codomain_mapper").v_map_from_target(e),[r,n]},e}(o),e.exports={Model:n}},{"../../model":"model"}],"models/mappers/linear_color_mapper":[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("./color_mapper"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="LinearColorMapper",e.prototype._get_values=function(t,e){var r,n,o,s,a,l,u,h,c,p,_,d,f;for(u=null!=(_=this.get("low"))?_:i.min(t),a=null!=(d=this.get("high"))?d:i.max(t),l=e.length-1,f=[],h=1/(a-u),p=1/e.length,n=0,s=t.length;n<s;n++)r=t[n],isNaN(r)?f.push(this.nan_color):(c=(r-u)*h,o=Math.floor(c/p),o<0?o=0:o>=l&&(o=l),f.push(e[o]));return f},e}(n.Model),e.exports={Model:o}},{"./color_mapper":"models/mappers/color_mapper",underscore:"underscore"}],"models/mappers/linear_mapper":[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;o=t("../../model"),i=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_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"])},e.prototype.map_to_target=function(t){var e,r,n;return r=this.get("mapper_state"),n=r[0],e=r[1],n*t+e},e.prototype.v_map_to_target=function(t){var e,r,n,o,i,s,a,l;for(i=this.get("mapper_state"),a=i[0],o=i[1],s=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)l=t[r],s[r]=a*l+o;return s},e.prototype.map_from_target=function(t){var e,r,n;return r=this.get("mapper_state"),n=r[0],e=r[1],(t-e)/n},e.prototype.v_map_from_target=function(t){var e,r,n,o,i,s,a,l;for(i=this.get("mapper_state"),a=i[0],o=i[1],s=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)l=t[r],s[r]=(l-o)/a;return s},e.prototype._mapper_state=function(){var t,e,r,n,o,i;return n=this.get("source_range").get("start"),r=this.get("source_range").get("end"),i=this.get("target_range").get("start"),o=this.get("target_range").get("end"),e=(o-i)/(r-n),t=-(e*n)+i,[e,t]},e.internal({source_range:[i.Any],target_range:[i.Any]}),e}(o),e.exports={Model:n}},{"../../core/properties":"core/properties","../../model":"model"}],"models/mappers/log_color_mapper":[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("./color_mapper"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="LogColorMapper",e.prototype._get_values=function(t,e){var r,n,o,s,a,l,u,h,c,p,_,d,f;for(c=e.length,u=null!=(p=this.get("low"))?p:i.min(t),n=null!=(_=this.get("high"))?_:i.max(t),d=c/(Math.log1p(n)-Math.log1p(u)),h=e.length-1,f=[],o=0,a=t.length;o<a;o++)r=t[o],isNaN(r)?f.push(this.nan_color):(r>n&&(r=n),r<u&&(r=u),l=Math.log1p(r)-Math.log1p(u),s=Math.floor(l*d),s>h&&(s=h),f.push(e[s]));return f},e}(n.Model),e.exports={Model:o}},{"./color_mapper":"models/mappers/color_mapper",underscore:"underscore"}],"models/mappers/log_mapper":[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;o=t("../../model"),i=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_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"])},e.prototype.map_to_target=function(t){var e,r,n,o,i,s,a;return i=this.get("mapper_state"),a=i[0],o=i[1],r=i[2],e=i[3],s=0,0===r?n=0:(n=(Math.log(t)-e)/r,!isNaN(n)&&isFinite(n)||(n=0)),s=n*a+o},e.prototype.v_map_to_target=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_;if(h=this.get("mapper_state"),p=h[0],u=h[1],n=h[2],r=h[3],c=new Float64Array(t.length),0===n)o=t.map(function(t){return 0});else for(o=t.map(function(t){return(Math.log(t)-r)/n}),e=i=0,a=o.length;i<a;e=++i)_=o[e],!isNaN(o[e])&&isFinite(o[e])||(o[e]=0);for(e=s=0,l=t.length;s<l;e=++s)_=t[e],c[e]=o[e]*p+u;return c},e.prototype.map_from_target=function(t){var e,r,n,o,i,s;return i=this.get("mapper_state"),s=i[0],o=i[1],r=i[2],e=i[3],n=(t-o)/s,n=Math.exp(r*n+e)},e.prototype.v_map_from_target=function(t){var e,r,n,o,i,s,a,l,u,h,c;for(u=new Float64Array(t.length),l=this.get("mapper_state"),h=l[0],a=l[1],n=l[2],r=l[3],o=t.map(function(t){return(t-a)/h}),e=i=0,s=t.length;i<s;e=++i)c=t[e],u[e]=Math.exp(n*o[e]+r);return u},e.prototype._get_safe_scale=function(t,e){var r,n,o,i;return i=t<0?0:t,r=e<0?0:e,i===r&&(0===i?(o=[1,10],i=o[0],r=o[1]):(n=Math.log(i)/Math.log(10),i=Math.pow(10,Math.floor(n)),r=Math.ceil(n)!==Math.floor(n)?Math.pow(10,Math.ceil(n)):Math.pow(10,Math.ceil(n)+1))),[i,r]},e.prototype._mapper_state=function(){var t,e,r,n,o,i,s,a,l,u,h,c;return l=this.get("source_range").get("start"),a=this.get("source_range").get("end"),c=this.get("target_range").get("start"),h=this.get("target_range").get("end"),s=h-c,o=this._get_safe_scale(l,a),u=o[0],t=o[1],0===u?(r=Math.log(t),e=0):(r=Math.log(t)-Math.log(u),e=Math.log(u)),i=s,n=c,[i,n,r,e]},e.internal({source_range:[i.Any],target_range:[i.Any]}),e}(o),e.exports={Model:n}},{"../../core/properties":"core/properties","../../model":"model"}],"models/markers/index":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w=function(t,e){function r(){this.constructor=t}for(var n in e)M.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},M={}.hasOwnProperty;n=t("./marker"),o=Math.sqrt(3),f=function(t,e){var r,o;return o=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return w(r,t),r.prototype._render_one=e,r}(n.View),r=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return w(r,e),r.prototype.default_view=o,r.prototype.type=t,r}(n.Model),{Model:r,View:o}},l=function(t,e){return t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)},i=function(t,e){return t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)},s=function(t,e){return t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()},a=function(t,e){var r,n;return n=e*o,r=n/3,t.moveTo(-e,r),t.lineTo(e,r),t.lineTo(0,r-n),t.closePath()},u=function(t,e,r,n,o,s,a){var u;u=.65*o,i(t,o),l(t,u),s.doit&&(s.set_vectorize(t,e),t.stroke())},h=function(t,e,r,n,o,s,a){t.arc(0,0,o,0,2*Math.PI,!1),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),i(t,o),t.stroke())},c=function(t,e,r,n,o,i,s){t.arc(0,0,o,0,2*Math.PI,!1),s.doit&&(s.set_vectorize(t,e),t.fill()),i.doit&&(i.set_vectorize(t,e),l(t,o),t.stroke())},p=function(t,e,r,n,o,s,a){i(t,o),s.doit&&(s.set_vectorize(t,e),t.stroke())},_=function(t,e,r,n,o,i,a){s(t,o),a.doit&&(a.set_vectorize(t,e),t.fill()),i.doit&&(i.set_vectorize(t,e),t.stroke())},d=function(t,e,r,n,o,a,l){s(t,o),l.doit&&(l.set_vectorize(t,e),t.fill()),a.doit&&(a.set_vectorize(t,e),i(t,o),t.stroke())},m=function(t,e,r,n,o,i,s){t.rotate(Math.PI),a(t,o),t.rotate(-Math.PI),s.doit&&(s.set_vectorize(t,e),t.fill()),i.doit&&(i.set_vectorize(t,e),t.stroke())},g=function(t,e,r,n,o,i,s){var a;a=2*o,t.rect(-o,-o,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),i.doit&&(i.set_vectorize(t,e),t.stroke())},y=function(t,e,r,n,o,s,a){var l;l=2*o,t.rect(-o,-o,l,l),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),i(t,o),t.stroke())},v=function(t,e,r,n,o,i,s){var a;a=2*o,t.rect(-o,-o,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),i.doit&&(i.set_vectorize(t,e),l(t,o),t.stroke())},b=function(t,e,r,n,o,i,s){a(t,o),s.doit&&(s.set_vectorize(t,e),t.fill()),i.doit&&(i.set_vectorize(t,e),t.stroke())},x=function(t,e,r,n,o,i,s){l(t,o),i.doit&&(i.set_vectorize(t,e),t.stroke())},e.exports={Asterisk:f("Asterisk",u),CircleCross:f("CircleCross",h),CircleX:f("CircleX",c),Cross:f("Cross",p),Diamond:f("Diamond",_),DiamondCross:f("DiamondCross",d),InvertedTriangle:f("InvertedTriangle",m),Square:f("Square",g),SquareCross:f("SquareCross",y),SquareX:f("SquareX",v),Triangle:f("Triangle",b),X:f("X",x)}},{"./marker":"models/markers/marker"}],"models/markers/marker":[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;s=t("underscore"),n=t("../glyphs/glyph"),a=t("../../common/hittest"),l=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.draw_legend=function(t,e,r,n,o){var i,s,a,l,u,h,c,p;return u=null!=(l=this.get_reference_point())?l:0,a=[u],c={},c[u]=(e+r)/2,p={},p[u]=(n+o)/2,h={},h[u]=.4*Math.min(Math.abs(r-e),Math.abs(o-n)),i={},i[u]=0,s={sx:c,sy:p,_size:h,_angle:i},this._render(t,a,s)},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c;for(h=r.sx,c=r.sy,o=r._size,n=r._angle,u=[],s=0,a=e.length;s<a;s++)i=e[s],isNaN(h[i]+c[i]+o[i]+n[i])||(l=o[i]/2,t.beginPath(),t.translate(h[i],c[i]),n[i]&&t.rotate(n[i]),
this._render_one(t,i,h[i],c[i],l,this.visuals.line,this.visuals.fill),n[i]&&t.rotate(-n[i]),u.push(t.translate(-h[i],-c[i])));return u},e.prototype._index_data=function(){return this._xy_index()},e.prototype._mask_data=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d,f;return r=this.renderer.plot_view.frame.get("h_range"),s=r.get("start")-this.max_size,l=r.get("end")+this.max_size,n=this.renderer.xmapper.v_map_from_target([s,l],!0),p=n[0],_=n[1],i=this.renderer.plot_view.frame.get("v_range"),u=i.get("start")-this.max_size,h=i.get("end")+this.max_size,o=this.renderer.ymapper.v_map_from_target([u,h],!0),d=o[0],f=o[1],e=a.validate_bbox_coords([p,_],[d,f]),function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)c=n[t],o.push(c.i);return o}.call(this)},e.prototype._hit_point=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S;for(h=[t.vx,t.vy],g=h[0],b=h[1],f=this.renderer.plot_view.canvas.vx_to_sx(g),m=this.renderer.plot_view.canvas.vy_to_sy(b),y=g-this.max_size,v=g+this.max_size,c=this.renderer.xmapper.v_map_from_target([y,v],!0),k=c[0],j=c[1],x=b-this.max_size,w=b+this.max_size,p=this.renderer.ymapper.v_map_from_target([x,w],!0),T=p[0],S=p[1],e=a.validate_bbox_coords([k,j],[T,S]),r=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)M=n[t],o.push(M.i);return o}.call(this),o=[],l=0,u=r.length;l<u;l++)i=r[l],d=this._size[i]/2,n=Math.abs(this.sx[i]-f)+Math.abs(this.sy[i]-m),Math.abs(this.sx[i]-f)<=d&&Math.abs(this.sy[i]-m)<=d&&o.push([i,n]);return _=a.create_hit_test_result(),_["1d"].indices=s.chain(o).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),_},e.prototype._hit_rect=function(t){var e,r,n,o,i,s,l,u,h;return r=this.renderer.xmapper.v_map_from_target([t.vx0,t.vx1],!0),s=r[0],l=r[1],n=this.renderer.ymapper.v_map_from_target([t.vy0,t.vy1],!0),u=n[0],h=n[1],e=a.validate_bbox_coords([s,l],[u,h]),o=a.create_hit_test_result(),o["1d"].indices=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)i=n[t],o.push(i.i);return o}.call(this),o},e.prototype._hit_poly=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d;for(s=[t.vx,t.vy],_=s[0],d=s[1],c=this.renderer.plot_view.canvas.v_vx_to_sx(_),p=this.renderer.plot_view.canvas.v_vy_to_sy(d),e=function(){h=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)h.push(t);return h}.apply(this),r=[],n=i=0,l=e.length;0<=l?i<l:i>l;n=0<=l?++i:--i)o=e[n],a.point_in_poly(this.sx[n],this.sy[n],c,p)&&r.push(o);return u=a.create_hit_test_result(),u["1d"].indices=r,u},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({size:[l.DistanceSpec,{units:"screen",value:4}],angle:[l.AngleSpec,0]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../glyphs/glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/plots/gmap_plot":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;a=t("underscore"),h=t("proj4"),c=h.defs("GOOGLE"),l=t("../../core/logging").logger,o=t("./gmap_plot_canvas"),s=t("./plot"),u=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.type="GMapPlot",e.prototype.default_view=i,e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.api_key||l.error("api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own."),this._plot_canvas=new o.Model({plot:this}),this.plot_canvas.toolbar=this.toolbar},e.define({map_options:[u.Any],api_key:[u.String]}),e}(s.Model),e.exports={Model:n,View:i}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./gmap_plot_canvas":"models/plots/gmap_plot_canvas","./plot":"models/plots/plot",proj4:"proj4",underscore:"underscore"}],"models/plots/gmap_plot_canvas":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){return function(){return t.apply(e,arguments)}},c=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;s=t("underscore"),l=t("proj4"),u=l.defs("GOOGLE"),i=t("./plot_canvas"),a=t("../../core/properties"),o=function(t){function e(){return this.setRanges=h(this.setRanges,this),this.getProjectedBounds=h(this.getProjectedBounds,this),this.getLatLngBounds=h(this.getLatLngBounds,this),e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,s.defaults(t,this.default_options)),this.zoom_count=0},e.prototype.getLatLngBounds=function(){var t,e,r,n,o,i,s;return e=this.map.getBounds(),r=e.getNorthEast(),t=e.getSouthWest(),o=t.lng(),n=r.lng(),s=t.lat(),i=r.lat(),[o,n,s,i]},e.prototype.getProjectedBounds=function(){var t,e,r,n,o,i,s,a,h,c,p;return o=this.getLatLngBounds(),h=o[0],a=o[1],p=o[2],c=o[3],i=l(u,[h,p]),e=i[0],n=i[1],s=l(u,[a,c]),t=s[0],r=s[1],[e,t,n,r]},e.prototype.setRanges=function(){var t,e,r,n,o;return o=this.getProjectedBounds(),e=o[0],t=o[1],n=o[2],r=o[3],this.x_range.set({start:e,end:t}),this.y_range.set({start:n,end:r})},e.prototype.update_range=function(t){var r,n,o,i,s,a,l,u;if(this.pause(),null==t.sdx&&null==t.sdy||(this.map.panBy(t.sdx,t.sdy),e.__super__.update_range.call(this,t)),null!=t.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,e.__super__.update_range.call(this,t),u=t.factor<0?-1:1,n=this.map.getZoom(),r=n+u,r>=2&&(this.map.setZoom(r),l=this.getProjectedBounds(),i=l[0],o=l[1],a=l[2],s=l[3],o-i<0&&this.map.setZoom(n)),this.setRanges()}return this.unpause()},e.prototype.bind_bokeh_events=function(){var t,r,n,o,i,a;return e.__super__.bind_bokeh_events.call(this),a=this.frame.get("width"),r=this.frame.get("height"),n=this.canvas.vx_to_sx(this.frame.get("left")),i=this.canvas.vy_to_sy(this.frame.get("top")),this.canvas_view.map_div.attr("style","top: "+i+"px; left: "+n+"px; position: absolute"),this.canvas_view.map_div.attr("style","width:"+a+"px;"),this.canvas_view.map_div.attr("style","height:"+r+"px;"),this.canvas_view.map_div.width(a+"px").height(r+"px"),this.initial_zoom=this.model.plot.map_options.zoom,t=function(t){return function(){var e,r,n,o;return n=window.google.maps,r={satellite:n.MapTypeId.SATELLITE,terrain:n.MapTypeId.TERRAIN,roadmap:n.MapTypeId.ROADMAP,hybrid:n.MapTypeId.HYBRID},o=t.model.plot.map_options,e={center:new n.LatLng(o.lat,o.lng),zoom:o.zoom,disableDefaultUI:!0,mapTypeId:r[o.map_type]},null!=o.styles&&(e.styles=JSON.parse(o.styles)),t.map=new n.Map(t.canvas_view.map_div[0],e),n.event.addListenerOnce(t.map,"idle",t.setRanges)}}(this),null==window._bokeh_gmap_loads&&(window._bokeh_gmap_loads=[]),null!=window.google&&null!=window.google.maps?s.defer(t):null!=window._bokeh_gmap_callback?window._bokeh_gmap_loads.push(t):(window._bokeh_gmap_loads.push(t),window._bokeh_gmap_callback=function(){return s.each(window._bokeh_gmap_loads,s.defer)},o=document.createElement("script"),o.type="text/javascript",o.src="https://maps.googleapis.com/maps/api/js?key="+this.model.plot.api_key+"&callback=_bokeh_gmap_callback",document.body.appendChild(o))},e.prototype._map_hook=function(t,e){var r,n,o,i;return n=e[0],o=e[1],i=e[2],r=e[3],this.canvas_view.map_div.attr("style","top: "+o+"px; left: "+n+"px;"),this.canvas_view.map_div.width(i+"px").height(r+"px")},e.prototype._paint_empty=function(t,e){var r,n,o,i,s,a;return s=this.canvas.get("width"),i=this.canvas.get("height"),o=e[0],a=e[1],n=e[2],r=e[3],t.clearRect(0,0,s,i),t.beginPath(),t.moveTo(0,0),t.lineTo(0,i),t.lineTo(s,i),t.lineTo(s,0),t.lineTo(0,0),t.moveTo(o,a),t.lineTo(o+n,a),t.lineTo(o+n,a+r),t.lineTo(o,a+r),t.lineTo(o,a),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.type="GMapPlotCanvas",e.prototype.default_view=o,e.prototype.initialize=function(t,r){return this.use_map=!0,e.__super__.initialize.call(this,t,r)},e}(i.Model),e.exports={Model:n,View:o}},{"../../core/properties":"core/properties","./plot_canvas":"models/plots/plot_canvas",proj4:"proj4",underscore:"underscore"}],"models/plots/plot":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x=function(t,e){function r(){this.constructor=t}for(var n in e)w.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},w={}.hasOwnProperty,M=[].slice;g=t("underscore"),b=t("../../core/layout/solver"),m=b.WEAK_EQ,i=b.GE,o=b.EQ,c=b.Strength,f=b.Variable,y=t("../../core/logging").logger,v=t("../../core/properties"),a=t("../layouts/layout_dom"),p=t("../annotations/title"),d=t("../tools/toolbar"),_=t("../../common/tool_events"),u=t("./plot_canvas").Model,n=t("../sources/column_data_source"),s=t("../renderers/glyph_renderer"),p=t("../annotations/title"),h=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.className="bk-plot-layout",e.prototype.bind_bokeh_events=function(){var t;return e.__super__.bind_bokeh_events.call(this),t="Title object cannot be replaced. Try changing properties on title to update it after initialization.",this.listenTo(this.model,"change:title",function(e){return function(){return y.warn(t)}}(this))},e.prototype.render=function(){var t,r,n,o;if(e.__super__.render.call(this),"scale_both"===this.model.sizing_mode)return r=this.get_width_height(),o=r[0],t=r[1],n=this.model.document.solver(),n.suggest_value(this.model._width,o),n.suggest_value(this.model._height,t),this.$el.css({position:"absolute",left:this.model._dom_left._value,top:this.model._dom_top._value,width:this.model._width.value(),height:this.model._height.value()})},e.prototype.get_width_height=function(){var t,e,r,n,o,i,s,a,l;return s=this.el.parentNode.clientHeight,a=this.el.parentNode.clientWidth,t=this.model.get_aspect_ratio(),o=a,r=a/t,i=s*t,n=s,o<i?(l=o,e=r):(l=i,e=n),[l,e]},e.prototype.get_height=function(){return this.model._width._value/this.model.get_aspect_ratio()},e.prototype.get_width=function(){return this.model._height._value*this.model.get_aspect_ratio()},e}(a.View),l=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.type="Plot",e.prototype.default_view=h,e.prototype.initialize=function(t){var r,n,o,i,s,a,l,h,c,_,d;for(e.__super__.initialize.call(this,t),a=g.values(this.extra_x_ranges).concat(this.x_range),r=0,o=a.length;r<o;r++)_=a[r],s=_.get("plots"),g.isArray(s)&&(s=s.concat(this),_.set("plots",s));for(l=g.values(this.extra_y_ranges).concat(this.y_range),n=0,i=l.length;n<i;n++)d=l[n],s=d.get("plots"),g.isArray(s)&&(s=s.concat(this),d.set("plots",s));if(this._horizontal=!1,"left"!==(h=this.toolbar_location)&&"right"!==h||(this._horizontal=!0),null!=this.min_border&&(null==this.min_border_top&&(this.min_border_top=this.min_border),null==this.min_border_bottom&&(this.min_border_bottom=this.min_border),null==this.min_border_left&&(this.min_border_left=this.min_border),null==this.min_border_right&&(this.min_border_right=this.min_border)),null!=this.title&&(c=g.isString(this.title)?new p.Model({text:this.title}):this.title,this.add_layout(c,this.title_location)),this._plot_canvas=new u({plot:this}),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar.toolbar_sticky=this.toolbar_sticky,this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height)return this.height=this.plot_height},Object.defineProperty(e.prototype,"plot_canvas",{get:function(){return this._plot_canvas}}),e.prototype._doc_attached=function(){var t,e,r,n,o,i,s,a;for(s=["above","below","left","right"],t=0,n=s.length;t<n;t++)for(a=s[t],r=this.get(a),e=0,o=r.length;e<o;e++)i=r[e],this.plot_canvas.add_renderer_to_canvas_side(i,a);return this.plot_canvas.attach_document(this.document),this._set_orientation_variables(this),this._set_orientation_variables(this.toolbar),this._set_orientation_variables(this.plot_canvas)},e.prototype.add_renderers=function(){var t,e;return t=1<=arguments.length?M.call(arguments,0):[],e=this.get("renderers"),e=e.concat(t),this.set("renderers",e)},e.prototype.add_layout=function(t,e){var r;if(null==e&&(e="center"),null!=t.props.plot&&(t.plot=this),this.add_renderers(t),"center"!==e)return r=this.get(e),r.push(t)},e.prototype.add_glyph=function(t,e,r){var o;return null==r&&(r={}),null==e&&(e=new n.Model),r=g.extend({},r,{data_source:e,glyph:t}),o=new s.Model(r),this.add_renderers(o),o},e.prototype.add_tools=function(){var t,e,r,n;return n=1<=arguments.length?M.call(arguments,0):[],e=function(){var e,o,i;for(i=[],e=0,o=n.length;e<o;e++)r=n[e],null!=r.overlay&&this.add_renderers(r.overlay),null!=r.plot?i.push(r):(t=g.clone(r.attributes),t.plot=this,i.push(new r.constructor(t)));return i}.call(this),this.toolbar.tools=this.toolbar.tools.concat(e)},e.prototype.get_aspect_ratio=function(){return this.width/this.height},e.prototype.get_layoutable_children=function(){var t;return t=[this.plot_canvas],null!=this.toolbar_location&&(t=[this.toolbar,this.plot_canvas]),t},e.prototype.get_edit_variables=function(){var t,r,n,o,i;for(r=e.__super__.get_edit_variables.call(this),"scale_both"===this.sizing_mode&&(r.push({edit_variable:this._width,strength:c.strong}),r.push({edit_variable:this._height,strength:c.strong})),i=this.get_layoutable_children(),n=0,o=i.length;n<o;n++)t=i[n],r=r.concat(t.get_edit_variables());return r},e.prototype.get_constraints=function(){var t,r,n,s,a,l,u,h;for(r=e.__super__.get_constraints.call(this),null!=this.toolbar_location&&(this.toolbar_sticky===!0?r.push(o(this._sizeable,[-1,this.plot_canvas._sizeable])):r.push(o(this._sizeable,[-1,this.plot_canvas._sizeable],[-1,this.toolbar._sizeable])),r.push(o(this._full,[-1,this.plot_canvas._full])),"above"===this.toolbar_location&&(h=this.toolbar_sticky===!0?this.plot_canvas._top:this.plot_canvas._dom_top,r.push(o(h,[-1,this.toolbar._dom_top],[-1,this.toolbar._height]))),"below"===this.toolbar_location&&(this.toolbar_sticky===!1&&r.push(o(this.toolbar._dom_top,[-1,this.plot_canvas._height],this.toolbar._bottom,[-1,this.toolbar._height])),this.toolbar_sticky===!0&&(r.push(i(this.plot_canvas.below_panel._height,[-1,this.toolbar._height])),r.push(m(this.toolbar._dom_top,[-1,this.plot_canvas._height],this.plot_canvas.below_panel._height)))),"left"===this.toolbar_location&&(h=this.toolbar_sticky===!0?this.plot_canvas._left:this.plot_canvas._dom_left,r.push(o(h,[-1,this.toolbar._dom_left],[-1,this.toolbar._width]))),"right"===this.toolbar_location&&(this.toolbar_sticky===!1&&r.push(o(this.toolbar._dom_left,[-1,this.plot_canvas._width],this.toolbar._right,[-1,this.toolbar._width])),this.toolbar_sticky===!0&&(r.push(i(this.plot_canvas.right_panel._width,[-1,this.toolbar._width])),r.push(m(this.toolbar._dom_left,[-1,this.plot_canvas._width],this.plot_canvas.right_panel._width)))),"above"!==(a=this.toolbar_location)&&"below"!==a||r.push(o(this._width,[-1,this.toolbar._width],[-1,this.plot_canvas._width_minus_right])),"left"!==(l=this.toolbar_location)&&"right"!==l||(r.push(o(this._height,[-1,this.toolbar._height],[-1,this.plot_canvas.above_panel._height])),r.push(o(this.toolbar._dom_top,[-1,this.plot_canvas.above_panel._height])))),null==this.toolbar_location&&(r.push(o(this._width,[-1,this.plot_canvas._width])),r.push(o(this._height,[-1,this.plot_canvas._height]))),u=this.get_layoutable_children(),n=0,s=u.length;n<s;n++)t=u[n],r=r.concat(t.get_constraints());return r},e.prototype.get_constrained_variables=function(){var t;return t=e.__super__.get_constrained_variables.call(this),t=g.extend(t,{"on-edge-align-top":this.plot_canvas._top,"on-edge-align-bottom":this.plot_canvas._height_minus_bottom,"on-edge-align-left":this.plot_canvas._left,"on-edge-align-right":this.plot_canvas._width_minus_right,"box-cell-align-top":this.plot_canvas._top,"box-cell-align-bottom":this.plot_canvas._height_minus_bottom,"box-cell-align-left":this.plot_canvas._left,"box-cell-align-right":this.plot_canvas._width_minus_right,"box-equal-size-top":this.plot_canvas._top,"box-equal-size-bottom":this.plot_canvas._height_minus_bottom}),"fixed"!==this.sizing_mode&&(t=g.extend(t,{"box-equal-size-left":this.plot_canvas._left,"box-equal-size-right":this.plot_canvas._width_minus_right})),t},e.prototype._set_orientation_variables=function(t){if(this._horizontal===!1&&(t._sizeable=t._height,t._full=t._width),this._horizontal===!0)return t._sizeable=t._width,t._full=t._height},e.mixins(["line:outline_","fill:background_","fill:border_"]),e.define({toolbar:[v.Instance,function(){return new d.Model}],toolbar_location:[v.Location,"right"],toolbar_sticky:[v.Bool,!0],plot_width:[v.Number,600],plot_height:[v.Number,600],title:[v.Any,function(){return new p.Model({text:""})}],title_location:[v.Location,"above"],h_symmetry:[v.Bool,!0],v_symmetry:[v.Bool,!1],above:[v.Array,[]],below:[v.Array,[]],left:[v.Array,[]],right:[v.Array,[]],renderers:[v.Array,[]],x_range:[v.Instance],extra_x_ranges:[v.Any,{}],y_range:[v.Instance],extra_y_ranges:[v.Any,{}],x_mapper_type:[v.String,"auto"],y_mapper_type:[v.String,"auto"],tool_events:[v.Instance,function(){return new _.Model}],lod_factor:[v.Number,10],lod_interval:[v.Number,300],lod_threshold:[v.Number,2e3],lod_timeout:[v.Number,500],webgl:[v.Bool,!1],hidpi:[v.Bool,!0],min_border:[v.Number,5],min_border_top:[v.Number,null],min_border_left:[v.Number,null],min_border_bottom:[v.Number,null],min_border_right:[v.Number,null]}),e.override({outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"}),e}(a.Model),e.exports={View:h,Model:l}},{"../../common/tool_events":"common/tool_events","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../annotations/title":"models/annotations/title","../layouts/layout_dom":"models/layouts/layout_dom","../renderers/glyph_renderer":"models/renderers/glyph_renderer","../sources/column_data_source":"models/sources/column_data_source","../tools/toolbar":"models/tools/toolbar","./plot_canvas":"models/plots/plot_canvas",underscore:"underscore"}],"models/plots/plot_canvas":[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){return function(){return t.apply(e,arguments)}},T=function(t,e){function r(){this.constructor=t}for(var n in e)S.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},S={}.hasOwnProperty,z=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};m=t("underscore"),n=t("jquery"),o=t("../canvas/canvas"),i=t("../canvas/cartesian_frame"),s=t("../ranges/data_range1d"),u=t("../renderers/glyph_renderer"),c=t("../layouts/layout_dom"),d=t("../renderers/renderer"),g=t("../../common/build_views"),f=t("../../common/ui_events"),y=t("../../core/enums"),h=t("../../core/layout/layout_canvas"),w=t("../../core/layout/solver"),a=w.EQ,l=w.GE,b=t("../../core/logging").logger,x=t("../../core/properties"),M=t("../../core/util/throttle").throttle,k=t("../../core/layout/side_panel").update_constraints,v=null,_=function(t){function e(){return this.remove=j(this.remove,this),this.request_render=j(this.request_render,this),e.__super__.constructor.apply(this,arguments)}return T(e,t),e.prototype.className="bk-plot-wrapper",e.prototype.state={history:[],index:-1},e.prototype.view_options=function(){return m.extend({plot_model:this.model,plot_view:this},this.options)},e.prototype.pause=function(){return this.is_paused=!0},e.prototype.unpause=function(){return this.is_paused=!1,this.request_render()},e.prototype.request_render=function(){this.is_paused||this.throttled_render()},e.prototype.remove=function(){var t,r,n,o;e.__super__.remove.call(this),r=this.tool_views,n=[];for(t in r)o=r[t],n.push(o.remove());return n},e.prototype.initialize=function(t){var r,n,o,i,s,a,l,u,h,c,p;for(e.__super__.initialize.call(this,t),this.pause(),this.visuals={},u=this.model.plot.mixins,r=0,o=u.length;r<o;r++)p=u[r],h=p.split(":"),a=h[0],l=h[1],null==l&&(l=""),this.visuals[l+a]=new d.Visuals[a]({obj:this.model.plot,prefix:l});for(this._initial_state_info={range:null,selection:{},dimensions:{width:this.mget("canvas").get("width"),height:this.mget("canvas").get("height")}},this.frame=this.mget("frame"),this.x_range=this.frame.get("x_ranges")["default"],this.y_range=this.frame.get("y_ranges")["default"],this.xmapper=this.frame.get("x_mappers")["default"],this.ymapper=this.frame.get("y_mappers")["default"],this.canvas=this.mget("canvas"),this.canvas_view=new this.canvas.default_view({model:this.canvas}),this.$el.append(this.canvas_view.el),this.canvas_view.render(!0),(this.model.plot.webgl||window.location.search.indexOf("webgl=1")>0)&&window.location.search.indexOf("webgl=0")===-1&&this.init_webgl(),this.throttled_render=M(this.render,15),null==this.model.document._unrendered_plots&&(this.model.document._unrendered_plots={}),this.model.document._unrendered_plots[this.id]=!0,this.ui_event_bus=new f({toolbar:this.mget("toolbar"),hit_area:this.canvas_view.$el}),this.renderer_views={},this.tool_views={},this.levels={},c=y.RenderLevel,n=0,i=c.length;n<i;n++)s=c[n],this.levels[s]={};return this.build_levels(),this.bind_bokeh_events(),this.update_dataranges(),this.unpause(),b.debug("PlotView initialized"),this},e.prototype.get_canvas_element=function(){return this.canvas_view.ctx.canvas},e.prototype.init_webgl=function(){var t,e,r;return t=this.canvas_view.ctx,e=v,null==e&&(v=e=document.createElement("canvas"),r={premultipliedAlpha:!0},e.gl=e.getContext("webgl",r)||e.getContext("experimental-webgl",r)),null!=e.gl?t.glcanvas=e:b.warn("WebGL is not supported, falling back to 2D canvas.")},e.prototype.prepare_webgl=function(t,e){var r,n,o,i;if(n=this.canvas_view.ctx,r=this.canvas_view.get_canvas_element(),n.glcanvas)return n.glcanvas.width=r.width,n.glcanvas.height=r.height,i=n.glcanvas.gl,i.viewport(0,0,n.glcanvas.width,n.glcanvas.height),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT||i.DEPTH_BUFFER_BIT),i.enable(i.SCISSOR_TEST),o=n.glcanvas.height-t*(e[1]+e[3]),i.scissor(t*e[0],o,t*e[2],t*e[3]),i.enable(i.BLEND),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE_MINUS_DST_ALPHA,i.ONE)},e.prototype.blit_webgl=function(t){var e;if(e=this.canvas_view.ctx,e.glcanvas)return b.debug("drawing with WebGL"),e.restore(),e.drawImage(e.glcanvas,0,0),e.save(),e.scale(t,t),e.translate(.5,.5)},e.prototype.update_dataranges=function(){var t,e,r,n,o,i,a,l,u,h,c,p,_,d,f,g,y,v,x,w,M,k,j;n=this.model.frame,e={},f=this.renderer_views;for(a in f)M=f[a],t=null!=(g=M.glyph)&&"function"==typeof g.bounds?g.bounds():void 0,null!=t&&(e[a]=t);for(r=!1,o=!1,y=m.values(n.get("x_ranges")),i=0,u=y.length;i<u;i++)k=y[i],k instanceof s.Model&&(k.update(e,0,this.model.id),k.get("follow")&&(r=!0)),null!=k.get("bounds")&&(o=!0);for(v=m.values(n.get("y_ranges")),l=0,h=v.length;l<h;l++)j=v[l],j instanceof s.Model&&(j.update(e,1,this.model.id),j.get("follow")&&(r=!0)),null!=j.get("bounds")&&(o=!0);if(r&&o){for(b.warn("Follow enabled so bounds are unset."),x=m.values(n.get("x_ranges")),_=0,c=x.length;_<c;_++)k=x[_],k.set("bounds",null);for(w=m.values(n.get("y_ranges")),d=0,p=w.length;d<p;d++)j=w[d],j.set("bounds",null)}return this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,r,n){return null==r&&(r="default"),null==n&&(n="default"),this.frame.map_to_screen(t,e,this.canvas,r,n)},e.prototype.push_state=function(t,e){var r,n;return r=(null!=(n=this.state.history[this.state.index])?n.info:void 0)||{},e=m.extend({},this._initial_state_info,r,e),this.state.history.slice(0,this.state.index+1),this.state.history.push({type:t,info:e}),this.state.index=this.state.history.length-1,this.trigger("state_changed")},e.prototype.clear_state=function(){return this.state={history:[],index:-1},this.trigger("state_changed")},e.prototype.can_undo=function(){return this.state.index>=0},e.prototype.can_redo=function(){return this.state.index<this.state.history.length-1},e.prototype.undo=function(){if(this.can_undo())return this.state.index-=1,this._do_state_change(this.state.index),this.trigger("state_changed")},e.prototype.redo=function(){if(this.can_redo())return this.state.index+=1,this._do_state_change(this.state.index),this.trigger("state_changed")},e.prototype._do_state_change=function(t){var e,r;if(e=(null!=(r=this.state.history[t])?r.info:void 0)||this._initial_state_info,null!=e.range&&this.update_range(e.range),null!=e.selection&&this.update_selection(e.selection),null!=e.dimensions)return this.canvas_view.set_dims([e.dimensions.width,e.dimensions.height])},e.prototype.reset_dimensions=function(){return this.update_dimensions(this.canvas.initial_width,this.canvas.initial_height)},e.prototype.update_dimensions=function(t,e){return this.pause(),this.model.plot.width=t,this.model.plot.height=e,this.model.document.resize(),this.unpause()},e.prototype.get_selection=function(){var t,e,r,n,o,i;for(i=[],r=this.model.plot.renderers,t=0,e=r.length;t<e;t++)n=r[t],n instanceof u.Model&&(o=n.get("data_source").get("selected"),i[n.id]=o);return i},e.prototype.update_selection=function(t){var e,r,n,o,i,s,a;for(o=this.model.plot.renderers,a=[],r=0,n=o.length;r<n;r++)s=o[r],s instanceof u.Model&&(e=s.get("data_source"),null!=t?(i=s.id,z.call(t,i)>=0?a.push(e.set("selected",t[s.id])):a.push(void 0)):a.push(e.get("selection_manager").clear()));return a},e.prototype.reset_selection=function(){return this.update_selection(null)},e.prototype._update_ranges_together=function(t){var e,r,n,o,i,s,a,l,u,h;for(h=1,e=0,n=t.length;e<n;e++)s=t[e],u=s[0],i=s[1],h=Math.min(h,this._get_weight_to_constrain_interval(u,i));if(h<1){for(l=[],r=0,o=t.length;r<o;r++)a=t[r],u=a[0],i=a[1],i.start=h*i.start+(1-h)*u.get("start"),l.push(i.end=h*i.end+(1-h)*u.get("end"));return l}},e.prototype._update_ranges_individually=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y;for(n=!1,o=0,s=t.length;o<s;o++)p=t[o],g=p[0],c=p[1],m=g.get("start")>g.get("end"),r||(y=this._get_weight_to_constrain_interval(g,c),y<1&&(c.start=y*c.start+(1-y)*g.get("start"),c.end=y*c.end+(1-y)*g.get("end"))),null!=g.get("bounds")&&(u=g.get("bounds")[0],l=g.get("bounds")[1],h=Math.abs(c.end-c.start),m?(null!=u&&u>=c.end&&(n=!0,c.end=u,null==e&&null==r||(c.start=u+h)),null!=l&&l<=c.start&&(n=!0,c.start=l,null==e&&null==r||(c.end=l-h))):(null!=u&&u>=c.start&&(n=!0,c.start=u,null==e&&null==r||(c.end=u+h)),null!=l&&l<=c.end&&(n=!0,c.end=l,null==e&&null==r||(c.start=l-h))));if(!r||!n){for(f=[],i=0,a=t.length;i<a;i++)_=t[i],g=_[0],c=_[1],g.have_updated_interactively=!0,g.get("start")!==c.start||g.get("end")!==c.end?(g.set(c),f.push(null!=(d=g.get("callback"))?d.execute(g):void 0)):f.push(void 0);return f}},e.prototype._get_weight_to_constrain_interval=function(t,e){var r,n,o,i,s,a,l,u,h;return s=t.get("min_interval"),n=t.get("max_interval"),h=1,null!=t.get("bounds")&&(u=t.get("bounds"),i=u[0],r=u[1],null!=i&&null!=r&&(o=Math.abs(r-i),n=null!=n?Math.min(n,o):o)),null==s&&null==n||(l=Math.abs(t.get("end")-t.get("start")),a=Math.abs(e.end-e.start),s>0&&a<s&&(h=(l-s)/(l-a)),n>0&&a>n&&(h=(n-l)/(a-l)),h=Math.max(0,Math.min(1,h))),h},e.prototype.update_range=function(t,e,r){var n,o,i,s,a,l,u,h,c;if(this.pause,null==t){i=this.frame.get("x_ranges");for(n in i)c=i[n],c.reset(),null!=(s=c.get("callback"))&&s.execute(c);a=this.frame.get("y_ranges");for(n in a)c=a[n],c.reset(),null!=(l=c.get("callback"))&&l.execute(c);this.update_dataranges()}else{o=[],u=this.frame.get("x_ranges");for(n in u)c=u[n],o.push([c,t.xrs[n]]);h=this.frame.get("y_ranges");for(n in h)c=h[n],o.push([c,t.yrs[n]]);r&&this._update_ranges_together(o),this._update_ranges_individually(o,e,r)}return this.unpause()},e.prototype.reset_range=function(){return this.update_range(null)},e.prototype.build_levels=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,y,v,b,x;for(p=this.model.plot.renderers,c=this.model.plot.toolbar.tools,e=0,n=c.length;e<n;e++)f=c[e],d=f.get("synthetic_renderers"),p=p.concat(d);for(h=m.keys(this.renderer_views),x=g(this.renderer_views,p,this.view_options()),_=m.difference(h,m.pluck(p,"id")),r=0,o=_.length;r<o;r++)t=_[r],delete this.levels.glyph[t];for(v=g(this.tool_views,this.model.plot.toolbar.tools,this.view_options()),l=0,i=x.length;l<i;l++)b=x[l],a=b.mget("level"),this.levels[a][b.model.id]=b,b.bind_bokeh_events();for(u=0,s=v.length;u<s;u++)y=v[u],a=y.mget("level"),this.levels[a][y.model.id]=y,y.bind_bokeh_events(),this.ui_event_bus.register_tool(y);return this},e.prototype.bind_bokeh_events=function(){var t,e,r,n;e=this.model.frame.get("x_ranges");for(t in e)n=e[t],this.listenTo(n,"change",this.request_render);r=this.model.frame.get("y_ranges");for(t in r)n=r[t],this.listenTo(n,"change",this.request_render);return this.listenTo(this.model.plot,"change:renderers",this.build_levels),this.listenTo(this.model.plot.toolbar,"change:tools",this.build_levels),this.listenTo(this.model.plot,"change",this.request_render),this.listenTo(this.model.plot,"destroy",function(t){return function(){return t.remove()}}(this)),this.listenTo(this.model.plot.document.solver(),"layout_update",function(t){return function(){return t.request_render()}}(this)),this.listenTo(this.model.plot.document.solver(),"resize",function(t){return function(){return t.resize()}}(this)),this.listenTo(this.canvas,"change:pixel_ratio",function(t){return function(){return t.request_render()}}(this))},e.prototype.set_initial_range=function(){var t,e,r,n,o,i,s;t=!0,i={},r=this.frame.get("x_ranges");for(e in r){if(o=r[e],null==o.get("start")||null==o.get("end")||m.isNaN(o.get("start")+o.get("end"))){t=!1;break}i[e]={start:o.get("start"),end:o.get("end")}}if(t){s={},n=this.frame.get("y_ranges");for(e in n){if(o=n[e],null==o.get("start")||null==o.get("end")||m.isNaN(o.get("start")+o.get("end"))){t=!1;break}s[e]={start:o.get("start"),end:o.get("end")}}}return t?(this._initial_state_info.range=this.initial_range_info={xrs:i,yrs:s},b.debug("initial ranges set")):b.warn("could not set initial ranges")},e.prototype.render=function(t){var e,r,o,i,s,a,l;if(null==t&&(t=!1),b.trace("PlotCanvas.render(force_canvas="+t+") for "+this.model.id),null!=this.model.document){Date.now()-this.interactive_timestamp<this.model.plot.lod_interval?(this.interactive=!0,i=this.model.plot.lod_timeout,setTimeout(function(t){return function(){return t.interactive&&Date.now()-t.interactive_timestamp>i&&(t.interactive=!1),t.request_render()}}(this),i)):this.interactive=!1,a=this.renderer_views;for(o in a)if(l=a[o],null==this.range_update_timestamp||l.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}return this.update_constraints(),this.model.get("frame")._update_mappers(),e=this.canvas_view.ctx,e.pixel_ratio=s=this.canvas_view.pixel_ratio,e.save(),e.scale(s,s),e.translate(.5,.5),r=[this.canvas.vx_to_sx(this.frame.get("left")),this.canvas.vy_to_sy(this.frame.get("top")),this.frame.get("width"),this.frame.get("height")],this._map_hook(e,r),this._paint_empty(e,r),this.prepare_webgl(s,r),e.save(),this.visuals.outline_line.doit&&(this.visuals.outline_line.set_value(e),e.strokeRect.apply(e,r)),e.restore(),this._render_levels(e,["image","underlay","glyph"],r),this.blit_webgl(s),this._render_levels(e,["annotation"],r),this._render_levels(e,["overlay","tool"]),null==this.initial_range_info&&this.set_initial_range(),e.restore(),null!=this.model.document._unrendered_plots&&(delete this.model.document._unrendered_plots[this.id],m.isEmpty(this.model.document._unrendered_plots))?(this.model.document._unrendered_plots=null,m.delay(n.proxy(this.model.document.resize,this.model.document),1)):void 0;
}},e.prototype.resize=function(){var t,e,r,n;n=this.model._width._value,e=this.model._height._value,this.canvas_view.set_dims([n,e],!0),this.canvas_view.prepare_canvas();try{this.update_constraints()}catch(t){r=t}return this.$el.css({position:"absolute",left:this.model._dom_left._value,top:this.model._dom_top._value,width:this.model._width._value,height:this.model._height._value})},e.prototype.update_constraints=function(){var t,e,r,n;r=this.model.document.solver(),r.suggest_value(this.frame._width,this.canvas.get("width")-1),r.suggest_value(this.frame._height,this.canvas.get("height")-1),e=this.renderer_views;for(t in e)n=e[t],null!=n.model.panel&&k(n);return r.update_variables(!1)},e.prototype._render_levels=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,g;for(t.save(),null!=r&&(t.beginPath(),t.rect.apply(t,r),t.clip(),t.beginPath()),o={},p=this.model.plot.renderers,n=i=0,a=p.length;i<a;n=++i)_=p[n],o[_.id]=n;for(g=function(t){return o[t.model.id]},s=0,l=e.length;s<l;s++)for(h=e[s],f=m.sortBy(m.values(this.levels[h]),g),c=0,u=f.length;c<u;c++)d=f[c],d.render();return t.restore()},e.prototype._map_hook=function(t,e){},e.prototype._paint_empty=function(t,e){if(t.clearRect(0,0,this.canvas_view.mget("width"),this.canvas_view.mget("height")),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(0,0,this.canvas_view.mget("width"),this.canvas_view.mget("height")),t.clearRect.apply(t,e)),this.visuals.background_fill.doit)return this.visuals.background_fill.set_value(t),t.fillRect.apply(t,e)},e}(d.View),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return T(e,t),e.prototype.type="PlotCanvas",e.prototype.default_view=_,e.prototype.initialize=function(t,r){var n;return e.__super__.initialize.call(this,t,r),this.canvas=new o.Model({map:null!=(n=this.use_map)&&n,initial_width:this.plot.plot_width,initial_height:this.plot.plot_height,use_hidpi:this.plot.hidpi}),this.frame=new i.Model({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_mapper_type:this.plot.x_mapper_type,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_mapper_type:this.plot.y_mapper_type}),this.above_panel=new h.Model,this.below_panel=new h.Model,this.left_panel=new h.Model,this.right_panel=new h.Model,b.debug("PlotCanvas initialized")},e.prototype.add_renderer_to_canvas_side=function(t,e){if("center"!==e)return t.add_panel(e)},e.prototype._doc_attached=function(){return this.canvas.attach_document(this.document),this.frame.attach_document(this.document),this.above_panel.attach_document(this.document),this.below_panel.attach_document(this.document),this.left_panel.attach_document(this.document),this.right_panel.attach_document(this.document),b.debug("PlotCanvas attached to document")},e.override({sizing_mode:"stretch_both"}),e.internal({plot:[x.Instance],toolbar:[x.Instance],canvas:[x.Instance],frame:[x.Instance]}),e.prototype.get_layoutable_children=function(){var t,e,r,n,o,i,s,a,l;for(t=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],a=["above","below","left","right"],e=0,o=a.length;e<o;e++)for(l=a[e],n=this.plot.get(l),r=0,i=n.length;r<i;r++)s=n[r],null!=s.panel&&t.push(s.panel);return t},e.prototype.get_edit_variables=function(){var t,e,r,n,o;for(e=[],o=this.get_layoutable_children(),r=0,n=o.length;r<n;r++)t=o[r],e=e.concat(t.get_edit_variables());return e},e.prototype.get_constraints=function(){var t,r,n,o,i;for(r=e.__super__.get_constraints.call(this),r=r.concat(this._get_constant_constraints()),r=r.concat(this._get_side_constraints()),i=this.get_layoutable_children(),n=0,o=i.length;n<o;n++)t=i[n],r=r.concat(t.get_constraints());return r},e.prototype._get_constant_constraints=function(){var t,e,r,n,o;return o=this.plot.min_border_top,e=this.plot.min_border_bottom,r=this.plot.min_border_left,n=this.plot.min_border_right,t=[],t.push(l(this.above_panel._height,-o)),t.push(l(this.below_panel._height,-e)),t.push(l(this.left_panel._width,-r)),t.push(l(this.right_panel._width,-n)),t.push(a(this.above_panel._top,[-1,this.canvas._top])),t.push(a(this.above_panel._bottom,[-1,this.frame._top])),t.push(a(this.below_panel._bottom,[-1,this.canvas._bottom])),t.push(a(this.below_panel._top,[-1,this.frame._bottom])),t.push(a(this.left_panel._left,[-1,this.canvas._left])),t.push(a(this.left_panel._right,[-1,this.frame._left])),t.push(a(this.right_panel._right,[-1,this.canvas._right])),t.push(a(this.right_panel._left,[-1,this.frame._right])),t.push(a(this.above_panel._height,[-1,this._top])),t.push(a(this.above_panel._height,[-1,this.canvas._top],this.frame._top)),t.push(a(this.below_panel._height,[-1,this._height],this._bottom)),t.push(a(this.below_panel._height,[-1,this.frame._bottom])),t.push(a(this.left_panel._width,[-1,this._left])),t.push(a(this.left_panel._width,[-1,this.frame._left])),t.push(a(this.right_panel._width,[-1,this._width],this._right)),t.push(a(this.right_panel._width,[-1,this.canvas._right],this.frame._right)),t},e.prototype._get_side_constraints=function(){var t,e,r,n,o,i,s,l,u,h;for(t=[],u=["above","below","left","right"],e=0,i=u.length;e<i;e++){for(h=u[e],o=this.plot.get(h),n=this.frame,r=0,s=o.length;r<s;r++)l=o[r],"above"===h&&t.push(a(n.panel._top,[-1,l.panel._bottom])),"below"===h&&t.push(a(n.panel._bottom,[-1,l.panel._top])),"left"===h&&t.push(a(n.panel._left,[-1,l.panel._right])),"right"===h&&t.push(a(n.panel._right,[-1,l.panel._left])),n=l;0!==o.length&&("above"===h&&t.push(a(n.panel._top,[-1,this.above_panel._top])),"below"===h&&t.push(a(n.panel._bottom,[-1,this.below_panel._bottom])),"left"===h&&t.push(a(n.panel._left,[-1,this.left_panel._left])),"right"===h&&t.push(a(n.panel._right,[-1,this.right_panel._right])))}return t},e.prototype.plot_canvas=function(){return this},e}(c.Model),e.exports={Model:p,View:_}},{"../../common/build_views":"common/build_views","../../common/ui_events":"common/ui_events","../../core/enums":"core/enums","../../core/layout/layout_canvas":"core/layout/layout_canvas","../../core/layout/side_panel":"core/layout/side_panel","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../../core/util/throttle":"core/util/throttle","../canvas/canvas":"models/canvas/canvas","../canvas/cartesian_frame":"models/canvas/cartesian_frame","../layouts/layout_dom":"models/layouts/layout_dom","../ranges/data_range1d":"models/ranges/data_range1d","../renderers/glyph_renderer":"models/renderers/glyph_renderer","../renderers/renderer":"models/renderers/renderer",jquery:"jquery",underscore:"underscore"}],"models/ranges/data_range":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./range"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="DataRange",e.define({names:[s.Array,[]],renderers:[s.Array,[]]}),e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./range":"models/ranges/range",underscore:"underscore"}],"models/ranges/data_range1d":[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("./data_range"),a=t("../../core/logging").logger,l=t("../../core/properties"),s=t("../../core/util/bbox"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.type="DataRange1d",e.define({start:[l.Number],end:[l.Number],range_padding:[l.Number,.1],flipped:[l.Bool,!1],follow:[l.String],follow_interval:[l.Number],default_span:[l.Number,2],bounds:[l.Any],min_interval:[l.Any],max_interval:[l.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("min",function(){return Math.min(this.get("start"),this.get("end"))},!0),this.add_dependencies("min",this,["start","end"]),this.define_computed_property("max",function(){return Math.max(this.get("start"),this.get("end"))},!0),this.add_dependencies("max",this,["start","end"]),this.plot_bounds={},this.have_updated_interactively=!1,this._initial_start=this.get("start"),this._initial_end=this.get("end"),this._initial_range_padding=this.get("range_padding"),this._initial_follow=this.get("follow"),this._initial_follow_interval=this.get("follow_interval"),this._initial_default_span=this.get("default_span")},e.prototype.computed_renderers=function(){var t,e,r,n,o,i,s,l,u,h,c;if(i=this.get("names"),h=this.get("renderers"),0===h.length)for(u=this.get("plots"),e=0,n=u.length;e<n;e++)s=u[e],t=s.get("renderers"),c=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)l=t[e],"GlyphRenderer"===l.type&&n.push(l);return n}(),h=h.concat(c);for(i.length>0&&(h=function(){var t,e,r;for(r=[],t=0,e=h.length;t<e;t++)l=h[t],i.indexOf(l.get("name"))>=0&&r.push(l);return r}()),a.debug("computed "+h.length+" renderers for DataRange1d "+this.id),r=0,o=h.length;r<o;r++)l=h[r],a.trace(" - "+l.type+" "+l.id);return h},e.prototype._compute_plot_bounds=function(t,e){var r,n,o,i;for(i=s.empty(),r=0,n=t.length;r<n;r++)o=t[r],null!=e[o.id]&&(i=s.union(i,e[o.id]));return i},e.prototype._compute_min_max=function(t,e){var r,n,o,i,a,l,u;i=s.empty();for(r in t)u=t[r],i=s.union(i,u);return 0===e?(a=[i.minX,i.maxX],o=a[0],n=a[1]):(l=[i.minY,i.maxY],o=l[0],n=l[1]),[o,n]},e.prototype._compute_range=function(t,e){var r,n,o,i,s,a,l,u,h,c;return s=this.get("range_padding"),null!=s&&s>0?(h=e===t?this.get("default_span"):(e-t)*(1+s),r=(e+t)/2,a=[r-h/2,r+h/2],c=a[0],n=a[1]):(l=[t,e],c=l[0],n=l[1]),i=1,this.get("flipped")&&(u=[n,c],c=u[0],n=u[1],i=-1),o=this.get("follow_interval"),null!=o&&Math.abs(c-n)>o&&("start"===this.get("follow")?n=c+i*o:"end"===this.get("follow")&&(c=n-i*o)),[c,n]},e.prototype.update=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_;if(!this.have_updated_interactively)return p=this.computed_renderers(),this.plot_bounds[r]=this._compute_plot_bounds(p,t),u=this._compute_min_max(this.plot_bounds,e),a=u[0],s=u[1],h=this._compute_range(a,s),_=h[0],i=h[1],null!=this._initial_start&&(_=this._initial_start),null!=this._initial_end&&(i=this._initial_end),c=[this.get("start"),this.get("end")],o=c[0],n=c[1],_===o&&i===n||(l={},_!==o&&(l.start=_),i!==n&&(l.end=i),this.set(l)),"auto"===this.get("bounds")?this.set("bounds",[_,i]):void 0},e.prototype.reset=function(){return this.have_updated_interactively=!1,this.set({range_padding:this._initial_range_padding,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span})},e}(n.Model),e.exports={Model:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../../core/util/bbox":"core/util/bbox","./data_range":"models/ranges/data_range",underscore:"underscore"}],"models/ranges/factor_range":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./range"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="FactorRange",e.define({offset:[s.Number,0],factors:[s.Array,[]],bounds:[s.Any],min_interval:[s.Any],max_interval:[s.Any]}),e.internal({_bounds_as_factors:[s.Any],start:[s.Number],end:[s.Number]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),null!=this.get("bounds")&&"auto"!==this.get("bounds")?this.set("_bounds_as_factors",this.get("bounds")):this.set("_bounds_as_factors",this.get("factors")),this._init(),this.define_computed_property("min",function(){return this.get("start")},!1),this.add_dependencies("min",this,["factors","offset"]),this.define_computed_property("max",function(){return this.get("end")},!1),this.add_dependencies("max",this,["factors","offset"]),this.listenTo(this,"change:factors",this._update_factors),this.listenTo(this,"change:offset",this._init)},e.prototype.reset=function(){return this._init()},e.prototype._update_factors=function(){return this.set("_bounds_as_factors",this.get("factors")),this._init()},e.prototype._init=function(){var t,e,r;if(e=this.get("factors"),null!=this.get("bounds")&&"auto"!==this.get("bounds")&&(e=this.get("_bounds_as_factors"),this.set("factors",e)),r=.5+this.get("offset"),t=e.length+r,this.set("start",r),this.set("end",t),null!=this.get("bounds"))return this.set("bounds",[r,t])},e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./range":"models/ranges/range",underscore:"underscore"}],"models/ranges/range":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("../../model"),s=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="Range",e.define({callback:[s.Instance]}),e.internal({plots:[s.Array,[]]}),e.prototype.reset=function(){},e}(n),e.exports={Model:o}},{"../../core/properties":"core/properties","../../model":"model",underscore:"underscore"}],"models/ranges/range1d":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("./range"),s=t("../../core/properties"),o=function(t){function e(){var t,r;return this instanceof e?e.__super__.constructor.apply(this,arguments):(r=arguments[0],t=arguments[1],new e({start:r,end:t}))}return a(e,t),e.prototype.type="Range1d",e.define({start:[s.Number,0],end:[s.Number,1],bounds:[s.Any],min_interval:[s.Any],max_interval:[s.Any]}),e.prototype._set_auto_bounds=function(){var t,e;if("auto"===this.get("bounds"))return e=Math.min(this._initial_start,this._initial_end),t=Math.max(this._initial_start,this._initial_end),this.set("bounds",[e,t])},e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("min",function(){return Math.min(this.get("start"),this.get("end"))},!0),this.add_dependencies("min",this,["start","end"]),this.define_computed_property("max",function(){return Math.max(this.get("start"),this.get("end"))},!0),this.add_dependencies("max",this,["start","end"]),this._initial_start=this.get("start"),this._initial_end=this.get("end"),this._set_auto_bounds()},e.prototype.reset=function(){return this.set({start:this._initial_start,end:this._initial_end}),this._set_auto_bounds()},e}(n.Model),e.exports={Model:o}},{"../../core/properties":"core/properties","./range":"models/ranges/range",underscore:"underscore"}],"models/renderers/glyph_renderer":[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;a=t("underscore"),s=t("./renderer"),i=t("../sources/remote_data_source"),l=t("../../core/logging").logger,u=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.initialize=function(t){var r,n,o,s,l,u,h,c,p;if(e.__super__.initialize.call(this,t),r=this.mget("glyph"),s=a.contains(r.mixins,"fill"),l=a.contains(r.mixins,"line"),o=a.omit(a.clone(r.attributes),"id"),h=function(t){var e;return e=a.clone(o),s&&a.extend(e,t.fill),l&&a.extend(e,t.line),new r.constructor(e)},this.glyph=this.build_glyph_view(r),p=this.mget("selection_glyph"),null==p&&(p=h(this.model.selection_defaults)),this.selection_glyph=this.build_glyph_view(p),c=this.mget("nonselection_glyph"),null==c&&(c=h(this.model.nonselection_defaults)),this.nonselection_glyph=this.build_glyph_view(c),u=this.mget("hover_glyph"),null!=u&&(this.hover_glyph=this.build_glyph_view(u)),n=h(this.model.decimated_defaults),this.decimated_glyph=this.build_glyph_view(n),this.xmapper=this.plot_view.frame.get("x_mappers")[this.mget("x_range_name")],this.ymapper=this.plot_view.frame.get("y_mappers")[this.mget("y_range_name")],this.set_data(!1),this.mget("data_source")instanceof i.Model)return this.mget("data_source").setup(this.plot_view,this.glyph)},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,plot_model:this.plot_model})},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.request_render),this.listenTo(this.mget("data_source"),"change",this.set_data),this.listenTo(this.mget("data_source"),"patch",this.set_data),this.listenTo(this.mget("data_source"),"stream",this.set_data),this.listenTo(this.mget("data_source"),"select",this.request_render),null!=this.hover_glyph&&this.listenTo(this.mget("data_source"),"inspect",this.request_render),this.listenTo(this.mget("glyph"),"propchange",function(){return this.glyph.set_visuals(this.mget("data_source")),this.request_render()})},e.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},e.prototype.set_data=function(t,e){var r,n,o,i,s,a,u,h,c;for(null==t&&(t=!0),c=Date.now(),h=this.mget("data_source"),this.glyph.model.set({x_range_name:this.mget("x_range_name"),y_range_name:this.mget("y_range_name")},{silent:!0}),this.glyph.set_data(h,e),this.glyph.set_visuals(h),this.decimated_glyph.set_visuals(h),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(h),this.nonselection_glyph.set_visuals(h)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(h),i=h.get_length(),null==i&&(i=1),this.all_indices=function(){u=[];for(var t=0;0<=i?t<i:t>i;0<=i?t++:t--)u.push(t);return u}.apply(this),s=this.plot_model.plot.lod_factor,this.decimated=[],n=o=0,a=Math.floor(this.all_indices.length/s);0<=a?o<a:o>a;n=0<=a?++o:--o)this.decimated.push(this.all_indices[n*s]);if(r=Date.now()-c,l.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+r+"ms"),this.set_data_timestamp=Date.now(),t)return this.request_render()},e.prototype.render=function(){var t,e,r,n,o,i,s,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S;if(this.model.visible!==!1){if(M=Date.now(),s=this.glyph.glglyph,k=Date.now(),this.glyph.map_data(),e=Date.now()-M,j=Date.now(),c=s?this.all_indices:this.glyph._mask_data(this.all_indices),r=Date.now()-j,t=this.plot_view.canvas_view.ctx,t.save(),b=this.mget("data_source").get("selected"),b=b&&0!==b.length?b["0d"].glyph?c:b["1d"].indices.length>0?b["1d"].indices:[]:[],p=this.mget("data_source").get("inspected"),p=p&&0!==p.length?p["0d"].glyph?c:p["1d"].indices.length>0?p["1d"].indices:[]:[],g=this.plot_model.plot.lod_threshold,this.plot_view.interactive&&!s&&null!=g&&this.all_indices.length>g?(c=this.decimated,u=this.decimated_glyph,v=this.decimated_glyph,w=this.selection_glyph):(u=this.glyph,v=this.nonselection_glyph,w=this.selection_glyph),null!=this.hover_glyph&&p.length&&(c=a.without.bind(null,c).apply(null,p)),b.length&&this.have_selection_glyphs()){for(S=Date.now(),x={},_=0,f=b.length;_<f;_++)h=b[_],x[h]=!0;for(b=new Array,y=new Array,d=0,m=c.length;d<m;d++)h=c[d],null!=x[h]?b.push(h):y.push(h);o=Date.now()-S,T=Date.now(),v.render(t,y,this.glyph),w.render(t,b,this.glyph),null!=this.hover_glyph&&this.hover_glyph.render(t,p,this.glyph),n=Date.now()-T}else T=Date.now(),u.render(t,c,this.glyph),this.hover_glyph&&p.length&&this.hover_glyph.render(t,p,this.glyph),n=Date.now()-T;return this.last_dtrender=n,i=Date.now()-M,l.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): render finished in "+i+"ms"),l.trace(" - map_data finished in : "+e+"ms"),null!=r&&l.trace(" - mask_data finished in : "+r+"ms"),null!=o&&l.trace(" - selection mask finished in : "+o+"ms"),l.trace(" - glyph renders finished in : "+n+"ms"),t.restore()}},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.mget("x_range_name"),this.mget("y_range_name"))},e.prototype.draw_legend=function(t,e,r,n,o){return this.glyph.draw_legend(t,e,r,n,o)},e.prototype.hit_test=function(t){return this.glyph.hit_test(t)},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=o,e.prototype.type="GlyphRenderer",e.define({x_range_name:[u.String,"default"],y_range_name:[u.String,"default"],data_source:[u.Instance],glyph:[u.Instance],hover_glyph:[u.Instance],nonselection_glyph:[u.Instance],selection_glyph:[u.Instance]}),e.override({level:"glyph"}),e.prototype.selection_defaults={fill:{},line:{}},e.prototype.decimated_defaults={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},e.prototype.nonselection_defaults={fill:{fill_alpha:.2,line_alpha:.2},line:{}},e}(s.Model),e.exports={Model:n,View:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../sources/remote_data_source":"models/sources/remote_data_source","./renderer":"models/renderers/renderer",underscore:"underscore"}],"models/renderers/guide_renderer":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./renderer"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="GuideRenderer",e.define({plot:[s.Instance]}),e.override({level:"overlay"}),e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./renderer":"models/renderers/renderer",underscore:"underscore"}],"models/renderers/renderer":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x=function(t,e){function r(){this.constructor=t}for(var n in e)w.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},w={}.hasOwnProperty;u=t("underscore"),v=t("proj4"),b=v.defs("GOOGLE"),n=t("backbone"),o=t("../../core/bokeh_view"),f=t("../../core/util/color").color2rgba,m=t("../../core/logging").logger,y=t("../../core/properties"),g=t("../../core/property_mixins"),d=t("../../core/util/math").array_max,i=t("../../model"),h=function(t){function e(t,r){var n,o,i,s,a,l,h;for(null==t.prefix&&(t.prefix=""),e.__super__.constructor.call(this,t,r),this.cache={},a=this.get("obj"),l=this.get("prefix"),o=a.properties[l+this.do_attr].spec,this.doit=!u.isNull(o.value),h=this.attrs,i=0,s=h.length;i<s;i++)n=h[i],this[n]=a.properties[l+n]}return x(e,t),e.prototype.warm_cache=function(t){var e,r,n,o,i,s,a,l;for(a=this.attrs,l=[],r=0,n=a.length;r<n;r++)e=a[r],o=this.get("obj"),i=this.get("prefix"),s=o.properties[i+e],u.isUndefined(s.spec.value)?l.push(this.cache[e+"_array"]=s.array(t)):l.push(this.cache[e]=s.spec.value);return l},e.prototype.cache_select=function(t,e){var r,n,o;return r=this.get("obj"),n=this.get("prefix"),o=r.properties[n+t],u.isUndefined(o.spec.value)?this.cache[t]=this.cache[t+"_array"][e]:this.cache[t]=o.spec.value},e}(n.Model),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.attrs=u.keys(g.line()),e.prototype.do_attr="line_color",e.prototype.set_value=function(t){return t.strokeStyle=this.line_color.value(),t.globalAlpha=this.line_alpha.value(),t.lineWidth=this.line_width.value(),t.lineJoin=this.line_join.value(),t.lineCap=this.line_cap.value(),t.setLineDash(this.line_dash.value()),t.setLineDashOffset(this.line_dash_offset.value())},e.prototype.set_vectorize=function(t,e){if(this.cache_select("line_color",e),t.strokeStyle!==this.cache.line_color&&(t.strokeStyle=this.cache.line_color),this.cache_select("line_alpha",e),t.globalAlpha!==this.cache.line_alpha&&(t.globalAlpha=this.cache.line_alpha),this.cache_select("line_width",e),t.lineWidth!==this.cache.line_width&&(t.lineWidth=this.cache.line_width),this.cache_select("line_join",e),t.lineJoin!==this.cache.line_join&&(t.lineJoin=this.cache.line_join),this.cache_select("line_cap",e),t.lineCap!==this.cache.line_cap&&(t.lineCap=this.cache.line_cap),this.cache_select("line_dash",e),t.getLineDash()!==this.cache.line_dash&&t.setLineDash(this.cache.line_dash),this.cache_select("line_dash_offset",e),t.getLineDashOffset()!==this.cache.line_dash_offset)return t.setLineDashOffset(this.cache.line_dash_offset)},e.prototype.color_value=function(){var t;return t=f(this.line_color.value(),this.line_alpha.value()),"rgba("+255*t[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e}(h),c=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.attrs=u.keys(g.fill()),e.prototype.do_attr="fill_color",e.prototype.set_value=function(t){return t.fillStyle=this.fill_color.value(),t.globalAlpha=this.fill_alpha.value()},e.prototype.set_vectorize=function(t,e){if(this.cache_select("fill_color",e),t.fillStyle!==this.cache.fill_color&&(t.fillStyle=this.cache.fill_color),this.cache_select("fill_alpha",e),t.globalAlpha!==this.cache.fill_alpha)return t.globalAlpha=this.cache.fill_alpha},e.prototype.color_value=function(){var t;return t=f(this.fill_color.value(),this.fill_alpha.value()),"rgba("+255*t[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e}(h),_=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.attrs=u.keys(g.text()),e.prototype.do_attr="text_color",e.prototype.cache_select=function(t,r){var n;return"font"===t?(n=e.__super__.cache_select.call(this,"text_font_style",r)+" "+e.__super__.cache_select.call(this,"text_font_size",r)+" "+e.__super__.cache_select.call(this,"text_font",r),this.cache.font=n):e.__super__.cache_select.call(this,t,r)},e.prototype.font_value=function(){var t,e,r;return t=this.text_font.value(),e=this.text_font_size.value(),r=this.text_font_style.value(),r+" "+e+" "+t},e.prototype.color_value=function(){var t;return t=f(this.text_color.value(),this.text_alpha.value()),"rgba("+255*t[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e.prototype.set_value=function(t){return t.font=this.font_value(),t.fillStyle=this.text_color.value(),t.globalAlpha=this.text_alpha.value(),t.textAlign=this.text_align.value(),t.textBaseline=this.text_baseline.value()},e.prototype.set_vectorize=function(t,e){if(this.cache_select("font",e),t.font!==this.cache.font&&(t.font=this.cache.font),this.cache_select("text_color",e),t.fillStyle!==this.cache.text_color&&(t.fillStyle=this.cache.text_color),this.cache_select("text_alpha",e),t.globalAlpha!==this.cache.text_alpha&&(t.globalAlpha=this.cache.text_alpha),this.cache_select("text_align",e),t.textAlign!==this.cache.text_align&&(t.textAlign=this.cache.text_align),this.cache_select("text_baseline",e),t.textBaseline!==this.cache.text_baseline)return t.textBaseline=this.cache.text_baseline},e}(h),l={line:p,fill:c,text:_},a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.initialize=function(t){var r,n,o,i,s,a,u,h;for(e.__super__.initialize.call(this,t),this.plot_model=t.plot_model,this.plot_view=t.plot_view,this.nohit_warned={},this.visuals={},s=this.model.mixins,u=[],r=0,n=s.length;r<n;r++)h=s[r],a=h.split(":"),o=a[0],i=a[1],null==i&&(i=""),u.push(this.visuals[i+o]=new l[o]({obj:this.model,prefix:i}));return u},e.prototype.bind_bokeh_events=function(){},e.prototype.request_render=function(){return this.plot_view.request_render()},e.prototype.map_data=function(){var t,e,r,n,o,i,s,a,l,h,c,p,_,d,f,m,g;for(o=this.model._coords,e=0,n=o.length;e<n;e++)if(i=o[e],m=i[0],g=i[1],_="s"+m,f="s"+g,m="_"+m,g="_"+g,u.isArray(null!=(s=this[m])?s[0]:void 0))for(a=[[],[]],this[_]=a[0],this[f]=a[1],t=r=0,l=this[m].length;0<=l?r<l:r>l;t=0<=l?++r:--r)h=this.map_to_screen(this[m][t],this[g][t]),p=h[0],d=h[1],this[_].push(p),this[f].push(d);else c=this.map_to_screen(this[m],this[g]),this[_]=c[0],this[f]=c[1];return this._map_data()},e.prototype.project_xy=function(t,e){var r,n,o,i,s,a,l,u;for(i=[],a=[],r=n=0,l=t.length;0<=l?n<l:n>l;r=0<=l?++n:--n)u=v(b,[t[r],e[r]]),o=u[0],s=u[1],i[r]=o,a[r]=s;return[i,a]},e.prototype.project_xsys=function(t,e){var r,n,o,i,s,a,l,u;for(i=[],a=[],r=n=0,l=t.length;0<=l?n<l:n>l;r=0<=l?++n:--n)u=this.project_xy(t[r],e[r]),o=u[0],s=u[1],i[r]=o,a[r]=s;return[i,a]},e.prototype.set_data=function(t){var e,r,n,o,i;n=this.model.properties;for(e in n)r=n[e],r.dataspec&&(!r.optional||null!==r.spec.value||e in this.model._set_after_defaults)&&(this["_"+e]=r.array(t),r instanceof y.Distance&&(this["max_"+e]=d(this["_"+e])));return this.plot_model.use_map&&(null!=this._x&&(o=this.project_xy(this._x,this._y),this._x=o[0],this._y=o[1]),null!=this._xs&&(i=this.project_xsys(this._xs,this._ys),this._xs=i[0],this._ys=i[1])),null!=this.glglyph&&this.glglyph.set_data_changed(this._x.length),this._set_data(),this.index=this._index_data()},e.prototype.set_visuals=function(t){var e,r,n;n=this.visuals;for(e in n)r=n[e],r.warm_cache(t);if(null!=this.glglyph)return this.glglyph.set_visuals_changed()},e.prototype._set_data=function(){return null},e.prototype._map_data=function(){return null},e.prototype._index_data=function(){return null},e.prototype._mask_data=function(t){return t},e.prototype._bounds=function(t){return t},e.prototype.hit_test=function(t){var e,r;return r=null,e="_hit_"+t.type,null!=this[e]?r=this[e](t):null==this.nohit_warned[t.type]&&(m.debug("'"+t.type+"' selection not available for "+this.model.type),this.nohit_warned[t.type]=!0),r},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.mget("x_range_name"),this.mget("y_range_name"))},e}(o),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return x(e,t),e.prototype.type="Renderer",e.define({level:[y.RenderLevel,null],visible:[y.Bool,!0]}),e}(i),e.exports={Model:s,View:a,Visuals:l}},{"../../core/bokeh_view":"core/bokeh_view","../../core/logging":"core/logging","../../core/properties":"core/properties","../../core/property_mixins":"core/property_mixins","../../core/util/color":"core/util/color","../../core/util/math":"core/util/math","../../model":"model",backbone:"backbone",proj4:"proj4",underscore:"underscore"}],"models/sources/ajax_data_source":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){return function(){return t.apply(e,arguments)}},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;n=t("jquery"),s=t("underscore"),i=t("./remote_data_source"),a=t("../../core/logging").logger,l=t("../../core/properties"),o=function(t){function e(){return this.get_data=u(this.get_data,this),this.setup=u(this.setup,this),this.destroy=u(this.destroy,this),e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="AjaxDataSource",e.define({mode:[l.String,"replace"],content_type:[l.String,"application/json"],http_headers:[l.Any,{}],max_size:[l.Number],method:[l.String,"POST"],if_modified:[l.Bool,!1]}),e.prototype.destroy=function(){if(null!=this.interval)return clearInterval(this.interval)},e.prototype.setup=function(t,e){if(this.pv=t,this.get_data(this.get("mode")),this.get("polling_interval"))return this.interval=setInterval(this.get_data,this.get("polling_interval"),this.get("mode"),this.get("max_size"),this.get("if_modified"))},e.prototype.get_data=function(t,e,r){return null==e&&(e=0),null==r&&(r=!1),n.ajax({dataType:"json",ifModified:r,url:this.get("data_url"),xhrField:{withCredentials:!0},method:this.get("method"),contentType:this.get("content_type"),headers:this.get("http_headers")}).done(function(r){return function(n){var o,i,s,l,u;if("replace"===t)r.set("data",n);else if("append"===t){
for(l=r.get("data"),u=r.columns(),i=0,s=u.length;i<s;i++)o=u[i],n[o]=l[o].concat(n[o]).slice(-e);r.set("data",n)}else a.error("unsupported mode: "+t);return a.trace(n),null}}(this)).error(function(){return a.error(arguments)}),null},e}(i.Model),e.exports={Model:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./remote_data_source":"models/sources/remote_data_source",jquery:"jquery",underscore:"underscore"}],"models/sources/column_data_source":[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"),o=t("./data_source"),a=t("../../common/hittest"),i=t("../../common/selection_manager"),l=t("../../core/logging").logger,u=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="ColumnDataSource",e.define({data:[u.Any,{}],column_names:[u.Array,[]]}),e.internal({selection_manager:[u.Instance,function(t){return new i({source:t})}],inspected:[u.Any]}),e.prototype.get_column=function(t){var e;return null!=(e=this.get("data")[t])?e:null},e.prototype.get_length=function(){var t,e,r,n;return t=this.get("data"),0===s.keys(t).length?null:(r=s.uniq(function(){var r;r=[];for(e in t)n=t[e],r.push(n.length);return r}()),r.length>1&&l.debug("data source has columns of inconsistent lengths"),r[0])},e.prototype.columns=function(){return s.keys(this.get("data"))},e.prototype.stream=function(t,e){var r,n,o;r=this.get("data");for(n in t)o=t[n],r[n]=r[n].concat(t[n]),r[n].length>e&&(r[n]=r[n].slice(-e));return this.set("data",r,{silent:!0}),this.trigger("stream")},e.prototype.patch=function(t){var e,r,n,o,i,s,a,l,u;e=this.get("data");for(i in t)for(s=t[i],r=o=0,a=s.length;0<=a?o<a:o>a;r=0<=a?++o:--o)l=s[r],n=l[0],u=l[1],e[i][n]=u;return this.set("data",e,{silent:!0}),this.trigger("patch")},e}(o.Model),e.exports={Model:n}},{"../../common/hittest":"common/hittest","../../common/selection_manager":"common/selection_manager","../../core/logging":"core/logging","../../core/properties":"core/properties","./data_source":"models/sources/data_source",underscore:"underscore"}],"models/sources/data_source":[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"),o=t("../../model"),s=t("../../common/hittest"),a=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="DataSource",e.define({selected:[a.Any,s.create_hit_test_result()],callback:[a.Any]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this,"change:selected",function(t){return function(){var e;if(e=t.get("callback"),null!=e)return i.isFunction(e)?e(t):e.execute(t)}}(this))},e}(o),e.exports={Model:n}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../../model":"model",underscore:"underscore"}],"models/sources/geojson_data_source":[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("./column_data_source"),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="GeoJSONDataSource",e.define({geojson:[a.Any]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.geojson_to_column_data(),this.define_computed_property("data",this.geojson_to_column_data,!0),this.add_dependencies("data",this,["geojson"])},e.prototype._get_new_list_array=function(t){var e,r;return e=new Array(t),r=i.map(e,function(t){return[]})},e.prototype._get_new_nan_array=function(t){var e,r;return e=new Array(t),r=i.map(e,function(t){return NaN})},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,r,n){var o,i;i=[];for(o in t.properties)e.hasOwnProperty(o)||(e[o]=this._get_new_nan_array(n)),i.push(e[o][r]=t.properties[o]);return i},e.prototype._add_geometry=function(t,e,r){var n,o,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A;switch(t.type){case"Point":return o=t.coordinates,e.x[r]=o[0],e.y[r]=o[1],e.z[r]=null!=(w=o[2])?w:NaN;case"LineString":for(n=t.coordinates,z=[],h=c=0,_=n.length;c<_;h=++c)o=n[h],e.xs[r][h]=o[0],e.ys[r][h]=o[1],z.push(e.zs[r][h]=null!=(M=o[2])?M:NaN);return z;case"Polygon":for(t.coordinates.length>1&&s.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),a=t.coordinates[0],P=[],h=p=0,d=a.length;p<d;h=++p)o=a[h],e.xs[r][h]=o[0],e.ys[r][h]=o[1],P.push(e.zs[r][h]=null!=(k=o[2])?k:NaN);return P;case"MultiPoint":return s.warn("MultiPoint not supported in Bokeh");case"MultiLineString":for(u=i.reduce(t.coordinates,this._flatten_function),E=[],h=y=0,f=u.length;y<f;h=++y)o=u[h],e.xs[r][h]=o[0],e.ys[r][h]=o[1],E.push(e.zs[r][h]=null!=(j=o[2])?j:NaN);return E;case"MultiPolygon":for(l=[],T=t.coordinates,v=0,m=T.length;v<m;v++)x=T[v],x.length>1&&s.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),l.push(x[0]);for(u=i.reduce(l,this._flatten_function),A=[],h=b=0,g=u.length;b<g;h=++b)o=u[h],e.xs[r][h]=o[0],e.ys[r][h]=o[1],A.push(e.zs[r][h]=null!=(S=o[2])?S:NaN);return A;default:throw new Error("Invalid type "+t.type)}},e.prototype._get_items_length=function(t){var e,r,n,o,i,s,a,l,u,h,c;for(e=0,o=a=0,u=t.length;a<u;o=++a)if(i=t[o],n="Feature"===i.type?i.geometry:i,"GeometryCollection"===n.type)for(c=n.geometries,s=l=0,h=c.length;l<h;s=++l)r=c[s],e+=1;else e+=1;return e},e.prototype.geojson_to_column_data=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f;if(n=JSON.parse(this.get("geojson")),"GeometryCollection"!==(d=n.type)&&"FeatureCollection"!==d)throw new Error("Bokeh only supports type GeometryCollection and FeatureCollection at top level");if("GeometryCollection"===n.type){if(null==n.geometries)throw new Error("No geometries found in GeometryCollection");if(0===n.geometries.length)throw new Error("geojson.geometries must have one or more items");l=n.geometries}if("FeatureCollection"===n.type){if(null==n.features)throw new Error("No features found in FeaturesCollection");if(0===n.features.length)throw new Error("geojson.features must have one or more items");l=n.features}for(a=this._get_items_length(l),e={x:this._get_new_nan_array(a),y:this._get_new_nan_array(a),z:this._get_new_nan_array(a),xs:this._get_new_list_array(a),ys:this._get_new_list_array(a),zs:this._get_new_list_array(a)},t=0,i=h=0,p=l.length;h<p;i=++h)if(s=l[i],o="Feature"===s.type?s.geometry:s,"GeometryCollection"===o.type)for(f=o.geometries,u=c=0,_=f.length;c<_;u=++c)r=f[u],this._add_geometry(r,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;else this._add_geometry(o,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;return e},e}(n.Model),e.exports={Model:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./column_data_source":"models/sources/column_data_source",underscore:"underscore"}],"models/sources/remote_data_source":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("./column_data_source"),s=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="RemoteDataSource",e.define({data_url:[s.String],polling_interval:[s.Number]}),e}(n.Model),e.exports={Model:o}},{"../../core/properties":"core/properties","./column_data_source":"models/sources/column_data_source",underscore:"underscore"}],"models/tickers/adaptive_ticker":[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;i=t("underscore"),s=t("./util").argmin,o=t("./continuous_ticker"),u=t("../../core/properties"),a=function(t,e,r){return Math.max(e,Math.min(r,t))},l=function(t,e){return null==e&&(e=Math.E),Math.log(t)/Math.log(e)},n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="AdaptiveTicker",e.define({base:[u.Number,10],mantissas:[u.Array,[1,2,5]],min_interval:[u.Number,0],max_interval:[u.Number]}),e.prototype.initialize=function(t,r){var n,o;return e.__super__.initialize.call(this,t,r),n=i.last(this.get("mantissas"))/this.get("base"),o=i.first(this.get("mantissas"))*this.get("base"),this.extended_mantissas=i.flatten([n,this.get("mantissas"),o]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},e.prototype.get_interval=function(t,e,r){var n,o,i,u,h,c,p,_,d;return i=e-t,h=this.get_ideal_interval(t,e,r),d=Math.floor(l(h/this.base_factor,this.get("base"))),c=Math.pow(this.get("base"),d)*this.base_factor,p=h/c,o=this.extended_mantissas,u=o.map(function(t){return Math.abs(r-i/(t*c))}),n=o[s(u)],_=n*c,a(_,this.get_min_interval(),this.get_max_interval())},e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./continuous_ticker":"models/tickers/continuous_ticker","./util":"models/tickers/util",underscore:"underscore"}],"models/tickers/basic_ticker":[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("./adaptive_ticker"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="BasicTicker",e}(n.Model),e.exports={Model:o}},{"./adaptive_ticker":"models/tickers/adaptive_ticker",underscore:"underscore"}],"models/tickers/categorical_ticker":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;o=t("./ticker"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="CategoricalTicker",e.prototype.get_ticks=function(t,e,r,n){var o,i,s,a,l,u,h;for(o=n.desired_n_ticks,u=[],i=r.get("factors"),s=l=0,h=i.length;0<=h?l<h:l>h;s=0<=h?++l:--l)a=s+r.get("offset"),a+1>t&&a+1<e&&u.push(i[s]);return{major:u,minor:[]}},e}(o.Model),e.exports={Model:n}},{"./ticker":"models/tickers/ticker"}],"models/tickers/composite_ticker":[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"),o=t("./continuous_ticker"),s=t("./util").argmin,a=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="CompositeTicker",e.define({tickers:[a.Array,[]]}),e.prototype.initialize=function(t,r){var n;return e.__super__.initialize.call(this,t,r),n=this.get("tickers"),this.define_computed_property("min_intervals",function(){return i.invoke(n,"get_min_interval")},!0),this.add_dependencies("min_intervals",this,["tickers"]),this.define_computed_property("max_intervals",function(){return i.invoke(n,"get_max_interval")},!0),this.add_dependencies("max_intervals",this,["tickers"]),this.define_computed_property("min_interval",function(){return i.first(this.get("min_intervals"))},!0),this.add_dependencies("min_interval",this,["min_intervals"]),this.define_computed_property("max_interval",function(){return i.first(this.get("max_intervals"))},!0),this.add_dependencies("max_interval",this,["max_interval"])},e.prototype.get_best_ticker=function(t,e,r){var n,o,a,l,u,h,c,p;return l=e-t,h=this.get_ideal_interval(t,e,r),p=[i.sortedIndex(this.get("min_intervals"),h)-1,i.sortedIndex(this.get("max_intervals"),h)],c=[this.get("min_intervals")[p[0]],this.get("max_intervals")[p[1]]],u=c.map(function(t){return Math.abs(r-l/t)}),n=s(u),n===1/0?this.get("tickers")[0]:(a=p[n],o=this.get("tickers")[a])},e.prototype.get_interval=function(t,e,r){var n;return n=this.get_best_ticker(t,e,r),n.get_interval(t,e,r)},e.prototype.get_ticks_no_defaults=function(t,e,r){var n,o;return n=this.get_best_ticker(t,e,r),o=n.get_ticks_no_defaults(t,e,r)},e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./continuous_ticker":"models/tickers/continuous_ticker","./util":"models/tickers/util",underscore:"underscore"}],"models/tickers/continuous_ticker":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./ticker"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="ContinuousTicker",e.define({num_minor_ticks:[s.Number,5],desired_num_ticks:[s.Number,6]}),e.prototype.get_interval=void 0,e.prototype.get_min_interval=function(){return this.get("min_interval")},e.prototype.get_max_interval=function(){var t;return null!=(t=this.get("max_interval"))?t:1/0},e.prototype.get_ideal_interval=function(t,e,r){var n;return n=e-t,n/r},e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./ticker":"models/tickers/ticker",underscore:"underscore"}],"models/tickers/datetime_ticker":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m=function(t,e){function r(){this.constructor=t}for(var n in e)g.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},g={}.hasOwnProperty;d=t("underscore"),n=t("./adaptive_ticker"),o=t("./composite_ticker"),s=t("./days_ticker"),a=t("./months_ticker"),_=t("./years_ticker"),f=t("./util"),u=f.ONE_MILLI,p=f.ONE_SECOND,h=f.ONE_MINUTE,l=f.ONE_HOUR,c=f.ONE_MONTH,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return m(e,t),e.prototype.type="DatetimeTicker",e.override({num_minor_ticks:0,tickers:function(){return[new n.Model({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*u,num_minor_ticks:0}),new n.Model({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:p,max_interval:30*h,num_minor_ticks:0}),new n.Model({mantissas:[1,2,4,6,8,12],base:24,min_interval:l,max_interval:12*l,num_minor_ticks:0}),new s.Model({days:d.range(1,32)}),new s.Model({days:d.range(1,31,3)}),new s.Model({days:[1,8,15,22]}),new s.Model({days:[1,15]}),new a.Model({months:d.range(0,12,1)}),new a.Model({months:d.range(0,12,2)}),new a.Model({months:d.range(0,12,4)}),new a.Model({months:d.range(0,12,6)}),new _.Model({})]}}),e}(o.Model),e.exports={Model:i}},{"./adaptive_ticker":"models/tickers/adaptive_ticker","./composite_ticker":"models/tickers/composite_ticker","./days_ticker":"models/tickers/days_ticker","./months_ticker":"models/tickers/months_ticker","./util":"models/tickers/util","./years_ticker":"models/tickers/years_ticker",underscore:"underscore"}],"models/tickers/days_ticker":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;s=t("underscore"),i=t("./single_interval_ticker"),c=t("./util"),h=t("../../core/properties"),a=c.copy_date,u=c.last_month_no_later_than,o=c.ONE_DAY,l=function(t,e){var r,n,o,i,s;for(s=u(new Date(t)),o=u(new Date(e)),i=a(o),o.setUTCMonth(o.getUTCMonth()+1),n=[],r=s;;)if(n.push(a(r)),r.setUTCMonth(r.getUTCMonth()+1),r>o)break;return n},n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.type="DaysTicker",e.define({days:[h.Array,[]]}),e.prototype.initialize=function(t,r){var n,i;return t.num_minor_ticks=0,e.__super__.initialize.call(this,t,r),n=this.get("days"),i=n.length>1?(n[1]-n[0])*o:31*o,this.set("interval",i)},e.prototype.get_ticks_no_defaults=function(t,e,r){var n,o,i,u,h,c,p,_;return p=l(t,e),u=this.get("days"),h=function(t){return function(t,e){var r,n,o,i,s,l;for(r=[],s=0,l=u.length;s<l;s++)n=u[s],o=a(t),o.setUTCDate(n),i=new Date(o.getTime()+e/2),i.getUTCMonth()===t.getUTCMonth()&&r.push(o);return r}}(this),c=this.get("interval"),i=s.flatten(function(){var t,e,r;for(r=[],t=0,e=p.length;t<e;t++)o=p[t],r.push(h(o,c));return r}()),n=s.invoke(i,"getTime"),_=s.filter(n,function(r){return t<=r&&r<=e}),{major:_,minor:[]}},e}(i.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./single_interval_ticker":"models/tickers/single_interval_ticker","./util":"models/tickers/util",underscore:"underscore"}],"models/tickers/fixed_ticker":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("./continuous_ticker"),s=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="FixedTicker",e.define({ticks:[s.Array,[]]}),e.prototype.get_ticks_no_defaults=function(t,e,r){return{major:this.get("ticks"),minor:[]}},e}(n.Model),e.exports={Model:o}},{"../../core/properties":"core/properties","./continuous_ticker":"models/tickers/continuous_ticker",underscore:"underscore"}],"models/tickers/log_ticker":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("./adaptive_ticker"),s=function(t,e,r){var n,o;if(i.isUndefined(e)&&(e=t,t=0),i.isUndefined(r)&&(r=1),r>0&&t>=e||r<0&&t<=e)return[];for(o=[],n=t;r>0?n<e:n>e;)o.push(n),n+=r;return o},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="LogTicker",e.override({mantissas:[1,5]}),e.prototype.get_ticks_no_defaults=function(t,e,r){var n,o,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D;if(P=this.get("num_minor_ticks"),S=[],t<=0&&(t=1),t>e&&(A=[e,t],t=A[0],e=A[1]),n=this.get("base"),M=Math.log(t)/Math.log(n),x=Math.log(e)/Math.log(n),w=x-M,w<2){if(c=this.get_interval(t,e,r),C=Math.floor(t/c),o=Math.ceil(e/c),u=i.isNaN(C)||i.isNaN(o)?[]:i.range(C,o+1),q=function(){var t,e,r;for(r=[],t=0,e=u.length;t<e;t++)l=u[t],0!==l&&r.push(l*c);return r}(),P>1){for(j=c/P,T=function(){var t,e,r;for(r=[],h=t=1,e=P;1<=e?t<=e:t>=e;h=1<=e?++t:--t)r.push(h*j);return r}(),p=0,f=T.length;p<f;p++)D=T[p],S.push(q[0]-D);for(_=0,m=q.length;_<m;_++)for(O=q[_],d=0,g=T.length;d<g;d++)D=T[d],S.push(O+D)}}else if(N=Math.ceil(M),a=Math.floor(x),c=Math.ceil((a-N)/9),q=s(N,a,c),(a-N)%c===0&&(q=q.concat([a])),q=q.map(function(t){return Math.pow(n,t)}),P>1){for(j=Math.pow(n,c)/P,T=function(){var t,e,r;for(r=[],h=t=1,e=P;1<=e?t<=e:t>=e;h=1<=e?++t:--t)r.push(h*j);return r}(),k=0,y=T.length;k<y;k++)D=T[k],S.push(q[0]/D);for(z=0,v=q.length;z<v;z++)for(O=q[z],E=0,b=T.length;E<b;E++)D=T[E],S.push(O*D)}return{major:q,minor:S}},e}(n.Model),e.exports={Model:o}},{"./adaptive_ticker":"models/tickers/adaptive_ticker",underscore:"underscore"}],"models/tickers/months_ticker":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;s=t("underscore"),i=t("./single_interval_ticker"),c=t("./util"),h=t("../../core/properties"),a=c.copy_date,u=c.last_year_no_later_than,o=c.ONE_MONTH,l=function(t,e){var r,n,o,i;for(i=u(new Date(t)),o=u(new Date(e)),o.setUTCFullYear(o.getUTCFullYear()+1),n=[],r=i;;)if(n.push(a(r)),r.setUTCFullYear(r.getUTCFullYear()+1),r>o)break;return n},n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.type="MonthsTicker",e.define({months:[h.Array,[]]}),e.prototype.initialize=function(t,r){var n,i;return e.__super__.initialize.call(this,t,r),i=this.get("months"),n=i.length>1?(i[1]-i[0])*o:12*o,this.set("interval",n)},e.prototype.get_ticks_no_defaults=function(t,e,r){var n,o,i,u,h,c,p;return p=l(t,e),u=this.get("months"),h=function(t){return u.map(function(e){var r;return r=a(t),r.setUTCMonth(e),r})},i=s.flatten(function(){var t,e,r;for(r=[],t=0,e=p.length;t<e;t++)o=p[t],r.push(h(o));return r}()),n=s.invoke(i,"getTime"),c=s.filter(n,function(r){return t<=r&&r<=e}),{major:c,minor:[]}},e}(i.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","./single_interval_ticker":"models/tickers/single_interval_ticker","./util":"models/tickers/util",underscore:"underscore"}],"models/tickers/single_interval_ticker":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),n=t("./continuous_ticker"),s=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="SingleIntervalTicker",e.define({interval:[s.Number]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("min_interval",function(){return this.get("interval")},!0),this.add_dependencies("min_interval",this,["interval"]),this.define_computed_property("max_interval",function(){return this.get("interval")},!0),this.add_dependencies("max_interval",this,["interval"])},e.prototype.get_interval=function(t,e,r){return this.get("interval")},e}(n.Model),e.exports={Model:o}},{"../../core/properties":"core/properties","./continuous_ticker":"models/tickers/continuous_ticker",underscore:"underscore"}],"models/tickers/ticker":[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("../../model"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="Ticker",e.prototype.get_ticks=function(t,e,r,n){var o;return o=n.desired_n_ticks,this.get_ticks_no_defaults(t,e,this.get("desired_num_ticks"))},e.prototype.get_ticks_no_defaults=function(t,e,r){var n,o,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w;if(l=this.get_interval(t,e,r),v=Math.floor(t/l),n=Math.ceil(e/l),s=i.isNaN(v)||i.isNaN(n)?[]:i.range(v,n+1),x=function(){var t,e,r;for(r=[],t=0,e=s.length;t<e;t++)o=s[t],r.push(o*l);return r}(),y=this.get("num_minor_ticks"),g=[],y>1){for(f=l/y,m=function(){var t,e,r;for(r=[],a=t=1,e=y;1<=e?t<=e:t>=e;a=1<=e?++t:--t)r.push(a*f);return r}(),u=0,p=m.length;u<p;u++)w=m[u],g.push(x[0]-w);for(h=0,_=x.length;h<_;h++)for(b=x[h],c=0,d=m.length;c<d;c++)w=m[c],g.push(b+w)}return{major:x,minor:g}},e}(n),e.exports={Model:o}},{"../../model":"model",underscore:"underscore"}],"models/tickers/util":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d;h=t("underscore"),i=1,l=1e3,s=60*l,o=60*s,n=24*o,a=30*n,u=365*n,c=function(t){var e;return e=h.min(h.range(t.length),function(e){return t[e]})},p=function(t){return new Date(t.getTime())},_=function(t){return t=p(t),t.setUTCDate(1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t},d=function(t){return t=_(t),t.setUTCMonth(0),t},e.exports={argmin:c,copy_date:p,last_month_no_later_than:_,last_year_no_later_than:d,ONE_MILLI:i,ONE_SECOND:l,ONE_MINUTE:s,ONE_HOUR:o,ONE_DAY:n,ONE_MONTH:a,ONE_YEAR:u}},{underscore:"underscore"}],"models/tickers/years_ticker":[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;a=t("underscore"),n=t("./basic_ticker"),i=t("./single_interval_ticker"),u=t("./util"),l=u.last_year_no_later_than,o=u.ONE_YEAR,s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="YearsTicker",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.set("interval",o),this.basic_ticker=new n.Model({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,r){var n,o,i,s,u,h;return i=l(new Date(t)).getUTCFullYear(),o=l(new Date(e)).getUTCFullYear(),h=this.basic_ticker.get_ticks_no_defaults(i,o,r).major,n=function(){var t,e,r;for(r=[],t=0,e=h.length;t<e;t++)u=h[t],r.push(Date.UTC(u,0,1));return r}(),s=a.filter(n,function(r){return t<=r&&r<=e}),{major:s,minor:[]}},e}(i.Model),e.exports={Model:s}},{"./basic_ticker":"models/tickers/basic_ticker","./single_interval_ticker":"models/tickers/single_interval_ticker","./util":"models/tickers/util",underscore:"underscore"}],"models/tiles/bbox_tile_source":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./mercator_tile_source"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="BBoxTileSource",e.define({use_latlon:[s.Bool,!1]}),e.prototype.get_image_url=function(t,e,r){var n,o,i,s,a,l,u;return n=this.string_lookup_replace(this.get("url"),this.get("extra_url_vars")),this.get("use_latlon")?(o=this.get_tile_geographic_bounds(t,e,r),a=o[0],u=o[1],s=o[2],l=o[3]):(i=this.get_tile_meter_bounds(t,e,r),a=i[0],u=i[1],s=i[2],l=i[3]),n.replace("{XMIN}",a).replace("{YMIN}",u).replace("{XMAX}",s).replace("{YMAX}",l)},e}(o),e.exports={Model:n}},{"../../core/properties":"core/properties","./mercator_tile_source":"models/tiles/mercator_tile_source",underscore:"underscore"}],"models/tiles/dynamic_image_renderer":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){return function(){return t.apply(e,arguments)}},c=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;a=t("underscore"),i=t("./image_pool"),s=t("../renderers/renderer"),l=t("../../core/logging").logger,u=t("../../core/properties"),o=function(t){function e(){return this._on_image_error=h(this._on_image_error,this),this._on_image_load=h(this._on_image_load,this),e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.request_render)},e.prototype.get_extent=function(){return[this.x_range.get("start"),this.y_range.get("start"),this.x_range.get("end"),this.y_range.get("end")]},e.prototype._set_data=function(){return this.map_plot=this.plot_view.model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_view.frame,this.x_range=this.map_plot.get("x_range"),this.x_mapper=this.map_frame.get("x_mappers")["default"],this.y_range=this.map_plot.get("y_range"),this.y_mapper=this.map_frame.get("y_mappers")["default"],this.lastImage=void 0,this.extent=this.get_extent()},e.prototype._map_data=function(){return this.initial_extent=this.get_extent()},e.prototype._on_image_load=function(t){var e;if(e=t.target.image_data,e.img=t.target,e.loaded=!0,this.lastImage=e,this.get_extent().join(":")===e.cache_key)return this.request_render()},e.prototype._on_image_error=function(t){var e;return l.error("Error loading image: #{e.target.src}"),e=t.target.image_data,this.mget("image_source").remove_image(e)},e.prototype._create_image=function(t){var e;return e=new Image,e.onload=this._on_image_load,e.onerror=this._on_image_error,e.alt="",e.image_data={bounds:t,loaded:!1,cache_key:t.join(":")},this.mget("image_source").add_image(e.image_data),e.src=this.mget("image_source").get_image_url(t[0],t[1],t[2],t[3],Math.ceil(this.map_frame.get("height")),Math.ceil(this.map_frame.get("width"))),e},e.prototype.render=function(t,e,r){var n,o;return null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),n=this.get_extent(),this.render_timer&&clearTimeout(this.render_timer),o=this.mget("image_source").images[n.join(":")],null!=o&&o.loaded?void this._draw_image(n.join(":")):(null!=this.lastImage&&this._draw_image(this.lastImage.cache_key),null==o?this.render_timer=setTimeout(function(t){return function(){return t._create_image(n)}}(this),125):void 0)},e.prototype._draw_image=function(t){var e,r,n,o,i,s,a,l,u,h,c;if(e=this.mget("image_source").images[t],null!=e)return this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.mget("alpha"),r=this.plot_view.frame.map_to_screen([e.bounds[0]],[e.bounds[3]],this.plot_view.canvas),l=r[0],c=r[1],n=this.plot_view.frame.map_to_screen([e.bounds[2]],[e.bounds[1]],this.plot_view.canvas),a=n[0],h=n[1],l=l[0],c=c[0],a=a[0],h=h[0],i=a-l,o=h-c,s=l,u=c,this.map_canvas.drawImage(e.img,s,u,i,o),this.map_canvas.restore()},e.prototype._set_rect=function(){var t,e,r,n,o;return r=this.plot_model.plot.properties.outline_line_width.value(),e=this.plot_view.canvas.vx_to_sx(this.map_frame.get("left"))+r/2,n=this.plot_view.canvas.vy_to_sy(this.map_frame.get("top"))+r/2,o=this.map_frame.get("width")-r,t=this.map_frame.get("height")-r,this.map_canvas.rect(e,n,o,t),this.map_canvas.clip()},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.default_view=o,e.prototype.type="DynamicImageRenderer",e.define({alpha:[u.Number,1],image_source:[u.Instance],render_parents:[u.Bool,!0]}),e.override({level:"underlay"}),e}(s.Model),e.exports={Model:n,View:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../renderers/renderer":"models/renderers/renderer","./image_pool":"models/tiles/image_pool",underscore:"underscore"}],"models/tiles/image_pool":[function(t,e,r){var n;n=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t;return t=this.images.pop(),null!=t?t:new Image},t.prototype.push=function(t){if(!(this.images.length>50))return t.constructor===Array?Array.prototype.push.apply(this.images,t):this.images.push(t)},t}(),e.exports=n},{}],"models/tiles/image_source":[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"),s=t("../../core/logging").logger,a=t("../../core/properties"),o=t("../../model"),n=function(t){function e(t){null==t&&(t={}),e.__super__.constructor.apply(this,arguments),this.images={},this.normalize_case()}return l(e,t),e.prototype.type="ImageSource",e.define({url:[a.String,""],extra_url_vars:[a.Any,{}]}),e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.get("url"),t=t.replace("{xmin}","{XMIN}"),t=t.replace("{ymin}","{YMIN}"),t=t.replace("{xmax}","{XMAX}"),t=t.replace("{ymax}","{YMAX}"),t=t.replace("{height}","{HEIGHT}"),t=t.replace("{width}","{WIDTH}"),this.set("url",t)},e.prototype.string_lookup_replace=function(t,e){var r,n,o;n=t;for(r in e)o=e[r],n=n.replace("{"+r+"}",o.toString());return n},e.prototype.add_image=function(t){return this.images[t.cache_key]=t},e.prototype.remove_image=function(t){return delete this.images[t.cache_key]},e.prototype.get_image_url=function(t,e,r,n,o,i){var s;return s=this.string_lookup_replace(this.get("url"),this.get("extra_url_vars")),
s.replace("{XMIN}",t).replace("{YMIN}",e).replace("{XMAX}",r).replace("{YMAX}",n).replace("{WIDTH}",i).replace("{HEIGHT}",o)},e}(o),e.exports={Model:n}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../../model":"model",underscore:"underscore"}],"models/tiles/mercator_tile_source":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./tile_source"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="MercatorTileSource",e.define({wrap_around:[s.Bool,!0]}),e.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097}),e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this._resolutions=function(){var t,e;for(e=[],r=t=0;t<=30;r=++t)e.push(this.get_resolution(r));return e}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.get("initial_resolution")?this.get("initial_resolution"):2*Math.PI*6378137/this.get("tile_size")},e.prototype.is_valid_tile=function(t,e,r){return!(!this.get("wrap_around")&&(t<0||t>=Math.pow(2,r)))&&!(e<0||e>=Math.pow(2,r))},e.prototype.retain_children=function(t){var e,r,n,o,i,s,a;o=t.quadkey,n=o.length,r=n+3,i=this.tiles,s=[];for(e in i)a=i[e],0===a.quadkey.indexOf(o)&&a.quadkey.length>n&&a.quadkey.length<=r?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,r,n,o,s,a,l,u,h,c,p,_,d;r=4,s=t.tile_coords,h=s[0],c=s[1],p=s[2],n=function(){var t,e,n,o;for(o=[],_=t=e=h-r,n=h+r;e<=n?t<=n:t>=n;_=e<=n?++t:--t)o.push(_);return o}(),o=function(){var t,e,n,o;for(o=[],d=t=e=c-r,n=c+r;e<=n?t<=n:t>=n;d=e<=n?++t:--t)o.push(d);return o}(),a=this.tiles,l=[];for(e in a)u=a[e],u.tile_coords[2]===p&&i.contains(n,u.tile_coords[0])&&i.contains(o,u.tile_coords[1])?l.push(u.retain=!0):l.push(void 0);return l},e.prototype.retain_parents=function(t){var e,r,n,o,i;r=t.quadkey,n=this.tiles,o=[];for(e in n)i=n[e],o.push(i.retain=0===r.indexOf(i.quadkey));return o},e.prototype.children_by_tile_xyz=function(t,e,r){var n,o,i,s,a,l,u,h,c;for(c=this.calculate_world_x_by_tile_xyz(t,e,r),0!==c&&(l=this.normalize_xyz(t,e,r),t=l[0],e=l[1],r=l[2]),a=this.tile_xyz_to_quadkey(t,e,r),o=[],i=s=0;s<=3;i=s+=1)u=this.quadkey_to_tile_xyz(a+i.toString()),t=u[0],e=u[1],r=u[2],0!==c&&(h=this.denormalize_xyz(t,e,r,c),t=h[0],e=h[1],r=h[2]),n=this.get_tile_meter_bounds(t,e,r),null!=n&&o.push([t,e,r,n]);return o},e.prototype.parent_by_tile_xyz=function(t,e,r){var n,o;return o=this.tile_xyz_to_quadkey(t,e,r),n=o.substring(0,o.length-1),this.quadkey_to_tile_xyz(n)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,r){var n,o;return n=(t[2]-t[0])/r,o=(t[3]-t[1])/e,[n,o]},e.prototype.get_level_by_extent=function(t,e,r){var n,o,i,s,a,l,u,h;for(u=(t[2]-t[0])/r,h=(t[3]-t[1])/e,l=Math.max(u,h),n=0,a=this._resolutions,o=0,i=a.length;o<i;o++){if(s=a[o],l>s){if(0===n)return 0;if(n>0)return n-1}n+=1}},e.prototype.get_closest_level_by_extent=function(t,e,r){var n,o,i,s,a;return s=(t[2]-t[0])/r,a=(t[3]-t[1])/e,o=Math.max(s,a),i=this._resolutions,n=this._resolutions.reduce(function(t,e){return Math.abs(e-o)<Math.abs(t-o)?e:t}),this._resolutions.indexOf(n)},e.prototype.snap_to_zoom=function(t,e,r,n){var o,i,s,a,l,u,h,c,p;return o=this._resolutions[n],i=r*o,s=e*o,u=t[0],p=t[1],l=t[2],c=t[3],a=(i-(l-u))/2,h=(s-(c-p))/2,[u-a,p-h,l+a,c+h]},e.prototype.tms_to_wmts=function(t,e,r){"Note this works both ways";return[t,Math.pow(2,r)-1-e,r]},e.prototype.wmts_to_tms=function(t,e,r){"Note this works both ways";return[t,Math.pow(2,r)-1-e,r]},e.prototype.pixels_to_meters=function(t,e,r){var n,o,i;return i=this.get_resolution(r),n=t*i-this.get("x_origin_offset"),o=e*i-this.get("y_origin_offset"),[n,o]},e.prototype.meters_to_pixels=function(t,e,r){var n,o,i;return i=this.get_resolution(r),n=(t+this.get("x_origin_offset"))/i,o=(e+this.get("y_origin_offset"))/i,[n,o]},e.prototype.pixels_to_tile=function(t,e){var r,n;return r=Math.ceil(t/parseFloat(this.get("tile_size"))),r=0===r?r:r-1,n=Math.max(Math.ceil(e/parseFloat(this.get("tile_size")))-1,0),[r,n]},e.prototype.pixels_to_raster=function(t,e,r){var n;return n=this.get("tile_size")<<r,[t,n-e]},e.prototype.meters_to_tile=function(t,e,r){var n,o,i;return i=this.meters_to_pixels(t,e,r),n=i[0],o=i[1],this.pixels_to_tile(n,o)},e.prototype.get_tile_meter_bounds=function(t,e,r){var n,o,i,s,a,l;return n=this.pixels_to_meters(t*this.get("tile_size"),e*this.get("tile_size"),r),s=n[0],l=n[1],o=this.pixels_to_meters((t+1)*this.get("tile_size"),(e+1)*this.get("tile_size"),r),i=o[0],a=o[1],null!=s&&null!=l&&null!=i&&null!=a?[s,l,i,a]:void 0},e.prototype.get_tile_geographic_bounds=function(t,e,r){var n,o,i,s,a,l;return n=this.get_tile_meter_bounds(t,e,r),l=this.utils.meters_extent_to_geographic(n),a=l[0],s=l[1],i=l[2],o=l[3],[a,s,i,o]},e.prototype.get_tiles_by_extent=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x;for(null==r&&(r=1),v=t[0],x=t[1],y=t[2],b=t[3],i=this.meters_to_tile(v,x,e),d=i[0],g=i[1],s=this.meters_to_tile(y,b,e),_=s[0],m=s[1],d-=r,g-=r,_+=r,m+=r,c=[],f=n=a=m,l=g;n>=l;f=n+=-1)for(p=o=u=d,h=_;o<=h;p=o+=1)this.is_valid_tile(p,f,e)&&c.push([p,f,e,this.get_tile_meter_bounds(p,f,e)]);return c=this.sort_tiles_from_center(c,[d,g,_,m])},e.prototype.quadkey_to_tile_xyz=function(t){"Computes tile x, y and z values based on quadKey.";var e,r,n,o,i,s,a,l;for(i=0,s=0,a=t.length,e=r=o=a;r>0;e=r+=-1)if(l=t.charAt(a-e),n=1<<e-1,"0"!==l)if("1"===l)i|=n;else if("2"===l)s|=n;else{if("3"!==l)throw new TypeError("Invalid Quadkey: "+t);i|=n,s|=n}return[i,s,a]},e.prototype.tile_xyz_to_quadkey=function(t,e,r){"Computes quadkey value based on tile x, y and z values.";var n,o,i,s,a,l;for(a="",o=i=l=r;i>0;o=i+=-1)n=0,s=1<<o-1,0!==(t&s)&&(n+=1),0!==(e&s)&&(n+=2),a+=n.toString();return a},e.prototype.children_by_tile_xyz=function(t,e,r){var n,o,i,s,a,l;for(a=this.tile_xyz_to_quadkey(t,e,r),o=[],i=s=0;s<=3;i=s+=1)l=this.quadkey_to_tile_xyz(a+i.toString()),t=l[0],e=l[1],r=l[2],n=this.get_tile_meter_bounds(t,e,r),null!=n&&o.push([t,e,r,n]);return o},e.prototype.parent_by_tile_xyz=function(t,e,r){var n,o;return o=this.tile_xyz_to_quadkey(t,e,r),n=o.substring(0,o.length-1),this.quadkey_to_tile_xyz(n)},e.prototype.get_closest_parent_by_tile_xyz=function(t,e,r){var n,o,i,s,a;for(a=this.calculate_world_x_by_tile_xyz(t,e,r),o=this.normalize_xyz(t,e,r),t=o[0],e=o[1],r=o[2],n=this.tile_xyz_to_quadkey(t,e,r);n.length>0;)if(n=n.substring(0,n.length-1),i=this.quadkey_to_tile_xyz(n),t=i[0],e=i[1],r=i[2],s=this.denormalize_xyz(t,e,r,a),t=s[0],e=s[1],r=s[2],this.tile_xyz_to_key(t,e,r)in this.tiles)return[t,e,r];return[0,0,0]},e.prototype.normalize_xyz=function(t,e,r){var n;return this.get("wrap_around")?(n=Math.pow(2,r),[(t%n+n)%n,e,r]):[t,e,r]},e.prototype.denormalize_xyz=function(t,e,r,n){return[t+n*Math.pow(2,r),e,r]},e.prototype.denormalize_meters=function(t,e,r,n){return[t+2*n*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,r){return Math.floor(t/Math.pow(2,r))},e}(o),e.exports=n},{"../../core/properties":"core/properties","./tile_source":"models/tiles/tile_source",underscore:"underscore"}],"models/tiles/quadkey_tile_source":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=t("./mercator_tile_source"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="QUADKEYTileSource",e.prototype.get_image_url=function(t,e,r){var n,o,i;return n=this.string_lookup_replace(this.get("url"),this.get("extra_url_vars")),i=this.tms_to_wmts(t,e,r),t=i[0],e=i[1],r=i[2],o=this.tile_xyz_to_quadkey(t,e,r),n.replace("{Q}",o)},e}(n),e.exports={Model:o}},{"./mercator_tile_source":"models/tiles/mercator_tile_source"}],"models/tiles/tile_renderer":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){return function(){return t.apply(e,arguments)}},_=function(t,e){function r(){this.constructor=t}for(var n in e)d.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},d={}.hasOwnProperty,f=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};l=t("underscore"),n=t("jquery"),o=t("./image_pool"),c=t("./wmts_tile_source"),i=t("../renderers/renderer"),u=t("../../core/logging").logger,h=t("../../core/properties"),a=function(t){function e(){return this._update=p(this._update,this),this._prefetch_tiles=p(this._prefetch_tiles,this),this._on_tile_error=p(this._on_tile_error,this),this._on_tile_cache_load=p(this._on_tile_cache_load,this),this._on_tile_load=p(this._on_tile_load,this),this._add_attribution=p(this._add_attribution,this),e.__super__.constructor.apply(this,arguments)}return _(e,t),e.prototype.initialize=function(t){return this.attributionEl=null,e.__super__.initialize.apply(this,arguments)},e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change",this.request_render)},e.prototype.get_extent=function(){return[this.x_range.get("start"),this.y_range.get("start"),this.x_range.get("end"),this.y_range.get("end")]},e.prototype._set_data=function(){return this.pool=new o,this.map_plot=this.plot_model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_model.frame,this.x_range=this.map_plot.get("x_range"),this.x_mapper=this.map_frame.get("x_mappers")["default"],this.y_range=this.map_plot.get("y_range"),this.y_mapper=this.map_frame.get("y_mappers")["default"],this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t,e,r,o,i,s;if(t=this.mget("tile_source").get("attribution"),l.isString(t)&&t.length>0)return null!=this.attributionEl?this.attributionEl.html(t):(e=this.map_plot.get("outline_line_width"),r=this.map_plot.get("min_border_bottom")+e,s=this.map_frame.get("right")-this.map_frame.get("width"),o=this.map_frame.get("width")-e,this.attributionEl=n("<div>").html(t).addClass("bk-tile-attribution").css({position:"absolute",bottom:r+"px",right:s+"px","max-width":o+"px","background-color":"rgba(255,255,255,0.8)","font-size":"9pt","font-family":"sans-serif"}),i=this.plot_view.$el.find("div.bk-canvas-events"),this.attributionEl.appendTo(i))},e.prototype._map_data=function(){var t,e;return this.initial_extent=this.get_extent(),e=this.mget("tile_source").get_level_by_extent(this.initial_extent,this.map_frame.get("height"),this.map_frame.get("width")),t=this.mget("tile_source").snap_to_zoom(this.initial_extent,this.map_frame.get("height"),this.map_frame.get("width"),e),this.x_range.set("start",t[0]),this.y_range.set("start",t[1]),this.x_range.set("end",t[2]),this.y_range.set("end",t[3]),this._add_attribution()},e.prototype._on_tile_load=function(t){var e;return e=t.target.tile_data,e.img=t.target,e.current=!0,e.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var e;return e=t.target.tile_data,e.img=t.target,e.loaded=!0},e.prototype._on_tile_error=function(t){return""},e.prototype._create_tile=function(t,e,r,n,o){var i,s,a;return null==o&&(o=!1),i=this.mget("tile_source").normalize_xyz(t,e,r),a=this.pool.pop(),o?a.onload=this._on_tile_cache_load:a.onload=this._on_tile_load,a.onerror=this._on_tile_error,a.alt="",a.tile_data={tile_coords:[t,e,r],normalized_coords:i,quadkey:this.mget("tile_source").tile_xyz_to_quadkey(t,e,r),cache_key:this.mget("tile_source").tile_xyz_to_key(t,e,r),bounds:n,loaded:!1,x_coord:n[0],y_coord:n[3]},this.mget("tile_source").tiles[a.tile_data.cache_key]=a.tile_data,a.src=(s=this.mget("tile_source")).get_image_url.apply(s,i),a},e.prototype._enforce_aspect_ratio=function(){var t,e,r;return(this._last_height!==this.map_frame.get("height")||this._last_width!==this.map_frame.get("width"))&&(t=this.get_extent(),r=this.mget("tile_source").get_level_by_extent(t,this.map_frame.get("height"),this.map_frame.get("width")),e=this.mget("tile_source").snap_to_zoom(t,this.map_frame.get("height"),this.map_frame.get("width"),r),this.x_range.set({start:e[0],end:e[2]}),this.y_range.set({start:e[1],end:e[3]}),this.extent=e,this._last_height=this.map_frame.get("height"),this._last_width=this.map_frame.get("width"),!0)},e.prototype.render=function(t,e,r){if(null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),!this._enforce_aspect_ratio())return this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles,500)},e.prototype._draw_tile=function(t){var e,r,n,o,i,s,a,l,u,h,c;if(c=this.mget("tile_source").tiles[t],null!=c)return e=this.plot_view.frame.map_to_screen([c.bounds[0]],[c.bounds[3]],this.plot_view.canvas),a=e[0],h=e[1],r=this.plot_view.frame.map_to_screen([c.bounds[2]],[c.bounds[1]],this.plot_view.canvas),s=r[0],u=r[1],a=a[0],h=h[0],s=s[0],u=u[0],o=s-a,n=u-h,i=a,l=h,this.map_canvas.drawImage(c.img,i,l,o,n)},e.prototype._set_rect=function(){var t,e,r,n,o;return r=this.plot_model.plot.properties.outline_line_width.value(),e=this.plot_view.canvas.vx_to_sx(this.map_frame.get("left"))+r/2,n=this.plot_view.canvas.vy_to_sy(this.map_frame.get("top"))+r/2,o=this.map_frame.get("width")-r,t=this.map_frame.get("height")-r,this.map_canvas.rect(e,n,o,t),this.map_canvas.clip()},e.prototype._render_tiles=function(t){var e,r,n;for(this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.mget("alpha"),e=0,r=t.length;e<r;e++)n=t[e],this._draw_tile(n);return this.map_canvas.restore()},e.prototype._prefetch_tiles=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v;for(_=this.mget("tile_source"),a=this.get_extent(),l=this.map_frame.get("height"),f=this.map_frame.get("width"),v=this.mget("tile_source").get_level_by_extent(a,l,f),d=this.mget("tile_source").get_tiles_by_extent(a,v),c=[],p=u=0,h=Math.min(10,d.length);u<=h;p=u+=1)m=p[0],g=p[1],y=p[2],t=p[3],n=this.mget("tile_source").children_by_tile_xyz(m,g,y),c.push(function(){var t,a,l;for(l=[],t=0,a=n.length;t<a;t++)e=n[t],o=e[0],i=e[1],s=e[2],r=e[3],_.tile_xyz_to_key(o,i,s)in _.tiles||l.push(this._create_tile(o,i,s,r,!0));return l}.call(this));return c},e.prototype._fetch_tiles=function(t){var e,r,n,o,i,s,a,l;for(o=[],r=0,n=t.length;r<n;r++)i=t[r],s=i[0],a=i[1],l=i[2],e=i[3],o.push(this._create_tile(s,a,l,e));return o},e.prototype._update=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F;for(C=this.mget("tile_source"),b=C.get("min_zoom"),v=C.get("max_zoom"),C.update(),u=this.get_extent(),F=this.extent[2]-this.extent[0]<u[2]-u[0],h=this.map_frame.get("height"),O=this.map_frame.get("width"),R=C.get_level_by_extent(u,h,O),P=!1,R<b?(u=this.extent,R=b,P=!0):R>v&&(u=this.extent,R=v,P=!0),P&&(this.x_range.set({x_range:{start:u[0],end:u[2]}}),this.y_range.set({start:u[1],end:u[3]}),this.extent=u),this.extent=u,N=C.get_tiles_by_extent(u,R),k=[],x=[],r=[],i=[],c=0,m=N.length;c<m;c++){if(E=N[c],q=E[0],D=E[1],I=E[2],t=E[3],d=C.tile_xyz_to_key(q,D,I),A=C.tiles[d],null!=A&&A.loaded===!0)r.push(d);else if(this.mget("render_parents")&&(z=C.get_closest_parent_by_tile_xyz(q,D,I),j=z[0],T=z[1],S=z[2],w=C.tile_xyz_to_key(j,T,S),M=C.tiles[w],null!=M&&M.loaded&&f.call(k,w)<0&&k.push(w),F))for(i=C.children_by_tile_xyz(q,D,I),p=0,g=i.length;p<g;p++)e=i[p],s=e[0],a=e[1],l=e[2],n=e[3],o=C.tile_xyz_to_key(s,a,l),o in C.tiles&&i.push(o);null==A&&x.push(E)}for(this._render_tiles(k),this._render_tiles(i),this._render_tiles(r),_=0,y=r.length;_<y;_++)E=r[_],C.tiles[E].current=!0;return null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(t){return function(){return t._fetch_tiles(x)}}(this),65)},e}(i.View),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return _(e,t),e.prototype.default_view=a,e.prototype.type="TileRenderer",e.define({alpha:[h.Number,1],x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],tile_source:[h.Instance,function(){return new c.Model}],render_parents:[h.Bool,!0]}),e.override({level:"underlay"}),e}(i.Model),e.exports={Model:s,View:a}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../renderers/renderer":"models/renderers/renderer","./image_pool":"models/tiles/image_pool","./wmts_tile_source":"models/tiles/wmts_tile_source",jquery:"jquery",underscore:"underscore"}],"models/tiles/tile_source":[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("./image_pool"),u=t("./tile_utils"),a=t("../../core/logging").logger,l=t("../../core/properties"),o=t("../../model"),i=function(t){function e(t){null==t&&(t={}),e.__super__.constructor.apply(this,arguments),this.utils=new u.ProjectionUtils,this.pool=new n,this.tiles={},this.normalize_case()}return h(e,t),e.prototype.type="TileSource",e.define({url:[l.String,""],tile_size:[l.Number,256],max_zoom:[l.Number,30],min_zoom:[l.Number,0],extra_url_vars:[l.Any,{}],attribution:[l.String,""],x_origin_offset:[l.Number],y_origin_offset:[l.Number],initial_resolution:[l.Number]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.normalize_case()},e.prototype.string_lookup_replace=function(t,e){var r,n,o;n=t;for(r in e)o=e[r],n=n.replace("{"+r+"}",o.toString());return n},e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.get("url"),t=t.replace("{x}","{X}"),t=t.replace("{y}","{Y}"),t=t.replace("{z}","{Z}"),t=t.replace("{q}","{Q}"),t=t.replace("{xmin}","{XMIN}"),t=t.replace("{ymin}","{YMIN}"),t=t.replace("{xmax}","{XMAX}"),t=t.replace("{ymax}","{YMAX}"),this.set("url",t)},e.prototype.update=function(){var t,e,r,n;a.debug("TileSource: tile cache count: "+Object.keys(this.tiles).length),e=this.tiles,r=[];for(t in e)n=e[t],n.current=!1,r.push(n.retain=!1);return r},e.prototype.tile_xyz_to_key=function(t,e,r){var n;return n=t+":"+e+":"+r},e.prototype.key_to_tile_xyz=function(t){var e;return function(){var r,n,o,i;for(o=t.split(":"),i=[],r=0,n=o.length;r<n;r++)e=o[r],i.push(parseInt(e));return i}()},e.prototype.sort_tiles_from_center=function(t,e){var r,n,o,i,s,a;return i=e[0],a=e[1],o=e[2],s=e[3],r=(o-i)/2+i,n=(s-a)/2+a,t.sort(function(t,e){var o,i;return o=Math.sqrt(Math.pow(r-t[0],2)+Math.pow(n-t[1],2)),i=Math.sqrt(Math.pow(r-e[0],2)+Math.pow(n-e[1],2)),o-i}),t},e.prototype.prune_tiles=function(){var t,e,r,n,o;e=this.tiles;for(t in e)o=e[t],o.retain=o.current||o.tile_coords[2]<3,o.current&&(this.retain_neighbors(o),this.retain_children(o),this.retain_parents(o));r=this.tiles,n=[];for(t in r)o=r[t],o.retain?n.push(void 0):n.push(this.remove_tile(t));return n},e.prototype.remove_tile=function(t){var e;if(e=this.tiles[t],null!=e)return this.pool.push(e.img),delete this.tiles[t]},e.prototype.get_image_url=function(t,e,r){var n;return n=this.string_lookup_replace(this.get("url"),this.get("extra_url_vars")),n.replace("{X}",t).replace("{Y}",e).replace("{Z}",r)},e.prototype.retain_neighbors=function(t){throw Error("Not Implemented")},e.prototype.retain_parents=function(t){throw Error("Not Implemented")},e.prototype.retain_children=function(t){throw Error("Not Implemented")},e.prototype.tile_xyz_to_quadkey=function(t,e,r){throw Error("Not Implemented")},e.prototype.quadkey_to_tile_xyz=function(t){throw Error("Not Implemented")},e}(o),e.exports=i},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../../model":"model","./image_pool":"models/tiles/image_pool","./tile_utils":"models/tiles/tile_utils",underscore:"underscore"}],"models/tiles/tile_utils":[function(t,e,r){var n,o,i,s;i=t("proj4"),o=i.defs("GOOGLE"),s=i.defs("WGS84"),n=function(){function t(){this.origin_shift=2*Math.PI*6378137/2}return t.prototype.geographic_to_meters=function(t,e){return i(s,o,[t,e])},t.prototype.meters_to_geographic=function(t,e){return i(o,s,[t,e])},t.prototype.geographic_extent_to_meters=function(t){var e,r,n,o,i,s;return o=t[0],s=t[1],n=t[2],i=t[3],e=this.geographic_to_meters(o,s),o=e[0],s=e[1],r=this.geographic_to_meters(n,i),n=r[0],i=r[1],[o,s,n,i]},t.prototype.meters_extent_to_geographic=function(t){var e,r,n,o,i,s;return o=t[0],s=t[1],n=t[2],i=t[3],e=this.meters_to_geographic(o,s),o=e[0],s=e[1],r=this.meters_to_geographic(n,i),n=r[0],i=r[1],[o,s,n,i]},t}(),e.exports={ProjectionUtils:n}},{proj4:"proj4"}],"models/tiles/tms_tile_source":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=t("./mercator_tile_source"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="TMSTileSource",e.prototype.get_image_url=function(t,e,r){var n;return n=this.string_lookup_replace(this.get("url"),this.get("extra_url_vars")),n.replace("{X}",t).replace("{Y}",e).replace("{Z}",r)},e}(n),e.exports={Model:o}},{"./mercator_tile_source":"models/tiles/mercator_tile_source"}],"models/tiles/wmts_tile_source":[function(t,e,r){var n,o,i=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;n=t("./mercator_tile_source"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="WMTSTileSource",e.prototype.get_image_url=function(t,e,r){var n,o;return n=this.string_lookup_replace(this.get("url"),this.get("extra_url_vars")),o=this.tms_to_wmts(t,e,r),t=o[0],e=o[1],r=o[2],n.replace("{X}",t).replace("{Y}",e).replace("{Z}",r)},e}(n),e.exports={Model:o}},{"./mercator_tile_source":"models/tiles/mercator_tile_source"}],"models/tools/actions/action_tool":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=t("../button_tool"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._clicked=function(){return this.model.trigger("do")},e}(s.ButtonView),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.model,"do",this["do"])},e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e}(s.Model),e.exports={Model:n,View:i,ButtonView:o}},{"../button_tool":"models/tools/button_tool"}],"models/tools/actions/help_tool":[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;s=t("underscore"),n=t("./action_tool"),a=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype["do"]=function(){return window.open(this.mget("redirect"))},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="HelpTool",e.prototype.tool_name="Help",e.prototype.icon="bk-tool-icon-help",e.define({help_tooltip:[a.String,"Click the question mark to learn more about Bokeh plot tools."],redirect:[a.String,"http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this.get("help_tooltip")})},e}(n.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","./action_tool":"models/tools/actions/action_tool",underscore:"underscore"}],"models/tools/actions/redo_tool":[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;n=t("./action_tool"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.plot_view,"state_changed",function(t){return function(){return t.model.set("disabled",!t.plot_view.can_redo())}}(this))},e.prototype["do"]=function(){return this.plot_view.redo()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.default_view=i,e.prototype.type="RedoTool",e.prototype.tool_name="Redo",e.prototype.icon="bk-tool-icon-redo",e.override({disabled:!0}),e}(n.Model),e.exports={Model:o,View:i}},{"./action_tool":"models/tools/actions/action_tool"}],"models/tools/actions/reset_tool":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;n=t("./action_tool"),s=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype["do"]=function(){if(this.plot_view.clear_state(),this.plot_view.reset_range(),this.plot_view.reset_selection(),this.model.reset_size)return this.plot_view.reset_dimensions()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=i,e.prototype.type="ResetTool",e.prototype.tool_name="Reset",e.prototype.icon="bk-tool-icon-reset",e.define({reset_size:[s.Bool,!0]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","./action_tool":"models/tools/actions/action_tool"}],"models/tools/actions/save_tool":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=t("underscore"),n=t("./action_tool"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype["do"]=function(){var t,e,r,n;return e=this.plot_view.get_canvas_element(),n="bokeh_plot.png",null!=e.msToBlob?(t=e.msToBlob(),window.navigator.msSaveBlob(t,n)):(r=document.createElement("a"),r.href=e.toDataURL("image/png"),r.download=n,r.target="_blank",r.dispatchEvent(new MouseEvent("click")))},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.default_view=i,e.prototype.type="SaveTool",e.prototype.tool_name="Save",e.prototype.icon="bk-tool-icon-save",e}(n.Model),e.exports={Model:o,View:i}},{"./action_tool":"models/tools/actions/action_tool",underscore:"underscore"}],"models/tools/actions/undo_tool":[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;n=t("./action_tool"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.plot_view,"state_changed",function(t){return function(){return t.model.set("disabled",!t.plot_view.can_undo())}}(this))},e.prototype["do"]=function(){return this.plot_view.undo()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.default_view=i,e.prototype.type="UndoTool",e.prototype.tool_name="Undo",e.prototype.icon="bk-tool-icon-undo",e.override({disabled:!0}),e}(n.Model),e.exports={Model:o,View:i}},{"./action_tool":"models/tools/actions/action_tool"}],"models/tools/button_tool":[function(t,e,r){var n,o,i,s,a,l,u,h,c=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;l=t("underscore"),n=t("backbone"),a=t("./tool"),u=t("./button_tool_template"),h=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.tagName="li",e.prototype.template=u,e.prototype.events=function(){return{"click .bk-toolbar-button":"_clicked"}},e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.$el.html(this.template({model:this.model})),this.listenTo(this.model,"change:active",function(t){return function(){return t.render()}}(this)),this.listenTo(this.model,"change:disabled",function(t){return function(){return t.render()}}(this)),this.render()},e.prototype.render=function(){return this.$el.children("button").prop("disabled",this.model.get("disabled")).toggleClass("active",this.model.get("active")),this},e.prototype._clicked=function(t){},e}(n.View),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e}(a.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.icon=null,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("tooltip",function(){return this.tool_name})},e.internal({disabled:[h.Boolean,!1]}),e}(a.Model),e.exports={Model:o,View:s,ButtonView:i}},{"../../core/properties":"core/properties","./button_tool_template":"models/tools/button_tool_template","./tool":"models/tools/tool",backbone:"backbone",underscore:"underscore"}],"models/tools/button_tool_template":[function(t,e,r){e.exports=function(t){t||(t={});var e=[],r=function(t){return t&&t.ecoSafe?t:"undefined"!=typeof t&&null!=t?n(t):""},n=function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};return function(){(function(){e.push('<button type="button" class="bk-toolbar-button hover">\n <div class=\'bk-btn-icon '),e.push(r(this.model.icon)),e.push("' />\n <span class='tip'>"),e.push(r(this.model.get("tooltip"))),e.push("</span>\n</button>\n")}).call(this)}.call(t),e.join("")}},{}],"models/tools/gestures/box_select_tool":[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;l=t("underscore"),a=t("./select_tool"),n=t("../../annotations/box_annotation"),u=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._pan_start=function(t){var e;return e=this.plot_view.canvas,this._baseboint=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],null},e.prototype._pan=function(t){var e,r,n,o,i,s,a,l,u;return r=this.plot_view.canvas,n=[r.sx_to_vx(t.bokeh.sx),r.sy_to_vy(t.bokeh.sy)],i=this.plot_model.get("frame"),o=this.mget("dimensions"),s=this.model._get_dim_limits(this._baseboint,n,i,o),l=s[0],u=s[1],this.mget("overlay").update({left:l[0],right:l[1],top:u[1],bottom:u[0]}),this.mget("select_every_mousemove")&&(e=null!=(a=t.srcEvent.shiftKey)&&a,this._select(l,u,!1,e)),null},e.prototype._pan_end=function(t){var e,r,n,o,i,s,a,l,u;return r=this.plot_view.canvas,n=[r.sx_to_vx(t.bokeh.sx),r.sy_to_vy(t.bokeh.sy)],i=this.plot_model.get("frame"),o=this.mget("dimensions"),s=this.model._get_dim_limits(this._baseboint,n,i,o),l=s[0],u=s[1],e=null!=(a=t.srcEvent.shiftKey)&&a,this._select(l,u,!0,e),
this.mget("overlay").update({left:null,right:null,top:null,bottom:null}),this._baseboint=null,this.plot_view.push_state("box_select",{selection:this.plot_view.get_selection()}),null},e.prototype._select=function(t,e,r,n){var o,i,s,a,l,u,h,c,p,_,d;for(c=t[0],p=t[1],_=e[0],d=e[1],null==n&&(n=!1),i={type:"rect",vx0:c,vx1:p,vy0:_,vy1:d},u=this.mget("computed_renderers"),s=0,a=u.length;s<a;s++)l=u[s],o=l.get("data_source"),h=o.get("selection_manager"),h.select(this,this.plot_view.renderer_views[l.id],i,r,n);return null!=this.mget("callback")&&this._emit_callback(i),this._save_geometry(i,r,n),null},e.prototype._emit_callback=function(t){var e,r,n,o,i;n=this.mget("computed_renderers")[0],e=this.plot_model.get("canvas"),r=this.plot_model.get("frame"),t.sx0=e.vx_to_sx(t.vx0),t.sx1=e.vx_to_sx(t.vx1),t.sy0=e.vy_to_sy(t.vy0),t.sy1=e.vy_to_sy(t.vy1),o=r.get("x_mappers")[n.get("x_range_name")],i=r.get("y_mappers")[n.get("y_range_name")],t.x0=o.map_from_target(t.vx0),t.x1=o.map_from_target(t.vx1),t.y0=i.map_from_target(t.vy0),t.y1=i.map_from_target(t.vy1),this.mget("callback").execute(this.model,{geometry:t})},e}(a.View),s=function(){return new n.Model({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="BoxSelectTool",e.prototype.tool_name="Box Select",e.prototype.icon="bk-tool-icon-box-select",e.prototype.event_type="pan",e.prototype.default_order=30,e.define({dimensions:[u.Array,["width","height"]],select_every_mousemove:[u.Bool,!1],callback:[u.Instance],overlay:[u.Instance,s]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this._get_dim_tooltip(this.tool_name,this._check_dims(this.get("dimensions"),"box select tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"])},e}(a.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","../../annotations/box_annotation":"models/annotations/box_annotation","./select_tool":"models/tools/gestures/select_tool",underscore:"underscore"}],"models/tools/gestures/box_zoom_tool":[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;l=t("underscore"),a=t("./gesture_tool"),n=t("../../annotations/box_annotation"),u=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._match_aspect=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b;return s=r.get("h_range").get("end"),a=r.get("h_range").get("start"),d=r.get("v_range").get("end"),m=r.get("v_range").get("start"),y=s-a,i=d-m,n=y/i,g=Math.abs(t[0]-e[0]),f=Math.abs(t[1]-e[1]),_=0===f?0:g/f,_>=n?(u=[1,_/n],v=u[0],b=u[1]):(h=[n/_,1],v=h[0],b=h[1]),t[0]<=e[0]?(l=t[0],c=t[0]+g*v,c>s&&(c=s)):(c=t[0],l=t[0]-g*v,l<a&&(l=a)),g=Math.abs(c-l),t[1]<=e[1]?(o=t[1],p=t[1]+g/n,p>d&&(p=d)):(p=t[1],o=t[1]-g/n,o<m&&(o=m)),f=Math.abs(p-o),t[0]<=e[0]?c=t[0]+n*f:l=t[0]-n*f,[[l,c],[o,p]]},e.prototype._pan_start=function(t){var e;return e=this.plot_view.canvas,this._baseboint=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],null},e.prototype._pan=function(t){var e,r,n,o,i,s,a,l;return e=this.plot_view.canvas,r=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],o=this.plot_model.get("frame"),n=this.mget("dimensions"),this.mget("match_aspect")&&2===n.length?(i=this._match_aspect(this._baseboint,r,o),a=i[0],l=i[1]):(s=this.model._get_dim_limits(this._baseboint,r,o,n),a=s[0],l=s[1]),this.mget("overlay").update({left:a[0],right:a[1],top:l[1],bottom:l[0]}),null},e.prototype._pan_end=function(t){var e,r,n,o,i,s,a,l;return e=this.plot_view.canvas,r=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],o=this.plot_model.get("frame"),n=this.mget("dimensions"),this.mget("match_aspect")&&2===n.length?(i=this._match_aspect(this._baseboint,r,o),a=i[0],l=i[1]):(s=this.model._get_dim_limits(this._baseboint,r,o,n),a=s[0],l=s[1]),this._update(a,l),this.mget("overlay").update({left:null,right:null,top:null,bottom:null}),this._baseboint=null,null},e.prototype._update=function(t,e){var r,n,o,i,s,a,l,u,h,c,p;if(!(Math.abs(t[1]-t[0])<=5||Math.abs(e[1]-e[0])<=5)){h={},i=this.plot_view.frame.get("x_mappers");for(o in i)n=i[o],s=n.v_map_from_target(t,!0),u=s[0],r=s[1],h[o]={start:u,end:r};c={},a=this.plot_view.frame.get("y_mappers");for(o in a)n=a[o],l=n.v_map_from_target(e,!0),u=l[0],r=l[1],c[o]={start:u,end:r};return p={xrs:h,yrs:c},this.plot_view.push_state("box_zoom",{range:p}),this.plot_view.update_range(p)}},e}(a.View),s=function(){return new n.Model({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="BoxZoomTool",e.prototype.tool_name="Box Zoom",e.prototype.icon="bk-tool-icon-box-zoom",e.prototype.event_type="pan",e.prototype.default_order=20,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this._get_dim_tooltip(this.tool_name,this._check_dims(this.get("dimensions"),"box zoom tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"])},e.define({dimensions:[u.Array,["width","height"]],overlay:[u.Instance,s],match_aspect:[u.Bool,!1]}),e}(a.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","../../annotations/box_annotation":"models/annotations/box_annotation","./gesture_tool":"models/tools/gestures/gesture_tool",underscore:"underscore"}],"models/tools/gestures/gesture_tool":[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;a=t("underscore"),n=t("../button_tool"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._clicked=function(){var t;return t=this.model.get("active"),this.model.set("active",!t)},e}(n.ButtonView),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.event_type=null,e.prototype.default_order=null,e}(n.Model),e.exports={Model:o,View:s,ButtonView:i}},{"../button_tool":"models/tools/button_tool",underscore:"underscore"}],"models/tools/gestures/lasso_select_tool":[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;l=t("underscore"),a=t("./select_tool"),s=t("../../annotations/poly_annotation"),u=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.model,"change:active",this._active_change),this.data=null},e.prototype._active_change=function(){if(!this.mget("active"))return this._clear_overlay()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_overlay()},e.prototype._pan_start=function(t){var e,r,n;return e=this.plot_view.canvas,r=e.sx_to_vx(t.bokeh.sx),n=e.sy_to_vy(t.bokeh.sy),this.data={vx:[r],vy:[n]},null},e.prototype._pan=function(t){var e,r,n,o,i,s,a,l;if(r=this.plot_view.canvas,a=r.sx_to_vx(t.bokeh.sx),l=r.sy_to_vy(t.bokeh.sy),n=this.plot_model.get("frame").get("h_range"),s=this.plot_model.get("frame").get("v_range"),a>n.get("end")&&(a=n.get("end")),a<n.get("start")&&(a=n.get("start")),l>s.get("end")&&(l=s.get("end")),l<s.get("start")&&(l=s.get("start")),this.data.vx.push(a),this.data.vy.push(l),o=this.mget("overlay"),o.update({xs:this.data.vx,ys:this.data.vy}),this.mget("select_every_mousemove"))return e=null!=(i=t.srcEvent.shiftKey)&&i,this._select(this.data.vx,this.data.vy,!1,e)},e.prototype._pan_end=function(t){var e,r;return this._clear_overlay(),e=null!=(r=t.srcEvent.shiftKey)&&r,this._select(this.data.vx,this.data.vy,!0,e),this.plot_view.push_state("lasso_select",{selection:this.plot_view.get_selection()})},e.prototype._clear_overlay=function(){return this.mget("overlay").update({xs:[],ys:[]})},e.prototype._select=function(t,e,r,n){var o,i,s,a,l,u,h;for(i={type:"poly",vx:t,vy:e},u=this.mget("computed_renderers"),s=0,a=u.length;s<a;s++)l=u[s],o=l.get("data_source"),h=o.get("selection_manager"),h.select(this,this.plot_view.renderer_views[l.id],i,r,n);return null!=this.mget("callback")&&this._emit_callback(i),this._save_geometry(i,r,n),null},e.prototype._emit_callback=function(t){var e,r,n,o,i;n=this.mget("computed_renderers")[0],e=this.plot_model.get("canvas"),r=this.plot_model.get("frame"),t.sx=e.v_vx_to_sx(t.vx),t.sy=e.v_vy_to_sy(t.vy),o=r.get("x_mappers")[n.get("x_range_name")],i=r.get("y_mappers")[n.get("y_range_name")],t.x=o.v_map_from_target(t.vx),t.y=i.v_map_from_target(t.vy),this.mget("callback").execute(this.model,{geometry:t})},e}(a.View),n=function(){return new s.Model({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="LassoSelectTool",e.prototype.tool_name="Lasso Select",e.prototype.icon="bk-tool-icon-lasso-select",e.prototype.event_type="pan",e.prototype.default_order=12,e.define({select_every_mousemove:[u.Bool,!0],callback:[u.Instance],overlay:[u.Instance,n]}),e}(a.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","../../annotations/poly_annotation":"models/annotations/poly_annotation","./select_tool":"models/tools/gestures/select_tool",underscore:"underscore"}],"models/tools/gestures/pan_tool":[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;s=t("underscore"),n=t("./gesture_tool"),a=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._pan_start=function(t){var e,r,n,o,i,s;return this.last_dx=0,this.last_dy=0,e=this.plot_view.canvas,r=this.plot_view.frame,i=e.sx_to_vx(t.bokeh.sx),s=e.sy_to_vy(t.bokeh.sy),r.contains(i,s)||(n=r.get("h_range"),o=r.get("v_range"),(i<n.get("start")||i>n.get("end"))&&(this.v_axis_only=!0),(s<o.get("start")||s>o.get("end"))&&(this.h_axis_only=!0)),this.plot_view.interactive_timestamp=Date.now()},e.prototype._pan=function(t){return this._update(t.deltaX,-t.deltaY),this.plot_view.interactive_timestamp=Date.now()},e.prototype._pan_end=function(t){if(this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info)return this.plot_view.push_state("pan",{range:this.pan_info})},e.prototype._update=function(t,e){var r,n,o,i,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P;o=this.plot_view.frame,h=t-this.last_dx,c=e-this.last_dy,i=s.clone(o.get("h_range")),w=i.get("start")-h,x=i.get("end")-h,S=s.clone(o.get("v_range")),T=S.get("start")-c,j=S.get("end")-c,r=this.mget("dimensions"),r.indexOf("width")>-1&&!this.v_axis_only?(v=w,b=x,m=-h):(v=i.get("start"),b=i.get("end"),m=0),r.indexOf("height")>-1&&!this.h_axis_only?(M=T,k=j,g=c):(M=S.get("start"),k=S.get("end"),g=0),this.last_dx=t,this.last_dy=e,z={},p=o.get("x_mappers");for(u in p)l=p[u],_=l.v_map_from_target([v,b],!0),y=_[0],n=_[1],z[u]={start:y,end:n};P={},d=o.get("y_mappers");for(u in d)l=d[u],f=l.v_map_from_target([M,k],!0),y=f[0],n=f[1],P[u]={start:y,end:n};return this.pan_info={xrs:z,yrs:P,sdx:m,sdy:g},this.plot_view.update_range(this.pan_info,a=!0),null},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="PanTool",e.prototype.tool_name="Pan",e.prototype.icon="bk-tool-icon-pan",e.prototype.event_type="pan",e.prototype.default_order=10,e.define({dimensions:[a.Array,["width","height"]]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this._get_dim_tooltip("Pan",this._check_dims(this.get("dimensions"),"pan tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"])},e}(n.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","./gesture_tool":"models/tools/gestures/gesture_tool",underscore:"underscore"}],"models/tools/gestures/poly_select_tool":[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;l=t("underscore"),a=t("./select_tool"),o=t("../../annotations/poly_annotation"),u=t("../../../core/properties"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.model,"change:active",this._active_change),this.data=null},e.prototype._active_change=function(){if(!this.mget("active"))return this._clear_data()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_data()},e.prototype._doubletap=function(t){var e,r;return e=null!=(r=t.srcEvent.shiftKey)&&r,this._select(this.data.vx,this.data.vy,!0,e),this._clear_data()},e.prototype._clear_data=function(){return this.data=null,this.mget("overlay").update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,r,n,o,i;return e=this.plot_view.canvas,o=e.sx_to_vx(t.bokeh.sx),i=e.sy_to_vy(t.bokeh.sy),null==this.data?(this.data={vx:[o],vy:[i]},null):(this.data.vx.push(o),this.data.vy.push(i),n=this.mget("overlay"),r={},r.vx=l.clone(this.data.vx),r.vy=l.clone(this.data.vy),n.update({xs:this.data.vx,ys:this.data.vy}))},e.prototype._select=function(t,e,r,n){var o,i,s,a,l,u,h;for(i={type:"poly",vx:t,vy:e},u=this.mget("computed_renderers"),s=0,a=u.length;s<a;s++)l=u[s],o=l.get("data_source"),h=o.get("selection_manager"),h.select(this,this.plot_view.renderer_views[l.id],i,r,n);return this._save_geometry(i,r,n),this.plot_view.push_state("poly_select",{selection:this.plot_view.get_selection()}),null},e}(a.View),n=function(){return new o.Model({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="PolySelectTool",e.prototype.tool_name="Poly Select",e.prototype.icon="bk-tool-icon-polygon-select",e.prototype.event_type="tap",e.prototype.default_order=11,e.define({overlay:[u.Instance,n]}),e}(a.Model),e.exports={Model:i,View:s}},{"../../../core/properties":"core/properties","../../annotations/poly_annotation":"models/annotations/poly_annotation","./select_tool":"models/tools/gestures/select_tool",underscore:"underscore"}],"models/tools/gestures/resize_tool":[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;s=t("underscore"),n=t("./gesture_tool"),a=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.className="bk-resize-popup",e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),r=this.plot_view.$el.find("div.bk-canvas-wrapper"),this.$el.appendTo(r),this.$el.hide(),this.active=!1,null},e.prototype.activate=function(){return this.active=!0,this.render(),null},e.prototype.deactivate=function(){return this.active=!1,this.render(),null},e.prototype.render=function(t){var e,r,n,o;return this.active?(e=this.plot_view.canvas,r=this.plot_view.frame,n=e.vx_to_sx(r.get("h_range").get("end")-40),o=e.vy_to_sy(r.get("v_range").get("start")+40),this.$el.attr("style","position:absolute; top:"+o+"px; left:"+n+"px;"),this.$el.show()):this.$el.hide(),this},e.prototype._pan_start=function(t){var e;return e=this.plot_view.canvas,this.ch=e.get("height"),this.cw=e.get("width"),this.plot_view.interactive_timestamp=Date.now(),null},e.prototype._pan=function(t){return this._update(t.deltaX,t.deltaY),this.plot_view.interactive_timestamp=Date.now(),null},e.prototype._pan_end=function(t){return this.plot_view.push_state("resize",{dimensions:{width:this.plot_view.canvas.get("width"),height:this.plot_view.canvas.get("height")}})},e.prototype._update=function(t,e){var r,n;n=this.cw+t,r=this.cw+e,n<100||r<100||this.plot_view.update_dimensions(n,r)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="ResizeTool",e.prototype.tool_name="Resize",e.prototype.icon="bk-tool-icon-resize",e.prototype.event_type="pan",e.prototype.default_order=40,e}(n.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","./gesture_tool":"models/tools/gestures/gesture_tool",underscore:"underscore"}],"models/tools/gestures/select_tool":[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;a=t("underscore"),n=t("./gesture_tool"),o=t("../../renderers/glyph_renderer"),l=t("../../../core/logging").logger,u=t("../../../core/properties"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._keyup=function(t){var e,r,n,o,i,s,a;if(27===t.keyCode){for(i=this.mget("computed_renderers"),s=[],r=0,n=i.length;r<n;r++)o=i[r],e=o.get("data_source"),a=e.get("selection_manager"),s.push(a.clear());return s}},e.prototype._save_geometry=function(t,e,r){var n,o,i,s,u,h,c,p;if(n=a.clone(t),c=this.plot_view.frame.get("x_mappers")["default"],p=this.plot_view.frame.get("y_mappers")["default"],"point"===n.type)n.x=c.map_from_target(n.vx),n.y=p.map_from_target(n.vy);else if("rect"===n.type)n.x0=c.map_from_target(n.vx0),n.y0=p.map_from_target(n.vy0),n.x1=c.map_from_target(n.vx1),n.y1=p.map_from_target(n.vy1);else if("poly"===n.type)for(n.x=new Array(n.vx.length),n.y=new Array(n.vy.length),i=s=0,u=n.vx.length;0<=u?s<u:s>u;i=0<=u?++s:--s)n.x[i]=c.map_from_target(n.vx[i]),n.y[i]=p.map_from_target(n.vy[i]);else l.debug("Unrecognized selection geometry type: '"+n.type+"'");return e&&(h=this.plot_model.plot.tool_events,r?(o=h.get("geometries"),o.push(n)):o=[n],h.set("geometries",o)),null},e}(n.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.define({renderers:[u.Array,[]],names:[u.Array,[]]}),e.internal({multi_select_modifier:[u.String,"shift"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("computed_renderers",function(){var t,e,r,n;return n=this.get("renderers"),e=this.get("names"),0===n.length&&(t=this.get("plot").get("renderers"),n=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],r instanceof o.Model&&i.push(r);return i}()),e.length>0&&(n=function(){var t,o,i;for(i=[],t=0,o=n.length;t<o;t++)r=n[t],e.indexOf(r.get("name"))>=0&&i.push(r);return i}()),n},!0),this.add_dependencies("computed_renderers",this,["renderers","names","plot"]),this.add_dependencies("computed_renderers",this.get("plot"),["renderers"]),null},e}(n.Model),e.exports={Model:i,View:s}},{"../../../core/logging":"core/logging","../../../core/properties":"core/properties","../../renderers/glyph_renderer":"models/renderers/glyph_renderer","./gesture_tool":"models/tools/gestures/gesture_tool",underscore:"underscore"}],"models/tools/gestures/tap_tool":[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;s=t("underscore"),n=t("./select_tool"),a=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._tap=function(t){var e,r,n,o,i;return r=this.plot_view.canvas,o=r.sx_to_vx(t.bokeh.sx),i=r.sy_to_vy(t.bokeh.sy),e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(o,i,!0,e)},e.prototype._select=function(t,e,r,n){var o,i,a,l,u,h,c,p,_,d,f;for(u={type:"point",vx:t,vy:e},o=this.mget("callback"),this._save_geometry(u,r,n),i={geometries:this.plot_model.plot.tool_events.get("geometries")},_=this.mget("computed_renderers"),h=0,c=_.length;h<c;h++)p=_[h],l=p.get("data_source"),d=l.get("selection_manager"),f=this.plot_view.renderer_views[p.id],a="select"===this.model.behavior?d.select(this,f,u,r,n):d.inspect(this,f,u,{geometry:u}),a&&null!=o&&(s.isFunction(o)?o(l,i):o.execute(l,i));return"select"===this.model.behavior&&this.plot_view.push_state("tap",{selection:this.plot_view.get_selection()}),null},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="TapTool",e.prototype.tool_name="Tap",e.prototype.icon="bk-tool-icon-tap-select",e.prototype.event_type="tap",e.prototype.default_order=10,e.define({behavior:[a.String,"select"],callback:[a.Any]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","./select_tool":"models/tools/gestures/select_tool",underscore:"underscore"}],"models/tools/gestures/wheel_zoom_tool":[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;s=t("underscore"),n=t("./gesture_tool"),l=t("../../../core/properties"),"undefined"!=typeof a&&null!==a||(a={}),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._pinch=function(t){var e;return e=t.scale>=1?20*(t.scale-1):-20/t.scale,t.bokeh.delta=e,this._scroll(t)},e.prototype._scroll=function(t){var e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A;i=this.plot_model.get("frame"),a=i.get("h_range"),w=i.get("v_range"),M=this.plot_view.canvas.sx_to_vx(t.bokeh.sx),T=this.plot_view.canvas.sy_to_vy(t.bokeh.sy),(M<a.get("start")||M>a.get("end"))&&(x=!0),(T<w.get("start")||T>w.get("end"))&&(s=!0),u=navigator.userAgent.toLowerCase().indexOf("firefox")>-1?20:1,e=null!=(null!=(c=t.originalEvent)?c.deltaY:void 0)?-t.originalEvent.deltaY*u:t.bokeh.delta,o=this.mget("speed")*e,o>.9?o=.9:o<-.9&&(o=-.9),j=a.get("start"),k=a.get("end"),z=w.get("start"),S=w.get("end"),r=this.mget("dimensions"),r.indexOf("width")>-1&&!x?(g=j-(j-M)*o,y=k-(k-M)*o):(g=j,y=k),r.indexOf("height")>-1&&!s?(v=z-(z-T)*o,b=S-(S-T)*o):(v=z,b=S),P={},p=i.get("x_mappers");for(h in p)l=p[h],_=l.v_map_from_target([g,y],!0),m=_[0],n=_[1],P[h]={start:m,end:n};E={},d=i.get("y_mappers");for(h in d)l=d[h],f=l.v_map_from_target([v,b],!0),m=f[0],n=f[1],E[h]={start:m,end:n};return A={xrs:P,yrs:E,factor:o},this.plot_view.push_state("wheel_zoom",{range:A}),this.plot_view.update_range(A,!1,!0),this.plot_view.interactive_timestamp=Date.now(),null},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=i,e.prototype.type="WheelZoomTool",e.prototype.tool_name="Wheel Zoom",e.prototype.icon="bk-tool-icon-wheel-zoom",e.prototype.event_type="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",e.prototype.default_order=10,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this._get_dim_tooltip(this.tool_name,this._check_dims(this.get("dimensions"),"wheel zoom tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"])},e.define({dimensions:[l.Array,["width","height"]]}),e.internal({speed:[l.Number,1/600]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","./gesture_tool":"models/tools/gestures/gesture_tool",underscore:"underscore"}],"models/tools/inspectors/crosshair_tool":[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;a=t("underscore"),i=t("./inspect_tool"),s=t("../../annotations/span"),l=t("../../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._move=function(t){var e,r,n,o,i,s,a,l,u,h;if(this.mget("active")){for(n=this.plot_model.get("frame"),e=this.plot_model.get("canvas"),u=e.sx_to_vx(t.bokeh.sx),h=e.sy_to_vy(t.bokeh.sy),s=this.mget("dimensions"),a=[],o=0,i=s.length;o<i;o++)r=s[o],l=this.mget("spans")[r],n.contains(u,h)?"width"===r?a.push(l.set("computed_location",h)):a.push(l.set("computed_location",u)):a.push(l.unset("computed_location"));return a}},e.prototype._move_exit=function(t){var e,r,n,o,i,s;for(o=this.mget("dimensions"),i=[],r=0,n=o.length;r<n;r++)e=o[r],s=this.mget("spans")[e],i.push(s.unset("computed_location"));return i},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="CrosshairTool",e.prototype.tool_name="Crosshair",e.define({dimensions:[l.Array,["width","height"]],line_color:[l.Color,"black"],line_width:[l.Number,1],line_alpha:[l.Number,1]}),e.internal({location_units:[l.SpatialUnits,"screen"],render_mode:[l.RenderMode,"css"],spans:[l.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this._get_dim_tooltip("Crosshair",this._check_dims(this.get("dimensions"),"crosshair tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"]),this.spans={width:new s.Model({for_hover:!0,dimension:"width",render_mode:this.get("render_mode"),location_units:this.get("location_units"),line_color:this.get("line_color"),line_width:this.get("line_width"),line_alpha:this.get("line_alpha")}),height:new s.Model({for_hover:!0,dimension:"height",render_mode:this.get("render_mode"),location_units:this.get("location_units"),line_color:this.get("line_color"),line_width:this.get("line_width"),line_alpha:this.get("line_alpha")})},this.override_computed_property("synthetic_renderers",function(t){return function(){return a.values(t.get("spans"))}}(this),!0)},e}(i.Model),e.exports={Model:n,View:o}},{"../../../core/properties":"core/properties","../../annotations/span":"models/annotations/span","./inspect_tool":"models/tools/inspectors/inspect_tool",underscore:"underscore"}],"models/tools/inspectors/hover_tool":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f=function(t,e){function r(){this.constructor=t}for(var n in e)m.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},m={}.hasOwnProperty;h=t("underscore"),n=t("jquery"),a=t("./inspect_tool"),l=t("../../annotations/tooltip"),o=t("../../renderers/glyph_renderer"),p=t("../../../common/hittest"),_=t("../../../core/logging").logger,d=t("../../../core/properties"),u=t("../../../util/util"),c=function(t){var e,r,n,o,i;return"#"===t.substr(0,1)?t:(r=/(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(t),o=parseInt(r[2]),n=parseInt(r[3]),e=parseInt(r[4]),i=e|n<<8|o<<16,r[1]+"#"+i.toString(16))},s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.prototype.bind_bokeh_events=function(){var t,e,r,n;for(n=this.mget("computed_renderers"),t=0,e=n.length;t<e;t++)r=n[t],this.listenTo(r.data_source,"inspect",this._update);return this.plot_view.canvas_view.$el.css("cursor","crosshair")},e.prototype._clear=function(){var t,e,r,n;this._inspect(1/0,1/0),t=this.mget("ttmodels"),e=[];for(r in t)n=t[r],e.push(n.clear());return e},e.prototype._move=function(t){var e,r,n;if(this.mget("active"))return e=this.plot_view.canvas,r=e.sx_to_vx(t.bokeh.sx),n=e.sy_to_vy(t.bokeh.sy),this.plot_view.frame.contains(r,n)?this._inspect(r,n):this._clear()},e.prototype._move_exit=function(){return this._clear()},e.prototype._inspect=function(t,e,r){var n,o,i,s,a,l,u,h;for(n={type:"point",vx:t,vy:e},"mouse"===this.model.mode?n.type="point":(n.type="span","vline"===this.model.mode?n.direction="h":n.direction="v"),o=[],i=[],u=this.mget("computed_renderers"),s=0,a=u.length;s<a;s++)l=u[s],h=l.data_source.get("selection_manager"),h.inspect(this,this.plot_view.renderer_views[l.id],n,{geometry:n});null!=this.mget("callback")&&this._emit_callback(n)},e.prototype._update=function(t,e,r,n,o){var i,s,a,l,u,c,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F,B,L,G,V,U,Y,H,X,$,W,J,Q,K,Z,tt,et,rt,nt;if(g=o.geometry,J=null!=(z=this.mget("ttmodels")[r.model.id])?z:null,null!=J&&(J.clear(),null!==t["0d"].glyph||0!==t["1d"].indices.length)){for(K=g.vx,Z=g.vy,i=this.plot_model.get("canvas"),m=this.plot_model.get("frame"),$=i.vx_to_sx(K),W=i.vy_to_sy(Z),et=m.get("x_mappers")[r.mget("x_range_name")],nt=m.get("y_mappers")[r.mget("y_range_name")],tt=et.map_from_target(K),rt=nt.map_from_target(Z),P=t["0d"].indices,b=0,w=P.length;b<w;b++)y=P[b],c=r.glyph._x[y+1],_=r.glyph._y[y+1],"interp"===this.model.line_policy?(D=r.glyph.get_interpolation_hit(y,g),c=D[0],_=D[1],U=et.map_to_target(c),Y=nt.map_to_target(_)):"prev"===this.model.line_policy?(U=i.sx_to_vx(r.glyph.sx[y]),Y=i.sy_to_vy(r.glyph.sy[y])):"next"===this.model.line_policy?(U=i.sx_to_vx(r.glyph.sx[y+1]),Y=i.sy_to_vy(r.glyph.sy[y+1])):"nearest"===this.model.line_policy?(s=r.glyph.sx[y],a=r.glyph.sy[y],d=p.dist_2_pts(s,a,$,W),l=r.glyph.sx[y+1],u=r.glyph.sy[y+1],f=p.dist_2_pts(l,u,$,W),d<f?(I=[s,a],H=I[0],X=I[1]):(R=[l,u],H=R[0],X=R[1],y+=1),c=r.glyph._x[y],_=r.glyph._y[y],U=i.sx_to_vx(H),Y=i.sy_to_vy(X)):(F=[K,Z],U=F[0],Y=F[1]),Q={index:y,x:tt,y:rt,vx:K,vy:Z,sx:$,sy:W,data_x:c,data_y:_,rx:U,ry:Y},J.add(U,Y,this._render_tooltips(n,y,Q));for(B=t["1d"].indices,x=0,M=B.length;x<M;x++)if(y=B[x],h.isEmpty(t["2d"]))c=null!=(C=r.glyph._x)?C[y]:void 0,_=null!=(N=r.glyph._y)?N[y]:void 0,"snap_to_data"===this.model.point_policy?(S=r.glyph.get_anchor_point(this.model.anchor,y,[$,W]),null!=S?(tt=S.x,rt=S.y):(O=r.glyph.get_anchor_point("center",y,[$,W]),tt=O.x,rt=O.y),U=i.sx_to_vx(tt),Y=i.sy_to_vy(rt)):(q=[K,Z],U=q[0],Y=q[1]),Q={index:y,x:tt,y:rt,vx:K,vy:Z,sx:$,sy:W,data_x:c,data_y:_},J.add(U,Y,this._render_tooltips(n,y,Q));else for(L=h.pairs(t["2d"]),j=0,k=L.length;j<k;j++)T=L[j],G=[T[0],T[1][0]],y=G[0],v=G[1],c=r.glyph._xs[y][v],_=r.glyph._ys[y][v],"interp"===this.model.line_policy?(V=r.glyph.get_interpolation_hit(y,v,g),c=V[0],_=V[1],U=et.map_to_target(c),Y=nt.map_to_target(_)):"prev"===this.model.line_policy?(U=i.sx_to_vx(r.glyph.sxs[y][v]),Y=i.sy_to_vy(r.glyph.sys[y][v])):"next"===this.model.line_policy?(U=i.sx_to_vx(r.glyph.sxs[y][v+1]),Y=i.sy_to_vy(r.glyph.sys[y][v+1])):"nearest"===this.model.line_policy&&(s=r.glyph.sx[y][v],a=r.glyph.sy[y][v],d=p.dist_2_pts(s,a,$,W),l=r.glyph.sx[y][v+1],u=r.glyph.sy[y][v+1],f=p.dist_2_pts(l,u,$,W),d<f?(E=[s,a],H=E[0],X=E[1]):(A=[l,u],H=A[0],X=A[1],v+=1),c=r.glyph._x[y][v],_=r.glyph._y[y][v],U=i.sx_to_vx(H),Y=i.sy_to_vy(X)),Q={index:y,segment_index:v,x:tt,y:rt,vx:K,vy:Z,sx:$,sy:W,data_x:c,data_y:_
},J.add(U,Y,this._render_tooltips(n,y,Q));return null}},e.prototype._emit_callback=function(t){var e,r,n,o,i,s,a,l,u,c;a=this.mget("computed_renderers")[0],i=this.plot_view.renderer_views[a.id].hit_test(t),r=this.plot_model.canvas,o=this.plot_model.frame,t.sx=r.vx_to_sx(t.vx),t.sy=r.vy_to_sy(t.vy),u=o.get("x_mappers")[a.get("x_range_name")],c=o.get("y_mappers")[a.get("y_range_name")],t.x=u.map_from_target(t.vx),t.y=c.map_from_target(t.vy),e=this.model.callback,l=[e,{index:i,geometry:t}],s=l[0],n=l[1],h.isFunction(e)?e(s,n):e.execute(s,n)},e.prototype._render_tooltips=function(t,e,r){var o,i,s,a,l,p,_,d,f,m,g,y,v,b,x,w,M,k;if(M=this.mget("tooltips"),h.isString(M))return n("<div>").html(u.replace_placeholders(M,t,e,r));if(h.isFunction(M))return M(t,r);for(x=n("<table></table>"),l=0,_=M.length;l<_;l++){if(m=M[l],p=m[0],k=m[1],y=n("<tr></tr>"),y.append(n("<td class='bk-tooltip-row-label'>").text(p+": ")),w=n("<td class='bk-tooltip-row-value'></td>"),k.indexOf("$color")>=0){if(g=k.match(/\$color(\[.*\])?:(\w*)/),d=g[0],f=g[1],o=g[2],s=t.get_column(o),null==s){v=n("<span>").text(o+" unknown"),w.append(v);continue}if(a=(null!=f?f.indexOf("hex"):void 0)>=0,b=(null!=f?f.indexOf("swatch"):void 0)>=0,i=s[e],null==i){v=n("<span>(null)</span>"),w.append(v);continue}a&&(i=c(i)),v=n("<span>").text(i),w.append(v),b&&(v=n("<span class='bk-tooltip-color-block'> </span>"),v.css({backgroundColor:i})),w.append(v)}else k=k.replace("$~","$data_"),k=u.replace_placeholders(k,t,e,r),w.append(n("<span>").html(k));y.append(w),x.append(y)}return x},e}(a.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.prototype.default_view=s,e.prototype.type="HoverTool",e.prototype.tool_name="Hover Tool",e.prototype.icon="bk-tool-icon-hover",e.define({tooltips:[d.Any,[["index","$index"],["data (x, y)","($x, $y)"],["canvas (x, y)","($sx, $sy)"]]],renderers:[d.Array,[]],names:[d.Array,[]],mode:[d.String,"mouse"],point_policy:[d.String,"snap_to_data"],line_policy:[d.String,"prev"],show_arrow:[d.Boolean,!0],anchor:[d.String,"center"],attachment:[d.String,"horizontal"],callback:[d.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("computed_renderers",function(){var t,e,r,n;return n=this.get("renderers"),e=this.get("names"),0===n.length&&(t=this.get("plot").get("renderers"),n=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],r instanceof o.Model&&i.push(r);return i}()),e.length>0&&(n=function(){var t,o,i;for(i=[],t=0,o=n.length;t<o;t++)r=n[t],e.indexOf(r.get("name"))>=0&&i.push(r);return i}()),n},!0),this.add_dependencies("computed_renderers",this,["renderers","names","plot"]),this.add_dependencies("computed_renderers",this.get("plot"),["renderers"]),this.define_computed_property("ttmodels",function(){var t,e,r,n,o,i,s;if(s={},i=this.get("tooltips"),null!=i)for(n=this.get("computed_renderers"),t=0,e=n.length;t<e;t++)r=n[t],o=new l.Model({custom:h.isString(i)||h.isFunction(i),attachment:this.attachment,show_arrow:this.show_arrow}),s[r.id]=o;return s},!0),this.add_dependencies("ttmodels",this,["computed_renderers","tooltips"]),this.override_computed_property("synthetic_renderers",function(){return h.values(this.get("ttmodels"))},!0),this.add_dependencies("synthetic_renderers",this,["ttmodels"])},e}(a.Model),e.exports={Model:i,View:s}},{"../../../common/hittest":"common/hittest","../../../core/logging":"core/logging","../../../core/properties":"core/properties","../../../util/util":"util/util","../../annotations/tooltip":"models/annotations/tooltip","../../renderers/glyph_renderer":"models/renderers/glyph_renderer","./inspect_tool":"models/tools/inspectors/inspect_tool",jquery:"jquery",underscore:"underscore"}],"models/tools/inspectors/inspect_tool":[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;l=t("underscore"),n=t("backbone"),a=t("../tool"),u=t("./inspect_tool_list_item_template"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.className="bk-toolbar-inspector",e.prototype.template=u,e.prototype.events={'click [type="checkbox"]':"_clicked"},e.prototype.initialize=function(t){return this.listenTo(this.model,"change:active",this.render),this.render()},e.prototype.render=function(){return this.$el.html(this.template({model:this.model})),this},e.prototype._clicked=function(t){var e;return e=this.model.get("active"),this.model.set("active",!e)},e}(n.View),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(a.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.event_type="move",e.override({active:!0}),e.prototype.bind_bokeh_events=function(){return e.__super__.bind_bokeh_events.call(this),this.listenTo(events,"move",this._inspect)},e.prototype._inspect=function(t,e,r){},e.prototype._exit_inner=function(){},e.prototype._exit_outer=function(){},e}(a.Model),e.exports={Model:o,View:s,ListItemView:i}},{"../tool":"models/tools/tool","./inspect_tool_list_item_template":"models/tools/inspectors/inspect_tool_list_item_template",backbone:"backbone",underscore:"underscore"}],"models/tools/inspectors/inspect_tool_list_item_template":[function(t,e,r){e.exports=function(t){t||(t={});var e=[],r=function(t){return t&&t.ecoSafe?t:"undefined"!=typeof t&&null!=t?n(t):""},n=function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};return function(){(function(){e.push('<input type="checkbox" '),this.model.active&&e.push("checked"),e.push(">"),e.push(r(this.model.tool_name)),e.push("</input>\n")}).call(this)}.call(t),e.join("")}},{}],"models/tools/tool":[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;a=t("underscore"),o=t("../renderers/renderer"),l=t("../../core/logging").logger,u=t("../../core/properties"),n=t("../../model"),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.bind_bokeh_events=function(){return this.listenTo(this.model,"change:active",function(t){return function(){return t.mget("active")?t.activate():t.deactivate()}}(this))},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("synthetic_renderers",function(){return[]},!0)},e.define({plot:[u.Instance]}),e.internal({level:[u.RenderLevel,"overlay"],active:[u.Boolean,!1]}),e.prototype._check_dims=function(t,e){var r,n,o;return n=[!1,!1],o=n[0],r=n[1],0===t.length?l.warn(e+" given empty dimensions"):1===t.length?"width"!==t[0]&&"height"!==t[0]&&l.warn(e+" given unrecognized dimensions: "+t):2===t.length?(t.indexOf("width")<0||t.indexOf("height")<0)&&l.warn(e+" given unrecognized dimensions: "+t):l.warn(e+" given more than two dimensions: "+t),t.indexOf("width")>=0&&(o=!0),t.indexOf("height")>=0&&(r=!0),[o,r]},e.prototype._get_dim_tooltip=function(t,e){var r,n;return n=e[0],r=e[1],n&&!r?t+" (x-axis)":r&&!n?t+" (y-axis)":t},e.prototype._get_dim_limits=function(t,e,r,n){var o,i,s,l,u,h,c,p;return s=t[0],h=t[1],l=e[0],c=e[1],o=r.get("h_range"),n.indexOf("width")>=0?(u=[a.min([s,l]),a.max([s,l])],u=[a.max([u[0],o.get("min")]),a.min([u[1],o.get("max")])]):u=[o.get("min"),o.get("max")],i=r.get("v_range"),n.indexOf("height")>=0?(p=[a.min([h,c]),a.max([h,c])],p=[a.max([p[0],i.get("min")]),a.min([p[1],i.get("max")])]):p=[i.get("min"),i.get("max")],[u,p]},e}(n),e.exports={Model:i,View:s}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../../model":"model","../renderers/renderer":"models/renderers/renderer",underscore:"underscore"}],"models/tools/tool_proxy":[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("../../core/properties"),n=t("../../model"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this,"do",this["do"]),this.listenTo(this,"change:active",this.set_active)},e.prototype["do"]=function(){var t,e,r,n;for(r=this.tools,t=0,e=r.length;t<e;t++)n=r[t],n.trigger("do");return null},e.prototype.set_active=function(){var t,e,r,n;for(r=this.tools,t=0,e=r.length;t<e;t++)n=r[t],n.active=this.active;return null},e.define({tools:[i.Array,[]],active:[i.Bool,!1],tooltip:[i.String],tool_name:[i.String],disabled:[i.Bool,!1],event_type:[i.String],icon:[i.String]}),e.prototype._clicked=function(){var t;return t=this.model.get("active"),this.model.set("active",!t)},e}(n),e.exports={ToolProxy:o}},{"../../core/properties":"core/properties","../../model":"model"}],"models/tools/toolbar":[function(t,e,r){var n,o,i,s,a,l,u,h,c=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;u=t("underscore"),h=t("../../core/properties"),n=t("./actions/action_tool"),i=t("./actions/help_tool"),o=t("./gestures/gesture_tool"),s=t("./inspectors/inspect_tool"),l=t("./toolbar_base"),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return c(e,t),e.prototype.type="Toolbar",e.prototype.default_view=l.View,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.listenTo(this,"change:tools",this._init_tools),this._init_tools()},e.prototype._init_tools=function(){var t,e,r,a,l,h,c;for(a=this.get("tools"),e=0,r=a.length;e<r;e++)if(h=a[e],h instanceof s.Model)u.some(this.inspectors,function(t){return function(t){return t.id===h.id}}(this))||(this.inspectors=this.inspectors.concat([h]));else if(h instanceof i.Model)u.some(this.help,function(t){return function(t){return t.id===h.id}}(this))||(this.help=this.help.concat([h]));else if(h instanceof n.Model)u.some(this.actions,function(t){return function(t){return t.id===h.id}}(this))||(this.actions=this.actions.concat([h]));else if(h instanceof o.Model){if(t=h.event_type,!(t in this.gestures)){logger.warn("Toolbar: unknown event type '"+t+"' for tool: "+h.type+" ("+h.id+")");continue}u.some(this.gestures[t].tools,function(t){return function(t){return t.id===h.id}}(this))||(this.gestures[t].tools=this.gestures[t].tools.concat([h])),this.listenTo(h,"change:active",u.bind(this._active_change,h))}l=[];for(t in this.gestures)if(c=this.gestures[t].tools,0!==c.length){if(this.gestures[t].tools=u.sortBy(c,function(t){return t.default_order}),"tap"===t){if(null===this.active_tap)continue;"auto"===this.active_tap?this.gestures[t].tools[0].active=!0:this.active_tap.active=!0}if("pan"===t){if(null===this.active_drag)continue;"auto"===this.active_drag?this.gestures[t].tools[0].active=!0:this.active_drag.active=!0}if("pinch"===t||"scroll"===t){if(null===this.active_scroll||"auto"===this.active_scroll)continue;l.push(this.active_scroll.active=!0)}else l.push(void 0)}return l},e.define({active_drag:[h.Any,"auto"],active_scroll:[h.Any,"auto"],active_tap:[h.Any,"auto"]}),e}(l.Model),e.exports={Model:a}},{"../../core/properties":"core/properties","./actions/action_tool":"models/tools/actions/action_tool","./actions/help_tool":"models/tools/actions/help_tool","./gestures/gesture_tool":"models/tools/gestures/gesture_tool","./inspectors/inspect_tool":"models/tools/inspectors/inspect_tool","./toolbar_base":"models/tools/toolbar_base",underscore:"underscore"}],"models/tools/toolbar_base":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v=function(t,e){function r(){this.constructor=t}for(var n in e)b.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},b={}.hasOwnProperty,x=function(t,e){return function(){return t.apply(e,arguments)}};d=t("underscore"),n=t("jquery"),o=t("bootstrap/dropdown"),f=t("../../core/logging").logger,g=t("../../core/layout/solver"),s=g.EQ,_=g.Variable,m=t("../../core/properties"),h=t("../layouts/layout_dom"),i=t("./actions/action_tool"),l=t("./actions/help_tool"),a=t("./gestures/gesture_tool"),u=t("./inspectors/inspect_tool"),y=t("./toolbar_template"),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return v(e,t),e.prototype.className="bk-toolbar-wrapper",e.prototype.template=y,e.prototype.render=function(){var t,e,r,o,s,l,h,c;"fixed"!==this.model.sizing_mode&&this.$el.css({left:this.model._dom_left._value,top:this.model._dom_top._value,width:this.model._width._value,height:this.model._height._value}),l=null!=this.model.toolbar_location?this.model.toolbar_location:"above",h=this.model.toolbar_sticky===!0?"sticky":"not-sticky",this.$el.html(this.template({logo:this.mget("logo"),location:l,sticky:h})),s=this.model.get("inspectors"),e=this.$(".bk-bs-dropdown[type='inspectors']"),0===s.length?e.hide():(t=n('<a href="#" data-bk-bs-toggle="dropdown" class="bk-bs-dropdown-toggle">inspect <span class="bk-bs-caret"></a>'),t.appendTo(e),c=n('<ul class="bk-bs-dropdown-menu" />'),d.each(s,function(t){var e;return e=n("<li />"),e.append(new u.ListItemView({model:t}).el),e.appendTo(c)}),c.on("click",function(t){return t.stopPropagation()}),c.appendTo(e),t.dropdown()),e=this.$(".bk-button-bar-list[type='help']"),d.each(this.model.get("help"),function(t){return e.append(new i.ButtonView({model:t}).el)}),e=this.$(".bk-button-bar-list[type='actions']"),d.each(this.model.get("actions"),function(t){return e.append(new i.ButtonView({model:t}).el)}),o=this.model.get("gestures");for(r in o)e=this.$(".bk-button-bar-list[type='"+r+"']"),d.each(o[r].tools,function(t){return e.append(new a.ButtonView({model:t}).el)});return this},e}(h.View),c=function(t){function e(){return this._active_change=x(this._active_change,this),e.__super__.constructor.apply(this,arguments)}return v(e,t),e.prototype.type="ToolbarBase",e.prototype.default_view=p,e.prototype._active_change=function(t){var e,r,n;return r=t.event_type,n=this.get("gestures"),e=n[r].active,null!=e&&e!==t&&(f.debug("Toolbar: deactivating tool: "+e.type+" ("+e.id+") for event type '"+r+"'"),e.set("active",!1)),n[r].active=t,this.set("gestures",n),f.debug("Toolbar: activating tool: "+t.type+" ("+t.id+") for event type '"+r+"'"),null},e.prototype.get_constraints=function(){var t;return t=e.__super__.get_constraints.call(this),t.push(s(this._sizeable,-30)),t},e.define({tools:[m.Array,[]],logo:[m.String,"normal"]}),e.internal({gestures:[m.Any,function(){return{pan:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null}}}],actions:[m.Array,[]],inspectors:[m.Array,[]],help:[m.Array,[]],toolbar_location:[m.Location,"right"],toolbar_sticky:[m.Bool]}),e.override({sizing_mode:null}),e}(h.Model),e.exports={Model:c,View:p}},{"../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../layouts/layout_dom":"models/layouts/layout_dom","./actions/action_tool":"models/tools/actions/action_tool","./actions/help_tool":"models/tools/actions/help_tool","./gestures/gesture_tool":"models/tools/gestures/gesture_tool","./inspectors/inspect_tool":"models/tools/inspectors/inspect_tool","./toolbar_template":"models/tools/toolbar_template","bootstrap/dropdown":"bootstrap/dropdown",jquery:"jquery",underscore:"underscore"}],"models/tools/toolbar_box":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f=function(t,e){function r(){this.constructor=t}for(var n in e)m.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},m={}.hasOwnProperty;_=t("underscore"),d=t("../../core/properties"),n=t("./actions/action_tool"),s=t("./actions/help_tool"),i=t("./gestures/gesture_tool"),a=t("./inspectors/inspect_tool"),u=t("./toolbar_base"),l=t("./tool_proxy").ToolProxy,o=t("../layouts/box"),c=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.prototype.type="ToolbarBoxToolbar",e.prototype.default_view=u.View,e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),this._init_tools(),this.merge_tools===!0)return this._merge_tools()},e.define({merge_tools:[d.Bool,!0]}),e.prototype._init_tools=function(){var t,e,r,o,l,u;for(o=this.get("tools"),l=[],e=0,r=o.length;e<r;e++)u=o[e],u instanceof a.Model?_.some(this.inspectors,function(t){return function(t){return t.id===u.id}}(this))?l.push(void 0):l.push(this.inspectors=this.inspectors.concat([u])):u instanceof s.Model?_.some(this.help,function(t){return function(t){return t.id===u.id}}(this))?l.push(void 0):l.push(this.help=this.help.concat([u])):u instanceof n.Model?_.some(this.actions,function(t){return function(t){return t.id===u.id}}(this))?l.push(void 0):l.push(this.actions=this.actions.concat([u])):u instanceof i.Model?(t=u.event_type,_.some(this.gestures[t].tools,function(t){return function(t){return t.id===u.id}}(this))?l.push(void 0):l.push(this.gestures[t].tools=this.gestures[t].tools.concat([u]))):l.push(void 0);return l},e.prototype._merge_tools=function(){var t,e,r,n,o,i,s,a,u,h,c,p,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A;for(u={},t={},o={},v=[],b=[],w=this.help,s=0,d=w.length;s<d;s++)i=w[s],_.contains(b,i.redirect)||(v.push(i),b.push(i.redirect));this.help=v,M=this.gestures;for(n in M){a=M[n],n in o||(o[n]={}),k=a.tools;for(h=0,f=k.length;h<f;h++)P=k[h],P.type in o[n]||(o[n][P.type]=[]),o[n][P.type].push(P)}for(j=this.inspectors,c=0,m=j.length;c<m;c++)P=j[c],P.type in u||(u[P.type]=[]),u[P.type].push(P);for(T=this.actions,p=0,g=T.length;p<g;p++)P=T[p],P.type in t||(t[P.type]=[]),t[P.type].push(P);y=function(t,e){return null==e&&(e=!1),new l({tools:t,event_type:t[0].event_type,tooltip:t[0].tool_name,tool_name:t[0].tool_name,icon:t[0].icon,active:e})};for(n in o){this.gestures[n].tools=[],S=o[n];for(E in S)A=S[E],A.length>0&&(x=y(A),this.gestures[n].tools.push(x),this.listenTo(x,"change:active",_.bind(this._active_change,x)))}this.actions=[];for(E in t)A=t[E],A.length>0&&this.actions.push(y(A));this.inspectors=[];for(E in u)A=u[E],A.length>0&&this.inspectors.push(y(A,e=!0));z=[];for(r in this.gestures)A=this.gestures[r].tools,0!==A.length&&(this.gestures[r].tools=_.sortBy(A,function(t){return t.default_order}),"pinch"!==r&&"scroll"!==r?z.push(this.gestures[r].tools[0].set("active",!0)):z.push(void 0));return z},e}(u.Model),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.prototype.className="bk-toolbar-box",e.prototype.get_width=function(){return this.model._horizontal===!0?30:null},e.prototype.get_height=function(){return 30},e}(o.View),h=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.prototype.type="ToolbarBox",e.prototype.default_view=p,e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this._toolbar=new c(t),"left"===(r=this.toolbar_location)||"right"===r?(this._horizontal=!0,this._toolbar._sizeable=this._toolbar._width):(this._horizontal=!1,this._toolbar._sizeable=this._toolbar._height)},e.prototype._doc_attached=function(){return this._toolbar.attach_document(this.document)},e.prototype.get_layoutable_children=function(){return[this._toolbar]},e.define({toolbar_location:[d.Location,"right"],merge_tools:[d.Bool,!0],tools:[d.Any,[]],logo:[d.String,"normal"]}),e}(o.Model),e.exports={Model:h,View:p}},{"../../core/properties":"core/properties","../layouts/box":"models/layouts/box","./actions/action_tool":"models/tools/actions/action_tool","./actions/help_tool":"models/tools/actions/help_tool","./gestures/gesture_tool":"models/tools/gestures/gesture_tool","./inspectors/inspect_tool":"models/tools/inspectors/inspect_tool","./tool_proxy":"models/tools/tool_proxy","./toolbar_base":"models/tools/toolbar_base",underscore:"underscore"}],"models/tools/toolbar_template":[function(t,e,r){e.exports=function(t){t||(t={});var e=[],r=function(t){return t&&t.ecoSafe?t:"undefined"!=typeof t&&null!=t?n(t):""},n=function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};return function(){(function(){e.push('<div class="bk-toolbar-'),e.push(r(this.location)),e.push(" bk-plot-"),e.push(r(this.location)),e.push(" bk-toolbar-"),e.push(r(this.sticky)),e.push(' bk-toolbar-active">\n '),null!=this.logo&&"grey"===this.logo?e.push("\n <a href='http://bokeh.pydata.org/' target='_blank' class='bk-logo bk-logo-small grey'></a>\n "):null!=this.logo&&e.push("\n <a href='http://bokeh.pydata.org/' target='_blank' class='bk-logo bk-logo-small'></a>\n "),e.push("\n <div class='bk-button-bar'>\n <ul class='bk-button-bar-list' type=\"pan\" />\n <ul class='bk-button-bar-list' type=\"scroll\" />\n <ul class='bk-button-bar-list' type=\"pinch\" />\n <ul class='bk-button-bar-list' type=\"tap\" />\n <ul class='bk-button-bar-list' type=\"press\" />\n <ul class='bk-button-bar-list' type=\"rotate\" />\n <ul class='bk-button-bar-list' type=\"actions\" />\n <div class='bk-button-bar-list bk-bs-dropdown' type=\"inspectors\" />\n <ul class='bk-button-bar-list' type=\"help\" />\n </div>\n</div>\n")}).call(this)}.call(t),e.join("")}},{}],"models/transforms/interpolator":[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,h=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1};i=t("underscore"),o=t("./transform"),a=t("../../core/properties"),s=t("../../core/logging").logger,n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.bind("change",function(){return this._sorted_dirty=!0})},e.define({x:[a.Any],y:[a.Any],data:[a.Any],clip:[a.Bool,!0]}),e.prototype.sort=function(t){var e,r,n,o,i,s,a,l,u,c,p;if(null==t&&(t=!1),typeof this.get("x")!=typeof this.get("y"))throw Error("The parameters for x and y must be of the same type, either both strings which define a column in the data source or both arrays of the same length");if("string"==typeof this.get("x")&&null===this.get("data"))throw Error("If the x and y parameters are not specified as an array, the data parameter is reqired.");if(this._sorted_dirty!==!1){if(c=[],p=[],"string"==typeof this.get("x")){if(r=this.get("data"),e=r.columns(),a=this.get("x"),h.call(e,a)<0)throw Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(l=this.get("y"),h.call(e,l)<0)throw Error("The x parameter does not correspond to a valid column name defined in the data parameter");c=r.get_column(this.get("x")),p=r.get_column(this.get("y"))}else c=this.get("x"),p=this.get("y");if(c.length!==p.length)throw Error("The length for x and y do not match");if(c.length<2)throw Error("x and y must have at least two elements to support interpolation");s=[];for(o in c)s.push({x:c[o],y:p[o]});for(t===!0?s.sort(function(t,e){var r,n;return null!=(r=t.x<e.x)?r:-{1:null!=(n=t.x===e.x)?n:{0:1}}}):s.sort(function(t,e){var r,n;return null!=(r=t.x>e.x)?r:-{1:null!=(n=t.x===e.x)?n:{0:1}}}),i=n=0,u=s.length-1;0<=u?n<=u:n>=u;i=0<=u?++n:--n)this._x_sorted[i]=s[i].x,this._y_sorted[i]=s[i].y;return this._sorted_dirty=!1}},e}(o.Model),e.exports={Model:n}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./transform":"models/transforms/transform",underscore:"underscore"}],"models/transforms/jitter":[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"),o=t("./transform"),a=t("../../core/properties"),s=t("../../core/util/math"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.define({mean:[a.Number,0],width:[a.Number,1],distribution:[a.Distribution,"uniform"]}),e.prototype.compute=function(t){return"uniform"===this.get("distribution")?t+this.get("mean")+(s.random()-.5)*this.get("width"):"normal"===this.get("distribution")?t+s.rnorm(this.get("mean"),this.get("width")):void 0},e.prototype.v_compute=function(t){var e,r,n,o,i;for(o=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)i=t[r],o[r]=this.compute(i);return o},e}(o.Model),e.exports={Model:n}},{"../../core/properties":"core/properties","../../core/util/math":"core/util/math","./transform":"models/transforms/transform",underscore:"underscore"}],"models/transforms/linear_interpolator":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=t("underscore"),i=t("./transform"),n=t("./interpolator"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.defaults=function(){return s.extend({},e.__super__.defaults.call(this))},e.prototype.compute=function(t){var e,r,n,o,i,a,l;if(this.sort(e=!1),this.clip===!0){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return null}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return r=s.findLastIndex(this._x_sorted,function(e){return t>=e}),o=this._x_sorted[r],i=this._x_sorted[r+1],a=this._y_sorted[r],l=this._y_sorted[r+1],n=a+(t-o)/(i-o)*(l-a)},e.prototype.v_compute=function(t){var e,r,n,o,i;for(o=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)i=t[r],o[r]=this.compute(i);return o},e}(n.Model),e.exports={Model:o}},{"./interpolator":"models/transforms/interpolator","./transform":"models/transforms/transform",underscore:"underscore"}],"models/transforms/step_interpolator":[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;s=t("underscore"),i=t("./transform"),n=t("./interpolator"),a=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.define({mode:[a.TransformStepMode,"after"]}),e.prototype.compute=function(t){var e,r,n,o,i,a;if(this.sort(e=!1),this.clip===!0){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return null}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return n=-1,"after"===this.get("mode")&&(n=s.findLastIndex(this._x_sorted,function(e){return t>=e})),"before"===this.get("mode")&&(n=s.findIndex(this._x_sorted,function(e){return t<=e})),"center"===this.get("mode")&&(r=function(){var e,r,n,o;for(n=this._x_sorted,o=[],e=0,r=n.length;e<r;e++)a=n[e],o.push(Math.abs(a-t));return o}.call(this),o=s.min(r),n=s.findIndex(r,function(t){return o===t})),i=n!==-1?this._y_sorted[n]:null},e.prototype.v_compute=function(t){var e,r,n,o,i;for(o=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)i=t[r],o[r]=this.compute(i);return o},e}(n.Model),e.exports={Model:o}},{"../../core/properties":"core/properties","./interpolator":"models/transforms/interpolator","./transform":"models/transforms/transform",underscore:"underscore"}],"models/transforms/transform":[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("../../model"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.defaults=function(){return i.extend({},e.__super__.defaults.call(this))},e}(n),e.exports={Model:o}},{"../../model":"model",underscore:"underscore"}],"palettes/palettes":[function(t,e,r){var n,o;n=t("underscore"),o={YlGn:{YlGn3:[3253076,11394446,16252089],YlGn4:[2327619,7915129,12773017,16777164],YlGn5:[26679,3253076,7915129,12773017,16777164],YlGn6:[26679,3253076,7915129,11394446,14282915,16777164],YlGn7:[23090,2327619,4303709,7915129,11394446,14282915,16777164],YlGn8:[23090,2327619,4303709,7915129,11394446,14282915,16252089,16777189],YlGn9:[17705,26679,2327619,4303709,7915129,11394446,14282915,16252089,16777189]},YlGnBu:{YlGnBu3:[2916280,8375739,15595697],YlGnBu4:[2252456,4306628,10607284,16777164],YlGnBu5:[2438292,2916280,4306628,10607284,16777164],YlGnBu6:[2438292,2916280,4306628,8375739,13101492,16777164],YlGnBu7:[797828,2252456,1937856,4306628,8375739,13101492,16777164],YlGnBu8:[797828,2252456,1937856,4306628,8375739,13101492,15595697,16777177],YlGnBu9:[531800,2438292,2252456,1937856,4306628,8375739,13101492,15595697,16777177]},GnBu:{GnBu3:[4432586,11066805,14742491],GnBu4:[2854078,8113348,12248252,15792616],GnBu5:[551084,4432586,8113348,12248252,15792616],GnBu6:[551084,4432586,8113348,11066805,13429701,15792616],GnBu7:[546974,2854078,5157843,8113348,11066805,13429701,15792616],GnBu8:[546974,2854078,5157843,8113348,11066805,13429701,14742491,16252144],GnBu9:[540801,551084,2854078,5157843,8113348,11066805,13429701,14742491,16252144]},BuGn:{BuGn3:[2925151,10082505,15070713],BuGn4:[2329413,6734500,11723490,15595771],BuGn5:[27948,2925151,6734500,11723490,15595771],BuGn6:[27948,2925151,6734500,10082505,13429990,15595771],BuGn7:[22564,2329413,4304502,6734500,10082505,13429990,15595771],BuGn8:[22564,2329413,4304502,6734500,10082505,13429990,15070713,16252157],BuGn9:[17435,27948,2329413,4304502,6734500,10082505,13429990,15070713,16252157]},PuBuGn:{PuBuGn3:[1872025,10927579,15524592],PuBuGn4:[164234,6793679,12437985,16183287],PuBuGn5:[93273,1872025,6793679,12437985,16183287],PuBuGn6:[93273,1872025,6793679,10927579,13685222,16183287],PuBuGn7:[91216,164234,3576e3,6793679,10927579,13685222,16183287],PuBuGn8:[91216,164234,3576e3,6793679,10927579,13685222,15524592,16775163],PuBuGn9:[83510,93273,164234,3576e3,6793679,10927579,13685222,15524592,16775163]},PuBu:{PuBu3:[2854078,10927579,15525874],PuBu4:[356528,7645647,12437985,15855350],PuBu5:[285325,2854078,7645647,12437985,15855350],PuBu6:[285325,2854078,7645647,10927579,13685222,15855350],PuBu7:[216699,356528,3576e3,7645647,10927579,13685222,15855350],PuBu8:[216699,356528,3576e3,7645647,10927579,13685222,15525874,16775163],PuBu9:[145496,285325,356528,3576e3,7645647,10927579,13685222,15525874,16775163]},BuPu:{BuPu3:[8935079,10403034,14740724],BuPu4:[8929693,9213638,11783651,15595771],BuPu5:[8458108,8935079,9213638,11783651,15595771],BuPu6:[8458108,8935079,9213638,10403034,12571622,15595771],BuPu7:[7209323,8929693,9202609,9213638,10403034,12571622,15595771],BuPu8:[7209323,8929693,9202609,9213638,10403034,12571622,14740724,16252157],BuPu9:[5046347,8458108,8929693,9202609,9213638,10403034,12571622,14740724,16252157]},RdPu:{RdPu3:[12917642,16424885,16638173],RdPu4:[11403646,16214177,16495801,16706530],RdPu5:[7995767,12917642,16214177,16495801,16706530],RdPu6:[7995767,12917642,16214177,16424885,16565696,16706530],RdPu7:[7995767,11403646,14496919,16214177,16424885,16565696,16706530],RdPu8:[7995767,11403646,14496919,16214177,16424885,16565696,16638173,16775155],RdPu9:[4784234,7995767,11403646,14496919,16214177,16424885,16565696,16638173,16775155]
},PuRd:{PuRd3:[14490743,13210823,15196655],PuRd4:[13505110,14640560,14136792,15855350],PuRd5:[9961539,14490743,14640560,14136792,15855350],PuRd6:[9961539,14490743,14640560,13210823,13941210,15855350],PuRd7:[9502783,13505110,15149450,14640560,13210823,13941210,15855350],PuRd8:[9502783,13505110,15149450,14640560,13210823,13941210,15196655,16250105],PuRd9:[6750239,9961539,13505110,15149450,14640560,13210823,13941210,15196655,16250105]},OrRd:{OrRd3:[14895667,16628612,16705736],OrRd4:[14102559,16551257,16632970,16707801],OrRd5:[11730944,14895667,16551257,16632970,16707801],OrRd6:[11730944,14895667,16551257,16628612,16635038,16707801],OrRd7:[10027008,14102559,15689032,16551257,16628612,16635038,16707801],OrRd8:[10027008,14102559,15689032,16551257,16628612,16635038,16705736,16775148],OrRd9:[8323072,11730944,14102559,15689032,16551257,16628612,16635038,16705736,16775148]},YlOrRd:{YlOrRd3:[15743776,16691788,16772512],YlOrRd4:[14883356,16616764,16698460,16777138],YlOrRd5:[12386342,15743776,16616764,16698460,16777138],YlOrRd6:[12386342,15743776,16616764,16691788,16701814,16777138],YlOrRd7:[11599910,14883356,16535082,16616764,16691788,16701814,16777138],YlOrRd8:[11599910,14883356,16535082,16616764,16691788,16701814,16772512,16777164],YlOrRd9:[8388646,12386342,14883356,16535082,16616764,16691788,16701814,16772512,16777164]},YlOrBr:{YlOrBr3:[14245646,16696399,16775100],YlOrBr4:[13388802,16685353,16701838,16777172],YlOrBr5:[10040324,14245646,16685353,16701838,16777172],YlOrBr6:[10040324,14245646,16685353,16696399,16704401,16777172],YlOrBr7:[9186564,13388802,15495188,16685353,16696399,16704401,16777172],YlOrBr8:[9186564,13388802,15495188,16685353,16696399,16704401,16775100,16777189],YlOrBr9:[6694150,10040324,13388802,15495188,16685353,16696399,16704401,16775100,16777189]},Purples:{Purples3:[7695281,12369372,15724021],Purples4:[6967715,10394312,13355490,15921399],Purples5:[5515151,7695281,10394312,13355490,15921399],Purples6:[5515151,7695281,10394312,12369372,14342891,15921399],Purples7:[4854918,6967715,8420794,10394312,12369372,14342891,15921399],Purples8:[4854918,6967715,8420794,10394312,12369372,14342891,15724021,16579581],Purples9:[4128893,5515151,6967715,8420794,10394312,12369372,14342891,15724021,16579581]},Blues:{Blues3:[3244733,10406625,14609399],Blues4:[2191797,7057110,12441575,15725567],Blues5:[545180,3244733,7057110,12441575,15725567],Blues6:[545180,3244733,7057110,10406625,13032431,15725567],Blues7:[542100,2191797,4362950,7057110,10406625,13032431,15725567],Blues8:[542100,2191797,4362950,7057110,10406625,13032431,14609399,16251903],Blues9:[536683,545180,2191797,4362950,7057110,10406625,13032431,14609399,16251903]},Greens:{Greens3:[3253076,10607003,15070688],Greens4:[2329413,7652470,12248243,15595753],Greens5:[27948,3253076,7652470,12248243,15595753],Greens6:[27948,3253076,7652470,10607003,13101504,15595753],Greens7:[23090,2329413,4303709,7652470,10607003,13101504,15595753],Greens8:[23090,2329413,4303709,7652470,10607003,13101504,15070688,16252149],Greens9:[17435,27948,2329413,4303709,7652470,10607003,13101504,15070688,16252149]},Oranges:{Oranges3:[15095053,16625259,16705230],Oranges4:[14239489,16616764,16629381,16707038],Oranges5:[10892803,15095053,16616764,16629381,16707038],Oranges6:[10892803,15095053,16616764,16625259,16634018,16707038],Oranges7:[9186564,14239745,15821075,16616764,16625259,16634018,16707038],Oranges8:[9186564,14239745,15821075,16616764,16625259,16634018,16705230,16774635],Oranges9:[8333060,10892803,14239745,15821075,16616764,16625259,16634018,16705230,16774635]},Reds:{Reds3:[14560550,16552562,16703698],Reds4:[13309981,16476746,16559761,16704985],Reds5:[10817301,14560550,16476746,16559761,16704985],Reds6:[10817301,14560550,16476746,16552562,16563105,16704985],Reds7:[10027021,13309981,15678252,16476746,16552562,16563105,16704985],Reds8:[10027021,13309981,15678252,16476746,16552562,16563105,16703698,16774640],Reds9:[6750221,10817301,13309981,15678252,16476746,16552562,16563105,16703698,16774640]},Greys:{Greys3:[6513507,12434877,15790320],Greys4:[5395026,9868950,13421772,16250871],Greys5:[2434341,6513507,9868950,13421772,16250871],Greys6:[2434341,6513507,9868950,12434877,14277081,16250871],Greys7:[2434341,5395026,7566195,9868950,12434877,14277081,16250871],Greys8:[2434341,5395026,7566195,9868950,12434877,14277081,15790320,16777215],Greys9:[0,2434341,5395026,7566195,9868950,12434877,14277081,15790320,16777215],Greys10:[0,1842204,3684408,5592405,7434609,9276813,11184810,13027014,14869218,16777215],Greys11:[0,1644825,3355443,5000268,6710886,8355711,10066329,11711154,13421772,15066597,16777215],Greys256:[0,65793,131586,197379,263172,328965,394758,460551,526344,592137,657930,723723,789516,855309,921102,986895,1052688,1118481,1184274,1250067,1315860,1381653,1447446,1513239,1579032,1644825,1710618,1776411,1842204,1907997,1973790,2039583,2105376,2171169,2236962,2302755,2368548,2434341,2500134,2565927,2631720,2697513,2763306,2829099,2894892,2960685,3026478,3092271,3158064,3223857,3289650,3355443,3421236,3487029,3552822,3618615,3684408,3750201,3815994,3881787,3947580,4013373,4079166,4144959,4210752,4276545,4342338,4408131,4473924,4539717,4605510,4671303,4737096,4802889,4868682,4934475,5000268,5066061,5131854,5197647,5263440,5329233,5395026,5460819,5526612,5592405,5658198,5723991,5789784,5855577,5921370,5987163,6052956,6118749,6184542,6250335,6316128,6381921,6447714,6513507,6579300,6645093,6710886,6776679,6842472,6908265,6974058,7039851,7105644,7171437,7237230,7303023,7368816,7434609,7500402,7566195,7631988,7697781,7763574,7829367,7895160,7960953,8026746,8092539,8158332,8224125,8289918,8355711,8421504,8487297,8553090,8618883,8684676,8750469,8816262,8882055,8947848,9013641,9079434,9145227,9211020,9276813,9342606,9408399,9474192,9539985,9605778,9671571,9737364,9803157,9868950,9934743,10000536,10066329,10132122,10197915,10263708,10329501,10395294,10461087,10526880,10592673,10658466,10724259,10790052,10855845,10921638,10987431,11053224,11119017,11184810,11250603,11316396,11382189,11447982,11513775,11579568,11645361,11711154,11776947,11842740,11908533,11974326,12040119,12105912,12171705,12237498,12303291,12369084,12434877,12500670,12566463,12632256,12698049,12763842,12829635,12895428,12961221,13027014,13092807,13158600,13224393,13290186,13355979,13421772,13487565,13553358,13619151,13684944,13750737,13816530,13882323,13948116,14013909,14079702,14145495,14211288,14277081,14342874,14408667,14474460,14540253,14606046,14671839,14737632,14803425,14869218,14935011,15000804,15066597,15132390,15198183,15263976,15329769,15395562,15461355,15527148,15592941,15658734,15724527,15790320,15856113,15921906,15987699,16053492,16119285,16185078,16250871,16316664,16382457,16448250,16514043,16579836,16645629,16711422,16777215]},PuOr:{PuOr3:[10063555,16250871,15835968],PuOr4:[6175897,11709394,16627811,15098113],PuOr5:[6175897,11709394,16250871,16627811,15098113],PuOr6:[5515144,10063555,14211819,16703670,15835968,11753478],PuOr7:[5515144,10063555,14211819,16250871,16703670,15835968,11753478],PuOr8:[5515144,8418220,11709394,14211819,16703670,16627811,14713364,11753478],PuOr9:[5515144,8418220,11709394,14211819,16250871,16703670,16627811,14713364,11753478],PuOr10:[2949195,5515144,8418220,11709394,14211819,16703670,16627811,14713364,11753478,8338184],PuOr11:[2949195,5515144,8418220,11709394,14211819,16250871,16703670,16627811,14713364,11753478,8338184]},BrBG:{BrBG3:[5944492,16119285,14201701],BrBG4:[99697,8441281,14664317,10903834],BrBG5:[99697,8441281,16119285,14664317,10903834],BrBG6:[91742,5944492,13101797,16181443,14201701,9195786],BrBG7:[91742,5944492,13101797,16119285,16181443,14201701,9195786],BrBG8:[91742,3512207,8441281,13101797,16181443,14664317,12550445,9195786],BrBG9:[91742,3512207,8441281,13101797,16119285,16181443,14664317,12550445,9195786],BrBG10:[15408,91742,3512207,8441281,13101797,16181443,14664317,12550445,9195786,5517317],BrBG11:[15408,91742,3512207,8441281,13101797,16119285,16181443,14664317,12550445,9195786,5517317]},PRGn:{PRGn3:[8372091,16250871,11505091],PRGn4:[34871,10935200,12756431,8073876],PRGn5:[34871,10935200,16250871,12756431,8073876],PRGn6:[1800247,8372091,14282963,15193320,11505091,7744131],PRGn7:[1800247,8372091,14282963,16250871,15193320,11505091,7744131],PRGn8:[1800247,5942881,10935200,14282963,15193320,12756431,10055851,7744131],PRGn9:[1800247,5942881,10935200,14282963,16250871,15193320,12756431,10055851,7744131],PRGn10:[17435,1800247,5942881,10935200,14282963,15193320,12756431,10055851,7744131,4194379],PRGn11:[17435,1800247,5942881,10935200,14282963,16250871,15193320,12756431,10055851,7744131,4194379]},PiYG:{PiYG3:[10606442,16250871,15311817],PiYG4:[5090342,12116358,15840986,13638795],PiYG5:[5090342,12116358,16250871,15840986,13638795],PiYG6:[5083681,10606442,15136208,16638191,15311817,12917629],PiYG7:[5083681,10606442,15136208,16250871,16638191,15311817,12917629],PiYG8:[5083681,8371265,12116358,15136208,16638191,15840986,14579630,12917629],PiYG9:[5083681,8371265,12116358,15136208,16250871,16638191,15840986,14579630,12917629],PiYG10:[2581529,5083681,8371265,12116358,15136208,16638191,15840986,14579630,12917629,9306450],PiYG11:[2581529,5083681,8371265,12116358,15136208,16250871,16638191,15840986,14579630,12917629,9306450]},RdBu:{RdBu3:[6793679,16250871,15698530],RdBu4:[356784,9618910,16033154,13238304],RdBu5:[356784,9618910,16250871,16033154,13238304],RdBu6:[2188972,6793679,13755888,16636871,15698530,11671595],RdBu7:[2188972,6793679,13755888,16250871,16636871,15698530,11671595],RdBu8:[2188972,4428739,9618910,13755888,16636871,16033154,14049357,11671595],RdBu9:[2188972,4428739,9618910,13755888,16250871,16636871,16033154,14049357,11671595],RdBu10:[340065,2188972,4428739,9618910,13755888,16636871,16033154,14049357,11671595,6750239],RdBu11:[340065,2188972,4428739,9618910,13755888,16250871,16636871,16033154,14049357,11671595,6750239]},RdGy:{RdGy3:[10066329,16777215,15698530],RdGy4:[4210752,12237498,16033154,13238304],RdGy5:[4210752,12237498,16777215,16033154,13238304],RdGy6:[5066061,10066329,14737632,16636871,15698530,11671595],RdGy7:[5066061,10066329,14737632,16777215,16636871,15698530,11671595],RdGy8:[5066061,8882055,12237498,14737632,16636871,16033154,14049357,11671595],RdGy9:[5066061,8882055,12237498,14737632,16777215,16636871,16033154,14049357,11671595],RdGy10:[1710618,5066061,8882055,12237498,14737632,16636871,16033154,14049357,11671595,6750239],RdGy11:[1710618,5066061,8882055,12237498,14737632,16777215,16636871,16033154,14049357,11671595,6750239]},RdYlBu:{RdYlBu3:[9551835,16777151,16551257],RdYlBu4:[2915254,11262441,16625249,14096668],RdYlBu5:[2915254,11262441,16777151,16625249,14096668],RdYlBu6:[4552116,9551835,14742520,16703632,16551257,14102567],RdYlBu7:[4552116,9551835,14742520,16777151,16703632,16551257,14102567],RdYlBu8:[4552116,7646673,11262441,14742520,16703632,16625249,16018755,14102567],RdYlBu9:[4552116,7646673,11262441,14742520,16777151,16703632,16625249,16018755,14102567],RdYlBu10:[3225237,4552116,7646673,11262441,14742520,16703632,16625249,16018755,14102567,10813478],RdYlBu11:[3225237,4552116,7646673,11262441,14742520,16777151,16703632,16625249,16018755,14102567,10813478]},Spectral:{Spectral3:[10081684,16777151,16551257],Spectral4:[2851770,11263396,16625249,14096668],Spectral5:[2851770,11263396,16777151,16625249,14096668],Spectral6:[3311805,10081684,15136152,16703627,16551257,13975119],Spectral7:[3311805,10081684,15136152,16777151,16703627,16551257,13975119],Spectral8:[3311805,6734501,11263396,15136152,16703627,16625249,16018755,13975119],Spectral9:[3311805,6734501,11263396,15136152,16777151,16703627,16625249,16018755,13975119],Spectral10:[6180770,3311805,6734501,11263396,15136152,16703627,16625249,16018755,13975119,10355010],Spectral11:[6180770,3311805,6734501,11263396,15136152,16777151,16703627,16625249,16018755,13975119,10355010]},RdYlGn:{RdYlGn3:[9555808,16777151,16551257],RdYlGn4:[1742401,10934634,16625249,14096668],RdYlGn5:[1742401,10934634,16777151,16625249,14096668],RdYlGn6:[1742928,9555808,14282635,16703627,16551257,14102567],RdYlGn7:[1742928,9555808,14282635,16777151,16703627,16551257,14102567],RdYlGn8:[1742928,6733155,10934634,14282635,16703627,16625249,16018755,14102567],RdYlGn9:[1742928,6733155,10934634,14282635,16777151,16703627,16625249,16018755,14102567],RdYlGn10:[26679,1742928,6733155,10934634,14282635,16703627,16625249,16018755,14102567,10813478],RdYlGn11:[26679,1742928,6733155,10934634,14282635,16777151,16703627,16625249,16018755,14102567,10813478]},Inferno:{Inferno3:[4456788,2133900,16639780],Inferno4:[3,7871597,15558693,16580260],Inferno5:[3,5574509,12203605,16354313,16580260],Inferno6:[3,4262247,9643367,14438457,16491530,16580260],Inferno7:[3,3279197,7871597,12203605,15558693,16495384,16580260],Inferno8:[3,2558802,6493294,10365283,13780802,16088085,16432933,16580260],Inferno9:[3,2034759,5574509,8921450,12203605,14899250,16354313,16304433,16580260],Inferno10:[3,1706816,4852586,7871597,10759264,13451847,15558693,16488710,16240442,16580260],Inferno11:[3,1444665,4262247,6952814,9643367,12203605,14438457,15889690,16491530,16176450,16580260],Inferno256:[3,4,6,65543,65801,65803,131342,131600,197138,262932,262934,328728,394267,460061,525855,591393,657187,722726,854056,919594,985389,1050927,1182258,1247796,1313590,1444665,1510203,1641278,1706816,1838147,1903685,2034759,2100298,2231116,2362190,2493264,2558802,2689876,2820694,2951768,3017306,3148380,3279197,3410271,3475808,3606881,3737954,3869028,3934565,4065638,4196710,4262247,4393576,4524649,4590185,4721514,4852586,4918379,5049451,5180780,5246316,5377644,5443181,5574509,5705581,5771373,5902701,5968238,6099566,6230638,6296430,6427758,6493294,6624622,6690158,6821486,6952814,7018350,7149678,7215214,7346542,7477613,7543405,7674733,7740269,7871597,8002669,8068460,8199532,8265324,8396651,8462187,8593515,8724586,8790378,8921450,8987241,9118313,9249641,9315432,9446504,9512295,9643367,9774694,9840230,9971557,10037348,10168420,10234211,10365283,10496610,10562401,10693473,10759264,10890335,10956127,11087454,11218525,11284316,11415643,11481435,11612506,11678297,11809624,11875159,12006486,12072278,12203605,12269396,12400467,12466258,12532049,12663376,12729167,12860494,12926285,13057612,13123147,13188938,13320265,13386056,13451847,13583430,13649220,13715011,13780802,13912129,13977920,14043711,14109502,14241085,14306875,14372666,14438457,14504504,14570295,14636086,14702132,14833459,14899250,14965297,15031088,15096878,15097389,15163180,15229227,15295018,15361064,15426855,15492902,15558693,15559203,15625250,15691041,15757087,15757342,15823389,15889436,15889690,15955737,15956248,16022038,16088085,16088596,16154642,16154897,16220944,16221454,16287501,16287756,16288267,16354313,16354824,16355336,16421127,16421638,16422150,16422662,16488710,16489222,16489734,16489991,16490503,16491016,16491530,16492043,16492557,16493070,16493584,16494098,16494612,16494870,16495384,16495898,16496412,16496926,16431905,16432419,16432933,16433448,16368426,16368940,16369455,16304433,16304948,16305463,16240442,16240956,16175935,16176450,16111429,16111944,16046923,16047183,15982162,15982678,15983193,15918173,15918688,15853668,15853928,15854444,15854960,15855220,15855737,15856253,15922049,15922309,15988361,16054157,16119953,16186005,16251801,16383133,16448928,16580260]},Magma:{Magma3:[3,11875961,16514239],Magma4:[3,7413633,15753309,16514239],Magma5:[3,5181819,11875961,16483936,16514239],Magma6:[3,3870575,9185664,14502248,16621420,16514239],Magma7:[3,2822494,7413633,11875961,15753309,16690806,16514239],Magma8:[3,2232656,6100862,9907327,13714030,16282972,16693631,16514239],Magma9:[3,1773636,5181819,8463745,11875961,15028323,16483936,16695942,16514239],Magma10:[3,1511228,4394869,7413633,10366590,13319793,15753309,16552806,16697227,16514239],Magma11:[3,1314101,3870575,6494591,9185664,11875961,14502248,16150107,16621420,16633232,16514239],Magma256:[3,4,6,65543,65801,65803,131597,131599,197393,262931,263189,328727,394521,460059,525853,591647,657186,722980,788774,854568,920106,985900,1051695,1117233,1183027,1314101,1379896,1445434,1511228,1576767,1708097,1773636,1839174,1970249,2036043,2101581,2232656,2298194,2429269,2494807,2625881,2756956,2822494,2953312,3084386,3149925,3280999,3412072,3477354,3608428,3739502,3870575,3936113,4067186,4198259,4329332,4394869,4525942,4657015,4722808,4853881,4919417,5050746,5181819,5247611,5378684,5444476,5575549,5706877,5772670,5903742,5969534,6100862,6166399,6297727,6363263,6494591,6625920,6691456,6822784,6888576,7019648,7085440,7216769,7282305,7413633,7544705,7610497,7741825,7807361,7938689,8004225,8135553,8266881,8332417,8463745,8529281,8660609,8726145,8857473,8988801,9054337,9185664,9251200,9382528,9513600,9579392,9710464,9776256,9907327,10038655,10104191,10235519,10366590,10432382,10563454,10694782,10760317,10891645,10957181,11088508,11219836,11285371,11416699,11547771,11613562,11744634,11875961,11941497,12072824,12138360,12269687,12401015,12466550,12597877,12728949,12794740,12926068,12991603,13122930,13254258,13319793,13451120,13516912,13648239,13714030,13845101,13910893,14042220,14108011,14239338,14305129,14436457,14502248,14568039,14699366,14765158,14830949,14962276,15028323,15094114,15159906,15225953,15357280,15423072,15489119,15554911,15620958,15621469,15687261,15753309,15819100,15885148,15951196,15951707,16017499,16083547,16084059,16150107,16150619,16216411,16216924,16282972,16283484,16349532,16350045,16350557,16416606,16416862,16417375,16483424,16483936,16484449,16484962,16551011,16551523,16552036,16552549,16552806,16618855,16619368,16619881,16620394,16620907,16621420,16621934,16622191,16622704,16688753,16689267,16689780,16690293,16690806,16691064,16691577,16692091,16692604,16693117,16693631,16694144,16694402,16694915,16695429,16695942,16696456,16696969,16697227,16697741,16698254,16633232,16633746,16634259,16634517,16635031,16635544,16636058,16636572,16637085,16637343,16637857,16638371,16573349,16573862,16574120,16574634,16575148,16575662,16576176,16576689,16576947,16577461,16577975,16512953,16513467,16513725,16514239]},Plasma:{Plasma3:[788358,13256312,15726625],Plasma4:[788358,10164126,15497299,15726625],Plasma5:[788358,8127143,13256312,16225089,15726625],Plasma6:[788358,6946983,11545231,14705761,16557621,15726625],Plasma7:[788358,6029477,10164126,13256312,15497299,16626223,15726625],Plasma8:[788358,5374371,8980645,12071561,14309992,15959880,16628523,15726625],Plasma9:[788358,4850336,8127143,11018902,13256312,15035228,16225089,16630568,15726625],Plasma10:[788358,4522910,7471272,10164126,12334725,14112364,15497299,16424250,16566054,15726625],Plasma11:[788358,4195228,6946983,9375139,11545231,13256312,14705761,15827532,16557621,16567333,15726625],Plasma256:[788358,1050503,1246857,1377930,1574539,1771148,1902221,2033038,2164111,2295184,2426257,2557330,2688403,2819476,2950292,3081365,3212438,3343511,3409048,3540120,3671193,3802266,3867546,3998619,4129692,4195228,4326301,4457374,4522910,4653727,4784799,4850336,4981409,5112481,5178018,5308834,5374371,5505443,5636515,5702052,5833124,5898405,6029477,6160549,6226086,6357158,6422694,6553767,6619303,6750375,6815911,6946983,7078056,7143592,7274664,7340200,7471272,7536808,7667880,7733672,7864744,7930280,8061608,8127143,8258471,8324007,8455335,8520871,8652198,8717990,8783782,8914853,8980645,9111972,9177764,9309348,9375139,9440931,9572258,9638049,9769377,9835168,9900960,10032287,10098078,10164126,10295453,10361244,10427035,10492827,10624154,10689945,10755736,10821527,10953111,11018902,11084693,11150484,11281811,11347602,11413393,11479184,11545231,11611023,11676814,11808141,11873932,11939723,12005514,12071561,12137352,12203143,12268934,12334725,12400516,12466307,12532098,12598145,12663936,12729728,12795519,12861310,12927101,12992892,13058683,13124730,13190521,13256312,13322103,13387894,13453685,13519477,13585268,13651315,13717106,13717361,13783152,13848943,13914734,13980525,14046573,14112364,14112619,14178410,14244201,14309992,14375783,14441830,14442086,14507877,14573668,14639459,14639714,14705761,14771552,14837344,14903135,14903390,14969437,15035228,15035483,15101274,15167066,15233113,15233368,15299159,15364950,15365205,15431252,15497044,15497299,15563090,15563601,15629392,15695183,15695438,15761485,15761741,15827532,15893579,15893834,15959625,15959880,16025927,16026183,16091974,16092485,16158276,16158531,16159042,16224833,16225089,16291136,16291391,16291902,16357693,16357948,16423995,16424250,16424762,16425017,16491064,16491319,16491574,16557621,16557877,16558388,16558643,16559154,16559409,16625457,16625712,16626223,16626478,16626989,16627245,16627756,16628011,16628523,16628778,16629289,16629801,16630056,16630568,16630823,16631334,16566054,16566566,16567077,16567333,16567845,16502820,16503076,16503588,16438564,16438820,16439332,16374052,16374564,16309540,16310052,16244772,16245285,16180261,16180517,16115494,16116006,16050726,15985702,15986214,15921190,15921446,15856422,15791397,15791651,15726625]},Viridis:{Viridis3:[4456788,2133900,16639780],Viridis4:[4456788,3172237,3520376,16639780],Viridis5:[4456788,3887498,2133900,6015074,16639780],Viridis6:[4456788,4211591,2717838,2271108,7983441,16639780],Viridis7:[4456788,4471170,3172237,2133900,3520376,9295428,16639780],Viridis8:[4456788,4600190,3562124,2588302,2007175,4833645,10344762,16639780],Viridis9:[4456788,4664186,3887498,2912654,2133900,2600320,6015074,11197234,16639780],Viridis10:[4456788,4663159,4082057,3172237,2458254,2006153,3520376,7064921,11722028,16639780],Viridis11:[4456788,4727668,4211591,3432077,2717838,2133900,2271108,4374129,7983441,12246567,16639780],Viridis256:[4456788,4457045,4457303,4523352,4523610,4524123,4589916,4590430,4590687,4591201,4656994,4657507,4657765,4658278,4658535,4658793,4659306,4725099,4725356,4725870,4726127,4726384,4726897,4727154,4727411,4727668,4662645,4662902,4663159,4663416,4663929,4664186,4664443,4599164,4599676,4599933,4600190,4534911,4535423,4535680,4535937,4470657,4471170,4405891,4406147,4406404,4341124,4341381,4341893,4276614,4276870,4211591,4211847,4146567,4147080,4081800,4082057,4016777,4017033,4017289,3952010,3952266,3887242,3887498,3822219,3822475,3757195,3757451,3692171,3692428,3627148,3627404,3562124,3562380,3497100,3497356,3432077,3432333,3367053,3367309,3302029,3302285,3237005,3237261,3237517,3172237,3172493,3107213,3107469,3042190,3042446,3042702,2977422,2977678,2912398,2912654,2912910,2847630,2847886,2782606,2782862,2783118,2717838,2718094,2652814,2652814,2653070,2587790,2588046,2588302,2523022,2523278,2523534,2458254,2458509,2393229,2393485,2393741,2328461,2328717,2328973,2263437,2263693,2263949,2198669,2198924,2199180,2133900,2134156,2134412,2069132,2069387,2069643,2069899,2070155,2004874,2005130,2005386,2005386,2005641,2005897,2006153,2006408,2006664,2006920,2007175,2072967,2073222,2073478,2139269,2139525,2205317,2205572,2271108,2336899,2337154,2402946,2468737,2534529,2600320,2666111,2731903,2797694,2863485,2929021,3060348,3126139,3191930,3323258,3389049,3520376,3586167,3717494,3783030,3914357,4045684,4111475,4242802,4374129,4505200,4570991,4702318,4833645,4964972,5096043,5227369,5358696,5490023,5621350,5752421,5883748,6015074,6211937,6343008,6474335,6605661,6802524,6933595,7064921,7196248,7392854,7524181,7655508,7852114,7983441,8180303,8311374,8508236,8639307,8836169,8967495,9164102,9295428,9492035,9623361,9819967,9951294,10147900,10344762,10475832,10672695,10869301,11000627,11197234,11394096,11525166,11722028,11918635,12049705,12246567,12443174,12574500,12771106,12967713,13099039,13295646,13492253,13623580,13820187,13951258,14148121,14344728,14475800,14672664,14803736,15000344,15197209,15328281,15524890,15656219,15852828,15983902,16180767,16311841,16442914,16639780]},Accent:{Accent3:[8374655,12496596,16629894],Accent4:[8374655,12496596,16629894,16777113],Accent5:[8374655,12496596,16629894,16777113,3697840],Accent6:[8374655,12496596,16629894,16777113,3697840,15729279],Accent7:[8374655,12496596,16629894,16777113,3697840,15729279,12540695],Accent8:[8374655,12496596,16629894,16777113,3697840,15729279,12540695,6710886]},Dark2:{Dark2_3:[1810039,14245634,7696563],Dark2_4:[1810039,14245634,7696563,15149450],Dark2_5:[1810039,14245634,7696563,15149450,6727198],Dark2_6:[1810039,14245634,7696563,15149450,6727198,15117058],Dark2_7:[1810039,14245634,7696563,15149450,6727198,15117058,10909213],Dark2_8:[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886]},Paired:{Paired3:[10931939,2062516,11722634],Paired4:[10931939,2062516,11722634,3383340],Paired5:[10931939,2062516,11722634,3383340,16489113],Paired6:[10931939,2062516,11722634,3383340,16489113,14883356],Paired7:[10931939,2062516,11722634,3383340,16489113,14883356,16629615],Paired8:[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192],Paired9:[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054],Paired10:[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586],Paired11:[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586,16777113],Paired12:[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586,16777113,11622696]},Pastel1:{Pastel1_3:[16495790,11783651,13429701],Pastel1_4:[16495790,11783651,13429701,14601188],Pastel1_5:[16495790,11783651,13429701,14601188,16701862],Pastel1_6:[16495790,11783651,13429701,14601188,16701862,16777164],Pastel1_7:[16495790,11783651,13429701,14601188,16701862,16777164,15063229],Pastel1_8:[16495790,11783651,13429701,14601188,16701862,16777164,15063229,16636652],Pastel1_9:[16495790,11783651,13429701,14601188,16701862,16777164,15063229,16636652,15921906]},Pastel2:{Pastel2_3:[11789005,16633260,13358568],Pastel2_4:[11789005,16633260,13358568,16042724],Pastel2_5:[11789005,16633260,13358568,16042724,15136201],Pastel2_6:[11789005,16633260,13358568,16042724,15136201,16773806],Pastel2_7:[11789005,16633260,13358568,16042724,15136201,16773806,15852236],Pastel2_8:[11789005,16633260,13358568,16042724,15136201,16773806,15852236,13421772]},Set1:{Set1_3:[14948892,3636920,5091146],Set1_4:[14948892,3636920,5091146,9981603],Set1_5:[14948892,3636920,5091146,9981603,16744192],Set1_6:[14948892,3636920,5091146,9981603,16744192,16777011],Set1_7:[14948892,3636920,5091146,9981603,16744192,16777011,10901032],Set1_8:[14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607],Set1_9:[14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329]},Set2:{Set2_3:[6734501,16551266,9281739],Set2_4:[6734501,16551266,9281739,15174339],Set2_5:[6734501,16551266,9281739,15174339,10934356],Set2_6:[6734501,16551266,9281739,15174339,10934356,16767279],Set2_7:[6734501,16551266,9281739,15174339,10934356,16767279,15058068],Set2_8:[6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]},Set3:{Set3_3:[9294791,16777139,12499674],Set3_4:[9294791,16777139,12499674,16482418],Set3_5:[9294791,16777139,12499674,16482418,8434131],Set3_6:[9294791,16777139,12499674,16482418,8434131,16626786],Set3_7:[9294791,16777139,12499674,16482418,8434131,16626786,11787881],Set3_8:[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781],Set3_9:[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081],Set3_10:[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725],Set3_11:[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725,13429701],Set3_12:[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725,13429701,16772463]}},/* License regarding the Viridis, Magma, Plasma and Inferno color maps */
e.exports=n.extend({},o,o.YlGn,o.YlGnBu,o.GnBu,o.BuGn,o.PuBuGn,o.PuBu,o.BuPu,o.RdPu,o.PuRd,o.OrRd,o.YlOrRd,o.YlOrBr,o.Purples,o.Blues,o.Greens,o.Oranges,o.Reds,o.Greys,o.PuOr,o.BrBG,o.PRGn,o.PiYG,o.RdBu,o.RdGy,o.RdYlBu,o.Spectral,o.RdYlGn,o.Inferno,o.Magma,o.Plasma,o.Viridis)},{underscore:"underscore"}],safely:[function(t,e,r){var n,o;n=function(t){var e,r,n,o,i,s;return r=document.createElement("div"),r.style["background-color"]="#f2dede",r.style.border="1px solid #a94442",r.style["border-radius"]="4px",r.style.display="inline-block",r.style["font-family"]="sans-serif",r.style["margin-top"]="5px",r.style["min-width"]="200px",r.style.padding="5px 5px 5px 10px",n=document.createElement("span"),n.style["background-color"]="#a94442",n.style["border-radius"]="0px 4px 0px 0px",n.style.color="white",n.style.cursor="pointer",n.style["float"]="right",n.style["font-size"]="0.8em",n.style.margin="-6px -6px 0px 0px",n.style.padding="2px 5px 4px 5px",n.title="close",n.setAttribute("aria-label","close"),n.appendChild(document.createTextNode("x")),n.addEventListener("click",function(){return e.removeChild(r)}),s=document.createElement("h3"),s.style.color="#a94442",s.style.margin="8px 0px 0px 0px",s.style.padding="0px",s.appendChild(document.createTextNode("Bokeh Error")),o=document.createElement("pre"),o.style["white-space"]="unset",o.appendChild(document.createTextNode(null!=(i=t.message)?i:t)),r.appendChild(n),r.appendChild(s),r.appendChild(o),e=document.getElementsByTagName("body")[0],e.insertBefore(r,e.firstChild)},o=function(t,e){var r,o;null==e&&(e=!1);try{return t()}catch(o){if(r=o,n(r),!e)throw r}},e.exports=o},{}],"util/bezier":[function(t,e,r){var n,o;o=function(t,e,r,n,o,i,s,a){var l,u,h,c,p,_,d,f,m,g,y,v;return l=a*o,u=-s*i,h=s*o,c=a*i,_=.5*(n-r),p=8/3*Math.sin(.5*_)*Math.sin(.5*_)/Math.sin(_),d=t+Math.cos(r)-p*Math.sin(r),g=e+Math.sin(r)+p*Math.cos(r),m=t+Math.cos(n),v=e+Math.sin(n),f=m+p*Math.sin(n),y=v-p*Math.cos(n),[l*d+u*g,h*d+c*g,l*f+u*y,h*f+c*y,l*m+u*v,h*m+c*v]},n=function(t,e,r,n,i,s,a,l,u){var h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R;return S=i*(Math.PI/180),T=Math.sin(S),d=Math.cos(S),x=Math.abs(r),w=Math.abs(n),y=d*(t-l)*.5+T*(e-u)*.5,v=d*(e-u)*.5-T*(t-l)*.5,g=y*y/(x*x)+v*v/(w*w),g>1&&(g=Math.sqrt(g),x*=g,w*=g),h=d/x,c=T/x,p=-T/w,_=d/w,N=h*t+c*e,D=p*t+_*e,O=h*l+c*u,I=p*l+_*u,f=(O-N)*(O-N)+(I-D)*(I-D),j=1/f-.25,j<0&&(j=0),k=Math.sqrt(j),a===s&&(k=-k),q=.5*(N+O)-k*(I-D),R=.5*(D+I)+k*(O-N),z=Math.atan2(D-R,N-q),P=Math.atan2(I-R,O-q),C=P-z,C<0&&1===a?C+=2*Math.PI:C>0&&0===a&&(C-=2*Math.PI),M=Math.ceil(Math.abs(C/(.5*Math.PI+.001))),b=function(){var t,e,r;for(r=[],m=t=0,e=M;0<=e?t<e:t>e;m=0<=e?++t:--t)E=z+m*C/M,A=z+(m+1)*C/M,r.push(o(q,R,E,A,x,w,T,d));return r}()},e.exports={arc_to_bezier:n,segment_to_bezier:o}},{}],"util/util":[function(t,e,r){var n,o,i,s,a,l;i=t("underscore"),o=t("sprintf"),n=t("numbro"),s=function(t){var e;return i.isNumber(t)?(e=function(){switch(!1){case Math.floor(t)!==t:return"%d";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return"%0.3f";default:return"%0.3e"}}(),o.sprintf(e,t)):""+t},l=function(t,e,r,o){return null==o&&(o={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t){return function(t,e,r){return e+"@$"+r}}(this)),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t){return function(t,a,l,u,h){var c,p,_;return l=null!=u?u:l,_="$"===l[0]?o[l.substring(1)]:null!=(c=e.get_column(l))?c[r]:void 0,p=null==_?"???":null!=h?n.format(_,h):s(_),""+a+i.escape(p)}}(this))},a=function(t){var e;return e=t.get("selected"),e["0d"].glyph?e["0d"].indices:e["1d"].indices.length>0?e["1d"].indices:e["2d"].indices.length>0?e["2d"].indices:[]},e.exports={replace_placeholders:l,get_indices:a}},{numbro:"numbro/numbro",sprintf:"sprintf",underscore:"underscore"}],version:[function(t,e,r){var n;n="0.12.2",e.exports=n},{}],backbone:[function(e,r,n){(function(r){
// (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Backbone may be freely distributed under the MIT license.
!function(o){var i="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r;if("function"==typeof t&&t.amd)t(["underscore","jquery","exports"],function(t,e,r){i.Backbone=o(i,r,t,e)});else if("undefined"!=typeof n){var s,a=e("underscore");try{s=e("jquery")}catch(l){}o(i,n,a,s)}else i.Backbone=o(i,{},i._,i.jQuery||i.Zepto||i.ender||i.$)}(function(t,e,r,n){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.3.3",e.$=n,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,n){switch(t){case 1:return function(){return r[e](this[n])};case 2:return function(t){return r[e](this[n],t)};case 3:return function(t,o){return r[e](this[n],l(t,this),o)};case 4:return function(t,o,i){return r[e](this[n],l(t,this),o,i)};default:return function(){var t=i.call(arguments);return t.unshift(this[n]),r[e].apply(r,t)}}},a=function(t,e,n){r.each(e,function(e,o){r[o]&&(t.prototype[o]=s(e,o,n))})},l=function(t,e){return r.isFunction(t)?t:r.isObject(t)&&!e._isModel(t)?u(t):r.isString(t)?function(e){return e.get(t)}:t},u=function(t){var e=r.matches(t);return function(t){return e(t.attributes)}},h=e.Events={},c=/\s+/,p=function(t,e,n,o,i){var s,a=0;if(n&&"object"==typeof n){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(s=r.keys(n);a<s.length;a++)e=p(t,e,s[a],n[s[a]],i)}else if(n&&c.test(n))for(s=n.split(c);a<s.length;a++)e=t(e,s[a],o,i);else e=t(e,n,o,i);return e};h.on=function(t,e,r){return _(this,t,e,r)};var _=function(t,e,r,n,o){if(t._events=p(d,t._events||{},e,r,{context:n,ctx:t,listening:o}),o){var i=t._listeners||(t._listeners={});i[o.id]=o}return t};h.listenTo=function(t,e,n){if(!t)return this;var o=t._listenId||(t._listenId=r.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),s=i[o];if(!s){var a=this._listenId||(this._listenId=r.uniqueId("l"));s=i[o]={obj:t,objId:o,id:a,listeningTo:i,count:0}}return _(t,e,n,this,s),this};var d=function(t,e,r,n){if(r){var o=t[e]||(t[e]=[]),i=n.context,s=n.ctx,a=n.listening;a&&a.count++,o.push({callback:r,context:i,ctx:i||s,listening:a})}return t};h.off=function(t,e,r){return this._events?(this._events=p(f,this._events,t,e,{context:r,listeners:this._listeners}),this):this},h.stopListening=function(t,e,n){var o=this._listeningTo;if(!o)return this;for(var i=t?[t._listenId]:r.keys(o),s=0;s<i.length;s++){var a=o[i[s]];if(!a)break;a.obj.off(e,n,this)}return this};var f=function(t,e,n,o){if(t){var i,s=0,a=o.context,l=o.listeners;if(e||n||a){for(var u=e?[e]:r.keys(t);s<u.length;s++){e=u[s];var h=t[e];if(!h)break;for(var c=[],p=0;p<h.length;p++){var _=h[p];n&&n!==_.callback&&n!==_.callback._callback||a&&a!==_.context?c.push(_):(i=_.listening,i&&0===--i.count&&(delete l[i.id],delete i.listeningTo[i.objId]))}c.length?t[e]=c:delete t[e]}return t}for(var d=r.keys(l);s<d.length;s++)i=l[d[s]],delete l[i.id],delete i.listeningTo[i.objId]}};h.once=function(t,e,n){var o=p(m,{},t,e,r.bind(this.off,this));return"string"==typeof t&&null==n&&(e=void 0),this.on(o,e,n)},h.listenToOnce=function(t,e,n){var o=p(m,{},e,n,r.bind(this.stopListening,this,t));return this.listenTo(t,o)};var m=function(t,e,n,o){if(n){var i=t[e]=r.once(function(){o(e,i),n.apply(this,arguments)});i._callback=n}return t};h.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),r=Array(e),n=0;n<e;n++)r[n]=arguments[n+1];return p(g,this._events,t,void 0,r),this};var g=function(t,e,r,n){if(t){var o=t[e],i=t.all;o&&i&&(i=i.slice()),o&&y(o,n),i&&y(i,[e].concat(n))}return t},y=function(t,e){var r,n=-1,o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++n<o;)(r=t[n]).callback.call(r.ctx);return;case 1:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i);return;case 2:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s);return;case 3:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s,a);return;default:for(;++n<o;)(r=t[n]).callback.apply(r.ctx,e);return}};h.bind=h.on,h.unbind=h.off,r.extend(e,h);var v=e.Model=function(t,e){var n=t||{};e||(e={}),this.cid=r.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});var o=r.result(this,"defaults");n=r.defaults(r.extend({},o,n),o),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};r.extend(v.prototype,h,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return r.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return r.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!r.iteratee(t,this)(this.attributes)},set:function(t,e,n){if(null==t)return this;var o;if("object"==typeof t?(o=t,n=e):(o={})[t]=e,n||(n={}),!this._validate(o,n))return!1;var i=n.unset,s=n.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=r.clone(this.attributes),this.changed={});var u=this.attributes,h=this.changed,c=this._previousAttributes;for(var p in o)e=o[p],r.isEqual(u[p],e)||a.push(p),r.isEqual(c[p],e)?delete h[p]:h[p]=e,i?delete u[p]:u[p]=e;if(this.idAttribute in o&&(this.id=this.get(this.idAttribute)),!s){a.length&&(this._pending=n);for(var _=0;_<a.length;_++)this.trigger("change:"+a[_],this,u[a[_]],n)}if(l)return this;if(!s)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,r.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,r.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!r.isEmpty(this.changed):r.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&r.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,n={};for(var o in t){var i=t[o];r.isEqual(e[o],i)||(n[o]=i)}return!!r.size(n)&&n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},fetch:function(t){t=r.extend({parse:!0},t);var e=this,n=t.success;return t.success=function(r){var o=t.parse?e.parse(r,t):r;return!!e.set(o,t)&&(n&&n.call(t.context,e,r,t),void e.trigger("sync",e,r,t))},L(this,t),this.sync("read",this,t)},save:function(t,e,n){var o;null==t||"object"==typeof t?(o=t,n=e):(o={})[t]=e,n=r.extend({validate:!0,parse:!0},n);var i=n.wait;if(o&&!i){if(!this.set(o,n))return!1}else if(!this._validate(o,n))return!1;var s=this,a=n.success,l=this.attributes;n.success=function(t){s.attributes=l;var e=n.parse?s.parse(t,n):t;return i&&(e=r.extend({},o,e)),!(e&&!s.set(e,n))&&(a&&a.call(n.context,s,t,n),void s.trigger("sync",s,t,n))},L(this,n),o&&i&&(this.attributes=r.extend({},l,o));var u=this.isNew()?"create":n.patch?"patch":"update";"patch"!==u||n.attrs||(n.attrs=o);var h=this.sync(u,this,n);return this.attributes=l,h},destroy:function(t){t=t?r.clone(t):{};var e=this,n=t.success,o=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(r){o&&i(),n&&n.call(t.context,e,r,t),e.isNew()||e.trigger("sync",e,r,t)};var s=!1;return this.isNew()?r.defer(t.success):(L(this,t),s=this.sync("delete",this,t)),o||i(),s},url:function(){var t=r.result(this,"urlRoot")||r.result(this.collection,"url")||B();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},r.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=r.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,r.extend(e,{validationError:n})),!1)}});var b={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};a(v,b,"attributes");var x=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,r.extend({silent:!0},e))},w={add:!0,remove:!0,merge:!0},M={add:!0,remove:!1},k=function(t,e,r){r=Math.min(Math.max(r,0),t.length);var n,o=Array(t.length-r),i=e.length;for(n=0;n<o.length;n++)o[n]=t[n+r];for(n=0;n<i;n++)t[n+r]=e[n];for(n=0;n<o.length;n++)t[n+i+r]=o[n]};r.extend(x.prototype,h,{model:v,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,r.extend({merge:!1},e,M))},remove:function(t,e){e=r.extend({},e);var n=!r.isArray(t);t=n?[t]:t.slice();var o=this._removeModels(t,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),n?o[0]:o},set:function(t,e){if(null!=t){e=r.extend({},w,e),e.parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var n=!r.isArray(t);t=n?[t]:t.slice();var o=e.at;null!=o&&(o=+o),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var i,s,a=[],l=[],u=[],h=[],c={},p=e.add,_=e.merge,d=e.remove,f=!1,m=this.comparator&&null==o&&e.sort!==!1,g=r.isString(this.comparator)?this.comparator:null;for(s=0;s<t.length;s++){i=t[s];var y=this.get(i);if(y){if(_&&i!==y){var v=this._isModel(i)?i.attributes:i;e.parse&&(v=y.parse(v,e)),y.set(v,e),u.push(y),m&&!f&&(f=y.hasChanged(g))}c[y.cid]||(c[y.cid]=!0,a.push(y)),t[s]=y}else p&&(i=t[s]=this._prepareModel(i,e),i&&(l.push(i),this._addReference(i,e),c[i.cid]=!0,a.push(i)))}if(d){for(s=0;s<this.length;s++)i=this.models[s],c[i.cid]||h.push(i);h.length&&this._removeModels(h,e)}var b=!1,x=!m&&p&&d;if(a.length&&x?(b=this.length!==a.length||r.some(this.models,function(t,e){return t!==a[e]}),this.models.length=0,k(this.models,a,0),this.length=this.models.length):l.length&&(m&&(f=!0),k(this.models,l,null==o?this.length:o),this.length=this.models.length),f&&this.sort({silent:!0}),!e.silent){for(s=0;s<l.length;s++)null!=o&&(e.index=o+s),i=l[s],i.trigger("add",i,this,e);(f||b)&&this.trigger("sort",this,e),(l.length||h.length||u.length)&&(e.changes={added:l,removed:h,merged:u},this.trigger("update",this,e))}return n?t[0]:t}},reset:function(t,e){e=e?r.clone(e):{};for(var n=0;n<this.models.length;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,r.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,r.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,r.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return i.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(t.attributes||t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var n=e.length;return r.isFunction(e)&&(e=r.bind(e,this)),1===n||r.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){t=r.extend({parse:!0},t);var e=t.success,n=this;return t.success=function(r){var o=t.reset?"reset":"set";n[o](r,t),e&&e.call(t.context,n,r,t),n.trigger("sync",n,r,t)},L(this,t),this.sync("read",this,t)},create:function(t,e){e=e?r.clone(e):{};var n=e.wait;if(t=this._prepareModel(t,e),!t)return!1;n||this.add(t,e);var o=this,i=e.success;return e.success=function(t,e,r){n&&o.add(t,r),i&&i.call(r.context,t,e,r)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;e=e?r.clone(e):{},e.collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){for(var r=[],n=0;n<t.length;n++){var o=this.get(t[n]);if(o){var i=this.indexOf(o);this.models.splice(i,1),this.length--,delete this._byId[o.cid];var s=this.modelId(o.attributes);null!=s&&delete this._byId[s],e.silent||(e.index=i,o.trigger("remove",o,this,e)),r.push(o),this._removeReference(o,e)}}return r},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var r=this.modelId(t.attributes);null!=r&&(this._byId[r]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var r=this.modelId(t.attributes);null!=r&&delete this._byId[r],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,r,n){if(e){if(("add"===t||"remove"===t)&&r!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){var o=this.modelId(e.previousAttributes()),i=this.modelId(e.attributes);o!==i&&(null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=e))}}this.trigger.apply(this,arguments)}});var j={forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3};a(x,j,"models");var T=e.View=function(t){this.cid=r.uniqueId("view"),r.extend(this,r.pick(t,z)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,z=["model","collection","el","id","attributes","className","tagName","events"];r.extend(T.prototype,h,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=r.result(this,"events")),!t)return this;this.undelegateEvents();for(var e in t){var n=t[e];if(r.isFunction(n)||(n=this[n]),n){var o=e.match(S);this.delegate(o[1],o[2],r.bind(n,this))}}return this},delegate:function(t,e,r){return this.$el.on(t+".delegateEvents"+this.cid,e,r),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,r){return this.$el.off(t+".delegateEvents"+this.cid,e,r),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(r.result(this,"el"));else{var t=r.extend({},r.result(this,"attributes"));this.id&&(t.id=r.result(this,"id")),this.className&&(t["class"]=r.result(this,"className")),this.setElement(this._createElement(r.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,n,o){var i=P[t];r.defaults(o||(o={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:i,dataType:"json"};if(o.url||(s.url=r.result(n,"url")||B()),null!=o.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(o.attrs||n.toJSON(o))),o.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),o.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",o.emulateJSON&&(s.data._method=i);var a=o.beforeSend;o.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",i),a)return a.apply(this,arguments)}}"GET"===s.type||o.emulateJSON||(s.processData=!1);var l=o.error;o.error=function(t,e,r){o.textStatus=e,o.errorThrown=r,l&&l.call(o.context,t,e,r)};var u=o.xhr=e.ajax(r.extend(s,o));return n.trigger("request",n,u,o),u};var P={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var E=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},A=/\((.*?)\)/g,C=/(\(\?)?:\w+/g,N=/\*\w+/g,O=/[\-{}\[\]+?.,\\\^$|#\s]/g;r.extend(E.prototype,h,{initialize:function(){},route:function(t,n,o){r.isRegExp(t)||(t=this._routeToRegExp(t)),r.isFunction(n)&&(o=n,n=""),o||(o=this[n]);var i=this;return e.history.route(t,function(r){var s=i._extractParameters(t,r);i.execute(o,s,n)!==!1&&(i.trigger.apply(i,["route:"+n].concat(s)),i.trigger("route",n,s),e.history.trigger("route",i,n,s))}),this},execute:function(t,e,r){t&&t.apply(this,e)},navigate:function(t,r){return e.history.navigate(t,r),this},_bindRoutes:function(){if(this.routes){this.routes=r.result(this,"routes");for(var t,e=r.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(O,"\\$&").replace(A,"(?:$1)?").replace(C,function(t,e){return e?t:"([^/?]+)"}).replace(N,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return r.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var q=e.History=function(){this.handlers=[],this.checkUrl=r.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},D=/^[#\/]|\s+$/g,I=/^\/+|\/+$/g,R=/#.*$/;q.started=!1,r.extend(q.prototype,h,{interval:50,atRoot:function(){var t=this.location.pathname.replace(/[^\/]$/,"$&/");return t===this.root&&!this.getSearch()},matchRoot:function(){var t=this.decodeFragment(this.location.pathname),e=t.slice(0,this.root.length-1)+"/";return e===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(D,"")},start:function(t){if(q.started)throw new Error("Backbone.history has already been started");if(q.started=!0,this.options=r.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(I,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var n=document.body,o=n.insertBefore(this.iframe,n.firstChild).contentWindow;o.document.open(),o.document.close(),o.location.hash="#"+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?i("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?i("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),q.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e!==this.fragment&&(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),r.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!q.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var r=this.root;""!==t&&"?"!==t.charAt(0)||(r=r.slice(0,-1)||"/");var n=r+t;if(t=this.decodeFragment(t.replace(R,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;e.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,r){if(r){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}}),e.history=new q;var F=function(t,e){var n,o=this;return n=t&&r.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},r.extend(n,o,e),n.prototype=r.create(o.prototype,t),n.prototype.constructor=n,n.__super__=o.prototype,n};v.extend=x.extend=E.extend=T.extend=q.extend=F;var B=function(){throw new Error('A "url" property or function must be specified')},L=function(t,e){var r=e.error;e.error=function(n){r&&r.call(e.context,t,n,e),t.trigger("error",t,n,e)}};return e})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{jquery:"jquery",underscore:"underscore"}],"es6-promise":[function(e,r,n){(function(n,o){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
* @version 3.0.2
*/
(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function s(t){return"function"==typeof t}function a(t){return"object"==typeof t&&null!==t}function l(t){H=t}function u(t){J=t}function h(){return function(){n.nextTick(f)}}function c(){return function(){Y(f)}}function p(){var t=0,e=new Z(f),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function _(){var t=new MessageChannel;return t.port1.onmessage=f,function(){t.port2.postMessage(0)}}function d(){return function(){setTimeout(f,1)}}function f(){for(var t=0;t<W;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}W=0}function m(){try{var t=e,r=t("vertx");return Y=r.runOnLoop||r.runOnContext,c()}catch(n){return d()}}function g(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function b(t){try{return t.then}catch(e){return st.error=e,st}}function x(t,e,r,n){try{t.call(e,r,n)}catch(o){return o}}function w(t,e,r){J(function(t){var n=!1,o=x(r,e,function(r){n||(n=!0,e!==r?j(t,r):S(t,r))},function(e){n||(n=!0,z(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,z(t,o))},t)}function M(t,e){e._state===ot?S(t,e._result):e._state===it?z(t,e._result):P(e,void 0,function(e){j(t,e)},function(e){z(t,e)})}function k(t,e){if(e.constructor===t.constructor)M(t,e);else{var r=b(e);r===st?z(t,st.error):void 0===r?S(t,e):s(r)?w(t,e,r):S(t,e)}}function j(t,e){t===e?z(t,y()):i(e)?k(t,e):S(t,e)}function T(t){t._onerror&&t._onerror(t._result),E(t)}function S(t,e){t._state===nt&&(t._result=e,t._state=ot,0!==t._subscribers.length&&J(E,t))}function z(t,e){t._state===nt&&(t._state=it,t._result=e,J(T,t))}function P(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+ot]=r,o[i+it]=n,0===i&&t._state&&J(E,t)}function E(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,o,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?N(r,n,o,i):o(i);t._subscribers.length=0}}function A(){this.error=null}function C(t,e){try{return t(e)}catch(r){return at.error=r,at}}function N(t,e,r,n){var o,i,a,l,u=s(r);if(u){if(o=C(r,n),o===at?(l=!0,i=o.error,o=null):a=!0,e===o)return void z(e,v())}else o=n,a=!0;e._state!==nt||(u&&a?j(e,o):l?z(e,i):t===ot?S(e,o):t===it&&z(e,o))}function O(t,e){try{e(function(e){j(t,e)},function(e){z(t,e)})}catch(r){z(t,r)}}function q(t,e){var r=this;r._instanceConstructor=t,r.promise=new t(g),r._validateInput(e)?(r._input=e,r.length=e.length,r._remaining=e.length,r._init(),0===r.length?S(r.promise,r._result):(r.length=r.length||0,r._enumerate(),0===r._remaining&&S(r.promise,r._result))):z(r.promise,r._validationError())}function D(t){return new lt(this,t).promise}function I(t){function e(t){j(o,t)}function r(t){z(o,t)}var n=this,o=new n(g);if(!$(t))return z(o,new TypeError("You must pass an array to race.")),o;for(var i=t.length,s=0;o._state===nt&&s<i;s++)P(n.resolve(t[s]),void 0,e,r);return o}function R(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(g);return j(r,t),r}function F(t){var e=this,r=new e(g);return z(r,t),r}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function L(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function G(t){this._id=_t++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==t&&(s(t)||B(),this instanceof G||L(),O(this,t))}function V(){var t;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;r&&"[object Promise]"===Object.prototype.toString.call(r.resolve())&&!r.cast||(t.Promise=dt)}var U;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var Y,H,X,$=U,W=0,J=({}.toString,function(t,e){rt[W]=t,rt[W+1]=e,W+=2,2===W&&(H?H(f):X())}),Q="undefined"!=typeof window?window:void 0,K=Q||{},Z=K.MutationObserver||K.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);X=tt?h():Z?p():et?_():void 0===Q&&"function"==typeof e?m():d();var nt=void 0,ot=1,it=2,st=new A,at=new A;q.prototype._validateInput=function(t){return $(t)},q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},q.prototype._init=function(){this._result=new Array(this.length)};var lt=q;q.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,o=0;r._state===nt&&o<e;o++)t._eachEntry(n[o],o)},q.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;a(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},q.prototype._settledAt=function(t,e,r){var n=this,o=n.promise;o._state===nt&&(n._remaining--,t===it?z(o,r):n._result[e]=r),0===n._remaining&&S(o,n._result)},q.prototype._willSettleAt=function(t,e){var r=this;P(t,void 0,function(t){r._settledAt(ot,e,t)},function(t){r._settledAt(it,e,t)})};var ut=D,ht=I,ct=R,pt=F,_t=0,dt=G;G.all=ut,G.race=ht,G.resolve=ct,G.reject=pt,G._setScheduler=l,G._setAsap=u,G._asap=J,G.prototype={constructor:G,then:function(t,e){var r=this,n=r._state;if(n===ot&&!t||n===it&&!e)return this;var o=new this.constructor(g),i=r._result;if(n){var s=arguments[n-1];J(function(){N(n,o,s,i)})}else P(r,o,t,e);return o},"catch":function(t){return this.then(null,t)}};var ft=V,mt={Promise:dt,polyfill:ft};"function"==typeof t&&t.amd?t(function(){return mt}):"undefined"!=typeof r&&r.exports?r.exports=mt:"undefined"!=typeof this&&(this.ES6Promise=mt),ft()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:"_process"}],"hammerjs/hammer":[function(e,r,n){/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(e,n,o,i){"use strict";function s(t,e,r){return setTimeout(c(t,r),e)}function a(t,e,r){return!!Array.isArray(t)&&(l(t,r[e],r),!0)}function l(t,e,r){var n;if(t)if(t.forEach)t.forEach(e,r);else if(t.length!==i)for(n=0;n<t.length;)e.call(r,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(r,t[n],n,t)}function u(t,r,n){var o="DEPRECATED METHOD: "+r+"\n"+n+" AT \n";return function(){var r=new Error("get-stack-trace"),n=r&&r.stack?r.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=e.console&&(e.console.warn||e.console.log);return i&&i.call(e.console,o,n),t.apply(this,arguments)}}function h(t,e,r){var n,o=e.prototype;n=t.prototype=Object.create(o),n.constructor=t,n._super=o,r&&_t(n,r)}function c(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==mt?t.apply(e?e[0]||i:i,e):t}function _(t,e){return t===i?e:t}function d(t,e,r){l(y(e),function(e){t.addEventListener(e,r,!1)})}function f(t,e,r){l(y(e),function(e){t.removeEventListener(e,r,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function g(t,e){return t.indexOf(e)>-1}function y(t){return t.trim().split(/\s+/g)}function v(t,e,r){if(t.indexOf&&!r)return t.indexOf(e);for(var n=0;n<t.length;){if(r&&t[n][r]==e||!r&&t[n]===e)return n;n++}return-1}function b(t){return Array.prototype.slice.call(t,0)}function x(t,e,r){for(var n=[],o=[],i=0;i<t.length;){var s=e?t[i][e]:t[i];v(o,s)<0&&n.push(t[i]),o[i]=s,i++}return r&&(n=e?n.sort(function(t,r){return t[e]>r[e]}):n.sort()),n}function w(t,e){for(var r,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<dt.length;){if(r=dt[s],n=r?r+o:e,n in t)return n;s++}return i}function M(){return wt++}function k(t){var r=t.ownerDocument||t;return r.defaultView||r.parentWindow||e}function j(t,e){var r=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){p(t.options.enable,[t])&&r.handler(e)},this.init()}function T(t){var e,r=t.options.inputClass;return new(e=r?r:jt?B:Tt?V:kt?Y:F)(t,S)}function S(t,e,r){var n=r.pointers.length,o=r.changedPointers.length,i=e&Ct&&n-o===0,s=e&(Ot|qt)&&n-o===0;r.isFirst=!!i,r.isFinal=!!s,i&&(t.session={}),r.eventType=e,z(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function z(t,e){var r=t.session,n=e.pointers,o=n.length;r.firstInput||(r.firstInput=A(e)),o>1&&!r.firstMultiple?r.firstMultiple=A(e):1===o&&(r.firstMultiple=!1);var i=r.firstInput,s=r.firstMultiple,a=s?s.center:i.center,l=e.center=C(n);e.timeStamp=vt(),e.deltaTime=e.timeStamp-i.timeStamp,e.angle=D(a,l),e.distance=q(a,l),P(r,e),e.offsetDirection=O(e.deltaX,e.deltaY);var u=N(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=yt(u.x)>yt(u.y)?u.x:u.y,e.scale=s?R(s.pointers,n):1,e.rotation=s?I(s.pointers,n):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,E(r,e);var h=t.element;m(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}function P(t,e){var r=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},i=t.prevInput||{};e.eventType!==Ct&&i.eventType!==Ot||(o=t.prevDelta={x:i.deltaX||0,y:i.deltaY||0},n=t.offsetDelta={x:r.x,y:r.y}),e.deltaX=o.x+(r.x-n.x),e.deltaY=o.y+(r.y-n.y)}function E(t,e){var r,n,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=qt&&(l>At||a.velocity===i)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=N(l,u,h);n=c.x,o=c.y,r=yt(c.x)>yt(c.y)?c.x:c.y,s=O(u,h),t.lastInterval=e}else r=a.velocity,n=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=r,e.velocityX=n,e.velocityY=o,e.direction=s}function A(t){for(var e=[],r=0;r<t.pointers.length;)e[r]={clientX:gt(t.pointers[r].clientX),clientY:gt(t.pointers[r].clientY)},r++;return{timeStamp:vt(),pointers:e,center:C(e),deltaX:t.deltaX,deltaY:t.deltaY}}function C(t){var e=t.length;if(1===e)return{x:gt(t[0].clientX),y:gt(t[0].clientY)};for(var r=0,n=0,o=0;o<e;)r+=t[o].clientX,n+=t[o].clientY,o++;return{x:gt(r/e),y:gt(n/e)}}function N(t,e,r){return{x:e/t||0,y:r/t||0}}function O(t,e){return t===e?Dt:yt(t)>=yt(e)?t<0?It:Rt:e<0?Ft:Bt}function q(t,e,r){r||(r=Ut);var n=e[r[0]]-t[r[0]],o=e[r[1]]-t[r[1]];return Math.sqrt(n*n+o*o)}function D(t,e,r){r||(r=Ut);var n=e[r[0]]-t[r[0]],o=e[r[1]]-t[r[1]];return 180*Math.atan2(o,n)/Math.PI}function I(t,e){return D(e[1],e[0],Yt)+D(t[1],t[0],Yt)}function R(t,e){return q(e[0],e[1],Yt)/q(t[0],t[1],Yt)}function F(){this.evEl=Xt,this.evWin=$t,this.pressed=!1,j.apply(this,arguments)}function B(){this.evEl=Qt,this.evWin=Kt,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function L(){this.evTarget=te,this.evWin=ee,this.started=!1,j.apply(this,arguments)}function G(t,e){var r=b(t.touches),n=b(t.changedTouches);return e&(Ot|qt)&&(r=x(r.concat(n),"identifier",!0)),[r,n]}function V(){this.evTarget=ne,this.targetIds={},j.apply(this,arguments)}function U(t,e){var r=b(t.touches),n=this.targetIds;if(e&(Ct|Nt)&&1===r.length)return n[r[0].identifier]=!0,[r,r];var o,i,s=b(t.changedTouches),a=[],l=this.target;if(i=r.filter(function(t){return m(t.target,l)}),e===Ct)for(o=0;o<i.length;)n[i[o].identifier]=!0,o++;for(o=0;o<s.length;)n[s[o].identifier]&&a.push(s[o]),e&(Ot|qt)&&delete n[s[o].identifier],o++;return a.length?[x(i.concat(a),"identifier",!0),a]:void 0}function Y(){j.apply(this,arguments);var t=c(this.handler,this);this.touch=new V(this.manager,t),this.mouse=new F(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function H(t,e){t&Ct?(this.primaryTouch=e.changedPointers[0].identifier,X.call(this,e)):t&(Ot|qt)&&X.call(this,e)}function X(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var r={x:e.clientX,y:e.clientY};this.lastTouches.push(r);var n=this.lastTouches,o=function(){var t=n.indexOf(r);t>-1&&n.splice(t,1)};setTimeout(o,oe)}}function $(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],i=Math.abs(e-o.x),s=Math.abs(r-o.y);if(i<=ie&&s<=ie)return!0}return!1}function W(t,e){this.manager=t,this.set(e)}function J(t){if(g(t,ce))return ce;var e=g(t,pe),r=g(t,_e);return e&&r?ce:e||r?e?pe:_e:g(t,he)?he:ue}function Q(){if(!ae)return!1;var t={},r=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){t[n]=!r||e.CSS.supports("touch-action",n)}),t}function K(t){this.options=_t({},this.defaults,t||{}),this.id=M(),this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=fe,this.simultaneous={},this.requireFail=[]}function Z(t){return t&be?"cancel":t&ye?"end":t&ge?"move":t&me?"start":""}function tt(t){return t==Bt?"down":t==Ft?"up":t==It?"left":t==Rt?"right":""}function et(t,e){var r=e.manager;return r?r.get(t):t}function rt(){K.apply(this,arguments)}function nt(){rt.apply(this,arguments),this.pX=null,this.pY=null}function ot(){rt.apply(this,arguments)}function it(){K.apply(this,arguments),this._timer=null,this._input=null}function st(){rt.apply(this,arguments)}function at(){rt.apply(this,arguments)}function lt(){K.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ut(t,e){return e=e||{},e.recognizers=_(e.recognizers,ut.defaults.preset),new ht(t,e)}function ht(t,e){this.options=_t({},ut.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=T(this),this.touchAction=new W(this,this.options.touchAction),ct(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ct(t,e){var r=t.element;if(r.style){var n;l(t.options.cssProps,function(o,i){n=w(r.style,i),e?(t.oldCssProps[n]=r.style[n],r.style[n]=o):r.style[n]=t.oldCssProps[n]||""}),e||(t.oldCssProps={})}}function pt(t,e){var r=n.createEvent("Event");r.initEvent(t,!0,!0),r.gesture=e,e.target.dispatchEvent(r)}var _t,dt=["","webkit","Moz","MS","ms","o"],ft=n.createElement("div"),mt="function",gt=Math.round,yt=Math.abs,vt=Date.now;_t="function"!=typeof Object.assign?function(t){if(t===i||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(n!==i&&null!==n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var bt=u(function(t,e,r){for(var n=Object.keys(e),o=0;o<n.length;)(!r||r&&t[n[o]]===i)&&(t[n[o]]=e[n[o]]),o++;return t},"extend","Use `assign`."),xt=u(function(t,e){return bt(t,e,!0)},"merge","Use `assign`."),wt=1,Mt=/mobile|tablet|ip(ad|hone|od)|android/i,kt="ontouchstart"in e,jt=w(e,"PointerEvent")!==i,Tt=kt&&Mt.test(navigator.userAgent),St="touch",zt="pen",Pt="mouse",Et="kinect",At=25,Ct=1,Nt=2,Ot=4,qt=8,Dt=1,It=2,Rt=4,Ft=8,Bt=16,Lt=It|Rt,Gt=Ft|Bt,Vt=Lt|Gt,Ut=["x","y"],Yt=["clientX","clientY"];j.prototype={handler:function(){},init:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&f(this.element,this.evEl,this.domHandler),this.evTarget&&f(this.target,this.evTarget,this.domHandler),this.evWin&&f(k(this.element),this.evWin,this.domHandler)}};var Ht={mousedown:Ct,mousemove:Nt,mouseup:Ot},Xt="mousedown",$t="mousemove mouseup";h(F,j,{handler:function(t){var e=Ht[t.type];e&Ct&&0===t.button&&(this.pressed=!0),e&Nt&&1!==t.which&&(e=Ot),this.pressed&&(e&Ot&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Pt,srcEvent:t}))}});var Wt={pointerdown:Ct,pointermove:Nt,pointerup:Ot,pointercancel:qt,pointerout:qt},Jt={2:St,3:zt,4:Pt,5:Et},Qt="pointerdown",Kt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Qt="MSPointerDown",Kt="MSPointerMove MSPointerUp MSPointerCancel"),h(B,j,{handler:function(t){var e=this.store,r=!1,n=t.type.toLowerCase().replace("ms",""),o=Wt[n],i=Jt[t.pointerType]||t.pointerType,s=i==St,a=v(e,t.pointerId,"pointerId");o&Ct&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):o&(Ot|qt)&&(r=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:i,srcEvent:t}),r&&e.splice(a,1))}});var Zt={touchstart:Ct,touchmove:Nt,touchend:Ot,touchcancel:qt},te="touchstart",ee="touchstart touchmove touchend touchcancel";h(L,j,{handler:function(t){var e=Zt[t.type];if(e===Ct&&(this.started=!0),this.started){var r=G.call(this,t,e);e&(Ot|qt)&&r[0].length-r[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:St,srcEvent:t})}}});var re={touchstart:Ct,touchmove:Nt,touchend:Ot,touchcancel:qt},ne="touchstart touchmove touchend touchcancel";h(V,j,{handler:function(t){var e=re[t.type],r=U.call(this,t,e);r&&this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:St,srcEvent:t})}});var oe=2500,ie=25;h(Y,j,{handler:function(t,e,r){var n=r.pointerType==St,o=r.pointerType==Pt;if(!(o&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(n)H.call(this,e,r);else if(o&&$.call(this,r))return;this.callback(t,e,r)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var se=w(ft.style,"touchAction"),ae=se!==i,le="compute",ue="auto",he="manipulation",ce="none",pe="pan-x",_e="pan-y",de=Q();W.prototype={set:function(t){t==le&&(t=this.compute()),ae&&this.manager.element.style&&de[t]&&(this.manager.element.style[se]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){p(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),J(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,r=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var n=this.actions,o=g(n,ce)&&!de[ce],i=g(n,_e)&&!de[_e],s=g(n,pe)&&!de[pe];if(o){var a=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(a&&l&&u)return}return s&&i?void 0:o||i&&r&Lt||s&&r&Gt?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var fe=1,me=2,ge=4,ye=8,ve=ye,be=16,xe=32;K.prototype={defaults:{},set:function(t){return _t(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(a(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=et(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return a(t,"dropRecognizeWith",this)?this:(t=et(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(a(t,"requireFailure",this))return this;var e=this.requireFail;return t=et(t,this),v(e,t)===-1&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(a(t,"dropRequireFailure",this))return this;t=et(t,this);var e=v(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){r.manager.emit(e,t)}var r=this,n=this.state;n<ye&&e(r.options.event+Z(n)),e(r.options.event),t.additionalEvent&&e(t.additionalEvent),n>=ye&&e(r.options.event+Z(n))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=xe)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(xe|fe)))return!1;t++}return!0},recognize:function(t){var e=_t({},t);return p(this.options.enable,[this,e])?(this.state&(ve|be|xe)&&(this.state=fe),this.state=this.process(e),void(this.state&(me|ge|ye|be)&&this.tryEmit(e))):(this.reset(),void(this.state=xe))},process:function(t){},getTouchAction:function(){},reset:function(){}},h(rt,K,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,r=t.eventType,n=e&(me|ge),o=this.attrTest(t);return n&&(r&qt||!o)?e|be:n||o?r&Ot?e|ye:e&me?e|ge:me:xe}}),h(nt,rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Vt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Lt&&e.push(_e),t&Gt&&e.push(pe),e},directionTest:function(t){var e=this.options,r=!0,n=t.distance,o=t.direction,i=t.deltaX,s=t.deltaY;return o&e.direction||(e.direction&Lt?(o=0===i?Dt:i<0?It:Rt,r=i!=this.pX,n=Math.abs(t.deltaX)):(o=0===s?Dt:s<0?Ft:Bt,r=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=o,r&&n>e.threshold&&o&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&me||!(this.state&me)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=tt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),h(ot,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&me)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),h(it,K,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance<e.threshold,o=t.deltaTime>e.time;if(this._input=t,!n||!r||t.eventType&(Ot|qt)&&!o)this.reset();else if(t.eventType&Ct)this.reset(),this._timer=s(function(){this.state=ve,this.tryEmit()},e.time,this);else if(t.eventType&Ot)return ve;return xe},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ve&&(t&&t.eventType&Ot?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=vt(),this.manager.emit(this.options.event,this._input)))}}),h(st,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&me)}}),h(at,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Lt|Gt,pointers:1},getTouchAction:function(){return nt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return r&(Lt|Gt)?e=t.overallVelocity:r&Lt?e=t.overallVelocityX:r&Gt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&yt(e)>this.options.velocity&&t.eventType&Ot},emit:function(t){var e=tt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),h(lt,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[he]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance<e.threshold,o=t.deltaTime<e.time;if(this.reset(),t.eventType&Ct&&0===this.count)return this.failTimeout();if(n&&o&&r){if(t.eventType!=Ot)return this.failTimeout();var i=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||q(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&i?this.count+=1:this.count=1,this._input=t;var l=this.count%e.taps;if(0===l)return this.hasRequireFailures()?(this._timer=s(function(){this.state=ve,this.tryEmit()},e.interval,this),me):ve}return xe},failTimeout:function(){return this._timer=s(function(){this.state=xe},this.options.interval,this),xe},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ut.VERSION="2.0.7",ut.defaults={domEvents:!1,touchAction:le,enable:!0,inputTarget:null,inputClass:null,preset:[[st,{enable:!1}],[ot,{enable:!1},["rotate"]],[at,{direction:Lt}],[nt,{direction:Lt},["swipe"]],[lt],[lt,{event:"doubletap",taps:2},["tap"]],[it]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var we=1,Me=2;ht.prototype={set:function(t){return _t(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?Me:we},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var r,n=this.recognizers,o=e.curRecognizer;(!o||o&&o.state&ve)&&(o=e.curRecognizer=null);for(var i=0;i<n.length;)r=n[i],e.stopped===Me||o&&r!=o&&!r.canRecognizeWith(o)?r.reset():r.recognize(t),!o&&r.state&(me|ge|ye)&&(o=e.curRecognizer=r),i++}},get:function(t){if(t instanceof K)return t;for(var e=this.recognizers,r=0;r<e.length;r++)if(e[r].options.event==t)return e[r];return null},add:function(t){if(a(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(a(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,r=v(e,t);r!==-1&&(e.splice(r,1),this.touchAction.update())}return this},on:function(t,e){if(t!==i&&e!==i){var r=this.handlers;return l(y(t),function(t){r[t]=r[t]||[],r[t].push(e)}),this}},off:function(t,e){if(t!==i){var r=this.handlers;return l(y(t),function(t){e?r[t]&&r[t].splice(v(r[t],e),1):delete r[t]}),this}},emit:function(t,e){this.options.domEvents&&pt(t,e);var r=this.handlers[t]&&this.handlers[t].slice();if(r&&r.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<r.length;)r[n](e),n++}},destroy:function(){this.element&&ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},_t(ut,{INPUT_START:Ct,INPUT_MOVE:Nt,INPUT_END:Ot,INPUT_CANCEL:qt,STATE_POSSIBLE:fe,STATE_BEGAN:me,STATE_CHANGED:ge,STATE_ENDED:ye,STATE_RECOGNIZED:ve,STATE_CANCELLED:be,STATE_FAILED:xe,DIRECTION_NONE:Dt,DIRECTION_LEFT:It,DIRECTION_RIGHT:Rt,DIRECTION_UP:Ft,DIRECTION_DOWN:Bt,DIRECTION_HORIZONTAL:Lt,DIRECTION_VERTICAL:Gt,DIRECTION_ALL:Vt,Manager:ht,Input:j,TouchAction:W,TouchInput:V,MouseInput:F,PointerEventInput:B,TouchMouseInput:Y,SingleTouchInput:L,Recognizer:K,AttrRecognizer:rt,Tap:lt,Pan:nt,Swipe:at,Pinch:ot,Rotate:st,Press:it,on:d,off:f,each:l,merge:xt,extend:bt,assign:_t,inherit:h,bindFn:c,prefixed:w});var ke="undefined"!=typeof e?e:"undefined"!=typeof self?self:{};ke.Hammer=ut,"function"==typeof t&&t.amd?t(function(){return ut}):"undefined"!=typeof r&&r.exports?r.exports=ut:e[o]=ut}(window,document,"Hammer")},{}],"jquery-mousewheel":[function(e,r,n){/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
!function(e){"function"==typeof t&&t.amd?t(["jquery"],e):"object"==typeof n?r.exports=e:e(jQuery)}(function(t){function e(e){var s=e||window.event,a=l.call(arguments,1),u=0,c=0,p=0,_=0,d=0,f=0;if(e=t.event.fix(s),e.type="mousewheel","detail"in s&&(p=s.detail*-1),"wheelDelta"in s&&(p=s.wheelDelta),"wheelDeltaY"in s&&(p=s.wheelDeltaY),"wheelDeltaX"in s&&(c=s.wheelDeltaX*-1),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(c=p*-1,p=0),u=0===p?c:p,"deltaY"in s&&(p=s.deltaY*-1,u=p),"deltaX"in s&&(c=s.deltaX,0===p&&(u=c*-1)),0!==p||0!==c){if(1===s.deltaMode){var m=t.data(this,"mousewheel-line-height");u*=m,p*=m,c*=m}else if(2===s.deltaMode){var g=t.data(this,"mousewheel-page-height");u*=g,p*=g,c*=g}if(_=Math.max(Math.abs(p),Math.abs(c)),(!i||_<i)&&(i=_,n(s,_)&&(i/=40)),n(s,_)&&(u/=40,c/=40,p/=40),u=Math[u>=1?"floor":"ceil"](u/i),c=Math[c>=1?"floor":"ceil"](c/i),p=Math[p>=1?"floor":"ceil"](p/i),h.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();d=e.clientX-y.left,f=e.clientY-y.top}return e.deltaX=c,e.deltaY=p,e.deltaFactor=i,e.offsetX=d,e.offsetY=f,e.deltaMode=0,a.unshift(e,u,c,p),o&&clearTimeout(o),o=setTimeout(r,200),(t.event.dispatch||t.event.handle).apply(this,a)}}function r(){i=null}function n(t,e){return h.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}var o,i,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(t.event.fixHooks)for(var u=s.length;u;)t.event.fixHooks[s[--u]]=t.event.mouseHooks;var h=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var r=a.length;r;)this.addEventListener(a[--r],e,!1);else this.onmousewheel=e;t.data(this,"mousewheel-line-height",h.getLineHeight(this)),t.data(this,"mousewheel-page-height",h.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var r=a.length;r;)this.removeEventListener(a[--r],e,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var r=t(e),n=r["offsetParent"in t.fn?"offsetParent":"parent"]();return n.length||(n=t("body")),parseInt(n.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})})},{}],jquery:[function(e,r,n){/*!
* jQuery JavaScript Library v2.2.4
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-05-20T17:23Z
*/
!function(t,e){"object"==typeof r&&"object"==typeof r.exports?r.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(e,r){function n(t){var e=!!t&&"length"in t&&t.length,r=st.type(t);return"function"!==r&&!st.isWindow(t)&&("array"===r||0===e||"number"==typeof e&&e>0&&e-1 in t)}function o(t,e,r){if(st.isFunction(e))return st.grep(t,function(t,n){return!!e.call(t,n,t)!==r});if(e.nodeType)return st.grep(t,function(t){return t===e!==r});if("string"==typeof e){if(mt.test(e))return st.filter(e,t,r);e=st.filter(e,t)}return st.grep(t,function(t){return tt.call(e,t)>-1!==r})}function i(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function s(t){var e={};return st.each(t.match(wt)||[],function(t,r){e[r]=!0}),e}function a(){J.removeEventListener("DOMContentLoaded",a),e.removeEventListener("load",a),st.ready()}function l(){this.expando=st.expando+l.uid++}function u(t,e,r){var n;if(void 0===r&&1===t.nodeType)if(n="data-"+e.replace(Pt,"-$&").toLowerCase(),r=t.getAttribute(n),"string"==typeof r){try{r="true"===r||"false"!==r&&("null"===r?null:+r+""===r?+r:zt.test(r)?st.parseJSON(r):r)}catch(o){}St.set(t,e,r)}else r=void 0;return r}function h(t,e,r,n){var o,i=1,s=20,a=n?function(){return n.cur()}:function(){return st.css(t,e,"")},l=a(),u=r&&r[3]||(st.cssNumber[e]?"":"px"),h=(st.cssNumber[e]||"px"!==u&&+l)&&At.exec(st.css(t,e));if(h&&h[3]!==u){u=u||h[3],r=r||[],h=+l||1;do i=i||".5",h/=i,st.style(t,e,h+u);while(i!==(i=a()/l)&&1!==i&&--s)}return r&&(h=+h||+l||0,o=r[1]?h+(r[1]+1)*r[2]:+r[2],n&&(n.unit=u,n.start=h,n.end=o)),o}function c(t,e){var r="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&st.nodeName(t,e)?st.merge([t],r):r}function p(t,e){for(var r=0,n=t.length;r<n;r++)Tt.set(t[r],"globalEval",!e||Tt.get(e[r],"globalEval"))}function _(t,e,r,n,o){for(var i,s,a,l,u,h,_=e.createDocumentFragment(),d=[],f=0,m=t.length;f<m;f++)if(i=t[f],i||0===i)if("object"===st.type(i))st.merge(d,i.nodeType?[i]:i);else if(Rt.test(i)){for(s=s||_.appendChild(e.createElement("div")),a=(qt.exec(i)||["",""])[1].toLowerCase(),l=It[a]||It._default,s.innerHTML=l[1]+st.htmlPrefilter(i)+l[2],h=l[0];h--;)s=s.lastChild;st.merge(d,s.childNodes),s=_.firstChild,s.textContent=""}else d.push(e.createTextNode(i));for(_.textContent="",f=0;i=d[f++];)if(n&&st.inArray(i,n)>-1)o&&o.push(i);else if(u=st.contains(i.ownerDocument,i),s=c(_.appendChild(i),"script"),u&&p(s),r)for(h=0;i=s[h++];)Dt.test(i.type||"")&&r.push(i);return _}function d(){return!0}function f(){return!1}function m(){try{return J.activeElement}catch(t){}}function g(t,e,r,n,o,i){var s,a;if("object"==typeof e){"string"!=typeof r&&(n=n||r,r=void 0);for(a in e)g(t,a,r,n,e[a],i);return t}if(null==n&&null==o?(o=r,n=r=void 0):null==o&&("string"==typeof r?(o=n,n=void 0):(o=n,n=r,r=void 0)),o===!1)o=f;else if(!o)return t;return 1===i&&(s=o,o=function(t){return st().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=st.guid++)),t.each(function(){st.event.add(this,e,o,n,r)})}function y(t,e){return st.nodeName(t,"table")&&st.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function v(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function b(t){var e=Yt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function x(t,e){var r,n,o,i,s,a,l,u;if(1===e.nodeType){if(Tt.hasData(t)&&(i=Tt.access(t),s=Tt.set(e,i),u=i.events)){delete s.handle,s.events={};for(o in u)for(r=0,n=u[o].length;r<n;r++)st.event.add(e,o,u[o][r])}St.hasData(t)&&(a=St.access(t),l=st.extend({},a),St.set(e,l))}}function w(t,e){var r=e.nodeName.toLowerCase();"input"===r&&Ot.test(t.type)?e.checked=t.checked:"input"!==r&&"textarea"!==r||(e.defaultValue=t.defaultValue)}function M(t,e,r,n){e=K.apply([],e);var o,i,s,a,l,u,h=0,p=t.length,d=p-1,f=e[0],m=st.isFunction(f);if(m||p>1&&"string"==typeof f&&!ot.checkClone&&Ut.test(f))return t.each(function(o){var i=t.eq(o);m&&(e[0]=f.call(this,o,i.html())),M(i,e,r,n)});if(p&&(o=_(e,t[0].ownerDocument,!1,t,n),i=o.firstChild,1===o.childNodes.length&&(o=i),i||n)){for(s=st.map(c(o,"script"),v),a=s.length;h<p;h++)l=o,h!==d&&(l=st.clone(l,!0,!0),a&&st.merge(s,c(l,"script"))),r.call(t[h],l,h);if(a)for(u=s[s.length-1].ownerDocument,st.map(s,b),h=0;h<a;h++)l=s[h],Dt.test(l.type||"")&&!Tt.access(l,"globalEval")&&st.contains(u,l)&&(l.src?st._evalUrl&&st._evalUrl(l.src):st.globalEval(l.textContent.replace(Ht,"")))}return t}function k(t,e,r){for(var n,o=e?st.filter(e,t):t,i=0;null!=(n=o[i]);i++)r||1!==n.nodeType||st.cleanData(c(n)),n.parentNode&&(r&&st.contains(n.ownerDocument,n)&&p(c(n,"script")),n.parentNode.removeChild(n));return t}function j(t,e){var r=st(e.createElement(t)).appendTo(e.body),n=st.css(r[0],"display");return r.detach(),n}function T(t){var e=J,r=$t[t];return r||(r=j(t,e),"none"!==r&&r||(Xt=(Xt||st("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement),e=Xt[0].contentDocument,e.write(),e.close(),r=j(t,e),Xt.detach()),$t[t]=r),r}function S(t,e,r){var n,o,i,s,a=t.style;return r=r||Qt(t),s=r?r.getPropertyValue(e)||r[e]:void 0,""!==s&&void 0!==s||st.contains(t.ownerDocument,t)||(s=st.style(t,e)),r&&!ot.pixelMarginRight()&&Jt.test(s)&&Wt.test(e)&&(n=a.width,o=a.minWidth,i=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=r.width,a.width=n,a.minWidth=o,a.maxWidth=i),void 0!==s?s+"":s}function z(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function P(t){if(t in oe)return t;for(var e=t[0].toUpperCase()+t.slice(1),r=ne.length;r--;)if(t=ne[r]+e,t in oe)return t}function E(t,e,r){var n=At.exec(e);return n?Math.max(0,n[2]-(r||0))+(n[3]||"px"):e}function A(t,e,r,n,o){for(var i=r===(n?"border":"content")?4:"width"===e?1:0,s=0;i<4;i+=2)"margin"===r&&(s+=st.css(t,r+Ct[i],!0,o)),n?("content"===r&&(s-=st.css(t,"padding"+Ct[i],!0,o)),"margin"!==r&&(s-=st.css(t,"border"+Ct[i]+"Width",!0,o))):(s+=st.css(t,"padding"+Ct[i],!0,o),"padding"!==r&&(s+=st.css(t,"border"+Ct[i]+"Width",!0,o)));return s}function C(t,e,r){var n=!0,o="width"===e?t.offsetWidth:t.offsetHeight,i=Qt(t),s="border-box"===st.css(t,"boxSizing",!1,i);if(o<=0||null==o){if(o=S(t,e,i),(o<0||null==o)&&(o=t.style[e]),Jt.test(o))return o;n=s&&(ot.boxSizingReliable()||o===t.style[e]),o=parseFloat(o)||0}return o+A(t,e,r||(s?"border":"content"),n,i)+"px"}function N(t,e){for(var r,n,o,i=[],s=0,a=t.length;s<a;s++)n=t[s],n.style&&(i[s]=Tt.get(n,"olddisplay"),r=n.style.display,e?(i[s]||"none"!==r||(n.style.display=""),""===n.style.display&&Nt(n)&&(i[s]=Tt.access(n,"olddisplay",T(n.nodeName)))):(o=Nt(n),"none"===r&&o||Tt.set(n,"olddisplay",o?r:st.css(n,"display"))));for(s=0;s<a;s++)n=t[s],n.style&&(e&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=e?i[s]||"":"none"));return t}function O(t,e,r,n,o){return new O.prototype.init(t,e,r,n,o)}function q(){return e.setTimeout(function(){ie=void 0}),ie=st.now()}function D(t,e){var r,n=0,o={height:t};for(e=e?1:0;n<4;n+=2-e)r=Ct[n],o["margin"+r]=o["padding"+r]=t;return e&&(o.opacity=o.width=t),o}function I(t,e,r){for(var n,o=(B.tweeners[e]||[]).concat(B.tweeners["*"]),i=0,s=o.length;i<s;i++)if(n=o[i].call(r,e,t))return n}function R(t,e,r){var n,o,i,s,a,l,u,h,c=this,p={},_=t.style,d=t.nodeType&&Nt(t),f=Tt.get(t,"fxshow");r.queue||(a=st._queueHooks(t,"fx"),null==a.unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,st.queue(t,"fx").length||a.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(r.overflow=[_.overflow,_.overflowX,_.overflowY],u=st.css(t,"display"),h="none"===u?Tt.get(t,"olddisplay")||T(t.nodeName):u,"inline"===h&&"none"===st.css(t,"float")&&(_.display="inline-block")),r.overflow&&(_.overflow="hidden",c.always(function(){_.overflow=r.overflow[0],_.overflowX=r.overflow[1],_.overflowY=r.overflow[2]}));for(n in e)if(o=e[n],ae.exec(o)){if(delete e[n],i=i||"toggle"===o,o===(d?"hide":"show")){if("show"!==o||!f||void 0===f[n])continue;d=!0}p[n]=f&&f[n]||st.style(t,n)}else u=void 0;if(st.isEmptyObject(p))"inline"===("none"===u?T(t.nodeName):u)&&(_.display=u);else{f?"hidden"in f&&(d=f.hidden):f=Tt.access(t,"fxshow",{}),i&&(f.hidden=!d),d?st(t).show():c.done(function(){st(t).hide()}),c.done(function(){var e;Tt.remove(t,"fxshow");for(e in p)st.style(t,e,p[e])});for(n in p)s=I(d?f[n]:0,n,c),n in f||(f[n]=s.start,d&&(s.end=s.start,s.start="width"===n||"height"===n?1:0))}}function F(t,e){var r,n,o,i,s;for(r in t)if(n=st.camelCase(r),o=e[n],i=t[r],st.isArray(i)&&(o=i[1],i=t[r]=i[0]),r!==n&&(t[n]=i,delete t[r]),s=st.cssHooks[n],s&&"expand"in s){i=s.expand(i),delete t[n];for(r in i)r in t||(t[r]=i[r],e[r]=o)}else e[n]=o}function B(t,e,r){var n,o,i=0,s=B.prefilters.length,a=st.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var e=ie||q(),r=Math.max(0,u.startTime+u.duration-e),n=r/u.duration||0,i=1-n,s=0,l=u.tweens.length;s<l;s++)u.tweens[s].run(i);return a.notifyWith(t,[u,i,r]),i<1&&l?r:(a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:st.extend({},e),opts:st.extend(!0,{specialEasing:{},easing:st.easing._default},r),originalProperties:e,originalOptions:r,startTime:ie||q(),duration:r.duration,tweens:[],createTween:function(e,r){var n=st.Tween(t,u.opts,e,r,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(n),n},stop:function(e){var r=0,n=e?u.tweens.length:0;if(o)return this;for(o=!0;r<n;r++)u.tweens[r].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),h=u.props;for(F(h,u.opts.specialEasing);i<s;i++)if(n=B.prefilters[i].call(u,t,h,u.opts))return st.isFunction(n.stop)&&(st._queueHooks(u.elem,u.opts.queue).stop=st.proxy(n.stop,n)),n;return st.map(h,I,u),st.isFunction(u.opts.start)&&u.opts.start.call(t,u),st.fx.timer(st.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function L(t){return t.getAttribute&&t.getAttribute("class")||""}function G(t){return function(e,r){"string"!=typeof e&&(r=e,e="*");var n,o=0,i=e.toLowerCase().match(wt)||[];if(st.isFunction(r))for(;n=i[o++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(r)):(t[n]=t[n]||[]).push(r)}}function V(t,e,r,n){function o(a){var l;return i[a]=!0,st.each(t[a]||[],function(t,a){var u=a(e,r,n);return"string"!=typeof u||s||i[u]?s?!(l=u):void 0:(e.dataTypes.unshift(u),o(u),!1)}),l}var i={},s=t===Se;return o(e.dataTypes[0])||!i["*"]&&o("*")}function U(t,e){var r,n,o=st.ajaxSettings.flatOptions||{};for(r in e)void 0!==e[r]&&((o[r]?t:n||(n={}))[r]=e[r]);return n&&st.extend(!0,t,n),t}function Y(t,e,r){for(var n,o,i,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(o in a)if(a[o]&&a[o].test(n)){l.unshift(o);break}if(l[0]in r)i=l[0];else{for(o in r){if(!l[0]||t.converters[o+" "+l[0]]){i=o;break}s||(s=o)}i=i||s}if(i)return i!==l[0]&&l.unshift(i),r[i]}function H(t,e,r,n){var o,i,s,a,l,u={},h=t.dataTypes.slice();if(h[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(i=h.shift();i;)if(t.responseFields[i]&&(r[t.responseFields[i]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=i,i=h.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(s=u[l+" "+i]||u["* "+i],!s)for(o in u)if(a=o.split(" "),a[1]===i&&(s=u[l+" "+a[0]]||u["* "+a[0]])){s===!0?s=u[o]:u[o]!==!0&&(i=a[0],h.unshift(a[1]));break}if(s!==!0)if(s&&t["throws"])e=s(e);else try{e=s(e)}catch(c){return{state:"parsererror",error:s?c:"No conversion from "+l+" to "+i}}}return{state:"success",data:e}}function X(t,e,r,n){var o;if(st.isArray(e))st.each(e,function(e,o){r||Ae.test(t)?n(t,o):X(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,r,n)});else if(r||"object"!==st.type(e))n(t,e);else for(o in e)X(t+"["+o+"]",e[o],r,n)}function $(t){return st.isWindow(t)?t:9===t.nodeType&&t.defaultView}var W=[],J=e.document,Q=W.slice,K=W.concat,Z=W.push,tt=W.indexOf,et={},rt=et.toString,nt=et.hasOwnProperty,ot={},it="2.2.4",st=function(t,e){return new st.fn.init(t,e)},at=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,lt=/^-ms-/,ut=/-([\da-z])/gi,ht=function(t,e){return e.toUpperCase()};st.fn=st.prototype={jquery:it,constructor:st,selector:"",length:0,toArray:function(){return Q.call(this)},get:function(t){return null!=t?t<0?this[t+this.length]:this[t]:Q.call(this)},pushStack:function(t){var e=st.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t){return st.each(this,t)},map:function(t){return this.pushStack(st.map(this,function(e,r){return t.call(e,r,e)}))},slice:function(){return this.pushStack(Q.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,r=+t+(t<0?e:0);return this.pushStack(r>=0&&r<e?[this[r]]:[])},end:function(){return this.prevObject||this.constructor()},push:Z,sort:W.sort,splice:W.splice},st.extend=st.fn.extend=function(){var t,e,r,n,o,i,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||st.isFunction(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)r=s[e],n=t[e],s!==n&&(u&&n&&(st.isPlainObject(n)||(o=st.isArray(n)))?(o?(o=!1,i=r&&st.isArray(r)?r:[]):i=r&&st.isPlainObject(r)?r:{},s[e]=st.extend(u,i,n)):void 0!==n&&(s[e]=n));return s},st.extend({expando:"jQuery"+(it+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===st.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){var e=t&&t.toString();return!st.isArray(t)&&e-parseFloat(e)+1>=0},isPlainObject:function(t){var e;if("object"!==st.type(t)||t.nodeType||st.isWindow(t))return!1;if(t.constructor&&!nt.call(t,"constructor")&&!nt.call(t.constructor.prototype||{},"isPrototypeOf"))return!1;for(e in t);return void 0===e||nt.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?et[rt.call(t)]||"object":typeof t},globalEval:function(t){var e,r=eval;t=st.trim(t),t&&(1===t.indexOf("use strict")?(e=J.createElement("script"),e.text=t,J.head.appendChild(e).parentNode.removeChild(e)):r(t))},camelCase:function(t){return t.replace(lt,"ms-").replace(ut,ht)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var r,o=0;if(n(t))for(r=t.length;o<r&&e.call(t[o],o,t[o])!==!1;o++);else for(o in t)if(e.call(t[o],o,t[o])===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(at,"")},makeArray:function(t,e){var r=e||[];return null!=t&&(n(Object(t))?st.merge(r,"string"==typeof t?[t]:t):Z.call(r,t)),r},inArray:function(t,e,r){return null==e?-1:tt.call(e,t,r)},merge:function(t,e){for(var r=+e.length,n=0,o=t.length;n<r;n++)t[o++]=e[n];return t.length=o,t},grep:function(t,e,r){for(var n,o=[],i=0,s=t.length,a=!r;i<s;i++)n=!e(t[i],i),n!==a&&o.push(t[i]);return o},map:function(t,e,r){var o,i,s=0,a=[];if(n(t))for(o=t.length;s<o;s++)i=e(t[s],s,r),null!=i&&a.push(i);else for(s in t)i=e(t[s],s,r),null!=i&&a.push(i);return K.apply([],a)},guid:1,proxy:function(t,e){var r,n,o;if("string"==typeof e&&(r=t[e],e=t,t=r),st.isFunction(t))return n=Q.call(arguments,2),o=function(){return t.apply(e||this,n.concat(Q.call(arguments)))},o.guid=t.guid=t.guid||st.guid++,o},now:Date.now,support:ot}),"function"==typeof Symbol&&(st.fn[Symbol.iterator]=W[Symbol.iterator]),st.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){et["[object "+e+"]"]=e.toLowerCase()});var ct=/*!
* Sizzle CSS Selector Engine v2.2.1
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2015-10-17
*/
function(t){function e(t,e,r,n){var o,i,s,a,l,u,c,_,d=e&&e.ownerDocument,f=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return r;if(!n&&((e?e.ownerDocument||e:B)!==C&&A(e),e=e||C,O)){if(11!==f&&(u=gt.exec(t)))if(o=u[1]){if(9===f){if(!(s=e.getElementById(o)))return r;if(s.id===o)return r.push(s),r}else if(d&&(s=d.getElementById(o))&&R(e,s)&&s.id===o)return r.push(s),r}else{if(u[2])return K.apply(r,e.getElementsByTagName(t)),r;if((o=u[3])&&x.getElementsByClassName&&e.getElementsByClassName)return K.apply(r,e.getElementsByClassName(o)),r}if(x.qsa&&!Y[t+" "]&&(!q||!q.test(t))){if(1!==f)d=e,_=t;else if("object"!==e.nodeName.toLowerCase()){for((a=e.getAttribute("id"))?a=a.replace(vt,"\\$&"):e.setAttribute("id",a=F),c=j(t),i=c.length,l=pt.test(a)?"#"+a:"[id='"+a+"']";i--;)c[i]=l+" "+p(c[i]);_=c.join(","),d=yt.test(t)&&h(e.parentNode)||e}if(_)try{return K.apply(r,d.querySelectorAll(_)),r}catch(m){}finally{a===F&&e.removeAttribute("id")}}}return S(t.replace(at,"$1"),e,r,n)}function r(){function t(r,n){return e.push(r+" ")>w.cacheLength&&delete t[e.shift()],t[r+" "]=n}var e=[];return t}function n(t){return t[F]=!0,t}function o(t){var e=C.createElement("div");try{return!!t(e)}catch(r){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function i(t,e){for(var r=t.split("|"),n=r.length;n--;)w.attrHandle[r[n]]=e}function s(t,e){var r=e&&t,n=r&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||X)-(~t.sourceIndex||X);if(n)return n;if(r)for(;r=r.nextSibling;)if(r===e)return-1;return t?1:-1}function a(t){return function(e){var r=e.nodeName.toLowerCase();return"input"===r&&e.type===t}}function l(t){return function(e){var r=e.nodeName.toLowerCase();return("input"===r||"button"===r)&&e.type===t}}function u(t){return n(function(e){return e=+e,n(function(r,n){for(var o,i=t([],r.length,e),s=i.length;s--;)r[o=i[s]]&&(r[o]=!(n[o]=r[o]))})})}function h(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function c(){}function p(t){for(var e=0,r=t.length,n="";e<r;e++)n+=t[e].value;return n}function _(t,e,r){var n=e.dir,o=r&&"parentNode"===n,i=G++;return e.first?function(e,r,i){for(;e=e[n];)if(1===e.nodeType||o)return t(e,r,i)}:function(e,r,s){var a,l,u,h=[L,i];if(s){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,r,s))return!0}else for(;e=e[n];)if(1===e.nodeType||o){if(u=e[F]||(e[F]={}),l=u[e.uniqueID]||(u[e.uniqueID]={}),(a=l[n])&&a[0]===L&&a[1]===i)return h[2]=a[2];if(l[n]=h,h[2]=t(e,r,s))return!0}}}function d(t){return t.length>1?function(e,r,n){for(var o=t.length;o--;)if(!t[o](e,r,n))return!1;return!0}:t[0]}function f(t,r,n){for(var o=0,i=r.length;o<i;o++)e(t,r[o],n);return n}function m(t,e,r,n,o){for(var i,s=[],a=0,l=t.length,u=null!=e;a<l;a++)(i=t[a])&&(r&&!r(i,n,o)||(s.push(i),u&&e.push(a)));return s}function g(t,e,r,o,i,s){return o&&!o[F]&&(o=g(o)),i&&!i[F]&&(i=g(i,s)),n(function(n,s,a,l){var u,h,c,p=[],_=[],d=s.length,g=n||f(e||"*",a.nodeType?[a]:a,[]),y=!t||!n&&e?g:m(g,p,t,a,l),v=r?i||(n?t:d||o)?[]:s:y;if(r&&r(y,v,a,l),o)for(u=m(v,_),o(u,[],a,l),h=u.length;h--;)(c=u[h])&&(v[_[h]]=!(y[_[h]]=c));if(n){if(i||t){if(i){for(u=[],h=v.length;h--;)(c=v[h])&&u.push(y[h]=c);i(null,v=[],u,l)}for(h=v.length;h--;)(c=v[h])&&(u=i?tt(n,c):p[h])>-1&&(n[u]=!(s[u]=c))}}else v=m(v===s?v.splice(d,v.length):v),i?i(null,s,v,l):K.apply(s,v)})}function y(t){for(var e,r,n,o=t.length,i=w.relative[t[0].type],s=i||w.relative[" "],a=i?1:0,l=_(function(t){return t===e},s,!0),u=_(function(t){return tt(e,t)>-1},s,!0),h=[function(t,r,n){var o=!i&&(n||r!==z)||((e=r).nodeType?l(t,r,n):u(t,r,n));return e=null,o}];a<o;a++)if(r=w.relative[t[a].type])h=[_(d(h),r)];else{if(r=w.filter[t[a].type].apply(null,t[a].matches),r[F]){for(n=++a;n<o&&!w.relative[t[n].type];n++);return g(a>1&&d(h),a>1&&p(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(at,"$1"),r,a<n&&y(t.slice(a,n)),n<o&&y(t=t.slice(n)),n<o&&p(t))}h.push(r)}return d(h)}function v(t,r){var o=r.length>0,i=t.length>0,s=function(n,s,a,l,u){var h,c,p,_=0,d="0",f=n&&[],g=[],y=z,v=n||i&&w.find.TAG("*",u),b=L+=null==y?1:Math.random()||.1,x=v.length;for(u&&(z=s===C||s||u);d!==x&&null!=(h=v[d]);d++){if(i&&h){for(c=0,s||h.ownerDocument===C||(A(h),a=!O);p=t[c++];)if(p(h,s||C,a)){l.push(h);break}u&&(L=b)}o&&((h=!p&&h)&&_--,n&&f.push(h))}if(_+=d,o&&d!==_){for(c=0;p=r[c++];)p(f,g,s,a);if(n){if(_>0)for(;d--;)f[d]||g[d]||(g[d]=J.call(l));g=m(g)}K.apply(l,g),u&&!n&&g.length>0&&_+r.length>1&&e.uniqueSort(l)}return u&&(L=b,z=y),f};return o?n(s):s}var b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F="sizzle"+1*new Date,B=t.document,L=0,G=0,V=r(),U=r(),Y=r(),H=function(t,e){return t===e&&(E=!0),0},X=1<<31,$={}.hasOwnProperty,W=[],J=W.pop,Q=W.push,K=W.push,Z=W.slice,tt=function(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",rt="[\\x20\\t\\r\\n\\f]",nt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot="\\["+rt+"*("+nt+")(?:"+rt+"*([*^$|!~]?=)"+rt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+nt+"))|)"+rt+"*\\]",it=":("+nt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",st=new RegExp(rt+"+","g"),at=new RegExp("^"+rt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+rt+"+$","g"),lt=new RegExp("^"+rt+"*,"+rt+"*"),ut=new RegExp("^"+rt+"*([>+~]|"+rt+")"+rt+"*"),ht=new RegExp("="+rt+"*([^\\]'\"]*?)"+rt+"*\\]","g"),ct=new RegExp(it),pt=new RegExp("^"+nt+"$"),_t={ID:new RegExp("^#("+nt+")"),CLASS:new RegExp("^\\.("+nt+")"),TAG:new RegExp("^("+nt+"|[*])"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp("^"+it),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+rt+"*(even|odd|(([+-]|)(\\d*)n|)"+rt+"*(?:([+-]|)"+rt+"*(\\d+)|))"+rt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+rt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+rt+"*((?:-\\d)?\\d*)"+rt+"*\\)|)(?=[^-]|$)","i")},dt=/^(?:input|select|textarea|button)$/i,ft=/^h\d$/i,mt=/^[^{]+\{\s*\[native \w/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,vt=/'|\\/g,bt=new RegExp("\\\\([\\da-f]{1,6}"+rt+"?|("+rt+")|.)","ig"),xt=function(t,e,r){var n="0x"+e-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},wt=function(){A()};try{K.apply(W=Z.call(B.childNodes),B.childNodes),W[B.childNodes.length].nodeType}catch(Mt){K={apply:W.length?function(t,e){Q.apply(t,Z.call(e))}:function(t,e){for(var r=t.length,n=0;t[r++]=e[n++];);t.length=r-1}}}x=e.support={},k=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},A=e.setDocument=function(t){var e,r,n=t?t.ownerDocument||t:B;return n!==C&&9===n.nodeType&&n.documentElement?(C=n,N=C.documentElement,O=!k(C),(r=C.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",wt,!1):r.attachEvent&&r.attachEvent("onunload",wt)),x.attributes=o(function(t){return t.className="i",!t.getAttribute("className")}),x.getElementsByTagName=o(function(t){return t.appendChild(C.createComment("")),!t.getElementsByTagName("*").length}),x.getElementsByClassName=mt.test(C.getElementsByClassName),x.getById=o(function(t){return N.appendChild(t).id=F,!C.getElementsByName||!C.getElementsByName(F).length}),x.getById?(w.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&O){var r=e.getElementById(t);return r?[r]:[]}},w.filter.ID=function(t){var e=t.replace(bt,xt);return function(t){return t.getAttribute("id")===e}}):(delete w.find.ID,w.filter.ID=function(t){var e=t.replace(bt,xt);return function(t){var r="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return r&&r.value===e}}),w.find.TAG=x.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):x.qsa?e.querySelectorAll(t):void 0}:function(t,e){var r,n=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;r=i[o++];)1===r.nodeType&&n.push(r);return n}return i},w.find.CLASS=x.getElementsByClassName&&function(t,e){if("undefined"!=typeof e.getElementsByClassName&&O)return e.getElementsByClassName(t)},D=[],q=[],(x.qsa=mt.test(C.querySelectorAll))&&(o(function(t){N.appendChild(t).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+rt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||q.push("\\["+rt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+F+"-]").length||q.push("~="),t.querySelectorAll(":checked").length||q.push(":checked"),t.querySelectorAll("a#"+F+"+*").length||q.push(".#.+[+~]")}),o(function(t){var e=C.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&q.push("name"+rt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),q.push(",.*:")})),(x.matchesSelector=mt.test(I=N.matches||N.webkitMatchesSelector||N.mozMatchesSelector||N.oMatchesSelector||N.msMatchesSelector))&&o(function(t){x.disconnectedMatch=I.call(t,"div"),I.call(t,"[s!='']:x"),D.push("!=",it)}),q=q.length&&new RegExp(q.join("|")),D=D.length&&new RegExp(D.join("|")),e=mt.test(N.compareDocumentPosition),R=e||mt.test(N.contains)?function(t,e){var r=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},H=e?function(t,e){if(t===e)return E=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r?r:(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&r||!x.sortDetached&&e.compareDocumentPosition(t)===r?t===C||t.ownerDocument===B&&R(B,t)?-1:e===C||e.ownerDocument===B&&R(B,e)?1:P?tt(P,t)-tt(P,e):0:4&r?-1:1)}:function(t,e){if(t===e)return E=!0,0;var r,n=0,o=t.parentNode,i=e.parentNode,a=[t],l=[e];if(!o||!i)return t===C?-1:e===C?1:o?-1:i?1:P?tt(P,t)-tt(P,e):0;if(o===i)return s(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)l.unshift(r);for(;a[n]===l[n];)n++;return n?s(a[n],l[n]):a[n]===B?-1:l[n]===B?1:0},C):C},e.matches=function(t,r){return e(t,null,null,r)},e.matchesSelector=function(t,r){if((t.ownerDocument||t)!==C&&A(t),r=r.replace(ht,"='$1']"),x.matchesSelector&&O&&!Y[r+" "]&&(!D||!D.test(r))&&(!q||!q.test(r)))try{var n=I.call(t,r);if(n||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(o){}return e(r,C,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==C&&A(t),R(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==C&&A(t);var r=w.attrHandle[e.toLowerCase()],n=r&&$.call(w.attrHandle,e.toLowerCase())?r(t,e,!O):void 0;return void 0!==n?n:x.attributes||!O?t.getAttribute(e):(n=t.getAttributeNode(e))&&n.specified?n.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,r=[],n=0,o=0;if(E=!x.detectDuplicates,P=!x.sortStable&&t.slice(0),t.sort(H),E){for(;e=t[o++];)e===t[o]&&(n=r.push(o));for(;n--;)t.splice(r[n],1)}return P=null,t},M=e.getText=function(t){var e,r="",n=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)r+=M(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[n++];)r+=M(e);return r},w=e.selectors={cacheLength:50,createPseudo:n,match:_t,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(bt,xt),t[3]=(t[3]||t[4]||t[5]||"").replace(bt,xt),"~="===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]||e.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]&&e.error(t[0]),t},PSEUDO:function(t){var e,r=!t[6]&&t[2];return _t.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":r&&ct.test(r)&&(e=j(r,!0))&&(e=r.indexOf(")",r.length-e)-r.length)&&(t[0]=t[0].slice(0,e),t[2]=r.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(bt,xt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=V[t+" "];return e||(e=new RegExp("(^|"+rt+")"+t+"("+rt+"|$)"))&&V(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,r,n){return function(o){var i=e.attr(o,t);return null==i?"!="===r:!r||(i+="","="===r?i===n:"!="===r?i!==n:"^="===r?n&&0===i.indexOf(n):"*="===r?n&&i.indexOf(n)>-1:"$="===r?n&&i.slice(-n.length)===n:"~="===r?(" "+i.replace(st," ")+" ").indexOf(n)>-1:"|="===r&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,r,n,o){var i="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===o?function(t){return!!t.parentNode}:function(e,r,l){var u,h,c,p,_,d,f=i!==s?"nextSibling":"previousSibling",m=e.parentNode,g=a&&e.nodeName.toLowerCase(),y=!l&&!a,v=!1;if(m){if(i){for(;f;){for(p=e;p=p[f];)if(a?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;d=f="only"===t&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&y){for(p=m,c=p[F]||(p[F]={}),h=c[p.uniqueID]||(c[p.uniqueID]={}),u=h[t]||[],_=u[0]===L&&u[1],v=_&&u[2],p=_&&m.childNodes[_];p=++_&&p&&p[f]||(v=_=0)||d.pop();)if(1===p.nodeType&&++v&&p===e){h[t]=[L,_,v];break}}else if(y&&(p=e,c=p[F]||(p[F]={}),h=c[p.uniqueID]||(c[p.uniqueID]={}),u=h[t]||[],_=u[0]===L&&u[1],v=_),v===!1)for(;(p=++_&&p&&p[f]||(v=_=0)||d.pop())&&((a?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++v||(y&&(c=p[F]||(p[F]={}),h=c[p.uniqueID]||(c[p.uniqueID]={}),h[t]=[L,v]),p!==e)););return v-=o,v===n||v%n===0&&v/n>=0}}},PSEUDO:function(t,r){var o,i=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return i[F]?i(r):i.length>1?(o=[t,t,"",r],w.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,e){for(var n,o=i(t,r),s=o.length;s--;)n=tt(t,o[s]),t[n]=!(e[n]=o[s])}):function(t){return i(t,0,o)}):i}},pseudos:{not:n(function(t){var e=[],r=[],o=T(t.replace(at,"$1"));return o[F]?n(function(t,e,r,n){for(var i,s=o(t,null,n,[]),a=t.length;a--;)(i=s[a])&&(t[a]=!(e[a]=i))}):function(t,n,i){return e[0]=t,o(e,null,i,r),e[0]=null,!r.pop()}}),has:n(function(t){return function(r){return e(t,r).length>0}}),contains:n(function(t){return t=t.replace(bt,xt),function(e){return(e.textContent||e.innerText||M(e)).indexOf(t)>-1}}),lang:n(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(bt,xt).toLowerCase(),function(e){var r;do if(r=O?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return r=r.toLowerCase(),r===t||0===r.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var r=t.location&&t.location.hash;return r&&r.slice(1)===e.id},root:function(t){return t===N},focus:function(t){return t===C.activeElement&&(!C.hasFocus||C.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.nodeType<6)return!1;return!0},parent:function(t){return!w.pseudos.empty(t)},header:function(t){return ft.test(t.nodeName)},input:function(t){return dt.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"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,r){return[r<0?r+e:r]}),even:u(function(t,e){for(var r=0;r<e;r+=2)t.push(r);return t}),odd:u(function(t,e){for(var r=1;r<e;r+=2)t.push(r);return t}),lt:u(function(t,e,r){for(var n=r<0?r+e:r;--n>=0;)t.push(n);return t}),gt:u(function(t,e,r){for(var n=r<0?r+e:r;++n<e;)t.push(n);return t})}},w.pseudos.nth=w.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[b]=a(b);for(b in{submit:!0,reset:!0})w.pseudos[b]=l(b);return c.prototype=w.filters=w.pseudos,w.setFilters=new c,j=e.tokenize=function(t,r){var n,o,i,s,a,l,u,h=U[t+" "];if(h)return r?0:h.slice(0);for(a=t,l=[],u=w.preFilter;a;){n&&!(o=lt.exec(a))||(o&&(a=a.slice(o[0].length)||a),l.push(i=[])),n=!1,(o=ut.exec(a))&&(n=o.shift(),i.push({value:n,type:o[0].replace(at," ")}),a=a.slice(n.length));for(s in w.filter)!(o=_t[s].exec(a))||u[s]&&!(o=u[s](o))||(n=o.shift(),i.push({value:n,type:s,matches:o}),a=a.slice(n.length));if(!n)break}return r?a.length:a?e.error(t):U(t,l).slice(0)},T=e.compile=function(t,e){var r,n=[],o=[],i=Y[t+" "];if(!i){for(e||(e=j(t)),r=e.length;r--;)i=y(e[r]),i[F]?n.push(i):o.push(i);i=Y(t,v(o,n)),i.selector=t}return i},S=e.select=function(t,e,r,n){var o,i,s,a,l,u="function"==typeof t&&t,c=!n&&j(t=u.selector||t);if(r=r||[],1===c.length){if(i=c[0]=c[0].slice(0),i.length>2&&"ID"===(s=i[0]).type&&x.getById&&9===e.nodeType&&O&&w.relative[i[1].type]){if(e=(w.find.ID(s.matches[0].replace(bt,xt),e)||[])[0],!e)return r;u&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=_t.needsContext.test(t)?0:i.length;o--&&(s=i[o],!w.relative[a=s.type]);)if((l=w.find[a])&&(n=l(s.matches[0].replace(bt,xt),yt.test(i[0].type)&&h(e.parentNode)||e))){if(i.splice(o,1),t=n.length&&p(i),!t)return K.apply(r,n),r;break}}return(u||T(t,c))(n,e,!O,r,!e||yt.test(t)&&h(e.parentNode)||e),r},x.sortStable=F.split("").sort(H).join("")===F,x.detectDuplicates=!!E,A(),x.sortDetached=o(function(t){return 1&t.compareDocumentPosition(C.createElement("div"))}),o(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||i("type|href|height|width",function(t,e,r){if(!r)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),x.attributes&&o(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||i("value",function(t,e,r){if(!r&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),o(function(t){return null==t.getAttribute("disabled")})||i(et,function(t,e,r){var n;if(!r)return t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(e);st.find=ct,st.expr=ct.selectors,st.expr[":"]=st.expr.pseudos,st.uniqueSort=st.unique=ct.uniqueSort,st.text=ct.getText,st.isXMLDoc=ct.isXML,st.contains=ct.contains;var pt=function(t,e,r){for(var n=[],o=void 0!==r;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&st(t).is(r))break;n.push(t)}return n},_t=function(t,e){for(var r=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&r.push(t);return r},dt=st.expr.match.needsContext,ft=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,mt=/^.[^:#\[\.,]*$/;st.filter=function(t,e,r){var n=e[0];return r&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?st.find.matchesSelector(n,t)?[n]:[]:st.find.matches(t,st.grep(e,function(t){return 1===t.nodeType}))},st.fn.extend({find:function(t){var e,r=this.length,n=[],o=this;if("string"!=typeof t)return this.pushStack(st(t).filter(function(){for(e=0;e<r;e++)if(st.contains(o[e],this))return!0}));for(e=0;e<r;e++)st.find(t,o[e],n);return n=this.pushStack(r>1?st.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(o(this,t||[],!1))},not:function(t){return this.pushStack(o(this,t||[],!0))},is:function(t){return!!o(this,"string"==typeof t&&dt.test(t)?st(t):t||[],!1).length}});var gt,yt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,vt=st.fn.init=function(t,e,r){var n,o;if(!t)return this;if(r=r||gt,"string"==typeof t){if(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:yt.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||r).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof st?e[0]:e,st.merge(this,st.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:J,!0)),ft.test(n[1])&&st.isPlainObject(e))for(n in e)st.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return o=J.getElementById(n[2]),o&&o.parentNode&&(this.length=1,this[0]=o),this.context=J,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):st.isFunction(t)?void 0!==r.ready?r.ready(t):t(st):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),st.makeArray(t,this))};vt.prototype=st.fn,gt=st(J);var bt=/^(?:parents|prev(?:Until|All))/,xt={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({has:function(t){var e=st(t,this),r=e.length;return this.filter(function(){for(var t=0;t<r;t++)if(st.contains(this,e[t]))return!0})},closest:function(t,e){for(var r,n=0,o=this.length,i=[],s=dt.test(t)||"string"!=typeof t?st(t,e||this.context):0;n<o;n++)for(r=this[n];r&&r!==e;r=r.parentNode)if(r.nodeType<11&&(s?s.index(r)>-1:1===r.nodeType&&st.find.matchesSelector(r,t))){i.push(r);break}return this.pushStack(i.length>1?st.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?tt.call(st(t),this[0]):tt.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(st.uniqueSort(st.merge(this.get(),st(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),st.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return pt(t,"parentNode")},parentsUntil:function(t,e,r){return pt(t,"parentNode",r)},next:function(t){return i(t,"nextSibling")},prev:function(t){return i(t,"previousSibling")},nextAll:function(t){return pt(t,"nextSibling")},prevAll:function(t){return pt(t,"previousSibling")},nextUntil:function(t,e,r){return pt(t,"nextSibling",r)},prevUntil:function(t,e,r){return pt(t,"previousSibling",r)},siblings:function(t){return _t((t.parentNode||{}).firstChild,t)},children:function(t){return _t(t.firstChild)},contents:function(t){return t.contentDocument||st.merge([],t.childNodes)}},function(t,e){st.fn[t]=function(r,n){var o=st.map(this,e,r);return"Until"!==t.slice(-5)&&(n=r),n&&"string"==typeof n&&(o=st.filter(n,o)),this.length>1&&(xt[t]||st.uniqueSort(o),bt.test(t)&&o.reverse()),this.pushStack(o)}});var wt=/\S+/g;st.Callbacks=function(t){t="string"==typeof t?s(t):st.extend({},t);var e,r,n,o,i=[],a=[],l=-1,u=function(){for(o=t.once,n=e=!0;a.length;l=-1)for(r=a.shift();++l<i.length;)i[l].apply(r[0],r[1])===!1&&t.stopOnFalse&&(l=i.length,r=!1);t.memory||(r=!1),e=!1,o&&(i=r?[]:"")},h={add:function(){return i&&(r&&!e&&(l=i.length-1,a.push(r)),function n(e){st.each(e,function(e,r){st.isFunction(r)?t.unique&&h.has(r)||i.push(r):r&&r.length&&"string"!==st.type(r)&&n(r)})}(arguments),r&&!e&&u()),this},remove:function(){return st.each(arguments,function(t,e){for(var r;(r=st.inArray(e,i,r))>-1;)i.splice(r,1),r<=l&&l--}),this},has:function(t){return t?st.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=r="",this},disabled:function(){return!i},lock:function(){return o=a=[],r||(i=r=""),this},locked:function(){return!!o},fireWith:function(t,r){return o||(r=r||[],r=[t,r.slice?r.slice():r],a.push(r),e||u()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},st.extend({Deferred:function(t){var e=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],r="pending",n={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var t=arguments;return st.Deferred(function(r){st.each(e,function(e,i){var s=st.isFunction(t[e])&&t[e];o[i[1]](function(){var t=s&&s.apply(this,arguments);t&&st.isFunction(t.promise)?t.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[i[0]+"With"](this===n?r.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?st.extend(t,n):n}},o={};return n.pipe=n.then,st.each(e,function(t,i){var s=i[2],a=i[3];n[i[1]]=s.add,a&&s.add(function(){r=a},e[1^t][2].disable,e[2][2].lock),o[i[0]]=function(){return o[i[0]+"With"](this===o?n:this,arguments),this},o[i[0]+"With"]=s.fireWith}),n.promise(o),t&&t.call(o,o),o},when:function(t){var e,r,n,o=0,i=Q.call(arguments),s=i.length,a=1!==s||t&&st.isFunction(t.promise)?s:0,l=1===a?t:st.Deferred(),u=function(t,r,n){return function(o){r[t]=this,n[t]=arguments.length>1?Q.call(arguments):o,n===e?l.notifyWith(r,n):--a||l.resolveWith(r,n)}};if(s>1)for(e=new Array(s),r=new Array(s),n=new Array(s);o<s;o++)i[o]&&st.isFunction(i[o].promise)?i[o].promise().progress(u(o,r,e)).done(u(o,n,i)).fail(l.reject):--a;return a||l.resolveWith(n,i),l.promise()}});var Mt;st.fn.ready=function(t){return st.ready.promise().done(t),this},st.extend({isReady:!1,readyWait:1,holdReady:function(t){t?st.readyWait++:st.ready(!0)},ready:function(t){(t===!0?--st.readyWait:st.isReady)||(st.isReady=!0,t!==!0&&--st.readyWait>0||(Mt.resolveWith(J,[st]),st.fn.triggerHandler&&(st(J).triggerHandler("ready"),st(J).off("ready"))))}}),st.ready.promise=function(t){return Mt||(Mt=st.Deferred(),"complete"===J.readyState||"loading"!==J.readyState&&!J.documentElement.doScroll?e.setTimeout(st.ready):(J.addEventListener("DOMContentLoaded",a),e.addEventListener("load",a))),Mt.promise(t)},st.ready.promise();var kt=function(t,e,r,n,o,i,s){var a=0,l=t.length,u=null==r;if("object"===st.type(r)){o=!0;for(a in r)kt(t,e,a,r[a],!0,i,s)}else if(void 0!==n&&(o=!0,st.isFunction(n)||(s=!0),u&&(s?(e.call(t,n),e=null):(u=e,e=function(t,e,r){return u.call(st(t),r)})),e))for(;a<l;a++)e(t[a],r,s?n:n.call(t[a],a,e(t[a],r)));return o?t:u?e.call(t):l?e(t[0],r):i},jt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};l.uid=1,l.prototype={register:function(t,e){var r=e||{};return t.nodeType?t[this.expando]=r:Object.defineProperty(t,this.expando,{value:r,writable:!0,configurable:!0}),t[this.expando]},cache:function(t){if(!jt(t))return{};var e=t[this.expando];return e||(e={},jt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,r){var n,o=this.cache(t);if("string"==typeof e)o[e]=r;else for(n in e)o[n]=e[n];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][e]},access:function(t,e,r){var n;return void 0===e||e&&"string"==typeof e&&void 0===r?(n=this.get(t,e),void 0!==n?n:this.get(t,st.camelCase(e))):(this.set(t,e,r),void 0!==r?r:e)},remove:function(t,e){var r,n,o,i=t[this.expando];if(void 0!==i){if(void 0===e)this.register(t);else{st.isArray(e)?n=e.concat(e.map(st.camelCase)):(o=st.camelCase(e),e in i?n=[e,o]:(n=o,n=n in i?[n]:n.match(wt)||[])),r=n.length;for(;r--;)delete i[n[r]]}(void 0===e||st.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!st.isEmptyObject(e)}};var Tt=new l,St=new l,zt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Pt=/[A-Z]/g;st.extend({hasData:function(t){return St.hasData(t)||Tt.hasData(t)},data:function(t,e,r){return St.access(t,e,r)},removeData:function(t,e){St.remove(t,e)},_data:function(t,e,r){return Tt.access(t,e,r)},_removeData:function(t,e){Tt.remove(t,e)}}),st.fn.extend({data:function(t,e){var r,n,o,i=this[0],s=i&&i.attributes;if(void 0===t){if(this.length&&(o=St.get(i),1===i.nodeType&&!Tt.get(i,"hasDataAttrs"))){for(r=s.length;r--;)s[r]&&(n=s[r].name,0===n.indexOf("data-")&&(n=st.camelCase(n.slice(5)),u(i,n,o[n])));Tt.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each(function(){St.set(this,t)}):kt(this,function(e){var r,n;if(i&&void 0===e){if(r=St.get(i,t)||St.get(i,t.replace(Pt,"-$&").toLowerCase()),void 0!==r)return r;if(n=st.camelCase(t),r=St.get(i,n),void 0!==r)return r;if(r=u(i,n,void 0),void 0!==r)return r}else n=st.camelCase(t),this.each(function(){var r=St.get(this,n);St.set(this,n,e),t.indexOf("-")>-1&&void 0!==r&&St.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){St.remove(this,t)})}}),st.extend({queue:function(t,e,r){var n;if(t)return e=(e||"fx")+"queue",n=Tt.get(t,e),r&&(!n||st.isArray(r)?n=Tt.access(t,e,st.makeArray(r)):n.push(r)),n||[]},dequeue:function(t,e){e=e||"fx";var r=st.queue(t,e),n=r.length,o=r.shift(),i=st._queueHooks(t,e),s=function(){st.dequeue(t,e)};"inprogress"===o&&(o=r.shift(),n--),o&&("fx"===e&&r.unshift("inprogress"),delete i.stop,o.call(t,s,i)),!n&&i&&i.empty.fire()},_queueHooks:function(t,e){var r=e+"queueHooks";return Tt.get(t,r)||Tt.access(t,r,{empty:st.Callbacks("once memory").add(function(){Tt.remove(t,[e+"queue",r])})})}}),st.fn.extend({queue:function(t,e){var r=2;return"string"!=typeof t&&(e=t,t="fx",r--),arguments.length<r?st.queue(this[0],t):void 0===e?this:this.each(function(){var r=st.queue(this,t,e);st._queueHooks(this,t),"fx"===t&&"inprogress"!==r[0]&&st.dequeue(this,t)})},dequeue:function(t){return this.each(function(){st.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var r,n=1,o=st.Deferred(),i=this,s=this.length,a=function(){--n||o.resolveWith(i,[i])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)r=Tt.get(i[s],t+"queueHooks"),r&&r.empty&&(n++,r.empty.add(a));return a(),o.promise(e)}});var Et=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,At=new RegExp("^(?:([+-])=|)("+Et+")([a-z%]*)$","i"),Ct=["Top","Right","Bottom","Left"],Nt=function(t,e){return t=e||t,"none"===st.css(t,"display")||!st.contains(t.ownerDocument,t)},Ot=/^(?:checkbox|radio)$/i,qt=/<([\w:-]+)/,Dt=/^$|\/(?:java|ecma)script/i,It={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,"",""]};It.optgroup=It.option,It.tbody=It.tfoot=It.colgroup=It.caption=It.thead,It.th=It.td;var Rt=/<|&#?\w+;/;!function(){var t=J.createDocumentFragment(),e=t.appendChild(J.createElement("div")),r=J.createElement("input");r.setAttribute("type","radio"),r.setAttribute("checked","checked"),r.setAttribute("name","t"),e.appendChild(r),ot.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",ot.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ft=/^key/,Bt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Lt=/^([^.]*)(?:\.(.+)|)/;st.event={global:{},add:function(t,e,r,n,o){var i,s,a,l,u,h,c,p,_,d,f,m=Tt.get(t);if(m)for(r.handler&&(i=r,r=i.handler,o=i.selector),r.guid||(r.guid=st.guid++),(l=m.events)||(l=m.events={}),(s=m.handle)||(s=m.handle=function(e){return"undefined"!=typeof st&&st.event.triggered!==e.type?st.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(wt)||[""],u=e.length;u--;)a=Lt.exec(e[u])||[],_=f=a[1],d=(a[2]||"").split(".").sort(),_&&(c=st.event.special[_]||{},_=(o?c.delegateType:c.bindType)||_,c=st.event.special[_]||{},h=st.extend({type:_,origType:f,data:n,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:d.join(".")},i),(p=l[_])||(p=l[_]=[],p.delegateCount=0,c.setup&&c.setup.call(t,n,d,s)!==!1||t.addEventListener&&t.addEventListener(_,s)),c.add&&(c.add.call(t,h),h.handler.guid||(h.handler.guid=r.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),st.event.global[_]=!0)},remove:function(t,e,r,n,o){var i,s,a,l,u,h,c,p,_,d,f,m=Tt.hasData(t)&&Tt.get(t);if(m&&(l=m.events)){for(e=(e||"").match(wt)||[""],u=e.length;u--;)if(a=Lt.exec(e[u])||[],_=f=a[1],d=(a[2]||"").split(".").sort(),_){for(c=st.event.special[_]||{},_=(n?c.delegateType:c.bindType)||_,p=l[_]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=i=p.length;i--;)h=p[i],!o&&f!==h.origType||r&&r.guid!==h.guid||a&&!a.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(p.splice(i,1),
h.selector&&p.delegateCount--,c.remove&&c.remove.call(t,h));s&&!p.length&&(c.teardown&&c.teardown.call(t,d,m.handle)!==!1||st.removeEvent(t,_,m.handle),delete l[_])}else for(_ in l)st.event.remove(t,_+e[u],r,n,!0);st.isEmptyObject(l)&&Tt.remove(t,"handle events")}},dispatch:function(t){t=st.event.fix(t);var e,r,n,o,i,s=[],a=Q.call(arguments),l=(Tt.get(this,"events")||{})[t.type]||[],u=st.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,t)!==!1){for(s=st.event.handlers.call(this,t,l),e=0;(o=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,r=0;(i=o.handlers[r++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(i.namespace)||(t.handleObj=i,t.data=i.data,n=((st.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,a),void 0!==n&&(t.result=n)===!1&&(t.preventDefault(),t.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,t),t.result}},handlers:function(t,e){var r,n,o,i,s=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==t.type)){for(n=[],r=0;r<a;r++)i=e[r],o=i.selector+" ",void 0===n[o]&&(n[o]=i.needsContext?st(o,this).index(l)>-1:st.find(o,this,null,[l]).length),n[o]&&n.push(i);n.length&&s.push({elem:l,handlers:n})}return a<e.length&&s.push({elem:this,handlers:e.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget detail 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,e){var r,n,o,i=e.button;return null==t.pageX&&null!=e.clientX&&(r=t.target.ownerDocument||J,n=r.documentElement,o=r.body,t.pageX=e.clientX+(n&&n.scrollLeft||o&&o.scrollLeft||0)-(n&&n.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||o&&o.scrollTop||0)-(n&&n.clientTop||o&&o.clientTop||0)),t.which||void 0===i||(t.which=1&i?1:2&i?3:4&i?2:0),t}},fix:function(t){if(t[st.expando])return t;var e,r,n,o=t.type,i=t,s=this.fixHooks[o];for(s||(this.fixHooks[o]=s=Bt.test(o)?this.mouseHooks:Ft.test(o)?this.keyHooks:{}),n=s.props?this.props.concat(s.props):this.props,t=new st.Event(i),e=n.length;e--;)r=n[e],t[r]=i[r];return t.target||(t.target=J),3===t.target.nodeType&&(t.target=t.target.parentNode),s.filter?s.filter(t,i):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==m()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===m()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&st.nodeName(this,"input"))return this.click(),!1},_default:function(t){return st.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},st.removeEvent=function(t,e,r){t.removeEventListener&&t.removeEventListener(e,r)},st.Event=function(t,e){return this instanceof st.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?d:f):this.type=t,e&&st.extend(this,e),this.timeStamp=t&&t.timeStamp||st.now(),void(this[st.expando]=!0)):new st.Event(t,e)},st.Event.prototype={constructor:st.Event,isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=d,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=d,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=d,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){st.event.special[t]={delegateType:e,bindType:e,handle:function(t){var r,n=this,o=t.relatedTarget,i=t.handleObj;return o&&(o===n||st.contains(n,o))||(t.type=i.origType,r=i.handler.apply(this,arguments),t.type=e),r}}}),st.fn.extend({on:function(t,e,r,n){return g(this,t,e,r,n)},one:function(t,e,r,n){return g(this,t,e,r,n,1)},off:function(t,e,r){var n,o;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,st(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return e!==!1&&"function"!=typeof e||(r=e,e=void 0),r===!1&&(r=f),this.each(function(){st.event.remove(this,t,r,e)})}});var Gt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Vt=/<script|<style|<link/i,Ut=/checked\s*(?:[^=]|=\s*.checked.)/i,Yt=/^true\/(.*)/,Ht=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;st.extend({htmlPrefilter:function(t){return t.replace(Gt,"<$1></$2>")},clone:function(t,e,r){var n,o,i,s,a=t.cloneNode(!0),l=st.contains(t.ownerDocument,t);if(!(ot.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||st.isXMLDoc(t)))for(s=c(a),i=c(t),n=0,o=i.length;n<o;n++)w(i[n],s[n]);if(e)if(r)for(i=i||c(t),s=s||c(a),n=0,o=i.length;n<o;n++)x(i[n],s[n]);else x(t,a);return s=c(a,"script"),s.length>0&&p(s,!l&&c(t,"script")),a},cleanData:function(t){for(var e,r,n,o=st.event.special,i=0;void 0!==(r=t[i]);i++)if(jt(r)){if(e=r[Tt.expando]){if(e.events)for(n in e.events)o[n]?st.event.remove(r,n):st.removeEvent(r,n,e.handle);r[Tt.expando]=void 0}r[St.expando]&&(r[St.expando]=void 0)}}}),st.fn.extend({domManip:M,detach:function(t){return k(this,t,!0)},remove:function(t){return k(this,t)},text:function(t){return kt(this,function(t){return void 0===t?st.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return M(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=y(this,t);e.appendChild(t)}})},prepend:function(){return M(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=y(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return M(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return M(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(st.cleanData(c(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return st.clone(this,t,e)})},html:function(t){return kt(this,function(t){var e=this[0]||{},r=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Vt.test(t)&&!It[(qt.exec(t)||["",""])[1].toLowerCase()]){t=st.htmlPrefilter(t);try{for(;r<n;r++)e=this[r]||{},1===e.nodeType&&(st.cleanData(c(e,!1)),e.innerHTML=t);e=0}catch(o){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return M(this,arguments,function(e){var r=this.parentNode;st.inArray(this,t)<0&&(st.cleanData(c(this)),r&&r.replaceChild(e,this))},t)}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){st.fn[t]=function(t){for(var r,n=[],o=st(t),i=o.length-1,s=0;s<=i;s++)r=s===i?this:this.clone(!0),st(o[s])[e](r),Z.apply(n,r.get());return this.pushStack(n)}});var Xt,$t={HTML:"block",BODY:"block"},Wt=/^margin/,Jt=new RegExp("^("+Et+")(?!px)[a-z%]+$","i"),Qt=function(t){var r=t.ownerDocument.defaultView;return r&&r.opener||(r=e),r.getComputedStyle(t)},Kt=function(t,e,r,n){var o,i,s={};for(i in e)s[i]=t.style[i],t.style[i]=e[i];o=r.apply(t,n||[]);for(i in e)t.style[i]=s[i];return o},Zt=J.documentElement;!function(){function t(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",Zt.appendChild(s);var t=e.getComputedStyle(a);r="1%"!==t.top,i="2px"===t.marginLeft,n="4px"===t.width,a.style.marginRight="50%",o="4px"===t.marginRight,Zt.removeChild(s)}var r,n,o,i,s=J.createElement("div"),a=J.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",ot.clearCloneStyle="content-box"===a.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(a),st.extend(ot,{pixelPosition:function(){return t(),r},boxSizingReliable:function(){return null==n&&t(),n},pixelMarginRight:function(){return null==n&&t(),o},reliableMarginLeft:function(){return null==n&&t(),i},reliableMarginRight:function(){var t,r=a.appendChild(J.createElement("div"));return r.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",r.style.marginRight=r.style.width="0",a.style.width="1px",Zt.appendChild(s),t=!parseFloat(e.getComputedStyle(r).marginRight),Zt.removeChild(s),a.removeChild(r),t}}))}();var te=/^(none|table(?!-c[ea]).+)/,ee={position:"absolute",visibility:"hidden",display:"block"},re={letterSpacing:"0",fontWeight:"400"},ne=["Webkit","O","Moz","ms"],oe=J.createElement("div").style;st.extend({cssHooks:{opacity:{get:function(t,e){if(e){var r=S(t,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,e,r,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,s,a=st.camelCase(e),l=t.style;return e=st.cssProps[a]||(st.cssProps[a]=P(a)||a),s=st.cssHooks[e]||st.cssHooks[a],void 0===r?s&&"get"in s&&void 0!==(o=s.get(t,!1,n))?o:l[e]:(i=typeof r,"string"===i&&(o=At.exec(r))&&o[1]&&(r=h(t,e,o),i="number"),null!=r&&r===r&&("number"===i&&(r+=o&&o[3]||(st.cssNumber[a]?"":"px")),ot.clearCloneStyle||""!==r||0!==e.indexOf("background")||(l[e]="inherit"),s&&"set"in s&&void 0===(r=s.set(t,r,n))||(l[e]=r)),void 0)}},css:function(t,e,r,n){var o,i,s,a=st.camelCase(e);return e=st.cssProps[a]||(st.cssProps[a]=P(a)||a),s=st.cssHooks[e]||st.cssHooks[a],s&&"get"in s&&(o=s.get(t,!0,r)),void 0===o&&(o=S(t,e,n)),"normal"===o&&e in re&&(o=re[e]),""===r||r?(i=parseFloat(o),r===!0||isFinite(i)?i||0:o):o}}),st.each(["height","width"],function(t,e){st.cssHooks[e]={get:function(t,r,n){if(r)return te.test(st.css(t,"display"))&&0===t.offsetWidth?Kt(t,ee,function(){return C(t,e,n)}):C(t,e,n)},set:function(t,r,n){var o,i=n&&Qt(t),s=n&&A(t,e,n,"border-box"===st.css(t,"boxSizing",!1,i),i);return s&&(o=At.exec(r))&&"px"!==(o[3]||"px")&&(t.style[e]=r,r=st.css(t,e)),E(t,r,s)}}}),st.cssHooks.marginLeft=z(ot.reliableMarginLeft,function(t,e){if(e)return(parseFloat(S(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),st.cssHooks.marginRight=z(ot.reliableMarginRight,function(t,e){if(e)return Kt(t,{display:"inline-block"},S,[t,"marginRight"])}),st.each({margin:"",padding:"",border:"Width"},function(t,e){st.cssHooks[t+e]={expand:function(r){for(var n=0,o={},i="string"==typeof r?r.split(" "):[r];n<4;n++)o[t+Ct[n]+e]=i[n]||i[n-2]||i[0];return o}},Wt.test(t)||(st.cssHooks[t+e].set=E)}),st.fn.extend({css:function(t,e){return kt(this,function(t,e,r){var n,o,i={},s=0;if(st.isArray(e)){for(n=Qt(t),o=e.length;s<o;s++)i[e[s]]=st.css(t,e[s],!1,n);return i}return void 0!==r?st.style(t,e,r):st.css(t,e)},t,e,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Nt(this)?st(this).show():st(this).hide()})}}),st.Tween=O,O.prototype={constructor:O,init:function(t,e,r,n,o,i){this.elem=t,this.prop=r,this.easing=o||st.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=i||(st.cssNumber[r]?"":"px")},cur:function(){var t=O.propHooks[this.prop];return t&&t.get?t.get(this):O.propHooks._default.get(this)},run:function(t){var e,r=O.propHooks[this.prop];return this.options.duration?this.pos=e=st.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=st.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){st.fx.step[t.prop]?st.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[st.cssProps[t.prop]]&&!st.cssHooks[t.prop]?t.elem[t.prop]=t.now:st.style(t.elem,t.prop,t.now+t.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},st.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},st.fx=O.prototype.init,st.fx.step={};var ie,se,ae=/^(?:toggle|show|hide)$/,le=/queueHooks$/;st.Animation=st.extend(B,{tweeners:{"*":[function(t,e){var r=this.createTween(t,e);return h(r.elem,t,At.exec(e),r),r}]},tweener:function(t,e){st.isFunction(t)?(e=t,t=["*"]):t=t.match(wt);for(var r,n=0,o=t.length;n<o;n++)r=t[n],B.tweeners[r]=B.tweeners[r]||[],B.tweeners[r].unshift(e)},prefilters:[R],prefilter:function(t,e){e?B.prefilters.unshift(t):B.prefilters.push(t)}}),st.speed=function(t,e,r){var n=t&&"object"==typeof t?st.extend({},t):{complete:r||!r&&e||st.isFunction(t)&&t,duration:t,easing:r&&e||e&&!st.isFunction(e)&&e};return n.duration=st.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in st.fx.speeds?st.fx.speeds[n.duration]:st.fx.speeds._default,null!=n.queue&&n.queue!==!0||(n.queue="fx"),n.old=n.complete,n.complete=function(){st.isFunction(n.old)&&n.old.call(this),n.queue&&st.dequeue(this,n.queue)},n},st.fn.extend({fadeTo:function(t,e,r,n){return this.filter(Nt).css("opacity",0).show().end().animate({opacity:e},t,r,n)},animate:function(t,e,r,n){var o=st.isEmptyObject(t),i=st.speed(e,r,n),s=function(){var e=B(this,st.extend({},t),i);(o||Tt.get(this,"finish"))&&e.stop(!0)};return s.finish=s,o||i.queue===!1?this.each(s):this.queue(i.queue,s)},stop:function(t,e,r){var n=function(t){var e=t.stop;delete t.stop,e(r)};return"string"!=typeof t&&(r=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,o=null!=t&&t+"queueHooks",i=st.timers,s=Tt.get(this);if(o)s[o]&&s[o].stop&&n(s[o]);else for(o in s)s[o]&&s[o].stop&&le.test(o)&&n(s[o]);for(o=i.length;o--;)i[o].elem!==this||null!=t&&i[o].queue!==t||(i[o].anim.stop(r),e=!1,i.splice(o,1));!e&&r||st.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,r=Tt.get(this),n=r[t+"queue"],o=r[t+"queueHooks"],i=st.timers,s=n?n.length:0;for(r.finish=!0,st.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<s;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete r.finish})}}),st.each(["toggle","show","hide"],function(t,e){var r=st.fn[e];st.fn[e]=function(t,n,o){return null==t||"boolean"==typeof t?r.apply(this,arguments):this.animate(D(e,!0),t,n,o)}}),st.each({slideDown:D("show"),slideUp:D("hide"),slideToggle:D("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){st.fn[t]=function(t,r,n){return this.animate(e,t,r,n)}}),st.timers=[],st.fx.tick=function(){var t,e=0,r=st.timers;for(ie=st.now();e<r.length;e++)t=r[e],t()||r[e]!==t||r.splice(e--,1);r.length||st.fx.stop(),ie=void 0},st.fx.timer=function(t){st.timers.push(t),t()?st.fx.start():st.timers.pop()},st.fx.interval=13,st.fx.start=function(){se||(se=e.setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){e.clearInterval(se),se=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fn.delay=function(t,r){return t=st.fx?st.fx.speeds[t]||t:t,r=r||"fx",this.queue(r,function(r,n){var o=e.setTimeout(r,t);n.stop=function(){e.clearTimeout(o)}})},function(){var t=J.createElement("input"),e=J.createElement("select"),r=e.appendChild(J.createElement("option"));t.type="checkbox",ot.checkOn=""!==t.value,ot.optSelected=r.selected,e.disabled=!0,ot.optDisabled=!r.disabled,t=J.createElement("input"),t.value="t",t.type="radio",ot.radioValue="t"===t.value}();var ue,he=st.expr.attrHandle;st.fn.extend({attr:function(t,e){return kt(this,st.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){st.removeAttr(this,t)})}}),st.extend({attr:function(t,e,r){var n,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return"undefined"==typeof t.getAttribute?st.prop(t,e,r):(1===i&&st.isXMLDoc(t)||(e=e.toLowerCase(),o=st.attrHooks[e]||(st.expr.match.bool.test(e)?ue:void 0)),void 0!==r?null===r?void st.removeAttr(t,e):o&&"set"in o&&void 0!==(n=o.set(t,r,e))?n:(t.setAttribute(e,r+""),r):o&&"get"in o&&null!==(n=o.get(t,e))?n:(n=st.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!ot.radioValue&&"radio"===e&&st.nodeName(t,"input")){var r=t.value;return t.setAttribute("type",e),r&&(t.value=r),e}}}},removeAttr:function(t,e){var r,n,o=0,i=e&&e.match(wt);if(i&&1===t.nodeType)for(;r=i[o++];)n=st.propFix[r]||r,st.expr.match.bool.test(r)&&(t[n]=!1),t.removeAttribute(r)}}),ue={set:function(t,e,r){return e===!1?st.removeAttr(t,r):t.setAttribute(r,r),r}},st.each(st.expr.match.bool.source.match(/\w+/g),function(t,e){var r=he[e]||st.find.attr;he[e]=function(t,e,n){var o,i;return n||(i=he[e],he[e]=o,o=null!=r(t,e,n)?e.toLowerCase():null,he[e]=i),o}});var ce=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;st.fn.extend({prop:function(t,e){return kt(this,st.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[st.propFix[t]||t]})}}),st.extend({prop:function(t,e,r){var n,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&st.isXMLDoc(t)||(e=st.propFix[e]||e,o=st.propHooks[e]),void 0!==r?o&&"set"in o&&void 0!==(n=o.set(t,r,e))?n:t[e]=r:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=st.find.attr(t,"tabindex");return e?parseInt(e,10):ce.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),ot.optSelected||(st.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),st.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){st.propFix[this.toLowerCase()]=this});var _e=/[\t\r\n\f]/g;st.fn.extend({addClass:function(t){var e,r,n,o,i,s,a,l=0;if(st.isFunction(t))return this.each(function(e){st(this).addClass(t.call(this,e,L(this)))});if("string"==typeof t&&t)for(e=t.match(wt)||[];r=this[l++];)if(o=L(r),n=1===r.nodeType&&(" "+o+" ").replace(_e," ")){for(s=0;i=e[s++];)n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=st.trim(n),o!==a&&r.setAttribute("class",a)}return this},removeClass:function(t){var e,r,n,o,i,s,a,l=0;if(st.isFunction(t))return this.each(function(e){st(this).removeClass(t.call(this,e,L(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(wt)||[];r=this[l++];)if(o=L(r),n=1===r.nodeType&&(" "+o+" ").replace(_e," ")){for(s=0;i=e[s++];)for(;n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=st.trim(n),o!==a&&r.setAttribute("class",a)}return this},toggleClass:function(t,e){var r=typeof t;return"boolean"==typeof e&&"string"===r?e?this.addClass(t):this.removeClass(t):st.isFunction(t)?this.each(function(r){st(this).toggleClass(t.call(this,r,L(this),e),e)}):this.each(function(){var e,n,o,i;if("string"===r)for(n=0,o=st(this),i=t.match(wt)||[];e=i[n++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==r||(e=L(this),e&&Tt.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||t===!1?"":Tt.get(this,"__className__")||""))})},hasClass:function(t){var e,r,n=0;for(e=" "+t+" ";r=this[n++];)if(1===r.nodeType&&(" "+L(r)+" ").replace(_e," ").indexOf(e)>-1)return!0;return!1}});var de=/\r/g,fe=/[\x20\t\r\n\f]+/g;st.fn.extend({val:function(t){var e,r,n,o=this[0];{if(arguments.length)return n=st.isFunction(t),this.each(function(r){var o;1===this.nodeType&&(o=n?t.call(this,r,st(this).val()):t,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(t){return null==t?"":t+""})),e=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return e=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(r=e.get(o,"value"))?r:(r=o.value,"string"==typeof r?r.replace(de,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(t){var e=st.find.attr(t,"value");return null!=e?e:st.trim(st.text(t)).replace(fe," ")}},select:{get:function(t){for(var e,r,n=t.options,o=t.selectedIndex,i="select-one"===t.type||o<0,s=i?null:[],a=i?o+1:n.length,l=o<0?a:i?o:0;l<a;l++)if(r=n[l],(r.selected||l===o)&&(ot.optDisabled?!r.disabled:null===r.getAttribute("disabled"))&&(!r.parentNode.disabled||!st.nodeName(r.parentNode,"optgroup"))){if(e=st(r).val(),i)return e;s.push(e)}return s},set:function(t,e){for(var r,n,o=t.options,i=st.makeArray(e),s=o.length;s--;)n=o[s],(n.selected=st.inArray(st.valHooks.option.get(n),i)>-1)&&(r=!0);return r||(t.selectedIndex=-1),i}}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]={set:function(t,e){if(st.isArray(e))return t.checked=st.inArray(st(t).val(),e)>-1}},ot.checkOn||(st.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var me=/^(?:focusinfocus|focusoutblur)$/;st.extend(st.event,{trigger:function(t,r,n,o){var i,s,a,l,u,h,c,p=[n||J],_=nt.call(t,"type")?t.type:t,d=nt.call(t,"namespace")?t.namespace.split("."):[];if(s=a=n=n||J,3!==n.nodeType&&8!==n.nodeType&&!me.test(_+st.event.triggered)&&(_.indexOf(".")>-1&&(d=_.split("."),_=d.shift(),d.sort()),u=_.indexOf(":")<0&&"on"+_,t=t[st.expando]?t:new st.Event(_,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=d.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),r=null==r?[t]:st.makeArray(r,[t]),c=st.event.special[_]||{},o||!c.trigger||c.trigger.apply(n,r)!==!1)){if(!o&&!c.noBubble&&!st.isWindow(n)){for(l=c.delegateType||_,me.test(l+_)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(n.ownerDocument||J)&&p.push(a.defaultView||a.parentWindow||e)}for(i=0;(s=p[i++])&&!t.isPropagationStopped();)t.type=i>1?l:c.bindType||_,h=(Tt.get(s,"events")||{})[t.type]&&Tt.get(s,"handle"),h&&h.apply(s,r),h=u&&s[u],h&&h.apply&&jt(s)&&(t.result=h.apply(s,r),t.result===!1&&t.preventDefault());return t.type=_,o||t.isDefaultPrevented()||c._default&&c._default.apply(p.pop(),r)!==!1||!jt(n)||u&&st.isFunction(n[_])&&!st.isWindow(n)&&(a=n[u],a&&(n[u]=null),st.event.triggered=_,n[_](),st.event.triggered=void 0,a&&(n[u]=a)),t.result}},simulate:function(t,e,r){var n=st.extend(new st.Event,r,{type:t,isSimulated:!0});st.event.trigger(n,null,e)}}),st.fn.extend({trigger:function(t,e){return this.each(function(){st.event.trigger(t,e,this)})},triggerHandler:function(t,e){var r=this[0];if(r)return st.event.trigger(t,e,r,!0)}}),st.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){st.fn[e]=function(t,r){return arguments.length>0?this.on(e,null,t,r):this.trigger(e)}}),st.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),ot.focusin="onfocusin"in e,ot.focusin||st.each({focus:"focusin",blur:"focusout"},function(t,e){var r=function(t){st.event.simulate(e,t.target,st.event.fix(t))};st.event.special[e]={setup:function(){var n=this.ownerDocument||this,o=Tt.access(n,e);o||n.addEventListener(t,r,!0),Tt.access(n,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Tt.access(n,e)-1;o?Tt.access(n,e,o):(n.removeEventListener(t,r,!0),Tt.remove(n,e))}}});var ge=e.location,ye=st.now(),ve=/\?/;st.parseJSON=function(t){return JSON.parse(t+"")},st.parseXML=function(t){var r;if(!t||"string"!=typeof t)return null;try{r=(new e.DOMParser).parseFromString(t,"text/xml")}catch(n){r=void 0}return r&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+t),r};var be=/#.*$/,xe=/([?&])_=[^&]*/,we=/^(.*?):[ \t]*([^\r\n]*)$/gm,Me=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ke=/^(?:GET|HEAD)$/,je=/^\/\//,Te={},Se={},ze="*/".concat("*"),Pe=J.createElement("a");Pe.href=ge.href,st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ge.href,type:"GET",isLocal:Me.test(ge.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ze,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?U(U(t,st.ajaxSettings),e):U(st.ajaxSettings,t)},ajaxPrefilter:G(Te),ajaxTransport:G(Se),ajax:function(t,r){function n(t,r,n,a){var u,c,y,v,x,M=r;2!==b&&(b=2,l&&e.clearTimeout(l),o=void 0,s=a||"",w.readyState=t>0?4:0,u=t>=200&&t<300||304===t,n&&(v=Y(p,w,n)),v=H(p,v,w,u),u?(p.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(st.lastModified[i]=x),x=w.getResponseHeader("etag"),x&&(st.etag[i]=x)),204===t||"HEAD"===p.type?M="nocontent":304===t?M="notmodified":(M=v.state,c=v.data,y=v.error,u=!y)):(y=M,!t&&M||(M="error",t<0&&(t=0))),w.status=t,w.statusText=(r||M)+"",u?f.resolveWith(_,[c,M,w]):f.rejectWith(_,[w,M,y]),w.statusCode(g),g=void 0,h&&d.trigger(u?"ajaxSuccess":"ajaxError",[w,p,u?c:y]),m.fireWith(_,[w,M]),h&&(d.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof t&&(r=t,t=void 0),r=r||{};var o,i,s,a,l,u,h,c,p=st.ajaxSetup({},r),_=p.context||p,d=p.context&&(_.nodeType||_.jquery)?st(_):st.event,f=st.Deferred(),m=st.Callbacks("once memory"),g=p.statusCode||{},y={},v={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!a)for(a={};e=we.exec(s);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(t,e){var r=t.toLowerCase();return b||(t=v[r]=v[r]||t,y[t]=e),this},overrideMimeType:function(t){return b||(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(b<2)for(e in t)g[e]=[g[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||x;return o&&o.abort(e),n(0,e),this}};if(f.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((t||p.url||ge.href)+"").replace(be,"").replace(je,ge.protocol+"//"),p.type=r.method||r.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(wt)||[""],null==p.crossDomain){u=J.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Pe.protocol+"//"+Pe.host!=u.protocol+"//"+u.host}catch(M){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),V(Te,p,r,w),2===b)return w;h=st.event&&p.global,h&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!ke.test(p.type),i=p.url,p.hasContent||(p.data&&(i=p.url+=(ve.test(i)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=xe.test(i)?i.replace(xe,"$1_="+ye++):i+(ve.test(i)?"&":"?")+"_="+ye++)),p.ifModified&&(st.lastModified[i]&&w.setRequestHeader("If-Modified-Since",st.lastModified[i]),st.etag[i]&&w.setRequestHeader("If-None-Match",st.etag[i])),(p.data&&p.hasContent&&p.contentType!==!1||r.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+ze+"; q=0.01":""):p.accepts["*"]);for(c in p.headers)w.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(p.beforeSend.call(_,w,p)===!1||2===b))return w.abort();x="abort";for(c in{success:1,error:1,complete:1})w[c](p[c]);if(o=V(Se,p,r,w)){if(w.readyState=1,h&&d.trigger("ajaxSend",[w,p]),2===b)return w;p.async&&p.timeout>0&&(l=e.setTimeout(function(){w.abort("timeout")},p.timeout));try{b=1,o.send(y,n)}catch(M){if(!(b<2))throw M;n(-1,M)}}else n(-1,"No Transport");return w},getJSON:function(t,e,r){return st.get(t,e,r,"json")},getScript:function(t,e){return st.get(t,void 0,e,"script")}}),st.each(["get","post"],function(t,e){st[e]=function(t,r,n,o){return st.isFunction(r)&&(o=o||n,n=r,r=void 0),st.ajax(st.extend({url:t,type:e,dataType:o,data:r,success:n},st.isPlainObject(t)&&t))}}),st._evalUrl=function(t){return st.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},st.fn.extend({wrapAll:function(t){var e;return st.isFunction(t)?this.each(function(e){st(this).wrapAll(t.call(this,e))}):(this[0]&&(e=st(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 st.isFunction(t)?this.each(function(e){st(this).wrapInner(t.call(this,e))}):this.each(function(){var e=st(this),r=e.contents();r.length?r.wrapAll(t):e.append(t)})},wrap:function(t){var e=st.isFunction(t);return this.each(function(r){st(this).wrapAll(e?t.call(this,r):t)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()}}),st.expr.filters.hidden=function(t){return!st.expr.filters.visible(t)},st.expr.filters.visible=function(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0};var Ee=/%20/g,Ae=/\[\]$/,Ce=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,Oe=/^(?:input|select|textarea|keygen)/i;st.param=function(t,e){var r,n=[],o=function(t,e){e=st.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(t)||t.jquery&&!st.isPlainObject(t))st.each(t,function(){o(this.name,this.value)});else for(r in t)X(r,t[r],e,o);return n.join("&").replace(Ee,"+")},st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=st.prop(this,"elements");return t?st.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!st(this).is(":disabled")&&Oe.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!Ot.test(t))}).map(function(t,e){var r=st(this).val();return null==r?null:st.isArray(r)?st.map(r,function(t){return{name:e.name,value:t.replace(Ce,"\r\n")}}):{name:e.name,value:r.replace(Ce,"\r\n")}}).get()}}),st.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var qe={0:200,1223:204},De=st.ajaxSettings.xhr();ot.cors=!!De&&"withCredentials"in De,ot.ajax=De=!!De,st.ajaxTransport(function(t){var r,n;if(ot.cors||De&&!t.crossDomain)return{send:function(o,i){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");
for(s in o)a.setRequestHeader(s,o[s]);r=function(t){return function(){r&&(r=n=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=r(),n=a.onerror=r("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){r&&n()})},r=r("abort");try{a.send(t.hasContent&&t.data||null)}catch(l){if(r)throw l}},abort:function(){r&&r()}}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return st.globalEval(t),t}}}),st.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),st.ajaxTransport("script",function(t){if(t.crossDomain){var e,r;return{send:function(n,o){e=st("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",r=function(t){e.remove(),r=null,t&&o("error"===t.type?404:200,t.type)}),J.head.appendChild(e[0])},abort:function(){r&&r()}}}});var Ie=[],Re=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ie.pop()||st.expando+"_"+ye++;return this[t]=!0,t}}),st.ajaxPrefilter("json jsonp",function(t,r,n){var o,i,s,a=t.jsonp!==!1&&(Re.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Re.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=st.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Re,"$1"+o):t.jsonp!==!1&&(t.url+=(ve.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},t.dataTypes[0]="json",i=e[o],e[o]=function(){s=arguments},n.always(function(){void 0===i?st(e).removeProp(o):e[o]=i,t[o]&&(t.jsonpCallback=r.jsonpCallback,Ie.push(o)),s&&st.isFunction(i)&&i(s[0]),s=i=void 0}),"script"}),st.parseHTML=function(t,e,r){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(r=e,e=!1),e=e||J;var n=ft.exec(t),o=!r&&[];return n?[e.createElement(n[1])]:(n=_([t],e,o),o&&o.length&&st(o).remove(),st.merge([],n.childNodes))};var Fe=st.fn.load;st.fn.load=function(t,e,r){if("string"!=typeof t&&Fe)return Fe.apply(this,arguments);var n,o,i,s=this,a=t.indexOf(" ");return a>-1&&(n=st.trim(t.slice(a)),t=t.slice(0,a)),st.isFunction(e)?(r=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&st.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){i=arguments,s.html(n?st("<div>").append(st.parseHTML(t)).find(n):t)}).always(r&&function(t,e){s.each(function(){r.apply(this,i||[t.responseText,e,t])})}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){st.fn[e]=function(t){return this.on(e,t)}}),st.expr.filters.animated=function(t){return st.grep(st.timers,function(e){return t===e.elem}).length},st.offset={setOffset:function(t,e,r){var n,o,i,s,a,l,u,h=st.css(t,"position"),c=st(t),p={};"static"===h&&(t.style.position="relative"),a=c.offset(),i=st.css(t,"top"),l=st.css(t,"left"),u=("absolute"===h||"fixed"===h)&&(i+l).indexOf("auto")>-1,u?(n=c.position(),s=n.top,o=n.left):(s=parseFloat(i)||0,o=parseFloat(l)||0),st.isFunction(e)&&(e=e.call(t,r,st.extend({},a))),null!=e.top&&(p.top=e.top-a.top+s),null!=e.left&&(p.left=e.left-a.left+o),"using"in e?e.using.call(t,p):c.css(p)}},st.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){st.offset.setOffset(this,t,e)});var e,r,n=this[0],o={top:0,left:0},i=n&&n.ownerDocument;if(i)return e=i.documentElement,st.contains(e,n)?(o=n.getBoundingClientRect(),r=$(i),{top:o.top+r.pageYOffset-e.clientTop,left:o.left+r.pageXOffset-e.clientLeft}):o},position:function(){if(this[0]){var t,e,r=this[0],n={top:0,left:0};return"fixed"===st.css(r,"position")?e=r.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),st.nodeName(t[0],"html")||(n=t.offset()),n.top+=st.css(t[0],"borderTopWidth",!0),n.left+=st.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-st.css(r,"marginTop",!0),left:e.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===st.css(t,"position");)t=t.offsetParent;return t||Zt})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var r="pageYOffset"===e;st.fn[t]=function(n){return kt(this,function(t,n,o){var i=$(t);return void 0===o?i?i[e]:t[n]:void(i?i.scrollTo(r?i.pageXOffset:o,r?o:i.pageYOffset):t[n]=o)},t,n,arguments.length)}}),st.each(["top","left"],function(t,e){st.cssHooks[e]=z(ot.pixelPosition,function(t,r){if(r)return r=S(t,e),Jt.test(r)?st(t).position()[e]+"px":r})}),st.each({Height:"height",Width:"width"},function(t,e){st.each({padding:"inner"+t,content:e,"":"outer"+t},function(r,n){st.fn[n]=function(n,o){var i=arguments.length&&(r||"boolean"!=typeof n),s=r||(n===!0||o===!0?"margin":"border");return kt(this,function(e,r,n){var o;return st.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===n?st.css(e,r,s):st.style(e,r,n,s)},e,i?n:void 0,i,null)}})}),st.fn.extend({bind:function(t,e,r){return this.on(t,null,e,r)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,r,n){return this.on(e,t,r,n)},undelegate:function(t,e,r){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",r)},size:function(){return this.length}}),st.fn.andSelf=st.fn.addBack,"function"==typeof t&&t.amd&&t("jquery",[],function(){return st});var Be=e.jQuery,Le=e.$;return st.noConflict=function(t){return e.$===st&&(e.$=Le),t&&e.jQuery===st&&(e.jQuery=Be),st},r||(e.jQuery=e.$=st),st})},{}],jsnlog:[function(t,e,r){function n(t){if(!t)return n.__;Array.prototype.reduce||(Array.prototype.reduce=function(t,e){for(var r=e,n=0;n<this.length;n++)r=t(r,this[n],n,this);return r});var e="",r=("."+t).split(".").reduce(function(t,r,o,i){e?e+="."+r:e=r;var s=t["__"+e];return void 0===s&&(n.Logger.prototype=t,s=new n.Logger(e),t["__"+e]=s),s},n.__);return r}/*
* JSNLog 2.20.0
* Open source under the MIT License.
* Copyright 2016 Mattijs Perdeck All rights reserved.
*/
var n,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};!function(t){function e(t,e,r){if(void 0!==e[t])return null===e[t]?void delete r[t]:void(r[t]=e[t])}function r(e){if(null!=t.enabled&&!t.enabled)return!1;if(null!=t.maxMessages&&t.maxMessages<1)return!1;try{if(e.userAgentRegex&&!new RegExp(e.userAgentRegex).test(navigator.userAgent))return!1}catch(r){}try{if(e.ipRegex&&t.clientIP&&!new RegExp(e.ipRegex).test(t.clientIP))return!1}catch(r){}return!0}function n(t,e){try{if(t.disallow&&new RegExp(t.disallow).test(e))return!1}catch(r){}return!0}function i(t){return"function"==typeof t?t instanceof RegExp?t.toString():t():t}function s(t){var e,r=i(t);switch(typeof r){case"string":return new v(r,null,r);case"number":return e=r.toString(),new v(e,null,e);case"boolean":return e=r.toString(),new v(e,null,e);case"undefined":return new v("undefined",null,"undefined");case"object":return r instanceof RegExp||r instanceof String||r instanceof Number||r instanceof Boolean?(e=r.toString(),new v(e,null,e)):new v(null,r,JSON.stringify(r));default:return new v("unknown",null,"unknown")}}function a(t){return e("enabled",t,this),e("maxMessages",t,this),e("defaultAjaxUrl",t,this),e("clientIP",t,this),e("requestId",t,this),e("defaultBeforeSend",t,this),this}function l(){return-2147483648}function u(){return 1e3}function h(){return 2e3}function c(){return 3e3}function p(){return 4e3}function _(){return 5e3}function d(){return 6e3}function f(){return 2147483647}function m(t){return t<=1e3?"trace":t<=2e3?"debug":t<=3e3?"info":t<=4e3?"warn":t<=5e3?"error":"fatal"}function g(t){return new M(t)}function y(t){return new k(t)}t.requestId="";var v=function(){function t(t,e,r){this.msg=t,this.meta=e,this.finalString=r}return t}();t.setOptions=a,t.getAllLevel=l,t.getTraceLevel=u,t.getDebugLevel=h,t.getInfoLevel=c,t.getWarnLevel=p,t.getErrorLevel=_,t.getFatalLevel=d,t.getOffLevel=f;var b=function(){function t(t,e){this.inner=e,this.name="JL.Exception",this.message=s(t).finalString}return t}();t.Exception=b,b.prototype=new Error;var x=function(){function t(t,e,r,n){this.l=t,this.m=e,this.n=r,this.t=n}return t}();t.LogItem=x;var w=function(){function o(e,r){this.appenderName=e,this.sendLogItems=r,this.level=t.getTraceLevel(),this.sendWithBufferLevel=2147483647,this.storeInBufferLevel=-2147483648,this.bufferSize=0,this.batchSize=1,this.buffer=[],this.batchBuffer=[]}return o.prototype.setOptions=function(t){return e("level",t,this),e("ipRegex",t,this),e("userAgentRegex",t,this),e("disallow",t,this),e("sendWithBufferLevel",t,this),e("storeInBufferLevel",t,this),e("bufferSize",t,this),e("batchSize",t,this),this.bufferSize<this.buffer.length&&(this.buffer.length=this.bufferSize),this},o.prototype.log=function(t,e,o,i,s,a,l){var u;if(r(this)&&n(this,a)&&!(s<this.storeInBufferLevel))return u=new x(s,a,l,(new Date).getTime()),s<this.level?void(this.bufferSize>0&&(this.buffer.push(u),this.buffer.length>this.bufferSize&&this.buffer.shift())):(s<this.sendWithBufferLevel?this.batchBuffer.push(u):(this.buffer.length&&(this.batchBuffer=this.batchBuffer.concat(this.buffer),this.buffer.length=0),this.batchBuffer.push(u)),this.batchBuffer.length>=this.batchSize?void this.sendBatch():void 0)},o.prototype.sendBatch=function(){0!=this.batchBuffer.length&&(null!=t.maxMessages&&t.maxMessages<1||(null!=t.maxMessages&&(t.maxMessages-=this.batchBuffer.length),this.sendLogItems(this.batchBuffer),this.batchBuffer.length=0))},o}();t.Appender=w;var M=function(r){function n(t){r.call(this,t,n.prototype.sendLogItemsAjax)}return o(n,r),n.prototype.setOptions=function(t){return e("url",t,this),e("beforeSend",t,this),r.prototype.setOptions.call(this,t),this},n.prototype.sendLogItemsAjax=function(e){try{var r="/jsnlog.logger";null!=t.defaultAjaxUrl&&(r=t.defaultAjaxUrl),this.url&&(r=this.url);var n=this.getXhr(r),o={r:t.requestId,lg:e};"function"==typeof this.beforeSend?this.beforeSend.call(this,n,o):"function"==typeof t.defaultBeforeSend&&t.defaultBeforeSend.call(this,n,o);var i=JSON.stringify(o);n.send(i)}catch(s){}},n.prototype.getXhr=function(e){var r=new XMLHttpRequest;if(!("withCredentials"in r)&&"undefined"!=typeof XDomainRequest){var n=new XDomainRequest;return n.open("POST",e),n}return r.open("POST",e),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("JSNLog-RequestId",t.requestId),r},n}(w);t.AjaxAppender=M;var k=function(e){function r(t){e.call(this,t,r.prototype.sendLogItemsConsole)}return o(r,e),r.prototype.clog=function(t){console.log(t)},r.prototype.cerror=function(t){console.error?console.error(t):this.clog(t)},r.prototype.cwarn=function(t){console.warn?console.warn(t):this.clog(t)},r.prototype.cinfo=function(t){console.info?console.info(t):this.clog(t)},r.prototype.cdebug=function(t){console.debug?console.debug(t):this.cinfo(t)},r.prototype.sendLogItemsConsole=function(e){try{if(!console)return;var r;for(r=0;r<e.length;++r){var n=e[r],o=n.n+": "+n.m;"undefined"==typeof window&&(o=new Date(n.t)+" | "+o),n.l<=t.getDebugLevel()?this.cdebug(o):n.l<=t.getInfoLevel()?this.cinfo(o):n.l<=t.getWarnLevel()?this.cwarn(o):this.cerror(o)}}catch(i){}},r}(w);t.ConsoleAppender=k;var j=function(){function t(t){this.loggerName=t,this.seenRegexes=[]}return t.prototype.setOptions=function(t){return e("level",t,this),e("userAgentRegex",t,this),e("disallow",t,this),e("ipRegex",t,this),e("appenders",t,this),e("onceOnly",t,this),this.seenRegexes=[],this},t.prototype.buildExceptionObject=function(t){var e={};return t.stack?e.stack=t.stack:e.e=t,t.message&&(e.message=t.message),t.name&&(e.name=t.name),t.data&&(e.data=t.data),t.inner&&(e.inner=this.buildExceptionObject(t.inner)),e},t.prototype.log=function(t,e,o){var a,l,u=0;if(!this.appenders)return this;if(t>=this.level&&r(this)&&(o?(l=this.buildExceptionObject(o),l.logData=i(e)):l=e,a=s(l),n(this,a.finalString))){if(this.onceOnly)for(u=this.onceOnly.length-1;u>=0;){if(new RegExp(this.onceOnly[u]).test(a.finalString)){if(this.seenRegexes[u])return this;this.seenRegexes[u]=!0}u--}for(a.meta=a.meta||{},a.meta.loggerName=this.loggerName,u=this.appenders.length-1;u>=0;)this.appenders[u].log(m(t),a.msg,a.meta,function(){},t,a.finalString,this.loggerName),u--}return this},t.prototype.trace=function(t){return this.log(u(),t)},t.prototype.debug=function(t){return this.log(h(),t)},t.prototype.info=function(t){return this.log(c(),t)},t.prototype.warn=function(t){return this.log(p(),t)},t.prototype.error=function(t){return this.log(_(),t)},t.prototype.fatal=function(t){return this.log(d(),t)},t.prototype.fatalException=function(t,e){return this.log(d(),t,e)},t}();t.Logger=j,t.createAjaxAppender=g,t.createConsoleAppender=y;var T=new M("");"undefined"==typeof window&&(T=new k("")),t.__=new t.Logger(""),t.__.setOptions({level:t.getDebugLevel(),appenders:[T]})}(n||(n={})),"undefined"!=typeof r&&(r.JL=n);var i;"function"==typeof i&&i.amd&&i("jsnlog",[],function(){return n}),"function"==typeof __jsnlog_configure&&__jsnlog_configure(n),"undefined"==typeof window||window.onerror||(window.onerror=function(t,e,r,o,i){return n("onerrorLogger").fatalException({msg:"Uncaught Exception",errorMsg:t,url:e,"line number":r,column:o},i),!1})},{}],"mgrs/mgrs":[function(t,e,r){function n(t){return t*(Math.PI/180)}function o(t){return 180*(t/Math.PI)}function i(t){var e,r,o,i,s,l,u,h,c,p=t.lat,_=t.lon,d=6378137,f=.00669438,m=.9996,g=n(p),y=n(_);c=Math.floor((_+180)/6)+1,180===_&&(c=60),p>=56&&p<64&&_>=3&&_<12&&(c=32),p>=72&&p<84&&(_>=0&&_<9?c=31:_>=9&&_<21?c=33:_>=21&&_<33?c=35:_>=33&&_<42&&(c=37)),e=6*(c-1)-180+3,h=n(e),r=f/(1-f),o=d/Math.sqrt(1-f*Math.sin(g)*Math.sin(g)),i=Math.tan(g)*Math.tan(g),s=r*Math.cos(g)*Math.cos(g),l=Math.cos(g)*(y-h),u=d*((1-f/4-3*f*f/64-5*f*f*f/256)*g-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*g)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*g)-35*f*f*f/3072*Math.sin(6*g));var v=m*o*(l+(1-i+s)*l*l*l/6+(5-18*i+i*i+72*s-58*r)*l*l*l*l*l/120)+5e5,b=m*(u+o*Math.tan(g)*(l*l/2+(5-i+9*s+4*s*s)*l*l*l*l/24+(61-58*i+i*i+600*s-330*r)*l*l*l*l*l*l/720));return p<0&&(b+=1e7),{northing:Math.round(b),easting:Math.round(v),zoneNumber:c,zoneLetter:a(p)}}function s(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var a,l,u,h,c,p,_,d,f,m,g=.9996,y=6378137,v=.00669438,b=(1-Math.sqrt(1-v))/(1+Math.sqrt(1-v)),x=r-5e5,w=e;n<"N"&&(w-=1e7),d=6*(i-1)-180+3,a=v/(1-v),_=w/g,f=_/(y*(1-v/4-3*v*v/64-5*v*v*v/256)),m=f+(3*b/2-27*b*b*b/32)*Math.sin(2*f)+(21*b*b/16-55*b*b*b*b/32)*Math.sin(4*f)+151*b*b*b/96*Math.sin(6*f),l=y/Math.sqrt(1-v*Math.sin(m)*Math.sin(m)),u=Math.tan(m)*Math.tan(m),h=a*Math.cos(m)*Math.cos(m),c=y*(1-v)/Math.pow(1-v*Math.sin(m)*Math.sin(m),1.5),p=x/(l*g);var M=m-l*Math.tan(m)/c*(p*p/2-(5+3*u+10*h-4*h*h-9*a)*p*p*p*p/24+(61+90*u+298*h+45*u*u-252*a-3*h*h)*p*p*p*p*p*p/720);M=o(M);var k=(p-(1+2*u+h)*p*p*p/6+(5-2*h+28*u-3*h*h+8*a+24*u*u)*p*p*p*p*p/120)/Math.cos(m);k=d+o(k);var j;if(t.accuracy){var T=s({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});j={top:T.lat,right:T.lon,bottom:M,left:k}}else j={lat:M,lon:k};return j}function a(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function l(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+u(t.easting,t.northing,t.zoneNumber)+r.substr(r.length-5,e)+n.substr(n.length-5,e)}function u(t,e,r){var n=h(r),o=Math.floor(t/1e5),i=Math.floor(e/1e5)%20;return c(o,i,n)}function h(t){var e=t%m;return 0===e&&(e=m),e}function c(t,e,r){var n=r-1,o=g.charCodeAt(n),i=y.charCodeAt(n),s=o+t-1,a=i+e,l=!1;s>M&&(s=s-M+v-1,l=!0),(s===b||o<b&&s>b||(s>b||o<b)&&l)&&s++,(s===x||o<x&&s>x||(s>x||o<x)&&l)&&(s++,s===b&&s++),s>M&&(s=s-M+v-1),a>w?(a=a-w+v-1,l=!0):l=!1,(a===b||i<b&&a>b||(a>b||i<b)&&l)&&a++,(a===x||i<x&&a>x||(a>x||i<x)&&l)&&(a++,a===b&&a++),a>w&&(a=a-w+v-1);var u=String.fromCharCode(s)+String.fromCharCode(a);return u}function p(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,o="",i=0;!/[A-Z]/.test(e=t.charAt(i));){if(i>=2)throw"MGRSPoint bad conversion from: "+t;o+=e,i++}var s=parseInt(o,10);if(0===i||i+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(i++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(i,i+=2);for(var l=h(s),u=_(n.charAt(0),l),c=d(n.charAt(1),l);c<f(a);)c+=2e6;var p=r-i;if(p%2!==0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var m,g,y,v,b,x=p/2,w=0,M=0;return x>0&&(m=1e5/Math.pow(10,x),g=t.substring(i,i+x),w=parseFloat(g)*m,y=t.substring(i+x),M=parseFloat(y)*m),v=w+u,b=M+c,{easting:v,northing:b,zoneLetter:a,zoneNumber:s,accuracy:m}}function _(t,e){for(var r=g.charCodeAt(e-1),n=1e5,o=!1;r!==t.charCodeAt(0);){if(r++,r===b&&r++,r===x&&r++,r>M){if(o)throw"Bad character: "+t;r=v,o=!0}n+=1e5}return n}function d(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=y.charCodeAt(e-1),n=0,o=!1;r!==t.charCodeAt(0);){if(r++,r===b&&r++,r===x&&r++,r>w){if(o)throw"Bad character: "+t;r=v,o=!0}n+=1e5}return n}function f(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}var m=6,g="AJSAJS",y="AFAFAF",v=65,b=73,x=79,w=86,M=90;r.forward=function(t,e){return e=e||5,l(i({lat:t[1],lon:t[0]}),e)},r.inverse=function(t){var e=s(p(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},r.toPoint=function(t){var e=s(p(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}},{}],"numbro/numbro":[function(t,e,r){function n(t){this._value=t}function o(t){var e,r="";for(e=0;e<t;e++)r+="0";return r}function i(t,e){var r,n,i,s,a;return a=t.toString(),r=a.split("e")[0],s=a.split("e")[1],n=r.split(".")[0],i=r.split(".")[1]||"",a=n+i+o(s-i.length),e>0&&(a+="."+o(e)),a}function s(t,e,r,n){var o,s,a=Math.pow(10,e);return s=t.toFixed(0).search("e")>-1?i(t,e):(r(t*a)/a).toFixed(e),n&&(o=new RegExp("0{1,"+n+"}$"),s=s.replace(o,"")),s}function a(t,e,r){var n;return n=e.indexOf("$")>-1?l(t,e,r):e.indexOf("%")>-1?u(t,e,r):e.indexOf(":")>-1?h(t):c(t,e,r)}function l(t,e,r){var n,o,i=e,s=i.indexOf("$"),a=i.indexOf("("),l=i.indexOf("+"),u=i.indexOf("-"),h="",p="";if(i.indexOf("$")===-1?"infix"===y[b].currency.position?(p=y[b].currency.symbol,y[b].currency.spaceSeparated&&(p=" "+p+" ")):y[b].currency.spaceSeparated&&(h=" "):i.indexOf(" $")>-1?(h=" ",i=i.replace(" $","")):i.indexOf("$ ")>-1?(h=" ",i=i.replace("$ ","")):i=i.replace("$",""),o=c(t,i,r,p),e.indexOf("$")===-1)switch(y[b].currency.position){case"postfix":o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,h+y[b].currency.symbol),o=o.join("")):o=o+h+y[b].currency.symbol;break;case"infix":break;case"prefix":o.indexOf("(")>-1||o.indexOf("-")>-1?(o=o.split(""),n=Math.max(a,u)+1,o.splice(n,0,y[b].currency.symbol+h),o=o.join("")):o=y[b].currency.symbol+h+o;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?o.indexOf("(")>-1||o.indexOf("+")>-1||o.indexOf("-")>-1?(o=o.split(""),n=1,(s<a||s<l||s<u)&&(n=0),o.splice(n,0,y[b].currency.symbol+h),o=o.join("")):o=y[b].currency.symbol+h+o:o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,h+y[b].currency.symbol),o=o.join("")):o=o+h+y[b].currency.symbol;return o}function u(t,e,r){var n,o="";return t=100*t,e.indexOf(" %")>-1?(o=" ",e=e.replace(" %","")):e=e.replace("%",""),n=c(t,e,r),n.indexOf(")")>-1?(n=n.split(""),n.splice(-1,0,o+"%"),n=n.join("")):n=n+o+"%",n}function h(t){var e=Math.floor(t/60/60),r=Math.floor((t-60*e*60)/60),n=Math.round(t-60*e*60-60*r);return e+":"+(r<10?"0"+r:r)+":"+(n<10?"0"+n:n)}function c(t,e,r,n){var o,i,a,l,u,h,c,p,_,d,f,m,g,v,w,M,k,j,T=!1,S=!1,z=!1,P="",E=!1,A=!1,C=!1,N=!1,O=!1,q="",D="",I=Math.abs(t),R=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],F=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],B="",L=!1,G=!1,V="";if(0===t&&null!==x)return x;if(!isFinite(t))return""+t;if(0===e.indexOf("{")){var U=e.indexOf("}");if(U===-1)throw Error('Format should also contain a "}"');m=e.slice(1,U),e=e.slice(U+1)}else m="";if(e.indexOf("}")===e.length-1){var Y=e.indexOf("{");if(Y===-1)throw Error('Format should also contain a "{"');g=e.slice(Y+1,-1),e=e.slice(0,Y+1)}else g="";var H;if(H=e.indexOf(".")===-1?e.match(/([0-9]+).*/):e.match(/([0-9]+)\..*/),j=null===H?-1:H[1].length,e.indexOf("-")!==-1&&(L=!0),e.indexOf("(")>-1?(T=!0,e=e.slice(1,-1)):e.indexOf("+")>-1&&(S=!0,e=e.replace(/\+/g,"")),e.indexOf("a")>-1){if(d=e.split(".")[0].match(/[0-9]+/g)||["0"],d=parseInt(d[0],10),E=e.indexOf("aK")>=0,A=e.indexOf("aM")>=0,C=e.indexOf("aB")>=0,N=e.indexOf("aT")>=0,O=E||A||C||N,e.indexOf(" a")>-1?(P=" ",e=e.replace(" a","")):e=e.replace("a",""),u=Math.floor(Math.log(I)/Math.LN10)+1,c=u%3,c=0===c?3:c,d&&0!==I&&(h=Math.floor(Math.log(I)/Math.LN10)+1-d,p=3*~~((Math.min(d,u)-c)/3),I/=Math.pow(10,p),e.indexOf(".")===-1&&d>3))for(e+="[.]",M=0===h?0:3*~~(h/3)-h,M=M<0?M+3:M,o=0;o<M;o++)e+="0";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==d&&(I>=Math.pow(10,12)&&!O||N?(P+=y[b].abbreviations.trillion,t/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!O||C?(P+=y[b].abbreviations.billion,t/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!O||A?(P+=y[b].abbreviations.million,t/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!O||E)&&(P+=y[b].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf("b")>-1)for(e.indexOf(" b")>-1?(q=" ",e=e.replace(" b","")):e=e.replace("b",""),l=0;l<=R.length;l++)if(i=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=i&&t<a){q+=R[l],i>0&&(t/=i);break}if(e.indexOf("d")>-1)for(e.indexOf(" d")>-1?(q=" ",e=e.replace(" d","")):e=e.replace("d",""),l=0;l<=F.length;l++)if(i=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=i&&t<a){q+=F[l],i>0&&(t/=i);break}if(e.indexOf("o")>-1&&(e.indexOf(" o")>-1?(D=" ",e=e.replace(" o","")):e=e.replace("o",""),y[b].ordinal&&(D+=y[b].ordinal(t))),e.indexOf("[.]")>-1&&(z=!0,e=e.replace("[.]",".")),_=t.toString().split(".")[0],f=e.split(".")[1],v=e.indexOf(","),f){if(f.indexOf("*")!==-1?B=s(t,t.toString().split(".")[1].length,r):f.indexOf("[")>-1?(f=f.replace("]",""),f=f.split("["),B=s(t,f[0].length+f[1].length,r,f[1].length)):B=s(t,f.length,r),_=B.split(".")[0],B.split(".")[1].length){var X=n?P+n:y[b].delimiters.decimal;B=X+B.split(".")[1]}else B="";z&&0===Number(B.slice(1))&&(B="")}else _=s(t,null,r);return _.indexOf("-")>-1&&(_=_.slice(1),G=!0),_.length<j&&(_=new Array(j-_.length+1).join("0")+_),v>-1&&(_=_.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+y[b].delimiters.thousands)),0===e.indexOf(".")&&(_=""),w=e.indexOf("("),k=e.indexOf("-"),V=w<k?(T&&G?"(":"")+(L&&G||!T&&G?"-":""):(L&&G||!T&&G?"-":"")+(T&&G?"(":""),m+V+(!G&&S&&0!==t?"+":"")+_+B+(D?D:"")+(P&&!n?P:"")+(q?q:"")+(T&&G?")":"")+g}function p(t,e){y[t]=e}function _(t){b=t;var e=y[t].defaults;e&&e.format&&f.defaultFormat(e.format),e&&e.currencyFormat&&f.defaultCurrencyFormat(e.currencyFormat)}function d(t,e,r,n){return m.isString(r)&&r!==f.culture()&&f.setCulture(r),a(Number(t),m.isString(e)?e:w,m.isUndefined(n)?Math.round:n)}/*!
* numbro.js
* version : 1.6.2
* author : Företagsplatsen AB
* license : MIT
* http://www.foretagsplatsen.se
*/
var f,m=t("underscore"),g="1.6.2",y={},v=y,b="en-US",x=null,w="0,0",M="0$",k=("undefined"!=typeof e&&e.exports,{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){var e=t%10;return 1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}});f=function(t){return f.isNumbro(t)?t=t.value():0===t||"undefined"==typeof t?t=0:Number(t)||(t=f.fn.unformat(t)),new n(Number(t))},f.version=g,f.isNumbro=function(t){return t instanceof n},f.setLanguage=function(t,e){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var r=t,n=t.split("-")[0],o=null;v[r]||(Object.keys(v).forEach(function(t){o||t.split("-")[0]!==n||(o=t)}),r=o||e||"en-US"),_(r)},f.setCulture=function(t,e){var r=t,n=t.split("-")[1],o=null;y[r]||(n&&Object.keys(y).forEach(function(t){o||t.split("-")[1]!==n||(o=t)}),r=o||e||"en-US"),_(r)},f.language=function(t,e){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!t)return b;if(t&&!e){if(!v[t])throw new Error("Unknown language : "+t);_(t)}return!e&&v[t]||p(t,e),f},f.culture=function(t,e){if(!t)return b;if(t&&!e){if(!y[t])throw new Error("Unknown culture : "+t);_(t)}return!e&&y[t]||p(t,e),f},f.languageData=function(t){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!t)return v[b];if(!v[t])throw new Error("Unknown language : "+t);return v[t]},f.cultureData=function(t){if(!t)return y[b];if(!y[t])throw new Error("Unknown culture : "+t);return y[t]},f.culture("en-US",k),f.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),v},f.cultures=function(){return y},f.zeroFormat=function(t){x="string"==typeof t?t:null},f.defaultFormat=function(t){w="string"==typeof t?t:"0.0"},f.defaultCurrencyFormat=function(t){M="string"==typeof t?t:"0$"},f.validate=function(t,e){var r,n,o,i,s,a,l,u;if("string"!=typeof t&&(t+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",t)),t=t.trim(),t.match(/^\d+$/))return!0;if(""===t)return!1;try{l=f.cultureData(e)}catch(h){l=f.cultureData(f.culture())}return o=l.currency.symbol,s=l.abbreviations,r=l.delimiters.decimal,n="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=t.match(/^[^\d]+/),(null===u||(t=t.substr(1),u[0]===o))&&(u=t.match(/[^\d]+$/),(null===u||(t=t.slice(0,-1),u[0]===s.thousand||u[0]===s.million||u[0]===s.billion||u[0]===s.trillion))&&(a=new RegExp(n+"{2}"),!t.match(/[^\d.,]/g)&&(i=t.split(r),!(i.length>2)&&(i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/)))))},e.exports={format:d}},{underscore:"underscore"}],_process:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function s(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){m&&d&&(m=!1,d.length?f=d.concat(f):g=-1,f.length&&l())}function l(){if(!m){var t=i(a);m=!0;for(var e=f.length;e;){for(d=f,f=[];++g<e;)d&&d[g].run();g=-1,e=f.length}d=null,m=!1,s(t)}}function u(t,e){this.fun=t,this.array=e}function h(){}var c,p,_=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var d,f=[],m=!1,g=-1;_.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new u(t,e)),1!==f.length||m||i(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},_.title="browser",_.browser=!0,_.env={},_.argv=[],_.version="",_.versions={},_.on=h,_.addListener=h,_.once=h,_.off=h,_.removeListener=h,_.removeAllListeners=h,_.emit=h,_.binding=function(t){throw new Error("process.binding is not supported")},_.cwd=function(){return"/"},_.chdir=function(t){throw new Error("process.chdir is not supported")},_.umask=function(){return 0}},{}],"proj4/lib/Point":[function(t,e,r){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&"undefined"==typeof e){var o=t.split(",");this.x=parseFloat(o[0],10),this.y=parseFloat(o[1],10),this.z=parseFloat(o[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}var o=t("mgrs");n.fromMGRS=function(t){return new n(o.toPoint(t))},n.prototype.toMGRS=function(t){return o.forward([this.x,this.y],t)},e.exports=n},{mgrs:"mgrs/mgrs"}],"proj4/lib/Proj":[function(t,e,r){function n(t,e){if(!(this instanceof n))return new n(t);e=e||function(t){if(t)throw t};var r=o(t);if("object"!=typeof r)return void e(t);var s=a(r),l=n.projections.get(s.projName);l?(i(this,s),i(this,l),this.init(),e(null,this)):e(t)}var o=t("./parseCode"),i=t("./extend"),s=t("./projections"),a=t("./deriveConstants");n.projections=s,n.projections.start(),e.exports=n},{"./deriveConstants":"proj4/lib/deriveConstants","./extend":"proj4/lib/extend","./parseCode":"proj4/lib/parseCode","./projections":"proj4/lib/projections"}],"proj4/lib/adjust_axis":[function(t,e,r){e.exports=function(t,e,r){var n,o,i,s=r.x,a=r.y,l=r.z||0;for(i=0;i<3;i++)if(!e||2!==i||void 0!==r.z)switch(0===i?(n=s,o="x"):1===i?(n=a,o="y"):(n=l,o="z"),t.axis[i]){case"e":r[o]=n;break;case"w":r[o]=-n;break;case"n":r[o]=n;break;case"s":r[o]=-n;break;case"u":void 0!==r[o]&&(r.z=n);break;case"d":void 0!==r[o]&&(r.z=-n);break;default:return null}return r}},{}],"proj4/lib/common/adjust_lat":[function(t,e,r){var n=Math.PI/2,o=t("./sign");e.exports=function(t){return Math.abs(t)<n?t:t-o(t)*Math.PI}},{"./sign":"proj4/lib/common/sign"}],"proj4/lib/common/adjust_lon":[function(t,e,r){var n=2*Math.PI,o=3.14159265359,i=t("./sign");e.exports=function(t){return Math.abs(t)<=o?t:t-i(t)*n}},{"./sign":"proj4/lib/common/sign"}],"proj4/lib/common/asinz":[function(t,e,r){e.exports=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}},{}],"proj4/lib/common/e0fn":[function(t,e,r){e.exports=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))}},{}],"proj4/lib/common/e1fn":[function(t,e,r){e.exports=function(t){return.375*t*(1+.25*t*(1+.46875*t))}},{}],"proj4/lib/common/e2fn":[function(t,e,r){e.exports=function(t){return.05859375*t*t*(1+.75*t)}},{}],"proj4/lib/common/e3fn":[function(t,e,r){e.exports=function(t){return t*t*t*(35/3072)}},{}],"proj4/lib/common/gN":[function(t,e,r){e.exports=function(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}},{}],"proj4/lib/common/imlfn":[function(t,e,r){e.exports=function(t,e,r,n,o){var i,s;i=t/e;for(var a=0;a<15;a++)if(s=(t-(e*i-r*Math.sin(2*i)+n*Math.sin(4*i)-o*Math.sin(6*i)))/(e-2*r*Math.cos(2*i)+4*n*Math.cos(4*i)-6*o*Math.cos(6*i)),i+=s,Math.abs(s)<=1e-10)return i;return NaN}},{}],"proj4/lib/common/iqsfnz":[function(t,e,r){var n=Math.PI/2;e.exports=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*n:n;for(var o,i,s,a,l=Math.asin(.5*e),u=0;u<30;u++)if(i=Math.sin(l),s=Math.cos(l),a=t*i,o=Math.pow(1-a*a,2)/(2*s)*(e/(1-t*t)-i/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),l+=o,Math.abs(o)<=1e-10)return l;return NaN}},{}],"proj4/lib/common/mlfn":[function(t,e,r){e.exports=function(t,e,r,n,o){return t*o-e*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)}},{}],"proj4/lib/common/msfnz":[function(t,e,r){e.exports=function(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}},{}],"proj4/lib/common/phi2z":[function(t,e,r){var n=Math.PI/2;e.exports=function(t,e){for(var r,o,i=.5*t,s=n-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(s),o=n-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-s,s+=o,Math.abs(o)<=1e-10)return s;return-9999}},{}],"proj4/lib/common/pj_enfn":[function(t,e,r){var n=1,o=.25,i=.046875,s=.01953125,a=.01068115234375,l=.75,u=.46875,h=.013020833333333334,c=.007120768229166667,p=.3645833333333333,_=.005696614583333333,d=.3076171875;e.exports=function(t){var e=[];e[0]=n-t*(o+t*(i+t*(s+t*a))),e[1]=t*(l-t*(i+t*(s+t*a)));var r=t*t;return e[2]=r*(u-t*(h+t*c)),r*=t,e[3]=r*(p-t*_),e[4]=r*t*d,e}},{}],"proj4/lib/common/pj_inv_mlfn":[function(t,e,r){var n=t("./pj_mlfn"),o=1e-10,i=20;e.exports=function(t,e,r){for(var s=1/(1-e),a=t,l=i;l;--l){var u=Math.sin(a),h=1-e*u*u;if(h=(n(a,u,Math.cos(a),r)-t)*(h*Math.sqrt(h))*s,a-=h,Math.abs(h)<o)return a}return a}},{"./pj_mlfn":"proj4/lib/common/pj_mlfn"}],"proj4/lib/common/pj_mlfn":[function(t,e,r){e.exports=function(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}},{}],"proj4/lib/common/qsfnz":[function(t,e,r){e.exports=function(t,e){var r;return t>1e-7?(r=t*e,(1-t*t)*(e/(1-r*r)-.5/t*Math.log((1-r)/(1+r)))):2*e}},{}],"proj4/lib/common/sign":[function(t,e,r){e.exports=function(t){return t<0?-1:1}},{}],"proj4/lib/common/srat":[function(t,e,r){e.exports=function(t,e){return Math.pow((1-t)/(1+t),e)}},{}],"proj4/lib/common/toPoint":[function(t,e,r){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},{}],"proj4/lib/common/tsfnz":[function(t,e,r){var n=Math.PI/2;e.exports=function(t,e,r){var o=t*r,i=.5*t;return o=Math.pow((1-o)/(1+o),i),Math.tan(.5*(n-e))/o}},{}],"proj4/lib/constants/Datum":[function(t,e,r){r.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},r.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},r.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},r.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},r.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},r.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},r.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},r.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},r.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},r.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},r.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},r.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},r.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},r.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},r.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},r.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},{}],"proj4/lib/constants/Ellipsoid":[function(t,e,r){r.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},r.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},r.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},r.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},r.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},r.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},r.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},r.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},r.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},r.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},r.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},r.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},r.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},r.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},r.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},r.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},r.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},r.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},r.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},r.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},r.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},r.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},r.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},r.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},r.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},r.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},r.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},r.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},r.hough={a:6378270,rf:297,ellipseName:"Hough"},r.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},r.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},r.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},r.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},r.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},r.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},r.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},r.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},r.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},r.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},r.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},r.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},r.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},r.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},{}],"proj4/lib/constants/PrimeMeridian":[function(t,e,r){r.greenwich=0,r.lisbon=-9.131906111111,r.paris=2.337229166667,r.bogota=-74.080916666667,r.madrid=-3.687938888889,r.rome=12.452333333333,r.bern=7.439583333333,r.jakarta=106.807719444444,r.ferro=-17.666666666667,r.brussels=4.367975,r.stockholm=18.058277777778,r.athens=23.7163375,r.oslo=10.722916666667},{}],"proj4/lib/constants/units":[function(t,e,r){r.ft={to_meter:.3048},r["us-ft"]={to_meter:1200/3937}},{}],"proj4/lib/core":[function(t,e,r){function n(t,e,r){var n;return Array.isArray(r)?(n=a(t,e,r),3===r.length?[n.x,n.y,n.z]:[n.x,n.y]):a(t,e,r)}function o(t){return t instanceof s?t:t.oProj?t.oProj:s(t)}function i(t,e,r){t=o(t);var i,s=!1;return"undefined"==typeof e?(e=t,t=l,s=!0):("undefined"!=typeof e.x||Array.isArray(e))&&(r=e,e=t,t=l,s=!0),e=o(e),r?n(t,e,r):(i={forward:function(r){return n(t,e,r)},inverse:function(r){return n(e,t,r)}},s&&(i.oProj=e),i)}var s=t("./Proj"),a=t("./transform"),l=s("WGS84");e.exports=i},{"./Proj":"proj4/lib/Proj","./transform":"proj4/lib/transform"}],"proj4/lib/datum":[function(t,e,r){var n=Math.PI/2,o=1,i=2,s=3,a=4,l=5,u=484813681109536e-20,h=1.0026,c=.3826834323650898,p=function(t){return this instanceof p?(this.datum_type=a,void(t&&(t.datumCode&&"none"===t.datumCode&&(this.datum_type=l),t.datum_params&&(this.datum_params=t.datum_params.map(parseFloat),0===this.datum_params[0]&&0===this.datum_params[1]&&0===this.datum_params[2]||(this.datum_type=o),this.datum_params.length>3&&(0===this.datum_params[3]&&0===this.datum_params[4]&&0===this.datum_params[5]&&0===this.datum_params[6]||(this.datum_type=i,this.datum_params[3]*=u,this.datum_params[4]*=u,this.datum_params[5]*=u,this.datum_params[6]=this.datum_params[6]/1e6+1))),this.datum_type=t.grids?s:this.datum_type,this.a=t.a,this.b=t.b,this.es=t.es,this.ep2=t.ep2,this.datum_type===s&&(this.grids=t.grids)))):new p(t)};p.prototype={compare_datums:function(t){return this.datum_type===t.datum_type&&(!(this.a!==t.a||Math.abs(this.es-t.es)>5e-11)&&(this.datum_type===o?this.datum_params[0]===t.datum_params[0]&&this.datum_params[1]===t.datum_params[1]&&this.datum_params[2]===t.datum_params[2]:this.datum_type===i?this.datum_params[0]===t.datum_params[0]&&this.datum_params[1]===t.datum_params[1]&&this.datum_params[2]===t.datum_params[2]&&this.datum_params[3]===t.datum_params[3]&&this.datum_params[4]===t.datum_params[4]&&this.datum_params[5]===t.datum_params[5]&&this.datum_params[6]===t.datum_params[6]:this.datum_type!==s&&t.datum_type!==s||this.nadgrids===t.nadgrids))},geodetic_to_geocentric:function(t){var e,r,o,i,s,a,l,u=t.x,h=t.y,c=t.z?t.z:0,p=0;if(h<-n&&h>-1.001*n)h=-n;else if(h>n&&h<1.001*n)h=n;else if(h<-n||h>n)return null;return u>Math.PI&&(u-=2*Math.PI),s=Math.sin(h),l=Math.cos(h),a=s*s,i=this.a/Math.sqrt(1-this.es*a),e=(i+c)*l*Math.cos(u),r=(i+c)*l*Math.sin(u),o=(i*(1-this.es)+c)*s,t.x=e,t.y=r,t.z=o,p},geocentric_to_geodetic:function(t){var e,r,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v=1e-12,b=v*v,x=30,w=t.x,M=t.y,k=t.z?t.z:0;if(d=!1,e=Math.sqrt(w*w+M*M),r=Math.sqrt(w*w+M*M+k*k),e/this.a<v){if(d=!0,m=0,r/this.a<v)return g=n,void(y=-this.b)}else m=Math.atan2(M,w);o=k/r,i=e/r,s=1/Math.sqrt(1-this.es*(2-this.es)*i*i),u=i*(1-this.es)*s,h=o*s,f=0;do f++,l=this.a/Math.sqrt(1-this.es*h*h),y=e*u+k*h-l*(1-this.es*h*h),a=this.es*l/(l+y),s=1/Math.sqrt(1-a*(2-a)*i*i),c=i*(1-a)*s,p=o*s,_=p*u-c*h,u=c,h=p;while(_*_>b&&f<x);return g=Math.atan(p/Math.abs(c)),t.x=m,t.y=g,t.z=y,t},geocentric_to_geodetic_noniter:function(t){var e,r,o,i,s,a,l,u,p,_,d,f,m,g,y,v,b,x=t.x,w=t.y,M=t.z?t.z:0;if(x=parseFloat(x),w=parseFloat(w),M=parseFloat(M),b=!1,0!==x)e=Math.atan2(w,x);else if(w>0)e=n;else if(w<0)e=-n;else if(b=!0,e=0,M>0)r=n;else{if(!(M<0))return r=n,void(o=-this.b);r=-n}return s=x*x+w*w,i=Math.sqrt(s),a=M*h,u=Math.sqrt(a*a+s),_=a/u,f=i/u,d=_*_*_,l=M+this.b*this.ep2*d,v=i-this.a*this.es*f*f*f,p=Math.sqrt(l*l+v*v),m=l/p,g=v/p,y=this.a/Math.sqrt(1-this.es*m*m),o=g>=c?i/g-y:g<=-c?i/-g-y:M/m+y*(this.es-1),b===!1&&(r=Math.atan(m/g)),t.x=e,t.y=r,t.z=o,t},geocentric_to_wgs84:function(t){if(this.datum_type===o)t.x+=this.datum_params[0],t.y+=this.datum_params[1],t.z+=this.datum_params[2];else if(this.datum_type===i){var e=this.datum_params[0],r=this.datum_params[1],n=this.datum_params[2],s=this.datum_params[3],a=this.datum_params[4],l=this.datum_params[5],u=this.datum_params[6],h=u*(t.x-l*t.y+a*t.z)+e,c=u*(l*t.x+t.y-s*t.z)+r,p=u*(-a*t.x+s*t.y+t.z)+n;t.x=h,t.y=c,t.z=p}},geocentric_from_wgs84:function(t){if(this.datum_type===o)t.x-=this.datum_params[0],t.y-=this.datum_params[1],t.z-=this.datum_params[2];else if(this.datum_type===i){var e=this.datum_params[0],r=this.datum_params[1],n=this.datum_params[2],s=this.datum_params[3],a=this.datum_params[4],l=this.datum_params[5],u=this.datum_params[6],h=(t.x-e)/u,c=(t.y-r)/u,p=(t.z-n)/u;t.x=h+l*c-a*p,t.y=-l*h+c+s*p,t.z=a*h-s*c+p}}},e.exports=p},{}],"proj4/lib/datum_transform":[function(t,e,r){var n=1,o=2,i=3,s=5,a=6378137,l=.006694379990141316;e.exports=function(t,e,r){function u(t){return t===n||t===o}var h,c,p;if(t.compare_datums(e))return r;if(t.datum_type===s||e.datum_type===s)return r;var _=t.a,d=t.es,f=e.a,m=e.es,g=t.datum_type;if(g===i)if(0===this.apply_gridshift(t,0,r))t.a=a,t.es=l;else{if(!t.datum_params)return t.a=_,t.es=t.es,r;for(h=1,c=0,p=t.datum_params.length;c<p;c++)h*=t.datum_params[c];if(0===h)return t.a=_,t.es=t.es,r;g=t.datum_params.length>3?o:n}return e.datum_type===i&&(e.a=a,e.es=l),(t.es!==e.es||t.a!==e.a||u(g)||u(e.datum_type))&&(t.geodetic_to_geocentric(r),u(t.datum_type)&&t.geocentric_to_wgs84(r),u(e.datum_type)&&e.geocentric_from_wgs84(r),e.geocentric_to_geodetic(r)),e.datum_type===i&&this.apply_gridshift(e,1,r),t.a=_,t.es=d,e.a=f,e.es=m,r}},{}],"proj4/lib/defs":[function(t,e,r){function n(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?n[t]=i(arguments[1]):n[t]=s(arguments[1]):n[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?n.apply(e,t):n(t)});if("string"==typeof t){if(t in n)return n[t]}else"EPSG"in t?n["EPSG:"+t.EPSG]=t:"ESRI"in t?n["ESRI:"+t.ESRI]=t:"IAU2000"in t?n["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var o=t("./global"),i=t("./projString"),s=t("./wkt");o(n),e.exports=n},{"./global":"proj4/lib/global","./projString":"proj4/lib/projString","./wkt":"proj4/lib/wkt"}],"proj4/lib/deriveConstants":[function(t,e,r){var n=t("./constants/Datum"),o=t("./constants/Ellipsoid"),i=t("./extend"),s=t("./datum"),a=1e-10,l=.16666666666666666,u=.04722222222222222,h=.022156084656084655;e.exports=function(t){if(t.datumCode&&"none"!==t.datumCode){var e=n[t.datumCode];e&&(t.datum_params=e.towgs84?e.towgs84.split(","):null,t.ellps=e.ellipse,t.datumName=e.datumName?e.datumName:t.datumCode)}if(!t.a){var r=o[t.ellps]?o[t.ellps]:o.WGS84;i(t,r)}return t.rf&&!t.b&&(t.b=(1-1/t.rf)*t.a),(0===t.rf||Math.abs(t.a-t.b)<a)&&(t.sphere=!0,t.b=t.a),t.a2=t.a*t.a,t.b2=t.b*t.b,t.es=(t.a2-t.b2)/t.a2,t.e=Math.sqrt(t.es),t.R_A&&(t.a*=1-t.es*(l+t.es*(u+t.es*h)),t.a2=t.a*t.a,t.b2=t.b*t.b,t.es=0),t.ep2=(t.a2-t.b2)/t.b2,t.k0||(t.k0=1),t.axis||(t.axis="enu"),t.datum||(t.datum=s(t)),t}},{"./constants/Datum":"proj4/lib/constants/Datum","./constants/Ellipsoid":"proj4/lib/constants/Ellipsoid","./datum":"proj4/lib/datum","./extend":"proj4/lib/extend"}],"proj4/lib/extend":[function(t,e,r){e.exports=function(t,e){t=t||{};var r,n;if(!e)return t;for(n in e)r=e[n],void 0!==r&&(t[n]=r);return t}},{}],"proj4/lib/global":[function(t,e,r){e.exports=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}},{}],"proj4/lib/includedProjections":[function(t,e,r){var n=[t("./projections/tmerc"),t("./projections/utm"),t("./projections/sterea"),t("./projections/stere"),t("./projections/somerc"),t("./projections/omerc"),t("./projections/lcc"),t("./projections/krovak"),t("./projections/cass"),t("./projections/laea"),t("./projections/aea"),t("./projections/gnom"),t("./projections/cea"),t("./projections/eqc"),t("./projections/poly"),t("./projections/nzmg"),t("./projections/mill"),t("./projections/sinu"),t("./projections/moll"),t("./projections/eqdc"),t("./projections/vandg"),t("./projections/aeqd")];e.exports=function(t){n.forEach(function(e){t.Proj.projections.add(e)})}},{"./projections/aea":"proj4/lib/projections/aea","./projections/aeqd":"proj4/lib/projections/aeqd","./projections/cass":"proj4/lib/projections/cass","./projections/cea":"proj4/lib/projections/cea","./projections/eqc":"proj4/lib/projections/eqc","./projections/eqdc":"proj4/lib/projections/eqdc","./projections/gnom":"proj4/lib/projections/gnom","./projections/krovak":"proj4/lib/projections/krovak","./projections/laea":"proj4/lib/projections/laea","./projections/lcc":"proj4/lib/projections/lcc","./projections/mill":"proj4/lib/projections/mill","./projections/moll":"proj4/lib/projections/moll","./projections/nzmg":"proj4/lib/projections/nzmg","./projections/omerc":"proj4/lib/projections/omerc","./projections/poly":"proj4/lib/projections/poly","./projections/sinu":"proj4/lib/projections/sinu","./projections/somerc":"proj4/lib/projections/somerc","./projections/stere":"proj4/lib/projections/stere","./projections/sterea":"proj4/lib/projections/sterea","./projections/tmerc":"proj4/lib/projections/tmerc","./projections/utm":"proj4/lib/projections/utm","./projections/vandg":"proj4/lib/projections/vandg"}],proj4:[function(t,e,r){var n=t("./core");n.defaultDatum="WGS84",n.Proj=t("./Proj"),n.WGS84=new n.Proj("WGS84"),n.Point=t("./Point"),n.toPoint=t("./common/toPoint"),n.defs=t("./defs"),n.transform=t("./transform"),n.mgrs=t("mgrs"),n.version=t("../package.json").version,t("./includedProjections")(n),e.exports=n},{"../package.json":"proj4/package.json","./Point":"proj4/lib/Point","./Proj":"proj4/lib/Proj","./common/toPoint":"proj4/lib/common/toPoint","./core":"proj4/lib/core","./defs":"proj4/lib/defs","./includedProjections":"proj4/lib/includedProjections","./transform":"proj4/lib/transform",mgrs:"mgrs/mgrs"}],"proj4/lib/parseCode":[function(t,e,r){function n(t){return"string"==typeof t}function o(t){return t in l}function i(t){var e=["GEOGCS","GEOCCS","PROJCS","LOCAL_CS"];return e.reduce(function(e,r){return e+1+t.indexOf(r)},0)}function s(t){return"+"===t[0]}function a(t){return n(t)?o(t)?l[t]:i(t)?u(t):s(t)?h(t):void 0:t}var l=t("./defs"),u=t("./wkt"),h=t("./projString");e.exports=a},{"./defs":"proj4/lib/defs","./projString":"proj4/lib/projString","./wkt":"proj4/lib/wkt"}],"proj4/lib/projString":[function(t,e,r){var n=.017453292519943295,o=t("./constants/PrimeMeridian"),i=t("./constants/units");e.exports=function(t){var e={},r={};t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).forEach(function(t){var e=t.split("=");e.push(!0),r[e[0].toLowerCase()]=e[1]});var s,a,l,u={proj:"projName",datum:"datumCode",rf:function(t){e.rf=parseFloat(t)},lat_0:function(t){e.lat0=t*n},lat_1:function(t){e.lat1=t*n},lat_2:function(t){e.lat2=t*n},lat_ts:function(t){e.lat_ts=t*n},lon_0:function(t){e.long0=t*n},lon_1:function(t){e.long1=t*n},lon_2:function(t){e.long2=t*n},alpha:function(t){e.alpha=parseFloat(t)*n},lonc:function(t){e.longc=t*n},x_0:function(t){e.x0=parseFloat(t)},y_0:function(t){e.y0=parseFloat(t)},k_0:function(t){e.k0=parseFloat(t)},k:function(t){e.k0=parseFloat(t)},a:function(t){e.a=parseFloat(t)},b:function(t){e.b=parseFloat(t)},r_a:function(){e.R_A=!0},zone:function(t){e.zone=parseInt(t,10)},south:function(){e.utmSouth=!0},towgs84:function(t){e.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){e.to_meter=parseFloat(t)},units:function(t){e.units=t,i[t]&&(e.to_meter=i[t].to_meter)},from_greenwich:function(t){e.from_greenwich=t*n},pm:function(t){e.from_greenwich=(o[t]?o[t]:parseFloat(t))*n},nadgrids:function(t){"@null"===t?e.datumCode="none":e.nadgrids=t},axis:function(t){var r="ewnsud";3===t.length&&r.indexOf(t.substr(0,1))!==-1&&r.indexOf(t.substr(1,1))!==-1&&r.indexOf(t.substr(2,1))!==-1&&(e.axis=t)}};for(s in r)a=r[s],s in u?(l=u[s],"function"==typeof l?l(a):e[l]=a):e[s]=a;return"string"==typeof e.datumCode&&"WGS84"!==e.datumCode&&(e.datumCode=e.datumCode.toLowerCase()),e}},{"./constants/PrimeMeridian":"proj4/lib/constants/PrimeMeridian","./constants/units":"proj4/lib/constants/units"}],"proj4/lib/projections":[function(t,e,r){function n(t,e){var r=s.length;return t.names?(s[r]=t,t.names.forEach(function(t){i[t.toLowerCase()]=r}),this):(console.log(e),!0)}var o=[t("./projections/merc"),t("./projections/longlat")],i={},s=[];r.add=n,r.get=function(t){if(!t)return!1;var e=t.toLowerCase();return"undefined"!=typeof i[e]&&s[i[e]]?s[i[e]]:void 0},r.start=function(){o.forEach(n)}},{"./projections/longlat":"proj4/lib/projections/longlat","./projections/merc":"proj4/lib/projections/merc"}],"proj4/lib/projections/aea":[function(t,e,r){var n=1e-10,o=t("../common/msfnz"),i=t("../common/qsfnz"),s=t("../common/adjust_lon"),a=t("../common/asinz");r.init=function(){Math.abs(this.lat1+this.lat2)<n||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=o(this.e3,this.sin_po,this.cos_po),this.qs1=i(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=o(this.e3,this.sin_po,this.cos_po),this.qs2=i(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=i(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>n?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},r.forward=function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=i(this.e3,this.sin_phi,this.cos_phi),o=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,a=this.ns0*s(e-this.long0),l=o*Math.sin(a)+this.x0,u=this.rh-o*Math.cos(a)+this.y0;return t.x=l,t.y=u,t},r.inverse=function(t){var e,r,n,o,i,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),o=0,0!==e&&(o=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),i=s(o/this.ns0+this.long0),t.x=i,t.y=a,t},r.phi1z=function(t,e){var r,o,i,s,l,u=a(.5*e);if(t<n)return u;for(var h=t*t,c=1;c<=25;c++)if(r=Math.sin(u),o=Math.cos(u),i=t*r,s=1-i*i,l=.5*s*s/o*(e/(1-h)-r/s+.5/t*Math.log((1-i)/(1+i))),u+=l,Math.abs(l)<=1e-7)return u;return null},r.names=["Albers_Conic_Equal_Area","Albers","aea"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz","../common/msfnz":"proj4/lib/common/msfnz","../common/qsfnz":"proj4/lib/common/qsfnz"}],"proj4/lib/projections/aeqd":[function(t,e,r){var n=t("../common/adjust_lon"),o=Math.PI/2,i=1e-10,s=t("../common/mlfn"),a=t("../common/e0fn"),l=t("../common/e1fn"),u=t("../common/e2fn"),h=t("../common/e3fn"),c=t("../common/gN"),p=t("../common/asinz"),_=t("../common/imlfn");r.init=function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},r.forward=function(t){var e,r,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N=t.x,O=t.y,q=Math.sin(t.y),D=Math.cos(t.y),I=n(N-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=i?(t.x=this.x0+this.a*(o-O)*Math.sin(I),t.y=this.y0-this.a*(o-O)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=i?(t.x=this.x0+this.a*(o+O)*Math.sin(I),t.y=this.y0+this.a*(o+O)*Math.cos(I),t):(S=this.sin_p12*q+this.cos_p12*D*Math.cos(I),j=Math.acos(S),T=j/Math.sin(j),t.x=this.x0+this.a*T*D*Math.sin(I),t.y=this.y0+this.a*T*(this.cos_p12*q-this.sin_p12*D*Math.cos(I)),t):(e=a(this.es),r=l(this.es),p=u(this.es),_=h(this.es),Math.abs(this.sin_p12-1)<=i?(d=this.a*s(e,r,p,_,o),f=this.a*s(e,r,p,_,O),t.x=this.x0+(d-f)*Math.sin(I),t.y=this.y0-(d-f)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=i?(d=this.a*s(e,r,p,_,o),f=this.a*s(e,r,p,_,O),t.x=this.x0+(d+f)*Math.sin(I),t.y=this.y0+(d+f)*Math.cos(I),t):(m=q/D,g=c(this.a,this.e,this.sin_p12),y=c(this.a,this.e,q),v=Math.atan((1-this.es)*m+this.es*g*this.sin_p12/(y*D)),b=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(v)-this.sin_p12*Math.cos(I)),z=0===b?Math.asin(this.cos_p12*Math.sin(v)-this.sin_p12*Math.cos(v)):Math.abs(Math.abs(b)-Math.PI)<=i?-Math.asin(this.cos_p12*Math.sin(v)-this.sin_p12*Math.cos(v)):Math.asin(Math.sin(I)*Math.cos(v)/Math.sin(b)),x=this.e*this.sin_p12/Math.sqrt(1-this.es),w=this.e*this.cos_p12*Math.cos(b)/Math.sqrt(1-this.es),M=x*w,k=w*w,P=z*z,E=P*z,A=E*z,C=A*z,j=g*z*(1-P*k*(1-k)/6+E/8*M*(1-2*k)+A/120*(k*(4-7*k)-3*x*x*(1-7*k))-C/48*M),t.x=this.x0+j*Math.sin(b),t.y=this.y0+j*Math.cos(b),t))},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O;if(this.sphere){if(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*o*this.a)return;return r=e/this.a,d=Math.sin(r),f=Math.cos(r),m=this.long0,Math.abs(e)<=i?g=this.lat0:(g=p(f*this.sin_p12+t.y*d*this.cos_p12/e),y=Math.abs(this.lat0)-o,m=n(Math.abs(y)<=i?this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*d,e*this.cos_p12*f-t.y*this.sin_p12*d))),t.x=m,t.y=g,t}return v=a(this.es),
b=l(this.es),x=u(this.es),w=h(this.es),Math.abs(this.sin_p12-1)<=i?(M=this.a*s(v,b,x,w,o),e=Math.sqrt(t.x*t.x+t.y*t.y),k=M-e,g=_(k/this.a,v,b,x,w),m=n(this.long0+Math.atan2(t.x,-1*t.y)),t.x=m,t.y=g,t):Math.abs(this.sin_p12+1)<=i?(M=this.a*s(v,b,x,w,o),e=Math.sqrt(t.x*t.x+t.y*t.y),k=e-M,g=_(k/this.a,v,b,x,w),m=n(this.long0+Math.atan2(t.x,t.y)),t.x=m,t.y=g,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),S=Math.atan2(t.x,t.y),j=c(this.a,this.e,this.sin_p12),z=Math.cos(S),P=this.e*this.cos_p12*z,E=-P*P/(1-this.es),A=3*this.es*(1-E)*this.sin_p12*this.cos_p12*z/(1-this.es),C=e/j,N=C-E*(1+E)*Math.pow(C,3)/6-A*(1+3*E)*Math.pow(C,4)/24,O=1-E*N*N/2-C*N*N*N/6,T=Math.asin(this.sin_p12*Math.cos(N)+this.cos_p12*Math.sin(N)*z),m=n(this.long0+Math.asin(Math.sin(S)*Math.sin(N)/Math.cos(T))),g=Math.atan((1-this.es*O*this.sin_p12/Math.sin(T))*Math.tan(T)/(1-this.es)),t.x=m,t.y=g,t)},r.names=["Azimuthal_Equidistant","aeqd"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/gN":"proj4/lib/common/gN","../common/imlfn":"proj4/lib/common/imlfn","../common/mlfn":"proj4/lib/common/mlfn"}],"proj4/lib/projections/cass":[function(t,e,r){var n=t("../common/mlfn"),o=t("../common/e0fn"),i=t("../common/e1fn"),s=t("../common/e2fn"),a=t("../common/e3fn"),l=t("../common/gN"),u=t("../common/adjust_lon"),h=t("../common/adjust_lat"),c=t("../common/imlfn"),p=Math.PI/2,_=1e-10;r.init=function(){this.sphere||(this.e0=o(this.es),this.e1=i(this.es),this.e2=s(this.es),this.e3=a(this.es),this.ml0=this.a*n(this.e0,this.e1,this.e2,this.e3,this.lat0))},r.forward=function(t){var e,r,o=t.x,i=t.y;if(o=u(o-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(o)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(o))-this.lat0);else{var s=Math.sin(i),a=Math.cos(i),h=l(this.a,this.e,s),c=Math.tan(i)*Math.tan(i),p=o*Math.cos(i),_=p*p,d=this.es*a*a/(1-this.es),f=this.a*n(this.e0,this.e1,this.e2,this.e3,i);e=h*p*(1-_*c*(1/6-(8-c+8*d)*_/120)),r=f-this.ml0+h*s/a*_*(.5+(5-c+6*d)*_/24)}return t.x=e+this.x0,t.y=r+this.y0,t},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n=t.x/this.a,o=t.y/this.a;if(this.sphere){var i=o+this.lat0;e=Math.asin(Math.sin(i)*Math.cos(n)),r=Math.atan2(Math.tan(n),Math.cos(i))}else{var s=this.ml0/this.a+o,a=c(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-p)<=_)return t.x=this.long0,t.y=p,o<0&&(t.y*=-1),t;var d=l(this.a,this.e,Math.sin(a)),f=d*d*d/this.a/this.a*(1-this.es),m=Math.pow(Math.tan(a),2),g=n*this.a/d,y=g*g;e=a-d*Math.tan(a)/f*g*g*(.5-(1+3*m)*g*g/24),r=g*(1-y*(m/3+(1+3*m)*m*y/15))/Math.cos(a)}return t.x=u(r+this.long0),t.y=h(e),t},r.names=["Cassini","Cassini_Soldner","cass"]},{"../common/adjust_lat":"proj4/lib/common/adjust_lat","../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/gN":"proj4/lib/common/gN","../common/imlfn":"proj4/lib/common/imlfn","../common/mlfn":"proj4/lib/common/mlfn"}],"proj4/lib/projections/cea":[function(t,e,r){var n=t("../common/adjust_lon"),o=t("../common/qsfnz"),i=t("../common/msfnz"),s=t("../common/iqsfnz");r.init=function(){this.sphere||(this.k0=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},r.forward=function(t){var e,r,i=t.x,s=t.y,a=n(i-this.long0);if(this.sphere)e=this.x0+this.a*a*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var l=o(this.e,Math.sin(s));e=this.x0+this.a*this.k0*a,r=this.y0+this.a*l*.5/this.k0}return t.x=e,t.y=r,t},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r;return this.sphere?(e=n(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=s(this.e,2*t.y*this.k0/this.a),e=n(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},r.names=["cea"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/iqsfnz":"proj4/lib/common/iqsfnz","../common/msfnz":"proj4/lib/common/msfnz","../common/qsfnz":"proj4/lib/common/qsfnz"}],"proj4/lib/projections/eqc":[function(t,e,r){var n=t("../common/adjust_lon"),o=t("../common/adjust_lat");r.init=function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},r.forward=function(t){var e=t.x,r=t.y,i=n(e-this.long0),s=o(r-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*s,t},r.inverse=function(t){var e=t.x,r=t.y;return t.x=n(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=o(this.lat0+(r-this.y0)/this.a),t},r.names=["Equirectangular","Equidistant_Cylindrical","eqc"]},{"../common/adjust_lat":"proj4/lib/common/adjust_lat","../common/adjust_lon":"proj4/lib/common/adjust_lon"}],"proj4/lib/projections/eqdc":[function(t,e,r){var n=t("../common/e0fn"),o=t("../common/e1fn"),i=t("../common/e2fn"),s=t("../common/e3fn"),a=t("../common/msfnz"),l=t("../common/mlfn"),u=t("../common/adjust_lon"),h=t("../common/adjust_lat"),c=t("../common/imlfn"),p=1e-10;r.init=function(){Math.abs(this.lat1+this.lat2)<p||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=n(this.es),this.e1=o(this.es),this.e2=i(this.es),this.e3=s(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=a(this.e,this.sinphi,this.cosphi),this.ml1=l(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<p?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=a(this.e,this.sinphi,this.cosphi),this.ml2=l(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=l(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},r.forward=function(t){var e,r=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var o=l(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-o)}var i=this.ns*u(r-this.long0),s=this.x0+e*Math.sin(i),a=this.y0+this.rh-e*Math.cos(i);return t.x=s,t.y=a,t},r.inverse=function(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,r,n,o;this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var i=0;if(0!==r&&(i=Math.atan2(e*t.x,e*t.y)),this.sphere)return o=u(this.long0+i/this.ns),n=h(this.g-r/this.a),t.x=o,t.y=n,t;var s=this.g-r/this.a;return n=c(s,this.e0,this.e1,this.e2,this.e3),o=u(this.long0+i/this.ns),t.x=o,t.y=n,t},r.names=["Equidistant_Conic","eqdc"]},{"../common/adjust_lat":"proj4/lib/common/adjust_lat","../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/imlfn":"proj4/lib/common/imlfn","../common/mlfn":"proj4/lib/common/mlfn","../common/msfnz":"proj4/lib/common/msfnz"}],"proj4/lib/projections/gauss":[function(t,e,r){var n=Math.PI/4,o=t("../common/srat"),i=Math.PI/2,s=20;r.init=function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+n)/(Math.pow(Math.tan(.5*this.lat0+n),this.C)*o(this.e*t,this.ratexp))},r.forward=function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+n),this.C)*o(this.e*Math.sin(r),this.ratexp))-i,t.x=this.C*e,t},r.inverse=function(t){for(var e=1e-14,r=t.x/this.C,a=t.y,l=Math.pow(Math.tan(.5*a+n)/this.K,1/this.C),u=s;u>0&&(a=2*Math.atan(l*o(this.e*Math.sin(t.y),-.5*this.e))-i,!(Math.abs(a-t.y)<e));--u)t.y=a;return u?(t.x=r,t.y=a,t):null},r.names=["gauss"]},{"../common/srat":"proj4/lib/common/srat"}],"proj4/lib/projections/gnom":[function(t,e,r){var n=t("../common/adjust_lon"),o=1e-10,i=t("../common/asinz");r.init=function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},r.forward=function(t){var e,r,i,s,a,l,u,h,c=t.x,p=t.y;return i=n(c-this.long0),e=Math.sin(p),r=Math.cos(p),s=Math.cos(i),l=this.sin_p14*e+this.cos_p14*r*s,a=1,l>0||Math.abs(l)<=o?(u=this.x0+this.a*a*r*Math.sin(i)/l,h=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*r*s)/l):(u=this.x0+this.infinity_dist*r*Math.sin(i),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*s)),t.x=u,t.y=h,t},r.inverse=function(t){var e,r,o,s,a,l;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(s=Math.atan2(e,this.rc),r=Math.sin(s),o=Math.cos(s),l=i(o*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.atan2(t.x*r,e*this.cos_p14*o-t.y*this.sin_p14*r),a=n(this.long0+a)):(l=this.phic0,a=0),t.x=a,t.y=l,t},r.names=["gnom"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz"}],"proj4/lib/projections/krovak":[function(t,e,r){var n=t("../common/adjust_lon");r.init=function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},r.forward=function(t){var e,r,o,i,s,a,l,u=t.x,h=t.y,c=n(u-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),o=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(o)),s=Math.asin(Math.cos(r)*Math.sin(o)/Math.cos(i)),a=this.n*s,l=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=l*Math.cos(a)/1,t.x=l*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},r.inverse=function(t){var e,r,n,o,i,s,a,l,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x),o=i/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(o)),r=Math.asin(Math.cos(n)*Math.sin(o)/Math.cos(e)),t.x=this.long0-r/this.alfa,a=e,l=0;var h=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(l=1),a=t.y,h+=1;while(0===l&&h<15);return h>=15?null:t},r.names=["Krovak","krovak"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon"}],"proj4/lib/projections/laea":[function(t,e,r){var n=Math.PI/2,o=Math.PI/4,i=1e-10,s=t("../common/qsfnz"),a=t("../common/adjust_lon");r.S_POLE=1,r.N_POLE=2,r.EQUIT=3,r.OBLIQ=4,r.init=function(){var t=Math.abs(this.lat0);if(Math.abs(t-n)<i?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<i?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=s(this.e,1),this.mmf=.5/(1-this.es),this.apa=this.authset(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=s(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},r.forward=function(t){var e,r,l,u,h,c,p,_,d,f,m=t.x,g=t.y;if(m=a(m-this.long0),this.sphere){if(h=Math.sin(g),f=Math.cos(g),l=Math.cos(m),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+f*l:1+this.sinph0*h+this.cosph0*f*l,r<=i)return null;r=Math.sqrt(2/r),e=r*f*Math.sin(m),r*=this.mode===this.EQUIT?h:this.cosph0*h-this.sinph0*f*l}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(l=-l),Math.abs(g+this.phi0)<i)return null;r=o-.5*g,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),e=r*Math.sin(m),r*=l}}else{switch(p=0,_=0,d=0,l=Math.cos(m),u=Math.sin(m),h=Math.sin(g),c=s(this.e,h),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(p=c/this.qp,_=Math.sqrt(1-p*p)),this.mode){case this.OBLIQ:d=1+this.sinb1*p+this.cosb1*_*l;break;case this.EQUIT:d=1+_*l;break;case this.N_POLE:d=n+g,c=this.qp-c;break;case this.S_POLE:d=g-n,c=this.qp+c}if(Math.abs(d)<i)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:d=Math.sqrt(2/d),r=this.mode===this.OBLIQ?this.ymf*d*(this.cosb1*p-this.sinb1*_*l):(d=Math.sqrt(2/(1+_*l)))*p*this.ymf,e=this.xmf*d*_*u;break;case this.N_POLE:case this.S_POLE:c>=0?(e=(d=Math.sqrt(c))*u,r=l*(this.mode===this.S_POLE?d:-d)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r,o,s,l,u,h,c=t.x/this.a,p=t.y/this.a;if(this.sphere){var _,d=0,f=0;if(_=Math.sqrt(c*c+p*p),r=.5*_,r>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(f=Math.sin(r),d=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(_)<=i?0:Math.asin(p*f/_),c*=f,p=d*_;break;case this.OBLIQ:r=Math.abs(_)<=i?this.phi0:Math.asin(d*this.sinph0+p*f*this.cosph0/_),c*=f*this.cosph0,p=(d-Math.sin(r)*this.sinph0)*_;break;case this.N_POLE:p=-p,r=n-r;break;case this.S_POLE:r-=n}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,p):0}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,p*=this.dd,u=Math.sqrt(c*c+p*p),u<i)return t.x=0,t.y=this.phi0,t;s=2*Math.asin(.5*u/this.rq),o=Math.cos(s),c*=s=Math.sin(s),this.mode===this.OBLIQ?(h=o*this.sinb1+p*s*this.cosb1/u,l=this.qp*h,p=u*this.cosb1*o-p*this.sinb1*s):(h=p*s/u,l=this.qp*h,p=u*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),l=c*c+p*p,!l)return t.x=0,t.y=this.phi0,t;h=1-l/this.qp,this.mode===this.S_POLE&&(h=-h)}e=Math.atan2(c,p),r=this.authlat(Math.asin(h),this.apa)}return t.x=a(this.long0+e),t.y=r,t},r.P00=.3333333333333333,r.P01=.17222222222222222,r.P02=.10257936507936508,r.P10=.06388888888888888,r.P11=.0664021164021164,r.P20=.016415012942191543,r.authset=function(t){var e,r=[];return r[0]=t*this.P00,e=t*t,r[0]+=e*this.P01,r[1]=e*this.P10,e*=t,r[0]+=e*this.P02,r[1]+=e*this.P11,r[2]=e*this.P20,r},r.authlat=function(t,e){var r=t+t;return t+e[0]*Math.sin(r)+e[1]*Math.sin(r+r)+e[2]*Math.sin(r+r+r)},r.names=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/qsfnz":"proj4/lib/common/qsfnz"}],"proj4/lib/projections/lcc":[function(t,e,r){var n=1e-10,o=t("../common/msfnz"),i=t("../common/tsfnz"),s=Math.PI/2,a=t("../common/sign"),l=t("../common/adjust_lon"),u=t("../common/phi2z");r.init=function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<n)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),s=o(this.e,e,r),a=i(this.e,this.lat1,e),l=Math.sin(this.lat2),u=Math.cos(this.lat2),h=o(this.e,l,u),c=i(this.e,this.lat2,l),p=i(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>n?this.ns=Math.log(s/h)/Math.log(a/c):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(p,this.ns),this.title||(this.title="Lambert Conformal Conic")}},r.forward=function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=n&&(r=a(r)*(s-2*n));var o,u,h=Math.abs(Math.abs(r)-s);if(h>n)o=i(this.e,r,Math.sin(r)),u=this.a*this.f0*Math.pow(o,this.ns);else{if(h=r*this.ns,h<=0)return null;u=0}var c=this.ns*l(e-this.long0);return t.x=this.k0*(u*Math.sin(c))+this.x0,t.y=this.k0*(this.rh-u*Math.cos(c))+this.y0,t},r.inverse=function(t){var e,r,n,o,i,a=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+h*h),r=1):(e=-Math.sqrt(a*a+h*h),r=-1);var c=0;if(0!==e&&(c=Math.atan2(r*a,r*h)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),o=u(this.e,n),o===-9999)return null}else o=-s;return i=l(c/this.ns+this.long0),t.x=i,t.y=o,t},r.names=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/msfnz":"proj4/lib/common/msfnz","../common/phi2z":"proj4/lib/common/phi2z","../common/sign":"proj4/lib/common/sign","../common/tsfnz":"proj4/lib/common/tsfnz"}],"proj4/lib/projections/longlat":[function(t,e,r){function n(t){return t}r.init=function(){},r.forward=n,r.inverse=n,r.names=["longlat","identity"]},{}],"proj4/lib/projections/merc":[function(t,e,r){var n=t("../common/msfnz"),o=Math.PI/2,i=1e-10,s=57.29577951308232,a=t("../common/adjust_lon"),l=Math.PI/4,u=t("../common/tsfnz"),h=t("../common/phi2z");r.init=function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=n(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},r.forward=function(t){var e=t.x,r=t.y;if(r*s>90&&r*s<-90&&e*s>180&&e*s<-180)return null;var n,h;if(Math.abs(Math.abs(r)-o)<=i)return null;if(this.sphere)n=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(l+.5*r));else{var c=Math.sin(r),p=u(this.e,r,c);n=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0-this.a*this.k0*Math.log(p)}return t.x=n,t.y=h,t},r.inverse=function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=o-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(r=h(this.e,s),r===-9999)return null}return e=a(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},r.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/msfnz":"proj4/lib/common/msfnz","../common/phi2z":"proj4/lib/common/phi2z","../common/tsfnz":"proj4/lib/common/tsfnz"}],"proj4/lib/projections/mill":[function(t,e,r){var n=t("../common/adjust_lon");r.init=function(){},r.forward=function(t){var e=t.x,r=t.y,o=n(e-this.long0),i=this.x0+this.a*o,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return t.x=i,t.y=s,t},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e=n(this.long0+t.x/this.a),r=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=r,t},r.names=["Miller_Cylindrical","mill"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon"}],"proj4/lib/projections/moll":[function(t,e,r){var n=t("../common/adjust_lon"),o=1e-10;r.init=function(){},r.forward=function(t){for(var e=t.x,r=t.y,i=n(e-this.long0),s=r,a=Math.PI*Math.sin(r),l=0;!0;l++){var u=-(s+Math.sin(s)-a)/(1+Math.cos(s));if(s+=u,Math.abs(u)<o)break}s/=2,Math.PI/2-Math.abs(r)<o&&(i=0);var h=.900316316158*this.a*i*Math.cos(s)+this.x0,c=1.4142135623731*this.a*Math.sin(s)+this.y0;return t.x=h,t.y=c,t},r.inverse=function(t){var e,r;t.x-=this.x0,t.y-=this.y0,r=t.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),e=Math.asin(r);var o=n(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));o<-Math.PI&&(o=-Math.PI),o>Math.PI&&(o=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=o,t.y=i,t},r.names=["Mollweide","moll"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon"}],"proj4/lib/projections/nzmg":[function(t,e,r){var n=484813681109536e-20;r.iterations=1,r.init=function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},r.forward=function(t){var e,r=t.x,o=t.y,i=o-this.lat0,s=r-this.long0,a=i/n*1e-5,l=s,u=1,h=0;for(e=1;e<=10;e++)u*=a,h+=this.A[e]*u;var c,p,_=h,d=l,f=1,m=0,g=0,y=0;for(e=1;e<=6;e++)c=f*_-m*d,p=m*_+f*d,f=c,m=p,g=g+this.B_re[e]*f-this.B_im[e]*m,y=y+this.B_im[e]*f+this.B_re[e]*m;return t.x=y*this.a+this.x0,t.y=g*this.a+this.y0,t},r.inverse=function(t){var e,r,o,i=t.x,s=t.y,a=i-this.x0,l=s-this.y0,u=l/this.a,h=a/this.a,c=1,p=0,_=0,d=0;for(e=1;e<=6;e++)r=c*u-p*h,o=p*u+c*h,c=r,p=o,_=_+this.C_re[e]*c-this.C_im[e]*p,d=d+this.C_im[e]*c+this.C_re[e]*p;for(var f=0;f<this.iterations;f++){var m,g,y=_,v=d,b=u,x=h;for(e=2;e<=6;e++)m=y*_-v*d,g=v*_+y*d,y=m,v=g,b+=(e-1)*(this.B_re[e]*y-this.B_im[e]*v),x+=(e-1)*(this.B_im[e]*y+this.B_re[e]*v);y=1,v=0;var w=this.B_re[1],M=this.B_im[1];for(e=2;e<=6;e++)m=y*_-v*d,g=v*_+y*d,y=m,v=g,w+=e*(this.B_re[e]*y-this.B_im[e]*v),M+=e*(this.B_im[e]*y+this.B_re[e]*v);var k=w*w+M*M;_=(b*w+x*M)/k,d=(x*w-b*M)/k}var j=_,T=d,S=1,z=0;for(e=1;e<=9;e++)S*=j,z+=this.D[e]*S;var P=this.lat0+z*n*1e5,E=this.long0+T;return t.x=E,t.y=P,t},r.names=["New_Zealand_Map_Grid","nzmg"]},{}],"proj4/lib/projections/omerc":[function(t,e,r){var n=t("../common/tsfnz"),o=t("../common/adjust_lon"),i=t("../common/phi2z"),s=Math.PI/2,a=Math.PI/4,l=1e-10;r.init=function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),r=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-r*r);var i=n(this.e,this.lat0,t),s=this.bl/e*Math.sqrt((1-this.es)/(1-r*r));s*s<1&&(s=1);var a,l;if(isNaN(this.longc)){var u=n(this.e,this.lat1,Math.sin(this.lat1)),h=n(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(s+Math.sqrt(s*s-1))*Math.pow(i,this.bl):this.el=(s-Math.sqrt(s*s-1))*Math.pow(i,this.bl);var c=Math.pow(u,this.bl),p=Math.pow(h,this.bl);a=this.el/c,l=.5*(a-1/a);var _=(this.el*this.el-p*c)/(this.el*this.el+p*c),d=(p-c)/(p+c),f=o(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(_*Math.tan(.5*this.bl*f)/d)/this.bl,this.long0=o(this.long0);var m=o(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*m)/l),this.alpha=Math.asin(s*Math.sin(this.gamma0))}else a=this.lat0>=0?s+Math.sqrt(s*s-1):s-Math.sqrt(s*s-1),this.el=a*Math.pow(i,this.bl),l=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/s),this.long0=this.longc-Math.asin(l*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(s*s-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(s*s-1),Math.cos(this.alpha))},r.forward=function(t){var e,r,i,u=t.x,h=t.y,c=o(u-this.long0);if(Math.abs(Math.abs(h)-s)<=l)i=h>0?-1:1,r=this.al/this.bl*Math.log(Math.tan(a+i*this.gamma0*.5)),e=-1*i*s*this.al/this.bl;else{var p=n(this.e,h,Math.sin(h)),_=this.el/Math.pow(p,this.bl),d=.5*(_-1/_),f=.5*(_+1/_),m=Math.sin(this.bl*c),g=(d*Math.sin(this.gamma0)-m*Math.cos(this.gamma0))/f;r=Math.abs(Math.abs(g)-1)<=l?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-g)/(1+g))/this.bl,e=Math.abs(Math.cos(this.bl*c))<=l?this.al*this.bl*c:this.al*Math.atan2(d*Math.cos(this.gamma0)+m*Math.sin(this.gamma0),Math.cos(this.bl*c))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+r):(e-=this.uc,t.x=this.x0+r*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-r*Math.sin(this.alpha)),t},r.inverse=function(t){var e,r;this.no_rot?(r=t.y-this.y0,e=t.x-this.x0):(r=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var n=Math.exp(-1*this.bl*r/this.al),a=.5*(n-1/n),u=.5*(n+1/n),h=Math.sin(this.bl*e/this.al),c=(h*Math.cos(this.gamma0)+a*Math.sin(this.gamma0))/u,p=Math.pow(this.el/Math.sqrt((1+c)/(1-c)),1/this.bl);return Math.abs(c-1)<l?(t.x=this.long0,t.y=s):Math.abs(c+1)<l?(t.x=this.long0,t.y=-1*s):(t.y=i(this.e,p),t.x=o(this.long0-Math.atan2(a*Math.cos(this.gamma0)-h*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t},r.names=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/phi2z":"proj4/lib/common/phi2z","../common/tsfnz":"proj4/lib/common/tsfnz"}],"proj4/lib/projections/poly":[function(t,e,r){var n=t("../common/e0fn"),o=t("../common/e1fn"),i=t("../common/e2fn"),s=t("../common/e3fn"),a=t("../common/adjust_lon"),l=t("../common/adjust_lat"),u=t("../common/mlfn"),h=1e-10,c=t("../common/gN"),p=20;r.init=function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=n(this.es),this.e1=o(this.es),this.e2=i(this.es),this.e3=s(this.es),this.ml0=this.a*u(this.e0,this.e1,this.e2,this.e3,this.lat0)},r.forward=function(t){var e,r,n,o=t.x,i=t.y,s=a(o-this.long0);if(n=s*Math.sin(i),this.sphere)Math.abs(i)<=h?(e=this.a*s,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(i),r=this.a*(l(i-this.lat0)+(1-Math.cos(n))/Math.tan(i)));else if(Math.abs(i)<=h)e=this.a*s,r=-1*this.ml0;else{var p=c(this.a,this.e,Math.sin(i))/Math.tan(i);e=p*Math.sin(n),r=this.a*u(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+p*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},r.inverse=function(t){var e,r,n,o,i,s,l,c,_;if(n=t.x-this.x0,o=t.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=h)e=a(n/this.a+this.long0),r=0;else{s=this.lat0+o/this.a,l=n*n/this.a/this.a+s*s,c=s;var d;for(i=p;i;--i)if(d=Math.tan(c),_=-1*(s*(c*d+1)-c-.5*(c*c+l)*d)/((c-s)/d-1),c+=_,Math.abs(_)<=h){r=c;break}e=a(this.long0+Math.asin(n*Math.tan(c)/this.a)/Math.sin(r))}else if(Math.abs(o+this.ml0)<=h)r=0,e=a(this.long0+n/this.a);else{s=(this.ml0+o)/this.a,l=n*n/this.a/this.a+s*s,c=s;var f,m,g,y,v;for(i=p;i;--i)if(v=this.e*Math.sin(c),f=Math.sqrt(1-v*v)*Math.tan(c),m=this.a*u(this.e0,this.e1,this.e2,this.e3,c),g=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),y=m/this.a,_=(s*(f*y+1)-y-.5*f*(y*y+l))/(this.es*Math.sin(2*c)*(y*y+l-2*s*y)/(4*f)+(s-y)*(f*g-2/Math.sin(2*c))-g),c-=_,Math.abs(_)<=h){r=c;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=a(this.long0+Math.asin(n*f/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},r.names=["Polyconic","poly"]},{"../common/adjust_lat":"proj4/lib/common/adjust_lat","../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/gN":"proj4/lib/common/gN","../common/mlfn":"proj4/lib/common/mlfn"}],"proj4/lib/projections/sinu":[function(t,e,r){var n=t("../common/adjust_lon"),o=t("../common/adjust_lat"),i=t("../common/pj_enfn"),s=20,a=t("../common/pj_mlfn"),l=t("../common/pj_inv_mlfn"),u=Math.PI/2,h=1e-10,c=t("../common/asinz");r.init=function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=i(this.es)},r.forward=function(t){var e,r,o=t.x,i=t.y;if(o=n(o-this.long0),this.sphere){if(this.m)for(var l=this.n*Math.sin(i),u=s;u;--u){var c=(this.m*i+Math.sin(i)-l)/(this.m+Math.cos(i));if(i-=c,Math.abs(c)<h)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;e=this.a*this.C_x*o*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var p=Math.sin(i),_=Math.cos(i);r=this.a*a(i,p,_,this.en),e=this.a*o*_/Math.sqrt(1-this.es*p*p)}return t.x=e,t.y=r,t},r.inverse=function(t){var e,r,i,s;return t.x-=this.x0,i=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,i/=this.C_x*(this.m+Math.cos(e)),this.m?e=c((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=c(Math.sin(e)/this.n)),i=n(i+this.long0),e=o(e)):(e=l(t.y/this.a,this.es,this.en),s=Math.abs(e),s<u?(s=Math.sin(e),r=this.long0+t.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),i=n(r)):s-h<u&&(i=this.long0)),t.x=i,t.y=e,t},r.names=["Sinusoidal","sinu"]},{"../common/adjust_lat":"proj4/lib/common/adjust_lat","../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz","../common/pj_enfn":"proj4/lib/common/pj_enfn","../common/pj_inv_mlfn":"proj4/lib/common/pj_inv_mlfn","../common/pj_mlfn":"proj4/lib/common/pj_mlfn"}],"proj4/lib/projections/somerc":[function(t,e,r){r.init=function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=this.rf,o=1/n,i=2*o-Math.pow(o,2),s=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+s*e)/(1-s*e));this.K=a-this.alpha*l+this.alpha*s/2*u},r.forward=function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,o=2*(Math.atan(Math.exp(n))-Math.PI/4),i=this.alpha*(t.x-this.lambda0),s=Math.atan(Math.sin(i)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(i))),a=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(i));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*s+this.x0,t},r.inverse=function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,o=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),i=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(n)),s=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(o))),a=this.lambda0+s/this.alpha,l=0,u=i,h=-1e3,c=0;Math.abs(u-h)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+i/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),h=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=u,t},r.names=["somerc"]},{}],"proj4/lib/projections/stere":[function(t,e,r){var n=Math.PI/2,o=1e-10,i=t("../common/sign"),s=t("../common/msfnz"),a=t("../common/tsfnz"),l=t("../common/phi2z"),u=t("../common/adjust_lon");r.ssfn_=function(t,e,r){return e*=r,Math.tan(.5*(n+t))*Math.pow((1-e)/(1+e),.5*r)},r.init=function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=o&&(this.k0=.5*(1+i(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=o&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=o&&(this.k0=.5*this.cons*s(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/a(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),
this.ms1=s(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},r.forward=function(t){var e,r,i,s,l,h,c=t.x,p=t.y,_=Math.sin(p),d=Math.cos(p),f=u(c-this.long0);return Math.abs(Math.abs(c-this.long0)-Math.PI)<=o&&Math.abs(p+this.lat0)<=o?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*_+this.coslat0*d*Math.cos(f)),t.x=this.a*e*d*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*_-this.sinlat0*d*Math.cos(f))+this.y0,t):(r=2*Math.atan(this.ssfn_(p,_,this.e))-n,s=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=o?(l=a(this.e,p*this.con,this.con*_),h=2*this.a*this.k0*l/this.cons,t.x=this.x0+h*Math.sin(c-this.long0),t.y=this.y0-this.con*h*Math.cos(c-this.long0),t):(Math.abs(this.sinlat0)<o?(e=2*this.a*this.k0/(1+s*Math.cos(f)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*s*Math.cos(f))),t.y=e*(this.cosX0*i-this.sinX0*s*Math.cos(f))+this.y0),t.x=e*s*Math.sin(f)+this.x0,t))},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,s,a,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var c=2*Math.atan(h/(.5*this.a*this.k0));return e=this.long0,r=this.lat0,h<=o?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(c)*this.sinlat0+t.y*Math.sin(c)*this.coslat0/h),e=u(Math.abs(this.coslat0)<o?this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(c),h*this.coslat0*Math.cos(c)-t.y*this.sinlat0*Math.sin(c))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=o){if(h<=o)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,i=h*this.cons/(2*this.a*this.k0),r=this.con*l(this.e,i),e=this.con*u(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else s=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=o?a=this.X0:(a=Math.asin(Math.cos(s)*this.sinX0+t.y*Math.sin(s)*this.cosX0/h),e=u(this.long0+Math.atan2(t.x*Math.sin(s),h*this.cosX0*Math.cos(s)-t.y*this.sinX0*Math.sin(s)))),r=-1*l(this.e,Math.tan(.5*(n+a)));return t.x=e,t.y=r,t},r.names=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/msfnz":"proj4/lib/common/msfnz","../common/phi2z":"proj4/lib/common/phi2z","../common/sign":"proj4/lib/common/sign","../common/tsfnz":"proj4/lib/common/tsfnz"}],"proj4/lib/projections/sterea":[function(t,e,r){var n=t("./gauss"),o=t("../common/adjust_lon");r.init=function(){n.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},r.forward=function(t){var e,r,i,s;return t.x=o(t.x-this.long0),n.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i),t.x=s*r*Math.sin(t.x),t.y=s*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},r.inverse=function(t){var e,r,i,s,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var l=2*Math.atan2(a,this.R2);e=Math.sin(l),r=Math.cos(l),s=Math.asin(r*this.sinc0+t.y*e*this.cosc0/a),i=Math.atan2(t.x*e,a*this.cosc0*r-t.y*this.sinc0*e)}else s=this.phic0,i=0;return t.x=i,t.y=s,n.inverse.apply(this,[t]),t.x=o(t.x+this.long0),t},r.names=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","./gauss":"proj4/lib/projections/gauss"}],"proj4/lib/projections/tmerc":[function(t,e,r){var n=t("../common/e0fn"),o=t("../common/e1fn"),i=t("../common/e2fn"),s=t("../common/e3fn"),a=t("../common/mlfn"),l=t("../common/adjust_lon"),u=Math.PI/2,h=1e-10,c=t("../common/sign"),p=t("../common/asinz");r.init=function(){this.e0=n(this.es),this.e1=o(this.es),this.e2=i(this.es),this.e3=s(this.es),this.ml0=this.a*a(this.e0,this.e1,this.e2,this.e3,this.lat0)},r.forward=function(t){var e,r,n,o=t.x,i=t.y,s=l(o-this.long0),u=Math.sin(i),h=Math.cos(i);if(this.sphere){var c=h*Math.sin(s);if(Math.abs(Math.abs(c)-1)<1e-10)return 93;r=.5*this.a*this.k0*Math.log((1+c)/(1-c)),e=Math.acos(h*Math.cos(s)/Math.sqrt(1-c*c)),i<0&&(e=-e),n=this.a*this.k0*(e-this.lat0)}else{var p=h*s,_=Math.pow(p,2),d=this.ep2*Math.pow(h,2),f=Math.tan(i),m=Math.pow(f,2);e=1-this.es*Math.pow(u,2);var g=this.a/Math.sqrt(e),y=this.a*a(this.e0,this.e1,this.e2,this.e3,i);r=this.k0*g*p*(1+_/6*(1-m+d+_/20*(5-18*m+Math.pow(m,2)+72*d-58*this.ep2)))+this.x0,n=this.k0*(y-this.ml0+g*f*(_*(.5+_/24*(5-m+9*d+4*Math.pow(d,2)+_/30*(61-58*m+Math.pow(m,2)+600*d-330*this.ep2)))))+this.y0}return t.x=r,t.y=n,t},r.inverse=function(t){var e,r,n,o,i,s,a=6;if(this.sphere){var _=Math.exp(t.x/(this.a*this.k0)),d=.5*(_-1/_),f=this.lat0+t.y/(this.a*this.k0),m=Math.cos(f);e=Math.sqrt((1-m*m)/(1+d*d)),i=p(e),f<0&&(i=-i),s=0===d&&0===m?this.long0:l(Math.atan2(d,m)+this.long0)}else{var g=t.x-this.x0,y=t.y-this.y0;for(e=(this.ml0+y/this.k0)/this.a,r=e,o=0;!0&&(n=(e+this.e1*Math.sin(2*r)-this.e2*Math.sin(4*r)+this.e3*Math.sin(6*r))/this.e0-r,r+=n,!(Math.abs(n)<=h));o++)if(o>=a)return 95;if(Math.abs(r)<u){var v=Math.sin(r),b=Math.cos(r),x=Math.tan(r),w=this.ep2*Math.pow(b,2),M=Math.pow(w,2),k=Math.pow(x,2),j=Math.pow(k,2);e=1-this.es*Math.pow(v,2);var T=this.a/Math.sqrt(e),S=T*(1-this.es)/e,z=g/(T*this.k0),P=Math.pow(z,2);i=r-T*x*P/S*(.5-P/24*(5+3*k+10*w-4*M-9*this.ep2-P/30*(61+90*k+298*w+45*j-252*this.ep2-3*M))),s=l(this.long0+z*(1-P/6*(1+2*k+w-P/20*(5-2*w+28*k-3*M+8*this.ep2+24*j)))/b)}else i=u*c(y),s=this.long0}return t.x=s,t.y=i,t},r.names=["Transverse_Mercator","Transverse Mercator","tmerc"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/mlfn":"proj4/lib/common/mlfn","../common/sign":"proj4/lib/common/sign"}],"proj4/lib/projections/utm":[function(t,e,r){var n=.017453292519943295,o=t("./tmerc");r.dependsOn="tmerc",r.init=function(){this.zone&&(this.lat0=0,this.long0=(6*Math.abs(this.zone)-183)*n,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,o.init.apply(this),this.forward=o.forward,this.inverse=o.inverse)},r.names=["Universal Transverse Mercator System","utm"]},{"./tmerc":"proj4/lib/projections/tmerc"}],"proj4/lib/projections/vandg":[function(t,e,r){var n=t("../common/adjust_lon"),o=Math.PI/2,i=1e-10,s=t("../common/asinz");r.init=function(){this.R=this.a},r.forward=function(t){var e,r,a=t.x,l=t.y,u=n(a-this.long0);Math.abs(l)<=i&&(e=this.x0+this.R*u,r=this.y0);var h=s(2*Math.abs(l/Math.PI));(Math.abs(u)<=i||Math.abs(Math.abs(l)-o)<=i)&&(e=this.x0,r=l>=0?this.y0+Math.PI*this.R*Math.tan(.5*h):this.y0+Math.PI*this.R*-Math.tan(.5*h));var c=.5*Math.abs(Math.PI/u-u/Math.PI),p=c*c,_=Math.sin(h),d=Math.cos(h),f=d/(_+d-1),m=f*f,g=f*(2/_-1),y=g*g,v=Math.PI*this.R*(c*(f-y)+Math.sqrt(p*(f-y)*(f-y)-(y+p)*(m-y)))/(y+p);u<0&&(v=-v),e=this.x0+v;var b=p+f;return v=Math.PI*this.R*(g*b-c*Math.sqrt((y+p)*(p+1)-b*b))/(y+p),r=l>=0?this.y0+v:this.y0-v,t.x=e,t.y=r,t},r.inverse=function(t){var e,r,o,s,a,l,u,h,c,p,_,d,f;return t.x-=this.x0,t.y-=this.y0,_=Math.PI*this.R,o=t.x/_,s=t.y/_,a=o*o+s*s,l=-Math.abs(s)*(1+a),u=l-2*s*s+o*o,h=-2*l+1+2*s*s+a*a,f=s*s/h+(2*u*u*u/h/h/h-9*l*u/h/h)/27,c=(l-u*u/3/h)/h,p=2*Math.sqrt(-c/3),_=3*f/c/p,Math.abs(_)>1&&(_=_>=0?1:-1),d=Math.acos(_)/3,r=t.y>=0?(-p*Math.cos(d+Math.PI/3)-u/3/h)*Math.PI:-(-p*Math.cos(d+Math.PI/3)-u/3/h)*Math.PI,e=Math.abs(o)<i?this.long0:n(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(o*o-s*s)+a*a))/2/o),t.x=e,t.y=r,t},r.names=["Van_der_Grinten_I","VanDerGrinten","vandg"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz"}],"proj4/lib/transform":[function(t,e,r){var n=.017453292519943295,o=57.29577951308232,i=1,s=2,a=t("./datum_transform"),l=t("./adjust_axis"),u=t("./Proj"),h=t("./common/toPoint");e.exports=function c(t,e,r){function p(t,e){return(t.datum.datum_type===i||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}var _;return Array.isArray(r)&&(r=h(r)),t.datum&&e.datum&&(p(t,e)||p(e,t))&&(_=new u("WGS84"),c(t,_,r),t=_),"enu"!==t.axis&&l(t,!1,r),"longlat"===t.projName?(r.x*=n,r.y*=n):(t.to_meter&&(r.x*=t.to_meter,r.y*=t.to_meter),t.inverse(r)),t.from_greenwich&&(r.x+=t.from_greenwich),r=a(t.datum,e.datum,r),e.from_greenwich&&(r.x-=e.from_greenwich),"longlat"===e.projName?(r.x*=o,r.y*=o):(e.forward(r),e.to_meter&&(r.x/=e.to_meter,r.y/=e.to_meter)),"enu"!==e.axis&&l(e,!0,r),r}},{"./Proj":"proj4/lib/Proj","./adjust_axis":"proj4/lib/adjust_axis","./common/toPoint":"proj4/lib/common/toPoint","./datum_transform":"proj4/lib/datum_transform"}],"proj4/lib/wkt":[function(t,e,r){function n(t,e,r){t[e]=r.map(function(t){var e={};return o(t,e),e}).reduce(function(t,e){return u(t,e)},{})}function o(t,e){var r;return Array.isArray(t)?(r=t.shift(),"PARAMETER"===r&&(r=t.shift()),1===t.length?Array.isArray(t[0])?(e[r]={},o(t[0],e[r])):e[r]=t[0]:t.length?"TOWGS84"===r?e[r]=t:(e[r]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(r)>-1?(e[r]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[r].auth=t[2])):"SPHEROID"===r?(e[r]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[r].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(r)>-1?(t[0]=["name",t[0]],n(e,r,t)):t.every(function(t){return Array.isArray(t)})?n(e,r,t):o(t,e[r])):e[r]=!0,void 0):void(e[t]=!0)}function i(t,e){var r=e[0],n=e[1];!(r in t)&&n in t&&(t[r]=t[n],3===e.length&&(t[r]=e[2](t[r])))}function s(t){return t*l}function a(t){function e(e){var r=t.to_meter||1;return parseFloat(e,10)*r}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=parseFloat(t.UNIT.convert,10)*t.DATUM.SPHEROID.a):t.to_meter=parseFloat(t.UNIT.convert,10))),t.GEOGCS&&(t.GEOGCS.DATUM?t.datumCode=t.GEOGCS.DATUM.name.toLowerCase():t.datumCode=t.GEOGCS.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36")),t.b&&!isFinite(t.b)&&(t.b=t.a);var r=function(e){return i(t,e)},n=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["alpha","azimuth",s],["srsCode","name"]];n.forEach(r),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=s(t.lat1>0?90:-90),t.lat_ts=t.lat1)}var l=.017453292519943295,u=t("./extend");e.exports=function(t,e){var r=JSON.parse((","+t).replace(/\s*\,\s*([A-Z_0-9]+?)(\[)/g,',["$1",').slice(1).replace(/\s*\,\s*([A-Z_0-9]+?)\]/g,',"$1"]').replace(/,\["VERTCS".+/,"")),n=r.shift(),i=r.shift();r.unshift(["name",i]),r.unshift(["type",n]),r.unshift("output");var s={};return o(r,s),a(s.output),u(e,s.output)}},{"./extend":"proj4/lib/extend"}],"proj4/package.json":[function(t,e,r){e.exports={_args:[[{name:"proj4",raw:"proj4@^2.3.10",rawSpec:"^2.3.10",scope:null,spec:">=2.3.10 <3.0.0",type:"range"},"D:\\develop\\zzz\\library\\bokeh-0.12.2\\bokehjs"]],_cnpm_publish_time:1471808264503,_from:"proj4@>=2.3.10 <3.0.0",_id:"proj4@2.3.15",_inCache:!0,_installable:!0,_location:"/proj4",_nodeVersion:"6.1.0",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/proj4-2.3.15.tgz_1471808262546_0.6752060337457806"},_npmUser:{email:"andreas.hocevar@gmail.com",name:"ahocevar"},_npmVersion:"3.8.6",_phantomChildren:{},_requested:{name:"proj4",raw:"proj4@^2.3.10",rawSpec:"^2.3.10",scope:null,spec:">=2.3.10 <3.0.0",type:"range"},_requiredBy:["/"],_resolved:"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz",_shasum:"5ad06e8bca30be0ffa389a49e4565f51f06d089e",_shrinkwrap:null,_spec:"proj4@^2.3.10",_where:"D:\\develop\\zzz\\library\\bokeh-0.12.2\\bokehjs",author:"",bugs:{url:"https://github.com/proj4js/proj4js/issues"},contributors:[{email:"madair@dmsolutions.ca",name:"Mike Adair"},{email:"rich@greenwoodmap.com",name:"Richard Greenwood"},{email:"calvin.metcalf@gmail.com",name:"Calvin Metcalf"},{name:"Richard Marsden",url:"http://www.winwaed.com"},{name:"T. Mittan"},{name:"D. Steinwand"},{name:"S. Nelson"}],dependencies:{mgrs:"~0.0.2"},description:"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",devDependencies:{browserify:"~12.0.1",chai:"~1.8.1",curl:"git://github.com/cujojs/curl.git",grunt:"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0",istanbul:"~0.2.4",mocha:"~1.17.1",tin:"~0.4.0"},directories:{doc:"docs",test:"test"},dist:{noattachment:!1,shasum:"5ad06e8bca30be0ffa389a49e4565f51f06d089e",size:114708,tarball:"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz"},gitHead:"9fa5249c1f4183d5ddee3c4793dfd7b9f29f1886",homepage:"https://github.com/proj4js/proj4js#readme",jam:{include:["dist/proj4.js","README.md","AUTHORS","LICENSE.md"],main:"dist/proj4.js"},license:"MIT",main:"lib/index.js",maintainers:[{email:"andreas.hocevar@gmail.com",name:"ahocevar"},{email:"calvin.metcalf@gmail.com",name:"cwmma"}],name:"proj4",optionalDependencies:{},publish_time:1471808264503,readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/proj4js/proj4js.git"},scripts:{test:"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},version:"2.3.15"}},{}],"quickselect/index":[function(t,e,r){"use strict";function n(t,e,r,s,a){for(r=r||0,s=s||t.length-1,a=a||i;s>r;){if(s-r>600){var l=s-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1),_=Math.max(r,Math.floor(e-u*c/l+p)),d=Math.min(s,Math.floor(e+(l-u)*c/l+p));n(t,e,_,d,a)}var f=t[e],m=r,g=s;for(o(t,r,e),a(t[s],f)>0&&o(t,r,s);m<g;){for(o(t,m,g),m++,g--;a(t[m],f)<0;)m++;for(;a(t[g],f)>0;)g--}0===a(t[r],f)?o(t,r,g):(g++,o(t,g,s)),g<=e&&(r=g+1),e<=g&&(s=g-1)}}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function i(t,e){return t<e?-1:t>e?1:0}e.exports=n},{}],rbush:[function(t,e,r){"use strict";function n(t,e){return this instanceof n?(this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),void this.clear()):new n(t,e)}function o(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function i(t,e){s(t,0,t.children.length,e,t)}function s(t,e,r,n,o){o||(o=m(null)),o.minX=1/0,o.minY=1/0,o.maxX=-(1/0),o.maxY=-(1/0);for(var i,s=e;s<r;s++)i=t.children[s],a(o,t.leaf?n(i):i);return o}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function _(t,e){var r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),o=Math.min(t.maxX,e.maxX),i=Math.min(t.maxY,e.maxY);return Math.max(0,o-r)*Math.max(0,i-n)}function d(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function g(t,e,r,n,o){for(var i,s=[e,r];s.length;)r=s.pop(),e=s.pop(),r-e<=n||(i=e+Math.ceil((r-e)/n/2)*n,y(t,i,e,r,o),s.push(e,i,i,r))}e.exports=n;var y=t("quickselect");n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!f(t,e))return r;for(var o,i,s,a,l=[];e;){for(o=0,i=e.children.length;o<i;o++)s=e.children[o],a=e.leaf?n(s):s,f(t,a)&&(e.leaf?r.push(s):d(t,a)?this._all(s,r):l.push(s));e=l.pop()}return r},collides:function(t){var e=this.data,r=this.toBBox;if(!f(t,e))return!1;for(var n,o,i,s,a=[];e;){for(n=0,o=e.children.length;n<o;n++)if(i=e.children[n],s=e.leaf?r(i):i,f(t,s)){if(e.leaf||d(t,s))return!0;a.push(i)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,r=t.length;e<r;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var o=this.data;this.data=n,n=o}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var r,n,i,s,a=this.data,l=this.toBBox(t),u=[],h=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],r=h.pop(),s=!0),a.leaf&&(i=o(t,a.children,e),i!==-1))return a.children.splice(i,1),u.push(a),this._condense(u),this;s||a.leaf||!d(a,l)?n?(r++,a=n.children[r],s=!1):a=null:(u.push(a),h.push(r),r=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},_build:function(t,e,r,n){var o,s=r-e+1,a=this._maxEntries;if(s<=a)return o=m(t.slice(e,r+1)),i(o,this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),o=m([]),o.leaf=!1,o.height=n;var l,u,h,c,p=Math.ceil(s/a),_=p*Math.ceil(Math.sqrt(a));for(g(t,e,r,_,this.compareMinX),l=e;l<=r;l+=_)for(h=Math.min(l+_-1,r),g(t,l,h,p,this.compareMinY),u=l;u<=h;u+=p)c=Math.min(u+p-1,h),o.children.push(this._build(t,u,c,n-1));return i(o,this.toBBox),o},_chooseSubtree:function(t,e,r,n){for(var o,i,s,a,l,u,c,_;;){if(n.push(e),e.leaf||n.length-1===r)break;for(c=_=1/0,o=0,i=e.children.length;o<i;o++)s=e.children[o],l=h(s),u=p(t,s)-l,u<_?(_=u,c=l<c?l:c,a=s):u===_&&l<c&&(c=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,r){var n=this.toBBox,o=r?t:n(t),i=[],s=this._chooseSubtree(o,this.data,e,i);for(s.children.push(t),a(s,o);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(o,i,e)},_split:function(t,e){var r=t[e],n=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,n);var s=this._chooseSplitIndex(r,o,n),a=m(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,i(r,this.toBBox),i(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,o,i,a,l,u,c,p;for(u=c=1/0,n=e;n<=r-e;n++)o=s(t,0,n,this.toBBox),i=s(t,n,r,this.toBBox),a=_(o,i),l=h(o)+h(i),a<u?(u=a,p=n,c=l<c?l:c):a===u&&l<c&&(c=l,p=n);return p},_chooseSplitAxis:function(t,e,r){var n=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:u,i=this._allDistMargin(t,e,r,n),s=this._allDistMargin(t,e,r,o);i<s&&t.children.sort(n)},_allDistMargin:function(t,e,r,n){t.children.sort(n);var o,i,l=this.toBBox,u=s(t,0,e,l),h=s(t,r-e,r,l),p=c(u)+c(h);for(o=e;o<r-e;o++)i=t.children[o],a(u,t.leaf?l(i):i),p+=c(u);for(o=r-e-1;o>=e;o--)i=t.children[o],a(h,t.leaf?l(i):i),p+=c(h);return p},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)a(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():i(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},{quickselect:"quickselect/index"}],sprintf:[function(t,e,r){/**
sprintf() for JavaScript 0.7-beta1
http://www.diveintojavascript.com/projects/javascript-sprintf
Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of sprintf() for JavaScript nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Changelog:
2010.11.07 - 0.7-beta1-node
- converted it to a node.js compatible module
2010.09.06 - 0.7-beta1
- features: vsprintf, support for named placeholders
- enhancements: format cache, reduced global namespace pollution
2010.05.22 - 0.6:
- reverted to 0.4 and fixed the bug regarding the sign of the number 0
Note:
Thanks to Raphael Pigulla <raph (at] n3rd [dot) org> (http://www.n3rd.org/)
who warned me about a bug in 0.5, I discovered that the last update was
a regress. I appologize for that.
2010.05.09 - 0.5:
- bug fix: 0 is now preceeded with a + sign
- bug fix: the sign was not at the right position on padded results (Kamal Abdali)
- switched from GPL to BSD license
2007.10.21 - 0.4:
- unit test and patch (David Baird)
2007.09.17 - 0.3:
- bug fix: no longer throws exception on empty paramenters (Hans Pufal)
2007.09.11 - 0.2:
- feature: added argument swapping
2007.04.03 - 0.1:
- initial release
**/
var n=function(){function t(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function e(t,e){for(var r=[];e>0;r[--e]=t);return r.join("")}var r=function(){return r.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};return r.object_stringify=function(t,e,n,o){var i="";if(null!=t)switch(typeof t){case"function":return"[Function"+(t.name?": "+t.name:"")+"]";case"object":if(t instanceof Error)return"["+t.toString()+"]";if(e>=n)return"[Object]";if(o&&(o=o.slice(0),o.push(t)),null!=t.length){i+="[";var s=[];for(var a in t)o&&o.indexOf(t[a])>=0?s.push("[Circular]"):s.push(r.object_stringify(t[a],e+1,n,o));i+=s.join(", ")+"]"}else{if("getMonth"in t)return"Date("+t+")";i+="{";var s=[];for(var l in t)t.hasOwnProperty(l)&&(o&&o.indexOf(t[l])>=0?s.push(l+": [Circular]"):s.push(l+": "+r.object_stringify(t[l],e+1,n,o)));i+=s.join(", ")+"}"}return i;case"string":return'"'+t+'"'}return""+t},r.format=function(o,i){var s,a,l,u,h,c,p,_=1,d=o.length,f="",m=[];for(a=0;a<d;a++)if(f=t(o[a]),"string"===f)m.push(o[a]);else if("array"===f){if(u=o[a],u[2])for(s=i[_],l=0;l<u[2].length;l++){if(!s.hasOwnProperty(u[2][l]))throw new Error(n('[sprintf] property "%s" does not exist',u[2][l]));s=s[u[2][l]]}else s=u[1]?i[u[1]]:i[_++];if(/[^sO]/.test(u[8])&&"number"!=t(s))throw new Error(n('[sprintf] expecting number but found %s "'+s+'"',t(s)));switch(u[8]){case"b":s=s.toString(2);break;case"c":s=String.fromCharCode(s);break;case"d":s=parseInt(s,10);break;case"e":s=u[7]?s.toExponential(u[7]):s.toExponential();break;case"f":s=u[7]?parseFloat(s).toFixed(u[7]):parseFloat(s);break;case"O":s=r.object_stringify(s,0,parseInt(u[7])||5);break;case"o":s=s.toString(8);break;case"s":s=(s=String(s))&&u[7]?s.substring(0,u[7]):s;break;case"u":s=Math.abs(s);break;case"x":s=s.toString(16);break;case"X":s=s.toString(16).toUpperCase()}s=/[def]/.test(u[8])&&u[3]&&s>=0?"+"+s:s,c=u[4]?"0"==u[4]?"0":u[4].charAt(1):" ",p=u[6]-String(s).length,h=u[6]?e(c,p):"",m.push(u[5]?s+h:h+s)}return m.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],o=0;e;){if(null!==(r=/^[^\x25]+/.exec(e)))n.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(e)))n.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosOuxX])/.exec(e)))throw new Error("[sprintf] "+e);if(r[2]){o|=1;var i=[],s=r[2],a=[];if(null===(a=/^([a-z_][a-z_\d]*)/i.exec(s)))throw new Error("[sprintf] "+s);for(i.push(a[1]);""!==(s=s.substring(a[0].length));)if(null!==(a=/^\.([a-z_][a-z_\d]*)/i.exec(s)))i.push(a[1]);else{if(null===(a=/^\[(\d+)\]/.exec(s)))throw new Error("[sprintf] "+s);i.push(a[1])}r[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push(r)}e=e.substring(r[0].length)}return n},r}(),o=function(t,e){var r=e.slice();return r.unshift(t),n.apply(null,r)};e.exports=n,n.sprintf=n,n.vsprintf=o},{}],"timezone/index":[function(e,r,n){!function(e){"object"==typeof r&&r.exports?r.exports=e():"function"==typeof t?t(e):this.tz=e()}(function(){function t(t,e,r){var n,o=e.day[1];do n=new Date(Date.UTC(r,e.month,Math.abs(o++)));while(e.day[0]<7&&n.getUTCDay()!=e.day[0]);return n={clock:e.clock,sort:n.getTime(),rule:e,save:6e4*e.save,offset:t.offset},n[n.clock]=n.sort+6e4*e.time,n.posix?n.wallclock=n[n.clock]+(t.offset+e.saved):n.posix=n[n.clock]-(t.offset+e.saved),n}function e(e,r,n){var o,i,s,a,l,u,h,c=e[e.zone],p=[],_=new Date(n).getUTCFullYear(),d=1;for(o=1,i=c.length;o<i&&!(c[o][r]<=n);o++);if(s=c[o],s.rules){for(u=e[s.rules],h=_+1;h>=_-d;--h)for(o=0,i=u.length;o<i;o++)u[o].from<=h&&h<=u[o].to?p.push(t(s,u[o],h)):u[o].to<h&&1==d&&(d=h-u[o].to);for(p.sort(function(t,e){return t.sort-e.sort}),o=0,i=p.length;o<i;o++)n>=p[o][r]&&p[o][p[o].clock]>s[p[o].clock]&&(a=p[o])}return a&&((l=/^(.*)\/(.*)$/.exec(s.format))?a.abbrev=l[a.save?2:1]:a.abbrev=s.format.replace(/%s/,a.rule.letter)),a||s}function r(t,r){return"UTC"==t.zone?r:(t.entry=e(t,"posix",r),r+t.entry.offset+t.entry.save)}function n(t,r){if("UTC"==t.zone)return r;var n,o;return t.entry=n=e(t,"wallclock",r),o=r-n.wallclock,0<o&&o<n.save?null:r-n.offset-n.save}function o(t,e,o){var i,s=+(o[1]+1),a=o[2]*s,l=u.indexOf(o[3].toLowerCase());if(l>9)e+=a*c[l-10];else{if(i=new Date(r(t,e)),l<7)for(;a;)i.setUTCDate(i.getUTCDate()+s),i.getUTCDay()==l&&(a-=s);else 7==l?i.setUTCFullYear(i.getUTCFullYear()+a):8==l?i.setUTCMonth(i.getUTCMonth()+a):i.setUTCDate(i.getUTCDate()+a);null==(e=n(t,i.getTime()))&&(e=n(t,i.getTime()+864e5*s)-864e5*s)}return e}function i(t){if(!t.length)return"0.0.38";var e,i,s,a,l,u=Object.create(this),c=[];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(s=typeof a,"string"==s)~a.indexOf("%")?u.format=a:e||"*"!=a?!e&&(s=/^(\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,s.slice(1,8)),s[9]?(l.push(s[10]+1),l.push.apply(l,s[11].split(/:/))):s[8]&&l.push(1)):/^\w{2,3}_\w{2}$/.test(a)?u.locale=a:(s=h.exec(a))?c.push(s):u.zone=a:l=a;else if("function"==s){if(s=a.call(u))return s}else if(/^\w{2,3}_\w{2}$/.test(a.name))u[a.name]=a;else if(a.zones){for(s in a.zones)u[s]=a.zones[s];for(s in a.rules)u[s]=a.rules[s]}}else e||(l=a);if(u[u.locale]||delete u.locale,u[u.zone]||delete u.zone,null!=l){if("*"==l)l=u.clock();else if(Array.isArray(l)){for(i=!l[7],e=0;e<11;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(i&&(l=n(u,l)),null==l)return l;for(e=0,i=c.length;e<i;e++)l=o(u,l,c[e]);return u.format?(s=new Date(r(u,l)),u.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,function(t,e,r,n,o){var i,a,h="0";if(i=u[o]){for(t=String(i.call(u,s,l,e,r.length)),"_"==(e||i.style)&&(h=" "),a="-"==e?0:i.pad||0;t.length<a;)t=h+t;for(a="-"==e?0:n||i.pad;t.length<a;)t=h+t;"N"==o&&a<t.length&&(t=t.slice(0,a)),"^"==e&&(t=t.toUpperCase())}return t})):l}}return function(){return u.convert(arguments)}}function s(t,e){var r,n,o;return n=new Date(Date.UTC(t.getUTCFullYear(),0)),r=Math.floor((t.getTime()-n.getTime())/864e5),n.getUTCDay()==e?o=0:(o=7-n.getUTCDay()+e,8==o&&(o=1)),r>=o?Math.floor((r-o)/7)+1:0}function a(t){var e,r,n;return r=t.getUTCFullYear(),e=new Date(Date.UTC(r,0)).getUTCDay(),n=s(t,1)+(e>1&&e<=4?1:0),n?53!=n||4==e||3==e&&29==new Date(r,1,29).getDate()?[n,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(r=t.getUTCFullYear()-1,e=new Date(Date.UTC(r,0)).getUTCDay(),n=4==e||3==e&&29==new Date(r,1,29).getDate()?53:52,[n,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,r,n){var o,i,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],u=3600;for(o=0;o<3;o++)l.push(("0"+Math.floor(a/u)).slice(-2)),a%=u,u/=60;return"^"!=r||s?("^"==r&&(n=3),3==n?(i=l.join(":"),i=i.replace(/:00$/,""),"^"!=r&&(i=i.replace(/:00$/,""))):n?(i=l.slice(0,n+1).join(":"),"^"==r&&(i=i.replace(/:00$/,""))):i=l.slice(0,2).join(""),i=(s<0?"-":"+")+i,i=i.replace(/([-+])(0)/,{_:" $1","-":"$1"}[r]||"$1$2")):"Z"},"%":function(t){return"%"},n:function(t){return"\n"},t:function(t){return"\t"},U:function(t){return s(t,0)},W:function(t){return s(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 t.getTime()%1e3*1e6},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(t){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:i,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("|")}}},u="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",h=new RegExp("^\\s*([+-])(\\d+)\\s+("+u+")s?\\s*$","i"),c=[36e5,6e4,1e3,1];return u=u.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)}})},{}],underscore:[function(e,r,n){
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function(){function e(t){function e(e,r,n,o,i,s){for(;i>=0&&i<s;i+=t){var a=o?o[i]:i;n=r(n,e[a],a,e)}return n}return function(r,n,o,i){n=w(n,i,4);var s=!P(r)&&x.keys(r),a=(s||r).length,l=t>0?0:a-1;return arguments.length<3&&(o=r[s?s[l]:l],l+=t),e(r,n,o,s,l,a)}}function o(t){return function(e,r,n){r=M(r,n);for(var o=z(e),i=t>0?0:o-1;i>=0&&i<o;i+=t)if(r(e[i],i,e))return i;return-1}}function i(t,e,r){return function(n,o,i){var s=0,a=z(n);if("number"==typeof i)t>0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(n,o),n[i]===o?i:-1;if(o!==o)return i=e(_.call(n,s,a),x.isNaN),i>=0?i+s:-1;for(i=t>0?s:a-1;i>=0&&i<a;i+=t)if(n[i]===o)return i;return-1}}function s(t,e){var r=O.length,n=t.constructor,o=x.isFunction(n)&&n.prototype||h,i="constructor";for(x.has(t,i)&&!x.contains(e,i)&&e.push(i);r--;)i=O[r],i in t&&t[i]!==o[i]&&!x.contains(e,i)&&e.push(i)}var a=this,l=a._,u=Array.prototype,h=Object.prototype,c=Function.prototype,p=u.push,_=u.slice,d=h.toString,f=h.hasOwnProperty,m=Array.isArray,g=Object.keys,y=c.bind,v=Object.create,b=function(){},x=function(t){return t instanceof x?t:this instanceof x?void(this._wrapped=t):new x(t)};"undefined"!=typeof n?("undefined"!=typeof r&&r.exports&&(n=r.exports=x),n._=x):a._=x,x.VERSION="1.8.3";var w=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)};case 4:return function(r,n,o,i){return t.call(e,r,n,o,i)}}return function(){return t.apply(e,arguments)}},M=function(t,e,r){return null==t?x.identity:x.isFunction(t)?w(t,e,r):x.isObject(t)?x.matcher(t):x.property(t)};x.iteratee=function(t,e){return M(t,e,1/0)};var k=function(t,e){return function(r){var n=arguments.length;if(n<2||null==r)return r;for(var o=1;o<n;o++)for(var i=arguments[o],s=t(i),a=s.length,l=0;l<a;l++){var u=s[l];e&&void 0!==r[u]||(r[u]=i[u])}return r}},j=function(t){if(!x.isObject(t))return{};if(v)return v(t);b.prototype=t;var e=new b;return b.prototype=null,e},T=function(t){return function(e){return null==e?void 0:e[t]}},S=Math.pow(2,53)-1,z=T("length"),P=function(t){var e=z(t);return"number"==typeof e&&e>=0&&e<=S};x.each=x.forEach=function(t,e,r){e=w(e,r);var n,o;if(P(t))for(n=0,o=t.length;n<o;n++)e(t[n],n,t);else{var i=x.keys(t);for(n=0,o=i.length;n<o;n++)e(t[i[n]],i[n],t)}return t},x.map=x.collect=function(t,e,r){e=M(e,r);for(var n=!P(t)&&x.keys(t),o=(n||t).length,i=Array(o),s=0;s<o;s++){var a=n?n[s]:s;i[s]=e(t[a],a,t)}return i},x.reduce=x.foldl=x.inject=e(1),x.reduceRight=x.foldr=e(-1),x.find=x.detect=function(t,e,r){var n;if(n=P(t)?x.findIndex(t,e,r):x.findKey(t,e,r),void 0!==n&&n!==-1)return t[n]},x.filter=x.select=function(t,e,r){var n=[];return e=M(e,r),x.each(t,function(t,r,o){e(t,r,o)&&n.push(t)}),n},x.reject=function(t,e,r){return x.filter(t,x.negate(M(e)),r)},x.every=x.all=function(t,e,r){e=M(e,r);for(var n=!P(t)&&x.keys(t),o=(n||t).length,i=0;i<o;i++){var s=n?n[i]:i;if(!e(t[s],s,t))return!1}return!0},x.some=x.any=function(t,e,r){e=M(e,r);for(var n=!P(t)&&x.keys(t),o=(n||t).length,i=0;i<o;i++){var s=n?n[i]:i;if(e(t[s],s,t))return!0}return!1},x.contains=x.includes=x.include=function(t,e,r,n){return P(t)||(t=x.values(t)),("number"!=typeof r||n)&&(r=0),x.indexOf(t,e,r)>=0},x.invoke=function(t,e){var r=_.call(arguments,2),n=x.isFunction(e);return x.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)})},x.pluck=function(t,e){return x.map(t,x.property(e))},x.where=function(t,e){return x.filter(t,x.matcher(e))},x.findWhere=function(t,e){return x.find(t,x.matcher(e))},x.max=function(t,e,r){var n,o,i=-(1/0),s=-(1/0);if(null==e&&null!=t){t=P(t)?t:x.values(t);for(var a=0,l=t.length;a<l;a++)n=t[a],n>i&&(i=n)}else e=M(e,r),x.each(t,function(t,r,n){o=e(t,r,n),(o>s||o===-(1/0)&&i===-(1/0))&&(i=t,s=o)});return i},x.min=function(t,e,r){var n,o,i=1/0,s=1/0;if(null==e&&null!=t){t=P(t)?t:x.values(t);for(var a=0,l=t.length;a<l;a++)n=t[a],n<i&&(i=n)}else e=M(e,r),x.each(t,function(t,r,n){o=e(t,r,n),(o<s||o===1/0&&i===1/0)&&(i=t,s=o)});return i},x.shuffle=function(t){for(var e,r=P(t)?t:x.values(t),n=r.length,o=Array(n),i=0;i<n;i++)e=x.random(0,i),e!==i&&(o[i]=o[e]),o[e]=r[i];return o},x.sample=function(t,e,r){return null==e||r?(P(t)||(t=x.values(t)),t[x.random(t.length-1)]):x.shuffle(t).slice(0,Math.max(0,e))},x.sortBy=function(t,e,r){return e=M(e,r),x.pluck(x.map(t,function(t,r,n){return{value:t,index:r,criteria:e(t,r,n)}}).sort(function(t,e){var r=t.criteria,n=e.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return t.index-e.index}),"value")};var E=function(t){return function(e,r,n){var o={};return r=M(r,n),x.each(e,function(n,i){var s=r(n,i,e);t(o,n,s)}),o}};x.groupBy=E(function(t,e,r){x.has(t,r)?t[r].push(e):t[r]=[e]}),x.indexBy=E(function(t,e,r){t[r]=e}),x.countBy=E(function(t,e,r){x.has(t,r)?t[r]++:t[r]=1}),x.toArray=function(t){return t?x.isArray(t)?_.call(t):P(t)?x.map(t,x.identity):x.values(t):[]},x.size=function(t){return null==t?0:P(t)?t.length:x.keys(t).length},x.partition=function(t,e,r){e=M(e,r);var n=[],o=[];return x.each(t,function(t,r,i){(e(t,r,i)?n:o).push(t)}),[n,o]},x.first=x.head=x.take=function(t,e,r){if(null!=t)return null==e||r?t[0]:x.initial(t,t.length-e)},x.initial=function(t,e,r){return _.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))},x.last=function(t,e,r){if(null!=t)return null==e||r?t[t.length-1]:x.rest(t,Math.max(0,t.length-e))},x.rest=x.tail=x.drop=function(t,e,r){return _.call(t,null==e||r?1:e)},x.compact=function(t){return x.filter(t,x.identity)};var A=function(t,e,r,n){for(var o=[],i=0,s=n||0,a=z(t);s<a;s++){var l=t[s];if(P(l)&&(x.isArray(l)||x.isArguments(l))){e||(l=A(l,e,r));var u=0,h=l.length;for(o.length+=h;u<h;)o[i++]=l[u++]}else r||(o[i++]=l)}return o};x.flatten=function(t,e){return A(t,e,!1)},x.without=function(t){return x.difference(t,_.call(arguments,1))},x.uniq=x.unique=function(t,e,r,n){x.isBoolean(e)||(n=r,r=e,e=!1),null!=r&&(r=M(r,n));for(var o=[],i=[],s=0,a=z(t);s<a;s++){var l=t[s],u=r?r(l,s,t):l;e?(s&&i===u||o.push(l),i=u):r?x.contains(i,u)||(i.push(u),o.push(l)):x.contains(o,l)||o.push(l)}return o},x.union=function(){return x.uniq(A(arguments,!0,!0))},x.intersection=function(t){for(var e=[],r=arguments.length,n=0,o=z(t);n<o;n++){var i=t[n];if(!x.contains(e,i)){for(var s=1;s<r&&x.contains(arguments[s],i);s++);s===r&&e.push(i)}}return e},x.difference=function(t){var e=A(arguments,!0,!0,1);return x.filter(t,function(t){return!x.contains(e,t)})},x.zip=function(){return x.unzip(arguments)},x.unzip=function(t){for(var e=t&&x.max(t,z).length||0,r=Array(e),n=0;n<e;n++)r[n]=x.pluck(t,n);return r},x.object=function(t,e){for(var r={},n=0,o=z(t);n<o;n++)e?r[t[n]]=e[n]:r[t[n][0]]=t[n][1];return r},x.findIndex=o(1),x.findLastIndex=o(-1),x.sortedIndex=function(t,e,r,n){r=M(r,n,1);for(var o=r(e),i=0,s=z(t);i<s;){var a=Math.floor((i+s)/2);r(t[a])<o?i=a+1:s=a}return i},x.indexOf=i(1,x.findIndex,x.sortedIndex),x.lastIndexOf=i(-1,x.findLastIndex),x.range=function(t,e,r){null==e&&(e=t||0,t=0),r=r||1;for(var n=Math.max(Math.ceil((e-t)/r),0),o=Array(n),i=0;i<n;i++,t+=r)o[i]=t;return o};var C=function(t,e,r,n,o){if(!(n instanceof e))return t.apply(r,o);var i=j(t.prototype),s=t.apply(i,o);return x.isObject(s)?s:i};x.bind=function(t,e){if(y&&t.bind===y)return y.apply(t,_.call(arguments,1));if(!x.isFunction(t))throw new TypeError("Bind must be called on a function");var r=_.call(arguments,2),n=function(){return C(t,n,e,this,r.concat(_.call(arguments)))};return n},x.partial=function(t){var e=_.call(arguments,1),r=function(){for(var n=0,o=e.length,i=Array(o),s=0;s<o;s++)i[s]=e[s]===x?arguments[n++]:e[s];for(;n<arguments.length;)i.push(arguments[n++]);return C(t,r,this,this,i)};return r},x.bindAll=function(t){var e,r,n=arguments.length;if(n<=1)throw new Error("bindAll must be passed function names");for(e=1;e<n;e++)r=arguments[e],t[r]=x.bind(t[r],t);return t},x.memoize=function(t,e){var r=function(n){var o=r.cache,i=""+(e?e.apply(this,arguments):n);return x.has(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return r.cache={},r},x.delay=function(t,e){var r=_.call(arguments,2);return setTimeout(function(){return t.apply(null,r)},e)},x.defer=x.partial(x.delay,x,1),x.throttle=function(t,e,r){var n,o,i,s=null,a=0;r||(r={});var l=function(){a=r.leading===!1?0:x.now(),s=null,i=t.apply(n,o),s||(n=o=null)};return function(){var u=x.now();a||r.leading!==!1||(a=u);var h=e-(u-a);return n=this,o=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=u,i=t.apply(n,o),s||(n=o=null)):s||r.trailing===!1||(s=setTimeout(l,h)),i}},x.debounce=function(t,e,r){var n,o,i,s,a,l=function(){var u=x.now()-s;u<e&&u>=0?n=setTimeout(l,e-u):(n=null,r||(a=t.apply(i,o),n||(i=o=null)))};return function(){i=this,o=arguments,s=x.now();var u=r&&!n;return n||(n=setTimeout(l,e)),u&&(a=t.apply(i,o),i=o=null),a}},x.wrap=function(t,e){return x.partial(e,t)},x.negate=function(t){return function(){return!t.apply(this,arguments)}},x.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},x.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},x.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},x.once=x.partial(x.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),O=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];x.keys=function(t){if(!x.isObject(t))return[];if(g)return g(t);var e=[];for(var r in t)x.has(t,r)&&e.push(r);return N&&s(t,e),e},x.allKeys=function(t){if(!x.isObject(t))return[];var e=[];for(var r in t)e.push(r);return N&&s(t,e),e},x.values=function(t){for(var e=x.keys(t),r=e.length,n=Array(r),o=0;o<r;o++)n[o]=t[e[o]];return n},x.mapObject=function(t,e,r){e=M(e,r);for(var n,o=x.keys(t),i=o.length,s={},a=0;a<i;a++)n=o[a],s[n]=e(t[n],n,t);return s},x.pairs=function(t){for(var e=x.keys(t),r=e.length,n=Array(r),o=0;o<r;o++)n[o]=[e[o],t[e[o]]];return n},x.invert=function(t){for(var e={},r=x.keys(t),n=0,o=r.length;n<o;n++)e[t[r[n]]]=r[n];return e},x.functions=x.methods=function(t){var e=[];for(var r in t)x.isFunction(t[r])&&e.push(r);return e.sort()},x.extend=k(x.allKeys),x.extendOwn=x.assign=k(x.keys),x.findKey=function(t,e,r){e=M(e,r);for(var n,o=x.keys(t),i=0,s=o.length;i<s;i++)if(n=o[i],e(t[n],n,t))return n},x.pick=function(t,e,r){var n,o,i={},s=t;if(null==s)return i;x.isFunction(e)?(o=x.allKeys(s),n=w(e,r)):(o=A(arguments,!1,!1,1),n=function(t,e,r){return e in r},s=Object(s));for(var a=0,l=o.length;a<l;a++){var u=o[a],h=s[u];n(h,u,s)&&(i[u]=h)}return i},x.omit=function(t,e,r){if(x.isFunction(e))e=x.negate(e);else{var n=x.map(A(arguments,!1,!1,1),String);e=function(t,e){return!x.contains(n,e)}}return x.pick(t,e,r)},x.defaults=k(x.allKeys,!0),x.create=function(t,e){var r=j(t);return e&&x.extendOwn(r,e),r},x.clone=function(t){return x.isObject(t)?x.isArray(t)?t.slice():x.extend({},t):t},x.tap=function(t,e){return e(t),t},x.isMatch=function(t,e){var r=x.keys(e),n=r.length;if(null==t)return!n;for(var o=Object(t),i=0;i<n;i++){var s=r[i];if(e[s]!==o[s]||!(s in o))return!1}return!0};var q=function(t,e,r,n){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof x&&(t=t._wrapped),e instanceof x&&(e=e._wrapped);var o=d.call(t);if(o!==d.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+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}var i="[object Array]"===o;if(!i){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,a=e.constructor;if(s!==a&&!(x.isFunction(s)&&s instanceof s&&x.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[],n=n||[];for(var l=r.length;l--;)if(r[l]===t)return n[l]===e;if(r.push(t),n.push(e),i){if(l=t.length,l!==e.length)return!1;for(;l--;)if(!q(t[l],e[l],r,n))return!1}else{var u,h=x.keys(t);if(l=h.length,x.keys(e).length!==l)return!1;for(;l--;)if(u=h[l],!x.has(e,u)||!q(t[u],e[u],r,n))return!1}return r.pop(),n.pop(),!0};x.isEqual=function(t,e){return q(t,e)},x.isEmpty=function(t){return null==t||(P(t)&&(x.isArray(t)||x.isString(t)||x.isArguments(t))?0===t.length:0===x.keys(t).length)},x.isElement=function(t){return!(!t||1!==t.nodeType)},x.isArray=m||function(t){return"[object Array]"===d.call(t)},x.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},x.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){x["is"+t]=function(e){return d.call(e)==="[object "+t+"]"}}),x.isArguments(arguments)||(x.isArguments=function(t){return x.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(x.isFunction=function(t){return"function"==typeof t||!1}),x.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},x.isNaN=function(t){return x.isNumber(t)&&t!==+t},x.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===d.call(t)},x.isNull=function(t){return null===t},x.isUndefined=function(t){return void 0===t},x.has=function(t,e){return null!=t&&f.call(t,e)},x.noConflict=function(){return a._=l,this},x.identity=function(t){return t},x.constant=function(t){return function(){return t}},x.noop=function(){},x.property=T,x.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},x.matcher=x.matches=function(t){return t=x.extendOwn({},t),function(e){return x.isMatch(e,t)}},x.times=function(t,e,r){var n=Array(Math.max(0,t));e=w(e,r,1);for(var o=0;o<t;o++)n[o]=e(o);return n},x.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},x.now=Date.now||function(){return(new Date).getTime()};var D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},I=x.invert(D),R=function(t){var e=function(e){return t[e]},r="(?:"+x.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};x.escape=R(D),x.unescape=R(I),x.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),x.isFunction(n)?n.call(t):n};var F=0;x.uniqueId=function(t){var e=++F+"";return t?t+e:e},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,L={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+L[t]};x.template=function(t,e,r){!e&&r&&(e=r),e=x.defaults({},e,x.templateSettings);var n=RegExp([(e.escape||B).source,(e.interpolate||B).source,(e.evaluate||B).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(n,function(e,r,n,s,a){return i+=t.slice(o,a).replace(G,V),o=a+e.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?i+="'+\n((__t=("+n+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e}),i+="';\n",e.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var s=new Function(e.variable||"obj","_",i)}catch(a){throw a.source=i,a}var l=function(t){return s.call(this,t,x)},u=e.variable||"obj";return l.source="function("+u+"){\n"+i+"}",l},x.chain=function(t){var e=x(t);return e._chain=!0,e};var U=function(t,e){return t._chain?x(e).chain():e};x.mixin=function(t){x.each(x.functions(t),function(e){var r=x[e]=t[e];x.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),U(this,r.apply(x,t))}})},x.mixin(x),x.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];x.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],U(this,r)}}),x.each(["concat","join","slice"],function(t){var e=u[t];x.prototype[t]=function(){return U(this,e.apply(this._wrapped,arguments))}}),x.prototype.value=function(){return this._wrapped},x.prototype.valueOf=x.prototype.toJSON=x.prototype.value,x.prototype.toString=function(){return""+this._wrapped},"function"==typeof t&&t.amd&&t("underscore",[],function(){return x})}).call(this)},{}],"bootstrap/dropdown":[function(t,e,r){function n(t){i(s).remove(),i(a).each(function(){var e=o(i(this)),r={relatedTarget:this};e.hasClass("bk-bs-open")&&(e.trigger(t=i.Event("hide.bk-bs.dropdown",r)),t.isDefaultPrevented()||e.removeClass("bk-bs-open").trigger("hidden.bk-bs.dropdown",r))})}function o(t){var e=t.attr("data-bk-bs-target");e||(e=t.attr("href"),e=e&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var r=e&&i(e);return r&&r.length?r:t.parent()}var i=t("jquery"),s=".bk-bs-dropdown-backdrop",a="[data-bk-bs-toggle=dropdown]",l=function(t){i(t).on("click.bk-bs.dropdown",this.toggle)};l.prototype.toggle=function(t){var e=i(this);if(!e.is(".bk-bs-disabled, :disabled")){var r=o(e),s=r.hasClass("bk-bs-open");if(n(),!s){"ontouchstart"in document.documentElement&&!r.closest(".bk-bs-navbar-nav").length&&i('<div class="bk-bs-dropdown-backdrop"/>').insertAfter(i(this)).on("click",n);var a={relatedTarget:this};if(r.trigger(t=i.Event("show.bk-bs.dropdown",a)),t.isDefaultPrevented())return;r.toggleClass("bk-bs-open").trigger("shown.bk-bs.dropdown",a),e.focus()}return!1}},l.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var e=i(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".bk-bs-disabled, :disabled")){var r=o(e),n=r.hasClass("bk-bs-open");if(!n||n&&27==t.keyCode)return 27==t.which&&r.find(a).focus(),e.click();var s=" li:not(.bk-bs-divider):visible a",l=r.find("[role=menu]"+s+", [role=listbox]"+s);if(l.length){var u=l.index(l.filter(":focus"));38==t.keyCode&&u>0&&u--,40==t.keyCode&&u<l.length-1&&u++,~u||(u=0),l.eq(u).focus()}}}};var u=i.fn.dropdown;i.fn.dropdown=function(t){return this.each(function(){var e=i(this),r=e.data("bk-bs.dropdown");r||e.data("bk-bs.dropdown",r=new l(this)),"string"==typeof t&&r[t].call(e)})},i.fn.dropdown.Constructor=l,i.fn.dropdown.noConflict=function(){return i.fn.dropdown=u,this},i(document).on("click.bk-bs.dropdown.data-api",n).on("click.bk-bs.dropdown.data-api",".bk-bs-dropdown form",function(t){t.stopPropagation()}).on("click.bk-bs.dropdown.data-api",a,l.prototype.toggle).on("keydown.bk-bs.dropdown.data-api",a+", [role=menu], [role=listbox]",l.prototype.keydown)},{jquery:"jquery"}],gear_utils:[function(t,e,r){var n,o,i;!function(){"use strict";n=function(t,e,r,n,o,i){function s(t,e){var r,n=50,o=0;for(r=1;r<=n;r++)o+=e(Math.cos(m*(r-.5)/n))*Math.cos(m*t*(r-.5)/n);return 2*o/n}function a(t,e){var r,n,o,i,a=[],l=[],u=[[],[]];for(r=0;r<t+1;r++)u[0][r]=0,u[1][r]=0;for(u[0][0]=1,u[1][1]=1,o=1;o<t+1;o++){for(u[o+1]=[0],n=0;n<u[o].length-1;n++)u[o+1][n+1]=2*u[o][n];for(n=0;n<u[o-1].length;n++)u[o+1][n]-=u[o-1][n]}for(o=0;o<=t;o++)l[o]=s(o,e),a[o]=0;for(o=0;o<=t;o++)for(i=0;i<=t;i++)a[i]+=l[o]*u[o][i];return a[0]-=s(0,e)/2,a}function l(t){var e=2*t-1,r=e*(p-_)/2+(_+p)/2;return v*(Math.cos(r)+r*Math.sin(r))}function u(t){var e=2*t-1,r=e*(p-_)/2+(_+p)/2;return v*(Math.sin(r)-r*Math.cos(r))}function h(t,e){var r,n=1;for(r=t-e+1;r<=t;r++)n*=r;for(r=1;r<=e;r++)n/=r;return n}function c(t,e){var r,n,o=a(x,e);for(r=0,n=0;n<=t;n++)r+=h(t,n)*o[n]/h(x,n);return r}var p,_,d,f,m=Math.PI,g=t*e/2,y=r||20,v=g*Math.cos(y*m/180),b=g+t,x=n||3,w=Math.sqrt(b*b-v*v)/v,M=i||1,k=.01,j=[];for(void 0!==o&&o<M&&(k=o),p=Math.sqrt(M)*w,_=Math.sqrt(k)*w,d=0;d<=x;d++)f={},f.x=c(d,l),f.y=c(d,u),j.push(f);return j},o=function(t,e,r){function o(t,e){return Math.sqrt(e*e-t*t)/t-Math.acos(t/e)}function i(t,e){var r=Math.sin(e),n=Math.cos(e);return{x:t.x*n-t.y*r,y:t.x*r+t.y*n}}function s(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)}}var a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M=t,k=e,j=r||20,T=M,S=1.25*M,z=S-T,P=k*M/2,E=P*Math.cos(j*Math.PI/180),A=P+T,C=P-S,N=1.5*z,O=2*Math.PI/k,q=o(E,P),D=q,I=Math.atan(N/(N+C));for(a=Math.sqrt((C+N)*(C+N)-N*N),E<a&&(a=C+z),a>E&&(D-=o(E,a)),l=1,u=.01,a>E&&(u=(a*a-E*E)/(A*A-E*E)),h=u+(l-u)/4,c=n(M,k,j,3,u,h),p=n(M,k,j,3,h,l),_=c.concat(p.slice(1)),d=[],x=0;x<_.length;x++)b=i(_[x],-q-O/4),_[x]=b,d[x]={x:b.x,y:-b.y};return f=s(a,-O/4-D),m={x:f.x,y:-f.y},y=s(C,O/4+D+I),v=s(C,3*O/4-D-I),g=i(f,O),w=[],w.push("M",f.x,f.y),a<E&&w.push("L",_[0].x,_[0].y),w.push("C",_[1].x,_[1].y,_[2].x,_[2].y,_[3].x,_[3].y,_[4].x,_[4].y,_[5].x,_[5].y,_[6].x,_[6].y),w.push("A",A,A,0,0,0,d[6].x,d[6].y),w.push("C",d[5].x,d[5].y,d[4].x,d[4].y,d[3].x,d[3].y,d[2].x,d[2].y,d[1].x,d[1].y,d[0].x,d[0].y),a<E&&w.push("L",m.x,m.y),v.y>y.y&&(w.push("A",N,N,0,0,1,y.x,y.y),w.push("A",C,C,0,0,0,v.x,v.y)),w.push("A",N,N,0,0,1,g.x,g.y),w},i=function(t,e,r){function o(t,e){return Math.sqrt(e*e-t*t)/t-Math.acos(t/e)}function i(t,e){var r=Math.sin(e),n=Math.cos(e);return{x:t.x*n-t.y*r,y:t.x*r+t.y*n}}function s(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)}}var a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z=t,P=e,E=r||20,A=.6*z,C=1.25*z,N=P*z/2,O=N*Math.cos(E*Math.PI/180),q=N-A,D=N+C,I=.25*z,R=D-I,F=1.5*I;for(a=2*Math.PI/P,l=o(O,N),u=l,q>O&&(u-=o(O,q)),h=o(O,R)-l,c=1.414*I/R,p=1,_=.01,q>O&&(_=(q*q-O*O)/(R*R-O*O)),d=_+(p-_)/4,f=n(z,P,E,3,_,d),m=n(z,P,E,3,d,p),y=f.concat(m.slice(1)),g=[],b=0;b<y.length;b++)v=i(y[b],a/4-l),y[b]=v,g[b]={x:v.x,y:-v.y};return w={x:g[6].x,y:g[6].y},k=s(q,-a/4+u),j={x:k.x,y:-k.y},T=s(D,a/4+h+c),S=s(D,3*a/4-h-c),M=i(w,a),x=[],x.push("M",g[6].x,g[6].y),x.push("C",g[5].x,g[5].y,g[4].x,g[4].y,g[3].x,g[3].y,g[2].x,g[2].y,g[1].x,g[1].y,g[0].x,g[0].y),q<O&&x.push("L",k.x,k.y),x.push("A",q,q,0,0,0,j.x,j.y),q<O&&x.push("L",y[0].x,y[0].y),x.push("C",y[1].x,y[1].y,y[2].x,y[2].y,y[3].x,y[3].y,y[4].x,y[4].y,y[5].x,y[5].y,y[6].x,y[6].y),T.y<S.y&&(x.push("A",F,F,0,0,0,T.x,T.y),x.push("A",D,D,0,0,0,S.x,S.y)),x.push("A",F,F,0,0,0,M.x,M.y),x}}(),e.exports={create_gear_tooth:o,create_internal_gear_tooth:i}},{}],gloo2:[function(e,r,n){(function(e){!function(e,o){"function"==typeof t&&t.amd?t([],o):"undefined"!=typeof n?(r.exports=o(),"undefined"==typeof window&&(e.gloo2=r.exports)):e.gloo2=o()}(this,function(){var t,r,n,o,i,s,a,l,u,h,c=function(t,e){return Array.isArray(t)&&Array.isArray(e)?t.concat(e):t+e},p=function(t){for(var e=0;e<t.length;e++)if(!g(t[e]))return!1;return!0},_=function(t,e){if(null==e);else{if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(d(t,e[r]))return!0;return!1}if(e.constructor===Object){for(var n in e)if(t==n)return!0;return!1}if(e.constructor==String)return e.indexOf(t)>=0}var o=Error("Not a container: "+e);throw o.name="TypeError",o},d=function j(t,e){if(null==t||null==e);else{if(Array.isArray(t)&&Array.isArray(e)){for(var r=0,n=t.length==e.length;n&&r<t.length;)n=j(t[r],e[r]),r+=1;return n}if(t.constructor===Object&&e.constructor===Object){var o=Object.keys(t),i=Object.keys(e);o.sort(),i.sort();for(var s,r=0,n=j(o,i);n&&r<o.length;)s=o[r],n=j(t[s],e[s]),r+=1;return n}}return t==e},f=function(t,r){if("undefined"==typeof t||"undefined"!=typeof window&&window===t||"undefined"!=typeof e&&e===t)throw"Class constructor is called as a function.";for(var n in t)void 0!==Object[n]||"function"!=typeof t[n]||t[n].nobind||(t[n]=t[n].bind(t));t.__init__&&t.__init__.apply(t,r)},m=function(t,e){if(("number"==typeof t)+("number"==typeof e)===1){if(t.constructor===String)return M.call(t,e);if(e.constructor===String)return M.call(e,t);if(Array.isArray(e)){var r=t;t=e,e=r}if(Array.isArray(t)){for(var n=[],o=0;o<e;o++)n=n.concat(t);return n}}return t*e},g=function(t){return null===t||"object"!=typeof t?t:void 0!==t.length?!!t.length&&t:void 0!==t.byteLength?!!t.byteLength&&t:t.constructor!==Object||!!Object.getOwnPropertyNames(t).length&&t},y=function(t){return Array.isArray(this)?void this.push(t):this.append.apply(this,arguments)},v=function(t,e){return this.constructor!==Object?this.get.apply(this,arguments):void 0!==this[t]?this[t]:void 0!==e?e:null},b=function(){return"function"==typeof this.keys?this.keys.apply(this,arguments):Object.keys(this)},x=function(t){if(this.constructor!==String)return this.lstrip.apply(this,arguments);t=void 0===t?" \t\r\n":t;for(var e=0;e<this.length;e++)if(t.indexOf(this[e])<0)return this.slice(e);return""},w=function(t){if(!Array.isArray(this))return this.remove.apply(this,arguments);for(var e=0;e<this.length;e++)if(d(this[e],t))return void this.splice(e,1);var r=Error(t);throw r.name="ValueError",r},M=function(t){if(this.repeat)return this.repeat(t);if(t<1)return"";for(var e="",r=this.valueOf();t>1;)1&t&&(e+=r),t>>=1,r+=r;return e+r},k=function(t){return this.constructor!==String?this.startswith.apply(this,arguments):0==this.indexOf(t)};return h=window.console,l="0.3",u=function(t,e){var r,n,o,i,s,a,l;for(e=void 0===e?"periodic check":e,i=[];;){if(n=t.getError(),d(n,t.NO_ERROR)||g(i)&&d(n,i[i.length-1]))break;y.call(i,n)}if(i.length){for(s="",a=i,"object"!=typeof a||Array.isArray(a)||(a=Object.keys(a)),l=0;l<a.length;l+=1)r=a[l],s=c(s,r);throw o=new Error("RuntimeError:"+("OpenGL got errors ("+e+"): "+s)),o.name="RuntimeError",o}return null},r=function(){f(this,arguments)},r.prototype._base_class=Object,r.prototype._class_name="GlooObject",r.prototype.__init__=function(t){if(this._gl=t,this.handle=null,this._create(),null===this.handle)throw"AssertionError: this.handle !== null";return null},r.prototype._create=function(){var t;throw t=new Error("NotImplementedError:"),t.name="NotImplementedError",t},o=function(){f(this,arguments)},o.prototype=Object.create(r.prototype),o.prototype._base_class=r.prototype,o.prototype._class_name="Program",o.prototype.UTYPEMAP={"float":"uniform1fv",vec2:"uniform2fv",vec3:"uniform3fv",vec4:"uniform4fv","int":"uniform1iv",ivec2:"uniform2iv",ivec3:"uniform3iv",ivec4:"uniform4iv",bool:"uniform1iv",bvec2:"uniform2iv",bvec3:"uniform3iv",bvec4:"uniform4iv",mat2:"uniformMatrix2fv",mat3:"uniformMatrix3fv",mat4:"uniformMatrix4fv",sampler1D:"uniform1i",sampler2D:"uniform1i",sampler3D:"uniform1i"},o.prototype.ATYPEMAP={"float":"vertexAttrib1f",vec2:"vertexAttrib2f",vec3:"vertexAttrib3f",vec4:"vertexAttrib4f"},o.prototype.ATYPEINFO={"float":[1,5126],vec2:[2,5126],vec3:[3,5126],vec4:[4,5126]},o.prototype._create=function(){return this.handle=this._gl.createProgram(),this.locations={},this._unset_variables=[],this._validated=!1,this._samplers={},this._attributes={},this._known_invalid=[],null},o.prototype["delete"]=function(){return this._gl.deleteProgram(this.handle),null},o.prototype.activate=function(){return this._gl.useProgram(this.handle),null},o.prototype.deactivate=function(){return this._gl.useProgram(0),null},o.prototype.set_shaders=function(t,e){var r,n,o,i,s,a,l,u,h,p,_,d,f;for(a=this._gl,this._linked=!1,f=a.createShader(a.VERTEX_SHADER),s=a.createShader(a.FRAGMENT_SHADER),_=[[t,f,"vertex"],[e,s,"fragment"]],u=0;u<2;u+=1)if(p=_[u],r=p[0],l=p[1],d=p[2],a.shaderSource(l,r),a.compileShader(l),h=a.getShaderParameter(l,a.COMPILE_STATUS),!g(h))throw i=a.getShaderInfoLog(l),o=new Error("RuntimeError:"+c("errors in "+d+" shader:\n",i)),o.name="RuntimeError",o;if(a.attachShader(this.handle,f),a.attachShader(this.handle,s),a.linkProgram(this.handle),!g(a.getProgramParameter(this.handle,a.LINK_STATUS)))throw n=new Error("RuntimeError:Program link error:\n"+a.getProgramInfoLog(this.handle)),n.name="RuntimeError",n;return this._unset_variables=this._get_active_attributes_and_uniforms(),a.detachShader(this.handle,f),a.detachShader(this.handle,s),a.deleteShader(f),a.deleteShader(s),this._known_invalid=[],this._linked=!0,null},o.prototype._get_active_attributes_and_uniforms=function(){var t,e,r,n,o,i,s,a,l,u,h,p,_,d,f,m,v,b,x;for(a=this._gl,this.locations={},d=new window.RegExp("(\\w+)\\s*(\\[(\\d+)\\])\\s*"),o=a.getProgramParameter(this.handle,a.ACTIVE_UNIFORMS),e=a.getProgramParameter(this.handle,a.ACTIVE_ATTRIBUTES),t=[],b=[],m=[[t,e,a.getActiveAttrib,a.getAttribLocation],[b,o,a.getActiveUniform,a.getUniformLocation]],"object"!=typeof m||Array.isArray(m)||(m=Object.keys(m)),v=0;v<m.length;v+=1)for(x=m[v],f=x,r=f[0],n=f[1],i=f[2],s=f[3],l=0;l<n;l+=1){if(u=i.call(a,this.handle,l),_=u.name,p=_.match(d),g(p))for(_=p[1],h=0;h<u.size;h+=1)y.call(r,[""+_+"["+h+"]",u.type]);else y.call(r,[_,u.type]);this.locations[_]=s.call(a,this.handle,_)}return c(function(){var e,r,n,o=[];for(r=t,"object"!=typeof r||Array.isArray(r)||(r=Object.keys(r)),n=0;n<r.length;n++)e=r[n],o.push(e[0]);return o}.apply(this),function(){var t,e,r,n=[];for(e=b,"object"!=typeof e||Array.isArray(e)||(e=Object.keys(e)),r=0;r<e.length;r++)t=e[r],n.push(t[0]);return n}.apply(this))},o.prototype.set_texture=function(t,e){var r,n,o;if(!g(this._linked))throw r=new Error("RuntimeError:Cannot set uniform when program has no code"),r.name="RuntimeError",r;return n=v.call(this.locations,t,-1),g(n<0)?(_(t,this._known_invalid)||(y.call(this._known_invalid,t),h.log("Variable "+t+" is not an active texture")),null):(_(t,this._unset_variables)&&w.call(this._unset_variables,t),this.activate(),o=b.call(this._samplers).length,_(t,this._samplers)&&(o=this._samplers[t][this._samplers[t].length-1]),this._samplers[t]=[e._target,e.handle,o],this._gl.uniform1i(n,o),null)},o.prototype.set_uniform=function(t,e,r){var n,o,i,s,a,l,u;if(!g(this._linked))throw i=new Error("RuntimeError:Cannot set uniform when program has no code"),i.name="RuntimeError",i;if(a=v.call(this.locations,t,-1),g(a<0))return _(t,this._known_invalid)||(y.call(this._known_invalid,t),h.log("Variable "+t+" is not an active uniform")),null;if(_(t,this._unset_variables)&&w.call(this._unset_variables,t),o=1,k.call(e,"mat")||(n=v.call({"int":"float",bool:"float"},e,x.call(e,"ib")),o=Math.floor(r.length/this.ATYPEINFO[n][0])),g(o>1))for(l=0;l<o;l+=1)_(""+t+"["+l+"]",this._unset_variables)&&(u=""+t+"["+l+"]",_(u,this._unset_variables)&&w.call(this._unset_variables,u));return s=this.UTYPEMAP[e],this.activate(),k.call(e,"mat")?this._gl[s](a,!1,r):this._gl[s](a,r),null},o.prototype.set_attribute=function(t,e,r,n,o){var i,s,l,u,c,p,d,f;if(n=void 0===n?0:n,o=void 0===o?0:o,!g(this._linked))throw s=new Error("RuntimeError:Cannot set attribute when program has no code"),s.name="RuntimeError",s;return p=r instanceof a,c=v.call(this.locations,t,-1),g(c<0)?(_(t,this._known_invalid)||(y.call(this._known_invalid,t),g(p)&&g(o>0)||h.log("Variable "+t+" is not an active attribute")),null):(_(t,this._unset_variables)&&w.call(this._unset_variables,t),this.activate(),g(p)?(f=this.ATYPEINFO[e],d=f[0],u=f[1],l="vertexAttribPointer",i=[d,u,this._gl.FALSE,n,o],this._attributes[t]=[r.handle,c,l,i]):(l=this.ATYPEMAP[e],this._attributes[t]=[0,c,l,r]),null)},o.prototype._pre_draw=function(){var t,e,r,n,o,i,s,a,l,u,h,p;this.activate(),s=this._samplers;for(p in s)s.hasOwnProperty(p)&&(p=s[p],i=p,l=i[0],a=i[1],u=i[2],this._gl.activeTexture(c(this._gl.TEXTURE0,u)),this._gl.bindTexture(l,a));o=this._attributes;for(p in o)o.hasOwnProperty(p)&&(p=o[p],n=p,h=n[0],e=n[1],r=n[2],t=n[3],g(h)?(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,h),this._gl.enableVertexAttribArray(e),this._gl[r].apply(this._gl,[].concat([e],t))):(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,null),this._gl.disableVertexAttribArray(e),this._gl[r].apply(this._gl,[].concat([e],t))));return g(this._validated)||(this._validated=!0,this._validate()),null},o.prototype._validate=function(){var t;if(this._unset_variables.length&&h.log("Program has unset variables: "+this._unset_variables),this._gl.validateProgram(this.handle),!g(this._gl.getProgramParameter(this.handle,this._gl.VALIDATE_STATUS)))throw h.log(this._gl.getProgramInfoLog(this.handle)),t=new Error("RuntimeError:Program validation error"),t.name="RuntimeError",t;return null},o.prototype.draw=function(t,e){var r,o,i,s,a;if(!g(this._linked))throw o=new Error("RuntimeError:Cannot draw program if code has not been set"),o.name="RuntimeError",o;return u(this._gl,"before draw"),g(e instanceof n)?(this._pre_draw(),e.activate(),r=e._buffer_size/2,s=this._gl.UNSIGNED_SHORT,this._gl.drawElements(t,r,s,0),e.deactivate()):(a=e,i=a[0],r=a[1],g(r)&&(this._pre_draw(),this._gl.drawArrays(t,i,r))),u(this._gl,"after draw"),null},t=function(){f(this,arguments)},t.prototype=Object.create(r.prototype),t.prototype._base_class=r.prototype,t.prototype._class_name="Buffer",
t.prototype._target=null,t.prototype._usage=35048,t.prototype._create=function(){return this.handle=this._gl.createBuffer(),this._buffer_size=0,null},t.prototype["delete"]=function(){return this._gl.deleteBuffer(this.handle),null},t.prototype.activate=function(){return this._gl.bindBuffer(this._target,this.handle),null},t.prototype.deactivate=function(){return this._gl.bindBuffer(this._target,null),null},t.prototype.set_size=function(t){return d(t,this._buffer_size)||(this.activate(),this._gl.bufferData(this._target,t,this._usage),this._buffer_size=t),null},t.prototype.set_data=function(t,e){return this.activate(),this._gl.bufferSubData(this._target,t,e),null},a=function(){f(this,arguments)},a.prototype=Object.create(t.prototype),a.prototype._base_class=t.prototype,a.prototype._class_name="VertexBuffer",a.prototype._target=34962,n=function(){f(this,arguments)},n.prototype=Object.create(t.prototype),n.prototype._base_class=t.prototype,n.prototype._class_name="IndexBuffer",n.prototype._target=34963,i=function(){f(this,arguments)},i.prototype=Object.create(r.prototype),i.prototype._base_class=r.prototype,i.prototype._class_name="Texture2D",i.prototype._target=3553,i.prototype._types={Int8Array:5120,Uint8Array:5121,Int16Array:5122,Uint16Array:5123,Int32Array:5124,Uint32Array:5125,Float32Array:5126},i.prototype._create=function(){return this.handle=this._gl.createTexture(),this._shape_format=null,null},i.prototype["delete"]=function(){return this._gl.deleteTexture(this.handle),null},i.prototype.activate=function(){return this._gl.bindTexture(this._target,this.handle),null},i.prototype.deactivate=function(){return this._gl.bindTexture(this._target,0),null},i.prototype._get_alignment=function(t){var e,r,n,o;for(r=[4,8,2,1],n=r,"object"!=typeof n||Array.isArray(n)||(n=Object.keys(n)),o=0;o<n.length;o+=1)if(e=n[o],d(t%e,0))return e;return null},i.prototype.set_wrapping=function(t,e){return this.activate(),this._gl.texParameterf(this._target,this._gl.TEXTURE_WRAP_S,t),this._gl.texParameterf(this._target,this._gl.TEXTURE_WRAP_T,e),null},i.prototype.set_interpolation=function(t,e){return this.activate(),this._gl.texParameterf(this._target,this._gl.TEXTURE_MIN_FILTER,t),this._gl.texParameterf(this._target,this._gl.TEXTURE_MAG_FILTER,e),null},i.prototype.set_size=function(t,e){var r,n,o;return n=t,r=n[0],o=n[1],d([r,o,e],this._shape_format)||(this._shape_format=[r,o,e],this.activate(),this._gl.texImage2D(this._target,0,e,o,r,0,e,this._gl.UNSIGNED_BYTE,null)),this.u_shape=[r,o],null},i.prototype.set_data=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_;if(d(e.length,2)&&(e=[e[0],e[1],1]),this.activate(),s=this._shape_format[2],u=e,l=u[0],c=u[1],n=u[2],h=t,_=h[0],p=h[1],a=v.call(this._types,r.constructor.name,null),null===a)throw i=new Error("ValueError:"+("Type "+r.constructor.name+" not allowed for texture")),i.name="ValueError",i;return o=this._get_alignment(m(e[e.length-2],e[e.length-1])),d(o,4)||this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,o),this._gl.texSubImage2D(this._target,0,p,_,c,l,s,a,r),d(o,4)||this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,4),null},s=function(){f(this,arguments)},s.prototype=Object.create(i.prototype),s.prototype._base_class=i.prototype,s.prototype._class_name="Texture3DLike",s.prototype.GLSL_SAMPLE_NEAREST="\n vec4 sample3D(sampler2D tex, vec3 texcoord, vec3 shape, vec2 tiles) {\n shape.xyz = shape.zyx; // silly row-major convention\n float nrows = tiles.y, ncols = tiles.x;\n // Don't let adjacent frames be interpolated into this one\n texcoord.x = min(texcoord.x * shape.x, shape.x - 0.5);\n texcoord.x = max(0.5, texcoord.x) / shape.x;\n texcoord.y = min(texcoord.y * shape.y, shape.y - 0.5);\n texcoord.y = max(0.5, texcoord.y) / shape.y;\n\n float zindex = floor(texcoord.z * shape.z);\n\n // Do a lookup in the 2D texture\n float u = (mod(zindex, ncols) + texcoord.x) / ncols;\n float v = (floor(zindex / ncols) + texcoord.y) / nrows;\n\n return texture2D(tex, vec2(u,v));\n }\n ",s.prototype.GLSL_SAMPLE_LINEAR="\n vec4 sample3D(sampler2D tex, vec3 texcoord, vec3 shape, vec2 tiles) {\n shape.xyz = shape.zyx; // silly row-major convention\n float nrows = tiles.y, ncols = tiles.x;\n // Don't let adjacent frames be interpolated into this one\n texcoord.x = min(texcoord.x * shape.x, shape.x - 0.5);\n texcoord.x = max(0.5, texcoord.x) / shape.x;\n texcoord.y = min(texcoord.y * shape.y, shape.y - 0.5);\n texcoord.y = max(0.5, texcoord.y) / shape.y;\n\n float z = texcoord.z * shape.z;\n float zindex1 = floor(z);\n float u1 = (mod(zindex1, ncols) + texcoord.x) / ncols;\n float v1 = (floor(zindex1 / ncols) + texcoord.y) / nrows;\n\n float zindex2 = zindex1 + 1.0;\n float u2 = (mod(zindex2, ncols) + texcoord.x) / ncols;\n float v2 = (floor(zindex2 / ncols) + texcoord.y) / nrows;\n\n vec4 s1 = texture2D(tex, vec2(u1, v1));\n vec4 s2 = texture2D(tex, vec2(u2, v2));\n\n return s1 * (zindex2 - z) + s2 * (z - zindex1);\n }\n ",s.prototype._get_tile_info=function(t){var e,r,n,o;if(r=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),o=Math.floor(r/t[1]),o=Math.min(o,t[0]),n=window.Math.ceil(t[0]/o),g(m(n,t[2])>r))throw e=new Error("RuntimeError:"+("Cannot fit 3D data with shape "+t+" onto simulated 2D texture.")),e.name="RuntimeError",e;return[o,n]},s.prototype.set_size=function(t,e){var r,n,o,i;return i=this._get_tile_info(t),n=i[0],r=i[1],o=[m(t[1],n),m(t[2],r)],s.prototype._base_class.set_size.call(this,o,e),this.u_shape=[t[0],t[1],t[2]],this.u_tiles=[r,n],null},s.prototype.set_data=function(t,e,r){var n,o,i,a,l,u,h,c,_,f,g,y,v;if(d(e.length,3)&&(e=[e[0],e[1],e[2],1]),!p(function(){var e,r,n,o=[];for(r=t,"object"!=typeof r||Array.isArray(r)||(r=Object.keys(r)),n=0;n<r.length;n++)e=r[n],o.push(d(e,0));return o}.apply(this)))throw a=new Error("ValueError:Texture3DLike does not support nonzero offset (for now)"),a.name="ValueError",a;if(_=this._get_tile_info(e),u=_[0],l=_[1],c=[m(e[1],u),m(e[2],l),e[3]],d(l,1))s.prototype._base_class.set_data.call(this,[0,0],c,r);else for(n=r.constructor,v=new n(m(m(c[0],c[1]),c[2])),s.prototype._base_class.set_data.call(this,[0,0],c,v),y=0;y<e[0];y+=1)f=[Math.floor(y/l),y%l],h=f[0],o=f[1],i=Math.floor(r.length/e[0]),g=r.slice(m(y,i),m(y+1,i)),s.prototype._base_class.set_data.call(this,[m(h,e[1]),m(o,e[2])],e.slice(1),g);return null},{Buffer:t,GlooObject:r,IndexBuffer:n,Program:o,Texture2D:i,Texture3DLike:s,VertexBuffer:a,check_error:u,console:h}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],kiwi:[function(t,e,r){/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n;!function(t){function e(t){return t instanceof Array?new l(t):t.__iter__()}function r(t){return t instanceof Array?new u(t):t.__reversed__()}function n(t){return t.__next__()}function o(t){if(t instanceof Array)return t.slice();for(var e,r=[],n=t.__iter__();void 0!==(e=n.__next__());)r.push(e);return r}function i(t,e){if(t instanceof Array){for(var r=0,n=t.length;r<n;++r)if(e(t[r])===!1)return}else for(var o,i=t.__iter__();void 0!==(o=i.__next__());)if(e(o)===!1)return}function s(t,e){var r=[];if(t instanceof Array)for(var n=0,o=t.length;n<o;++n)r.push(e(t[n]));else for(var i,s=t.__iter__();void 0!==(i=s.__next__());)r.push(e(i));return r}function a(t,e){var r,n=[];if(t instanceof Array)for(var o=0,i=t.length;o<i;++o)r=t[o],e(r)&&n.push(r);else for(var s=t.__iter__();void 0!==(r=s.__next__());)e(r)&&n.push(r);return n}var l=function(){function t(t,e){"undefined"==typeof e&&(e=0),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[this._index++]},t.prototype.__iter__=function(){return this},t}();t.ArrayIterator=l;var u=function(){function t(t,e){"undefined"==typeof e&&(e=t.length),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[--this._index]},t.prototype.__iter__=function(){return this},t}();t.ReverseArrayIterator=u,t.iter=e,t.reversed=r,t.next=n,t.asArray=o,t.forEach=i,t.map=s,t.filter=a}(n||(n={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n;!function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();t.Pair=e}(n||(n={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n;!function(t){function e(t,e,r){for(var n,o,i=0,s=t.length;s>0;)n=s>>1,o=i+n,r(t[o],e)<0?(i=o+1,s-=n+1):s=n;return i}function r(t,r,n){var o=e(t,r,n);if(o===t.length)return-1;var i=t[o];return 0!==n(i,r)?-1:o}function n(t,r,n){var o=e(t,r,n);if(o!==t.length){var i=t[o];if(0===n(i,r))return i}}function o(e,r){var n=t.asArray(e),o=n.length;if(o<=1)return n;n.sort(r);for(var i=[n[0]],s=1,a=0;s<o;++s){var l=n[s];0!==r(i[a],l)&&(i.push(l),++a)}return i}function i(t,e,r){for(var n=0,o=0,i=t.length,s=e.length;n<i&&o<s;){var a=r(t[n],e[o]);if(a<0)++n;else{if(!(a>0))return!1;++o}}return!0}function s(t,e,r){var n=t.length,o=e.length;if(n>o)return!1;for(var i=0,s=0;i<n&&s<o;){var a=r(t[i],e[s]);if(a<0)return!1;a>0?++s:(++i,++s)}return!(i<n)}function a(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?(a.push(l),++n):h>0?(a.push(u),++o):(a.push(l),++n,++o)}for(;n<i;)a.push(t[n]),++n;for(;o<s;)a.push(e[o]),++o;return a}function l(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?++n:h>0?++o:(a.push(l),++n,++o)}return a}function u(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?(a.push(l),++n):h>0?++o:(++n,++o)}for(;n<i;)a.push(t[n]),++n;return a}function h(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?(a.push(l),++n):h>0?(a.push(u),++o):(++n,++o)}for(;n<i;)a.push(t[n]),++n;for(;o<s;)a.push(e[o]),++o;return a}t.lowerBound=e,t.binarySearch=r,t.binaryFind=n,t.asSet=o,t.setIsDisjoint=i,t.setIsSubset=s,t.setUnion=a,t.setIntersection=l,t.setDifference=u,t.setSymmetricDifference=h}(n||(n={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n;!function(t){var e=function(){function e(){this._array=[]}return e.prototype.size=function(){return this._array.length},e.prototype.empty=function(){return 0===this._array.length},e.prototype.itemAt=function(t){return this._array[t]},e.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},e.prototype.clear=function(){this._array=[]},e.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},e.prototype.__iter__=function(){return t.iter(this._array)},e.prototype.__reversed__=function(){return t.reversed(this._array)},e}();t.ArrayBase=e}(n||(n={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n,o=this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);r.prototype=e.prototype,t.prototype=new r};!function(t){function e(t){return function(e,r){return t(e.first,r)}}function r(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l.first,u.first);h<0?(a.push(l.copy()),++n):h>0?(a.push(u.copy()),++o):(a.push(u.copy()),++n,++o)}for(;n<i;)a.push(t[n].copy()),++n;for(;o<s;)a.push(e[o].copy()),++o;return a}var n=function(n){function i(t){n.call(this),this._compare=t,this._wrapped=e(t)}return o(i,n),i.prototype.comparitor=function(){return this._compare},i.prototype.indexOf=function(e){return t.binarySearch(this._array,e,this._wrapped)},i.prototype.contains=function(e){return t.binarySearch(this._array,e,this._wrapped)>=0},i.prototype.find=function(e){return t.binaryFind(this._array,e,this._wrapped)},i.prototype.setDefault=function(e,r){var n=this._array,o=t.lowerBound(n,e,this._wrapped);if(o===n.length){var i=new t.Pair(e,r());return n.push(i),i}var s=n[o];if(0!==this._compare(s.first,e)){var i=new t.Pair(e,r());return n.splice(o,0,i),i}return s},i.prototype.insert=function(e,r){var n=this._array,o=t.lowerBound(n,e,this._wrapped);if(o===n.length){var i=new t.Pair(e,r);return n.push(i),i}var s=n[o];if(0!==this._compare(s.first,e)){var i=new t.Pair(e,r);return n.splice(o,0,i),i}return s.second=r,s},i.prototype.update=function(e){var n=this;if(e instanceof i){var o=e;this._array=r(this._array,o._array,this._compare)}else t.forEach(e,function(t){n.insert(t.first,t.second)})},i.prototype.erase=function(e){var r=this._array,n=t.binarySearch(r,e,this._wrapped);if(!(n<0))return r.splice(n,1)[0]},i.prototype.copy=function(){for(var t=new i(this._compare),e=t._array,r=this._array,n=0,o=r.length;n<o;++n)e.push(r[n].copy());return t},i}(t.ArrayBase);t.AssociativeArray=n}(n||(n={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n;!function(t){function e(e,n){return e instanceof r?e._array:t.asSet(e,n)}var r=function(r){function n(t){r.call(this),this._compare=t}return o(n,r),n.prototype.comparitor=function(){return this._compare},n.prototype.indexOf=function(e){return t.binarySearch(this._array,e,this._compare)},n.prototype.contains=function(e){return t.binarySearch(this._array,e,this._compare)>=0},n.prototype.insert=function(e){var r=this._array,n=t.lowerBound(r,e,this._compare);return n===r.length?(r.push(e),!0):0!==this._compare(r[n],e)&&(r.splice(n,0,e),!0)},n.prototype.erase=function(e){var r=this._array,n=t.binarySearch(r,e,this._compare);return!(n<0)&&(r.splice(n,1),!0)},n.prototype.copy=function(){var t=new n(this._compare);return t._array=this._array.slice(),t},n.prototype.isDisjoint=function(r){var n=this._compare,o=e(r,n);return t.setIsDisjoint(this._array,o,n)},n.prototype.isSubset=function(r){var n=this._compare,o=e(r,n);return t.setIsSubset(this._array,o,n)},n.prototype.isSuperset=function(r){var n=this._compare,o=e(r,n);return t.setIsSubset(o,this._array,n)},n.prototype.union=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setUnion(this._array,s,o),i},n.prototype.intersection=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setIntersection(this._array,s,o),i},n.prototype.difference=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setDifference(this._array,s,o),i},n.prototype.symmetricDifference=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setSymmetricDifference(this._array,s,o),i},n.prototype.unionUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setUnion(this._array,o,n)},n.prototype.intersectionUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setIntersection(this._array,o,n)},n.prototype.differenceUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setDifference(this._array,o,n)},n.prototype.symmetricDifferenceUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setSymmetricDifference(this._array,o,n)},n}(t.ArrayBase);t.UniqueArray=r}(n||(n={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var i;!function(t){!function(t){t[t.Le=0]="Le",t[t.Ge=1]="Ge",t[t.Eq=2]="Eq"}(t.Operator||(t.Operator={}));var e=(t.Operator,function(){function e(e,n,o){"undefined"==typeof o&&(o=t.Strength.required),this._id=r++,this._operator=n,this._expression=e,this._strength=t.Strength.clip(o)}return e.Compare=function(t,e){return t.id()-e.id()},e.prototype.id=function(){return this._id},e.prototype.expression=function(){return this._expression},e.prototype.op=function(){return this._operator},e.prototype.strength=function(){return this._strength},e}());t.Constraint=e;var r=0}(i||(i={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var i;!function(t){function e(t){return new n.AssociativeArray(t)}t.createMap=e}(i||(i={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var i;!function(t){var e=function(){function t(t){"undefined"==typeof t&&(t=""),this._value=0,this._context=null,this._id=r++,this._name=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.name=function(){return this._name},t.prototype.setName=function(t){this._name=t},t.prototype.context=function(){return this._context},t.prototype.setContext=function(t){this._context=t},t.prototype.value=function(){return this._value},t.prototype.setValue=function(t){this._value=t},t}();t.Variable=e;var r=0}(i||(i={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var i;!function(t){function e(e){for(var r=0,n=function(){return 0},o=t.createMap(t.Variable.Compare),i=0,s=e.length;i<s;++i){var a=e[i];if("number"==typeof a)r+=a;else if(a instanceof t.Variable)o.setDefault(a,n).second+=1;else{if(!(a instanceof Array))throw new Error("invalid Expression argument: "+a);if(2!==a.length)throw new Error("array must have length 2");var l=a[0],u=a[1];if("number"!=typeof l)throw new Error("array item 0 must be a number");if(!(u instanceof t.Variable))throw new Error("array item 1 must be a variable");o.setDefault(u,n).second+=l}}return{terms:o,constant:r}}var r=function(){function t(){var t=e(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.terms=function(){return this._terms},t.prototype.constant=function(){return this._constant},t.prototype.value=function(){var t=this._constant;return n.forEach(this._terms,function(e){t+=e.first.value()*e.second}),t},t}();t.Expression=r}(i||(i={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var i;!function(t){!function(t){function e(t,e,r,n){"undefined"==typeof n&&(n=1);var o=0;return o+=1e6*Math.max(0,Math.min(1e3,t*n)),o+=1e3*Math.max(0,Math.min(1e3,e*n)),o+=Math.max(0,Math.min(1e3,r*n))}function r(e){return Math.max(0,Math.min(t.required,e))}t.create=e,t.required=e(1e3,1e3,1e3),t.strong=e(1,0,0),t.medium=e(0,1,0),t.weak=e(0,0,1),t.clip=r}(t.Strength||(t.Strength={}));t.Strength}(i||(i={}));/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var i;!function(t){function e(t){var e=1e-8;return t<0?-t<e:t<e}function r(){return t.createMap(t.Constraint.Compare)}function n(){return t.createMap(l.Compare)}function o(){return t.createMap(t.Variable.Compare)}function i(){return t.createMap(t.Variable.Compare)}var s=function(){function s(){this._cnMap=r(),this._rowMap=n(),this._varMap=o(),this._editMap=i(),this._infeasibleRows=[],this._objective=new h,this._artificial=null,this._idTick=0}return s.prototype.addConstraint=function(t){var r=this._cnMap.find(t);if(void 0!==r)throw new Error("duplicate constraint");var n=this._createRow(t),o=n.row,i=n.tag,s=this._chooseSubject(o,i);if(0===s.type()&&o.allDummies()){if(!e(o.constant()))throw new Error("unsatisfiable constraint");s=i.marker}if(0===s.type()){if(!this._addWithArtificialVariable(o)){for(var a,l="",u=0;a=t._expression._terms._array[u];u++)l+=a.first._name,l+=", ";var h=["LE","GE","EQ"];throw new Error("Unsatisfiable constraint ["+l.slice(0,-2)+"] operator: "+h[t._operator])}}else o.solveFor(s),this._substitute(s,o),this._rowMap.insert(s,o);this._cnMap.insert(t,i),this._optimize(this._objective)},s.prototype.removeConstraint=function(t){var e=this._cnMap.erase(t);if(void 0===e)throw new Error("unknown constraint");this._removeConstraintEffects(t,e.second);var r=e.second.marker,n=this._rowMap.erase(r);if(void 0===n){var o=this._getMarkerLeavingSymbol(r);if(0===o.type())throw new Error("failed to find leaving row");n=this._rowMap.erase(o),n.second.solveForEx(o,r),this._substitute(r,n.second)}this._optimize(this._objective)},s.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},s.prototype.addEditVariable=function(e,r){var n=this._editMap.find(e);if(void 0!==n)throw new Error("duplicate edit variable");if(r=t.Strength.clip(r),r===t.Strength.required)throw new Error("bad required strength");var o=new t.Expression(e),i=new t.Constraint(o,2,r);this.addConstraint(i);var s=this._cnMap.find(i).second,a={tag:s,constraint:i,constant:0};this._editMap.insert(e,a)},s.prototype.removeEditVariable=function(t){var e=this._editMap.erase(t);if(void 0===e)throw new Error("unknown edit variable");this.removeConstraint(e.second.constraint)},s.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},s.prototype.suggestValue=function(t,e){var r=this._editMap.find(t);if(void 0===r)throw new Error("unknown edit variable");var n=this._rowMap,o=r.second,i=e-o.constant;o.constant=e;var s=o.tag.marker,a=n.find(s);if(void 0!==a)return a.second.add(-i)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=o.tag.other,a=n.find(l);if(void 0!==a)return a.second.add(i)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var u=0,h=n.size();u<h;++u){var a=n.itemAt(u),c=a.second,p=c.coefficientFor(s);0!==p&&c.add(i*p)<0&&1!==a.first.type()&&this._infeasibleRows.push(a.first)}this._dualOptimize()},s.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,r=0,n=t.size();r<n;++r){var o=t.itemAt(r),i=e.find(o.second);void 0!==i?o.first.setValue(i.second.constant()):o.first.setValue(0)}},s.prototype._getVarSymbol=function(t){var e=this,r=function(){return e._makeSymbol(1)};return this._varMap.setDefault(t,r).second},s.prototype._createRow=function(r){for(var n=r.expression(),o=new h(n.constant()),i=n.terms(),s=0,a=i.size();s<a;++s){var l=i.itemAt(s);if(!e(l.second)){var c=this._getVarSymbol(l.first),p=this._rowMap.find(c);void 0!==p?o.insertRow(p.second,l.second):o.insertSymbol(c,l.second)}}var _=this._objective,d=r.strength(),f={marker:u,other:u};switch(r.op()){case 0:case 1:var m=0===r.op()?1:-1,g=this._makeSymbol(2);if(f.marker=g,o.insertSymbol(g,m),d<t.Strength.required){var y=this._makeSymbol(3);f.other=y,o.insertSymbol(y,-m),_.insertSymbol(y,d)}break;case 2:if(d<t.Strength.required){var v=this._makeSymbol(3),b=this._makeSymbol(3);f.marker=v,f.other=b,o.insertSymbol(v,-1),o.insertSymbol(b,1),_.insertSymbol(v,d),_.insertSymbol(b,d)}else{var x=this._makeSymbol(4);f.marker=x,o.insertSymbol(x)}}return o.constant()<0&&o.reverseSign(),{row:o,tag:f}},s.prototype._chooseSubject=function(t,e){for(var r=t.cells(),n=0,o=r.size();n<o;++n){var i=r.itemAt(n);if(1===i.first.type())return i.first}var s=e.marker.type();return(2===s||3===s)&&t.coefficientFor(e.marker)<0?e.marker:(s=e.other.type(),(2===s||3===s)&&t.coefficientFor(e.other)<0?e.other:u)},s.prototype._addWithArtificialVariable=function(t){var r=this._makeSymbol(2);this._rowMap.insert(r,t.copy()),this._artificial=t.copy(),this._optimize(this._artificial);var n=e(this._artificial.constant());this._artificial=null;var o=this._rowMap.erase(r);if(void 0!==o){var i=o.second;if(i.isConstant())return n;var s=this._anyPivotableSymbol(i);if(0===s.type())return!1;i.solveForEx(r,s),this._substitute(s,i),this._rowMap.insert(s,i)}for(var a=this._rowMap,l=0,u=a.size();l<u;++l)a.itemAt(l).second.removeSymbol(r);return this._objective.removeSymbol(r),n},s.prototype._substitute=function(t,e){for(var r=this._rowMap,n=0,o=r.size();n<o;++n){var i=r.itemAt(n);i.second.substitute(t,e),i.second.constant()<0&&1!==i.first.type()&&this._infeasibleRows.push(i.first)}this._objective.substitute(t,e),this._artificial&&this._artificial.substitute(t,e)},s.prototype._optimize=function(t){for(;;){var e=this._getEnteringSymbol(t);if(0===e.type())return;var r=this._getLeavingSymbol(e);if(0===r.type())throw new Error("the objective is unbounded");var n=this._rowMap.erase(r).second;n.solveForEx(r,e),this._substitute(e,n),this._rowMap.insert(e,n)}},s.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var r=e.pop(),n=t.find(r);if(void 0!==n&&n.second.constant()<0){var o=this._getDualEnteringSymbol(n.second);if(0===o.type())throw new Error("dual optimize failed");var i=n.second;t.erase(r),i.solveForEx(r,o),this._substitute(o,i),t.insert(o,i)}}},s.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),r=0,n=e.size();r<n;++r){var o=e.itemAt(r),i=o.first;if(o.second<0&&4!==i.type())return i}return u},s.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,r=u,n=t.cells(),o=0,i=n.size();o<i;++o){var s=n.itemAt(o),a=s.first,l=s.second;if(l>0&&4!==a.type()){var h=this._objective.coefficientFor(a),c=h/l;c<e&&(e=c,r=a)}}return r},s.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,r=u,n=this._rowMap,o=0,i=n.size();o<i;++o){var s=n.itemAt(o),a=s.first;if(1!==a.type()){var l=s.second,h=l.coefficientFor(t);if(h<0){var c=-l.constant()/h;c<e&&(e=c,r=a)}}}return r},s.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,r=e,n=e,o=u,i=o,s=o,a=o,l=this._rowMap,h=0,c=l.size();h<c;++h){var p=l.itemAt(h),_=p.second,d=_.coefficientFor(t);if(0!==d){var f=p.first;if(1===f.type())a=f;else if(d<0){var m=-_.constant()/d;m<r&&(r=m,i=f)}else{var m=_.constant()/d;m<n&&(n=m,s=f)}}}return i!==o?i:s!==o?s:a},s.prototype._removeConstraintEffects=function(t,e){3===e.marker.type()&&this._removeMarkerEffects(e.marker,t.strength()),3===e.other.type()&&this._removeMarkerEffects(e.other,t.strength())},s.prototype._removeMarkerEffects=function(t,e){var r=this._rowMap.find(t);void 0!==r?this._objective.insertRow(r.second,-e):this._objective.insertSymbol(t,-e)},s.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),r=0,n=e.size();r<n;++r){var o=e.itemAt(r),i=o.first.type();if(2===i||3===i)return o.first}return u},s.prototype._makeSymbol=function(t){return new l(t,(this._idTick++))},s}();t.Solver=s;var a;!function(t){t[t.Invalid=0]="Invalid",t[t.External=1]="External",t[t.Slack=2]="Slack",t[t.Error=3]="Error",t[t.Dummy=4]="Dummy"}(a||(a={}));var l=function(){function t(t,e){this._id=e,this._type=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.type=function(){return this._type},t}(),u=new l(0,(-1)),h=function(){function r(e){"undefined"==typeof e&&(e=0),this._cellMap=t.createMap(l.Compare),this._constant=e}return r.prototype.cells=function(){return this._cellMap},r.prototype.constant=function(){return this._constant},r.prototype.isConstant=function(){return this._cellMap.empty()},r.prototype.allDummies=function(){for(var t=this._cellMap,e=0,r=t.size();e<r;++e){var n=t.itemAt(e);if(4!==n.first.type())return!1}return!0},r.prototype.copy=function(){var t=new r(this._constant);return t._cellMap=this._cellMap.copy(),t},r.prototype.add=function(t){return this._constant+=t},r.prototype.insertSymbol=function(t,r){"undefined"==typeof r&&(r=1);var n=this._cellMap.setDefault(t,function(){return 0});e(n.second+=r)&&this._cellMap.erase(t)},r.prototype.insertRow=function(t,e){"undefined"==typeof e&&(e=1),this._constant+=t._constant*e;for(var r=t._cellMap,n=0,o=r.size();n<o;++n){var i=r.itemAt(n);this.insertSymbol(i.first,i.second*e)}},r.prototype.removeSymbol=function(t){this._cellMap.erase(t)},r.prototype.reverseSign=function(){this._constant=-this._constant;for(var t=this._cellMap,e=0,r=t.size();e<r;++e){var n=t.itemAt(e);n.second=-n.second}},r.prototype.solveFor=function(t){var e=this._cellMap,r=e.erase(t),n=-1/r.second;this._constant*=n;for(var o=0,i=e.size();o<i;++o)e.itemAt(o).second*=n},r.prototype.solveForEx=function(t,e){this.insertSymbol(t,-1),this.solveFor(e)},r.prototype.coefficientFor=function(t){var e=this._cellMap.find(t);return void 0!==e?e.second:0},r.prototype.substitute=function(t,e){var r=this._cellMap.erase(t);void 0!==r&&this.insertRow(e,r.second)},r}()}(i||(i={})),/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
e.exports=i},{}]},{},["main"])}();/*
Copyright (c) 2012, Continuum Analytics, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of Continuum Analytics nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*/