-
Notifications
You must be signed in to change notification settings - Fork 10
/
render_js.txt
executable file
·270 lines (239 loc) · 957 KB
/
render_js.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<script type="text/javascript">
/* BEGIN bokeh.min.js */
!function(t,e){t.Bokeh=function(t,e,n){var i={},r=function(n){var o=null!=e[n]?e[n]:n;if(!i[o]){if(!t[o]){var s=new Error("Cannot find module '"+n+"'");throw s.code="MODULE_NOT_FOUND",s}var a=i[o]={exports:{}};t[o].call(a.exports,r,a,a.exports)}return i[o].exports},o=r(49);return o.require=r,o.register_plugin=function(n,i,s){for(var a in n)t[a]=n[a];for(var a in i)e[a]=i[a];var l=r(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,n){var i=t(135),r=t(30);n.overrides={};var o=r.clone(i);n.Models=function(t){var e=n.overrides[t]||o[t];if(null==e)throw new Error("Model '"+t+"' does not exist. This could be due to a widget\n or a custom model not being registered before first usage.");return e},n.Models.register=function(t,e){n.overrides[t]=e},n.Models.unregister=function(t){delete n.overrides[t]},n.Models.register_models=function(t,e,n){if(void 0===e&&(e=!1),null!=t)for(var i in t){var r=t[i];e||!o.hasOwnProperty(i)?o[i]=r:null!=n?n(i):console.warn("Model '"+i+"' was already registered")}},n.register_models=n.Models.register_models,n.Models.registered_names=function(){return Object.keys(o)},n.index={}},function(t,e,n){var i=t(302),r=t(14),o=t(47),s=t(245),a=t(246),l=t(2);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_SESSION_ID="default";var u=0,h=function(){function t(t,e,i,o,s){void 0===t&&(t=n.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=n.DEFAULT_SESSION_ID),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),this.url=t,this.id=e,this.args_string=i,this._on_have_session_hook=o,this._on_closed_permanently_hook=s,this._number=u++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this._receiver=new a.Receiver,r.logger.debug("Creating websocket "+this._number+" to '"+this.url+"' session '"+this.id+"'")}return t.prototype.connect=function(){var t=this;if(this.closed_permanently)return i.Promise.reject(new Error("Cannot connect() a closed ClientConnection"));if(null!=this.socket)return i.Promise.reject(new Error("Already connected"));this._pending_replies={},this._current_handler=null;try{var e=this.url+"?bokeh-protocol-version=1.0&bokeh-session-id="+this.id;return null!=this.args_string&&this.args_string.length>0&&(e+="&"+this.args_string),this.socket=new WebSocket(e),new i.Promise(function(e,n){t.socket.binaryType="arraybuffer",t.socket.onopen=function(){return t._on_open(e,n)},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(n)}})}catch(t){return r.logger.error("websocket creation failed to url: "+this.url),r.logger.error(" - "+t),i.Promise.reject(t)}},t.prototype.close=function(){this.closed_permanently||(r.logger.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.session._connection_closed(),null!=this._on_closed_permanently_hook&&(this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null))},t.prototype._schedule_reconnect=function(t){var e=this;setTimeout(function(){e.closed_permanently||r.logger.info("Websocket connection "+e._number+" disconnected, will not attempt to reconnect");return},t)},t.prototype.send=function(t){if(null==this.socket)throw new Error("not connected so cannot send "+t);t.send(this.socket)},t.prototype.send_with_reply=function(t){var e=this,n=new i.Promise(function(n,i){e._pending_replies[t.msgid()]=[n,i],e.send(t)});return n.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=s.Message.create("PULL-DOC-REQ",{}),e=this.send_with_reply(t);return 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(){var t=this;null==this.session?r.logger.debug("Pulling session for first time"):r.logger.debug("Repulling session"),this._pull_doc_json().then(function(e){if(null==t.session)if(t.closed_permanently)r.logger.debug("Got new document after connection was already closed");else{var n=o.Document.from_json(e),i=o.Document._compute_patch_since_json(e,n);if(i.events.length>0){r.logger.debug("Sending "+i.events.length+" changes from model construction back to server");var a=s.Message.create("PATCH-DOC",{},i);t.send(a)}t.session=new l.ClientSession(t,n,t.id),r.logger.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)}else t.session.document.replace_with_json(e),r.logger.debug("Updated existing session with new pulled doc")},function(t){throw t}).catch(function(t){null!=console.trace&&console.trace(t),r.logger.error("Failed to repull session "+t)})},t.prototype._on_open=function(t,e){var n=this;r.logger.info("Websocket connection "+this._number+" is now open"),this._pending_ack=[t,e],this._current_handler=function(t){n._awaiting_ack_handler(t)}},t.prototype._on_message=function(t){null==this._current_handler&&r.logger.error("Got a message with no current handler set");try{this._receiver.consume(t.data)}catch(t){this._close_bad_protocol(t.toString())}if(null!=this._receiver.message){var e=this._receiver.message,n=e.problem();null!=n&&this._close_bad_protocol(n),this._current_handler(e)}},t.prototype._on_close=function(t){var e=this;r.logger.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);for(var n=function(){for(var t in e._pending_replies){var n=e._pending_replies[t];return delete e._pending_replies[t],n}return null},i=n();null!=i;)i[1]("Disconnected"),i=n();this.closed_permanently||this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){r.logger.debug("Websocket error on socket "+this._number),t(new Error("Could not open websocket"))},t.prototype._close_bad_protocol=function(t){r.logger.error("Closing connection: "+t),null!=this.socket&&this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){var e=this;"ACK"===t.msgtype()?(this._current_handler=function(t){return e._steady_state_handler(t)},this._repull_session_doc(),null!=this._pending_ack&&(this._pending_ack[0](this),this._pending_ack=null)):this._close_bad_protocol("First message was not an ACK")},t.prototype._steady_state_handler=function(t){if(t.reqid()in this._pending_replies){var e=this._pending_replies[t.reqid()];delete this._pending_replies[t.reqid()],e[0](t)}else this.session.handle(t)},t}();n.ClientConnection=h,n.pull_session=function(t,e,n){var o;return new i.Promise(function(i,s){return(o=new h(t,e,n,function(t){try{i(t)}catch(e){throw r.logger.error("Promise handler threw an error, closing session "+e),t.close(),e}},function(){s(new Error("Connection was closed before we successfully pulled a session"))})).connect().then(function(t){},function(t){throw r.logger.error("Failed to connect to Bokeh server "+t),t})})}},function(t,e,n){var i=t(14),r=t(47),o=t(245),s=function(){function t(t,e,n){var i=this;this._connection=t,this.document=e,this.id=n,this._document_listener=function(t){return i._document_changed(t)},this.document.on_change(this._document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.handle=function(t){var e=t.msgtype();"PATCH-DOC"===e?this._handle_patch(t):"OK"===e?this._handle_ok(t):"ERROR"===e?this._handle_error(t):i.logger.debug("Doing nothing with message "+t.msgtype())},t.prototype.close=function(){this._connection.close()},t.prototype.send_event=function(t){var e=o.Message.create("EVENT",{},JSON.stringify(t));this._connection.send(e)},t.prototype._connection_closed=function(){this.document.remove_on_change(this._document_listener)},t.prototype.request_server_info=function(){var t=o.Message.create("SERVER-INFO-REQ",{}),e=this._connection.send_with_reply(t);return e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){if(t.setter_id!==this.id&&(!(t instanceof r.ModelChangedEvent)||t.attr in t.model.serializable_attributes())){var e=o.Message.create("PATCH-DOC",{},this.document.create_json_patch([t]));this._connection.send(e)}},t.prototype._handle_patch=function(t){this.document.apply_json_patch(t.content,t.buffers,this.id)},t.prototype._handle_ok=function(t){i.logger.trace("Unhandled OK reply to "+t.reqid())},t.prototype._handle_error=function(t){i.logger.error("Unhandled ERROR reply to "+t.reqid()+": "+t.content.text)},t}();n.ClientSession=s},function(t,e,n){function i(t){return function(e){e.prototype.event_name=t,a[t]=e}}var r=t(364),o=t(14),s=t(30),a={};n.register_event_class=i,n.register_with_event=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=t.prototype.applicable_models.concat(e);t.prototype.applicable_models=i};var l=function(){function t(t){void 0===t&&(t={}),this.model_id=null,this._options=t,t.model_id&&(this.model_id=t.model_id)}return t.prototype.set_model_id=function(t){return this._options.model_id=t,this.model_id=t,this},t.prototype.is_applicable_to=function(t){return this.applicable_models.some(function(e){return t instanceof e})},t.event_class=function(t){if(t.type)return a[t.type];o.logger.warn("BokehEvent.event_class required events with a string type attribute")},t.prototype.toJSON=function(){return{event_name:this.event_name,event_values:s.clone(this._options)}},t.prototype._customize_event=function(t){return this},t}();n.BokehEvent=l,l.prototype.applicable_models=[];var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("button_click")],e)}(l);n.ButtonClick=u;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(l);n.UIEvent=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("lodstart")],e)}(h);n.LODStart=c;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("lodend")],e)}(h);n.LODEnd=_;var p=function(t){function e(e){var n=t.call(this,e)||this;return n.geometry=e.geometry,n.final=e.final,n}return r.__extends(e,t),e=r.__decorate([i("selectiongeometry")],e)}(h);n.SelectionGeometry=p;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("reset")],e)}(h);n.Reset=d;var f=function(t){function e(e){var n=t.call(this,e)||this;return n.sx=e.sx,n.sy=e.sy,n.x=null,n.y=null,n}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,model_id:e})},e.prototype._customize_event=function(t){var e=t.plot_canvas.frame.xscales.default,n=t.plot_canvas.frame.yscales.default;return this.x=e.invert(this.sx),this.y=n.invert(this.sy),this._options.x=this.x,this._options.y=this.y,this},e}(h);n.PointEvent=f;var m=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.delta_x=e.delta_x,n.delta_y=e.delta_y,n}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,delta_x:t.deltaX,delta_y:t.deltaY,direction:t.direction,model_id:e})},e=r.__decorate([i("pan")],e)}(f);n.Pan=m;var v=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.scale=e.scale,n}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,scale:t.scale,model_id:e})},e=r.__decorate([i("pinch")],e)}(f);n.Pinch=v;var g=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.delta=e.delta,n}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,delta:t.bokeh.delta,model_id:e})},e=r.__decorate([i("wheel")],e)}(f);n.MouseWheel=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("mousemove")],e)}(f);n.MouseMove=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("mouseenter")],e)}(f);n.MouseEnter=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("mouseleave")],e)}(f);n.MouseLeave=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("tap")],e)}(f);n.Tap=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("doubletap")],e)}(f);n.DoubleTap=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("press")],e)}(f);n.Press=S;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("panstart")],e)}(f);n.PanStart=T;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("panend")],e)}(f);n.PanEnd=M;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("pinchstart")],e)}(f);n.PinchStart=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([i("pinchend")],e)}(f);n.PinchEnd=E},function(t,e,n){var i=t(22),r=t(30);n.build_views=function(t,e,n,o){void 0===o&&(o=function(t){return t.default_view});for(var s=0,a=i.difference(Object.keys(t),e.map(function(t){return t.id}));s<a.length;s++){var l=a[s];t[l].remove(),delete t[l]}for(var u=[],h=0,c=e.filter(function(e){return null==t[e.id]});h<c.length;h++){var _=c[h],p=o(_),d=r.extend({},n,{model:_,connect_signals:!1}),f=new p(d);t[_.id]=f,u.push(f)}for(var m=0,v=u;m<v.length;m++){var f=v[m];f.connect_signals()}return u},n.remove_views=function(t){for(var e in t)t[e].remove(),delete t[e]}},function(t,e,n){function i(t,e){var n=Element.prototype,i=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return i.call(t,e)}var r=t(42),o=function(t){return function(e){function n(t){if(t instanceof HTMLElement)s.appendChild(t);else if(r.isString(t))s.appendChild(document.createTextNode(t));else if(null!=t&&!1!==t)throw new Error("expected an HTMLElement, string, false or null, got "+JSON.stringify(t))}void 0===e&&(e={});for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var s=document.createElement(t);for(var a in e){var l=e[a];if(null!=l&&(!r.isBoolean(l)||l))if("class"===a&&r.isArray(l))for(var u=0,h=l;u<h.length;u++){var c=h[u];null!=c&&s.classList.add(c)}else if("style"===a&&r.isObject(l))for(var _ in l)s.style[_]=l[_];else if("data"===a&&r.isObject(l))for(var p in l)s.dataset[p]=l[p];else s.setAttribute(a,l)}for(var d=0,f=i;d<f.length;d++){var m=f[d];if(r.isArray(m))for(var v=0,g=m;v<g.length;v++){var y=g[v];n(y)}else n(m)}return s}};n.createElement=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return o(t).apply(void 0,[e].concat(n))},n.div=o("div"),n.span=o("span"),n.link=o("link"),n.style=o("style"),n.a=o("a"),n.p=o("p"),n.pre=o("pre"),n.button=o("button"),n.label=o("label"),n.input=o("input"),n.select=o("select"),n.option=o("option"),n.optgroup=o("optgroup"),n.canvas=o("canvas"),n.ul=o("ul"),n.ol=o("ol"),n.li=o("li"),n.nbsp=document.createTextNode(" "),n.removeElement=function(t){var e=t.parentNode;null!=e&&e.removeChild(t)},n.replaceWith=function(t,e){var n=t.parentNode;null!=n&&n.replaceChild(e,t)},n.prepend=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=t.firstChild,r=0,o=e;r<o.length;r++){var s=o[r];t.insertBefore(s,i)}},n.empty=function(t){var e;for(;e=t.firstChild;)t.removeChild(e)},n.show=function(t){t.style.display=""},n.hide=function(t){t.style.display="none"},n.position=function(t){return{top:t.offsetTop,left:t.offsetLeft}},n.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},n.matches=i,n.parent=function(t,e){var n=t;for(;n=n.parentElement;)if(i(n,e))return n;return null};!function(t){t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Esc=27]="Esc",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.Up=38]="Up",t[t.Down=40]="Down"}(n.Keys||(n.Keys={}))},function(t,e,n){var i=t(364),r=t(45),o=t(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._has_finished=!1,this.el=this._createElement()},e.prototype.remove=function(){o.removeElement(this.el),t.prototype.remove.call(this)},e.prototype.layout=function(){},e.prototype.render=function(){},e.prototype.renderTo=function(t,e){void 0===e&&(e=!1),e?o.replaceWith(t,this.el):t.appendChild(this.el),this.layout()},e.prototype.has_finished=function(){return this._has_finished},Object.defineProperty(e.prototype,"_root_element",{get:function(){return o.parent(this.el,".bk-root")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"solver",{get:function(){return this.is_root?this._solver:this.parent.solver},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_idle",{get:function(){return this.has_finished()},enumerable:!0,configurable:!0}),e.prototype._createElement=function(){return o.createElement(this.tagName,{id:this.id,class:this.className})},e}(r.View);n.DOMView=s,s.prototype.tagName="div",s.prototype.className=null},function(t,e,n){n.AngleUnits=["deg","rad"],n.Dimension=["width","height"],n.Dimensions=["width","height","both"],n.Direction=["clock","anticlock"],n.FontStyle=["normal","italic","bold"],n.LatLon=["lat","lon"],n.LineCap=["butt","round","square"],n.LineJoin=["miter","round","bevel"],n.Location=["above","below","left","right"],n.LegendLocation=["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"],n.Orientation=["vertical","horizontal"],n.OutputBackend=["canvas","svg","webgl"],n.RenderLevel=["image","underlay","glyph","annotation","overlay"],n.RenderMode=["canvas","css"],n.Side=["left","right"],n.SpatialUnits=["screen","data"],n.StartEnd=["start","end"],n.VerticalAlign=["top","middle","bottom"],n.TextAlign=["left","right","center"],n.TextBaseline=["top","middle","bottom","alphabetic","hanging","ideographic"],n.DistributionTypes=["uniform","normal"],n.StepModes=["after","before","center"],n.SizingMode=["stretch_both","scale_width","scale_height","scale_both","fixed"],n.PaddingUnits=["percent","absolute"]},function(t,e,n){var i=t(364),r=t(20),o=t(16),s=t(33),a=t(15),l=t(37),u=t(22),h=t(30),c=t(42),_=t(28),p=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n={});var i=t.call(this)||this;i._subtype=void 0,i.document=null,i.destroyed=new r.Signal(i,"destroyed"),i.change=new r.Signal(i,"change"),i.transformchange=new r.Signal(i,"transformchange"),i.attributes={},i.properties={},i._set_after_defaults={},i._pending=!1,i._changing=!1;for(var o in i.props){var s=i.props[o],a=s.type,u=s.default_value;if(null==a)throw new Error("undefined property type for "+i.type+"."+o);i.properties[o]=new a(i,o,u)}return null==e.id&&i.setv(["id",l.uniqueId()],{silent:!0}),i.setv(e,h.extend({silent:!0},n)),n.defer_initialization||i.finalize(e,n),i}return i.__extends(e,t),e.getters=function(t){for(var e in t){var n=t[e];Object.defineProperty(this.prototype,e,{get:n})}},e._fix_default=function(t,e){return void 0===t?void 0:c.isFunction(t)?t:c.isObject(t)?c.isArray(t)?function(){return u.copy(t)}:function(){return h.clone(t)}:function(){return t}},e.define=function(t){var e=function(e){var i=t[e];if(null!=n.prototype.props[e])throw new Error("attempted to redefine property '"+n.prototype.type+"."+e+"'");if(null!=n.prototype[e])throw new Error("attempted to redefine attribute '"+n.prototype.type+"."+e+"'");Object.defineProperty(n.prototype,e,{get:function(){var t=this.getv(e);return t},set:function(t){return this.setv([e,t]),this},configurable:!1,enumerable:!0});var r=i[0],o=i[1],s=i[2],a={type:r,default_value:n._fix_default(o,e),internal:s||!1},l=h.clone(n.prototype.props);l[e]=a,n.prototype.props=l},n=this;for(var i in t)e(i)},e.internal=function(t){var e={};for(var n in t){var i=t[n],r=i[0],o=i[1];e[n]=[r,o,!0]}this.define(e)},e.mixin=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.define(o.create(t));var n=this.prototype.mixins.concat(t);this.prototype.mixins=n},e.mixins=function(t){this.mixin.apply(this,t)},e.override=function(t){for(var e in t){var n=this._fix_default(t[e],e),i=this.prototype.props[e];if(null==i)throw new Error("attempted to override nonexistent '"+this.prototype.type+"."+e+"'");var r=h.clone(this.prototype.props);r[e]=h.extend({},i,{default_value:n}),this.prototype.props=r}},e.prototype.toString=function(){return this.type+"("+this.id+")"},e.prototype.finalize=function(t,e){var n=this;for(var i in this.properties){var r=this.properties[i];r.update(),null!=r.spec.transform&&this.connect(r.spec.transform.change,function(){return n.transformchange.emit(void 0)})}this.initialize(t,e),this.connect_signals()},e.prototype.initialize=function(t,e){},e.prototype.connect_signals=function(){},e.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},e.prototype.destroy=function(){this.disconnect_signals(),this.destroyed.emit(void 0)},e.prototype.clone=function(){return new this.constructor(this.attributes)},e.prototype._setv=function(t,e){var n=e.check_eq,i=e.silent,r=[],o=this._changing;this._changing=!0;var s=this.attributes;for(var a in t){var l=t[a];!1!==n?_.isEqual(s[a],l)||r.push(a):r.push(a),s[a]=l}if(!i){r.length>0&&(this._pending=!0);for(var u=0;u<r.length;u++)this.properties[r[u]].change.emit(s[r[u]])}if(!o){if(!i&&!e.no_change)for(;this._pending;)this._pending=!1,this.change.emit(void 0);this._pending=!1,this._changing=!1}},e.prototype.setv=function(t,e){void 0===e&&(e={});var n={};if(c.isArray(t)){var i=t,r=i[0],o=i[1];n[r]=o}else n=t;for(var s in n)if(n.hasOwnProperty(s)){var a=s;if(null==this.props[a])throw new Error("property "+this.type+"."+a+" wasn't declared");null!=e&&e.defaults||(this._set_after_defaults[s]=!0)}if(!h.isEmpty(n)){var l={};for(var s in n)l[s]=this.getv(s);this._setv(n,e);var u=e.silent;if(null==u||!u)for(var s in n)this._tell_document_about_change(s,l[s],this.getv(s),e)}},e.prototype.getv=function(t){if(null==this.props[t])throw new Error("property "+this.type+"."+t+" wasn't declared");return this.attributes[t]},e.prototype.ref=function(){return s.create_ref(this)},e.prototype.set_subtype=function(t){this._subtype=t},e.prototype.attribute_is_serializable=function(t){var e=this.props[t];if(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={};for(var e in this.attributes){var n=this.attributes[e];this.attribute_is_serializable(e)&&(t[e]=n)}return t},e._value_to_json=function(t,n,i){if(n instanceof e)return n.ref();if(c.isArray(n)){for(var r=[],o=0;o<n.length;o++){var s=n[o];r.push(e._value_to_json(o.toString(),s,n))}return r}if(c.isObject(n)){var a={};for(var l in n)n.hasOwnProperty(l)&&(a[l]=e._value_to_json(l,n[l],n));return a}return n},e.prototype.attributes_as_json=function(t,n){void 0===t&&(t=!0),void 0===n&&(n=e._value_to_json);var i=this.serializable_attributes(),r={};for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];t?r[o]=s:o in this._set_after_defaults&&(r[o]=s)}return n("attributes",r,this)},e._json_record_references=function(t,n,i,r){if(null==n);else if(s.is_ref(n)){if(!(n.id in i)){var o=t.get_model_by_id(n.id);e._value_record_references(o,i,r)}}else if(c.isArray(n))for(var a=0,l=n;a<l.length;a++){var u=l[a];e._json_record_references(t,u,i,r)}else if(c.isObject(n))for(var h in n)if(n.hasOwnProperty(h)){var u=n[h];e._json_record_references(t,u,i,r)}},e._value_record_references=function(t,n,i){if(null==t);else if(t instanceof e){if(!(t.id in n)&&(n[t.id]=t,i))for(var r=t._immediate_references(),o=0,s=r;o<s.length;o++){var a=s[o];e._value_record_references(a,n,!0)}}else if(t.buffer instanceof ArrayBuffer);else if(c.isArray(t))for(var l=0,u=t;l<u.length;l++){var h=u[l];e._value_record_references(h,n,i)}else if(c.isObject(t))for(var _ in t)if(t.hasOwnProperty(_)){var h=t[_];e._value_record_references(h,n,i)}},e.prototype._immediate_references=function(){var t={},n=this.serializable_attributes();for(var i in n){var r=n[i];e._value_record_references(r,t,!1)}return h.values(t)},e.prototype.references=function(){var t={};return e._value_record_references(this,t,!0),h.values(t)},e.prototype._doc_attached=function(){},e.prototype.attach_document=function(t){if(null!=this.document&&this.document!=t)throw new Error("models must be owned by only a single document");this.document=t,this._doc_attached()},e.prototype.detach_document=function(){this.document=null},e.prototype._tell_document_about_change=function(t,n,i,r){if(this.attribute_is_serializable(t)&&null!=this.document){var o={};e._value_record_references(i,o,!1);var s={};e._value_record_references(n,s,!1);var a=!1;for(var l in o)if(!(l in s)){a=!0;break}if(!a)for(var u in s)if(!(u in o)){a=!0;break}a&&this.document._invalidate_all_models(),this.document._notify_change(this,t,n,i,r)}},e.prototype.materialize_dataspecs=function(t){var e={};for(var n in this.properties){var i=this.properties[n];i.dataspec&&((!i.optional||null!=i.spec.value||n in this._set_after_defaults)&&(e["_"+n]=i.array(t),null!=i.spec.field&&i.spec.field in t._shapes&&(e["_"+n+"_shape"]=t._shapes[i.spec.field]),i instanceof a.Distance&&(e["max_"+n]=u.max(e["_"+n]))))}return e},e}(r.Signalable());n.HasProps=p,p.prototype.type="HasProps",p.prototype.props={},p.prototype.mixins=[],p.define({id:[a.Any]})},function(t,e,n){function i(t){return t*t}function r(t,e,n,r){return i(t-n)+i(e-r)}function o(t,e,n){var i=r(e.x,e.y,n.x,n.y);if(0==i)return r(t.x,t.y,e.x,e.y);var o=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i;return o<0?r(t.x,t.y,e.x,e.y):o>1?r(t.x,t.y,n.x,n.y):r(t.x,t.y,e.x+o*(n.x-e.x),e.y+o*(n.y-e.y))}var s=t(22),a=t(30);n.point_in_poly=function(t,e,n,i){for(var r=!1,o=n[n.length-1],s=i[i.length-1],a=0;a<n.length;a++){var l=n[a],u=i[a];s<e!=u<e&&o+(e-s)/(u-s)*(l-o)<t&&(r=!r),o=l,s=u}return r};var l=function(){return null},u=function(){function t(){this["0d"]={glyph:null,get_view:l,indices:[]},this["1d"]={indices:[]},this["2d"]={indices:{}}}return Object.defineProperty(t.prototype,"_0d",{get:function(){return this["0d"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_1d",{get:function(){return this["1d"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_2d",{get:function(){return this["2d"]},enumerable:!0,configurable:!0}),t.prototype.is_empty=function(){return 0==this._0d.indices.length&&0==this._1d.indices.length&&a.isEmpty(this._2d.indices)},t.prototype.update_through_union=function(t){this._0d.indices=s.union(t._0d.indices,this._0d.indices),this._0d.glyph=t._0d.glyph||this._0d.glyph,this._1d.indices=s.union(t._1d.indices,this._1d.indices),this._2d.indices=a.merge(t._2d.indices,this._2d.indices)},t}();n.HitTestResult=u,n.create_hit_test_result=function(){return new u},n.create_1d_hit_test_result=function(t){var e=new u;return e._1d.indices=s.sortBy(t,function(t){return t[0],t[1]}).map(function(t){var e=t[0];return t[1],e}),e},n.validate_bbox_coords=function(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];n>i&&(s=[i,n],n=s[0],i=s[1]);r>o&&(a=[o,r],r=a[0],o=a[1]);return{minX:n,minY:r,maxX:i,maxY:o};var s,a},n.dist_2_pts=r,n.dist_to_segment_squared=o,n.dist_to_segment=function(t,e,n){return Math.sqrt(o(t,e,n))},n.check_2_segments_intersect=function(t,e,n,i,r,o,s,a){var l=(a-o)*(n-t)-(s-r)*(i-e);if(0==l)return{hit:!1,x:null,y:null};var u=e-o,h=t-r,c=(s-r)*u-(a-o)*h,_=(n-t)*u-(i-e)*h;h=_/l;var p=t+(u=c/l)*(n-t),d=e+u*(i-e);return{hit:u>0&&u<1&&h>0&&h<1,x:p,y:d}}},function(t,e,n){var i=t(13),r=t(22);n.vstack=function(t,e){var n=[];if(e.length>0){n.push(i.EQ(r.head(e)._bottom,[-1,t._bottom])),n.push(i.EQ(r.tail(e)._top,[-1,t._top])),n.push.apply(n,r.pairwise(e,function(t,e){return i.EQ(t._top,[-1,e._bottom])}));for(var o=0,s=e;o<s.length;o++){var a=s[o];n.push(i.EQ(a._left,[-1,t._left])),n.push(i.EQ(a._right,[-1,t._right]))}}return n},n.hstack=function(t,e){var n=[];if(e.length>0){n.push(i.EQ(r.head(e)._right,[-1,t._right])),n.push(i.EQ(r.tail(e)._left,[-1,t._left])),n.push.apply(n,r.pairwise(e,function(t,e){return i.EQ(t._left,[-1,e._right])}));for(var o=0,s=e;o<s.length;o++){var a=s[o];n.push(i.EQ(a._top,[-1,t._top])),n.push(i.EQ(a._bottom,[-1,t._bottom]))}}return n}},function(t,e,n){var i=t(364),r=t(13),o=t(8),s=t(23),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this._top=new r.Variable(this.toString()+".top"),this._left=new r.Variable(this.toString()+".left"),this._width=new r.Variable(this.toString()+".width"),this._height=new r.Variable(this.toString()+".height"),this._right=new r.Variable(this.toString()+".right"),this._bottom=new r.Variable(this.toString()+".bottom"),this._hcenter=new r.Variable(this.toString()+".hcenter"),this._vcenter=new r.Variable(this.toString()+".vcenter")},e.prototype.get_editables=function(){return[]},e.prototype.get_constraints=function(){return[r.GE(this._top),r.GE(this._bottom),r.GE(this._left),r.GE(this._right),r.GE(this._width),r.GE(this._height),r.EQ(this._left,this._width,[-1,this._right]),r.EQ(this._top,this._height,[-1,this._bottom]),r.EQ([2,this._hcenter],[-1,this._left],[-1,this._right]),r.EQ([2,this._vcenter],[-1,this._top],[-1,this._bottom])]},Object.defineProperty(e.prototype,"bbox",{get:function(){return new s.BBox({x0:this._left.value,y0:this._top.value,x1:this._right.value,y1:this._bottom.value})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layout_bbox",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,hcenter:this._hcenter.value,vcenter:this._vcenter.value}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xview",{get:function(){var t=this;return{compute:function(e){return t._left.value+e},v_compute:function(e){for(var n=new Float64Array(e.length),i=t._left.value,r=0;r<e.length;r++)n[r]=i+e[r];return n}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yview",{get:function(){var t=this;return{compute:function(e){return t._bottom.value-e},v_compute:function(e){for(var n=new Float64Array(e.length),i=t._bottom.value,r=0;r<e.length;r++)n[r]=i-e[r];return n}}},enumerable:!0,configurable:!0}),e}(o.HasProps);n.LayoutCanvas=a,a.prototype.type="LayoutCanvas"},function(t,e,n){var i,r,o,s,a,l,u,h,c,_=t(364),p=t(13),d=t(11),f=t(15),m=t(14),v=t(42);c=Math.PI/2,u={above:{parallel:0,normal:-c,horizontal:0,vertical:-c},below:{parallel:0,normal:c,horizontal:0,vertical:c},left:{parallel:-c,normal:0,horizontal:0,vertical:-c},right:{parallel:c,normal:0,horizontal:0,vertical:c}},h={above:{justified:"top",parallel:i="alphabetic",normal:o="middle",horizontal:i,vertical:o},below:{justified:"bottom",parallel:"hanging",normal:o,horizontal:"hanging",vertical:o},left:{justified:"top",parallel:i,normal:o,horizontal:o,vertical:i},right:{justified:"top",parallel:i,normal:o,horizontal:o,vertical:i}},s={above:{justified:r="center",parallel:r,normal:"left",horizontal:r,vertical:"left"},below:{justified:r,parallel:r,normal:"left",horizontal:r,vertical:"left"},left:{justified:r,parallel:r,normal:"right",horizontal:"right",vertical:r},right:{justified:r,parallel:r,normal:"left",horizontal:"left",vertical:r}},a={above:"right",below:"left",left:"right",right:"left"},l={above:"left",below:"right",left:"right",right:"left"},n._view_sizes=new WeakMap,n.update_panel_constraints=function(t){var e,i;if(i=t.get_size(),e=t.solver,null!=t._size_constraint&&e.has_constraint(t._size_constraint)){if(n._view_sizes.get(t)===i)return;e.remove_constraint(t._size_constraint)}return n._view_sizes.set(t,i),t._size_constraint=p.GE(t.model.panel._size,-i),e.add_constraint(t._size_constraint)};var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _.__extends(e,t),e.prototype.toString=function(){return this.type+"("+this.id+", "+this.side+")"},e.prototype.initialize=function(e,n){switch(t.prototype.initialize.call(this,e,n),this.side){case"above":return this._dim=0,this._normals=[0,-1],this._size=this._height;case"below":return this._dim=0,this._normals=[0,1],this._size=this._height;case"left":return this._dim=1,this._normals=[-1,0],this._size=this._width;case"right":return this._dim=1,this._normals=[1,0],this._size=this._width;default:return m.logger.error("unrecognized side: '"+this.side+"'")}},e.prototype.apply_label_text_heuristics=function(t,e){var n,i,r;return r=this.side,v.isString(e)?(i=h[r][e],n=s[r][e]):0===e?(i=h[r][e],n=s[r][e]):e<0?(i="middle",n=a[r]):e>0&&(i="middle",n=l[r]),t.textBaseline=i,t.textAlign=n,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.side,u[e][t]},e}(d.LayoutCanvas);n.SidePanel=g,g.prototype.type="SidePanel",g.internal({side:[f.String]}),g.getters({is_horizontal:function(){return"above"===this.side||"below"===this.side},is_vertical:function(){return"left"===this.side||"right"===this.side}})},function(t,e,n){function i(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t)}}function r(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t,o.Strength.weak)}}var o=t(321);n.Variable=o.Variable,n.Expression=o.Expression,n.Constraint=o.Constraint,n.Operator=o.Operator,n.Strength=o.Strength,n.EQ=i(o.Operator.Eq),n.LE=i(o.Operator.Le),n.GE=i(o.Operator.Ge),n.WEAK_EQ=r(o.Operator.Eq),n.WEAK_LE=r(o.Operator.Le),n.WEAK_GE=r(o.Operator.Ge);var s=function(){function t(){this.solver=new o.Solver}return t.prototype.clear=function(){this.solver=new o.Solver},t.prototype.toString=function(){return"Solver(num_constraints="+this.num_constraints+", num_editables="+this.num_editables+")"},Object.defineProperty(t.prototype,"num_constraints",{get:function(){return this.solver.numConstraints},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"num_editables",{get:function(){return this.solver.numEditVariables},enumerable:!0,configurable:!0}),t.prototype.get_constraints=function(){return this.solver.getConstraints()},t.prototype.update_variables=function(){this.solver.updateVariables()},t.prototype.has_constraint=function(t){return this.solver.hasConstraint(t)},t.prototype.add_constraint=function(t){try{this.solver.addConstraint(t)}catch(e){throw new Error(e.message+": "+t.toString())}},t.prototype.remove_constraint=function(t){this.solver.removeConstraint(t)},t.prototype.add_edit_variable=function(t,e){this.solver.addEditVariable(t,e)},t.prototype.remove_edit_variable=function(t){this.solver.removeEditVariable(t)},t.prototype.suggest_value=function(t,e){this.solver.suggestValue(t,e)},t}();n.Solver=s},function(t,e,n){var i=t(42),r={},o=function(){return function(t,e){this.name=t,this.level=e}}();n.LogLevel=o;var s=function(){function t(e,n){void 0===n&&(n=t.INFO),this._name=e,this.set_level(n)}return Object.defineProperty(t,"levels",{get:function(){return Object.keys(t.log_levels)},enumerable:!0,configurable:!0}),t.get=function(e,n){if(void 0===n&&(n=t.INFO),e.length>0){var i=r[e];return null==i&&(r[e]=i=new t(e,n)),i}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")},Object.defineProperty(t.prototype,"level",{get:function(){return this.get_level()},enumerable:!0,configurable:!0}),t.prototype.get_level=function(){return this._log_level},t.prototype.set_level=function(e){if(e instanceof o)this._log_level=e;else{if(!i.isString(e)||null==t.log_levels[e])throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=t.log_levels[e]}var n="["+this._name+"]";for(var r in t.log_levels){var s=t.log_levels[r];s.level<this._log_level.level||this._log_level.level===t.OFF.level?this[r]=function(){}:this[r]=function(t,e){return null!=console[t]?console[t].bind(console,e):null!=console.log?console.log.bind(console,e):function(){}}(r,n)}},t.prototype.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.TRACE=new o("trace",0),t.DEBUG=new o("debug",1),t.INFO=new o("info",2),t.WARN=new o("warn",6),t.ERROR=new o("error",7),t.FATAL=new o("fatal",8),t.OFF=new o("off",9),t.log_levels={trace:t.TRACE,debug:t.DEBUG,info:t.INFO,warn:t.WARN,error:t.ERROR,fatal:t.FATAL,off:t.OFF},t}();n.Logger=s,n.logger=s.get("bokeh"),n.set_log_level=function(t){null==s.log_levels[t]?(console.log("[bokeh] unrecognized logging level '"+t+"' passed to Bokeh.set_log_level(), ignoring"),console.log("[bokeh] valid log levels are: "+s.levels.join(", "))):(console.log("[bokeh] setting log level to: '"+t+"'"),n.logger.set_level(t))}},function(t,e,n){function i(t){try{return JSON.stringify(t)}catch(e){return t.toString()}}function r(t,e){return function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return a.__extends(r,n),r.prototype.validate=function(n){if(!e(n))throw new Error(t+" property '"+this.attr+"' given invalid value: "+i(n))},r}(d)}function o(t,e){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(t,function(t){return _.contains(e,t)}))}function s(t,e,n){return function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return a.__extends(r,i),r.prototype.init=function(){null==this.spec.units&&(this.spec.units=n);var i=this.spec.units;if(!_.contains(e,i))throw new Error(t+" units must be one of "+e+", given invalid value: "+i)},Object.defineProperty(r.prototype,"units",{get:function(){return this.spec.units},set:function(t){this.spec.units=t},enumerable:!0,configurable:!0}),r}(b)}var a=t(364),l=t(20),u=t(7),h=t(38),c=t(26),_=t(22),p=t(42),d=function(t){function e(e,n,i){var r=t.call(this)||this;return r.obj=e,r.attr=n,r.default_value=i,r.optional=!1,r.change=new l.Signal(r.obj,"change"),r._init(),r.connect(r.change,function(){return r._init()}),r}return a.__extends(e,t),e.prototype.update=function(){this._init()},e.prototype.init=function(){},e.prototype.transform=function(t){return t},e.prototype.validate=function(t){},e.prototype.value=function(t){if(void 0===t&&(t=!0),void 0===this.spec.value)throw new Error("attempted to retrieve property value for property without value specification");var e=this.transform([this.spec.value])[0];return null!=this.spec.transform&&t&&(e=this.spec.transform.compute(e)),e},e.prototype.array=function(t){if(!this.dataspec)throw new Error("attempted to retrieve property array for non-dataspec property");var e,n=t.data;if(null!=this.spec.field){if(!(this.spec.field in n))throw new Error("attempted to retrieve property array for nonexistent field '"+this.spec.field+"'");e=this.transform(t.get_column(this.spec.field))}else if(null!=this.spec.expr)e=this.transform(this.spec.expr._v_compute(t));else{var i=t.get_length();null==i&&(i=1);var r=this.value(!1);e=_.repeat(r,i)}return null!=this.spec.transform&&(e=this.spec.transform.v_compute(e)),e},e.prototype._init=function(){var t=this.obj,e=this.attr,n=t.getv(e);if(void 0===n){var i=this.default_value;n=void 0!==i?i(t):null,t.setv([e,n],{silent:!0,defaults:!0})}if(p.isArray(n)?this.spec={value:n}:p.isObject(n)&&(void 0===n.value?0:1)+(void 0===n.field?0:1)+(void 0===n.expr?0:1)==1?this.spec=n:this.spec={value:n},null!=this.spec.field&&!p.isString(this.spec.field))throw new Error("field value for property '"+e+"' is not a string");null!=this.spec.value&&this.validate(this.spec.value),this.init()},e.prototype.toString=function(){return"Prop("+this.obj+"."+this.attr+", spec: "+i(this.spec)+")"},e}(l.Signalable());n.Property=d,d.prototype.dataspec=!1,n.simple_prop=r;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Any",function(t){return!0}));n.Any=f;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Array",function(t){return p.isArray(t)||t instanceof Float64Array}));n.Array=m;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Bool",p.isBoolean));n.Bool=v,n.Boolean=v;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Color",function(t){return null!=h[t.toLowerCase()]||"#"==t.substring(0,1)||c.valid_rgb(t)}));n.Color=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Instance",function(t){return null!=t.properties}));n.Instance=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Number",function(t){return p.isNumber(t)||p.isBoolean(t)}));n.Number=b,n.Int=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Number",function(t){return(p.isNumber(t)||p.isBoolean(t))&&0<=t&&t<=1}));n.Percent=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("String",p.isString));n.String=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(w);n.Font=k,n.enum_prop=o;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Anchor",u.LegendLocation));n.Anchor=S;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("AngleUnits",u.AngleUnits));n.AngleUnits=T;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.transform=function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)switch(t[n]){case"clock":e[n]=0;break;case"anticlock":e[n]=1}return e},e}(o("Direction",u.Direction));n.Direction=M;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Dimension",u.Dimension));n.Dimension=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Dimensions",u.Dimensions));n.Dimensions=E;var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("FontStyle",u.FontStyle));n.FontStyle=z;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LatLon",u.LatLon));n.LatLon=C;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LineCap",u.LineCap));n.LineCap=O;var N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LineJoin",u.LineJoin));n.LineJoin=N;var j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LegendLocation",u.LegendLocation));n.LegendLocation=j;var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Location",u.Location));n.Location=P;var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("OutputBackend",u.OutputBackend));n.OutputBackend=D;var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Orientation",u.Orientation));n.Orientation=F;var I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("VerticalAlign",u.VerticalAlign));n.VerticalAlign=I;var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("TextAlign",u.TextAlign));n.TextAlign=B;var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("TextBaseline",u.TextBaseline));n.TextBaseline=R;var L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("RenderLevel",u.RenderLevel));n.RenderLevel=L;var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("RenderMode",u.RenderMode));n.RenderMode=V;var G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("SizingMode",u.SizingMode));n.SizingMode=G;var U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("SpatialUnits",u.SpatialUnits));n.SpatialUnits=U;var Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Distribution",u.DistributionTypes));n.Distribution=Y;var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("StepMode",u.StepModes));n.StepMode=q;var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("PaddingUnits",u.PaddingUnits));n.PaddingUnits=X;var W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("StartEnd",u.StartEnd));n.StartEnd=W,n.units_prop=s;var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.transform=function(e){return"deg"==this.spec.units&&(e=_.map(e,function(t){return t*Math.PI/180})),e=_.map(e,function(t){return-t}),t.prototype.transform.call(this,e)},e}(s("Angle",u.AngleUnits,"rad"));n.Angle=H;var J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(s("Distance",u.SpatialUnits,"data"));n.Distance=J;var Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(H);n.AngleSpec=Q,Q.prototype.dataspec=!0;var $=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(g);n.ColorSpec=$,$.prototype.dataspec=!0;var Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(J);n.DirectionSpec=Z,Z.prototype.dataspec=!0;var K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(J);n.DistanceSpec=K,K.prototype.dataspec=!0;var tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(w);n.FontSizeSpec=tt,tt.prototype.dataspec=!0;var et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(b);n.NumberSpec=et,et.prototype.dataspec=!0;var nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(w);n.StringSpec=nt,nt.prototype.dataspec=!0},function(t,e,n){var i,r,o,s,a=t(15),l=t(30);r=function(t,e){var n,i,r;i={},null==e&&(e="");for(n in t)r=t[n],i[e+n]=r;return i},o={line_color:[a.ColorSpec,"black"],line_width:[a.NumberSpec,1],line_alpha:[a.NumberSpec,1],line_join:[a.LineJoin,"miter"],line_cap:[a.LineCap,"butt"],line_dash:[a.Array,[]],line_dash_offset:[a.Number,0]},n.line=function(t){return r(o,t)},i={fill_color:[a.ColorSpec,"gray"],fill_alpha:[a.NumberSpec,1]},n.fill=function(t){return r(i,t)},s={text_font:[a.Font,"helvetica"],text_font_size:[a.FontSizeSpec,"12pt"],text_font_style:[a.FontStyle,"normal"],text_color:[a.ColorSpec,"#444444"],text_alpha:[a.NumberSpec,1],text_align:[a.TextAlign,"left"],text_baseline:[a.TextBaseline,"bottom"],text_line_height:[a.Number,1.2]},n.text=function(t){return r(s,t)},n.create=function(t){var e,n,i,r,o,s;for(s={},n=0,r=t.length;n<r;n++){if(e=t[n],a=e.split(":"),i=a[0],o=a[1],null==this[i])throw new Error("Unknown property mixin kind '"+i+"'");s=l.extend(s,this[i](o))}return s;var a}},function(t,e,n){var i=t(364),r=t(8),o=t(18),s=t(9),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.selector=new o.Selector,this.inspectors={}},e.prototype.select=function(t,e,n,i){void 0===i&&(i=!1);for(var r=!1,o=0,s=t;o<s.length;o++){var a=s[o];r=r||a.hit_test(e,n,i)}return r},e.prototype.inspect=function(t,e){var n=!1;return n=n||t.hit_test(e,!1,!1,"inspect")},e.prototype.clear=function(t){this.selector.clear(),this.source.selected=s.create_hit_test_result()},e.prototype.get_or_create_inspector=function(t){return null==this.inspectors[t.id]&&(this.inspectors[t.id]=new o.Selector),this.inspectors[t.id]},e}(r.HasProps);n.SelectionManager=l,l.prototype.type="SelectionManager",l.internal({source:[a.Any]})},function(t,e,n){var i=t(364),r=t(8),o=t(9),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.update=function(t,e,n,i){void 0===i&&(i=!1),this.setv({timestamp:new Date},{silent:i}),this.setv({final:e},{silent:i}),n&&t.update_through_union(this.indices),this.setv({indices:t},{silent:i})},e.prototype.clear=function(){this.timestamp=new Date,this.final=!0,this.indices=new o.HitTestResult},e}(r.HasProps);n.Selector=a,a.prototype.type="Selector",a.internal({indices:[s.Any,function(){return new o.HitTestResult}],final:[s.Boolean],timestamp:[s.Any]})},function(t,e,n){var i=function(){function t(){this._dev=!1}return Object.defineProperty(t.prototype,"dev",{get:function(){return this._dev},set:function(t){this._dev=t},enumerable:!0,configurable:!0}),t}();n.Settings=i,n.settings=new i},function(t,e,n){function i(t,e,n,i){return l.find(t,function(t){return t.signal===e&&t.slot===n&&t.context===i})}function r(t){0===_.size&&a.defer(o),_.add(t)}function o(){_.forEach(function(t){l.removeBy(t,function(t){return null==t.signal})}),_.clear()}var s=t(364),a=t(24),l=t(22),u=function(){function t(t,e){this.sender=t,this.name=e}return t.prototype.connect=function(t,e){void 0===e&&(e=null),h.has(this.sender)||h.set(this.sender,[]);var n=h.get(this.sender);if(null!=i(n,this,t,e))return!1;var r=e||t;c.has(r)||c.set(r,[]);var o=c.get(r),s={signal:this,slot:t,context:e};return n.push(s),o.push(s),!0},t.prototype.disconnect=function(t,e){void 0===e&&(e=null);var n=h.get(this.sender);if(null==n||0===n.length)return!1;var o=i(n,this,t,e);if(null==o)return!1;var s=e||t,a=c.get(s);return o.signal=null,r(n),r(a),!0},t.prototype.emit=function(t){for(var e=h.get(this.sender)||[],n=0,i=e;n<i.length;n++){var r=i[n],o=r.signal,s=r.slot,a=r.context;o===this&&s.call(a,t,this.sender)}},t}();n.Signal=u,function(t){t.disconnectBetween=function(t,e){var n=h.get(t);if(null==n||0===n.length)return;var i=c.get(e);if(null==i||0===i.length)return;for(var o=0,s=i;o<s.length;o++){var a=s[o];if(null==a.signal)return;a.signal.sender===t&&(a.signal=null)}r(n),r(i)},t.disconnectSender=function(t){var e=h.get(t);if(null==e||0===e.length)return;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(null==o.signal)return;var s=o.context||o.slot;o.signal=null,r(c.get(s))}r(e)},t.disconnectReceiver=function(t){var e=c.get(t);if(null==e||0===e.length)return;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(null==o.signal)return;var s=o.signal.sender;o.signal=null,r(h.get(s))}r(e)},t.disconnectAll=function(t){var e=h.get(t);if(null!=e&&0!==e.length){for(var n=0,i=e;n<i.length;n++){var o=i[n];o.signal=null}r(e)}var s=c.get(t);if(null!=s&&0!==s.length){for(var a=0,l=s;a<l.length;a++){var o=l[a];o.signal=null}r(s)}}}(u=n.Signal||(n.Signal={})),n.Signal=u,n.Signalable=function(t){return null!=t?function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.connect=function(t,e){return t.connect(e,this)},e}(t):function(){function t(){}return t.prototype.connect=function(t,e){return t.connect(e,this)},t}()};!function(t){t.connect=function(t,e){return t.connect(e,this)}}(n._Signalable||(n._Signalable={}));var h=new WeakMap,c=new WeakMap,_=new Set},function(t,e,n){var i=t(318),r=t(20),o=t(14),s=t(5),a=t(43),l=t(30),u=t(3);n.UIEvents=function(){function t(t,e,n,i){this.plot_view=t,this.toolbar=e,this.hit_area=n,this.plot=i,this.tap=new r.Signal(this,"tap"),this.doubletap=new r.Signal(this,"doubletap"),this.press=new r.Signal(this,"press"),this.pan_start=new r.Signal(this,"pan:start"),this.pan=new r.Signal(this,"pan"),this.pan_end=new r.Signal(this,"pan:end"),this.pinch_start=new r.Signal(this,"pinch:start"),this.pinch=new r.Signal(this,"pinch"),this.pinch_end=new r.Signal(this,"pinch:end"),this.rotate_start=new r.Signal(this,"rotate:start"),this.rotate=new r.Signal(this,"rotate"),this.rotate_end=new r.Signal(this,"rotate:end"),this.move_enter=new r.Signal(this,"move:enter"),this.move=new r.Signal(this,"move"),this.move_exit=new r.Signal(this,"move:exit"),this.scroll=new r.Signal(this,"scroll"),this.keydown=new r.Signal(this,"keydown"),this.keyup=new r.Signal(this,"keyup"),this._configure_hammerjs()}return t.prototype._configure_hammerjs=function(){var t=this;return this.hammer=new i(this.hit_area),this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",function(e){return t._doubletap(e)}),this.hammer.on("tap",function(e){return t._tap(e)}),this.hammer.on("press",function(e){return t._press(e)}),this.hammer.get("pan").set({direction:i.DIRECTION_ALL}),this.hammer.on("panstart",function(e){return t._pan_start(e)}),this.hammer.on("pan",function(e){return t._pan(e)}),this.hammer.on("panend",function(e){return t._pan_end(e)}),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",function(e){return t._pinch_start(e)}),this.hammer.on("pinch",function(e){return t._pinch(e)}),this.hammer.on("pinchend",function(e){return t._pinch_end(e)}),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",function(e){return t._rotate_start(e)}),this.hammer.on("rotate",function(e){return t._rotate(e)}),this.hammer.on("rotateend",function(e){return t._rotate_end(e)}),this.hit_area.addEventListener("mousemove",function(e){return t._mouse_move(e)}),this.hit_area.addEventListener("mouseenter",function(e){return t._mouse_enter(e)}),this.hit_area.addEventListener("mouseleave",function(e){return t._mouse_exit(e)}),this.hit_area.addEventListener("wheel",function(e){return t._mouse_wheel(e)}),document.addEventListener("keydown",function(e){return t._key_down(e)}),document.addEventListener("keyup",function(e){return t._key_up(e)})},t.prototype.register_tool=function(t,e){var n,i,r,s,a,l,u;if(null==(i=e||t.model.event_type)||"string"==typeof i){if(s=t.model.id,l=t.model.type,null!=i){switch(u=t,i){case"pan":null!=u._pan_start&&u.connect(this.pan_start,function(t){if(t.id===s)return u._pan_start(t.e)}),null!=u._pan&&u.connect(this.pan,function(t){if(t.id===s)return u._pan(t.e)}),null!=u._pan_end&&u.connect(this.pan_end,function(t){if(t.id===s)return u._pan_end(t.e)});break;case"pinch":null!=u._pinch_start&&u.connect(this.pinch_start,function(t){if(t.id===s)return u._pinch_start(t.e)}),null!=u._pinch&&u.connect(this.pinch,function(t){if(t.id===s)return u._pinch(t.e)}),null!=u._pinch_end&&u.connect(this.pinch_end,function(t){if(t.id===s)return u._pinch_end(t.e)});break;case"rotate":null!=u._rotate_start&&u.connect(this.rotate_start,function(t){if(t.id===s)return u._rotate_start(t.e)}),null!=u._rotate&&u.connect(this.rotate,function(t){if(t.id===s)return u._rotate(t.e)}),null!=u._rotate_end&&u.connect(this.rotate_end,function(t){if(t.id===s)return u._rotate_end(t.e)});break;case"move":null!=u._move_enter&&u.connect(this.move_enter,function(t){if(t.id===s)return u._move_enter(t.e)}),null!=u._move&&u.connect(this.move,function(t){if(t.id===s)return u._move(t.e)}),null!=u._move_exit&&u.connect(this.move_exit,function(t){if(t.id===s)return u._move_exit(t.e)});break;case"tap":null!=u._tap&&u.connect(this.tap,function(t){if(t.id===s)return u._tap(t.e)});break;case"press":null!=u._press&&u.connect(this.press,function(t){if(t.id===s)return u._press(t.e)});break;case"scroll":null!=u._scroll&&u.connect(this.scroll,function(t){if(t.id===s)return u._scroll(t.e)});break;default:throw new Error("unsupported event_type: "+ev)}return null!=u._doubletap&&u.connect(this.doubletap,function(t){return u._doubletap(t.e)}),null!=u._keydown&&u.connect(this.keydown,function(t){return u._keydown(t.e)}),null!=u._keyup&&u.connect(this.keyup,function(t){return u._keyup(t.e)}),("ontouchstart"in window||navigator.maxTouchPoints>0)&&"pinch"===i?(o.logger.debug("Registering scroll on touch screen"),u.connect(this.scroll,function(t){if(t.id===s)return u._scroll(t.e)})):void 0}o.logger.debug("Button tool: "+l)}else for(r=0,a=i.length;r<a;r++)n=i[r],this.register_tool(t,n)},t.prototype._hit_test_renderers=function(t,e){var n,i,r,o;for(i=this.plot_view.get_renderer_views(),n=i.length-1;n>=0;n+=-1)if(o=i[n],("annotation"===(r=o.model.level)||"overlay"===r)&&null!=o.bbox&&o.bbox().contains(t,e))return o;return null},t.prototype._hit_test_frame=function(t,e){return this.plot_view.frame.bbox.contains(t,e)},t.prototype._trigger=function(t,e){var n,i,r,o,s,a,u,h,c,_,p;switch(a=t.name,o=a.split(":")[0],p=this._hit_test_renderers(e.bokeh.sx,e.bokeh.sy),o){case"move":for(i=this.toolbar.inspectors.filter(function(t){return t.active}),s="default",null!=p?(null!=p.model.cursor&&(s=p.model.cursor()),l.isEmpty(i)||(t=this.move_exit,a=t.name)):this._hit_test_frame(e.bokeh.sx,e.bokeh.sy)&&(l.isEmpty(i)||(s="crosshair")),this.plot_view.set_cursor(s),_=[],u=0,c=i.length;u<c;u++)h=i[u],_.push(this.trigger(t,e,h.id));return _;case"tap":if(null!=p&&"function"==typeof p.on_hit&&p.on_hit(e.bokeh.sx,e.bokeh.sy),null!=(n=this.toolbar.gestures[o].active))return this.trigger(t,e,n.id);break;case"scroll":if(r="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",null!=(n=this.toolbar.gestures[r].active))return e.preventDefault(),e.stopPropagation(),this.trigger(t,e,n.id);break;default:if(null!=(n=this.toolbar.gestures[o].active))return this.trigger(t,e,n.id)}},t.prototype.trigger=function(t,e,n){return void 0===n&&(n=null),t.emit({id:n,e:e})},t.prototype._event_sxy=function(t){var e,n;return i=s.offset(this.hit_area),e=i.left,n=i.top,{sx:t.pageX-e,sy:t.pageY-n};var i},t.prototype._bokify_hammer=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t.srcEvent),e),null!=(n=u.BokehEvent.event_class(t))?this.plot.trigger_event(n.from_event(t)):o.logger.debug("Unhandled event of type "+t.type)},t.prototype._bokify_point_event=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t),e),null!=(n=u.BokehEvent.event_class(t))?this.plot.trigger_event(n.from_event(t)):o.logger.debug("Unhandled event of type "+t.type)},t.prototype._tap=function(t){return this._bokify_hammer(t),this._trigger(this.tap,t)},t.prototype._doubletap=function(t){return this._bokify_hammer(t),this.trigger(this.doubletap,t)},t.prototype._press=function(t){return this._bokify_hammer(t),this._trigger(this.press,t)},t.prototype._pan_start=function(t){return this._bokify_hammer(t),t.bokeh.sx-=t.deltaX,t.bokeh.sy-=t.deltaY,this._trigger(this.pan_start,t)},t.prototype._pan=function(t){return this._bokify_hammer(t),this._trigger(this.pan,t)},t.prototype._pan_end=function(t){return this._bokify_hammer(t),this._trigger(this.pan_end,t)},t.prototype._pinch_start=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_start,t)},t.prototype._pinch=function(t){return this._bokify_hammer(t),this._trigger(this.pinch,t)},t.prototype._pinch_end=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_end,t)},t.prototype._rotate_start=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_start,t)},t.prototype._rotate=function(t){return this._bokify_hammer(t),this._trigger(this.rotate,t)},t.prototype._rotate_end=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_end,t)},t.prototype._mouse_enter=function(t){return this._bokify_point_event(t),this._trigger(this.move_enter,t)},t.prototype._mouse_move=function(t){return this._bokify_point_event(t),this._trigger(this.move,t)},t.prototype._mouse_exit=function(t){return this._bokify_point_event(t),this._trigger(this.move_exit,t)},t.prototype._mouse_wheel=function(t){return this._bokify_point_event(t,{delta:a.getDeltaY(t)}),this._trigger(this.scroll,t)},t.prototype._key_down=function(t){return this.trigger(this.keydown,t)},t.prototype._key_up=function(t){return this.trigger(this.keyup,t)},t}()},function(t,e,n){function i(t){return(e=[]).concat.apply(e,t);var e}function r(t,e){return-1!==t.indexOf(e)}function o(t,e,n){void 0===n&&(n=1),null==e&&(e=t,t=0);for(var i=Math.max(Math.ceil((e-t)/n),0),r=Array(i),o=0;o<i;o++,t+=n)r[o]=t;return r}function s(t,e){if(0==t.length)throw new Error("minBy() called with an empty array");for(var n=t[0],i=e(n),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a<i&&(n=s,i=a)}return n}function a(t,e){if(0==t.length)throw new Error("maxBy() called with an empty array");for(var n=t[0],i=e(n),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a>i&&(n=s,i=a)}return n}function l(t){return function(e,n){for(var i=e.length,r=t>0?0:i-1;r>=0&&r<i;r+=t)if(n(e[r]))return r;return-1}}function u(t){for(var e=[],n=0,i=t;n<i.length;n++){var o=i[n];r(e,o)||e.push(o)}return e}var h=t(29),c=Array.prototype.slice;n.head=function(t){return t[0]},n.tail=function(t){return t[t.length-1]},n.last=function(t){return t[t.length-1]},n.copy=function(t){return c.call(t)},n.concat=i,n.contains=r,n.nth=function(t,e){return t[e>=0?e:t.length+e]},n.zip=function(t,e){for(var n=Math.min(t.length,e.length),i=new Array(n),r=0;r<n;r++)i[r]=[t[r],e[r]];return i},n.unzip=function(t){for(var e=t.length,n=new Array(e),i=new Array(e),r=0;r<e;r++)o=t[r],n[r]=o[0],i[r]=o[1];return[n,i];var o},n.range=o,n.linspace=function(t,e,n){void 0===n&&(n=100);for(var i=(e-t)/(n-1),r=new Array(n),o=0;o<n;o++)r[o]=t+i*o;return r},n.transpose=function(t){for(var e=t.length,n=t[0].length,i=[],r=0;r<n;r++){i[r]=[];for(var o=0;o<e;o++)i[r][o]=t[o][r]}return i},n.sum=function(t){return t.reduce(function(t,e){return t+e},0)},n.cumsum=function(t){var e=[];return t.reduce(function(t,n,i){return e[i]=t+n},0),e},n.min=function(t){for(var e,n=1/0,i=0,r=t.length;i<r;i++)(e=t[i])<n&&(n=e);return n},n.minBy=s,n.max=function(t){for(var e,n=-1/0,i=0,r=t.length;i<r;i++)(e=t[i])>n&&(n=e);return n},n.maxBy=a,n.argmin=function(t){return s(o(t.length),function(e){return t[e]})},n.argmax=function(t){return a(o(t.length),function(e){return t[e]})},n.all=function(t,e){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(!e(r))return!1}return!0},n.any=function(t,e){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e(r))return!0}return!1},n.findIndex=l(1),n.findLastIndex=l(-1),n.find=function(t,e){var i=n.findIndex(t,e);return-1==i?void 0:t[i]},n.findLast=function(t,e){var i=n.findLastIndex(t,e);return-1==i?void 0:t[i]},n.sortedIndex=function(t,e){var n=0,i=t.length;for(;n<i;){var r=Math.floor((n+i)/2);t[r]<e?n=r+1:i=r}return n},n.sortBy=function(t,e){var n=t.map(function(t,n){return{value:t,index:n,key:e(t)}});return n.sort(function(t,e){var n=t.key,i=e.key;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return t.index-e.index}),n.map(function(t){return t.value})},n.uniq=u,n.uniqBy=function(t,e){for(var n=[],i=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e(a);r(i,l)||(i.push(l),n.push(a))}return n},n.union=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return u(i(t))},n.intersection=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=[];t:for(var o=0,s=t;o<s.length;o++){var a=s[o];if(!r(i,a)){for(var l=0,u=e;l<u.length;l++){var h=u[l];if(!r(h,a))continue t}i.push(a)}}return i},n.difference=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=i(e);return t.filter(function(t){return!r(o,t)})},n.removeBy=function(t,e){for(var n=0;n<t.length;)e(t[n])?t.splice(n,1):n++},n.shuffle=function(t){for(var e=t.length,n=new Array(e),i=0;i<e;i++){var r=h.randomIn(0,i);r!==i&&(n[i]=n[r]),n[r]=t[i]}return n},n.pairwise=function(t,e){for(var n=t.length,i=new Array(n-1),r=0;r<n-1;r++)i[r]=e(t[r],t[r+1]);return i},n.reversed=function(t){for(var e=t.length,n=new Array(e),i=0;i<e;i++)n[e-i-1]=t[i];return n},n.repeat=function(t,e){for(var n=new Array(e),i=0;i<e;i++)n[i]=t;return n},n.map=function(t,e){for(var n=t.length,i=new Array(n),r=0;r<n;r++)i[r]=e(t[r]);return i}},function(t,e,n){var i=Math.min,r=Math.max;n.empty=function(){return{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},n.positive_x=function(){return{minX:Number.MIN_VALUE,minY:-1/0,maxX:1/0,maxY:1/0}},n.positive_y=function(){return{minX:-1/0,minY:Number.MIN_VALUE,maxX:1/0,maxY:1/0}},n.union=function(t,e){return{minX:i(t.minX,e.minX),maxX:r(t.maxX,e.maxX),minY:i(t.minY,e.minY),maxY:r(t.maxY,e.maxY)}};var o=function(){function t(t){if("x0"in t&&"y0"in t&&"x1"in t&&"y1"in t){var e=t,n=e.x0,i=e.y0,r=e.x1,o=e.y1;if(!(n<=r&&i<=o))throw new Error("invalid bbox {x0: "+n+", y0: "+i+", x1: "+r+", y1: "+o+"}");this.x0=n,this.y0=i,this.x1=r,this.y1=o}else{var s=t,a=s.x,l=s.y,u=s.width,h=s.height;if(!(u>=0&&h>=0))throw new Error("invalid bbox {x: "+a+", y: "+l+", width: "+u+", height: "+h+"}");this.x0=a,this.y0=l,this.x1=a+u,this.y1=l+h}}return Object.defineProperty(t.prototype,"minX",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p0",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p1",{get:function(){return[this.x1,this.y1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.x1-this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.y1-this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"h_range",{get:function(){return{start:this.x0,end:this.x1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v_range",{get:function(){return{start:this.y0,end:this.y1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ranges",{get:function(){return[this.h_range,this.v_range]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"aspect",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0}),t.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},t.prototype.clip=function(t,e){return t<this.x0?t=this.x0:t>this.x1&&(t=this.x1),e<this.y0?e=this.y0:e>this.y1&&(e=this.y1),[t,e]},t.prototype.union=function(e){return new t({x0:i(this.x0,e.x0),y0:i(this.y0,e.y0),x1:r(this.x1,e.x1),y1:r(this.y1,e.y1)})},t}();n.BBox=o},function(t,e,n){n.delay=function(t,e){return setTimeout(t,e)};var i="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;n.defer=function(t){return i(t)},n.throttle=function(t,e,n){void 0===n&&(n={});var i,r,o,s=null,a=0,l=function(){a=!1===n.leading?0:Date.now(),s=null,o=t.apply(i,r),s||(i=r=null)};return function(){var u=Date.now();a||!1!==n.leading||(a=u);var h=e-(u-a);return i=this,r=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=u,o=t.apply(i,r),s||(i=r=null)):s||!1===n.trailing||(s=setTimeout(l,h)),o}},n.once=function(t){var e,n=!1;return function(){return n||(n=!0,e=t()),e}}},function(t,e,n){n.fixup_ctx=function(t){(function(t){t.setLineDash||(t.setLineDash=function(e){t.mozDash=e,t.webkitLineDash=e});t.getLineDash||(t.getLineDash=function(){return t.mozDash})})(t),function(t){t.setLineDashOffset=function(e){t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}}(t),function(t){t.setImageSmoothingEnabled=function(e){t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e=t.imageSmoothingEnabled;return null==e||e}}(t),function(t){t.measureText&&null==t.html5MeasureText&&(t.html5MeasureText=t.measureText,t.measureText=function(e){var n=t.html5MeasureText(e);return n.ascent=1.6*t.html5MeasureText("m").width,n})}(t),function(t){t.ellipse||(t.ellipse=function(e,n,i,r,o,s,a,l){void 0===l&&(l=!1);t.translate(e,n),t.rotate(o);var u=i,h=r;l&&(u=-i,h=-r);t.moveTo(-u,0),t.bezierCurveTo(-u,.551784*h,.551784*-u,h,0,h),t.bezierCurveTo(.551784*u,h,u,.551784*h,u,0),t.bezierCurveTo(u,.551784*-h,.551784*u,-h,0,-h),t.bezierCurveTo(.551784*-u,-h,-u,.551784*-h,-u,0),t.rotate(-o),t.translate(-e,-n)})}(t)},n.get_scale_ratio=function(t,e,n){if("svg"==n)return 1;if(e){var i=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/r}return 1}},function(t,e,n){var i,r=[].indexOf,o=t(38);i=function(t){var e;return e=Number(t).toString(16),e=1===e.length?"0"+e:e},n.color2hex=function(t){var e,n,r;return 0===(t+="").indexOf("#")?t:null!=o[t]?o[t]:0===t.indexOf("rgb")?(n=t.replace(/^rgba?\(|\s+|\)$/g,"").split(","),e=function(){var t,e,o,s;for(o=n.slice(0,3),s=[],t=0,e=o.length;t<e;t++)r=o[t],s.push(i(r));return s}().join(""),4===n.length&&(e+=i(Math.floor(255*parseFloat(n.slice(3))))),"#"+e.slice(0,8)):t},n.color2rgba=function(t,e){void 0===e&&(e=1);var i,r,o;if(!t)return[0,0,0,0];for((i=(i=n.color2hex(t)).replace(/ |#/g,"")).length<=4&&(i=i.replace(/(.)/g,"$1$1")),i=i.match(/../g),o=function(){var t,e,n;for(n=[],t=0,e=i.length;t<e;t++)r=i[t],n.push(parseInt(r,16)/255);return n}();o.length<3;)o.push(0);return o.length<4&&o.push(e),o.slice(0,4)},n.valid_rgb=function(t){var e,n,i,o;switch(t.substring(0,4)){case"rgba":n={start:"rgba(",len:4,alpha:!0};break;case"rgb(":n={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(n.start,"").replace(")","").split(",").map(parseFloat)).length!==n.len)throw new Error("color expects rgba "+expect_len+"-tuple, received "+t);if(n.alpha&&!(0<=(i=e[3])&&i<=1))throw new Error("color expects rgba 4-tuple to have alpha value between 0 and 1");if(r.call(function(){var t,n,i,r;for(i=e.slice(0,3),r=[],t=0,n=i.length;t<n;t++)o=i[t],r.push(0<=o&&o<=255);return r}(),!1)>=0)throw new Error("color expects rgb to have value between 0 and 255");return!0}},function(t,e,n){var i=t(22),r=t(28),o=t(42),s=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 n=this._existing(t);null==n?this._dict[t]=e:o.isArray(n)?n.push(e):this._dict[t]=[n,e]},t.prototype.remove_value=function(t,e){var n=this._existing(t);if(o.isArray(n)){var s=i.difference(n,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else r.isEqual(n,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var n=this._existing(t);if(o.isArray(n)){if(1===n.length)return n[0];throw new Error(e)}return n},t}();n.MultiDict=s;var a=function(){function t(e){this.values=null==e?[]:e instanceof t?i.copy(e.values):this._compact(e)}return t.prototype._compact=function(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];-1===e.indexOf(r)&&e.push(r)}return e},t.prototype.push=function(t){this.missing(t)&&this.values.push(t)},t.prototype.remove=function(t){var 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-1!=this.values.indexOf(t)},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.union=function(e){return e=new t(e),new t(this.values.concat(e.values))},t.prototype.intersect=function(e){e=new t(e);for(var n=new t,i=0,r=e.values;i<r.length;i++){var o=r[i];this.includes(o)&&e.includes(o)&&n.push(o)}return n},t.prototype.diff=function(e){e=new t(e);for(var n=new t,i=0,r=this.values;i<r.length;i++){var o=r[i];e.missing(o)&&n.push(o)}return n},t}();n.Set=a},function(t,e,n){function i(t,e,n,s){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;var a=o.call(t);if(a!==o.call(e))return!1;switch(a){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 l="[object Array]"===a;if(!l){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,h=e.constructor;if(u!==h&&!(r.isFunction(u)&&u instanceof u&&r.isFunction(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],s=s||[];for(var c=n.length;c--;)if(n[c]===t)return s[c]===e;if(n.push(t),s.push(e),l){if((c=t.length)!==e.length)return!1;for(;c--;)if(!i(t[c],e[c],n,s))return!1}else{var _=Object.keys(t),p=void 0;if(c=_.length,Object.keys(e).length!==c)return!1;for(;c--;)if(p=_[c],!e.hasOwnProperty(p)||!i(t[p],e[p],n,s))return!1}return n.pop(),s.pop(),!0}var r=t(42),o=Object.prototype.toString;n.isEqual=function(t,e){return i(t,e)}},function(t,e,n){function i(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}function r(t,e){return Math.abs(i(t-e))}function o(){return Math.random()}n.angle_norm=i,n.angle_dist=r,n.angle_between=function(t,e,n,o){var s=i(t),a=r(e,n),l=r(e,s)<=a&&r(s,n)<=a;return"anticlock"==o?l:!l},n.random=o,n.randomIn=function(t,e){null==e&&(e=t,t=0);return t+Math.floor(Math.random()*(e-t+1))},n.atan2=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},n.rnorm=function(t,e){var n,i;for(;n=o(),i=o(),i=(2*i-1)*Math.sqrt(1/Math.E*2),!(-4*n*n*Math.log(n)>=i*i););var r=i/n;return r=t+e*r},n.clamp=function(t,e,n){return t>n?n:t<e?e:t}},function(t,e,n){function i(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0,r=e;i<r.length;i++){var o=r[i];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t}function r(t){return Object.keys(t).length}var o=t(22);n.keys=Object.keys,n.values=function(t){for(var e=Object.keys(t),n=e.length,i=new Array(n),r=0;r<n;r++)i[r]=t[e[r]];return i},n.extend=i,n.clone=function(t){return i({},t)},n.merge=function(t,e){for(var n=Object.create(Object.prototype),i=0,r=o.concat([Object.keys(t),Object.keys(e)]);i<r.length;i++){var s=r[i],a=t.hasOwnProperty(s)?t[s]:[],l=e.hasOwnProperty(s)?e[s]:[];n[s]=o.union(a,l)}return n},n.size=r,n.isEmpty=function(t){return 0===r(t)}},function(t,e,n){var i,r=t(345);n.proj4=r;var o=t(333),s=t(339),a=t(349),l=t(358);r.defaultDatum="WGS84",r.WGS84=new o("WGS84"),r.Proj=o,r.toPoint=s,r.defs=a,r.transform=l,n.mercator=a("GOOGLE"),n.wgs84=a("WGS84"),n.mercator_bounds={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},i={lon:[-180,180],lat:[-85.06,85.06]},n.clip_mercator=function(t,e,i){var r,o;return s=n.mercator_bounds[i],o=s[0],r=s[1],[Math.max(t,o),Math.min(e,r)];var s},n.in_bounds=function(t,e){return t>i[e][0]&&t<i[e][1]}},function(t,e,n){function i(t,e){for(var n=Math.min(t.length,e.length),i=new Array(n),o=new Array(n),s=0;s<n;s++){var a=r.proj4(r.mercator,[t[s],e[s]]),l=a[0],u=a[1];i[s]=l,o[s]=u}return[i,o]}var r=t(31);n.project_xy=i,n.project_xsys=function(t,e){for(var n=Math.min(t.length,e.length),r=new Array(n),o=new Array(n),s=0;s<n;s++){var a=i(t[s],e[s]),l=a[0],u=a[1];r[s]=l,o[s]=u}return[r,o]}},function(t,e,n){var i=t(42);n.create_ref=function(t){var e={type:t.type,id:t.id};null!=t._subtype&&(e.subtype=t._subtype);return e},n.is_ref=function(t){if(i.isObject(t)){var e=Object.keys(t).sort();if(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}},function(t,e,n){n.get_indices=function(t){var e=t.selected;return e["0d"].glyph?e["0d"].indices:e["1d"].indices.length>0?e["1d"].indices:e["2d"].indices.length>0?e["2d"].indices:[]}},function(t,e,n){var i,r,o,s,a,l,u=t(42);n.ARRAY_TYPES={float32:Float32Array,float64:Float64Array,uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array},n.DTYPES={};for(a in n.ARRAY_TYPES)l=n.ARRAY_TYPES[a],n.DTYPES[l.name]=a;r=new ArrayBuffer(2),s=new Uint8Array(r),o=new Uint16Array(r),s[0]=170,s[1]=187,i=48042===o[0]?"little":"big",n.BYTE_ORDER=i,n.swap16=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,2*t.length),e=n=0,i=o.length;n<i;e=n+=2)r=o[e],o[e]=o[e+1],o[e+1]=r;return null},n.swap32=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,4*t.length),e=n=0,i=o.length;n<i;e=n+=4)r=o[e],o[e]=o[e+3],o[e+3]=r,r=o[e+1],o[e+1]=o[e+2],o[e+2]=r;return null},n.swap64=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,8*t.length),e=n=0,i=o.length;n<i;e=n+=8)r=o[e],o[e]=o[e+7],o[e+7]=r,r=o[e+1],o[e+1]=o[e+6],o[e+6]=r,r=o[e+2],o[e+2]=o[e+5],o[e+5]=r,r=o[e+3],o[e+3]=o[e+4],o[e+4]=r;return null},n.process_buffer=function(t,e){var i,o,s,a,l,u;for(l=t.order!==n.BYTE_ORDER,u=t.shape,o=null,s=0,a=e.length;s<a;s++)if(r=e[s],JSON.parse(r[0]).id===t.__buffer__){o=r[1];break}return i=new n.ARRAY_TYPES[t.dtype](o),l&&(2===i.BYTES_PER_ELEMENT?n.swap16(i):4===i.BYTES_PER_ELEMENT?n.swap32(i):8===i.BYTES_PER_ELEMENT&&n.swap64(i)),[i,u]},n.process_array=function(t,e){return u.isObject(t)&&"__ndarray__"in t?n.decode_base64(t):u.isObject(t)&&"__buffer__"in t?n.process_buffer(t,e):u.isArray(t)?[t,[]]:void 0},n.arrayBufferToBase64=function(t){var e,n,i;return i=new Uint8Array(t),n=function(){var t,n,r;for(r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(String.fromCharCode(e));return r}(),btoa(n.join(""))},n.base64ToArrayBuffer=function(t){var e,n,i,r,o,s;for(e=atob(t),o=e.length,n=new Uint8Array(o),i=r=0,s=o;0<=s?r<s:r>s;i=0<=s?++r:--r)n[i]=e.charCodeAt(i);return n.buffer},n.decode_base64=function(t){var e,i,r,o;return i=n.base64ToArrayBuffer(t.__ndarray__),(r=t.dtype)in n.ARRAY_TYPES&&(e=new n.ARRAY_TYPES[r](i)),o=t.shape,[e,o]},n.encode_base64=function(t,e){var i,r;return i=n.arrayBufferToBase64(t.buffer),r=n.DTYPES[t.constructor.name],{__ndarray__:i,shape:e,dtype:r}},n.decode_column_data=function(t,e){var i,r,o,s,h,c,_,p,d;h={},c={};for(a in t)if(l=t[a],u.isArray(l)){if(0===l.length||!u.isObject(l[0])&&!u.isArray(l[0])){h[a]=l;continue}for(r=[],d=[],o=0,s=l.length;o<s;o++)_=l[o],f=n.process_array(_,e),i=f[0],p=f[1],r.push(i),d.push(p);h[a]=r,c[a]=d}else m=n.process_array(l,e),i=m[0],p=m[1],h[a]=i,c[a]=p;return[h,c];var f,m},n.encode_column_data=function(t,e){var i,r,o,s,h,c,_;s={};for(a in t){if((null!=(l=t[a])?l.buffer:void 0)instanceof ArrayBuffer)l=n.encode_base64(l,null!=e?e[a]:void 0);else if(u.isArray(l)){for(o=[],i=r=0,h=l.length;0<=h?r<h:r>h;i=0<=h?++r:--r)(null!=(c=l[i])?c.buffer:void 0)instanceof ArrayBuffer?o.push(n.encode_base64(l[i],null!=e&&null!=(_=e[a])?_[i]:void 0)):o.push(l[i]);l=o}s[a]=l}return s}},function(t,e,n){var i=t(364),r=t(361),o=function(){return function(){}}();n.SpatialIndex=o;var s=function(t){function e(e){var n=t.call(this)||this;return n.index=r(),n.index.load(e),n}return i.__extends(e,t),Object.defineProperty(e.prototype,"bbox",{get:function(){var t=this.index.toJSON(),e=t.minX,n=t.minY,i=t.maxX,r=t.maxY;return{minX:e,minY:n,maxX:i,maxY:r}},enumerable:!0,configurable:!0}),e.prototype.search=function(t){return this.index.search(t)},e.prototype.indices=function(t){for(var e=this.search(t),n=e.length,i=new Array(n),r=0;r<n;r++)i[r]=e[r].i;return i},e}(o);n.RBush=s},function(t,e,n){function i(){for(var t=new Array(32),e=0;e<32;e++)t[e]="0123456789ABCDEF".substr(Math.floor(16*Math.random()),1);return t[12]="4",t[16]="0123456789ABCDEF".substr(3&t[16].charCodeAt(0)|8,1),t.join("")}var r=t(19);n.startsWith=function(t,e,n){void 0===n&&(n=0);return t.substr(n,e.length)==e},n.uuid4=i;var o=1e3;n.uniqueId=function(t){var e=r.settings.dev?"j"+o++:i();return null!=t?t+"-"+e:e},n.escape=function(t){return t.replace(/(?:[&<>"'`])/g,function(t){switch(t){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"`":return"`";default:return t}})},n.unescape=function(t){return t.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,function(t,e){switch(e){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return e}})}},function(t,e,n){n.indianred="#CD5C5C",n.lightcoral="#F08080",n.salmon="#FA8072",n.darksalmon="#E9967A",n.lightsalmon="#FFA07A",n.crimson="#DC143C",n.red="#FF0000",n.firebrick="#B22222",n.darkred="#8B0000",n.pink="#FFC0CB",n.lightpink="#FFB6C1",n.hotpink="#FF69B4",n.deeppink="#FF1493",n.mediumvioletred="#C71585",n.palevioletred="#DB7093",n.coral="#FF7F50",n.tomato="#FF6347",n.orangered="#FF4500",n.darkorange="#FF8C00",n.orange="#FFA500",n.gold="#FFD700",n.yellow="#FFFF00",n.lightyellow="#FFFFE0",n.lemonchiffon="#FFFACD",n.lightgoldenrodyellow="#FAFAD2",n.papayawhip="#FFEFD5",n.moccasin="#FFE4B5",n.peachpuff="#FFDAB9",n.palegoldenrod="#EEE8AA",n.khaki="#F0E68C",n.darkkhaki="#BDB76B",n.lavender="#E6E6FA",n.thistle="#D8BFD8",n.plum="#DDA0DD",n.violet="#EE82EE",n.orchid="#DA70D6",n.fuchsia="#FF00FF",n.magenta="#FF00FF",n.mediumorchid="#BA55D3",n.mediumpurple="#9370DB",n.blueviolet="#8A2BE2",n.darkviolet="#9400D3",n.darkorchid="#9932CC",n.darkmagenta="#8B008B",n.purple="#800080",n.indigo="#4B0082",n.slateblue="#6A5ACD",n.darkslateblue="#483D8B",n.mediumslateblue="#7B68EE",n.greenyellow="#ADFF2F",n.chartreuse="#7FFF00",n.lawngreen="#7CFC00",n.lime="#00FF00",n.limegreen="#32CD32",n.palegreen="#98FB98",n.lightgreen="#90EE90",n.mediumspringgreen="#00FA9A",n.springgreen="#00FF7F",n.mediumseagreen="#3CB371",n.seagreen="#2E8B57",n.forestgreen="#228B22",n.green="#008000",n.darkgreen="#006400",n.yellowgreen="#9ACD32",n.olivedrab="#6B8E23",n.olive="#808000",n.darkolivegreen="#556B2F",n.mediumaquamarine="#66CDAA",n.darkseagreen="#8FBC8F",n.lightseagreen="#20B2AA",n.darkcyan="#008B8B",n.teal="#008080",n.aqua="#00FFFF",n.cyan="#00FFFF",n.lightcyan="#E0FFFF",n.paleturquoise="#AFEEEE",n.aquamarine="#7FFFD4",n.turquoise="#40E0D0",n.mediumturquoise="#48D1CC",n.darkturquoise="#00CED1",n.cadetblue="#5F9EA0",n.steelblue="#4682B4",n.lightsteelblue="#B0C4DE",n.powderblue="#B0E0E6",n.lightblue="#ADD8E6",n.skyblue="#87CEEB",n.lightskyblue="#87CEFA",n.deepskyblue="#00BFFF",n.dodgerblue="#1E90FF",n.cornflowerblue="#6495ED",n.royalblue="#4169E1",n.blue="#0000FF",n.mediumblue="#0000CD",n.darkblue="#00008B",n.navy="#000080",n.midnightblue="#191970",n.cornsilk="#FFF8DC",n.blanchedalmond="#FFEBCD",n.bisque="#FFE4C4",n.navajowhite="#FFDEAD",n.wheat="#F5DEB3",n.burlywood="#DEB887",n.tan="#D2B48C",n.rosybrown="#BC8F8F",n.sandybrown="#F4A460",n.goldenrod="#DAA520",n.darkgoldenrod="#B8860B",n.peru="#CD853F",n.chocolate="#D2691E",n.saddlebrown="#8B4513",n.sienna="#A0522D",n.brown="#A52A2A",n.maroon="#800000",n.white="#FFFFFF",n.snow="#FFFAFA",n.honeydew="#F0FFF0",n.mintcream="#F5FFFA",n.azure="#F0FFFF",n.aliceblue="#F0F8FF",n.ghostwhite="#F8F8FF",n.whitesmoke="#F5F5F5",n.seashell="#FFF5EE",n.beige="#F5F5DC",n.oldlace="#FDF5E6",n.floralwhite="#FFFAF0",n.ivory="#FFFFF0",n.antiquewhite="#FAEBD7",n.linen="#FAF0E6",n.lavenderblush="#FFF0F5",n.mistyrose="#FFE4E1",n.gainsboro="#DCDCDC",n.lightgray="#D3D3D3",n.lightgrey="#D3D3D3",n.silver="#C0C0C0",n.darkgray="#A9A9A9",n.darkgrey="#A9A9A9",n.gray="#808080",n.grey="#808080",n.dimgray="#696969",n.dimgrey="#696969",n.lightslategray="#778899",n.lightslategrey="#778899",n.slategray="#708090",n.slategrey="#708090",n.darkslategray="#2F4F4F",n.darkslategrey="#2F4F4F",n.black="#000000"},function(t,e,n){var i,r=t(362),o=t(332),s=t(363),a=t(37),l=t(42);i=function(t){var e;return l.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"}}(),r.sprintf(e,t)):""+t},n.replace_placeholders=function(t,e,n,l,u){return void 0===u&&(u={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t,e,n){return e+"@$"+n}),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,h,c,_,p){var d,f,m;if(c=null!=_?_:c,m="$"===c[0]?u[c.substring(1)]:null!=(d=e.get_column(c))?d[n]:void 0,f=null,null==m)f="???";else{if("safe"===p)return""+h+m;if(null!=p)if(null!=l&&c in l)if("numeral"===l[c])f=o.format(m,p);else if("datetime"===l[c])f=s(m,p);else{if("printf"!==l[c])throw new Error("Unknown tooltip field formatter type '"+l[c]+"'");f=r.sprintf(p,m)}else f=o.format(m,p);else f=i(m)}return f=""+h+a.escape(f)})}},function(t,e,n){var i=t(5),r={};n.get_text_height=function(t){if(null!=r[t])return r[t];var e=i.span({style:{font:t}},"Hg"),n=i.div({style:{display:"inline-block",width:"1px",height:"0px"}}),o=i.div({},e,n);document.body.appendChild(o);try{n.style.verticalAlign="baseline";var s=i.offset(n).top-i.offset(e).top;n.style.verticalAlign="bottom";var a=i.offset(n).top-i.offset(e).top,l={height:a,ascent:s,descent:a-s};return r[t]=l,l}finally{document.body.removeChild(o)}}},function(t,e,n){var i,r;i=function(t){return t()},r=("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)||i,n.throttle=function(t,e){var n,i,o,s,a,l,u;return h=[null,null,null,null],i=h[0],n=h[1],u=h[2],l=h[3],a=0,s=!1,o=function(){return a=new Date,u=null,s=!1,l=t.apply(i,n)},function(){var t,h;return t=new Date,h=e-(t-a),i=this,n=arguments,h<=0&&!s?(clearTimeout(u),s=!0,r(o)):u||s||(u=setTimeout(function(){return r(o)},h)),l};var h}},function(t,e,n){function i(t){return"[object Number]"===r.call(t)}var r=Object.prototype.toString;n.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===r.call(t)},n.isNumber=i,n.isInteger=function(t){return i(t)&&isFinite(t)&&Math.floor(t)===t},n.isString=function(t){return"[object String]"===r.call(t)},n.isStrictNaN=function(t){return i(t)&&t!==+t},n.isFunction=function(t){return"[object Function]"===r.call(t)},n.isArray=function(t){return Array.isArray(t)},n.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t}},function(t,e,n){function i(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}n.getDeltaY=function(t){var e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=function(t){return i(t.offsetParent||document.body)||i(t)||16}(t.target);break;case t.DOM_DELTA_PAGE:e*=function(t){return t.clientHeight}(t.target)}return e}},function(t,e,n){function i(t,e,n){var i=[t.start,t.end],r=i[0],o=i[1],s=null!=n?n:(o+r)/2,a=r-(r-s)*e,l=o-(o-s)*e;return[a,l]}function r(t,e){var n=e[0],i=e[1],r={};for(var o in t){var s=t[o],a=s.r_invert(n,i),l=a[0],u=a[1];r[o]={start:l,end:u}}return r}var o=t(29);n.scale_highlow=i,n.get_info=r,n.scale_range=function(t,e,n,s,a){void 0===n&&(n=!0);void 0===s&&(s=!0);e=o.clamp(e,-.9,.9);var l=n?e:0,u=i(t.bbox.h_range,l,null!=a?a.x:void 0),h=u[0],c=u[1],_=r(t.xscales,[h,c]),p=s?e:0,d=i(t.bbox.v_range,p,null!=a?a.y:void 0),f=d[0],m=d[1],v=r(t.yscales,[f,m]);return{xrs:_,yrs:v,factor:e}}},function(t,e,n){var i=t(364),r=t(20),o=t(37),s=function(t){function e(e){var n=t.call(this)||this;if(n.removed=new r.Signal(n,"removed"),null==e.model)throw new Error("model of a view wasn't configured");return n.model=e.model,n._parent=e.parent,n.id=e.id||o.uniqueId(),n.initialize(e),!1!==e.connect_signals&&n.connect_signals(),n}return i.__extends(e,t),e.getters=function(t){for(var e in t){var n=t[e];Object.defineProperty(this.prototype,e,{get:n})}},e.prototype.initialize=function(t){},e.prototype.remove=function(){this._parent=void 0,this.disconnect_signals(),this.removed.emit(void 0)},e.prototype.toString=function(){return this.model.type+"View("+this.id+")"},Object.defineProperty(e.prototype,"parent",{get:function(){if(void 0!==this._parent)return this._parent;throw new Error("parent of a view wasn't configured")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_root",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.is_root?this:this.parent.root},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){},e.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},e.prototype.notify_finished=function(){this.root.notify_finished()},e}(r.Signalable());n.View=s},function(t,e,n){var i,r=t(364),o={}.hasOwnProperty,s=t(16),a=t(26),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),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"rgba("+255*(t=a.color2rgba(this.line_color.value(),this.line_alpha.value()))[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e}(i=function(){function t(t,e){void 0===e&&(e="");var n,i,r,o,s;for(this.obj=t,this.prefix=e,this.cache={},i=t.properties[e+this.do_attr].spec,this.doit=null!==i.value,s=this.attrs,r=0,o=s.length;r<o;r++)this[n=s[r]]=t.properties[e+n]}return t.prototype.warm_cache=function(t){var e,n,i,r,o,s;for(o=this.attrs,s=[],n=0,i=o.length;n<i;n++)e=o[n],void 0!==(r=this.obj.properties[this.prefix+e]).spec.value?s.push(this.cache[e]=r.spec.value):s.push(this.cache[e+"_array"]=r.array(t));return s},t.prototype.cache_select=function(t,e){var n;return void 0!==(n=this.obj.properties[this.prefix+t]).spec.value?this.cache[t]=n.spec.value:this.cache[t]=this.cache[t+"_array"][e]},t.prototype.set_vectorize=function(t,e){return null!=this.all_indices?this._set_vectorize(t,this.all_indices[e]):this._set_vectorize(t,e)},t}());n.Line=l,l.prototype.attrs=Object.keys(s.line()),l.prototype.do_attr="line_color";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),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"rgba("+255*(t=a.color2rgba(this.fill_color.value(),this.fill_alpha.value()))[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e}(i);n.Fill=u,u.prototype.attrs=Object.keys(s.fill()),u.prototype.do_attr="fill_color";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.cache_select=function(e,n){var i;return"font"===e?(i=t.prototype.cache_select.call(this,"text_font_style",n)+" "+t.prototype.cache_select.call(this,"text_font_size",n)+" "+t.prototype.cache_select.call(this,"text_font",n),this.cache.font=i):t.prototype.cache_select.call(this,e,n)},e.prototype.font_value=function(){var t,e;return t=this.text_font.value(),e=this.text_font_size.value(),this.text_font_style.value()+" "+e+" "+t},e.prototype.color_value=function(){var t;return"rgba("+255*(t=a.color2rgba(this.text_color.value(),this.text_alpha.value()))[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}(i);n.Text=h,h.prototype.attrs=Object.keys(s.text()),h.prototype.do_attr="text_color",n.Visuals=function(){function t(t){var e,n,i,r,o,s,a;for(s=t.mixins,n=0,i=s.length;n<i;n++)a=s[n],c=a.split(":"),r=c[0],_=c[1],o=void 0===_?"":_,e=function(){switch(r){case"line":return l;case"fill":return u;case"text":return h}}(),this[o+r]=new e(t,o);var c,_}return t.prototype.warm_cache=function(t){var e,n,r;r=[];for(e in this)o.call(this,e)&&((n=this[e])instanceof i?r.push(n.warm_cache(t)):r.push(void 0));return r},t.prototype.set_all_indices=function(t){var e,n,r;r=[];for(e in this)o.call(this,e)&&((n=this[e])instanceof i?r.push(n.all_indices=t):r.push(void 0));return r},t}()},function(t,e,n){var i=t(364),r=t(0),o=t(248),s=t(14),a=t(3),l=t(8),u=t(20),h=t(33),c=t(35),_=t(27),p=t(22),d=t(30),f=t(28),m=t(42),v=t(139),g=t(173),y=t(50),b=function(){function t(t){this.document=t,this.session=null,this.subscribed_models=new _.Set}return t.prototype.send_event=function(t){null!=this.session&&this.session.send_event(t)},t.prototype.trigger=function(t){for(var e=0,n=this.subscribed_models.values;e<n.length;e++){var i=n[e];if(null==t.model_id||t.model_id===i){var r=this.document._all_models[i];null!=r&&r._process_event(t)}}},t}();n.EventManager=b;var x=function(){return function(t){this.document=t}}();n.DocumentChangedEvent=x;var w=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e)||this;return a.model=n,a.attr=i,a.old=r,a.new_=o,a.setter_id=s,a}return i.__extends(e,t),e.prototype.json=function(t){if("id"===this.attr)throw new Error("'id' field should never change, whatever code just set it is wrong");var e=this.new_,n=l.HasProps._value_to_json(this.attr,e,this.model),i={};l.HasProps._value_record_references(e,i,!0),this.model.id in i&&this.model!==e&&delete i[this.model.id];for(var r in i)t[r]=i[r];return{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,new:n}},e}(x);n.ModelChangedEvent=w;var k=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.title=n,r.setter_id=i,r}return i.__extends(e,t),e.prototype.json=function(t){return{kind:"TitleChanged",title:this.title}},e}(x);n.TitleChangedEvent=k;var S=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.model=n,r.setter_id=i,r}return i.__extends(e,t),e.prototype.json=function(t){return l.HasProps._value_record_references(this.model,t,!0),{kind:"RootAdded",model:this.model.ref()}},e}(x);n.RootAddedEvent=S;var T=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.model=n,r.setter_id=i,r}return i.__extends(e,t),e.prototype.json=function(t){return{kind:"RootRemoved",model:this.model.ref()}},e}(x);n.RootRemovedEvent=T,n.documents=[],n.DEFAULT_TITLE="Bokeh Application";var M=function(){function t(){n.documents.push(this),this._init_timestamp=Date.now(),this._title=n.DEFAULT_TITLE,this._roots=[],this._all_models={},this._all_models_by_name=new _.MultiDict,this._all_models_freeze_count=0,this._callbacks=[],this.event_manager=new b(this),this.idle=new u.Signal(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}return Object.defineProperty(t.prototype,"layoutables",{get:function(){return this._roots.filter(function(t){return t instanceof v.LayoutDOM})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"is_idle",{get:function(){for(var t=0,e=this.layoutables;t<e.length;t++){var n=e[t];if(!this._idle_roots.has(n))return!1}return!0},enumerable:!0,configurable:!0}),t.prototype.notify_idle=function(t){this._idle_roots.set(t,!0),this.is_idle&&(s.logger.info("document idle at "+(Date.now()-this._init_timestamp)+" ms"),this.idle.emit(void 0))},t.prototype.clear=function(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}},t.prototype.interactive_start=function(t){null==this._interactive_plot&&(this._interactive_plot=t,this._interactive_plot.trigger_event(new a.LODStart({}))),this._interactive_timestamp=Date.now()},t.prototype.interactive_stop=function(t){null!=this._interactive_plot&&this._interactive_plot.id===t.id&&this._interactive_plot.trigger_event(new a.LODEnd({})),this._interactive_plot=null,this._interactive_timestamp=null},t.prototype.interactive_duration=function(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp},t.prototype.destructively_move=function(t){if(t===this)throw new Error("Attempted to overwrite a document with itself");t.clear();var e=p.copy(this._roots);this.clear();for(var n=0,i=e;n<i.length;n++){var r=i[n];if(null!=r.document)throw new Error("Somehow we didn't detach "+r)}if(0!==Object.keys(this._all_models).length)throw new Error("this._all_models still had stuff in it: "+this._all_models);for(var o=0,s=e;o<s.length;o++){var r=s[o];t.add_root(r)}t.set_title(this._title)},t.prototype._push_all_models_freeze=function(){this._all_models_freeze_count+=1},t.prototype._pop_all_models_freeze=function(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()},t.prototype._invalidate_all_models=function(){s.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()},t.prototype._recompute_all_models=function(){for(var t=new _.Set,e=0,n=this._roots;e<n.length;e++){var i=n[e];t=t.union(i.references())}for(var r=new _.Set(d.values(this._all_models)),o=r.diff(t),s=t.diff(r),a={},l=0,u=t.values;l<u.length;l++){var h=u[l];a[h.id]=h}for(var c=0,p=o.values;c<p.length;c++){var f=p[c];f.detach_document(),f instanceof y.Model&&null!=f.name&&this._all_models_by_name.remove_value(f.name,f)}for(var m=0,v=s.values;m<v.length;m++){var g=v[m];g.attach_document(this),g instanceof y.Model&&null!=g.name&&this._all_models_by_name.add_value(g.name,g)}this._all_models=a},t.prototype.roots=function(){return this._roots},t.prototype.add_root=function(t,e){if(s.logger.debug("Adding root: "+t),!p.contains(this._roots,t)){this._push_all_models_freeze();try{this._roots.push(t)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new S(this,t,e))}},t.prototype.remove_root=function(t,e){var n=this._roots.indexOf(t);if(!(n<0)){this._push_all_models_freeze();try{this._roots.splice(n,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new T(this,t,e))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t,e){t!==this._title&&(this._title=t,this._trigger_on_change(new k(this,t,e)))},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){p.contains(this._callbacks,t)||this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e=this._callbacks.indexOf(t);e>=0&&this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){for(var e=0,n=this._callbacks;e<n.length;e++){var i=n[e];i(t)}},t.prototype._notify_change=function(t,e,n,i,r){"name"===e&&(this._all_models_by_name.remove_value(n,t),null!=i&&this._all_models_by_name.add_value(i,t));var o=null!=r?r.setter_id:void 0;this._trigger_on_change(new w(this,t,e,n,i,o))},t._references_json=function(t,e){void 0===e&&(e=!0);for(var n=[],i=0,r=t;i<r.length;i++){var o=r[i],s=o.ref();s.attributes=o.attributes_as_json(e),delete s.attributes.id,n.push(s)}return n},t._instantiate_object=function(t,e,n){var i=d.extend({},n,{id:t}),o=r.Models(e);return new o(i,{silent:!0,defer_initialization:!0})},t._instantiate_references_json=function(e,n){for(var i={},r=0,o=e;r<o.length;r++){var s=o[r],a=s.id,l=s.type,u=s.attributes||{},h=void 0;a in n?h=n[a]:(h=t._instantiate_object(a,l,u),null!=s.subtype&&h.set_subtype(s.subtype)),i[h.id]=h}return i},t._resolve_refs=function(t,e,n){function i(t){if(h.is_ref(t)){if(t.id in e)return e[t.id];if(t.id in n)return n[t.id];throw new Error("reference "+JSON.stringify(t)+" isn't known (not in Document?)")}return m.isArray(t)?function(t){for(var e=[],n=0,r=t;n<r.length;n++){var o=r[n];e.push(i(o))}return e}(t):m.isObject(t)?function(t){var e={};for(var n in t){var r=t[n];e[n]=i(r)}return e}(t):t}return i(t)},t._initialize_references_json=function(e,n,i){function r(t,e){function n(r){if(r instanceof l.HasProps){if(!(r.id in i)&&r.id in t){i[r.id]=!0;var o=t[r.id],s=o[1],a=o[2];for(var u in s){var h=s[u];n(h)}e(r,s,a)}}else if(m.isArray(r))for(var c=0,_=r;c<_.length;c++){var h=_[c];n(h)}else if(m.isObject(r))for(var p in r){var h=r[p];n(h)}}var i={};for(var r in t){var o=t[r],s=o[0];n(s)}}for(var o={},s=0,a=e;s<a.length;s++){var u=a[s],h=u.id,c=u.attributes,_=!(h in n),p=_?i[h]:n[h],d=t._resolve_refs(c,n,i);o[p.id]=[p,d,_]}r(o,function(t,e,n){n&&t.setv(e,{silent:!0})}),r(o,function(t,e,n){n&&t.finalize(e,{})})},t._event_for_attribute_change=function(t,e,n,i,r){var o=i.get_model_by_id(t.id);if(o.attribute_is_serializable(e)){var s={kind:"ModelChanged",model:{id:t.id,type:t.type},attr:e,new:n};return l.HasProps._json_record_references(i,n,r,!0),s}return null},t._events_to_sync_objects=function(e,n,i,r){for(var o=Object.keys(e.attributes),a=Object.keys(n.attributes),l=p.difference(o,a),u=p.difference(a,o),h=p.intersection(o,a),c=[],_=0,d=l;_<d.length;_++){var m=d[_];s.logger.warn("Server sent key "+m+" but we don't seem to have it in our JSON")}for(var v=0,g=u;v<g.length;v++){var m=g[v],y=n.attributes[m];c.push(t._event_for_attribute_change(e,m,y,i,r))}for(var b=0,x=h;b<x.length;b++){var m=x[b],w=e.attributes[m],y=n.attributes[m];null==w&&null==y||(null==w||null==y?c.push(t._event_for_attribute_change(e,m,y,i,r)):f.isEqual(w,y)||c.push(t._event_for_attribute_change(e,m,y,i,r)))}return c.filter(function(t){return null!=t})},t._compute_patch_since_json=function(e,n){function i(t){for(var e={},n=0,i=t.roots.references;n<i.length;n++){var r=i[n];e[r.id]=r}return e}for(var r=n.to_json(!1),o=i(e),s={},a=[],l=0,u=e.roots.root_ids;l<u.length;l++){var h=u[l];s[h]=o[h],a.push(h)}for(var c=i(r),_={},f=[],m=0,v=r.roots.root_ids;m<v.length;m++){var h=v[m];_[h]=c[h],f.push(h)}if(a.sort(),f.sort(),p.difference(a,f).length>0||p.difference(f,a).length>0)throw new Error("Not implemented: computing add/remove of document roots");var g={},y=[];for(var b in n._all_models)if(b in o){var x=t._events_to_sync_objects(o[b],c[b],n,g);y=y.concat(x)}return{references:t._references_json(d.values(g),!1),events:y}},t.prototype.to_json_string=function(t){return void 0===t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){void 0===e&&(e=!0);var n=this._roots.map(function(t){return t.id}),i=d.values(this._all_models);return{title:this._title,roots:{root_ids:n,references:t._references_json(i,e)}}},t.from_json_string=function(e){var n=JSON.parse(e);return t.from_json(n)},t.from_json=function(e){s.logger.debug("Creating Document from JSON");var n=e.version,i=-1!==n.indexOf("+")||-1!==n.indexOf("-"),r="Library versions: JS ("+o.version+") / Python ("+n+")";i||o.version===n?s.logger.debug(r):(s.logger.warn("JS/Python version mismatch"),s.logger.warn(r));var a=e.roots,l=a.root_ids,u=a.references,h=t._instantiate_references_json(u,{});t._initialize_references_json(u,{},h);for(var c=new t,_=0,p=l;_<p.length;_++){var d=p[_];c.add_root(h[d])}return c.set_title(e.title),c},t.prototype.replace_with_json=function(e){var n=t.from_json(e);n.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){for(var n={},i=[],r=0,o=e;r<o.length;r++){var a=o[r];if(a.document!==this)throw s.logger.warn("Cannot create a patch using events from a different document, event had ",a.document," we are ",this),new Error("Cannot create a patch using events from a different document");i.push(a.json(n))}return{events:i,references:t._references_json(d.values(n))}},t.prototype.apply_json_patch=function(e,n,i){for(var r=e.references,o=e.events,a=t._instantiate_references_json(r,this._all_models),l=0,u=o;l<u.length;l++){var h=u[l];switch(h.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":var _=h.model.id;if(_ in this._all_models)a[_]=this._all_models[_];else if(!(_ in a))throw s.logger.warn("Got an event for unknown model ",h.model),new Error("event model wasn't known")}}var p={},d={};for(var f in a){var m=a[f];f in this._all_models?p[f]=m:d[f]=m}t._initialize_references_json(r,p,d);for(var v=0,y=o;v<y.length;v++){var h=y[v];switch(h.kind){case"ModelChanged":var b=h.model.id;if(!(b in this._all_models))throw new Error("Cannot apply patch to "+b+" which is not in the document");var x=this._all_models[b],w=h.attr,k=h.model.type;if("data"===w&&"ColumnDataSource"===k){var S=c.decode_column_data(h.new,n),T=S[0],M=S[1];x.setv({_shapes:M,data:T},{setter_id:i})}else{var m=t._resolve_refs(h.new,p,d);x.setv([w,m],{setter_id:i})}break;case"ColumnDataChanged":var A=h.column_source.id;if(!(A in this._all_models))throw new Error("Cannot stream to "+A+" which is not in the document");var E=this._all_models[A],z=c.decode_column_data(h.new,n),T=z[0],M=z[1];if(null!=h.cols){for(var C in E.data)C in T||(T[C]=E.data[C]);for(var C in E._shapes)C in M||(M[C]=E._shapes[C])}E.setv({_shapes:M,data:T},{setter_id:i,check_eq:!1});break;case"ColumnsStreamed":var A=h.column_source.id;if(!(A in this._all_models))throw new Error("Cannot stream to "+A+" which is not in the document");var E=this._all_models[A];if(!(E instanceof g.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");var T=h.data,O=h.rollover;E.stream(T,O);break;case"ColumnsPatched":var A=h.column_source.id;if(!(A in this._all_models))throw new Error("Cannot patch "+A+" which is not in the document");var E=this._all_models[A];if(!(E instanceof g.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");var N=h.patches;E.patch(N);break;case"RootAdded":var j=h.model.id,P=a[j];this.add_root(P,i);break;case"RootRemoved":var j=h.model.id,P=a[j];this.remove_root(P,i);break;case"TitleChanged":this.set_title(h.title,i);break;default:throw new Error("Unknown patch event "+JSON.stringify(h))}}},t}();n.Document=M},function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f=t(0),m=t(1),v=t(14),g=t(47),y=t(5),b=t(24),x=t(37),w=t(30),k=t(42),S=t(246);n.BOKEH_ROOT="bk-root",l=function(t,e){if(e.buffers.length>0?t.consume(e.buffers[0].buffer):t.consume(e.content.data),null!=(e=t.message))return this.apply_json_patch(e.content,e.buffers)},c=function(t,e,n){var i;if(t===n.target_name)return i=new S.Receiver,n.on_msg(l.bind(e,i))},u=function(t,e){var n,i,r,o,s;if("undefined"==typeof Jupyter||null===Jupyter||null==Jupyter.notebook.kernel)return console.warn("Jupyter notebooks comms not available. push_notebook() will not function");v.logger.info("Registering Jupyter comms for target "+t),n=Jupyter.notebook.kernel.comm_manager,s=function(n){return c(t,e,n)},o=n.comms;for(r in o)o[r].then(s);try{return n.register_target(t,function(n,i){var r;return v.logger.info("Registering Jupyter comms for target "+t),r=new S.Receiver,n.on_msg(l.bind(e,r))})}catch(t){return i=t,v.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+i+")")}},i=function(t){var e;return e=new t.default_view({model:t,parent:null}),f.index[t.id]=e,e},o=function(t){var e,i,r,o;if(o=t.elementid,null==(r=document.getElementById(o)))throw new Error("Error rendering Bokeh model: could not find tag with id: "+o);if(!document.body.contains(r))throw new Error("Error rendering Bokeh model: element with id '"+o+"' must be under <body>");return"SCRIPT"===r.tagName&&(d(r,t),i=y.div({class:n.BOKEH_ROOT}),y.replaceWith(r,i),e=y.div(),i.appendChild(e),r=e),r},n.add_model_standalone=function(t,e,n){var r;if(null==(r=n.get_model_by_id(t)))throw new Error("Model "+t+" was not in document "+n);return i(r).renderTo(e,!0)},n.add_document_standalone=function(t,e,n){void 0===n&&(n=!1);var r,o,s,a,l,u,h;for(h={},l=function(t){var n;return(n=i(t)).renderTo(e),h[t.id]=n},u=function(t){var n;if(t.id in h)return n=h[t.id],e.removeChild(n.el),delete h[t.id],delete f.index[t.id]},a=t.roots(),r=0,o=a.length;r<o;r++)s=a[r],l(s);return n&&(window.document.title=t.title()),t.on_change(function(t){return t instanceof g.RootAddedEvent?l(t.model):t instanceof g.RootRemovedEvent?u(t.model):n&&t instanceof g.TitleChangedEvent?window.document.title=t.title:void 0}),h},h={},s=function(t,e,n){var i;if(null==t)throw new Error("Missing websocket_url");return t in h||(h[t]={}),i=h[t],e in i||(i[e]=m.pull_session(t,e,n)),i[e]},_=function(t,e,i,r){var o;return o=window.location.search.substr(1),s(e,i,o).then(function(e){return n.add_document_standalone(e.document,t,r)},function(t){throw v.logger.error("Failed to load Bokeh session "+i+": "+t),t})},p=function(t,e,n,r){var o;return o=window.location.search.substr(1),s(e,r,o).then(function(e){var r;if(null==(r=e.document.get_model_by_id(n)))throw new Error("Did not find model "+n+" in session");return i(r).renderTo(t,!0)},function(t){throw v.logger.error("Failed to load Bokeh session "+r+": "+t),t})},n.inject_css=function(t){var e;return e=y.link({href:t,rel:"stylesheet",type:"text/css"}),document.body.appendChild(e)},n.inject_raw_css=function(t){var e;return e=y.style({},t),document.body.appendChild(e)},d=function(t,e){var n;return null!=(n=t.dataset).bokehLogLevel&&n.bokehLogLevel.length>0&&v.set_log_level(n.bokehLogLevel),null!=n.bokehDocId&&n.bokehDocId.length>0&&(e.docid=n.bokehDocId),null!=n.bokehModelId&&n.bokehModelId.length>0&&(e.modelid=n.bokehModelId),null!=n.bokehSessionId&&n.bokehSessionId.length>0&&(e.sessionid=n.bokehSessionId),v.logger.info("Will inject Bokeh script tag with params "+JSON.stringify(e))},n.embed_items_notebook=function(t,e){var i,r,s,a,l,h;if(1!==w.size(t))throw new Error("embed_items_notebook expects exactly one document in docs_json");for(i=g.Document.from_json(w.values(t)[0]),h=[],s=0,l=e.length;s<l;s++)null!=(a=e[s]).notebook_comms_target&&u(a.notebook_comms_target,i),r=o(a),null!=a.modelid?h.push(n.add_model_standalone(a.modelid,r,i)):h.push(n.add_document_standalone(i,r,!1));return h},a=function(t,e){var n,i;return i="ws:","https:"===window.location.protocol&&(i="wss:"),null!=e?(n=document.createElement("a")).href=e:n=window.location,null!=t?"/"===t&&(t=""):t=n.pathname.replace(/\/+$/,""),i+"//"+n.host+t+"/ws"},n.embed_items=function(t,e,n,i){return b.defer(function(){return r(t,e,n,i)})},r=function(t,e,i,r){var s,l,u,h,c,d,f,m,y,b;k.isString(t)&&(t=JSON.parse(x.unescape(t))),l={};for(s in t)l[s]=g.Document.from_json(t[s]);for(m=[],h=0,d=e.length;h<d;h++)if(c=e[h],u=o(c),y=null!=c.use_for_title&&c.use_for_title,null!=c.sessionid)b=a(i,r),v.logger.debug("embed: computed ws url: "+b),f=null!=c.modelid?p(u,b,c.modelid,c.sessionid):_(u,b,c.sessionid,y),m.push(f.then(function(t){return console.log("Bokeh items were rendered successfully")},function(t){return console.log("Error rendering Bokeh items ",t)}));else{if(null==c.docid)throw new Error("Error rendering Bokeh items to element "+c.elementid+": no document ID or session ID specified");null!=c.modelid?m.push(n.add_model_standalone(c.modelid,u,l[c.docid])):m.push(n.add_document_standalone(l[c.docid],u,y))}return m}},function(t,e,n){t(244);var i=t(248);n.version=i.version;var r=t(48);n.embed=r;var o=t(14);n.logger=o.logger,n.set_log_level=o.set_log_level;var s=t(19);n.settings=s.settings;var a=t(0);n.Models=a.Models,n.index=a.index;var l=t(47);n.documents=l.documents;var u=t(247);n.safely=u.safely},function(t,e,n){var i=t(364),r=t(8),o=t(15),s=t(42),a=t(30),l=t(14),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this);for(var n in this.js_property_callbacks)for(var i=this.js_property_callbacks[n],r=n.split(":"),o=r[0],s=r[1],a=void 0===s?null:s,l=function(t){var n=null!=a?u.properties[a][o]:u[o];u.connect(n,function(){return t.execute(e,{})})},u=this,h=0,c=i;h<c.length;h++){var _=c[h];l(_)}this.connect(this.properties.js_event_callbacks.change,function(){return e._update_event_callbacks}),this.connect(this.properties.subscribed_events.change,function(){return e._update_event_callbacks})},e.prototype._process_event=function(t){if(t.is_applicable_to(this)){t=t._customize_event(this);for(var e=0,n=this.js_event_callbacks[t.event_name]||[];e<n.length;e++){var i=n[e];i.execute(t,{})}null!=this.document&&this.subscribed_events.some(function(e){return e==t.event_name})&&this.document.event_manager.send_event(t)}},e.prototype.trigger_event=function(t){null!=this.document&&this.document.event_manager.trigger(t.set_model_id(this.id))},e.prototype._update_event_callbacks=function(){null!=this.document?this.document.event_manager.subscribed_models.push(this.id):l.logger.warn("WARNING: Document not defined for updating event callbacks")},e.prototype._doc_attached=function(){a.isEmpty(this.js_event_callbacks)&&a.isEmpty(this.subscribed_events)||this._update_event_callbacks()},e.prototype.select=function(t){if(s.isString(t))return this.references().filter(function(n){return n instanceof e&&n.name===t});if(t.prototype instanceof r.HasProps)return this.references().filter(function(e){return e instanceof t});throw new Error("invalid selector")},e.prototype.select_one=function(t){var e=this.select(t);switch(e.length){case 0:return null;case 1:return e[0];default:throw new Error("found more than one object matching given selector")}},e}(r.HasProps);n.Model=u,u.prototype.type="Model",u.define({tags:[o.Array,[]],name:[o.String],js_property_callbacks:[o.Any,{}],js_event_callbacks:[o.Any,{}],subscribed_events:[o.Array,[]]})},function(t,e,n){var i=t(364),r=t(12),o=t(15),s=t(165);n.AnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_size=function(){return new Error("not implemented")},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e}(s.RendererView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.add_panel=function(t){var e;if(null==this.panel||t!==this.panel.side)return(e=new r.SidePanel({side:t})).attach_document(this.document),this.set_panel(e)},e.prototype.set_panel=function(t){return this.panel=t,this.level="overlay"},e}(s.Renderer);n.Annotation=a,a.prototype.type="Annotation",a.prototype.default_view=n.AnnotationView,a.define({plot:[o.Instance]}),a.override({level:"annotation"})},function(t,e,n){var i=t(364),r=t(51),o=t(53),s=t(173),a=t(15),l=t(29);n.ArrowView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),null==this.model.source&&(this.model.source=new s.ColumnDataSource),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s;return e=this.plot_view.frame,"data"===this.model.start_units?(r=e.xscales[this.model.x_range_name].v_compute(this._x_start),s=e.yscales[this.model.y_range_name].v_compute(this._y_start)):(r=e.xview.v_compute(this._x_start),s=e.yview.v_compute(this._y_start)),"data"===this.model.end_units?(i=e.xscales[this.model.x_range_name].v_compute(this._x_end),o=e.yscales[this.model.y_range_name].v_compute(this._y_end)):(i=e.xview.v_compute(this._x_end),o=e.yview.v_compute(this._y_end)),n=[r,s],t=[i,o],[n,t]},e.prototype.render=function(){var t,e,n,i,r;if(this.model.visible){return(t=this.plot_view.canvas_view.ctx).save(),o=this._map_data(),this.start=o[0],this.end=o[1],null!=this.model.end&&this._arrow_head(t,"render",this.model.end,this.start,this.end),null!=this.model.start&&this._arrow_head(t,"render",this.model.start,this.end,this.start),t.beginPath(),s=this.plot_model.canvas.bbox.rect,i=s.x,r=s.y,n=s.width,e=s.height,t.rect(i,r,n,e),null!=this.model.end&&this._arrow_head(t,"clip",this.model.end,this.start,this.end),null!=this.model.start&&this._arrow_head(t,"clip",this.model.start,this.end,this.start),t.closePath(),t.clip(),this._arrow_body(t),t.restore();var o,s}},e.prototype._arrow_body=function(t){var e,n,i,r;if(this.visuals.line.doit){for(r=[],e=n=0,i=this._x_start.length;0<=i?n<i:n>i;e=0<=i?++n:--n)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]),r.push(t.stroke());return r}},e.prototype._arrow_head=function(t,e,n,i,r){var o,s,a,u,h;for(h=[],s=a=0,u=this._x_start.length;0<=u?a<u:a>u;s=0<=u?++a:--a)o=Math.PI/2+l.atan2([i[0][s],i[1][s]],[r[0][s],r[1][s]]),t.save(),t.translate(r[0][s],r[1][s]),t.rotate(o),"render"===e?n.render(t):"clip"===e&&n.clip(t),h.push(t.restore());return h},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Arrow=u,u.prototype.default_view=n.ArrowView,u.prototype.type="Arrow",u.mixins(["line"]),u.define({x_start:[a.NumberSpec],y_start:[a.NumberSpec],start_units:[a.String,"data"],start:[a.Instance,null],x_end:[a.NumberSpec],y_end:[a.NumberSpec],end_units:[a.String,"data"],end:[a.Instance,function(){return new o.OpenHead({})}],source:[a.Instance],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]})},function(t,e,n){var i=t(364),r=t(51),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals=new o.Visuals(this)},e.prototype.render=function(t,e){return null},e.prototype.clip=function(t,e){return null},e}(r.Annotation);n.ArrowHead=a,a.prototype.type="ArrowHead";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,0),t.lineTo(.5*this.size,this.size)},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.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.stroke()},e}(a);n.OpenHead=l,l.prototype.type="OpenHead",l.mixins(["line"]),l.define({size:[s.Number,25]});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke()},e.prototype._normal=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},e}(a);n.NormalHead=u,u.prototype.type="NormalHead",u.mixins(["line","fill"]),u.define({size:[s.Number,25]}),u.override({fill_color:"black"});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke()},e.prototype._vee=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.closePath()},e}(a);n.VeeHead=h,h.prototype.type="VeeHead",h.mixins(["line","fill"]),h.define({size:[s.Number,25]}),h.override({fill_color:"black"});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),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.size,0),t.lineTo(-.5*this.size,0),t.stroke()},e}(a);n.TeeHead=c,c.prototype.type="TeeHead",c.mixins(["line"]),c.define({size:[s.Number,25]})},function(t,e,n){var i=t(364),r=t(51),o=t(173),s=t(15);n.BandView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_view.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c="height"===a?d:p,o="height"===a?p:d,_="height"===a?l.yview:l.xview,s="height"===a?l.xview:l.yview,n="data"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r="data"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t="data"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f="height"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){for(this._map_data(),(t=this.plot_view.canvas_view.ctx).beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=n=0,s=this._lower_sx.length;0<=s?n<s:n>s;e=0<=s?++n:--n)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(e=i=a=this._upper_sx.length-1;a<=0?i<=0:i>=0;e=a<=0?++i:--i)t.lineTo(this._upper_sx[e],this._upper_sy[e]);for(t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_value(t),t.fill()),t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=r=0,l=this._lower_sx.length;0<=l?r<l:r>l;e=0<=l?++r:--r)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]),e=o=0,u=this._upper_sx.length;0<=u?o<u:o>u;e=0<=u?++o:--o)t.lineTo(this._upper_sx[e],this._upper_sy[e]);return this.visuals.line.doit?(this.visuals.line.set_value(t),t.stroke()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Band=a,a.prototype.default_view=n.BandView,a.prototype.type="Band",a.mixins(["line","fill"]),a.define({lower:[s.DistanceSpec],upper:[s.DistanceSpec],base:[s.DistanceSpec],dimension:[s.Dimension,"height"],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){var i=t(364),r=t(51),o=t(20),s=t(5),a=t(15),l=t(42);n.BoxAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add("bk-shading"),s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.data_update,function(){return this.render()})):(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()}))},e.prototype.render=function(){var t,e,n,i,r,o,a,l,u=this;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible)return null==this.model.left&&null==this.model.right&&null==this.model.top&&null==this.model.bottom?(s.hide(this.el),null):(e=this.plot_model.frame,a=e.xscales[this.model.x_range_name],l=e.yscales[this.model.y_range_name],t=function(t,e,n,i,r){return null!=t?u.model.screen?t:"data"===e?n.compute(t):i.compute(t):r},i=t(this.model.left,this.model.left_units,a,e.xview,e._left.value),r=t(this.model.right,this.model.right_units,a,e.xview,e._right.value),o=t(this.model.top,this.model.top_units,l,e.yview,e._top.value),n=t(this.model.bottom,this.model.bottom_units,l,e.yview,e._bottom.value),("css"===this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this))(i,r,n,o))},e.prototype._css_box=function(t,e,n,i){var r,o,a;return a=Math.abs(e-t),o=Math.abs(n-i),this.el.style.left=t+"px",this.el.style.width=a+"px",this.el.style.top=i+"px",this.el.style.height=o+"px",this.el.style.borderWidth=this.model.line_width.value+"px",this.el.style.borderColor=this.model.line_color.value,this.el.style.backgroundColor=this.model.fill_color.value,this.el.style.opacity=this.model.fill_alpha.value,r=this.model.line_dash,l.isArray(r)&&(r=r.length<2?"solid":"dashed"),l.isString(r)&&(this.el.style.borderStyle=r),s.show(this.el)},e.prototype._canvas_box=function(t,e,n,i){var r;return(r=this.plot_view.canvas_view.ctx).save(),r.beginPath(),r.rect(t,i,e-t,n-i),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,"data_update")},e.prototype.update=function(t){var e=t.left,n=t.right,i=t.top,r=t.bottom;return this.setv({left:e,right:n,top:i,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.BoxAnnotation=u,u.prototype.default_view=n.BoxAnnotationView,u.prototype.type="BoxAnnotation",u.mixins(["line","fill"]),u.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"]}),u.internal({screen:[a.Boolean,!1]}),u.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){var i=t(364),r=t(51),o=t(180),s=t(91),a=t(146),l=t(168),u=t(169),h=t(160),c=t(15),_=t(40),p=t(22),d=t(30),f=t(42);n.ColorBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._set_canvas_image()},e.prototype.connect_signals=function(){var e=this;if(t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()}),this.connect(this.model.ticker.change,function(){return e.plot_view.request_render()}),this.connect(this.model.formatter.change,function(){return e.plot_view.request_render()}),null!=this.model.color_mapper)return this.connect(this.model.color_mapper.change,function(){return this._set_canvas_image(),this.plot_view.request_render()})},e.prototype._get_size=function(){var t,e;return null==this.model.color_mapper?0:(t=this.compute_legend_dimensions(),"above"===(e=this.model.panel.side)||"below"===e?t.height:"left"===e||"right"===e?t.width:void 0)},e.prototype._set_canvas_image=function(){var t,e,n,i,r,o,s,l,u,h;if(null!=this.model.color_mapper){switch(l=this.model.color_mapper.palette,"vertical"===this.model.orientation&&(l=l.slice(0).reverse()),this.model.orientation){case"vertical":c=[1,l.length],h=c[0],r=c[1];break;case"horizontal":_=[l.length,1],h=_[0],r=_[1]}return n=document.createElement("canvas"),p=[h,r],n.width=p[0],n.height=p[1],o=n.getContext("2d"),s=o.getImageData(0,0,h,r),i=new a.LinearColorMapper({palette:l}),t=i.v_map_screen(function(){u=[];for(var t=0,e=l.length;0<=e?t<e:t>e;0<=e?t++:t--)u.push(t);return u}.apply(this)),e=new Uint8Array(t),s.data.set(e),o.putImageData(s,0,0),this.image=n;var c,_,p}},e.prototype.compute_legend_dimensions=function(){var t,e,n,i,r,o,s,a,l;switch(t=this.model._computed_image_dimensions(),u=[t.height,t.width],e=u[0],n=u[1],i=this._get_label_extent(),l=this.model._title_extent(),a=this.model._tick_extent(),s=this.model.padding,this.model.orientation){case"vertical":r=e+l+2*s,o=n+a+i+2*s;break;case"horizontal":r=e+l+a+i+2*s,o=n+2*s}return{height:r,width:o};var u},e.prototype.compute_legend_location=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_;if(e=this.compute_legend_dimensions(),p=[e.height,e.width],n=p[0],r=p[1],i=this.model.margin,s=null!=(a=this.model.panel)?a:this.plot_view.frame,d=s.bbox.ranges,t=d[0],h=d[1],o=this.model.location,f.isString(o))switch(o){case"top_left":l=t.start+i,u=h.start+i;break;case"top_center":l=(t.end+t.start)/2-r/2,u=h.start+i;break;case"top_right":l=t.end-i-r,u=h.start+i;break;case"bottom_right":l=t.end-i-r,u=h.end-i-n;break;case"bottom_center":l=(t.end+t.start)/2-r/2,u=h.end-i-n;break;case"bottom_left":l=t.start+i,u=h.end-i-n;break;case"center_left":l=t.start+i,u=(h.end+h.start)/2-n/2;break;case"center":l=(t.end+t.start)/2-r/2,u=(h.end+h.start)/2-n/2;break;case"center_right":l=t.end-i-r,u=(h.end+h.start)/2-n/2}else f.isArray(o)&&2===o.length&&(c=o[0],_=o[1],l=s.xview.compute(c),u=s.yview.compute(_)-n);return{sx:l,sy:u};var p,d},e.prototype.render=function(){var t,e,n,i,r;if(this.model.visible&&null!=this.model.color_mapper){return(t=this.plot_view.canvas_view.ctx).save(),o=this.compute_legend_location(),n=o.sx,i=o.sy,t.translate(n,i),this._draw_bbox(t),e=this._get_image_offset(),t.translate(e.x,e.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high&&(r=this.model.tick_info(),this._draw_major_ticks(t,r),this._draw_minor_ticks(t,r),this._draw_major_labels(t,r)),this.model.title&&this._draw_title(t),t.restore();var o}},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,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.major_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.major,l=m[0],u=m[1],h=this.model.major_tick_in,c=this.model.major_tick_out,t.save(),t.translate(_,p),this.visuals.major_tick_line.set_value(t),n=r=0,a=l.length;0<=a?r<a:r>a;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_minor_ticks=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.minor_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.minor,l=m[0],u=m[1],h=this.model.minor_tick_in,c=this.model.minor_tick_out,t.save(),t.translate(_,p),this.visuals.minor_tick_line.set_value(t),n=r=0,a=l.length;0<=a?r<a:r>a;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_major_labels=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f;if(this.visuals.major_label_text.doit){for(m=this.model._normals(),s=m[0],a=m[1],r=this.model._computed_image_dimensions(),v=[r.width*s,r.height*a],_=v[0],d=v[1],u=this.model.label_standoff+this.model._tick_extent(),p=(g=[u*s,u*a])[0],f=g[1],y=e.coords.major,h=y[0],c=y[1],n=e.labels.major,this.visuals.major_label_text.set_value(t),t.save(),t.translate(_+p,d+f),i=o=0,l=h.length;0<=l?o<l:o>l;i=0<=l?++o:--o)t.fillText(n[i],Math.round(h[i]+s*this.model.label_standoff),Math.round(c[i]+a*this.model.label_standoff));return t.restore();var m,v,g,y}},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,n,i;if(i=this.model.tick_info().labels.major,null==this.model.color_mapper.low||null==this.model.color_mapper.high||d.isEmpty(i))n=0;else{switch((t=this.plot_view.canvas_view.ctx).save(),this.visuals.major_label_text.set_value(t),this.model.orientation){case"vertical":n=p.max(function(){var n,r,o;for(o=[],n=0,r=i.length;n<r;n++)e=i[n],o.push(t.measureText(e.toString()).width);return o}());break;case"horizontal":n=_.get_text_height(this.visuals.major_label_text.font_value()).height}n+=this.model.label_standoff,t.restore()}return n},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}(r.AnnotationView);var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n)},e.prototype._normals=function(){var t,e;return"vertical"===this.orientation?(t=(n=[1,0])[0],e=n[1]):(t=(i=[0,1])[0],e=i[1]),[t,e];var n,i},e.prototype._title_extent=function(){var t;return t=this.title_text_font+" "+this.title_text_font_size+" "+this.title_text_font_style,this.title?_.get_text_height(t).height+this.title_standoff:0},e.prototype._tick_extent=function(){return null!=this.color_mapper.low&&null!=this.color_mapper.high?p.max([this.major_tick_out,this.minor_tick_out]):0},e.prototype._computed_image_dimensions=function(){var t,e,n,i,r;switch(t=this.plot.plot_canvas.frame._height.value,e=this.plot.plot_canvas.frame._width.value,i=this._title_extent(),this.orientation){case"vertical":"auto"===this.height?null!=this.panel?n=t-2*this.padding-i:(n=p.max([25*this.color_mapper.palette.length,.3*t]),n=p.min([n,.8*t-2*this.padding-i])):n=this.height,r="auto"===this.width?25:this.width;break;case"horizontal":n="auto"===this.height?25:this.height,"auto"===this.width?null!=this.panel?r=e-2*this.padding:(r=p.max([25*this.color_mapper.palette.length,.3*e]),r=p.min([r,.8*e-2*this.padding])):r=this.width}return{height:n,width:r}},e.prototype._tick_coordinate_scale=function(t){var e,n;switch(e={source_range:new h.Range1d({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new h.Range1d({start:0,end:t})},this.color_mapper.type){case"LinearColorMapper":n=new l.LinearScale(e);break;case"LogColorMapper":n=new u.LogScale(e)}return n},e.prototype._format_major_labels=function(t,e){var n,i,r,o,s;for(o=t,n=this.formatter.doFormat(o,null),i=r=0,s=e.length;0<=s?r<s:r>s;i=0<=s?++r:--r)e[i]in this.major_label_overrides&&(n[i]=this.major_label_overrides[e[i]]);return n},e.prototype.tick_info=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y;switch(o=this._computed_image_dimensions(),this.orientation){case"vertical":v=o.height;break;case"horizontal":v=o.width}for(m=this._tick_coordinate_scale(v),b=this._normals(),i=b[0],s=b[1],x=[this.color_mapper.low,this.color_mapper.high],g=x[0],n=x[1],y=this.ticker.get_ticks(g,n,null,null,this.ticker.desired_num_ticks),e={major:[[],[]],minor:[[],[]]},c=y.major,p=y.minor,h=e.major,_=e.minor,r=a=0,d=c.length;0<=d?a<d:a>d;r=0<=d?++a:--a)c[r]<g||c[r]>n||(h[i].push(c[r]),h[s].push(0));for(r=l=0,f=p.length;0<=f?l<f:l>f;r=0<=f?++l:--l)p[r]<g||p[r]>n||(_[i].push(p[r]),_[s].push(0));return u={major:this._format_major_labels(h[i].slice(0),c)},h[i]=m.v_compute(h[i]),_[i]=m.v_compute(_[i]),"vertical"===this.orientation&&(h[i]=new Float64Array(function(){var e,n,r,o;for(r=h[i],o=[],n=0,e=r.length;n<e;n++)t=r[n],o.push(v-t);return o}()),_[i]=new Float64Array(function(){var e,n,r,o;for(r=_[i],o=[],n=0,e=r.length;n<e;n++)t=r[n],o.push(v-t);return o}())),{ticks:y,coords:e,labels:u};var b,x},e}(r.Annotation);n.ColorBar=m,m.prototype.default_view=n.ColorBarView,m.prototype.type="ColorBar",m.mixins(["text:major_label_","text:title_","line:major_tick_","line:minor_tick_","line:border_","line:bar_","fill:background_"]),m.define({location:[c.Any,"top_right"],orientation:[c.Orientation,"vertical"],title:[c.String],title_standoff:[c.Number,2],height:[c.Any,"auto"],width:[c.Any,"auto"],scale_alpha:[c.Number,1],ticker:[c.Instance,function(){return new o.BasicTicker}],formatter:[c.Instance,function(){return new s.BasicTickFormatter}],major_label_overrides:[c.Any,{}],color_mapper:[c.Instance],label_standoff:[c.Number,5],margin:[c.Number,30],padding:[c.Number,10],major_tick_in:[c.Number,5],major_tick_out:[c.Number,0],minor_tick_in:[c.Number,0],minor_tick_out:[c.Number,0]}),m.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"})},function(t,e,n){var i=t(51);n.Annotation=i.Annotation;var r=t(52);n.Arrow=r.Arrow;var o=t(53);n.ArrowHead=o.ArrowHead;var s=t(53);n.OpenHead=s.OpenHead;var a=t(53);n.NormalHead=a.NormalHead;var l=t(53);n.TeeHead=l.TeeHead;var u=t(53);n.VeeHead=u.VeeHead;var h=t(54);n.Band=h.Band;var c=t(55);n.BoxAnnotation=c.BoxAnnotation;var _=t(56);n.ColorBar=_.ColorBar;var p=t(58);n.Label=p.Label;var d=t(59);n.LabelSet=d.LabelSet;var f=t(60);n.Legend=f.Legend;var m=t(61);n.LegendItem=m.LegendItem;var v=t(62);n.PolyAnnotation=v.PolyAnnotation;var g=t(63);n.Span=g.Span;var y=t(64);n.TextAnnotation=y.TextAnnotation;var b=t(65);n.Title=b.Title;var x=t(66);n.ToolbarPanel=x.ToolbarPanel;var w=t(67);n.Tooltip=w.Tooltip;var k=t(68);n.Whisker=k.Whisker},function(t,e,n){var i=t(364),r=t(64),o=t(5),s=t(15);n.LabelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals.warm_cache(null)},e.prototype._get_size=function(){var t;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),this.model.panel.is_horizontal?t.measureText(this.model.text).ascent:t.measureText(this.model.text).width},e.prototype.render=function(){var t,e,n,i,r,s,a;if(this.model.visible||"css"!==this.model.render_mode||o.hide(this.el),this.model.visible){switch(this.model.angle_units){case"rad":t=-1*this.model.angle;break;case"deg":t=-1*this.model.angle*Math.PI/180}return e=null!=(n=this.model.panel)?n:this.plot_view.frame,s=this.plot_view.frame.xscales[this.model.x_range_name],a=this.plot_view.frame.yscales[this.model.y_range_name],i="data"===this.model.x_units?s.compute(this.model.x):e.xview.compute(this.model.x),r="data"===this.model.y_units?a.compute(this.model.y):e.yview.compute(this.model.y),i+=this.model.x_offset,r-=this.model.y_offset,("canvas"===this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.plot_view.canvas_view.ctx,this.model.text,i,r,t)}},e}(r.TextAnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.Label=a,a.prototype.default_view=n.LabelView,a.prototype.type="Label",a.mixins(["text","line:border_","fill:background_"]),a.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"]}),a.override({background_fill_color:null,border_line_color:null})},function(t,e,n){var i=t(364),r=t(64),o=t(173),s=t(5),a=t(15),l=t(42);n.LabelSetView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,r;if(t.prototype.initialize.call(this,e),this.set_data(this.model.source),"css"===this.model.render_mode){for(r=[],n=0,i=this._text.length;0<=i?n<i:n>i;0<=i?++n:--n)this.title_div=s.div({class:"bk-annotation-child",style:{display:"none"}}),r.push(this.el.appendChild(this.title_div));return r}},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.render()})):(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}))},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e)},e.prototype._map_data=function(){var t,e,n,i,r,o;return r=this.plot_view.frame.xscales[this.model.x_range_name],o=this.plot_view.frame.yscales[this.model.y_range_name],t=null!=(e=this.model.panel)?e:this.plot_view.frame,n="data"===this.model.x_units?r.v_compute(this._x):t.xview.v_compute(this._x),i="data"===this.model.y_units?o.v_compute(this._y):t.yview.v_compute(this._y),[n,i]},e.prototype.render=function(){var t,e,n,i,r,o,a,l;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible){for(e="canvas"===this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),t=this.plot_view.canvas_view.ctx,u=this._map_data(),a=u[0],l=u[1],o=[],n=i=0,r=this._text.length;0<=r?i<r:i>r;n=0<=r?++i:--i)o.push(e(t,n,this._text[n],a[n]+this._x_offset[n],l[n]-this._y_offset[n],this._angle[n]));return o;var u}},e.prototype._get_size=function(){var t,e;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),"above"===(e=this.model.panel.side)||"below"===e?t.measureText(this._text[0]).ascent:"left"===e||"right"===e?t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,n,i,r,o){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,n),t.save(),t.beginPath(),t.translate(i,r),t.rotate(o),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(n,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,n,i,r,o){var a,u,h,c;return u=this.el.childNodes[e],u.textContent=n,this.visuals.text.set_vectorize(t,e),a=this._calculate_bounding_box_dimensions(t,n),h=this.visuals.border_line.line_dash.value(),l.isArray(h)&&(c=h.length<2?"solid":"dashed"),l.isString(h)&&(c=h),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),u.style.position="absolute",u.style.left=i+a[0]+"px",u.style.top=r+a[1]+"px",u.style.color=""+this.visuals.text.text_color.value(),u.style.opacity=""+this.visuals.text.text_alpha.value(),u.style.font=""+this.visuals.text.font_value(),u.style.lineHeight="normal",o&&(u.style.transform="rotate("+o+"rad)"),this.visuals.background_fill.doit&&(u.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(u.style.borderStyle=""+c,u.style.borderWidth=this.visuals.border_line.line_width.value()+"px",u.style.borderColor=""+this.visuals.border_line.color_value()),s.show(u)},e}(r.TextAnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.LabelSet=u,u.prototype.default_view=n.LabelSetView,u.prototype.type="Label",u.mixins(["text","line:border_","fill:background_"]),u.define({x:[a.NumberSpec],y:[a.NumberSpec],x_units:[a.SpatialUnits,"data"],y_units:[a.SpatialUnits,"data"],text:[a.StringSpec,{field:"text"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,{value:0}],y_offset:[a.NumberSpec,{value:0}],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],render_mode:[a.RenderMode,"canvas"]}),u.override({background_fill_color:null,border_line_color:null})},function(t,e,n){var i=t(364),r=t(51),o=t(15),s=t(40),a=t(23),l=t(22),u=t(30),h=t(42),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()})},e.prototype.compute_legend_bbox=function(){var t,e,n,i,r,o,a,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;for(d=this.model.get_legend_names(),e=this.model.glyph_height,n=this.model.glyph_width,o=this.model.label_height,c=this.model.label_width,this.max_label_height=l.max([s.get_text_height(this.visuals.label_text.font_value()).height,o,e]),(t=this.plot_view.canvas_view.ctx).save(),this.visuals.label_text.set_value(t),this.text_widths={},r=0,g=d.length;r<g;r++)x=d[r],this.text_widths[x]=l.max([t.measureText(x).width,c]);if(t.restore(),b=Math.max(l.max(u.values(this.text_widths)),0),p=this.model.margin,f=this.legend_padding,m=this.model.spacing,a=this.model.label_standoff,"vertical"===this.model.orientation)_=d.length*this.max_label_height+Math.max(d.length-1,0)*m+2*f,v=b+n+a+2*f;else{v=2*f+Math.max(d.length-1,0)*m,k=this.text_widths;for(x in k)C=k[x],v+=l.max([C,c])+n+a;_=this.max_label_height+2*f}if(w=null!=(S=this.model.panel)?S:this.plot_view.frame,O=w.bbox.ranges,i=O[0],A=O[1],y=this.model.location,h.isString(y))switch(y){case"top_left":T=i.start+p,M=A.start+p;break;case"top_center":T=(i.end+i.start)/2-v/2,M=A.start+p;break;case"top_right":T=i.end-p-v,M=A.start+p;break;case"bottom_right":T=i.end-p-v,M=A.end-p-_;break;case"bottom_center":T=(i.end+i.start)/2-v/2,M=A.end-p-_;break;case"bottom_left":T=i.start+p,M=A.end-p-_;break;case"center_left":T=i.start+p,M=(A.end+A.start)/2-_/2;break;case"center":T=(i.end+i.start)/2-v/2,M=(A.end+A.start)/2-_/2;break;case"center_right":T=i.end-p-v,M=(A.end+A.start)/2-_/2}else h.isArray(y)&&2===y.length&&(E=y[0],z=y[1],T=w.xview.compute(E),M=w.yview.compute(z)-_);return{x:T,y:M,width:v,height:_};var O},e.prototype.bbox=function(){var t,e,n,i;return r=this.compute_legend_bbox(),n=r.x,i=r.y,e=r.width,t=r.height,new a.BBox({x:n,y:i,width:e,height:t});var r},e.prototype.on_hit=function(t,e){var n,i,r,o,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;for(n=this.model.glyph_height,i=this.model.glyph_width,f=this.legend_padding,m=this.model.spacing,_=this.model.label_standoff,E=C=f,d=this.compute_legend_bbox(),T="vertical"===this.model.orientation,w=this.model.items,o=0,v=w.length;o<v;o++)for(s=w[o],p=s.get_labels_list_from_label_prop(),s.get_field_from_label_prop(),l=0,g=p.length;l<g;l++){if(c=p[l],A=d.x+E,z=d.y+C,A+i,z+n,T?(O=[d.width-2*f,this.max_label_height],M=O[0],r=O[1]):(N=[this.text_widths[c]+i+_,this.max_label_height],M=N[0],r=N[1]),new a.BBox({x:A,y:z,width:M,height:r}).contains(t,e)){switch(this.model.click_policy){case"hide":for(k=s.renderers,u=0,y=k.length;u<y;u++)(x=k[u]).visible=!x.visible;break;case"mute":for(S=s.renderers,h=0,b=S.length;h<b;h++)(x=S[h]).muted=!x.muted}return!0}T?C+=this.max_label_height+m:E+=this.text_widths[c]+i+_+m}return!1;var O,N},e.prototype.render=function(){var t,e;if(this.model.visible&&0!==this.model.items.length)return e=this.plot_view.canvas_view.ctx,t=this.compute_legend_bbox(),e.save(),this._draw_legend_box(e,t),this._draw_legend_items(e,t),e.restore()},e.prototype._draw_legend_box=function(t,e){if(t.beginPath(),t.rect(e.x,e.y,e.width,e.height),this.visuals.background_fill.set_value(t),t.fill(),this.visuals.border_line.doit)return this.visuals.border_line.set_value(t),t.stroke()},e.prototype._draw_legend_items=function(t,e){var n,i,r,o,s,a,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;for(r=this.model.glyph_height,o=this.model.glyph_width,f=this.legend_padding,m=this.model.spacing,p=this.model.label_standoff,A=C=f,k="vertical"===this.model.orientation,x=this.model.items,a=0,v=x.length;a<v;a++)if(u=x[a],d=u.get_labels_list_from_label_prop(),i=u.get_field_from_label_prop(),0!==d.length)for(n=function(){switch(this.model.click_policy){case"none":return!0;case"hide":return l.all(u.renderers,function(t){return t.visible});case"mute":return l.all(u.renderers,function(t){return!t.muted})}}.call(this),h=0,g=d.length;h<g;h++){for(_=d[h],T=e.x+A,E=e.y+C,M=T+o,z=E+r,k?C+=this.max_label_height+m:A+=this.text_widths[_]+o+p+m,this.visuals.label_text.set_value(t),t.fillText(_,M+p,E+this.max_label_height/2),w=u.renderers,c=0,y=w.length;c<y;c++)b=w[c],this.plot_view.renderer_views[b.id].draw_legend(t,T,M,E,z,i,_);n||(k?(O=[e.width-2*f,this.max_label_height],S=O[0],s=O[1]):(N=[this.text_widths[_]+o+p,this.max_label_height],S=N[0],s=N[1]),t.beginPath(),t.rect(T,E,S,s),this.visuals.inactive_fill.set_value(t),t.fill())}return null;var O,N},e.prototype._get_size=function(){var t,e;return t=this.compute_legend_bbox(),"above"===(e=this.model.panel.side)||"below"===e?t.height+2*this.model.margin:"left"===e||"right"===e?t.width+2*this.model.margin:void 0},e}(r.AnnotationView);n.LegendView=c,c.getters({legend_padding:function(){return null!=this.visuals.border_line.line_color.value()?this.model.padding:0}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.cursor=function(){return"none"===this.click_policy?null:"pointer"},e.prototype.get_legend_names=function(){var t,e,n,i,r,o;for(i=[],o=this.items,t=0,r=o.length;t<r;t++)e=o[t],n=e.get_labels_list_from_label_prop(),i=i.concat(n);return i},e}(r.Annotation);n.Legend=_,_.prototype.default_view=c,_.prototype.type="Legend",_.mixins(["text:label_","fill:inactive_","line:border_","fill:background_"]),_.define({orientation:[o.Orientation,"vertical"],location:[o.Any,"top_right"],label_standoff:[o.Number,5],glyph_height:[o.Number,20],glyph_width:[o.Number,20],label_height:[o.Number,20],label_width:[o.Number,20],margin:[o.Number,10],padding:[o.Number,10],spacing:[o.Number,3],items:[o.Array,[]],click_policy:[o.Any,"none"]}),_.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,inactive_fill_color:"white",inactive_fill_alpha:.7,label_text_font_size:"10pt",label_text_baseline:"middle"})},function(t,e,n){var i=t(364),r=[].indexOf,o=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},s=t(50),a=t(15),l=t(14),u=t(22),h=t(173),c=function(t){function e(){var e=t.apply(this,arguments)||this;return e.get_field_from_label_prop=e.get_field_from_label_prop.bind(e),e.get_labels_list_from_label_prop=e.get_labels_list_from_label_prop.bind(e),e}return i.__extends(e,t),e.prototype._check_data_sources_on_renderers=function(){var t,e,n,i;if(null!=this.get_field_from_label_prop()){if(this.renderers.length<1)return!1;if(null!=(i=this.renderers[0].data_source))for(n=this.renderers,t=0,e=n.length;t<e;t++)if(n[t].data_source!==i)return!1}return!0},e.prototype._check_field_label_on_data_source=function(){var t,e;if(null!=(t=this.get_field_from_label_prop())){if(this.renderers.length<1)return!1;if(null!=(e=this.renderers[0].data_source)&&r.call(e.columns(),t)<0)return!1}return!0},e.prototype.initialize=function(e,n){if(t.prototype.initialize.call(this,e,n),this._check_data_sources_on_renderers()||l.logger.error("Non matching data sources on legend item renderers"),!this._check_field_label_on_data_source())return l.logger.error("Bad column name on label: "+this.label)},e.prototype.get_field_from_label_prop=function(){if(o(this,e),null!=this.label&&null!=this.label.field)return this.label.field},e.prototype.get_labels_list_from_label_prop=function(){var t,n,i;if(o(this,e),null!=this.label&&null!=this.label.value)return[this.label.value];if(null!=(n=this.get_field_from_label_prop())){if(!this.renderers[0]||null==this.renderers[0].data_source)return["No source found"];if((i=this.renderers[0].data_source)instanceof h.ColumnDataSource)return null!=(t=i.get_column(n))?u.uniq(t):["Invalid field"]}return[]},e}(s.Model);n.LegendItem=c,c.prototype.type="LegendItem",c.define({label:[a.StringSpec,null],renderers:[a.Array,[]]})},function(t,e,n){var i=t(364),r=t(51),o=t(20),s=t(15);n.PolyAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()})},e.prototype.render=function(t){var e,n,i,r,o,s,a,l;if(this.model.visible){if(a=this.model.xs,l=this.model.ys,a.length!==l.length)return null;if(a.length<3||l.length<3)return null;for(e=this.plot_view.frame,t=this.plot_view.canvas_view.ctx,n=i=0,r=a.length;0<=r?i<r:i>r;n=0<=r?++i:--i)"screen"===this.model.xs_units&&(o=this.model.screen?a[n]:e.xview.compute(a[n])),"screen"===this.model.ys_units&&(s=this.model.screen?l[n]:e.yview.compute(l[n])),0===n?(t.beginPath(),t.moveTo(o,s)):t.lineTo(o,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}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,"data_update")},e.prototype.update=function(t){var e=t.xs,n=t.ys;return this.setv({xs:e,ys:n,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.PolyAnnotation=a,a.prototype.default_view=n.PolyAnnotationView,a.prototype.type="PolyAnnotation",a.mixins(["line","fill"]),a.define({xs:[s.Array,[]],xs_units:[s.SpatialUnits,"data"],ys:[s.Array,[]],ys_units:[s.SpatialUnits,"data"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),a.internal({screen:[s.Boolean,!1]}),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){var i=t(364),r=t(51),o=t(5),s=t(15);n.SpanView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position="absolute",o.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return this._draw_span()}):"canvas"===this.model.render_mode?(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.properties.location.change,function(){return e.plot_view.request_render()})):(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.properties.location.change,function(){return this._draw_span()}))},e.prototype.render=function(){if(this.model.visible||"css"!==this.model.render_mode||o.hide(this.el),this.model.visible)return this._draw_span()},e.prototype._draw_span=function(){var t,e,n,i,r,s,a,l,u,h,c=this;if(null!=(r=this.model.for_hover?this.model.computed_location:this.model.location))return n=this.plot_view.frame,u=n.xscales[this.model.x_range_name],h=n.yscales[this.model.y_range_name],t=function(t,e){return c.model.for_hover?c.model.computed_location:"data"===c.model.location_units?t.compute(r):e.compute(r)},"width"===this.model.dimension?(a=t(h,n.yview),s=n._left.value,l=n._width.value,i=this.model.properties.line_width.value()):(a=n._top.value,s=t(u,n.xview),l=this.model.properties.line_width.value(),i=n._height.value),"css"===this.model.render_mode?(this.el.style.top=a+"px",this.el.style.left=s+"px",this.el.style.width=l+"px",this.el.style.height=i+"px",this.el.style.zIndex=1e3,this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),o.show(this.el)):"canvas"===this.model.render_mode?((e=this.plot_view.canvas_view.ctx).save(),e.beginPath(),this.visuals.line.set_value(e),e.moveTo(s,a),"width"===this.model.dimension?e.lineTo(s+l,a):e.lineTo(s,a+i),e.stroke(),e.restore()):void 0;o.hide(this.el)},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Span=a,a.prototype.default_view=n.SpanView,a.prototype.type="Span",a.mixins(["line"]),a.define({render_mode:[s.RenderMode,"canvas"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],location:[s.Number,null],location_units:[s.SpatialUnits,"data"],dimension:[s.Dimension,"width"]}),a.override({line_color:"black"}),a.internal({for_hover:[s.Boolean,!1],computed_location:[s.Number,null]})},function(t,e,n){var i=t(364),r=t(51),o=t(5),s=t(42),a=t(40);n.TextAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),"css"===this.model.render_mode)return this.el.classList.add("bk-annotation"),this.plot_view.canvas_overlays.appendChild(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?this.connect(this.model.change,function(){return this.render()}):this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._calculate_text_dimensions=function(t,e){var n,i;return i=t.measureText(e).width,n=a.get_text_height(this.visuals.text.font_value()).height,[i,n]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var n,i,r,o;switch(s=this._calculate_text_dimensions(t,e),i=s[0],n=s[1],t.textAlign){case"left":r=0;break;case"center":r=-i/2;break;case"right":r=-i}switch(t.textBaseline){case"top":o=0;break;case"middle":o=-.5*n;break;case"bottom":o=-1*n;break;case"alphabetic":o=-.8*n;break;case"hanging":o=-.17*n;break;case"ideographic":o=-.83*n}return[r,o,i,n];var s},e.prototype._get_size=function(){var t;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(this.model.text).ascent},e.prototype.render=function(){return null},e.prototype._canvas_text=function(t,e,n,i,r){var o;return this.visuals.text.set_value(t),o=this._calculate_bounding_box_dimensions(t,e),t.save(),t.beginPath(),t.translate(n,i),r&&t.rotate(r),t.rect(o[0],o[1],o[2],o[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,n,i,r){var a,l,u;return o.hide(this.el),this.visuals.text.set_value(t),a=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),this.el.style.position="absolute",this.el.style.left=n+a[0]+"px",this.el.style.top=i+a[1]+"px",this.el.style.color=""+this.visuals.text.text_color.value(),this.el.style.opacity=""+this.visuals.text.text_alpha.value(),this.el.style.font=""+this.visuals.text.font_value(),this.el.style.lineHeight="normal",r&&(this.el.style.transform="rotate("+r+"rad)"),this.visuals.background_fill.doit&&(this.el.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(this.el.style.borderStyle=""+u,this.el.style.borderWidth=this.visuals.border_line.line_width.value()+"px",this.el.style.borderColor=""+this.visuals.border_line.color_value()),this.el.textContent=e,o.show(this.el)},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.TextAnnotation=l,l.prototype.type="TextAnnotation",l.prototype.default_view=n.TextAnnotationView},function(t,e,n){var i=t(364),r=t(64),o=t(5),s=t(15),a=t(46);n.TitleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals.text=new a.Text(this.model)},e.prototype._get_location=function(){var t,e,n,i;switch(e=this.model.panel,t=this.model.offset,5,e.side){case"above":case"below":switch(this.model.vertical_align){case"top":i=e._top.value+5;break;case"middle":i=e._vcenter.value;break;case"bottom":i=e._bottom.value-5}switch(this.model.align){case"left":n=e._left.value+t;break;case"center":n=e._hcenter.value;break;case"right":n=e._right.value-t}break;case"left":switch(this.model.vertical_align){case"top":n=e._left.value-5;break;case"middle":n=e._hcenter.value;break;case"bottom":n=e._right.value+5}switch(this.model.align){case"left":i=e._bottom.value-t;break;case"center":i=e._vcenter.value;break;case"right":i=e._top.value+t}break;case"right":switch(this.model.vertical_align){case"top":n=e._right.value-5;break;case"middle":n=e._hcenter.value;break;case"bottom":n=e._left.value+5}switch(this.model.align){case"left":i=e._top.value+t;break;case"center":i=e._vcenter.value;break;case"right":i=e._bottom.value-t}}return[n,i]},e.prototype.render=function(){var t,e,n,i;if(this.model.visible){if(null!=(i=this.model.text)&&0!==i.length){return this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align,r=this._get_location(),e=r[0],n=r[1],t=this.model.panel.get_label_angle_heuristic("parallel"),("canvas"===this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.plot_view.canvas_view.ctx,i,e,n,t);var r}}else"css"===this.model.render_mode&&o.hide(this.el)},e.prototype._get_size=function(){var t,e;return null==(e=this.model.text)||0===e.length?0:(t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(e).ascent+10)},e}(r.TextAnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.Title=l,l.prototype.default_view=n.TitleView,l.prototype.type="Title",l.mixins(["line:border_","fill:background_"]),l.define({text:[s.String],text_font:[s.Font,"helvetica"],text_font_size:[s.FontSizeSpec,"10pt"],text_font_style:[s.FontStyle,"bold"],text_color:[s.ColorSpec,"#444444"],text_alpha:[s.NumberSpec,1],vertical_align:[s.VerticalAlign,"bottom"],align:[s.TextAlign,"left"],offset:[s.Number,0],render_mode:[s.RenderMode,"canvas"]}),l.override({background_fill_color:null,border_line_color:null}),l.internal({text_align:[s.TextAlign,"left"],text_baseline:[s.TextBaseline,"bottom"]})},function(t,e,n){var i=t(364),r=t(51),o=t(4),s=t(5),a=t(15);n.ToolbarPanelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return o.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e,n;t.prototype.render.call(this);if(this.model.visible)return e=this.model.panel,this.el.style.position="absolute",this.el.style.left=e._left.value+"px",this.el.style.top=e._top.value+"px",this.el.style.width=e._width.value+"px",this.el.style.height=e._height.value+"px",this.el.style.overflow="hidden",(n=this._toolbar_views[this.model.toolbar.id]).render(),s.empty(this.el),this.el.appendChild(n.el),s.show(this.el);s.hide(this.el)},e.prototype._get_size=function(){return 30},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.ToolbarPanel=l,l.prototype.type="ToolbarPanel",l.prototype.default_view=n.ToolbarPanelView,l.define({toolbar:[a.Instance]})},function(t,e,n){var i=t(364),r=t(51),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex=1010,o.hide(this.el)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return this._draw_tips()})},e.prototype.render=function(){if(this.model.visible)return this._draw_tips()},e.prototype._draw_tips=function(){var t,e,n,i,r,s,a,l,u,h,c,_,p;if(n=this.model.data,o.empty(this.el),o.hide(this.el),this.model.custom?this.el.classList.add("bk-tooltip-custom"):this.el.classList.remove("bk-tooltip-custom"),0!==n.length){for(i=this.plot_view.frame,r=0,a=n.length;r<a;r++)p=n[r],u=p[0],h=p[1],e=p[2],this.model.inner_only&&!i.bbox.contains(u,h)||(c=o.div({},e),this.el.appendChild(c));switch(t=this.model.attachment){case"horizontal":l=u<i._hcenter.value?"right":"left";break;case"vertical":l=h<i._vcenter.value?"below":"above";break;default:l=t}switch(this.el.classList.remove("bk-right"),this.el.classList.remove("bk-left"),this.el.classList.remove("bk-above"),this.el.classList.remove("bk-below"),10,o.show(this.el),l){case"right":this.el.classList.add("bk-left"),s=u+(this.el.offsetWidth-this.el.clientWidth)+10,_=h-this.el.offsetHeight/2;break;case"left":this.el.classList.add("bk-right"),s=u-this.el.offsetWidth-10,_=h-this.el.offsetHeight/2;break;case"above":this.el.classList.add("bk-above"),_=h+(this.el.offsetHeight-this.el.clientHeight)+10,s=Math.round(u-this.el.offsetWidth/2);break;case"below":this.el.classList.add("bk-below"),_=h-this.el.offsetHeight-10,s=Math.round(u-this.el.offsetWidth/2)}return this.model.show_arrow&&this.el.classList.add("bk-tooltip-arrow"),this.el.childNodes.length>0?(this.el.style.top=_+"px",this.el.style.left=s+"px"):o.hide(this.el)}},e}(r.AnnotationView);n.TooltipView=a,a.prototype.className="bk-tooltip";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clear=function(){return this.data=[]},e.prototype.add=function(t,e,n){var i;return(i=this.data).push([t,e,n]),this.data=i,this.properties.data.change.emit()},e}(r.Annotation);n.Tooltip=l,l.prototype.default_view=a,l.prototype.type="Tooltip",l.define({attachment:[s.String,"horizontal"],inner_only:[s.Bool,!0],show_arrow:[s.Bool,!0]}),l.override({level:"overlay"}),l.internal({data:[s.Any,[]],custom:[s.Any]})},function(t,e,n){var i=t(364),r=t(51),o=t(173),s=t(53),a=t(15);n.WhiskerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_model.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c="height"===a?d:p,o="height"===a?p:d,_="height"===a?l.yview:l.xview,s="height"===a?l.xview:l.yview,n="data"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r="data"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t="data"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f="height"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){if(this._map_data(),e=this.plot_view.canvas_view.ctx,this.visuals.line.doit)for(n=i=0,s=this._lower_sx.length;0<=s?i<s:i>s;n=0<=s?++i:--i)this.visuals.line.set_vectorize(e,n),e.beginPath(),e.moveTo(this._lower_sx[n],this._lower_sy[n]),e.lineTo(this._upper_sx[n],this._upper_sy[n]),e.stroke();if(t="height"===this.model.dimension?0:Math.PI/2,null!=this.model.lower_head)for(n=r=0,a=this._lower_sx.length;0<=a?r<a:r>a;n=0<=a?++r:--r)e.save(),e.translate(this._lower_sx[n],this._lower_sy[n]),e.rotate(t+Math.PI),this.model.lower_head.render(e,n),e.restore();if(null!=this.model.upper_head){for(u=[],n=o=0,l=this._upper_sx.length;0<=l?o<l:o>l;n=0<=l?++o:--o)e.save(),e.translate(this._upper_sx[n],this._upper_sy[n]),e.rotate(t),this.model.upper_head.render(e,n),u.push(e.restore());return u}}},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Whisker=l,l.prototype.default_view=n.WhiskerView,l.prototype.type="Whisker",l.mixins(["line"]),l.define({lower:[a.DistanceSpec],lower_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],upper:[a.DistanceSpec],upper_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],base:[a.DistanceSpec],dimension:[a.Dimension,"height"],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),l.override({level:"underlay"})},function(t,e,n){var i=t(364),r=t(12),o=t(163),s=t(165),a=t(14),l=t(15),u=t(22),h=t(42);n.AxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var t,e,n;if(!1!==this.model.visible)return e={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},n=this.model.tick_coords,(t=this.plot_view.canvas_view.ctx).save(),this._draw_rule(t,e),this._draw_major_ticks(t,e,n),this._draw_minor_ticks(t,e,n),this._draw_major_labels(t,e,n),this._draw_axis_label(t,e,n),null!=this._render&&this._render(t,e,n),t.restore()},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype._draw_rule=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.axis_line.doit){for(d=this.model.rule_coords,h=d[0],_=d[1],f=this.plot_view.map_to_screen(h,_,this.model.x_range_name,this.model.y_range_name),l=f[0],u=f[1],m=this.model.normals,o=m[0],s=m[1],v=this.model.offsets,c=v[0],p=v[1],this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(l[0]+o*c),Math.round(u[0]+s*p)),i=r=1,a=l.length;1<=a?r<a:r>a;i=1<=a?++r:--r)l=Math.round(l[i]+o*c),u=Math.round(u[i]+s*p),t.lineTo(l,u);t.stroke();var d,f,m,v}},e.prototype._draw_major_ticks=function(t,e,n){var i,r,o;i=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line,this._draw_ticks(t,n.major,i,r,o)},e.prototype._draw_minor_ticks=function(t,e,n){var i,r,o;i=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line,this._draw_ticks(t,n.minor,i,r,o)},e.prototype._draw_major_labels=function(t,e,n){var i,r,o,s,a;i=n.major,r=this.model.compute_labels(i[this.model.dimension]),o=this.model.major_label_orientation,s=e.tick+this.model.major_label_standoff,a=this.visuals.major_label_text,this._draw_oriented_labels(t,r,i,o,this.model.panel_side,s,a)},e.prototype._draw_axis_label=function(t,e,n){var i,r,o,s,a;if(null!=this.model.axis_label&&0!==this.model.axis_label.length){switch(this.model.panel.side){case"above":o=this.model.panel._hcenter.value,s=this.model.panel._bottom.value;break;case"below":o=this.model.panel._hcenter.value,s=this.model.panel._top.value;break;case"left":o=this.model.panel._right.value,s=this.model.panel._vcenter._value;break;case"right":o=this.model.panel._left.value,s=this.model.panel._vcenter._value}i=[[o],[s]],r=e.tick+u.sum(e.tick_label)+this.model.axis_label_standoff,a=this.visuals.axis_label_text,this._draw_oriented_labels(t,[this.model.axis_label],i,"parallel",this.model.panel_side,r,a,"screen")}},e.prototype._draw_ticks=function(t,e,n,i,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(r.doit&&0!==e.length){for(b=e[0],w=e[1],S=this.plot_view.map_to_screen(b,w,this.model.x_range_name,this.model.y_range_name),m=S[0],y=S[1],T=this.model.normals,a=T[0],h=T[1],M=this.model.offsets,x=M[0],k=M[1],l=(A=[a*(x-n),h*(k-n)])[0],c=A[1],u=(E=[a*(x+i),h*(k+i)])[0],_=E[1],r.set_value(t),o=s=0,p=m.length;0<=p?s<p:s>p;o=0<=p?++s:--s)d=Math.round(m[o]+u),v=Math.round(y[o]+_),f=Math.round(m[o]+l),g=Math.round(y[o]+c),t.beginPath(),t.moveTo(d,v),t.lineTo(f,g),t.stroke();var S,T,M,A,E}},e.prototype._draw_oriented_labels=function(t,e,n,i,r,o,s,a){void 0===a&&(a="data");var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,S;if(s.doit&&0!==e.length){for("screen"===a?(b=n[0],w=n[1],k=(T=[0,0])[0],S=T[1]):(u=n[0],c=n[1],M=this.plot_view.map_to_screen(u,c,this.model.x_range_name,this.model.y_range_name),b=M[0],w=M[1],A=this.model.offsets,k=A[0],S=A[1]),E=this.model.normals,d=E[0],m=E[1],f=d*(k+o),v=m*(S+o),s.set_value(t),this.model.panel.apply_label_text_heuristics(t,i),l=h.isString(i)?this.model.panel.get_label_angle_heuristic(i):-i,_=p=0,g=b.length;0<=g?p<g:p>g;_=0<=g?++p:--p)y=Math.round(b[_]+f),x=Math.round(w[_]+v),t.translate(y,x),t.rotate(l),t.fillText(e[_],0,0),t.rotate(-l),t.translate(-y,-x);var T,M,A,E}},e.prototype._axis_label_extent=function(){var t,e;return null==this.model.axis_label||""===this.model.axis_label?0:(t=this.model.axis_label_standoff,e=this.visuals.axis_label_text,this._oriented_labels_extent([this.model.axis_label],"parallel",this.model.panel_side,t,e))},e.prototype._tick_extent=function(){return this.model.major_tick_out},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t,e,n,i,r;return t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),n=this.model.major_label_orientation,i=this.model.major_label_standoff,r=this.visuals.major_label_text,[this._oriented_labels_extent(e,n,this.model.panel_side,i,r)]},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._oriented_labels_extent=function(t,e,n,i,r){var o,s,a,l,u,c,_,p,d,f,m,v;if(0===t.length)return 0;for(a=this.plot_view.canvas_view.ctx,r.set_value(a),h.isString(e)?(c=1,o=this.model.panel.get_label_angle_heuristic(e)):(c=2,o=-e),o=Math.abs(o),s=Math.cos(o),f=Math.sin(o),l=0,_=p=0,d=t.length;0<=d?p<d:p>d;_=0<=d?++p:--p)v=1.1*a.measureText(t[_]).width,u=.9*a.measureText(t[_]).ascent,(m="above"===n||"below"===n?v*f+u/c*s:v*s+u/c*f)>l&&(l=m);return l>0&&(l+=i),l},e}(s.RendererView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_labels=function(t){var e,n,i,r;for(i=this.formatter.doFormat(t,this),e=n=0,r=t.length;0<=r?n<r:n>r;e=0<=r?++n:--n)t[e]in this.major_label_overrides&&(i[e]=this.major_label_overrides[t[e]]);return i},e.prototype.label_info=function(t){var e;return e=this.major_label_orientation,{dim:this.dimension,coords:t,side:this.panel_side,orient:e,standoff:this.major_label_standoff}},e.prototype.add_panel=function(t){return this.panel=new r.SidePanel({side:t}),this.panel.attach_document(this.document),this.panel_side=t},e.prototype._offsets=function(){var t,e,n,i;switch(e=this.panel_side,r=[0,0],n=r[0],i=r[1],t=this.plot.plot_canvas.frame,e){case"below":i=Math.abs(this.panel._top.value-t._bottom.value);break;case"above":i=Math.abs(this.panel._bottom.value-t._top.value);break;case"right":n=Math.abs(this.panel._left.value-t._right.value);break;case"left":n=Math.abs(this.panel._right.value-t._left.value)}return[n,i];var r},e.prototype._ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype._computed_bounds=function(){var t,e,n,i,r,o;return s=this.ranges,e=s[0],s[1],o=null!=(i=this.bounds)?i:"auto",n=[e.min,e.max],"auto"===o?n:h.isArray(o)?(Math.abs(o[0]-o[1])>Math.abs(n[0]-n[1])?(r=Math.max(Math.min(o[0],o[1]),n[0]),t=Math.min(Math.max(o[0],o[1]),n[1])):(r=Math.min(o[0],o[1]),t=Math.max(o[0],o[1])),[r,t]):(a.logger.error("user bounds '"+o+"' not understood"),null);var s},e.prototype._rule_coords=function(){var t,e,n,i,r,o,s,a;return n=this.dimension,i=(n+1)%2,l=this.ranges,r=l[0],l[1],u=this.computed_bounds,o=u[0],e=u[1],s=new Array(2),a=new Array(2),t=[s,a],t[n][0]=Math.max(o,r.min),t[n][1]=Math.min(e,r.max),t[n][0]>t[n][1]&&(t[n][0]=t[n][1]=NaN),t[i][0]=this.loc,t[i][1]=this.loc,t;var l,u},e.prototype._tick_coords=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m;for(n=this.dimension,r=(n+1)%2,v=this.ranges,h=v[0],v[1],g=this.computed_bounds,f=g[0],e=g[1],m=this.ticker.get_ticks(f,e,h,this.loc,{}),a=m.major,u=m.minor,t=[[],[]],l=[[],[]],y=[h.min,h.max],_=y[0],c=y[1],i=o=0,p=a.length;0<=p?o<p:o>p;i=0<=p?++o:--o)a[i]<_||a[i]>c||(t[n].push(a[i]),t[r].push(this.loc));for(i=s=0,d=u.length;0<=d?s<d:s>d;i=0<=d?++s:--s)u[i]<_||u[i]>c||(l[n].push(u[i]),l[r].push(this.loc));return{major:t,minor:l};var v,g,y},e.prototype._get_loc=function(){var t;switch(e=this.ranges,e[0],t=e[1],t.start,t.end,this.panel_side){case"left":case"below":return t.start;case"right":case"above":return t.end}var e},e}(o.GuideRenderer);n.Axis=c,c.prototype.default_view=n.AxisView,c.prototype.type="Axis",c.mixins(["line:axis_","line:major_tick_","line:minor_tick_","text:major_label_","text:axis_label_"]),c.define({bounds:[l.Any,"auto"],ticker:[l.Instance,null],formatter:[l.Instance,null],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"],axis_label:[l.String,""],axis_label_standoff:[l.Int,5],major_label_standoff:[l.Int,5],major_label_orientation:[l.Any,"horizontal"],major_label_overrides:[l.Any,{}],major_tick_in:[l.Number,2],major_tick_out:[l.Number,6],minor_tick_in:[l.Number,0],minor_tick_out:[l.Number,4]}),c.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"}),c.internal({panel_side:[l.Any]}),c.getters({computed_bounds:function(){return this._computed_bounds()},rule_coords:function(){return this._rule_coords()},tick_coords:function(){return this._tick_coords()},ranges:function(){return this._ranges()},normals:function(){return this.panel._normals},dimension:function(){return this.panel._dim},offsets:function(){return this._offsets()},loc:function(){return this._get_loc()}})},function(t,e,n){var i=t(364),r=t(69),o=t(92),s=t(181);n.CategoricalAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){return this._draw_group_separators(t,e,n)},e.prototype._draw_group_separators=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x;if(w=this.model.ranges,m=w[0],w[1],k=this.model.computed_bounds,b=k[0],s=k[1],d=this.model.loc,this.model.ticker.get_ticks(b,s,m,d,{}),S=this.model.ranges,m=S[0],S[1],m.tops&&!(m.tops.length<2)&&this.visuals.separator_line.doit){for(o=this.model.dimension,i=(o+1)%2,r=[[],[]],u=0,l=c=0,v=m.tops.length-1;0<=v?c<v:c>v;l=0<=v?++c:--c){for(h=_=g=u,y=m.factors.length;g<=y?_<y:_>y;h=g<=y?++_:--_)if(m.factors[h][0]===m.tops[l+1]){T=[m.factors[h-1],m.factors[h]],a=T[0],p=T[1],u=h;break}(f=(m.synthetic(a)+m.synthetic(p))/2)>b&&f<s&&(r[o].push(f),r[i].push(this.model.loc))}x=this._tick_label_extent(),this._draw_ticks(t,r,-3,x-6,this.visuals.separator_line);var w,k,S,T}},e.prototype._draw_major_labels=function(t,e,n){var i,r,o,s,a,l,u,h,c,_;for(s=this._get_factor_info(),this.model.loc,r=this.model.dimension,(r+1)%2,c=e.tick+this.model.major_label_standoff,o=a=0,h=s.length;0<=h?a<h:a>h;o=0<=h?++a:--a)p=s[o],l=p[0],i=p[1],u=p[2],_=p[3],this._draw_oriented_labels(t,l,i,u,this.model.panel_side,c,_),c+=e.tick_label[o];var p},e.prototype._tick_label_extents=function(){var t,e,n,i,r,o,s,a;for(n=this._get_factor_info(),e=[],i=0,o=n.length;i<o;i++)l=n[i],r=l[0],l[1],s=l[2],a=l[3],t=this._oriented_labels_extent(r,s,this.model.panel_side,this.model.major_label_standoff,a),e.push(t);return e;var l},e.prototype._get_factor_info=function(){var t,e,n,i,r,o,s,a,l,u;return h=this.model.ranges,s=h[0],h[1],c=this.model.computed_bounds,a=c[0],e=c[1],r=this.model.loc,l=this.model.ticker.get_ticks(a,e,s,r,{}),t=this.model.tick_coords,n=[],1===s.levels?(i=this.model.formatter.doFormat(l.major,this),n.push([i,t.major,this.model.major_label_orientation,this.visuals.major_label_text])):2===s.levels?(i=this.model.formatter.doFormat(function(){var t,e,n,i;for(n=l.major,i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(u[1]);return i}(),this),n.push([i,t.major,this.model.major_label_orientation,this.visuals.major_label_text]),n.push([l.tops,t.tops,"parallel",this.visuals.group_text])):3===s.levels&&(i=this.model.formatter.doFormat(function(){var t,e,n,i;for(n=l.major,i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(u[2]);return i}(),this),o=function(){var t,e,n,i;for(n=l.mids,i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(u[1]);return i}(),n.push([i,t.major,this.model.major_label_orientation,this.visuals.major_label_text]),n.push([o,t.mids,"parallel",this.visuals.subgroup_text]),n.push([l.tops,t.tops,"parallel",this.visuals.group_text])),n;var h,c},e}(r.AxisView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tick_coords=function(){var t,e,n,i,r,o,s,a;return n=this.dimension,i=(n+1)%2,l=this.ranges,r=l[0],l[1],u=this.computed_bounds,o=u[0],e=u[1],s=this.ticker.get_ticks(o,e,r,this.loc,{}),t={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[]},t.major[n]=s.major,t.major[i]=function(){var t,e,n,i;for(n=s.major,i=[],t=0,e=n.length;t<e;t++)a=n[t],i.push(this.loc);return i}.call(this),3===r.levels&&(t.mids[n]=s.mids,t.mids[i]=function(){var t,e,n,i;for(n=s.mids,i=[],t=0,e=n.length;t<e;t++)a=n[t],i.push(this.loc);return i}.call(this)),r.levels>1&&(t.tops[n]=s.tops,t.tops[i]=function(){var t,e,n,i;for(n=s.tops,i=[],t=0,e=n.length;t<e;t++)a=n[t],i.push(this.loc);return i}.call(this)),t;var l,u},e}(r.Axis);n.CategoricalAxis=a,a.prototype.default_view=n.CategoricalAxisView,a.prototype.type="CategoricalAxis",a.mixins(["line:separator_","text:group_","text:subgroup_"]),a.override({ticker:function(){return new s.CategoricalTicker},formatter:function(){return new o.CategoricalTickFormatter},separator_line_color:"lightgrey",separator_line_width:2,group_text_font_style:"bold",group_text_font_size:"8pt",group_text_color:"grey",subgroup_text_font_style:"bold",subgroup_text_font_size:"8pt"})},function(t,e,n){var i=t(364),r=t(69),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Axis);n.ContinuousAxis=o,o.prototype.type="ContinuousAxis"},function(t,e,n){var i=t(364),r=t(74),o=t(93),s=t(184);n.DatetimeAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LinearAxisView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LinearAxis);n.DatetimeAxis=a,a.prototype.default_view=n.DatetimeAxisView,a.prototype.type="DatetimeAxis",a.override({ticker:function(){return new s.DatetimeTicker},formatter:function(){return new o.DatetimeTickFormatter}})},function(t,e,n){var i=t(69);n.Axis=i.Axis;var r=t(70);n.CategoricalAxis=r.CategoricalAxis;var o=t(71);n.ContinuousAxis=o.ContinuousAxis;var s=t(72);n.DatetimeAxis=s.DatetimeAxis;var a=t(74);n.LinearAxis=a.LinearAxis;var l=t(75);n.LogAxis=l.LogAxis},function(t,e,n){var i=t(364),r=t(69),o=t(71),s=t(91),a=t(180);n.LinearAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.AxisView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ContinuousAxis);n.LinearAxis=l,l.prototype.default_view=n.LinearAxisView,l.prototype.type="LinearAxis",l.override({ticker:function(){return new a.BasicTicker},formatter:function(){return new s.BasicTickFormatter}})},function(t,e,n){var i=t(364),r=t(69),o=t(71),s=t(96),a=t(188);n.LogAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.AxisView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ContinuousAxis);n.LogAxis=l,l.prototype.default_view=n.LogAxisView,l.prototype.type="LogAxis",l.override({ticker:function(){return new a.LogTicker},formatter:function(){return new s.LogTickFormatter}})},function(t,e,n){var i=t(364),r=t(15),o=t(30),s=t(50),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.execute=function(e,n){return this.func.apply(e,this.values.concat(e,n,t,{}))},n.prototype._make_values=function(){return o.values(this.args)},n.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),["cb_obj","cb_data","require","exports",this.code])))},n}(s.Model);n.CustomJS=a,a.prototype.type="CustomJS",a.define({args:[r.Any,{}],code:[r.String,""]}),a.getters({values:function(){return this._make_values()},func:function(){return this._make_func()}})},function(t,e,n){var i=t(76);n.CustomJS=i.CustomJS;var r=t(78);n.OpenURL=r.OpenURL},function(t,e,n){var i=t(364),r=t(50),o=t(15),s=t(34),a=t(39),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.execute=function(t,e){var n,i,r,o,l;for(o=s.get_indices(e.source),i=0,r=o.length;i<r;i++)n=o[i],l=a.replace_placeholders(this.url,e.source,n),window.open(l);return null},e}(r.Model);n.OpenURL=l,l.prototype.type="OpenURL",l.define({url:[o.String,"http://"]})},function(t,e,n){var i=t(364),r=t(11),o=t(6),s=t(13),a=t(14),l=t(15),u=t(5),h=t(25),c=t(249);null!=window.CanvasPixelArray&&(CanvasPixelArray.prototype.set=function(t){var e,n,i,r;for(r=[],e=n=0,i=this.length;0<=i?n<i:n>i;e=0<=i?++n:--n)r.push(this[e]=t[e]);return r});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){switch(t.prototype.initialize.call(this,e),this.map_el=this.model.map?this.el.appendChild(u.div({class:"bk-canvas-map"})):null,this.model.output_backend){case"canvas":case"webgl":this.canvas_el=this.el.appendChild(u.canvas({class:"bk-canvas"})),this._ctx=this.canvas_el.getContext("2d");break;case"svg":this._ctx=new c,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}return this.overlays_el=this.el.appendChild(u.div({class:"bk-canvas-overlays"})),this.events_el=this.el.appendChild(u.div({class:"bk-canvas-events"})),this.ctx=this.get_ctx(),h.fixup_ctx(this.ctx),a.logger.debug("CanvasView initialized")},e.prototype.get_ctx=function(){return this._ctx},e.prototype.get_canvas_element=function(){return this.canvas_el},e.prototype.prepare_canvas=function(){var t,e,n;return n=this.model._width.value,t=this.model._height.value,this.el.style.width=n+"px",this.el.style.height=t+"px",e=h.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend),this.model.pixel_ratio=e,this.canvas_el.style.width=n+"px",this.canvas_el.style.height=t+"px",this.canvas_el.setAttribute("width",n*e),this.canvas_el.setAttribute("height",t*e),a.logger.debug("Rendering CanvasView with width: "+n+", height: "+t+", pixel ratio: "+e)},e.prototype.set_dims=function(t){var e=t[0],n=t[1];if(0!==e&&0!==n)return e!==this.model._width.value&&(null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),this._width_constraint=s.EQ(this.model._width,-e),this.solver.add_constraint(this._width_constraint)),n!==this.model._height.value&&(null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._height_constraint=s.EQ(this.model._height,-n),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables()},e}(o.DOMView);n.CanvasView=_,_.prototype.className="bk-canvas-wrapper";var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LayoutCanvas);n.Canvas=p,p.prototype.type="Canvas",p.prototype.default_view=_,p.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,"canvas"]}),p.getters({panel:function(){return this}})},function(t,e,n){var i=t(364),r=t(166),o=t(168),s=t(169),a=t(160),l=t(156),u=t(157),h=t(11),c=t(15),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){var i=this;return t.prototype.initialize.call(this,e,n),this._configure_scales(),this.connect(this.change,function(){return i._configure_scales()})},e.prototype.get_editables=function(){return t.prototype.get_editables.call(this).concat([this._width,this._height])},e.prototype.map_to_screen=function(t,e,n,i){void 0===n&&(n="default"),void 0===i&&(i="default");var r,o;return r=this.xscales[n].v_compute(t),o=this.yscales[i].v_compute(e),[r,o]},e.prototype._get_ranges=function(t,e){var n,i,r;if(r={},r.default=t,null!=e)for(i in e)n=e[i],r[i]=n;return r},e.prototype._get_scales=function(t,e,n){var i,h,c,_;_={};for(i in e){if((h=e[i])instanceof l.DataRange1d||h instanceof a.Range1d){if(!(t instanceof s.LogScale||t instanceof o.LinearScale))throw new Error("Range "+h.type+" is incompatible is Scale "+t.type);if(t instanceof r.CategoricalScale)throw new Error("Range "+h.type+" is incompatible is Scale "+t.type)}if(h instanceof u.FactorRange&&!(t instanceof r.CategoricalScale))throw new Error("Range "+h.type+" is incompatible is Scale "+t.type);t instanceof s.LogScale&&h instanceof l.DataRange1d&&(h.scale_hint="log"),(c=t.clone()).setv({source_range:h,target_range:n}),_[i]=c}return _},e.prototype._configure_frame_ranges=function(){return this._h_target=new a.Range1d({start:this._left.value,end:this._right.value}),this._v_target=new a.Range1d({start:this._bottom._value,end:this._top.value})},e.prototype._configure_scales=function(){return this._configure_frame_ranges(),this._x_ranges=this._get_ranges(this.x_range,this.extra_x_ranges),this._y_ranges=this._get_ranges(this.y_range,this.extra_y_ranges),this._xscales=this._get_scales(this.x_scale,this._x_ranges,this._h_target),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_target)},e.prototype._update_scales=function(){var t,e,n;this._configure_frame_ranges(),e=this._xscales;for(t in e)e[t].target_range=this._h_target;n=this._yscales;for(t in n)n[t].target_range=this._v_target;return null},Object.defineProperty(e.prototype,"x_ranges",{get:function(){return this._x_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y_ranges",{get:function(){return this._y_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xscales",{get:function(){return this._xscales},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yscales",{get:function(){return this._yscales},enumerable:!0,configurable:!0}),e}(h.LayoutCanvas);n.CartesianFrame=_,_.prototype.type="CartesianFrame",_.getters({panel:function(){return this}}),_.internal({extra_x_ranges:[c.Any,{}],extra_y_ranges:[c.Any,{}],x_range:[c.Instance],y_range:[c.Instance],x_scale:[c.Instance],y_scale:[c.Instance]})},function(t,e,n){var i=t(79);n.Canvas=i.Canvas;var r=t(80);n.CartesianFrame=r.CartesianFrame},function(t,e,n){var i=t(364),r=t(50);n.Expression=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._connected={},this._result={}},e.prototype._v_compute=function(t){return null==this._connected[t.id]&&(this.connect(t.change,function(){return this._result[t.id]=null}),this._connected[t.id]=!0),null!=this._result[t.id]?this._result[t.id]:(this._result[t.id]=this.v_compute(t),this._result[t.id])},e}(r.Model)},function(t,e,n){var i=t(82);n.Expression=i.Expression;var r=t(84);n.Stack=r.Stack},function(t,e,n){var i=t(364),r=t(82),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.v_compute=function(t){var e,n,i,r,o,s,a,l,u,h;for(u=new Float64Array(t.get_length()),a=this.fields,i=0,o=a.length;i<o;i++)for(e=a[i],l=t.data[e],n=r=0,s=l.length;r<s;n=++r)h=l[n],u[n]+=h;return u},e}(r.Expression);n.Stack=s,s.define({fields:[o.Array,[]]})},function(t,e,n){var i=t(364),r=t(87),o=t(15),s=t(14),a=t(22),l=t(42),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e,n,i;return(null!=(n=this.booleans)?n.length:void 0)>0?a.all(this.booleans,l.isBoolean)?(this.booleans.length!==t.get_length()&&s.logger.warn("BooleanFilter "+this.id+": length of booleans doesn't match data source"),function(){var t,n,i,r;for(i=a.range(0,this.booleans.length),r=[],t=0,n=i.length;t<n;t++)e=i[t],!0===this.booleans[e]&&r.push(e);return r}.call(this)):(s.logger.warn("BooleanFilter "+this.id+": booleans should be array of booleans, defaulting to no filtering"),null):(0===(null!=(i=this.booleans)?i.length:void 0)?s.logger.warn("BooleanFilter "+this.id+": booleans is empty, defaulting to no filtering"):s.logger.warn("BooleanFilter "+this.id+": booleans was not set, defaulting to no filtering"),null)},e}(r.Filter);n.BooleanFilter=u,u.prototype.type="BooleanFilter",u.define({booleans:[o.Array,null]})},function(t,e,n){var i=t(364),r=t(87),o=t(15),s=t(30),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.compute_indices=function(n){return this.filter=this.func.apply(this,this.values.concat([n,t,{}])),e.prototype.compute_indices.call(this)},n.prototype._make_values=function(){return s.values(this.args)},n.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),["source","require","exports",this.code])))},n}(r.Filter);n.CustomJSFilter=a,a.prototype.type="CustomJSFilter",a.define({args:[o.Any,{}],code:[o.String,""]}),a.getters({values:function(){return this._make_values()},func:function(){return this._make_func()}})},function(t,e,n){var i=t(364),r=t(50),o=t(15),s=t(42),a=t(22),l=t(14),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e.prototype.compute_indices=function(){var t,e;return(null!=(e=this.filter)?e.length:void 0)>=0?a.all(this.filter,s.isBoolean)?function(){var e,n,i,r;for(i=a.range(0,this.filter.length),r=[],e=0,n=i.length;e<n;e++)t=i[e],!0===this.filter[t]&&r.push(t);return r}.call(this):a.all(this.filter,s.isInteger)?this.filter:(l.logger.warn("Filter "+this.id+": filter should either be array of only booleans or only integers, defaulting to no filtering"),null):(l.logger.warn("Filter "+this.id+": filter was not set to be an array, defaulting to no filtering"),null)},e}(r.Model);n.Filter=u,u.prototype.type="Filter",u.define({filter:[o.Array,null]})},function(t,e,n){var i=t(364),r=t(87),o=t(15),s=t(14),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e,n;return null==(e=t.get_column(this.column_name))?(s.logger.warn("group filter: groupby column not found in data source"),null):(this.indices=function(){var i,r,o;for(o=[],n=i=0,r=t.get_length();0<=r?i<r:i>r;n=0<=r?++i:--i)e[n]===this.group&&o.push(n);return o}.call(this),0===this.indices.length&&s.logger.warn("group filter: group '"+this.group+"' did not match any values in column '"+this.column_name+"'"),this.indices)},e}(r.Filter);n.GroupFilter=a,a.prototype.type="GroupFilter",a.define({column_name:[o.String],group:[o.String]})},function(t,e,n){var i=t(85);n.BooleanFilter=i.BooleanFilter;var r=t(86);n.CustomJSFilter=r.CustomJSFilter;var o=t(87);n.Filter=o.Filter;var s=t(88);n.GroupFilter=s.GroupFilter;var a=t(90);n.IndexFilter=a.IndexFilter},function(t,e,n){var i=t(364),r=t(87),o=t(15),s=t(14),a=t(42),l=t(22),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e;return(null!=(e=this.indices)?e.length:void 0)>=0?l.all(this.indices,a.isInteger)?this.indices:(s.logger.warn("IndexFilter "+this.id+": indices should be array of integers, defaulting to no filtering"),null):(s.logger.warn("IndexFilter "+this.id+": indices was not set, defaulting to no filtering"),null)},e}(r.Filter);n.IndexFilter=u,u.prototype.type="IndexFilter",u.define({indices:[o.Array,null]})},function(t,e,n){var i=t(364),r=t(100),o=t(15),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.last_precision=3},e.prototype.doFormat=function(t,e){var n,i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(0===t.length)return[];if(k=0,t.length>=2&&(k=Math.abs(t[1]-t[0])/1e4),_=!1,this.use_scientific)for(r=0,u=t.length;r<u;r++)if(b=t[r],(x=Math.abs(b))>k&&(x>=this.scientific_limit_high||x<=this.scientific_limit_low)){_=!0;break}if(null==(d=this.precision)||s.isNumber(d)){if(l=new Array(t.length),_)for(n=o=0,f=t.length;0<=f?o<f:o>f;n=0<=f?++o:--o)l[n]=t[n].toExponential(d||void 0);else for(n=a=0,m=t.length;0<=m?a<m:a>m;n=0<=m?++a:--a)l[n]=t[n].toFixed(d||void 0).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");return l}if("auto"===d)for(l=new Array(t.length),w=h=v=this.last_precision;v<=15?h<=15:h>=15;w=v<=15?++h:--h){if(i=!0,_){for(n=c=0,g=t.length;0<=g?c<g:c>g;n=0<=g?++c:--c)if(l[n]=t[n].toExponential(w),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}else{for(n=p=0,y=t.length;0<=y?p<y:p>y;n=0<=y?++p:--p)if(l[n]=t[n].toFixed(w).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}if(i)return this.last_precision=w,l}return l},e}(r.TickFormatter);n.BasicTickFormatter=a,a.prototype.type="BasicTickFormatter",a.define({precision:[o.Any,"auto"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]}),a.getters({scientific_limit_low:function(){return Math.pow(10,this.power_limit_low)},scientific_limit_high:function(){return Math.pow(10,this.power_limit_high)}})},function(t,e,n){var i=t(364),r=t(100),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){return t},e}(r.TickFormatter);n.CategoricalTickFormatter=o,o.prototype.type="CategoricalTickFormatter"},function(t,e,n){var i,r,o,s=t(364),a=t(362),l=t(363),u=t(100),h=t(14),c=t(15),_=t(22),p=t(42);o=function(t){return Math.round(t/1e3%1*1e6)},i=function(t){return l(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})},r=function(t,e){var n;return p.isFunction(e)?e(t):(n=a.sprintf("$1%06d",o(t)),-1===(e=e.replace(/((^|[^%])(%%)*)%f/,n)).indexOf("%")?e:l(t,e))};var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._update_width_formats()},e.prototype._update_width_formats=function(){var t,e;return e=l(new Date),t=function(t){var n,i,o;return i=function(){var i,o,s;for(s=[],i=0,o=t.length;i<o;i++)n=t[i],s.push(r(e,n).length);return s}(),o=_.sortBy(_.zip(i,t),function(t){var e=t[0];t[1];return e}),_.unzip(o)},this._width_formats={microseconds:t(this.microseconds),milliseconds:t(this.milliseconds),seconds:t(this.seconds),minsec:t(this.minsec),minutes:t(this.minutes),hourmin:t(this.hourmin),hours:t(this.hours),days:t(this.days),months:t(this.months),years:t(this.years)}},e.prototype._get_resolution_str=function(t,e){var n;switch(n=1.1*t,!1){case!(n<.001):return"microseconds";case!(n<1):return"milliseconds";case!(n<60):return e>=60?"minsec":"seconds";case!(n<3600):return e>=3600?"hourmin":"minutes";case!(n<86400):return"hours";case!(n<2678400):return"days";case!(n<31536e3):return"months";default:return"years"}},e.prototype.doFormat=function(t,e,n,o,s,a){void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=.3),void 0===a&&(a=null);var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j,P,D;if(0===t.length)return[];if(C=Math.abs(t[t.length-1]-t[0])/1e3,S=a?a.resolution:C/(t.length-1),A=this._get_resolution_str(S,C),F=this._width_formats[A],D=F[0],_=F[1],c=_[0],o){for(p=[],f=m=0,T=D.length;0<=T?m<T:m>T;f=0<=T?++m:--m)D[f]*t.length<s*o&&p.push(this._width_formats[f]);p.length>0&&(c=p[p.length-1])}for(y=[],E=this.format_order.indexOf(A),j={},M=this.format_order,v=0,b=M.length;v<b;v++)u=M[v],j[u]=0;for(j.seconds=5,j.minsec=4,j.minutes=4,j.hourmin=3,j.hours=3,g=0,x=t.length;g<x;g++){N=t[g];try{P=i(N),z=r(N,c)}catch(t){l=t,h.logger.warn("unable to format tick for timestamp value "+N),h.logger.warn(" - "+l),y.push("ERR");continue}for(d=!1,k=E;0===P[j[this.format_order[k]]]&&(k+=1)!==this.format_order.length;){if(("minsec"===A||"hourmin"===A)&&!d){if("minsec"===A&&0===P[4]&&0!==P[5]||"hourmin"===A&&0===P[3]&&0!==P[4]){w=this._width_formats[this.format_order[E-1]][1][0],z=r(N,w);break}d=!0}w=this._width_formats[this.format_order[k]][1][0],z=r(N,w)}this.strip_leading_zeros?((O=z.replace(/^0+/g,""))!==z&&isNaN(parseInt(O))&&(O="0"+O),y.push(O)):y.push(z)}return y;var F},e}(u.TickFormatter);n.DatetimeTickFormatter=d,d.prototype.type="DatetimeTickFormatter",d.define({microseconds:[c.Array,["%fus"]],milliseconds:[c.Array,["%3Nms","%S.%3Ns"]],seconds:[c.Array,["%Ss"]],minsec:[c.Array,[":%M:%S"]],minutes:[c.Array,[":%M","%Mm"]],hourmin:[c.Array,["%H:%M"]],hours:[c.Array,["%Hh","%H:%M"]],days:[c.Array,["%m/%d","%a%d"]],months:[c.Array,["%m/%Y","%b%y"]],years:[c.Array,["%Y"]]}),d.prototype.format_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],d.prototype.strip_leading_zeros=!0},function(t,e,n){var i=t(364),r=t(100),o=t(15),s=t(30),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0,"tick"].concat(Object.keys(this.args),["require",this.code])))},n.prototype.doFormat=function(e,n){var i,r;return i=this._make_func(),function(){var n,o,a;for(a=[],n=0,o=e.length;n<o;n++)r=e[n],a.push(i.apply(void 0,[r].concat(s.values(this.args),[t])));return a}.call(this)},n}(r.TickFormatter);n.FuncTickFormatter=a,a.prototype.type="FuncTickFormatter",a.define({args:[o.Any,{}],code:[o.String,""]})},function(t,e,n){var i=t(91);n.BasicTickFormatter=i.BasicTickFormatter;var r=t(92);n.CategoricalTickFormatter=r.CategoricalTickFormatter;var o=t(93);n.DatetimeTickFormatter=o.DatetimeTickFormatter;var s=t(94);n.FuncTickFormatter=s.FuncTickFormatter;var a=t(96);n.LogTickFormatter=a.LogTickFormatter;var l=t(97);n.MercatorTickFormatter=l.MercatorTickFormatter;var u=t(98);n.NumeralTickFormatter=u.NumeralTickFormatter;var h=t(99);n.PrintfTickFormatter=h.PrintfTickFormatter;var c=t(100);n.TickFormatter=c.TickFormatter},function(t,e,n){var i=t(364),r=t(91),o=t(100),s=t(14),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){if(t.prototype.initialize.call(this,e,n),this.basic_formatter=new r.BasicTickFormatter,null==this.ticker)return s.logger.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,e){var n,i,r,o,s,a;if(0===t.length)return[];for(n=null!=this.ticker?this.ticker.base:10,a=!1,o=new Array(t.length),i=r=0,s=t.length;0<=s?r<s:r>s;i=0<=s?++r:--r)if(o[i]=n+"^"+Math.round(Math.log(t[i])/Math.log(n)),i>0&&o[i]===o[i-1]){a=!0;break}return a&&(o=this.basic_formatter.doFormat(t)),o},e}(o.TickFormatter);n.LogTickFormatter=l,l.prototype.type="LogTickFormatter",l.define({ticker:[a.Instance,null]})},function(t,e,n){var i=t(364),r=t(91),o=t(15),s=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(e,n){var i,r,o,a,l,u,h,c;if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0===e.length)return[];if(u=new Array(e.length),"lon"===this.dimension)for(i=r=0,h=e.length;0<=h?r<h:r>h;i=0<=h?++r:--r)_=s.proj4(s.mercator).inverse([e[i],n.loc]),l=_[0],a=_[1],u[i]=l;else for(i=o=0,c=e.length;0<=c?o<c:o>c;i=0<=c?++o:--o)p=s.proj4(s.mercator).inverse([n.loc,e[i]]),l=p[0],a=p[1],u[i]=a;return t.prototype.doFormat.call(this,u,n);var _,p},e}(r.BasicTickFormatter);n.MercatorTickFormatter=a,a.prototype.type="MercatorTickFormatter",a.define({dimension:[o.LatLon]})},function(t,e,n){var i=t(364),r=t(332),o=t(100),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){var n,i,o,s;return n=this.format,i=this.language,o=function(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}.call(this),function(){var e,a,l;for(l=[],e=0,a=t.length;e<a;e++)s=t[e],l.push(r.format(s,n,i,o));return l}()},e}(o.TickFormatter);n.NumeralTickFormatter=a,a.prototype.type="NumeralTickFormatter",a.define({format:[s.String,"0,0"],language:[s.String,"en"],rounding:[s.String,"round"]})},function(t,e,n){var i=t(364),r=t(362),o=t(100),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){var n,i;return n=this.format,function(){var e,o,s;for(s=[],e=0,o=t.length;e<o;e++)i=t[e],s.push(r.sprintf(n,i));return s}()},e}(o.TickFormatter);n.PrintfTickFormatter=a,a.prototype.type="PrintfTickFormatter",a.define({format:[s.String,"%s"]})},function(t,e,n){var i=t(364),r=t(50),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){},e}(r.Model);n.TickFormatter=o,o.prototype.type="TickFormatter"},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15),a=t(29);n.AnnularWedgeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){var t,e,n,i;for("data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,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.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius,this._angle=new Float32Array(this._start_angle.length),i=[],t=e=0,n=this._start_angle.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this._angle[t]=this._end_angle[t]-this._start_angle[t]);return i},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._start_angle,c=n._angle,_=n.sinner_radius,p=n.souter_radius;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o<s;o++)r=e[o],isNaN(l[r]+u[r]+_[r]+p[r]+h[r]+c[r])||(t.translate(l[r],u[r]),t.rotate(h[r]),t.moveTo(p[r],0),t.beginPath(),t.arc(0,0,p[r],0,c[r],i),t.rotate(c[r]),t.lineTo(_[r],0),t.arc(0,0,_[r],0,-c[r],!i),t.closePath(),t.rotate(-c[r]-h[r]),t.translate(-l[r],-u[r]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,r),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,r),a.push(t.stroke())):a.push(void 0));return a},e.prototype._hit_point=function(t){var e,n,i,r,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E;for(v=t.sx,b=t.sy,k=this.renderer.xscale.invert(v),M=this.renderer.yscale.invert(b),"data"===this.model.properties.outer_radius.units?(S=k-this.max_outer_radius,T=k+this.max_outer_radius,A=M-this.max_outer_radius,E=M+this.max_outer_radius):(g=v-this.max_outer_radius,y=v+this.max_outer_radius,z=this.renderer.xscale.r_invert(g,y),S=z[0],T=z[1],x=b-this.max_outer_radius,w=b+this.max_outer_radius,C=this.renderer.yscale.r_invert(x,w),A=C[0],E=C[1]),i=[],n=o.validate_bbox_coords([S,T],[A,E]),m=this.index.indices(n),c=0,p=m.length;c<p;c++)u=m[c],f=Math.pow(this.souter_radius[u],2),h=Math.pow(this.sinner_radius[u],2),O=this.renderer.xscale.r_compute(k,this._x[u]),g=O[0],y=O[1],N=this.renderer.yscale.r_compute(M,this._y[u]),x=N[0],w=N[1],(s=Math.pow(g-y,2)+Math.pow(x-w,2))<=f&&s>=h&&i.push([u,s]);for(r=this.model.properties.direction.value(),l=[],_=0,d=i.length;_<d;_++)j=i[_],u=j[0],s=j[1],e=Math.atan2(b-this.sy[u],v-this.sx[u]),a.angle_between(-e,-this._start_angle[u],-this._end_angle[u],r)&&l.push([u,s]);return o.create_1d_hit_test_result(l);var z,C,O,N,j},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e.prototype._scxy=function(t){var e,n;return n=(this.sinner_radius[t]+this.souter_radius[t])/2,e=(this._start_angle[t]+this._end_angle[t])/2,{x:this.sx[t]+n*Math.cos(e),y:this.sy[t]+n*Math.sin(e)}},e.prototype.scx=function(t){return this._scxy(t).x},e.prototype.scy=function(t){return this._scxy(t).y},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.AnnularWedge=l,l.prototype.default_view=n.AnnularWedgeView,l.prototype.type="AnnularWedge",l.mixins(["line","fill"]),l.define({direction:[s.Direction,"anticlock"],inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15);n.AnnulusView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,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.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sx,p=n.sy,d=n.sinner_radius,f=n.souter_radius;for(c=[],s=0,l=e.length;s<l;s++)if(r=e[s],!isNaN(_[r]+p[r]+d[r]+f[r])){if(o=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,r),t.beginPath(),o)for(a=0,u=(h=[!1,!0]).length;a<u;a++)i=h[a],t.arc(_[r],p[r],d[r],0,Math.PI,i),t.arc(_[r],p[r],f[r],Math.PI,0,!i);else t.arc(_[r],p[r],d[r],0,2*Math.PI,!0),t.arc(_[r],p[r],f[r],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit?(this.visuals.line.set_vectorize(t,r),t.beginPath(),t.arc(_[r],p[r],d[r],0,2*Math.PI),t.moveTo(_[r]+f[r],p[r]),t.arc(_[r],p[r],f[r],0,2*Math.PI),c.push(t.stroke())):c.push(void 0)}return c},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;for(c=t.sx,d=t.sy,v=this.renderer.xscale.invert(c),g=v-this.max_radius,y=v+this.max_radius,b=this.renderer.yscale.invert(d),x=b-this.max_radius,w=b+this.max_radius,i=[],e=o.validate_bbox_coords([g,y],[x,w]),h=this.index.indices(e),a=0,l=h.length;a<l;a++)r=h[a],u=Math.pow(this.souter_radius[r],2),s=Math.pow(this.sinner_radius[r],2),k=this.renderer.xscale.r_compute(v,this._x[r]),_=k[0],p=k[1],S=this.renderer.yscale.r_compute(b,this._y[r]),f=S[0],m=S[1],(n=Math.pow(_-p,2)+Math.pow(f-m,2))<=u&&n>=s&&i.push([r,n]);return o.create_1d_hit_test_result(i);var k,S},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_;return a=[o],c={},c[o]=(e+n)/2,_={},_[o]=(i+r)/2,l=.5*Math.min(Math.abs(n-e),Math.abs(r-i)),u={},u[o]=.4*l,h={},h[o]=.8*l,s={sx:c,sy:_,sinner_radius:u,souter_radius:h},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Annulus=a,a.prototype.default_view=n.AnnulusView,a.prototype.type="Annulus",a.mixins(["line","fill"]),a.define({inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec]})},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.ArcView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;if(this.visuals.line.doit){for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o<s;o++)r=e[o],isNaN(l[r]+u[r]+h[r]+c[r]+_[r])||(t.beginPath(),t.arc(l[r],u[r],h[r],c[r],_[r],i),this.visuals.line.set_vectorize(t,r),a.push(t.stroke()));return a}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Arc=s,s.prototype.default_view=n.ArcView,s.prototype.type="Arc",s.mixins(["line"]),s.define({direction:[o.Direction,"anticlock"],radius:[o.DistanceSpec],start_angle:[o.AngleSpec],end_angle:[o.AngleSpec]})},function(t,e,n){var i,r=t(364),o=t(36),s=t(108);i=function(t,e,n,i,r,o,s,a){var l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S;for(w=[],c=[[],[]],p=m=0;m<=2;p=++m)if(0===p?(u=6*t-12*n+6*r,l=-3*t+9*n-9*r+3*s,_=3*n-3*t):(u=6*e-12*i+6*o,l=-3*e+9*i-9*o+3*a,_=3*i-3*e),Math.abs(l)<1e-12){if(Math.abs(u)<1e-12)continue;0<(y=-_/u)&&y<1&&w.push(y)}else h=u*u-4*_*l,g=Math.sqrt(h),h<0||(0<(b=(-u+g)/(2*l))&&b<1&&w.push(b),0<(x=(-u-g)/(2*l))&&x<1&&w.push(x));for(d=w.length,f=d;d--;)y=w[d],k=(v=1-y)*v*v*t+3*v*v*y*n+3*v*y*y*r+y*y*y*s,c[0][d]=k,S=v*v*v*e+3*v*v*y*i+3*v*y*y*o+y*y*y*a,c[1][d]=S;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])]},n.BezierView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){var t,e,n,r,s,a,l,u;for(n=[],t=e=0,r=this._x0.length;0<=r?e<r:e>r;t=0<=r?++e:--e)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])||(h=i(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=h[0],l=h[1],a=h[2],u=h[3],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=(n.scx,n.scx0),_=n.scy0,p=n.scx1,d=n.scy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+c[i]+_[i]+p[i]+d[i])||(t.beginPath(),t.moveTo(a[i],l[i]),t.bezierCurveTo(c[i],_[i],p[i],d[i],u[i],h[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke()));return s}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(s.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(s.Glyph);n.Bezier=a,a.prototype.default_view=n.BezierView,a.prototype.type="Bezier",a.coords([["x0","y0"],["x1","y1"],["cx0","cy0"],["cx1","cy1"]]),a.mixins(["line"])},function(t,e,n){var i=t(364),r=t(36),o=t(108),s=t(9);n.BoxView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_box=function(t){var e,n,i,o,s,a,l,u;for(s=[],n=i=0,l=t;0<=l?i<l:i>l;n=0<=l?++i:--i)h=this._lrtb(n),o=h[0],a=h[1],u=h[2],e=h[3],!isNaN(o+a+u+e)&&isFinite(o+a+u+e)&&s.push({minX:o,minY:e,maxX:a,maxY:u,i:n});return new r.RBush(s);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sleft,l=n.sright,u=n.stop,h=n.sbottom;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+u[i]+l[i]+h[i])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fillRect(a[i],u[i],l[i]-a[i],h[i]-u[i])),this.visuals.line.doit?(t.beginPath(),t.rect(a[i],u[i],l[i]-a[i],h[i]-u[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e,n,i,r,o,a;return i=t.sx,r=t.sy,o=this.renderer.xscale.invert(i),a=this.renderer.yscale.invert(r),e=this.index.indices({minX:o,minY:a,maxX:o,maxY:a}),n=s.create_hit_test_result(),n["1d"].indices=e,n},e.prototype._hit_span=function(t){var e,n,i,r,o,a,l,u,h,c,_,p;return u=t.sx,h=t.sy,"v"===t.direction?(p=this.renderer.yscale.invert(h),n=this.renderer.plot_view.frame.bbox.h_range,d=this.renderer.xscale.r_invert(n.start,n.end),o=d[0],i=d[1],e=this.index.indices({minX:o,minY:p,maxX:i,maxY:p})):(_=this.renderer.xscale.invert(u),c=this.renderer.plot_view.frame.bbox.v_range,f=this.renderer.yscale.r_invert(c.start,c.end),a=f[0],r=f[1],e=this.index.indices({minX:_,minY:a,maxX:_,maxY:r})),l=s.create_hit_test_result(),l["1d"].indices=e,l;var d,f},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(o.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.Box=a,a.mixins(["line","fill"])},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15);n.CircleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),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+"scale"],this["_"+t],this._radius)):(this.sradius=this._radius,this.max_size=2*this.max_radius):this.sradius=function(){var t,n,i,r;for(i=this._size,r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(e/2);return r}.call(this)},e.prototype._mask_data=function(t){var e,n,i,r,s,a,l,u,h,c,_;return p=this.renderer.plot_view.frame.bbox.ranges,n=p[0],l=p[1],null!=this._radius&&"data"===this.model.properties.radius.units?(i=n.start,r=n.end,d=this.renderer.xscale.r_invert(i,r),u=d[0],h=d[1],u-=this.max_radius,h+=this.max_radius,s=l.start,a=l.end,f=this.renderer.yscale.r_invert(s,a),c=f[0],_=f[1],c-=this.max_radius,_+=this.max_radius):(i=n.start-this.max_size,r=n.end+this.max_size,m=this.renderer.xscale.r_invert(i,r),u=m[0],h=m[1],s=l.start-this.max_size,a=l.end+this.max_size,v=this.renderer.yscale.r_invert(s,a),c=v[0],_=v[1]),e=o.validate_bbox_coords([u,h],[c,_]),this.index.indices(e);var p,d,f,m,v},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sradius;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i])||(t.beginPath(),t.arc(a[i],l[i],u[i],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,i),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(_=t.sx,f=t.sy,g=this.renderer.xscale.invert(_),x=this.renderer.yscale.invert(f),null!=this._radius&&"data"===this.model.properties.radius.units?(y=g-this.max_radius,b=g+this.max_radius,w=x-this.max_radius,k=x+this.max_radius):(p=_-this.max_size,d=_+this.max_size,S=this.renderer.xscale.r_invert(p,d),y=S[0],b=S[1],T=[Math.min(y,b),Math.max(y,b)],y=T[0],b=T[1],m=f-this.max_size,v=f+this.max_size,M=this.renderer.yscale.r_invert(m,v),w=M[0],k=M[1],A=[Math.min(w,k),Math.max(w,k)],w=A[0],k=A[1]),e=o.validate_bbox_coords([y,b],[w,k]),n=this.index.indices(e),r=[],null!=this._radius&&"data"===this.model.properties.radius.units)for(a=0,u=n.length;a<u;a++)s=n[a],c=Math.pow(this.sradius[s],2),E=this.renderer.xscale.r_compute(g,this._x[s]),p=E[0],d=E[1],z=this.renderer.yscale.r_compute(x,this._y[s]),m=z[0],v=z[1],(i=Math.pow(p-d,2)+Math.pow(m-v,2))<=c&&r.push([s,i]);else for(l=0,h=n.length;l<h;l++)s=n[l],c=Math.pow(this.sradius[s],2),(i=Math.pow(this.sx[s]-_,2)+Math.pow(this.sy[s]-f,2))<=c&&r.push([s,i]);return o.create_1d_hit_test_result(r);var S,T,M,A,E,z},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y;return h=t.sx,p=t.sy,b=this.bounds(),s=b.minX,a=b.minY,i=b.maxX,r=b.maxY,u=o.create_hit_test_result(),"h"===t.direction?(g=a,y=r,null!=this._radius&&"data"===this.model.properties.radius.units?(c=h-this.max_radius,_=h+this.max_radius,x=this.renderer.xscale.r_invert(c,_),m=x[0],v=x[1]):(l=this.max_size/2,c=h-l,_=h+l,w=this.renderer.xscale.r_invert(c,_),m=w[0],v=w[1])):(m=s,v=i,null!=this._radius&&"data"===this.model.properties.radius.units?(d=p-this.max_radius,f=p+this.max_radius,k=this.renderer.yscale.r_invert(d,f),g=k[0],y=k[1]):(l=this.max_size/2,d=p-l,f=p+l,S=this.renderer.yscale.r_invert(d,f),g=S[0],y=S[1])),e=o.validate_bbox_coords([m,v],[g,y]),n=this.index.indices(e),u["1d"].indices=n,u;var b,x,w,k,S},e.prototype._hit_rect=function(t){var e,n,i,r,s,a,l,u,h,c;return i=t.sx0,r=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,r),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=o.validate_bbox_coords([l,u],[h,c]),n=o.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},e.prototype._hit_poly=function(t){var e,n,i,r,s,a,l,u,h,c;for(h=t.sx,c=t.sy,e=function(){u=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?s<a:s>a;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l["1d"].indices=n,l},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h;return a=[o],u={},u[o]=(e+n)/2,h={},h[o]=(i+r)/2,l={},l[o]=.2*Math.min(Math.abs(n-e),Math.abs(r-i)),s={sx:u,sy:h,sradius:l},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.properties.radius.optional=!0},e}(r.XYGlyph);n.Circle=a,a.prototype.default_view=n.CircleView,a.prototype.type="Circle",a.mixins(["line","fill"]),a.define({angle:[s.AngleSpec,0],size:[s.DistanceSpec,{units:"screen",value:4}],radius:[s.DistanceSpec,null],radius_dimension:[s.String,"x"]})},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.EllipseView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(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._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sw,h=n.sh;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+this._angle[i])||(t.beginPath(),t.ellipse(a[i],l[i],u[i]/2,h[i]/2,this._angle[i],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,i),s.push(t.stroke())):s.push(void 0));return s},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p;return l=[o],_={},_[o]=(e+n)/2,p={},p[o]=(i+r)/2,u=this.sw[o]/this.sh[o],s=.8*Math.min(Math.abs(n-e),Math.abs(r-i)),c={},h={},u>1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Ellipse=s,s.prototype.default_view=n.EllipseView,s.prototype.type="Ellipse",s.mixins(["line","fill"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){var i=t(364),r=t(9),o=t(15),s=t(23),a=t(32),l=t(45),u=t(50),h=t(46),c=t(14),_=t(30),p=t(42),d=t(114);n.GlyphView=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.initialize=function(n){var i,r,o,s;if(e.prototype.initialize.call(this,n),this._nohit_warned={},this.renderer=n.renderer,this.visuals=new h.Visuals(this.model),null!=(r=this.renderer.plot_view.canvas_view.ctx).glcanvas){try{s=t(425)}catch(t){if("MODULE_NOT_FOUND"!==(o=t).code)throw o;c.logger.warn("WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering."),s=null}if(null!=s&&null!=(i=s[this.model.type+"GLGlyph"]))return this.glglyph=new i(r.glcanvas.gl,this)}},n.prototype.set_visuals=function(t){if(this.visuals.warm_cache(t),null!=this.glglyph)return this.glglyph.set_visuals_changed()},n.prototype.render=function(t,e,n){if(t.beginPath(),null==this.glglyph||!this.glglyph.render(t,e,n))return this._render(t,e,n)},n.prototype.has_finished=function(){return!0},n.prototype.notify_finished=function(){return this.renderer.notify_finished()},n.prototype.bounds=function(){return null==this.index?s.empty():this._bounds(this.index.bbox)},n.prototype.log_bounds=function(){var t,e,n,i,r,o,a,l,u;if(null==this.index)return s.empty();for(t=s.empty(),o=this.index.search(s.positive_x()),a=this.index.search(s.positive_y()),e=0,i=o.length;e<i;e++)(l=o[e]).minX<t.minX&&(t.minX=l.minX),l.maxX>t.maxX&&(t.maxX=l.maxX);for(n=0,r=a.length;n<r;n++)(u=a[n]).minY<t.minY&&(t.minY=u.minY),u.maxY>t.maxY&&(t.maxY=u.maxY);return this._bounds(t)},n.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}},n.prototype.get_anchor_point=function(t,e,n){var i=n[0],r=n[1];switch(t){case"center":return{x:this.scx(e,i,r),y:this.scy(e,i,r)};default:return null}},n.prototype.scx=function(t){return this.sx[t]},n.prototype.scy=function(t){return this.sy[t]},n.prototype.sdist=function(t,e,n,i,r){void 0===i&&(i="edge"),void 0===r&&(r=!1);var o,s,a,l,u,h,c;return null!=t.source_range.v_synthetic&&(e=t.source_range.v_synthetic(e)),"center"===i?(s=function(){var t,e,i;for(i=[],t=0,e=n.length;t<e;t++)o=n[t],i.push(o/2);return i}(),l=function(){var t,n,i;for(i=[],a=t=0,n=e.length;0<=n?t<n:t>n;a=0<=n?++t:--t)i.push(e[a]-s[a]);return i}(),u=function(){var t,n,i;for(i=[],a=t=0,n=e.length;0<=n?t<n:t>n;a=0<=n?++t:--t)i.push(e[a]+s[a]);return i}()):(l=e,u=function(){var t,e,i;for(i=[],a=t=0,e=l.length;0<=e?t<e:t>e;a=0<=e?++t:--t)i.push(l[a]+n[a]);return i}()),h=t.v_compute(l),c=t.v_compute(u),r?function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?t<e:t>e;a=0<=e?++t:--t)n.push(Math.ceil(Math.abs(c[a]-h[a])));return n}():function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?t<e:t>e;a=0<=e?++t:--t)n.push(Math.abs(c[a]-h[a]));return n}()},n.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return null},n.prototype._generic_line_legend=function(t,e,n,i,r,o){return t.save(),t.beginPath(),t.moveTo(e,(i+r)/2),t.lineTo(n,(i+r)/2),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,o),t.stroke()),t.restore()},n.prototype._generic_area_legend=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p;if([o],p=Math.abs(n-e),a=.1*p,l=Math.abs(r-i),s=.1*l,u=e+a,h=n-a,c=i+s,_=r-s,this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,o),t.fillRect(u,c,h-u,_-c)),this.visuals.line.doit)return t.beginPath(),t.rect(u,c,h-u,_-c),this.visuals.line.set_vectorize(t,o),t.stroke()},n.prototype.hit_test=function(t){var e,n;return n=null,e="_hit_"+t.type,null!=this[e]?n=this[e](t):null==this._nohit_warned[t.type]&&(c.logger.debug("'"+t.type+"' selection not available for "+this.model.type),this._nohit_warned[t.type]=!0),n},n.prototype._hit_rect_against_index=function(t){var e,n,i,o,s,a,l,u,h,c;return i=t.sx0,o=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,o),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=r.validate_bbox_coords([l,u],[h,c]),n=r.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},n.prototype.set_data=function(t,e,n){var i,r,o,s,l,u,h,c,p,f,m,v;if(i=this.model.materialize_dataspecs(t),this.visuals.set_all_indices(e),e&&!(this instanceof d.LineView)){r={};for(l in i)c=i[l],"_"===l.charAt(0)?r[l]=function(){var t,n,i;for(i=[],t=0,n=e.length;t<n;t++)o=e[t],i.push(c[o]);return i}():r[l]=c;i=r}if(_.extend(this,i),this.renderer.plot_view.model.use_map&&(null!=this._x&&(g=a.project_xy(this._x,this._y),this._x=g[0],this._y=g[1]),null!=this._xs&&(y=a.project_xsys(this._xs,this._ys),this._xs=y[0],this._ys=y[1])),null!=this.renderer.plot_view.frame.x_ranges)for(f=this.renderer.plot_view.frame.x_ranges[this.model.x_range_name],v=this.renderer.plot_view.frame.y_ranges[this.model.y_range_name],h=this.model._coords,s=0,u=h.length;s<u;s++)b=h[s],p=b[0],m=b[1],p="_"+p,m="_"+m,null!=f.v_synthetic&&(this[p]=f.v_synthetic(this[p])),null!=v.v_synthetic&&(this[m]=v.v_synthetic(this[m]));return null!=this.glglyph&&this.glglyph.set_data_changed(this._x.length),this._set_data(t,n),this.index=this._index_data();var g,y,b},n.prototype._set_data=function(){},n.prototype._index_data=function(){},n.prototype.mask_data=function(t){return null!=this.glglyph?t:this._mask_data(t)},n.prototype._mask_data=function(t){return t},n.prototype._bounds=function(t){return t},n.prototype.map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,d,f;for(r=this.model._coords,e=0,i=r.length;e<i;e++)if(m=r[e],d=m[0],f=m[1],h="s"+d,_="s"+f,d="_"+d,f="_"+f,p.isArray(null!=(o=this[d])?o[0]:void 0)||(null!=(s=this[d])&&null!=(a=s[0])?a.buffer:void 0)instanceof ArrayBuffer)for(v=[[],[]],this[h]=v[0],this[_]=v[1],t=n=0,l=this[d].length;0<=l?n<l:n>l;t=0<=l?++n:--n)g=this.map_to_screen(this[d][t],this[f][t]),u=g[0],c=g[1],this[h].push(u),this[_].push(c);else y=this.map_to_screen(this[d],this[f]),this[h]=y[0],this[_]=y[1];return this._map_data();var m,v,g,y},n.prototype._map_data=function(){},n.prototype.map_to_screen=function(t,e){return this.renderer.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},n}(l.View);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.coords=function(t){var e,n,i,r,s,a;for(e=this.prototype._coords.concat(t),this.prototype._coords=e,r={},n=0,i=t.length;n<i;n++)l=t[n],s=l[0],a=l[1],r[s]=[o.NumberSpec],r[a]=[o.NumberSpec];return this.define(r);var l},e}(u.Model);n.Glyph=f,f.prototype._coords=[],f.internal({x_range_name:[o.String,"default"],y_range_name:[o.String,"default"]})},function(t,e,n){var i=t(364),r=t(105),o=t(15);n.HBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype._index_data=function(){return this._index_box(this._y.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=Math.min(this._left[t],this._right[t]),i=Math.max(this._left[t],this._right[t]),r=this._y[t]+.5*this._height[t],e=this._y[t]-.5*this._height[t],[n,i,r,e]},e.prototype._map_data=function(){var t,e,n;for(this.sy=this.renderer.yscale.v_compute(this._y),this.sright=this.renderer.xscale.v_compute(this._right),this.sleft=this.renderer.xscale.v_compute(this._left),this.stop=[],this.sbottom=[],this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"),t=e=0,n=this.sy.length;0<=n?e<n:e>n;t=0<=n?++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}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.HBar=s,s.prototype.default_view=n.HBarView,s.prototype.type="HBar",s.coords([["left","y"]]),s.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),s.override({left:0})},function(t,e,n){var i=t(364),r=t(128),o=t(146),s=t(15),a=t(22);n.ImageView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.color_mapper.change,function(){return this._update_image()})},e.prototype._update_image=function(){if(null!=this.image_data)return this._set_data(),this.renderer.plot_view.request_render()},e.prototype._set_data=function(){var t,e,n,i,r,o,s,l,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=[],o=u=0,h=this._image.length;0<=h?u<h:u>h;o=0<=h?++u:--u)_=[],null!=this._image_shape&&(_=this._image_shape[o]),_.length>0?(l=this._image[o],this._height[o]=_[0],this._width[o]=_[1]):(l=a.concat(this._image[o]),this._height[o]=this._image[o].length,this._width[o]=this._image[o][0].length),null!=this.image_data[o]&&this.image_data[o].width===this._width[o]&&this.image_data[o].height===this._height[o]?n=this.image_data[o]:((n=document.createElement("canvas")).width=this._width[o],n.height=this._height[o]),r=n.getContext("2d"),s=r.getImageData(0,0,this._width[o],this._height[o]),i=this.model.color_mapper,t=i.v_map_screen(l,!0),e=new Uint8Array(t),s.data.set(e),r.putImageData(s,0,0),this.image_data[o]=n,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=a.max(this._dw)),this.max_dh=0,"data"===this._dh.units?c.push(this.max_dh=a.max(this._dh)):c.push(void 0);return c},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;r<o;r++)i=e[r],null!=l[i]&&(isNaN(u[i]+h[i]+c[i]+_[i])||(a=h[i],t.translate(0,a),t.scale(1,-1),t.translate(0,-a),t.drawImage(l[i],0|u[i],0|h[i],c[i],_[i]),t.translate(0,a),t.scale(1,-1),t.translate(0,-a)));return t.setImageSmoothingEnabled(s)},e.prototype.bounds=function(){var t;return t=this.index.bbox,t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Image=l,l.prototype.default_view=n.ImageView,l.prototype.type="Image",l.define({image:[s.NumberSpec],dw:[s.DistanceSpec],dh:[s.DistanceSpec],dilate:[s.Bool,!1],color_mapper:[s.Instance,function(){return new o.LinearColorMapper({palette:[0,2434341,5395026,7566195,9868950,12434877,14277081,15790320,16777215]})}]})},function(t,e,n){var i=t(364),r=t(128),o=t(15),s=t(22);n.ImageRGBAView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(t,e){var n,i,r,o,a,l,u,h,c,_,p,d,f,m,v;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=_=0,d=this._image.length;0<=d?_<d:_>d;u=0<=d?++_:--_)if(!(null!=e&&e.indexOf(u)<0)){if(v=[],null!=this._image_shape&&(v=this._image_shape[u]),v.length>0)n=this._image[u].buffer,this._height[u]=v[0],this._width[u]=v[1];else{for(l=s.concat(this._image[u]),n=new ArrayBuffer(4*l.length),o=new Uint32Array(n),c=p=0,f=l.length;0<=f?p<f:p>f;c=0<=f?++p:--p)o[c]=l[c];this._height[u]=this._image[u].length,this._width[u]=this._image[u][0].length}null!=this.image_data[u]&&this.image_data[u].width===this._width[u]&&this.image_data[u].height===this._height[u]?r=this.image_data[u]:((r=document.createElement("canvas")).width=this._width[u],r.height=this._height[u]),a=r.getContext("2d"),h=a.getImageData(0,0,this._width[u],this._height[u]),i=new Uint8Array(n),h.data.set(i),a.putImageData(h,0,0),this.image_data[u]=r,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.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;r<o;r++)i=e[r],isNaN(u[i]+h[i]+c[i]+_[i])||(a=h[i],t.translate(0,a),t.scale(1,-1),t.translate(0,-a),t.drawImage(l[i],0|u[i],0|h[i],c[i],_[i]),t.translate(0,a),t.scale(1,-1),t.translate(0,-a));return t.setImageSmoothingEnabled(s)},e.prototype.bounds=function(){var t;return t=this.index.bbox,t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.ImageRGBA=a,a.prototype.default_view=n.ImageRGBAView,a.prototype.type="ImageRGBA",a.define({image:[o.NumberSpec],dw:[o.DistanceSpec],dh:[o.DistanceSpec],dilate:[o.Bool,!1]})},function(t,e,n){var i=t(364),r=t(108),o=t(14),s=t(15);n.ImageURLView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.model.properties.global_alpha.change,function(){return n.renderer.request_render()})},e.prototype._index_data=function(){},e.prototype._set_data=function(){var t,e,n,i,r,s,a,l=this;for(null!=this.image&&this.image.length===this._url.length||(this.image=function(){var t,n,i,r;for(i=this._url,r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(null);return r}.call(this)),s=this.model.retry_attempts,a=this.model.retry_timeout,this.retries=function(){var t,n,i,r;for(i=this._url,r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(s);return r}.call(this),r=[],t=n=0,i=this._url.length;0<=i?n<i:n>i;t=0<=i?++n:--n)null!=this._url[t]&&((e=new Image).onerror=function(t,e){return function(){return l.retries[t]>0?(o.logger.trace("ImageURL failed to load "+l._url[t]+" image, retrying in "+a+" ms"),setTimeout(function(){return e.src=l._url[t]},a)):o.logger.warn("ImageURL unable to load "+l._url[t]+" image after "+s+" retries"),l.retries[t]-=1}}(t,e),e.onload=function(t,e){return function(){return l.image[e]=t,l.renderer.request_render()}}(e,t),r.push(e.src=this._url[t]));return r},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&!0===this._images_rendered},e.prototype._map_data=function(){var t,e,n;switch(e=function(){var t,e,i,r;if(null!=this.model.w)return this._w;for(i=this._x,r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(NaN);return r}.call(this),t=function(){var t,e,i,r;if(null!=this.model.h)return this._h;for(i=this._x,r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(NaN);return r}.call(this),this.model.properties.w.units){case"data":this.sw=this.sdist(this.renderer.xscale,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.yscale,this._y,t,"edge",this.model.dilate);case"screen":return this.sh=t}},e.prototype._render=function(t,e,n){n._url;var i,r,o,s,a,l=n.image,u=n.sx,h=n.sy,c=n.sw,_=n.sh,p=n._angle;for(r=this.renderer.plot_view.frame,t.rect(r._left.value+1,r._top.value+1,r._width.value-2,r._height.value-2),t.clip(),i=!0,s=0,a=e.length;s<a;s++)o=e[s],isNaN(u[o]+h[o]+p[o])||-1!==this.retries[o]&&(null!=l[o]?this._render_image(t,o,l[o],u,h,c,_,p):i=!1);if(i&&!this._images_rendered)return this._images_rendered=!0,this.notify_finished()},e.prototype._final_sx_sy=function(t,e,n,i,r){switch(t){case"top_left":return[e,n];case"top_center":return[e-i/2,n];case"top_right":return[e-i,n];case"center_right":return[e-i,n-r/2];case"bottom_right":return[e-i,n-r];case"bottom_center":return[e-i/2,n-r];case"bottom_left":return[e,n-r];case"center_left":return[e,n-r/2];case"center":return[e-i/2,n-r/2]}},e.prototype._render_image=function(t,e,n,i,r,o,s,a){var l;return isNaN(o[e])&&(o[e]=n.width),isNaN(s[e])&&(s[e]=n.height),l=this.model.anchor,u=this._final_sx_sy(l,i[e],r[e],o[e],s[e]),i=u[0],r=u[1],t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(i,r),t.rotate(a[e]),t.drawImage(n,0,0,o[e],s[e]),t.rotate(-a[e]),t.translate(-i,-r)):t.drawImage(n,i,r,o[e],s[e]),t.restore();var u},e}(r.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Glyph);n.ImageURL=a,a.prototype.default_view=n.ImageURLView,a.prototype.type="ImageURL",a.coords([["x","y"]]),a.mixins([]),a.define({url:[s.StringSpec],anchor:[s.Anchor,"top_left"],global_alpha:[s.Number,1],angle:[s.AngleSpec,0],w:[s.DistanceSpec],h:[s.DistanceSpec],dilate:[s.Bool,!1],retry_attempts:[s.Number,0],retry_timeout:[s.Number,0]})},function(t,e,n){var i=t(101);n.AnnularWedge=i.AnnularWedge;var r=t(102);n.Annulus=r.Annulus;var o=t(103);n.Arc=o.Arc;var s=t(104);n.Bezier=s.Bezier;var a=t(106);n.Circle=a.Circle;var l=t(107);n.Ellipse=l.Ellipse;var u=t(108);n.Glyph=u.Glyph;var h=t(109);n.HBar=h.HBar;var c=t(110);n.Image=c.Image;var _=t(111);n.ImageRGBA=_.ImageRGBA;var p=t(112);n.ImageURL=p.ImageURL;var d=t(114);n.Line=d.Line;var f=t(115);n.MultiLine=f.MultiLine;var m=t(116);n.Oval=m.Oval;var v=t(117);n.Patch=v.Patch;var g=t(118);n.Patches=g.Patches;var y=t(119);n.Quad=y.Quad;var b=t(120);n.Quadratic=b.Quadratic;var x=t(121);n.Ray=x.Ray;var w=t(122);n.Rect=w.Rect;var k=t(123);n.Segment=k.Segment;var S=t(124);n.Step=S.Step;var T=t(125);n.Text=T.Text;var M=t(126);n.VBar=M.VBar;var A=t(127);n.Wedge=A.Wedge;var E=t(128);n.XYGlyph=E.XYGlyph},function(t,e,n){var i=t(364),r=t(128),o=t(9);n.LineView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy;for(i=!1,this.visuals.line.set_value(t),s=null,o=0,a=e.length;o<a;o++){if(r=e[o],i){if(!isFinite(l[r]+u[r])){t.stroke(),t.beginPath(),i=!1,s=r;continue}null!==s&&r-s>1&&(t.stroke(),i=!1)}i?t.lineTo(l[r],u[r]):(t.beginPath(),t.moveTo(l[r],u[r]),i=!0),s=r}if(i)return t.stroke()},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c;for(u=o.create_hit_test_result(),a={x:t.sx,y:t.sy},h=9999,c=Math.max(2,this.visuals.line.line_width.value()/2),n=i=0,l=this.sx.length-1;0<=l?i<l:i>l;n=0<=l?++i:--i)_=[{x:this.sx[n],y:this.sy[n]},{x:this.sx[n+1],y:this.sy[n+1]}],r=_[0],s=_[1],(e=o.dist_to_segment(a,r,s))<c&&e<h&&(h=e,u["0d"].glyph=this.model,u["0d"].get_view=function(){return this}.bind(this),u["0d"].flag=!0,u["0d"].indices=[n]);return u;var _},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u;for(s=t.sx,a=t.sy,r=o.create_hit_test_result(),"v"===t.direction?(l=this.renderer.yscale.invert(a),u=this._y):(l=this.renderer.xscale.invert(s),u=this._x),e=n=0,i=u.length-1;0<=i?n<i:n>i;e=0<=i?++n:--n)(u[e]<=l&&l<=u[e+1]||u[e+1]<=l&&l<=u[e])&&(r["0d"].glyph=this.model,r["0d"].get_view=function(){return this}.bind(this),r["0d"].flag=!0,r["0d"].indices.push(e));return r},e.prototype.get_interpolation_hit=function(t,e){var n,i,r,s,a,l,u,h,c,_,p;return i=e.sx,r=e.sy,d=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],l=d[0],_=d[1],u=d[2],p=d[3],"point"===e.type?(f=this.renderer.yscale.r_invert(r-1,r+1),h=f[0],c=f[1],m=this.renderer.xscale.r_invert(i-1,i+1),s=m[0],a=m[1]):"v"===e.direction?(v=this.renderer.yscale.r_invert(r,r),h=v[0],c=v[1],s=(g=[l,u])[0],a=g[1]):(y=this.renderer.xscale.r_invert(i,i),s=y[0],a=y[1],h=(b=[_,p])[0],c=b[1]),n=o.check_2_segments_intersect(s,h,a,c,l,_,u,p),[n.x,n.y];var d,f,m,v,g,y,b},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Line=s,s.prototype.default_view=n.LineView,s.prototype.type="Line",s.mixins(["line"])},function(t,e,n){var i=t(364),r=t(36),o=t(9),s=t(22),a=t(42),l=t(108);n.MultiLineView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i,o,l,u,h;for(n=[],t=e=0,i=this._xs.length;0<=i?e<i:e>i;t=0<=i?++e:--e)null!==this._xs[t]&&0!==this._xs[t].length&&(l=function(){var e,n,i,r;for(i=this._xs[t],r=[],e=0,n=i.length;e<n;e++)o=i[e],a.isStrictNaN(o)||r.push(o);return r}.call(this),h=function(){var e,n,i,r;for(i=this._ys[t],r=[],e=0,n=i.length;e<n;e++)u=i[e],a.isStrictNaN(u)||r.push(u);return r}.call(this),n.push({minX:s.min(l),minY:s.min(h),maxX:s.max(l),maxY:s.max(h),i:t}));return new r.RBush(n)},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sxs,p=n.sys;for(u=[],o=0,a=e.length;o<a;o++){for(i=e[o],d=[_[i],p[i]],h=d[0],c=d[1],this.visuals.line.set_vectorize(t,i),r=s=0,l=h.length;0<=l?s<l:s>l;r=0<=l?++s:--s)0!==r?isNaN(h[r])||isNaN(c[r])?(t.stroke(),t.beginPath()):t.lineTo(h[r],c[r]):(t.beginPath(),t.moveTo(h[r],c[r]));u.push(t.stroke())}return u;var d},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m;for(d=o.create_hit_test_result(),h={x:t.sx,y:t.sy},f=9999,n={},i=s=0,_=this.sxs.length;0<=_?s<_:s>_;i=0<=_?++s:--s){for(m=Math.max(2,this.visuals.line.cache_select("line_width",i)/2),c=null,r=a=0,p=this.sxs[i].length-1;0<=p?a<p:a>p;r=0<=p?++a:--a)v=[{x:this.sxs[i][r],y:this.sys[i][r]},{x:this.sxs[i][r+1],y:this.sys[i][r+1]}],l=v[0],u=v[1],(e=o.dist_to_segment(h,l,u))<m&&e<f&&(f=e,c=[r]);c&&(n[i]=c)}return d["1d"].indices=function(){var t,e,r,o;for(r=Object.keys(n),o=[],e=0,t=r.length;e<t;e++)i=r[e],o.push(parseInt(i));return o}(),d["2d"].indices=n,d;var v},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d;for(c=t.sx,_=t.sy,h=o.create_hit_test_result(),"v"===t.direction?(p=this.renderer.yscale.invert(_),d=this._ys):(p=this.renderer.xscale.invert(c),d=this._xs),e={},n=r=0,l=d.length;0<=l?r<l:r>l;n=0<=l?++r:--r){for(a=[],i=s=0,u=d[n].length-1;0<=u?s<u:s>u;i=0<=u?++s:--s)d[n][i]<=p&&p<=d[n][i+1]&&a.push(i);a.length>0&&(e[n]=a)}return h["1d"].indices=function(){var t,i,r,o;for(r=Object.keys(e),o=[],i=0,t=r.length;i<t;i++)n=r[i],o.push(parseInt(n));return o}(),h["2d"].indices=e,h},e.prototype.get_interpolation_hit=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d;return r=n.sx,s=n.sy,f=[this._xs[t][e],this._ys[t][e],this._xs[t][e+1],this._ys[t][e+1]],u=f[0],p=f[1],h=f[2],d=f[3],"point"===n.type?(m=this.renderer.yscale.r_invert(s-1,s+1),c=m[0],_=m[1],v=this.renderer.xscale.r_invert(r-1,r+1),a=v[0],l=v[1]):"v"===n.direction?(g=this.renderer.yscale.r_invert(s,s),c=g[0],_=g[1],a=(y=[u,h])[0],l=y[1]):(b=this.renderer.xscale.r_invert(r,r),a=b[0],l=b[1],c=(x=[p,d])[0],_=x[1]),i=o.check_2_segments_intersect(a,c,l,_,u,p,h,d),[i.x,i.y];var f,m,v,g,y,b,x},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(l.GlyphView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Glyph);n.MultiLine=u,u.prototype.default_view=n.MultiLineView,u.prototype.type="MultiLine",u.coords([["xs","ys"]]),u.mixins(["line"])},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.OvalView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(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._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sw,h=n.sh;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+this._angle[i])||(t.translate(a[i],l[i]),t.rotate(this._angle[i]),t.beginPath(),t.moveTo(0,-h[i]/2),t.bezierCurveTo(u[i]/2,-h[i]/2,u[i]/2,h[i]/2,0,h[i]/2),t.bezierCurveTo(-u[i]/2,h[i]/2,-u[i]/2,-h[i]/2,0,-h[i]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,i),t.stroke()),t.rotate(-this._angle[i]),s.push(t.translate(-a[i],-l[i])));return s},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p;return l=[o],_={},_[o]=(e+n)/2,p={},p[o]=(i+r)/2,u=this.sw[o]/this.sh[o],s=.8*Math.min(Math.abs(n-e),Math.abs(r-i)),c={},h={},u>1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Oval=s,s.prototype.default_view=n.OvalView,s.prototype.type="Oval",s.mixins(["line","fill"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){var i=t(364),r=t(128);n.PatchView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy;if(this.visuals.fill.doit){for(this.visuals.fill.set_value(t),r=0,s=e.length;r<s;r++)0!==(i=e[r])?isNaN(l[i]+u[i])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(l[i],u[i]):(t.beginPath(),t.moveTo(l[i],u[i]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_value(t),o=0,a=e.length;o<a;o++)0!==(i=e[o])?isNaN(l[i]+u[i])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(l[i],u[i]):(t.beginPath(),t.moveTo(l[i],u[i]));return t.closePath(),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Patch=o,o.prototype.default_view=n.PatchView,o.prototype.type="Patch",o.mixins(["line","fill"])},function(t,e,n){var i=t(364),r=t(36),o=t(108),s=t(22),a=t(42),l=t(9);n.PatchesView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._build_discontinuous_object=function(t){var e,n,i,r,o,l,u,h,c;for(n={},i=r=0,c=t.length;0<=c?r<c:r>c;i=0<=c?++r:--r)for(n[i]=[],u=s.copy(t[i]);u.length>0;)(o=s.findLastIndex(u,function(t){return a.isStrictNaN(t)}))>=0?h=u.splice(o):(h=u,u=[]),e=function(){var t,e,n;for(n=[],t=0,e=h.length;t<e;t++)l=h[t],a.isStrictNaN(l)||n.push(l);return n}(),n[i].push(e);return n},e.prototype._index_data=function(){var t,e,n,i,o,a,l,u,h,c,_;for(h=this._build_discontinuous_object(this._xs),_=this._build_discontinuous_object(this._ys),o=[],t=n=0,a=this._xs.length;0<=a?n<a:n>a;t=0<=a?++n:--n)for(e=i=0,l=h[t].length;0<=l?i<l:i>l;e=0<=l?++i:--i)u=h[t][e],c=_[t][e],0!==u.length&&o.push({minX:s.min(u),minY:s.min(c),maxX:s.max(u),maxY:s.max(c),i:t});return new r.RBush(o)},e.prototype._mask_data=function(t){var e,n,i,r,o,s,a;return r=this.renderer.plot_view.frame.x_ranges.default,u=[r.min,r.max],n=u[0],i=u[1],a=this.renderer.plot_view.frame.y_ranges.default,h=[a.min,a.max],o=h[0],s=h[1],e=l.validate_bbox_coords([n,i],[o,s]),this.index.indices(e).sort(function(t,e){return t-e});var u,h},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d=n.sxs,f=n.sys;for(this.renderer.sxss=this._build_discontinuous_object(d),this.renderer.syss=this._build_discontinuous_object(f),c=[],o=0,a=e.length;o<a;o++){if(i=e[o],m=[d[i],f[i]],_=m[0],p=m[1],this.visuals.fill.doit){for(this.visuals.fill.set_vectorize(t,i),r=s=0,u=_.length;0<=u?s<u:s>u;r=0<=u?++s:--s)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_vectorize(t,i),r=l=0,h=_.length;0<=h?l<h:l>h;r=0<=h?++l:--l)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),c.push(t.stroke())}else c.push(void 0)}return c;var m},e.prototype._hit_point=function(t){var e,n,i,r,o,s,a,u,h,c,_,p,d,f,m,v;for(_=t.sx,d=t.sy,m=this.renderer.xscale.invert(_),v=this.renderer.yscale.invert(d),e=this.index.indices({minX:m,minY:v,maxX:m,maxY:v}),n=[],i=s=0,u=e.length;0<=u?s<u:s>u;i=0<=u?++s:--s)for(r=e[i],p=this.renderer.sxss[r],f=this.renderer.syss[r],o=a=0,h=p.length;0<=h?a<h:a>h;o=0<=h?++a:--a)l.point_in_poly(_,d,p[o],f[o])&&n.push(r);return c=l.create_hit_test_result(),c["1d"].indices=n,c},e.prototype._get_snap_coord=function(t){var e,n,i,r;for(r=0,e=0,n=t.length;e<n;e++)i=t[e],r+=i;return r/t.length},e.prototype.scx=function(t,e,n){var i,r,o,s,a;if(1===this.renderer.sxss[t].length)return this._get_snap_coord(this.sxs[t]);for(s=this.renderer.sxss[t],a=this.renderer.syss[t],i=r=0,o=s.length;0<=o?r<o:r>o;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(s[i]);return null},e.prototype.scy=function(t,e,n){var i,r,o,s,a;if(1===this.renderer.syss[t].length)return this._get_snap_coord(this.sys[t]);for(s=this.renderer.sxss[t],a=this.renderer.syss[t],i=r=0,o=s.length;0<=o?r<o:r>o;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(a[i])},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(o.GlyphView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.Patches=u,u.prototype.default_view=n.PatchesView,u.prototype.type="Patches",u.coords([["xs","ys"]]),u.mixins(["line","fill"])},function(t,e,n){var i=t(364),r=t(105);n.QuadView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_anchor_point=function(t,e,n){var i,r,o,s;switch(r=Math.min(this.sleft[e],this.sright[e]),o=Math.max(this.sright[e],this.sleft[e]),s=Math.min(this.stop[e],this.sbottom[e]),i=Math.max(this.sbottom[e],this.stop[e]),t){case"top_left":return{x:r,y:s};case"top_center":return{x:(r+o)/2,y:s};case"top_right":return{x:o,y:s};case"center_right":return{x:o,y:(s+i)/2};case"bottom_right":return{x:o,y:i};case"bottom_center":return{x:(r+o)/2,y:i};case"bottom_left":return{x:r,y:i};case"center_left":return{x:r,y:(s+i)/2};case"center":return{x:(r+o)/2,y:(s+i)/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._index_data=function(){return this._index_box(this._right.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=this._left[t],i=this._right[t],r=this._top[t],e=this._bottom[t],[n,i,r,e]},e}(r.BoxView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.Quad=o,o.prototype.default_view=n.QuadView,o.prototype.type="Quad",o.coords([["right","bottom"],["left","top"]])},function(t,e,n){var i,r=t(364),o=t(36),s=t(108);i=function(t,e,n){var i,r;return e===(t+n)/2?[t,n]:(r=(t-e)/(t-2*e+n),i=t*Math.pow(1-r,2)+2*e*(1-r)*r+n*Math.pow(r,2),[Math.min(t,n,i),Math.max(t,n,i)])},n.QuadraticView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){var t,e,n,r,s,a,l,u;for(n=[],t=e=0,r=this._x0.length;0<=r?e<r:e>r;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx[t]+this._cy[t])||(h=i(this._x0[t],this._cx[t],this._x1[t]),s=h[0],a=h[1],c=i(this._y0[t],this._cy[t],this._y1[t]),l=c[0],u=c[1],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h,c},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=n.scx,_=n.scy;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+c[i]+_[i])||(t.beginPath(),t.moveTo(a[i],l[i]),t.quadraticCurveTo(c[i],_[i],u[i],h[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke()));return s}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(s.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(s.Glyph);n.Quadratic=a,a.prototype.default_view=n.QuadraticView,a.prototype.type="Quadratic",a.coords([["x0","y0"],["x1","y1"],["cx","cy"]]),a.mixins(["line"])},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.RayView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this._length):this.slength=this._length},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sx,p=n.sy,d=n.slength,f=n._angle;if(this.visuals.line.doit){for(c=this.renderer.plot_view.frame._width.value,i=this.renderer.plot_view.frame._height.value,o=2*(c+i),r=s=0,u=d.length;0<=u?s<u:s>u;r=0<=u?++s:--s)0===d[r]&&(d[r]=o);for(h=[],a=0,l=e.length;a<l;a++)r=e[a],isNaN(_[r]+p[r]+f[r]+d[r])||(t.translate(_[r],p[r]),t.rotate(f[r]),t.beginPath(),t.moveTo(0,0),t.lineTo(d[r],0),this.visuals.line.set_vectorize(t,r),t.stroke(),t.rotate(-f[r]),h.push(t.translate(-_[r],-p[r])));return h}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Ray=s,s.prototype.default_view=n.RayView,s.prototype.type="Ray",s.mixins(["line"]),s.define({length:[o.DistanceSpec],angle:[o.AngleSpec]})},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15),a=t(22);n.RectView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(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._map_data=function(){var t;return"data"===this.model.properties.width.units?(e=this._map_dist_corner_for_data_side_length(this._x,this._width,this.renderer.xscale,0),this.sw=e[0],this.sx0=e[1]):(this.sw=this._width,this.sx0=function(){var e,n,i;for(i=[],t=e=0,n=this.sx.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this.sx[t]-this.sw[t]/2);return i}.call(this)),"data"===this.model.properties.height.units?(n=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale,1),this.sh=n[0],this.sy1=n[1]):(this.sh=this._height,this.sy1=function(){var e,n,i;for(i=[],t=e=0,n=this.sy.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this.sy[t]-this.sh[t]/2);return i}.call(this)),this.ssemi_diag=function(){var e,n,i;for(i=[],t=e=0,n=this.sw.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(Math.sqrt(this.sw[t]/2*this.sw[t]/2+this.sh[t]/2*this.sh[t]/2));return i}.call(this);var e,n},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sx0,c=n.sy1,_=n.sw,p=n.sh,d=n._angle;if(this.visuals.fill.doit)for(r=0,s=e.length;r<s;r++)i=e[r],isNaN(l[i]+u[i]+h[i]+c[i]+_[i]+p[i]+d[i])||(this.visuals.fill.set_vectorize(t,i),d[i]?(t.translate(l[i],u[i]),t.rotate(d[i]),t.fillRect(-_[i]/2,-p[i]/2,_[i],p[i]),t.rotate(-d[i]),t.translate(-l[i],-u[i])):t.fillRect(h[i],c[i],_[i],p[i]));if(this.visuals.line.doit){for(t.beginPath(),o=0,a=e.length;o<a;o++)i=e[o],isNaN(l[i]+u[i]+h[i]+c[i]+_[i]+p[i]+d[i])||0!==_[i]&&0!==p[i]&&(d[i]?(t.translate(l[i],u[i]),t.rotate(d[i]),t.rect(-_[i]/2,-p[i]/2,_[i],p[i]),t.rotate(-d[i]),t.translate(-l[i],-u[i])):t.rect(h[i],c[i],_[i],p[i]),this.visuals.line.set_vectorize(t,i),t.stroke(),t.beginPath());return t.stroke()}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e,n,i,r,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A;for(y=t.sx,b=t.sy,w=this.renderer.xscale.invert(y),T=this.renderer.yscale.invert(b),v=function(){var t,e,n;for(n=[],s=t=0,e=this.sx0.length;0<=e?t<e:t>e;s=0<=e?++t:--t)n.push(this.sx0[s]+this.sw[s]/2);return n}.call(this),g=function(){var t,e,n;for(n=[],s=t=0,e=this.sy1.length;0<=e?t<e:t>e;s=0<=e?++t:--t)n.push(this.sy1[s]+this.sh[s]/2);return n}.call(this),h=a.max(this._ddist(0,v,this.ssemi_diag)),c=a.max(this._ddist(1,g,this.ssemi_diag)),k=w-h,S=w+h,M=T-c,A=T+c,r=[],e=o.validate_bbox_coords([k,S],[M,A]),d=this.index.indices(e),l=0,u=d.length;l<u;l++)s=d[l],this._angle[s]?(Math.sqrt(Math.pow(y-this.sx[s],2)+Math.pow(b-this.sy[s],2)),m=Math.sin(-this._angle[s]),n=Math.cos(-this._angle[s]),_=n*(y-this.sx[s])-m*(b-this.sy[s])+this.sx[s],p=m*(y-this.sx[s])+n*(b-this.sy[s])+this.sy[s],y=_,b=p,x=Math.abs(this.sx[s]-y)<=this.sw[s]/2,i=Math.abs(this.sy[s]-b)<=this.sh[s]/2):(x=y-this.sx0[s]<=this.sw[s]&&y-this.sx0[s]>=0,i=b-this.sy1[s]<=this.sh[s]&&b-this.sy1[s]>=0),i&&x&&r.push(s);return f=o.create_hit_test_result(),f["1d"].indices=r,f},e.prototype._map_dist_corner_for_data_side_length=function(t,e,n,i){var r,o,s,a,l,u,h,c,_,p,d,f;if(this.renderer.plot_view.frame,null!=n.source_range.synthetic&&(t=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)f=t[e],r.push(n.source_range.synthetic(f));return r}()),a=function(){var n,i,o;for(o=[],r=n=0,i=t.length;0<=i?n<i:n>i;r=0<=i?++n:--n)o.push(Number(t[r])-e[r]/2);return o}(),l=function(){var n,i,o;for(o=[],r=n=0,i=t.length;0<=i?n<i:n>i;r=0<=i?++n:--n)o.push(Number(t[r])+e[r]/2);return o}(),c=n.v_compute(a),_=n.v_compute(l),d=this.sdist(n,a,e,"edge",this.model.dilate),0===i){for(p=c,r=o=0,u=c.length;0<=u?o<u:o>u;r=0<=u?++o:--o)if(c[r]!==_[r]){p=c[r]<_[r]?c:_;break}return[d,p]}if(1===i){for(p=c,r=s=0,h=c.length;0<=h?s<h:s>h;r=0<=h?++s:--s)if(c[r]!==_[r]){p=c[r]<_[r]?c:_;break}return[d,p]}},e.prototype._ddist=function(t,e,n){var i,r,o,s,a,l;return s=0===t?this.renderer.xscale:this.renderer.yscale,a=e,l=function(){var t,e,r;for(r=[],i=t=0,e=a.length;0<=e?t<e:t>e;i=0<=e?++t:--t)r.push(a[i]+n[i]);return r}(),r=s.v_invert(a),o=s.v_invert(l),function(){var t,e,n;for(n=[],i=t=0,e=r.length;0<=e?t<e:t>e;i=0<=e?++t:--t)n.push(Math.abs(o[i]-r[i]));return n}()},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Rect=l,l.prototype.default_view=n.RectView,l.prototype.type="Rect",l.mixins(["line","fill"]),l.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec],dilate:[s.Bool,!1]})},function(t,e,n){var i=t(364),r=t(9),o=t(36),s=t(108);n.SegmentView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i;for(n=[],t=e=0,i=this._x0.length;0<=i?e<i:e>i;t=0<=i?++e:--e)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 new o.RBush(n)},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i])||(t.beginPath(),t.moveTo(a[i],l[i]),t.lineTo(u[i],h[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke()));return s}},e.prototype._hit_point=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d,f,m,v;for(f=t.sx,m=t.sy,this.renderer.xscale.invert(f),this.renderer.yscale.invert(m),p={x:f,y:m},n=[],2,g=this.renderer.xscale.r_invert(f-2,f+2),u=g[0],a=g[1],y=this.renderer.yscale.r_invert(m-2,m+2),h=y[0],l=y[1],e=this.index.indices({minX:u,minY:h,maxX:a,maxY:l}),o=0,s=e.length;o<s;o++)i=e[o],v=Math.pow(Math.max(2,this.visuals.line.cache_select("line_width",i)/2),2),b=[{x:this.sx0[i],y:this.sy0[i]},{x:this.sx1[i],y:this.sy1[i]}],c=b[0],_=b[1],r.dist_to_segment_squared(p,c,_)<v&&n.push(i);return d=r.create_hit_test_result(),d["1d"].indices=n,d;var g,y,b},e.prototype._hit_span=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d,f,m,v,g;for(y=this.renderer.plot_view.frame.bbox.ranges,i=y[0],g=y[1],p=t.sx,d=t.sy,"v"===t.direction?(v=this.renderer.yscale.invert(d),b=[this._y0,this._y1],f=b[0],m=b[1]):(v=this.renderer.xscale.invert(p),x=[this._x0,this._x1],f=x[0],m=x[1]),n=[],w=this.renderer.xscale.r_invert(i.start,i.end),h=w[0],l=w[1],k=this.renderer.yscale.r_invert(g.start,g.end),c=k[0],u=k[1],e=this.index.indices({minX:h,minY:c,maxX:l,maxY:u}),s=0,a=e.length;s<a;s++)o=e[s],(f[o]<=v&&v<=m[o]||m[o]<=v&&v<=f[o])&&n.push(o);return _=r.create_hit_test_result(),_["1d"].indices=n,_;var y,b,x,w,k},e.prototype.scx=function(t){return(this.sx0[t]+this.sx1[t])/2},e.prototype.scy=function(t){return(this.sy0[t]+this.sy1[t])/2},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(s.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.Glyph);n.Segment=a,a.prototype.default_view=n.SegmentView,a.prototype.type="Segment",a.coords([["x0","y0"],["x1","y1"]]),a.mixins(["line"])},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.StepView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sx,p=n.sy;if(this.visuals.line.set_value(t),!((i=e.length)<2)){for(t.beginPath(),t.moveTo(_[0],p[0]),r=o=1,s=i;1<=s?o<s:o>s;r=1<=s?++o:--o){switch(this.model.mode){case"before":d=[_[r-1],p[r]],a=d[0],h=d[1],f=[_[r],p[r]],l=f[0],c=f[1];break;case"after":m=[_[r],p[r-1]],a=m[0],h=m[1],v=[_[r],p[r]],l=v[0],c=v[1];break;case"center":u=(_[r-1]+_[r])/2,g=[u,p[r-1]],a=g[0],h=g[1],y=[u,p[r]],l=y[0],c=y[1]}t.lineTo(a,h),t.lineTo(l,c)}return t.lineTo(_[i-1],p[i-1]),t.stroke();var d,f,m,v,g,y}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Step=s,s.prototype.default_view=n.StepView,s.prototype.type="Step",s.mixins(["line"]),s.define({mode:[o.StepMode,"before"]})},function(t,e,n){var i=t(364),r=t(128),o=t(15),s=t(40);n.TextView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y=n.sx,b=n.sy,x=n._x_offset,w=n._y_offset,k=n._angle,S=n._text;for(m=[],u=0,c=e.length;u<c;u++)if(l=e[u],!isNaN(y[l]+b[l]+x[l]+w[l]+k[l])&&null!=S[l])if(this.visuals.text.doit){if(v=""+S[l],t.save(),t.translate(y[l]+x[l],b[l]+w[l]),t.rotate(k[l]),this.visuals.text.set_vectorize(t,l),-1===v.indexOf("\n"))t.fillText(v,0,0);else{switch(f=v.split("\n"),o=this.visuals.text.cache_select("font",l),a=s.get_text_height(o).height,d=this.visuals.text.text_line_height.value()*a,r=d*f.length,i=this.visuals.text.cache_select("text_baseline",l)){case"top":g=0;break;case"middle":g=-r/2+d/2;break;case"bottom":g=-r+d;break;default:g=0,console.warn("'"+i+"' baseline not supported with multi line text")}for(h=0,_=f.length;h<_;h++)p=f[h],t.fillText(p,0,g),g+=d}m.push(t.restore())}else m.push(void 0);return m},e.prototype.draw_legend_for_index=function(t,e,n,i,r,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",x2,(r+y2)/2),t.restore()},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Text=a,a.prototype.default_view=n.TextView,a.prototype.type="Text",a.mixins(["text"]),a.define({text:[o.StringSpec,{field:"text"}],angle:[o.AngleSpec,0],x_offset:[o.NumberSpec,0],y_offset:[o.NumberSpec,0]})},function(t,e,n){var i=t(364),r=t(105),o=t(15);n.VBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._x.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=this._x[t]-this._width[t]/2,i=this._x[t]+this._width[t]/2,r=Math.max(this._top[t],this._bottom[t]),e=Math.min(this._top[t],this._bottom[t]),[n,i,r,e]},e.prototype._map_data=function(){var t,e,n;for(this.sx=this.renderer.xscale.v_compute(this._x),this.stop=this.renderer.yscale.v_compute(this._top),this.sbottom=this.renderer.yscale.v_compute(this._bottom),this.sleft=[],this.sright=[],this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"),t=e=0,n=this.sx.length;0<=n?e<n:e>n;t=0<=n?++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}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.VBar=s,s.prototype.default_view=n.VBarView,s.prototype.type="VBar",s.coords([["x","bottom"]]),s.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),s.override({bottom:0})},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15),a=t(29);n.WedgeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o<s;o++)r=e[o],isNaN(l[r]+u[r]+h[r]+c[r]+_[r])||(t.beginPath(),t.arc(l[r],u[r],h[r],c[r],_[r],i),t.lineTo(l[r],u[r]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,r),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,r),a.push(t.stroke())):a.push(void 0));return a},e.prototype._hit_point=function(t){var e,n,i,r,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A;for(m=t.sx,y=t.sy,w=this.renderer.xscale.invert(m),T=this.renderer.yscale.invert(y),"data"===this.model.properties.radius.units?(k=w-this.max_radius,S=w+this.max_radius,M=T-this.max_radius,A=T+this.max_radius):(v=m-this.max_radius,g=m+this.max_radius,E=this.renderer.xscale.r_invert(v,g),k=E[0],S=E[1],b=y-this.max_radius,x=y+this.max_radius,z=this.renderer.yscale.r_invert(b,x),M=z[0],A=z[1]),i=[],n=o.validate_bbox_coords([k,S],[M,A]),f=this.index.indices(n),h=0,_=f.length;h<_;h++)u=f[h],d=Math.pow(this.sradius[u],2),C=this.renderer.xscale.r_compute(w,this._x[u]),v=C[0],g=C[1],O=this.renderer.yscale.r_compute(T,this._y[u]),b=O[0],x=O[1],(s=Math.pow(v-g,2)+Math.pow(b-x,2))<=d&&i.push([u,s]);for(r=this.model.properties.direction.value(),l=[],c=0,p=i.length;c<p;c++)N=i[c],u=N[0],s=N[1],e=Math.atan2(y-this.sy[u],m-this.sx[u]),a.angle_between(-e,-this._start_angle[u],-this._end_angle[u],r)&&l.push([u,s]);return o.create_1d_hit_test_result(l);var E,z,C,O,N},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Wedge=l,l.prototype.default_view=n.WedgeView,l.prototype.type="Wedge",l.mixins(["line","fill"]),l.define({direction:[s.Direction,"anticlock"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},function(t,e,n){var i=t(364),r=t(36),o=t(108);n.XYGlyphView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i,o,s;for(n=[],t=e=0,i=this._x.length;0<=i?e<i:e>i;t=0<=i?++e:--e)o=this._x[t],s=this._y[t],!isNaN(o+s)&&isFinite(o+s)&&n.push({minX:o,minY:s,maxX:o,maxY:s,i:t});return new r.RBush(n)},e}(o.GlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.XYGlyph=s,s.prototype.type="XYGlyph",s.prototype.default_view=n.XYGlyphView,s.coords([["x","y"]])},function(t,e,n){var i=t(364),r=t(50),o=t(22),s=t(9);n.GraphHitTestPolicy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.do_selection=function(t,e,n,i){return!1},e.prototype.do_inspection=function(t,e,n,i){return!1},e}(r.Model);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,o;return o=e.node_view,null!==(r=o.glyph.hit_test(t))&&(this._node_selector.update(r,n,i),!this._node_selector.indices.is_empty())},e.prototype.do_selection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.node_view.model.data_source.selected=this._node_selector.indices,e.node_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._node_selector=e.model.get_selection_manager().get_or_create_inspector(e.node_view.model),r=this._do(t,e,n,i),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.node_view.model.data_source.inspect.emit([e.node_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.NodesOnly=a,a.prototype.type="NodesOnly";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f,m,v;if(g=[e.node_view,e.edge_view],m=g[0],l=g[1],null===(u=m.glyph.hit_test(t)))return!1;for(this._node_selector.update(u,n,i),f=function(){var t,e,n,i;for(n=u["1d"].indices,i=[],t=0,e=n.length;t<e;t++)h=n[t],i.push(m.model.data_source.data.index[h]);return i}(),a=l.model.data_source,r=[],h=c=0,v=a.data.start.length;0<=v?c<v:c>v;h=0<=v?++c:--c)(o.contains(f,a.data.start[h])||o.contains(f,a.data.end[h]))&&r.push(h);for(d=s.create_hit_test_result(),_=0,p=r.length;_<p;_++)h=r[_],d["2d"].indices[h]=[0];return this._edge_selector.update(d,n,i),!this._node_selector.indices.is_empty();var g},e.prototype.do_selection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,this._edge_selector=e.edge_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.node_view.model.data_source.selected=this._node_selector.indices,e.edge_view.model.data_source.selected=this._edge_selector.indices,e.node_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.get_or_create_inspector(e.node_view.model),this._edge_selector=e.edge_view.model.data_source.selection_manager.get_or_create_inspector(e.edge_view.model),r=this._do(t,e,n,i),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.edge_view.model.data_source.setv({inspected:this._edge_selector.indices},{silent:!0}),e.node_view.model.data_source.inspect.emit([e.node_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.NodesAndLinkedEdges=l,l.prototype.type="NodesAndLinkedEdges";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f;if(m=[e.node_view,e.edge_view],d=m[0],a=m[1],null===(l=a.glyph.hit_test(t)))return!1;for(this._edge_selector.update(l,n,i),r=function(){var t,e,n,i;for(n=Object.keys(l["2d"].indices),i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(parseInt(u));return i}(),f=[],h=0,c=r.length;h<c;h++)u=r[h],f.push(a.model.data_source.data.start[u]),f.push(a.model.data_source.data.end[u]);return p=function(){var t,e,n,i;for(n=o.uniq(f),i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(d.model.data_source.data.index.indexOf(u));return i}(),_=s.create_hit_test_result(),_["1d"].indices=p,this._node_selector.update(_,n,i),!this._edge_selector.indices.is_empty();var m},e.prototype.do_selection=function(t,e,n,i){var r;return this._edge_selector=e.edge_view.model.data_source.selection_manager.selector,this._node_selector=e.node_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.edge_view.model.data_source.selected=this._edge_selector.indices,e.node_view.model.data_source.selected=this._node_selector.indices,e.edge_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._edge_selector=e.edge_view.model.data_source.selection_manager.get_or_create_inspector(e.edge_view.model),this._node_selector=e.node_view.model.data_source.selection_manager.get_or_create_inspector(e.node_view.model),r=this._do(t,e,n,i),e.edge_view.model.data_source.setv({inspected:this._edge_selector.indices},{silent:!0}),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.edge_view.model.data_source.inspect.emit([e.edge_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.EdgesAndLinkedNodes=u,u.prototype.type="EdgesAndLinkedNodes"},function(t,e,n){var i=t(364);i.__exportStar(t(129),n),i.__exportStar(t(131),n),i.__exportStar(t(132),n)},function(t,e,n){var i=t(364),r=t(50);n.LayoutProvider=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_node_coordinates=function(t){return[[],[]]},e.prototype.get_edge_coordinates=function(t){return[[],[]]},e}(r.Model)},function(t,e,n){var i=t(364),r=t(131),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_node_coordinates=function(t){var e,n,i,r,o,s,a,l;for(s=(u=[[],[]])[0],l=u[1],r=t.data.index,n=0,i=r.length;n<i;n++)e=r[n],o=null!=this.graph_layout[e]?this.graph_layout[e][0]:NaN,a=null!=this.graph_layout[e]?this.graph_layout[e][1]:NaN,s.push(o),l.push(a);return[s,l];var u},e.prototype.get_edge_coordinates=function(t){var e,n,i,r,o,s,a,l,u,h,c;for(h=(_=[[],[]])[0],c=_[1],u=t.data.start,n=t.data.end,i=null!=t.data.xs&&null!=t.data.ys,r=s=0,a=u.length;0<=a?s<a:s>a;r=0<=a?++s:--s)o=null!=this.graph_layout[u[r]]&&null!=this.graph_layout[n[r]],i&&o?(h.push(t.data.xs[r]),c.push(t.data.ys[r])):(o?(p=[this.graph_layout[u[r]],this.graph_layout[n[r]]],l=p[0],e=p[1]):(l=(d=[[NaN,NaN],[NaN,NaN]])[0],e=d[1]),h.push([l[0],e[0]]),c.push([l[1],e[1]]));return[h,c];var _,p,d},e}(r.LayoutProvider);n.StaticLayoutProvider=s,s.prototype.type="StaticLayoutProvider",s.define({graph_layout:[o.Any,{}]})},function(t,e,n){var i=t(364),r=t(163),o=t(165),s=t(15),a=t(42);n.GridView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_range_name=this.model.x_range_name,this._y_range_name=this.model.y_range_name},e.prototype.render=function(){var t;if(!1!==this.model.visible)return(t=this.plot_view.canvas_view.ctx).save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype._draw_regions=function(t){var e,n,i,r,o,s,a,l,u;if(this.visuals.band_fill.doit){for(h=this.model.grid_coords("major",!1),l=h[0],u=h[1],this.visuals.band_fill.set_value(t),e=n=0,i=l.length-1;0<=i?n<i:n>i;e=0<=i?++n:--n)e%2==1&&(c=this.plot_view.map_to_screen(l[e],u[e],this._x_range_name,this._y_range_name),r=c[0],s=c[1],_=this.plot_view.map_to_screen(l[e+1],u[e+1],this._x_range_name,this._y_range_name),o=_[0],a=_[1],t.fillRect(r[0],s[0],o[1]-r[0],a[1]-s[0]),t.fill());var h,c,_}},e.prototype._draw_grids=function(t){var e,n;if(this.visuals.grid_line.doit){return i=this.model.grid_coords("major"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.grid_line,e,n);var i}},e.prototype._draw_minor_grids=function(t){var e,n;if(this.visuals.minor_grid_line.doit){return i=this.model.grid_coords("minor"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.minor_grid_line,e,n);var i}},e.prototype._draw_grid_helper=function(t,e,n,i){var r,o,s,a,l,u,h;for(e.set_value(t),r=o=0,a=n.length;0<=a?o<a:o>a;r=0<=a?++o:--o){for(c=this.plot_view.map_to_screen(n[r],i[r],this._x_range_name,this._y_range_name),u=c[0],h=c[1],t.beginPath(),t.moveTo(Math.round(u[0]),Math.round(h[0])),r=s=1,l=u.length;1<=l?s<l:s>l;r=1<=l?++s:--s)t.lineTo(Math.round(u[r]),Math.round(h[r]));t.stroke()}var c},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype.computed_bounds=function(){var t,e,n,i,r;return o=this.ranges(),e=o[0],o[1],r=this.bounds,n=[e.min,e.max],a.isArray(r)?(i=Math.min(r[0],r[1]),t=Math.max(r[0],r[1]),i<n[0]?i=n[0]:i>n[1]&&(i=null),t>n[1]?t=n[1]:t<n[0]&&(t=null)):(i=n[0],t=n[1]),[i,t];var o},e.prototype.grid_coords=function(t,e){void 0===e&&(e=!0);var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S;for(h=this.dimension,_=(h+1)%2,T=this.ranges(),y=T[0],s=T[1],M=this.computed_bounds(),w=M[0],u=M[1],S=Math.min(w,u),u=Math.max(w,u),w=S,k=this.ticker.get_ticks(w,u,y,s.min,{})[t],v=y.min,m=y.max,r=s.min,i=s.max,o=[[],[]],c=p=0,b=k.length;0<=b?p<b:p>b;c=0<=b?++p:--p)if(k[c]!==v&&k[c]!==m||!e){for(a=[],l=[],g=d=0,x=n=2;0<=x?d<x:d>x;g=0<=x?++d:--d)f=r+(i-r)/(n-1)*g,a.push(k[c]),l.push(f);o[h].push(a),o[_].push(l)}return o;var T,M},e}(r.GuideRenderer);n.Grid=l,l.prototype.default_view=n.GridView,l.prototype.type="Grid",l.mixins(["line:grid_","line:minor_grid_","fill:band_"]),l.define({bounds:[s.Any,"auto"],dimension:[s.Number,0],ticker:[s.Instance],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),l.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},function(t,e,n){var i=t(133);n.Grid=i.Grid},function(t,e,n){var i=t(364);i.__exportStar(t(57),n),i.__exportStar(t(73),n),i.__exportStar(t(77),n),i.__exportStar(t(81),n),i.__exportStar(t(83),n),i.__exportStar(t(89),n),i.__exportStar(t(95),n),i.__exportStar(t(113),n),i.__exportStar(t(130),n),i.__exportStar(t(134),n),i.__exportStar(t(138),n),i.__exportStar(t(145),n),i.__exportStar(t(238),n),i.__exportStar(t(148),n),i.__exportStar(t(152),n),i.__exportStar(t(158),n),i.__exportStar(t(164),n),i.__exportStar(t(167),n),i.__exportStar(t(177),n),i.__exportStar(t(187),n),i.__exportStar(t(199),n),i.__exportStar(t(226),n)},function(t,e,n){var i=t(364),r=[].indexOf,o=t(13),s=t(15),a=t(22),l=t(30),u=t(139),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.get_height=function(){var t,e;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._height.value}),this.model._horizontal?a.max(t):a.sum(t)},e.prototype.get_width=function(){var t,e;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._width.value}),this.model._horizontal?a.sum(t):a.max(t)},e}(u.LayoutDOMView);n.BoxView=h,h.prototype.className="bk-grid";var c=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._child_equal_size_width=new o.Variable(i.toString()+".child_equal_size_width"),i._child_equal_size_height=new o.Variable(i.toString()+".child_equal_size_height"),i._box_equal_size_top=new o.Variable(i.toString()+".box_equal_size_top"),i._box_equal_size_bottom=new o.Variable(i.toString()+".box_equal_size_bottom"),i._box_equal_size_left=new o.Variable(i.toString()+".box_equal_size_left"),i._box_equal_size_right=new o.Variable(i.toString()+".box_equal_size_right"),i._box_cell_align_top=new o.Variable(i.toString()+".box_cell_align_top"),i._box_cell_align_bottom=new o.Variable(i.toString()+".box_cell_align_bottom"),i._box_cell_align_left=new o.Variable(i.toString()+".box_cell_align_left"),i._box_cell_align_right=new o.Variable(i.toString()+".box_cell_align_right"),i}return i.__extends(e,t),e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return l.extend({},t.prototype.get_constrained_variables.call(this),{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 e,n,i,r,s,a,l,u,h,c,_,p,d;if(r=t.prototype.get_constraints.call(this),e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.push.apply(r,t)},0===(i=this.get_layoutable_children()).length)return r;for(a=0,h=i.length;a<h;a++)n=i[a],d=n.get_constrained_variables(),_=this._child_rect(d),this._horizontal?null!=d.height&&e(o.EQ(_.height,[-1,this._height])):null!=d.width&&e(o.EQ(_.width,[-1,this._width])),this._horizontal?null!=d.box_equal_size_left&&null!=d.box_equal_size_right&&null!=d.width&&e(o.EQ([-1,d.box_equal_size_left],[-1,d.box_equal_size_right],d.width,this._child_equal_size_width)):null!=d.box_equal_size_top&&null!=d.box_equal_size_bottom&&null!=d.height&&e(o.EQ([-1,d.box_equal_size_top],[-1,d.box_equal_size_bottom],d.height,this._child_equal_size_height));for(u=this._info(i[0].get_constrained_variables()),e(o.EQ(u.span.start,0)),s=l=1,p=i.length;1<=p?l<p:l>p;s=1<=p?++l:--l)c=this._info(i[s].get_constrained_variables()),u.span.size&&e(o.EQ(u.span.start,u.span.size,[-1,c.span.start])),e(o.WEAK_EQ(u.whitespace.after,c.whitespace.before,0-this.spacing)),e(o.GE(u.whitespace.after,c.whitespace.before,0-this.spacing)),u=c;return this._horizontal?null!=d.width&&e(o.EQ(u.span.start,u.span.size,[-1,this._width])):null!=d.height&&e(o.EQ(u.span.start,u.span.size,[-1,this._height])),r=r.concat(this._align_outer_edges_constraints(!0),this._align_outer_edges_constraints(!1),this._align_inner_cell_edges_constraints(),this._box_equal_size_bounds(!0),this._box_equal_size_bounds(!1),this._box_cell_align_bounds(!0),this._box_cell_align_bounds(!1),this._box_whitespace(!0),this._box_whitespace(!1))},e.prototype._child_rect=function(t){return{x:t.origin_x,y:t.origin_y,width:t.width,height:t.height}},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,n;return n=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:n}},e.prototype._flatten_cell_edge_variables=function(t){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;for(x=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,n=t!==this._horizontal,l=this.get_layoutable_children(),r=l.length,h={},o=0,c=0,f=l.length;c<f;c++){for(a=l[c],s=a instanceof e?a._flatten_cell_edge_variables(t):{},i=a.get_constrained_variables(),_=0,m=x.length;_<m;_++)(v=x[_])in i&&(s[v]=[i[v]]);for(p in s)w=s[p],n?(y=p.split(" "),d=y[0],b=y.length>1?y[1]:"",u=this._horizontal?"row":"col",g=d+" "+u+"-"+r+"-"+o+"-"+b):g=p,h[g]=g in h?h[g].concat(w):w;o+=1}return h},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,n,i,s,a,l,u;if(t=[],null!=this.document&&r.call(this.document.roots(),this)>=0){e=this._flatten_cell_edge_variables(this._horizontal);for(s in e)if((u=e[s]).length>1)for(a=u[0],n=i=1,l=u.length;1<=l?i<l:i>l;n=1<=l?++i:--i)t.push(o.EQ(u[n],[-1,a]))}return t},e.prototype._find_edge_leaves=function(t){var n,i,r,o,s,a,l,u;if(r=this.get_layoutable_children(),a=[[],[]],r.length>0)if(this._horizontal===t)u=r[0],o=r[r.length-1],u instanceof e?a[0]=a[0].concat(u._find_edge_leaves(t)[0]):a[0].push(u),o instanceof e?a[1]=a[1].concat(o._find_edge_leaves(t)[1]):a[1].push(o);else for(s=0,l=r.length;s<l;s++)(n=r[s])instanceof e?(i=n._find_edge_leaves(t),a[0]=a[0].concat(i[0]),a[1]=a[1].concat(i[1])):(a[0].push(n),a[1].push(n));return a},e.prototype._align_outer_edges_constraints=function(t){var e,n,i,r,s,a,l,u,h;return c=this._find_edge_leaves(t),u=c[0],r=c[1],t?(h="on_edge_align_left",s="on_edge_align_right"):(h="on_edge_align_top",s="on_edge_align_bottom"),n=function(t,e){var n,i,r,o,s;for(n=[],i=0,o=t.length;i<o;i++)r=t[i],s=r.get_constrained_variables(),e in s&&n.push(s[e]);return n},l=n(u,h),i=n(r,s),a=[],(e=function(t){var e,n,i,r,s;if(t.length>1){for(n=t[0],i=r=1,s=t.length;1<=s?r<s:r>s;i=1<=s?++r:--r)e=t[i],a.push(o.EQ([-1,n],e));return null}})(l),e(i),a;var c},e.prototype._box_insets_from_child_insets=function(t,e,n,i){var r,s,a,l,u,h,c,_;return p=this._find_edge_leaves(t),c=p[0],s=p[1],t?(_=e+"_left",a=e+"_right",u=this[n+"_left"],l=this[n+"_right"]):(_=e+"_top",a=e+"_bottom",u=this[n+"_top"],l=this[n+"_bottom"]),h=[],(r=function(t,e,n){var r,s,a,l;for([],r=0,a=e.length;r<a;r++)s=e[r],l=s.get_constrained_variables(),n in l&&(i?h.push(o.GE([-1,t],l[n])):h.push(o.EQ([-1,t],l[n])));return null})(u,c,_),r(l,s,a),h;var 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}(u.LayoutDOM);n.Box=c,c.prototype.default_view=h,c.define({children:[s.Array,[]]}),c.internal({spacing:[s.Number,6]}),c._left_right_inner_cell_edge_variables=["box_cell_align_left","box_cell_align_right"],c._top_bottom_inner_cell_edge_variables=["box_cell_align_top","box_cell_align_bottom"]},function(t,e,n){var i=t(364),r=t(136),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.BoxView);n.ColumnView=o,o.prototype.className="bk-grid-column";var s=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._horizontal=!1,i}return i.__extends(e,t),e}(r.Box);n.Column=s,s.prototype.type="Column",s.prototype.default_view=o},function(t,e,n){var i=t(136);n.Box=i.Box;var r=t(137);n.Column=r.Column;var o=t(139);n.LayoutDOM=o.LayoutDOM;var s=t(140);n.Row=s.Row;var a=t(141);n.Spacer=a.Spacer;var l=t(142);n.WidgetBox=l.WidgetBox},function(t,e,n){var i=t(364),r=t(50),o=t(5),s=t(15),a=t(11),l=t(13),u=t(4),h=t(6),c=t(14);n.LayoutDOMView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.is_root&&(this._solver=new l.Solver),this.child_views={},this.build_child_views()},e.prototype.remove=function(){var e,n;n=this.child_views;for(e in n)n[e].remove();return this.child_views={},t.prototype.remove.call(this)},e.prototype.has_finished=function(){var e,n;if(!t.prototype.has_finished.call(this))return!1;n=this.child_views;for(e in n)if(!n[e].has_finished())return!1;return!0},e.prototype.notify_finished=function(){return this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document?(this._idle_notified=!0,this.model.document.notify_idle(this.model)):void 0:t.prototype.notify_finished.call(this)},e.prototype._calc_width_height=function(){var t,e,n;for(e=this.el;;){if(null==(e=e.parentNode)){c.logger.warn("detached element"),n=t=null;break}if(i=e.getBoundingClientRect(),n=i.width,0!==(t=i.height))break}return[n,t];var i},e.prototype._init_solver=function(){var t,e,n,i,r,o,s,a,u;for(this._root_width=new l.Variable(this.toString()+".root_width"),this._root_height=new l.Variable(this.toString()+".root_height"),this._solver.add_edit_variable(this._root_width),this._solver.add_edit_variable(this._root_height),i=this.model.get_all_editables(),r=0,s=i.length;r<s;r++)n=i[r],this._solver.add_edit_variable(n,l.Strength.strong);for(e=this.model.get_all_constraints(),o=0,a=e.length;o<a;o++)t=e[o],this._solver.add_constraint(t);return null!=(u=this.model.get_constrained_variables()).width&&this._solver.add_constraint(l.EQ(u.width,this._root_width)),null!=u.height&&this._solver.add_constraint(l.EQ(u.height,this._root_height)),this._solver.update_variables(),this._solver_inited=!0},e.prototype._suggest_dims=function(t,e){var n;if(null!=(n=this.model.get_constrained_variables()).width||null!=n.height)return null!==t&&null!==e||(i=this._calc_width_height(),t=i[0],e=i[1]),null!=n.width&&null!=t&&this._solver.suggest_value(this._root_width,t),null!=n.height&&null!=e&&this._solver.suggest_value(this._root_height,e),this._solver.update_variables();var i},e.prototype.resize=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=null),this.is_root?this._do_layout(!1,t,e):this.root.resize(t,e)},e.prototype.partial_layout=function(){return this.is_root?this._do_layout(!1):this.root.partial_layout()},e.prototype.layout=function(t){return void 0===t&&(t=!0),this.is_root?this._do_layout(!0):this.root.layout()},e.prototype._do_layout=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this._solver_inited&&!t||(this._solver.clear(),this._init_solver()),this._suggest_dims(e,n),this._layout(),this._layout(),this._layout(!0),this.notify_finished()},e.prototype._layout=function(t){void 0===t&&(t=!1);var e,n,i,r,o;for(o=this.model.get_layoutable_children(),i=0,r=o.length;i<r;i++)e=o[i],null!=(n=this.child_views[e.id])._layout&&n._layout(t);if(this.render(),t)return this._has_finished=!0},e.prototype.rebuild_child_views=function(){return this.solver.clear(),this.build_child_views(),this.layout()},e.prototype.build_child_views=function(){var t,e,n,i,r,s;for(n=this.model.get_layoutable_children(),u.build_views(this.child_views,n,{parent:this}),o.empty(this.el),s=[],i=0,r=n.length;i<r;i++)t=n[i],e=this.child_views[t.id],s.push(this.el.appendChild(e.el));return s},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.is_root&&window.addEventListener("resize",function(){return e.resize()}),this.connect(this.model.properties.sizing_mode.change,function(){return e.layout()})},e.prototype._render_classes=function(){var t,e,n,i,r;if(this.el.className="",null!=this.className&&this.el.classList.add(this.className),this.el.classList.add("bk-layout-"+this.model.sizing_mode),null!=this.model.css_classes){for(i=this.model.css_classes,r=[],e=0,n=i.length;e<n;e++)t=i[e],r.push(this.el.classList.add(t));return r}},e.prototype.render=function(){var t,e;switch(this._render_classes(),this.model.sizing_mode){case"fixed":null!=this.model.width?e=this.model.width:(e=this.get_width(),this.model.setv({width:e},{silent:!0})),null!=this.model.height?t=this.model.height:(t=this.get_height(),this.model.setv({height:t},{silent:!0})),this.solver.suggest_value(this.model._width,e),this.solver.suggest_value(this.model._height,t);break;case"scale_width":t=this.get_height(),this.solver.suggest_value(this.model._height,t);break;case"scale_height":e=this.get_width(),this.solver.suggest_value(this.model._width,e);break;case"scale_both":n=this.get_width_height(),e=n[0],t=n[1],this.solver.suggest_value(this.model._width,e),this.solver.suggest_value(this.model._height,t)}return this.solver.update_variables(),this.position();var n},e.prototype.position=function(){switch(this.model.sizing_mode){case"fixed":case"scale_width":case"scale_height":this.el.style.position="relative",this.el.style.left="",this.el.style.top="";break;case"scale_both":case"stretch_both":this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px"}return this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"},e.prototype.get_height=function(){throw new Error("not implemented")},e.prototype.get_width=function(){throw new Error("not implemented")},e.prototype.get_width_height=function(){var t,e,n,i,r,o,s,a,l;return s=this.el.parentNode.clientHeight,a=this.el.parentNode.clientWidth,t=this.model.get_aspect_ratio(),r=a,n=a/t,o=s*t,i=s,r<o?(l=r,e=n):(l=o,e=i),[l,e]},e}(h.DOMView);var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._width=new l.Variable(this.toString()+".width"),this._height=new l.Variable(this.toString()+".height"),this._left=new l.Variable(this.toString()+".left"),this._right=new l.Variable(this.toString()+".right"),this._top=new l.Variable(this.toString()+".top"),this._bottom=new l.Variable(this.toString()+".bottom"),this._dom_top=new l.Variable(this.toString()+".dom_top"),this._dom_left=new l.Variable(this.toString()+".dom_left"),this._width_minus_right=new l.Variable(this.toString()+".width_minus_right"),this._height_minus_bottom=new l.Variable(this.toString()+".height_minus_bottom"),this._whitespace_top=new l.Variable(this.toString()+".whitespace_top"),this._whitespace_bottom=new l.Variable(this.toString()+".whitespace_bottom"),this._whitespace_left=new l.Variable(this.toString()+".whitespace_left"),this._whitespace_right=new l.Variable(this.toString()+".whitespace_right")},e.prototype.dump_layout=function(){var t,n,i;for(t={},i=[this];i.length>0;)(n=i.shift())instanceof e&&i.push.apply(i,n.get_layoutable_children()),t[n.toString()]=n.layout_bbox;return console.table(t)},e.prototype.get_all_constraints=function(){var t,e,n,i,r;for(e=this.get_constraints(),r=this.get_layoutable_children(),n=0,i=r.length;n<i;n++)t=r[n],e=t instanceof a.LayoutCanvas?e.concat(t.get_constraints()):e.concat(t.get_all_constraints());return e},e.prototype.get_all_editables=function(){var t,e,n,i,r;for(e=this.get_editables(),r=this.get_layoutable_children(),n=0,i=r.length;n<i;n++)t=r[n],e=t instanceof a.LayoutCanvas?e.concat(t.get_editables()):e.concat(t.get_all_editables());return e},e.prototype.get_constraints=function(){return[l.GE(this._dom_left),l.GE(this._dom_top),l.GE(this._left),l.GE(this._width,[-1,this._right]),l.GE(this._top),l.GE(this._height,[-1,this._bottom]),l.EQ(this._width_minus_right,[-1,this._width],this._right),l.EQ(this._height_minus_bottom,[-1,this._height],this._bottom)]},e.prototype.get_layoutable_children=function(){return[]},e.prototype.get_editables=function(){switch(this.sizing_mode){case"fixed":return[this._height,this._width];case"scale_width":return[this._height];case"scale_height":return[this._width];case"scale_both":return[this._width,this._height];default:return[]}},e.prototype.get_constrained_variables=function(){var t;switch(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},this.sizing_mode){case"stretch_both":t.width=this._width,t.height=this._height;break;case"scale_width":t.width=this._width;break;case"scale_height":t.height=this._height}return t},e.prototype.get_aspect_ratio=function(){return this.width/this.height},e}(r.Model);n.LayoutDOM=_,_.prototype.type="LayoutDOM",_.getters({layout_bbox:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,dom_top:this._dom_top.value,dom_left:this._dom_left.value}}}),_.define({height:[s.Number],width:[s.Number],disabled:[s.Bool,!1],sizing_mode:[s.SizingMode,"fixed"],css_classes:[s.Array,[]]})},function(t,e,n){var i=t(364),r=t(136),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.BoxView);n.RowView=o,o.prototype.className="bk-grid-row";var s=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._horizontal=!0,i}return i.__extends(e,t),e}(r.Box);n.Row=s,s.prototype.type="Row",s.prototype.default_view=o},function(t,e,n){var i=t(364),r=t(139),o=t(30),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){if(t.prototype.render.call(this),"fixed"===this.sizing_mode)return this.el.style.width=this.model.width+"px",this.el.style.height=this.model.height+"px"},e.prototype.get_height=function(){return 1},e}(r.LayoutDOMView);n.SpacerView=s,s.prototype.className="bk-spacer-box";var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_constrained_variables=function(){return o.extend({},t.prototype.get_constrained_variables.call(this),{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}(r.LayoutDOM);n.Spacer=a,a.prototype.type="Spacer",a.prototype.default_view=s},function(t,e,n){var i=t(364),r={}.hasOwnProperty,o=t(14),s=t(15),a=t(30),l=t(139),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.render=function(){var t,e,n;return this._render_classes(),"fixed"!==this.model.sizing_mode&&"scale_height"!==this.model.sizing_mode||(n=this.get_width(),this.model._width.value!==n&&this.solver.suggest_value(this.model._width,n)),"fixed"!==this.model.sizing_mode&&"scale_width"!==this.model.sizing_mode||(e=this.get_height(),this.model._height.value!==e&&this.solver.suggest_value(this.model._height,e)),this.solver.update_variables(),"stretch_both"===this.model.sizing_mode?(this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"):(t=this.model._width.value-20>0?this.model._width.value-20+"px":"100%",this.el.style.width=t)},e.prototype.get_height=function(){var t,e,n,i,o,s,a,l;n=0,a=this.child_views;for(i in a)r.call(a,i)&&(t=a[i],e=t.el,l=getComputedStyle(e),s=parseInt(l.marginTop)||0,o=parseInt(l.marginBottom)||0,n+=e.offsetHeight+s+o);return n+20},e.prototype.get_width=function(){var t,e,n,i,o;if(null!=this.model.width)return this.model.width;o=this.el.scrollWidth+20,i=this.child_views;for(n in i)r.call(i,n)&&(t=i[n],(e=t.el.scrollWidth)>o&&(o=e));return o},e}(l.LayoutDOMView);n.WidgetBoxView=u,u.prototype.className="bk-widget-box";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),"fixed"===this.sizing_mode&&null===this.width&&(this.width=300,o.logger.info("WidgetBox mode is fixed, but no width specified. Using default of 300.")),"scale_height"===this.sizing_mode)return o.logger.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_constrained_variables=function(){var e;return e=a.extend({},t.prototype.get_constrained_variables.call(this),{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&&(e.box_equal_size_left=this._left,e.box_equal_size_right=this._width_minus_right),e},e.prototype.get_layoutable_children=function(){return this.children},e}(l.LayoutDOM);n.WidgetBox=h,h.prototype.type="WidgetBox",h.prototype.default_view=u,h.define({children:[s.Array,[]]})},function(t,e,n){var i,r=t(364),o=t(144),s=t(15),a=t(22),l=t(42);i=function(t,e){var n,i,r;if(t.length!==e.length)return!1;for(n=i=0,r=t.length;0<=r?i<r:i>r;n=0<=r?++i:--i)if(t[n]!==e[n])return!1;return!0};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._get_values=function(t,e){var n,r,o,s,u,h;for(h=[],o=0,u=t.length;o<u;o++)r=t[o],l.isString(r)?s=this.factors.indexOf(r):(null!=this.start?r=null!=this.end?r.slice(this.start,this.end):r.slice(this.start):null!=this.end&&(r=r.slice(0,this.end)),s=1===r.length?this.factors.indexOf(r[0]):a.findIndex(this.factors,function(t){return i(t,r)})),n=s<0||s>=e.length?this.nan_color:e[s],h.push(n);return h},e}(o.ColorMapper);n.CategoricalColorMapper=u,u.prototype.type="CategoricalColorMapper",u.define({factors:[s.Array],start:[s.Number,0],end:[s.Number]})},function(t,e,n){var i=t(364),r=t(15),o=t(243),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._little_endian=this._is_little_endian(),this._palette=this._build_palette(this.palette),this.connect(this.change,function(){return this._palette=this._build_palette(this.palette)})},e.prototype.v_map_screen=function(t,e){void 0===e&&(e=!1);var n,i,r,o,s,a,l,u,h,c;if(c=this._get_values(t,this._palette,e),n=new ArrayBuffer(4*t.length),this._little_endian)for(i=new Uint8Array(n),r=s=0,l=t.length;0<=l?s<l:s>l;r=0<=l?++s:--s)h=c[r],i[o=4*r]=Math.floor(h/4278190080*255),i[o+1]=(16711680&h)>>16,i[o+2]=(65280&h)>>8,i[o+3]=255&h;else for(i=new Uint32Array(n),r=a=0,u=t.length;0<=u?a<u:a>u;r=0<=u?++a:--a)h=c[r],i[r]=h<<8|255;return n},e.prototype.compute=function(t){return null},e.prototype.v_compute=function(t){return this._get_values(t,this.palette)},e.prototype._get_values=function(t,e,n){return void 0===n&&(n=!1),[]},e.prototype._is_little_endian=function(){var t,e,n,i;return t=new ArrayBuffer(4),n=new Uint8Array(t),e=new Uint32Array(t),e[1]=168496141,i=!0,10===n[4]&&11===n[5]&&12===n[6]&&13===n[7]&&(i=!1),i},e.prototype._build_palette=function(t){var e,n,i,r,o;for(r=new Uint32Array(t.length),e=function(t){return s.isNumber(t)?t:(9!==t.length&&(t+="ff"),parseInt(t.slice(1),16))},n=i=0,o=t.length;0<=o?i<o:i>o;n=0<=o?++i:--i)r[n]=e(t[n]);return r},e}(o.Transform);n.ColorMapper=a,a.prototype.type="ColorMapper",a.define({palette:[r.Any],nan_color:[r.Color,"gray"]})},function(t,e,n){var i=t(143);n.CategoricalColorMapper=i.CategoricalColorMapper;var r=t(144);n.ColorMapper=r.ColorMapper;var o=t(146);n.LinearColorMapper=o.LinearColorMapper;var s=t(147);n.LogColorMapper=s.LogColorMapper},function(t,e,n){var i=t(364),r=t(15),o=t(26),s=t(22),a=t(144),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([o.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([o.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([o.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y;for(h=null!=(v=this.low)?v:s.min(t),r=null!=(g=this.high)?g:s.max(t),_=e.length-1,y=[],p=n?this._nan_color:this.nan_color,c=n?this._low_color:this.low_color,o=n?this._high_color:this.high_color,d=1/(r-h),m=1/e.length,a=0,u=t.length;a<u;a++)i=t[a],isNaN(i)?y.push(p):i!==r?(f=(i-h)*d,(l=Math.floor(f/m))<0?null!=this.low_color?y.push(c):y.push(e[0]):l>_?null!=this.high_color?y.push(o):y.push(e[_]):y.push(e[l])):y.push(e[_]);return y},e}(a.ColorMapper);n.LinearColorMapper=l,l.prototype.type="LinearColorMapper",l.define({high:[r.Number],low:[r.Number],high_color:[r.Color],low_color:[r.Color]})},function(t,e,n){var i,r,o=t(364),s=t(15),a=t(26),l=t(22),u=t(144);i=null!=(r=Math.log1p)?r:function(t){return Math.log(1+t)};var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([a.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([a.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([a.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var r,o,s,a,u,h,c,_,p,d,f,m,v,g,y,b;for(f=e.length,_=null!=(v=this.low)?v:l.min(t),o=null!=(g=this.high)?g:l.max(t),y=f/(i(o)-i(_)),d=e.length-1,b=[],m=n?this._nan_color:this.nan_color,s=n?this._high_color:this.high_color,p=n?this._low_color:this.low_color,a=0,h=t.length;a<h;a++)r=t[a],isNaN(r)?b.push(m):r>o?null!=this.high_color?b.push(s):b.push(e[d]):r!==o?r<_?null!=this.low_color?b.push(p):b.push(e[0]):(c=i(r)-i(_),(u=Math.floor(c*y))>d&&(u=d),b.push(e[u])):b.push(e[d]);return b},e}(u.ColorMapper);n.LogColorMapper=h,h.prototype.type="LogColorMapper",h.define({high:[s.Number],low:[s.Number],high_color:[s.Color],low_color:[s.Color]})},function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t(364),w=t(149);i=Math.sqrt(3),l=function(t,e){return t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)},o=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 n,r;return r=e*i,n=r/3,t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-r),t.closePath()},u=function(t,e,n,i,r,s,a){var u;u=.65*r,o(t,r),l(t,u),s.doit&&(s.set_vectorize(t,e),t.stroke())},h=function(t,e,n,i,r,s,a){t.arc(0,0,r,0,2*Math.PI,!1),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},c=function(t,e,n,i,r,o,s){t.arc(0,0,r,0,2*Math.PI,!1),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},_=function(t,e,n,i,r,s,a){o(t,r),s.doit&&(s.set_vectorize(t,e),t.stroke())},p=function(t,e,n,i,r,o,a){s(t,r),a.doit&&(a.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},d=function(t,e,n,i,r,a,l){s(t,r),l.doit&&(l.set_vectorize(t,e),t.fill()),a.doit&&(a.set_vectorize(t,e),o(t,r),t.stroke())},f=function(t,e,n,i,r,o,s){t.rotate(Math.PI),a(t,r),t.rotate(-Math.PI),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},m=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},v=function(t,e,n,i,r,s,a){var l;l=2*r,t.rect(-r,-r,l,l),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},g=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},y=function(t,e,n,i,r,o,s){a(t,r),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},b=function(t,e,n,i,r,o,s){l(t,r),o.doit&&(o.set_vectorize(t,e),t.stroke())},r=function(t,e){var n;return n=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.MarkerView);return t.prototype._render_one=e,t}(),function(){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.Marker);return e.prototype.default_view=n,e.prototype.type=t,e}()},n.Asterisk=r("Asterisk",u),n.CircleCross=r("CircleCross",h),n.CircleX=r("CircleX",c),n.Cross=r("Cross",_),n.Diamond=r("Diamond",p),n.DiamondCross=r("DiamondCross",d),n.InvertedTriangle=r("InvertedTriangle",f),n.Square=r("Square",m),n.SquareCross=r("SquareCross",v),n.SquareX=r("SquareX",g),n.Triangle=r("Triangle",y),n.X=r("X",b)},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15);n.MarkerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c;return l=[o],h={},h[o]=(e+n)/2,c={},c[o]=(i+r)/2,u={},u[o]=.4*Math.min(Math.abs(n-e),Math.abs(r-i)),s={},s[o]=this._angle[o],a={sx:h,sy:c,_size:u,_angle:s},this._render(t,l,a)},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._size,c=n._angle;for(a=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(l[i]+u[i]+h[i]+c[i])||(s=h[i]/2,t.beginPath(),t.translate(l[i],u[i]),c[i]&&t.rotate(c[i]),this._render_one(t,i,l[i],u[i],s,this.visuals.line,this.visuals.fill),c[i]&&t.rotate(-c[i]),a.push(t.translate(-l[i],-u[i])));return a},e.prototype._mask_data=function(t){var e,n,i,r,s,a,l,u,h,c,_;return n=this.renderer.plot_view.frame.bbox.h_range,i=n.start-this.max_size,r=n.end+this.max_size,p=this.renderer.xscale.r_invert(i,r),u=p[0],h=p[1],l=this.renderer.plot_view.frame.bbox.v_range,s=l.start-this.max_size,a=l.end+this.max_size,d=this.renderer.yscale.r_invert(s,a),c=d[0],_=d[1],e=o.validate_bbox_coords([u,h],[c,_]),this.index.indices(e);var p,d},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y;for(h=t.sx,p=t.sy,c=h-this.max_size,_=h+this.max_size,b=this.renderer.xscale.r_invert(c,_),m=b[0],v=b[1],d=p-this.max_size,f=p+this.max_size,x=this.renderer.yscale.r_invert(d,f),g=x[0],y=x[1],e=o.validate_bbox_coords([m,v],[g,y]),n=this.index.indices(e),r=[],a=0,l=n.length;a<l;a++)s=n[a],u=this._size[s]/2,i=Math.abs(this.sx[s]-h)+Math.abs(this.sy[s]-p),Math.abs(this.sx[s]-h)<=u&&Math.abs(this.sy[s]-p)<=u&&r.push([s,i]);return o.create_1d_hit_test_result(r);var b,x},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y;return h=t.sx,p=t.sy,b=this.bounds(),s=b.minX,a=b.minY,i=b.maxX,r=b.maxY,u=o.create_hit_test_result(),"h"===t.direction?(g=a,y=r,l=this.max_size/2,c=h-l,_=h+l,x=this.renderer.xscale.r_invert(c,_),m=x[0],v=x[1]):(m=s,v=i,l=this.max_size/2,d=p-l,f=p+l,w=this.renderer.yscale.r_invert(d,f),g=w[0],y=w[1]),e=o.validate_bbox_coords([m,v],[g,y]),n=this.index.indices(e),u["1d"].indices=n,u;var b,x,w},e.prototype._hit_rect=function(t){var e,n,i,r,s,a,l,u,h,c;return i=t.sx0,r=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,r),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=o.validate_bbox_coords([l,u],[h,c]),n=o.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},e.prototype._hit_poly=function(t){var e,n,i,r,s,a,l,u,h,c;for(h=t.sx,c=t.sy,e=function(){u=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?s<a:s>a;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l["1d"].indices=n,l},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Marker=a,a.mixins(["line","fill"]),a.define({size:[s.DistanceSpec,{units:"screen",value:4}],angle:[s.AngleSpec,0]})},function(t,e,n){var i=t(364),r=t(14),o=t(151),s=t(153),a=t(15),l=t(50),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Model);n.MapOptions=u,u.prototype.type="MapOptions",u.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u);n.GMapOptions=h,h.prototype.type="GMapOptions",h.define({map_type:[a.String,"roadmap"],scale_control:[a.Bool,!1],styles:[a.String]}),n.GMapPlotView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.PlotView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),!this.api_key)return r.logger.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.")},e.prototype._init_plot_canvas=function(){return new o.GMapPlotCanvas({plot:this})},e}(s.Plot);n.GMapPlot=c,c.prototype.type="GMapPlot",c.prototype.default_view=n.GMapPlotView,c.define({map_options:[a.Instance],api_key:[a.String]})},function(t,e,n){var i,r,o=t(364),s=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},a=t(31),l=t(154),u=t(20);i=new u.Signal(this,"gmaps_ready"),r=function(t){var e;return window._bokeh_gmaps_callback=function(){return i.emit()},e=document.createElement("script"),e.type="text/javascript",e.src="https://maps.googleapis.com/maps/api/js?key="+t+"&callback=_bokeh_gmaps_callback",document.body.appendChild(e)},n.GMapPlotCanvasView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._get_latlon_bounds=e._get_latlon_bounds.bind(e),e._get_projected_bounds=e._get_projected_bounds.bind(e),e._set_bokeh_ranges=e._set_bokeh_ranges.bind(e),e}return o.__extends(e,t),e.prototype.initialize=function(e){var n,o,s=this;return this.pause(),t.prototype.initialize.call(this,e),this._tiles_loaded=!1,this.zoom_count=0,n=this.model.plot.map_options,this.initial_zoom=n.zoom,this.initial_lat=n.lat,this.initial_lng=n.lng,this.canvas_view.map_el.style.position="absolute",null==(null!=(o=window.google)?o.maps:void 0)&&(null==window._bokeh_gmaps_callback&&r(this.model.plot.api_key),i.connect(function(){return s.request_render()})),this.unpause()},e.prototype.update_range=function(e){var n,i,r,o,s;if(null==e)this.model.plot.map_options,this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),t.prototype.update_range.call(this,null);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(e.sdx,e.sdy),t.prototype.update_range.call(this,e);else if(null!=e.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),t.prototype.update_range.call(this,e),s=e.factor<0?-1:1,i=this.map.getZoom(),(n=i+s)>=2&&(this.map.setZoom(n),a=this._get_projected_bounds(),o=a[0],r=a[1],a[2],a[3],r-o<0&&this.map.setZoom(i)),this.unpause()}return this._set_bokeh_ranges();var a},e.prototype._build_map=function(){var t,e,n,i=this;return e=window.google.maps,this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID},n=this.model.plot.map_options,t={center:new e.LatLng(n.lat,n.lng),zoom:n.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[n.map_type],scaleControl:n.scale_control},null!=n.styles&&(t.styles=JSON.parse(n.styles)),this.map=new e.Map(this.canvas_view.map_el,t),e.event.addListener(this.map,"idle",function(){return i._set_bokeh_ranges()}),e.event.addListener(this.map,"bounds_changed",function(){return i._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,"tilesloaded",function(){return i._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return i._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return i._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return i._update_center("lat")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return i._update_center("lng")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return i._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return i._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return i._update_scale_control()})},e.prototype._render_finished=function(){return this._tiles_loaded=!0,this.notify_finished()},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&!0===this._tiles_loaded},e.prototype._get_latlon_bounds=function(){var t,n,i,r,o,a,l;return s(this,e),n=this.map.getBounds(),i=n.getNorthEast(),t=n.getSouthWest(),o=t.lng(),r=i.lng(),l=t.lat(),a=i.lat(),[o,r,l,a]},e.prototype._get_projected_bounds=function(){var t,n,i,r,o,l,u,h;return s(this,e),c=this._get_latlon_bounds(),l=c[0],o=c[1],h=c[2],u=c[3],_=a.proj4(a.mercator,[l,h]),n=_[0],r=_[1],p=a.proj4(a.mercator,[o,u]),t=p[0],i=p[1],[n,t,r,i];var c,_,p},e.prototype._set_bokeh_ranges=function(){var t,n,i,r;return s(this,e),o=this._get_projected_bounds(),n=o[0],t=o[1],r=o[2],i=o[3],this.frame.x_range.setv({start:n,end:t}),this.frame.y_range.setv({start:r,end:i});var o},e.prototype._update_center=function(t){var e;return e=this.map.getCenter().toJSON(),e[t]=this.model.plot.map_options[t],this.map.setCenter(e),this._set_bokeh_ranges()},e.prototype._update_map_type=function(){return window.google.maps,this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},e.prototype._update_scale_control=function(){return window.google.maps,this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},e.prototype._update_options=function(){return this._update_styles(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()},e.prototype._update_styles=function(){return this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},e.prototype._update_zoom=function(){return this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},e.prototype._map_hook=function(t,e){var n,i,r,o,s;if(i=e[0],o=e[1],s=e[2],n=e[3],this.canvas_view.map_el.style.top=o+"px",this.canvas_view.map_el.style.left=i+"px",this.canvas_view.map_el.style.width=s+"px",this.canvas_view.map_el.style.height=n+"px",null==this.map&&null!=(null!=(r=window.google)?r.maps:void 0))return this._build_map()},e.prototype._paint_empty=function(t,e){var n,i,r,o,s,a;return s=this.canvas._width.value,o=this.canvas._height.value,r=e[0],a=e[1],i=e[2],n=e[3],t.clearRect(0,0,s,o),t.beginPath(),t.moveTo(0,0),t.lineTo(0,o),t.lineTo(s,o),t.lineTo(s,0),t.lineTo(0,0),t.moveTo(r,a),t.lineTo(r+i,a),t.lineTo(r+i,a+n),t.lineTo(r,a+n),t.lineTo(r,a),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(l.PlotCanvasView);var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return this.use_map=!0,t.prototype.initialize.call(this,e,n)},e}(l.PlotCanvas);n.GMapPlotCanvas=h,h.prototype.type="GMapPlotCanvas",h.prototype.default_view=n.GMapPlotCanvasView},function(t,e,n){var i=t(150);n.MapOptions=i.MapOptions;var r=t(150);n.GMapOptions=r.GMapOptions;var o=t(150);n.GMapPlot=o.GMapPlot;var s=t(151);n.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(153);n.Plot=a.Plot;var l=t(154);n.PlotCanvas=l.PlotCanvas},function(t,e,n){var i=t(364),r=t(13),o=t(14),s=t(15),a=t(22),l=t(30),u=t(42),h=t(139),c=t(65),_=t(168),p=t(233),d=t(66),f=t(154),m=t(173),v=t(161),g=t(3),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e;return t.prototype.connect_signals.call(this),e="Title object cannot be replaced. Try changing properties on title to update it after initialization.",this.connect(this.model.properties.title.change,function(){return o.logger.warn(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.prototype.save=function(t){return this.plot_canvas_view.save(t)},e}(h.LayoutDOMView);n.PlotView=y,y.prototype.className="bk-plot-layout",y.getters({plot_canvas_view:function(){return this.child_views[this.model._plot_canvas.id]}});var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,r,o,s,a,h,c,_,p,d,f,m,v,g,y;for(t.prototype.initialize.call(this,e),_=l.values(this.extra_x_ranges).concat(this.x_range),n=0,s=_.length;n<s;n++)g=_[n],c=g.plots,u.isArray(c)&&(c=c.concat(this),g.setv({plots:c},{silent:!0}));for(p=l.values(this.extra_y_ranges).concat(this.y_range),i=0,a=p.length;i<a;i++)y=p[i],c=y.plots,u.isArray(c)&&(c=c.concat(this),y.setv({plots:c},{silent:!0}));for(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)),this._init_title_panel(),this._init_toolbar_panel(),this._plot_canvas=this._init_plot_canvas(),this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height&&(this.height=this.plot_height),m=[],r=0,h=(d=["above","below","left","right"]).length;r<h;r++)v=d[r],o=this.getv(v),m.push(function(){var t,e,n;for(n=[],t=0,e=o.length;t<e;t++)f=o[t],n.push(f.add_panel(v));return n}());return m},e.prototype._init_plot_canvas=function(){return new f.PlotCanvas({plot:this})},e.prototype._init_title_panel=function(){var t;if(null!=this.title)return t=u.isString(this.title)?new c.Title({text:this.title}):this.title,this.add_layout(t,this.title_location)},e.prototype._init_toolbar_panel=function(){var t,e,n,i,r,o,s=this;if(null!=this._toolbar_panel){for(r=[this.left,this.right,this.above,this.below,this.renderers],t=0,n=r.length;t<n;t++)e=r[t],a.removeBy(e,function(t){return t===s._toolbar_panel});this._toolbar_panel=null}switch(this.toolbar_location){case"left":case"right":case"above":case"below":return this._toolbar_panel=new d.ToolbarPanel({toolbar:this.toolbar}),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar_sticky&&(i=this.getv(this.toolbar_location),null!=(o=a.find(i,function(t){return t instanceof c.Title})))?(this._toolbar_panel.set_panel(o.panel),void this.add_renderers(this._toolbar_panel)):this.add_layout(this._toolbar_panel,this.toolbar_location)}},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.properties.toolbar_location.change,function(){return e._init_toolbar_panel()})},e.prototype._doc_attached=function(){return this.plot_canvas.attach_document(this.document),t.prototype._doc_attached.call(this)},e.prototype.add_renderers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n;return n=this.renderers,n=n.concat(t),this.renderers=n},e.prototype.add_layout=function(t,e){void 0===e&&(e="center");return null!=t.props.plot&&(t.plot=this),"center"!==e&&(this.getv(e).push(t),t.add_panel(e)),this.add_renderers(t)},e.prototype.add_glyph=function(t,e,n){void 0===n&&(n={});var i;return null==e&&(e=new m.ColumnDataSource),n=l.extend({},n,{data_source:e,glyph:t}),i=new v.GlyphRenderer(n),this.add_renderers(i),i},e.prototype.add_tools=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,i,r;for(n=0,i=t.length;n<i;n++)null!=(r=t[n]).overlay&&this.add_renderers(r.overlay);return this.toolbar.tools=this.toolbar.tools.concat(t)},e.prototype.get_layoutable_children=function(){return[this.plot_canvas]},e.prototype.get_constraints=function(){var e;return(e=t.prototype.get_constraints.call(this)).push(r.EQ(this._width,[-1,this.plot_canvas._width])),e.push(r.EQ(this._height,[-1,this.plot_canvas._height])),e},e.prototype.get_constrained_variables=function(){var e;return e=l.extend({},t.prototype.get_constrained_variables.call(this),{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&&(e.box_equal_size_left=this.plot_canvas._left,e.box_equal_size_right=this.plot_canvas._width_minus_right),e},e}(h.LayoutDOM);n.Plot=b,b.prototype.type="Plot",b.prototype.default_view=y,b.getters({plot_canvas:function(){return this._plot_canvas}}),b.mixins(["line:outline_","fill:background_","fill:border_"]),b.define({toolbar:[s.Instance,function(){return new p.Toolbar}],toolbar_location:[s.Location,"right"],toolbar_sticky:[s.Boolean,!0],plot_width:[s.Number,600],plot_height:[s.Number,600],title:[s.Any,function(){return new c.Title({text:""})}],title_location:[s.Location,"above"],h_symmetry:[s.Bool,!0],v_symmetry:[s.Bool,!1],above:[s.Array,[]],below:[s.Array,[]],left:[s.Array,[]],right:[s.Array,[]],renderers:[s.Array,[]],x_range:[s.Instance],extra_x_ranges:[s.Any,{}],y_range:[s.Instance],extra_y_ranges:[s.Any,{}],x_scale:[s.Instance,function(){return new _.LinearScale}],y_scale:[s.Instance,function(){return new _.LinearScale}],lod_factor:[s.Number,10],lod_interval:[s.Number,300],lod_threshold:[s.Number,2e3],lod_timeout:[s.Number,500],hidpi:[s.Bool,!0],output_backend:[s.OutputBackend,"canvas"],min_border:[s.Number,5],min_border_top:[s.Number,null],min_border_left:[s.Number,null],min_border_bottom:[s.Number,null],min_border_right:[s.Number,null],inner_width:[s.Number],inner_height:[s.Number],layout_width:[s.Number],layout_height:[s.Number],match_aspect:[s.Bool,!1],aspect_scale:[s.Number,1]}),b.override({outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"}),b.getters({all_renderers:function(){var t,e,n,i,r;for(i=this.renderers,n=this.toolbar.tools,t=0,e=n.length;t<e;t++)r=n[t],i=i.concat(r.synthetic_renderers);return i},webgl:function(){return log.warning("webgl attr is deprecated, use output_backend"),"webgl"===this.output_backend},tool_events:function(){return log.warning("tool_events attr is deprecated, use SelectionGeometry Event"),null}}),g.register_with_event(g.UIEvent,b)},function(t,e,n){var i,r,o,s,a,l=t(364),u=[].indexOf,h=t(79),c=t(80),_=t(156),p=t(161),d=t(139),f=t(20),m=t(4),v=t(21),g=t(46),y=t(6),b=t(11),x=t(10),w=t(13),k=t(14),S=t(7),T=t(15),M=t(41),A=t(42),E=t(22),z=t(30),C=t(12);a=null;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.prototype.view_options=function(){return z.extend({plot_view:this,parent:this},this.options)},e.prototype.pause=function(){return null==this._is_paused?this._is_paused=1:this._is_paused+=1},e.prototype.unpause=function(t){if(void 0===t&&(t=!1),this._is_paused-=1,0===this._is_paused&&!t)return this.request_render()},e.prototype.request_render=function(){return this.request_paint()},e.prototype.request_paint=function(){this.is_paused||this.throttled_paint()},e.prototype.remove=function(){return m.remove_views(this.renderer_views),m.remove_views(this.tool_views),this.canvas_view.remove(),this.canvas_view=null,t.prototype.remove.call(this)},e.prototype.initialize=function(e){var n,i,r,o,s=this;for(this.pause(),t.prototype.initialize.call(this,e),this.force_paint=new f.Signal(this,"force_paint"),this.state_changed=new f.Signal(this,"state_changed"),this.lod_started=!1,this.visuals=new g.Visuals(this.model.plot),this._initial_state_info={range:null,selection:{},dimensions:{width:this.model.canvas._width.value,height:this.model.canvas._height.value}},this.frame=this.model.frame,this.canvas=this.model.canvas,this.canvas_view=new this.canvas.default_view({model:this.canvas,parent:this}),this.el.appendChild(this.canvas_view.el),this.canvas_view.render(),"webgl"===this.model.plot.output_backend&&this.init_webgl(),this.throttled_paint=M.throttle(function(){return s.force_paint.emit()},15),this.ui_event_bus=new v.UIEvents(this,this.model.toolbar,this.canvas_view.el,this.model.plot),this.levels={},o=S.RenderLevel,n=0,i=o.length;n<i;n++)r=o[n],this.levels[r]={};return this.renderer_views={},this.tool_views={},this.build_levels(),this.build_tools(),this.update_dataranges(),this.unpause(!0),k.logger.debug("PlotView initialized"),this},e.prototype.set_cursor=function(t){return void 0===t&&(t="default"),this.canvas_view.el.style.cursor=t},e.prototype.init_webgl=function(){var t,e,n;return t=this.canvas_view.ctx,null==(e=a)&&(a=e=document.createElement("canvas"),n={premultipliedAlpha:!0},e.gl=e.getContext("webgl",n)||e.getContext("experimental-webgl",n)),null!=e.gl?t.glcanvas=e:k.logger.warn("WebGL is not supported, falling back to 2D canvas.")},e.prototype.prepare_webgl=function(t,e){var n,i,r;if(i=this.canvas_view.ctx,n=this.canvas_view.get_canvas_element(),i.glcanvas)return i.glcanvas.width=n.width,i.glcanvas.height=n.height,(r=i.glcanvas.gl).viewport(0,0,i.glcanvas.width,i.glcanvas.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT||r.DEPTH_BUFFER_BIT),r.enable(r.SCISSOR_TEST),r.scissor(t*e[0],t*e[1],t*e[2],t*e[3]),r.enable(r.BLEND),r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE_MINUS_DST_ALPHA,r.ONE)},e.prototype.blit_webgl=function(t){var e;if((e=this.canvas_view.ctx).glcanvas)return k.logger.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,n,i,r,o,s,a,l,u,h,c,p,d,f,m,v,g,y,b,x,w,S,T,M,A,E,C,O,N,j,P,D,F,I,B;for(o=this.model.frame,e={},g={},i=!1,S=z.values(o.x_ranges).concat(z.values(o.y_ranges)),l=0,c=S.length;l<c;l++)(w=S[l])instanceof _.DataRange1d&&"log"===w.scale_hint&&(i=!0);T=this.renderer_views;for(u in T)j=T[u],null!=(t=null!=(M=j.glyph)&&"function"==typeof M.bounds?M.bounds():void 0)&&(e[u]=t),i&&null!=(v=null!=(A=j.glyph)&&"function"==typeof A.log_bounds?A.log_bounds():void 0)&&(g[u]=v);if(r=!1,s=!1,!1!==this.model.plot.match_aspect&&0!==this.frame._width.value&&0!==this.frame._height.value){w=1/this.model.plot.aspect_scale*(this.frame._width.value/this.frame._height.value);for(u in e)j=e[u],isFinite(j.maxX)&&isFinite(j.minX)&&isFinite(j.maxY)&&isFinite(j.minY)&&((P=j.maxX-j.minX)<=0&&(P=1),(a=j.maxY-j.minY)<=0&&(a=1),D=.5*(j.maxX+j.minX),I=.5*(j.maxY+j.minY),P<w*a?P=w*a:a=P/w,e[u].maxX=D+.5*P,e[u].minX=D-.5*P,e[u].maxY=I+.5*a,e[u].minY=I-.5*a)}for(E=z.values(o.x_ranges),h=0,p=E.length;h<p;h++)(F=E[h])instanceof _.DataRange1d&&(n="log"===F.scale_hint?g:e,F.update(n,0,this.model.id),F.follow&&(r=!0)),null!=F.bounds&&(s=!0);for(C=z.values(o.y_ranges),y=0,d=C.length;y<d;y++)(B=C[y])instanceof _.DataRange1d&&(n="log"===B.scale_hint?g:e,B.update(n,1,this.model.id),B.follow&&(r=!0)),null!=B.bounds&&(s=!0);if(r&&s){for(k.logger.warn("Follow enabled so bounds are unset."),O=z.values(o.x_ranges),b=0,f=O.length;b<f;b++)(F=O[b]).bounds=null;for(N=z.values(o.y_ranges),x=0,m=N.length;x<m;x++)(B=N[x]).bounds=null}return this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,n,i){return void 0===n&&(n="default"),void 0===i&&(i="default"),this.frame.map_to_screen(t,e,n,i)},e.prototype.push_state=function(t,e){var n,i;return n=(null!=(i=this.state.history[this.state.index])?i.info:void 0)||{},e=z.extend({},this._initial_state_info,n,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.state_changed.emit()},e.prototype.clear_state=function(){return this.state={history:[],index:-1},this.state_changed.emit()},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.state_changed.emit()},e.prototype.redo=function(){if(this.can_redo())return this.state.index+=1,this._do_state_change(this.state.index),this.state_changed.emit()},e.prototype._do_state_change=function(t){var e,n;if(null!=(e=(null!=(n=this.state.history[t])?n.info:void 0)||this._initial_state_info).range&&this.update_range(e.range),null!=e.selection)return this.update_selection(e.selection)},e.prototype.get_selection=function(){var t,e,n,i,r,o;for(o=[],n=this.model.plot.renderers,t=0,e=n.length;t<e;t++)(i=n[t])instanceof p.GlyphRenderer&&(r=i.data_source.selected,o[i.id]=r);return o},e.prototype.update_selection=function(t){var e,n,i,r,o,s,a;for(r=this.model.plot.renderers,a=[],n=0,i=r.length;n<i;n++)(s=r[n])instanceof p.GlyphRenderer&&(e=s.data_source,null!=t?(o=s.id,u.call(t,o)>=0?a.push(e.selected=t[s.id]):a.push(void 0)):a.push(e.selection_manager.clear()));return a},e.prototype.reset_selection=function(){return this.update_selection(null)},e.prototype._update_ranges_together=function(t){var e,n,i,r,o,s,a,l;for(l=1,e=0,i=t.length;e<i;e++)u=t[e],a=u[0],o=u[1],l=Math.min(l,this._get_weight_to_constrain_interval(a,o));if(l<1){for(s=[],n=0,r=t.length;n<r;n++)h=t[n],a=h[0],(o=h[1]).start=l*o.start+(1-l)*a.start,s.push(o.end=l*o.end+(1-l)*a.end);return s}var u,h},e.prototype._update_ranges_individually=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f;for(i=!1,o=0,a=t.length;o<a;o++)m=t[o],d=m[0],_=m[1],r=d.start>d.end,n||(f=this._get_weight_to_constrain_interval(d,_))<1&&(_.start=f*_.start+(1-f)*d.start,_.end=f*_.end+(1-f)*d.end),null!=d.bounds&&(h=d.bounds[0],u=d.bounds[1],c=Math.abs(_.end-_.start),r?(null!=h&&h>=_.end&&(i=!0,_.end=h,null==e&&null==n||(_.start=h+c)),null!=u&&u<=_.start&&(i=!0,_.start=u,null==e&&null==n||(_.end=u-c))):(null!=h&&h>=_.start&&(i=!0,_.start=h,null==e&&null==n||(_.end=h+c)),null!=u&&u<=_.end&&(i=!0,_.end=u,null==e&&null==n||(_.start=u-c))));if(!n||!i){for(p=[],s=0,l=t.length;s<l;s++)v=t[s],d=v[0],_=v[1],d.have_updated_interactively=!0,d.start!==_.start||d.end!==_.end?p.push(d.setv(_)):p.push(void 0);return p;var m,v}},e.prototype._get_weight_to_constrain_interval=function(t,e){var n,i,r,o,s,a,l,u;return s=t.min_interval,i=t.max_interval,u=1,null!=t.bounds&&(h=t.bounds,o=h[0],n=h[1],null!=o&&null!=n&&(r=Math.abs(n-o),i=null!=i?Math.min(i,r):r)),null==s&&null==i||(l=Math.abs(t.end-t.start),a=Math.abs(e.end-e.start),s>0&&a<s&&(u=(l-s)/(l-a)),i>0&&a>i&&(u=(i-l)/(a-l)),u=Math.max(0,Math.min(1,u))),u;var h},e.prototype.update_range=function(t,e,n){var i,r,o,s,a,l,u;if(this.pause(),null==t){o=this.frame.x_ranges;for(i in o)(u=o[i]).reset();s=this.frame.y_ranges;for(i in s)(u=s[i]).reset();this.update_dataranges()}else{r=[],a=this.frame.x_ranges;for(i in a)u=a[i],r.push([u,t.xrs[i]]);l=this.frame.y_ranges;for(i in l)u=l[i],r.push([u,t.yrs[i]]);n&&this._update_ranges_together(r),this._update_ranges_individually(r,e,n)}return this.unpause()},e.prototype.reset_range=function(){return this.update_range(null)},e.prototype.build_levels=function(){var t,e,n,i,r,o,s,a,l,u,h;for(l=this.model.plot.all_renderers,a=Object.keys(this.renderer_views),s=m.build_views(this.renderer_views,l,this.view_options()),u=E.difference(a,function(){var t,e,n;for(n=[],t=0,e=l.length;t<e;t++)o=l[t],n.push(o.id);return n}()),e=0,i=u.length;e<i;e++)t=u[e],delete this.levels.glyph[t];for(n=0,r=s.length;n<r;n++)h=s[n],this.levels[h.model.level][h.model.id]=h;return this},e.prototype.get_renderer_views=function(){var t,e,n,i,r;for(i=this.model.plot.renderers,r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(this.levels[n.level][n.id]);return r},e.prototype.build_tools=function(){var t,e,n,i,r,o;for(r=this.model.plot.toolbar.tools,n=m.build_views(this.tool_views,r,this.view_options()),i=[],t=0,e=n.length;t<e;t++)o=n[t],i.push(this.ui_event_bus.register_tool(o));return i},e.prototype.connect_signals=function(){var e,n,i,r,o=this;t.prototype.connect_signals.call(this),this.connect(this.force_paint,function(){return o.repaint()}),n=this.model.frame.x_ranges;for(e in n)r=n[e],this.connect(r.change,function(){return this.request_render()});i=this.model.frame.y_ranges;for(e in i)r=i[e],this.connect(r.change,function(){return this.request_render()});return this.connect(this.model.plot.properties.renderers.change,function(){return o.build_levels()}),this.connect(this.model.plot.toolbar.properties.tools.change,function(){return o.build_levels(),o.build_tools()}),this.connect(this.model.plot.change,function(){return this.request_render()})},e.prototype.set_initial_range=function(){var t,e,n,i,r,o,s;t=!0,o={},n=this.frame.x_ranges;for(e in n){if(null==(r=n[e]).start||null==r.end||A.isStrictNaN(r.start+r.end)){t=!1;break}o[e]={start:r.start,end:r.end}}if(t){s={},i=this.frame.y_ranges;for(e in i){if(null==(r=i[e]).start||null==r.end||A.isStrictNaN(r.start+r.end)){t=!1;break}s[e]={start:r.start,end:r.end}}}return t?(this._initial_state_info.range=this.initial_range_info={xrs:o,yrs:s},k.logger.debug("initial ranges set")):k.logger.warn("could not set initial ranges")},e.prototype.update_constraints=function(){var t,e,n;this.solver.suggest_value(this.frame._width,this.canvas._width.value),this.solver.suggest_value(this.frame._height,this.canvas._height.value),e=this.renderer_views;for(t in e)null!=(n=e[t]).model.panel&&C.update_panel_constraints(n);return this.solver.update_variables()},e.prototype._layout=function(t){if(void 0===t&&(t=!1),this.render(),t)return this.model.plot.setv({inner_width:Math.round(this.frame._width.value),inner_height:Math.round(this.frame._height.value),layout_width:Math.round(this.canvas._width.value),layout_height:Math.round(this.canvas._height.value)},{no_change:!0}),this.paint()},e.prototype.has_finished=function(){var e,n,i;if(!t.prototype.has_finished.call(this))return!1;n=this.levels;for(e in n){i=n[e];for(e in i)if(!i[e].has_finished())return!1}return!0},e.prototype.render=function(){var t,e;return e=this.model._width.value,t=this.model._height.value,this.canvas_view.set_dims([e,t]),this.update_constraints(),!1!==this.model.plot.match_aspect&&0!==this.frame._width.value&&0!==this.frame._height.value&&this.update_dataranges(),this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"},e.prototype._needs_layout=function(){var t,e,n;e=this.renderer_views;for(t in e)if(null!=(n=e[t]).model.panel&&C._view_sizes.get(n)!==n.get_size())return!0;return!1},e.prototype.repaint=function(){return this._needs_layout()?this.parent.partial_layout():this.paint()},e.prototype.paint=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_=this;if(!this.is_paused){k.logger.trace("PlotCanvas.render() for "+this.model.id),this.canvas_view.prepare_canvas(),null!=this.model.document&&((i=this.model.document.interactive_duration())>=0&&i<this.model.plot.lod_interval?(o=this.model.plot.lod_timeout,setTimeout(function(){return _.model.document.interactive_duration()>o&&_.model.document.interactive_stop(_.model.plot),_.request_render()},o)):this.model.document.interactive_stop(this.model.plot)),a=this.renderer_views;for(r in a)if(l=a[r],null==this.range_update_timestamp||l.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}return this.model.frame._update_scales(),t=this.canvas_view.ctx,t.pixel_ratio=s=this.canvas.pixel_ratio,t.save(),t.scale(s,s),t.translate(.5,.5),e=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value],this._map_hook(t,e),this._paint_empty(t,e),this.prepare_webgl(s,e),t.save(),this.visuals.outline_line.doit&&(this.visuals.outline_line.set_value(t),c=e[1],n=e[3],(h=e[0])+(u=e[2])===this.canvas._width.value&&(u-=1),c+n===this.canvas._height.value&&(n-=1),t.strokeRect(h,c,u,n)),t.restore(),this._paint_levels(t,["image","underlay","glyph"],e),this.blit_webgl(s),this._paint_levels(t,["annotation"],e),this._paint_levels(t,["overlay"]),null==this.initial_range_info&&this.set_initial_range(),t.restore(),this._has_finished?void 0:(this._has_finished=!0,this.notify_finished())}},e.prototype._paint_levels=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f;for(t.save(),null!=n&&"canvas"===this.model.plot.output_backend&&(t.beginPath(),t.rect.apply(t,n),t.clip()),r={},_=this.model.plot.renderers,i=o=0,a=_.length;o<a;i=++o)p=_[i],r[p.id]=i;for(f=function(t){return r[t.model.id]},s=0,l=e.length;s<l;s++)for(h=e[s],d=E.sortBy(z.values(this.levels[h]),f),c=0,u=d.length;c<u;c++)d[c].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.model._width.value,this.canvas_view.model._height.value),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(0,0,this.canvas_view.model._width.value,this.canvas_view.model._height.value),t.clearRect.apply(t,e)),this.visuals.background_fill.doit)return this.visuals.background_fill.set_value(t),t.fillRect.apply(t,e)},e.prototype.save=function(t){var e,n,i,r,o,s,a;return"canvas"===(o=this.model.plot.output_backend)||"webgl"===o?null!=(n=this.canvas_view.get_canvas_element()).msToBlob?(e=n.msToBlob(),window.navigator.msSaveBlob(e,t)):(r=document.createElement("a"),r.href=n.toDataURL("image/png"),r.download=t+".png",r.target="_blank",r.dispatchEvent(new MouseEvent("click"))):"svg"===this.model.plot.output_backend?(s=this.canvas_view.ctx.getSerializedSvg(!0),a=new Blob([s],{type:"text/plain"}),i=document.createElement("a"),i.download=t+".svg",i.innerHTML="Download svg",i.href=window.URL.createObjectURL(a),i.onclick=function(t){return document.body.removeChild(t.target)},i.style.display="none",document.body.appendChild(i),i.click()):void 0},e}(y.DOMView);n.PlotCanvasView=O,O.prototype.className="bk-plot-wrapper",O.prototype.state={history:[],index:-1},O.getters({canvas_overlays:function(){return this.canvas_view.overlays_el},canvas_events:function(){return this.canvas_view.events_el},is_paused:function(){return null!=this._is_paused&&0!==this._is_paused}}),i=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="AbovePanel",t}(),r=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="BelowPanel",t}(),o=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="LeftPanel",t}(),s=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="RightPanel",t}();var N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.prototype.initialize=function(e,n){var a;return t.prototype.initialize.call(this,e,n),this.canvas=new h.Canvas({map:null!=(a=this.use_map)&&a,use_hidpi:this.plot.hidpi,output_backend:this.plot.output_backend}),this.frame=new c.CartesianFrame({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_scale:this.plot.x_scale,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_scale:this.plot.y_scale}),this.above_panel=new i,this.below_panel=new r,this.left_panel=new o,this.right_panel=new s,k.logger.debug("PlotCanvas initialized")},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),t.prototype._doc_attached.call(this),k.logger.debug("PlotCanvas attached to document")},e.prototype.get_layoutable_children=function(){var t,e;return t=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],(e=function(e){var n,i,r,o;for(o=[],n=0,i=e.length;n<i;n++)null!=(r=e[n]).panel?o.push(t.push(r.panel)):o.push(void 0);return o})(this.plot.above),e(this.plot.below),e(this.plot.left),e(this.plot.right),t},e.prototype.get_constraints=function(){return t.prototype.get_constraints.call(this).concat(this._get_constant_constraints(),this._get_side_constraints())},e.prototype._get_constant_constraints=function(){return[w.EQ(this.canvas._left,0),w.EQ(this.canvas._top,0),w.GE(this.above_panel._top,[-1,this.canvas._top]),w.EQ(this.above_panel._bottom,[-1,this.frame._top]),w.EQ(this.above_panel._left,[-1,this.left_panel._right]),w.EQ(this.above_panel._right,[-1,this.right_panel._left]),w.EQ(this.below_panel._top,[-1,this.frame._bottom]),w.LE(this.below_panel._bottom,[-1,this.canvas._bottom]),w.EQ(this.below_panel._left,[-1,this.left_panel._right]),w.EQ(this.below_panel._right,[-1,this.right_panel._left]),w.EQ(this.left_panel._top,[-1,this.above_panel._bottom]),w.EQ(this.left_panel._bottom,[-1,this.below_panel._top]),w.GE(this.left_panel._left,[-1,this.canvas._left]),w.EQ(this.left_panel._right,[-1,this.frame._left]),w.EQ(this.right_panel._top,[-1,this.above_panel._bottom]),w.EQ(this.right_panel._bottom,[-1,this.below_panel._top]),w.EQ(this.right_panel._left,[-1,this.frame._right]),w.LE(this.right_panel._right,[-1,this.canvas._right]),w.EQ(this._top,[-1,this.above_panel._bottom]),w.EQ(this._left,[-1,this.left_panel._right]),w.EQ(this._height,[-1,this._bottom],[-1,this.canvas._bottom],this.below_panel._top),w.EQ(this._width,[-1,this._right],[-1,this.canvas._right],this.right_panel._left),w.GE(this._top,-this.plot.min_border_top),w.GE(this._left,-this.plot.min_border_left),w.GE(this._height,[-1,this._bottom],-this.plot.min_border_bottom),w.GE(this._width,[-1,this._right],-this.plot.min_border_right)]},e.prototype._get_side_constraints=function(){var t,e,n,i,r;return i=function(t){var e,n,i,r;for(r=[],e=0,n=t.length;e<n;e++)i=t[e],r.push(i.panel);return r},t=x.vstack(this.above_panel,i(this.plot.above)),e=x.vstack(this.below_panel,E.reversed(i(this.plot.below))),n=x.hstack(this.left_panel,i(this.plot.left)),r=x.hstack(this.right_panel,E.reversed(i(this.plot.right))),[].concat(t,e,n,r)},e}(d.LayoutDOM);n.PlotCanvas=N,N.prototype.type="PlotCanvas",N.prototype.default_view=O,N.override({sizing_mode:"stretch_both"}),N.internal({plot:[T.Instance],toolbar:[T.Instance],canvas:[T.Instance],frame:[T.Instance]})},function(t,e,n){var i=t(364),r=t(159),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Range);n.DataRange=s,s.prototype.type="DataRange",s.define({names:[o.Array,[]],renderers:[o.Array,[]]})},function(t,e,n){var i=t(364),r=t(155),o=t(161),s=t(14),a=t(15),l=t(23),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.plot_bounds={},this.have_updated_interactively=!1,this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span},e.prototype.computed_renderers=function(){var t,e,n,i,r,a,l,u,h,c,_;if(a=this.names,0===(c=this.renderers).length)for(h=this.plots,e=0,i=h.length;e<i;e++)l=h[e],t=l.renderers,_=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)(u=t[e])instanceof o.GlyphRenderer&&i.push(u);return i}(),c=c.concat(_);for(a.length>0&&(c=function(){var t,e,n;for(n=[],t=0,e=c.length;t<e;t++)u=c[t],a.indexOf(u.name)>=0&&n.push(u);return n}()),s.logger.debug("computed "+c.length+" renderers for DataRange1d "+this.id),n=0,r=c.length;n<r;n++)u=c[n],s.logger.trace(" - "+u.type+" "+u.id);return c},e.prototype._compute_plot_bounds=function(t,e){var n,i,r,o;for(o=l.empty(),n=0,i=t.length;n<i;n++)r=t[n],null!=e[r.id]&&(o=l.union(o,e[r.id]));return o},e.prototype._compute_min_max=function(t,e){var n,i,r,o,s;o=l.empty();for(n in t)s=t[n],o=l.union(o,s);return 0===e?(a=[o.minX,o.maxX],r=a[0],i=a[1]):(u=[o.minY,o.maxY],r=u[0],i=u[1]),[r,i];var a,u},e.prototype._compute_range=function(t,e){var n,i,r,o,a,l,u,h,c,_;return u=null!=(h=this.range_padding)?h:0,"log"===this.scale_hint?((isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?.1:e/100,s.logger.warn("could not determine minimum data value for log axis, DataRange1d using value "+t)),(isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?10:100*t,s.logger.warn("could not determine maximum data value for log axis, DataRange1d using value "+e)),e===t?(c=this.default_span+.001,n=Math.log(t)/Math.log(10)):("percent"===this.range_padding_units?(l=Math.log(t)/Math.log(10),a=Math.log(e)/Math.log(10),c=(a-l)*(1+u)):(l=Math.log(t-u)/Math.log(10),a=Math.log(e+u)/Math.log(10),c=a-l),n=(l+a)/2),p=[Math.pow(10,n-c/2),Math.pow(10,n+c/2)],_=p[0],i=p[1]):(c=e===t?this.default_span:"percent"===this.range_padding_units?(e-t)*(1+u):e-t+2*u,_=(d=[(n=(e+t)/2)-c/2,n+c/2])[0],i=d[1]),o=1,this.flipped&&(_=(f=[i,_])[0],i=f[1],o=-1),null!=(r=this.follow_interval)&&Math.abs(_-i)>r&&("start"===this.follow?i=_+o*r:"end"===this.follow&&(_=i-o*r)),[_,i];var p,d,f},e.prototype.update=function(t,e,n){var i,r,o,s,a,l,u,h;if(!this.have_updated_interactively){return u=this.computed_renderers(),this.plot_bounds[n]=this._compute_plot_bounds(u,t),c=this._compute_min_max(this.plot_bounds,e),a=c[0],s=c[1],_=this._compute_range(a,s),h=_[0],o=_[1],null!=this._initial_start&&("log"===this.scale_hint?this._initial_start>0&&(h=this._initial_start):h=this._initial_start),null!=this._initial_end&&("log"===this.scale_hint?this._initial_end>0&&(o=this._initial_end):o=this._initial_end),p=[this.start,this.end],r=p[0],i=p[1],h===r&&o===i||(l={},h!==r&&(l.start=h),o!==i&&(l.end=o),this.setv(l)),"auto"===this.bounds&&this.setv({bounds:[h,o]},{silent:!0}),this.change.emit();var c,_,p}},e.prototype.reset=function(){return this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()},e}(r.DataRange);n.DataRange1d=u,u.prototype.type="DataRange1d",u.define({start:[a.Number],end:[a.Number],range_padding:[a.Number,.1],range_padding_units:[a.PaddingUnits,"percent"],flipped:[a.Bool,!1],follow:[a.StartEnd],follow_interval:[a.Number],default_span:[a.Number,2],bounds:[a.Any],min_interval:[a.Any],max_interval:[a.Any]}),u.internal({scale_hint:[a.String,"auto"]}),u.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)}})},function(t,e,n){var i=t(364),r=t(159),o=t(15),s=t(22),a=t(42);n.map_one_level=function(t,e,n){void 0===n&&(n=0);var i,r,o,s,a;for(a={},r=o=0,s=t.length;o<s;r=++o){if((i=t[r])in a)throw new Error("duplicate factor or subfactor "+i);a[i]={value:.5+r*(1+e)+n}}return[a,(t.length-1)*e]},n.map_two_levels=function(t,e,i,r){void 0===r&&(r=0);var o,a,l,u,h,c,_,p,d,f,m,v,g,y,b;for(_={},g={},y=[],l=0,h=t.length;l<h;l++)x=t[l],o=x[0],a=x[1],o in g||(g[o]=[],y.push(o)),g[o].push(a);for(f=r,b=0,u=0,c=y.length;u<c;u++)o=y[u],p=g[o].length,w=n.map_one_level(g[o],i,f),d=w[0],m=w[1],b+=m,v=s.sum(function(){var t,e,n,i;for(n=g[o],i=[],t=0,e=n.length;t<e;t++)a=n[t],i.push(d[a].value);return i}()),_[o]={value:v/p,mapping:d},f+=p+e+m;return[_,y,(y.length-1)*e+b];var x,w},n.map_three_levels=function(t,e,i,r,o){void 0===o&&(o=0);var a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M;for(m={},S={},T=[],h=0,p=t.length;h<p;h++)A=t[h],a=A[0],l=A[1],u=A[2],a in S||(S[a]=[],T.push(a)),S[a].push([l,u]);for(v=[],x=o,M=0,c=0,d=T.length;c<d;c++){for(a=T[c],g=S[a].length,E=n.map_two_levels(S[a],i,r,x),y=E[0],b=E[1],w=E[2],_=0,f=b.length;_<f;_++)l=b[_],v.push([a,l]);M+=w,k=s.sum(function(){var t,e,n,i;for(n=S[a],i=[],e=0,t=n.length;e<t;e++)r=n[e],l=r[0],u=r[1],i.push(y[l].value);return i;var r}()),m[a]={value:k/g,mapping:y},x+=g+e+w}return[m,T,v,(T.length-1)*e+M];var A,E};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._init(),this.connect(this.properties.factors.change,function(){return this._init()}),this.connect(this.properties.factor_padding.change,function(){return this._init()}),this.connect(this.properties.group_padding.change,function(){return this._init()}),this.connect(this.properties.subgroup_padding.change,function(){return this._init()}),this.connect(this.properties.range_padding.change,function(){return this._init()}),this.connect(this.properties.range_padding_units.change,function(){return this._init()})},e.prototype.reset=function(){return this._init(),this.change.emit()},e.prototype.synthetic=function(t){var e;return a.isNumber(t)?t:a.isString(t)?this._lookup([t]):(e=0,a.isNumber(t[t.length-1])&&(e=t[t.length-1],t=t.slice(0,-1)),this._lookup(t)+e)},e.prototype.v_synthetic=function(t){var e;return function(){var n,i,r;for(r=[],n=0,i=t.length;n<i;n++)e=t[n],r.push(this.synthetic(e));return r}.call(this)},e.prototype._init=function(){var t,e,i,r,o;if(s.all(this.factors,a.isString))r=1,l=n.map_one_level(this.factors,this.factor_padding),this._mapping=l[0],i=l[1];else if(s.all(this.factors,function(t){return a.isArray(t)&&2===t.length&&a.isString(t[0])&&a.isString(t[1])}))r=2,u=n.map_two_levels(this.factors,this.group_padding,this.factor_padding),this._mapping=u[0],this.tops=u[1],i=u[2];else{if(!s.all(this.factors,function(t){return a.isArray(t)&&3===t.length&&a.isString(t[0])&&a.isString(t[1])&&a.isString(t[2])}))throw new Error("");r=3,h=n.map_three_levels(this.factors,this.group_padding,this.subgroup_padding,this.factor_padding),this._mapping=h[0],this.tops=h[1],this.mids=h[2],i=h[3]}if(o=0,t=this.factors.length+i,"percent"===this.range_padding_units?(e=(t-o)*this.range_padding/2,o-=e,t+=e):(o-=this.range_padding,t+=this.range_padding),this.setv({start:o,end:t,levels:r},{silent:!0}),"auto"===this.bounds)return this.setv({bounds:[o,t]},{silent:!0});var l,u,h},e.prototype._lookup=function(t){return 1===t.length?this._mapping[t[0]].value:2===t.length?this._mapping[t[0]].mapping[t[1]].value:3===t.length?this._mapping[t[0]].mapping[t[1]].mapping[t[2]].value:void 0},e}(r.Range);n.FactorRange=l,l.prototype.type="FactorRange",l.define({factors:[o.Array,[]],factor_padding:[o.Number,0],subgroup_padding:[o.Number,.8],group_padding:[o.Number,1.4],range_padding:[o.Number,0],range_padding_units:[o.PaddingUnits,"percent"],start:[o.Number],end:[o.Number],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]}),l.getters({min:function(){return this.start},max:function(){return this.end}}),l.internal({levels:[o.Number],mids:[o.Array],tops:[o.Array],tops_groups:[o.Array]})},function(t,e,n){var i=t(155);n.DataRange=i.DataRange;var r=t(156);n.DataRange1d=r.DataRange1d;var o=t(157);n.FactorRange=o.FactorRange;var s=t(159);n.Range=s.Range;var a=t(160);n.Range1d=a.Range1d},function(t,e,n){var i=t(364),r=t(50),o=t(15),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.change,function(){return this._emit_callback()})},e.prototype.reset=function(){return this.change.emit()},e.prototype._emit_callback=function(){if(null!=this.callback)return s.isFunction(this.callback)?this.callback(this):this.callback.execute(this)},e}(r.Model);n.Range=a,a.prototype.type="Range",a.define({callback:[o.Any]}),a.internal({plots:[o.Array,[]]})},function(t,e,n){var i=t(364),r=t(159),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_auto_bounds=function(){var t,e;if("auto"===this.bounds)return e=Math.min(this._initial_start,this._initial_end),t=Math.max(this._initial_start,this._initial_end),this.setv({bounds:[e,t]},{silent:!0})},e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._initial_start=this.start,this._initial_end=this.end,this._set_auto_bounds()},Object.defineProperty(e.prototype,"min",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_reversed",{get:function(){return this.start>this.end},enumerable:!0,configurable:!0}),e.prototype.reset=function(){return this._set_auto_bounds(),this.start!==this._initial_start||this.end!==this._initial_end?this.setv({start:this._initial_start,end:this._initial_end}):this.change.emit()},e}(r.Range);n.Range1d=s,s.prototype.type="Range1d",s.define({start:[o.Number,0],end:[o.Number,1],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]})},function(t,e,n){var i=t(364),r=[].indexOf,o=t(165),s=t(114),a=t(178),l=t(172),u=t(14),h=t(15),c=t(22),_=t(30);n.GlyphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,o,s,l,u,h,c,p,d;if(t.prototype.initialize.call(this,e),n=this.model.glyph,s=r.call(n.mixins,"fill")>=0,l=r.call(n.mixins,"line")>=0,o=_.clone(n.attributes),delete o.id,h=function(t){var e;return e=_.clone(o),s&&_.extend(e,t.fill),l&&_.extend(e,t.line),new n.constructor(e)},this.glyph=this.build_glyph_view(n),null==(d=this.model.selection_glyph)?d=h({fill:{},line:{}}):"auto"===d&&(d=h(this.model.selection_defaults)),this.selection_glyph=this.build_glyph_view(d),null==(p=this.model.nonselection_glyph)?p=h({fill:{},line:{}}):"auto"===p&&(p=h(this.model.nonselection_defaults)),this.nonselection_glyph=this.build_glyph_view(p),null!=(u=this.model.hover_glyph)&&(this.hover_glyph=this.build_glyph_view(u)),null!=(c=this.model.muted_glyph)&&(this.muted_glyph=this.build_glyph_view(c)),i=h(this.model.decimated_defaults),this.decimated_glyph=this.build_glyph_view(i),this.xscale=this.plot_view.frame.xscales[this.model.x_range_name],this.yscale=this.plot_view.frame.yscales[this.model.y_range_name],this.set_data(!1),this.model.data_source instanceof a.RemoteDataSource)return this.model.data_source.setup()},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,parent:this})},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()}),this.connect(this.model.glyph.change,function(){return this.set_data()}),this.connect(this.model.data_source.change,function(){return this.set_data()}),this.connect(this.model.data_source.streaming,function(){return this.set_data()}),this.connect(this.model.data_source.patching,function(t){return this.set_data(!0,t)}),this.connect(this.model.data_source.select,function(){return this.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return this.request_render()}),this.connect(this.model.properties.view.change,function(){return this.set_data()}),this.connect(this.model.view.change,function(){return this.set_data()}),this.connect(this.model.glyph.transformchange,function(){return this.set_data()})},e.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},e.prototype.set_data=function(t,e){void 0===t&&(t=!0);var n,i,r,o,s,a,l;for(l=Date.now(),a=this.model.data_source,this.all_indices=this.model.view.indices,this.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.glyph.set_data(a,this.all_indices,e),this.glyph.set_visuals(a),this.decimated_glyph.set_visuals(a),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(a),this.nonselection_glyph.set_visuals(a)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(a),null!=this.muted_glyph&&this.muted_glyph.set_visuals(a),o=this.plot_model.plot.lod_factor,this.decimated=[],i=r=0,s=Math.floor(this.all_indices.length/o);0<=s?r<s:r>s;i=0<=s?++r:--r)this.decimated.push(i*o);if(n=Date.now()-l,u.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+n+"ms"),this.set_data_timestamp=Date.now(),t)return this.request_render()},e.prototype.render=function(){var t,e,n,i,o,a,l,h,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j;if(this.model.visible){if(C=Date.now(),l=this.glyph.glglyph,Date.now(),this.glyph.map_data(),e=Date.now()-C,O=Date.now(),(p=this.glyph.mask_data(this.all_indices)).length===this.all_indices.length&&(p=function(){M=[];for(var t=0,e=this.all_indices.length;0<=e?t<e:t>e;0<=e?t++:t--)M.push(t);return M}.apply(this)),n=Date.now()-O,(t=this.plot_view.canvas_view.ctx).save(),A=this.model.data_source.selected,A=A&&0!==A.length?A["0d"].glyph?this.model.view.convert_indices_from_subset(p):A["1d"].indices.length>0?A["1d"].indices:function(){var t,e,n,i;for(n=Object.keys(A["2d"].indices),i=[],t=0,e=n.length;t<e;t++)_=n[t],i.push(parseInt(_));return i}():[],d=this.model.data_source.inspected,d=d&&0!==d.length?d["0d"].glyph?this.model.view.convert_indices_from_subset(p):d["1d"].indices.length>0?d["1d"].indices:function(){var t,e,n,i;for(n=Object.keys(d["2d"].indices),i=[],t=0,e=n.length;t<e;t++)_=n[t],i.push(parseInt(_));return i}():[],d=function(){var t,e,n,i;for(i=[],t=0,e=p.length;t<e;t++)_=p[t],n=this.all_indices[_],r.call(d,n)>=0&&i.push(_);return i}.call(this),b=this.plot_model.plot.lod_threshold,(null!=(S=this.model.document)?S.interactive_duration():void 0)>0&&!l&&null!=b&&this.all_indices.length>b?(p=this.decimated,h=this.decimated_glyph,k=this.decimated_glyph,z=this.selection_glyph):(h=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,k=this.nonselection_glyph,z=this.selection_glyph),null!=this.hover_glyph&&d.length&&(p=c.difference(p,d)),A.length&&this.have_selection_glyphs()){for(j=Date.now(),E={},f=0,v=A.length;f<v;f++)_=A[f],E[_]=!0;if(A=new Array,w=new Array,this.glyph instanceof s.LineView)for(T=this.all_indices,m=0,g=T.length;m<g;m++)_=T[m],null!=E[_]?A.push(_):w.push(_);else for(x=0,y=p.length;x<y;x++)_=p[x],null!=E[this.all_indices[_]]?A.push(_):w.push(_);o=Date.now()-j,N=Date.now(),k.render(t,w,this.glyph),z.render(t,A,this.glyph),null!=this.hover_glyph&&(this.glyph instanceof s.LineView?this.hover_glyph.render(t,this.model.view.convert_indices_from_subset(d),this.glyph):this.hover_glyph.render(t,d,this.glyph)),i=Date.now()-N}else N=Date.now(),this.glyph instanceof s.LineView?this.hover_glyph&&d.length?this.hover_glyph.render(t,this.model.view.convert_indices_from_subset(d),this.glyph):h.render(t,this.all_indices,this.glyph):(h.render(t,p,this.glyph),this.hover_glyph&&d.length&&this.hover_glyph.render(t,d,this.glyph)),i=Date.now()-N;return this.last_dtrender=i,a=Date.now()-C,u.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): render finished in "+a+"ms"),u.logger.trace(" - map_data finished in : "+e+"ms"),null!=n&&u.logger.trace(" - mask_data finished in : "+n+"ms"),null!=o&&u.logger.trace(" - selection mask finished in : "+o+"ms"),u.logger.trace(" - glyph renders finished in : "+i+"ms"),t.restore()}},e.prototype.draw_legend=function(t,e,n,i,r,o,s){var a;return a=this.model.get_reference_point(o,s),this.glyph.draw_legend_for_index(t,e,n,i,r,a)},e.prototype.hit_test=function(t,e,n,i){return void 0===i&&(i="select"),this.model.hit_test_helper(t,this,e,n,i)},e}(o.RendererView);var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),null==this.view.source)return this.view.source=this.data_source,this.view.compute_indices()},e.prototype.get_reference_point=function(t,e){var n,i,r;return r=0,null!=t&&null!=this.data_source.get_column&&(n=this.data_source.get_column(t))&&(i=n.indexOf(e))>0&&(r=i),r},e.prototype.hit_test_helper=function(t,e,n,i,r){var o,s,a,l;return!!this.visible&&(null!==(o=e.glyph.hit_test(t))&&(s=this.view.convert_selection_from_subset(o),"select"===r?((l=this.data_source.selection_manager.selector).update(s,n,i),this.data_source.selected=l.indices,this.data_source.select.emit()):((a=this.data_source.selection_manager.get_or_create_inspector(this)).update(s,!0,!1,!0),this.data_source.setv({inspected:a.indices},{silent:!0}),this.data_source.inspect.emit([e,{geometry:t}])),!s.is_empty()))},e.prototype.get_selection_manager=function(){return this.data_source.selection_manager},e}(o.Renderer);n.GlyphRenderer=p,p.prototype.default_view=n.GlyphRendererView,p.prototype.type="GlyphRenderer",p.define({x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],data_source:[h.Instance],view:[h.Instance,function(){return new l.CDSView}],glyph:[h.Instance],hover_glyph:[h.Instance],nonselection_glyph:[h.Any,"auto"],selection_glyph:[h.Any,"auto"],muted_glyph:[h.Instance],muted:[h.Bool,!1]}),p.override({level:"glyph"}),p.prototype.selection_defaults={fill:{},line:{}},p.prototype.decimated_defaults={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},p.prototype.nonselection_defaults={fill:{fill_alpha:.2,line_alpha:.2},line:{}}},function(t,e,n){var i=t(364),r=t(165),o=t(129),s=t(15),a=t(4);n.GraphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.xscale=this.plot_view.frame.xscales.default,this.yscale=this.plot_view.frame.yscales.default,this._renderer_views={},n=a.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=n[0],this.edge_view=n[1],this.set_data();var n},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return this.set_data()})},e.prototype.set_data=function(t){if(void 0===t&&(t=!0),this.node_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.edge_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),e=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),this.node_view.glyph._x=e[0],this.node_view.glyph._y=e[1],n=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),this.edge_view.glyph._xs=n[0],this.edge_view.glyph._ys=n[1],this.node_view.glyph.index=this.node_view.glyph._index_data(),this.edge_view.glyph.index=this.edge_view.glyph._index_data(),t)return this.request_render();var e,n},e.prototype.render=function(){return this.edge_view.render(),this.node_view.render()},e.prototype.hit_test=function(t,e,n,i){void 0===i&&(i="select");var r,o;return!!this.model.visible&&(!1,"select"===i?null!=(r=this.model.selection_policy)?r.do_selection(t,this,e,n):void 0:null!=(o=this.model.inspection_policy)?o.do_inspection(t,this,e,n):void 0)},e}(r.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e}(r.Renderer);n.GraphRenderer=l,l.prototype.default_view=n.GraphRendererView,l.prototype.type="GraphRenderer",l.define({x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],layout_provider:[s.Instance],node_renderer:[s.Instance],edge_renderer:[s.Instance],selection_policy:[s.Instance,function(){return new o.NodesOnly}],inspection_policy:[s.Instance,function(){return new o.NodesOnly}]}),l.override({level:"glyph"})},function(t,e,n){var i=t(364),r=t(165),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Renderer);n.GuideRenderer=s,s.prototype.type="GuideRenderer",s.define({plot:[o.Instance]}),s.override({level:"overlay"})},function(t,e,n){var i=t(161);n.GlyphRenderer=i.GlyphRenderer;var r=t(162);n.GraphRenderer=r.GraphRenderer;var o=t(163);n.GuideRenderer=o.GuideRenderer;var s=t(165);n.Renderer=s.Renderer},function(t,e,n){var i=t(364),r=t(6),o=t(46),s=t(15),a=t(32),l=t(30),u=t(50),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},e.prototype.request_render=function(){return this.plot_view.request_render()},e.prototype.set_data=function(t){var e;if(e=this.model.materialize_dataspecs(t),l.extend(this,e),this.plot_model.use_map&&(null!=this._x&&(n=a.project_xy(this._x,this._y),this._x=n[0],this._y=n[1]),null!=this._xs))return i=a.project_xsys(this._xs,this._ys),this._xs=i[0],this._ys=i[1],i;var n,i},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},e}(r.DOMView);n.RendererView=h,h.getters({plot_model:function(){return this.plot_view.model}});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u.Model);n.Renderer=c,c.prototype.type="Renderer",c.define({level:[s.RenderLevel,null],visible:[s.Bool,!0]})},function(t,e,n){var i=t(364),r=t(168),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(e){return t.prototype.compute.call(this,this.source_range.synthetic(e))},e.prototype.v_compute=function(e){return t.prototype.v_compute.call(this,this.source_range.v_synthetic(e))},e}(r.LinearScale);n.CategoricalScale=o,o.prototype.type="CategoricalScale"},function(t,e,n){var i=t(166);n.CategoricalScale=i.CategoricalScale;var r=t(168);n.LinearScale=r.LinearScale;var o=t(169);n.LogScale=o.LogScale;var s=t(170);n.Scale=s.Scale},function(t,e,n){var i=t(364),r=t(170),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n;return i=this._compute_state(),e=i[0],n=i[1],e*t+n;var i},e.prototype.v_compute=function(t){var e,n,i,r,o,s,a;for(l=this._compute_state(),e=l[0],o=l[1],s=new Float64Array(t.length),i=n=0,r=t.length;n<r;i=++n)a=t[i],s[i]=e*a+o;return s;var l},e.prototype.invert=function(t){var e,n;return i=this._compute_state(),e=i[0],n=i[1],(t-n)/e;var i},e.prototype.v_invert=function(t){var e,n,i,r,o,s,a;for(l=this._compute_state(),e=l[0],o=l[1],s=new Float64Array(t.length),i=n=0,r=t.length;n<r;i=++n)a=t[i],s[i]=(a-o)/e;return s;var l},e.prototype._compute_state=function(){var t,e,n,i,r,o;return i=this.source_range.start,n=this.source_range.end,o=this.target_range.start,r=this.target_range.end,t=(r-o)/(n-i),e=-t*i+o,[t,e]},e}(r.Scale);n.LinearScale=o,o.prototype.type="LinearScale"},function(t,e,n){var i=t(364),r=t(170),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,r,o,s;return a=this._compute_state(),n=a[0],o=a[1],i=a[2],r=a[3],0===i?s=0:(e=(Math.log(t)-r)/i,s=isFinite(e)?e*n+o:NaN),s;var a},e.prototype.v_compute=function(t){var e,n,i,r,o,s,a,l,u,h,c,_;if(p=this._compute_state(),n=p[0],l=p[1],r=p[2],o=p[3],c=new Float64Array(t.length),0===r)for(i=s=0,u=t.length;0<=u?s<u:s>u;i=0<=u?++s:--s)c[i]=0;else for(i=a=0,h=t.length;0<=h?a<h:a>h;i=0<=h?++a:--a)e=(Math.log(t[i])-o)/r,_=isFinite(e)?e*n+l:NaN,c[i]=_;return c;var p},e.prototype.invert=function(t){var e,n,i,r,o;return s=this._compute_state(),e=s[0],r=s[1],n=s[2],i=s[3],o=(t-r)/e,Math.exp(n*o+i);var s},e.prototype.v_invert=function(t){var e,n,i,r,o,s,a,l,u;for(h=this._compute_state(),e=h[0],s=h[1],i=h[2],r=h[3],l=new Float64Array(t.length),n=o=0,a=t.length;0<=a?o<a:o>a;n=0<=a?++o:--o)u=(t[n]-s)/e,l[n]=Math.exp(i*u+r);return l;var h},e.prototype._get_safe_factor=function(t,e){var n,i,r;return r=t<0?0:t,n=e<0?0:e,r===n&&(0===r?(r=(o=[1,10])[0],n=o[1]):(i=Math.log(r)/Math.log(10),r=Math.pow(10,Math.floor(i)),n=Math.ceil(i)!==Math.floor(i)?Math.pow(10,Math.ceil(i)):Math.pow(10,Math.ceil(i)+1))),[r,n];var o},e.prototype._compute_state=function(){var t,e,n,i,r,o,s,a,l,u,h;return a=this.source_range.start,s=this.source_range.end,h=this.target_range.start,u=this.target_range.end,o=u-h,c=this._get_safe_factor(a,s),l=c[0],t=c[1],0===l?(n=Math.log(t),i=0):(n=Math.log(t)-Math.log(l),i=Math.log(l)),e=o,r=h,[e,r,n,i];var c},e}(r.Scale);n.LogScale=o,o.prototype.type="LogScale"},function(t,e,n){var i=t(364),r=t(238),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.r_compute=function(t,e){return this.target_range.is_reversed?[this.compute(e),this.compute(t)]:[this.compute(t),this.compute(e)]},e.prototype.r_invert=function(t,e){return this.target_range.is_reversed?[this.invert(e),this.invert(t)]:[this.invert(t),this.invert(e)]},e}(r.Transform);n.Scale=s,s.prototype.type="Scale",s.internal({source_range:[o.Any],target_range:[o.Any]})},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=t(178),s=t(14),a=t(15),l=function(t){function e(){var e=t.apply(this,arguments)||this;return e.destroy=e.destroy.bind(e),e.setup=e.setup.bind(e),e.get_data=e.get_data.bind(e),e}return i.__extends(e,t),e.prototype.destroy=function(){if(r(this,e),null!=this.interval)return clearInterval(this.interval)},e.prototype.setup=function(){if(r(this,e),null==this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval))return this.interval=setInterval(this.get_data,this.polling_interval,this.mode,this.max_size,this.if_modified)},e.prototype.get_data=function(t,n,i){var o=this;void 0===n&&(n=0),void 0===i&&(i=!1);var a,l,u,h;r(this,e),(h=new XMLHttpRequest).open(this.method,this.data_url,!0),h.withCredentials=!1,h.setRequestHeader("Content-Type",this.content_type),l=this.http_headers;for(a in l)u=l[a],h.setRequestHeader(a,u);return h.addEventListener("load",function(){var e,i,r,s,a,l;if(200===h.status)switch(i=JSON.parse(h.responseText),t){case"replace":return o.data=i;case"append":for(a=o.data,l=o.columns(),r=0,s=l.length;r<s;r++)e=l[r],i[e]=a[e].concat(i[e]).slice(-n);return o.data=i}}),h.addEventListener("error",function(){return s.logger.error("Failed to fetch JSON from "+o.data_url+" with code "+h.status)}),h.send(),null},e}(o.RemoteDataSource);n.AjaxDataSource=l,l.prototype.type="AjaxDataSource",l.define({mode:[a.String,"replace"],content_type:[a.String,"application/json"],http_headers:[a.Any,{}],max_size:[a.Number],method:[a.String,"POST"],if_modified:[a.Bool,!1]})},function(t,e,n){var i=t(364),r=t(50),o=t(15),s=t(9),a=t(22),l=t(174),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.compute_indices()},e.prototype.connect_signals=function(){var e,n,i;if(t.prototype.connect_signals.call(this),this.connect(this.properties.filters.change,function(){return this.compute_indices(),this.change.emit()}),null!=(null!=(e=this.source)?e.change:void 0)&&this.connect(this.source.change,function(){return this.compute_indices()}),null!=(null!=(n=this.source)?n.streaming:void 0)&&this.connect(this.source.streaming,function(){return this.compute_indices()}),null!=(null!=(i=this.source)?i.patching:void 0))return this.connect(this.source.patching,function(){return this.compute_indices()})},e.prototype.compute_indices=function(){var t,e,n,i;return e=function(){var e,n,i,r;for(i=this.filters,r=[],e=0,n=i.length;e<n;e++)t=i[e],r.push(t.compute_indices(this.source));return r}.call(this),(e=function(){var t,i,r;for(r=[],t=0,i=e.length;t<i;t++)null!=(n=e[t])&&r.push(n);return r}()).length>0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=null!=(i=this.source)?i.get_indices():void 0),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){var t,e,n,i;for(this.indices_map={},i=[],t=e=0,n=this.indices.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this.indices_map[this.indices[t]]=t);return i},e.prototype.convert_selection_from_subset=function(t){var e,n,i;return(i=s.create_hit_test_result()).update_through_union(t),n=function(){var n,i,r,o;for(r=t["1d"].indices,o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(this.indices[e]);return o}.call(this),i["1d"].indices=n,i},e.prototype.convert_selection_to_subset=function(t){var e,n,i;return(i=s.create_hit_test_result()).update_through_union(t),n=function(){var n,i,r,o;for(r=t["1d"].indices,o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(this.indices_map[e]);return o}.call(this),i["1d"].indices=n,i},e.prototype.convert_indices_from_subset=function(t){var e;return function(){var n,i,r;for(r=[],n=0,i=t.length;n<i;n++)e=t[n],r.push(this.indices[e]);return r}.call(this)},e}(r.Model);n.CDSView=u,u.prototype.type="CDSView",u.define({filters:[o.Array,[]],source:[o.Instance]}),u.internal({indices:[o.Array,[]],indices_map:[o.Any,{}]})},function(t,e,n){var i=t(364),r={}.hasOwnProperty,o=t(174),s=t(8),a=t(15),l=t(27),u=t(35),h=t(42);n.concat_typed_arrays=function(t,e){var n;return(n=new t.constructor(t.length+e.length)).set(t,0),n.set(e,t.length),n},n.stream_to_column=function(t,e,i){var r,o,s,a,l,u,h,c,_,p;if(null!=t.concat)return(t=t.concat(e)).length>i&&(t=t.slice(-i)),t;if(p=t.length+e.length,null!=i&&p>i){for(c=p-i,r=t.length,t.length<i&&((_=new t.constructor(i)).set(t,0),t=_),o=s=l=c,u=r;l<=u?s<u:s>u;o=l<=u?++s:--s)t[o-c]=t[o];for(o=a=0,h=e.length;0<=h?a<h:a>h;o=0<=h?++a:--a)t[o+(r-c)]=e[o];return t}return _=new t.constructor(e),n.concat_typed_arrays(t,_)},n.slice=function(t,e){var n,i,r;return h.isObject(t)?[null!=(n=t.start)?n:0,null!=(i=t.stop)?i:e,null!=(r=t.step)?r:1]:(o=[t,t+1,1],o[0],o[1],o[2],o);var o},n.patch_to_column=function(t,e,i){var r,o,s,a,u,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E;for(x=new l.Set,w=!1,v=0,g=e.length;v<g;v++)for(z=e[v],s=z[0],E=z[1],h.isArray(s)?(x.push(s[0]),A=i[s[0]],_=t[s[0]]):(h.isNumber(s)?(E=[E],x.push(s)):w=!0,s=[0,0,s],A=[1,t.length],_=t),2===s.length&&(A=[1,A[0]],s=[s[0],0,s[1]]),r=0,C=n.slice(s[1],A[0]),a=C[0],c=C[1],u=C[2],O=n.slice(s[2],A[1]),d=O[0],m=O[1],f=O[2],o=y=a,k=c,S=u;S>0?y<k:y>k;o=y+=S)for(p=b=d,T=m,M=f;M>0?b<T:b>T;p=b+=M)w&&x.push(p),_[o*A[1]+p]=E[r],r++;return x;var z,C,O};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),n=u.decode_column_data(this.data),this.data=n[0],this._shapes=n[1],n;var n},e.prototype.attributes_as_json=function(t,n){void 0===t&&(t=!0),void 0===n&&(n=e._value_to_json);var i,o,s,a;i={},s=this.serializable_attributes();for(o in s)r.call(s,o)&&(a=s[o],"data"===o&&(a=u.encode_column_data(a,this._shapes)),t?i[o]=a:o in this._set_after_defaults&&(i[o]=a));return n("attributes",i,this)},e._value_to_json=function(t,e,n){return h.isObject(e)&&"data"===t?u.encode_column_data(e,n._shapes):s.HasProps._value_to_json(t,e,n)},e.prototype.stream=function(t,e){var i,r;i=this.data;for(r in t)t[r],i[r]=n.stream_to_column(i[r],t[r],e);return this.setv({data:i},{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e,i,r,o;e=this.data,o=new l.Set;for(i in t)r=t[i],o=o.union(n.patch_to_column(e[i],r,this._shapes[i]));return this.setv({data:e},{silent:!0}),this.patching.emit(o.values)},e}(o.ColumnarDataSource);n.ColumnDataSource=c,c.prototype.type="ColumnDataSource",c.define({data:[a.Any,{}]})},function(t,e,n){var i=t(364),r=t(175),o=t(20),s=t(14),a=t(17),l=t(15),u=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.select=new o.Signal(this,"select"),this.inspect=new o.Signal(this,"inspect"),this.streaming=new o.Signal(this,"streaming"),this.patching=new o.Signal(this,"patching")},e.prototype.get_column=function(t){var e;return null!=(e=this.data[t])?e:null},e.prototype.columns=function(){return Object.keys(this.data)},e.prototype.get_length=function(t){void 0===t&&(t=!0);var e,n,i,r;switch((n=u.uniq(function(){var t,n;t=this.data,n=[];for(e in t)r=t[e],n.push(r.length);return n}.call(this))).length){case 0:return null;case 1:return n[0];default:if(i="data source has columns of inconsistent lengths",t)return s.logger.warn(i),n.sort()[0];throw new Error(i)}},e.prototype.get_indices=function(){var t,e;return null==(t=this.get_length())&&(t=1),function(){e=[];for(var n=0;0<=t?n<t:n>t;0<=t?n++:n--)e.push(n);return e}.apply(this)},e}(r.DataSource);n.ColumnarDataSource=h,h.prototype.type="ColumnarDataSource",h.define({column_names:[l.Array,[]]}),h.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Any],_shapes:[l.Any,{}]})},function(t,e,n){var i=t(364),r=t(50),o=t(9),s=t(15),a=t(42),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.properties.selected.change,function(){var t;if(null!=(t=n.callback))return a.isFunction(t)?t(n):t.execute(n)})},e}(r.Model);n.DataSource=l,l.prototype.type="DataSource",l.define({selected:[s.Any,o.create_hit_test_result()],callback:[s.Any]})},function(t,e,n){var i=t(364),r=t(174),o=t(14),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this._update_data(),this.connect(this.properties.geojson.change,function(){return n._update_data()})},e.prototype._update_data=function(){return this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){var e,n,i;for(i=[],e=0,n=t;0<=n?e<n:e>n;0<=n?++e:--e)i.push([]);return i},e.prototype._get_new_nan_array=function(t){var e,n,i;for(i=[],e=0,n=t;0<=n?e<n:e>n;0<=n?++e:--e)i.push(NaN);return i},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,n,i){var r,o;o=[];for(r in t.properties)e.hasOwnProperty(r)||(e[r]=this._get_new_nan_array(i)),o.push(e[r][n]=t.properties[r]);return o},e.prototype._add_geometry=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;switch(t.type){case"Point":return r=t.coordinates,e.x[n]=r[0],e.y[n]=r[1],e.z[n]=null!=(x=r[2])?x:NaN;case"LineString":for(i=t.coordinates,A=[],u=h=0,_=i.length;h<_;u=++h)r=i[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],A.push(e.zs[n][u]=null!=(w=r[2])?w:NaN);return A;case"Polygon":for(t.coordinates.length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),s=t.coordinates[0],E=[],u=c=0,p=s.length;c<p;u=++c)r=s[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],E.push(e.zs[n][u]=null!=(k=r[2])?k:NaN);return E;case"MultiPoint":return o.logger.warn("MultiPoint not supported in Bokeh");case"MultiLineString":for(l=t.coordinates.reduce(this._flatten_function),z=[],u=v=0,d=l.length;v<d;u=++v)r=l[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],z.push(e.zs[n][u]=null!=(S=r[2])?S:NaN);return z;case"MultiPolygon":for(a=[],T=t.coordinates,g=0,f=T.length;g<f;g++)(b=T[g]).length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),a.push(b[0]);for(l=a.reduce(this._flatten_function),C=[],u=y=0,m=l.length;y<m;u=++y)r=l[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],C.push(e.zs[n][u]=null!=(M=r[2])?M:NaN);return C;default:throw new Error("Invalid type "+t.type)}},e.prototype._get_items_length=function(t){var e,n,i,r,o,s,a,l,u,h;for(e=0,i=s=0,l=t.length;s<l;i=++s)if(r=t[i],"GeometryCollection"===(n="Feature"===r.type?r.geometry:r).type)for(h=n.geometries,o=a=0,u=h.length;a<u;o=++a)h[o],e+=1;else e+=1;return e},e.prototype.geojson_to_column_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f;if(i=JSON.parse(this.geojson),"GeometryCollection"!==(d=i.type)&&"FeatureCollection"!==d)throw new Error("Bokeh only supports type GeometryCollection and FeatureCollection at top level");if("GeometryCollection"===i.type){if(null==i.geometries)throw new Error("No geometries found in GeometryCollection");if(0===i.geometries.length)throw new Error("geojson.geometries must have one or more items");l=i.geometries}if("FeatureCollection"===i.type){if(null==i.features)throw new Error("No features found in FeaturesCollection");if(0===i.features.length)throw new Error("geojson.features must have one or more items");l=i.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,o=h=0,_=l.length;h<_;o=++h)if(s=l[o],"GeometryCollection"===(r="Feature"===s.type?s.geometry:s).type)for(f=r.geometries,u=c=0,p=f.length;c<p;u=++c)n=f[u],this._add_geometry(n,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;else this._add_geometry(r,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;return e},e}(r.ColumnarDataSource);n.GeoJSONDataSource=a,a.prototype.type="GeoJSONDataSource",a.define({geojson:[s.Any]}),a.internal({data:[s.Any,{}]})},function(t,e,n){var i=t(171);n.AjaxDataSource=i.AjaxDataSource;var r=t(173);n.ColumnDataSource=r.ColumnDataSource;var o=t(174);n.ColumnarDataSource=o.ColumnarDataSource;var s=t(172);n.CDSView=s.CDSView;var a=t(175);n.DataSource=a.DataSource;var l=t(176);n.GeoJSONDataSource=l.GeoJSONDataSource;var u=t(178);n.RemoteDataSource=u.RemoteDataSource},function(t,e,n){var i=t(364),r=t(173),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ColumnDataSource);n.RemoteDataSource=s,s.prototype.type="RemoteDataSource",s.define({data_url:[o.String],polling_interval:[o.Number]})},function(t,e,n){var i=t(364),r=t(183),o=t(15),s=t(22),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n);var i=s.nth(this.mantissas,-1)/this.base,r=s.nth(this.mantissas,0)*this.base;this.extended_mantissas=[i].concat(this.mantissas,[r]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},e.prototype.get_interval=function(t,e,n){var i=e-t,r=this.get_ideal_interval(t,e,n),o=Math.floor(function(t,e){void 0===e&&(e=Math.E);return Math.log(t)/Math.log(e)}(r/this.base_factor,this.base)),a=Math.pow(this.base,o)*this.base_factor,l=this.extended_mantissas,u=l.map(function(t){return Math.abs(n-i/(t*a))}),h=l[s.argmin(u)],c=h*a;return function(t,e,n){return Math.max(e,Math.min(n,t))}(c,this.get_min_interval(),this.get_max_interval())},e}(r.ContinuousTicker);n.AdaptiveTicker=a,a.prototype.type="AdaptiveTicker",a.define({base:[o.Number,10],mantissas:[o.Array,[1,2,5]],min_interval:[o.Number,0],max_interval:[o.Number]})},function(t,e,n){var i=t(364),r=t(179),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.AdaptiveTicker);n.BasicTicker=o,o.prototype.type="BasicTicker"},function(t,e,n){var i=t(364),r=t(192),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks=function(t,e,n,i,r){var o=this._collect(n.factors,n,t,e),s=this._collect(n.tops||[],n,t,e),a=this._collect(n.mids||[],n,t,e);return{major:o,minor:[],tops:s,mids:a}},e.prototype._collect=function(t,e,n,i){for(var r=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e.synthetic(a);l>n&&l<i&&r.push(a)}return r},e}(r.Ticker);n.CategoricalTicker=o,o.prototype.type="CategoricalTicker"},function(t,e,n){var i=t(364),r=t(183),o=t(15),s=t(22),a=t(30),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),Object.defineProperty(e.prototype,"min_intervals",{get:function(){return this.tickers.map(function(t){return t.get_min_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max_intervals",{get:function(){return this.tickers.map(function(t){return t.get_max_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min_interval",{get:function(){return this.min_intervals[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max_interval",{get:function(){return this.max_intervals[0]},enumerable:!0,configurable:!0}),e.prototype.get_best_ticker=function(t,e,n){var i,r=e-t,o=this.get_ideal_interval(t,e,n),l=[s.sortedIndex(this.min_intervals,o)-1,s.sortedIndex(this.max_intervals,o)],u=[this.min_intervals[l[0]],this.max_intervals[l[1]]],h=u.map(function(t){return Math.abs(n-r/t)});if(a.isEmpty(h.filter(function(t){return!isNaN(t)})))i=this.tickers[0];else{var c=s.argmin(h),_=l[c];i=this.tickers[_]}return i},e.prototype.get_interval=function(t,e,n){var i=this.get_best_ticker(t,e,n);return i.get_interval(t,e,n)},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=this.get_best_ticker(t,e,i);return r.get_ticks_no_defaults(t,e,n,i)},e}(r.ContinuousTicker);n.CompositeTicker=l,l.prototype.type="CompositeTicker",l.define({tickers:[o.Array,[]]})},function(t,e,n){var i=t(364),r=t(192),o=t(15),s=t(22),a=t(42),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks=function(t,e,n,i,r){return this.get_ticks_no_defaults(t,e,i,this.desired_num_ticks)},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=this.get_interval(t,e,i),o=Math.floor(t/r),l=Math.ceil(e/r),u=(a.isStrictNaN(o)||a.isStrictNaN(l)?[]:s.range(o,l+1)).map(function(t){return t*r}).filter(function(n){return t<=n&&n<=e}),h=this.num_minor_ticks,c=[];if(h>0&&u.length>0){for(var _=r/h,p=s.range(0,h).map(function(t){return t*_}),d=0,f=p.slice(1);d<f.length;d++){var m=f[d];c.push(u[0]-m)}for(var v=0,g=u;v<g.length;v++)for(var y=g[v],b=0,x=p;b<x.length;b++){var m=x[b];c.push(y+m)}}return{major:u,minor:c}},e.prototype.get_min_interval=function(){return this.min_interval},e.prototype.get_max_interval=function(){return null!=this.max_interval?this.max_interval:1/0},e.prototype.get_ideal_interval=function(t,e,n){var i=e-t;return i/n},e}(r.Ticker);n.ContinuousTicker=l,l.prototype.type="ContinuousTicker",l.define({num_minor_ticks:[o.Number,5],desired_num_ticks:[o.Number,6]})},function(t,e,n){var i=t(364),r=t(22),o=t(179),s=t(182),a=t(185),l=t(190),u=t(194),h=t(193),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.CompositeTicker);n.DatetimeTicker=c,c.prototype.type="DatetimeTicker",c.override({num_minor_ticks:0,tickers:function(){return[new o.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*h.ONE_MILLI,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:h.ONE_SECOND,max_interval:30*h.ONE_MINUTE,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:h.ONE_HOUR,max_interval:12*h.ONE_HOUR,num_minor_ticks:0}),new a.DaysTicker({days:r.range(1,32)}),new a.DaysTicker({days:r.range(1,31,3)}),new a.DaysTicker({days:[1,8,15,22]}),new a.DaysTicker({days:[1,15]}),new l.MonthsTicker({months:r.range(0,12,1)}),new l.MonthsTicker({months:r.range(0,12,2)}),new l.MonthsTicker({months:r.range(0,12,4)}),new l.MonthsTicker({months:r.range(0,12,6)}),new u.YearsTicker({})]}})},function(t,e,n){var i=t(364),r=t(191),o=t(193),s=t(15),a=t(22),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){e.num_minor_ticks=0,t.prototype.initialize.call(this,e,n);var i=this.days;i.length>1?this.interval=(i[1]-i[0])*o.ONE_DAY:this.interval=31*o.ONE_DAY},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=function(t,e){var n=o.last_month_no_later_than(new Date(t)),i=o.last_month_no_later_than(new Date(e));i.setUTCMonth(i.getUTCMonth()+1);var r=[],s=n;for(;r.push(o.copy_date(s)),s.setUTCMonth(s.getUTCMonth()+1),!(s>i););return r}(t,e),s=this.days,l=this.interval,u=a.concat(r.map(function(t){return function(t,e){for(var n=[],i=0,r=s;i<r.length;i++){var a=r[i],l=o.copy_date(t);l.setUTCDate(a);var u=new Date(l.getTime()+e/2);u.getUTCMonth()==t.getUTCMonth()&&n.push(l)}return n}(t,l)})),h=u.map(function(t){return t.getTime()}),c=h.filter(function(n){return t<=n&&n<=e});return{major:c,minor:[]}},e}(r.SingleIntervalTicker);n.DaysTicker=l,l.prototype.type="DaysTicker",l.define({days:[s.Array,[]]})},function(t,e,n){var i=t(364),r=t(183),o=t(15),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.min_interval=0,e.max_interval=0,e}return i.__extends(e,t),e.prototype.get_ticks_no_defaults=function(t,e,n,i){return{major:this.ticks,minor:[]}},e.prototype.get_interval=function(t,e,n){return 0},e}(r.ContinuousTicker);n.FixedTicker=s,s.prototype.type="FixedTicker",s.define({ticks:[o.Array,[]]})},function(t,e,n){var i=t(179);n.AdaptiveTicker=i.AdaptiveTicker;var r=t(180);n.BasicTicker=r.BasicTicker;var o=t(181);n.CategoricalTicker=o.CategoricalTicker;var s=t(182);n.CompositeTicker=s.CompositeTicker;var a=t(183);n.ContinuousTicker=a.ContinuousTicker;var l=t(184);n.DatetimeTicker=l.DatetimeTicker;var u=t(185);n.DaysTicker=u.DaysTicker;var h=t(186);n.FixedTicker=h.FixedTicker;var c=t(188);n.LogTicker=c.LogTicker;var _=t(189);n.MercatorTicker=_.MercatorTicker;var p=t(190);n.MonthsTicker=p.MonthsTicker;var d=t(191);n.SingleIntervalTicker=d.SingleIntervalTicker;var f=t(192);n.Ticker=f.Ticker;var m=t(194);n.YearsTicker=m.YearsTicker},function(t,e,n){var i=t(364),r=t(22),o=t(179),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks_no_defaults=function(t,e,n,i){var o,s=this.num_minor_ticks,a=[],l=this.base,u=Math.log(t)/Math.log(l),h=Math.log(e)/Math.log(l),c=h-u;if(isFinite(c))if(c<2){var _=this.get_interval(t,e,i),p=Math.floor(t/_),d=Math.ceil(e/_);if(o=r.range(p,d+1).filter(function(t){return 0!=t}).map(function(t){return t*_}).filter(function(n){return t<=n&&n<=e}),s>0&&o.length>0){for(var f=_/s,m=r.range(0,s).map(function(t){return t*f}),v=0,g=m.slice(1);v<g.length;v++){var y=g[v];a.push(o[0]-y)}for(var b=0,x=o;b<x.length;b++)for(var w=x[b],k=0,S=m;k<S.length;k++){var y=S[k];a.push(w+y)}}}else{var T=Math.ceil(.999999*u),M=Math.floor(1.000001*h),A=Math.ceil((M-T)/9);if(o=r.range(T,M+1,A).map(function(t){return Math.pow(l,t)}).filter(function(n){return t<=n&&n<=e}),s>0&&o.length>0){for(var E=Math.pow(l,A)/s,m=r.range(1,s+1).map(function(t){return t*E}),z=0,C=m;z<C.length;z++){var y=C[z];a.push(o[0]/y)}a.push(o[0]);for(var O=0,N=o;O<N.length;O++)for(var w=N[O],j=0,P=m;j<P.length;j++){var y=P[j];a.push(w*y)}}}else o=[];return{major:o,minor:a}},e}(o.AdaptiveTicker);n.LogTicker=s,s.prototype.type="LogTicker",s.override({mantissas:[1,5]})},function(t,e,n){var i=t(364),r=t(180),o=t(15),s=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks_no_defaults=function(e,n,i,r){if(null==this.dimension)throw new Error("MercatorTicker.dimension not configured");T=s.clip_mercator(e,n,this.dimension),e=T[0],n=T[1];var o,a,l;"lon"===this.dimension?(M=s.proj4(s.mercator).inverse([e,i]),o=M[0],l=M[1],A=s.proj4(s.mercator).inverse([n,i]),a=A[0],l=A[1]):(E=s.proj4(s.mercator).inverse([i,e]),l=E[0],o=E[1],z=s.proj4(s.mercator).inverse([i,n]),l=z[0],a=z[1]);var u=t.prototype.get_ticks_no_defaults.call(this,o,a,i,r),h=[],c=[];if("lon"===this.dimension){for(var _=0,p=u.major;_<p.length;_++){var d=p[_];if(s.in_bounds(d,"lon")){var f=s.proj4(s.mercator).forward([d,l])[0];h.push(f)}}for(var m=0,v=u.minor;m<v.length;m++){var d=v[m];if(s.in_bounds(d,"lon")){var f=s.proj4(s.mercator).forward([d,l])[0];c.push(f)}}}else{for(var g=0,y=u.major;g<y.length;g++){var d=y[g];if(s.in_bounds(d,"lat")){var b=s.proj4(s.mercator).forward([l,d]),x=b[1];h.push(x)}}for(var w=0,k=u.minor;w<k.length;w++){var d=k[w];if(s.in_bounds(d,"lat")){var S=s.proj4(s.mercator).forward([l,d]),x=S[1];c.push(x)}}}return{major:h,minor:c};var T,M,A,E,z},e}(r.BasicTicker);n.MercatorTicker=a,a.prototype.type="MercatorTicker",a.define({dimension:[o.LatLon]})},function(t,e,n){var i=t(364),r=t(191),o=t(193),s=t(15),a=t(22),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n);var i=this.months;i.length>1?this.interval=(i[1]-i[0])*o.ONE_MONTH:this.interval=12*o.ONE_MONTH},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=function(t,e){var n=o.last_year_no_later_than(new Date(t)),i=o.last_year_no_later_than(new Date(e));i.setUTCFullYear(i.getUTCFullYear()+1);var r=[],s=n;for(;r.push(o.copy_date(s)),s.setUTCFullYear(s.getUTCFullYear()+1),!(s>i););return r}(t,e),s=this.months,l=a.concat(r.map(function(t){return s.map(function(e){var n=o.copy_date(t);return n.setUTCMonth(e),n})})),u=l.map(function(t){return t.getTime()}),h=u.filter(function(n){return t<=n&&n<=e});return{major:h,minor:[]}},e}(r.SingleIntervalTicker);n.MonthsTicker=l,l.prototype.type="MonthsTicker",l.define({months:[s.Array,[]]})},function(t,e,n){var i=t(364),r=t(183),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_interval=function(t,e,n){return this.interval},Object.defineProperty(e.prototype,"min_interval",{get:function(){return this.interval},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max_interval",{get:function(){return this.interval},enumerable:!0,configurable:!0}),e}(r.ContinuousTicker);n.SingleIntervalTicker=s,s.prototype.type="SingleIntervalTicker",s.define({interval:[o.Number]})},function(t,e,n){var i=t(364),r=t(50),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Model);n.Ticker=o,o.prototype.type="Ticker"},function(t,e,n){function i(t){return new Date(t.getTime())}function r(t){var e=i(t);return e.setUTCDate(1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}n.ONE_MILLI=1,n.ONE_SECOND=1e3,n.ONE_MINUTE=60*n.ONE_SECOND,n.ONE_HOUR=60*n.ONE_MINUTE,n.ONE_DAY=24*n.ONE_HOUR,n.ONE_MONTH=30*n.ONE_DAY,n.ONE_YEAR=365*n.ONE_DAY,n.copy_date=i,n.last_month_no_later_than=r,n.last_year_no_later_than=function(t){var e=r(t);return e.setUTCMonth(0),e}},function(t,e,n){var i=t(364),r=t(180),o=t(191),s=t(193),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.interval=s.ONE_YEAR,this.basic_ticker=new r.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=s.last_year_no_later_than(new Date(t)).getUTCFullYear(),o=s.last_year_no_later_than(new Date(e)).getUTCFullYear(),a=this.basic_ticker.get_ticks_no_defaults(r,o,n,i).major,l=a.map(function(t){return Date.UTC(t,0,1)}),u=l.filter(function(n){return t<=n&&n<=e});return{major:u,minor:[]}},e}(o.SingleIntervalTicker);n.YearsTicker=a,a.prototype.type="YearsTicker"},function(t,e,n){var i=t(364),r=t(200),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r,o,s,a;return i=this.string_lookup_replace(this.url,this.extra_url_vars),this.use_latlon?(l=this.get_tile_geographic_bounds(t,e,n),o=l[0],a=l[1],r=l[2],s=l[3]):(u=this.get_tile_meter_bounds(t,e,n),o=u[0],a=u[1],r=u[2],s=u[3]),i.replace("{XMIN}",o).replace("{YMIN}",a).replace("{XMAX}",r).replace("{YMAX}",s);var l,u},e}(r.MercatorTileSource);n.BBoxTileSource=s,s.prototype.type="BBoxTileSource",s.define({use_latlon:[o.Bool,!1]})},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=t(165),s=t(14),a=t(15);n.DynamicImageView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._on_image_load=e._on_image_load.bind(e),e._on_image_error=e._on_image_error.bind(e),e}return i.__extends(e,t),e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.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.x_range,this.y_range=this.map_plot.y_range,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 n;if(r(this,e),n=t.target.image_data,n.img=t.target,n.loaded=!0,this.lastImage=n,this.get_extent().join(":")===n.cache_key)return this.request_render()},e.prototype._on_image_error=function(t){var n;return r(this,e),s.logger.error("Error loading image: "+t.target.src),n=t.target.image_data,this.model.image_source.remove_image(n)},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.model.image_source.add_image(e.image_data),e.src=this.model.image_source.get_image_url(t[0],t[1],t[2],t[3],Math.ceil(this.map_frame._height.value),Math.ceil(this.map_frame._width.value)),e},e.prototype.render=function(t,e,n){var i,r,o=this;if(null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),i=this.get_extent(),this.render_timer&&clearTimeout(this.render_timer),null==(r=this.model.image_source.images[i.join(":")])||!r.loaded)return null!=this.lastImage&&this._draw_image(this.lastImage.cache_key),null==r?this.render_timer=setTimeout(function(){return o._create_image(i)},125):void 0;this._draw_image(i.join(":"))},e.prototype._draw_image=function(t){var e,n,i,r,o,s,a,l,u;if(null!=(e=this.model.image_source.images[t]))return this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,h=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),s=h[0],u=h[1],c=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),o=c[0],l=c[1],s=s[0],u=u[0],o=o[0],l=l[0],i=o-s,n=l-u,r=s,a=u,this.map_canvas.drawImage(e.img,r,a,i,n),this.map_canvas.restore();var h,c},e.prototype._set_rect=function(){var t,e,n,i,r;return n=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+n/2,i=this.map_frame._top.value+n/2,r=this.map_frame._width.value-n,t=this.map_frame._height.value-n,this.map_canvas.rect(e,i,r,t),this.map_canvas.clip()},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Renderer);n.DynamicImageRenderer=l,l.prototype.default_view=n.DynamicImageView,l.prototype.type="DynamicImageRenderer",l.define({alpha:[a.Number,1],image_source:[a.Instance],render_parents:[a.Bool,!0]}),l.override({level:"underlay"})},function(t,e,n){n.ImagePool=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t;return null!=(t=this.images.pop())?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}()},function(t,e,n){var i=t(364),r=t(15),o=t(50),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.images={},this.normalize_case()},e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.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.url=t},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace("{"+n+"}",r.toString());return i},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,n,i,r,o){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{XMIN}",t).replace("{YMIN}",e).replace("{XMAX}",n).replace("{YMAX}",i).replace("{WIDTH}",o).replace("{HEIGHT}",r)},e}(o.Model);n.ImageSource=s,s.prototype.type="ImageSource",s.define({url:[r.String,""],extra_url_vars:[r.Any,{}]})},function(t,e,n){var i=t(195);n.BBoxTileSource=i.BBoxTileSource;var r=t(196);n.DynamicImageRenderer=r.DynamicImageRenderer;var o=t(198);n.ImageSource=o.ImageSource;var s=t(200);n.MercatorTileSource=s.MercatorTileSource;var a=t(201);n.QUADKEYTileSource=a.QUADKEYTileSource;var l=t(202);n.TileRenderer=l.TileRenderer;var u=t(203);n.TileSource=u.TileSource;var h=t(205);n.TMSTileSource=h.TMSTileSource;var c=t(206);n.WMTSTileSource=c.WMTSTileSource},function(t,e,n){var i=t(364),r=[].indexOf,o=t(203),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n;return t.prototype.initialize.call(this,e),this._resolutions=function(){var t,e,i,r;for(r=[],n=t=e=this.min_zoom,i=this.max_zoom;e<=i?t<=i:t>=i;n=e<=i?++t:--t)r.push(this.get_resolution(n));return r}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},e.prototype.is_valid_tile=function(t,e,n){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,n)))&&!(e<0||e>=Math.pow(2,n))},e.prototype.retain_children=function(t){var e,n,i,r,o,s,a;r=t.quadkey,i=r.length,n=i+3,o=this.tiles,s=[];for(e in o)0===(a=o[e]).quadkey.indexOf(r)&&a.quadkey.length>i&&a.quadkey.length<=n?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d;f=t.tile_coords,h=f[0],c=f[1],_=f[2],n=function(){var t,e,n,i;for(i=[],p=t=e=h-4,n=h+4;e<=n?t<=n:t>=n;p=e<=n?++t:--t)i.push(p);return i}(),i=function(){var t,e,n,i;for(i=[],d=t=e=c-4,n=c+4;e<=n?t<=n:t>=n;d=e<=n?++t:--t)i.push(d);return i}(),o=this.tiles,l=[];for(e in o)(u=o[e]).tile_coords[2]===_&&(s=u.tile_coords[0],r.call(n,s)>=0)&&(a=u.tile_coords[1],r.call(i,a)>=0)?l.push(u.retain=!0):l.push(void 0);return l;var f},e.prototype.retain_parents=function(t){var e,n,i,r,o;n=t.quadkey,i=this.tiles,r=[];for(e in i)o=i[e],r.push(o.retain=0===n.indexOf(o.quadkey));return r},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a,l;for(0!==(l=this.calculate_world_x_by_tile_xyz(t,e,n))&&(u=this.normalize_xyz(t,e,n),t=u[0],e=u[1],n=u[2]),a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)h=this.quadkey_to_tile_xyz(a+o.toString()),t=h[0],e=h[1],n=h[2],0!==l&&(c=this.denormalize_xyz(t,e,n,l),t=c[0],e=c[1],n=c[2]),null!=(i=this.get_tile_meter_bounds(t,e,n))&&r.push([t,e,n,i]);return r;var u,h,c},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,n){var i,r;return i=(t[2]-t[0])/n,r=(t[3]-t[1])/e,[i,r]},e.prototype.get_level_by_extent=function(t,e,n){var i,r,o,s,a,l,u,h;for(u=(t[2]-t[0])/n,h=(t[3]-t[1])/e,l=Math.max(u,h),i=0,a=this._resolutions,r=0,o=a.length;r<o;r++){if(s=a[r],l>s){if(0===i)return 0;if(i>0)return i-1}i+=1}},e.prototype.get_closest_level_by_extent=function(t,e,n){var i,r,o,s;return o=(t[2]-t[0])/n,s=(t[3]-t[1])/e,r=Math.max(o,s),this._resolutions,i=this._resolutions.reduce(function(t,e){return Math.abs(e-r)<Math.abs(t-r)?e:t}),this._resolutions.indexOf(i)},e.prototype.snap_to_zoom=function(t,e,n,i){var r,o,s,a,l,u,h,c,_;return r=this._resolutions[i],o=n*r,s=e*r,u=t[0],_=t[1],l=t[2],c=t[3],a=(o-(l-u))/2,h=(s-(c-_))/2,[u-a,_-h,l+a,c+h]},e.prototype.tms_to_wmts=function(t,e,n){"Note this works both ways";return[t,Math.pow(2,n)-1-e,n]},e.prototype.wmts_to_tms=function(t,e,n){"Note this works both ways";return[t,Math.pow(2,n)-1-e,n]},e.prototype.pixels_to_meters=function(t,e,n){var i,r,o;return o=this.get_resolution(n),i=t*o-this.x_origin_offset,r=e*o-this.y_origin_offset,[i,r]},e.prototype.meters_to_pixels=function(t,e,n){var i,r,o;return o=this.get_resolution(n),i=(t+this.x_origin_offset)/o,r=(e+this.y_origin_offset)/o,[i,r]},e.prototype.pixels_to_tile=function(t,e){var n,i;return n=Math.ceil(t/parseFloat(this.tile_size)),n=0===n?n:n-1,i=Math.max(Math.ceil(e/parseFloat(this.tile_size))-1,0),[n,i]},e.prototype.pixels_to_raster=function(t,e,n){var i;return i=this.tile_size<<n,[t,i-e]},e.prototype.meters_to_tile=function(t,e,n){var i,r;return o=this.meters_to_pixels(t,e,n),i=o[0],r=o[1],this.pixels_to_tile(i,r);var o},e.prototype.get_tile_meter_bounds=function(t,e,n){var i,r,o,s;return a=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,n),r=a[0],s=a[1],l=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,n),i=l[0],o=l[1],null!=r&&null!=s&&null!=i&&null!=o?[r,s,i,o]:void 0;var a,l},e.prototype.get_tile_geographic_bounds=function(t,e,n){var i,r,o,s,a;return i=this.get_tile_meter_bounds(t,e,n),l=this.utils.meters_extent_to_geographic(i),a=l[0],s=l[1],o=l[2],r=l[3],[a,s,o,r];var l},e.prototype.get_tiles_by_extent=function(t,e,n){void 0===n&&(n=1);var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v;for(f=t[0],v=t[1],d=t[2],m=t[3],g=this.meters_to_tile(f,v,e),h=g[0],p=g[1],y=this.meters_to_tile(d,m,e),u=y[0],_=y[1],h-=n,u+=n,a=[],c=i=_+=n,o=p-=n;i>=o;c=i+=-1)for(l=r=h,s=u;r<=s;l=r+=1)this.is_valid_tile(l,c,e)&&a.push([l,c,e,this.get_tile_meter_bounds(l,c,e)]);return a=this.sort_tiles_from_center(a,[h,p,u,_]);var g,y},e.prototype.quadkey_to_tile_xyz=function(t){"Computes tile x, y and z values based on quadKey.";var e,n,i,r,o,s,a;for(r=0,o=0,s=t.length,e=n=s;n>0;e=n+=-1)switch(a=t.charAt(s-e),i=1<<e-1,a){case"0":continue;case"1":r|=i;break;case"2":o|=i;break;case"3":r|=i,o|=i;break;default:throw new TypeError("Invalid Quadkey: "+t)}return[r,o,s]},e.prototype.tile_xyz_to_quadkey=function(t,e,n){"Computes quadkey value based on tile x, y and z values.";var i,r,o,s,a;for(a="",r=o=n;o>0;r=o+=-1)i=0,0!=(t&(s=1<<r-1))&&(i+=1),0!=(e&s)&&(i+=2),a+=i.toString();return a},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a;for(a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)l=this.quadkey_to_tile_xyz(a+o.toString()),t=l[0],e=l[1],n=l[2],null!=(i=this.get_tile_meter_bounds(t,e,n))&&r.push([t,e,n,i]);return r;var l},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_closest_parent_by_tile_xyz=function(t,e,n){var i,r;for(r=this.calculate_world_x_by_tile_xyz(t,e,n),o=this.normalize_xyz(t,e,n),t=o[0],e=o[1],n=o[2],i=this.tile_xyz_to_quadkey(t,e,n);i.length>0;)if(i=i.substring(0,i.length-1),s=this.quadkey_to_tile_xyz(i),t=s[0],e=s[1],n=s[2],a=this.denormalize_xyz(t,e,n,r),t=a[0],e=a[1],n=a[2],this.tile_xyz_to_key(t,e,n)in this.tiles)return[t,e,n];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,n){var i;return this.wrap_around?(i=Math.pow(2,n),[(t%i+i)%i,e,n]):[t,e,n]},e.prototype.denormalize_xyz=function(t,e,n,i){return[t+i*Math.pow(2,n),e,n]},e.prototype.denormalize_meters=function(t,e,n,i){return[t+2*i*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,n){return Math.floor(t/Math.pow(2,n))},e}(o.TileSource);n.MercatorTileSource=a,a.prototype.type="MercatorTileSource",a.define({wrap_around:[s.Bool,!0]}),a.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(t,e,n){var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r;return i=this.string_lookup_replace(this.url,this.extra_url_vars),o=this.tms_to_wmts(t,e,n),t=o[0],e=o[1],n=o[2],r=this.tile_xyz_to_quadkey(t,e,n),i.replace("{Q}",r);var o},e}(r.MercatorTileSource);n.QUADKEYTileSource=o,o.prototype.type="QUADKEYTileSource"},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=[].indexOf,s=t(197),a=t(206),l=t(165),u=t(5),h=t(15),c=t(42);n.TileRendererView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._add_attribution=e._add_attribution.bind(e),e._on_tile_load=e._on_tile_load.bind(e),e._on_tile_cache_load=e._on_tile_cache_load.bind(e),e._on_tile_error=e._on_tile_error.bind(e),e._prefetch_tiles=e._prefetch_tiles.bind(e),e._update=e._update.bind(e),e}return i.__extends(e,t),e.prototype.initialize=function(e){return this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.pool=new s.ImagePool,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.x_range,this.y_range=this.map_plot.y_range,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t,n,i,o;if(r(this,e),t=this.model.tile_source.attribution,c.isString(t)&&t.length>0)return null==this.attributionEl&&(o=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,n=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,i=this.map_frame._width.value,this.attributionEl=u.div({class:"bk-tile-attribution",style:{position:"absolute",bottom:n+"px",right:o+"px","max-width":i+"px",padding:"2px","background-color":"rgba(255,255,255,0.8)","font-size":"9pt","font-family":"sans-serif"}}),this.plot_view.canvas_view.events_el.appendChild(this.attributionEl)),this.attributionEl.innerHTML=t},e.prototype._map_data=function(){var t,e;return this.initial_extent=this.get_extent(),e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),t=this.model.tile_source.snap_to_zoom(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,e),this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this._add_attribution()},e.prototype._on_tile_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.current=!0,n.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.loaded=!0,n.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){var n;return r(this,e),n=t.target.tile_data,n.finished=!0},e.prototype._create_tile=function(t,e,n,i,r){void 0===r&&(r=!1);var o,s;return o=this.model.tile_source.normalize_xyz(t,e,n),s=this.pool.pop(),s.onload=r?this._on_tile_cache_load:this._on_tile_load,s.onerror=this._on_tile_error,s.alt="",s.tile_data={tile_coords:[t,e,n],normalized_coords:o,quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,n),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,n),bounds:i,loaded:!1,finished:!1,x_coord:i[0],y_coord:i[3]},this.model.tile_source.tiles[s.tile_data.cache_key]=s.tile_data,s.src=(a=this.model.tile_source).get_image_url.apply(a,o),this._tiles.push(s),s;var a},e.prototype._enforce_aspect_ratio=function(){var t,e,n;return(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value)&&(t=this.get_extent(),n=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom(t,this.map_frame._height.value,this.map_frame._width.value,n),this.x_range.setv({start:e[0],end:e[2]}),this.y_range.setv({start:e[1],end:e[3]}),this.extent=e,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0)},e.prototype.has_finished=function(){var e,n,i;if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(i=this._tiles,e=0,n=i.length;e<n;e++)if(!i[e].tile_data.finished)return!1;return!0},e.prototype.render=function(t,e,n){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),this.has_finished()?this.notify_finished():void 0},e.prototype._draw_tile=function(t){var e,n,i,r,o,s,a,l,u;if(null!=(u=this.model.tile_source.tiles[t]))return h=this.plot_view.map_to_screen([u.bounds[0]],[u.bounds[3]]),o=h[0],l=h[1],c=this.plot_view.map_to_screen([u.bounds[2]],[u.bounds[1]]),r=c[0],a=c[1],o=o[0],l=l[0],r=r[0],a=a[0],n=r-o,e=a-l,i=o,s=l,this.map_canvas.drawImage(u.img,i,s,n,e);var h,c},e.prototype._set_rect=function(){var t,e,n,i,r;return n=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+n/2,i=this.map_frame._top.value+n/2,r=this.map_frame._width.value-n,t=this.map_frame._height.value-n,this.map_canvas.rect(e,i,r,t),this.map_canvas.clip()},e.prototype._render_tiles=function(t){var e,n,i;for(this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,e=0,n=t.length;e<n;e++)i=t[e],this._draw_tile(i);return this.map_canvas.restore()},e.prototype._prefetch_tiles=function(){var t,n,i,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b;for(r(this,e),d=this.model.tile_source,l=this.get_extent(),u=this.map_frame._height.value,m=this.map_frame._width.value,b=this.model.tile_source.get_level_by_extent(l,u,m),f=this.model.tile_source.get_tiles_by_extent(l,b),_=[],p=h=0,c=Math.min(10,f.length);h<=c;p=h+=1)v=p[0],g=p[1],y=p[2],p[3],i=this.model.tile_source.children_by_tile_xyz(v,g,y),_.push(function(){var e,r,l;for(l=[],e=0,r=i.length;e<r;e++)t=i[e],o=t[0],s=t[1],a=t[2],n=t[3],d.tile_xyz_to_key(o,s,a)in d.tiles||l.push(this._create_tile(o,s,a,n,!0));return l}.call(this));return _},e.prototype._fetch_tiles=function(t){var e,n,i,r,o,s,a,l;for(r=[],n=0,i=t.length;n<i;n++)o=t[n],s=o[0],a=o[1],l=o[2],e=o[3],r.push(this._create_tile(s,a,l,e));return r},e.prototype._update=function(){var t,n,i,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j,P,D,F,I,B,R=this;for(r(this,e),O=this.model.tile_source,b=O.min_zoom,y=O.max_zoom,O.update(),h=this.get_extent(),B=this.extent[2]-this.extent[0]<h[2]-h[0],c=this.map_frame._height.value,j=this.map_frame._width.value,I=O.get_level_by_extent(h,c,j),E=!1,I<b?(h=this.extent,I=b,E=!0):I>y&&(h=this.extent,I=y,E=!0),E&&(this.x_range.setv({x_range:{start:h[0],end:h[2]}}),this.y_range.setv({start:h[1],end:h[3]}),this.extent=h),this.extent=h,N=O.get_tiles_by_extent(h,I),S=[],x=[],n=[],s=[],_=0,m=N.length;_<m;_++){if(z=N[_],P=z[0],D=z[1],F=z[2],z[3],f=O.tile_xyz_to_key(P,D,F),null!=(C=O.tiles[f])&&!0===C.loaded)n.push(f);else if(this.model.render_parents&&(L=O.get_closest_parent_by_tile_xyz(P,D,F),T=L[0],M=L[1],A=L[2],w=O.tile_xyz_to_key(T,M,A),null!=(k=O.tiles[w])&&k.loaded&&o.call(S,w)<0&&S.push(w),B))for(s=O.children_by_tile_xyz(P,D,F),p=0,v=s.length;p<v;p++)t=s[p],a=t[0],l=t[1],u=t[2],t[3],(i=O.tile_xyz_to_key(a,l,u))in O.tiles&&s.push(i);null==C&&x.push(z)}for(this._render_tiles(S),this._render_tiles(s),this._render_tiles(n),d=0,g=n.length;d<g;d++)z=n[d],O.tiles[z].current=!0;return null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(){return R._fetch_tiles(x)},65);var L},e}(l.RendererView);var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Renderer);n.TileRenderer=_,_.prototype.default_view=n.TileRendererView,_.prototype.type="TileRenderer",_.define({alpha:[h.Number,1],x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],tile_source:[h.Instance,function(){return new a.WMTSTileSource}],render_parents:[h.Bool,!0]}),_.override({level:"underlay"})},function(t,e,n){var i=t(364),r=t(197),o=t(204),s=t(14),a=t(15),l=t(50),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.utils=new o.ProjectionUtils,this.pool=new r.ImagePool,this.tiles={},this.normalize_case()},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace("{"+n+"}",r.toString());return i},e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.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.url=t},e.prototype.update=function(){var t,e,n,i;s.logger.debug("TileSource: tile cache count: "+Object.keys(this.tiles).length),e=this.tiles,n=[];for(t in e)(i=e[t]).current=!1,n.push(i.retain=!1);return n},e.prototype.tile_xyz_to_key=function(t,e,n){return t+":"+e+":"+n},e.prototype.key_to_tile_xyz=function(t){var e;return function(){var n,i,r,o;for(r=t.split(":"),o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(parseInt(e));return o}()},e.prototype.sort_tiles_from_center=function(t,e){var n,i,r,o,s,a;return o=e[0],a=e[1],r=e[2],s=e[3],n=(r-o)/2+o,i=(s-a)/2+a,t.sort(function(t,e){var r,o;return r=Math.sqrt(Math.pow(n-t[0],2)+Math.pow(i-t[1],2)),o=Math.sqrt(Math.pow(n-e[0],2)+Math.pow(i-e[1],2)),r-o}),t},e.prototype.prune_tiles=function(){var t,e,n,i,r;e=this.tiles;for(t in e)(r=e[t]).retain=r.current||r.tile_coords[2]<3,r.current&&(this.retain_neighbors(r),this.retain_children(r),this.retain_parents(r));n=this.tiles,i=[];for(t in n)(r=n[t]).retain?i.push(void 0):i.push(this.remove_tile(t));return i},e.prototype.remove_tile=function(t){var e;if(null!=(e=this.tiles[t]))return this.pool.push(e.img),delete this.tiles[t]},e.prototype.get_image_url=function(t,e,n){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",t).replace("{Y}",e).replace("{Z}",n)},e.prototype.retain_neighbors=function(t){throw new Error("Not Implemented")},e.prototype.retain_parents=function(t){throw new Error("Not Implemented")},e.prototype.retain_children=function(t){throw new Error("Not Implemented")},e.prototype.tile_xyz_to_quadkey=function(t,e,n){throw new Error("Not Implemented")},e.prototype.quadkey_to_tile_xyz=function(t){throw new Error("Not Implemented")},e}(l.Model);n.TileSource=u,u.prototype.type="TileSource",u.define({url:[a.String,""],tile_size:[a.Number,256],max_zoom:[a.Number,30],min_zoom:[a.Number,0],extra_url_vars:[a.Any,{}],attribution:[a.String,""],x_origin_offset:[a.Number],y_origin_offset:[a.Number],initial_resolution:[a.Number]})},function(t,e,n){var i=t(31);n.ProjectionUtils=function(){function t(){this.origin_shift=2*Math.PI*6378137/2}return t.prototype.geographic_to_meters=function(t,e){return i.proj4(i.wgs84,i.mercator,[t,e])},t.prototype.meters_to_geographic=function(t,e){return i.proj4(i.mercator,i.wgs84,[t,e])},t.prototype.geographic_extent_to_meters=function(t){var e,n,i,r;return n=t[0],r=t[1],e=t[2],i=t[3],o=this.geographic_to_meters(n,r),n=o[0],r=o[1],s=this.geographic_to_meters(e,i),e=s[0],i=s[1],[n,r,e,i];var o,s},t.prototype.meters_extent_to_geographic=function(t){var e,n,i,r;return n=t[0],r=t[1],e=t[2],i=t[3],o=this.meters_to_geographic(n,r),n=o[0],r=o[1],s=this.meters_to_geographic(e,i),e=s[0],i=s[1],[n,r,e,i];var o,s},t}()},function(t,e,n){var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",t).replace("{Y}",e).replace("{Z}",n)},e}(r.MercatorTileSource);n.TMSTileSource=o,o.prototype.type="TMSTileSource"},function(t,e,n){var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i;return i=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,n),t=r[0],e=r[1],n=r[2],i.replace("{X}",t).replace("{Y}",e).replace("{Z}",n);var r},e}(r.MercatorTileSource);n.WMTSTileSource=o,o.prototype.type="WMTSTileSource"},function(t,e,n){var i=t(364),r=t(215),o=t(20);n.ActionToolButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._clicked=function(){return this.model.do.emit()},e}(r.ButtonToolButtonView),n.ActionToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.do,function(){return this.doit()})},e}(r.ButtonToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.do=new o.Signal(this,"do")},e}(r.ButtonTool);n.ActionTool=s,s.prototype.button_view=n.ActionToolButtonView},function(t,e,n){var i=t(364),r=t(207),o=t(15);n.HelpToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){return window.open(this.model.redirect)},e}(r.ActionToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.HelpTool=s,s.prototype.default_view=n.HelpToolView,s.prototype.type="HelpTool",s.prototype.tool_name="Help",s.prototype.icon="bk-tool-icon-help",s.define({help_tooltip:[o.String,"Click the question mark to learn more about Bokeh plot tools."],redirect:[o.String,"https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools"]}),s.getters({tooltip:function(){return this.help_tooltip}})},function(t,e,n){var i=t(364),r=t(207);n.RedoToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.plot_view.state_changed,function(){return n.model.disabled=!n.plot_view.can_redo()})},e.prototype.doit=function(){return this.plot_view.redo()},e}(r.ActionToolView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.RedoTool=o,o.prototype.default_view=n.RedoToolView,o.prototype.type="RedoTool",o.prototype.tool_name="Redo",o.prototype.icon="bk-tool-icon-redo",o.override({disabled:!0})},function(t,e,n){var i=t(364),r=t(207),o=t(3),s=t(15);n.ResetToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){return this.plot_view.clear_state(),this.plot_view.reset_range(),this.plot_view.reset_selection(),this.plot_model.plot.trigger_event(new o.Reset)},e}(r.ActionToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.ResetTool=a,a.prototype.default_view=n.ResetToolView,a.prototype.type="ResetTool",a.prototype.tool_name="Reset",a.prototype.icon="bk-tool-icon-reset",a.define({reset_size:[s.Bool,!0]})},function(t,e,n){var i=t(364),r=t(207);n.SaveToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){return this.plot_view.save("bokeh_plot")},e}(r.ActionToolView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.SaveTool=o,o.prototype.default_view=n.SaveToolView,o.prototype.type="SaveTool",o.prototype.tool_name="Save",o.prototype.icon="bk-tool-icon-save"},function(t,e,n){var i=t(364),r=t(207);n.UndoToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.plot_view.state_changed,function(){return n.model.disabled=!n.plot_view.can_undo()})},e.prototype.doit=function(){return this.plot_view.undo()},e}(r.ActionToolView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.UndoTool=o,o.prototype.default_view=n.UndoToolView,o.prototype.type="UndoTool",o.prototype.tool_name="Undo",o.prototype.icon="bk-tool-icon-undo",o.override({disabled:!0})},function(t,e,n){var i=t(364),r=t(207),o=t(44),s=t(15);n.ZoomInToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){var t,e,n,i,r,s;return e=this.plot_model.frame,t=this.model.dimensions,n="width"===t||"both"===t,r="height"===t||"both"===t,s=o.scale_range(e,this.model.factor,n,r),this.plot_view.push_state("zoom_out",{range:s}),this.plot_view.update_range(s,!1,!0),null!=(i=this.model.document)&&i.interactive_start(this.plot_model.plot),null},e}(r.ActionToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.ZoomInTool=a,a.prototype.default_view=n.ZoomInToolView,a.prototype.type="ZoomInTool",a.prototype.tool_name="Zoom In",a.prototype.icon="bk-tool-icon-zoom-in",a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,"both"]})},function(t,e,n){var i=t(364),r=t(207),o=t(44),s=t(15);n.ZoomOutToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){var t,e,n,i,r,s;return e=this.plot_model.frame,t=this.model.dimensions,n="width"===t||"both"===t,r="height"===t||"both"===t,s=o.scale_range(e,-this.model.factor,n,r),this.plot_view.push_state("zoom_out",{range:s}),this.plot_view.update_range(s,!1,!0),null!=(i=this.model.document)&&i.interactive_start(this.plot_model.plot),null},e}(r.ActionToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.ZoomOutTool=a,a.prototype.default_view=n.ZoomOutToolView,a.prototype.type="ZoomOutTool",a.prototype.tool_name="Zoom Out",a.prototype.icon="bk-tool-icon-zoom-out",a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,"both"]})},function(t,e,n){var i=t(364),r=t(6),o=t(231),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.model.change,function(){return n.render()}),this.el.addEventListener("click",function(t){return t.stopPropagation(),t.preventDefault(),n._clicked()}),this.render()},e.prototype.render=function(){return s.empty(this.el),this.el.disabled=this.model.disabled,this.el.classList.add(this.model.icon),this.el.title=this.model.tooltip},e.prototype._clicked=function(){},e}(r.DOMView);n.ButtonToolButtonView=l,l.prototype.className="bk-toolbar-button",n.ButtonToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ToolView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Tool);n.ButtonTool=u,u.prototype.button_view=l,u.prototype.icon=null,u.getters({tooltip:function(){return this.tool_name}}),u.internal({disabled:[a.Boolean,!1]})},function(t,e,n){var i,r=t(364),o=t(222),s=t(55),a=t(15);n.BoxSelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._pan_start=function(t){var e,n;return i=t.bokeh,e=i.sx,n=i.sy,this._base_point=[e,n],null;var i},e.prototype._pan=function(t){var e,n,i,r,o,s,a,l,u;return h=t.bokeh,s=h.sx,l=h.sy,n=[s,l],r=this.plot_model.frame,i=this.model.dimensions,c=this.model._get_dim_limits(this._base_point,n,r,i),a=c[0],u=c[1],this.model.overlay.update({left:a[0],right:a[1],top:u[0],bottom:u[1]}),this.model.select_every_mousemove&&(e=null!=(o=t.srcEvent.shiftKey)&&o,this._do_select(a,u,!1,e)),null;var h,c},e.prototype._pan_end=function(t){var e,n,i,r,o,s,a,l,u;return h=t.bokeh,s=h.sx,l=h.sy,n=[s,l],r=this.plot_model.frame,i=this.model.dimensions,c=this.model._get_dim_limits(this._base_point,n,r,i),a=c[0],u=c[1],e=null!=(o=t.srcEvent.shiftKey)&&o,this._do_select(a,u,!0,e),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.push_state("box_select",{selection:this.plot_view.get_selection()}),null;var h,c},e.prototype._do_select=function(t,e,n,i){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===i&&(i=!1);var l;return l={type:"rect",sx0:r,sx1:o,sy0:s,sy1:a},this._select(l,n,i)},e.prototype._emit_callback=function(t){var e,n,i,r,o,s,a,l;n=this.computed_renderers[0],e=this.plot_model.frame,a=e.xscales[n.x_range_name],l=e.yscales[n.y_range_name],i=t.sx0,r=t.sx1,o=t.sy0,s=t.sy1,u=a.r_invert(i,r),t.x0=u[0],t.x1=u[1],h=l.r_invert(o,s),t.y0=h[0],t.y1=h[1],this.model.callback.execute(this.model,{geometry:t});var u,h},e}(o.SelectToolView),i=function(){return new s.BoxAnnotation({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.BoxSelectTool=l,l.prototype.default_view=n.BoxSelectToolView,l.prototype.type="BoxSelectTool",l.prototype.tool_name="Box Select",l.prototype.icon="bk-tool-icon-box-select",l.prototype.event_type="pan",l.prototype.default_order=30,l.define({dimensions:[a.Dimensions,"both"],select_every_mousemove:[a.Bool,!1],callback:[a.Instance],overlay:[a.Instance,i]}),l.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}})},function(t,e,n){var i,r=t(364),o=t(218),s=t(55),a=t(15);n.BoxZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._match_aspect=function(t,e,n){var i,r,o,s,a,l,u,h,c;return i=n.bbox.aspect,h=Math.abs(t[0]-e[0]),u=Math.abs(t[1]-e[1]),(l=0===u?0:h/u)>=i?(c=(_=[1,l/i])[0],_[1]):(c=(p=[i/l,1])[0],p[1]),t[0]<=e[0]?(o=t[0],(s=t[0]+h*c)>hend&&(s=hend)):(s=t[0],(o=t[0]-h*c)<hstart&&(o=hstart)),h=Math.abs(s-o),t[1]<=e[1]?(r=t[1],(a=t[1]+h/i)>vend&&(a=vend)):(a=t[1],(r=t[1]-h/i)<vstart&&(r=vstart)),u=Math.abs(a-r),t[0]<=e[0]?s=t[0]+i*u:o=t[0]-i*u,[[o,s],[r,a]];var _,p},e.prototype._pan_start=function(t){return this._base_point=[t.bokeh.sx,t.bokeh.sy],null},e.prototype._pan=function(t){var e,n,i,r,o;return e=[t.bokeh.sx,t.bokeh.sy],i=this.plot_model.frame,n=this.model.dimensions,this.model.match_aspect&&"both"===n?(s=this._match_aspect(this._base_point,e,i),r=s[0],o=s[1]):(a=this.model._get_dim_limits(this._base_point,e,i,n),r=a[0],o=a[1]),this.model.overlay.update({left:r[0],right:r[1],top:o[0],bottom:o[1]}),null;var s,a},e.prototype._pan_end=function(t){var e,n,i,r,o;return e=[t.bokeh.sx,t.bokeh.sy],i=this.plot_model.frame,n=this.model.dimensions,this.model.match_aspect&&"both"===n?(s=this._match_aspect(this._base_point,e,i),r=s[0],o=s[1]):(a=this.model._get_dim_limits(this._base_point,e,i,n),r=a[0],o=a[1]),this._update(r,o),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,null;var s,a},e.prototype._update=function(t,e){var n,i,r,o,s,a,l,u,h,c=t[0],_=t[1],p=e[0],d=e[1];if(!(Math.abs(_-c)<=5||Math.abs(d-p)<=5)){l={},r=this.plot_view.frame.xscales;for(i in r)s=r[i],f=s.r_invert(c,_),a=f[0],n=f[1],l[i]={start:a,end:n};u={},o=this.plot_view.frame.yscales;for(i in o)s=o[i],m=s.r_invert(p,d),a=m[0],n=m[1],u[i]={start:a,end:n};return h={xrs:l,yrs:u},this.plot_view.push_state("box_zoom",{range:h}),this.plot_view.update_range(h);var f,m}},e}(o.GestureToolView),i=function(){return new s.BoxAnnotation({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.GestureTool);n.BoxZoomTool=l,l.prototype.default_view=n.BoxZoomToolView,l.prototype.type="BoxZoomTool",l.prototype.tool_name="Box Zoom",l.prototype.icon="bk-tool-icon-box-zoom",l.prototype.event_type="pan",l.prototype.default_order=20,l.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),l.define({dimensions:[a.Dimensions,"both"],overlay:[a.Instance,i],match_aspect:[a.Bool,!1]})},function(t,e,n){var i=t(364),r=t(215),o=t(230);n.GestureToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ButtonToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ButtonTool);n.GestureTool=s,s.prototype.button_view=o.OnOffButtonView,s.prototype.event_type=null,s.prototype.default_order=null},function(t,e,n){var i,r=t(364),o=t(222),s=t(62),a=t(15);n.LassoSelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data=null},e.prototype._active_change=function(){if(!this.model.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,n;return i=t.bokeh,e=i.sx,n=i.sy,this.data={sx:[e],sy:[n]},null;var i},e.prototype._pan=function(t){var e,n,i,r;if(o=t.bokeh,i=o.sx,r=o.sy,s=this.plot_model.frame.bbox.clip(i,r),i=s[0],r=s[1],this.data.sx.push(i),this.data.sy.push(r),this.model.overlay.update({xs:this.data.sx,ys:this.data.sy}),this.model.select_every_mousemove)return e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!1,e);var o,s},e.prototype._pan_end=function(t){var e,n;return this._clear_overlay(),e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state("lasso_select",{selection:this.plot_view.get_selection()})},e.prototype._clear_overlay=function(){return this.model.overlay.update({xs:[],ys:[]})},e.prototype._do_select=function(t,e,n,i){var r;return r={type:"poly",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i,r;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],r=e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=r.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.LassoSelectTool=l,l.prototype.default_view=n.LassoSelectToolView,l.prototype.type="LassoSelectTool",l.prototype.tool_name="Lasso Select",l.prototype.icon="bk-tool-icon-lasso-select",l.prototype.event_type="pan",l.prototype.default_order=12,l.define({select_every_mousemove:[a.Bool,!0],callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){var i=t(364),r=t(218),o=t(15);n.PanToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._pan_start=function(t){var e,n,i,r,o,s;return this.last_dx=0,this.last_dy=0,a=t.bokeh,r=a.sx,o=a.sy,(e=this.plot_view.frame.bbox).contains(r,o)||(n=e.h_range,s=e.v_range,(r<n.start||r>n.end)&&(this.v_axis_only=!0),(o<s.start||o>s.end)&&(this.h_axis_only=!0)),null!=(i=this.model.document)?i.interactive_start(this.plot_model.plot):void 0;var a},e.prototype._pan=function(t){var e;return this._update(t.deltaX,t.deltaY),null!=(e=this.model.document)?e.interactive_start(this.plot_model.plot):void 0},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 n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T;r=this.plot_view.frame,a=t-this.last_dx,l=e-this.last_dy,o=r.bbox.h_range,g=o.start-a,v=o.end-a,k=r.bbox.v_range,w=k.start-l,x=k.end-l,"width"!==(n=this.model.dimensions)&&"both"!==n||this.v_axis_only?(f=o.start,m=o.end,_=0):(f=g,m=v,_=-a),"height"!==n&&"both"!==n||this.h_axis_only?(y=k.start,b=k.end,p=0):(y=w,b=x,p=-l),this.last_dx=t,this.last_dy=e,S={},u=r.xscales;for(s in u)c=u[s],M=c.r_invert(f,m),d=M[0],i=M[1],S[s]={start:d,end:i};T={},h=r.yscales;for(s in h)c=h[s],A=c.r_invert(y,b),d=A[0],i=A[1],T[s]={start:d,end:i};return this.pan_info={xrs:S,yrs:T,sdx:_,sdy:p},this.plot_view.update_range(this.pan_info,!0),null;var M,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.PanTool=s,s.prototype.default_view=n.PanToolView,s.prototype.type="PanTool",s.prototype.tool_name="Pan",s.prototype.event_type="pan",s.prototype.default_order=10,s.define({dimensions:[o.Dimensions,"both"]}),s.getters({tooltip:function(){return this._get_dim_tooltip("Pan",this.dimensions)},icon:function(){return"bk-tool-icon-"+function(){switch(this.dimensions){case"both":return"pan";case"width":return"xpan";case"height":return"ypan"}}.call(this)}})},function(t,e,n){var i,r=t(364),o=t(222),s=t(62),a=t(15),l=t(22);n.PolySelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data={sx:[],sy:[]}},e.prototype._active_change=function(){if(!this.model.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,n;return e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state("poly_select",{selection:this.plot_view.get_selection()}),this._clear_data()},e.prototype._clear_data=function(){return this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,n;if(i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)){return this.data.sx.push(e),this.data.sy.push(n),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)});var i}},e.prototype._do_select=function(t,e,n,i){var r;return r={type:"poly",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=i.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.PolySelectTool=u,u.prototype.default_view=n.PolySelectToolView,u.prototype.type="PolySelectTool",u.prototype.tool_name="Poly Select",u.prototype.icon="bk-tool-icon-polygon-select",u.prototype.event_type="tap",u.prototype.default_order=11,u.define({callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){var i=t(364),r=t(218),o=t(161),s=t(162),a=t(14),l=t(15),u=t(30),h=t(3),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._computed_renderers_by_data_source=function(){var t,e,n,i,r,a;for(r={},i=this.computed_renderers,t=0,e=i.length;t<e;t++)(n=i[t])instanceof s.GraphRenderer?a=n.node_renderer.data_source.id:n instanceof o.GlyphRenderer&&(a=n.data_source.id),r[a]=a in r?r[a].concat([n]):[n];return r},e.prototype._keyup=function(t){var e,n,i,r,o,s,a;if(27===t.keyCode){for(o=this.computed_renderers,s=[],n=0,i=o.length;n<i;n++)r=o[n],e=r.data_source,a=e.selection_manager,s.push(a.clear());return s}},e.prototype._select=function(t,e,n){var i,r,o,s,a,l,u,h;u=this._computed_renderers_by_data_source();for(i in u){for(l=u[i],h=l[0].get_selection_manager(),a=[],r=0,o=l.length;r<o;r++)(s=l[r]).id in this.plot_view.renderer_views&&a.push(this.plot_view.renderer_views[s.id]);h.select(a,t,e,n)}return null!=this.model.callback&&this._emit_callback(t),this._emit_selection_event(t,e),null},e.prototype._emit_selection_event=function(t,e){void 0===e&&(e=!0);var n,i,r,o,s,l;switch(n=u.clone(t),s=this.plot_view.frame.xscales.default,l=this.plot_view.frame.yscales.default,n.type){case"point":n.x=s.invert(n.sx),n.y=l.invert(n.sy);break;case"rect":c=s.r_invert(n.sx0,n.sx1),n.x0=c[0],n.x1=c[1],_=l.r_invert(n.sy0,n.sy1),n.y0=_[0],n.y1=_[1];break;case"poly":for(n.x=new Array(n.sx.length),n.y=new Array(n.sy.length),i=r=0,o=n.sx.length;0<=o?r<o:r>o;i=0<=o?++r:--r)n.x[i]=s.invert(n.sx[i]),n.y[i]=l.invert(n.sy[i]);break;default:a.logger.debug("Unrecognized selection geometry type: '"+n.type+"'")}return this.plot_model.plot.trigger_event(new h.SelectionGeometry({geometry:n,final:e}));var c,_},e}(r.GestureToolView);n.SelectToolView=c,c.getters({computed_renderers:function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)((n=t[e])instanceof o.GlyphRenderer||n instanceof s.GraphRenderer)&&r.push(n);return r}()),e.length>0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t<r;t++)n=i[t],e.indexOf(n.name)>=0&&o.push(n);return o}()),i}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.SelectTool=_,_.define({renderers:[l.Array,[]],names:[l.Array,[]]}),_.internal({multi_select_modifier:[l.String,"shift"]})},function(t,e,n){var i=t(364),r=t(222),o=t(15),s=t(42);n.TapToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tap=function(t){var e,n,i,r;return o=t.bokeh,i=o.sx,r=o.sy,e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(i,r,!0,e);var o},e.prototype._select=function(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m;if(l={type:"point",sx:t,sy:e},o=this.model.callback,a={geometries:l},"select"===this.model.behavior){f=this._computed_renderers_by_data_source();for(r in f)d=f[r],m=d[0].get_selection_manager(),_=function(){var t,e,n;for(n=[],t=0,e=d.length;t<e;t++)c=d[t],n.push(this.plot_view.renderer_views[c.id]);return n}.call(this),m.select(_,l,n,i)&&null!=o&&(a.source=m.source,s.isFunction(o)?o(this,a):o.execute(this,a));this._emit_selection_event(l),this.plot_view.push_state("tap",{selection:this.plot_view.get_selection()})}else for(p=this.computed_renderers,u=0,h=p.length;u<h;u++)c=p[u],m=c.get_selection_manager(),m.inspect(this.plot_view.renderer_views[c.id],l)&&null!=o&&(a.source=m.source,s.isFunction(o)?o(this,a):o.execute(this,a));return null},e}(r.SelectToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.SelectTool);n.TapTool=a,a.prototype.default_view=n.TapToolView,a.prototype.type="TapTool",a.prototype.tool_name="Tap",a.prototype.icon="bk-tool-icon-tap-select",a.prototype.event_type="tap",a.prototype.default_order=10,a.define({behavior:[o.String,"select"],callback:[o.Any]})},function(t,e,n){var i=t(364),r=t(218),o=t(15);n.WheelPanToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._scroll=function(t){var e;return(e=this.model.speed*t.bokeh.delta)>.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;switch(n=this.plot_model.frame,i=n.bbox.h_range,x=n.bbox.v_range,S=[i.start,i.end],d=S[0],p=S[1],T=[x.start,x.end],y=T[0],g=T[1],this.model.dimension){case"height":b=Math.abs(g-y),c=d,_=p,m=y-b*t,v=g-b*t;break;case"width":f=Math.abs(p-d),c=d-f*t,_=p-f*t,m=y,v=g}w={},s=n.xscales;for(r in s)u=s[r],M=u.r_invert(c,_),h=M[0],e=M[1],w[r]={start:h,end:e};k={},a=n.yscales;for(r in a)u=a[r],A=u.r_invert(m,v),h=A[0],e=A[1],k[r]={start:h,end:e};return o={xrs:w,yrs:k,factor:t},this.plot_view.push_state("wheel_pan",{range:o}),this.plot_view.update_range(o,!1,!0),null!=(l=this.model.document)&&l.interactive_start(this.plot_model.plot),null;var S,T,M,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelPanTool=s,s.prototype.type="WheelPanTool",s.prototype.default_view=n.WheelPanToolView,s.prototype.tool_name="Wheel Pan",s.prototype.icon="bk-tool-icon-wheel-pan",s.prototype.event_type="scroll",s.prototype.default_order=12,s.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)}}),s.define({dimension:[o.Dimension,"width"]}),s.internal({speed:[o.Number,.001]})},function(t,e,n){var i=t(364),r=t(218),o=t(44),s=t(15);n.WheelZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(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,n,i,r,s,a,l,u,h,c,_;return i=this.plot_model.frame,s=i.bbox.h_range,c=i.bbox.v_range,p=t.bokeh,l=p.sx,u=p.sy,e=this.model.dimensions,r=("width"===e||"both"===e)&&s.start<l&&l<s.end,h=("height"===e||"both"===e)&&c.start<u&&u<c.end,n=this.model.speed*t.bokeh.delta,_=o.scale_range(i,n,r,h,{x:l,y:u}),this.plot_view.push_state("wheel_zoom",{range:_}),this.plot_view.update_range(_,!1,!0),null!=(a=this.model.document)&&a.interactive_start(this.plot_model.plot),null;var p},e}(r.GestureToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelZoomTool=a,a.prototype.default_view=n.WheelZoomToolView,a.prototype.type="WheelZoomTool",a.prototype.tool_name="Wheel Zoom",a.prototype.icon="bk-tool-icon-wheel-zoom",a.prototype.event_type="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",a.prototype.default_order=10,a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({dimensions:[s.Dimensions,"both"]}),a.internal({speed:[s.Number,1/600]})},function(t,e,n){var i=t(207);n.ActionTool=i.ActionTool;var r=t(208);n.HelpTool=r.HelpTool;var o=t(209);n.RedoTool=o.RedoTool;var s=t(210);n.ResetTool=s.ResetTool;var a=t(211);n.SaveTool=a.SaveTool;var l=t(212);n.UndoTool=l.UndoTool;var u=t(213);n.ZoomInTool=u.ZoomInTool;var h=t(214);n.ZoomOutTool=h.ZoomOutTool;var c=t(215);n.ButtonTool=c.ButtonTool;var _=t(216);n.BoxSelectTool=_.BoxSelectTool;var p=t(217);n.BoxZoomTool=p.BoxZoomTool;var d=t(218);n.GestureTool=d.GestureTool;var f=t(219);n.LassoSelectTool=f.LassoSelectTool;var m=t(220);n.PanTool=m.PanTool;var v=t(221);n.PolySelectTool=v.PolySelectTool;var g=t(222);n.SelectTool=g.SelectTool;var y=t(223);n.TapTool=y.TapTool;var b=t(224);n.WheelPanTool=b.WheelPanTool;var x=t(225);n.WheelZoomTool=x.WheelZoomTool;var w=t(227);n.CrosshairTool=w.CrosshairTool;var k=t(228);n.HoverTool=k.HoverTool;var S=t(229);n.InspectTool=S.InspectTool;var T=t(231);n.Tool=T.Tool;var M=t(232);n.ToolProxy=M.ToolProxy;var A=t(233);n.Toolbar=A.Toolbar;var E=t(234);n.ToolbarBase=E.ToolbarBase;var z=t(235);n.ProxyToolbar=z.ProxyToolbar;var C=t(235);n.ToolbarBox=C.ToolbarBox},function(t,e,n){var i=t(364),r=t(229),o=t(63),s=t(15),a=t(30);n.CrosshairToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)||(e=n=null),this._update_spans(e,n);var i}},e.prototype._move_exit=function(t){return this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var n;if("width"!==(n=this.model.dimensions)&&"both"!==n||(this.model.spans.width.computed_location=e),"height"===n||"both"===n)return this.model.spans.height.computed_location=t},e}(r.InspectToolView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.spans={width:new o.Span({for_hover:!0,dimension:"width",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:"height",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},e}(r.InspectTool);n.CrosshairTool=l,l.prototype.default_view=n.CrosshairToolView,l.prototype.type="CrosshairTool",l.prototype.tool_name="Crosshair",l.prototype.icon="bk-tool-icon-crosshair",l.define({dimensions:[s.Dimensions,"both"],line_color:[s.Color,"black"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),l.internal({location_units:[s.SpatialUnits,"screen"],render_mode:[s.RenderMode,"css"],spans:[s.Any]}),l.getters({tooltip:function(){return this._get_dim_tooltip("Crosshair",this.dimensions)},synthetic_renderers:function(){return a.values(this.spans)}})},function(t,e,n){var i=t(364),r=t(229),o=t(67),s=t(161),a=t(162),l=t(9),u=t(39),h=t(5),c=t(15),_=t(26),p=t(30),d=t(42),f=t(4);n._nearest_line_hit=function(t,e,n,i,r,o){var s,a,u,h,c,_;if(s=r[t],a=o[t],u=r[t+1],h=o[t+1],"span"===e.type)switch(e.direction){case"h":c=Math.abs(s-n),_=Math.abs(u-n);break;case"v":c=Math.abs(a-i),_=Math.abs(h-i)}else c=l.dist_2_pts(s,a,n,i),_=l.dist_2_pts(u,h,n,i);return c<_?[[s,a],t]:[[u,h],t+1]},n._line_hit=function(t,e,n){return[[t[n],e[n]],n]};var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){return f.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e,n,i,r;for(t.prototype.connect_signals.call(this),r=this.computed_renderers,e=0,n=r.length;e<n;e++)(i=r[e])instanceof s.GlyphRenderer?this.connect(i.data_source.inspect,this._update):i instanceof a.GraphRenderer&&(this.connect(i.node_renderer.data_source.inspect,this._update),this.connect(i.edge_renderer.data_source.inspect,this._update));return this.connect(this.model.properties.renderers.change,function(){return this._computed_renderers=this._ttmodels=null}),this.connect(this.model.properties.names.change,function(){return this._computed_renderers=this._ttmodels=null}),this.connect(this.model.properties.tooltips.change,function(){return this._ttmodels=null})},e.prototype._compute_renderers=function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)((n=t[e])instanceof s.GlyphRenderer||n instanceof a.GraphRenderer)&&r.push(n);return r}()),e.length>0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t<r;t++)n=i[t],e.indexOf(n.name)>=0&&o.push(n);return o}()),i},e.prototype._compute_ttmodels=function(){var t,e,n,i,r,l,u;if(u={},null!=(l=this.model.tooltips))for(i=this.computed_renderers,t=0,e=i.length;t<e;t++)(n=i[t])instanceof s.GlyphRenderer?(r=new o.Tooltip({custom:d.isString(l)||d.isFunction(l),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),u[n.id]=r):n instanceof a.GraphRenderer&&(r=new o.Tooltip({custom:d.isString(l)||d.isFunction(l),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),u[n.node_renderer.id]=r,u[n.edge_renderer.id]=r);return f.build_views(this.ttviews,p.values(u),{parent:this,plot_view:this.plot_view}),u},e.prototype._clear=function(){var t,e,n,i;this._inspect(Infinity,Infinity),t=this.ttmodels,e=[];for(n in t)i=t[n],e.push(i.clear());return e},e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_view.frame.bbox.contains(e,n)?this._inspect(e,n):this._clear();var i}},e.prototype._move_exit=function(){return this._clear()},e.prototype._inspect=function(t,e){var n,i,r,o,s,a;for(a="mouse"===this.model.mode?"point":"span",n={type:a,sx:t,sy:e},"span"===a&&(n.direction="vline"===this.model.mode?"h":"v"),s=this.computed_renderers,i=0,r=s.length;i<r;i++)o=s[i],o.get_selection_manager().inspect(this.plot_view.renderer_views[o.id],n);null!=this.model.callback&&this._emit_callback(n)},e.prototype._update=function(t){var e,i,r,o,a,l,u,h,c,_,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j,P,D,F=t[0],I=t[1].geometry;if(this.model.active&&null!=(C=null!=(b=this.ttmodels[F.model.id])?b:null)&&(C.clear(),c=F.model.get_selection_manager().inspectors[F.model.id].indices,F.model instanceof s.GlyphRenderer&&(c=F.model.view.convert_selection_to_subset(c)),r=F.model.get_selection_manager().source,!c.is_empty())){for(o=this.plot_model.frame,E=I.sx,z=I.sy,j=o.xscales[F.model.x_range_name],D=o.yscales[F.model.y_range_name],N=j.invert(E),P=D.invert(z),a=F.glyph,x=c["0d"].indices,f=0,v=x.length;f<v;f++){switch(l=x[f],e=a._x[l+1],i=a._y[l+1],u=l,this.model.line_policy){case"interp":B=a.get_interpolation_hit(l,I),e=B[0],i=B[1],M=j.compute(e),A=D.compute(i);break;case"prev":R=n._line_hit(a.sx,a.sy,l),L=R[0],M=L[0],A=L[1],u=R[1];break;case"next":V=n._line_hit(a.sx,a.sy,l+1),G=V[0],M=G[0],A=G[1],u=V[1];break;case"nearest":U=n._nearest_line_hit(l,I,E,z,a.sx,a.sy),Y=U[0],M=Y[0],A=Y[1],u=U[1],e=a._x[u],i=a._y[u];break;default:M=(q=[E,z])[0],A=q[1]}O={index:u,x:N,y:P,sx:E,sy:z,data_x:e,data_y:i,rx:M,ry:A},C.add(M,A,this._render_tooltips(r,u,O))}for(w=c["1d"].indices,m=0,g=w.length;m<g;m++)if(l=w[m],p.isEmpty(c["2d"].indices))e=null!=(S=a._x)?S[l]:void 0,i=null!=(T=a._y)?T[l]:void 0,"snap_to_data"===this.model.point_policy?(null==(y=a.get_anchor_point(this.model.anchor,l,[E,z]))&&(y=a.get_anchor_point("center",l,[E,z])),M=y.x,A=y.y):(M=(K=[E,z])[0],A=K[1]),h=F.model instanceof s.GlyphRenderer?F.model.view.convert_indices_from_subset([l])[0]:l,O={index:h,x:N,y:P,sx:E,sy:z,data_x:e,data_y:i},C.add(M,A,this._render_tooltips(r,h,O));else{k=c["2d"].indices;for(l in k){switch(_=k[l][0],e=a._xs[l][_],i=a._ys[l][_],d=_,this.model.line_policy){case"interp":X=a.get_interpolation_hit(l,_,I),e=X[0],i=X[1],M=j.compute(e),A=D.compute(i);break;case"prev":W=n._line_hit(a.sxs[l],a.sys[l],_),H=W[0],M=H[0],A=H[1],d=W[1];break;case"next":J=n._line_hit(a.sxs[l],a.sys[l],_+1),Q=J[0],M=Q[0],A=Q[1],d=J[1];break;case"nearest":$=n._nearest_line_hit(_,I,E,z,a.sxs[l],a.sys[l]),Z=$[0],M=Z[0],A=Z[1],d=$[1],e=a._xs[l][d],i=a._ys[l][d]}h=F.model instanceof s.GlyphRenderer?F.model.view.convert_indices_from_subset([l])[0]:l,O={index:h,segment_index:d,x:N,y:P,sx:E,sy:z,data_x:e,data_y:i},C.add(M,A,this._render_tooltips(r,h,O))}}return null;var B,R,L,V,G,U,Y,q,X,W,H,J,Q,$,Z,K}},e.prototype._emit_callback=function(t){var e,n,i,r,o,s,a,l,u,h,c;for(u=this.computed_renderers,o=0,s=u.length;o<s;o++)l=u[o],r=l.data_source.inspected,i=this.plot_model.frame,h=i.xscales[l.x_range_name],c=i.yscales[l.y_range_name],t.x=h.invert(t.sx),t.y=c.invert(t.sy),e=this.model.callback,a=(_=[e,{index:r,geometry:t,renderer:l}])[0],n=_[1],d.isFunction(e)?e(a,n):e.execute(a,n);var _},e.prototype._render_tooltips=function(t,e,n){var i,r,o,s,a,l,c,p,f,m,v,g,y,b,x;if(b=this.model.tooltips,d.isString(b))return a=h.div(),a.innerHTML=u.replace_placeholders(b,t,e,this.model.formatters,n),a;if(d.isFunction(b))return b(t,n);for(g=h.div({style:{display:"table",borderSpacing:"2px"}}),c=0,f=b.length;c<f;c++)if(w=b[c],p=w[0],x=w[1],v=h.div({style:{display:"table-row"}}),g.appendChild(v),i=h.div({style:{display:"table-cell"},class:"bk-tooltip-row-label"},p+": "),v.appendChild(i),i=h.div({style:{display:"table-cell"},class:"bk-tooltip-row-value"}),v.appendChild(i),x.indexOf("$color")>=0){if(k=x.match(/\$color(\[.*\])?:(\w*)/),k[0],m=k[1],r=k[2],null==(s=t.get_column(r))){a=h.span({},r+" unknown"),i.appendChild(a);continue}if(l=(null!=m?m.indexOf("hex"):void 0)>=0,y=(null!=m?m.indexOf("swatch"):void 0)>=0,null==(o=s[e])){a=h.span({},"(null)"),i.appendChild(a);continue}l&&(o=_.color2hex(o)),a=h.span({},o),i.appendChild(a),y&&(a=h.span({class:"bk-tooltip-color-block",style:{backgroundColor:o}}," "),i.appendChild(a))}else x=x.replace("$~","$data_"),(a=h.span()).innerHTML=u.replace_placeholders(x,t,e,this.model.formatters,n),i.appendChild(a);return g;var w,k},e}(r.InspectToolView);n.HoverToolView=m,m.getters({computed_renderers:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},ttmodels:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels}});var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InspectTool);n.HoverTool=v,v.prototype.default_view=m,v.prototype.type="HoverTool",v.prototype.tool_name="Hover",v.prototype.icon="bk-tool-icon-hover",v.define({tooltips:[c.Any,[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[c.Any,{}],renderers:[c.Array,[]],names:[c.Array,[]],mode:[c.String,"mouse"],point_policy:[c.String,"snap_to_data"],line_policy:[c.String,"nearest"],show_arrow:[c.Boolean,!0],anchor:[c.String,"center"],attachment:[c.String,"horizontal"],callback:[c.Any]})},function(t,e,n){var i=t(364),r=t(15),o=t(215),s=t(230);n.InspectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonTool);n.InspectTool=a,a.prototype.button_view=s.OnOffButtonView,a.prototype.event_type="move",a.define({toggleable:[r.Bool,!0]}),a.override({active:!0})},function(t,e,n){var i=t(364),r=t(215);n.OnOffButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.model.active?this.el.classList.add("bk-active"):this.el.classList.remove("bk-active")},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(r.ButtonToolButtonView)},function(t,e,n){var i=t(364),r=t(15),o=t(45),s=t(22),a=t(50),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);n.ToolView=l,l.getters({plot_model:function(){return this.plot_view.model}});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_dim_tooltip=function(t,e){switch(e){case"width":return t+" (x-axis)";case"height":return t+" (y-axis)";case"both":return t}},e.prototype._get_dim_limits=function(t,e,n,i){var r,o,a,l,u=t[0],h=t[1],c=e[0],_=e[1];return r=n.bbox.h_range,"width"===i||"both"===i?(o=[s.min([u,c]),s.max([u,c])],o=[s.max([o[0],r.start]),s.min([o[1],r.end])]):o=[r.start,r.end],l=n.bbox.v_range,"height"===i||"both"===i?(a=[s.min([h,_]),s.max([h,_])],a=[s.max([a[0],l.start]),s.min([a[1],l.end])]):a=[l.start,l.end],[o,a]},e}(a.Model);n.Tool=u,u.getters({synthetic_renderers:function(){return[]}}),u.internal({active:[r.Boolean,!1]})},function(t,e,n){var i=t(364),r=t(15),o=t(20),s=t(50),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.do=new o.Signal(this,"do"),this.connect(this.do,function(){return this.doit()}),this.connect(this.properties.active.change,function(){return this.set_active()})},e.prototype.doit=function(){var t,e,n;for(n=this.tools,t=0,e=n.length;t<e;t++)n[t].do.emit();return null},e.prototype.set_active=function(){var t,e,n;for(n=this.tools,t=0,e=n.length;t<e;t++)n[t].active=this.active;return null},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(s.Model);n.ToolProxy=a,a.getters({button_view:function(){return this.tools[0].button_view},event_type:function(){return this.tools[0].event_type},tooltip:function(){return this.tools[0].tool_name},tool_name:function(){return this.tools[0].tool_name},icon:function(){return this.tools[0].icon}}),a.define({tools:[r.Array,[]],active:[r.Bool,!1],disabled:[r.Bool,!1]})},function(t,e,n){var i=t(364),r=[].indexOf,o=t(15),s=t(22),a=t(14),l=t(207),u=t(208),h=t(218),c=t(229),_=t(234),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.connect(this.properties.tools.change,function(){return this._init_tools()}),this._init_tools()},e.prototype._init_tools=function(){var t,e,n,i,o,_,p,d,f,m,v,g=this;for(f=this.tools,i=0,_=f.length;i<_;i++)if((m=f[i])instanceof c.InspectTool)s.any(this.inspectors,function(t){return t.id===m.id})||(this.inspectors=this.inspectors.concat([m]));else if(m instanceof u.HelpTool)s.any(this.help,function(t){return t.id===m.id})||(this.help=this.help.concat([m]));else if(m instanceof l.ActionTool)s.any(this.actions,function(t){return t.id===m.id})||(this.actions=this.actions.concat([m]));else if(m instanceof h.GestureTool)for(n=m.event_type,d=!0,"string"==typeof n&&(n=[n],d=!1),o=0,p=n.length;o<p;o++)(e=n[o])in this.gestures?(d?s.any(this.gestures.multi.tools,function(t){return t.id===m.id})||(this.gestures.multi.tools=this.gestures.multi.tools.concat([m])):s.any(this.gestures[e].tools,function(t){return t.id===m.id})||(this.gestures[e].tools=this.gestures[e].tools.concat([m])),this.connect(m.properties.active.change,this._active_change.bind(this,m))):a.logger.warn("Toolbar: unknown event type '"+e+"' for tool: "+m.type+" ("+m.id+")");"auto"===this.active_inspect||(this.active_inspect instanceof c.InspectTool?this.inspectors.map(function(t){if(t!==g.active_inspect)return t.active=!1}):this.active_inspect instanceof Array?this.inspectors.map(function(t){if(r.call(g.active_inspect,t)<0)return t.active=!1}):null===this.active_inspect&&this.inspectors.map(function(t){return t.active=!1})),t=function(t){return t.active?g._active_change(t):t.active=!0};for(e in this.gestures)if(0!==(v=this.gestures[e].tools).length){if(this.gestures[e].tools=s.sortBy(v,function(t){return t.default_order}),"tap"===e){if(null===this.active_tap)continue;t("auto"===this.active_tap?this.gestures[e].tools[0]:this.active_tap)}if("pan"===e){if(null===this.active_drag)continue;t("auto"===this.active_drag?this.gestures[e].tools[0]:this.active_drag)}if("pinch"===e||"scroll"===e){if(null===this.active_scroll||"auto"===this.active_scroll)continue;t(this.active_scroll)}}return null},e}(_.ToolbarBase);n.Toolbar=p,p.prototype.type="Toolbar",p.prototype.default_view=_.ToolbarBaseView,p.define({active_drag:[o.Any,"auto"],active_inspect:[o.Any,"auto"],active_scroll:[o.Any,"auto"],active_tap:[o.Any,"auto"]})},function(t,e,n){var i=t(364),r=t(14),o=t(5),s=t(4),a=t(15),l=t(6),u=t(50);n.ToolbarBaseView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._tool_button_views={},this._build_tool_button_views()},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.tools.change,function(){return e._build_tool_button_views()})},e.prototype.remove=function(){return s.remove_views(this._tool_button_views),t.prototype.remove.call(this)},e.prototype._build_tool_button_views=function(){var t,e;return e=null!=(t=this.model._proxied_tools)?t:this.model.tools,s.build_views(this._tool_button_views,e,{parent:this},function(t){return t.button_view})},e.prototype.render=function(){var t,e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;o.empty(this.el),this.el.classList.add("bk-toolbar"),this.el.classList.add("bk-toolbar-"+this.model.toolbar_location),null!=this.model.logo&&(i="grey"===this.model.logo?"bk-grey":null,m=o.a({href:"https://bokeh.pydata.org/",target:"_blank",class:["bk-logo","bk-logo-small",i]}),this.el.appendChild(m)),e=[],s=this.model.gestures;for(r in s){for(n=[],g=s[r].tools,a=0,c=g.length;a<c;a++)w=g[a],n.push(this._tool_button_views[w.id].el);e.push(n)}for(n=[],y=this.model.actions,l=0,_=y.length;l<_;l++)w=y[l],n.push(this._tool_button_views[w.id].el);for(e.push(n),n=[],b=this.model.inspectors,u=0,p=b.length;u<p;u++)(w=b[u]).toggleable&&n.push(this._tool_button_views[w.id].el);for(e.push(n),n=[],x=this.model.help,h=0,d=x.length;h<d;h++)w=x[h],n.push(this._tool_button_views[w.id].el);for(e.push(n),v=0,f=e.length;v<f;v++)0!==(n=e[v]).length&&(t=o.div({class:"bk-button-bar"},n),this.el.appendChild(t));return this},e}(l.DOMView);var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._active_change=function(t){var e,n,i,o,s;for("string"==typeof(i=t.event_type)&&(i=[i]),o=0,s=i.length;o<s;o++)n=i[o],t.active?(null!=(e=this.gestures[n].active)&&t!==e&&(r.logger.debug("Toolbar: deactivating tool: "+e.type+" ("+e.id+") for event type '"+n+"'"),e.active=!1),this.gestures[n].active=t,r.logger.debug("Toolbar: activating tool: "+t.type+" ("+t.id+") for event type '"+n+"'")):this.gestures[n].active=null;return null},e}(u.Model);n.ToolbarBase=h,h.prototype.type="ToolbarBase",h.prototype.default_view=n.ToolbarBaseView,h.getters({horizontal:function(){return"above"===this.toolbar_location||"below"===this.toolbar_location},vertical:function(){return"left"===this.toolbar_location||"right"===this.toolbar_location}}),h.define({tools:[a.Array,[]],logo:[a.String,"normal"]}),h.internal({gestures:[a.Any,function(){return{pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null},multi:{tools:[],active:null}}}],actions:[a.Array,[]],inspectors:[a.Array,[]],help:[a.Array,[]],toolbar_location:[a.Location,"right"]})},function(t,e,n){var i=t(364),r=[].indexOf,o=t(15),s=t(5),a=t(22),l=t(207),u=t(208),h=t(218),c=t(229),_=t(234),p=t(232),d=t(139),f=t(4),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._init_tools(),this._merge_tools()},e.prototype._init_tools=function(){var t,e,n,i,r,o;for(i=this.tools,r=[],e=0,n=i.length;e<n;e++)(o=i[e])instanceof c.InspectTool?a.any(this.inspectors,function(t){return t.id===o.id})?r.push(void 0):r.push(this.inspectors=this.inspectors.concat([o])):o instanceof u.HelpTool?a.any(this.help,function(t){return t.id===o.id})?r.push(void 0):r.push(this.help=this.help.concat([o])):o instanceof l.ActionTool?a.any(this.actions,function(t){return t.id===o.id})?r.push(void 0):r.push(this.actions=this.actions.concat([o])):o instanceof h.GestureTool?(t=o.event_type,a.any(this.gestures[t].tools,function(t){return t.id===o.id})?r.push(void 0):r.push(this.gestures[t].tools=this.gestures[t].tools.concat([o]))):r.push(void 0);return r},e.prototype._merge_tools=function(){var t,e,n,i,o,s,l,u,h,c,_,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j=this;for(this._proxied_tools=[],u={},t={},i={},y=[],b=[],w=this.help,s=0,d=w.length;s<d;s++)o=w[s],k=o.redirect,r.call(b,k)<0&&(y.push(o),b.push(o.redirect));(P=this._proxied_tools).push.apply(P,y),this.help=y,S=this.gestures;for(n in S){l=S[n],n in i||(i[n]={}),T=l.tools;for(h=0,f=T.length;h<f;h++)(C=T[h]).type in i[n]||(i[n][C.type]=[]),i[n][C.type].push(C)}for(M=this.inspectors,c=0,m=M.length;c<m;c++)(C=M[c]).type in u||(u[C.type]=[]),u[C.type].push(C);for(A=this.actions,_=0,v=A.length;_<v;_++)(C=A[_]).type in t||(t[C.type]=[]),t[C.type].push(C);g=function(t,e){void 0===e&&(e=!1);var n;return n=new p.ToolProxy({tools:t,active:e}),j._proxied_tools.push(n),n};for(n in i){this.gestures[n].tools=[],E=i[n];for(O in E)(N=E[O]).length>0&&(x=g(N),this.gestures[n].tools.push(x),this.connect(x.properties.active.change,this._active_change.bind(this,x)))}this.actions=[];for(O in t)(N=t[O]).length>0&&this.actions.push(g(N));this.inspectors=[];for(O in u)(N=u[O]).length>0&&this.inspectors.push(g(N,!0));z=[];for(e in this.gestures)0!==(N=this.gestures[e].tools).length&&(this.gestures[e].tools=a.sortBy(N,function(t){return t.default_order}),"pinch"!==e&&"scroll"!==e?z.push(this.gestures[e].tools[0].active=!0):z.push(void 0));return z;var P},e}(_.ToolbarBase);n.ProxyToolbar=m,m.prototype.type="ProxyToolbar";var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},f.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return f.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e;return t.prototype.render.call(this),(e=this._toolbar_views[this.model.toolbar.id]).render(),s.empty(this.el),this.el.appendChild(e.el)},e.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},e.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},e}(d.LayoutDOMView);n.ToolbarBoxView=v,v.prototype.className="bk-toolbar-box";var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(d.LayoutDOM);n.ToolbarBox=g,g.prototype.type="ToolbarBox",g.prototype.default_view=v,g.define({toolbar:[o.Instance],toolbar_location:[o.Location,"right"]}),g.getters({sizing_mode:function(){switch(this.toolbar_location){case"above":case"below":return"scale_width";case"left":case"right":return"scale_height"}}})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=t(30),a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(r,e),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,n]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,n]))},r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),[t,"require","exports",e])))},r.prototype._make_values=function(){return s.values(this.args)},r}(r.Transform);n.CustomJSTransform=a,a.prototype.type="CustomJSTransform",a.define({args:[o.Any,{}],func:[o.String,""],v_func:[o.String,""]}),a.getters({values:function(){return this._make_values()},scalar_transform:function(){return this._make_transform("x",this.func)},vector_transform:function(){return this._make_transform("xs",this.v_func)}})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),t+this.value},e}(r.Transform);n.Dodge=s,s.define({value:[o.Number,0],range:[o.Instance]})},function(t,e,n){var i=t(236);n.CustomJSTransform=i.CustomJSTransform;var r=t(237);n.Dodge=r.Dodge;var o=t(239);n.Interpolator=o.Interpolator;var s=t(240);n.Jitter=s.Jitter;var a=t(241);n.LinearInterpolator=a.LinearInterpolator;var l=t(242);n.StepInterpolator=l.StepInterpolator;var u=t(243);n.Transform=u.Transform},function(t,e,n){var i=t(364),r=[].indexOf,o=t(243),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.connect(this.change,function(){return this._sorted_dirty=!0})},e.prototype.sort=function(t){void 0===t&&(t=!1);var e,n,i,o,s,a,l,u,h,c,_;if(typeof this.x!=typeof this.y)throw new 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.x&&null===this.data)throw new Error("If the x and y parameters are not specified as an array, the data parameter is reqired.");if(!1!==this._sorted_dirty){if(c=[],_=[],"string"==typeof this.x){if(n=this.data,e=n.columns(),l=this.x,r.call(e,l)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(u=this.y,r.call(e,u)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");c=n.get_column(this.x),_=n.get_column(this.y)}else c=this.x,_=this.y;if(c.length!==_.length)throw new Error("The length for x and y do not match");if(c.length<2)throw new Error("x and y must have at least two elements to support interpolation");a=[];for(o in c)a.push({x:c[o],y:_[o]});for(!0===t?a.sort(function(t,e){var n,i;return null!=(n=t.x<e.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}):a.sort(function(t,e){var n,i;return null!=(n=t.x>e.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}),s=i=0,h=a.length;0<=h?i<h:i>h;s=0<=h?++i:--i)this._x_sorted[s]=a[s].x,this._y_sorted[s]=a[s].y;return this._sorted_dirty=!1}},e}(o.Transform);n.Interpolator=a,a.define({x:[s.Any],y:[s.Any],data:[s.Any],clip:[s.Bool,!0]})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=t(29),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),"uniform"===this.distribution?t+this.mean+(s.random()-.5)*this.width:"normal"===this.distribution?t+s.rnorm(this.mean,this.width):void 0},e}(r.Transform);n.Jitter=a,a.define({mean:[o.Number,0],width:[o.Number,1],distribution:[o.Distribution,"uniform"],range:[o.Instance]})},function(t,e,n){var i=t(364),r=t(22),o=t(239);n.LinearInterpolator=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,o,s;if(this.sort(!1),!0===this.clip){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 t===this._x_sorted[0]?this._y_sorted[0]:(e=r.findLastIndex(this._x_sorted,function(e){return e<t}),n=this._x_sorted[e],i=this._x_sorted[e+1],o=this._y_sorted[e],s=this._y_sorted[e+1],o+(t-n)/(i-n)*(s-o))},e.prototype.v_compute=function(t){var e,n,i,r,o;for(r=new Float64Array(t.length),n=e=0,i=t.length;e<i;n=++e)o=t[n],r[n]=this.compute(o);return r},e}(o.Interpolator)},function(t,e,n){var i=t(364),r=t(239),o=t(15),s=t(22),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,r;if(this.sort(!1),!0===this.clip){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.mode&&(n=s.findLastIndex(this._x_sorted,function(e){return t>=e})),"before"===this.mode&&(n=s.findIndex(this._x_sorted,function(e){return t<=e})),"center"===this.mode&&(e=function(){var e,n,i,o;for(i=this._x_sorted,o=[],e=0,n=i.length;e<n;e++)r=i[e],o.push(Math.abs(r-t));return o}.call(this),i=s.min(e),n=s.findIndex(e,function(t){return i===t})),-1!==n?this._y_sorted[n]:null},e.prototype.v_compute=function(t){var e,n,i,r,o;for(r=new Float64Array(t.length),n=e=0,i=t.length;e<i;n=++e)o=t[n],r[n]=this.compute(o);return r},e}(r.Interpolator);n.StepInterpolator=a,a.define({mode:[o.StepMode,"after"]})},function(t,e,n){var i=t(364),r=t(50);n.Transform=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.v_compute=function(t){var e,n,i,r,o,s;for(null!=(null!=(r=this.range)?r.v_synthetic:void 0)&&(t=this.range.v_synthetic(t)),o=new Float64Array(t.length),n=e=0,i=t.length;e<i;n=++e)s=t[n],o[n]=this.compute(s,!1);return o},e}(r.Model)},function(t,e,n){"function"!=typeof WeakMap&&t(313),"function"!=typeof Set&&t(303);var i=String.prototype;i.repeat||(i.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var e=""+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==e.length||0==t)return"";if(e.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var n="";1==(1&t)&&(n+=e),0!=(t>>>=1);)e+=e;return n})},function(t,e,n){var i=t(37),r=function(){function t(t,e,n){this.header=t,this.metadata=e,this.content=n,this.buffers=[]}return t.assemble=function(e,n,i){var r=JSON.parse(e),o=JSON.parse(n),s=JSON.parse(i);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var n=null!=this.header.num_buffers?this.header.num_buffers:0;if(n<=this.buffers.length)throw new Error("too many buffers received, expecting #{nb}");this.buffers.push([t,e])},t.create=function(e,n,i){void 0===i&&(i={});var r=t.create_header(e);return new t(r,n,i)},t.create_header=function(t){return{msgid:i.uniqueId(),msgtype:t}},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.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(e>0)throw new Error("BokehJS only supports receiving buffers, not sending");var n=JSON.stringify(this.header),i=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(n),t.send(i),t.send(r)},t.prototype.msgid=function(){return this.header.msgid},t.prototype.msgtype=function(){return this.header.msgtype},t.prototype.reqid=function(){return this.header.reqid},t.prototype.problem=function(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"},t}();n.Message=r},function(t,e,n){var i=t(245),r=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),n=e[0],r=e[1],o=e[2];this._partial=i.Message.assemble(n,r,o),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error("Expected text fragment but received binary fragment")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();n.Receiver=r},function(t,e,n){n.safely=function(t,e){void 0===e&&(e=!1);try{return t()}catch(t){if(function(t){var e=document.createElement("div");e.style.backgroundColor="#f2dede",e.style.border="1px solid #a94442",e.style.borderRadius="4px",e.style.display="inline-block",e.style.fontFamily="sans-serif",e.style.marginTop="5px",e.style.minWidth="200px",e.style.padding="5px 5px 5px 10px";var n=document.createElement("span");n.style.backgroundColor="#a94442",n.style.borderRadius="0px 4px 0px 0px",n.style.color="white",n.style.cursor="pointer",n.style.cssFloat="right",n.style.fontSize="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 o.removeChild(e)});var i=document.createElement("h3");i.style.color="#a94442",i.style.margin="8px 0px 0px 0px",i.style.padding="0px",i.appendChild(document.createTextNode("Bokeh Error"));var r=document.createElement("pre");r.style.whiteSpace="unset",r.style.overflowX="auto",r.appendChild(document.createTextNode(t.message||t)),e.appendChild(n),e.appendChild(i),e.appendChild(r);var o=document.getElementsByTagName("body")[0];o.insertBefore(e,o.firstChild)}(t),e)return;throw t}}},function(t,e,n){n.version="0.12.13"},/*!!
* Canvas 2 Svg v1.0.21
* A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Author:
* Kerry Liu
*
* Copyright (c) 2014 Gliffy Inc.
*/
function(t,e,n){!function(){"use strict";function t(t,e){var n,i=Object.keys(e);for(n=0;n<i.length;n++)t=t.replace(new RegExp("\\{"+i[n]+"\\}","gi"),e[i[n]]);return t}function n(t){var e,n,i;if(!t)throw new Error("cannot create a random attribute name for an undefined object");e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="";do{for(n="",i=0;i<12;i++)n+=e[Math.floor(Math.random()*e.length)]}while(t[n]);return n}var i,r,o,s,a;a=function(t,e){var n,i,r,o={};for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)i="&"+t[n+1]+";",r=parseInt(t[n],e),o[i]="&#"+r+";";return o["\\xa0"]=" ",o}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),i={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}},(o=function(t,e){this.__root=t,this.__ctx=e}).prototype.addColorStop=function(e,n){var i,r=this.__ctx.__createElement("stop");r.setAttribute("offset",e),-1!==n.indexOf("rgba")?(i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(n),r.setAttribute("stop-color",t("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),r.setAttribute("stop-opacity",i[4])):r.setAttribute("stop-color",n),this.__root.appendChild(r)},s=function(t,e){this.__root=t,this.__ctx=e},(r=function(t){var e,n={width:500,height:500,enableMirroring:!1};if(arguments.length>1?((e=n).width=arguments[0],e.height=arguments[1]):e=t||n,!(this instanceof r))return new r(e);this.width=e.width||n.width,this.height=e.height||n.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:n.enableMirroring,this.canvas=this,this.__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__root.setAttribute("version",1.1),this.__root.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__root.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__ids={},this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__root.appendChild(this.__currentElement)}).prototype.__createElement=function(t,e,n){void 0===e&&(e={});var i,r,o=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);for(n&&(o.setAttribute("fill","none"),o.setAttribute("stroke","none")),i=0;i<s.length;i++)r=s[i],o.setAttribute(r,e[r]);return o},r.prototype.__setDefaultStyles=function(){var t,e,n=Object.keys(i);for(t=0;t<n.length;t++)this[e=n[t]]=i[e].canvas},r.prototype.__applyStyleState=function(t){var e,n,i=Object.keys(t);for(e=0;e<i.length;e++)this[n=i[e]]=t[n]},r.prototype.__getStyleState=function(){var t,e,n={},r=Object.keys(i);for(t=0;t<r.length;t++)e=r[t],n[e]=this[e];return n},r.prototype.__applyStyleToCurrentElement=function(e){var n=this.__currentElement,r=this.__currentElementsToStyle;r&&(n.setAttribute(e,""),n=r.element,r.children.forEach(function(t){t.setAttribute(e,"")}));var a,l,u,h,c,_=Object.keys(i);for(a=0;a<_.length;a++)if(l=i[_[a]],u=this[_[a]],l.apply)if(u instanceof s){if(u.__ctx)for(;u.__ctx.__defs.childNodes.length;)h=u.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[h]=h,this.__defs.appendChild(u.__ctx.__defs.childNodes[0]);n.setAttribute(l.apply,t("url(#{id})",{id:u.__root.getAttribute("id")}))}else if(u instanceof o)n.setAttribute(l.apply,t("url(#{id})",{id:u.__root.getAttribute("id")}));else if(-1!==l.apply.indexOf(e)&&l.svg!==u)if("stroke"!==l.svgAttr&&"fill"!==l.svgAttr||-1===u.indexOf("rgba")){var p=l.svgAttr;if("globalAlpha"===_[a]&&(p=e+"-"+l.svgAttr,n.getAttribute(p)))continue;n.setAttribute(p,u)}else{c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(u),n.setAttribute(l.svgAttr,t("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));var d=c[4],f=this.globalAlpha;null!=f&&(d*=f),n.setAttribute(l.svgAttr+"-opacity",d)}},r.prototype.__closestGroupOrSvg=function(t){return"g"===(t=t||this.__currentElement).nodeName||"svg"===t.nodeName?t:this.__closestGroupOrSvg(t.parentNode)},r.prototype.getSerializedSvg=function(t){var e,n,i,r,o,s=(new XMLSerializer).serializeToString(this.__root);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(s)&&(s=s.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t)for(e=Object.keys(a),n=0;n<e.length;n++)i=e[n],r=a[i],(o=new RegExp(i,"gi")).test(s)&&(s=s.replace(o,r));return s},r.prototype.getSvg=function(){return this.__root},r.prototype.save=function(){var t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__stack.push(this.__getStyleState())},r.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var t=this.__stack.pop();this.__applyStyleState(t)},r.prototype.__addTransform=function(t){var e=this.__closestGroupOrSvg();if(e.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}var i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)},r.prototype.scale=function(e,n){void 0===n&&(n=e),this.__addTransform(t("scale({x},{y})",{x:e,y:n}))},r.prototype.rotate=function(e){var n=180*e/Math.PI;this.__addTransform(t("rotate({angle},{cx},{cy})",{angle:n,cx:0,cy:0}))},r.prototype.translate=function(e,n){this.__addTransform(t("translate({x},{y})",{x:e,y:n}))},r.prototype.transform=function(e,n,i,r,o,s){this.__addTransform(t("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:n,c:i,d:r,e:o,f:s}))},r.prototype.beginPath=function(){var t;this.__currentDefaultPath="",this.__currentPosition={},t=this.__createElement("path",{},!0),this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t},r.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;"path"===t.nodeName?t.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",t.nodeName)},r.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t},r.prototype.moveTo=function(e,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:n},this.__addPathCommand(t("M {x} {y}",{x:e,y:n}))},r.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},r.prototype.lineTo=function(e,n){this.__currentPosition={x:e,y:n},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(t("L {x} {y}",{x:e,y:n})):this.__addPathCommand(t("M {x} {y}",{x:e,y:n}))},r.prototype.bezierCurveTo=function(e,n,i,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:n,cp2x:i,cp2y:r,x:o,y:s}))},r.prototype.quadraticCurveTo=function(e,n,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(t("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:n,x:i,y:r}))};var l=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};r.prototype.arcTo=function(t,e,n,i,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if(void 0!==o&&void 0!==s){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&s===e||t===n&&e===i||0===r)this.lineTo(t,e);else{var a=l([o-t,s-e]),u=l([n-t,i-e]);if(a[0]*u[1]!=a[1]*u[0]){var h=a[0]*u[0]+a[1]*u[1],c=Math.acos(Math.abs(h)),_=l([a[0]+u[0],a[1]+u[1]]),p=r/Math.sin(c/2),d=t+p*_[0],f=e+p*_[1],m=[-a[1],a[0]],v=[u[1],-u[0]],g=function(t){var e=t[0],n=t[1];return n>=0?Math.acos(e):-Math.acos(e)},y=g(m),b=g(v);this.lineTo(d+m[0]*r,f+m[1]*r),this.arc(d,f,r,y,b)}else this.lineTo(t,e)}}},r.prototype.stroke=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},r.prototype.fill=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},r.prototype.rect=function(t,e,n,i){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()},r.prototype.fillRect=function(t,e,n,i){var r;r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")},r.prototype.strokeRect=function(t,e,n,i){var r;r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")},r.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute("transform"),n=this.__root.childNodes[1],i=n.childNodes,r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)},r.prototype.clearRect=function(t,e,n,i){if(0!==t||0!==e||n!==this.width||i!==this.height){var r,o=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0),o.appendChild(r)}else this.__clearCanvas()},r.prototype.createLinearGradient=function(t,e,i,r){var s=this.__createElement("linearGradient",{id:n(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(s),new o(s,this)},r.prototype.createRadialGradient=function(t,e,i,r,s,a){var l=this.__createElement("radialGradient",{id:n(this.__ids),cx:r+"px",cy:s+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(l),new o(l,this)},r.prototype.__parseFont=function(){var t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i.exec(this.font),e={style:t[1]||"normal",size:t[4]||"10px",family:t[6]||"sans-serif",weight:t[3]||"normal",decoration:t[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(e.decoration="underline"),this.__fontHref&&(e.href=this.__fontHref),e},r.prototype.__wrapTextLink=function(t,e){if(t.href){var n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e},r.prototype.__applyText=function(t,e,n,i){var r=this.__parseFont(),o=this.__closestGroupOrSvg(),s=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":function(t){var e={left:"start",right:"end",center:"middle",start:"start",end:"end"};return e[t]||e.start}(this.textAlign),"dominant-baseline":function(t){var e={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return e[t]||e.alphabetic}(this.textBaseline)},!0);s.appendChild(this.__document.createTextNode(t)),this.__currentElement=s,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,s))},r.prototype.fillText=function(t,e,n){this.__applyText(t,e,n,"fill")},r.prototype.strokeText=function(t,e,n){this.__applyText(t,e,n,"stroke")},r.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},r.prototype.arc=function(e,n,i,r,o,s){if(r!==o){r%=2*Math.PI,o%=2*Math.PI,r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+i*Math.cos(o),l=n+i*Math.sin(o),u=e+i*Math.cos(r),h=n+i*Math.sin(r),c=s?0:1,_=0,p=o-r;p<0&&(p+=2*Math.PI),_=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(u,h),this.__addPathCommand(t("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:_,sweepFlag:c,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},r.prototype.clip=function(){var e=this.__closestGroupOrSvg(),i=this.__createElement("clipPath"),r=n(this.__ids),o=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),i.setAttribute("id",r),i.appendChild(this.__currentElement),this.__defs.appendChild(i),e.setAttribute("clip-path",t("url(#{id})",{id:r})),e.appendChild(o),this.__currentElement=o},r.prototype.drawImage=function(){var t,e,n,i,o,s,a,l,u,h,c,_,p,d,f=Array.prototype.slice.call(arguments),m=f[0],v=0,g=0;if(3===f.length)t=f[1],e=f[2],o=m.width,s=m.height,n=o,i=s;else if(5===f.length)t=f[1],e=f[2],n=f[3],i=f[4],o=m.width,s=m.height;else{if(9!==f.length)throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length);v=f[1],g=f[2],o=f[3],s=f[4],t=f[5],e=f[6],n=f[7],i=f[8]}a=this.__closestGroupOrSvg(),this.__currentElement;var y="translate("+t+", "+e+")";if(m instanceof r){if((l=m.getSvg().cloneNode(!0)).childNodes&&l.childNodes.length>1){for(u=l.childNodes[0];u.childNodes.length;)d=u.childNodes[0].getAttribute("id"),this.__ids[d]=d,this.__defs.appendChild(u.childNodes[0]);if(h=l.childNodes[1]){var b,x=h.getAttribute("transform");b=x?x+" "+y:y,h.setAttribute("transform",b),a.appendChild(h)}}}else"IMG"===m.nodeName?((c=this.__createElement("image")).setAttribute("width",n),c.setAttribute("height",i),c.setAttribute("preserveAspectRatio","none"),(v||g||o!==m.width||s!==m.height)&&((_=this.__document.createElement("canvas")).width=n,_.height=i,(p=_.getContext("2d")).drawImage(m,v,g,o,s,0,0,n,i),m=_),c.setAttribute("transform",y),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===m.nodeName?m.toDataURL():m.getAttribute("src")),a.appendChild(c)):"CANVAS"===m.nodeName&&((c=this.__createElement("image")).setAttribute("width",n),c.setAttribute("height",i),c.setAttribute("preserveAspectRatio","none"),(_=this.__document.createElement("canvas")).width=n,_.height=i,(p=_.getContext("2d")).imageSmoothingEnabled=!1,p.mozImageSmoothingEnabled=!1,p.oImageSmoothingEnabled=!1,p.webkitImageSmoothingEnabled=!1,p.drawImage(m,v,g,o,s,0,0,n,i),m=_,c.setAttribute("transform",y),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m.toDataURL()),a.appendChild(c))},r.prototype.createPattern=function(t,e){var i,o=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),a=n(this.__ids);return o.setAttribute("id",a),o.setAttribute("width",t.width),o.setAttribute("height",t.height),"CANVAS"===t.nodeName||"IMG"===t.nodeName?((i=this.__document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("width",t.width),i.setAttribute("height",t.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===t.nodeName?t.toDataURL():t.getAttribute("src")),o.appendChild(i),this.__defs.appendChild(o)):t instanceof r&&(o.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(o)),new s(o,this)},r.prototype.setLineDash=function(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null},r.prototype.drawFocusRing=function(){},r.prototype.createImageData=function(){},r.prototype.getImageData=function(){},r.prototype.putImageData=function(){},r.prototype.globalCompositeOperation=function(){},r.prototype.setTransform=function(){},"object"==typeof window&&(window.C2S=r),"object"==typeof e&&"object"==typeof e.exports&&(e.exports=r)}()},function(t,e,n){var i,r=t(273),o=t(283),s=t(287),a=t(282),l=t(287),u=t(289),h=Function.prototype.bind,c=Object.defineProperty,_=Object.prototype.hasOwnProperty;i=function(t,e,n){var i,o=u(e)&&l(e.value);return i=r(e),delete i.writable,delete i.value,i.get=function(){return!n.overwriteDefinition&&_.call(this,t)?o:(e.value=h.call(o,n.resolveContext?n.resolveContext(this):this),c(this,t,e),this[t])},i},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,n){return i(n,t,e)})}},function(t,e,n){var i=t(270),r=t(283),o=t(276),s=t(290);(e.exports=function(t,e){var n,o,a,l,u;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=a=!0,o=!1):(n=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),u={value:e,configurable:n,enumerable:o,writable:a},l?i(r(l),u):u}).gs=function(t,e,n){var a,l,u,h;return"string"!=typeof t?(u=n,n=e,e=t,t=null):u=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=e,e=n=void 0),null==t?(a=!0,l=!1):(a=s.call(t,"c"),l=s.call(t,"e")),h={get:e,set:n,configurable:a,enumerable:l},u?i(r(u),h):h}},function(t,e,n){var i=t(289);e.exports=function(){return i(this).length=0,this}},function(t,e,n){var i=t(264),r=t(268),o=t(289),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,u=Math.floor;e.exports=function(t){var e,n,h,c;if(!i(t))return s.apply(this,arguments);for(n=r(o(this).length),h=arguments[1],h=isNaN(h)?0:h>=0?u(h):r(this.length)-u(l(h)),e=h;e<n;++e)if(a.call(this,e)&&(c=this[e],i(c)))return e;return-1}},function(t,e,n){e.exports=t(255)()?Array.from:t(256)},function(t,e,n){e.exports=function(){var t,e,n=Array.from;return"function"==typeof n&&(t=["raz","dwa"],e=n(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,n){var i=t(308).iterator,r=t(257),o=t(258),s=t(268),a=t(287),l=t(289),u=t(278),h=t(293),c=Array.isArray,_=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,n,f,m,v,g,y,b,x,w,k=arguments[1],S=arguments[2];if(t=Object(l(t)),u(k)&&a(k),this&&this!==Array&&o(this))e=this;else{if(!k){if(r(t))return 1!==(v=t.length)?Array.apply(null,t):(m=new Array(1),m[0]=t[0],m);if(c(t)){for(m=new Array(v=t.length),n=0;n<v;++n)m[n]=t[n];return m}}m=[]}if(!c(t))if(void 0!==(x=t[i])){for(y=a(x).call(t),e&&(m=new e),b=y.next(),n=0;!b.done;)w=k?_.call(k,S,b.value,n):b.value,e?(p.value=w,d(m,n,p)):m[n]=w,b=y.next(),++n;v=n}else if(h(t)){for(v=t.length,e&&(m=new e),n=0,f=0;n<v;++n)w=t[n],n+1<v&&(g=w.charCodeAt(0))>=55296&&g<=56319&&(w+=t[++n]),w=k?_.call(k,S,w,f):w,e?(p.value=w,d(m,f,p)):m[f]=w,++f;v=f}if(void 0===v)for(v=s(t.length),e&&(m=new e(v)),n=0;n<v;++n)w=k?_.call(k,S,t[n],n):t[n],e?(p.value=w,d(m,n,p)):m[n]=w;return e&&(p.value=null,m.length=v),m}},function(t,e,n){var i=Object.prototype.toString,r=i.call(function(){return arguments}());e.exports=function(t){return i.call(t)===r}},function(t,e,n){var i=Object.prototype.toString,r=i.call(t(259));e.exports=function(t){return"function"==typeof t&&i.call(t)===r}},function(t,e,n){e.exports=function(){}},function(t,e,n){e.exports=function(){return this}()},function(t,e,n){e.exports=t(262)()?Math.sign:t(263)},function(t,e,n){e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e,n){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,n){e.exports=t(265)()?Number.isNaN:t(266)},function(t,e,n){e.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){e.exports=function(t){return t!=t}},function(t,e,n){var i=t(261),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?i(t)*o(r(t)):t}},function(t,e,n){var i=t(267),r=Math.max;e.exports=function(t){return r(0,i(t))}},function(t,e,n){var i=t(287),r=t(289),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(n,u){var h,c=arguments[2],_=arguments[3];return n=Object(r(n)),i(u),h=a(n),_&&h.sort("function"==typeof _?o.call(_,n):void 0),"function"!=typeof t&&(t=h[t]),s.call(t,h,function(t,i){return l.call(n,t)?s.call(u,c,n[t],t,n,i):e})}}},function(t,e,n){e.exports=t(271)()?Object.assign:t(272)},function(t,e,n){e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){var i=t(279),r=t(289),o=Math.max;e.exports=function(t,e){var n,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(i){try{t[i]=e[i]}catch(t){n||(n=t)}},s=1;s<l;++s)e=arguments[s],i(e).forEach(a);if(void 0!==n)throw n;return t}},function(t,e,n){var i=t(254),r=t(270),o=t(289);e.exports=function(t){var e=Object(o(t)),n=arguments[1],s=Object(arguments[2]);if(e!==t&&!n)return e;var a={};return n?i(n,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):r(a,t),a}},function(t,e,n){var i,r=Object.create;t(285)()||(i=t(286)),e.exports=function(){var t,e,n;return i?1!==i.level?r:(t={},e={},n={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){e[t]="__proto__"!==t?n:{configurable:!0,enumerable:!1,writable:!0,value:void 0}}),Object.defineProperties(t,e),Object.defineProperty(i,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,n){return r(null===e?t:e,n)}):r}()},function(t,e,n){e.exports=t(269)("forEach")},function(t,e,n){e.exports=function(t){return"function"==typeof t}},function(t,e,n){var i=t(278),r={function:!0,object:!0};e.exports=function(t){return i(t)&&r[typeof t]||!1}},function(t,e,n){var i=t(259)();e.exports=function(t){return t!==i&&null!==t}},function(t,e,n){e.exports=t(280)()?Object.keys:t(281)},function(t,e,n){e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){var i=t(278),r=Object.keys;e.exports=function(t){return r(i(t)?Object(t):t)}},function(t,e,n){var i=t(287),r=t(275),o=Function.prototype.call;e.exports=function(t,e){var n={},s=arguments[2];return i(e),r(t,function(t,i,r,a){n[i]=o.call(e,s,t,i,r,a)}),n}},function(t,e,n){var i=t(278),r=Array.prototype.forEach,o=Object.create;e.exports=function(t){var e=o(null);return r.call(arguments,function(t){i(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)}),e}},function(t,e,n){e.exports=t(285)()?Object.setPrototypeOf:t(286)},function(t,e,n){var i=Object.create,r=Object.getPrototypeOf,o={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||i;return"function"==typeof t&&r(t(e(null),o))===o}},function(t,e,n){var i,r=t(277),o=t(289),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};i=function(t,e){if(o(t),null===e||r(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,n;return t?(2===t.level?t.set?(n=t.set,e=function(t,e){return n.call(i(t,e),e),t}):e=function(t,e){return i(t,e).__proto__=e,t}:e=function t(e,n){var r;return i(e,n),(r=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===n&&(n=t.nullPolyfill),e.__proto__=n,r&&a(t.nullPolyfill,"__proto__",l),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),n={},i=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(i){try{(t=i.set).call(e,n)}catch(t){}if(Object.getPrototypeOf(e)===n)return{set:t,level:2}}return e.__proto__=n,Object.getPrototypeOf(e)===n?{level:2}:(e={},e.__proto__=n,Object.getPrototypeOf(e)===n&&{level:1})}()),t(274)},function(t,e,n){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){var i=t(277);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not an Object");return t}},function(t,e,n){var i=t(278);e.exports=function(t){if(!i(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){e.exports=t(291)()?String.prototype.contains:t(292)},function(t,e,n){e.exports=function(){return"function"==typeof"razdwatrzy".contains&&(!0==="razdwatrzy".contains("dwa")&&!1==="razdwatrzy".contains("foo"))}},function(t,e,n){var i=String.prototype.indexOf;e.exports=function(t){return i.call(this,t,arguments[1])>-1}},function(t,e,n){var i=Object.prototype.toString,r=i.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||i.call(t)===r)||!1}},function(t,e,n){var i=Object.create(null),r=Math.random;e.exports=function(){var t;do{t=r().toString(36).slice(2)}while(i[t]);return t}},function(t,e,n){var i,r=t(284),o=t(290),s=t(251),a=t(308),l=t(298),u=Object.defineProperty;i=e.exports=function(t,e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",u(this,"__kind__",s("",e))},r&&r(i,l),delete i.prototype.constructor,i.prototype=Object.create(l.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),u(i.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,n){var i=t(257),r=t(287),o=t(293),s=t(297),a=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var n,h,c,_,p,d,f,m,v=arguments[2];if(a(t)||i(t)?n="array":o(t)?n="string":t=s(t),r(e),c=function(){_=!0},"array"!==n)if("string"!==n)for(h=t.next();!h.done;){if(l.call(e,v,h.value,c),_)return;h=t.next()}else for(d=t.length,p=0;p<d&&(f=t[p],p+1<d&&(m=f.charCodeAt(0))>=55296&&m<=56319&&(f+=t[++p]),l.call(e,v,f,c),!_);++p);else u.call(t,function(t){return l.call(e,v,t,c),_})}},function(t,e,n){var i=t(257),r=t(293),o=t(295),s=t(300),a=t(301),l=t(308).iterator;e.exports=function(t){return"function"==typeof a(t)[l]?t[l]():i(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,n){var i,r=t(252),o=t(270),s=t(287),a=t(289),l=t(251),u=t(250),h=t(308),c=Object.defineProperty,_=Object.defineProperties;e.exports=i=function(t,e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");_(this,{__list__:l("w",a(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete i.prototype.constructor,_(i.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:l(function(){return this._createResult(this._next())}),_createResult:l(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:l(function(t){return this.__list__[t]}),_unBind:l(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:l(function(){return"[object "+(this[h.toStringTag]||"Object")+"]"})},u({_onAdd:l(function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)):c(this,"__redo__",l("c",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),c(i.prototype,h.iterator,l(function(){return this}))},function(t,e,n){var i=t(257),r=t(278),o=t(293),s=t(308).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!i(t)||"function"==typeof t[s])))}},function(t,e,n){var i,r=t(284),o=t(251),s=t(308),a=t(298),l=Object.defineProperty;i=e.exports=function(t){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),l(this,"__length__",o("",t.length))},r&&r(i,a),delete i.prototype.constructor,i.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,n=this.__list__[t];return this.__nextIndex__===this.__length__?n:(e=n.charCodeAt(0))>=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n})}),l(i.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,n){var i=t(299);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not iterable");return t}},/*!
* @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(t,e,n){(function(){"use strict";function n(t){return"function"==typeof t}function i(){return function(){setTimeout(r,1)}}function r(){for(var t=0;t<w;t+=2){var e=z[t],n=z[t+1];e(n),z[t]=void 0,z[t+1]=void 0}w=0}function o(){try{var e=t,n=e("vertx");return g=n.runOnLoop||n.runOnContext,function(){g(r)}}catch(t){return i()}}function s(){}function a(t,e){if(e.constructor===t.constructor)!function(t,e){e._state===O?h(t,e._result):e._state===N?c(t,e._result):_(e,void 0,function(e){l(t,e)},function(e){c(t,e)})}(t,e);else{var i=function(t){try{return t.then}catch(t){return j.error=t,j}}(e);i===j?c(t,j.error):void 0===i?h(t,e):n(i)?function(t,e,n){k(function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,function(n){i||(i=!0,e!==n?l(t,n):h(t,n))},function(e){i||(i=!0,c(t,e))},t._label);!i&&r&&(i=!0,c(t,r))},t)}(t,e,i):h(t,e)}}function l(t,e){t===e?c(t,new TypeError("You cannot resolve a promise with itself")):!function(t){return"function"==typeof t||"object"==typeof t&&null!==t}(e)?h(t,e):a(t,e)}function u(t){t._onerror&&t._onerror(t._result),p(t)}function h(t,e){t._state===C&&(t._result=e,t._state=O,0!==t._subscribers.length&&k(p,t))}function c(t,e){t._state===C&&(t._state=N,t._result=e,k(u,t))}function _(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+O]=n,r[o+N]=i,0===o&&t._state&&k(p,t)}function p(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i,r,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?f(n,i,r,o):r(o);t._subscribers.length=0}}function d(){this.error=null}function f(t,e,i,r){var o,s,a,u,_=n(i);if(_){if((o=function(t,e){try{return t(e)}catch(t){return P.error=t,P}}(i,r))===P?(u=!0,s=o.error,o=null):a=!0,e===o)return void c(e,new TypeError("A promises callback cannot return that same promise."))}else o=r,a=!0;e._state!==C||(_&&a?l(e,o):u?c(e,s):t===O?h(e,o):t===N&&c(e,o))}function m(t,e){this._instanceConstructor=t,this.promise=new t(s),this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?h(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&h(this.promise,this._result))):c(this.promise,this._validationError())}function v(t){this._id=L++,this._state=void 0,this._result=void 0,this._subscribers=[],s!==t&&(n(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof v||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(t,e){try{e(function(e){l(t,e)},function(e){c(t,e)})}catch(e){c(t,e)}}(this,t))}var g,y,b,x=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},w=0,k=function(t,e){z[w]=t,z[w+1]=e,2===(w+=2)&&(y?y(r):b())},S="undefined"!=typeof window?window:void 0,T=S||{},M=T.MutationObserver||T.WebKitMutationObserver,A="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),E="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,z=new Array(1e3);b=A?function(){process.nextTick(r)}:M?function(){var t=0,e=new M(r),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}():E?function(){var t=new MessageChannel;return t.port1.onmessage=r,function(){t.port2.postMessage(0)}}():void 0===S&&"function"==typeof t?o():i();var C=void 0,O=1,N=2,j=new d,P=new d;m.prototype._validateInput=function(t){return x(t)},m.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},m.prototype._init=function(){this._result=new Array(this.length)};var D=m;m.prototype._enumerate=function(){for(var t=this.length,e=this.promise,n=this._input,i=0;e._state===C&&i<t;i++)this._eachEntry(n[i],i)},m.prototype._eachEntry=function(t,e){var n=this._instanceConstructor;!function(t){return"object"==typeof t&&null!==t}(t)?(this._remaining--,this._result[e]=t):t.constructor===n&&t._state!==C?(t._onerror=null,this._settledAt(t._state,e,t._result)):this._willSettleAt(n.resolve(t),e)},m.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===C&&(this._remaining--,t===N?c(i,n):this._result[e]=n),0===this._remaining&&h(i,this._result)},m.prototype._willSettleAt=function(t,e){var n=this;_(t,void 0,function(t){n._settledAt(O,e,t)},function(t){n._settledAt(N,e,t)})};var F=function(t){return new D(this,t).promise},I=function(t){function e(t){l(i,t)}function n(t){c(i,t)}var i=new this(s);if(!x(t))return c(i,new TypeError("You must pass an array to race.")),i;var r=t.length;for(var o=0;i._state===C&&o<r;o++)_(this.resolve(t[o]),void 0,e,n);return i},B=function(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(s);return l(e,t),e},R=function(t){var e=new this(s);return c(e,t),e},L=0,V=v;v.all=F,v.race=I,v.resolve=B,v.reject=R,v._setScheduler=function(t){y=t},v._setAsap=function(t){k=t},v._asap=k,v.prototype={constructor:v,then:function(t,e){var n=this._state;if(n===O&&!t||n===N&&!e)return this;var i=new this.constructor(s),r=this._result;if(n){var o=arguments[n-1];k(function(){f(n,i,o,r)})}else _(this,i,t,e);return i},catch:function(t){return this.then(null,t)}};var G=function(){var t;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e&&"[object Promise]"===Object.prototype.toString.call(e.resolve())&&!e.cast)return;t.Promise=V},U={Promise:V,polyfill:G};void 0!==e&&e.exports?e.exports=U:void 0!==this&&(this.ES6Promise=U),G()}).call(this)},function(t,e,n){t(304)()||Object.defineProperty(t(260),"Set",{value:t(307),configurable:!0,enumerable:!1,writable:!0})},function(t,e,n){e.exports=function(){var t,e,n;return"function"==typeof Set&&(t=new Set(["raz","dwa","trzy"]),"[object Set]"===String(t)&&(3===t.size&&("function"==typeof t.add&&("function"==typeof t.clear&&("function"==typeof t.delete&&("function"==typeof t.entries&&("function"==typeof t.forEach&&("function"==typeof t.has&&("function"==typeof t.keys&&("function"==typeof t.values&&(e=t.values(),!1===(n=e.next()).done&&"raz"===n.value)))))))))))}},function(t,e,n){e.exports="undefined"!=typeof Set&&"[object Set]"===Object.prototype.toString.call(Set.prototype)},function(t,e,n){var i,r=t(284),o=t(290),s=t(251),a=t(298),l=t(308).toStringTag,u=Object.defineProperty;i=e.exports=function(t,e){if(!(this instanceof i))return new i(t,e);a.call(this,t.__setData__,t),e=e&&o.call(e,"key+value")?"key+value":"value",u(this,"__kind__",s("",e))},r&&r(i,a),i.prototype=Object.create(a.prototype,{constructor:s(i),_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__list__[t]]}),toString:s(function(){return"[object Set Iterator]"})}),u(i.prototype,l,s("c","Set Iterator"))},function(t,e,n){var i,r,o,s=t(252),a=t(253),l=t(284),u=t(287),h=t(251),c=t(317),_=t(308),p=t(301),d=t(296),f=t(306),m=t(305),v=Function.prototype.call,g=Object.defineProperty,y=Object.getPrototypeOf;m&&(o=Set),e.exports=i=function(){var t,e=arguments[0];if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");return t=m&&l?l(new o,y(this)):this,null!=e&&p(e),g(t,"__setData__",h("c",[])),e?(d(e,function(t){-1===a.call(this,t)&&this.push(t)},t.__setData__),t):t},m&&(l&&l(i,o),i.prototype=Object.create(o.prototype,{constructor:h(i)})),c(Object.defineProperties(i.prototype,{add:h(function(t){return this.has(t)?this:(this.emit("_add",this.__setData__.push(t)-1,t),this)}),clear:h(function(){this.__setData__.length&&(s.call(this.__setData__),this.emit("_clear"))}),delete:h(function(t){var e=a.call(this.__setData__,t);return-1!==e&&(this.__setData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:h(function(){return new f(this,"key+value")}),forEach:h(function(t){var e,n,i,r=arguments[1];for(u(t),e=this.values(),n=e._next();void 0!==n;)i=e._resolve(n),v.call(t,r,i,i,this),n=e._next()}),has:h(function(t){return-1!==a.call(this.__setData__,t)}),keys:h(r=function(){return this.values()}),size:h.gs(function(){return this.__setData__.length}),values:h(function(){return new f(this)}),toString:h(function(){return"[object Set]"})})),g(i.prototype,_.iterator,h(r)),g(i.prototype,_.toStringTag,h("c","Set"))},function(t,e,n){e.exports=t(309)()?Symbol:t(311)},function(t,e,n){var i={object:!0,symbol:!0};e.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!i[typeof Symbol.iterator]&&(!!i[typeof Symbol.toPrimitive]&&!!i[typeof Symbol.toStringTag])}},function(t,e,n){e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,n){var i,r,o,s,a=t(251),l=t(312),u=Object.create,h=Object.defineProperties,c=Object.defineProperty,_=Object.prototype,p=u(null);if("function"==typeof Symbol){i=Symbol;try{String(i()),s=!0}catch(t){}}var d=function(){var t=u(null);return function(e){for(var n,i,r=0;t[e+(r||"")];)++r;return e+=r||"",t[e]=!0,n="@@"+e,c(_,n,a.gs(null,function(t){i||(i=!0,c(this,n,a(t)),i=!1)})),n}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?i(e):(n=u(o.prototype),e=void 0===e?"":String(e),h(n,{__description__:a("",e),__name__:a("",d(e))}))},h(r,{for:a(function(t){return p[t]?p[t]:p[t]=r(String(t))}),keyFor:a(function(t){var e;l(t);for(e in p)if(p[e]===t)return e}),hasInstance:a("",i&&i.hasInstance||r("hasInstance")),isConcatSpreadable:a("",i&&i.isConcatSpreadable||r("isConcatSpreadable")),iterator:a("",i&&i.iterator||r("iterator")),match:a("",i&&i.match||r("match")),replace:a("",i&&i.replace||r("replace")),search:a("",i&&i.search||r("search")),species:a("",i&&i.species||r("species")),split:a("",i&&i.split||r("split")),toPrimitive:a("",i&&i.toPrimitive||r("toPrimitive")),toStringTag:a("",i&&i.toStringTag||r("toStringTag")),unscopables:a("",i&&i.unscopables||r("unscopables"))}),h(o.prototype,{constructor:a(r),toString:a("",function(){return this.__name__})}),h(r.prototype,{toString:a(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:a(function(){return l(this)})}),c(r.prototype,r.toPrimitive,a("",function(){var t=l(this);return"symbol"==typeof t?t:t.toString()})),c(r.prototype,r.toStringTag,a("c","Symbol")),c(o.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),c(o.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))},function(t,e,n){var i=t(310);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){t(314)()||Object.defineProperty(t(260),"WeakMap",{value:t(316),configurable:!0,enumerable:!1,writable:!0})},function(t,e,n){e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},function(t,e,n){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},function(t,e,n){var i,r=t(284),o=t(288),s=t(289),a=t(294),l=t(251),u=t(297),h=t(296),c=t(308).toStringTag,_=t(315),p=Array.isArray,d=Object.defineProperty,f=Object.prototype.hasOwnProperty,m=Object.getPrototypeOf;e.exports=i=function(){var t,e=arguments[0];if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");return t=_&&r&&WeakMap!==i?r(new WeakMap,m(this)):this,null!=e&&(p(e)||(e=u(e))),d(t,"__weakMapData__",l("c","$weakMap$"+a())),e?(h(e,function(e){s(e),t.set(e[0],e[1])}),t):t},_&&(r&&r(i,WeakMap),i.prototype=Object.create(WeakMap.prototype,{constructor:l(i)})),Object.defineProperties(i.prototype,{delete:l(function(t){return!!f.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:l(function(t){if(f.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:l(function(t){return f.call(o(t),this.__weakMapData__)}),set:l(function(t,e){return d(o(t),this.__weakMapData__,l("c",e)),this}),toString:l(function(){return"[object WeakMap]"})}),d(i.prototype,c,l("c","WeakMap"))},function(t,e,n){var i,r,o,s,a,l,u,h=t(251),c=t(287),_=Function.prototype.apply,p=Function.prototype.call,d=Object.create,f=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};a={on:i=function(t,e){var n;return c(e),v.call(this,"__ee__")?n=this.__ee__:(n=g.value=d(null),f(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r=function(t,e){var n,r;return c(e),r=this,i.call(this,t,n=function(){o.call(r,t,n),_.call(e,this,arguments)}),n.__eeOnceListener__=e,this},off:o=function(t,e){var n,i,r,o;if(c(e),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(i=n[t]))for(o=0;r=i[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===i.length?n[t]=i[o?0:1]:i.splice(o,1));else i!==e&&i.__eeOnceListener__!==e||delete n[t];return this},emit:s=function(t){var e,n,i,r,o;if(v.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)_.call(i,this,o)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];_.call(r,this,o)}}},l={on:h(i),once:h(r),off:h(o),emit:h(s)},u=m({},l),e.exports=n=function(t){return null==t?d(u):m(Object(t),l)},n.methods=a},/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
function(t,e,n){!function(t,n,i,r){"use strict";function o(t,e,n){return setTimeout(h(t,n),e)}function s(t,e,n){return!!Array.isArray(t)&&(a(t,n[e],n),!0)}function a(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==r)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function l(e,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,i),e.apply(this,arguments)}}function u(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&Z(i,n)}function h(t,e){return function(){return t.apply(e,arguments)}}function c(t,e){return typeof t==et?t.apply(e?e[0]||r:r,e):t}function _(t,e){return t===r?e:t}function p(t,e,n){a(v(e),function(e){t.addEventListener(e,n,!1)})}function d(t,e,n){a(v(e),function(e){t.removeEventListener(e,n,!1)})}function f(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function m(t,e){return t.indexOf(e)>-1}function v(t){return t.trim().split(/\s+/g)}function g(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function y(t){return Array.prototype.slice.call(t,0)}function b(t,e,n){for(var i=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];g(r,s)<0&&i.push(t[o]),r[o]=s,o++}return n&&(i=e?i.sort(function(t,n){return t[e]>n[e]}):i.sort()),i}function x(t,e){for(var n,i,o=e[0].toUpperCase()+e.slice(1),s=0;s<K.length;){if(n=K[s],(i=n?n+o:e)in t)return i;s++}return r}function w(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}function k(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){c(t.options.enable,[t])&&n.handler(e)},this.init()}function S(t,e,n){var i=n.pointers.length,o=n.changedPointers.length,s=e&_t&&i-o==0,a=e&(dt|ft)&&i-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,i=e.pointers,o=i.length;n.firstInput||(n.firstInput=T(e));o>1&&!n.firstMultiple?n.firstMultiple=T(e):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,u=e.center=M(i);e.timeStamp=rt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=C(l,u),e.distance=z(l,u),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==_t&&o.eventType!==dt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y});e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=E(e.deltaX,e.deltaY);var h=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=it(h.x)>it(h.y)?h.x:h.y,e.scale=a?function(t,e){return z(e[0],e[1],Tt)/z(t[0],t[1],Tt)}(a.pointers,i):1,e.rotation=a?function(t,e){return C(e[1],e[0],Tt)+C(t[1],t[0],Tt)}(a.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=ft&&(l>ct||a.velocity===r)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=A(l,u,h);i=c.x,o=c.y,n=it(c.x)>it(c.y)?c.x:c.y,s=E(u,h),t.lastInterval=e}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=o,e.direction=s}(n,e);var c=t.element;f(e.srcEvent.target,c)&&(c=e.srcEvent.target);e.target=c}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function T(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:nt(t.pointers[n].clientX),clientY:nt(t.pointers[n].clientY)},n++;return{timeStamp:rt(),pointers:e,center:M(e),deltaX:t.deltaX,deltaY:t.deltaY}}function M(t){var e=t.length;if(1===e)return{x:nt(t[0].clientX),y:nt(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:nt(n/e),y:nt(i/e)}}function A(t,e,n){return{x:e/t||0,y:n/t||0}}function E(t,e){return t===e?mt:it(t)>=it(e)?t<0?vt:gt:e<0?yt:bt}function z(t,e,n){n||(n=St);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function C(t,e,n){n||(n=St);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function O(){this.evEl=At,this.evWin=Et,this.pressed=!1,k.apply(this,arguments)}function N(){this.evEl=Ot,this.evWin=Nt,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function j(){this.evTarget=Pt,this.evWin=Dt,this.started=!1,k.apply(this,arguments)}function P(){this.evTarget=It,this.targetIds={},k.apply(this,arguments)}function D(){k.apply(this,arguments);var t=h(this.handler,this);this.touch=new P(this.manager,t),this.mouse=new O(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function F(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)};setTimeout(r,Bt)}}function I(t,e){this.manager=t,this.set(e)}function B(t){this.options=Z({},this.defaults,t||{}),this.id=at++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Ht,this.simultaneous={},this.requireFail=[]}function R(t){return t&Kt?"cancel":t&$t?"end":t&Qt?"move":t&Jt?"start":""}function L(t){return t==bt?"down":t==yt?"up":t==vt?"left":t==gt?"right":""}function V(t,e){var n=e.manager;return n?n.get(t):t}function G(){B.apply(this,arguments)}function U(){G.apply(this,arguments),this.pX=null,this.pY=null}function Y(){G.apply(this,arguments)}function q(){B.apply(this,arguments),this._timer=null,this._input=null}function X(){G.apply(this,arguments)}function W(){G.apply(this,arguments)}function H(){B.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function J(t,e){return e=e||{},e.recognizers=_(e.recognizers,J.defaults.preset),new Q(t,e)}function Q(t,e){this.options=Z({},J.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){var e,n=t.options.inputClass;e=n||(ut?N:ht?P:lt?D:O);return new e(t,S)}(this),this.touchAction=new I(this,this.options.touchAction),$(this,!0),a(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 $(t,e){var n=t.element;if(n.style){var i;a(t.options.cssProps,function(r,o){i=x(n.style,o),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={})}}var Z,K=["","webkit","Moz","MS","ms","o"],tt=n.createElement("div"),et="function",nt=Math.round,it=Math.abs,rt=Date.now;Z="function"!=typeof Object.assign?function(t){if(t===r||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(e[o]=i[o])}return e}:Object.assign;var ot=l(function(t,e,n){for(var i=Object.keys(e),o=0;o<i.length;)(!n||n&&t[i[o]]===r)&&(t[i[o]]=e[i[o]]),o++;return t},"extend","Use `assign`."),st=l(function(t,e){return ot(t,e,!0)},"merge","Use `assign`."),at=1,lt="ontouchstart"in t,ut=x(t,"PointerEvent")!==r,ht=lt&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ct=25,_t=1,pt=2,dt=4,ft=8,mt=1,vt=2,gt=4,yt=8,bt=16,xt=vt|gt,wt=yt|bt,kt=xt|wt,St=["x","y"],Tt=["clientX","clientY"];k.prototype={handler:function(){},init:function(){this.evEl&&p(this.element,this.evEl,this.domHandler),this.evTarget&&p(this.target,this.evTarget,this.domHandler),this.evWin&&p(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(w(this.element),this.evWin,this.domHandler)}};var Mt={mousedown:_t,mousemove:pt,mouseup:dt},At="mousedown",Et="mousemove mouseup";u(O,k,{handler:function(t){var e=Mt[t.type];e&_t&&0===t.button&&(this.pressed=!0),e&pt&&1!==t.which&&(e=dt),this.pressed&&(e&dt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var zt={pointerdown:_t,pointermove:pt,pointerup:dt,pointercancel:ft,pointerout:ft},Ct={2:"touch",3:"pen",4:"mouse",5:"kinect"},Ot="pointerdown",Nt="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ot="MSPointerDown",Nt="MSPointerMove MSPointerUp MSPointerCancel"),u(N,k,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=zt[i],o=Ct[t.pointerType]||t.pointerType,s="touch"==o,a=g(e,t.pointerId,"pointerId");r&_t&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(dt|ft)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))}});var jt={touchstart:_t,touchmove:pt,touchend:dt,touchcancel:ft},Pt="touchstart",Dt="touchstart touchmove touchend touchcancel";u(j,k,{handler:function(t){var e=jt[t.type];if(e===_t&&(this.started=!0),this.started){var n=function(t,e){var n=y(t.touches),i=y(t.changedTouches);e&(dt|ft)&&(n=b(n.concat(i),"identifier",!0));return[n,i]}.call(this,t,e);e&(dt|ft)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var Ft={touchstart:_t,touchmove:pt,touchend:dt,touchcancel:ft},It="touchstart touchmove touchend touchcancel";u(P,k,{handler:function(t){var e=Ft[t.type],n=function(t,e){var n=y(t.touches),i=this.targetIds;if(e&(_t|pt)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=y(t.changedTouches),a=[],l=this.target;if(o=n.filter(function(t){return f(t.target,l)}),e===_t)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;r=0;for(;r<s.length;)i[s[r].identifier]&&a.push(s[r]),e&(dt|ft)&&delete i[s[r].identifier],r++;if(!a.length)return;return[b(o.concat(a),"identifier",!0),a]}.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});var Bt=2500,Rt=25;u(D,k,{handler:function(t,e,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(t,e){t&_t?(this.primaryTouch=e.changedPointers[0].identifier,F.call(this,e)):t&(dt|ft)&&F.call(this,e)}).call(this,e,n);else if(r&&function(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=Rt&&s<=Rt)return!0}return!1}.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Lt=x(tt.style,"touchAction"),Vt=Lt!==r,Gt="auto",Ut="manipulation",Yt="none",qt="pan-x",Xt="pan-y",Wt=function(){if(!Vt)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){e[i]=!n||t.CSS.supports("touch-action",i)}),e}();I.prototype={set:function(t){"compute"==t&&(t=this.compute()),Vt&&this.manager.element.style&&Wt[t]&&(this.manager.element.style[Lt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return a(this.manager.recognizers,function(e){c(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(m(t,Yt))return Yt;var e=m(t,qt),n=m(t,Xt);if(e&&n)return Yt;if(e||n)return e?qt:Xt;if(m(t,Ut))return Ut;return Gt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=m(i,Yt)&&!Wt[Yt],o=m(i,Xt)&&!Wt[Xt],s=m(i,qt)&&!Wt[qt];if(r){var a=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(a&&l&&u)return}if(!s||!o)return r||o&&n&xt||s&&n&wt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Ht=1,Jt=2,Qt=4,$t=8,Zt=$t,Kt=16;B.prototype={defaults:{},set:function(t){return Z(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(s(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=V(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return s(t,"dropRecognizeWith",this)?this:(t=V(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(s(t,"requireFailure",this))return this;var e=this.requireFail;return t=V(t,this),-1===g(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(s(t,"dropRequireFailure",this))return this;t=V(t,this);var e=g(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){n.manager.emit(e,t)}var n=this,i=this.state;i<$t&&e(n.options.event+R(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=$t&&e(n.options.event+R(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|Ht)))return!1;t++}return!0},recognize:function(t){var e=Z({},t);if(!c(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(Zt|Kt|32)&&(this.state=Ht),this.state=this.process(e),this.state&(Jt|Qt|$t|Kt)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},u(G,B,{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,n=t.eventType,i=e&(Jt|Qt),r=this.attrTest(t);return i&&(n&ft||!r)?e|Kt:i||r?n&dt?e|$t:e&Jt?e|Qt:Jt:32}}),u(U,G,{defaults:{event:"pan",threshold:10,pointers:1,direction:kt},getTouchAction:function(){var t=this.options.direction,e=[];return t&xt&&e.push(Xt),t&wt&&e.push(qt),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&xt?(r=0===o?mt:o<0?vt:gt,n=o!=this.pX,i=Math.abs(t.deltaX)):(r=0===s?mt:s<0?yt:bt,n=s!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return G.prototype.attrTest.call(this,t)&&(this.state&Jt||!(this.state&Jt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=L(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(Y,G,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Jt)},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)}}),u(q,B,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(dt|ft)&&!r)this.reset();else if(t.eventType&_t)this.reset(),this._timer=o(function(){this.state=Zt,this.tryEmit()},e.time,this);else if(t.eventType&dt)return Zt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Zt&&(t&&t.eventType&dt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=rt(),this.manager.emit(this.options.event,this._input)))}}),u(X,G,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Jt)}}),u(W,G,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xt|wt,pointers:1},getTouchAction:function(){return U.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(xt|wt)?e=t.overallVelocity:n&xt?e=t.overallVelocityX:n&wt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&it(e)>this.options.velocity&&t.eventType&dt},emit:function(t){var e=L(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(H,B,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ut]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&_t&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=dt)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||z(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t;var l=this.count%e.taps;if(0===l)return this.hasRequireFailures()?(this._timer=o(function(){this.state=Zt,this.tryEmit()},e.interval,this),Jt):Zt}return 32},failTimeout:function(){return this._timer=o(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Zt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),J.VERSION="2.0.7",J.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[X,{enable:!1}],[Y,{enable:!1},["rotate"]],[W,{direction:xt}],[U,{direction:xt},["swipe"]],[H],[H,{event:"doubletap",taps:2},["tap"]],[q]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};Q.prototype={set:function(t){return Z(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?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,i=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&Zt)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===e.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&n.state&(Jt|Qt|$t)&&(r=e.curRecognizer=n),o++}},get:function(t){if(t instanceof B)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(s(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(s(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=g(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==r&&e!==r){var n=this.handlers;return a(v(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==r){var n=this.handlers;return a(v(t),function(t){e?n[t]&&n[t].splice(g(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var i=n.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](e),r++}},destroy:function(){this.element&&$(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},Z(J,{INPUT_START:_t,INPUT_MOVE:pt,INPUT_END:dt,INPUT_CANCEL:ft,STATE_POSSIBLE:Ht,STATE_BEGAN:Jt,STATE_CHANGED:Qt,STATE_ENDED:$t,STATE_RECOGNIZED:Zt,STATE_CANCELLED:Kt,STATE_FAILED:32,DIRECTION_NONE:mt,DIRECTION_LEFT:vt,DIRECTION_RIGHT:gt,DIRECTION_UP:yt,DIRECTION_DOWN:bt,DIRECTION_HORIZONTAL:xt,DIRECTION_VERTICAL:wt,DIRECTION_ALL:kt,Manager:Q,Input:k,TouchAction:I,TouchInput:P,MouseInput:O,PointerEventInput:N,TouchMouseInput:D,SingleTouchInput:j,Recognizer:B,AttrRecognizer:G,Tap:H,Pan:U,Swipe:W,Pinch:Y,Rotate:X,Press:q,on:p,off:d,each:a,merge:st,extend:ot,assign:Z,inherit:u,bindFn:h,prefixed:x});var te=void 0!==t?t:"undefined"!=typeof self?self:{};te.Hammer=J,void 0!==e&&e.exports?e.exports=J:t.Hammer=J}(window,document)},function(t,e,n){var i,r=t(324);!function(t){t[t.Le=0]="Le",t[t.Ge=1]="Ge",t[t.Eq=2]="Eq"}(i=n.Operator||(n.Operator={}));var o=function(){function t(t,e,n){void 0===n&&(n=r.Strength.required),this._id=s++,this._operator=e,this._expression=t,this._strength=r.Strength.clip(n)}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){var t=this;return this._expression+" "+function(){switch(t._operator){case i.Le:return"<=";case i.Ge:return">=";case i.Eq:return"=="}}()+" 0"},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"expression",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"op",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();n.Constraint=o;var s=0},function(t,e,n){var i=t(328),r=t(331),o=t(322),s=function(){function t(){var t=function(t){for(var e=0,n=function(){return 0},i=o.createMap(r.Variable.Compare),s=0,a=t.length;s<a;++s){var l=t[s];if("number"==typeof l)e+=l;else if(l instanceof r.Variable)i.setDefault(l,n).second+=1;else{if(!(l instanceof Array))throw new Error("invalid Expression argument: "+JSON.stringify(l));if(2!==l.length)throw new Error("array must have length 2");var u=l[0],h=l[1];if("number"!=typeof u)throw new Error("array item 0 must be a number");if(!(h instanceof r.Variable))throw new Error("array item 1 must be a variable");i.setDefault(h,n).second+=u}}return{terms:i,constant:e}}(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.toString=function(){var t=[];i.forEach(this._terms,function(e){t.push([e.first,e.second])});for(var e=!0,n="",r=0,o=t;r<o.length;r++){var s=o[r],a=s[0],l=s[1];e?(e=!1,n+=1==l?""+a:-1==l?"-"+a:l+"*"+a):n+=1==l?" + "+a:-1==l?" - "+a:l>=0?" + "+l+a:" - "+-l+a}var u=this.constant;return u<0?n+=" - "+-u:u>0&&(n+=" + "+u),n},Object.defineProperty(t.prototype,"terms",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"constant",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this._constant;return i.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();n.Expression=s},function(t,e,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.
|----------------------------------------------------------------------------*/
function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}i(t(331)),i(t(320)),i(t(319)),i(t(324)),i(t(323))},function(t,e,n){var i=t(328);n.createMap=function(t){return new i.AssociativeArray(t)}},function(t,e,n){function i(t){return t<0?-t<1e-8:t<1e-8}var r=t(331),o=t(320),s=t(319),a=t(324),l=t(322),u=t(328),h=function(){function t(){this._cnMap=l.createMap(s.Constraint.Compare),this._rowMap=l.createMap(_.Compare),this._varMap=l.createMap(r.Variable.Compare),this._editMap=l.createMap(r.Variable.Compare),this._infeasibleRows=[],this._objective=new d,this._artificial=null,this._idTick=0}return t.prototype.addConstraint=function(t){var e=this._cnMap.find(t);if(void 0!==e)throw new Error("duplicate constraint");var n=this._createRow(t),r=n.row,o=n.tag,s=this._chooseSubject(r,o);if(s.type()===c.Invalid&&r.allDummies()){if(!i(r.constant())){for(var a=[],l=0,u=t.expression.terms._array;l<u.length;l++){var h=u[l];a.push(h.first.name)}var _=["LE","GE","EQ"][t.op];throw new Error("unsatisfiable constraint ["+a.join(",")+"] operator: "+_)}s=o.marker}if(s.type()===c.Invalid){if(!this._addWithArtificialVariable(r))throw new Error("unsatisfiable constraint")}else r.solveFor(s),this._substitute(s,r),this._rowMap.insert(s,r);this._cnMap.insert(t,o),this._optimize(this._objective)},t.prototype.removeConstraint=function(t,e){void 0===e&&(e=!1);var n=this._cnMap.erase(t);if(void 0===n){if(e)return;throw new Error("unknown constraint")}this._removeConstraintEffects(t,n.second);var i=n.second.marker,r=this._rowMap.erase(i);if(void 0===r){var o=this._getMarkerLeavingSymbol(i);if(o.type()===c.Invalid)throw new Error("failed to find leaving row");(r=this._rowMap.erase(o)).second.solveForEx(o,i),this._substitute(i,r.second)}this._optimize(this._objective)},t.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},t.prototype.addEditVariable=function(t,e){var n=this._editMap.find(t);if(void 0!==n)throw new Error("duplicate edit variable: "+t.name);if((e=a.Strength.clip(e))===a.Strength.required)throw new Error("bad required strength");var i=new o.Expression(t),r=new s.Constraint(i,s.Operator.Eq,e);this.addConstraint(r);var l=this._cnMap.find(r).second,u={tag:l,constraint:r,constant:0};this._editMap.insert(t,u)},t.prototype.removeEditVariable=function(t,e){void 0===e&&(e=!1);var n=this._editMap.erase(t);if(void 0===n){if(e)return;throw new Error("unknown edit variable: "+t.name)}this.removeConstraint(n.second.constraint,e)},t.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},t.prototype.suggestValue=function(t,e){var n=this._editMap.find(t);if(void 0===n)throw new Error("unknown edit variable: "+t.name);var i=this._rowMap,r=n.second,o=e-r.constant;r.constant=e;var s=r.tag.marker,a=i.find(s);if(void 0!==a)return a.second.add(-o)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=r.tag.other;if(void 0!==(a=i.find(l)))return a.second.add(o)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var u=0,h=i.size();u<h;++u){var _=i.itemAt(u),p=_.second,d=p.coefficientFor(s);0!==d&&p.add(o*d)<0&&_.first.type()!==c.External&&this._infeasibleRows.push(_.first)}this._dualOptimize()},t.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,n=0,i=t.size();n<i;++n){var r=t.itemAt(n),o=e.find(r.second),s=0;void 0!==o&&-0===(s=o.second.constant())&&(s=0),r.first.setValue(s)}},t.prototype.getConstraints=function(){var t=[];return u.forEach(this._cnMap,function(e){t.push(e.first)}),t},Object.defineProperty(t.prototype,"numConstraints",{get:function(){return this._cnMap.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numEditVariables",{get:function(){return this._editMap.size()},enumerable:!0,configurable:!0}),t.prototype._getVarSymbol=function(t){var e=this;return this._varMap.setDefault(t,function(){return e._makeSymbol(c.External)}).second},t.prototype._createRow=function(t){for(var e=t.expression,n=new d(e.constant),r=e.terms,o=0,l=r.size();o<l;++o){var u=r.itemAt(o);if(!i(u.second)){var h=this._getVarSymbol(u.first),_=this._rowMap.find(h);void 0!==_?n.insertRow(_.second,u.second):n.insertSymbol(h,u.second)}}var f=this._objective,m=t.strength,v={marker:p,other:p};switch(t.op){case s.Operator.Le:case s.Operator.Ge:var g=t.op===s.Operator.Le?1:-1,y=this._makeSymbol(c.Slack);if(v.marker=y,n.insertSymbol(y,g),m<a.Strength.required){var b=this._makeSymbol(c.Error);v.other=b,n.insertSymbol(b,-g),f.insertSymbol(b,m)}break;case s.Operator.Eq:if(m<a.Strength.required){var x=this._makeSymbol(c.Error),w=this._makeSymbol(c.Error);v.marker=x,v.other=w,n.insertSymbol(x,-1),n.insertSymbol(w,1),f.insertSymbol(x,m),f.insertSymbol(w,m)}else{var k=this._makeSymbol(c.Dummy);v.marker=k,n.insertSymbol(k)}}return n.constant()<0&&n.reverseSign(),{row:n,tag:v}},t.prototype._chooseSubject=function(t,e){for(var n=t.cells(),i=0,r=n.size();i<r;++i){var o=n.itemAt(i);if(o.first.type()===c.External)return o.first}var s=e.marker.type();return(s===c.Slack||s===c.Error)&&t.coefficientFor(e.marker)<0?e.marker:((s=e.other.type())===c.Slack||s===c.Error)&&t.coefficientFor(e.other)<0?e.other:p},t.prototype._addWithArtificialVariable=function(t){var e=this._makeSymbol(c.Slack);this._rowMap.insert(e,t.copy()),this._artificial=t.copy(),this._optimize(this._artificial);var n=i(this._artificial.constant());this._artificial=null;var r=this._rowMap.erase(e);if(void 0!==r){var o=r.second;if(o.isConstant())return n;var s=this._anyPivotableSymbol(o);if(s.type()===c.Invalid)return!1;o.solveForEx(e,s),this._substitute(s,o),this._rowMap.insert(s,o)}for(var a=this._rowMap,l=0,u=a.size();l<u;++l)a.itemAt(l).second.removeSymbol(e);return this._objective.removeSymbol(e),n},t.prototype._substitute=function(t,e){for(var n=this._rowMap,i=0,r=n.size();i<r;++i){var o=n.itemAt(i);o.second.substitute(t,e),o.second.constant()<0&&o.first.type()!==c.External&&this._infeasibleRows.push(o.first)}this._objective.substitute(t,e),this._artificial&&this._artificial.substitute(t,e)},t.prototype._optimize=function(t){for(;;){var e=this._getEnteringSymbol(t);if(e.type()===c.Invalid)return;var n=this._getLeavingSymbol(e);if(n.type()===c.Invalid)throw new Error("the objective is unbounded");var i=this._rowMap.erase(n).second;i.solveForEx(n,e),this._substitute(e,i),this._rowMap.insert(e,i)}},t.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var n=e.pop(),i=t.find(n);if(void 0!==i&&i.second.constant()<0){var r=this._getDualEnteringSymbol(i.second);if(r.type()===c.Invalid)throw new Error("dual optimize failed");var o=i.second;t.erase(n),o.solveForEx(n,r),this._substitute(r,o),t.insert(r,o)}}},t.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),n=0,i=e.size();n<i;++n){var r=e.itemAt(n),o=r.first;if(r.second<0&&o.type()!==c.Dummy)return o}return p},t.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,n=p,i=t.cells(),r=0,o=i.size();r<o;++r){var s=i.itemAt(r),a=s.first,l=s.second;if(l>0&&a.type()!==c.Dummy){var u=this._objective.coefficientFor(a),h=u/l;h<e&&(e=h,n=a)}}return n},t.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,n=p,i=this._rowMap,r=0,o=i.size();r<o;++r){var s=i.itemAt(r),a=s.first;if(a.type()!==c.External){var l=s.second,u=l.coefficientFor(t);if(u<0){var h=-l.constant()/u;h<e&&(e=h,n=a)}}}return n},t.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,n=e,i=e,r=p,o=r,s=r,a=r,l=this._rowMap,u=0,h=l.size();u<h;++u){var _=l.itemAt(u),d=_.second,f=d.coefficientFor(t);if(0!==f){var m=_.first;if(m.type()===c.External)a=m;else if(f<0){var v=-d.constant()/f;v<n&&(n=v,o=m)}else{var v=d.constant()/f;v<i&&(i=v,s=m)}}}return o!==r?o:s!==r?s:a},t.prototype._removeConstraintEffects=function(t,e){e.marker.type()===c.Error&&this._removeMarkerEffects(e.marker,t.strength),e.other.type()===c.Error&&this._removeMarkerEffects(e.other,t.strength)},t.prototype._removeMarkerEffects=function(t,e){var n=this._rowMap.find(t);void 0!==n?this._objective.insertRow(n.second,-e):this._objective.insertSymbol(t,-e)},t.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),n=0,i=e.size();n<i;++n){var r=e.itemAt(n),o=r.first.type();if(o===c.Slack||o===c.Error)return r.first}return p},t.prototype._makeSymbol=function(t){return new _(t,this._idTick++)},t}();n.Solver=h;var c;!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"}(c||(c={}));var _=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}(),p=new _(c.Invalid,-1),d=function(){function t(t){void 0===t&&(t=0),this._cellMap=l.createMap(_.Compare),this._constant=t}return t.prototype.cells=function(){return this._cellMap},t.prototype.constant=function(){return this._constant},t.prototype.isConstant=function(){return this._cellMap.empty()},t.prototype.allDummies=function(){for(var t=this._cellMap,e=0,n=t.size();e<n;++e){var i=t.itemAt(e);if(i.first.type()!==c.Dummy)return!1}return!0},t.prototype.copy=function(){var e=new t(this._constant);return e._cellMap=this._cellMap.copy(),e},t.prototype.add=function(t){return this._constant+=t},t.prototype.insertSymbol=function(t,e){void 0===e&&(e=1);var n=this._cellMap.setDefault(t,function(){return 0});i(n.second+=e)&&this._cellMap.erase(t)},t.prototype.insertRow=function(t,e){void 0===e&&(e=1),this._constant+=t._constant*e;for(var n=t._cellMap,i=0,r=n.size();i<r;++i){var o=n.itemAt(i);this.insertSymbol(o.first,o.second*e)}},t.prototype.removeSymbol=function(t){this._cellMap.erase(t)},t.prototype.reverseSign=function(){this._constant=-this._constant;for(var t=this._cellMap,e=0,n=t.size();e<n;++e){var i=t.itemAt(e);i.second=-i.second}},t.prototype.solveFor=function(t){var e=this._cellMap,n=e.erase(t),i=-1/n.second;this._constant*=i;for(var r=0,o=e.size();r<o;++r)e.itemAt(r).second*=i},t.prototype.solveForEx=function(t,e){this.insertSymbol(t,-1),this.solveFor(e)},t.prototype.coefficientFor=function(t){var e=this._cellMap.find(t);return void 0!==e?e.second:0},t.prototype.substitute=function(t,e){var n=this._cellMap.erase(t);void 0!==n&&this.insertRow(e,n.second)},t}()},function(t,e,n){!function(t){function e(t,e,n,i){void 0===i&&(i=1);var r=0;return r+=1e6*Math.max(0,Math.min(1e3,t*i)),r+=1e3*Math.max(0,Math.min(1e3,e*i)),r+=Math.max(0,Math.min(1e3,n*i))}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=function(e){return Math.max(0,Math.min(t.required,e))}}(n.Strength||(n.Strength={}))},function(t,e,n){function i(t,e,n){for(var i,r,o=0,s=t.length;s>0;)n(t[r=o+(i=s>>1)],e)<0?(o=r+1,s-=i+1):s=i;return o}var r=t(329);n.lowerBound=i,n.binarySearch=function(t,e,n){var r=i(t,e,n);if(r===t.length)return-1;var o=t[r];if(0!==n(o,e))return-1;return r},n.binaryFind=function(t,e,n){var r=i(t,e,n);if(r===t.length)return;var o=t[r];if(0!==n(o,e))return;return o},n.asSet=function(t,e){var n=r.asArray(t),i=n.length;if(i<=1)return n;n.sort(e);for(var o=[n[0]],s=1,a=0;s<i;++s){var l=n[s];0!==e(o[a],l)&&(o.push(l),++a)}return o},n.setIsDisjoint=function(t,e,n){var i=0,r=0,o=t.length,s=e.length;for(;i<o&&r<s;){var a=n(t[i],e[r]);if(a<0)++i;else{if(!(a>0))return!1;++r}}return!0},n.setIsSubset=function(t,e,n){var i=t.length,r=e.length;if(i>r)return!1;var o=0,s=0;for(;o<i&&s<r;){var a=n(t[o],e[s]);if(a<0)return!1;a>0?++s:(++o,++s)}if(o<i)return!1;return!0},n.setUnion=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?(a.push(l),++i):h>0?(a.push(u),++r):(a.push(l),++i,++r)}for(;i<o;)a.push(t[i]),++i;for(;r<s;)a.push(e[r]),++r;return a},n.setIntersection=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?++i:h>0?++r:(a.push(l),++i,++r)}return a},n.setDifference=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?(a.push(l),++i):h>0?++r:(++i,++r)}for(;i<o;)a.push(t[i]),++i;return a},n.setSymmetricDifference=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?(a.push(l),++i):h>0?(a.push(u),++r):(++i,++r)}for(;i<o;)a.push(t[i]),++i;for(;r<s;)a.push(e[r]),++r;return a}},function(t,e,n){var i=t(329),r=function(){function t(){this._array=[]}return t.prototype.size=function(){return this._array.length},t.prototype.empty=function(){return 0===this._array.length},t.prototype.itemAt=function(t){return this._array[t]},t.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},t.prototype.clear=function(){this._array=[]},t.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},t.prototype.__iter__=function(){return i.iter(this._array)},t.prototype.__reversed__=function(){return i.reversed(this._array)},t}();n.ArrayBase=r},function(t,e,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 i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=t(330),o=t(326),s=t(325),a=t(329),l=function(t){function e(e){var n=t.call(this)||this;return n._compare=e,n._wrapped=function(t){return function(e,n){return t(e.first,n)}}(e),n}return i(e,t),e.prototype.comparitor=function(){return this._compare},e.prototype.indexOf=function(t){return s.binarySearch(this._array,t,this._wrapped)},e.prototype.contains=function(t){return s.binarySearch(this._array,t,this._wrapped)>=0},e.prototype.find=function(t){return s.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var n=this._array,i=s.lowerBound(n,t,this._wrapped);if(i===n.length){var o=new r.Pair(t,e());return n.push(o),o}var a=n[i];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e());return n.splice(i,0,o),o}return a},e.prototype.insert=function(t,e){var n=this._array,i=s.lowerBound(n,t,this._wrapped);if(i===n.length){var o=new r.Pair(t,e);return n.push(o),o}var a=n[i];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e);return n.splice(i,0,o),o}return a.second=e,a},e.prototype.update=function(t){var n=this;t instanceof e?this._array=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i<o&&r<s;){var l=t[i],u=e[r],h=n(l.first,u.first);h<0?(a.push(l.copy()),++i):h>0?(a.push(u.copy()),++r):(a.push(u.copy()),++i,++r)}for(;i<o;)a.push(t[i].copy()),++i;for(;r<s;)a.push(e[r].copy()),++r;return a}(this._array,t._array,this._compare):a.forEach(t,function(t){n.insert(t.first,t.second)})},e.prototype.erase=function(t){var e=this._array,n=s.binarySearch(e,t,this._wrapped);if(!(n<0))return e.splice(n,1)[0]},e.prototype.copy=function(){for(var t=new e(this._compare),n=t._array,i=this._array,r=0,o=i.length;r<o;++r)n.push(i[r].copy());return t},e}(o.ArrayBase);n.AssociativeArray=l},function(t,e,n){function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}i(t(325)),i(t(326)),i(t(327)),i(t(329)),i(t(330))},function(t,e,n){var i=function(){function t(t,e){void 0===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}();n.ArrayIterator=i;var r=function(){function t(t,e){void 0===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}();n.ReverseArrayIterator=r,n.iter=function(t){if(t instanceof Array)return new i(t);return t.__iter__()},n.reversed=function(t){if(t instanceof Array)return new r(t);return t.__reversed__()},n.next=function(t){return t.__next__()},n.asArray=function(t){if(t instanceof Array)return t.slice();var e,n=[],i=t.__iter__();for(;void 0!==(e=i.__next__());)n.push(e);return n},n.forEach=function(t,e){if(t instanceof Array){for(var n=0,i=t.length;n<i;++n)if(!1===e(t[n]))return}else for(var r,o=t.__iter__();void 0!==(r=o.__next__());)if(!1===e(r))return},n.map=function(t,e){var n=[];if(t instanceof Array)for(var i=0,r=t.length;i<r;++i)n.push(e(t[i]));else for(var o,s=t.__iter__();void 0!==(o=s.__next__());)n.push(e(o));return n},n.filter=function(t,e){var n,i=[];if(t instanceof Array)for(var r=0,o=t.length;r<o;++r)n=t[r],e(n)&&i.push(n);else for(var s=t.__iter__();void 0!==(n=s.__next__());)e(n)&&i.push(n);return i}},function(t,e,n){var i=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();n.Pair=i},function(t,e,n){var i=function(){function t(t){void 0===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.toString=function(){return this._name},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.setName=function(t){this._name=t},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),t.prototype.setContext=function(t){this._context=t},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){this._value=t},t}();n.Variable=i;var r=0},/*!
* numbro.js
* version : 1.6.2
* author : Företagsplatsen AB
* license : MIT
* http://www.foretagsplatsen.se
*/
function(t,e,n){function i(t){this._value=t}function r(t){var e,n="";for(e=0;e<t;e++)n+="0";return n}function o(t,e,n,i){var o,s,a=Math.pow(10,e);return s=t.toFixed(0).search("e")>-1?function(t,e){var n,i,o,s,a;a=t.toString(),n=a.split("e")[0],s=a.split("e")[1],i=n.split(".")[0],o=n.split(".")[1]||"",a=i+o+r(s-o.length),e>0&&(a+="."+r(e));return a}(t,e):(n(t*a)/a).toFixed(e),i&&(o=new RegExp("0{1,"+i+"}$"),s=s.replace(o,"")),s}function s(t,e,n){return e.indexOf("$")>-1?function(t,e,n){var i,r,o=e,s=o.indexOf("$"),l=o.indexOf("("),u=o.indexOf("+"),h=o.indexOf("-"),_="",d="";-1===o.indexOf("$")?"infix"===c[p].currency.position?(d=c[p].currency.symbol,c[p].currency.spaceSeparated&&(d=" "+d+" ")):c[p].currency.spaceSeparated&&(_=" "):o.indexOf(" $")>-1?(_=" ",o=o.replace(" $","")):o.indexOf("$ ")>-1?(_=" ",o=o.replace("$ ","")):o=o.replace("$","");if(r=a(t,o,n,d),-1===e.indexOf("$"))switch(c[p].currency.position){case"postfix":r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,_+c[p].currency.symbol),r=r.join("")):r=r+_+c[p].currency.symbol;break;case"infix":break;case"prefix":r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),i=Math.max(l,h)+1,r.splice(i,0,c[p].currency.symbol+_),r=r.join("")):r=c[p].currency.symbol+_+r;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?r.indexOf("(")>-1||r.indexOf("+")>-1||r.indexOf("-")>-1?(r=r.split(""),i=1,(s<l||s<u||s<h)&&(i=0),r.splice(i,0,c[p].currency.symbol+_),r=r.join("")):r=c[p].currency.symbol+_+r:r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,_+c[p].currency.symbol),r=r.join("")):r=r+_+c[p].currency.symbol;return r}(t,e,n):e.indexOf("%")>-1?function(t,e,n){var i,r="";t*=100,e.indexOf(" %")>-1?(r=" ",e=e.replace(" %","")):e=e.replace("%","");(i=a(t,e,n)).indexOf(")")>-1?((i=i.split("")).splice(-1,0,r+"%"),i=i.join("")):i=i+r+"%";return i}(t,e,n):e.indexOf(":")>-1?function(t){var e=Math.floor(t/60/60),n=Math.floor((t-60*e*60)/60),i=Math.round(t-60*e*60-60*n);return e+":"+(n<10?"0"+n:n)+":"+(i<10?"0"+i:i)}(t):a(t,e,n)}function a(t,e,n,i){var r,s,a,l,u,h,_,f,m,v,g,y,b,x,w,k,S,T,M=!1,A=!1,E=!1,z="",C=!1,O=!1,N=!1,j=!1,P=!1,D="",F="",I=Math.abs(t),B=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],R=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],L="",V=!1,G=!1,U="";if(0===t&&null!==d)return d;if(!isFinite(t))return""+t;if(0===e.indexOf("{")){var Y=e.indexOf("}");if(-1===Y)throw Error('Format should also contain a "}"');y=e.slice(1,Y),e=e.slice(Y+1)}else y="";if(e.indexOf("}")===e.length-1){var q=e.indexOf("{");if(-1===q)throw Error('Format should also contain a "{"');b=e.slice(q+1,-1),e=e.slice(0,q+1)}else b="";var X;if(X=-1===e.indexOf(".")?e.match(/([0-9]+).*/):e.match(/([0-9]+)\..*/),T=null===X?-1:X[1].length,-1!==e.indexOf("-")&&(V=!0),e.indexOf("(")>-1?(M=!0,e=e.slice(1,-1)):e.indexOf("+")>-1&&(A=!0,e=e.replace(/\+/g,"")),e.indexOf("a")>-1){if(v=e.split(".")[0].match(/[0-9]+/g)||["0"],v=parseInt(v[0],10),C=e.indexOf("aK")>=0,O=e.indexOf("aM")>=0,N=e.indexOf("aB")>=0,j=e.indexOf("aT")>=0,P=C||O||N||j,e.indexOf(" a")>-1?(z=" ",e=e.replace(" a","")):e=e.replace("a",""),u=Math.floor(Math.log(I)/Math.LN10)+1,_=u%3,_=0===_?3:_,v&&0!==I&&(h=Math.floor(Math.log(I)/Math.LN10)+1-v,f=3*~~((Math.min(v,u)-_)/3),I/=Math.pow(10,f),-1===e.indexOf(".")&&v>3))for(e+="[.]",k=(k=0===h?0:3*~~(h/3)-h)<0?k+3:k,r=0;r<k;r++)e+="0";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==v&&(I>=Math.pow(10,12)&&!P||j?(z+=c[p].abbreviations.trillion,t/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!P||N?(z+=c[p].abbreviations.billion,t/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!P||O?(z+=c[p].abbreviations.million,t/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!P||C)&&(z+=c[p].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf("b")>-1)for(e.indexOf(" b")>-1?(D=" ",e=e.replace(" b","")):e=e.replace("b",""),l=0;l<=B.length;l++)if(s=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=s&&t<a){D+=B[l],s>0&&(t/=s);break}if(e.indexOf("d")>-1)for(e.indexOf(" d")>-1?(D=" ",e=e.replace(" d","")):e=e.replace("d",""),l=0;l<=R.length;l++)if(s=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=s&&t<a){D+=R[l],s>0&&(t/=s);break}if(e.indexOf("o")>-1&&(e.indexOf(" o")>-1?(F=" ",e=e.replace(" o","")):e=e.replace("o",""),c[p].ordinal&&(F+=c[p].ordinal(t))),e.indexOf("[.]")>-1&&(E=!0,e=e.replace("[.]",".")),m=t.toString().split(".")[0],g=e.split(".")[1],x=e.indexOf(","),g){if(-1!==g.indexOf("*")?L=o(t,t.toString().split(".")[1].length,n):g.indexOf("[")>-1?(g=(g=g.replace("]","")).split("["),L=o(t,g[0].length+g[1].length,n,g[1].length)):L=o(t,g.length,n),m=L.split(".")[0],L.split(".")[1].length){var W=i?z+i:c[p].delimiters.decimal;L=W+L.split(".")[1]}else L="";E&&0===Number(L.slice(1))&&(L="")}else m=o(t,null,n);return m.indexOf("-")>-1&&(m=m.slice(1),G=!0),m.length<T&&(m=new Array(T-m.length+1).join("0")+m),x>-1&&(m=m.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+c[p].delimiters.thousands)),0===e.indexOf(".")&&(m=""),w=e.indexOf("("),S=e.indexOf("-"),U=w<S?(M&&G?"(":"")+(V&&G||!M&&G?"-":""):(V&&G||!M&&G?"-":"")+(M&&G?"(":""),y+U+(!G&&A&&0!==t?"+":"")+m+L+(F||"")+(z&&!i?z:"")+(D||"")+(M&&G?")":"")+b}function l(t,e){c[t]=e}function u(t){p=t;var e=c[t].defaults;e&&e.format&&h.defaultFormat(e.format),e&&e.currencyFormat&&h.defaultCurrencyFormat(e.currencyFormat)}var h,c={},_=c,p="en-US",d=null,f="0,0",m="0$";void 0!==e&&e.exports;(h=function(t){return h.isNumbro(t)?t=t.value():0===t||void 0===t?t=0:Number(t)||(t=h.fn.unformat(t)),new i(Number(t))}).version="1.6.2",h.isNumbro=function(t){return t instanceof i},h.setLanguage=function(t,e){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var n=t,i=t.split("-")[0],r=null;_[n]||(Object.keys(_).forEach(function(t){r||t.split("-")[0]!==i||(r=t)}),n=r||e||"en-US"),u(n)},h.setCulture=function(t,e){var n=t,i=t.split("-")[1],r=null;c[n]||(i&&Object.keys(c).forEach(function(t){r||t.split("-")[1]!==i||(r=t)}),n=r||e||"en-US"),u(n)},h.language=function(t,e){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!t)return p;if(t&&!e){if(!_[t])throw new Error("Unknown language : "+t);u(t)}return!e&&_[t]||l(t,e),h},h.culture=function(t,e){if(!t)return p;if(t&&!e){if(!c[t])throw new Error("Unknown culture : "+t);u(t)}return!e&&c[t]||l(t,e),h},h.languageData=function(t){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!t)return _[p];if(!_[t])throw new Error("Unknown language : "+t);return _[t]},h.cultureData=function(t){if(!t)return c[p];if(!c[t])throw new Error("Unknown culture : "+t);return c[t]},h.culture("en-US",{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"}}),h.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),_},h.cultures=function(){return c},h.zeroFormat=function(t){d="string"==typeof t?t:null},h.defaultFormat=function(t){f="string"==typeof t?t:"0.0"},h.defaultCurrencyFormat=function(t){m="string"==typeof t?t:"0$"},h.validate=function(t,e){var n,i,r,o,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()).match(/^\d+$/))return!0;if(""===t)return!1;try{l=h.cultureData(e)}catch(t){l=h.cultureData(h.culture())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,i="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,(null===(u=t.match(/^[^\d]+/))||(t=t.substr(1),u[0]===r))&&((null===(u=t.match(/[^\d]+$/))||(t=t.slice(0,-1),u[0]===s.thousand||u[0]===s.million||u[0]===s.billion||u[0]===s.trillion))&&(a=new RegExp(i+"{2}"),!t.match(/[^\d.,]/g)&&!((o=t.split(n)).length>2||(o.length<2?!o[0].match(/^\d+.*\d$/)||o[0].match(a):1===o[0].length?!o[0].match(/^\d+$/)||o[0].match(a)||!o[1].match(/^\d+$/):!o[0].match(/^\d+.*\d$/)||o[0].match(a)||!o[1].match(/^\d+$/)))))},e.exports={format:function(t,e,n,i){null!=n&&n!==h.culture()&&h.setCulture(n);return s(Number(t),null!=e?e:f,null==i?Math.round:i)}}},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(t);e=e||function(t){if(t)throw t};var n=r(t);if("object"==typeof n){var s=i.projections.get(n.projName);if(s){if(n.datumCode&&"none"!==n.datumCode){var h=l[n.datumCode];h&&(n.datum_params=h.towgs84?h.towgs84.split(","):null,n.ellps=h.ellipse,n.datumName=h.datumName?h.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu";var c=a.sphere(n.a,n.b,n.rf,n.ellps,n.sphere),_=a.eccentricity(c.a,c.b,c.rf,n.R_A),p=n.datum||u(n.datumCode,n.datum_params,c.a,c.b,_.es,_.ep2);o(this,n),o(this,s),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=_.es,this.e=_.e,this.ep2=_.ep2,this.datum=p,this.init(),e(null,this)}else e(t)}else e(t)}var r=t(353),o=t(351),s=t(355),a=t(350),l=t(341),u=t(346);(i.projections=s).start(),e.exports=i},function(t,e,n){e.exports=function(t,e,n){var i,r,o,s=n.x,a=n.y,l=n.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(i=s,r="x"):1===o?(i=a,r="y"):(i=l,r="z"),t.axis[o]){case"e":u[r]=i;break;case"w":u[r]=-i;break;case"n":u[r]=i;break;case"s":u[r]=-i;break;case"u":void 0!==n[r]&&(u.z=i);break;case"d":void 0!==n[r]&&(u.z=-i);break;default:return null}return u}},function(t,e,n){var i=2*Math.PI,r=t(338);e.exports=function(t){return Math.abs(t)<=3.14159265359?t:t-r(t)*i}},function(t,e,n){e.exports=function(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e){for(var n,r,o=.5*t,s=i-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,n){e.exports=function(t){return t<0?-1:1}},function(t,e,n){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}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r}},function(t,e,n){n.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},n.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},n.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},n.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},n.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},n.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},n.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},n.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},n.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},n.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},n.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},n.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},n.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},n.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},n.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},n.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(t,e,n){n.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},n.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},n.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},n.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},n.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},n.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},n.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},n.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},n.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},n.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},n.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},n.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},n.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},n.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},n.hough={a:6378270,rf:297,ellipseName:"Hough"},n.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},n.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},n.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},n.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},n.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},n.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},n.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},n.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},n.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},n.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},n.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,n){n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},function(t,e,n){n.ft={to_meter:.3048},n["us-ft"]={to_meter:1200/3937}},function(t,e,n){function i(t,e,n){var i;return Array.isArray(n)?(i=s(t,e,n),3===n.length?[i.x,i.y,i.z]:[i.x,i.y]):s(t,e,n)}function r(t){return t instanceof o?t:t.oProj?t.oProj:o(t)}var o=t(333),s=t(358),a=o("WGS84");e.exports=function(t,e,n){t=r(t);var o,s=!1;void 0===e?(e=t,t=a,s=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=a,s=!0);return e=r(e),n?i(t,e,n):(o={forward:function(n){return i(t,e,n)},inverse:function(n){return i(e,t,n)}},s&&(o.oProj=e),o)}},function(t,e,n){var i=1,r=2,o=4,s=5,a=484813681109536e-20;e.exports=function(t,e,n,l,u,h){var c={};c.datum_type=o,t&&"none"===t&&(c.datum_type=s);e&&(c.datum_params=e.map(parseFloat),0===c.datum_params[0]&&0===c.datum_params[1]&&0===c.datum_params[2]||(c.datum_type=i),c.datum_params.length>3&&(0===c.datum_params[3]&&0===c.datum_params[4]&&0===c.datum_params[5]&&0===c.datum_params[6]||(c.datum_type=r,c.datum_params[3]*=a,c.datum_params[4]*=a,c.datum_params[5]*=a,c.datum_params[6]=c.datum_params[6]/1e6+1)));return c.a=n,c.b=l,c.es=u,c.ep2=h,c}},function(t,e,n){var i=Math.PI/2;n.compareDatums=function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(this.es-e.es)>5e-11)&&(1===t.datum_type?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))},n.geodeticToGeocentric=function(t,e,n){var r,o,s,a,l=t.x,u=t.y,h=t.z?t.z:0;if(u<-i&&u>-1.001*i)u=-i;else if(u>i&&u<1.001*i)u=i;else if(u<-i||u>i)return null;return l>Math.PI&&(l-=2*Math.PI),o=Math.sin(u),a=Math.cos(u),s=o*o,r=n/Math.sqrt(1-e*s),{x:(r+h)*a*Math.cos(l),y:(r+h)*a*Math.sin(l),z:(r*(1-e)+h)*o}},n.geocentricToGeodetic=function(t,e,n,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t.x,w=t.y,k=t.z?t.z:0;if(o=Math.sqrt(x*x+w*w),s=Math.sqrt(x*x+w*w+k*k),o/n<1e-12){if(g=0,s/n<1e-12)return y=i,b=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(w,x);a=k/s,l=o/s,u=1/Math.sqrt(1-e*(2-e)*l*l),_=l*(1-e)*u,p=a*u,v=0;do{v++,c=n/Math.sqrt(1-e*p*p),h=e*c/(c+(b=o*_+k*p-c*(1-e*p*p))),u=1/Math.sqrt(1-h*(2-h)*l*l),m=(f=a*u)*_-(d=l*(1-h)*u)*p,_=d,p=f}while(m*m>1e-24&&v<30);return y=Math.atan(f/Math.abs(d)),{x:g,y:y,z:b}},n.geocentricToWgs84=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],u=n[6];return{x:u*(t.x-l*t.y+a*t.z)+i,y:u*(l*t.x+t.y-s*t.z)+r,z:u*(-a*t.x+s*t.y+t.z)+o}}},n.geocentricFromWgs84=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],u=n[6],h=(t.x-i)/u,c=(t.y-r)/u,_=(t.z-o)/u;return{x:h+l*c-a*_,y:-l*h+c+s*_,z:a*h-s*c+_}}}},function(t,e,n){function i(t){return t===r||t===o}var r=1,o=2,s=t(347);e.exports=function(t,e,n){return s.compareDatums(t,e)?n:5===t.datum_type||5===e.datum_type?n:t.es!==e.es||t.a!==e.a||i(t.datum_type)||i(e.datum_type)?(n=s.geodeticToGeocentric(n,t.es,t.a),i(t.datum_type)&&(n=s.geocentricToWgs84(n,t.datum_type,t.datum_params)),i(e.datum_type)&&(n=s.geocentricFromWgs84(n,e.datum_type,e.datum_params)),s.geocentricToGeodetic(n,e.es,e.a,e.b)):n}},function(t,e,n){function i(t){var e=this;if(2===arguments.length){var n=arguments[1];i[t]="string"==typeof n?"+"===n.charAt(0)?o(arguments[1]):s(arguments[1]):n}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?i.apply(e,t):i(t)});if("string"==typeof t){if(t in i)return i[t]}else"EPSG"in t?i["EPSG:"+t.EPSG]=t:"ESRI"in t?i["ESRI:"+t.ESRI]=t:"IAU2000"in t?i["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var r=t(352),o=t(354),s=t(359);r(i),e.exports=i},function(t,e,n){var i=t(342);n.eccentricity=function(t,e,n,i){var r=t*t,o=e*e,s=(r-o)/r,a=0;i?(r=(t*=1-s*(.16666666666666666+s*(.04722222222222222+.022156084656084655*s)))*t,s=0):a=Math.sqrt(s);var l=(r-o)/o;return{es:s,e:a,ep2:l}},n.sphere=function(t,e,n,r,o){if(!t){var s=i[r];s||(s=i.WGS84),t=s.a,e=s.b,n=s.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<1e-10)&&(o=!0,e=t),{a:t,b:e,rf:n,sphere:o}}},function(t,e,n){e.exports=function(t,e){t=t||{};var n,i;if(!e)return t;for(i in e)void 0!==(n=e[i])&&(t[i]=n);return t}},function(t,e,n){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"]}},function(t,e,n){var i=t(349),r=t(359),o=t(354),s=["GEOGCS","GEOCCS","PROJCS","LOCAL_CS"];e.exports=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in i}(t))return i[t];if(function(t){return s.some(function(e){return t.indexOf(e)>-1})}(t))return r(t);if(function(t){return"+"===t[0]}(t))return o(t)}},function(t,e,n){var i=.017453292519943295,r=t(343),o=t(344);e.exports=function(t){var e,n,s,a={},l=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t},{}),u={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*i},lat_1:function(t){a.lat1=t*i},lat_2:function(t){a.lat2=t*i},lat_ts:function(t){a.lat_ts=t*i},lon_0:function(t){a.long0=t*i},lon_1:function(t){a.long1=t*i},lon_2:function(t){a.long2=t*i},alpha:function(t){a.alpha=parseFloat(t)*i},lonc:function(t){a.longc=t*i},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t,o[t]&&(a.to_meter=o[t].to_meter)},from_greenwich:function(t){a.from_greenwich=t*i},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*i},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t},axis:function(t){3===t.length&&-1!=="ewnsud".indexOf(t.substr(0,1))&&-1!=="ewnsud".indexOf(t.substr(1,1))&&-1!=="ewnsud".indexOf(t.substr(2,1))&&(a.axis=t)}};for(e in l)n=l[e],e in u?"function"==typeof(s=u[e])?s(n):a[s]=n:a[e]=n;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,n){function i(t,e){var n=s.length;return t.names?(s[n]=t,t.names.forEach(function(t){o[t.toLowerCase()]=n}),this):(console.log(e),!0)}var r=[t(357),t(356)],o={},s=[];n.add=i,n.get=function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==o[e]&&s[o[e]]?s[o[e]]:void 0},n.start=function(){r.forEach(i)}},function(t,e,n){function i(t){return t}n.init=function(){},n.forward=i,n.inverse=i,n.names=["longlat","identity"]},function(t,e,n){var i=t(336),r=Math.PI/2,o=57.29577951308232,s=t(335),a=Math.PI/4,l=t(340),u=t(337);n.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=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},n.forward=function(t){var e=t.x,n=t.y;if(n*o>90&&n*o<-90&&e*o>180&&e*o<-180)return null;var i,u;if(Math.abs(Math.abs(n)-r)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*s(e-this.long0),u=this.y0+this.a*this.k0*Math.log(Math.tan(a+.5*n));else{var h=Math.sin(n),c=l(this.e,n,h);i=this.x0+this.a*this.k0*s(e-this.long0),u=this.y0-this.a*this.k0*Math.log(c)}return t.x=i,t.y=u,t},n.inverse=function(t){var e,n,i=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(n=u(this.e,a)))return null}return e=s(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},n.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},function(t,e,n){var i=1,r=2,o=t(348),s=t(334),a=t(333),l=t(339);e.exports=function t(e,n,u){var h;return Array.isArray(u)&&(u=l(u)),e.datum&&n.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===r)&&"WGS84"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===r)&&"WGS84"!==t.datumCode}(e,n)&&(h=new a("WGS84"),u=t(e,h,u),e=h),"enu"!==e.axis&&(u=s(e,!1,u)),"longlat"===e.projName?u={x:.017453292519943295*u.x,y:.017453292519943295*u.y}:(e.to_meter&&(u={x:u.x*e.to_meter,y:u.y*e.to_meter}),u=e.inverse(u)),e.from_greenwich&&(u.x+=e.from_greenwich),u=o(e.datum,n.datum,u),n.from_greenwich&&(u={x:u.x-n.grom_greenwich,y:u.y}),"longlat"===n.projName?u={x:57.29577951308232*u.x,y:57.29577951308232*u.y}:(u=n.forward(u),n.to_meter&&(u={x:u.x/n.to_meter,y:u.y/n.to_meter})),"enu"!==n.axis?s(n,!0,u):u}},function(t,e,n){function i(t,e,n){t[e]=n.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return a(t,e)},{})}function r(t,e){var n;Array.isArray(t)?("PARAMETER"===(n=t.shift())&&(n=t.shift()),1===t.length?Array.isArray(t[0])?(e[n]={},r(t[0],e[n])):e[n]=t[0]:t.length?"TOWGS84"===n?e[n]=t:(e[n]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(n)>-1?(e[n]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[n].auth=t[2])):"SPHEROID"===n?(e[n]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[n].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(n)>-1?(t[0]=["name",t[0]],i(e,n,t)):t.every(function(t){return Array.isArray(t)})?i(e,n,t):r(t,e[n])):e[n]=!0):e[t]=!0}function o(t){return t*s}var s=.017453292519943295,a=t(351);e.exports=function(t,e){var n=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".+/,"")),i=n.shift(),s=n.shift();n.unshift(["name",s]),n.unshift(["type",i]),n.unshift("output");var l={};return r(n,l),function(t){function e(e){var n=t.to_meter||1;return parseFloat(e,10)*n}"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);[["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",o],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",o],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",o],["lat0","latitude_of_origin",o],["lat0","standard_parallel_1",o],["lat1","standard_parallel_1",o],["lat2","standard_parallel_2",o],["alpha","azimuth",o],["srsCode","name"]].forEach(function(e){return function(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}(t,e)}),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=o(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(l.output),a(e,l.output)}},function(t,e,n){function i(t,e,n,o,s){for(n=n||0,o=o||t.length-1,s=s||function(t,e){return t<e?-1:t>e?1:0};o>n;){if(o-n>600){var a=o-n+1,l=e-n+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1),_=Math.max(n,Math.floor(e-l*h/a+c)),p=Math.min(o,Math.floor(e+(a-l)*h/a+c));i(t,e,_,p,s)}var d=t[e],f=n,m=o;for(r(t,n,e),s(t[o],d)>0&&r(t,n,o);f<m;){for(r(t,f,m),f++,m--;s(t[f],d)<0;)f++;for(;s(t[m],d)>0;)m--}0===s(t[n],d)?r(t,n,m):r(t,++m,o),m<=e&&(n=m+1),e<=m&&(o=m-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}e.exports=i},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e){o(t,0,t.children.length,e,t)}function o(t,e,n,i,r){r||(r=p(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o,a=e;a<n;a++)o=t.children[a],s(r,t.leaf?i(o):o);return r}function s(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 a(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function u(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function c(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function _(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(t,e,n,i,r){for(var o,s=[e,n];s.length;)n=s.pop(),e=s.pop(),n-e<=i||(o=e+Math.ceil((n-e)/i/2)*i,f(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var f=t(360);i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!_(t,e))return n;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],a=e.leaf?i(s):s,_(t,a)&&(e.leaf?n.push(s):c(t,a)?this._all(s,n):l.push(s));e=l.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!_(t,e))return!1;for(var i,r,o,s,a=[];e;){for(i=0,r=e.children.length;i<r;i++)if(o=e.children[i],s=e.leaf?n(o):o,_(t,s)){if(e.leaf||c(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=p([]),this},remove:function(t,e){if(!t)return this;for(var n,i,r,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),i=l[l.length-1],n=u.pop(),o=!0),s.leaf&&-1!==(r=function(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}(t,s.children,e)))return s.children.splice(r,1),l.push(s),this._condense(l),this;o||s.leaf||!c(s,a)?i?(n++,s=i.children[n],o=!1):s=null:(l.push(s),u.push(n),n=0,i=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:a,compareMinY:l,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,i){var o,s=n-e+1,a=this._maxEntries;if(s<=a)return o=p(t.slice(e,n+1)),r(o,this.toBBox),o;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(o=p([])).leaf=!1,o.height=i;var l,u,h,c,_=Math.ceil(s/a),f=_*Math.ceil(Math.sqrt(a));for(d(t,e,n,f,this.compareMinX),l=e;l<=n;l+=f)for(h=Math.min(l+f-1,n),d(t,l,h,_,this.compareMinY),u=l;u<=h;u+=_)c=Math.min(u+_-1,h),o.children.push(this._build(t,u,c,i-1));return r(o,this.toBBox),o},_chooseSubtree:function(t,e,n,i){for(var r,o,s,a,l,h,c,_;i.push(e),!e.leaf&&i.length-1!==n;){for(c=_=1/0,r=0,o=e.children.length;r<o;r++)s=e.children[r],l=u(s),(h=function(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))}(t,s)-l)<_?(_=h,c=l<c?l:c,a=s):h===_&&l<c&&(c=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var i=this.toBBox,r=n?t:i(t),o=[],a=this._chooseSubtree(r,this.data,e,o);for(a.children.push(t),s(a,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);var s=this._chooseSplitIndex(n,o,i),a=p(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,r(n,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,s,a,l,h,c,_;for(h=c=1/0,i=e;i<=n-e;i++)r=o(t,0,i,this.toBBox),s=o(t,i,n,this.toBBox),a=function(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}(r,s),l=u(r)+u(s),a<h?(h=a,_=i,c=l<c?l:c):a===h&&l<c&&(c=l,_=i);return _},_chooseSplitAxis:function(t,e,n){var i=t.leaf?this.compareMinX:a,r=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,i),s=this._allDistMargin(t,e,n,r);o<s&&t.children.sort(i)},_allDistMargin:function(t,e,n,i){t.children.sort(i);var r,a,l=this.toBBox,u=o(t,0,e,l),c=o(t,n-e,n,l),_=h(u)+h(c);for(r=e;r<n-e;r++)a=t.children[r],s(u,t.leaf?l(a):a),_+=h(u);for(r=n-e-1;r>=e;r--)a=t.children[r],s(c,t.leaf?l(a):a),_+=h(c);return _},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)s(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():r(t[n],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]+"};")}}},function(t,e,n){!function(){"use strict";function t(e){return function(e,n){var r,o,s,a,l,u,h,c,_,p=1,d=e.length,f="";for(o=0;o<d;o++)if("string"==typeof e[o])f+=e[o];else if(Array.isArray(e[o])){if((a=e[o])[2])for(r=n[p],s=0;s<a[2].length;s++){if(!r.hasOwnProperty(a[2][s]))throw new Error(t('[sprintf] property "%s" does not exist',a[2][s]));r=r[a[2][s]]}else r=a[1]?n[a[1]]:n[p++];if(i.not_type.test(a[8])&&i.not_primitive.test(a[8])&&r instanceof Function&&(r=r()),i.numeric_arg.test(a[8])&&"number"!=typeof r&&isNaN(r))throw new TypeError(t("[sprintf] expecting number but found %T",r));switch(i.number.test(a[8])&&(c=r>=0),a[8]){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a[6]?parseInt(a[6]):0);break;case"e":r=a[7]?parseFloat(r).toExponential(a[7]):parseFloat(r).toExponential();break;case"f":r=a[7]?parseFloat(r).toFixed(a[7]):parseFloat(r);break;case"g":r=a[7]?String(Number(r.toPrecision(a[7]))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a[7]?r.substring(0,a[7]):r;break;case"t":r=String(!!r),r=a[7]?r.substring(0,a[7]):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a[7]?r.substring(0,a[7]):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a[7]?r.substring(0,a[7]):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(a[8])?f+=r:(!i.number.test(a[8])||c&&!a[3]?_="":(_=c?"+":"-",r=r.toString().replace(i.sign,"")),u=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",h=a[6]-(_+r).length,l=a[6]&&h>0?u.repeat(h):"",f+=a[5]?_+r+l:"0"===u?_+l+r:l+_+r)}return f}(function(t){if(r[t])return r[t];var e,n=t,o=[],s=0;for(;n;){if(null!==(e=i.text.exec(n)))o.push(e[0]);else if(null!==(e=i.modulo.exec(n)))o.push("%");else{if(null===(e=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){s|=1;var a=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))a.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(u[1])}e[2]=a}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");o.push(e)}n=n.substring(e[0].length)}return r[t]=o}(e),arguments)}function e(e,n){return t.apply(null,[e].concat(n||[]))}var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},r=Object.create(null);void 0!==n&&(n.sprintf=t,n.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},function(t,e,n){!function(t){"object"==typeof e&&e.exports?e.exports=t():this.tz=t()}(function(){function t(t,e,n){var i,r=e.day[1];do{i=new Date(Date.UTC(n,e.month,Math.abs(r++)))}while(e.day[0]<7&&i.getUTCDay()!=e.day[0]);return i={clock:e.clock,sort:i.getTime(),rule:e,save:6e4*e.save,offset:t.offset},i[i.clock]=i.sort+6e4*e.time,i.posix?i.wallclock=i[i.clock]+(t.offset+e.saved):i.posix=i[i.clock]-(t.offset+e.saved),i}function e(e,n,i){var r,o,s,a,l,u,h,c=e[e.zone],_=[],p=new Date(i).getUTCFullYear(),d=1;for(r=1,o=c.length;r<o&&!(c[r][n]<=i);r++);if((s=c[r]).rules){for(u=e[s.rules],h=p+1;h>=p-d;--h)for(r=0,o=u.length;r<o;r++)u[r].from<=h&&h<=u[r].to?_.push(t(s,u[r],h)):u[r].to<h&&1==d&&(d=h-u[r].to);for(_.sort(function(t,e){return t.sort-e.sort}),r=0,o=_.length;r<o;r++)i>=_[r][n]&&_[r][_[r].clock]>s[_[r].clock]&&(a=_[r])}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 n(t,n){return"UTC"==t.zone?n:(t.entry=e(t,"posix",n),n+t.entry.offset+t.entry.save)}function i(t,n){if("UTC"==t.zone)return n;var i,r;return t.entry=i=e(t,"wallclock",n),0<(r=n-i.wallclock)&&r<i.save?null:n-i.offset-i.save}function r(t,e,r){var o,s=+(r[1]+1),a=r[2]*s,u=l.indexOf(r[3].toLowerCase());if(u>9)e+=a*h[u-10];else{if(o=new Date(n(t,e)),u<7)for(;a;)o.setUTCDate(o.getUTCDate()+s),o.getUTCDay()==u&&(a-=s);else 7==u?o.setUTCFullYear(o.getUTCFullYear()+a):8==u?o.setUTCMonth(o.getUTCMonth()+a):o.setUTCDate(o.getUTCDate()+a);null==(e=i(t,o.getTime()))&&(e=i(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t,e){var n,i,r;return i=new Date(Date.UTC(t.getUTCFullYear(),0)),n=Math.floor((t.getTime()-i.getTime())/864e5),i.getUTCDay()==e?r=0:8==(r=7-i.getUTCDay()+e)&&(r=1),n>=r?Math.floor((n-r)/7)+1:0}function s(t){var e,n,i;return n=t.getUTCFullYear(),e=new Date(Date.UTC(n,0)).getUTCDay(),(i=o(t,1)+(e>1&&e<=4?1:0))?53!=i||4==e||3==e&&29==new Date(n,1,29).getDate()?[i,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(n=t.getUTCFullYear()-1,e=new Date(Date.UTC(n,0)).getUTCDay(),i=4==e||3==e&&29==new Date(n,1,29).getDate()?53:52,[i,t.getUTCFullYear()-1])}var a={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(t,e,n,i){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],u=3600;for(r=0;r<3;r++)l.push(("0"+Math.floor(a/u)).slice(-2)),a%=u,u/=60;return"^"!=n||s?("^"==n&&(i=3),3==i?(o=(o=l.join(":")).replace(/:00$/,""),"^"!=n&&(o=o.replace(/:00$/,""))):i?(o=l.slice(0,i+1).join(":"),"^"==n&&(o=o.replace(/:00$/,""))):o=l.slice(0,2).join(""),o=(s<0?"-":"+")+o,o=o.replace(/([-+])(0)/,{_:" $1","-":"$1"}[n]||"$1$2")):"Z"},"%":function(t){return"%"},n:function(t){return"\n"},t:function(t){return"\t"},U:function(t){return o(t,0)},W:function(t){return o(t,1)},V:function(t){return s(t)[0]},G:function(t){return s(t)[1]},g:function(t){return s(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:function(t){if(!t.length)return"1.0.13";var e,o,s,a,l,h=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("string"==(s=typeof a))~a.indexOf("%")?h.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=[]).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)?h.locale=a:(s=u.exec(a))?c.push(s):h.zone=a:l=a;else if("function"==s){if(s=a.call(h))return s}else if(/^\w{2,3}_\w{2}$/.test(a.name))h[a.name]=a;else if(a.zones){for(s in a.zones)h[s]=a.zones[s];for(s in a.rules)h[s]=a.rules[s]}}else e||(l=a);h[h.locale]||delete h.locale;h[h.zone]||delete h.zone;if(null!=l){if("*"==l)l=h.clock();else if(Array.isArray(l)){for(s=[],o=!l[7],e=0;e<11;e++)s[e]=+(l[e]||0);--s[1],l=Date.UTC.apply(Date.UTC,s)+-s[7]*(36e5*s[8]+6e4*s[9]+1e3*s[10])}else l=Math.floor(l);if(!isNaN(l)){if(o&&(l=i(h,l)),null==l)return l;for(e=0,o=c.length;e<o;e++)l=r(h,l,c[e]);return h.format?(s=new Date(n(h,l)),h.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,function(t,e,n,i,r){var o,a,u="0";if(o=h[r]){for(t=String(o.call(h,s,l,e,n.length)),"_"==(e||o.style)&&(u=" "),a="-"==e?0:o.pad||0;t.length<a;)t=u+t;for(a="-"==e?0:i||o.pad;t.length<a;)t=u+t;"N"==r&&a<t.length&&(t=t.slice(0,a)),"^"==e&&(t=t.toUpperCase())}return t})):l}}return function(){return h.convert(arguments)}},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("|")}}},l="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",u=new RegExp("^\\s*([+-])(\\d+)\\s+("+l+")s?\\s*$","i"),h=[36e5,6e4,1e3,1];return l=l.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,function(t){a[t].pad=2}),a.N.pad=9,a.j.pad=3,a.k.style="_",a.l.style="_",a.e.style="_",function(){return a.convert(arguments)}})},/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y;!function(t){function n(t,e){return"function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0,function(n,i){return t[n]=e?e(n,i):i}}var i="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};t("object"==typeof e&&"object"==typeof e.exports?n(i,n(e.exports)):n(i))}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};i=function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)},r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&(n[i[r]]=t[i[r]]);return n},s=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},a=function(t,e){return function(n,i){e(n,i,t)}},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(s,a)}l((i=i.apply(t,e||[])).next())})},h=function(t,e){function n(n){return function(s){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(o=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[0,o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=e.call(t,a)}catch(t){n=[6,t],r=0}finally{i=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var i,r,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},c=function(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])},_=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}},p=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},d=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t},f=function(t){return this instanceof f?(this.v=t,this):new f(t)},m=function(t,e,n){function i(t){u[t]&&(l[t]=function(e){return new Promise(function(n,i){h.push([t,e,n,i])>1||r(t,e)})})}function r(t,e){try{!function(t){t.value instanceof f?Promise.resolve(t.value.v).then(o,s):a(h[0][2],t)}(u[t](e))}catch(t){a(h[0][3],t)}}function o(t){r("next",t)}function s(t){r("throw",t)}function a(t,e){t(e),h.shift(),h.length&&r(h[0][0],h[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l,u=n.apply(t,e||[]),h=[];return l={},i("next"),i("throw"),i("return"),l[Symbol.asyncIterator]=function(){return this},l},v=function(t){function e(e,r){t[e]&&(n[e]=function(n){return(i=!i)?{value:f(t[e](n)),done:"return"===e}:r?r(n):n})}var n,i;return n={},e("next"),e("throw",function(t){throw t}),e("return"),n[Symbol.iterator]=function(){return this},n},g=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof _?_(t):t[Symbol.iterator]()},y=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},t("__extends",i),t("__assign",r),t("__rest",o),t("__decorate",s),t("__param",a),t("__metadata",l),t("__awaiter",u),t("__generator",h),t("__exportStar",c),t("__values",_),t("__read",p),t("__spread",d),t("__await",f),t("__asyncGenerator",m),t("__asyncDelegator",v),t("__asyncValues",g),t("__makeTemplateObject",y)})}],{base:0,"client/connection":1,"client/session":2,"core/bokeh_events":3,"core/build_views":4,"core/dom":5,"core/dom_view":6,"core/enums":7,"core/has_props":8,"core/hittest":9,"core/layout/alignments":10,"core/layout/layout_canvas":11,"core/layout/side_panel":12,"core/layout/solver":13,"core/logging":14,"core/properties":15,"core/property_mixins":16,"core/selection_manager":17,"core/selector":18,"core/settings":19,"core/signaling":20,"core/ui_events":21,"core/util/array":22,"core/util/bbox":23,"core/util/callback":24,"core/util/canvas":25,"core/util/color":26,"core/util/data_structures":27,"core/util/eq":28,"core/util/math":29,"core/util/object":30,"core/util/proj4":31,"core/util/projections":32,"core/util/refs":33,"core/util/selection":34,"core/util/serialization":35,"core/util/spatial":36,"core/util/string":37,"core/util/svg_colors":38,"core/util/templating":39,"core/util/text":40,"core/util/throttle":41,"core/util/types":42,"core/util/wheel":43,"core/util/zoom":44,"core/view":45,"core/visuals":46,document:47,embed:48,main:49,model:50,"models/annotations/annotation":51,"models/annotations/arrow":52,"models/annotations/arrow_head":53,"models/annotations/band":54,"models/annotations/box_annotation":55,"models/annotations/color_bar":56,"models/annotations/index":57,"models/annotations/label":58,"models/annotations/label_set":59,"models/annotations/legend":60,"models/annotations/legend_item":61,"models/annotations/poly_annotation":62,"models/annotations/span":63,"models/annotations/text_annotation":64,"models/annotations/title":65,"models/annotations/toolbar_panel":66,"models/annotations/tooltip":67,"models/annotations/whisker":68,"models/axes/axis":69,"models/axes/categorical_axis":70,"models/axes/continuous_axis":71,"models/axes/datetime_axis":72,"models/axes/index":73,"models/axes/linear_axis":74,"models/axes/log_axis":75,"models/callbacks/customjs":76,"models/callbacks/index":77,"models/callbacks/open_url":78,"models/canvas/canvas":79,"models/canvas/cartesian_frame":80,"models/canvas/index":81,"models/expressions/expression":82,"models/expressions/index":83,"models/expressions/stack":84,"models/filters/boolean_filter":85,"models/filters/customjs_filter":86,"models/filters/filter":87,"models/filters/group_filter":88,"models/filters/index":89,"models/filters/index_filter":90,"models/formatters/basic_tick_formatter":91,"models/formatters/categorical_tick_formatter":92,"models/formatters/datetime_tick_formatter":93,"models/formatters/func_tick_formatter":94,"models/formatters/index":95,"models/formatters/log_tick_formatter":96,"models/formatters/mercator_tick_formatter":97,"models/formatters/numeral_tick_formatter":98,"models/formatters/printf_tick_formatter":99,"models/formatters/tick_formatter":100,"models/glyphs/annular_wedge":101,"models/glyphs/annulus":102,"models/glyphs/arc":103,"models/glyphs/bezier":104,"models/glyphs/box":105,"models/glyphs/circle":106,"models/glyphs/ellipse":107,"models/glyphs/glyph":108,"models/glyphs/hbar":109,"models/glyphs/image":110,"models/glyphs/image_rgba":111,"models/glyphs/image_url":112,"models/glyphs/index":113,"models/glyphs/line":114,"models/glyphs/multi_line":115,"models/glyphs/oval":116,"models/glyphs/patch":117,"models/glyphs/patches":118,"models/glyphs/quad":119,"models/glyphs/quadratic":120,"models/glyphs/ray":121,"models/glyphs/rect":122,"models/glyphs/segment":123,"models/glyphs/step":124,"models/glyphs/text":125,"models/glyphs/vbar":126,"models/glyphs/wedge":127,"models/glyphs/xy_glyph":128,"models/graphs/graph_hit_test_policy":129,"models/graphs/index":130,"models/graphs/layout_provider":131,"models/graphs/static_layout_provider":132,"models/grids/grid":133,"models/grids/index":134,"models/index":135,"models/layouts/box":136,"models/layouts/column":137,"models/layouts/index":138,"models/layouts/layout_dom":139,"models/layouts/row":140,"models/layouts/spacer":141,"models/layouts/widget_box":142,"models/mappers/categorical_color_mapper":143,"models/mappers/color_mapper":144,"models/mappers/index":145,"models/mappers/linear_color_mapper":146,"models/mappers/log_color_mapper":147,"models/markers/index":148,"models/markers/marker":149,"models/plots/gmap_plot":150,"models/plots/gmap_plot_canvas":151,"models/plots/index":152,"models/plots/plot":153,"models/plots/plot_canvas":154,"models/ranges/data_range":155,"models/ranges/data_range1d":156,"models/ranges/factor_range":157,"models/ranges/index":158,"models/ranges/range":159,"models/ranges/range1d":160,"models/renderers/glyph_renderer":161,"models/renderers/graph_renderer":162,"models/renderers/guide_renderer":163,"models/renderers/index":164,"models/renderers/renderer":165,"models/scales/categorical_scale":166,"models/scales/index":167,"models/scales/linear_scale":168,"models/scales/log_scale":169,"models/scales/scale":170,"models/sources/ajax_data_source":171,"models/sources/cds_view":172,"models/sources/column_data_source":173,"models/sources/columnar_data_source":174,"models/sources/data_source":175,"models/sources/geojson_data_source":176,"models/sources/index":177,"models/sources/remote_data_source":178,"models/tickers/adaptive_ticker":179,"models/tickers/basic_ticker":180,"models/tickers/categorical_ticker":181,"models/tickers/composite_ticker":182,"models/tickers/continuous_ticker":183,"models/tickers/datetime_ticker":184,"models/tickers/days_ticker":185,"models/tickers/fixed_ticker":186,"models/tickers/index":187,"models/tickers/log_ticker":188,"models/tickers/mercator_ticker":189,"models/tickers/months_ticker":190,"models/tickers/single_interval_ticker":191,"models/tickers/ticker":192,"models/tickers/util":193,"models/tickers/years_ticker":194,"models/tiles/bbox_tile_source":195,"models/tiles/dynamic_image_renderer":196,"models/tiles/image_pool":197,"models/tiles/image_source":198,"models/tiles/index":199,"models/tiles/mercator_tile_source":200,"models/tiles/quadkey_tile_source":201,"models/tiles/tile_renderer":202,"models/tiles/tile_source":203,"models/tiles/tile_utils":204,"models/tiles/tms_tile_source":205,"models/tiles/wmts_tile_source":206,"models/tools/actions/action_tool":207,"models/tools/actions/help_tool":208,"models/tools/actions/redo_tool":209,"models/tools/actions/reset_tool":210,"models/tools/actions/save_tool":211,"models/tools/actions/undo_tool":212,"models/tools/actions/zoom_in_tool":213,"models/tools/actions/zoom_out_tool":214,"models/tools/button_tool":215,"models/tools/gestures/box_select_tool":216,"models/tools/gestures/box_zoom_tool":217,"models/tools/gestures/gesture_tool":218,"models/tools/gestures/lasso_select_tool":219,"models/tools/gestures/pan_tool":220,"models/tools/gestures/poly_select_tool":221,"models/tools/gestures/select_tool":222,"models/tools/gestures/tap_tool":223,"models/tools/gestures/wheel_pan_tool":224,"models/tools/gestures/wheel_zoom_tool":225,"models/tools/index":226,"models/tools/inspectors/crosshair_tool":227,"models/tools/inspectors/hover_tool":228,"models/tools/inspectors/inspect_tool":229,"models/tools/on_off_button":230,"models/tools/tool":231,"models/tools/tool_proxy":232,"models/tools/toolbar":233,"models/tools/toolbar_base":234,"models/tools/toolbar_box":235,"models/transforms/customjs_transform":236,"models/transforms/dodge":237,"models/transforms/index":238,"models/transforms/interpolator":239,"models/transforms/jitter":240,"models/transforms/linear_interpolator":241,"models/transforms/step_interpolator":242,"models/transforms/transform":243,polyfill:244,"protocol/message":245,"protocol/receiver":246,safely:247,version:248})}(this);/*!
Copyright (c) 2012, Anaconda, 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 Anaconda 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.
*/
//# sourceMappingURL=bokeh.min.js.map
/* END bokeh.min.js */
</script>
<script type="text/javascript">
/* BEGIN bokeh-widgets.min.js */
!function(t,e){!function(t){(function(e,n,i){if(null!=t)return t.register_plugin(e,n,387);throw new Error("Cannot find Bokeh. You have to load it prior to loading plugins.")})({372:function(t,e,n){var i=t(364),r=t(15),o=t(5),s=t(4),a=t(412);n.AbstractButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.icon_views={},this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.remove=function(){return s.remove_views(this.icon_views),t.prototype.remove.call(this)},e.prototype._render_button=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.button.apply(void 0,[{type:"button",disabled:this.model.disabled,class:["bk-bs-btn","bk-bs-btn-"+this.model.button_type]}].concat(t))},e.prototype.render=function(){var e,n=this;return t.prototype.render.call(this),o.empty(this.el),this.buttonEl=this._render_button(this.model.label),this.buttonEl.addEventListener("click",function(t){return n._button_click(t)}),this.el.appendChild(this.buttonEl),null!=(e=this.model.icon)&&(s.build_views(this.icon_views,[e],{parent:this}),o.prepend(this.buttonEl,this.icon_views[e.id].el,o.nbsp)),this},e.prototype._button_click=function(t){return t.preventDefault(),this.change_input()},e.prototype.change_input=function(){var t;return null!=(t=this.model.callback)?t.execute(this.model):void 0},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(a.Widget);n.AbstractButton=l,l.prototype.type="AbstractButton",l.prototype.default_view=n.AbstractButtonView,l.define({callback:[r.Instance],label:[r.String,"Button"],icon:[r.Instance],button_type:[r.String,"default"]})},373:function(t,e,n){var i=t(364),r=t(412),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Widget);n.AbstractIcon=o,o.prototype.type="AbstractIcon"},374:function(t,e,n){var i=t(364),r=t(403),o=t(15),s=t(5),a=t(14),l=t(24),u=t(412);n.AbstractSliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var t=this;return this.connect(this.model.change,function(){return t.render()})},e.prototype._calc_to=function(){},e.prototype._calc_from=function(t){},e.prototype.render=function(){var e,n,i,o,u,c,d,p,h,f,m,g,v,y,b=this;if(null==this.sliderEl&&t.prototype.render.call(this),null!=this.model.callback)switch(e=function(){return b.model.callback.execute(b.model)},this.model.callback_policy){case"continuous":this.callback_wrapper=e;break;case"throttle":this.callback_wrapper=l.throttle(e,this.model.callback_throttle)}return d="bk-noUi-",_=this._calc_to(),h=_.start,n=_.end,y=_.value,f=_.step,this.model.tooltips?(i={to:function(t){return b.model.pretty(t)}},g=function(){var t,e,n;for(n=[],u=t=0,e=y.length;0<=e?t<e:t>e;u=0<=e?++t:--t)n.push(i);return n}()):g=!1,this.el.classList.add("bk-slider"),null==this.sliderEl?(this.sliderEl=s.div(),this.el.appendChild(this.sliderEl),r.create(this.sliderEl,{cssPrefix:d,range:{min:h,max:n},start:y,step:f,behaviour:this.model.behaviour,connect:this.model.connected,tooltips:g,orientation:this.model.orientation,direction:this.model.direction}),this.sliderEl.noUiSlider.on("slide",function(t,e,n){return b._slide(n)}),this.sliderEl.noUiSlider.on("change",function(t,e,n){return b._change(n)}),c=function(t){var e;switch(y=Number(b.sliderEl.noUiSlider.get()),t.which){case 37:y-=f;break;case 39:y+=f;break;default:return}return e=b.model.pretty(y),a.logger.debug("[slider keypress] value = "+e),b.model.value=y,b.sliderEl.noUiSlider.set(y),null!=b.valueEl&&(b.valueEl.textContent=e),"function"==typeof b.callback_wrapper?b.callback_wrapper():void 0},(o=this.sliderEl.querySelector(".bk-noUi-handle")).setAttribute("tabindex",0),o.addEventListener("click",this.focus),o.addEventListener("keydown",c),m=function(t,e){var n;return o=b.sliderEl.querySelectorAll(".bk-noUi-handle")[t],n=o.querySelector(".bk-noUi-tooltip"),n.style.display=e?"block":""},this.sliderEl.noUiSlider.on("start",function(t,e){return m(e,!0)}),this.sliderEl.noUiSlider.on("end",function(t,e){return m(e,!1)})):this.sliderEl.noUiSlider.updateOptions({range:{min:h,max:n},start:y,step:f}),null!=this.titleEl&&this.el.removeChild(this.titleEl),null!=this.valueEl&&this.el.removeChild(this.valueEl),null!=this.model.title&&(0!==this.model.title.length&&(this.titleEl=s.label({},this.model.title+":"),this.el.insertBefore(this.titleEl,this.sliderEl)),this.model.show_value&&(p=function(){var t,e,n;for(n=[],t=0,e=y.length;t<e;t++)v=y[t],n.push(this.model.pretty(v));return n}.call(this).join(" .. "),this.valueEl=s.div({class:"bk-slider-value"},p),this.el.insertBefore(this.valueEl,this.sliderEl))),this.model.disabled||(this.sliderEl.querySelector(".bk-noUi-connect").style.backgroundColor=this.model.bar_color),this.model.disabled?this.sliderEl.setAttribute("disabled",!0):this.sliderEl.removeAttribute("disabled"),this;var _},e.prototype._slide=function(t){var e,n,i;return i=this._calc_from(t),e=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)n=t[e],r.push(this.model.pretty(n));return r}.call(this).join(" .. "),a.logger.debug("[slider slide] value = "+e),null!=this.valueEl&&(this.valueEl.textContent=e),this.model.value=i,"function"==typeof this.callback_wrapper?this.callback_wrapper():void 0},e.prototype._change=function(t){var e,n,i,r;switch(r=this._calc_from(t),e=function(){var e,n,r;for(r=[],e=0,n=t.length;e<n;e++)i=t[e],r.push(this.model.pretty(i));return r}.call(this).join(" .. "),a.logger.debug("[slider change] value = "+e),null!=this.valueEl&&(this.valueEl.value=e),this.model.value=r,this.model.callback_policy){case"mouseup":case"throttle":return null!=(n=this.model.callback)?n.execute(this.model):void 0}},e}(u.WidgetView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._formatter=function(t,e){return""+t},e.prototype.pretty=function(t){return this._formatter(t,this.format)},e}(u.Widget);n.AbstractSlider=c,c.prototype.type="AbstractSlider",c.prototype.default_view=n.AbstractSliderView,c.define({title:[o.String,""],show_value:[o.Bool,!0],start:[o.Any],end:[o.Any],value:[o.Any],step:[o.Number,1],format:[o.String],orientation:[o.Orientation,"horizontal"],direction:[o.Any,"ltr"],tooltips:[o.Boolean,!0],callback:[o.Instance],callback_throttle:[o.Number,200],callback_policy:[o.String,"throttle"],bar_color:[o.Color,"#e6e6e6"]}),c.prototype.behaviour=null,c.prototype.connected=!1},375:function(t,e,n){var i=t(364),r=t(400),o=t(379),s=t(5),a=t(15);n.AutocompleteInputView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),o.clear_menus.connect(function(){return e._clear_menu()})},e.prototype.render=function(){var e=this;return t.prototype.render.call(this),this.inputEl.classList.add("bk-autocomplete-input"),this.inputEl.addEventListener("keydown",function(t){return e._keydown(t)}),this.inputEl.addEventListener("keyup",function(t){return e._keyup(t)}),this.menuEl=s.ul({class:"bk-bs-dropdown-menu"}),this.menuEl.addEventListener("click",function(t){return e._item_click(t)}),this.el.appendChild(this.menuEl),this},e.prototype._render_items=function(t){var e,n,i,r,o;for(s.empty(this.menuEl),r=[],e=0,i=t.length;e<i;e++)o=t[e],n=s.li({},s.a({data:{text:o}},o)),r.push(this.menuEl.appendChild(n));return r},e.prototype._open_menu=function(){return this.el.classList.add("bk-bs-open")},e.prototype._clear_menu=function(){return this.el.classList.remove("bk-bs-open")},e.prototype._item_click=function(t){var e,n;if(t.preventDefault(),t.target!==t.currentTarget)return e=t.target,n=e.dataset.text,this.model.value=n},e.prototype._keydown=function(t){},e.prototype._keyup=function(t){var e,n,i,r,o,a;switch(t.keyCode){case s.Keys.Enter:return console.log("enter");case s.Keys.Esc:return this._clear_menu();case s.Keys.Up:case s.Keys.Down:return console.log("up/down");default:if((a=this.inputEl.value).length<=1)return void this._clear_menu();for(e=[],r=this.model.completions,n=0,i=r.length;n<i;n++)-1!==(o=r[n]).indexOf(a)&&e.push(o);return 0===e.length?this._clear_menu():(this._render_items(e),this._open_menu())}},e}(r.TextInputView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextInput);n.AutocompleteInput=l,l.prototype.type="AutocompleteInput",l.prototype.default_view=n.AutocompleteInputView,l.define({completions:[a.Array,[]]}),l.internal({active:[a.Boolean,!0]})},376:function(t,e,n){var i=t(364),r=t(15),o=t(3),s=t(372);n.ButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.change_input=function(){return this.model.trigger_event(new o.ButtonClick({})),this.model.clicks=this.model.clicks+1,t.prototype.change_input.call(this)},e}(s.AbstractButtonView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.AbstractButton);n.Button=a,a.prototype.type="Button",a.prototype.default_view=n.ButtonView,a.define({clicks:[r.Number,0]}),o.register_with_event(o.ButtonClick,a)},377:function(t,e,n){var i=t(364),r=[].indexOf,o=t(5),s=t(15),a=t(412);n.CheckboxButtonGroupView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.render=function(){var e,n,i,s,a,l,u,c,d,p=this;for(t.prototype.render.call(this),o.empty(this.el),n=o.div({class:"bk-bs-btn-group"}),this.el.appendChild(n),e=this.model.active,c=this.model.labels,i=a=0,u=c.length;a<u;i=++a)d=c[i],(s=o.input({type:"checkbox",value:""+i,checked:r.call(e,i)>=0})).addEventListener("change",function(){return p.change_input()}),l=o.label({class:["bk-bs-btn","bk-bs-btn-"+this.model.button_type]},s,d),r.call(e,i)>=0&&l.classList.add("bk-bs-active"),n.appendChild(l);return this},e.prototype.change_input=function(){var t,e,n,i;return t=function(){var t,i,r,o;for(r=this.el.querySelectorAll("input"),o=[],n=t=0,i=r.length;t<i;n=++t)(e=r[n]).checked&&o.push(n);return o}.call(this),this.model.active=t,null!=(i=this.model.callback)?i.execute(this.model):void 0},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(a.Widget);n.CheckboxButtonGroup=l,l.prototype.type="CheckboxButtonGroup",l.prototype.default_view=n.CheckboxButtonGroupView,l.define({active:[s.Array,[]],labels:[s.Array,[]],button_type:[s.String,"default"],callback:[s.Instance]})},378:function(t,e,n){var i=t(364),r=[].indexOf,o=t(5),s=t(15),a=t(412);n.CheckboxGroupView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.render=function(){var e,n,i,s,a,l,u,c,d,p=this;for(t.prototype.render.call(this),o.empty(this.el),e=this.model.active,c=this.model.labels,i=a=0,u=c.length;a<u;i=++a)d=c[i],(s=o.input({type:"checkbox",value:""+i})).addEventListener("change",function(){return p.change_input()}),this.model.disabled&&(s.disabled=!0),r.call(e,i)>=0&&(s.checked=!0),l=o.label({},s,d),this.model.inline?(l.classList.add("bk-bs-checkbox-inline"),this.el.appendChild(l)):(n=o.div({class:"bk-bs-checkbox"},l),this.el.appendChild(n));return this},e.prototype.change_input=function(){var t,e,n,i;return t=function(){var t,i,r,o;for(r=this.el.querySelectorAll("input"),o=[],n=t=0,i=r.length;t<i;n=++t)(e=r[n]).checked&&o.push(n);return o}.call(this),this.model.active=t,null!=(i=this.model.callback)?i.execute(this.model):void 0},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(a.Widget);n.CheckboxGroup=l,l.prototype.type="CheckboxGroup",l.prototype.default_view=n.CheckboxGroupView,l.define({active:[s.Array,[]],labels:[s.Array,[]],inline:[s.Bool,!1],callback:[s.Instance]})},379:function(t,e,n){var i=t(20);n.clear_menus=new i.Signal({},"clear_menus"),document.addEventListener("click",function(){return n.clear_menus.emit(void 0)})},380:function(t,e,n){var i=t(364),r=t(386),o=t(5),s=t(15),a=t(404);a.prototype.adjustPosition=function(){var t,e,n,i,r,o,s,a,l;if(!this._o.container)return this.el.style.position="absolute",e=this._o.trigger,l=this.el.offsetWidth,n=this.el.offsetHeight,a=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,t=e.getBoundingClientRect(),i=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset,i-=this.el.parentElement.offsetLeft,o-=this.el.parentElement.offsetTop,(this._o.reposition&&i+l>a||this._o.position.indexOf("right")>-1&&i-l+e.offsetWidth>0)&&(i=i-l+e.offsetWidth),(this._o.reposition&&o+n>s+r||this._o.position.indexOf("top")>-1&&o-n-e.offsetHeight>0)&&(o=o-n-e.offsetHeight),this.el.style.left=i+"px",this.el.style.top=o+"px"};var l=function(t){function e(){var e=t.apply(this,arguments)||this;return e._on_select=e._on_select.bind(e),e}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),null!=this._picker&&this._picker.destroy(),o.empty(this.el),this.labelEl=o.label({},this.model.title),this.el.appendChild(this.labelEl),this.inputEl=o.input({type:"text",class:"bk-widget-form-input",disabled:this.model.disabled}),this.el.appendChild(this.inputEl),this._picker=new a({field:this.inputEl,defaultDate:new Date(this.model.value),setDefaultDate:!0,minDate:null!=this.model.min_date?new Date(this.model.min_date):null,maxDate:null!=this.model.max_date?new Date(this.model.max_date):null,onSelect:this._on_select}),this._root_element.appendChild(this._picker.el),this},e.prototype._on_select=function(t){return function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")}(this,e),this.model.value=t.toDateString(),this.change_input()},e}(r.InputWidgetView);n.DatePickerView=l,l.prototype.className="bk-widget-form-group";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InputWidget);n.DatePicker=u,u.prototype.type="DatePicker",u.prototype.default_view=l,u.define({value:[s.Any,Date.now()],min_date:[s.Any],max_date:[s.Any]})},381:function(t,e,n){var i=t(364),r=t(363),o=t(374);n.DateRangeSliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:this.model.value,step:this.model.step}},e.prototype._calc_from=function(t){return t},e}(o.AbstractSliderView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractSlider);n.DateRangeSlider=s,s.prototype.type="DateRangeSlider",s.prototype.default_view=n.DateRangeSliderView,s.prototype.behaviour="drag",s.prototype.connected=[!1,!0,!1],s.prototype._formatter=r,s.override({format:"%d %b %Y"})},382:function(t,e,n){var i=t(364),r=t(363),o=t(374);n.DateSliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:[this.model.value],step:this.model.step}},e.prototype._calc_from=function(t){var e=t[0];return e},e}(o.AbstractSliderView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractSlider);n.DateSlider=s,s.prototype.type="DateSlider",s.prototype.default_view=n.DateSliderView,s.prototype.behaviour="tap",s.prototype.connected=[!0,!1],s.prototype._formatter=r,s.override({format:"%d %b %Y"})},383:function(t,e,n){var i=t(364),r=t(388),o=t(5),s=t(15);n.DivView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var e;return t.prototype.render.call(this),e=o.div(),this.model.render_as_text?e.textContent=this.model.text:e.innerHTML=this.model.text,this.markupEl.appendChild(e),this},e}(r.MarkupView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Markup);n.Div=a,a.prototype.type="Div",a.prototype.default_view=n.DivView,a.define({render_as_text:[s.Bool,!1]})},384:function(t,e,n){var i=t(364),r=t(5),o=t(15),s=t(372),a=t(379);n.DropdownView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),a.clear_menus.connect(function(){return e._clear_menu()})},e.prototype.render=function(){var e,n,i,o,s,a,l,u,c,d,p,h=this;for(t.prototype.render.call(this),this.model.is_split_button?(this.el.classList.add("bk-bs-btn-group"),(e=this._render_button(r.span({class:"bk-bs-caret"}))).classList.add("bk-bs-dropdown-toggle"),e.addEventListener("click",function(t){return h._caret_click(t)}),this.el.appendChild(e)):(this.el.classList.add("bk-bs-dropdown"),this.buttonEl.classList.add("bk-bs-dropdown-toggle"),this.buttonEl.appendChild(r.span({class:"bk-bs-caret"}))),this.model.active&&this.el.classList.add("bk-bs-open"),s=[],d=this.model.menu,n=0,l=d.length;n<l;n++)null!=(i=d[n])?(a=i[0],p=i[1],(u=r.a({},a)).dataset.value=p,u.addEventListener("click",function(t){return h._item_click(t)}),o=r.li({},u)):o=r.li({class:"bk-bs-divider"}),s.push(o);return c=r.ul({class:"bk-bs-dropdown-menu"},s),this.el.appendChild(c),this},e.prototype._clear_menu=function(){return this.model.active=!1},e.prototype._toggle_menu=function(){var t;if(t=this.model.active,a.clear_menus.emit(),!t)return this.model.active=!0},e.prototype._button_click=function(t){return t.preventDefault(),t.stopPropagation(),this.model.is_split_button?(this._clear_menu(),this.set_value(this.model.default_value)):this._toggle_menu()},e.prototype._caret_click=function(t){return t.preventDefault(),t.stopPropagation(),this._toggle_menu()},e.prototype._item_click=function(t){return t.preventDefault(),this._clear_menu(),this.set_value(t.currentTarget.dataset.value)},e.prototype.set_value=function(t){return this.buttonEl.value=this.model.value=t,this.change_input()},e}(s.AbstractButtonView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.AbstractButton);n.Dropdown=l,l.prototype.type="Dropdown",l.prototype.default_view=n.DropdownView,l.define({value:[o.String],default_value:[o.String],menu:[o.Array,[]]}),l.override({label:"Dropdown"}),l.internal({active:[o.Boolean,!1]}),l.getters({is_split_button:function(){return null!=this.default_value}})},385:function(t,e,n){var i=t(372);n.AbstractButton=i.AbstractButton;var r=t(373);n.AbstractIcon=r.AbstractIcon;var o=t(375);n.AutocompleteInput=o.AutocompleteInput;var s=t(376);n.Button=s.Button;var a=t(377);n.CheckboxButtonGroup=a.CheckboxButtonGroup;var l=t(378);n.CheckboxGroup=l.CheckboxGroup;var u=t(380);n.DatePicker=u.DatePicker;var c=t(381);n.DateRangeSlider=c.DateRangeSlider;var d=t(382);n.DateSlider=d.DateSlider;var p=t(383);n.Div=p.Div;var h=t(384);n.Dropdown=h.Dropdown;var f=t(386);n.InputWidget=f.InputWidget;var m=t(388);n.Markup=m.Markup;var g=t(389);n.MultiSelect=g.MultiSelect;var v=t(390);n.Panel=v.Panel;var y=t(391);n.Paragraph=y.Paragraph;var b=t(392);n.PasswordInput=b.PasswordInput;var _=t(393);n.PreText=_.PreText;var w=t(394);n.RadioButtonGroup=w.RadioButtonGroup;var x=t(395);n.RadioGroup=x.RadioGroup;var k=t(396);n.RangeSlider=k.RangeSlider;var S=t(397);n.Select=S.Select;var E=t(398);n.Slider=E.Slider;var D=t(399);n.Tabs=D.Tabs;var C=t(400);n.TextInput=C.TextInput;var M=t(401);n.Toggle=M.Toggle;var A=t(412);n.Widget=A.Widget},386:function(t,e,n){var i=t(364),r=t(412),o=t(15);n.InputWidgetView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.change_input=function(){var t;return null!=(t=this.model.callback)?t.execute(this.model):void 0},e}(r.WidgetView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Widget);n.InputWidget=s,s.prototype.type="InputWidget",s.prototype.default_view=n.InputWidgetView,s.define({callback:[o.Instance],title:[o.String,""]})},387:function(t,e,n){var i=t(385);n.Widgets=i;var r=t(0);r.register_models(i)},388:function(t,e,n){var i=t(364),r=t(15),o=t(5),s=t(30),a=t(412);n.MarkupView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.render=function(){var e;return t.prototype.render.call(this),o.empty(this.el),e=s.extend({width:this.model.width+"px",height:this.model.height+"px"},this.model.style),this.markupEl=o.div({style:e}),this.el.appendChild(this.markupEl)},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e}(a.Widget);n.Markup=l,l.prototype.type="Markup",l.define({text:[r.String,""],style:[r.Any,{}]})},389:function(t,e,n){var i=t(364),r=[].indexOf,o=t(5),s=t(42),a=t(15),l=t(386);n.MultiSelectView=function(t){function e(){var e=t.apply(this,arguments)||this;return e.render_selection=e.render_selection.bind(e),e}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.properties.value.change,function(){return this.render_selection()}),this.connect(this.model.properties.options.change,function(){return this.render()}),this.connect(this.model.properties.name.change,function(){return this.render()}),this.connect(this.model.properties.title.change,function(){return this.render()}),this.connect(this.model.properties.size.change,function(){return this.render()}),this.connect(this.model.properties.disabled.change,function(){return this.render()})},e.prototype.render=function(){var e,n,i=this;return t.prototype.render.call(this),o.empty(this.el),e=o.label({for:this.model.id},this.model.title),this.el.appendChild(e),n=this.model.options.map(function(t){var e,n,a;return s.isString(t)?a=e=t:(a=t[0],e=t[1]),n=r.call(i.model.value,a)>=0,o.option({selected:n,value:a},e)}),this.selectEl=o.select({multiple:!0,class:"bk-widget-form-input",id:this.model.id,name:this.model.name,size:this.model.size,disabled:this.model.disabled},n),this.selectEl.addEventListener("change",function(){return i.change_input()}),this.el.appendChild(this.selectEl),this},e.prototype.render_selection=function(){var t,n,i,r,o,s,a,l,u;for(function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")}(this,e),l={},s=this.model.value,n=0,r=s.length;n<r;n++)u=s[n],l[u]=!0;for(a=this.el.querySelectorAll("option"),i=0,o=a.length;i<o;i++)t=a[i],l[t.value]&&(t.selected="selected");return this.selectEl.size=this.model.size},e.prototype.change_input=function(){var e,n,i,r,o,s;for(i=null!==this.el.querySelector("select:focus"),s=[],o=this.el.querySelectorAll("option"),n=0,r=o.length;n<r;n++)(e=o[n]).selected&&s.push(e.value);if(this.model.value=s,t.prototype.change_input.call(this),i)return this.selectEl.focus()},e}(l.InputWidgetView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.InputWidget);n.MultiSelect=u,u.prototype.type="MultiSelect",u.prototype.default_view=n.MultiSelectView,u.define({value:[a.Array,[]],options:[a.Array,[]],size:[a.Number,4]})},390:function(t,e,n){var i=t(364),r=t(412),o=t(15),s=t(5);n.PanelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),s.empty(this.el),this},e}(r.WidgetView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Widget);n.Panel=a,a.prototype.type="Panel",a.prototype.default_view=n.PanelView,a.define({title:[o.String,""],child:[o.Instance],closable:[o.Bool,!1]})},391:function(t,e,n){var i=t(364),r=t(388),o=t(5);n.ParagraphView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var e;return t.prototype.render.call(this),e=o.p({style:{margin:0}},this.model.text),this.markupEl.appendChild(e)},e}(r.MarkupView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Markup);n.Paragraph=s,s.prototype.type="Paragraph",s.prototype.default_view=n.ParagraphView},392:function(t,e,n){var i=t(364),r=t(400);n.PasswordInputView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.inputEl.type="password"},e}(r.TextInputView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextInput);n.PasswordInput=o,o.prototype.type="PasswordInput",o.prototype.default_view=n.PasswordInputView},393:function(t,e,n){var i=t(364),r=t(388),o=t(5);n.PreTextView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var e;return t.prototype.render.call(this),e=o.pre({style:{overflow:"auto"}},this.model.text),this.markupEl.appendChild(e)},e}(r.MarkupView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Markup);n.PreText=s,s.prototype.type="PreText",s.prototype.default_view=n.PreTextView},394:function(t,e,n){var i=t(364),r=t(5),o=t(37),s=t(15),a=t(412);n.RadioButtonGroupView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.render=function(){var e,n,i,s,a,l,u,c,d,p,h=this;for(t.prototype.render.call(this),r.empty(this.el),n=r.div({class:"bk-bs-btn-group"}),this.el.appendChild(n),c=o.uniqueId(),e=this.model.active,d=this.model.labels,i=a=0,u=d.length;a<u;i=++a)p=d[i],(s=r.input({type:"radio",name:c,value:""+i,checked:i===e})).addEventListener("change",function(){return h.change_input()}),l=r.label({class:["bk-bs-btn","bk-bs-btn-"+this.model.button_type]},s,p),i===e&&l.classList.add("bk-bs-active"),n.appendChild(l);return this},e.prototype.change_input=function(){var t,e,n,i;return t=function(){var t,i,r,o;for(r=this.el.querySelectorAll("input"),o=[],e=t=0,i=r.length;t<i;e=++t)(n=r[e]).checked&&o.push(e);return o}.call(this),this.model.active=t[0],null!=(i=this.model.callback)?i.execute(this.model):void 0},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(a.Widget);n.RadioButtonGroup=l,l.prototype.type="RadioButtonGroup",l.prototype.default_view=n.RadioButtonGroupView,l.define({active:[s.Any,null],labels:[s.Array,[]],button_type:[s.String,"default"],callback:[s.Instance]})},395:function(t,e,n){var i=t(364),r=t(5),o=t(37),s=t(15),a=t(412);n.RadioGroupView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.render=function(){var e,n,i,s,a,l,u,c,d,p,h=this;for(t.prototype.render.call(this),r.empty(this.el),c=o.uniqueId(),e=this.model.active,d=this.model.labels,i=a=0,u=d.length;a<u;i=++a)p=d[i],(s=r.input({type:"radio",name:c,value:""+i})).addEventListener("change",function(){return h.change_input()}),this.model.disabled&&(s.disabled=!0),i===e&&(s.checked=!0),l=r.label({},s,p),this.model.inline?(l.classList.add("bk-bs-radio-inline"),this.el.appendChild(l)):(n=r.div({class:"bk-bs-radio"},l),this.el.appendChild(n));return this},e.prototype.change_input=function(){var t,e,n,i;return t=function(){var t,i,r,o;for(r=this.el.querySelectorAll("input"),o=[],e=t=0,i=r.length;t<i;e=++t)(n=r[e]).checked&&o.push(e);return o}.call(this),this.model.active=t[0],null!=(i=this.model.callback)?i.execute(this.model):void 0},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(a.Widget);n.RadioGroup=l,l.prototype.type="RadioGroup",l.prototype.default_view=n.RadioGroupView,l.define({active:[s.Any,null],labels:[s.Array,[]],inline:[s.Bool,!1],callback:[s.Instance]})},396:function(t,e,n){var i=t(364),r=t(332),o=t(374);n.RangeSliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:this.model.value,step:this.model.step}},e.prototype._calc_from=function(t){return t},e}(o.AbstractSliderView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractSlider);n.RangeSlider=s,s.prototype.type="RangeSlider",s.prototype.default_view=n.RangeSliderView,s.prototype.behaviour="drag",s.prototype.connected=[!1,!0,!1],s.prototype._formatter=r.format,s.override({format:"0[.]00"})},397:function(t,e,n){var i=t(364),r=t(5),o=t(42),s=t(14),a=t(15),l=t(386);n.SelectView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.build_options=function(t){var e=this;return t.map(function(t){var n,i,s;return o.isString(t)?s=n=t:(s=t[0],n=t[1]),i=e.model.value===s,r.option({selected:i,value:s},n)})},e.prototype.render=function(){var e,n,i,s,a,l=this;if(t.prototype.render.call(this),r.empty(this.el),i=r.label({for:this.model.id},this.model.title),this.el.appendChild(i),o.isArray(this.model.options))e=this.build_options(this.model.options);else{e=[],s=this.model.options;for(n in s)a=s[n],e.push(r.optgroup({label:n},this.build_options(a)))}return this.selectEl=r.select({class:"bk-widget-form-input",id:this.model.id,name:this.model.name,disabled:this.model.disabled},e),this.selectEl.addEventListener("change",function(){return l.change_input()}),this.el.appendChild(this.selectEl),this},e.prototype.change_input=function(){var e;return e=this.selectEl.value,s.logger.debug("selectbox: value = "+e),this.model.value=e,t.prototype.change_input.call(this)},e}(l.InputWidgetView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.InputWidget);n.Select=u,u.prototype.type="Select",u.prototype.default_view=n.SelectView,u.define({value:[a.String,""],options:[a.Any,[]]})},398:function(t,e,n){var i=t(364),r=t(332),o=t(374);n.SliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:[this.model.value],step:this.model.step}},e.prototype._calc_from=function(t){var e=t[0];return Number.isInteger(this.model.start)&&Number.isInteger(this.model.end)&&Number.isInteger(this.model.step)?Math.round(e):e},e}(o.AbstractSliderView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractSlider);n.Slider=s,s.prototype.type="Slider",s.prototype.default_view=n.SliderView,s.prototype.behaviour="tap",s.prototype.connected=[!0,!1],s.prototype._formatter=r.format,s.override({format:"0[.]00"})},399:function(t,e,n){var i=t(364),r=t(5),o=t(22),s=t(15),a=t(412);n.TabsView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.tabs.change,function(){return e.rebuild_child_views()}),this.connect(this.model.properties.active.change,function(){return e.render()})},e.prototype.render=function(){var e,n,i,s,a,l,u,c,d,p=this;if(t.prototype.render.call(this),r.empty(this.el),0!==(i=this.model.tabs.length)){for(this.model.active>=i&&(this.model.active=i-1),(c=this.model.tabs.map(function(t,e){return r.li({},r.span({data:{index:e}},t.title))}))[this.model.active].classList.add("bk-bs-active"),d=r.ul({class:["bk-bs-nav","bk-bs-nav-tabs"]},c),this.el.appendChild(d),(a=this.model.tabs.map(function(t){return r.div({class:"bk-bs-tab-pane"})}))[this.model.active].classList.add("bk-bs-active"),l=r.div({class:"bk-bs-tab-content"},a),this.el.appendChild(l),d.addEventListener("click",function(t){var e,n,i,r;if(t.preventDefault(),t.target!==t.currentTarget&&(e=t.target,i=p.model.active,n=parseInt(e.dataset.index),i!==n))return c[i].classList.remove("bk-bs-active"),a[i].classList.remove("bk-bs-active"),c[n].classList.add("bk-bs-active"),a[n].classList.add("bk-bs-active"),p.model.active=n,null!=(r=p.model.callback)?r.execute(p.model):void 0}),u=o.zip(this.model.children,a),n=0,s=u.length;n<s;n++)h=u[n],e=h[0],h[1].appendChild(this.child_views[e.id].el);return this;var h}},e}(a.WidgetView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_layoutable_children=function(){return this.children},e}(a.Widget);n.Tabs=l,l.prototype.type="Tabs",l.prototype.default_view=n.TabsView,l.define({tabs:[s.Array,[]],active:[s.Number,0],callback:[s.Instance]}),l.getters({children:function(){var t,e,n,i,r;for(n=this.tabs,i=[],t=0,e=n.length;t<e;t++)r=n[t],i.push(r.child);return i}})},400:function(t,e,n){var i=t(364),r=t(14),o=t(15),s=t(5),a=t(386),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.render=function(){var e,n=this;return t.prototype.render.call(this),s.empty(this.el),e=s.label({for:this.model.id},this.model.title),this.el.appendChild(e),this.inputEl=s.input({type:"text",class:"bk-widget-form-input",id:this.model.id,name:this.model.name,value:this.model.value,disabled:this.model.disabled,placeholder:this.model.placeholder}),this.inputEl.addEventListener("change",function(){return n.change_input()}),this.el.appendChild(this.inputEl),this.model.height&&(this.inputEl.style.height=this.model.height-35+"px"),this},e.prototype.change_input=function(){var e;return e=this.inputEl.value,r.logger.debug("widget/text_input: value = "+e),this.model.value=e,t.prototype.change_input.call(this)},e}(a.InputWidgetView);n.TextInputView=l,l.prototype.className="bk-widget-form-group";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(a.InputWidget);n.TextInput=u,u.prototype.type="TextInput",u.prototype.default_view=l,u.define({value:[o.String,""],placeholder:[o.String,""]})},401:function(t,e,n){var i=t(364),r=t(15),o=t(372);n.ToggleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.model.active&&this.buttonEl.classList.add("bk-bs-active"),this},e.prototype.change_input=function(){return this.model.active=!this.model.active,t.prototype.change_input.call(this)},e}(o.AbstractButtonView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractButton);n.Toggle=s,s.prototype.type="Toggle",s.prototype.default_view=n.ToggleView,s.define({active:[r.Bool,!1]}),s.override({label:"Toggle"})},412:function(t,e,n){var i=t(364),r=t(139),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){if(this._render_classes(),null!=this.model.height&&(this.el.style.height=this.model.height+"px"),null!=this.model.width)return this.el.style.width=this.model.width+"px"},e}(r.LayoutDOMView);n.WidgetView=o,o.prototype.className="bk-widget";var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LayoutDOM);n.Widget=s,s.prototype.type="Widget",s.prototype.default_view=o},403:/*! nouislider - 10.1.0 - 2017-07-28 17:11:18 */
function(t,e,n){!function(t){"object"==typeof n?e.exports=t():window.noUiSlider=t()}(function(){"use strict";function t(t){t.preventDefault()}function e(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function n(t,e,n){n>0&&(o(t,e),setTimeout(function(){s(t,e)},n))}function i(t){return Array.isArray(t)?t:[t]}function r(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function o(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function s(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function a(t){var e=void 0!==window.pageXOffset,n="CSS1Compat"===(t.compatMode||""),i=e?window.pageXOffset:n?t.documentElement.scrollLeft:t.body.scrollLeft,r=e?window.pageYOffset:n?t.documentElement.scrollTop:t.body.scrollTop;return{x:i,y:r}}function l(t,e){return 100/(e-t)}function u(t,e){return 100*e/(t[1]-t[0])}function c(t,e){for(var n=1;t>=e[n];)n+=1;return n}function d(t,e,n){if(n>=t.slice(-1)[0])return 100;var i,r,o,s,a=c(n,t);return i=t[a-1],r=t[a],o=e[a-1],s=e[a],o+function(t,e){return u(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}([i,r],n)/l(o,s)}function p(t,e,n,i){if(100===i)return i;var r,o,s=c(i,t);return n?(r=t[s-1],o=t[s],i-r>(o-r)/2?o:r):e[s-1]?t[s-1]+function(t,e){return Math.round(t/e)*e}(i-t[s-1],e[s-1]):i}function h(t,n,i){var r;if("number"==typeof n&&(n=[n]),"[object Array]"!==Object.prototype.toString.call(n))throw new Error("noUiSlider ("+B+"): 'range' contains invalid value.");if(r="min"===t?0:"max"===t?100:parseFloat(t),!e(r)||!e(n[0]))throw new Error("noUiSlider ("+B+"): 'range' value isn't numeric.");i.xPct.push(r),i.xVal.push(n[0]),r?i.xSteps.push(!isNaN(n[1])&&n[1]):isNaN(n[1])||(i.xSteps[0]=n[1]),i.xHighestCompleteStep.push(0)}function f(t,e,n){if(!e)return!0;n.xSteps[t]=u([n.xVal[t],n.xVal[t+1]],e)/l(n.xPct[t],n.xPct[t+1]);var i=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],r=Math.ceil(Number(i.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*r;n.xHighestCompleteStep[t]=o}function m(t,e,n){this.xPct=[],this.xVal=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i,r=[];for(i in t)t.hasOwnProperty(i)&&r.push([t[i],i]);for(r.length&&"object"==typeof r[0][0]?r.sort(function(t,e){return t[0][0]-e[0][0]}):r.sort(function(t,e){return t[0]-e[0]}),i=0;i<r.length;i++)h(r[i][1],r[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)f(i,this.xNumSteps[i],this)}function g(t){if(function(t){return"object"==typeof t&&"function"==typeof t.to&&"function"==typeof t.from}(t))return!0;throw new Error("noUiSlider ("+B+"): 'format' requires 'to' and 'from' methods.")}function v(t,n){if(!e(n))throw new Error("noUiSlider ("+B+"): 'step' is not numeric.");t.singleStep=n}function y(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider ("+B+"): 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider ("+B+"): Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider ("+B+"): 'range' 'min' and 'max' cannot be equal.");t.spectrum=new m(e,t.snap,t.singleStep)}function b(t,e){if(e=i(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider ("+B+"): 'start' option is incorrect.");t.handles=e.length,t.start=e}function _(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider ("+B+"): 'snap' option must be a boolean.")}function w(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider ("+B+"): 'animate' option must be a boolean.")}function x(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider ("+B+"): 'animationDuration' option must be a number.")}function k(t,e){var n,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)i.push(e);i.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider ("+B+"): 'connect' option doesn't match handle count.");i=e}t.connect=i}function S(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider ("+B+"): 'orientation' option is invalid.")}}function E(t,n){if(!e(n))throw new Error("noUiSlider ("+B+"): 'margin' option must be numeric.");if(0!==n&&(t.margin=t.spectrum.getMargin(n),!t.margin))throw new Error("noUiSlider ("+B+"): 'margin' option is only supported on linear sliders.")}function D(t,n){if(!e(n))throw new Error("noUiSlider ("+B+"): 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(n),!t.limit||t.handles<2)throw new Error("noUiSlider ("+B+"): 'limit' option is only supported on linear sliders with 2 or more handles.")}function C(t,n){if(!e(n))throw new Error("noUiSlider ("+B+"): 'padding' option must be numeric.");if(0!==n){if(t.padding=t.spectrum.getMargin(n),!t.padding)throw new Error("noUiSlider ("+B+"): 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider ("+B+"): 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider ("+B+"): 'padding' option must be less than half the range.")}}function M(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider ("+B+"): 'direction' option was not recognized.")}}function A(t,e){if("string"!=typeof e)throw new Error("noUiSlider ("+B+"): 'behaviour' must be a string containing options.");var n=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,r=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,s=e.indexOf("hover")>=0;if(r){if(2!==t.handles)throw new Error("noUiSlider ("+B+"): 'fixed' behaviour must be used with 2 handles");E(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:i,fixed:r,snap:o,hover:s}}function V(t,e){if(t.multitouch=e,"boolean"!=typeof e)throw new Error("noUiSlider ("+B+"): 'multitouch' option must be a boolean.")}function N(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=i(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider ("+B+"): must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider ("+B+"): 'tooltips' must be passed a formatter or 'false'.")})}}function I(t,e){t.ariaFormat=e,g(e)}function P(t,e){t.format=e,g(e)}function R(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider ("+B+"): 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function L(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider ("+B+"): 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function T(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider ("+B+"): 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function O(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:U,format:U},n={step:{r:!1,t:v},start:{r:!0,t:b},connect:{r:!0,t:k},direction:{r:!0,t:M},snap:{r:!1,t:_},animate:{r:!1,t:w},animationDuration:{r:!1,t:x},range:{r:!0,t:y},orientation:{r:!1,t:S},margin:{r:!1,t:E},limit:{r:!1,t:D},padding:{r:!1,t:C},behaviour:{r:!0,t:A},multitouch:{r:!0,t:V},ariaFormat:{r:!1,t:I},format:{r:!1,t:P},tooltips:{r:!1,t:N},cssPrefix:{r:!1,t:R},cssClasses:{r:!1,t:L},useRequestAnimationFrame:{r:!1,t:T}},i={connect:!1,direction:"ltr",behaviour:"tap",multitouch:!1,orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};t.format&&!t.ariaFormat&&(t.ariaFormat=t.format),Object.keys(n).forEach(function(r){if(void 0===t[r]&&void 0===i[r]){if(n[r].r)throw new Error("noUiSlider ("+B+"): '"+r+"' is required.");return!0}n[r].t(e,void 0===t[r]?i[r]:t[r])}),e.pips=t.pips;var r=[["left","top"],["right","bottom"]];return e.style=r[e.dir][e.ort],e.styleOposite=r[e.dir?0:1][e.ort],e}function W(e,r,l){function u(t,e){var n=Z.createElement("div");return e&&o(n,e),t.appendChild(n),n}function c(t,e){var n=u(t,r.cssClasses.origin),i=u(n,r.cssClasses.handle);return i.setAttribute("data-handle",e),i.setAttribute("tabindex","0"),i.setAttribute("role","slider"),i.setAttribute("aria-orientation",r.ort?"vertical":"horizontal"),0===e?o(i,r.cssClasses.handleLower):e===r.handles-1&&o(i,r.cssClasses.handleUpper),n}function d(t,e){return!!e&&u(t,r.cssClasses.connect)}function p(t,e){return!!r.tooltips[e]&&u(t.firstChild,r.cssClasses.tooltip)}function h(t,e,n){function i(t,e){var n=e===r.cssClasses.value,i=n?c:d,o=n?a:l;return e+" "+i[r.ort]+" "+o[t]}var s=Z.createElement("div"),a=[r.cssClasses.valueNormal,r.cssClasses.valueLarge,r.cssClasses.valueSub],l=[r.cssClasses.markerNormal,r.cssClasses.markerLarge,r.cssClasses.markerSub],c=[r.cssClasses.valueHorizontal,r.cssClasses.valueVertical],d=[r.cssClasses.markerHorizontal,r.cssClasses.markerVertical];return o(s,r.cssClasses.pips),o(s,0===r.ort?r.cssClasses.pipsHorizontal:r.cssClasses.pipsVertical),Object.keys(t).forEach(function(o){!function(t,o){o[1]=o[1]&&e?e(o[0],o[1]):o[1];var a=u(s,!1);a.className=i(o[1],r.cssClasses.marker),a.style[r.style]=t+"%",o[1]&&((a=u(s,!1)).className=i(o[1],r.cssClasses.value),a.style[r.style]=t+"%",a.innerText=n.to(o[0]))}(o,t[o])}),s}function f(){j&&(!function(t){t.parentElement.removeChild(t)}(j),j=null)}function m(t){f();var e=t.mode,n=t.density||1,i=t.filter||!1,r=t.values||!1,o=t.stepped||!1,s=function(t,e,n){if("range"===t||"steps"===t)return J.xVal;if("count"===t){if(!e)throw new Error("noUiSlider ("+B+"): 'values' required for mode 'count'.");var i,r=100/(e-1),o=0;for(e=[];(i=o++*r)<=100;)e.push(i);t="positions"}if("positions"===t)return e.map(function(t){return J.fromStepping(n?J.getStep(t):t)});if("values"===t)return n?e.map(function(t){return J.fromStepping(J.getStep(J.toStepping(t)))}):e}(e,r,o),a=function(t,e,n){function i(t,e){return(t+e).toFixed(7)/1}var r={},o=J.xVal[0],s=J.xVal[J.xVal.length-1],a=!1,l=!1,u=0;(n=function(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}(n.slice().sort(function(t,e){return t-e})))[0]!==o&&(n.unshift(o),a=!0);n[n.length-1]!==s&&(n.push(s),l=!0);return n.forEach(function(o,s){var c,d,p,h,f,m,g,v,y,b=o,_=n[s+1];if("steps"===e&&(c=J.xNumSteps[s]),c||(c=_-b),!1!==b&&void 0!==_)for(c=Math.max(c,1e-7),d=b;d<=_;d=i(d,c)){for(g=(f=(h=J.toStepping(d))-u)/t,y=f/(v=Math.round(g)),p=1;p<=v;p+=1)r[(u+p*y).toFixed(5)]=["x",0];m=n.indexOf(d)>-1?1:"steps"===e?2:0,!s&&a&&(m=0),d===_&&l||(r[h.toFixed(5)]=[d,m]),u=h}}),r}(n,e,s),l=t.format||{to:Math.round};return j=q.appendChild(h(a,i,l))}function g(){var t=T.getBoundingClientRect(),e="offset"+["Width","Height"][r.ort];return 0===r.ort?t.width||T[e]:t.height||T[e]}function v(t,e,n,i){var o=function(o){return!q.hasAttribute("disabled")&&(!function(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}(q,r.cssClasses.tap)&&(!!(o=function(t,e,n){var i,o,s=0===t.type.indexOf("touch"),l=0===t.type.indexOf("mouse"),u=0===t.type.indexOf("pointer");0===t.type.indexOf("MSPointer")&&(u=!0);if(s&&r.multitouch){var c=function(t){return t.target===n||n.contains(t.target)};if("touchstart"===t.type){var d=Array.prototype.filter.call(t.touches,c);if(d.length>1)return!1;i=d[0].pageX,o=d[0].pageY}else{var p=Array.prototype.find.call(t.changedTouches,c);if(!p)return!1;i=p.pageX,o=p.pageY}}else if(s){if(t.touches.length>1)return!1;i=t.changedTouches[0].pageX,o=t.changedTouches[0].pageY}e=e||a(Z),(l||u)&&(i=t.clientX+e.x,o=t.clientY+e.y);return t.pageOffset=e,t.points=[i,o],t.cursor=l||u,t}(o,i.pageOffset,i.target||e))&&(!(t===F.start&&void 0!==o.buttons&&o.buttons>1)&&((!i.hover||!o.buttons)&&(H||o.preventDefault(),o.calcPoint=o.points[r.ort],void n(o,i))))))},s=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!!H&&{passive:!0}),s.push([t,o])}),s}function y(t){var e=t-function(t,e){var n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.documentElement,o=a(i);/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0);return e?n.top+o.y-r.clientTop:n.left+o.x-r.clientLeft}(T,r.ort),n=100*e/g();return r.dir?100-n:n}function b(t,e,n,i){var r=n.slice(),o=[!t,t],s=[t,!t];i=i.slice(),t&&i.reverse(),i.length>1?i.forEach(function(t,n){var i=C(r,t,r[t]+e,o[n],s[n],!1);!1===i?e=0:(e=i-r[t],r[t]=i)}):o=s=[!0];var a=!1;i.forEach(function(t,i){a=V(t,n[t]+e,o[i],s[i])||a}),a&&i.forEach(function(t){_("update",t),_("slide",t)})}function _(t,e,n){Object.keys(Q).forEach(function(i){var o=i.split(".")[0];t===o&&Q[i].forEach(function(t){t.call(z,$.map(r.format.to),e,$.slice(),n||!1,G.slice())})})}function w(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&k(t,e)}function x(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return k(t,e);var n=(r.dir?-1:1)*(t.calcPoint-e.startCalcPoint),i=100*n/e.baseSize;b(n>0,i,e.locations,e.handleNumbers)}function k(e,n){n.handle&&(s(n.handle,r.cssClasses.active),K-=1),n.listeners.forEach(function(t){tt.removeEventListener(t[0],t[1])}),0===K&&(s(q,r.cssClasses.drag),A(),e.cursor&&(et.style.cursor="",et.removeEventListener("selectstart",t))),n.handleNumbers.forEach(function(t){_("change",t),_("set",t),_("end",t)})}function S(e,n){var i;if(1===n.handleNumbers.length){var s=W[n.handleNumbers[0]];if(s.hasAttribute("disabled"))return!1;i=s.children[0],K+=1,o(i,r.cssClasses.active)}e.stopPropagation();var a=[],l=v(F.move,tt,x,{target:e.target,handle:i,listeners:a,startCalcPoint:e.calcPoint,baseSize:g(),pageOffset:e.pageOffset,handleNumbers:n.handleNumbers,buttonsProperty:e.buttons,locations:G.slice()}),u=v(F.end,tt,k,{target:e.target,handle:i,listeners:a,handleNumbers:n.handleNumbers}),c=v("mouseout",tt,w,{target:e.target,handle:i,listeners:a,handleNumbers:n.handleNumbers});a.push.apply(a,l.concat(u,c)),e.cursor&&(et.style.cursor=getComputedStyle(e.target).cursor,W.length>1&&o(q,r.cssClasses.drag),et.addEventListener("selectstart",t,!1)),n.handleNumbers.forEach(function(t){_("start",t)})}function E(t){t.stopPropagation();var e=y(t.calcPoint),i=function(t){var e=100,n=!1;return W.forEach(function(i,r){if(!i.hasAttribute("disabled")){var o=Math.abs(G[r]-t);o<e&&(n=r,e=o)}}),n}(e);if(!1===i)return!1;r.events.snap||n(q,r.cssClasses.tap,r.animationDuration),V(i,e,!0,!0),A(),_("slide",i,!0),_("update",i,!0),_("change",i,!0),_("set",i,!0),r.events.snap&&S(t,{handleNumbers:[i]})}function D(t){var e=y(t.calcPoint),n=J.getStep(e),i=J.fromStepping(n);Object.keys(Q).forEach(function(t){"hover"===t.split(".")[0]&&Q[t].forEach(function(t){t.call(z,i)})})}function C(t,e,n,i,o,s){return W.length>1&&(i&&e>0&&(n=Math.max(n,t[e-1]+r.margin)),o&&e<W.length-1&&(n=Math.min(n,t[e+1]-r.margin))),W.length>1&&r.limit&&(i&&e>0&&(n=Math.min(n,t[e-1]+r.limit)),o&&e<W.length-1&&(n=Math.max(n,t[e+1]-r.limit))),r.padding&&(0===e&&(n=Math.max(n,r.padding)),e===W.length-1&&(n=Math.min(n,100-r.padding))),n=J.getStep(n),!((n=function(t){return Math.max(Math.min(t,100),0)}(n))===t[e]&&!s)&&n}function M(t){return t+"%"}function A(){X.forEach(function(t){var e=G[t]>50?-1:1,n=3+(W.length+e*t);W[t].childNodes[0].style.zIndex=n})}function V(t,e,n,i){return!1!==(e=C(G,t,e,n,i,!1))&&(function(t,e){G[t]=e,$[t]=J.fromStepping(e);var n=function(){W[t].style[r.style]=M(e),N(t),N(t+1)};window.requestAnimationFrame&&r.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function N(t){if(U[t]){var e=0,n=100;0!==t&&(e=G[t-1]),t!==U.length-1&&(n=G[t]),U[t].style[r.style]=M(e),U[t].style[r.styleOposite]=M(100-n)}}function I(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=r.format.from(t))||isNaN(t)||V(e,J.toStepping(t),!1,!1))}function P(t,e){var o=i(t),s=void 0===G[0];e=void 0===e||!!e,o.forEach(I),r.animate&&!s&&n(q,r.cssClasses.tap,r.animationDuration),X.forEach(function(t){V(t,G[t],!0,!1)}),A(),X.forEach(function(t){_("update",t),null!==o[t]&&e&&_("set",t)})}function R(){var t=$.map(r.format.to);return 1===t.length?t[0]:t}function L(t,e){Q[t]=Q[t]||[],Q[t].push(e),"update"===t.split(".")[0]&&W.forEach(function(t,e){_("update",e)})}var T,W,U,z,j,F=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},Y=window.CSS&&CSS.supports&&CSS.supports("touch-action","none"),H=Y&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),q=e,G=[],X=[],K=0,J=r.spectrum,$=[],Q={},Z=e.ownerDocument,tt=Z.documentElement,et=Z.body;if(q.noUiSlider)throw new Error("noUiSlider ("+B+"): Slider was already initialized.");return function(t){o(t,r.cssClasses.target),0===r.dir?o(t,r.cssClasses.ltr):o(t,r.cssClasses.rtl);0===r.ort?o(t,r.cssClasses.horizontal):o(t,r.cssClasses.vertical);T=u(t,r.cssClasses.base)}(q),function(t,e){W=[],(U=[]).push(d(e,t[0]));for(var n=0;n<r.handles;n++)W.push(c(e,n)),X[n]=n,U.push(d(e,t[n+1]))}(r.connect,T),z={destroy:function(){for(var t in r.cssClasses)r.cssClasses.hasOwnProperty(t)&&s(q,r.cssClasses[t]);for(;q.firstChild;)q.removeChild(q.firstChild);delete q.noUiSlider},steps:function(){return G.map(function(t,e){var n=J.getNearbySteps(t),i=$[e],r=n.thisStep.step,o=null;!1!==r&&i+r>n.stepAfter.startValue&&(r=n.stepAfter.startValue-i),o=i>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&i-n.stepBefore.highestStep,100===t?r=null:0===t&&(o=null);var s=J.countStepDecimals();return null!==r&&!1!==r&&(r=Number(r.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,r]})},on:L,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(Q).forEach(function(t){var i=t.split(".")[0],r=t.substring(i.length);e&&e!==i||n&&n!==r||delete Q[t]})},get:R,set:P,reset:function(t){P(r.start,t)},__moveHandles:function(t,e,n){b(t,e,G,n)},options:l,updateOptions:function(t,e){var n=R(),i=["margin","limit","padding","range","animate","snap","step","format"];i.forEach(function(e){void 0!==t[e]&&(l[e]=t[e])});var o=O(l);i.forEach(function(e){void 0!==t[e]&&(r[e]=o[e])}),J=o.spectrum,r.margin=o.margin,r.limit=o.limit,r.padding=o.padding,r.pips&&m(r.pips);G=[],P(t.start||n,e)},target:q,removePips:f,pips:m},function(t){t.fixed||W.forEach(function(t,e){v(F.start,t.children[0],S,{handleNumbers:[e]})});t.tap&&v(F.start,T,E,{});t.hover&&v(F.move,T,D,{hover:!0});t.drag&&U.forEach(function(e,n){if(!1!==e&&0!==n&&n!==U.length-1){var i=W[n-1],s=W[n],a=[e];o(e,r.cssClasses.draggable),t.fixed&&(a.push(i.children[0]),a.push(s.children[0])),a.forEach(function(t){v(F.start,t,S,{handles:[i,s],handleNumbers:[n-1,n]})})}})}(r.events),P(r.start),r.pips&&m(r.pips),r.tooltips&&function(){var t=W.map(p);L("update",function(e,n,i){if(t[n]){var o=e[n];!0!==r.tooltips[n]&&(o=r.tooltips[n].to(i[n])),t[n].innerHTML=o}})}(),L("update",function(t,e,n,i,o){X.forEach(function(t){var e=W[t],i=C(G,t,0,!0,!0,!0),s=C(G,t,100,!0,!0,!0),a=o[t],l=r.ariaFormat.to(n[t]);e.children[0].setAttribute("aria-valuemin",i.toFixed(1)),e.children[0].setAttribute("aria-valuemax",s.toFixed(1)),e.children[0].setAttribute("aria-valuenow",a.toFixed(1)),e.children[0].setAttribute("aria-valuetext",l)})}),z}var B="10.1.0";m.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider ("+B+"): 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&u(this.xVal,t)},m.prototype.toStepping=function(t){return t=d(this.xVal,this.xPct,t)},m.prototype.fromStepping=function(t){return function(t,e,n){if(n>=100)return t.slice(-1)[0];var i,r,o,s,a=c(n,e);return i=t[a-1],r=t[a],o=e[a-1],s=e[a],function(t,e){return e*(t[1]-t[0])/100+t[0]}([i,r],(n-o)*l(o,s))}(this.xVal,this.xPct,t)},m.prototype.getStep=function(t){return t=p(this.xPct,this.xSteps,this.snap,t)},m.prototype.getNearbySteps=function(t){var e=c(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},m.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(r);return Math.max.apply(null,t)},m.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var U={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};return{version:B,create:function(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider ("+B+"): create requires a single element, got: "+t);var n=O(e),i=W(t,n,e);return t.noUiSlider=i,i}}})},404:/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
*/
function(t,e,n){!function(i,r){"use strict";var o;if("object"==typeof n){try{o=t("moment")}catch(t){}e.exports=r(o)}else i.Pikaday=r(i.moment)}(this,function(t){"use strict";var e="function"==typeof t,n=!!window.addEventListener,i=window.document,r=window.setTimeout,o=function(t,e,i,r){n?t.addEventListener(e,i,!!r):t.attachEvent("on"+e,i)},s=function(t,e,i,r){n?t.removeEventListener(e,i,!!r):t.detachEvent("on"+e,i)},a=function(t,e){return-1!==(" "+t.className+" ").indexOf(" "+e+" ")},l=function(t){return/Array/.test(Object.prototype.toString.call(t))},u=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},c=function(t){var e=t.getDay();return 0===e||6===e},d=function(t,e){return[31,function(t){return t%4==0&&t%100!=0||t%400==0}(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},p=function(t){u(t)&&t.setHours(0,0,0,0)},h=function(t,e){return t.getTime()===e.getTime()},f=function(t,e,n){var i,r;for(i in e)(r=void 0!==t[i])&&"object"==typeof e[i]&&null!==e[i]&&void 0===e[i].nodeName?u(e[i])?n&&(t[i]=new Date(e[i].getTime())):l(e[i])?n&&(t[i]=e[i].slice(0)):t[i]=f({},e[i],n):!n&&r||(t[i]=e[i]);return t},m=function(t,e,n){var r;i.createEvent?((r=i.createEvent("HTMLEvents")).initEvent(e,!0,!1),r=f(r,n),t.dispatchEvent(r)):i.createEventObject&&(r=i.createEventObject(),r=f(r,n),t.fireEvent("on"+e,r))},g=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},v={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null},y=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},b=function(t){var e=[],n="false";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled")}return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},_=function(t,e,n){var i=new Date(n,0,1),r=Math.ceil(((new Date(n,e,t)-i)/864e5+i.getDay()+1)/7);return'<td class="pika-week">'+r+"</td>"},w=function(t,e,n,i){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(i?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},x=function(t,e,n,i,r,o){var s,a,u,c,d,p=t._o,h=n===p.minYear,f=n===p.maxYear,m='<div id="'+o+'" class="pika-title" role="heading" aria-live="assertive">',g=!0,v=!0;for(u=[],s=0;s<12;s++)u.push('<option value="'+(n===r?s-e:12+s-e)+'"'+(s===i?' selected="selected"':"")+(h&&s<p.minMonth||f&&s>p.maxMonth?'disabled="disabled"':"")+">"+p.i18n.months[s]+"</option>");for(c='<div class="pika-label">'+p.i18n.months[i]+'<select class="pika-select pika-select-month" tabindex="-1">'+u.join("")+"</select></div>",l(p.yearRange)?(s=p.yearRange[0],a=p.yearRange[1]+1):(s=n-p.yearRange,a=1+n+p.yearRange),u=[];s<a&&s<=p.maxYear;s++)s>=p.minYear&&u.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return d='<div class="pika-label">'+n+p.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+u.join("")+"</select></div>",p.showMonthAfterYear?m+=d+c:m+=c+d,h&&(0===i||p.minMonth>=i)&&(g=!1),f&&(11===i||p.maxMonth<=i)&&(v=!1),0===e&&(m+='<button class="pika-prev'+(g?"":" is-disabled")+'" type="button">'+p.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(m+='<button class="pika-next'+(v?"":" is-disabled")+'" type="button">'+p.i18n.nextMonth+"</button>"),m+="</div>"},k=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(t){var e,n=[];t.showWeekNumber&&n.push("<th></th>");for(e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+y(t,e)+'">'+y(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"}(t)+function(t){return"<tbody>"+t.join("")+"</tbody>"}(e)+"</table>"},S=function(s){var l=this,c=l.config(s);l._onMouseDown=function(t){if(l._v){var e=(t=t||window.event).target||t.srcElement;if(e)if(a(e,"is-disabled")||(!a(e,"pika-button")||a(e,"is-empty")||a(e.parentNode,"is-disabled")?a(e,"pika-prev")?l.prevMonth():a(e,"pika-next")&&l.nextMonth():(l.setDate(new Date(e.getAttribute("data-pika-year"),e.getAttribute("data-pika-month"),e.getAttribute("data-pika-day"))),c.bound&&r(function(){l.hide(),c.blurFieldOnSelect&&c.field&&c.field.blur()},100))),a(e,"pika-select"))l._c=!0;else{if(!t.preventDefault)return t.returnValue=!1,!1;t.preventDefault()}}},l._onChange=function(t){var e=(t=t||window.event).target||t.srcElement;e&&(a(e,"pika-select-month")?l.gotoMonth(e.value):a(e,"pika-select-year")&&l.gotoYear(e.value))},l._onKeyChange=function(t){if(t=t||window.event,l.isVisible())switch(t.keyCode){case 13:case 27:c.field&&c.field.blur();break;case 37:t.preventDefault(),l.adjustDate("subtract",1);break;case 38:l.adjustDate("subtract",7);break;case 39:l.adjustDate("add",1);break;case 40:l.adjustDate("add",7)}},l._onInputChange=function(n){var i;n.firedBy!==l&&(i=c.parse?c.parse(c.field.value,c.format):e?(i=t(c.field.value,c.format,c.formatStrict))&&i.isValid()?i.toDate():null:new Date(Date.parse(c.field.value)),u(i)&&l.setDate(i),l._v||l.show())},l._onInputFocus=function(){l.show()},l._onInputClick=function(){l.show()},l._onInputBlur=function(){var t=i.activeElement;do{if(a(t,"pika-single"))return}while(t=t.parentNode);l._c||(l._b=r(function(){l.hide()},50)),l._c=!1},l._onClick=function(t){var e=(t=t||window.event).target||t.srcElement,i=e;if(e){!n&&a(e,"pika-select")&&(e.onchange||(e.setAttribute("onchange","return;"),o(e,"change",l._onChange)));do{if(a(i,"pika-single")||i===c.trigger)return}while(i=i.parentNode);l._v&&e!==c.trigger&&i!==c.trigger&&l.hide()}},l.el=i.createElement("div"),l.el.className="pika-single"+(c.isRTL?" is-rtl":"")+(c.theme?" "+c.theme:""),o(l.el,"mousedown",l._onMouseDown,!0),o(l.el,"touchend",l._onMouseDown,!0),o(l.el,"change",l._onChange),o(i,"keydown",l._onKeyChange),c.field&&(c.container?c.container.appendChild(l.el):c.bound?i.body.appendChild(l.el):c.field.parentNode.insertBefore(l.el,c.field.nextSibling),o(c.field,"change",l._onInputChange),c.defaultDate||(e&&c.field.value?c.defaultDate=t(c.field.value,c.format).toDate():c.defaultDate=new Date(Date.parse(c.field.value)),c.setDefaultDate=!0));var d=c.defaultDate;u(d)?c.setDefaultDate?l.setDate(d,!0):l.gotoDate(d):l.gotoDate(new Date),c.bound?(this.hide(),l.el.className+=" is-bound",o(c.trigger,"click",l._onInputClick),o(c.trigger,"focus",l._onInputFocus),o(c.trigger,"blur",l._onInputBlur)):this.show()};return S.prototype={config:function(t){this._o||(this._o=f({},v,!0));var e=f(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme="string"==typeof e.theme&&e.theme?e.theme:null,e.bound=!!(void 0!==e.bound?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn="function"==typeof e.disableDayFn?e.disableDayFn:null;var n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,u(e.minDate)||(e.minDate=!1),u(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),l(e.yearRange)){var i=(new Date).getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||i,e.yearRange[1]=parseInt(e.yearRange[1],10)||i}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||v.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(n){return n=n||this._o.format,u(this._d)?this._o.toString?this._o.toString(this._d,n):e?t(this._d).format(n):this._d.toDateString():""},getMoment:function(){return e?t(this._d):null},setMoment:function(n,i){e&&t.isMoment(n)&&this.setDate(n.toDate(),i)},getDate:function(){return u(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",m(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof t&&(t=new Date(Date.parse(t))),u(t)){var n=this._o.minDate,i=this._o.maxDate;u(n)&&t<n?t=n:u(i)&&t>i&&(t=i),this._d=new Date(t.getTime()),p(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),m(this._o.field,"change",{firedBy:this})),e||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(t){var e=!0;if(u(t)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=t.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),e=r<n.getTime()||i.getTime()<r}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){var n,i=this.getDate()||new Date,r=24*parseInt(e)*60*60*1e3;"add"===t?n=new Date(i.valueOf()+r):"subtract"===t&&(n=new Date(i.valueOf()-r)),this.setDate(n)},adjustCalendars:function(){this.calendars[0]=g(this.calendars[0]);for(var t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=g({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(p(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=v.minDate,this._o.minYear=v.minYear,this._o.minMonth=v.minMonth,this._o.startRange=v.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(p(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=v.maxDate,this._o.maxYear=v.maxYear,this._o.maxMonth=v.maxMonth,this._o.endRange=v.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(this._v||t){var e,n=this._o,i=n.minYear,o=n.maxYear,s=n.minMonth,a=n.maxMonth,l="";this._y<=i&&(this._y=i,!isNaN(s)&&this._m<s&&(this._m=s)),this._y>=o&&(this._y=o,!isNaN(a)&&this._m>a&&(this._m=a)),e="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+x(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,e)+this.render(this.calendars[u].year,this.calendars[u].month,e)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&r(function(){n.trigger.focus()},1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var t,e,n,r,o,s,a,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=this._o.trigger,e=t,n=this.el.offsetWidth,r=this.el.offsetHeight,o=window.innerWidth||i.documentElement.clientWidth,s=window.innerHeight||i.documentElement.clientHeight,a=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,"function"==typeof t.getBoundingClientRect)c=t.getBoundingClientRect(),l=c.left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=e.offsetLeft,u=e.offsetTop+e.offsetHeight;e=e.offsetParent;)l+=e.offsetLeft,u+=e.offsetTop;(this._o.reposition&&l+n>o||this._o.position.indexOf("right")>-1&&l-n+t.offsetWidth>0)&&(l=l-n+t.offsetWidth),(this._o.reposition&&u+r>s+a||this._o.position.indexOf("top")>-1&&u-r-t.offsetHeight>0)&&(u=u-r-t.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(t,e,n){var i=this._o,r=new Date,o=d(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];p(r),i.firstDay>0&&(s-=i.firstDay)<0&&(s+=7);for(var f=0===e?11:e-1,m=11===e?0:e+1,g=0===e?t-1:t,v=11===e?t+1:t,y=d(g,f),x=o+s,S=x;S>7;)S-=7;x+=7-S;for(var E=!1,D=0,C=0;D<x;D++){var M=new Date(t,e,D-s+1),A=!!u(this._d)&&h(M,this._d),V=h(M,r),N=-1!==i.events.indexOf(M.toDateString()),I=D<s||D>=o+s,P=D-s+1,R=e,L=t,T=i.startRange&&h(i.startRange,M),O=i.endRange&&h(i.endRange,M),W=i.startRange&&i.endRange&&i.startRange<M&&M<i.endRange,B=i.minDate&&M<i.minDate||i.maxDate&&M>i.maxDate||i.disableWeekends&&c(M)||i.disableDayFn&&i.disableDayFn(M);I&&(D<s?(P=y+P,R=f,L=g):(P-=o,R=m,L=v));var U={day:P,month:R,year:L,hasEvent:N,isSelected:A,isToday:V,isDisabled:B,isEmpty:I,isStartRange:T,isEndRange:O,isInRange:W,showDaysInNextAndPreviousMonths:i.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:i.enableSelectionDaysInNextAndPreviousMonths};i.pickWholeWeek&&A&&(E=!0),l.push(b(U)),7==++C&&(i.showWeekNumber&&l.unshift(_(D-s,e,t)),a.push(w(l,i.isRTL,i.pickWholeWeek,E)),l=[],C=0,E=!1)}return k(i,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),function(t,e){t.className=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}((" "+t.className+" ").replace(" "+e+" "," "))}(this.el,"is-hidden"),this._o.bound&&(o(i,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var t=this._v;!1!==t&&(this._o.bound&&s(i,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",function(t,e){a(t,e)||(t.className=""===t.className?e:t.className+" "+e)}(this.el,"is-hidden"),this._v=!1,void 0!==t&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),s(i,"keydown",this._onKeyChange),this._o.field&&(s(this._o.field,"change",this._onInputChange),this._o.bound&&(s(this._o.trigger,"click",this._onInputClick),s(this._o.trigger,"focus",this._onInputFocus),s(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},S})}},{"models/widgets/abstract_button":372,"models/widgets/abstract_icon":373,"models/widgets/abstract_slider":374,"models/widgets/autocomplete_input":375,"models/widgets/button":376,"models/widgets/checkbox_button_group":377,"models/widgets/checkbox_group":378,"models/widgets/common":379,"models/widgets/date_picker":380,"models/widgets/date_range_slider":381,"models/widgets/date_slider":382,"models/widgets/div":383,"models/widgets/dropdown":384,"models/widgets/index":385,"models/widgets/input_widget":386,"models/widgets/main":387,"models/widgets/markup":388,"models/widgets/multiselect":389,"models/widgets/panel":390,"models/widgets/paragraph":391,"models/widgets/password_input":392,"models/widgets/pretext":393,"models/widgets/radio_button_group":394,"models/widgets/radio_group":395,"models/widgets/range_slider":396,"models/widgets/selectbox":397,"models/widgets/slider":398,"models/widgets/tabs":399,"models/widgets/text_input":400,"models/widgets/toggle":401,"models/widgets/widget":412})}(t.Bokeh)}(this);/*!
Copyright (c) 2012, Anaconda, 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 Anaconda 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.
*/
//# sourceMappingURL=bokeh-widgets.min.js.map
/* END bokeh-widgets.min.js */
</script>
<script type="text/javascript">
/* BEGIN bokeh-tables.min.js */
!function(a8274,a8275){!function(Bokeh){var define;(function(e,t,n){if(null!=Bokeh)return Bokeh.register_plugin(e,t,409);throw new Error("Cannot find Bokeh. You have to load it prior to loading plugins.")})({405:function(e,t,n){var o=e(364),r=e(15),i=e(5),l=e(30),a=e(6),s=e(50),u=e(407),c=function(e){function t(t){var n=e.call(this,l.extend({model:t.column.editor},t))||this;return n.args=t,n}return o.__extends(t,e),t.prototype.initialize=function(t){return e.prototype.initialize.call(this,t),this.render()},t.prototype.render=function(){return e.prototype.render.call(this),this.args.container.appendChild(this.el),this.el.appendChild(this.inputEl),this.renderEditor(),this.disableNavigation(),this},t.prototype.renderEditor=function(){},t.prototype.disableNavigation=function(){return this.inputEl.addEventListener("keydown",function(e){switch(e.keyCode){case i.Keys.Left:case i.Keys.Right:case i.Keys.Up:case i.Keys.Down:case i.Keys.PageUp:case i.Keys.PageDown:return e.stopImmediatePropagation()}})},t.prototype.destroy=function(){return this.remove()},t.prototype.focus=function(){return this.inputEl.focus()},t.prototype.show=function(){},t.prototype.hide=function(){},t.prototype.position=function(){},t.prototype.getValue=function(){return this.inputEl.value},t.prototype.setValue=function(e){return this.inputEl.value=e},t.prototype.serializeValue=function(){return this.getValue()},t.prototype.isValueChanged=function(){return!(""===this.getValue()&&null==this.defaultValue)&&this.getValue()!==this.defaultValue},t.prototype.applyValue=function(e,t){return this.args.grid.getData().setField(e[u.DTINDEX_NAME],this.args.column.field,t)},t.prototype.loadValue=function(e){var t;return t=e[this.args.column.field],this.defaultValue=null!=t?t:this.emptyValue,this.setValue(this.defaultValue)},t.prototype.validateValue=function(e){var t;return this.args.column.validator&&!(t=this.args.column.validator(e)).valid?t:{valid:!0,msg:null}},t.prototype.validate=function(){return this.validateValue(this.getValue())},t}(a.DOMView);n.CellEditorView=c,c.prototype.className="bk-cell-editor",c.prototype.inputEl=null,c.prototype.emptyValue=null,c.prototype.defaultValue=null;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(s.Model);n.CellEditor=d,d.prototype.type="CellEditor",d.prototype.default_view=c;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.renderEditor=function(){return this.inputEl.focus(),this.inputEl.select()},t.prototype.loadValue=function(t){return e.prototype.loadValue.call(this,t),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},t}(c);n.StringEditorView=p,p.prototype.emptyValue="",p.prototype.inputEl=i.input({type:"text"});var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.StringEditor=f,f.prototype.type="StringEditor",f.prototype.default_view=p,f.define({completions:[r.Array,[]]}),n.TextEditorView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(c);var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.TextEditor=h,h.prototype.type="TextEditor",h.prototype.default_view=n.TextEditorView;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.renderEditor=function(){var e,t,n;for(n=this.model.options,e=0,t=n.length;e<t;e++)i.option=n[e],this.inputEl.appendChild(i.option({value:i.option},i.option));return this.focus()},t.prototype.loadValue=function(t){return e.prototype.loadValue.call(this,t),this.inputEl.select()},t}(c);n.SelectEditorView=g,g.prototype.inputEl=i.select();var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.SelectEditor=m,m.prototype.type="SelectEditor",m.prototype.default_view=g,m.define({options:[r.Array,[]]}),n.PercentEditorView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(c);var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.PercentEditor=v,v.prototype.type="PercentEditor",v.prototype.default_view=n.PercentEditorView;var w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.renderEditor=function(){return this.focus()},t.prototype.loadValue=function(e){return this.defaultValue=!!e[this.args.column.field],this.inputEl.checked=this.defaultValue},t.prototype.serializeValue=function(){return this.inputEl.checked},t}(c);n.CheckboxEditorView=w,w.prototype.inputEl=i.input({type:"checkbox",value:"true"});var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.CheckboxEditor=y,y.prototype.type="CheckboxEditor",y.prototype.default_view=w;var C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.renderEditor=function(){return this.inputEl.focus(),this.inputEl.select()},t.prototype.remove=function(){return e.prototype.remove.call(this)},t.prototype.serializeValue=function(){return parseInt(this.getValue(),10)||0},t.prototype.loadValue=function(t){return e.prototype.loadValue.call(this,t),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},t.prototype.validateValue=function(t){return isNaN(t)?{valid:!1,msg:"Please enter a valid integer"}:e.prototype.validateValue.call(this,t)},t}(c);n.IntEditorView=C,C.prototype.inputEl=i.input({type:"text"});var b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.IntEditor=b,b.prototype.type="IntEditor",b.prototype.default_view=C,b.define({step:[r.Number,1]});var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.renderEditor=function(){return this.inputEl.focus(),this.inputEl.select()},t.prototype.remove=function(){return e.prototype.remove.call(this)},t.prototype.serializeValue=function(){return parseFloat(this.getValue())||0},t.prototype.loadValue=function(t){return e.prototype.loadValue.call(this,t),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},t.prototype.validateValue=function(t){return isNaN(t)?{valid:!1,msg:"Please enter a valid number"}:e.prototype.validateValue.call(this,t)},t}(c);n.NumberEditorView=x,x.prototype.inputEl=i.input({type:"text"});var R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.NumberEditor=R,R.prototype.type="NumberEditor",R.prototype.default_view=x,R.define({step:[r.Number,.01]}),n.TimeEditorView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(c);var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.TimeEditor=S,S.prototype.type="TimeEditor",S.prototype.default_view=n.TimeEditorView;var E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.renderEditor=function(){return this.calendarOpen=!1,this.inputEl.focus(),this.inputEl.select()},t.prototype.destroy=function(){return e.prototype.destroy.call(this)},t.prototype.show=function(){return e.prototype.show.call(this)},t.prototype.hide=function(){return e.prototype.hide.call(this)},t.prototype.position=function(t){return e.prototype.position.call(this)},t.prototype.getValue=function(){},t.prototype.setValue=function(e){},t}(c);n.DateEditorView=E,E.prototype.emptyValue=new Date,E.prototype.inputEl=i.input({type:"text"});var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(d);n.DateEditor=k,k.prototype.type="DateEditor",k.prototype.default_view=E},406:function(e,t,n){var o=e(364),r=e(332),i=e(421),l=e(363),a=e(15),s=e(5),u=e(30),c=e(42),d=e(50);n.CellFormatter=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){return null==n?"":(n+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},t}(d.Model);var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){var i,l,a,u;switch(i=this.font_style,a=this.text_align,u=this.text_color,l=s.span({},null==n?"":""+n),i){case"bold":l.style.fontWeight="bold";break;case"italic":l.style.fontStyle="italic"}return null!=a&&(l.style.textAlign=a),null!=u&&(l.style.color=u),l=l.outerHTML},t}(n.CellFormatter);n.StringFormatter=p,p.prototype.type="StringFormatter",p.define({font_style:[a.FontStyle,"normal"],text_align:[a.TextAlign,"left"],text_color:[a.Color]});var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(t,n,o,i,l){var a,s,u;return a=this.format,s=this.language,u=function(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}.call(this),o=r.format(o,a,s,u),e.prototype.doFormat.call(this,t,n,o,i,l)},t}(p);n.NumberFormatter=f,f.prototype.type="NumberFormatter",f.define({format:[a.String,"0,0"],language:[a.String,"en"],rounding:[a.String,"round"]});var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){return n?s.i({class:this.icon}).outerHTML:""},t}(n.CellFormatter);n.BooleanFormatter=h,h.prototype.type="BooleanFormatter",h.define({icon:[a.String,"check"]});var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.getFormat=function(){var e;return"__CUSTOM__"===(e=function(){switch(this.format){case"ATOM":case"W3C":case"RFC-3339":case"ISO-8601":return"%Y-%m-%d";case"COOKIE":return"%a, %d %b %Y";case"RFC-850":return"%A, %d-%b-%y";case"RFC-1123":case"RFC-2822":return"%a, %e %b %Y";case"RSS":case"RFC-822":case"RFC-1036":return"%a, %e %b %y";case"TIMESTAMP":return null;default:return"__CUSTOM__"}}.call(this))?this.format:e},t.prototype.doFormat=function(t,n,o,r,i){var a;return o=c.isString(o)?parseInt(o,10):o,a=l(o,this.getFormat()),e.prototype.doFormat.call(this,t,n,a,r,i)},t}(n.CellFormatter);n.DateFormatter=g,g.prototype.type="DateFormatter",g.define({format:[a.String,"ISO-8601"]});var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){var l;return l=this.template,null===n?"":(r=u.extend({},r,{value:n}),i(l)(r))},t}(n.CellFormatter);n.HTMLTemplateFormatter=m,m.prototype.type="HTMLTemplateFormatter",m.define({template:[a.String,"<%= value %>"]})},407:function(e,t,n){var o=e(364),r=e(419),i=e(417),l=e(416),a=e(9),s=e(15),u=e(37),c=e(22),d=e(14),p=e(411),f=e(412);n.DTINDEX_NAME="__bkdt_internal_index__",n.DataProvider=function(){function e(e,t){if(this.source=e,this.view=t,n.DTINDEX_NAME in this.source.data)throw new Error("special name "+n.DTINDEX_NAME+" cannot be used as a data table column");this.index=this.view.indices}return e.prototype.getLength=function(){return this.index.length},e.prototype.getItem=function(e){var t,o,r,i,l;for(o={},l=Object.keys(this.source.data),r=0,i=l.length;r<i;r++)t=l[r],o[t]=this.source.data[t][this.index[e]];return o[n.DTINDEX_NAME]=this.index[e],o},e.prototype.setItem=function(e,t){var o,r;for(o in t)r=t[o],o!==n.DTINDEX_NAME&&(this.source.data[o][this.index[e]]=r);return this._update_source_inplace(),null},e.prototype.getField=function(e,t){return t===n.DTINDEX_NAME?this.index[e]:this.source.data[t][this.index[e]]},e.prototype.setField=function(e,t,n){return this.source.data[t][this.index[e]]=n,this._update_source_inplace(),null},e.prototype.getItemMetadata=function(e){return null},e.prototype.getRecords=function(){var e;return function(){var t,n,o;for(o=[],e=t=0,n=this.getLength();0<=n?t<n:t>n;e=0<=n?++t:--t)o.push(this.getItem(e));return o}.call(this)},e.prototype.sort=function(e){var t,o,r,i;return 0===(t=function(){var t,n,r;for(r=[],t=0,n=e.length;t<n;t++)o=e[t],r.push([o.sortCol.field,o.sortAsc?1:-1]);return r}()).length&&(t=[[n.DTINDEX_NAME,1]]),i=this.getRecords(),r=this.index.slice(),this.index.sort(function(e,n){var o,l,a,s,u,c,d;for(l=0,a=t.length;l<a;l++)if(p=t[l],o=p[0],u=p[1],c=i[r.indexOf(e)][o],d=i[r.indexOf(n)][o],0!==(s=c===d?0:c>d?u:-u))return s;return 0;var p})},e.prototype._update_source_inplace=function(){this.source.properties.data.change.emit(this,this.source.attributes.data)},e}();var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.initialize=function(t){return e.prototype.initialize.call(this,t),this.in_selection_update=!1},t.prototype.connect_signals=function(){var t=this;return e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()}),this.connect(this.model.source.properties.data.change,function(){return t.updateGrid()}),this.connect(this.model.source.streaming,function(){return t.updateGrid()}),this.connect(this.model.source.patching,function(){return t.updateGrid()}),this.connect(this.model.source.change,function(){return t.updateSelection()})},t.prototype.updateGrid=function(){return this.model.view.compute_indices(),this.data.constructor(this.model.source,this.model.view),this.grid.invalidate(),this.grid.render(),this.model.source.data=this.model.source.data,this.model.source.change.emit()},t.prototype.updateSelection=function(){var e,t,n,o,r,i;if(!this.in_selection_update)return o=this.model.source.selected,r=o["1d"].indices,n=function(){var e,t,n;for(n=[],e=0,t=r.length;e<t;e++)i=r[e],n.push(this.data.index.indexOf(i));return n}.call(this),this.in_selection_update=!0,this.grid.setSelectedRows(n),this.in_selection_update=!1,e=this.grid.getViewport(),this.model.scroll_to_selection&&!c.any(n,function(t){return e.top<=t&&t<=e.bottom})?(t=Math.max(0,Math.min.apply(null,n)-1),this.grid.scrollRowToTop(t)):void 0},t.prototype.newIndexColumn=function(){return{id:u.uniqueId(),name:"#",field:n.DTINDEX_NAME,width:40,behavior:"select",cannotTriggerInsert:!0,resizable:!1,selectable:!1,sortable:!0,cssClass:"bk-cell-index"}},t.prototype.render=function(){var e,t,o,s,u,c,p=this;return o=function(){var e,n,o,r;for(o=this.model.columns,r=[],e=0,n=o.length;e<n;e++)t=o[e],r.push(t.toColumn());return r}.call(this),"checkbox"===this.model.selectable&&(e=new l.CheckboxSelectColumn({cssClass:"bk-cell-select"}),o.unshift(e.getColumnDefinition())),this.model.row_headers&&o.unshift(this.newIndexColumn()),(c=this.model.reorderable)&&null==("undefined"!=typeof $&&null!==$&&null!=(u=$.fn)?u.sortable:void 0)&&(null==this._warned_not_reorderable&&(d.logger.warn("jquery-ui is required to enable DataTable.reorderable"),this._warned_not_reorderable=!0),c=!1),s={enableCellNavigation:!1!==this.model.selectable,enableColumnReorder:c,forceFitColumns:this.model.fit_columns,autoHeight:"auto"===this.model.height,multiColumnSort:this.model.sortable,editable:this.model.editable,autoEdit:!1},null!=this.model.width?this.el.style.width=this.model.width+"px":this.el.style.width=this.model.default_width+"px",null!=this.model.height&&"auto"!==this.model.height&&(this.el.style.height=this.model.height+"px"),this.data=new n.DataProvider(this.model.source,this.model.view),this.grid=new r.Grid(this.el,this.data,o,s),this.grid.onSort.subscribe(function(e,t){return o=t.sortCols,p.data.sort(o),p.grid.invalidate(),p.updateSelection(),p.grid.render()}),!1!==this.model.selectable&&(this.grid.setSelectionModel(new i.RowSelectionModel({selectActiveRow:null==e})),null!=e&&this.grid.registerPlugin(e),this.grid.onSelectedRowsChanged.subscribe(function(e,t){var n,o;if(!p.in_selection_update)return o=a.create_hit_test_result(),o["1d"].indices=function(){var e,o,r,i;for(r=t.rows,i=[],e=0,o=r.length;e<o;e++)n=r[e],i.push(this.data.index[n]);return i}.call(p),p.model.source.selected=o}),this.updateSelection()),this},t}(f.WidgetView);n.DataTableView=h,h.prototype.className="bk-data-table";var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(p.TableWidget);n.DataTable=g,g.prototype.type="DataTable",g.prototype.default_view=h,g.define({columns:[s.Array,[]],fit_columns:[s.Bool,!0],sortable:[s.Bool,!0],reorderable:[s.Bool,!0],editable:[s.Bool,!1],selectable:[s.Bool,!0],row_headers:[s.Bool,!0],scroll_to_selection:[s.Bool,!0]}),g.override({height:400}),g.internal({default_width:[s.Number,600]})},408:function(e,t,n){var o=e(364);o.__exportStar(e(405),n),o.__exportStar(e(406),n);var r=e(407);n.DataTable=r.DataTable;var i=e(410);n.TableColumn=i.TableColumn;var l=e(411);n.TableWidget=l.TableWidget},409:function(e,t,n){var o=e(408);n.Tables=o;var r=e(0);r.register_models(o)},410:function(e,t,n){var o=e(364),r=e(406),i=e(405),l=e(15),a=e(37),s=e(50),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.toColumn=function(){var e;return{id:a.uniqueId(),field:this.field,name:this.title,width:this.width,formatter:null!=(e=this.formatter)?e.doFormat.bind(this.formatter):void 0,editor:this.editor.default_view,sortable:this.sortable,defaultSortAsc:"ascending"===this.default_sort}},t}(s.Model);n.TableColumn=u,u.prototype.type="TableColumn",u.prototype.default_view=null,u.define({field:[l.String],title:[l.String],width:[l.Number,300],formatter:[l.Instance,function(){return new r.StringFormatter}],editor:[l.Instance,function(){return new i.StringEditor}],sortable:[l.Bool,!0],default_sort:[l.String,"ascending"]})},411:function(e,t,n){var o=e(364),r=e(412),i=e(172),l=e(15),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.initialize=function(t){if(e.prototype.initialize.call(this,t),null==this.view.source)return this.view.source=this.source,this.view.compute_indices()},t}(r.Widget);n.TableWidget=a,a.prototype.type="TableWidget",a.define({source:[l.Instance],view:[l.Instance,function(){return new i.CDSView}]})},412:function(e,t,n){var o=e(364),r=e(139),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.render=function(){if(this._render_classes(),null!=this.model.height&&(this.el.style.height=this.model.height+"px"),null!=this.model.width)return this.el.style.width=this.model.width+"px"},t}(r.LayoutDOMView);n.WidgetView=i,i.prototype.className="bk-widget";var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t}(r.LayoutDOM);n.Widget=l,l.prototype.type="Widget",l.prototype.default_view=i},413:/*!
* jQuery JavaScript Library v3.2.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2017-03-20T18:59Z
*/
function(e,t,n){!function(e,n){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t){var n=(t=t||G).createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function o(e){var t=!!e&&"length"in e&&e.length,n=ae.type(e);return"function"!==n&&!ae.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function i(e,t,n){return ae.isFunction(t)?ae.grep(e,function(e,o){return!!t.call(e,o,e)!==n}):t.nodeType?ae.grep(e,function(e){return e===t!==n}):"string"!=typeof t?ae.grep(e,function(e){return ee.call(t,e)>-1!==n}):ve.test(t)?ae.filter(t,e,n):(t=ae.filter(t,e),ae.grep(e,function(e){return ee.call(t,e)>-1!==n&&1===e.nodeType}))}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){return e}function s(e){throw e}function u(e,t,n,o){var r;try{e&&ae.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&ae.isFunction(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(o))}catch(e){n.apply(void 0,[e])}}function c(){G.removeEventListener("DOMContentLoaded",c),e.removeEventListener("load",c),ae.ready()}function d(){this.expando=ae.expando+d.uid++}function p(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace(Ae,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(o))){try{n=function(e){if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if(e===+e+"")return+e;if(Ne.test(e))return JSON.parse(e);return e}(n)}catch(e){}De.set(e,t,n)}else n=void 0;return n}function f(e,t,n,o){var r,i=1,l=20,a=o?function(){return o.cur()}:function(){return ae.css(e,t,"")},s=a(),u=n&&n[3]||(ae.cssNumber[t]?"":"px"),c=(ae.cssNumber[t]||"px"!==u&&+s)&&He.exec(ae.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+s||1;do{c/=i=i||".5",ae.style(e,t,c+u)}while(i!==(i=a()/s)&&1!==i&&--l)}return n&&(c=+c||+s||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],o&&(o.unit=u,o.start=c,o.end=r)),r}function h(e){var t,n=e.ownerDocument,o=e.nodeName,r=_e[o];return r||(t=n.body.appendChild(n.createElement(o)),r=ae.css(t,"display"),t.parentNode.removeChild(t),"none"===r&&(r="block"),_e[o]=r,r)}function g(e,t){for(var n,o,r=[],i=0,l=e.length;i<l;i++)(o=e[i]).style&&(n=o.style.display,t?("none"===n&&(r[i]=Pe.get(o,"display")||null,r[i]||(o.style.display="")),""===o.style.display&&Fe(o)&&(r[i]=h(o))):"none"!==n&&(r[i]="none",Pe.set(o,"display",n)));for(i=0;i<l;i++)null!=r[i]&&(e[i].style.display=r[i]);return e}function m(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&r(e,t)?ae.merge([e],n):n}function v(e,t){for(var n=0,o=e.length;n<o;n++)Pe.set(e[n],"globalEval",!t||Pe.get(t[n],"globalEval"))}function w(e,t,n,o,r){for(var i,l,a,s,u,c,d=t.createDocumentFragment(),p=[],f=0,h=e.length;f<h;f++)if((i=e[f])||0===i)if("object"===ae.type(i))ae.merge(p,i.nodeType?[i]:i);else if(Be.test(i)){for(l=l||d.appendChild(t.createElement("div")),a=(We.exec(i)||["",""])[1].toLowerCase(),s=Ve[a]||Ve._default,l.innerHTML=s[1]+ae.htmlPrefilter(i)+s[2],c=s[0];c--;)l=l.lastChild;ae.merge(p,l.childNodes),(l=d.firstChild).textContent=""}else p.push(t.createTextNode(i));for(d.textContent="",f=0;i=p[f++];)if(o&&ae.inArray(i,o)>-1)r&&r.push(i);else if(u=ae.contains(i.ownerDocument,i),l=m(d.appendChild(i),"script"),u&&v(l),n)for(c=0;i=l[c++];)je.test(i.type||"")&&n.push(i);return d}function y(){return!0}function C(){return!1}function b(){try{return G.activeElement}catch(e){}}function x(e,t,n,o,r,i){var l,a;if("object"==typeof t){"string"!=typeof n&&(o=o||n,n=void 0);for(a in t)x(e,a,n,o,t[a],i);return e}if(null==o&&null==r?(r=n,o=n=void 0):null==r&&("string"==typeof n?(r=o,o=void 0):(r=o,o=n,n=void 0)),!1===r)r=C;else if(!r)return e;return 1===i&&(l=r,(r=function(e){return ae().off(e),l.apply(this,arguments)}).guid=l.guid||(l.guid=ae.guid++)),e.each(function(){ae.event.add(this,t,r,o,n)})}function R(e,t){return r(e,"table")&&r(11!==t.nodeType?t:t.firstChild,"tr")?ae(">tbody",e)[0]||e:e}function S(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function E(e){var t=Ye.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function k(e,t){var n,o,r,i,l,a,s,u;if(1===t.nodeType){if(Pe.hasData(e)&&(i=Pe.access(e),l=Pe.set(t,i),u=i.events)){delete l.handle,l.events={};for(r in u)for(n=0,o=u[r].length;n<o;n++)ae.event.add(t,r,u[r][n])}De.hasData(e)&&(a=De.access(e),s=ae.extend({},a),De.set(t,s))}}function T(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Me.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function P(e,t,o,r){t=J.apply([],t);var i,l,a,s,u,c,d=0,p=e.length,f=p-1,h=t[0],g=ae.isFunction(h);if(g||p>1&&"string"==typeof h&&!le.checkClone&&Ge.test(h))return e.each(function(n){var i=e.eq(n);g&&(t[0]=h.call(this,n,i.html())),P(i,t,o,r)});if(p&&(i=w(t,e[0].ownerDocument,!1,e,r),l=i.firstChild,1===i.childNodes.length&&(i=l),l||r)){for(a=ae.map(m(i,"script"),S),s=a.length;d<p;d++)u=i,d!==f&&(u=ae.clone(u,!0,!0),s&&ae.merge(a,m(u,"script"))),o.call(e[d],u,d);if(s)for(c=a[a.length-1].ownerDocument,ae.map(a,E),d=0;d<s;d++)u=a[d],je.test(u.type||"")&&!Pe.access(u,"globalEval")&&ae.contains(c,u)&&(u.src?ae._evalUrl&&ae._evalUrl(u.src):n(u.textContent.replace(Qe,""),c))}return e}function D(e,t,n){for(var o,r=t?ae.filter(t,e):e,i=0;null!=(o=r[i]);i++)n||1!==o.nodeType||ae.cleanData(m(o)),o.parentNode&&(n&&ae.contains(o.ownerDocument,o)&&v(m(o,"script")),o.parentNode.removeChild(o));return e}function N(e,t,n){var o,r,i,l,a=e.style;return(n=n||et(e))&&(""!==(l=n.getPropertyValue(t)||n[t])||ae.contains(e.ownerDocument,e)||(l=ae.style(e,t)),!le.pixelMarginRight()&&Ze.test(l)&&Je.test(t)&&(o=a.width,r=a.minWidth,i=a.maxWidth,a.minWidth=a.maxWidth=a.width=l,l=n.width,a.width=o,a.minWidth=r,a.maxWidth=i)),void 0!==l?l+"":l}function A(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function $(e){var t=ae.cssProps[e];return t||(t=ae.cssProps[e]=function(e){if(e in lt)return e;var t=e[0].toUpperCase()+e.slice(1),n=it.length;for(;n--;)if((e=it[n]+t)in lt)return e}(e)||e),t}function H(e,t,n){var o=He.exec(t);return o?Math.max(0,o[2]-(n||0))+(o[3]||"px"):t}function L(e,t,n,o,r){var i,l=0;for(i=n===(o?"border":"content")?4:"width"===t?1:0;i<4;i+=2)"margin"===n&&(l+=ae.css(e,n+Le[i],!0,r)),o?("content"===n&&(l-=ae.css(e,"padding"+Le[i],!0,r)),"margin"!==n&&(l-=ae.css(e,"border"+Le[i]+"Width",!0,r))):(l+=ae.css(e,"padding"+Le[i],!0,r),"padding"!==n&&(l+=ae.css(e,"border"+Le[i]+"Width",!0,r)));return l}function F(e,t,n){var o,r=et(e),i=N(e,t,r),l="border-box"===ae.css(e,"boxSizing",!1,r);return Ze.test(i)?i:(o=l&&(le.boxSizingReliable()||i===e.style[t]),"auto"===i&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)]),(i=parseFloat(i)||0)+L(e,t,n||(l?"border":"content"),o,r)+"px")}function I(e,t,n,o,r){return new I.prototype.init(e,t,n,o,r)}function _(){st&&(!1===G.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(_):e.setTimeout(_,ae.fx.interval),ae.fx.tick())}function M(){return e.setTimeout(function(){at=void 0}),at=ae.now()}function W(e,t){var n,o=0,r={height:e};for(t=t?1:0;o<4;o+=2-t)n=Le[o],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function j(e,t,n){for(var o,r=(V.tweeners[t]||[]).concat(V.tweeners["*"]),i=0,l=r.length;i<l;i++)if(o=r[i].call(n,t,e))return o}function V(e,t,n){var o,r,i=0,l=V.prefilters.length,a=ae.Deferred().always(function(){delete s.elem}),s=function(){if(r)return!1;for(var t=at||M(),n=Math.max(0,u.startTime+u.duration-t),o=n/u.duration||0,i=1-o,l=0,s=u.tweens.length;l<s;l++)u.tweens[l].run(i);return a.notifyWith(e,[u,i,n]),i<1&&s?n:(s||a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:ae.extend({},t),opts:ae.extend(!0,{specialEasing:{},easing:ae.easing._default},n),originalProperties:t,originalOptions:n,startTime:at||M(),duration:n.duration,tweens:[],createTween:function(t,n){var o=ae.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(o),o},stop:function(t){var n=0,o=t?u.tweens.length:0;if(r)return this;for(r=!0;n<o;n++)u.tweens[n].run(1);return t?(a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u,t])):a.rejectWith(e,[u,t]),this}}),c=u.props;for(!function(e,t){var n,o,r,i,l;for(n in e)if(o=ae.camelCase(n),r=t[o],i=e[n],Array.isArray(i)&&(r=i[1],i=e[n]=i[0]),n!==o&&(e[o]=i,delete e[n]),(l=ae.cssHooks[o])&&"expand"in l){i=l.expand(i),delete e[o];for(n in i)n in e||(e[n]=i[n],t[n]=r)}else t[o]=r}(c,u.opts.specialEasing);i<l;i++)if(o=V.prefilters[i].call(u,e,c,u.opts))return ae.isFunction(o.stop)&&(ae._queueHooks(u.elem,u.opts.queue).stop=ae.proxy(o.stop,o)),o;return ae.map(c,j,u),ae.isFunction(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),ae.fx.timer(ae.extend(s,{elem:e,anim:u,queue:u.opts.queue})),u}function B(e){var t=e.match(Re)||[];return t.join(" ")}function q(e){return e.getAttribute&&e.getAttribute("class")||""}function O(e,t,n,o){var r;if(Array.isArray(t))ae.each(t,function(t,r){n||Ct.test(e)?o(e,r):O(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,o)});else if(n||"object"!==ae.type(t))o(e,t);else for(r in t)O(e+"["+r+"]",t[r],n,o)}function z(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var o,r=0,i=t.toLowerCase().match(Re)||[];if(ae.isFunction(n))for(;o=i[r++];)"+"===o[0]?(o=o.slice(1)||"*",(e[o]=e[o]||[]).unshift(n)):(e[o]=e[o]||[]).push(n)}}function X(e,t,n,o){function r(a){var s;return i[a]=!0,ae.each(e[a]||[],function(e,a){var u=a(t,n,o);return"string"!=typeof u||l||i[u]?l?!(s=u):void 0:(t.dataTypes.unshift(u),r(u),!1)}),s}var i={},l=e===At;return r(t.dataTypes[0])||!i["*"]&&r("*")}function U(e,t){var n,o,r=ae.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:o||(o={}))[n]=t[n]);return o&&ae.extend(!0,e,o),e}var K=[],G=e.document,Y=Object.getPrototypeOf,Q=K.slice,J=K.concat,Z=K.push,ee=K.indexOf,te={},ne=te.toString,oe=te.hasOwnProperty,re=oe.toString,ie=re.call(Object),le={},ae=function(e,t){return new ae.fn.init(e,t)},se=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ue=/^-ms-/,ce=/-([a-z])/g,de=function(e,t){return t.toUpperCase()};ae.fn=ae.prototype={jquery:"3.2.1",constructor:ae,length:0,toArray:function(){return Q.call(this)},get:function(e){return null==e?Q.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ae.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ae.each(this,e)},map:function(e){return this.pushStack(ae.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(Q.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:Z,sort:K.sort,splice:K.splice},ae.extend=ae.fn.extend=function(){var e,t,n,o,r,i,l=arguments[0]||{},a=1,s=arguments.length,u=!1;for("boolean"==typeof l&&(u=l,l=arguments[a]||{},a++),"object"==typeof l||ae.isFunction(l)||(l={}),a===s&&(l=this,a--);a<s;a++)if(null!=(e=arguments[a]))for(t in e)n=l[t],o=e[t],l!==o&&(u&&o&&(ae.isPlainObject(o)||(r=Array.isArray(o)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&ae.isPlainObject(n)?n:{},l[t]=ae.extend(u,i,o)):void 0!==o&&(l[t]=o));return l},ae.extend({expando:"jQuery"+("3.2.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ae.type(e)},isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=ae.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==ne.call(e))&&(!(t=Y(e))||"function"==typeof(n=oe.call(t,"constructor")&&t.constructor)&&re.call(n)===ie)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?te[ne.call(e)]||"object":typeof e},globalEval:function(e){n(e)},camelCase:function(e){return e.replace(ue,"ms-").replace(ce,de)},each:function(e,t){var n,r=0;if(o(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(se,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(o(Object(e))?ae.merge(n,"string"==typeof e?[e]:e):Z.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:ee.call(t,e,n)},merge:function(e,t){for(var n=+t.length,o=0,r=e.length;o<n;o++)e[r++]=t[o];return e.length=r,e},grep:function(e,t,n){for(var o=[],r=0,i=e.length,l=!n;r<i;r++)!t(e[r],r)!==l&&o.push(e[r]);return o},map:function(e,t,n){var r,i,l=0,a=[];if(o(e))for(r=e.length;l<r;l++)null!=(i=t(e[l],l,n))&&a.push(i);else for(l in e)null!=(i=t(e[l],l,n))&&a.push(i);return J.apply([],a)},guid:1,proxy:function(e,t){var n,o,r;if("string"==typeof t&&(n=e[t],t=e,e=n),ae.isFunction(e))return o=Q.call(arguments,2),r=function(){return e.apply(t||this,o.concat(Q.call(arguments)))},r.guid=e.guid=e.guid||ae.guid++,r},now:Date.now,support:le}),"function"==typeof Symbol&&(ae.fn[Symbol.iterator]=K[Symbol.iterator]),ae.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){te["[object "+t+"]"]=t.toLowerCase()});var pe=/*!
* Sizzle CSS Selector Engine v2.3.3
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-08-08
*/
function(e){function t(e,t,n,o){var r,i,l,a,s,u,c,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!o&&((t?t.ownerDocument||t:W)!==A&&N(t),t=t||A,H)){if(11!==h&&(s=ge.exec(e)))if(r=s[1]){if(9===h){if(!(l=t.getElementById(r)))return n;if(l.id===r)return n.push(l),n}else if(p&&(l=p.getElementById(r))&&_(t,l)&&l.id===r)return n.push(l),n}else{if(s[2])return Y.apply(n,t.getElementsByTagName(e)),n;if((r=s[3])&&C.getElementsByClassName&&t.getElementsByClassName)return Y.apply(n,t.getElementsByClassName(r)),n}if(C.qsa&&!O[e+" "]&&(!L||!L.test(e))){if(1!==h)p=t,c=e;else if("object"!==t.nodeName.toLowerCase()){for((a=t.getAttribute("id"))?a=a.replace(ye,Ce):t.setAttribute("id",a=M),u=S(e),i=u.length;i--;)u[i]="#"+a+" "+f(u[i]);c=u.join(","),p=me.test(e)&&d(t.parentNode)||t}if(c)try{return Y.apply(n,p.querySelectorAll(c)),n}catch(e){}finally{a===M&&t.removeAttribute("id")}}}return k(e.replace(ie,"$1"),t,n,o)}function n(){function e(n,o){return t.push(n+" ")>b.cacheLength&&delete e[t.shift()],e[n+" "]=o}var t=[];return e}function o(e){return e[M]=!0,e}function r(e){var t=A.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split("|"),o=n.length;o--;)b.attrHandle[n[o]]=t}function l(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function s(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&xe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function c(e){return o(function(t){return t=+t,o(function(n,o){for(var r,i=e([],n.length,t),l=i.length;l--;)n[r=i[l]]&&(n[r]=!(o[r]=n[r]))})})}function d(e){return e&&void 0!==e.getElementsByTagName&&e}function p(){}function f(e){for(var t=0,n=e.length,o="";t<n;t++)o+=e[t].value;return o}function h(e,t,n){var o=t.dir,r=t.next,i=r||o,l=n&&"parentNode"===i,a=V++;return t.first?function(t,n,r){for(;t=t[o];)if(1===t.nodeType||l)return e(t,n,r);return!1}:function(t,n,s){var u,c,d,p=[j,a];if(s){for(;t=t[o];)if((1===t.nodeType||l)&&e(t,n,s))return!0}else for(;t=t[o];)if(1===t.nodeType||l)if(d=t[M]||(t[M]={}),c=d[t.uniqueID]||(d[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[o]||t;else{if((u=c[i])&&u[0]===j&&u[1]===a)return p[2]=u[2];if(c[i]=p,p[2]=e(t,n,s))return!0}return!1}}function g(e){return e.length>1?function(t,n,o){for(var r=e.length;r--;)if(!e[r](t,n,o))return!1;return!0}:e[0]}function m(e,t,n,o,r){for(var i,l=[],a=0,s=e.length,u=null!=t;a<s;a++)(i=e[a])&&(n&&!n(i,o,r)||(l.push(i),u&&t.push(a)));return l}function v(e,n,r,i,l,a){return i&&!i[M]&&(i=v(i)),l&&!l[M]&&(l=v(l,a)),o(function(o,a,s,u){var c,d,p,f=[],h=[],g=a.length,v=o||function(e,n,o){for(var r=0,i=n.length;r<i;r++)t(e,n[r],o);return o}(n||"*",s.nodeType?[s]:s,[]),w=!e||!o&&n?v:m(v,f,e,s,u),y=r?l||(o?e:g||i)?[]:a:w;if(r&&r(w,y,s,u),i)for(c=m(y,h),i(c,[],s,u),d=c.length;d--;)(p=c[d])&&(y[h[d]]=!(w[h[d]]=p));if(o){if(l||e){if(l){for(c=[],d=y.length;d--;)(p=y[d])&&c.push(w[d]=p);l(null,y=[],c,u)}for(d=y.length;d--;)(p=y[d])&&(c=l?J(o,p):f[d])>-1&&(o[c]=!(a[c]=p))}}else y=m(y===a?y.splice(g,y.length):y),l?l(null,a,y,u):Y.apply(a,y)})}function w(e){for(var t,n,o,r=e.length,i=b.relative[e[0].type],l=i||b.relative[" "],a=i?1:0,s=h(function(e){return e===t},l,!0),u=h(function(e){return J(t,e)>-1},l,!0),c=[function(e,n,o){var r=!i&&(o||n!==T)||((t=n).nodeType?s(e,n,o):u(e,n,o));return t=null,r}];a<r;a++)if(n=b.relative[e[a].type])c=[h(g(c),n)];else{if((n=b.filter[e[a].type].apply(null,e[a].matches))[M]){for(o=++a;o<r&&!b.relative[e[o].type];o++);return v(a>1&&g(c),a>1&&f(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ie,"$1"),n,a<o&&w(e.slice(a,o)),o<r&&w(e=e.slice(o)),o<r&&f(e))}c.push(n)}return g(c)}var y,C,b,x,R,S,E,k,T,P,D,N,A,$,H,L,F,I,_,M="sizzle"+1*new Date,W=e.document,j=0,V=0,B=n(),q=n(),O=n(),z=function(e,t){return e===t&&(D=!0),0},X={}.hasOwnProperty,U=[],K=U.pop,G=U.push,Y=U.push,Q=U.slice,J=function(e,t){for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},Z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ee="[\\x20\\t\\r\\n\\f]",te="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ne="\\["+ee+"*("+te+")(?:"+ee+"*([*^$|!~]?=)"+ee+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+te+"))|)"+ee+"*\\]",oe=":("+te+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ne+")*)|.*)\\)|)",re=new RegExp(ee+"+","g"),ie=new RegExp("^"+ee+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ee+"+$","g"),le=new RegExp("^"+ee+"*,"+ee+"*"),ae=new RegExp("^"+ee+"*([>+~]|"+ee+")"+ee+"*"),se=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),ue=new RegExp(oe),ce=new RegExp("^"+te+"$"),de={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ne),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,fe=/^h\d$/i,he=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,ve=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),we=function(e,t,n){var o="0x"+t-65536;return o!=o||n?t:o<0?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,1023&o|56320)},ye=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Ce=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},be=function(){N()},xe=h(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{Y.apply(U=Q.call(W.childNodes),W.childNodes),U[W.childNodes.length].nodeType}catch(e){Y={apply:U.length?function(e,t){G.apply(e,Q.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}C=t.support={},R=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},N=t.setDocument=function(e){var t,n,o=e?e.ownerDocument||e:W;return o!==A&&9===o.nodeType&&o.documentElement?(A=o,$=A.documentElement,H=!R(A),W!==A&&(n=A.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",be,!1):n.attachEvent&&n.attachEvent("onunload",be)),C.attributes=r(function(e){return e.className="i",!e.getAttribute("className")}),C.getElementsByTagName=r(function(e){return e.appendChild(A.createComment("")),!e.getElementsByTagName("*").length}),C.getElementsByClassName=he.test(A.getElementsByClassName),C.getById=r(function(e){return $.appendChild(e).id=M,!A.getElementsByName||!A.getElementsByName(M).length}),C.getById?(b.filter.ID=function(e){var t=e.replace(ve,we);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&H){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var t=e.replace(ve,we);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&H){var n,o,r,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(r=t.getElementsByName(e),o=0;i=r[o++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),b.find.TAG=C.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):C.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],r=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[r++];)1===n.nodeType&&o.push(n);return o}return i},b.find.CLASS=C.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&H)return t.getElementsByClassName(e)},F=[],L=[],(C.qsa=he.test(A.querySelectorAll))&&(r(function(e){$.appendChild(e).innerHTML="<a id='"+M+"'></a><select id='"+M+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&L.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||L.push("\\["+ee+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+M+"-]").length||L.push("~="),e.querySelectorAll(":checked").length||L.push(":checked"),e.querySelectorAll("a#"+M+"+*").length||L.push(".#.+[+~]")}),r(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=A.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&L.push("name"+ee+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&L.push(":enabled",":disabled"),$.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&L.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),L.push(",.*:")})),(C.matchesSelector=he.test(I=$.matches||$.webkitMatchesSelector||$.mozMatchesSelector||$.oMatchesSelector||$.msMatchesSelector))&&r(function(e){C.disconnectedMatch=I.call(e,"*"),I.call(e,"[s!='']:x"),F.push("!=",oe)}),L=L.length&&new RegExp(L.join("|")),F=F.length&&new RegExp(F.join("|")),t=he.test($.compareDocumentPosition),_=t||he.test($.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!C.sortDetached&&t.compareDocumentPosition(e)===n?e===A||e.ownerDocument===W&&_(W,e)?-1:t===A||t.ownerDocument===W&&_(W,t)?1:P?J(P,e)-J(P,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,o=0,r=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!r||!i)return e===A?-1:t===A?1:r?-1:i?1:P?J(P,e)-J(P,t):0;if(r===i)return l(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[o]===s[o];)o++;return o?l(a[o],s[o]):a[o]===W?-1:s[o]===W?1:0},A):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&N(e),n=n.replace(se,"='$1']"),C.matchesSelector&&H&&!O[n+" "]&&(!F||!F.test(n))&&(!L||!L.test(n)))try{var o=I.call(e,n);if(o||C.disconnectedMatch||e.document&&11!==e.document.nodeType)return o}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&N(e),_(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&N(e);var n=b.attrHandle[t.toLowerCase()],o=n&&X.call(b.attrHandle,t.toLowerCase())?n(e,t,!H):void 0;return void 0!==o?o:C.attributes||!H?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},t.escape=function(e){return(e+"").replace(ye,Ce)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],o=0,r=0;if(D=!C.detectDuplicates,P=!C.sortStable&&e.slice(0),e.sort(z),D){for(;t=e[r++];)t===e[r]&&(o=n.push(r));for(;o--;)e.splice(n[o],1)}return P=null,e},x=t.getText=function(e){var t,n="",o=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[o++];)n+=x(t);return n},(b=t.selectors={cacheLength:50,createPseudo:o,match:de,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,we),e[3]=(e[3]||e[4]||e[5]||"").replace(ve,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return de.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ue.test(n)&&(t=S(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=B[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&B(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,o){return function(r){var i=t.attr(r,e);return null==i?"!="===n:!n||(i+="","="===n?i===o:"!="===n?i!==o:"^="===n?o&&0===i.indexOf(o):"*="===n?o&&i.indexOf(o)>-1:"$="===n?o&&i.slice(-o.length)===o:"~="===n?(" "+i.replace(re," ")+" ").indexOf(o)>-1:"|="===n&&(i===o||i.slice(0,o.length+1)===o+"-"))}},CHILD:function(e,t,n,o,r){var i="nth"!==e.slice(0,3),l="last"!==e.slice(-4),a="of-type"===t;return 1===o&&0===r?function(e){return!!e.parentNode}:function(t,n,s){var u,c,d,p,f,h,g=i!==l?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),w=!s&&!a,y=!1;if(m){if(i){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[l?m.firstChild:m.lastChild],l&&w){for(d=(p=m)[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),u=c[e]||[],f=u[0]===j&&u[1],y=f&&u[2],p=f&&m.childNodes[f];p=++f&&p&&p[g]||(y=f=0)||h.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[j,f,y];break}}else if(w&&(d=(p=t)[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),u=c[e]||[],f=u[0]===j&&u[1],y=f),!1===y)for(;(p=++f&&p&&p[g]||(y=f=0)||h.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++y||(w&&(d=p[M]||(p[M]={}),(c=d[p.uniqueID]||(d[p.uniqueID]={}))[e]=[j,y]),p!==t)););return(y-=r)===o||y%o==0&&y/o>=0}}},PSEUDO:function(e,n){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return i[M]?i(n):i.length>1?(r=[e,e,"",n],b.setFilters.hasOwnProperty(e.toLowerCase())?o(function(e,t){for(var o,r=i(e,n),l=r.length;l--;)o=J(e,r[l]),e[o]=!(t[o]=r[l])}):function(e){return i(e,0,r)}):i}},pseudos:{not:o(function(e){var t=[],n=[],r=E(e.replace(ie,"$1"));return r[M]?o(function(e,t,n,o){for(var i,l=r(e,null,o,[]),a=e.length;a--;)(i=l[a])&&(e[a]=!(t[a]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:o(function(e){return function(n){return t(e,n).length>0}}),contains:o(function(e){return e=e.replace(ve,we),function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),lang:o(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ve,we).toLowerCase(),function(t){var n;do{if(n=H?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===$},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:u(!1),disabled:u(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return fe.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[n<0?n+t:n]}),even:c(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var o=n<0?n+t:n;--o>=0;)e.push(o);return e}),gt:c(function(e,t,n){for(var o=n<0?n+t:n;++o<t;)e.push(o);return e})}}).pseudos.nth=b.pseudos.eq;for(y in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[y]=a(y);for(y in{submit:!0,reset:!0})b.pseudos[y]=s(y);return p.prototype=b.filters=b.pseudos,b.setFilters=new p,S=t.tokenize=function(e,n){var o,r,i,l,a,s,u,c=q[e+" "];if(c)return n?0:c.slice(0);for(a=e,s=[],u=b.preFilter;a;){o&&!(r=le.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),o=!1,(r=ae.exec(a))&&(o=r.shift(),i.push({value:o,type:r[0].replace(ie," ")}),a=a.slice(o.length));for(l in b.filter)!(r=de[l].exec(a))||u[l]&&!(r=u[l](r))||(o=r.shift(),i.push({value:o,type:l,matches:r}),a=a.slice(o.length));if(!o)break}return n?a.length:a?t.error(e):q(e,s).slice(0)},E=t.compile=function(e,n){var r,i=[],l=[],a=O[e+" "];if(!a){for(n||(n=S(e)),r=n.length;r--;)(a=w(n[r]))[M]?i.push(a):l.push(a);(a=O(e,function(e,n){var r=n.length>0,i=e.length>0,l=function(o,l,a,s,u){var c,d,p,f=0,h="0",g=o&&[],v=[],w=T,y=o||i&&b.find.TAG("*",u),C=j+=null==w?1:Math.random()||.1,x=y.length;for(u&&(T=l===A||l||u);h!==x&&null!=(c=y[h]);h++){if(i&&c){for(d=0,l||c.ownerDocument===A||(N(c),a=!H);p=e[d++];)if(p(c,l||A,a)){s.push(c);break}u&&(j=C)}r&&((c=!p&&c)&&f--,o&&g.push(c))}if(f+=h,r&&h!==f){for(d=0;p=n[d++];)p(g,v,l,a);if(o){if(f>0)for(;h--;)g[h]||v[h]||(v[h]=K.call(s));v=m(v)}Y.apply(s,v),u&&!o&&v.length>0&&f+n.length>1&&t.uniqueSort(s)}return u&&(j=C,T=w),g};return r?o(l):l}(l,i))).selector=e}return a},k=t.select=function(e,t,n,o){var r,i,l,a,s,u="function"==typeof e&&e,c=!o&&S(e=u.selector||e);if(n=n||[],1===c.length){if((i=c[0]=c[0].slice(0)).length>2&&"ID"===(l=i[0]).type&&9===t.nodeType&&H&&b.relative[i[1].type]){if(!(t=(b.find.ID(l.matches[0].replace(ve,we),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(r=de.needsContext.test(e)?0:i.length;r--&&(l=i[r],!b.relative[a=l.type]);)if((s=b.find[a])&&(o=s(l.matches[0].replace(ve,we),me.test(i[0].type)&&d(t.parentNode)||t))){if(i.splice(r,1),!(e=o.length&&f(i)))return Y.apply(n,o),n;break}}return(u||E(e,c))(o,t,!H,n,!t||me.test(e)&&d(t.parentNode)||t),n},C.sortStable=M.split("").sort(z).join("")===M,C.detectDuplicates=!!D,N(),C.sortDetached=r(function(e){return 1&e.compareDocumentPosition(A.createElement("fieldset"))}),r(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||i("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),C.attributes&&r(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||i("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),r(function(e){return null==e.getAttribute("disabled")})||i(Z,function(e,t,n){var o;if(!n)return!0===e[t]?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null}),t}(e);ae.find=pe,ae.expr=pe.selectors,ae.expr[":"]=ae.expr.pseudos,ae.uniqueSort=ae.unique=pe.uniqueSort,ae.text=pe.getText,ae.isXMLDoc=pe.isXML,ae.contains=pe.contains,ae.escapeSelector=pe.escape;var fe=function(e,t,n){for(var o=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&ae(e).is(n))break;o.push(e)}return o},he=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},ge=ae.expr.match.needsContext,me=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,ve=/^.[^:#\[\.,]*$/;ae.filter=function(e,t,n){var o=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===o.nodeType?ae.find.matchesSelector(o,e)?[o]:[]:ae.find.matches(e,ae.grep(t,function(e){return 1===e.nodeType}))},ae.fn.extend({find:function(e){var t,n,o=this.length,r=this;if("string"!=typeof e)return this.pushStack(ae(e).filter(function(){for(t=0;t<o;t++)if(ae.contains(r[t],this))return!0}));for(n=this.pushStack([]),t=0;t<o;t++)ae.find(e,r[t],n);return o>1?ae.uniqueSort(n):n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&ge.test(e)?ae(e):e||[],!1).length}});var we,ye=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Ce=ae.fn.init=function(e,t,n){var o,r;if(!e)return this;if(n=n||we,"string"==typeof e){if(!(o="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ye.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof ae?t[0]:t,ae.merge(this,ae.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:G,!0)),me.test(o[1])&&ae.isPlainObject(t))for(o in t)ae.isFunction(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(r=G.getElementById(o[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ae.isFunction(e)?void 0!==n.ready?n.ready(e):e(ae):ae.makeArray(e,this)};Ce.prototype=ae.fn,we=ae(G);var be=/^(?:parents|prev(?:Until|All))/,xe={children:!0,contents:!0,next:!0,prev:!0};ae.fn.extend({has:function(e){var t=ae(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ae.contains(this,t[e]))return!0})},closest:function(e,t){var n,o=0,r=this.length,i=[],l="string"!=typeof e&&ae(e);if(!ge.test(e))for(;o<r;o++)for(n=this[o];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(l?l.index(n)>-1:1===n.nodeType&&ae.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?ae.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?ee.call(ae(e),this[0]):ee.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ae.uniqueSort(ae.merge(this.get(),ae(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ae.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return fe(e,"parentNode")},parentsUntil:function(e,t,n){return fe(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return fe(e,"nextSibling")},prevAll:function(e){return fe(e,"previousSibling")},nextUntil:function(e,t,n){return fe(e,"nextSibling",n)},prevUntil:function(e,t,n){return fe(e,"previousSibling",n)},siblings:function(e){return he((e.parentNode||{}).firstChild,e)},children:function(e){return he(e.firstChild)},contents:function(e){return r(e,"iframe")?e.contentDocument:(r(e,"template")&&(e=e.content||e),ae.merge([],e.childNodes))}},function(e,t){ae.fn[e]=function(n,o){var r=ae.map(this,t,n);return"Until"!==e.slice(-5)&&(o=n),o&&"string"==typeof o&&(r=ae.filter(o,r)),this.length>1&&(xe[e]||ae.uniqueSort(r),be.test(e)&&r.reverse()),this.pushStack(r)}});var Re=/[^\x20\t\r\n\f]+/g;ae.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return ae.each(e.match(Re)||[],function(e,n){t[n]=!0}),t}(e):ae.extend({},e);var t,n,o,r,i=[],l=[],a=-1,s=function(){for(r=r||e.once,o=t=!0;l.length;a=-1)for(n=l.shift();++a<i.length;)!1===i[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=i.length,n=!1);e.memory||(n=!1),t=!1,r&&(i=n?[]:"")},u={add:function(){return i&&(n&&!t&&(a=i.length-1,l.push(n)),function t(n){ae.each(n,function(n,o){ae.isFunction(o)?e.unique&&u.has(o)||i.push(o):o&&o.length&&"string"!==ae.type(o)&&t(o)})}(arguments),n&&!t&&s()),this},remove:function(){return ae.each(arguments,function(e,t){for(var n;(n=ae.inArray(t,i,n))>-1;)i.splice(n,1),n<=a&&a--}),this},has:function(e){return e?ae.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return r=l=[],i=n="",this},disabled:function(){return!i},lock:function(){return r=l=[],n||t||(i=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],l.push(n),t||s()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!o}};return u},ae.extend({Deferred:function(t){var n=[["notify","progress",ae.Callbacks("memory"),ae.Callbacks("memory"),2],["resolve","done",ae.Callbacks("once memory"),ae.Callbacks("once memory"),0,"resolved"],["reject","fail",ae.Callbacks("once memory"),ae.Callbacks("once memory"),1,"rejected"]],o="pending",r={state:function(){return o},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return ae.Deferred(function(t){ae.each(n,function(n,o){var r=ae.isFunction(e[o[4]])&&e[o[4]];i[o[1]](function(){var e=r&&r.apply(this,arguments);e&&ae.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[o[0]+"With"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(t,o,r){function i(t,n,o,r){return function(){var u=this,c=arguments,d=function(){var e,d;if(!(t<l)){if((e=o.apply(u,c))===n.promise())throw new TypeError("Thenable self-resolution");d=e&&("object"==typeof e||"function"==typeof e)&&e.then,ae.isFunction(d)?r?d.call(e,i(l,n,a,r),i(l,n,s,r)):(l++,d.call(e,i(l,n,a,r),i(l,n,s,r),i(l,n,a,n.notifyWith))):(o!==a&&(u=void 0,c=[e]),(r||n.resolveWith)(u,c))}},p=r?d:function(){try{d()}catch(e){ae.Deferred.exceptionHook&&ae.Deferred.exceptionHook(e,p.stackTrace),t+1>=l&&(o!==s&&(u=void 0,c=[e]),n.rejectWith(u,c))}};t?p():(ae.Deferred.getStackHook&&(p.stackTrace=ae.Deferred.getStackHook()),e.setTimeout(p))}}var l=0;return ae.Deferred(function(e){n[0][3].add(i(0,e,ae.isFunction(r)?r:a,e.notifyWith)),n[1][3].add(i(0,e,ae.isFunction(t)?t:a)),n[2][3].add(i(0,e,ae.isFunction(o)?o:s))}).promise()},promise:function(e){return null!=e?ae.extend(e,r):r}},i={};return ae.each(n,function(e,t){var l=t[2],a=t[5];r[t[1]]=l.add,a&&l.add(function(){o=a},n[3-e][2].disable,n[0][2].lock),l.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=l.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,o=Array(n),r=Q.call(arguments),i=ae.Deferred(),l=function(e){return function(n){o[e]=this,r[e]=arguments.length>1?Q.call(arguments):n,--t||i.resolveWith(o,r)}};if(t<=1&&(u(e,i.done(l(n)).resolve,i.reject,!t),"pending"===i.state()||ae.isFunction(r[n]&&r[n].then)))return i.then();for(;n--;)u(r[n],l(n),i.reject);return i.promise()}});var Se=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ae.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Se.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},ae.readyException=function(t){e.setTimeout(function(){throw t})};var Ee=ae.Deferred();ae.fn.ready=function(e){return Ee.then(e).catch(function(e){ae.readyException(e)}),this},ae.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ae.readyWait:ae.isReady)||(ae.isReady=!0,!0!==e&&--ae.readyWait>0||Ee.resolveWith(G,[ae]))}}),ae.ready.then=Ee.then,"complete"===G.readyState||"loading"!==G.readyState&&!G.documentElement.doScroll?e.setTimeout(ae.ready):(G.addEventListener("DOMContentLoaded",c),e.addEventListener("load",c));var ke=function(e,t,n,o,r,i,l){var a=0,s=e.length,u=null==n;if("object"===ae.type(n)){r=!0;for(a in n)ke(e,t,a,n[a],!0,i,l)}else if(void 0!==o&&(r=!0,ae.isFunction(o)||(l=!0),u&&(l?(t.call(e,o),t=null):(u=t,t=function(e,t,n){return u.call(ae(e),n)})),t))for(;a<s;a++)t(e[a],n,l?o:o.call(e[a],a,t(e[a],n)));return r?e:u?t.call(e):s?t(e[0],n):i},Te=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};d.uid=1,d.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Te(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var o,r=this.cache(e);if("string"==typeof t)r[ae.camelCase(t)]=n;else for(o in t)r[ae.camelCase(o)]=t[o];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ae.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,o=e[this.expando];if(void 0!==o){if(void 0!==t){t=Array.isArray(t)?t.map(ae.camelCase):(t=ae.camelCase(t))in o?[t]:t.match(Re)||[],n=t.length;for(;n--;)delete o[t[n]]}(void 0===t||ae.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ae.isEmptyObject(t)}};var Pe=new d,De=new d,Ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ae=/[A-Z]/g;ae.extend({hasData:function(e){return De.hasData(e)||Pe.hasData(e)},data:function(e,t,n){return De.access(e,t,n)},removeData:function(e,t){De.remove(e,t)},_data:function(e,t,n){return Pe.access(e,t,n)},_removeData:function(e,t){Pe.remove(e,t)}}),ae.fn.extend({data:function(e,t){var n,o,r,i=this[0],l=i&&i.attributes;if(void 0===e){if(this.length&&(r=De.get(i),1===i.nodeType&&!Pe.get(i,"hasDataAttrs"))){for(n=l.length;n--;)l[n]&&0===(o=l[n].name).indexOf("data-")&&(o=ae.camelCase(o.slice(5)),p(i,o,r[o]));Pe.set(i,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each(function(){De.set(this,e)}):ke(this,function(t){var n;if(i&&void 0===t){if(void 0!==(n=De.get(i,e)))return n;if(void 0!==(n=p(i,e)))return n}else this.each(function(){De.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){De.remove(this,e)})}}),ae.extend({queue:function(e,t,n){var o;if(e)return t=(t||"fx")+"queue",o=Pe.get(e,t),n&&(!o||Array.isArray(n)?o=Pe.access(e,t,ae.makeArray(n)):o.push(n)),o||[]},dequeue:function(e,t){t=t||"fx";var n=ae.queue(e,t),o=n.length,r=n.shift(),i=ae._queueHooks(e,t),l=function(){ae.dequeue(e,t)};"inprogress"===r&&(r=n.shift(),o--),r&&("fx"===t&&n.unshift("inprogress"),delete i.stop,r.call(e,l,i)),!o&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Pe.get(e,n)||Pe.access(e,n,{empty:ae.Callbacks("once memory").add(function(){Pe.remove(e,[t+"queue",n])})})}}),ae.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?ae.queue(this[0],e):void 0===t?this:this.each(function(){var n=ae.queue(this,e,t);ae._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&ae.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ae.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,o=1,r=ae.Deferred(),i=this,l=this.length,a=function(){--o||r.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";l--;)(n=Pe.get(i[l],e+"queueHooks"))&&n.empty&&(o++,n.empty.add(a));return a(),r.promise(t)}});var $e=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,He=new RegExp("^(?:([+-])=|)("+$e+")([a-z%]*)$","i"),Le=["Top","Right","Bottom","Left"],Fe=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ae.contains(e.ownerDocument,e)&&"none"===ae.css(e,"display")},Ie=function(e,t,n,o){var r,i,l={};for(i in t)l[i]=e.style[i],e.style[i]=t[i];r=n.apply(e,o||[]);for(i in t)e.style[i]=l[i];return r},_e={};ae.fn.extend({show:function(){return g(this,!0)},hide:function(){return g(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Fe(this)?ae(this).show():ae(this).hide()})}});var Me=/^(?:checkbox|radio)$/i,We=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,je=/^$|\/(?:java|ecma)script/i,Ve={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,"",""]};Ve.optgroup=Ve.option,Ve.tbody=Ve.tfoot=Ve.colgroup=Ve.caption=Ve.thead,Ve.th=Ve.td;var Be=/<|&#?\w+;/;!function(){var e=G.createDocumentFragment(),t=e.appendChild(G.createElement("div")),n=G.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),le.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var qe=G.documentElement,Oe=/^key/,ze=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Xe=/^([^.]*)(?:\.(.+)|)/;ae.event={global:{},add:function(e,t,n,o,r){var i,l,a,s,u,c,d,p,f,h,g,m=Pe.get(e);if(m)for(n.handler&&(n=(i=n).handler,r=i.selector),r&&ae.find.matchesSelector(qe,r),n.guid||(n.guid=ae.guid++),(s=m.events)||(s=m.events={}),(l=m.handle)||(l=m.handle=function(t){return void 0!==ae&&ae.event.triggered!==t.type?ae.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Re)||[""],u=t.length;u--;)a=Xe.exec(t[u])||[],f=g=a[1],h=(a[2]||"").split(".").sort(),f&&(d=ae.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=ae.event.special[f]||{},c=ae.extend({type:f,origType:g,data:o,handler:n,guid:n.guid,selector:r,needsContext:r&&ae.expr.match.needsContext.test(r),namespace:h.join(".")},i),(p=s[f])||((p=s[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,o,h,l)||e.addEventListener&&e.addEventListener(f,l)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,c):p.push(c),ae.event.global[f]=!0)},remove:function(e,t,n,o,r){var i,l,a,s,u,c,d,p,f,h,g,m=Pe.hasData(e)&&Pe.get(e);if(m&&(s=m.events)){for(t=(t||"").match(Re)||[""],u=t.length;u--;)if(a=Xe.exec(t[u])||[],f=g=a[1],h=(a[2]||"").split(".").sort(),f){for(d=ae.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,p=s[f]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=i=p.length;i--;)c=p[i],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||o&&o!==c.selector&&("**"!==o||!c.selector)||(p.splice(i,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||ae.removeEvent(e,f,m.handle),delete s[f])}else for(f in s)ae.event.remove(e,f+t[u],n,o,!0);ae.isEmptyObject(s)&&Pe.remove(e,"handle events")}},dispatch:function(e){var t,n,o,r,i,l,a=ae.event.fix(e),s=new Array(arguments.length),u=(Pe.get(this,"events")||{})[a.type]||[],c=ae.event.special[a.type]||{};for(s[0]=a,t=1;t<arguments.length;t++)s[t]=arguments[t];if(a.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,a)){for(l=ae.event.handlers.call(this,a,u),t=0;(r=l[t++])&&!a.isPropagationStopped();)for(a.currentTarget=r.elem,n=0;(i=r.handlers[n++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!a.rnamespace.test(i.namespace)||(a.handleObj=i,a.data=i.data,void 0!==(o=((ae.event.special[i.origType]||{}).handle||i.handler).apply(r.elem,s))&&!1===(a.result=o)&&(a.preventDefault(),a.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,a),a.result}},handlers:function(e,t){var n,o,r,i,l,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(i=[],l={},n=0;n<s;n++)o=t[n],r=o.selector+" ",void 0===l[r]&&(l[r]=o.needsContext?ae(r,this).index(u)>-1:ae.find(r,this,null,[u]).length),l[r]&&i.push(o);i.length&&a.push({elem:u,handlers:i})}return u=this,s<t.length&&a.push({elem:u,handlers:t.slice(s)}),a},addProp:function(e,t){Object.defineProperty(ae.Event.prototype,e,{enumerable:!0,configurable:!0,get:ae.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[ae.expando]?e:new ae.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==b()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===b()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r(this,"input"))return this.click(),!1},_default:function(e){return r(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ae.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ae.Event=function(e,t){if(!(this instanceof ae.Event))return new ae.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?y:C,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ae.extend(this,t),this.timeStamp=e&&e.timeStamp||ae.now(),this[ae.expando]=!0},ae.Event.prototype={constructor:ae.Event,isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=y,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=y,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=y,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ae.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Oe.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&ze.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},ae.event.addProp),ae.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ae.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,o=e.relatedTarget,r=e.handleObj;return o&&(o===this||ae.contains(this,o))||(e.type=r.origType,n=r.handler.apply(this,arguments),e.type=t),n}}}),ae.fn.extend({on:function(e,t,n,o){return x(this,e,t,n,o)},one:function(e,t,n,o){return x(this,e,t,n,o,1)},off:function(e,t,n){var o,r;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,ae(e.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=C),this.each(function(){ae.event.remove(this,e,n,t)})}});var Ue=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ke=/<script|<style|<link/i,Ge=/checked\s*(?:[^=]|=\s*.checked.)/i,Ye=/^true\/(.*)/,Qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;ae.extend({htmlPrefilter:function(e){return e.replace(Ue,"<$1></$2>")},clone:function(e,t,n){var o,r,i,l,a=e.cloneNode(!0),s=ae.contains(e.ownerDocument,e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ae.isXMLDoc(e)))for(l=m(a),i=m(e),o=0,r=i.length;o<r;o++)T(i[o],l[o]);if(t)if(n)for(i=i||m(e),l=l||m(a),o=0,r=i.length;o<r;o++)k(i[o],l[o]);else k(e,a);return(l=m(a,"script")).length>0&&v(l,!s&&m(e,"script")),a},cleanData:function(e){for(var t,n,o,r=ae.event.special,i=0;void 0!==(n=e[i]);i++)if(Te(n)){if(t=n[Pe.expando]){if(t.events)for(o in t.events)r[o]?ae.event.remove(n,o):ae.removeEvent(n,o,t.handle);n[Pe.expando]=void 0}n[De.expando]&&(n[De.expando]=void 0)}}}),ae.fn.extend({detach:function(e){return D(this,e,!0)},remove:function(e){return D(this,e)},text:function(e){return ke(this,function(e){return void 0===e?ae.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return P(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=R(this,e);t.appendChild(e)}})},prepend:function(){return P(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=R(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return P(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return P(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ae.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ae.clone(this,e,t)})},html:function(e){return ke(this,function(e){var t=this[0]||{},n=0,o=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ke.test(e)&&!Ve[(We.exec(e)||["",""])[1].toLowerCase()]){e=ae.htmlPrefilter(e);try{for(;n<o;n++)1===(t=this[n]||{}).nodeType&&(ae.cleanData(m(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return P(this,arguments,function(t){var n=this.parentNode;ae.inArray(this,e)<0&&(ae.cleanData(m(this)),n&&n.replaceChild(t,this))},e)}}),ae.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ae.fn[e]=function(e){for(var n,o=[],r=ae(e),i=r.length-1,l=0;l<=i;l++)n=l===i?this:this.clone(!0),ae(r[l])[t](n),Z.apply(o,n.get());return this.pushStack(o)}});var Je=/^margin/,Ze=new RegExp("^("+$e+")(?!px)[a-z%]+$","i"),et=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)};!function(){function t(){if(a){a.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",qe.appendChild(l);var t=e.getComputedStyle(a);n="1%"!==t.top,i="2px"===t.marginLeft,o="4px"===t.width,a.style.marginRight="50%",r="4px"===t.marginRight,qe.removeChild(l),a=null}}var n,o,r,i,l=G.createElement("div"),a=G.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===a.style.backgroundClip,l.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.appendChild(a),ae.extend(le,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return t(),o},pixelMarginRight:function(){return t(),r},reliableMarginLeft:function(){return t(),i}}))}();var tt=/^(none|table(?!-c[ea]).+)/,nt=/^--/,ot={position:"absolute",visibility:"hidden",display:"block"},rt={letterSpacing:"0",fontWeight:"400"},it=["Webkit","Moz","ms"],lt=G.createElement("div").style;ae.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=N(e,"opacity");return""===n?"1":n}}}},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(e,t,n,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,i,l,a=ae.camelCase(t),s=nt.test(t),u=e.style;if(s||(t=$(a)),l=ae.cssHooks[t]||ae.cssHooks[a],void 0===n)return l&&"get"in l&&void 0!==(r=l.get(e,!1,o))?r:u[t];"string"==(i=typeof n)&&(r=He.exec(n))&&r[1]&&(n=f(e,t,r),i="number"),null!=n&&n==n&&("number"===i&&(n+=r&&r[3]||(ae.cssNumber[a]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),l&&"set"in l&&void 0===(n=l.set(e,n,o))||(s?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,o){var r,i,l,a=ae.camelCase(t),s=nt.test(t);return s||(t=$(a)),(l=ae.cssHooks[t]||ae.cssHooks[a])&&"get"in l&&(r=l.get(e,!0,n)),void 0===r&&(r=N(e,t,o)),"normal"===r&&t in rt&&(r=rt[t]),""===n||n?(i=parseFloat(r),!0===n||isFinite(i)?i||0:r):r}}),ae.each(["height","width"],function(e,t){ae.cssHooks[t]={get:function(e,n,o){if(n)return!tt.test(ae.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?F(e,t,o):Ie(e,ot,function(){return F(e,t,o)})},set:function(e,n,o){var r,i=o&&et(e),l=o&&L(e,t,o,"border-box"===ae.css(e,"boxSizing",!1,i),i);return l&&(r=He.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=ae.css(e,t)),H(e,n,l)}}}),ae.cssHooks.marginLeft=A(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(N(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ae.each({margin:"",padding:"",border:"Width"},function(e,t){ae.cssHooks[e+t]={expand:function(n){for(var o=0,r={},i="string"==typeof n?n.split(" "):[n];o<4;o++)r[e+Le[o]+t]=i[o]||i[o-2]||i[0];return r}},Je.test(e)||(ae.cssHooks[e+t].set=H)}),ae.fn.extend({css:function(e,t){return ke(this,function(e,t,n){var o,r,i={},l=0;if(Array.isArray(t)){for(o=et(e),r=t.length;l<r;l++)i[t[l]]=ae.css(e,t[l],!1,o);return i}return void 0!==n?ae.style(e,t,n):ae.css(e,t)},e,t,arguments.length>1)}}),ae.Tween=I,(I.prototype={constructor:I,init:function(e,t,n,o,r,i){this.elem=e,this.prop=n,this.easing=r||ae.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=i||(ae.cssNumber[n]?"":"px")},cur:function(){var e=I.propHooks[this.prop];return e&&e.get?e.get(this):I.propHooks._default.get(this)},run:function(e){var t,n=I.propHooks[this.prop];return this.options.duration?this.pos=t=ae.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}}).init.prototype=I.prototype,(I.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ae.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ae.fx.step[e.prop]?ae.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[ae.cssProps[e.prop]]&&!ae.cssHooks[e.prop]?e.elem[e.prop]=e.now:ae.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=I.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ae.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ae.fx=I.prototype.init,ae.fx.step={};var at,st,ut=/^(?:toggle|show|hide)$/,ct=/queueHooks$/;ae.Animation=ae.extend(V,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return f(n.elem,e,He.exec(t),n),n}]},tweener:function(e,t){ae.isFunction(e)?(t=e,e=["*"]):e=e.match(Re);for(var n,o=0,r=e.length;o<r;o++)n=e[o],V.tweeners[n]=V.tweeners[n]||[],V.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var o,r,i,l,a,s,u,c,d="width"in t||"height"in t,p=this,f={},h=e.style,m=e.nodeType&&Fe(e),v=Pe.get(e,"fxshow");n.queue||(null==(l=ae._queueHooks(e,"fx")).unqueued&&(l.unqueued=0,a=l.empty.fire,l.empty.fire=function(){l.unqueued||a()}),l.unqueued++,p.always(function(){p.always(function(){l.unqueued--,ae.queue(e,"fx").length||l.empty.fire()})}));for(o in t)if(r=t[o],ut.test(r)){if(delete t[o],i=i||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!v||void 0===v[o])continue;m=!0}f[o]=v&&v[o]||ae.style(e,o)}if(!(s=!ae.isEmptyObject(t))&&ae.isEmptyObject(f))return;d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=v&&v.display)&&(u=Pe.get(e,"display")),"none"===(c=ae.css(e,"display"))&&(u?c=u:(g([e],!0),u=e.style.display||u,c=ae.css(e,"display"),g([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===ae.css(e,"float")&&(s||(p.done(function(){h.display=u}),null==u&&(c=h.display,u="none"===c?"":c)),h.display="inline-block"));n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));s=!1;for(o in f)s||(v?"hidden"in v&&(m=v.hidden):v=Pe.access(e,"fxshow",{display:u}),i&&(v.hidden=!m),m&&g([e],!0),p.done(function(){m||g([e]),Pe.remove(e,"fxshow");for(o in f)ae.style(e,o,f[o])})),s=j(m?v[o]:0,o,p),o in v||(v[o]=s.start,m&&(s.end=s.start,s.start=0))}],prefilter:function(e,t){t?V.prefilters.unshift(e):V.prefilters.push(e)}}),ae.speed=function(e,t,n){var o=e&&"object"==typeof e?ae.extend({},e):{complete:n||!n&&t||ae.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ae.isFunction(t)&&t};return ae.fx.off?o.duration=0:"number"!=typeof o.duration&&(o.duration in ae.fx.speeds?o.duration=ae.fx.speeds[o.duration]:o.duration=ae.fx.speeds._default),null!=o.queue&&!0!==o.queue||(o.queue="fx"),o.old=o.complete,o.complete=function(){ae.isFunction(o.old)&&o.old.call(this),o.queue&&ae.dequeue(this,o.queue)},o},ae.fn.extend({fadeTo:function(e,t,n,o){return this.filter(Fe).css("opacity",0).show().end().animate({opacity:t},e,n,o)},animate:function(e,t,n,o){var r=ae.isEmptyObject(e),i=ae.speed(t,n,o),l=function(){var t=V(this,ae.extend({},e),i);(r||Pe.get(this,"finish"))&&t.stop(!0)};return l.finish=l,r||!1===i.queue?this.each(l):this.queue(i.queue,l)},stop:function(e,t,n){var o=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",i=ae.timers,l=Pe.get(this);if(r)l[r]&&l[r].stop&&o(l[r]);else for(r in l)l[r]&&l[r].stop&&ct.test(r)&&o(l[r]);for(r=i.length;r--;)i[r].elem!==this||null!=e&&i[r].queue!==e||(i[r].anim.stop(n),t=!1,i.splice(r,1));!t&&n||ae.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Pe.get(this),o=n[e+"queue"],r=n[e+"queueHooks"],i=ae.timers,l=o?o.length:0;for(n.finish=!0,ae.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<l;t++)o[t]&&o[t].finish&&o[t].finish.call(this);delete n.finish})}}),ae.each(["toggle","show","hide"],function(e,t){var n=ae.fn[t];ae.fn[t]=function(e,o,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(W(t,!0),e,o,r)}}),ae.each({slideDown:W("show"),slideUp:W("hide"),slideToggle:W("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ae.fn[e]=function(e,n,o){return this.animate(t,e,n,o)}}),ae.timers=[],ae.fx.tick=function(){var e,t=0,n=ae.timers;for(at=ae.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ae.fx.stop(),at=void 0},ae.fx.timer=function(e){ae.timers.push(e),ae.fx.start()},ae.fx.interval=13,ae.fx.start=function(){st||(st=!0,_())},ae.fx.stop=function(){st=null},ae.fx.speeds={slow:600,fast:200,_default:400},ae.fn.delay=function(t,n){return t=ae.fx?ae.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,o){var r=e.setTimeout(n,t);o.stop=function(){e.clearTimeout(r)}})},function(){var e=G.createElement("input"),t=G.createElement("select"),n=t.appendChild(G.createElement("option"));e.type="checkbox",le.checkOn=""!==e.value,le.optSelected=n.selected,(e=G.createElement("input")).value="t",e.type="radio",le.radioValue="t"===e.value}();var dt,pt=ae.expr.attrHandle;ae.fn.extend({attr:function(e,t){return ke(this,ae.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ae.removeAttr(this,e)})}}),ae.extend({attr:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?ae.prop(e,t,n):(1===i&&ae.isXMLDoc(e)||(r=ae.attrHooks[t.toLowerCase()]||(ae.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void ae.removeAttr(e,t):r&&"set"in r&&void 0!==(o=r.set(e,n,t))?o:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(o=r.get(e,t))?o:null==(o=ae.find.attr(e,t))?void 0:o)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&r(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,o=0,r=t&&t.match(Re);if(r&&1===e.nodeType)for(;n=r[o++];)e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?ae.removeAttr(e,n):e.setAttribute(n,n),n}},ae.each(ae.expr.match.bool.source.match(/\w+/g),function(e,t){var n=pt[t]||ae.find.attr;pt[t]=function(e,t,o){var r,i,l=t.toLowerCase();return o||(i=pt[l],pt[l]=r,r=null!=n(e,t,o)?l:null,pt[l]=i),r}});var ft=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;ae.fn.extend({prop:function(e,t){return ke(this,ae.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ae.propFix[e]||e]})}}),ae.extend({prop:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&ae.isXMLDoc(e)||(t=ae.propFix[t]||t,r=ae.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(o=r.set(e,n,t))?o:e[t]=n:r&&"get"in r&&null!==(o=r.get(e,t))?o:e[t]},propHooks:{tabIndex:{get:function(e){var t=ae.find.attr(e,"tabindex");return t?parseInt(t,10):ft.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),le.optSelected||(ae.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ae.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ae.propFix[this.toLowerCase()]=this}),ae.fn.extend({addClass:function(e){var t,n,o,r,i,l,a,s=0;if(ae.isFunction(e))return this.each(function(t){ae(this).addClass(e.call(this,t,q(this)))});if("string"==typeof e&&e)for(t=e.match(Re)||[];n=this[s++];)if(r=q(n),o=1===n.nodeType&&" "+B(r)+" "){for(l=0;i=t[l++];)o.indexOf(" "+i+" ")<0&&(o+=i+" ");a=B(o),r!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,o,r,i,l,a,s=0;if(ae.isFunction(e))return this.each(function(t){ae(this).removeClass(e.call(this,t,q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Re)||[];n=this[s++];)if(r=q(n),o=1===n.nodeType&&" "+B(r)+" "){for(l=0;i=t[l++];)for(;o.indexOf(" "+i+" ")>-1;)o=o.replace(" "+i+" "," ");a=B(o),r!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ae.isFunction(e)?this.each(function(n){ae(this).toggleClass(e.call(this,n,q(this),t),t)}):this.each(function(){var t,o,r,i;if("string"===n)for(o=0,r=ae(this),i=e.match(Re)||[];t=i[o++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==n||((t=q(this))&&Pe.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Pe.get(this,"__className__")||""))})},hasClass:function(e){var t,n,o=0;for(t=" "+e+" ";n=this[o++];)if(1===n.nodeType&&(" "+B(q(n))+" ").indexOf(t)>-1)return!0;return!1}});var gt=/\r/g;ae.fn.extend({val:function(e){var t,n,o,r=this[0];if(arguments.length)return o=ae.isFunction(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=o?e.call(this,n,ae(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=ae.map(r,function(e){return null==e?"":e+""})),(t=ae.valHooks[this.type]||ae.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))});if(r)return(t=ae.valHooks[r.type]||ae.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(gt,""):null==n?"":n}}),ae.extend({valHooks:{option:{get:function(e){var t=ae.find.attr(e,"value");return null!=t?t:B(ae.text(e))}},select:{get:function(e){var t,n,o,i=e.options,l=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?l+1:i.length;for(o=l<0?u:a?l:0;o<u;o++)if(((n=i[o]).selected||o===l)&&!n.disabled&&(!n.parentNode.disabled||!r(n.parentNode,"optgroup"))){if(t=ae(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,o,r=e.options,i=ae.makeArray(t),l=r.length;l--;)((o=r[l]).selected=ae.inArray(ae.valHooks.option.get(o),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),ae.each(["radio","checkbox"],function(){ae.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=ae.inArray(ae(e).val(),t)>-1}},le.checkOn||(ae.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var mt=/^(?:focusinfocus|focusoutblur)$/;ae.extend(ae.event,{trigger:function(t,n,o,r){var i,l,a,s,u,c,d,p=[o||G],f=oe.call(t,"type")?t.type:t,h=oe.call(t,"namespace")?t.namespace.split("."):[];if(l=a=o=o||G,3!==o.nodeType&&8!==o.nodeType&&!mt.test(f+ae.event.triggered)&&(f.indexOf(".")>-1&&(h=f.split("."),f=h.shift(),h.sort()),u=f.indexOf(":")<0&&"on"+f,t=t[ae.expando]?t:new ae.Event(f,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:ae.makeArray(n,[t]),d=ae.event.special[f]||{},r||!d.trigger||!1!==d.trigger.apply(o,n))){if(!r&&!d.noBubble&&!ae.isWindow(o)){for(s=d.delegateType||f,mt.test(s+f)||(l=l.parentNode);l;l=l.parentNode)p.push(l),a=l;a===(o.ownerDocument||G)&&p.push(a.defaultView||a.parentWindow||e)}for(i=0;(l=p[i++])&&!t.isPropagationStopped();)t.type=i>1?s:d.bindType||f,(c=(Pe.get(l,"events")||{})[t.type]&&Pe.get(l,"handle"))&&c.apply(l,n),(c=u&&l[u])&&c.apply&&Te(l)&&(t.result=c.apply(l,n),!1===t.result&&t.preventDefault());return t.type=f,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),n)||!Te(o)||u&&ae.isFunction(o[f])&&!ae.isWindow(o)&&((a=o[u])&&(o[u]=null),ae.event.triggered=f,o[f](),ae.event.triggered=void 0,a&&(o[u]=a)),t.result}},simulate:function(e,t,n){var o=ae.extend(new ae.Event,n,{type:e,isSimulated:!0});ae.event.trigger(o,null,t)}}),ae.fn.extend({trigger:function(e,t){return this.each(function(){ae.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ae.event.trigger(e,t,n,!0)}}),ae.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){ae.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ae.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),le.focusin="onfocusin"in e,le.focusin||ae.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ae.event.simulate(t,e.target,ae.event.fix(e))};ae.event.special[t]={setup:function(){var o=this.ownerDocument||this,r=Pe.access(o,t);r||o.addEventListener(e,n,!0),Pe.access(o,t,(r||0)+1)},teardown:function(){var o=this.ownerDocument||this,r=Pe.access(o,t)-1;r?Pe.access(o,t,r):(o.removeEventListener(e,n,!0),Pe.remove(o,t))}}});var vt=e.location,wt=ae.now(),yt=/\?/;ae.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||ae.error("Invalid XML: "+t),n};var Ct=/\[\]$/,bt=/\r?\n/g,xt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;ae.param=function(e,t){var n,o=[],r=function(e,t){var n=ae.isFunction(t)?t():t;o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!ae.isPlainObject(e))ae.each(e,function(){r(this.name,this.value)});else for(n in e)O(n,e[n],t,r);return o.join("&")},ae.fn.extend({serialize:function(){return ae.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ae.prop(this,"elements");return e?ae.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ae(this).is(":disabled")&&Rt.test(this.nodeName)&&!xt.test(e)&&(this.checked||!Me.test(e))}).map(function(e,t){var n=ae(this).val();return null==n?null:Array.isArray(n)?ae.map(n,function(e){return{name:t.name,value:e.replace(bt,"\r\n")}}):{name:t.name,value:n.replace(bt,"\r\n")}}).get()}});var St=/%20/g,Et=/#.*$/,kt=/([?&])_=[^&]*/,Tt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:GET|HEAD)$/,Dt=/^\/\//,Nt={},At={},$t="*/".concat("*"),Ht=G.createElement("a");Ht.href=vt.href,ae.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:vt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(vt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,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":JSON.parse,"text xml":ae.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?U(U(e,ae.ajaxSettings),t):U(ae.ajaxSettings,e)},ajaxPrefilter:z(Nt),ajaxTransport:z(At),ajax:function(t,n){function o(t,n,o,a){var u,p,f,C,b,x=n;c||(c=!0,s&&e.clearTimeout(s),r=void 0,l=a||"",R.readyState=t>0?4:0,u=t>=200&&t<300||304===t,o&&(C=function(e,t,n){var o,r,i,l,a=e.contents,s=e.dataTypes;for(;"*"===s[0];)s.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader("Content-Type"));if(o)for(r in a)if(a[r]&&a[r].test(o)){s.unshift(r);break}if(s[0]in n)i=s[0];else{for(r in n){if(!s[0]||e.converters[r+" "+s[0]]){i=r;break}l||(l=r)}i=i||l}if(i)return i!==s[0]&&s.unshift(i),n[i]}(h,R,o)),C=function(e,t,n,o){var r,i,l,a,s,u={},c=e.dataTypes.slice();if(c[1])for(l in e.converters)u[l.toLowerCase()]=e.converters[l];i=c.shift();for(;i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!s&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=i,i=c.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(l=u[s+" "+i]||u["* "+i]))for(r in u)if((a=r.split(" "))[1]===i&&(l=u[s+" "+a[0]]||u["* "+a[0]])){!0===l?l=u[r]:!0!==u[r]&&(i=a[0],c.unshift(a[1]));break}if(!0!==l)if(l&&e.throws)t=l(t);else try{t=l(t)}catch(e){return{state:"parsererror",error:l?e:"No conversion from "+s+" to "+i}}}return{state:"success",data:t}}(h,C,R,u),u?(h.ifModified&&((b=R.getResponseHeader("Last-Modified"))&&(ae.lastModified[i]=b),(b=R.getResponseHeader("etag"))&&(ae.etag[i]=b)),204===t||"HEAD"===h.type?x="nocontent":304===t?x="notmodified":(x=C.state,p=C.data,f=C.error,u=!f)):(f=x,!t&&x||(x="error",t<0&&(t=0))),R.status=t,R.statusText=(n||x)+"",u?v.resolveWith(g,[p,x,R]):v.rejectWith(g,[R,x,f]),R.statusCode(y),y=void 0,d&&m.trigger(u?"ajaxSuccess":"ajaxError",[R,h,u?p:f]),w.fireWith(g,[R,x]),d&&(m.trigger("ajaxComplete",[R,h]),--ae.active||ae.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,l,a,s,u,c,d,p,f,h=ae.ajaxSetup({},n),g=h.context||h,m=h.context&&(g.nodeType||g.jquery)?ae(g):ae.event,v=ae.Deferred(),w=ae.Callbacks("once memory"),y=h.statusCode||{},C={},b={},x="canceled",R={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Tt.exec(l);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?l:null},setRequestHeader:function(e,t){return null==c&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,C[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)R.always(e[R.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||x;return r&&r.abort(t),o(0,t),this}};if(v.promise(R),h.url=((t||h.url||vt.href)+"").replace(Dt,vt.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Re)||[""],null==h.crossDomain){u=G.createElement("a");try{u.href=h.url,u.href=u.href,h.crossDomain=Ht.protocol+"//"+Ht.host!=u.protocol+"//"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ae.param(h.data,h.traditional)),X(Nt,h,n,R),c)return R;(d=ae.event&&h.global)&&0==ae.active++&&ae.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Pt.test(h.type),i=h.url.replace(Et,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(St,"+")):(f=h.url.slice(i.length),h.data&&(i+=(yt.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(kt,"$1"),f=(yt.test(i)?"&":"?")+"_="+wt+++f),h.url=i+f),h.ifModified&&(ae.lastModified[i]&&R.setRequestHeader("If-Modified-Since",ae.lastModified[i]),ae.etag[i]&&R.setRequestHeader("If-None-Match",ae.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&R.setRequestHeader("Content-Type",h.contentType),R.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)R.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,R,h)||c))return R.abort();if(x="abort",w.add(h.complete),R.done(h.success),R.fail(h.error),r=X(At,h,n,R)){if(R.readyState=1,d&&m.trigger("ajaxSend",[R,h]),c)return R;h.async&&h.timeout>0&&(s=e.setTimeout(function(){R.abort("timeout")},h.timeout));try{c=!1,r.send(C,o)}catch(e){if(c)throw e;o(-1,e)}}else o(-1,"No Transport");return R},getJSON:function(e,t,n){return ae.get(e,t,n,"json")},getScript:function(e,t){return ae.get(e,void 0,t,"script")}}),ae.each(["get","post"],function(e,t){ae[t]=function(e,n,o,r){return ae.isFunction(n)&&(r=r||o,o=n,n=void 0),ae.ajax(ae.extend({url:e,type:t,dataType:r,data:n,success:o},ae.isPlainObject(e)&&e))}}),ae._evalUrl=function(e){return ae.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},ae.fn.extend({wrapAll:function(e){var t;return this[0]&&(ae.isFunction(e)&&(e=e.call(this[0])),t=ae(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ae.isFunction(e)?this.each(function(t){ae(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ae(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ae.isFunction(e);return this.each(function(n){ae(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ae(this).replaceWith(this.childNodes)}),this}}),ae.expr.pseudos.hidden=function(e){return!ae.expr.pseudos.visible(e)},ae.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ae.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Lt={0:200,1223:204},Ft=ae.ajaxSettings.xhr();le.cors=!!Ft&&"withCredentials"in Ft,le.ajax=Ft=!!Ft,ae.ajaxTransport(function(t){var n,o;if(le.cors||Ft&&!t.crossDomain)return{send:function(r,i){var l,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(l in t.xhrFields)a[l]=t.xhrFields[l];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(l in r)a.setRequestHeader(l,r[l]);n=function(e){return function(){n&&(n=o=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(Lt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),o=a.onerror=n("error"),void 0!==a.onabort?a.onabort=o:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&o()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),ae.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ae.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ae.globalEval(e),e}}}),ae.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ae.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(o,r){t=ae("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),G.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],_t=/(=)\?(?=&|$)|\?\?/;ae.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||ae.expando+"_"+wt++;return this[e]=!0,e}}),ae.ajaxPrefilter("json jsonp",function(t,n,o){var r,i,l,a=!1!==t.jsonp&&(_t.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&_t.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=ae.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(_t,"$1"+r):!1!==t.jsonp&&(t.url+=(yt.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return l||ae.error(r+" was not called"),l[0]},t.dataTypes[0]="json",i=e[r],e[r]=function(){l=arguments},o.always(function(){void 0===i?ae(e).removeProp(r):e[r]=i,t[r]&&(t.jsonpCallback=n.jsonpCallback,It.push(r)),l&&ae.isFunction(i)&&i(l[0]),l=i=void 0}),"script"}),le.createHTMLDocument=function(){var e=G.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),ae.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var o,r,i;return t||(le.createHTMLDocument?(t=G.implementation.createHTMLDocument(""),(o=t.createElement("base")).href=G.location.href,t.head.appendChild(o)):t=G),r=me.exec(e),i=!n&&[],r?[t.createElement(r[1])]:(r=w([e],t,i),i&&i.length&&ae(i).remove(),ae.merge([],r.childNodes))},ae.fn.load=function(e,t,n){var o,r,i,l=this,a=e.indexOf(" ");return a>-1&&(o=B(e.slice(a)),e=e.slice(0,a)),ae.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),l.length>0&&ae.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){i=arguments,l.html(o?ae("<div>").append(ae.parseHTML(e)).find(o):e)}).always(n&&function(e,t){l.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},ae.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ae.fn[t]=function(e){return this.on(t,e)}}),ae.expr.pseudos.animated=function(e){return ae.grep(ae.timers,function(t){return e===t.elem}).length},ae.offset={setOffset:function(e,t,n){var o,r,i,l,a,s,u=ae.css(e,"position"),c=ae(e),d={};"static"===u&&(e.style.position="relative"),a=c.offset(),i=ae.css(e,"top"),s=ae.css(e,"left"),("absolute"===u||"fixed"===u)&&(i+s).indexOf("auto")>-1?(o=c.position(),l=o.top,r=o.left):(l=parseFloat(i)||0,r=parseFloat(s)||0),ae.isFunction(t)&&(t=t.call(e,n,ae.extend({},a))),null!=t.top&&(d.top=t.top-a.top+l),null!=t.left&&(d.left=t.left-a.left+r),"using"in t?t.using.call(e,d):c.css(d)}},ae.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ae.offset.setOffset(this,e,t)});var t,n,o,r,i=this[0];if(i)return i.getClientRects().length?(o=i.getBoundingClientRect(),t=i.ownerDocument,n=t.documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],o={top:0,left:0};return"fixed"===ae.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),r(e[0],"html")||(o=e.offset()),o={top:o.top+ae.css(e[0],"borderTopWidth",!0),left:o.left+ae.css(e[0],"borderLeftWidth",!0)}),{top:t.top-o.top-ae.css(n,"marginTop",!0),left:t.left-o.left-ae.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===ae.css(e,"position");)e=e.offsetParent;return e||qe})}}),ae.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;ae.fn[e]=function(o){return ke(this,function(e,o,r){var i;if(ae.isWindow(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===r)return i?i[t]:e[o];i?i.scrollTo(n?i.pageXOffset:r,n?r:i.pageYOffset):e[o]=r},e,o,arguments.length)}}),ae.each(["top","left"],function(e,t){ae.cssHooks[t]=A(le.pixelPosition,function(e,n){if(n)return n=N(e,t),Ze.test(n)?ae(e).position()[t]+"px":n})}),ae.each({Height:"height",Width:"width"},function(e,t){ae.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,o){ae.fn[o]=function(r,i){var l=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return ke(this,function(t,n,r){var i;return ae.isWindow(t)?0===o.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?ae.css(t,n,a):ae.style(t,n,r,a)},t,l?r:void 0,l)}})}),ae.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,o){return this.on(t,e,n,o)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),ae.holdReady=function(e){e?ae.readyWait++:ae.ready(!0)},ae.isArray=Array.isArray,ae.parseJSON=JSON.parse,ae.nodeName=r,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ae});var Mt=e.jQuery,Wt=e.$;return ae.noConflict=function(t){return e.$===ae&&(e.$=Wt),t&&e.jQuery===ae&&(e.jQuery=Mt),ae},t||(e.jQuery=e.$=ae),ae})},414:/*!
* jquery.event.drag - v 2.3.0
* Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
* Open Source MIT License - http://threedubmedia.com/code/license
*/
function(e,t,n){var o=e(420);o.fn.drag=function(e,t,n){var r="string"==typeof e?e:"",i=o.isFunction(e)?e:o.isFunction(t)?t:null;return 0!==r.indexOf("drag")&&(r="drag"+r),n=(e==i?t:n)||{},i?this.on(r,n,i):this.trigger(r)};var r=o.event,i=r.special,l=i.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:!1,drop:!0,click:!1},datakey:"dragdata",noBubble:!0,add:function(e){var t=o.data(this,l.datakey),n=e.data||{};t.related+=1,o.each(l.defaults,function(e,o){void 0!==n[e]&&(t[e]=n[e])})},remove:function(){o.data(this,l.datakey).related-=1},setup:function(){if(!o.data(this,l.datakey)){var e=o.extend({related:0},l.defaults);o.data(this,l.datakey,e),r.add(this,"touchstart mousedown",l.init,e),this.attachEvent&&this.attachEvent("ondragstart",l.dontstart)}},teardown:function(){var e=o.data(this,l.datakey)||{};e.related||(o.removeData(this,l.datakey),r.remove(this,"touchstart mousedown",l.init),l.textselect(!0),this.detachEvent&&this.detachEvent("ondragstart",l.dontstart))},init:function(e){if(!l.touched){var t,n=e.data;if(!(0!=e.which&&n.which>0&&e.which!=n.which)&&!o(e.target).is(n.not)&&(!n.handle||o(e.target).closest(n.handle,e.currentTarget).length)&&(l.touched="touchstart"==e.type?this:null,n.propagates=1,n.mousedown=this,n.interactions=[l.interaction(this,n)],n.target=e.target,n.pageX=e.pageX,n.pageY=e.pageY,n.dragging=null,t=l.hijack(e,"draginit",n),n.propagates))return(t=l.flatten(t))&&t.length&&(n.interactions=[],o.each(t,function(){n.interactions.push(l.interaction(this,n))})),n.propagates=n.interactions.length,!1!==n.drop&&i.drop&&i.drop.handler(e,n),l.textselect(!1),l.touched?r.add(l.touched,"touchmove touchend",l.handler,n):r.add(document,"mousemove mouseup",l.handler,n),!(!l.touched||n.live)&&void 0}},interaction:function(e,t){var n=e&&e.ownerDocument?o(e)[t.relative?"position":"offset"]()||{top:0,left:0}:{top:0,left:0};return{drag:e,callback:new l.callback,droppable:[],offset:n}},handler:function(e){var t=e.data;switch(e.type){case!t.dragging&&"touchmove":e.preventDefault();case!t.dragging&&"mousemove":if(Math.pow(e.pageX-t.pageX,2)+Math.pow(e.pageY-t.pageY,2)<Math.pow(t.distance,2))break;e.target=t.target,l.hijack(e,"dragstart",t),t.propagates&&(t.dragging=!0);case"touchmove":e.preventDefault();case"mousemove":if(t.dragging){if(l.hijack(e,"drag",t),t.propagates){!1!==t.drop&&i.drop&&i.drop.handler(e,t);break}e.type="mouseup"}case"touchend":case"mouseup":default:l.touched?r.remove(l.touched,"touchmove touchend",l.handler):r.remove(document,"mousemove mouseup",l.handler),t.dragging&&(!1!==t.drop&&i.drop&&i.drop.handler(e,t),l.hijack(e,"dragend",t)),l.textselect(!0),!1===t.click&&t.dragging&&o.data(t.mousedown,"suppress.click",(new Date).getTime()+5),t.dragging=l.touched=!1}},hijack:function(e,t,n,i,a){if(n){var s,u,c,d={event:e.originalEvent,type:e.type},p=t.indexOf("drop")?"drag":"drop",f=i||0,h=isNaN(i)?n.interactions.length:i;e.type=t;var g=function(){};e.originalEvent=new o.Event(d.event,{preventDefault:g,stopPropagation:g,stopImmediatePropagation:g}),n.results=[];do{if(u=n.interactions[f]){if("dragend"!==t&&u.cancelled)continue;c=l.properties(e,n,u),u.results=[],o(a||u[p]||n.droppable).each(function(i,a){if(c.target=a,e.isPropagationStopped=function(){return!1},!1===(s=a?r.dispatch.call(a,e,c):null)?("drag"==p&&(u.cancelled=!0,n.propagates-=1),"drop"==t&&(u[p][i]=null)):"dropinit"==t&&u.droppable.push(l.element(s)||a),"dragstart"==t&&(u.proxy=o(l.element(s)||u.drag)[0]),u.results.push(s),delete e.result,"dropinit"!==t)return s}),n.results[f]=l.flatten(u.results),"dropinit"==t&&(u.droppable=l.flatten(u.droppable)),"dragstart"!=t||u.cancelled||c.update()}}while(++f<h);return e.type=d.type,e.originalEvent=d.event,l.flatten(n.results)}},properties:function(e,t,n){var o=n.callback;return o.drag=n.drag,o.proxy=n.proxy||n.drag,o.startX=t.pageX,o.startY=t.pageY,o.deltaX=e.pageX-t.pageX,o.deltaY=e.pageY-t.pageY,o.originalX=n.offset.left,o.originalY=n.offset.top,o.offsetX=o.originalX+o.deltaX,o.offsetY=o.originalY+o.deltaY,o.drop=l.flatten((n.drop||[]).slice()),o.available=l.flatten((n.droppable||[]).slice()),o},element:function(e){if(e&&(e.jquery||1==e.nodeType))return e},flatten:function(e){return o.map(e,function(e){return e&&e.jquery?o.makeArray(e):e&&e.length?l.flatten(e):e})},textselect:function(e){o(document)[e?"off":"on"]("selectstart",l.dontstart).css("MozUserSelect",e?"":"none"),document.unselectable=e?"off":"on"},dontstart:function(){return!1},callback:function(){}};l.callback.prototype={update:function(){i.drop&&this.available.length&&o.each(this.available,function(e){i.drop.locate(this,e)})}};var a=r.dispatch;r.dispatch=function(e){if(!(o.data(this,"suppress."+e.type)-(new Date).getTime()>0))return a.apply(this,arguments);o.removeData(this,"suppress."+e.type)},i.draginit=i.dragstart=i.dragend=l},415:/*!
* jquery.event.drop - v 2.3.0
* Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
* Open Source MIT License - http://threedubmedia.com/code/license
*/
function(e,t,n){var o=e(420);o.fn.drop=function(e,t,n){var r="string"==typeof e?e:"",i=o.isFunction(e)?e:o.isFunction(t)?t:null;return 0!==r.indexOf("drop")&&(r="drop"+r),n=(e==i?t:n)||{},i?this.on(r,n,i):this.trigger(r)},o.drop=function(e){e=e||{},l.multi=!0===e.multi?1/0:!1===e.multi?1:isNaN(e.multi)?l.multi:e.multi,l.delay=e.delay||l.delay,l.tolerance=o.isFunction(e.tolerance)?e.tolerance:null===e.tolerance?null:l.tolerance,l.mode=e.mode||l.mode||"intersect"};var r=o.event,i=r.special,l=o.event.special.drop={multi:1,delay:20,mode:"overlap",targets:[],datakey:"dropdata",noBubble:!0,add:function(e){var t=o.data(this,l.datakey);t.related+=1},remove:function(){o.data(this,l.datakey).related-=1},setup:function(){if(!o.data(this,l.datakey)){o.data(this,l.datakey,{related:0,active:[],anyactive:0,winner:0,location:{}}),l.targets.push(this)}},teardown:function(){var e=o.data(this,l.datakey)||{};if(!e.related){o.removeData(this,l.datakey);var t=this;l.targets=o.grep(l.targets,function(e){return e!==t})}},handler:function(e,t){var n;if(t)switch(e.type){case"mousedown":case"touchstart":n=o(l.targets),"string"==typeof t.drop&&(n=n.filter(t.drop)),n.each(function(){var e=o.data(this,l.datakey);e.active=[],e.anyactive=0,e.winner=0}),t.droppable=n,i.drag.hijack(e,"dropinit",t);break;case"mousemove":case"touchmove":l.event=e,l.timer||l.tolerate(t);break;case"mouseup":case"touchend":l.timer=clearTimeout(l.timer),t.propagates&&(i.drag.hijack(e,"drop",t),i.drag.hijack(e,"dropend",t))}},locate:function(e,t){var n=o.data(e,l.datakey),r=o(e),i=r.offset()||{},a=r.outerHeight(),s=r.outerWidth(),u={elem:e,width:s,height:a,top:i.top,left:i.left,right:i.left+s,bottom:i.top+a};return n&&(n.location=u,n.index=t,n.elem=e),u},contains:function(e,t){return(t[0]||t.left)>=e.left&&(t[0]||t.right)<=e.right&&(t[1]||t.top)>=e.top&&(t[1]||t.bottom)<=e.bottom},modes:{intersect:function(e,t,n){return this.contains(n,[e.pageX,e.pageY])?1e9:this.modes.overlap.apply(this,arguments)},overlap:function(e,t,n){return Math.max(0,Math.min(n.bottom,t.bottom)-Math.max(n.top,t.top))*Math.max(0,Math.min(n.right,t.right)-Math.max(n.left,t.left))},fit:function(e,t,n){return this.contains(n,t)?1:0},middle:function(e,t,n){return this.contains(n,[t.left+.5*t.width,t.top+.5*t.height])?1:0}},sort:function(e,t){return t.winner-e.winner||e.index-t.index},tolerate:function(e){var t,n,r,a,s,u,c,d,p=0,f=e.interactions.length,h=[l.event.pageX,l.event.pageY],g=l.tolerance||l.modes[l.mode];do{if(d=e.interactions[p]){if(!d)return;d.drop=[],s=[],u=d.droppable.length,g&&(r=l.locate(d.proxy)),t=0;do{if(c=d.droppable[t]){if(a=o.data(c,l.datakey),!(n=a.location))continue;a.winner=g?g.call(l,l.event,r,n):l.contains(n,h)?1:0,s.push(a)}}while(++t<u);s.sort(l.sort),t=0;do{(a=s[t])&&(a.winner&&d.drop.length<l.multi?(a.active[p]||a.anyactive||(!1!==i.drag.hijack(l.event,"dropstart",e,p,a.elem)[0]?(a.active[p]=1,a.anyactive+=1):a.winner=0),a.winner&&d.drop.push(a.elem)):a.active[p]&&1==a.anyactive&&(i.drag.hijack(l.event,"dropend",e,p,a.elem),a.active[p]=0,a.anyactive-=1))}while(++t<u)}}while(++p<f);l.last&&h[0]==l.last.pageX&&h[1]==l.last.pageY?delete l.timer:l.timer=setTimeout(function(){l.tolerate(e)},l.delay),l.last=l.event}};i.dropinit=i.dropstart=i.dropend=l},416:function(e,t,n){var o=e(420),r=e(418);t.exports={CheckboxSelectColumn:function(e){function t(e,t){var n,o,r=u.getSelectedRows(),i={};for(o=0;o<r.length;o++)n=r[o],i[n]=!0,i[n]!==d[n]&&(u.invalidateRow(n),delete d[n]);for(o in d)u.invalidateRow(o);d=i,u.render(),r.length&&r.length==u.getDataLength()?u.updateColumnHeader(p.columnId,"<input type='checkbox' checked='checked'>",p.toolTip):u.updateColumnHeader(p.columnId,"<input type='checkbox'>",p.toolTip)}function n(e,t){32==e.which&&u.getColumns()[t.cell].id===p.columnId&&(u.getEditorLock().isActive()&&!u.getEditorLock().commitCurrentEdit()||l(t.row),e.preventDefault(),e.stopImmediatePropagation())}function i(e,t){if(u.getColumns()[t.cell].id===p.columnId&&o(e.target).is(":checkbox")){if(u.getEditorLock().isActive()&&!u.getEditorLock().commitCurrentEdit())return e.preventDefault(),void e.stopImmediatePropagation();l(t.row),e.stopPropagation(),e.stopImmediatePropagation()}}function l(e){d[e]?u.setSelectedRows(o.grep(u.getSelectedRows(),function(t){return t!=e})):u.setSelectedRows(u.getSelectedRows().concat(e))}function a(e,t){if(t.column.id==p.columnId&&o(e.target).is(":checkbox")){if(u.getEditorLock().isActive()&&!u.getEditorLock().commitCurrentEdit())return e.preventDefault(),void e.stopImmediatePropagation();if(o(e.target).is(":checked")){for(var n=[],r=0;r<u.getDataLength();r++)n.push(r);u.setSelectedRows(n)}else u.setSelectedRows([]);e.stopPropagation(),e.stopImmediatePropagation()}}function s(e,t,n,o,r){return r?d[e]?"<input type='checkbox' checked='checked'>":"<input type='checkbox'>":null}var u,c=new r.EventHandler,d={},p=o.extend(!0,{},{columnId:"_checkbox_selector",cssClass:null,toolTip:"Select/Deselect All",width:30},e);o.extend(this,{init:function(e){u=e,c.subscribe(u.onSelectedRowsChanged,t).subscribe(u.onClick,i).subscribe(u.onHeaderClick,a).subscribe(u.onKeyDown,n)},destroy:function(){c.unsubscribeAll()},deSelectRows:function(e){var t,n=e.length,r=[];for(t=0;t<n;t++)d[e[t]]&&(r[r.length]=e[t]);u.setSelectedRows(o.grep(u.getSelectedRows(),function(e){return r.indexOf(e)<0}))},selectRows:function(e){var t,n=e.length,o=[];for(t=0;t<n;t++)d[e[t]]||(o[o.length]=e[t]);u.setSelectedRows(u.getSelectedRows().concat(o))},getColumnDefinition:function(){return{id:p.columnId,name:"<input type='checkbox'>",toolTip:p.toolTip,field:"sel",width:p.width,resizable:!1,sortable:!1,cssClass:p.cssClass,formatter:s}}})}}},417:function(e,t,n){var o=e(420),r=e(418);t.exports={RowSelectionModel:function(e){function t(e){return function(){p||(p=!0,e.apply(this,arguments),p=!1)}}function n(e){for(var t=[],n=0;n<e.length;n++)for(var o=e[n].fromRow;o<=e[n].toRow;o++)t.push(o);return t}function i(e){for(var t=[],n=d.getColumns().length-1,o=0;o<e.length;o++)t.push(new r.Range(e[o],0,e[o],n));return t}function l(){return n(h)}function a(e){(h&&0!==h.length||e&&0!==e.length)&&(h=e,g.onSelectedRangesChanged.notify(h))}function s(e,t){f.selectActiveRow&&null!=t.row&&a([new r.Range(t.row,0,t.row,d.getColumns().length-1)])}function u(e){var t=d.getActiveCell();if(t&&e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(38==e.which||40==e.which)){var n=l();n.sort(function(e,t){return e-t}),n.length||(n=[t.row]);var o,r=n[0],s=n[n.length-1];if((o=40==e.which?t.row<s||r==s?++s:++r:t.row<s?--s:--r)>=0&&o<d.getDataLength()){d.scrollRowIntoView(o);var u=i(function(e,t){var n,o=[];for(n=e;n<=t;n++)o.push(n);for(n=t;n<e;n++)o.push(n);return o}(r,s));a(u)}e.preventDefault(),e.stopPropagation()}}function c(e){var t=d.getCellFromEvent(e);if(!t||!d.canCellBeActive(t.row,t.cell))return!1;if(!d.getOptions().multiSelect||!e.ctrlKey&&!e.shiftKey&&!e.metaKey)return!1;var r=n(h),l=o.inArray(t.row,r);if(-1===l&&(e.ctrlKey||e.metaKey))r.push(t.row),d.setActiveCell(t.row,t.cell);else if(-1!==l&&(e.ctrlKey||e.metaKey))r=o.grep(r,function(e,n){return e!==t.row}),d.setActiveCell(t.row,t.cell);else if(r.length&&e.shiftKey){var s=r.pop(),u=Math.min(t.row,s),c=Math.max(t.row,s);r=[];for(var p=u;p<=c;p++)p!==s&&r.push(p);r.push(s),d.setActiveCell(t.row,t.cell)}var f=i(r);return a(f),e.stopImmediatePropagation(),!0}var d,p,f,h=[],g=this,m=new r.EventHandler,v={selectActiveRow:!0};o.extend(this,{getSelectedRows:l,setSelectedRows:function(e){a(i(e))},getSelectedRanges:function(){return h},setSelectedRanges:a,init:function(n){f=o.extend(!0,{},v,e),d=n,m.subscribe(d.onActiveCellChanged,t(s)),m.subscribe(d.onKeyDown,t(u)),m.subscribe(d.onClick,t(c))},destroy:function(){m.unsubscribeAll()},onSelectedRangesChanged:new r.Event})}}},418:function(e,t,n){function o(){var e=!1,t=!1;this.stopPropagation=function(){e=!0},this.isPropagationStopped=function(){return e},this.stopImmediatePropagation=function(){t=!0},this.isImmediatePropagationStopped=function(){return t}}function r(){this.__nonDataRow=!0}function i(){this.__group=!0,this.level=0,this.count=0,this.value=null,this.title=null,this.collapsed=!1,this.selectChecked=!1,this.totals=null,this.rows=[],this.groups=null,this.groupingKey=null}function l(){this.__groupTotals=!0,this.group=null,this.initialized=!1}function a(){var e=null;this.isActive=function(t){return t?e===t:null!==e},this.activate=function(t){if(t!==e){if(null!==e)throw new Error("SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController");if(!t.commitCurrentEdit)throw new Error("SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()");if(!t.cancelCurrentEdit)throw new Error("SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()");e=t}},this.deactivate=function(t){if(e!==t)throw new Error("SlickGrid.EditorLock.deactivate: specified editController is not the currently active one");e=null},this.commitCurrentEdit=function(){return!e||e.commitCurrentEdit()},this.cancelCurrentEdit=function(){return!e||e.cancelCurrentEdit()}}(i.prototype=new r).equals=function(e){return this.value===e.value&&this.count===e.count&&this.collapsed===e.collapsed&&this.title===e.title},l.prototype=new r,t.exports={Event:function(){var e=[];this.subscribe=function(t){e.push(t)},this.unsubscribe=function(t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},this.notify=function(t,n,r){n=n||new o,r=r||this;for(var i,l=0;l<e.length&&!n.isPropagationStopped()&&!n.isImmediatePropagationStopped();l++)i=e[l].call(r,n,t);return i}},EventData:o,EventHandler:function(){var e=[];this.subscribe=function(t,n){return e.push({event:t,handler:n}),t.subscribe(n),this},this.unsubscribe=function(t,n){for(var o=e.length;o--;)if(e[o].event===t&&e[o].handler===n)return e.splice(o,1),void t.unsubscribe(n);return this},this.unsubscribeAll=function(){for(var t=e.length;t--;)e[t].event.unsubscribe(e[t].handler);return e=[],this}},Range:function(e,t,n,o){void 0===n&&void 0===o&&(n=e,o=t);this.fromRow=Math.min(e,n),this.fromCell=Math.min(t,o),this.toRow=Math.max(e,n),this.toCell=Math.max(t,o),this.isSingleRow=function(){return this.fromRow==this.toRow},this.isSingleCell=function(){return this.fromRow==this.toRow&&this.fromCell==this.toCell},this.contains=function(e,t){return e>=this.fromRow&&e<=this.toRow&&t>=this.fromCell&&t<=this.toCell},this.toString=function(){return this.isSingleCell()?"("+this.fromRow+":"+this.fromCell+")":"("+this.fromRow+":"+this.fromCell+" - "+this.toRow+":"+this.toCell+")"}},NonDataRow:r,Group:i,GroupTotals:l,EditorLock:a,GlobalEditorLock:new a,keyCode:{BACKSPACE:8,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,ESC:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,TAB:9,UP:38,C:67,V:86},preClickClassName:"slick-edit-preclick"}},419:function _(require,module,exports){function SlickGrid(container,data,columns,options){function init(){if(($container=container instanceof $?container:$(container)).length<1)throw new Error("SlickGrid requires a valid container, "+container+" does not exist in the DOM.");cacheCssForHiddenInit(),maxSupportedCssHeight=maxSupportedCssHeight||getMaxSupportedCssHeight(),scrollbarDimensions=scrollbarDimensions||measureScrollbar(),options=$.extend({},defaults,options),validateAndEnforceOptions(),columnDefaults.width=options.defaultColumnWidth,columnsById={};for(var e=0;e<columns.length;e++){var t=columns[e]=$.extend({},columnDefaults,columns[e]);columnsById[t.id]=e,t.minWidth&&t.width<t.minWidth&&(t.width=t.minWidth),t.maxWidth&&t.width>t.maxWidth&&(t.width=t.maxWidth)}if(options.enableColumnReorder&&!$.fn.sortable)throw new Error("SlickGrid's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded");editController={commitCurrentEdit:commitCurrentEdit,cancelCurrentEdit:cancelCurrentEdit},$container.empty().css("overflow","hidden").css("outline",0).addClass(uid).addClass("ui-widget"),/relative|absolute|fixed/.test($container.css("position"))||$container.css("position","relative"),$focusSink=$("<div tabIndex='0' hideFocus style='position:fixed;width:0;height:0;top:0;left:0;outline:0;'></div>").appendTo($container),options.createPreHeaderPanel&&($preHeaderPanelScroller=$("<div class='slick-preheader-panel ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container),$preHeaderPanel=$("<div />").appendTo($preHeaderPanelScroller),$preHeaderPanelSpacer=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").css("width",getCanvasWidth()+scrollbarDimensions.width+"px").appendTo($preHeaderPanelScroller),options.showPreHeaderPanel||$preHeaderPanelScroller.hide()),$headerScroller=$("<div class='slick-header ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container),($headers=$("<div class='slick-header-columns' style='left:-1000px' />").appendTo($headerScroller)).width(getHeadersWidth()),$headerRowScroller=$("<div class='slick-headerrow ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container),$headerRow=$("<div class='slick-headerrow-columns' />").appendTo($headerRowScroller),$headerRowSpacer=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").css("width",getCanvasWidth()+scrollbarDimensions.width+"px").appendTo($headerRowScroller),$topPanelScroller=$("<div class='slick-top-panel-scroller ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container),$topPanel=$("<div class='slick-top-panel' style='width:10000px' />").appendTo($topPanelScroller),options.showTopPanel||$topPanelScroller.hide(),options.showHeaderRow||$headerRowScroller.hide(),($viewport=$("<div class='slick-viewport' style='width:100%;overflow:auto;outline:0;position:relative;;'>").appendTo($container)).css("overflow-y",options.autoHeight?"hidden":"auto"),$canvas=$("<div class='grid-canvas' />").appendTo($viewport),options.createFooterRow&&($footerRowScroller=$("<div class='slick-footerrow ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($container),$footerRow=$("<div class='slick-footerrow-columns' />").appendTo($footerRowScroller),$footerRowSpacer=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").css("width",getCanvasWidth()+scrollbarDimensions.width+"px").appendTo($footerRowScroller),options.showFooterRow||$footerRowScroller.hide()),options.numberedMultiColumnSort&&(sortIndicatorCssClass="slick-sort-indicator-numbered"),$focusSink2=$focusSink.clone().appendTo($container),options.explicitInitialization||finishInitialization()}function finishInitialization(){initialized||(initialized=!0,viewportW=parseFloat($.css($container[0],"width",!0)),measureCellPaddingAndBorder(),disableSelection($headers),options.enableTextSelectionOnCells||$viewport.on("selectstart.ui",function(e){return $(e.target).is("input,textarea")}),updateColumnCaches(),createColumnHeaders(),setupColumnSort(),createCssRules(),resizeCanvas(),bindAncestorScrollEvents(),$container.on("resize.slickgrid",resizeCanvas),$viewport.on("scroll",handleScroll),$headerScroller.on("contextmenu",handleHeaderContextMenu).on("click",handleHeaderClick).on("mouseenter",".slick-header-column",handleHeaderMouseEnter).on("mouseleave",".slick-header-column",handleHeaderMouseLeave),$headerRowScroller.on("scroll",handleHeaderRowScroll),options.createFooterRow&&$footerRowScroller.on("scroll",handleFooterRowScroll),options.createPreHeaderPanel&&$preHeaderPanelScroller.on("scroll",handlePreHeaderPanelScroll),$focusSink.add($focusSink2).on("keydown",handleKeyDown),$canvas.on("keydown",handleKeyDown).on("click",handleClick).on("dblclick",handleDblClick).on("contextmenu",handleContextMenu).on("draginit",handleDragInit).on("dragstart",{distance:3},handleDragStart).on("drag",handleDrag).on("dragend",handleDragEnd).on("mouseenter",".slick-cell",handleMouseEnter).on("mouseleave",".slick-cell",handleMouseLeave),navigator.userAgent.toLowerCase().match(/webkit/)&&navigator.userAgent.toLowerCase().match(/macintosh/)&&$canvas.on("mousewheel",handleMouseWheel),restoreCssFromHiddenInit())}function cacheCssForHiddenInit(){($hiddenParents=$container.parents().addBack().not(":visible")).each(function(){var e={};for(var t in cssShow)e[t]=this.style[t],this.style[t]=cssShow[t];oldProps.push(e)})}function restoreCssFromHiddenInit(){$hiddenParents.each(function(e){var t=oldProps[e];for(var n in cssShow)this.style[n]=t[n]})}function registerPlugin(e){plugins.unshift(e),e.init(self)}function unregisterPlugin(e){for(var t=plugins.length;t>=0;t--)if(plugins[t]===e){plugins[t].destroy&&plugins[t].destroy(),plugins.splice(t,1);break}}function setSelectionModel(e){selectionModel&&(selectionModel.onSelectedRangesChanged.unsubscribe(handleSelectedRangesChanged),selectionModel.destroy&&selectionModel.destroy()),(selectionModel=e)&&(selectionModel.init(self),selectionModel.onSelectedRangesChanged.subscribe(handleSelectedRangesChanged))}function getSelectionModel(){return selectionModel}function getCanvasNode(){return $canvas[0]}function measureScrollbar(){var e=$("<div style='position:absolute; top:-10000px; left:-10000px; width:100px; height:100px; overflow:scroll;'></div>").appendTo("body"),t={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};return e.remove(),t}function getColumnTotalWidth(e){for(var t=0,n=0,o=columns.length;n<o;n++){var r=columns[n].width;t+=r}return e&&(t+=scrollbarDimensions.width),t}function getHeadersWidth(){var e=getColumnTotalWidth(!0);return Math.max(e,viewportW)+1e3}function getCanvasWidth(){for(var e=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW,t=0,n=columns.length;n--;)t+=columns[n].width;return options.fullWidthRows?Math.max(t,e):t}function updateCanvasWidth(e){var t=canvasWidth;(canvasWidth=getCanvasWidth())!=t&&($canvas.width(canvasWidth),$headerRow.width(canvasWidth),options.createFooterRow&&$footerRow.width(canvasWidth),options.createPreHeaderPanel&&$preHeaderPanel.width(canvasWidth),$headers.width(getHeadersWidth()),viewportHasHScroll=canvasWidth>viewportW-scrollbarDimensions.width);var n=canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0);$headerRowSpacer.width(n),options.createFooterRow&&$footerRowSpacer.width(n),options.createPreHeaderPanel&&$preHeaderPanelSpacer.width(n),(canvasWidth!=t||e)&&applyColumnWidths()}function disableSelection(e){e&&e.jquery&&e.attr("unselectable","on").css("MozUserSelect","none").on("selectstart.ui",function(){return!1})}function getMaxSupportedCssHeight(){for(var e=1e6,t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,n=$("<div style='display:none' />").appendTo(document.body);;){var o=2*e;if(n.css("height",o),o>t||n.height()!==o)break;e=o}return n.remove(),e}function getUID(){return uid}function getHeaderColumnWidthDiff(){return headerColumnWidthDiff}function getScrollbarDimensions(){return scrollbarDimensions}function bindAncestorScrollEvents(){for(var e=$canvas[0];(e=e.parentNode)!=document.body&&null!=e;)if(e==$viewport[0]||e.scrollWidth!=e.clientWidth||e.scrollHeight!=e.clientHeight){var t=$(e);$boundAncestors=$boundAncestors?$boundAncestors.add(t):t,t.on("scroll."+uid,handleActiveCellPositionChange)}}function unbindAncestorScrollEvents(){$boundAncestors&&($boundAncestors.off("scroll."+uid),$boundAncestors=null)}function updateColumnHeader(e,t,n){if(initialized){var o=getColumnIndex(e);if(null!=o){var r=columns[o],i=$headers.children().eq(o);i&&(void 0!==t&&(columns[o].name=t),void 0!==n&&(columns[o].toolTip=n),trigger(self.onBeforeHeaderCellDestroy,{node:i[0],column:r,grid:self}),i.attr("title",n||"").children().eq(0).html(t),trigger(self.onHeaderCellRendered,{node:i[0],column:r,grid:self}))}}}function getHeaderRow(){return $headerRow[0]}function getFooterRow(){return $footerRow[0]}function getPreHeaderPanel(){return $preHeaderPanel[0]}function getHeaderRowColumn(e){var t=getColumnIndex(e),n=$headerRow.children().eq(t);return n&&n[0]}function getFooterRowColumn(e){var t=getColumnIndex(e),n=$footerRow.children().eq(t);return n&&n[0]}function createColumnHeaders(){function e(){$(this).addClass("ui-state-hover")}function t(){$(this).removeClass("ui-state-hover")}$headers.find(".slick-header-column").each(function(){var e=$(this).data("column");e&&trigger(self.onBeforeHeaderCellDestroy,{node:this,column:e,grid:self})}),$headers.empty(),$headers.width(getHeadersWidth()),$headerRow.find(".slick-headerrow-column").each(function(){var e=$(this).data("column");e&&trigger(self.onBeforeHeaderRowCellDestroy,{node:this,column:e,grid:self})}),$headerRow.empty(),options.createFooterRow&&($footerRow.find(".slick-footerrow-column").each(function(){var e=$(this).data("column");e&&trigger(self.onBeforeFooterRowCellDestroy,{node:this,column:e})}),$footerRow.empty());for(var n=0;n<columns.length;n++){var o=columns[n],r=$("<div class='ui-state-default slick-header-column' />").html("<span class='slick-column-name'>"+o.name+"</span>").width(o.width-headerColumnWidthDiff).attr("id",""+uid+o.id).attr("title",o.toolTip||"").data("column",o).addClass(o.headerCssClass||"").appendTo($headers);if((options.enableColumnReorder||o.sortable)&&r.on("mouseenter",e).on("mouseleave",t),o.sortable&&(r.addClass("slick-header-sortable"),r.append("<span class='"+sortIndicatorCssClass+"' />")),trigger(self.onHeaderCellRendered,{node:r[0],column:o,grid:self}),options.showHeaderRow){var i=$("<div class='ui-state-default slick-headerrow-column l"+n+" r"+n+"'></div>").data("column",o).appendTo($headerRow);trigger(self.onHeaderRowCellRendered,{node:i[0],column:o,grid:self})}if(options.createFooterRow&&options.showFooterRow){var l=$("<div class='ui-state-default slick-footerrow-column l"+n+" r"+n+"'></div>").data("column",o).appendTo($footerRow);trigger(self.onFooterRowCellRendered,{node:l[0],column:o})}}setSortColumns(sortColumns),setupColumnResize(),options.enableColumnReorder&&("function"==typeof options.enableColumnReorder?options.enableColumnReorder(self,$headers,headerColumnWidthDiff,setColumns,setupColumnResize,columns,getColumnIndex,uid,trigger):setupColumnReorder())}function setupColumnSort(){$headers.click(function(e){if(e.metaKey=e.metaKey||e.ctrlKey,!$(e.target).hasClass("slick-resizable-handle")){var t=$(e.target).closest(".slick-header-column");if(t.length){var n=t.data("column");if(n.sortable){if(!getEditorLock().commitCurrentEdit())return;for(var o=null,r=0;r<sortColumns.length;r++)if(sortColumns[r].columnId==n.id){(o=sortColumns[r]).sortAsc=!o.sortAsc;break}var i=!!o;options.tristateMultiColumnSort?(o||(o={columnId:n.id,sortAsc:n.defaultSortAsc}),i&&o.sortAsc&&(sortColumns.splice(r,1),o=null),options.multiColumnSort||(sortColumns=[]),!o||i&&options.multiColumnSort||sortColumns.push(o)):e.metaKey&&options.multiColumnSort?o&&sortColumns.splice(r,1):((e.shiftKey||e.metaKey)&&options.multiColumnSort||(sortColumns=[]),o?0==sortColumns.length&&sortColumns.push(o):(o={columnId:n.id,sortAsc:n.defaultSortAsc},sortColumns.push(o))),setSortColumns(sortColumns),sortColumns.length>0&&(options.multiColumnSort?trigger(self.onSort,{multiColumnSort:!0,sortCols:$.map(sortColumns,function(e){return{sortCol:columns[getColumnIndex(e.columnId)],sortAsc:e.sortAsc}}),grid:self},e):trigger(self.onSort,{multiColumnSort:!1,sortCol:n,sortAsc:sortColumns[0].sortAsc,grid:self},e))}}}})}function setupColumnReorder(){$headers.filter(":ui-sortable").sortable("destroy"),$headers.sortable({containment:"parent",distance:3,axis:"x",cursor:"default",tolerance:"intersection",helper:"clone",placeholder:"slick-sortable-placeholder ui-state-default slick-header-column",start:function(e,t){t.placeholder.width(t.helper.outerWidth()-headerColumnWidthDiff),$(t.helper).addClass("slick-header-column-active")},beforeStop:function(e,t){$(t.helper).removeClass("slick-header-column-active")},stop:function(e){if(getEditorLock().commitCurrentEdit()){for(var t=$headers.sortable("toArray"),n=[],o=0;o<t.length;o++)n.push(columns[getColumnIndex(t[o].replace(uid,""))]);setColumns(n),trigger(self.onColumnsReordered,{grid:self}),e.stopPropagation(),setupColumnResize()}else $(this).sortable("cancel")}})}function setupColumnResize(){var e,t,n,o,r,i,l,a,s;(r=$headers.children()).find(".slick-resizable-handle").remove(),r.each(function(e,t){e>=columns.length||columns[e].resizable&&(void 0===a&&(a=e),s=e)}),void 0!==a&&r.each(function(u,c){u>=columns.length||u<a||options.forceFitColumns&&u>=s||(e=$(c),$("<div class='slick-resizable-handle' />").appendTo(c).on("dragstart",function(e,a){if(!getEditorLock().commitCurrentEdit())return!1;o=e.pageX,$(this).parent().addClass("slick-header-column-active");var s=null,c=null;if(r.each(function(e,t){e>=columns.length||(columns[e].previousWidth=$(t).outerWidth())}),options.forceFitColumns)for(s=0,c=0,t=u+1;t<columns.length;t++)(n=columns[t]).resizable&&(null!==c&&(n.maxWidth?c+=n.maxWidth-n.previousWidth:c=null),s+=n.previousWidth-Math.max(n.minWidth||0,absoluteColumnMinWidth));var d=0,p=0;for(t=0;t<=u;t++)(n=columns[t]).resizable&&(null!==p&&(n.maxWidth?p+=n.maxWidth-n.previousWidth:p=null),d+=n.previousWidth-Math.max(n.minWidth||0,absoluteColumnMinWidth));null===s&&(s=1e5),null===d&&(d=1e5),null===c&&(c=1e5),null===p&&(p=1e5),l=o+Math.min(s,p),i=o-Math.min(d,c)}).on("drag",function(e,r){var a,s,c=Math.min(l,Math.max(i,e.pageX))-o;if(c<0){for(s=c,t=u;t>=0;t--)(n=columns[t]).resizable&&(a=Math.max(n.minWidth||0,absoluteColumnMinWidth),s&&n.previousWidth+s<a?(s+=n.previousWidth-a,n.width=a):(n.width=n.previousWidth+s,s=0));if(options.forceFitColumns)for(s=-c,t=u+1;t<columns.length;t++)(n=columns[t]).resizable&&(s&&n.maxWidth&&n.maxWidth-n.previousWidth<s?(s-=n.maxWidth-n.previousWidth,n.width=n.maxWidth):(n.width=n.previousWidth+s,s=0))}else{for(s=c,t=u;t>=0;t--)(n=columns[t]).resizable&&(s&&n.maxWidth&&n.maxWidth-n.previousWidth<s?(s-=n.maxWidth-n.previousWidth,n.width=n.maxWidth):(n.width=n.previousWidth+s,s=0));if(options.forceFitColumns)for(s=-c,t=u+1;t<columns.length;t++)(n=columns[t]).resizable&&(a=Math.max(n.minWidth||0,absoluteColumnMinWidth),s&&n.previousWidth+s<a?(s+=n.previousWidth-a,n.width=a):(n.width=n.previousWidth+s,s=0))}applyColumnHeaderWidths(),options.syncColumnCellResize&&applyColumnWidths()}).on("dragend",function(e,o){var i;for($(this).parent().removeClass("slick-header-column-active"),t=0;t<columns.length;t++)n=columns[t],i=$(r[t]).outerWidth(),n.previousWidth!==i&&n.rerenderOnResize&&invalidateAllRows();updateCanvasWidth(!0),render(),trigger(self.onColumnsResized,{grid:self})}))})}function getVBoxDelta(e){var t=0;return $.each(["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],function(n,o){t+=parseFloat(e.css(o))||0}),t}function measureCellPaddingAndBorder(){var e,t=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],n=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],o=$.fn.jquery.split(".");jQueryNewWidthBehaviour=1==o[0]&&o[1]>=8||o[0]>=2,e=$("<div class='ui-state-default slick-header-column' style='visibility:hidden'>-</div>").appendTo($headers),headerColumnWidthDiff=headerColumnHeightDiff=0,"border-box"!=e.css("box-sizing")&&"border-box"!=e.css("-moz-box-sizing")&&"border-box"!=e.css("-webkit-box-sizing")&&($.each(t,function(t,n){headerColumnWidthDiff+=parseFloat(e.css(n))||0}),$.each(n,function(t,n){headerColumnHeightDiff+=parseFloat(e.css(n))||0})),e.remove();var r=$("<div class='slick-row' />").appendTo($canvas);e=$("<div class='slick-cell' id='' style='visibility:hidden'>-</div>").appendTo(r),cellWidthDiff=cellHeightDiff=0,"border-box"!=e.css("box-sizing")&&"border-box"!=e.css("-moz-box-sizing")&&"border-box"!=e.css("-webkit-box-sizing")&&($.each(t,function(t,n){cellWidthDiff+=parseFloat(e.css(n))||0}),$.each(n,function(t,n){cellHeightDiff+=parseFloat(e.css(n))||0})),r.remove(),absoluteColumnMinWidth=Math.max(headerColumnWidthDiff,cellWidthDiff)}function createCssRules(){$style=$("<style type='text/css' rel='stylesheet' />").appendTo($("head"));for(var e=options.rowHeight-cellHeightDiff,t=["."+uid+" .slick-header-column { left: 1000px; }","."+uid+" .slick-top-panel { height:"+options.topPanelHeight+"px; }","."+uid+" .slick-preheader-panel { height:"+options.preHeaderPanelHeight+"px; }","."+uid+" .slick-headerrow-columns { height:"+options.headerRowHeight+"px; }","."+uid+" .slick-footerrow-columns { height:"+options.footerRowHeight+"px; }","."+uid+" .slick-cell { height:"+e+"px; }","."+uid+" .slick-row { height:"+options.rowHeight+"px; }"],n=0;n<columns.length;n++)t.push("."+uid+" .l"+n+" { }"),t.push("."+uid+" .r"+n+" { }");$style[0].styleSheet?$style[0].styleSheet.cssText=t.join(" "):$style[0].appendChild(document.createTextNode(t.join(" ")))}function getColumnCssRules(e){var t;if(!stylesheet){var n=document.styleSheets;for(t=0;t<n.length;t++)if((n[t].ownerNode||n[t].owningElement)==$style[0]){stylesheet=n[t];break}if(!stylesheet)throw new Error("Cannot find stylesheet.");columnCssRulesL=[],columnCssRulesR=[];var o,r,i=stylesheet.cssRules||stylesheet.rules;for(t=0;t<i.length;t++){var l=i[t].selectorText;(o=/\.l\d+/.exec(l))?(r=parseInt(o[0].substr(2,o[0].length-2),10),columnCssRulesL[r]=i[t]):(o=/\.r\d+/.exec(l))&&(r=parseInt(o[0].substr(2,o[0].length-2),10),columnCssRulesR[r]=i[t])}}return{left:columnCssRulesL[e],right:columnCssRulesR[e]}}function removeCssRules(){$style.remove(),stylesheet=null}function destroy(){getEditorLock().cancelCurrentEdit(),trigger(self.onBeforeDestroy,{grid:self});for(var e=plugins.length;e--;)unregisterPlugin(plugins[e]);options.enableColumnReorder&&$headers.filter(":ui-sortable").sortable("destroy"),unbindAncestorScrollEvents(),$container.off(".slickgrid"),removeCssRules(),$canvas.off("draginit dragstart dragend drag"),$container.empty().removeClass(uid)}function trigger(e,t,n){return n=n||new Slick.EventData,t=t||{},t.grid=self,e.notify(t,n,self)}function getEditorLock(){return options.editorLock}function getEditController(){return editController}function getColumnIndex(e){return columnsById[e]}function autosizeColumns(){var e,t,n,o=[],r=0,i=0,l=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW;for(e=0;e<columns.length;e++)t=columns[e],o.push(t.width),i+=t.width,t.resizable&&(r+=t.width-Math.max(t.minWidth,absoluteColumnMinWidth));for(n=i;i>l&&r;){var a=(i-l)/r;for(e=0;e<columns.length&&i>l;e++){t=columns[e];var s=o[e];if(!(!t.resizable||s<=t.minWidth||s<=absoluteColumnMinWidth)){var u=Math.max(t.minWidth,absoluteColumnMinWidth),c=Math.floor(a*(s-u))||1;c=Math.min(c,s-u),i-=c,r-=c,o[e]-=c}}if(n<=i)break;n=i}for(n=i;i<l;){var d=l/i;for(e=0;e<columns.length&&i<l;e++){t=columns[e];var p,f=o[e];p=!t.resizable||t.maxWidth<=f?0:Math.min(Math.floor(d*f)-f,t.maxWidth-f||1e6)||1,i+=p,o[e]+=i<=l?p:0}if(n>=i)break;n=i}var h=!1;for(e=0;e<columns.length;e++)columns[e].rerenderOnResize&&columns[e].width!=o[e]&&(h=!0),columns[e].width=o[e];applyColumnHeaderWidths(),updateCanvasWidth(!0),h&&(invalidateAllRows(),render())}function applyColumnHeaderWidths(){if(initialized){for(var e,t=0,n=$headers.children(),o=columns.length;t<o;t++)e=$(n[t]),jQueryNewWidthBehaviour?e.outerWidth()!==columns[t].width&&e.outerWidth(columns[t].width):e.width()!==columns[t].width-headerColumnWidthDiff&&e.width(columns[t].width-headerColumnWidthDiff);updateColumnCaches()}}function applyColumnWidths(){for(var e,t,n=0,o=0;o<columns.length;o++)e=columns[o].width,(t=getColumnCssRules(o)).left.style.left=n+"px",t.right.style.right=canvasWidth-n-e+"px",n+=columns[o].width}function setSortColumn(e,t){setSortColumns([{columnId:e,sortAsc:t}])}function setSortColumns(e){sortColumns=e;var t=options.numberedMultiColumnSort&&sortColumns.length>1,n=$headers.children(),o=n.removeClass("slick-header-column-sorted").find("."+sortIndicatorCssClass).removeClass("slick-sort-indicator-asc slick-sort-indicator-desc");t&&o.text(""),$.each(sortColumns,function(e,r){null==r.sortAsc&&(r.sortAsc=!0);var i=getColumnIndex(r.columnId);null!=i&&(o=n.eq(i).addClass("slick-header-column-sorted").find("."+sortIndicatorCssClass).addClass(r.sortAsc?"slick-sort-indicator-asc":"slick-sort-indicator-desc"),t&&o.text(e+1))})}function getSortColumns(){return sortColumns}function handleSelectedRangesChanged(e,t){selectedRows=[];for(var n={},o=0;o<t.length;o++)for(var r=t[o].fromRow;r<=t[o].toRow;r++){n[r]||(selectedRows.push(r),n[r]={});for(var i=t[o].fromCell;i<=t[o].toCell;i++)canCellBeSelected(r,i)&&(n[r][columns[i].id]=options.selectedCellCssClass)}setCellCssStyles(options.selectedCellCssClass,n),trigger(self.onSelectedRowsChanged,{rows:getSelectedRows(),grid:self},e)}function getColumns(){return columns}function updateColumnCaches(){columnPosLeft=[],columnPosRight=[];for(var e=0,t=0,n=columns.length;t<n;t++)columnPosLeft[t]=e,columnPosRight[t]=e+columns[t].width,e+=columns[t].width}function setColumns(e){columns=e,columnsById={};for(var t=0;t<columns.length;t++){var n=columns[t]=$.extend({},columnDefaults,columns[t]);columnsById[n.id]=t,n.minWidth&&n.width<n.minWidth&&(n.width=n.minWidth),n.maxWidth&&n.width>n.maxWidth&&(n.width=n.maxWidth)}updateColumnCaches(),initialized&&(invalidateAllRows(),createColumnHeaders(),removeCssRules(),createCssRules(),resizeCanvas(),applyColumnWidths(),handleScroll())}function getOptions(){return options}function setOptions(e,t){getEditorLock().commitCurrentEdit()&&(makeActiveCellNormal(),options.enableAddRow!==e.enableAddRow&&invalidateRow(getDataLength()),options=$.extend(options,e),validateAndEnforceOptions(),$viewport.css("overflow-y",options.autoHeight?"hidden":"auto"),t||render())}function validateAndEnforceOptions(){options.autoHeight&&(options.leaveSpaceForNewRows=!1)}function setData(e,t){data=e,invalidateAllRows(),updateRowCount(),t&&scrollTo(0)}function getData(){return data}function getDataLength(){return data.getLength?data.getLength():data.length}function getDataLengthIncludingAddNew(){return getDataLength()+(options.enableAddRow&&(!pagingActive||pagingIsLastPage)?1:0)}function getDataItem(e){return data.getItem?data.getItem(e):data[e]}function getTopPanel(){return $topPanel[0]}function setTopPanelVisibility(e){options.showTopPanel!=e&&(options.showTopPanel=e,e?$topPanelScroller.slideDown("fast",resizeCanvas):$topPanelScroller.slideUp("fast",resizeCanvas))}function setHeaderRowVisibility(e){options.showHeaderRow!=e&&(options.showHeaderRow=e,e?$headerRowScroller.slideDown("fast",resizeCanvas):$headerRowScroller.slideUp("fast",resizeCanvas))}function setFooterRowVisibility(e){options.showFooterRow!=e&&(options.showFooterRow=e,e?$footerRowScroller.slideDown("fast",resizeCanvas):$footerRowScroller.slideUp("fast",resizeCanvas))}function setPreHeaderPanelVisibility(e){options.showPreHeaderPanel!=e&&(options.showPreHeaderPanel=e,e?$preHeaderPanelScroller.slideDown("fast",resizeCanvas):$preHeaderPanelScroller.slideUp("fast",resizeCanvas))}function getContainerNode(){return $container.get(0)}function getRowTop(e){return options.rowHeight*e-offset}function getRowFromPosition(e){return Math.floor((e+offset)/options.rowHeight)}function scrollTo(e){e=Math.max(e,0),e=Math.min(e,th-viewportH+(viewportHasHScroll?scrollbarDimensions.height:0));var t=offset;page=Math.min(n-1,Math.floor(e/ph)),offset=Math.round(page*cj);var o=e-offset;if(offset!=t){var r=getVisibleRange(o);cleanupRows(r),updateRowPositions()}prevScrollTop!=o&&(vScrollDir=prevScrollTop+t<o+offset?1:-1,$viewport[0].scrollTop=lastRenderedScrollTop=scrollTop=prevScrollTop=o,trigger(self.onViewportChanged,{grid:self}))}function defaultFormatter(e,t,n,o,r){return null==n?"":(n+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function getFormatter(e,t){var n=data.getItemMetadata&&data.getItemMetadata(e),o=n&&n.columns&&(n.columns[t.id]||n.columns[getColumnIndex(t.id)]);return o&&o.formatter||n&&n.formatter||t.formatter||options.formatterFactory&&options.formatterFactory.getFormatter(t)||options.defaultFormatter}function getEditor(e,t){var n=columns[t],o=data.getItemMetadata&&data.getItemMetadata(e),r=o&&o.columns;return r&&r[n.id]&&void 0!==r[n.id].editor?r[n.id].editor:r&&r[t]&&void 0!==r[t].editor?r[t].editor:n.editor||options.editorFactory&&options.editorFactory.getEditor(n)}function getDataItemValueForColumn(e,t){return options.dataItemColumnValueExtractor?options.dataItemColumnValueExtractor(e,t):e[t.field]}function appendRowHtml(e,t,n,o){var r=getDataItem(t),i=t<o&&!r,l="slick-row"+(i?" loading":"")+(t===activeRow?" active":"")+(t%2==1?" odd":" even");r||(l+=" "+options.addNewRowCssClass);var a=data.getItemMetadata&&data.getItemMetadata(t);a&&a.cssClasses&&(l+=" "+a.cssClasses),e.push("<div class='ui-widget-content "+l+"' style='top:"+getRowTop(t)+"px'>");for(var s,u,c=0,d=columns.length;c<d;c++){if(u=columns[c],s=1,a&&a.columns){var p=a.columns[u.id]||a.columns[c];"*"===(s=p&&p.colspan||1)&&(s=d-c)}if(columnPosRight[Math.min(d-1,c+s-1)]>n.leftPx){if(columnPosLeft[c]>n.rightPx)break;appendCellHtml(e,t,c,s,r)}s>1&&(c+=s-1)}e.push("</div>")}function appendCellHtml(e,t,n,o,r){var i=columns[n],l="slick-cell l"+n+" r"+Math.min(columns.length-1,n+o-1)+(i.cssClass?" "+i.cssClass:"");t===activeRow&&n===activeCell&&(l+=" active");for(var a in cellCssClasses)cellCssClasses[a][t]&&cellCssClasses[a][t][i.id]&&(l+=" "+cellCssClasses[a][t][i.id]);var s=null;r&&(s=getDataItemValueForColumn(r,i));var u=getFormatter(t,i)(t,n,s,i,r),c=trigger(self.onBeforeAppendCell,{row:t,cell:n,grid:self,value:s,dataContext:r})||"";c+=u.addClasses?(c?" ":"")+u.addClasses:"",e.push("<div class='"+l+(c?" "+c:"")+"'>"),r&&e.push("object"!=typeof u?u:u.text),e.push("</div>"),rowsCache[t].cellRenderQueue.push(n),rowsCache[t].cellColSpans[n]=o}function cleanupRows(e){for(var t in rowsCache)(t=parseInt(t,10))!==activeRow&&(t<e.top||t>e.bottom)&&removeRowFromCache(t);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()}function invalidate(){updateRowCount(),invalidateAllRows(),render()}function invalidateAllRows(){currentEditor&&makeActiveCellNormal();for(var e in rowsCache)removeRowFromCache(e);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()}function queuePostProcessedRowForCleanup(e,t,n){postProcessgroupId++;for(var o in t)t.hasOwnProperty(o)&&postProcessedCleanupQueue.push({actionType:"C",groupId:postProcessgroupId,node:e.cellNodesByColumnIdx[0|o],columnIdx:0|o,rowIdx:n});postProcessedCleanupQueue.push({actionType:"R",groupId:postProcessgroupId,node:e.rowNode}),$(e.rowNode).detach()}function queuePostProcessedCellForCleanup(e,t,n){postProcessedCleanupQueue.push({actionType:"C",groupId:postProcessgroupId,node:e,columnIdx:t,rowIdx:n}),$(e).detach()}function removeRowFromCache(e){var t=rowsCache[e];t&&(rowNodeFromLastMouseWheelEvent===t.rowNode?(t.rowNode.style.display="none",zombieRowNodeFromLastMouseWheelEvent=rowNodeFromLastMouseWheelEvent,zombieRowCacheFromLastMouseWheelEvent=t,zombieRowPostProcessedFromLastMouseWheelEvent=postProcessedRows[e]):options.enableAsyncPostRenderCleanup&&postProcessedRows[e]?queuePostProcessedRowForCleanup(t,postProcessedRows[e],e):$canvas[0].removeChild(t.rowNode),delete rowsCache[e],delete postProcessedRows[e],renderedRows--,counter_rows_removed++)}function invalidateRows(e){var t,n;if(e&&e.length){for(vScrollDir=0,n=e.length,t=0;t<n;t++)currentEditor&&activeRow===e[t]&&makeActiveCellNormal(),rowsCache[e[t]]&&removeRowFromCache(e[t]);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()}}function invalidateRow(e){invalidateRows([e])}function applyFormatResultToCellNode(e,t,n){"object"==typeof e?(t.innerHTML=e.text,e.removeClasses&&!n&&t.removeClass(e.removeClasses),e.addClasses&&t.addClass(e.addClasses)):t.innerHTML=e}function updateCell(e,t){var n=getCellNode(e,t);if(n){var o=columns[t],r=getDataItem(e);if(currentEditor&&activeRow===e&&activeCell===t)currentEditor.loadValue(r);else{var i=r?getFormatter(e,o)(e,t,getDataItemValueForColumn(r,o),o,r):"";applyFormatResultToCellNode(i,n),invalidatePostProcessingResults(e)}}}function updateRow(e){var t=rowsCache[e];if(t){ensureCellNodesInRowsCache(e);var n=getDataItem(e);for(var o in t.cellNodesByColumnIdx)if(t.cellNodesByColumnIdx.hasOwnProperty(o)){var r=columns[o|=0],i=t.cellNodesByColumnIdx[o];e===activeRow&&o===activeCell&¤tEditor?currentEditor.loadValue(n):n?applyFormatResultToCellNode(getFormatter(e,r)(e,o,getDataItemValueForColumn(n,r),r,n),i):i.innerHTML=""}invalidatePostProcessingResults(e)}}function getViewportHeight(){return parseFloat($.css($container[0],"height",!0))-parseFloat($.css($container[0],"paddingTop",!0))-parseFloat($.css($container[0],"paddingBottom",!0))-parseFloat($.css($headerScroller[0],"height"))-getVBoxDelta($headerScroller)-(options.showTopPanel?options.topPanelHeight+getVBoxDelta($topPanelScroller):0)-(options.showHeaderRow?options.headerRowHeight+getVBoxDelta($headerRowScroller):0)-(options.createFooterRow&&options.showFooterRow?options.footerRowHeight+getVBoxDelta($footerRowScroller):0)-(options.createPreHeaderPanel&&options.showPreHeaderPanel?options.preHeaderPanelHeight+getVBoxDelta($preHeaderPanelScroller):0)}function resizeCanvas(){initialized&&(viewportH=options.autoHeight?options.rowHeight*getDataLengthIncludingAddNew():getViewportHeight(),numVisibleRows=Math.ceil(viewportH/options.rowHeight),viewportW=parseFloat($.css($container[0],"width",!0)),options.autoHeight||$viewport.height(viewportH),options.forceFitColumns&&autosizeColumns(),updateRowCount(),handleScroll(),lastRenderedScrollLeft=-1,render())}function updatePagingStatusFromView(e){pagingActive=0!==e.pageSize,pagingIsLastPage=e.pageNum==e.totalPages-1}function updateRowCount(){if(initialized){var e=getDataLength(),t=getDataLengthIncludingAddNew(),o=t+(options.leaveSpaceForNewRows?numVisibleRows-1:0),r=viewportHasVScroll;viewportHasVScroll=!options.autoHeight&&o*options.rowHeight>viewportH,viewportHasHScroll=canvasWidth>viewportW-scrollbarDimensions.width,makeActiveCellNormal();var i=e-1;for(var l in rowsCache)l>i&&removeRowFromCache(l);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup(),activeCellNode&&activeRow>i&&resetActiveCell();var a=h;(th=Math.max(options.rowHeight*o,viewportH-scrollbarDimensions.height))<maxSupportedCssHeight?(h=ph=th,n=1,cj=0):(ph=(h=maxSupportedCssHeight)/100,n=Math.floor(th/ph),cj=(th-h)/(n-1)),h!==a&&($canvas.css("height",h),scrollTop=$viewport[0].scrollTop);var s=scrollTop+offset<=th-viewportH;0==th||0==scrollTop?page=offset=0:scrollTo(s?scrollTop+offset:th-viewportH),h!=a&&options.autoHeight&&resizeCanvas(),options.forceFitColumns&&r!=viewportHasVScroll&&autosizeColumns(),updateCanvasWidth(!1)}}function getVisibleRange(e,t){return null==e&&(e=scrollTop),null==t&&(t=scrollLeft),{top:getRowFromPosition(e),bottom:getRowFromPosition(e+viewportH)+1,leftPx:t,rightPx:t+viewportW}}function getRenderedRange(e,t){var n=getVisibleRange(e,t),o=Math.round(viewportH/options.rowHeight);return-1==vScrollDir?(n.top-=o,n.bottom+=3):1==vScrollDir?(n.top-=3,n.bottom+=o):(n.top-=3,n.bottom+=3),n.top=Math.max(0,n.top),n.bottom=Math.min(getDataLengthIncludingAddNew()-1,n.bottom),n.leftPx-=viewportW,n.rightPx+=viewportW,n.leftPx=Math.max(0,n.leftPx),n.rightPx=Math.min(canvasWidth,n.rightPx),n}function ensureCellNodesInRowsCache(e){var t=rowsCache[e];if(t&&t.cellRenderQueue.length)for(var n=t.rowNode.lastChild;t.cellRenderQueue.length;){var o=t.cellRenderQueue.pop();t.cellNodesByColumnIdx[o]=n,n=n.previousSibling}}function cleanUpCells(e,t){var n=rowsCache[t],o=[];for(var r in n.cellNodesByColumnIdx)if(n.cellNodesByColumnIdx.hasOwnProperty(r)){r|=0;var i=n.cellColSpans[r];(columnPosLeft[r]>e.rightPx||columnPosRight[Math.min(columns.length-1,r+i-1)]<e.leftPx)&&(t==activeRow&&r==activeCell||o.push(r))}var l,a;for(postProcessgroupId++;null!=(l=o.pop());)a=n.cellNodesByColumnIdx[l],options.enableAsyncPostRenderCleanup&&postProcessedRows[t]&&postProcessedRows[t][l]?queuePostProcessedCellForCleanup(a,l,t):n.rowNode.removeChild(a),delete n.cellColSpans[l],delete n.cellNodesByColumnIdx[l],postProcessedRows[t]&&delete postProcessedRows[t][l],0}function cleanUpAndRenderCells(e){for(var t,n,o,r=[],i=[],l=e.top,a=e.bottom;l<=a;l++)if(t=rowsCache[l]){ensureCellNodesInRowsCache(l),cleanUpCells(e,l),n=0;var s=data.getItemMetadata&&data.getItemMetadata(l);s=s&&s.columns;for(var u=getDataItem(l),c=0,d=columns.length;c<d&&!(columnPosLeft[c]>e.rightPx);c++)if(null==(o=t.cellColSpans[c])){if(o=1,s){var p=s[columns[c].id]||s[c];"*"===(o=p&&p.colspan||1)&&(o=d-c)}columnPosRight[Math.min(d-1,c+o-1)]>e.leftPx&&(appendCellHtml(r,l,c,o,u),n++),c+=o>1?o-1:0}else c+=o>1?o-1:0;n&&(n,i.push(l))}if(r.length){var f=document.createElement("div");f.innerHTML=r.join("");for(var h,g;null!=(h=i.pop());){t=rowsCache[h];for(var m;null!=(m=t.cellRenderQueue.pop());)g=f.lastChild,t.rowNode.appendChild(g),t.cellNodesByColumnIdx[m]=g}}}function renderRows(e){for(var t=$canvas[0],n=[],o=[],r=!1,i=getDataLength(),l=e.top,a=e.bottom;l<=a;l++)rowsCache[l]||(renderedRows++,o.push(l),rowsCache[l]={rowNode:null,cellColSpans:[],cellNodesByColumnIdx:[],cellRenderQueue:[]},appendRowHtml(n,l,e,i),activeCellNode&&activeRow===l&&(r=!0),counter_rows_rendered++);if(o.length){var s=document.createElement("div");s.innerHTML=n.join("");for(var l=0,a=o.length;l<a;l++)rowsCache[o[l]].rowNode=t.appendChild(s.firstChild);r&&(activeCellNode=getCellNode(activeRow,activeCell))}}function startPostProcessing(){options.enableAsyncPostRender&&(clearTimeout(h_postrender),h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay))}function startPostProcessingCleanup(){options.enableAsyncPostRenderCleanup&&(clearTimeout(h_postrenderCleanup),h_postrenderCleanup=setTimeout(asyncPostProcessCleanupRows,options.asyncPostRenderCleanupDelay))}function invalidatePostProcessingResults(e){for(var t in postProcessedRows[e])postProcessedRows[e].hasOwnProperty(t)&&(postProcessedRows[e][t]="C");postProcessFromRow=Math.min(postProcessFromRow,e),postProcessToRow=Math.max(postProcessToRow,e),startPostProcessing()}function updateRowPositions(){for(var e in rowsCache)rowsCache[e].rowNode.style.top=getRowTop(e)+"px"}function render(){if(initialized){var e=getVisibleRange(),t=getRenderedRange();cleanupRows(t),lastRenderedScrollLeft!=scrollLeft&&cleanUpAndRenderCells(t),renderRows(t),postProcessFromRow=e.top,postProcessToRow=Math.min(getDataLengthIncludingAddNew()-1,e.bottom),startPostProcessing(),lastRenderedScrollTop=scrollTop,lastRenderedScrollLeft=scrollLeft,h_render=null}}function handleHeaderRowScroll(){var e=$headerRowScroller[0].scrollLeft;e!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=e)}function handleFooterRowScroll(){var e=$footerRowScroller[0].scrollLeft;e!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=e)}function handlePreHeaderPanelScroll(){var e=$preHeaderPanelScroller[0].scrollLeft;e!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=e)}function handleScroll(){scrollTop=$viewport[0].scrollTop,scrollLeft=$viewport[0].scrollLeft;var e=Math.abs(scrollTop-prevScrollTop),t=Math.abs(scrollLeft-prevScrollLeft);if(t&&(prevScrollLeft=scrollLeft,$headerScroller[0].scrollLeft=scrollLeft,$topPanelScroller[0].scrollLeft=scrollLeft,$headerRowScroller[0].scrollLeft=scrollLeft,options.createFooterRow&&($footerRowScroller[0].scrollLeft=scrollLeft),options.createPreHeaderPanel&&($preHeaderPanelScroller[0].scrollLeft=scrollLeft)),e)if(vScrollDir=prevScrollTop<scrollTop?1:-1,prevScrollTop=scrollTop,e<viewportH)scrollTo(scrollTop+offset);else{var o=offset;page=h==viewportH?0:Math.min(n-1,Math.floor(scrollTop*((th-viewportH)/(h-viewportH))*(1/ph))),offset=Math.round(page*cj),o!=offset&&invalidateAllRows()}(t||e)&&(h_render&&clearTimeout(h_render),(Math.abs(lastRenderedScrollTop-scrollTop)>20||Math.abs(lastRenderedScrollLeft-scrollLeft)>20)&&(options.forceSyncScrolling||Math.abs(lastRenderedScrollTop-scrollTop)<viewportH&&Math.abs(lastRenderedScrollLeft-scrollLeft)<viewportW?render():h_render=setTimeout(render,50),trigger(self.onViewportChanged,{grid:self}))),trigger(self.onScroll,{scrollLeft:scrollLeft,scrollTop:scrollTop,grid:self})}function asyncPostProcessRows(){for(var e=getDataLength();postProcessFromRow<=postProcessToRow;){var t=vScrollDir>=0?postProcessFromRow++:postProcessToRow--,n=rowsCache[t];if(n&&!(t>=e)){postProcessedRows[t]||(postProcessedRows[t]={}),ensureCellNodesInRowsCache(t);for(var o in n.cellNodesByColumnIdx)if(n.cellNodesByColumnIdx.hasOwnProperty(o)){var r=columns[o|=0],i=postProcessedRows[t][o];if(r.asyncPostRender&&"R"!==i){var l=n.cellNodesByColumnIdx[o];l&&r.asyncPostRender(l,t,getDataItem(t),r,"C"===i),postProcessedRows[t][o]="R"}}return void(h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay))}}}function asyncPostProcessCleanupRows(){if(postProcessedCleanupQueue.length>0){for(var e=postProcessedCleanupQueue[0].groupId;postProcessedCleanupQueue.length>0&&postProcessedCleanupQueue[0].groupId==e;){var t=postProcessedCleanupQueue.shift();if("R"==t.actionType&&$(t.node).remove(),"C"==t.actionType){var n=columns[t.columnIdx];n.asyncPostRenderCleanup&&t.node&&n.asyncPostRenderCleanup(t.node,t.rowIdx,n)}}h_postrenderCleanup=setTimeout(asyncPostProcessCleanupRows,options.asyncPostRenderCleanupDelay)}}function updateCellCssStylesOnRenderedRows(e,t){var n,o,r,i;for(var l in rowsCache){if(i=t&&t[l],r=e&&e[l],i)for(o in i)r&&i[o]==r[o]||(n=getCellNode(l,getColumnIndex(o)))&&$(n).removeClass(i[o]);if(r)for(o in r)i&&i[o]==r[o]||(n=getCellNode(l,getColumnIndex(o)))&&$(n).addClass(r[o])}}function addCellCssStyles(e,t){if(cellCssClasses[e])throw new Error("addCellCssStyles: cell CSS hash with key '"+e+"' already exists.");cellCssClasses[e]=t,updateCellCssStylesOnRenderedRows(t,null),trigger(self.onCellCssStylesChanged,{key:e,hash:t,grid:self})}function removeCellCssStyles(e){cellCssClasses[e]&&(updateCellCssStylesOnRenderedRows(null,cellCssClasses[e]),delete cellCssClasses[e],trigger(self.onCellCssStylesChanged,{key:e,hash:null,grid:self}))}function setCellCssStyles(e,t){var n=cellCssClasses[e];cellCssClasses[e]=t,updateCellCssStylesOnRenderedRows(t,n),trigger(self.onCellCssStylesChanged,{key:e,hash:t,grid:self})}function getCellCssStyles(e){return cellCssClasses[e]}function flashCell(e,t,n){if(n=n||100,rowsCache[e]){var o=$(getCellNode(e,t)),r=function(e){e&&setTimeout(function(){o.queue(function(){o.toggleClass(options.cellFlashingCssClass).dequeue(),r(e-1)})},n)};r(4)}}function handleMouseWheel(e){var t=$(e.target).closest(".slick-row")[0];t!=rowNodeFromLastMouseWheelEvent&&(zombieRowNodeFromLastMouseWheelEvent&&zombieRowNodeFromLastMouseWheelEvent!=t&&(options.enableAsyncPostRenderCleanup&&zombieRowPostProcessedFromLastMouseWheelEvent?queuePostProcessedRowForCleanup(zombieRowCacheFromLastMouseWheelEvent,zombieRowPostProcessedFromLastMouseWheelEvent):$canvas[0].removeChild(zombieRowNodeFromLastMouseWheelEvent),zombieRowNodeFromLastMouseWheelEvent=null,zombieRowCacheFromLastMouseWheelEvent=null,zombieRowPostProcessedFromLastMouseWheelEvent=null,options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()),rowNodeFromLastMouseWheelEvent=t)}function handleDragInit(e,t){var n=getCellFromEvent(e);if(!n||!cellExists(n.row,n.cell))return!1;var o=trigger(self.onDragInit,t,e);return!!e.isImmediatePropagationStopped()&&o}function handleDragStart(e,t){var n=getCellFromEvent(e);if(!n||!cellExists(n.row,n.cell))return!1;var o=trigger(self.onDragStart,t,e);return!!e.isImmediatePropagationStopped()&&o}function handleDrag(e,t){return trigger(self.onDrag,t,e)}function handleDragEnd(e,t){trigger(self.onDragEnd,t,e)}function handleKeyDown(e){trigger(self.onKeyDown,{row:activeRow,cell:activeCell,grid:self},e);var t=e.isImmediatePropagationStopped(),n=Slick.keyCode;if(!t)if(e.shiftKey||e.altKey||e.ctrlKey)e.which!=n.TAB||!e.shiftKey||e.ctrlKey||e.altKey||(t=navigatePrev());else{if(options.editable&¤tEditor&¤tEditor.keyCaptureList&¤tEditor.keyCaptureList.indexOf(e.which)>-1)return;if(e.which==n.ESCAPE){if(!getEditorLock().isActive())return;cancelEditAndSetFocus()}else e.which==n.PAGE_DOWN?(navigatePageDown(),t=!0):e.which==n.PAGE_UP?(navigatePageUp(),t=!0):e.which==n.LEFT?t=navigateLeft():e.which==n.RIGHT?t=navigateRight():e.which==n.UP?t=navigateUp():e.which==n.DOWN?t=navigateDown():e.which==n.TAB?t=navigateNext():e.which==n.ENTER&&(options.editable&&(currentEditor?activeRow===getDataLength()?navigateDown():commitEditAndSetFocus():getEditorLock().commitCurrentEdit()&&makeActiveCellEditable()),t=!0)}if(t){e.stopPropagation(),e.preventDefault();try{e.originalEvent.keyCode=0}catch(e){}}}function handleClick(e){currentEditor||(e.target!=document.activeElement||$(e.target).hasClass("slick-cell"))&&setFocus();var t=getCellFromEvent(e);if(t&&(null===currentEditor||activeRow!=t.row||activeCell!=t.cell)&&(trigger(self.onClick,{row:t.row,cell:t.cell,grid:self},e),!e.isImmediatePropagationStopped()&&canCellBeActive(t.row,t.cell)&&(!getEditorLock().isActive()||getEditorLock().commitCurrentEdit()))){scrollRowIntoView(t.row,!1);var n=e.target&&e.target.className===Slick.preClickClassName;setActiveCellInternal(getCellNode(t.row,t.cell),null,n)}}function handleContextMenu(e){var t=$(e.target).closest(".slick-cell",$canvas);0!==t.length&&(activeCellNode===t[0]&&null!==currentEditor||trigger(self.onContextMenu,{grid:self},e))}function handleDblClick(e){var t=getCellFromEvent(e);!t||null!==currentEditor&&activeRow==t.row&&activeCell==t.cell||(trigger(self.onDblClick,{row:t.row,cell:t.cell,grid:self},e),e.isImmediatePropagationStopped()||options.editable&&gotoCell(t.row,t.cell,!0))}function handleHeaderMouseEnter(e){trigger(self.onHeaderMouseEnter,{column:$(this).data("column"),grid:self},e)}function handleHeaderMouseLeave(e){trigger(self.onHeaderMouseLeave,{column:$(this).data("column"),grid:self},e)}function handleHeaderContextMenu(e){var t=$(e.target).closest(".slick-header-column",".slick-header-columns"),n=t&&t.data("column");trigger(self.onHeaderContextMenu,{column:n,grid:self},e)}function handleHeaderClick(e){var t=$(e.target).closest(".slick-header-column",".slick-header-columns"),n=t&&t.data("column");n&&trigger(self.onHeaderClick,{column:n,grid:self},e)}function handleMouseEnter(e){trigger(self.onMouseEnter,{grid:self},e)}function handleMouseLeave(e){trigger(self.onMouseLeave,{grid:self},e)}function cellExists(e,t){return!(e<0||e>=getDataLength()||t<0||t>=columns.length)}function getCellFromPoint(e,t){for(var n=getRowFromPosition(t),o=0,r=0,i=0;i<columns.length&&r<e;i++)r+=columns[i].width,o++;return o<0&&(o=0),{row:n,cell:o-1}}function getCellFromNode(e){var t=/l\d+/.exec(e.className);if(!t)throw new Error("getCellFromNode: cannot get cell - "+e.className);return parseInt(t[0].substr(1,t[0].length-1),10)}function getRowFromNode(e){for(var t in rowsCache)if(rowsCache[t].rowNode===e)return 0|t;return null}function getCellFromEvent(e){var t=$(e.target).closest(".slick-cell",$canvas);if(!t.length)return null;var n=getRowFromNode(t[0].parentNode),o=getCellFromNode(t[0]);return null==n||null==o?null:{row:n,cell:o}}function getCellNodeBox(e,t){if(!cellExists(e,t))return null;for(var n=getRowTop(e),o=n+options.rowHeight-1,r=0,i=0;i<t;i++)r+=columns[i].width;var l=r+columns[t].width;return{top:n,left:r,bottom:o,right:l}}function resetActiveCell(){setActiveCellInternal(null,!1)}function setFocus(){-1==tabbingDirection?$focusSink[0].focus():$focusSink2[0].focus()}function scrollCellIntoView(e,t,n){scrollRowIntoView(e,n);var o=getColspan(e,t);internalScrollColumnIntoView(columnPosLeft[t],columnPosRight[t+(o>1?o-1:0)])}function internalScrollColumnIntoView(e,t){var n=scrollLeft+viewportW;e<scrollLeft?($viewport.scrollLeft(e),handleScroll(),render()):t>n&&($viewport.scrollLeft(Math.min(e,t-$viewport[0].clientWidth)),handleScroll(),render())}function scrollColumnIntoView(e){internalScrollColumnIntoView(columnPosLeft[e],columnPosRight[e])}function setActiveCellInternal(e,t,n,o){null!==activeCellNode&&(makeActiveCellNormal(),$(activeCellNode).removeClass("active"),rowsCache[activeRow]&&$(rowsCache[activeRow].rowNode).removeClass("active"));null!=(activeCellNode=e)?(activeRow=getRowFromNode(activeCellNode.parentNode),activeCell=activePosX=getCellFromNode(activeCellNode),null==t&&(t=activeRow==getDataLength()||options.autoEdit),options.showCellSelection&&($(activeCellNode).addClass("active"),$(rowsCache[activeRow].rowNode).addClass("active")),options.editable&&t&&isCellPotentiallyEditable(activeRow,activeCell)&&(clearTimeout(h_editorLoader),options.asyncEditorLoading?h_editorLoader=setTimeout(function(){makeActiveCellEditable(void 0,n)},options.asyncEditorLoadDelay):makeActiveCellEditable(void 0,n))):activeRow=activeCell=null,o||trigger(self.onActiveCellChanged,getActiveCell())}function clearTextSelection(){if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}else if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}}function isCellPotentiallyEditable(e,t){var n=getDataLength();return!(e<n&&!getDataItem(e))&&(!(columns[t].cannotTriggerInsert&&e>=n)&&!!getEditor(e,t))}function makeActiveCellNormal(){if(currentEditor){if(trigger(self.onBeforeCellEditorDestroy,{editor:currentEditor,grid:self}),currentEditor.destroy(),currentEditor=null,activeCellNode){var e=getDataItem(activeRow);if($(activeCellNode).removeClass("editable invalid"),e){var t=columns[activeCell],n=getFormatter(activeRow,t),o=n(activeRow,activeCell,getDataItemValueForColumn(e,t),t,e,self);applyFormatResultToCellNode(o,activeCellNode),invalidatePostProcessingResults(activeRow)}}navigator.userAgent.toLowerCase().match(/msie/)&&clearTextSelection(),getEditorLock().deactivate(editController)}}function makeActiveCellEditable(e,t){if(activeCellNode){if(!options.editable)throw new Error("Grid : makeActiveCellEditable : should never get called when options.editable is false");if(clearTimeout(h_editorLoader),isCellPotentiallyEditable(activeRow,activeCell)){var n=columns[activeCell],o=getDataItem(activeRow);if(!1!==trigger(self.onBeforeEditCell,{row:activeRow,cell:activeCell,item:o,column:n,grid:self})){getEditorLock().activate(editController),$(activeCellNode).addClass("editable");var r=e||getEditor(activeRow,activeCell);e||r.suppressClearOnEdit||(activeCellNode.innerHTML=""),currentEditor=new r({grid:self,gridPosition:absBox($container[0]),position:absBox(activeCellNode),container:activeCellNode,column:n,item:o||{},commitChanges:commitEditAndSetFocus,cancelChanges:cancelEditAndSetFocus}),o&&(currentEditor.loadValue(o),t&¤tEditor.preClick&¤tEditor.preClick()),serializedEditorValue=currentEditor.serializeValue(),currentEditor.position&&handleActiveCellPositionChange()}else setFocus()}}}function commitEditAndSetFocus(){getEditorLock().commitCurrentEdit()&&(setFocus(),options.autoEdit&&navigateDown())}function cancelEditAndSetFocus(){getEditorLock().cancelCurrentEdit()&&setFocus()}function absBox(e){var t={top:e.offsetTop,left:e.offsetLeft,bottom:0,right:0,width:$(e).outerWidth(),height:$(e).outerHeight(),visible:!0};t.bottom=t.top+t.height,t.right=t.left+t.width;for(var n=e.offsetParent;(e=e.parentNode)!=document.body&&null!=e;)t.visible&&e.scrollHeight!=e.offsetHeight&&"visible"!=$(e).css("overflowY")&&(t.visible=t.bottom>e.scrollTop&&t.top<e.scrollTop+e.clientHeight),t.visible&&e.scrollWidth!=e.offsetWidth&&"visible"!=$(e).css("overflowX")&&(t.visible=t.right>e.scrollLeft&&t.left<e.scrollLeft+e.clientWidth),t.left-=e.scrollLeft,t.top-=e.scrollTop,e===n&&(t.left+=e.offsetLeft,t.top+=e.offsetTop,n=e.offsetParent),t.bottom=t.top+t.height,t.right=t.left+t.width;return t}function getActiveCellPosition(){return absBox(activeCellNode)}function getGridPosition(){return absBox($container[0])}function handleActiveCellPositionChange(){if(activeCellNode&&(trigger(self.onActiveCellPositionChanged,{grid:self}),currentEditor)){var e=getActiveCellPosition();currentEditor.show&¤tEditor.hide&&(e.visible?currentEditor.show():currentEditor.hide()),currentEditor.position&¤tEditor.position(e)}}function getCellEditor(){return currentEditor}function getActiveCell(){return activeCellNode?{row:activeRow,cell:activeCell,grid:self}:null}function getActiveCellNode(){return activeCellNode}function scrollRowIntoView(e,t){var n=e*options.rowHeight,o=(e+1)*options.rowHeight-viewportH+(viewportHasHScroll?scrollbarDimensions.height:0);(e+1)*options.rowHeight>scrollTop+viewportH+offset?(scrollTo(t?n:o),render()):e*options.rowHeight<scrollTop+offset&&(scrollTo(t?o:n),render())}function scrollRowToTop(e){scrollTo(e*options.rowHeight),render()}function scrollPage(e){var t=e*numVisibleRows;if(scrollTo((getRowFromPosition(scrollTop)+t)*options.rowHeight),render(),options.enableCellNavigation&&null!=activeRow){var n=activeRow+t,o=getDataLengthIncludingAddNew();n>=o&&(n=o-1),n<0&&(n=0);for(var r=0,i=null,l=activePosX;r<=activePosX;)canCellBeActive(n,r)&&(i=r),r+=getColspan(n,r);null!==i?(setActiveCellInternal(getCellNode(n,i)),activePosX=l):resetActiveCell()}}function navigatePageDown(){scrollPage(1)}function navigatePageUp(){scrollPage(-1)}function getColspan(e,t){var n=data.getItemMetadata&&data.getItemMetadata(e);if(!n||!n.columns)return 1;var o=n.columns[columns[t].id]||n.columns[t],r=o&&o.colspan;return r="*"===r?columns.length-t:r||1}function findFirstFocusableCell(e){for(var t=0;t<columns.length;){if(canCellBeActive(e,t))return t;t+=getColspan(e,t)}return null}function findLastFocusableCell(e){for(var t=0,n=null;t<columns.length;)canCellBeActive(e,t)&&(n=t),t+=getColspan(e,t);return n}function gotoRight(e,t,n){if(t>=columns.length)return null;do{t+=getColspan(e,t)}while(t<columns.length&&!canCellBeActive(e,t));return t<columns.length?{row:e,cell:t,posX:t}:null}function gotoLeft(e,t,n){if(t<=0)return null;var o=findFirstFocusableCell(e);if(null===o||o>=t)return null;for(var r,i={row:e,cell:o,posX:o};;){if(!(r=gotoRight(i.row,i.cell,i.posX)))return null;if(r.cell>=t)return i;i=r}}function gotoDown(e,t,n){for(var o,r=getDataLengthIncludingAddNew();;){if(++e>=r)return null;for(o=t=0;t<=n;)o=t,t+=getColspan(e,t);if(canCellBeActive(e,o))return{row:e,cell:o,posX:n}}}function gotoUp(e,t,n){for(var o;;){if(--e<0)return null;for(o=t=0;t<=n;)o=t,t+=getColspan(e,t);if(canCellBeActive(e,o))return{row:e,cell:o,posX:n}}}function gotoNext(e,t,n){if(null==e&&null==t&&(e=t=n=0,canCellBeActive(e,t)))return{row:e,cell:t,posX:t};var o=gotoRight(e,t,n);if(o)return o;var r=null,i=getDataLengthIncludingAddNew();for(e===i-1&&e--;++e<i;)if(null!==(r=findFirstFocusableCell(e)))return{row:e,cell:r,posX:r};return null}function gotoPrev(e,t,n){if(null==e&&null==t&&(e=getDataLengthIncludingAddNew()-1,t=n=columns.length-1,canCellBeActive(e,t)))return{row:e,cell:t,posX:t};for(var o,r;!o&&!(o=gotoLeft(e,t,n));){if(--e<0)return null;t=0,null!==(r=findLastFocusableCell(e))&&(o={row:e,cell:r,posX:r})}return o}function navigateRight(){return navigate("right")}function navigateLeft(){return navigate("left")}function navigateDown(){return navigate("down")}function navigateUp(){return navigate("up")}function navigateNext(){return navigate("next")}function navigatePrev(){return navigate("prev")}function navigate(e){if(!options.enableCellNavigation)return!1;if(!activeCellNode&&"prev"!=e&&"next"!=e)return!1;if(!getEditorLock().commitCurrentEdit())return!0;setFocus();tabbingDirection={up:-1,down:1,left:-1,right:1,prev:-1,next:1}[e];var t={up:gotoUp,down:gotoDown,left:gotoLeft,right:gotoRight,prev:gotoPrev,next:gotoNext},n=t[e],o=n(activeRow,activeCell,activePosX);if(o){var r=o.row==getDataLength();return scrollCellIntoView(o.row,o.cell,!r),setActiveCellInternal(getCellNode(o.row,o.cell)),activePosX=o.posX,!0}return setActiveCellInternal(getCellNode(activeRow,activeCell)),!1}function getCellNode(e,t){return rowsCache[e]?(ensureCellNodesInRowsCache(e),rowsCache[e].cellNodesByColumnIdx[t]):null}function setActiveCell(e,t,n,o,r){initialized&&(e>getDataLength()||e<0||t>=columns.length||t<0||options.enableCellNavigation&&(scrollCellIntoView(e,t,!1),setActiveCellInternal(getCellNode(e,t),n,o,r)))}function canCellBeActive(e,t){if(!options.enableCellNavigation||e>=getDataLengthIncludingAddNew()||e<0||t>=columns.length||t<0)return!1;var n=data.getItemMetadata&&data.getItemMetadata(e);if(n&&"boolean"==typeof n.focusable)return n.focusable;var o=n&&n.columns;return o&&o[columns[t].id]&&"boolean"==typeof o[columns[t].id].focusable?o[columns[t].id].focusable:o&&o[t]&&"boolean"==typeof o[t].focusable?o[t].focusable:columns[t].focusable}function canCellBeSelected(e,t){if(e>=getDataLength()||e<0||t>=columns.length||t<0)return!1;var n=data.getItemMetadata&&data.getItemMetadata(e);if(n&&"boolean"==typeof n.selectable)return n.selectable;var o=n&&n.columns&&(n.columns[columns[t].id]||n.columns[t]);return o&&"boolean"==typeof o.selectable?o.selectable:columns[t].selectable}function gotoCell(e,t,n){if(initialized&&canCellBeActive(e,t)&&getEditorLock().commitCurrentEdit()){scrollCellIntoView(e,t,!1);var o=getCellNode(e,t);setActiveCellInternal(o,n||e===getDataLength()||options.autoEdit),currentEditor||setFocus()}}function commitCurrentEdit(){var e=getDataItem(activeRow),t=columns[activeCell];if(currentEditor){if(currentEditor.isValueChanged()){var n=currentEditor.validate();if(n.valid){if(activeRow<getDataLength()){var o={row:activeRow,cell:activeCell,editor:currentEditor,serializedValue:currentEditor.serializeValue(),prevSerializedValue:serializedEditorValue,execute:function(){this.editor.applyValue(e,this.serializedValue),updateRow(this.row),trigger(self.onCellChange,{row:activeRow,cell:activeCell,item:e,grid:self})},undo:function(){this.editor.applyValue(e,this.prevSerializedValue),updateRow(this.row),trigger(self.onCellChange,{row:activeRow,cell:activeCell,item:e,grid:self})}};options.editCommandHandler?(makeActiveCellNormal(),options.editCommandHandler(e,t,o)):(o.execute(),makeActiveCellNormal())}else{var r={};currentEditor.applyValue(r,currentEditor.serializeValue()),makeActiveCellNormal(),trigger(self.onAddNewRow,{item:r,column:t,grid:self})}return!getEditorLock().isActive()}return $(activeCellNode).removeClass("invalid"),$(activeCellNode).width(),$(activeCellNode).addClass("invalid"),trigger(self.onValidationError,{editor:currentEditor,cellNode:activeCellNode,validationResults:n,row:activeRow,cell:activeCell,column:t,grid:self}),currentEditor.focus(),!1}makeActiveCellNormal()}return!0}function cancelCurrentEdit(){return makeActiveCellNormal(),!0}function rowsToRanges(e){for(var t=[],n=columns.length-1,o=0;o<e.length;o++)t.push(new Slick.Range(e[o],0,e[o],n));return t}function getSelectedRows(){if(!selectionModel)throw new Error("Selection model is not set");return selectedRows}function setSelectedRows(e){if(!selectionModel)throw new Error("Selection model is not set");selectionModel.setSelectedRanges(rowsToRanges(e))}$.fn.drag||require(414),$.fn.drop||require(415);var defaults={explicitInitialization:!1,rowHeight:25,defaultColumnWidth:80,enableAddRow:!1,leaveSpaceForNewRows:!1,editable:!1,autoEdit:!0,enableCellNavigation:!0,enableColumnReorder:!0,asyncEditorLoading:!1,asyncEditorLoadDelay:100,forceFitColumns:!1,enableAsyncPostRender:!1,asyncPostRenderDelay:50,enableAsyncPostRenderCleanup:!1,asyncPostRenderCleanupDelay:40,autoHeight:!1,editorLock:Slick.GlobalEditorLock,showHeaderRow:!1,headerRowHeight:25,createFooterRow:!1,showFooterRow:!1,footerRowHeight:25,createPreHeaderPanel:!1,showPreHeaderPanel:!1,preHeaderPanelHeight:25,showTopPanel:!1,topPanelHeight:25,formatterFactory:null,editorFactory:null,cellFlashingCssClass:"flashing",selectedCellCssClass:"selected",multiSelect:!0,enableTextSelectionOnCells:!1,dataItemColumnValueExtractor:null,fullWidthRows:!1,multiColumnSort:!1,numberedMultiColumnSort:!1,tristateMultiColumnSort:!1,defaultFormatter:defaultFormatter,forceSyncScrolling:!1,addNewRowCssClass:"new-row",preserveCopiedSelectionOnPaste:!1,showCellSelection:!0},columnDefaults={name:"",resizable:!0,sortable:!1,minWidth:30,rerenderOnResize:!1,headerCssClass:null,defaultSortAsc:!0,focusable:!0,selectable:!0},th,h,ph,n,cj,page=0,offset=0,vScrollDir=1,initialized=!1,$container,uid="slickgrid_"+Math.round(1e6*Math.random()),self=this,$focusSink,$focusSink2,$headerScroller,$headers,$headerRow,$headerRowScroller,$headerRowSpacer,$footerRow,$footerRowScroller,$footerRowSpacer,$preHeaderPanel,$preHeaderPanelScroller,$preHeaderPanelSpacer,$topPanelScroller,$topPanel,$viewport,$canvas,$style,$boundAncestors,stylesheet,columnCssRulesL,columnCssRulesR,viewportH,viewportW,canvasWidth,viewportHasHScroll,viewportHasVScroll,headerColumnWidthDiff=0,headerColumnHeightDiff=0,cellWidthDiff=0,cellHeightDiff=0,jQueryNewWidthBehaviour=!1,absoluteColumnMinWidth,sortIndicatorCssClass="slick-sort-indicator",tabbingDirection=1,activePosX,activeRow,activeCell,activeCellNode=null,currentEditor=null,serializedEditorValue,editController,rowsCache={},renderedRows=0,numVisibleRows,prevScrollTop=0,scrollTop=0,lastRenderedScrollTop=0,lastRenderedScrollLeft=0,prevScrollLeft=0,scrollLeft=0,selectionModel,selectedRows=[],plugins=[],cellCssClasses={},columnsById={},sortColumns=[],columnPosLeft=[],columnPosRight=[],pagingActive=!1,pagingIsLastPage=!1,h_editorLoader=null,h_render=null,h_postrender=null,h_postrenderCleanup=null,postProcessedRows={},postProcessToRow=null,postProcessFromRow=null,postProcessedCleanupQueue=[],postProcessgroupId=0,counter_rows_rendered=0,counter_rows_removed=0,rowNodeFromLastMouseWheelEvent,zombieRowNodeFromLastMouseWheelEvent,zombieRowCacheFromLastMouseWheelEvent,zombieRowPostProcessedFromLastMouseWheelEvent,cssShow={position:"absolute",visibility:"hidden",display:"block"},$hiddenParents,oldProps=[];this.debug=function(){var e="";e+="\ncounter_rows_rendered: "+counter_rows_rendered,e+="\ncounter_rows_removed: "+counter_rows_removed,e+="\nrenderedRows: "+renderedRows,e+="\nnumVisibleRows: "+numVisibleRows,e+="\nmaxSupportedCssHeight: "+maxSupportedCssHeight,e+="\nn(umber of pages): "+n,e+="\n(current) page: "+page,e+="\npage height (ph): "+ph,e+="\nvScrollDir: "+vScrollDir,alert(e)},this.eval=function(expr){return eval(expr)},$.extend(this,{slickGridVersion:"2.3.4",onScroll:new Slick.Event,onSort:new Slick.Event,onHeaderMouseEnter:new Slick.Event,onHeaderMouseLeave:new Slick.Event,onHeaderContextMenu:new Slick.Event,onHeaderClick:new Slick.Event,onHeaderCellRendered:new Slick.Event,onBeforeHeaderCellDestroy:new Slick.Event,onHeaderRowCellRendered:new Slick.Event,onFooterRowCellRendered:new Slick.Event,onBeforeHeaderRowCellDestroy:new Slick.Event,onBeforeFooterRowCellDestroy:new Slick.Event,onMouseEnter:new Slick.Event,onMouseLeave:new Slick.Event,onClick:new Slick.Event,onDblClick:new Slick.Event,onContextMenu:new Slick.Event,onKeyDown:new Slick.Event,onAddNewRow:new Slick.Event,onBeforeAppendCell:new Slick.Event,onValidationError:new Slick.Event,onViewportChanged:new Slick.Event,onColumnsReordered:new Slick.Event,onColumnsResized:new Slick.Event,onCellChange:new Slick.Event,onBeforeEditCell:new Slick.Event,onBeforeCellEditorDestroy:new Slick.Event,onBeforeDestroy:new Slick.Event,onActiveCellChanged:new Slick.Event,onActiveCellPositionChanged:new Slick.Event,onDragInit:new Slick.Event,onDragStart:new Slick.Event,onDrag:new Slick.Event,onDragEnd:new Slick.Event,onSelectedRowsChanged:new Slick.Event,onCellCssStylesChanged:new Slick.Event,registerPlugin:registerPlugin,unregisterPlugin:unregisterPlugin,getColumns:getColumns,setColumns:setColumns,getColumnIndex:getColumnIndex,updateColumnHeader:updateColumnHeader,setSortColumn:setSortColumn,setSortColumns:setSortColumns,getSortColumns:getSortColumns,autosizeColumns:autosizeColumns,getOptions:getOptions,setOptions:setOptions,getData:getData,getDataLength:getDataLength,getDataItem:getDataItem,setData:setData,getSelectionModel:getSelectionModel,setSelectionModel:setSelectionModel,getSelectedRows:getSelectedRows,setSelectedRows:setSelectedRows,getContainerNode:getContainerNode,updatePagingStatusFromView:updatePagingStatusFromView,render:render,invalidate:invalidate,invalidateRow:invalidateRow,invalidateRows:invalidateRows,invalidateAllRows:invalidateAllRows,updateCell:updateCell,updateRow:updateRow,getViewport:getVisibleRange,getRenderedRange:getRenderedRange,resizeCanvas:resizeCanvas,updateRowCount:updateRowCount,scrollRowIntoView:scrollRowIntoView,scrollRowToTop:scrollRowToTop,scrollCellIntoView:scrollCellIntoView,scrollColumnIntoView:scrollColumnIntoView,getCanvasNode:getCanvasNode,getUID:getUID,getHeaderColumnWidthDiff:getHeaderColumnWidthDiff,getScrollbarDimensions:getScrollbarDimensions,getHeadersWidth:getHeadersWidth,getCanvasWidth:getCanvasWidth,focus:setFocus,getCellFromPoint:getCellFromPoint,getCellFromEvent:getCellFromEvent,getActiveCell:getActiveCell,setActiveCell:setActiveCell,getActiveCellNode:getActiveCellNode,getActiveCellPosition:getActiveCellPosition,resetActiveCell:resetActiveCell,editActiveCell:makeActiveCellEditable,getCellEditor:getCellEditor,getCellNode:getCellNode,getCellNodeBox:getCellNodeBox,canCellBeSelected:canCellBeSelected,canCellBeActive:canCellBeActive,navigatePrev:navigatePrev,navigateNext:navigateNext,navigateUp:navigateUp,navigateDown:navigateDown,navigateLeft:navigateLeft,navigateRight:navigateRight,navigatePageUp:navigatePageUp,navigatePageDown:navigatePageDown,gotoCell:gotoCell,getTopPanel:getTopPanel,setTopPanelVisibility:setTopPanelVisibility,getPreHeaderPanel:getPreHeaderPanel,setPreHeaderPanelVisibility:setPreHeaderPanelVisibility,setHeaderRowVisibility:setHeaderRowVisibility,getHeaderRow:getHeaderRow,getHeaderRowColumn:getHeaderRowColumn,setFooterRowVisibility:setFooterRowVisibility,getFooterRow:getFooterRow,getFooterRowColumn:getFooterRowColumn,getGridPosition:getGridPosition,flashCell:flashCell,addCellCssStyles:addCellCssStyles,setCellCssStyles:setCellCssStyles,removeCellCssStyles:removeCellCssStyles,getCellCssStyles:getCellCssStyles,init:finishInitialization,destroy:destroy,getEditorLock:getEditorLock,getEditController:getEditController}),init()}/**
* @license
* (c) 2009-2016 Michael Leibman
* michael{dot}leibman{at}gmail{dot}com
* http://github.com/mleibman/slickgrid
*
* Distributed under MIT license.
* All rights reserved.
*
* SlickGrid v2.3
*
* NOTES:
* Cell/row DOM manipulations are done directly bypassing jQuery's DOM manipulation methods.
* This increases the speed dramatically, but can only be done safely because there are no event handlers
* or data associated with any cell/row DOM nodes. Cell editors must make sure they implement .destroy()
* and do proper cleanup.
*/
var $=require(420),Slick=require(418),scrollbarDimensions,maxSupportedCssHeight;module.exports={Grid:SlickGrid}},420:function(e,t,n){t.exports="undefined"!=typeof $?$:e(413)},421:function(e,t,n){function o(e,t,n){return i(e,t,n)}var r=e(422),i=r.template;o._=r,t.exports=o,"function"==typeof define&&define.amd?define(function(){return o}):"undefined"==typeof window&&"undefined"==typeof navigator||(window.UnderscoreTemplate=o)},422:function(e,t,n){
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
var o={},r=Array.prototype,i=Object.prototype,l=r.slice,a=i.toString,s=i.hasOwnProperty,u=r.forEach,c=Object.keys,d=Array.isArray,p=function(){},f=p.each=p.forEach=function(e,t,n){if(null!=e)if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e)===o)return}else for(var l=p.keys(e),r=0,i=l.length;r<i;r++)if(t.call(n,e[l[r]],l[r],e)===o)return};p.keys=c||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)p.has(e,n)&&t.push(n);return t},p.defaults=function(e){return f(l.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e},p.isArray=d||function(e){return"[object Array]"===a.call(e)},p.has=function(e,t){if(!p.isArray(t))return null!=e&&s.call(e,t);for(var n=t.length,o=0;o<n;o++){var r=t[o];if(null==e||!s.call(e,r))return!1;e=e[r]}return!!n};var h={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}},g={escape:new RegExp("["+p.keys(h.escape).join("")+"]","g")};p.each(["escape"],function(e){p[e]=function(t){return null==t?"":(""+t).replace(g[e],function(t){return h[e][t]})}}),p.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var m=/(.)^/,v={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},w=/\\|'|\r|\n|\t|\u2028|\u2029/g;p.template=function(e,t,n){var o;n=p.defaults({},n,p.templateSettings);var r=new RegExp([(n.escape||m).source,(n.interpolate||m).source,(n.evaluate||m).source].join("|")+"|$","g"),i=0,l="__p+='";e.replace(r,function(t,n,o,r,a){return l+=e.slice(i,a).replace(w,function(e){return"\\"+v[e]}),n&&(l+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),o&&(l+="'+\n((__t=("+o+"))==null?'':__t)+\n'"),r&&(l+="';\n"+r+"\n__p+='"),i=a+t.length,t}),l+="';\n",n.variable||(l="with(obj||{}){\n"+l+"}\n"),l="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+l+"return __p;\n";try{o=new Function(n.variable||"obj","_",l)}catch(e){throw e.source=l,e}if(t)return o(t,p);var a=function(e){return o.call(this,e,p)};return a.source="function("+(n.variable||"obj")+"){\n"+l+"}",a},t.exports=p}},{"models/widgets/tables/cell_editors":405,"models/widgets/tables/cell_formatters":406,"models/widgets/tables/data_table":407,"models/widgets/tables/index":408,"models/widgets/tables/main":409,"models/widgets/tables/table_column":410,"models/widgets/tables/table_widget":411,"models/widgets/widget":412})}(a8274.Bokeh)}(this);/*!
Copyright (c) 2012, Anaconda, 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 Anaconda 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.
*/
//# sourceMappingURL=bokeh-tables.min.js.map
/* END bokeh-tables.min.js */
</script>
<script type="text/javascript">
/* BEGIN bokeh-gl.min.js */
!function(t,e){!function(t){(function(e,n,a){if(null!=t)return t.register_plugin(e,n,427);throw new Error("Cannot find Bokeh. You have to load it prior to loading plugins.")})({423:function(t,e,n){var a=t(26),s=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.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.prototype.render=function(t,e,n){var a,s,i,r,o,l,_;return l=_=1,h=this.glyph.renderer.map_to_screen([0*l,1*l,2*l],[0*_,1*_,2*_]),a=h[0],s=h[1],l=100/Math.min(Math.max(Math.abs(a[1]-a[0]),1e-12),1e12),_=100/Math.min(Math.max(Math.abs(s[1]-s[0]),1e-12),1e12),c=this.glyph.renderer.map_to_screen([0*l,1*l,2*l],[0*_,1*_,2*_]),a=c[0],s=c[1],!(Math.abs(a[1]-a[0]-(a[2]-a[1]))>1e-6||Math.abs(s[1]-s[0]-(s[2]-s[1]))>1e-6)&&(u=[(a[1]-a[0])/l,(s[1]-s[0])/_],i=u[0],r=u[1],o={pixel_ratio:t.pixel_ratio,width:t.glcanvas.width,height:t.glcanvas.height,dx:a[0]/i,dy:s[0]/r,sx:i,sy:r},this.draw(e,n,o),!0);var h,c,u},t}();n.BaseGLGlyph=s,s.prototype.GLYPH="",s.prototype.VERT="",s.prototype.FRAG="",n.line_width=function(t){return t<2&&(t=Math.sqrt(2*t)),t},n.fill_array_with_float=function(t,e){var n,a,s,i;for(n=new Float32Array(t),a=s=0,i=t;0<=i?s<i:s>i;a=0<=i?++s:--s)n[a]=e;return n},n.fill_array_with_vec=function(t,e,n){var a,s,i,r,o,l,_;for(a=new Float32Array(t*e),s=r=0,l=t;0<=l?r<l:r>l;s=0<=l?++r:--r)for(i=o=0,_=e;0<=_?o<_:o>_;i=0<=_?++o:--o)a[s*e+i]=n[i];return a},n.visual_prop_is_singular=function(t,e){return void 0!==t[e].spec.value},n.attach_float=function(t,e,a,s,i,r){var o;return i.doit?n.visual_prop_is_singular(i,r)?(e.used=!1,t.set_attribute(a,"float",i[r].value())):(e.used=!0,o=new Float32Array(i.cache[r+"_array"]),e.set_size(4*s),e.set_data(0,o),t.set_attribute(a,"float",e)):(e.used=!1,t.set_attribute(a,"float",[0]))},n.attach_color=function(t,e,s,i,r,o){var l,_,h,c,u,f,d,p,g,v,y,x;if(4,c=o+"_color",_=o+"_alpha",r.doit){if(n.visual_prop_is_singular(r,c)&&n.visual_prop_is_singular(r,_))return e.used=!1,x=a.color2rgba(r[c].value(),r[_].value()),t.set_attribute(s,"vec4",x);for(e.used=!0,u=n.visual_prop_is_singular(r,c)?function(){var t,e,n;for(n=[],f=t=0,e=i;0<=e?t<e:t>e;f=0<=e?++t:--t)n.push(r[c].value());return n}():r.cache[c+"_array"],h=n.visual_prop_is_singular(r,_)?n.fill_array_with_float(i,r[_].value()):r.cache[_+"_array"],l=new Float32Array(4*i),f=p=0,v=i;0<=v?p<v:p>v;f=0<=v?++p:--p)for(x=a.color2rgba(u[f],h[f]),d=g=0,y=4;0<=y?g<y:g>y;d=0<=y?++g:--g)l[4*f+d]=x[d];return e.set_size(4*i*4),e.set_data(0,l),t.set_attribute(s,"vec4",e)}return e.used=!1,t.set_attribute(s,"vec4",[0,0,0,0])}},424:function(t,e,n){var a,s,i,r,o,l,_,h,c,u=function(t,e){return Array.isArray(t)&&Array.isArray(e)?t.concat(e):t+e},f=function(t,e){if(null==e);else{if(Array.isArray(e)){for(var n=0;n<e.length;n++)if(d(t,e[n]))return!0;return!1}if(e.constructor===Object){for(var a in e)if(t==a)return!0;return!1}if(e.constructor==String)return e.indexOf(t)>=0}var s=Error("Not a container: "+e);throw s.name="TypeError",s},d=function t(e,n){if(null==e||null==n);else{if(Array.isArray(e)&&Array.isArray(n)){for(var a=0,s=e.length==n.length;s&&a<e.length;)s=t(e[a],n[a]),a+=1;return s}if(e.constructor===Object&&n.constructor===Object){var i=Object.keys(e),r=Object.keys(n);i.sort(),r.sort();for(var o,a=0,s=t(i,r);s&&a<i.length;)o=i[a],s=t(e[o],n[o]),a+=1;return s}}return e==n},p=function(t,e){if(void 0===t||"undefined"!=typeof window&&window===t||"undefined"!=typeof global&&global===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,e)},g=function(t,e){if(("number"==typeof t)+("number"==typeof e)===1){if(t.constructor===String)return b.call(t,e);if(e.constructor===String)return b.call(e,t);if(Array.isArray(e)){var n=t;t=e,e=n}if(Array.isArray(t)){for(var a=[],s=0;s<e;s++)a=a.concat(t);return a}}return t*e},v=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){if(!Array.isArray(this))return this.append.apply(this,arguments);this.push(t)},x=function(t,e){return this.constructor!==Object?this.get.apply(this,arguments):void 0!==this[t]?this[t]:void 0!==e?e:null},m=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 n=Error(t);throw n.name="ValueError",n},b=function(t){if(this.repeat)return this.repeat(t);if(t<1)return"";for(var e="",n=this.valueOf();t>1;)1&t&&(e+=n),t>>=1,n+=n;return e+n},w=function(t){return this.constructor!==String?this.startswith.apply(this,arguments):0==this.indexOf(t)};c=window.console,h=function(t,e){var n,a,s,i,r,o,l;for(e=void 0===e?"periodic check":e,i=[];a=t.getError(),!(d(a,t.NO_ERROR)||v(i)&&d(a,i[i.length-1]));)y.call(i,a);if(i.length){for(r="","object"!=typeof(o=i)||Array.isArray(o)||(o=Object.keys(o)),l=0;l<o.length;l+=1)n=o[l],r=u(r,n);throw s=new Error("RuntimeError:OpenGL got errors ("+e+"): "+r),s.name="RuntimeError",s}return null},(s=function(){p(this,arguments)}).prototype._base_class=Object,s.prototype._class_name="GlooObject",s.prototype.__init__=function(t){if(this._gl=t,this.handle=null,this._create(),null===this.handle)throw"AssertionError: this.handle !== null";return null},s.prototype._create=function(){var t;throw t=new Error("NotImplementedError:"),t.name="NotImplementedError",t},((r=function(){p(this,arguments)}).prototype=Object.create(s.prototype))._base_class=s.prototype,r.prototype._class_name="Program",r.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"},r.prototype.ATYPEMAP={float:"vertexAttrib1f",vec2:"vertexAttrib2f",vec3:"vertexAttrib3f",vec4:"vertexAttrib4f"},r.prototype.ATYPEINFO={float:[1,5126],vec2:[2,5126],vec3:[3,5126],vec4:[4,5126]},r.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},r.prototype.delete=function(){return this._gl.deleteProgram(this.handle),null},r.prototype.activate=function(){return this._gl.useProgram(this.handle),null},r.prototype.deactivate=function(){return this._gl.useProgram(0),null},r.prototype.set_shaders=function(t,e){var n,a,s,i,r,o,l,_,h,c,f,d,p;for(o=this._gl,this._linked=!1,p=o.createShader(o.VERTEX_SHADER),r=o.createShader(o.FRAGMENT_SHADER),f=[[t,p,"vertex"],[e,r,"fragment"]],_=0;_<2;_+=1)if(c=f[_],n=c[0],l=c[1],d=c[2],o.shaderSource(l,n),o.compileShader(l),h=o.getShaderParameter(l,o.COMPILE_STATUS),!v(h))throw i=o.getShaderInfoLog(l),s=new Error("RuntimeError:"+u("errors in "+d+" shader:\n",i)),s.name="RuntimeError",s;if(o.attachShader(this.handle,p),o.attachShader(this.handle,r),o.linkProgram(this.handle),!v(o.getProgramParameter(this.handle,o.LINK_STATUS)))throw a=new Error("RuntimeError:Program link error:\n"+o.getProgramInfoLog(this.handle)),a.name="RuntimeError",a;return this._unset_variables=this._get_active_attributes_and_uniforms(),o.detachShader(this.handle,p),o.detachShader(this.handle,r),o.deleteShader(p),o.deleteShader(r),this._known_invalid=[],this._linked=!0,null},r.prototype._get_active_attributes_and_uniforms=function(){var t,e,n,a,s,i,r,o,l,_,h,c,f,d,p,g,x,m,b;for(o=this._gl,this.locations={},d=new window.RegExp("(\\w+)\\s*(\\[(\\d+)\\])\\s*"),s=o.getProgramParameter(this.handle,o.ACTIVE_UNIFORMS),e=o.getProgramParameter(this.handle,o.ACTIVE_ATTRIBUTES),m=[],"object"!=typeof(g=[[t=[],e,o.getActiveAttrib,o.getAttribLocation],[m,s,o.getActiveUniform,o.getUniformLocation]])||Array.isArray(g)||(g=Object.keys(g)),x=0;x<g.length;x+=1)for(b=g[x],n=(p=b)[0],a=p[1],i=p[2],r=p[3],l=0;l<a;l+=1){if(_=i.call(o,this.handle,l),f=_.name,c=f.match(d),v(c))for(f=c[1],h=0;h<_.size;h+=1)y.call(n,[f+"["+h+"]",_.type]);else y.call(n,[f,_.type]);this.locations[f]=r.call(o,this.handle,f)}return u(function(){var e,n,a,s=[];for("object"!=typeof(n=t)||Array.isArray(n)||(n=Object.keys(n)),a=0;a<n.length;a++)e=n[a],s.push(e[0]);return s}.apply(this),function(){var t,e,n,a=[];for("object"!=typeof(e=m)||Array.isArray(e)||(e=Object.keys(e)),n=0;n<e.length;n++)t=e[n],a.push(t[0]);return a}.apply(this))},r.prototype.set_texture=function(t,e){var n,a,s;if(!v(this._linked))throw n=new Error("RuntimeError:Cannot set uniform when program has no code"),n.name="RuntimeError",n;return a=x.call(this.locations,t,-1),v(a<0)?(f(t,this._known_invalid)||(y.call(this._known_invalid,t),c.log("Variable "+t+" is not an active texture")),null):(f(t,this._unset_variables)&&m.call(this._unset_variables,t),this.activate(),s=function(){return"function"==typeof this.keys?this.keys.apply(this,arguments):Object.keys(this)}.call(this._samplers).length,f(t,this._samplers)&&(s=this._samplers[t][this._samplers[t].length-1]),this._samplers[t]=[e._target,e.handle,s],this._gl.uniform1i(a,s),null)},r.prototype.set_uniform=function(t,e,n){var a,s,i,r,o,l,_;if(!v(this._linked))throw i=new Error("RuntimeError:Cannot set uniform when program has no code"),i.name="RuntimeError",i;if(o=x.call(this.locations,t,-1),v(o<0))return f(t,this._known_invalid)||(y.call(this._known_invalid,t),c.log("Variable "+t+" is not an active uniform")),null;if(f(t,this._unset_variables)&&m.call(this._unset_variables,t),s=1,w.call(e,"mat")||(a=x.call({int:"float",bool:"float"},e,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""}.call(e,"ib")),s=Math.floor(n.length/this.ATYPEINFO[a][0])),v(s>1))for(l=0;l<s;l+=1)f(t+"["+l+"]",this._unset_variables)&&f(_=t+"["+l+"]",this._unset_variables)&&m.call(this._unset_variables,_);return r=this.UTYPEMAP[e],this.activate(),w.call(e,"mat")?this._gl[r](o,!1,n):this._gl[r](o,n),null},r.prototype.set_attribute=function(t,e,n,a,s){var i,r,o,l,h,u,d,p;if(a=void 0===a?0:a,s=void 0===s?0:s,!v(this._linked))throw r=new Error("RuntimeError:Cannot set attribute when program has no code"),r.name="RuntimeError",r;return u=n instanceof _,h=x.call(this.locations,t,-1),v(h<0)?(f(t,this._known_invalid)||(y.call(this._known_invalid,t),v(u)&&v(s>0)||c.log("Variable "+t+" is not an active attribute")),null):(f(t,this._unset_variables)&&m.call(this._unset_variables,t),this.activate(),v(u)?(p=this.ATYPEINFO[e],d=p[0],l=p[1],o="vertexAttribPointer",i=[d,l,this._gl.FALSE,a,s],this._attributes[t]=[n.handle,h,o,i]):(o=this.ATYPEMAP[e],this._attributes[t]=[0,h,o,n]),null)},r.prototype._pre_draw=function(){var t,e,n,a,s,i,r,o,l,_,h,c;this.activate(),r=this._samplers;for(c in r)r.hasOwnProperty(c)&&(c=r[c],l=(i=c)[0],o=i[1],_=i[2],this._gl.activeTexture(u(this._gl.TEXTURE0,_)),this._gl.bindTexture(l,o));s=this._attributes;for(c in s)s.hasOwnProperty(c)&&(c=s[c],h=(a=c)[0],e=a[1],n=a[2],t=a[3],v(h)?(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,h),this._gl.enableVertexAttribArray(e),this._gl[n].apply(this._gl,[].concat([e],t))):(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,null),this._gl.disableVertexAttribArray(e),this._gl[n].apply(this._gl,[].concat([e],t))));return v(this._validated)||(this._validated=!0,this._validate()),null},r.prototype._validate=function(){var t;if(this._unset_variables.length&&c.log("Program has unset variables: "+this._unset_variables),this._gl.validateProgram(this.handle),!v(this._gl.getProgramParameter(this.handle,this._gl.VALIDATE_STATUS)))throw c.log(this._gl.getProgramInfoLog(this.handle)),t=new Error("RuntimeError:Program validation error"),t.name="RuntimeError",t;return null},r.prototype.draw=function(t,e){var n,a,s,r,o;if(!v(this._linked))throw a=new Error("RuntimeError:Cannot draw program if code has not been set"),a.name="RuntimeError",a;return h(this._gl,"before draw"),v(e instanceof i)?(this._pre_draw(),e.activate(),n=e._buffer_size/2,r=this._gl.UNSIGNED_SHORT,this._gl.drawElements(t,n,r,0),e.deactivate()):(s=(o=e)[0],n=o[1],v(n)&&(this._pre_draw(),this._gl.drawArrays(t,s,n))),h(this._gl,"after draw"),null},((a=function(){p(this,arguments)}).prototype=Object.create(s.prototype))._base_class=s.prototype,a.prototype._class_name="Buffer",a.prototype._target=null,a.prototype._usage=35048,a.prototype._create=function(){return this.handle=this._gl.createBuffer(),this._buffer_size=0,null},a.prototype.delete=function(){return this._gl.deleteBuffer(this.handle),null},a.prototype.activate=function(){return this._gl.bindBuffer(this._target,this.handle),null},a.prototype.deactivate=function(){return this._gl.bindBuffer(this._target,null),null},a.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},a.prototype.set_data=function(t,e){return this.activate(),this._gl.bufferSubData(this._target,t,e),null},(_=function(){p(this,arguments)}).prototype=Object.create(a.prototype),_.prototype._base_class=a.prototype,_.prototype._class_name="VertexBuffer",_.prototype._target=34962,(i=function(){p(this,arguments)}).prototype=Object.create(a.prototype),i.prototype._base_class=a.prototype,i.prototype._class_name="IndexBuffer",i.prototype._target=34963,((o=function(){p(this,arguments)}).prototype=Object.create(s.prototype))._base_class=s.prototype,o.prototype._class_name="Texture2D",o.prototype._target=3553,o.prototype._types={Int8Array:5120,Uint8Array:5121,Int16Array:5122,Uint16Array:5123,Int32Array:5124,Uint32Array:5125,Float32Array:5126},o.prototype._create=function(){return this.handle=this._gl.createTexture(),this._shape_format=null,null},o.prototype.delete=function(){return this._gl.deleteTexture(this.handle),null},o.prototype.activate=function(){return this._gl.bindTexture(this._target,this.handle),null},o.prototype.deactivate=function(){return this._gl.bindTexture(this._target,0),null},o.prototype._get_alignment=function(t){var e,n,a;for("object"!=typeof(n=[4,8,2,1])||Array.isArray(n)||(n=Object.keys(n)),a=0;a<n.length;a+=1)if(e=n[a],d(t%e,0))return e;return null},o.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},o.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},o.prototype.set_size=function(t,e){var n,a,s;return a=t,n=a[0],s=a[1],d([n,s,e],this._shape_format)||(this._shape_format=[n,s,e],this.activate(),this._gl.texImage2D(this._target,0,e,s,n,0,e,this._gl.UNSIGNED_BYTE,null)),this.u_shape=[n,s],null},o.prototype.set_data=function(t,e,n){var a,s,i,r,o,l,_,h,c,u;if(d(e.length,2)&&(e=[e[0],e[1],1]),this.activate(),i=this._shape_format[2],l=e,o=l[0],h=l[1],l[2],_=t,u=_[0],c=_[1],null===(r=x.call(this._types,n.constructor.name,null)))throw s=new Error("ValueError:Type "+n.constructor.name+" not allowed for texture"),s.name="ValueError",s;return a=this._get_alignment(g(e[e.length-2],e[e.length-1])),d(a,4)||this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,a),this._gl.texSubImage2D(this._target,0,c,u,h,o,i,r,n),d(a,4)||this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,4),null},((l=function(){p(this,arguments)}).prototype=Object.create(o.prototype))._base_class=o.prototype,l.prototype._class_name="Texture3DLike",l.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 ",l.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 ",l.prototype._get_tile_info=function(t){var e,n,a,s;if(n=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),s=Math.floor(n/t[1]),s=Math.min(s,t[0]),a=window.Math.ceil(t[0]/s),v(g(a,t[2])>n))throw e=new Error("RuntimeError:Cannot fit 3D data with shape "+t+" onto simulated 2D texture."),e.name="RuntimeError",e;return[s,a]},l.prototype.set_size=function(t,e){var n,a,s,i;return i=this._get_tile_info(t),a=i[0],n=i[1],s=[g(t[1],a),g(t[2],n)],l.prototype._base_class.set_size.call(this,s,e),this.u_shape=[t[0],t[1],t[2]],this.u_tiles=[n,a],null},l.prototype.set_data=function(t,e,n){var a,s,i,r,o,_,h,c,u,f,p,y,x;if(d(e.length,3)&&(e=[e[0],e[1],e[2],1]),!function(t){for(var e=0;e<t.length;e++)if(!v(t[e]))return!1;return!0}(function(){var e,n,a,s=[];for("object"!=typeof(n=t)||Array.isArray(n)||(n=Object.keys(n)),a=0;a<n.length;a++)e=n[a],s.push(d(e,0));return s}.apply(this)))throw r=new Error("ValueError:Texture3DLike does not support nonzero offset (for now)"),r.name="ValueError",r;if(u=this._get_tile_info(e),_=u[0],o=u[1],c=[g(e[1],_),g(e[2],o),e[3]],d(o,1))l.prototype._base_class.set_data.call(this,[0,0],c,n);else for(a=n.constructor,x=new a(g(g(c[0],c[1]),c[2])),l.prototype._base_class.set_data.call(this,[0,0],c,x),y=0;y<e[0];y+=1)f=[Math.floor(y/o),y%o],h=f[0],s=f[1],i=Math.floor(n.length/e[0]),p=n.slice(g(y,i),g(y+1,i)),l.prototype._base_class.set_data.call(this,[g(h,e[1]),g(s,e[2])],e.slice(1),p);return null},e.exports={Buffer:a,GlooObject:s,IndexBuffer:i,Program:r,Texture2D:o,Texture3DLike:l,VertexBuffer:_,check_error:h,console:c}},425:function(t,e,n){var a=t(364);a.__exportStar(t(426),n),a.__exportStar(t(428),n)},426:function(t,e,n){var a,s=t(364),i=t(424),r=t(423),o=t(26);a=function(){function t(t){this._atlas={},this._index=0,this._width=256,this._height=256,this.tex=new i.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,n,a,s;return n=t.join("-"),void 0===this._atlas[n]&&(i=this.make_pattern(t),e=i[0],a=i[1],this.tex.set_data([this._index,0],[1,this._width],new Uint8Array(function(){var t,n,a;for(a=[],t=0,n=e.length;t<n;t++)s=e[t],a.push(s+10);return a}())),this._atlas[n]=[this._index/this._height,a],this._index+=1),this._atlas[n];var i},t.prototype.make_pattern=function(t){var e,n,a,s,i,r,o,l,_,h,c,u,f,d,p,g,v,y,x,m,b,w,P,A,E;for(t.length>1&&t.length%2&&(t=t.concat(t)),g=0,u=0,f=t.length;u<f;u++)w=t[u],g+=w;for(e=[],i=0,_=p=0,x=t.length+2;p<x;_=p+=2)a=Math.max(1e-4,t[_%t.length]),s=Math.max(1e-4,t[(_+1)%t.length]),e.push.apply(e,[i,i+a]),i+=a+s;for(d=this._width,n=new Float32Array(4*d),_=v=0,m=d;0<=m?v<m:v>m;_=0<=m?++v:--v){for(E=g*_/(d-1),h=0,A=1e16,c=y=0,b=e.length;0<=b?y<b:y>b;c=0<=b?++y:--y)(P=Math.abs(e[c]-E))<A&&(h=c,A=P);h%2==0?(l=E<=e[h]?1:0,o=e[h],r=e[h+1]):(l=E>e[h]?-1:0,o=e[h-1],r=e[h]),n[4*_+0]=e[h],n[4*_+1]=l,n[4*_+2]=o,n[4*_+3]=r}return[n,g]},t}();var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.init=function(){var t;return t=this.gl,this._scale_aspect=0,this.prog=new i.Program(t),this.prog.set_shaders(this.VERT,this.FRAG),this.index_buffer=new i.IndexBuffer(t),this.vbo_position=new i.VertexBuffer(t),this.vbo_tangents=new i.VertexBuffer(t),this.vbo_segment=new i.VertexBuffer(t),this.vbo_angles=new i.VertexBuffer(t),this.vbo_texcoord=new i.VertexBuffer(t),this.dash_atlas=new a(t)},e.prototype.draw=function(t,e,n){var a,s,i,r,o,l,_,h,c,u,f,d,p,g,v,y,x,m,b,w;if((_=e.glglyph).data_changed){if(!isFinite(n.dx)||!isFinite(n.dy))return;_._baked_offset=[n.dx,n.dy],_._set_data(),_.data_changed=!1}if(this.visuals_changed&&(this._set_visuals(),this.visuals_changed=!1),x=n.sx,m=n.sy,y=Math.sqrt(x*x+m*m),x/=y,m/=y,Math.abs(this._scale_aspect-m/x)>Math.abs(.001*this._scale_aspect)&&(_._update_scale(x,m),this._scale_aspect=m/x),this.prog.set_attribute("a_position","vec2",_.vbo_position),this.prog.set_attribute("a_tangents","vec4",_.vbo_tangents),this.prog.set_attribute("a_segment","vec2",_.vbo_segment),this.prog.set_attribute("a_angles","vec2",_.vbo_angles),this.prog.set_attribute("a_texcoord","vec2",_.vbo_texcoord),this.prog.set_uniform("u_length","float",[_.cumsum]),this.prog.set_texture("u_dash_atlas",this.dash_atlas.tex),a=_._baked_offset,this.prog.set_uniform("u_pixel_ratio","float",[n.pixel_ratio]),this.prog.set_uniform("u_canvas_size","vec2",[n.width,n.height]),this.prog.set_uniform("u_offset","vec2",[n.dx-a[0],n.dy-a[1]]),this.prog.set_uniform("u_scale_aspect","vec2",[x,m]),this.prog.set_uniform("u_scale_length","float",[y]),this.I_triangles=_.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,r=64008,i=[],o=l=0,d=Math.ceil(h/r);0<=d?l<d:l>d;o=0<=d?++l:--l)i.push([]);for(o=u=0,p=t.length;0<=p?u<p:u>p;o=0<=p?++u:--u)w=t[o]%r,s=Math.floor(t[o]/r),i[s].push(w);for(v=[],s=f=0,g=i.length;0<=g?f<g:f>g;s=0<=g?++f:--f)b=new Uint16Array(i[s]),c=s*r*4,0!==b.length&&(this.prog.set_attribute("a_position","vec2",_.vbo_position,0,2*c),this.prog.set_attribute("a_tangents","vec4",_.vbo_tangents,0,4*c),this.prog.set_attribute("a_segment","vec2",_.vbo_segment,0,2*c),this.prog.set_attribute("a_angles","vec2",_.vbo_angles,0,2*c),this.prog.set_attribute("a_texcoord","vec2",_.vbo_texcoord,0,2*c),this.index_buffer.set_size(2*b.length),this.index_buffer.set_data(0,b),v.push(this.prog.draw(this.gl.TRIANGLES,this.index_buffer)));return v},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,n,a,s,i;return e=o.color2rgba(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]),a=this.glyph.visuals.line.line_dash.value(),n=0,s=1,a.length&&(r=this.dash_atlas.get_atlas_data(a),n=r[0],s=r[1]),this.prog.set_uniform("u_dash_index","float",[n]),this.prog.set_uniform("u_dash_phase","float",[this.glyph.visuals.line.line_dash_offset.value()]),this.prog.set_uniform("u_dash_period","float",[s]),this.prog.set_uniform("u_dash_caps","vec2",[t,t]),this.prog.set_uniform("u_closed","float",[0]);var r},e.prototype._bake=function(){var t,e,n,a,s,i,r,o,l,_,h,c,u,f,d,p,g,v,y,x,m,b,w,P,A,E,z,R,q,T,S,k,G,I,O,D,L,M,F,C;for(m=this.nvertices,u=new Float64Array(this.glyph._x),f=new Float64Array(this.glyph._y),i=h=new Float32Array(2*m),a=new Float32Array(2*m),o=c=new Float32Array(4*m),new Float32Array(2*m),d=y=0,E=m;0<=E?y<E:y>E;d=0<=E?++y:--y)i[2*d+0]=u[d]+this._baked_offset[0],i[2*d+1]=f[d]+this._baked_offset[1];for(this.tangents=n=new Float32Array(2*m-2),d=w=0,z=m-1;0<=z?w<z:w>z;d=0<=z?++w:--w)n[2*d+0]=h[2*(d+1)+0]-h[2*d+0],n[2*d+1]=h[2*(d+1)+1]-h[2*d+1];for(d=P=0,R=m-1;0<=R?P<R:P>R;d=0<=R?++P:--P)o[4*(d+1)+0]=n[2*d+0],o[4*(d+1)+1]=n[2*d+1],o[4*d+2]=n[2*d+0],o[4*d+3]=n[2*d+1];for(o[0]=n[0],o[1]=n[1],o[4*(m-1)+2]=n[2*(m-2)+0],o[4*(m-1)+3]=n[2*(m-2)+1],t=new Float32Array(m),d=A=0,q=m;0<=q?A<q:A>q;d=0<=q?++A:--A)t[d]=Math.atan2(c[4*d+0]*c[4*d+3]-c[4*d+1]*c[4*d+2],c[4*d+0]*c[4*d+2]+c[4*d+1]*c[4*d+3]);for(d=O=0,T=m-1;0<=T?O<T:O>T;d=0<=T?++O:--O)a[2*d+0]=t[d],a[2*d+1]=t[d+1];for(x=4*m-4,this.V_position=r=new Float32Array(2*x),this.V_angles=s=new Float32Array(2*x),this.V_tangents=l=new Float32Array(4*x),this.V_texcoord=_=new Float32Array(2*x),2,d=D=0,S=m;0<=S?D<S:D>S;d=0<=S?++D:--D)for(g=L=0;L<4;g=++L){for(v=M=0;M<2;v=++M)r[2*(4*d+g-2)+v]=i[2*d+v],s[2*(4*d+g)+v]=a[2*d+v];for(v=F=0;F<4;v=++F)l[4*(4*d+g-2)+v]=o[4*d+v]}for(d=C=0,k=m;0<=k?C<=k:C>=k;d=0<=k?++C:--C)_[2*(4*d+0)+0]=-1,_[2*(4*d+1)+0]=-1,_[2*(4*d+2)+0]=1,_[2*(4*d+3)+0]=1,_[2*(4*d+0)+1]=-1,_[2*(4*d+1)+1]=1,_[2*(4*d+2)+1]=-1,_[2*(4*d+3)+1]=1;for(b=6*(m-1),this.I_triangles=e=new Uint32Array(b),I=[],d=p=0,G=m;0<=G?p<G:p>G;d=0<=G?++p:--p)e[6*d+0]=0+4*d,e[6*d+1]=1+4*d,e[6*d+2]=3+4*d,e[6*d+3]=2+4*d,e[6*d+4]=0+4*d,I.push(e[6*d+5]=3+4*d);return I},e.prototype._update_scale=function(t,e){var n,a,s,i,r,o,l,_,h,c,u,f,d,p,g,v,y,x;for(u=this.nvertices,c=4*u-4,a=this.tangents,n=new Float32Array(u-1),s=new Float32Array(2*u),this.V_segment=i=new Float32Array(2*c),o=h=0,g=u-1;0<=g?h<g:h>g;o=0<=g?++h:--h)n[o]=Math.sqrt(Math.pow(a[2*o+0]*t,2)+Math.pow(a[2*o+1]*e,2));for(r=0,o=f=0,v=u-1;0<=v?f<v:f>v;o=0<=v?++f:--f)r+=n[o],s[2*(o+1)+0]=r,s[2*o+1]=r;for(o=d=0,y=u;0<=y?d<y:d>y;o=0<=y?++d:--d)for(l=p=0;p<4;l=++p)for(_=x=0;x<2;_=++x)i[2*(4*o+l)+_]=s[2*o+_];return this.cumsum=r,this.vbo_segment.set_size(4*this.V_segment.length),this.vbo_segment.set_data(0,this.V_segment)},e}(r.BaseGLGlyph);n.LineGLGlyph=l,l.prototype.GLYPH="line",l.prototype.JOINS={miter:0,round:1,bevel:2},l.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},l.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",l.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}",l.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}"},427:function(t,e,n){t(425)},428:function(t,e,n){var a,s=t(364),i=t(424),r=t(423),o=t(14),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.init=function(){var t,e;return e=this.gl,t=this.FRAG.replace(/MARKERCODE/,this.MARKERCODE),this.last_trans={},this.prog=new i.Program(e),this.prog.set_shaders(this.VERT,t),this.vbo_x=new i.VertexBuffer(e),this.prog.set_attribute("a_x","float",this.vbo_x),this.vbo_y=new i.VertexBuffer(e),this.prog.set_attribute("a_y","float",this.vbo_y),this.vbo_s=new i.VertexBuffer(e),this.prog.set_attribute("a_size","float",this.vbo_s),this.vbo_a=new i.VertexBuffer(e),this.prog.set_attribute("a_angle","float",this.vbo_a),this.vbo_linewidth=new i.VertexBuffer(e),this.vbo_fg_color=new i.VertexBuffer(e),this.vbo_bg_color=new i.VertexBuffer(e),this.index_buffer=new i.IndexBuffer(e)},e.prototype.draw=function(t,e,n){var a,s,i,r,l,_,h,c,u,f,d,p,g,v,y,x,m,b,w;if(u=e.glglyph,f=u.nvertices,u.data_changed){if(!isFinite(n.dx)||!isFinite(n.dy))return;u._baked_offset=[n.dx,n.dy],u._set_data(f),u.data_changed=!1}else null==this.glyph._radius||n.sx===this.last_trans.sx&&n.sy===this.last_trans.sy||(this.last_trans=n,this.vbo_s.set_data(0,new Float32Array(function(){var t,e,n,a;for(n=this.glyph.sradius,a=[],t=0,e=n.length;t<e;t++)x=n[t],a.push(2*x);return a}.call(this))));if(this.visuals_changed&&(this._set_visuals(f),this.visuals_changed=!1),a=u._baked_offset,this.prog.set_uniform("u_pixel_ratio","float",[n.pixel_ratio]),this.prog.set_uniform("u_canvas_size","vec2",[n.width,n.height]),this.prog.set_uniform("u_offset","vec2",[n.dx-a[0],n.dy-a[1]]),this.prog.set_uniform("u_scale","vec2",[n.sx,n.sy]),this.prog.set_attribute("a_x","float",u.vbo_x),this.prog.set_attribute("a_y","float",u.vbo_y),this.prog.set_attribute("a_size","float",u.vbo_s),this.prog.set_attribute("a_angle","float",u.vbo_a),0!==t.length){if(t.length===f)return this.prog.draw(this.gl.POINTS,[0,f]);if(f<65535)return(b=window.navigator.userAgent).indexOf("MSIE ")+b.indexOf("Trident/")+b.indexOf("Edge/")>0&&o.logger.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(r=64e3,i=[],l=_=0,p=Math.ceil(f/r);0<=p?_<p:_>p;l=0<=p?++_:--_)i.push([]);for(l=h=0,g=t.length;0<=g?h<g:h>g;l=0<=g?++h:--h)w=t[l]%r,s=Math.floor(t[l]/r),i[s].push(w);for(y=[],s=c=0,v=i.length;0<=v?c<v:c>v;s=0<=v?++c:--c)m=new Uint16Array(i[s]),d=s*r*4,0!==m.length&&(this.prog.set_attribute("a_x","float",u.vbo_x,0,d),this.prog.set_attribute("a_y","float",u.vbo_y,0,d),this.prog.set_attribute("a_size","float",u.vbo_s,0,d),this.prog.set_attribute("a_angle","float",u.vbo_a,0,d),this.vbo_linewidth.used&&this.prog.set_attribute("a_linewidth","float",this.vbo_linewidth,0,d),this.vbo_fg_color.used&&this.prog.set_attribute("a_fg_color","vec4",this.vbo_fg_color,0,4*d),this.vbo_bg_color.used&&this.prog.set_attribute("a_bg_color","vec4",this.vbo_bg_color,0,4*d),this.index_buffer.set_size(2*m.length),this.index_buffer.set_data(0,m),y.push(this.prog.draw(this.gl.POINTS,this.index_buffer)));return y}},e.prototype._set_data=function(t){var e,n,a,s,i,r,o;for(a=4*t,this.vbo_x.set_size(a),this.vbo_y.set_size(a),this.vbo_a.set_size(a),this.vbo_s.set_size(a),r=new Float64Array(this.glyph._x),o=new Float64Array(this.glyph._y),e=n=0,s=t;0<=s?n<s:n>s;e=0<=s?++n:--n)r[e]+=this._baked_offset[0],o[e]+=this._baked_offset[1];return this.vbo_x.set_data(0,new Float32Array(r)),this.vbo_y.set_data(0,new Float32Array(o)),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,n,a;for(n=this.glyph.sradius,a=[],t=0,e=n.length;t<e;t++)i=n[t],a.push(2*i);return a}.call(this))):this.vbo_s.set_data(0,new Float32Array(this.glyph._size))},e.prototype._set_visuals=function(t){return r.attach_float(this.prog,this.vbo_linewidth,"a_linewidth",t,this.glyph.visuals.line,"line_width"),r.attach_color(this.prog,this.vbo_fg_color,"a_fg_color",t,this.glyph.visuals.line,"line"),r.attach_color(this.prog,this.vbo_bg_color,"a_bg_color",t,this.glyph.visuals.fill,"fill"),this.prog.set_uniform("u_antialias","float",[.8])},e}(r.BaseGLGlyph);return t.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}",t.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}",t.prototype.MARKERCODE="<defined in subclasses>",t}());n.CircleGLGlyph=l,l.prototype.GLYPH="circle",l.prototype.MARKERCODE="// --- disc\nfloat marker(vec2 P, float size)\n{\n return length(P) - size/2.0;\n}";var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.SquareGLGlyph=_,_.prototype.GLYPH="square",_.prototype.MARKERCODE="// --- square\nfloat marker(vec2 P, float size)\n{\n return max(abs(P.x), abs(P.y)) - size/2.0;\n}";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.AnnulusGLGlyph=h,h.prototype.GLYPH="annulus",h.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}";var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.DiamondGLGlyph=c,c.prototype.GLYPH="diamond",c.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}";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.TriangleGLGlyph=u,u.prototype.GLYPH="triangle",u.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}";var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.InvertedTriangleGLGlyph=f,f.prototype.GLYPH="invertedtriangle",f.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}";var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.CrossGLGlyph=d,d.prototype.GLYPH="cross",d.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}';var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.CircleCrossGLGlyph=p,p.prototype.GLYPH="circlecross",p.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}";var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.SquareCrossGLGlyph=g,g.prototype.GLYPH="squarecross",g.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}";var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.DiamondCrossGLGlyph=v,v.prototype.GLYPH="diamondcross",v.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}";var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.XGLGlyph=y,y.prototype.GLYPH="x",y.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}';var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.CircleXGLGlyph=x,x.prototype.GLYPH="circlex",x.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}';var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.SquareXGLGlyph=m,m.prototype.GLYPH="squarex",m.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}";var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e}(a);n.AsteriskGLGlyph=b,b.prototype.GLYPH="asterisk",b.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}'}},{"models/glyphs/webgl/base":423,"models/glyphs/webgl/gloo2":424,"models/glyphs/webgl/index":425,"models/glyphs/webgl/line":426,"models/glyphs/webgl/main":427,"models/glyphs/webgl/markers":428})}(t.Bokeh)}(this);/*!
Copyright (c) 2012, Anaconda, 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 Anaconda 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.
*/
//# sourceMappingURL=bokeh-gl.min.js.map
/* END bokeh-gl.min.js */
</script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>