From 6ff067782cf8f09b778c9e21f666a6b461aef2fb Mon Sep 17 00:00:00 2001 From: <> Date: Thu, 20 Jul 2023 17:59:11 +0000 Subject: [PATCH] Update documentation --- contributing/contributing.html | 16 +- examples/balanced_field/balanced_field.html | 69 +++++---- .../balanced_field_funccomp.html | 32 ++-- examples/brachistochrone/brachistochrone.html | 54 +++---- .../brachistochrone_tandem_phases.html | 122 +++++++-------- .../brachistochrone_upstream_controls.html | 14 +- ...ochrone_upstream_init_duration_states.html | 12 +- .../brachistochrone_upstream_states.html | 14 +- examples/bryson_denham/bryson_denham.html | 80 +++++----- .../cannonball_implicit_duration.html | 31 ++-- examples/cart_pole/cart_pole.html | 34 ++--- .../commercial_aircraft.html | 72 ++++----- .../double_integrator/double_integrator.html | 34 ++--- .../finite_burn_orbit_raise.html | 28 ++-- examples/hull/hull_problem.html | 40 ++--- examples/hypersensitive/hypersensitive.html | 143 +++++++++--------- .../length_constrained_brachistochrone.html | 12 +- examples/min_time_climb/min_time_climb.html | 34 ++--- examples/mountain_car/mountain_car.html | 86 +++++------ .../multi_phase_cannonball.html | 50 +++--- .../multibranch_trajectory.html | 8 +- examples/racecar/racecar.html | 10 +- examples/reentry/reentry.html | 38 ++--- .../robertson_problem/robertson_problem.html | 8 +- examples/ssto_earth/ssto_earth.html | 79 +++++----- .../ssto_moon_linear_tangent.html | 16 +- .../ssto_moon_polynomial_controls.html | 22 +-- examples/vanderpol/vanderpol.html | 110 +++++++------- examples/water_rocket/water_rocket.html | 42 ++--- faq/connect_scalar_parameters_to_ode.html | 13 +- faq/tandem_phases.html | 22 +-- faq/use_partial_coloring.html | 88 ++++++----- features/phases/analytic_phases.html | 24 ++- features/phases/constraints.html | 8 +- features/phases/phases.html | 8 +- features/trajectories/trajectories.html | 4 +- getting_started/collocation.html | 24 +-- getting_started/defining_odes.html | 4 +- getting_started/intro_to_dymos/intro_ivp.html | 8 +- getting_started/optimal_control.html | 12 +- searchindex.js | 2 +- 41 files changed, 772 insertions(+), 755 deletions(-) diff --git a/contributing/contributing.html b/contributing/contributing.html index f10b1e439..26d1d55ff 100644 --- a/contributing/contributing.html +++ b/contributing/contributing.html @@ -729,21 +729,21 @@

Notebook Creation#

Both sets of equations of motion have common aerodynamic models.

First, the lift coefficient is computed using a model which assumes linearity in lift wrt the angle of attack.

-
-(21)#\[\begin{align} +
+(21)#\[\begin{align} C_L &= C_{L0} + \frac{\alpha}{\alpha_{max}} \left(C_{L-max} - C_{L0}\right) \end{align}\]

Next, the drag-due-to-lift factor is computed (Equations 12.48 and 12.61 in Raymer[@raymer2012aircraft]).

-
-(22)#\[\begin{align} +
+(22)#\[\begin{align} K_{nom} &= \frac{1}{ \pi AR e} \\ b &= \frac{span}{2} \\ K &= 33 K_{nom} \frac{ \left(\frac{h + h_w}{b} \right) ^{\frac{3}{2}}}{1.0 + 33 \left( \frac{h + h_w}{b}\right) ^{\frac{3}{2}}} @@ -591,8 +591,8 @@

The Aerodynamic Model

Finally, the lift and drag are computed after computing the dynamic pressure.

-
-(23)#\[\begin{align} +
+(23)#\[\begin{align} q &= 0.5 \rho v^2 \\ L &= q S C_L \\ D &= q S \left( C_{D0} + K C_{L}^2 \right) @@ -603,8 +603,8 @@

Stall Speed\(\frac{v}{v_{stall}}\)). This constraint is used to trigger the beginning of rotation and is used as a boundary constraint at the end of the initial climb. Stall speed is given by Equation 5.6 in Raymer[@raymer2012aircraft].

-
-(24)#\[\begin{align} +
+(24)#\[\begin{align} W &= m g \\ v_{stall} &= \sqrt{\frac{2 * W}{\rho S C_{L-max}}} \end{align}\]
@@ -612,8 +612,8 @@

Stall Speed

Runway Equations of Motion#

The runway equations of motion are used to integrate range and speed as the vehicle rolls along the runway.

-
-(25)#\[\begin{align} +
+(25)#\[\begin{align} F_r &= mg - L \cos \alpha - T \sin \alpha \\ \dot{v} &= \frac{T \cos \alpha - D - F_r \mu_r}{m} \\ \dot{r} &= v @@ -640,8 +640,8 @@

Runway Equations of Motion

Flight Equations of Motion#

The flight equations of motion include two additional state variables: the flight-path angle (\(\gamma\)) and altitude (\(h\)).

-
-(26)#\[\begin{align} +
+(26)#\[\begin{align} \dot{v} &= \frac{T}{m} \cos \alpha - \frac{D}{m} - g \sin \gamma \\ \dot{\gamma} &= \frac{T}{m v} \sin \alpha + \frac{L}{m v} - \frac{g \cos \gamma}{v} \\ \dot{h} &= v \sin \gamma \\ @@ -1165,7 +1165,7 @@

Building and running the problem -
-
Jacobian shape: (132, 60)  ( 9.80% nonzero)
+
+Jacobian shape: (132, 60)  ( 9.81% nonzero)
 FWD solves: 16   REV solves: 0
 Total colors vs. total size: 16 vs 60  (73.3% improvement)
 
 Sparsity computed using tolerance: 1e-25
-Time to compute sparsity: 0.019714 sec.
-Time to compute coloring: 0.015048 sec.
+Time to compute sparsity: 0.025481 sec.
+Time to compute coloring: 0.018218 sec.
 Memory to compute coloring: 0.000000 MB.
-
-
-
Coloring for 'traj.phases.rto.rhs_all' (class BalancedFieldODEComp)
 
-Jacobian shape: (132, 60)  ( 9.80% nonzero)
+Coloring for 'traj.phases.rto.rhs_all' (class BalancedFieldODEComp)
+
+Jacobian shape: (132, 60)  ( 9.79% nonzero)
 FWD solves: 16   REV solves: 0
 Total colors vs. total size: 16 vs 60  (73.3% improvement)
 
 Sparsity computed using tolerance: 1e-25
-Time to compute sparsity: 0.019854 sec.
-Time to compute coloring: 0.014563 sec.
+Time to compute sparsity: 0.025783 sec.
+Time to compute coloring: 0.018428 sec.
 Memory to compute coloring: 0.000000 MB.
 
 Coloring for 'traj.phases.v1_to_vr.rhs_all' (class BalancedFieldODEComp)
@@ -1450,8 +1449,8 @@ 

Building and running the problem
Full total jacobian was computed 3 times, taking 1.376847 seconds.
+
@@ -1023,8 +1023,8 @@ 

Building and running the problem
Full total jacobian was computed 3 times, taking 4.735711 seconds.
+
Full total jacobian was computed 3 times, taking 5.520926 seconds.
 Total jacobian shape: (178, 166) 
 
 
@@ -1067,8 +1067,8 @@ 

Building and running the problem

System dynamics#

From the free-body diagram above, the evolution of the state variables is given by the following ordinary differential equations (ODE).

-
-(13)#\[\begin{align} +
+(13)#\[\begin{align} \frac{d x}{d t} &= v \sin(\theta) \\ \frac{d y}{d t} &= -v \cos(\theta) \\ \frac{d v}{d t} &= g \cos(\theta) @@ -556,8 +556,8 @@

The initial and final conditions -(14)#\[\begin{align} +
+(14)#\[\begin{align} x_0 &= 0 \\ y_0 &= 10 \\ v_0 &= 0 @@ -565,8 +565,8 @@

The initial and final conditions -(15)#\[\begin{align} +
+(15)#\[\begin{align} x_f &= 10 \\ y_f &= 5 \\ v_f &= \mathrm{free} @@ -732,27 +732,27 @@

Testing the ODE
Model viewer data has already been recorded for Driver.
 

-

-
Full total jacobian was computed 3 times, taking 0.283968 seconds.
+
Full total jacobian was computed 3 times, taking 0.336792 seconds.
 Total jacobian shape: (223, 287) 
 
@@ -691,9 +691,9 @@

Setup and run
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/openmdao/visualization/opt_report/opt_report.py:634: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
@@ -938,10 +938,10 @@ 

Plots# function _(t,_,n,o,r){o();t(1).__exportStar(t(2),n),t(70)}, function _(e,t,r,n,o){n();var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)};r.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function u(e){return this instanceof u?(this.v=e,this):new u(e)}r.__assign=function(){return r.__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;c--)(o=e[c])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},r.__param=function(e,t){return function(r,n){t(r,n,e)}},r.__esDecorate=function(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,u=n.kind,f="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?n.static?e:e.prototype:null,s=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),p=!1,y=r.length-1;y>=0;y--){var d={};for(var h in n)d[h]="access"===h?{}:n[h];for(var h in n.access)d.access[h]=n.access[h];d.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var _=(0,r[y])("accessor"===u?{get:s.get,set:s.set}:s[f],d);if("accessor"===u){if(void 0===_)continue;if(null===_||"object"!=typeof _)throw new TypeError("Object expected");(c=i(_.get))&&(s.get=c),(c=i(_.set))&&(s.set=c),(c=i(_.init))&&o.push(c)}else(c=i(_))&&("field"===u?o.push(c):s[f]=c)}l&&Object.defineProperty(l,n.name,s),p=!0},r.__runInitializers=function(e,t,r){for(var n=arguments.length>2,o=0;o0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof u?Promise.resolve(r.value.v).then(f,l):s(a[0][2],r)}catch(e){s(a[0][3],e)}var r}function f(e){c("next",e)}function l(e){c("throw",e)}function s(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},r.__asyncDelegator=function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:u(e[n](t)),done:!1}:o?o(t):t}:o}},r.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=i(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},r.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var f=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};r.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&(0,r.__createBinding)(t,e,n);return f(t,e),t},r.__importDefault=function(e){return e&&e.__esModule?e:{default:e}},r.__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},r.__classPrivateFieldSet=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},r.__classPrivateFieldIn=function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}}, function _(e,t,o,s,l){s();const r=e(1);l("version",e(3).version),l("index",e(4).index),o.embed=r.__importStar(e(4)),o.protocol=r.__importStar(e(67)),o._testing=r.__importStar(e(68));var _=e(18);l("logger",_.logger),l("set_log_level",_.set_log_level),l("settings",e(28).settings),l("Models",e(7).default_resolver),l("documents",e(5).documents),l("safely",e(69).safely)}, -function _(n,i,o,c,e){c(),o.version="3.2.0"}, -function _(e,o,t,n,r){n();const s=e(5),d=e(28),i=e(18),_=e(38),c=e(9),a=e(8),u=e(16),l=e(53),m=e(60),f=e(65);var w=e(53);r("add_document_standalone",w.add_document_standalone),r("index",w.index),r("add_document_from_session",e(60).add_document_from_session);var g=e(66);async function k(e,o,t,n){(0,a.isString)(e)&&(e=JSON.parse((0,_.unescape)(e)));const r={};for(const[o,t]of(0,c.entries)(e))r[o]=s.Document.from_json(t);const u=[];for(const e of o){const o=(0,f._resolve_element)(e),s=(0,f._resolve_root_elements)(e);if(null!=e.docid)u.push(await(0,l.add_document_standalone)(r[e.docid],o,s,e.use_for_title));else{if(null==e.token)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const r=(0,m._get_ws_url)(t,n);i.logger.debug(`embed: computed ws url: ${r}`);try{u.push(await(0,m.add_document_from_session)(r,e.token,o,s,e.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(e){if(d.settings.dev)throw e;console.error("Error rendering Bokeh items:",e)}}}}return u}r("embed_items_notebook",g.embed_items_notebook),r("kernels",g.kernels),t.embed_item=async function(e,o){const t={},n=(0,_.uuid4)();t[n]=e.doc,null==o&&(o=e.target_id);const r={roots:{[e.root_id]:o},root_ids:[e.root_id],docid:n};await(0,u.defer)();const[s]=await k(t,[r]);return s},t.embed_items=async function(e,o,t,n){return await(0,u.defer)(),k(e,o,t,n)}}, -function _(t,_,o,r,n){r();const a=t(1);a.__exportStar(t(6),o),a.__exportStar(t(39),o)}, -function _(e,t,s,o,n){o();const i=e(1),_=e(7),l=e(3),r=e(18),a=e(45),c=e(30),d=e(46),h=e(49),m=e(15),u=e(8),f=e(25),v=e(10),g=e(9),p=i.__importStar(e(43)),w=e(50),b=e(51),k=e(52),y=e(39);d.Deserializer.register("model",b.decode_def);class z{constructor(e){this.subscribed_models=new Set,this.document=e}send_event(e){if(e.publish){const t=new y.MessageSentEvent(this.document,"bokeh_event",e);this.document._trigger_on_change(t)}this.document._trigger_on_event(e)}trigger(e){for(const t of this.subscribed_models)null!=e.origin&&e.origin!=t||t._process_event(e)}}s.EventManager=z,z.__name__="EventManager",s.documents=[],s.DEFAULT_TITLE="Bokeh Application";class S{constructor(e){var t;s.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(t=null==e?void 0:e.resolver)&&void 0!==t?t:new a.ModelResolver(_.default_resolver),this._title=s.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._new_models=new Set,this._all_models_freeze_count=0,this._callbacks=new Map,this._document_callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new z(this),this.idle=new m.Signal0(this,"idle"),this._idle_roots=new WeakSet,this._interactive_timestamp=null,this._interactive_plot=null}[f.equals](e,t){return this==e}get is_idle(){for(const e of this._roots)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.add(e),this.is_idle&&(r.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new k.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(e,t=null){null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new k.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new k.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}destructively_move(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();const t=(0,v.copy)(this._roots);this.clear();for(const e of t)if(null!=e.document)throw new Error(`Somehow we didn't detach ${e}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const s of t)e.add_root(s);e.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}_invalidate_all_models(){r.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const t of this._roots)e=p.union(e,t.references());const t=new Set(this._all_models.values()),s=p.difference(t,e),o=p.difference(e,t),n=new Map;for(const t of e)n.set(t.id,t);for(const e of s)e.detach_document();for(const e of o)e.attach_document(this),this._new_models.add(e);this._all_models=n}roots(){return this._roots}_add_root(e){if((0,v.includes)(this._roots,e))return!1;this._push_all_models_freeze();try{this._roots.push(e)}finally{this._pop_all_models_freeze()}return!0}_remove_root(e){const t=this._roots.indexOf(e);if(t<0)return!1;this._push_all_models_freeze();try{this._roots.splice(t,1)}finally{this._pop_all_models_freeze()}return!0}_set_title(e){const t=e!=this._title;return t&&(this._title=e),t}add_root(e){this._add_root(e)&&this._trigger_on_change(new y.RootAddedEvent(this,e))}remove_root(e){this._remove_root(e)&&this._trigger_on_change(new y.RootRemovedEvent(this,e))}set_title(e){this._set_title(e)&&this._trigger_on_change(new y.TitleChangedEvent(this,e))}title(){return this._title}get_model_by_id(e){var t;return null!==(t=this._all_models.get(e))&&void 0!==t?t:null}get_model_by_name(e){const t=[];for(const s of this._all_models.values())s instanceof w.Model&&s.name==e&&t.push(s);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`Multiple models are named '${e}'`)}}on_message(e,t){const s=this._message_callbacks.get(e);null==s?this._message_callbacks.set(e,new Set([t])):s.add(t)}remove_on_message(e,t){var s;null===(s=this._message_callbacks.get(e))||void 0===s||s.delete(t)}_trigger_on_message(e,t){const s=this._message_callbacks.get(e);if(null!=s)for(const e of s)e(t)}on_change(e,t=!1){this._callbacks.has(e)||this._callbacks.set(e,t)}remove_on_change(e){this._callbacks.delete(e)}_trigger_on_change(e){for(const[t,s]of this._callbacks)if(!s&&e instanceof y.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_trigger_on_event(e){const t=this._document_callbacks.get(e.event_name);if(null!=t)for(const s of t)s.execute(this,e)}on_event(e,...t){var s;const o=(0,u.isString)(e)?e:e.prototype.event_name,n=null!==(s=this._document_callbacks.get(o))&&void 0!==s?s:[],i=t.map((e=>(0,u.isFunction)(e)?{execute:e}:e));this._document_callbacks.set(o,[...n,...i])}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new c.Serializer({include_defaults:e}).encode(this._roots);return{version:l.version,title:this._title,roots:t}}static from_json_string(e,t){const s=JSON.parse(e);return S.from_json(s,t)}static _handle_version(e){if(null!=e.version){const t=e.version,s=-1!==t.indexOf("+")||-1!==t.indexOf("-"),o=`Library versions: JS (${l.version}) / Python (${t})`;s||(0,h.pyify_version)(l.version)==t?r.logger.debug(o):(r.logger.warn("JS/Python version mismatch"),r.logger.warn(o))}else r.logger.warn("'version' field is missing")}static from_json(e,t){r.logger.debug("Creating Document from JSON"),S._handle_version(e);const s=new a.ModelResolver(_.default_resolver);if(null!=e.defs){new d.Deserializer(s).decode(e.defs)}const o=new S({resolver:s});o._push_all_models_freeze();const n=e=>null==t?void 0:t.push(e);o.on_change(n,!0);const i=new d.Deserializer(s,o._all_models,(e=>e.attach_document(o))),l=i.decode(e.roots),c=null!=e.callbacks?i.decode(e.callbacks):{};o.remove_on_change(n);for(const[e,t]of(0,g.entries)(c))o.on_event(e,...t);for(const e of l)o.add_root(e);return null!=e.title&&o.set_title(e.title),o._pop_all_models_freeze(),o}replace_with_json(e){S.from_json(e).destructively_move(this)}create_json_patch(e){for(const t of e)if(t.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new Map;for(const e of this._all_models.values())this._new_models.has(e)||t.set(e,e.ref());const s={events:new c.Serializer({references:t,binary:!0}).encode(e)};return this._new_models.clear(),s}apply_json_patch(e,t=new Map){this._push_all_models_freeze();const s=new d.Deserializer(this._resolver,this._all_models,(e=>e.attach_document(this))).decode(e.events,t);for(const e of s)switch(e.kind){case"MessageSent":{const{msg_type:t,msg_data:s}=e;this._trigger_on_message(t,s);break}case"ModelChanged":{const{model:t,attr:s,new:o}=e;t.setv({[s]:o},{sync:!1});break}case"ColumnDataChanged":{const{model:t,attr:s,cols:o,data:n}=e;if(null!=o){const e=t.property(s).get_value();for(const t in e)t in n||(n[t]=e[t])}t.setv({data:n},{sync:!1,check_eq:!1});break}case"ColumnsStreamed":{const{model:t,attr:s,data:o,rollover:n}=e,i=t.property(s);t.stream_to(i,o,n,{sync:!1});break}case"ColumnsPatched":{const{model:t,attr:s,patches:o}=e,n=t.property(s);t.patch_to(n,o,{sync:!1});break}case"RootAdded":this._add_root(e.model);break;case"RootRemoved":this._remove_root(e.model);break;case"TitleChanged":this._set_title(e.title);break;default:throw new Error(`unknown patch event type '${e.kind}'`)}this._pop_all_models_freeze()}}s.Document=S,S.__name__="Document"}, +function _(n,i,o,c,e){c(),o.version="3.2.1"}, +function _(e,o,t,n,r){n();const s=e(5),d=e(28),i=e(18),_=e(39),c=e(9),a=e(8),u=e(16),l=e(53),m=e(60),f=e(65);var w=e(53);r("add_document_standalone",w.add_document_standalone),r("index",w.index),r("add_document_from_session",e(60).add_document_from_session);var g=e(66);async function k(e,o,t,n){(0,a.isString)(e)&&(e=JSON.parse((0,_.unescape)(e)));const r={};for(const[o,t]of(0,c.entries)(e))r[o]=s.Document.from_json(t);const u=[];for(const e of o){const o=(0,f._resolve_element)(e),s=(0,f._resolve_root_elements)(e);if(null!=e.docid)u.push(await(0,l.add_document_standalone)(r[e.docid],o,s,e.use_for_title));else{if(null==e.token)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const r=(0,m._get_ws_url)(t,n);i.logger.debug(`embed: computed ws url: ${r}`);try{u.push(await(0,m.add_document_from_session)(r,e.token,o,s,e.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(e){if(d.settings.dev)throw e;console.error("Error rendering Bokeh items:",e)}}}}return u}r("embed_items_notebook",g.embed_items_notebook),r("kernels",g.kernels),t.embed_item=async function(e,o){const t={},n=(0,_.uuid4)();t[n]=e.doc,null==o&&(o=e.target_id);const r={roots:{[e.root_id]:o},root_ids:[e.root_id],docid:n};await(0,u.defer)();const[s]=await k(t,[r]);return s},t.embed_items=async function(e,o,t,n){return await(0,u.defer)(),k(e,o,t,n)}}, +function _(t,_,o,r,n){r();const a=t(1);a.__exportStar(t(6),o),a.__exportStar(t(40),o)}, +function _(e,t,s,o,n){o();const i=e(1),_=e(7),l=e(3),r=e(18),a=e(45),c=e(31),d=e(46),h=e(49),m=e(15),u=e(8),f=e(25),v=e(10),g=e(9),p=i.__importStar(e(43)),w=e(50),b=e(51),k=e(52),y=e(40);d.Deserializer.register("model",b.decode_def);class z{constructor(e){this.subscribed_models=new Set,this.document=e}send_event(e){if(e.publish){const t=new y.MessageSentEvent(this.document,"bokeh_event",e);this.document._trigger_on_change(t)}this.document._trigger_on_event(e)}trigger(e){for(const t of this.subscribed_models)null!=e.origin&&e.origin!=t||t._process_event(e)}}s.EventManager=z,z.__name__="EventManager",s.documents=[],s.DEFAULT_TITLE="Bokeh Application";class S{constructor(e){var t;s.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(t=null==e?void 0:e.resolver)&&void 0!==t?t:new a.ModelResolver(_.default_resolver),this._title=s.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._new_models=new Set,this._all_models_freeze_count=0,this._callbacks=new Map,this._document_callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new z(this),this.idle=new m.Signal0(this,"idle"),this._idle_roots=new WeakSet,this._interactive_timestamp=null,this._interactive_plot=null}[f.equals](e,t){return this==e}get is_idle(){for(const e of this._roots)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.add(e),this.is_idle&&(r.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new k.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(e,t=null){null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new k.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new k.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}destructively_move(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();const t=(0,v.copy)(this._roots);this.clear();for(const e of t)if(null!=e.document)throw new Error(`Somehow we didn't detach ${e}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const s of t)e.add_root(s);e.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}_invalidate_all_models(){r.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const t of this._roots)e=p.union(e,t.references());const t=new Set(this._all_models.values()),s=p.difference(t,e),o=p.difference(e,t),n=new Map;for(const t of e)n.set(t.id,t);for(const e of s)e.detach_document();for(const e of o)e.attach_document(this),this._new_models.add(e);this._all_models=n}roots(){return this._roots}_add_root(e){if((0,v.includes)(this._roots,e))return!1;this._push_all_models_freeze();try{this._roots.push(e)}finally{this._pop_all_models_freeze()}return!0}_remove_root(e){const t=this._roots.indexOf(e);if(t<0)return!1;this._push_all_models_freeze();try{this._roots.splice(t,1)}finally{this._pop_all_models_freeze()}return!0}_set_title(e){const t=e!=this._title;return t&&(this._title=e),t}add_root(e){this._add_root(e)&&this._trigger_on_change(new y.RootAddedEvent(this,e))}remove_root(e){this._remove_root(e)&&this._trigger_on_change(new y.RootRemovedEvent(this,e))}set_title(e){this._set_title(e)&&this._trigger_on_change(new y.TitleChangedEvent(this,e))}title(){return this._title}get_model_by_id(e){var t;return null!==(t=this._all_models.get(e))&&void 0!==t?t:null}get_model_by_name(e){const t=[];for(const s of this._all_models.values())s instanceof w.Model&&s.name==e&&t.push(s);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`Multiple models are named '${e}'`)}}on_message(e,t){const s=this._message_callbacks.get(e);null==s?this._message_callbacks.set(e,new Set([t])):s.add(t)}remove_on_message(e,t){var s;null===(s=this._message_callbacks.get(e))||void 0===s||s.delete(t)}_trigger_on_message(e,t){const s=this._message_callbacks.get(e);if(null!=s)for(const e of s)e(t)}on_change(e,t=!1){this._callbacks.has(e)||this._callbacks.set(e,t)}remove_on_change(e){this._callbacks.delete(e)}_trigger_on_change(e){for(const[t,s]of this._callbacks)if(!s&&e instanceof y.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_trigger_on_event(e){const t=this._document_callbacks.get(e.event_name);if(null!=t)for(const s of t)s.execute(this,e)}on_event(e,...t){var s;const o=(0,u.isString)(e)?e:e.prototype.event_name,n=null!==(s=this._document_callbacks.get(o))&&void 0!==s?s:[],i=t.map((e=>(0,u.isFunction)(e)?{execute:e}:e));this._document_callbacks.set(o,[...n,...i])}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new c.Serializer({include_defaults:e}).encode(this._roots);return{version:l.version,title:this._title,roots:t}}static from_json_string(e,t){const s=JSON.parse(e);return S.from_json(s,t)}static _handle_version(e){if(null!=e.version){const t=e.version,s=-1!==t.indexOf("+")||-1!==t.indexOf("-"),o=`Library versions: JS (${l.version}) / Python (${t})`;s||(0,h.pyify_version)(l.version)==t?r.logger.debug(o):(r.logger.warn("JS/Python version mismatch"),r.logger.warn(o))}else r.logger.warn("'version' field is missing")}static from_json(e,t){r.logger.debug("Creating Document from JSON"),S._handle_version(e);const s=new a.ModelResolver(_.default_resolver);if(null!=e.defs){new d.Deserializer(s).decode(e.defs)}const o=new S({resolver:s});o._push_all_models_freeze();const n=e=>null==t?void 0:t.push(e);o.on_change(n,!0);const i=new d.Deserializer(s,o._all_models,(e=>e.attach_document(o))),l=i.decode(e.roots),c=null!=e.callbacks?i.decode(e.callbacks):{};o.remove_on_change(n);for(const[e,t]of(0,g.entries)(c))o.on_event(e,...t);for(const e of l)o.add_root(e);return null!=e.title&&o.set_title(e.title),o._pop_all_models_freeze(),o}replace_with_json(e){S.from_json(e).destructively_move(this)}create_json_patch(e){for(const t of e)if(t.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new Map;for(const e of this._all_models.values())this._new_models.has(e)||t.set(e,e.ref());const s={events:new c.Serializer({references:t,binary:!0}).encode(e)};return this._new_models.clear(),s}apply_json_patch(e,t=new Map){this._push_all_models_freeze();const s=new d.Deserializer(this._resolver,this._all_models,(e=>e.attach_document(this))).decode(e.events,t);for(const e of s)switch(e.kind){case"MessageSent":{const{msg_type:t,msg_data:s}=e;this._trigger_on_message(t,s);break}case"ModelChanged":{const{model:t,attr:s,new:o}=e;t.setv({[s]:o},{sync:!1});break}case"ColumnDataChanged":{const{model:t,attr:s,cols:o,data:n}=e;if(null!=o){const e=t.property(s).get_value();for(const t in e)t in n||(n[t]=e[t])}t.setv({data:n},{sync:!1,check_eq:!1});break}case"ColumnsStreamed":{const{model:t,attr:s,data:o,rollover:n}=e,i=t.property(s);t.stream_to(i,o,n,{sync:!1});break}case"ColumnsPatched":{const{model:t,attr:s,patches:o}=e,n=t.property(s);t.patch_to(n,o,{sync:!1});break}case"RootAdded":this._add_root(e.model);break;case"RootRemoved":this._remove_root(e.model);break;case"TitleChanged":this._set_title(e.title);break;default:throw new Error(`unknown patch event type '${e.kind}'`)}this._pop_all_models_freeze()}}s.Document=S,S.__name__="Document"}, function _(e,o,r,s,t){s();const l=e(8),n=e(9),a=e(14),f=e(45);r.default_resolver=new f.ModelResolver(null),r.register_models=function(e,o=!1){for(const t of(0,l.isArray)(e)?e:(0,n.values)(e))s=t,(0,l.isObject)(s)&&s.prototype instanceof a.HasProps&&r.default_resolver.register(t,o);var s}}, function _(n,t,r,e,i){e(); // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -955,10 +955,10 @@

Plots# function _(n,t,r,o,e){o();const a=n(8),c=n(12),{PI:u,abs:i,sign:f}=Math;function l(n){if(0==n)return 0;for(;n<=0;)n+=2*u;for(;n>2*u;)n-=2*u;return n}function s(n,t){return l(n-t)}function h(n){switch(n){case"deg":return u/180;case"rad":return 1;case"grad":return u/200;case"turn":return 2*u}}function g(n,t){for(n=Math.abs(n),t=Math.abs(t);0!=t;)[n,t]=[t,n%t];return n}r.angle_norm=l,r.angle_dist=s,r.angle_between=function(n,t,r,o=!1){const e=s(t,r);if(0==e)return!1;if(e==2*u)return!0;const a=l(n),c=s(t,a)<=e&&s(a,r)<=e;return o?!c:c},r.randomIn=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},r.atan2=function(n,t){return Math.atan2(t[1]-n[1],t[0]-n[0])},r.radians=function(n){return n*(u/180)},r.degrees=function(n){return n/(u/180)},r.compute_angle=function(n,t,r="anticlock"){return-("anticlock"==r?1:-1)*n*h(t)},r.invert_angle=function(n,t,r="anticlock"){return-("anticlock"==r?1:-1)*n/h(t)},r.to_radians_coeff=h,r.clamp=function(n,t,r){return nr?r:n},r.log=function(n,t=Math.E){return Math.log(n)/Math.log(t)},r.gcd=g,r.lcm=function(n,...t){for(const r of t)n=Math.floor(n*r/g(n,r));return n},r.float=Symbol("float"),r.is_Floating=function(n){return(0,a.isObject)(n)&&r.float in n};class m{constructor(n,t){(0,c.assert)(0!=t,"Zero divisor");const r=g(n,t),o=f(n)*f(t);this.numer=o*i(n)/r,this.denom=i(t)/r}[r.float](){return this.numer/this.denom}toString(){return`${this.numer}/${this.denom}`}}function _(n){let t=1;for(let r=2;r<=n;r++)t*=r;return t}r.Fraction=m,m.__name__="Fraction",r.float32_epsilon=1.1920928955078125e-7,r.factorial=_,r.hermite=function(n){const t=new Array(n+1);t.fill(0);const r=_(n);for(let o=0;o<=Math.floor(n/2);o++){const e=(-1)**o*r/(_(o)*_(n-2*o))*2**(n-2*o);t[2*o]=e}return t},r.eval_poly=function(n,t){let r=0,o=1;for(let e=n.length-1;e>=0;e--)r+=o*n[e],o*=t;return r}}, function _(r,n,e,o,s){o();class t extends Error{}e.AssertionError=t,t.__name__="AssertionError",e.assert=function(r,n){if(!(!0===r||!1!==r&&r()))throw new t(null!=n?n:"Assertion failed")},e.unreachable=function(){throw new Error("unreachable code")}}, function _(n,t,e,r,o){r();const i=n(11);function u(n,t,e,...r){const o=n.length;t<0&&(t+=o),t<0?t=0:t>o&&(t=o),null==e||e>o-t?e=o-t:e<0&&(e=0);const i=o-e+r.length,u=new n.constructor(i);let c=0;for(;c0?0:r-1;for(;o>=0&&ot[t.length-1])return t.length;if(1==t.length)return 0;let e=0,r=t.length-1;for(;r-e!=1;){const o=e+Math.floor((r-e)/2);n>=t[o]?e=o:r=o}return e}e.is_empty=function(n){return 0==n.length},e.copy=function(n){return Array.isArray(n)?n.slice():new n.constructor(n)},e.splice=u,e.head=c,e.insert=function(n,t,e){return u(n,e,0,t)},e.append=function(n,t){return u(n,n.length,0,t)},e.prepend=function(n,t){return u(n,0,0,t)},e.index_of=function(n,t){return n.indexOf(t)},e.includes=l,e.contains=l,e.subselect=function(n,t){const e=t.length,r=new n.constructor(e);for(let o=0;o({index:e,key:t(n)})));return e.sort(((n,t)=>{const e=n.key,r=t.key;if(e!==r){if(e>r)return 1;if(en[e[r].index]))},e.min=function(n){let t,e=1/0;for(let r=0,o=n.length;re&&(e=t);return e},e.minmax=function(n){let t,e=1/0,r=-1/0;for(let o=0,i=n.length;or&&(r=t));return[e,r]},e.minmax2=function(n,t){let e,r,o=1/0,i=-1/0,u=1/0,c=-1/0;const l=Math.min(n.length,t.length);for(let f=0;fi&&(i=e),rc&&(c=r));return[o,i,u,c]},e.min_by=function(n,t){if(0==n.length)throw new Error("min_by() called with an empty array");let e=n[0],r=t(e);for(let o=1,i=n.length;or&&(e=i,r=u)}return e},e.sum=function(n){let t=0;for(let e=0,r=n.length;et[r]=n+e),0),t},e.every=function(n,t){for(const e of n)if(!t(e))return!1;return!0},e.some=function(n,t){for(const e of n)if(t(e))return!0;return!1},e.find_index=a(1),e.find_last_index=a(-1),e.find=function(n,t){const r=(0,e.find_index)(n,t);return-1==r?void 0:n[r]},e.find_last=function(n,t){const r=(0,e.find_last_index)(n,t);return-1==r?void 0:n[r]},e.sorted_index=h,e.bin_counts=function(n,t){const e=t.length-1,r=Array(e).fill(0);for(let o=0;o(n-t)/r))}}, -function _(t,e,s,n,i){var r;n();const o=t(1),c=t(15),a=o.__importStar(t(17)),h=o.__importStar(t(20)),_=t(12),l=t(38),u=t(9),f=t(8),p=t(25),d=t(30),g=t(39),y=t(25),m=t(40),v=t(41),w=o.__importStar(t(20)),b=t(27),S=t(42),$=new WeakMap;class j extends((0,c.Signalable)()){get is_syncable(){return!0}get type(){return this.constructor.__qualified__}static get __qualified__(){let t=$.get(this);if(null==t){const{__module__:e,__name__:s}=this;t=null!=e?`${e}.${s}`:s,$.set(this,t)}return t}static set __qualified__(t){$.set(this,t)}get[Symbol.toStringTag](){return this.constructor.__qualified__}static _fix_default(t,e){if(void 0===t||t===a.unset)return()=>a.unset;if((0,f.isFunction)(t))return t;if((0,f.isPrimitive)(t))return()=>t;{const e=new v.Cloner;return()=>e.clone(t)}}static define(t){for(const[e,s]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){if(e in this.prototype._props)throw new Error(`attempted to redefine property '${this.prototype.type}.${e}'`);if(e in this.prototype)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${e}'`);Object.defineProperty(this.prototype,e,{get(){return this.properties[e].get_value()},set(t){return this.setv({[e]:t}),this},configurable:!1,enumerable:!0});const[t,n,i={}]=s,r={type:t,default_value:this._fix_default(n,e),options:i};this.prototype._props=Object.assign(Object.assign({},this.prototype._props),{[e]:r})}}static internal(t){const e={};for(const[s,n]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){const[t,i,r={}]=n;e[s]=[t,i,Object.assign(Object.assign({},r),{internal:!0})]}this.define(e)}static mixins(t){function e(t,e){const s={};for(const[n,i]of(0,u.entries)(e))s[t+n]=i;return s}const s={},n=[];for(const i of(0,f.isArray)(t)?t:[t])if((0,f.isArray)(i)){const[t,r]=i;(0,u.extend)(s,e(t,r)),n.push([t,r])}else{const t=i;(0,u.extend)(s,t),n.push(["",t])}this.define(s),this.prototype._mixins=[...this.prototype._mixins,...n]}static override(t){for(const[e,s]of(0,u.entries)(t)){const t=this._fix_default(s,e);if(!(e in this.prototype._props))throw new Error(`attempted to override nonexistent '${this.prototype.type}.${e}'`);const n=this.prototype._props[e],i=Object.assign({},this.prototype._props);i[e]=Object.assign(Object.assign({},n),{default_value:t}),this.prototype._props=i}}static toString(){return this.__qualified__}toString(){return`${this.type}(${this.id})`}property(t){if(t in this.properties)return this.properties[t];throw new Error(`unknown property ${this.type}.${t}`)}get attributes(){const t={};for(const e of this)e.is_unset||(t[e.attr]=e.get_value());return t}[v.clone](t){const e=new Map;for(const s of this)s.dirty&&e.set(s.attr,t.clone(s.get_value()));return new this.constructor(e)}[y.equals](t,e){for(const s of this){const n=t.property(s.attr);if(!e.eq(s.get_value(),n.get_value()))return!1}return!0}[m.pretty](t){const e=t.token,s=[];for(const n of this)if(n.dirty){const i=n.get_value();s.push(`${n.attr}${e(":")} ${t.to_string(i)}`)}return`${this.constructor.__qualified__}${e("(")}${e("{")}${s.join(`${e(",")} `)}${e("}")}${e(")")}`}[d.serialize](t){const e=this.ref();t.add_ref(this,e);const s={};for(const e of this)if(e.syncable&&(t.include_defaults||e.dirty)){const n=e.get_value();s[e.attr]=t.encode(n)}const{type:n,id:i}=this,r={type:"object",name:n,id:i};return(0,u.is_empty)(s)?r:Object.assign(Object.assign({},r),{attributes:s})}constructor(t={}){super(),this.document=null,this.destroyed=new c.Signal0(this,"destroyed"),this.change=new c.Signal0(this,"change"),this.transformchange=new c.Signal0(this,"transformchange"),this.exprchange=new c.Signal0(this,"exprchange"),this.streaming=new c.Signal0(this,"streaming"),this.patching=new c.Signal(this,"patching"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const e=(0,f.isPlainObject)(t)&&"id"in t;this.id=e?t.id:(0,l.unique_id)();for(const[t,{type:e,default_value:s,options:n}]of(0,u.entries)(this._props)){let i;e instanceof a.PropertyAlias?Object.defineProperty(this.properties,t,{get:()=>this.properties[e.attr],configurable:!1,enumerable:!1}):(i=e instanceof h.Kind?new a.PrimitiveProperty(this,t,e,s,n):new e(this,t,h.Any,s,n),this.properties[t]=i)}if(e)(0,_.assert)(1==(0,u.keys)(t).length,"'id' cannot be used together with property initializers");else{const e=t instanceof Map?t:new u.Dict(t);this.initialize_props(e),this.finalize(),this.connect_signals()}}initialize_props(t){const e=new Set;for(const s of this){const n=t.get(s.attr);s.initialize(n),e.add(s.attr)}for(const s of t.keys())e.has(s)||this.property(s)}finalize(){this.initialize()}initialize(){}assert_initialized(){for(const t of this)t.syncable&&!t.readonly&&t.get_value()}connect_signals(){for(const t of this){if(!(t instanceof a.VectorSpec||t instanceof a.ScalarSpec))continue;if(t.is_unset)continue;const e=t.get_value();null!=e.transform&&this.connect(e.transform.change,(()=>this.transformchange.emit())),(0,b.isExpr)(e)&&this.connect(e.expr.change,(()=>this.exprchange.emit()))}}disconnect_signals(){c.Signal.disconnect_receiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return(new v.Cloner).clone(this)}_clear_watchers(){this._watchers=new WeakMap}changed_for(t){const e=this._watchers.get(t);return this._watchers.set(t,!1),null==e||e}_setv(t,e){var s;const n=e.check_eq,i=new Set,r=this._changing;this._changing=!0;for(const[e,s]of t)!1!==n&&!e.is_unset&&(0,p.is_equal)(e.get_value(),s)||(e.set_value(s),i.add(e));i.size>0&&(this._clear_watchers(),this._pending=!0);for(const t of i)t.change.emit();if(!r){if(null===(s=e.no_change)||void 0===s||!s)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}return i}setv(t,e={}){var s,n;const i=(0,u.entries)(t);if(0==i.length)return;if(null!==(s=e.silent)&&void 0!==s&&s){this._clear_watchers();for(const[t,e]of i)this.properties[t].set_value(e);return}const r=new Map,o=new Map;for(const[t,e]of i){const s=this.properties[t];r.set(s,e),o.set(s,s.is_unset?void 0:s.get_value())}const c=this._setv(r,e),{document:a}=this;if(null!=a){const t=[];for(const[e,s]of o)c.has(e)&&t.push([e,s,e.get_value()]);for(const[,e,s]of t)if(this._needs_invalidate(e,s)){a._invalidate_all_models();break}(null===(n=e.sync)||void 0===n||n)&&this._push_changes(t)}}ref(){return{id:this.id}}*[Symbol.iterator](){yield*(0,u.values)(this.properties)}*syncable_properties(){for(const t of this)t.syncable&&(yield t)}static _value_record_references(t,e,s){const{recursive:n}=s;if((0,f.isObject)(t))if(t instanceof j){if(!e.has(t)&&(e.add(t),n))for(const s of t.syncable_properties())if(!s.is_unset){const t=s.get_value();j._value_record_references(t,e,{recursive:n})}}else if((0,f.isIterable)(t))for(const s of t)j._value_record_references(s,e,{recursive:n});else if((0,f.isPlainObject)(t))for(const s of(0,u.values)(t))j._value_record_references(s,e,{recursive:n})}references(){const t=new Set;return j._value_record_references(this,t,{recursive:!0}),t}_doc_attached(){}_doc_detached(){}attach_document(t){if(null!=this.document){if(this.document==t)return;throw new Error("models must be owned by only a single document")}this.document=t,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(t,e){const s=new Set;j._value_record_references(e,s,{recursive:!1});const n=new Set;j._value_record_references(t,n,{recursive:!1});for(const t of s)if(!n.has(t))return!0;for(const t of n)if(!s.has(t))return!0;return!1}_push_changes(t){if(!this.is_syncable)return;const{document:e}=this;if(null==e)return;const s=[];for(const[n,,i]of t)n.syncable&&s.push(new g.ModelChangedEvent(e,this,n.attr,i));if(0!=s.length){let t;1==s.length?[t]=s:t=new g.DocumentEventBatch(e,s),e._trigger_on_change(t)}}on_change(t,e){for(const s of(0,f.isArray)(t)?t:[t])this.connect(s.change,e)}stream_to(t,e,s,{sync:n}={}){const i=t.get_value();if((0,S.stream_to_columns)(i,e,s),this._clear_watchers(),t.set_value(i),this.streaming.emit(),null!=this.document&&(null==n||n)){const n=new g.ColumnsStreamedEvent(this.document,this,t.attr,e,s);this.document._trigger_on_change(n)}}patch_to(t,e,{sync:s}={}){const n=t.get_value(),i=(0,S.patch_to_columns)(n,e);if(this._clear_watchers(),t.set_value(n),this.patching.emit([...i]),null!=this.document&&(null==s||s)){const s=new g.ColumnsPatchedEvent(this.document,this,t.attr,e);this.document._trigger_on_change(s)}}}s.HasProps=j,(r=j).prototype._props={},r.prototype._mixins=[]}, +function _(t,e,s,n,i){var r;n();const o=t(1),c=t(15),a=o.__importStar(t(17)),h=o.__importStar(t(20)),_=t(12),l=t(39),u=t(9),f=t(8),p=t(25),d=t(31),g=t(40),y=t(25),m=t(41),v=t(30),w=o.__importStar(t(20)),b=t(27),S=t(42),$=new WeakMap;class j extends((0,c.Signalable)()){get is_syncable(){return!0}get type(){return this.constructor.__qualified__}static get __qualified__(){let t=$.get(this);if(null==t){const{__module__:e,__name__:s}=this;t=null!=e?`${e}.${s}`:s,$.set(this,t)}return t}static set __qualified__(t){$.set(this,t)}get[Symbol.toStringTag](){return this.constructor.__qualified__}static _fix_default(t,e){if(void 0===t||t===a.unset)return()=>a.unset;if((0,f.isFunction)(t))return t;if((0,f.isPrimitive)(t))return()=>t;{const e=new v.Cloner;return()=>e.clone(t)}}static define(t){for(const[e,s]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){if(e in this.prototype._props)throw new Error(`attempted to redefine property '${this.prototype.type}.${e}'`);if(e in this.prototype)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${e}'`);Object.defineProperty(this.prototype,e,{get(){return this.properties[e].get_value()},set(t){return this.setv({[e]:t}),this},configurable:!1,enumerable:!0});const[t,n,i={}]=s,r={type:t,default_value:this._fix_default(n,e),options:i};this.prototype._props=Object.assign(Object.assign({},this.prototype._props),{[e]:r})}}static internal(t){const e={};for(const[s,n]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){const[t,i,r={}]=n;e[s]=[t,i,Object.assign(Object.assign({},r),{internal:!0})]}this.define(e)}static mixins(t){function e(t,e){const s={};for(const[n,i]of(0,u.entries)(e))s[t+n]=i;return s}const s={},n=[];for(const i of(0,f.isArray)(t)?t:[t])if((0,f.isArray)(i)){const[t,r]=i;(0,u.extend)(s,e(t,r)),n.push([t,r])}else{const t=i;(0,u.extend)(s,t),n.push(["",t])}this.define(s),this.prototype._mixins=[...this.prototype._mixins,...n]}static override(t){for(const[e,s]of(0,u.entries)(t)){const t=this._fix_default(s,e);if(!(e in this.prototype._props))throw new Error(`attempted to override nonexistent '${this.prototype.type}.${e}'`);const n=this.prototype._props[e],i=Object.assign({},this.prototype._props);i[e]=Object.assign(Object.assign({},n),{default_value:t}),this.prototype._props=i}}static toString(){return this.__qualified__}toString(){return`${this.type}(${this.id})`}property(t){if(t in this.properties)return this.properties[t];throw new Error(`unknown property ${this.type}.${t}`)}get attributes(){const t={};for(const e of this)e.is_unset||(t[e.attr]=e.get_value());return t}[v.clone](t){const e=new Map;for(const s of this)s.dirty&&e.set(s.attr,t.clone(s.get_value()));return new this.constructor(e)}[y.equals](t,e){for(const s of this){const n=t.property(s.attr);if(!e.eq(s.get_value(),n.get_value()))return!1}return!0}[m.pretty](t){const e=t.token,s=[];for(const n of this)if(n.dirty){const i=n.get_value();s.push(`${n.attr}${e(":")} ${t.to_string(i)}`)}return`${this.constructor.__qualified__}${e("(")}${e("{")}${s.join(`${e(",")} `)}${e("}")}${e(")")}`}[d.serialize](t){const e=this.ref();t.add_ref(this,e);const s={};for(const e of this)if(e.syncable&&(t.include_defaults||e.dirty)){const n=e.get_value();s[e.attr]=t.encode(n)}const{type:n,id:i}=this,r={type:"object",name:n,id:i};return(0,u.is_empty)(s)?r:Object.assign(Object.assign({},r),{attributes:s})}constructor(t={}){super(),this.document=null,this.destroyed=new c.Signal0(this,"destroyed"),this.change=new c.Signal0(this,"change"),this.transformchange=new c.Signal0(this,"transformchange"),this.exprchange=new c.Signal0(this,"exprchange"),this.streaming=new c.Signal0(this,"streaming"),this.patching=new c.Signal(this,"patching"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const e=(0,f.isPlainObject)(t)&&"id"in t;this.id=e?t.id:(0,l.unique_id)();for(const[t,{type:e,default_value:s,options:n}]of(0,u.entries)(this._props)){let i;e instanceof a.PropertyAlias?Object.defineProperty(this.properties,t,{get:()=>this.properties[e.attr],configurable:!1,enumerable:!1}):(i=e instanceof h.Kind?new a.PrimitiveProperty(this,t,e,s,n):new e(this,t,h.Any,s,n),this.properties[t]=i)}if(e)(0,_.assert)(1==(0,u.keys)(t).length,"'id' cannot be used together with property initializers");else{const e=t instanceof Map?t:new u.Dict(t);this.initialize_props(e),this.finalize(),this.connect_signals()}}initialize_props(t){const e=new Set;for(const s of this){const n=t.get(s.attr);s.initialize(n),e.add(s.attr)}for(const s of t.keys())e.has(s)||this.property(s)}finalize(){this.initialize()}initialize(){}assert_initialized(){for(const t of this)t.syncable&&!t.readonly&&t.get_value()}connect_signals(){for(const t of this){if(!(t instanceof a.VectorSpec||t instanceof a.ScalarSpec))continue;if(t.is_unset)continue;const e=t.get_value();null!=e.transform&&this.connect(e.transform.change,(()=>this.transformchange.emit())),(0,b.isExpr)(e)&&this.connect(e.expr.change,(()=>this.exprchange.emit()))}}disconnect_signals(){c.Signal.disconnect_receiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return(new v.Cloner).clone(this)}_clear_watchers(){this._watchers=new WeakMap}changed_for(t){const e=this._watchers.get(t);return this._watchers.set(t,!1),null==e||e}_setv(t,e){var s;const n=e.check_eq,i=new Set,r=this._changing;this._changing=!0;for(const[e,s]of t)!1!==n&&!e.is_unset&&(0,p.is_equal)(e.get_value(),s)||(e.set_value(s),i.add(e));i.size>0&&(this._clear_watchers(),this._pending=!0);for(const t of i)t.change.emit();if(!r){if(null===(s=e.no_change)||void 0===s||!s)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}return i}setv(t,e={}){var s,n;const i=(0,u.entries)(t);if(0==i.length)return;if(null!==(s=e.silent)&&void 0!==s&&s){this._clear_watchers();for(const[t,e]of i)this.properties[t].set_value(e);return}const r=new Map,o=new Map;for(const[t,e]of i){const s=this.properties[t];r.set(s,e),o.set(s,s.is_unset?void 0:s.get_value())}const c=this._setv(r,e),{document:a}=this;if(null!=a){const t=[];for(const[e,s]of o)c.has(e)&&t.push([e,s,e.get_value()]);for(const[,e,s]of t)if(this._needs_invalidate(e,s)){a._invalidate_all_models();break}(null===(n=e.sync)||void 0===n||n)&&this._push_changes(t)}}ref(){return{id:this.id}}*[Symbol.iterator](){yield*(0,u.values)(this.properties)}*syncable_properties(){for(const t of this)t.syncable&&(yield t)}static _value_record_references(t,e,s){const{recursive:n}=s;if((0,f.isObject)(t))if(t instanceof j){if(!e.has(t)&&(e.add(t),n))for(const s of t.syncable_properties())if(!s.is_unset){const t=s.get_value();j._value_record_references(t,e,{recursive:n})}}else if((0,f.isIterable)(t))for(const s of t)j._value_record_references(s,e,{recursive:n});else if((0,f.isPlainObject)(t))for(const s of(0,u.values)(t))j._value_record_references(s,e,{recursive:n})}references(){const t=new Set;return j._value_record_references(this,t,{recursive:!0}),t}_doc_attached(){}_doc_detached(){}attach_document(t){if(null!=this.document){if(this.document==t)return;throw new Error("models must be owned by only a single document")}this.document=t,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(t,e){const s=new Set;j._value_record_references(e,s,{recursive:!1});const n=new Set;j._value_record_references(t,n,{recursive:!1});for(const t of s)if(!n.has(t))return!0;for(const t of n)if(!s.has(t))return!0;return!1}_push_changes(t){if(!this.is_syncable)return;const{document:e}=this;if(null==e)return;const s=[];for(const[n,,i]of t)n.syncable&&s.push(new g.ModelChangedEvent(e,this,n.attr,i));if(0!=s.length){let t;1==s.length?[t]=s:t=new g.DocumentEventBatch(e,s),e._trigger_on_change(t)}}on_change(t,e){for(const s of(0,f.isArray)(t)?t:[t])this.connect(s.change,e)}stream_to(t,e,s,{sync:n}={}){const i=t.get_value();if((0,S.stream_to_columns)(i,e,s),this._clear_watchers(),t.set_value(i),this.streaming.emit(),null!=this.document&&(null==n||n)){const n=new g.ColumnsStreamedEvent(this.document,this,t.attr,e,s);this.document._trigger_on_change(n)}}patch_to(t,e,{sync:s}={}){const n=t.get_value(),i=(0,S.patch_to_columns)(n,e);if(this._clear_watchers(),t.set_value(n),this.patching.emit([...i]),null!=this.document&&(null==s||s)){const s=new g.ColumnsPatchedEvent(this.document,this,t.attr,e);this.document._trigger_on_change(s)}}}s.HasProps=j,(r=j).prototype._props={},r.prototype._mixins=[]}, function _(n,e,t,s,l){s();const r=n(16),i=n(10);class o{constructor(n,e){this.sender=n,this.name=e}connect(n,e=null){t.receivers_for_sender.has(this.sender)||t.receivers_for_sender.set(this.sender,[]);const s=t.receivers_for_sender.get(this.sender);if(null!=f(s,this,n,e))return!1;const l=null!=e?e:n;u.has(l)||u.set(l,[]);const r=u.get(l),i={signal:this,slot:n,context:e};return s.push(i),r.push(i),!0}disconnect(n,e=null){const s=t.receivers_for_sender.get(this.sender);if(null==s||0===s.length)return!1;const l=f(s,this,n,e);if(null==l)return!1;const r=null!=e?e:n,i=u.get(r);return l.signal=null,g(s),g(i),!0}emit(n){var e;const s=null!==(e=t.receivers_for_sender.get(this.sender))&&void 0!==e?e:[];for(const{signal:e,slot:t,context:l}of s)e===this&&t.call(l,n,this.sender)}}t.Signal=o,o.__name__="Signal";class c extends o{emit(){super.emit(void 0)}}t.Signal0=c,c.__name__="Signal0",function(n){n.disconnect_between=function(n,e){const s=t.receivers_for_sender.get(n);if(null==s||0===s.length)return;const l=u.get(e);if(null!=l&&0!==l.length){for(const e of l){if(null==e.signal)return;e.signal.sender===n&&(e.signal=null)}g(s),g(l)}},n.disconnect_sender=function(n){var e;const s=t.receivers_for_sender.get(n);if(null!=s&&0!==s.length){for(const n of s){if(null==n.signal)return;const t=null!==(e=n.context)&&void 0!==e?e:n.slot;n.signal=null,g(u.get(t))}g(s)}},n.disconnect_receiver=function(n,e,s){const l=u.get(n);if(null!=l&&0!==l.length){for(const n of l){if(null==n.signal)return;if(null!=e&&n.slot!=e)continue;const l=n.signal.sender;null!=s&&s.has(l)||(n.signal=null,g(t.receivers_for_sender.get(l)))}g(l)}},n.disconnect_all=function(n){const e=t.receivers_for_sender.get(n);if(null!=e&&0!==e.length){for(const n of e)n.signal=null;g(e)}const s=u.get(n);if(null!=s&&0!==s.length){for(const n of s)n.signal=null;g(s)}}}(o||(t.Signal=o={})),t.Signalable=function(){return class{connect(n,e){return n.connect(e,this)}disconnect(n,e){return n.disconnect(e,this)}}},t.receivers_for_sender=new WeakMap;const u=new WeakMap;function f(n,e,t,s){return(0,i.find)(n,(n=>n.signal===e&&n.slot===t&&n.context===s))}const a=new Set;function g(n){0===a.size&&(async()=>{await(0,r.defer)(),function(){for(const n of a)(0,i.remove_by)(n,(n=>null==n.signal));a.clear()}()})(),a.add(n)}}, function _(e,n,t,r,o){r();const s=new MessageChannel,i=new Map;s.port1.onmessage=e=>{const n=e.data,t=i.get(n);if(null!=t)try{t()}finally{i.delete(n)}};let a=1;t.defer=function(){return new Promise((e=>{const n=a++;i.set(n,e),s.port2.postMessage(n)}))},t.delay=function(e){return new Promise((n=>setTimeout(n,e)))},t.paint=function(){return new Promise((e=>{requestAnimationFrame((()=>e()))}))},t.idle=function(){return new Promise((e=>{requestIdleCallback((()=>e()))}))}}, -function _(e,t,r,n,a){n(),r.TextBaselineSpec=r.TextAlignSpec=r.FontStyleSpec=r.FontSizeSpec=r.FontSpec=r.LineDashSpec=r.LineCapSpec=r.LineJoinSpec=r.MarkerSpec=r.ArraySpec=r.NullStringSpec=r.StringSpec=r.AnySpec=void 0;const s=e(1),i=e(15),l=e(18),_=s.__importStar(e(19)),o=e(23),c=e(10),u=e(13),d=e(11),S=e(21),p=e(26),h=e(8),m=e(27),v=e(28),f=e(29),y=e(36),x=e(12),g=e(30),A=e(37);function w(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}function z(e){return(0,h.isPlainObject)(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)==1}a("Uniform",A.Uniform),a("UniformScalar",A.UniformScalar),a("UniformVector",A.UniformVector),r.isSpec=z;let b=null;r.use_theme=function(e=null){b=e},r.unset=Symbol("unset");class C extends Error{}r.UnsetValueError=C,C.__name__="UnsetValueError";class F{get syncable(){return!this.internal}get is_unset(){return this._value===r.unset}get initialized(){return this._initialized}initialize(e=r.unset){if(this._initialized)throw new Error("already initialized");let t=r.unset;if(e!==r.unset)t=e,this._dirty=!0;else{const e=this._default_override();if(e!==r.unset)t=e;else{let e=!1;if(null!=b){const r=b.get(this.obj,this.attr);void 0!==r&&(t=r,e=!0)}e||(t=this.default_value(this.obj))}}t!==r.unset?this._update(t):this._value=r.unset,this._initialized=!0}get_value(){if(this._value!==r.unset)return this._value;throw new C(`${this.obj}.${this.attr} is unset`)}set_value(e){this._initialized?(this._update(e),this._dirty=!0):this.initialize(e),y.diagnostics.report(this)}_default_override(){return r.unset}get dirty(){return this._dirty}constructor(e,t,n,a,s={}){var l,_;this._value=r.unset,this._initialized=!1,this._dirty=!1,this.obj=e,this.attr=t,this.kind=n,this.default_value=a,this.change=new i.Signal0(this.obj,"change"),this.internal=null!==(l=s.internal)&&void 0!==l&&l,this.readonly=null!==(_=s.readonly)&&void 0!==_&&_,this.convert=s.convert,this.on_update=s.on_update}_update(e){var t;if(this.validate(e),null!=this.convert){const t=this.convert(e);void 0!==t&&(e=t)}this._value=e,null===(t=this.on_update)||void 0===t||t.call(this,e,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, value: ${w(this._value)})`}normalize(e){return e}validate(e){if(!this.valid(e))throw new Error(`${this.obj}.${this.attr} given invalid value: ${w(e)}`)}valid(e){return this.kind.valid(e)}}r.Property=F,F.__name__="Property";class q{constructor(e){this.attr=e}}r.PropertyAlias=q,q.__name__="PropertyAlias",r.Alias=function(e){return new q(e)};class N extends F{}r.PrimitiveProperty=N,N.__name__="PrimitiveProperty";class U extends N{_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.Font=U,U.__name__="Font";class $ extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isExpr)(r)){const{expr:t,transform:a}=r;let s=t.compute(e);return null!=a&&(s=a.compute(s)),s=this.materialize(s),this.scalar(s,n)}{const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}}}r.ScalarSpec=$,$.__name__="ScalarSpec";class j extends ${}r.AnyScalar=j,j.__name__="AnyScalar";class B extends ${}r.ColorScalar=B,B.__name__="ColorScalar";class L extends ${}r.NumberScalar=L,L.__name__="NumberScalar";class D extends ${}r.StringScalar=D,D.__name__="StringScalar";class E extends ${}r.NullStringScalar=E,E.__name__="NullStringScalar";class P extends ${}r.ArrayScalar=P,P.__name__="ArrayScalar";class T extends ${}r.LineJoinScalar=T,T.__name__="LineJoinScalar";class V extends ${}r.LineCapScalar=V,V.__name__="LineCapScalar";class k extends ${}r.LineDashScalar=k,k.__name__="LineDashScalar";class J extends ${_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.FontScalar=J,J.__name__="FontScalar";class X extends ${}r.FontSizeScalar=X,X.__name__="FontSizeScalar";class Y extends ${}r.FontStyleScalar=Y,Y.__name__="FontStyleScalar";class G extends ${}r.TextAlignScalar=G,G.__name__="TextAlignScalar";class I extends ${}r.TextBaselineScalar=I,I.__name__="TextBaselineScalar";class O extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}v_materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}vector(e){return new A.UniformVector(e)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isField)(r)){const{field:t,transform:a}=r;let s=e.get_column(t);return null!=s?(null!=a&&(s=a.v_compute(s)),s=this.v_materialize(s),this.vector(s)):(l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`),this.scalar(null,n))}if((0,m.isExpr)(r)){const{expr:t,transform:n}=r;let a=t.v_compute(e);return null!=n&&(a=n.v_compute(a)),a=this.v_materialize(a),this.vector(a)}if((0,m.isValue)(r)){const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}(0,x.unreachable)()}array(e){var t;let r;const n=null!==(t=e.get_length())&&void 0!==t?t:1,a=this.get_value();if((0,m.isField)(a)){const{field:t}=a,s=e.get_column(t);if(null!=s)r=this.normalize(s);else{l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`);const e=new Float64Array(n);e.fill(NaN),r=e}}else if((0,m.isExpr)(a)){const{expr:t}=a;r=this.normalize(t.v_compute(e))}else{const e=this.normalize([a.value])[0];if((0,h.isNumber)(e)){const t=new Float64Array(n);t.fill(e),r=t}else r=(0,c.repeat)(e,n)}const{transform:s}=a;return null!=s&&(r=s.v_compute(r)),r}}r.VectorSpec=O,O.__name__="VectorSpec";class R extends O{}r.DataSpec=R,R.__name__="DataSpec";class M extends O{constructor(){super(...arguments),this._value=r.unset}_update(e){if(super._update(e),this._value!==r.unset){const{units:e}=this._value;if(null!=e&&!(0,c.includes)(this.valid_units,e))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${e}`)}}get units(){var e;return this._value!==r.unset&&null!==(e=this._value.units)&&void 0!==e?e:this.default_units}set units(e){if(this._value===r.unset)throw new Error(`${this.obj}.${this.attr} is unset`);e!=this.default_units?this._value.units=e:delete this._value.units}}r.UnitsSpec=M,M.__name__="UnitsSpec";class H extends M{array(e){return new Float64Array(super.array(e))}}r.NumberUnitsSpec=H,H.__name__="NumberUnitsSpec";class K extends R{}r.BaseCoordinateSpec=K,K.__name__="BaseCoordinateSpec";class Q extends K{}r.CoordinateSpec=Q,Q.__name__="CoordinateSpec";class W extends K{}r.CoordinateSeqSpec=W,W.__name__="CoordinateSeqSpec";class Z extends K{}r.CoordinateSeqSeqSeqSpec=Z,Z.__name__="CoordinateSeqSeqSeqSpec";class ee extends Q{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSpec=ee,ee.__name__="XCoordinateSpec";class te extends Q{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSpec=te,te.__name__="YCoordinateSpec";class re extends W{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSpec=re,re.__name__="XCoordinateSeqSpec";class ne extends W{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSpec=ne,ne.__name__="YCoordinateSeqSpec";class ae extends Z{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSeqSeqSpec=ae,ae.__name__="XCoordinateSeqSeqSeqSpec";class se extends Z{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSeqSeqSpec=se,se.__name__="YCoordinateSeqSeqSeqSpec";class ie extends H{get default_units(){return"rad"}get valid_units(){return[..._.AngleUnits]}materialize(e){return e*-(0,d.to_radians_coeff)(this.units)}v_materialize(e){const t=-(0,d.to_radians_coeff)(this.units),r=new Float32Array(e.length);return(0,u.mul)(e,t,r),r}array(e){throw new Error("not supported")}}r.AngleSpec=ie,ie.__name__="AngleSpec";class le extends H{get default_units(){return"data"}get valid_units(){return[..._.SpatialUnits]}}r.DistanceSpec=le,le.__name__="DistanceSpec";class _e extends le{materialize(e){return null!=e?e:NaN}}r.NullDistanceSpec=_e,_e.__name__="NullDistanceSpec";class oe extends R{v_materialize(e){return new Uint8Array(e)}array(e){return new Uint8Array(super.array(e))}}r.BooleanSpec=oe,oe.__name__="BooleanSpec";class ce extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Int32Array(e)}array(e){return new Int32Array(super.array(e))}}r.IntSpec=ce,ce.__name__="IntSpec";class ue extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Float64Array(e)}array(e){return new Float64Array(super.array(e))}}r.NumberSpec=ue,ue.__name__="NumberSpec";class de extends ue{valid(e){return(0,h.isNumber)(e)&&e>=0}}r.ScreenSizeSpec=de,de.__name__="ScreenSizeSpec";class Se extends R{materialize(e){return(0,S.encode_rgba)((0,S.color2rgba)(e))}v_materialize(e){if(!(0,f.is_NDArray)(e))return this._from_css_array(e);if("uint32"==e.dtype&&1==e.dimension)return(0,p.to_big_endian)(e);if("uint8"==e.dtype&&1==e.dimension){const[t]=e.shape,r=new o.RGBAArray(4*t);let n=0;for(const t of e)r[n++]=t,r[n++]=t,r[n++]=t,r[n++]=255;return new o.ColorArray(r.buffer)}if("uint8"==e.dtype&&2==e.dimension){const[t,r]=e.shape;if(4==r)return new o.ColorArray(e.buffer);if(3==r){const n=new o.RGBAArray(4*t);for(let a=0,s=0;a{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isExpr)(r)){const{expr:t,transform:a}=r;let s=t.compute(e);return null!=a&&(s=a.compute(s)),s=this.materialize(s),this.scalar(s,n)}{const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}}}r.ScalarSpec=$,$.__name__="ScalarSpec";class j extends ${}r.AnyScalar=j,j.__name__="AnyScalar";class B extends ${}r.ColorScalar=B,B.__name__="ColorScalar";class L extends ${}r.NumberScalar=L,L.__name__="NumberScalar";class D extends ${}r.StringScalar=D,D.__name__="StringScalar";class E extends ${}r.NullStringScalar=E,E.__name__="NullStringScalar";class P extends ${}r.ArrayScalar=P,P.__name__="ArrayScalar";class T extends ${}r.LineJoinScalar=T,T.__name__="LineJoinScalar";class V extends ${}r.LineCapScalar=V,V.__name__="LineCapScalar";class k extends ${}r.LineDashScalar=k,k.__name__="LineDashScalar";class J extends ${_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.FontScalar=J,J.__name__="FontScalar";class X extends ${}r.FontSizeScalar=X,X.__name__="FontSizeScalar";class Y extends ${}r.FontStyleScalar=Y,Y.__name__="FontStyleScalar";class G extends ${}r.TextAlignScalar=G,G.__name__="TextAlignScalar";class I extends ${}r.TextBaselineScalar=I,I.__name__="TextBaselineScalar";class O extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}v_materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}vector(e){return new A.UniformVector(e)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isField)(r)){const{field:t,transform:a}=r;let s=e.get_column(t);return null!=s?(null!=a&&(s=a.v_compute(s)),s=this.v_materialize(s),this.vector(s)):(l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`),this.scalar(null,n))}if((0,m.isExpr)(r)){const{expr:t,transform:n}=r;let a=t.v_compute(e);return null!=n&&(a=n.v_compute(a)),a=this.v_materialize(a),this.vector(a)}if((0,m.isValue)(r)){const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}(0,x.unreachable)()}array(e){var t;let r;const n=null!==(t=e.get_length())&&void 0!==t?t:1,a=this.get_value();if((0,m.isField)(a)){const{field:t}=a,s=e.get_column(t);if(null!=s)r=this.normalize(s);else{l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`);const e=new Float64Array(n);e.fill(NaN),r=e}}else if((0,m.isExpr)(a)){const{expr:t}=a;r=this.normalize(t.v_compute(e))}else{const e=this.normalize([a.value])[0];if((0,h.isNumber)(e)){const t=new Float64Array(n);t.fill(e),r=t}else r=(0,c.repeat)(e,n)}const{transform:s}=a;return null!=s&&(r=s.v_compute(r)),r}}r.VectorSpec=O,O.__name__="VectorSpec";class R extends O{}r.DataSpec=R,R.__name__="DataSpec";class M extends O{constructor(){super(...arguments),this._value=r.unset}_update(e){if(super._update(e),this._value!==r.unset){const{units:e}=this._value;if(null!=e&&!(0,c.includes)(this.valid_units,e))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${e}`)}}get units(){var e;return this._value!==r.unset&&null!==(e=this._value.units)&&void 0!==e?e:this.default_units}set units(e){if(this._value===r.unset)throw new Error(`${this.obj}.${this.attr} is unset`);e!=this.default_units?this._value.units=e:delete this._value.units}}r.UnitsSpec=M,M.__name__="UnitsSpec";class H extends M{array(e){return new Float64Array(super.array(e))}}r.NumberUnitsSpec=H,H.__name__="NumberUnitsSpec";class K extends R{}r.BaseCoordinateSpec=K,K.__name__="BaseCoordinateSpec";class Q extends K{}r.CoordinateSpec=Q,Q.__name__="CoordinateSpec";class W extends K{}r.CoordinateSeqSpec=W,W.__name__="CoordinateSeqSpec";class Z extends K{}r.CoordinateSeqSeqSeqSpec=Z,Z.__name__="CoordinateSeqSeqSeqSpec";class ee extends Q{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSpec=ee,ee.__name__="XCoordinateSpec";class te extends Q{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSpec=te,te.__name__="YCoordinateSpec";class re extends W{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSpec=re,re.__name__="XCoordinateSeqSpec";class ne extends W{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSpec=ne,ne.__name__="YCoordinateSeqSpec";class ae extends Z{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSeqSeqSpec=ae,ae.__name__="XCoordinateSeqSeqSeqSpec";class se extends Z{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSeqSeqSpec=se,se.__name__="YCoordinateSeqSeqSeqSpec";class ie extends H{get default_units(){return"rad"}get valid_units(){return[..._.AngleUnits]}materialize(e){return e*-(0,d.to_radians_coeff)(this.units)}v_materialize(e){const t=-(0,d.to_radians_coeff)(this.units),r=new Float32Array(e.length);return(0,u.mul)(e,t,r),r}array(e){throw new Error("not supported")}}r.AngleSpec=ie,ie.__name__="AngleSpec";class le extends H{get default_units(){return"data"}get valid_units(){return[..._.SpatialUnits]}}r.DistanceSpec=le,le.__name__="DistanceSpec";class _e extends le{materialize(e){return null!=e?e:NaN}}r.NullDistanceSpec=_e,_e.__name__="NullDistanceSpec";class oe extends R{v_materialize(e){return new Uint8Array(e)}array(e){return new Uint8Array(super.array(e))}}r.BooleanSpec=oe,oe.__name__="BooleanSpec";class ce extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Int32Array(e)}array(e){return new Int32Array(super.array(e))}}r.IntSpec=ce,ce.__name__="IntSpec";class ue extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Float64Array(e)}array(e){return new Float64Array(super.array(e))}}r.NumberSpec=ue,ue.__name__="NumberSpec";class de extends ue{valid(e){return(0,h.isNumber)(e)&&e>=0}}r.ScreenSizeSpec=de,de.__name__="ScreenSizeSpec";class Se extends R{materialize(e){return(0,S.encode_rgba)((0,S.color2rgba)(e))}v_materialize(e){if(!(0,f.is_NDArray)(e))return this._from_css_array(e);if("uint32"==e.dtype&&1==e.dimension)return(0,p.to_big_endian)(e);if("uint8"==e.dtype&&1==e.dimension){const[t]=e.shape,r=new o.RGBAArray(4*t);let n=0;for(const t of e)r[n++]=t,r[n++]=t,r[n++]=t,r[n++]=255;return new o.ColorArray(r.buffer)}if("uint8"==e.dtype&&2==e.dimension){const[t,r]=e.shape;if(4==r)return new o.ColorArray(e.buffer);if(3==r){const n=new o.RGBAArray(4*t);for(let a=0,s=0;a0)return e in r?r[e]:r[e]=new v(e,l);throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}constructor(e,l=v.INFO){this._name=e,this.set_level(l)}get level(){return this.get_level()}get_level(){return this._log_level}set_level(e){if(e instanceof i)this._log_level=e;else{if(!(0,s.isString)(e)||!(e in v.log_levels))throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=v.log_levels[e]}const l=`[${this._name}]`;for(const[e,o]of(0,g.entries)(v.log_levels))o.level","*"),n.HTTPMethod=(0,a.Enum)("POST","GET"),n.HexTileOrientation=(0,a.Enum)("pointytop","flattop"),n.HoverMode=(0,a.Enum)("mouse","hline","vline"),n.ImageOrigin=(0,a.Enum)("bottom_left","top_left","bottom_right","top_right"),n.LatLon=(0,a.Enum)("lat","lon"),n.LegendClickPolicy=(0,a.Enum)("none","hide","mute"),n.LegendLocation=n.Anchor,n.LineCap=(0,a.Enum)("butt","round","square"),n.LineDash=(0,a.Enum)("solid","dashed","dotted","dotdash","dashdot"),n.LineJoin=(0,a.Enum)("miter","round","bevel"),n.LinePolicy=(0,a.Enum)("prev","next","nearest","interp","none"),n.Location=(0,a.Enum)("above","below","left","right"),n.Logo=(0,a.Enum)("normal","grey"),n.MapType=(0,a.Enum)("satellite","roadmap","terrain","hybrid"),n.MarkerType=(0,a.Enum)("asterisk","circle","circle_cross","circle_dot","circle_x","circle_y","cross","dash","diamond","diamond_cross","diamond_dot","dot","hex","hex_dot","inverted_triangle","plus","square","square_cross","square_dot","square_pin","square_x","star","star_dot","triangle","triangle_dot","triangle_pin","x","y"),n.MutedPolicy=(0,a.Enum)("show","ignore"),n.Orientation=(0,a.Enum)("vertical","horizontal"),n.OutputBackend=(0,a.Enum)("canvas","svg","webgl"),n.PaddingUnits=(0,a.Enum)("percent","absolute"),n.Place=(0,a.Enum)("above","below","left","right","center"),n.PointPolicy=(0,a.Enum)("snap_to_data","follow_mouse","none"),n.RadiusDimension=(0,a.Enum)("x","y","max","min"),n.RenderLevel=(0,a.Enum)("image","underlay","glyph","guide","annotation","overlay"),n.ResetPolicy=(0,a.Enum)("standard","event_only"),n.RoundingFunction=(0,a.Enum)("round","nearest","floor","rounddown","ceil","roundup"),n.ScrollbarPolicy=(0,a.Enum)("auto","visible","hidden"),n.SelectionMode=(0,a.Enum)("replace","append","intersect","subtract"),n.Side=(0,a.Enum)("above","below","left","right"),n.SizingMode=(0,a.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed","inherit"),n.Sort=(0,a.Enum)("ascending","descending"),n.SpatialUnits=(0,a.Enum)("screen","data"),n.StartEnd=(0,a.Enum)("start","end"),n.StepMode=(0,a.Enum)("after","before","center"),n.TapBehavior=(0,a.Enum)("select","inspect"),n.TapGesture=(0,a.Enum)("tap","doubletap"),n.TextAlign=(0,a.Enum)("left","right","center"),n.TextBaseline=(0,a.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),n.TextureRepetition=(0,a.Enum)("repeat","repeat_x","repeat_y","no_repeat"),n.LabelOrientation=(0,a.Enum)("vertical","horizontal","parallel","normal"),n.TooltipAttachment=(0,a.Enum)("horizontal","vertical","left","right","above","below"),n.UpdateMode=(0,a.Enum)("replace","append"),n.VerticalAlign=(0,a.Enum)("top","middle","bottom"),n.ToolIcon=(0,a.Enum)("append_mode","box_edit","box_select","box_zoom","clear_selection","copy","crosshair","freehand_draw","help","hover","intersect_mode","lasso_select","line_edit","pan","point_draw","poly_draw","poly_edit","polygon_select","range","redo","replace_mode","reset","save","subtract_mode","tap_select","undo","wheel_pan","wheel_zoom","xpan","ypan","zoom_in","zoom_out")}, function _(t,e,n,r,s){r();const i=t(1).__importStar(t(8)),a=t(21),o=t(9),u=globalThis.Map,_=globalThis.Set,{hasOwnProperty:l}=Object.prototype;class c{}n.Kind=c,c.__name__="Kind",function(t){class e extends c{valid(t){return void 0!==t}toString(){return"Any"}}e.__name__="Any",t.Any=e;class n extends c{valid(t){return void 0!==t}toString(){return"Unknown"}}n.__name__="Unknown",t.Unknown=n;class r extends c{valid(t){return i.isBoolean(t)}toString(){return"Boolean"}}r.__name__="Boolean",t.Boolean=r;class s extends c{constructor(t){super(),this.obj_type=t}valid(t){return t instanceof this.obj_type}toString(){var t;const e=this.obj_type;return`Ref(${null!==(t=e.__name__)&&void 0!==t?t:e.toString()})`}}s.__name__="Ref",t.Ref=s;class d extends c{valid(t){return i.isObject(t)}toString(){return"AnyRef"}}d.__name__="AnyRef",t.AnyRef=d;class p extends c{valid(t){return i.isNumber(t)}toString(){return"Number"}}p.__name__="Number",t.Number=p;class y extends p{valid(t){return super.valid(t)&&i.isInteger(t)}toString(){return"Int"}}y.__name__="Int",t.Int=y;class S extends p{valid(t){return super.valid(t)&&0<=t&&t<=1}toString(){return"Percent"}}S.__name__="Percent",t.Percent=S;class g extends c{constructor(t){super(),this.types=t,this.types=t}valid(t){return this.types.some((e=>e.valid(t)))}toString(){return`Or(${this.types.map((t=>t.toString())).join(", ")})`}}g.__name__="Or",t.Or=g;class m extends c{constructor(t){super(),this.types=t,this.types=t}valid(t){if(!i.isArray(t))return!1;for(let e=0;et.toString())).join(", ")})`}}m.__name__="Tuple",t.Tuple=m;class h extends c{constructor(t){super(),this.struct_type=t}valid(t){if(!i.isPlainObject(t))return!1;const{struct_type:e}=this;for(const n of(0,o.keys)(t))if(!l.call(e,n))return!1;for(const n in e)if(l.call(e,n)){const r=e[n],s=t[n];if(!r.valid(s))return!1}return!0}toString(){return`Struct({${(0,o.entries)(this.struct_type).map((([t,e])=>`${t}: ${e}`)).join(", ")}})`}}h.__name__="Struct",t.Struct=h;class v extends c{constructor(t){super(),this.struct_type=t}valid(t){if(!i.isPlainObject(t))return!1;const{struct_type:e}=this;for(const n of(0,o.keys)(t))if(!l.call(e,n))return!1;for(const n in e)if(l.call(t,n)&&l.call(e,n)){const r=e[n],s=t[n];if(!r.valid(s))return!1}return!0}toString(){return`Struct({${(0,o.entries)(this.struct_type).map((([t,e])=>`${t}?: ${e}`)).join(", ")}})`}}v.__name__="PartialStruct",t.PartialStruct=v;class f extends c{constructor(t){super(),this.item_type=t}valid(t){return i.isArray(t)||i.isTypedArray(t)}toString(){return`Arrayable(${this.item_type.toString()})`}}f.__name__="Arrayable",t.Arrayable=f;class b extends c{constructor(t){super(),this.item_type=t}valid(t){return i.isArray(t)&&t.every((t=>this.item_type.valid(t)))}toString(){return`Array(${this.item_type.toString()})`}}b.__name__="Array",t.Array=b;class x extends c{valid(t){return null===t}toString(){return"Null"}}x.__name__="Null",t.Null=x;class w extends c{constructor(t){super(),this.base_type=t}valid(t){return null===t||this.base_type.valid(t)}toString(){return`Nullable(${this.base_type.toString()})`}}w.__name__="Nullable",t.Nullable=w;class K extends c{constructor(t){super(),this.base_type=t}valid(t){return void 0===t||this.base_type.valid(t)}toString(){return`Opt(${this.base_type.toString()})`}}K.__name__="Opt",t.Opt=K;class N extends c{valid(t){return t instanceof ArrayBuffer}toString(){return"Bytes"}}N.__name__="Bytes",t.Bytes=N;class A extends c{valid(t){return i.isString(t)}toString(){return"String"}}A.__name__="String",t.String=A;class O extends A{constructor(t){super(),this.regex=t}valid(t){return super.valid(t)&&this.regex.test(t)}toString(){return`Regex(${this.regex.toString()})`}}O.__name__="Regex",t.Regex=O;class $ extends c{constructor(t){super(),this.values=new _(t)}valid(t){return this.values.has(t)}*[Symbol.iterator](){yield*this.values}toString(){return`Enum(${[...this.values].map((t=>t.toString())).join(", ")})`}}$.__name__="Enum",t.Enum=$;class P extends c{constructor(t){super(),this.item_type=t}valid(t){if(!i.isPlainObject(t))return!1;for(const e in t)if(l.call(t,e)){const n=t[e];if(!this.item_type.valid(n))return!1}return!0}toString(){return`Dict(${this.item_type.toString()})`}}P.__name__="Dict",t.Dict=P;class R extends c{constructor(t,e){super(),this.key_type=t,this.item_type=e}valid(t){if(!(t instanceof u))return!1;for(const[e,n]of t.entries())if(!this.key_type.valid(e)||!this.item_type.valid(n))return!1;return!0}toString(){return`Map(${this.key_type.toString()}, ${this.item_type.toString()})`}}R.__name__="Map",t.Map=R;class j extends c{constructor(t){super(),this.item_type=t}valid(t){if(!(t instanceof _))return!1;for(const e of t)if(!this.item_type.valid(e))return!1;return!0}toString(){return`Set(${this.item_type.toString()})`}}j.__name__="Set",t.Set=j;class B extends c{valid(t){return(0,a.is_Color)(t)}toString(){return"Color"}}B.__name__="Color",t.Color=B;class C extends A{toString(){return"CSSLength"}}C.__name__="CSSLength",t.CSSLength=C;class M extends c{valid(t){return i.isFunction(t)}toString(){return"Function(...)"}}M.__name__="Function",t.Function=M;class k extends c{constructor(t){super(),this.base_type=t}valid(t){return this.base_type.valid(t)&&t>=0}toString(){return`NonNegative(${this.base_type.toString()})`}}k.__name__="NonNegative",t.NonNegative=k;class D extends c{constructor(t){super(),this.base_type=t}valid(t){return this.base_type.valid(t)&&t>0}toString(){return`Positive(${this.base_type.toString()})`}}D.__name__="Positive",t.Positive=D;class F extends c{valid(t){return t instanceof Node}toString(){return"DOMNode"}}F.__name__="DOMNode",t.DOMNode=F}(n.Kinds||(n.Kinds={})),n.Any=new n.Kinds.Any,n.Unknown=new n.Kinds.Unknown,n.Boolean=new n.Kinds.Boolean,n.Number=new n.Kinds.Number,n.Int=new n.Kinds.Int,n.Bytes=new n.Kinds.Bytes,n.String=new n.Kinds.String;n.Regex=t=>new n.Kinds.Regex(t),n.Null=new n.Kinds.Null;n.Nullable=t=>new n.Kinds.Nullable(t);n.Opt=t=>new n.Kinds.Opt(t);n.Or=(...t)=>new n.Kinds.Or(t);n.Tuple=(...t)=>new n.Kinds.Tuple(t);n.Struct=t=>new n.Kinds.Struct(t);n.PartialStruct=t=>new n.Kinds.PartialStruct(t);n.Arrayable=t=>new n.Kinds.Arrayable(t);n.Array=t=>new n.Kinds.Array(t);n.Dict=t=>new n.Kinds.Dict(t);n.Map=(t,e)=>new n.Kinds.Map(t,e);n.Set=t=>new n.Kinds.Set(t);n.Enum=(...t)=>new n.Kinds.Enum(t);n.Ref=t=>new n.Kinds.Ref(t);n.AnyRef=()=>new n.Kinds.AnyRef;n.Function=()=>new n.Kinds.Function,n.DOMNode=new n.Kinds.DOMNode;n.NonNegative=t=>new n.Kinds.NonNegative(t);n.Positive=t=>new n.Kinds.Positive(t),n.Percent=new n.Kinds.Percent,n.Alpha=n.Percent,n.Color=new n.Kinds.Color,n.Auto=(0,n.Enum)("auto"),n.CSSLength=new n.Kinds.CSSLength,n.FontSize=n.String,n.Font=n.String,n.Angle=n.Number}, @@ -970,40 +970,40 @@

Plots# function _(n,t,i,e,r){e(),i.is_mobile="ontouchstart"in globalThis||"undefined"!=typeof navigator&&navigator.maxTouchPoints>0,i.is_little_endian=(()=>{const n=new ArrayBuffer(4),t=new Uint8Array(n);new Uint32Array(n)[1]=168496141;let i=!0;return 10==t[4]&&11==t[5]&&12==t[6]&&13==t[7]&&(i=!1),i})(),i.BYTE_ORDER=i.is_little_endian?"little":"big",i.to_big_endian=function(n){if(i.is_little_endian){const t=new Uint32Array(n.length),i=new DataView(t.buffer);let e=0;for(const t of n)i.setUint32(e,t),e+=4;return t}return n}}, function _(i,n,e,t,u){t();const c=i(8);e.isValue=function(i){return(0,c.isPlainObject)(i)&&"value"in i},e.isField=function(i){return(0,c.isPlainObject)(i)&&"field"in i},e.isExpr=function(i){return(0,c.isPlainObject)(i)&&"expr"in i}}, function _(e,t,r,s,_){s();class i{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(e){this._dev=e}get dev(){return this._dev}set wireframe(e){this._wireframe=e}get wireframe(){return this._wireframe}set force_webgl(e){this._force_webgl=e}get force_webgl(){return this._force_webgl}}r.Settings=i,i.__name__="Settings",r.settings=new i}, -function _(t,e,s,r,n){var a,i,h,u,l,o,p,c,y,_;r();const A=t(8),d=t(26),g=t(25),f=t(30),m=Symbol("__ndarray__");function N(t,e){return{type:"ndarray",array:e.encode("object"==t.dtype?Array.from(t):t.buffer),order:d.BYTE_ORDER,dtype:t.dtype,shape:t.shape}}class D extends Uint8Array{constructor(t,e){super(t),this[a]=!0,this.dtype="bool",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(a=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return 1==this[t]}}s.BoolNDArray=D,D.__name__="BoolNDArray";class q extends Uint8Array{constructor(t,e){super(t),this[i]=!0,this.dtype="uint8",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(i=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Uint8NDArray=q,q.__name__="Uint8NDArray";class b extends Int8Array{constructor(t,e){super(t),this[h]=!0,this.dtype="int8",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(h=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Int8NDArray=b,b.__name__="Int8NDArray";class w extends Uint16Array{constructor(t,e){super(t),this[u]=!0,this.dtype="uint16",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(u=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Uint16NDArray=w,w.__name__="Uint16NDArray";class U extends Int16Array{constructor(t,e){super(t),this[l]=!0,this.dtype="int16",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(l=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Int16NDArray=U,U.__name__="Int16NDArray";class I extends Uint32Array{constructor(t,e){super(t),this[o]=!0,this.dtype="uint32",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(o=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Uint32NDArray=I,I.__name__="Uint32NDArray";class x extends Int32Array{constructor(t,e){super(t),this[p]=!0,this.dtype="int32",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(p=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Int32NDArray=x,x.__name__="Int32NDArray";class z extends Float32Array{constructor(t,e){super(t),this[c]=!0,this.dtype="float32",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(c=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Float32NDArray=z,z.__name__="Float32NDArray";class F extends Float64Array{constructor(t,e){super(t),this[y]=!0,this.dtype="float64",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(y=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Float64NDArray=F,F.__name__="Float64NDArray";class j extends Array{get shape(){var t;return null!==(t=this._shape)&&void 0!==t?t:[this.length]}get dimension(){return this.shape.length}constructor(t,e){const s=t instanceof ArrayBuffer?new Float64Array(t):t;if(super((0,A.isNumber)(s)?s:s.length),this[_]=!0,this.dtype="object",!(0,A.isNumber)(s))for(let t=0;t{switch(!0){case t instanceof Uint8Array:return"uint8";case t instanceof Int8Array:return"int8";case t instanceof Uint16Array:return"uint16";case t instanceof Int16Array:return"int16";case t instanceof Uint32Array:return"uint32";case t instanceof Int32Array:return"int32";case t instanceof Float32Array:return"float32";case t instanceof ArrayBuffer:case t instanceof Float64Array:return"float64";default:return"object"}})()),e){case"bool":return new D(t,s);case"uint8":return new q(t,s);case"int8":return new b(t,s);case"uint16":return new w(t,s);case"int16":return new U(t,s);case"uint32":return new I(t,s);case"int32":return new x(t,s);case"float32":return new z(t,s);case"float64":return new F(t,s);case"object":return new j(t,s)}}}, -function _(r,e,i,a,f){a();const o=r(1);var l=r(31);f("Serializer",l.Serializer),f("SerializationError",l.SerializationError),f("serialize",l.serialize);var t=r(33);f("Buffer",t.Buffer),f("Base64Buffer",t.Base64Buffer),o.__exportStar(r(35),i)}, -function _(e,r,t,n,i){n();const s=e(12),a=e(9),o=e(8),c=e(32),l=e(26),u=e(33);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class y{constructor(e){this.value=e}to_json(){return JSON.stringify(this.value)}}y.__name__="Serialized";class d{constructor(e){var r,t;this._circular=new WeakSet,this.binary=null!==(r=null==e?void 0:e.binary)&&void 0!==r&&r,this.include_defaults=null!==(t=null==e?void 0:e.include_defaults)&&void 0!==t&&t;const n=null==e?void 0:e.references;this._references=null!=n?new Map(n):new Map}get_ref(e){return this._references.get(e)}add_ref(e,r){(0,s.assert)(!this._references.has(e)),this._references.set(e,r)}to_serializable(e){return new y(this.encode(e))}encode(e){const r=this.get_ref(e);if(null!=r)return r;if(!(0,o.isObject)(e))return this._encode(e);this._circular.has(e)&&this.error("circular reference"),this._circular.add(e);try{return this._encode(e)}finally{this._circular.delete(e)}}_encode(e){if(function(e){return(0,o.isObject)(e)&&t.serialize in e}(e))return e[t.serialize](this);if((0,o.isArray)(e)){const r=e.length,t=new Array(r);for(let n=0;n[this.encode(e),this.encode(r)]))]}}if(null===e||(0,o.isBoolean)(e)||(0,o.isString)(e))return e;if((0,o.isNumber)(e))return isNaN(e)?{type:"number",value:"nan"}:isFinite(e)?e:{type:"number",value:(e<0?"-":"+")+"inf"};if(e instanceof Date){return{type:"date",iso:e.toISOString()}}if(e instanceof Set)return 0==e.size?{type:"set"}:{type:"set",entries:[...(0,c.map)(e.values(),(e=>this.encode(e)))]};if(e instanceof Map)return 0==e.size?{type:"map"}:{type:"map",entries:[...(0,c.map)(e.entries(),(([e,r])=>[this.encode(e),this.encode(r)]))]};if((0,o.isSymbol)(e)&&null!=e.description)return{type:"symbol",name:e.description};throw new f(`${Object.prototype.toString.call(e)} is not serializable`)}encode_struct(e){const r={};for(const[t,n]of(0,a.entries)(e))void 0!==n&&(r[t]=this.encode(n));return r}error(e){throw new f(e)}_encode_typed_array(e){const r=this.encode(e.buffer),t=(()=>{switch(e.constructor){case Uint8Array:return"uint8";case Int8Array:return"int8";case Uint16Array:return"uint16";case Int16Array:return"int16";case Uint32Array:return"uint32";case Int32Array:return"int32";case Float32Array:return"float32";case Float64Array:return"float64";default:this.error(`can't serialize typed array of type '${e[Symbol.toStringTag]}'`)}})();return{type:"typed_array",array:r,order:l.BYTE_ORDER,dtype:t}}}t.Serializer=d,d.__name__="Serializer"}, +function _(e,t,s,r,n){var a,i,h,u,l,o,c,p,y,_;r();const A=e(8),d=e(26),g=e(25),f=e(30),m=e(31),w=Symbol("__ndarray__");function N(e,t){return{type:"ndarray",array:t.encode("object"==e.dtype?Array.from(e):e.buffer),order:d.BYTE_ORDER,dtype:e.dtype,shape:e.shape}}class D extends Uint8Array{constructor(e,t){super(e),this[a]=!0,this.dtype="bool",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(a=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new D(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return 1==this[e]}}s.BoolNDArray=D,D.__name__="BoolNDArray";class q extends Uint8Array{constructor(e,t){super(e),this[i]=!0,this.dtype="uint8",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(i=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new q(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint8NDArray=q,q.__name__="Uint8NDArray";class b extends Int8Array{constructor(e,t){super(e),this[h]=!0,this.dtype="int8",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(h=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new b(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int8NDArray=b,b.__name__="Int8NDArray";class U extends Uint16Array{constructor(e,t){super(e),this[u]=!0,this.dtype="uint16",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(u=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new U(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint16NDArray=U,U.__name__="Uint16NDArray";class I extends Int16Array{constructor(e,t){super(e),this[l]=!0,this.dtype="int16",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(l=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new I(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int16NDArray=I,I.__name__="Int16NDArray";class x extends Uint32Array{constructor(e,t){super(e),this[o]=!0,this.dtype="uint32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(o=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new x(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint32NDArray=x,x.__name__="Uint32NDArray";class z extends Int32Array{constructor(e,t){super(e),this[c]=!0,this.dtype="int32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(c=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new z(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int32NDArray=z,z.__name__="Int32NDArray";class F extends Float32Array{constructor(e,t){super(e),this[p]=!0,this.dtype="float32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(p=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new F(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Float32NDArray=F,F.__name__="Float32NDArray";class j extends Float64Array{constructor(e,t){super(e),this[y]=!0,this.dtype="float64",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(y=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new j(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Float64NDArray=j,j.__name__="Float64NDArray";class B extends Array{get shape(){var e;return null!==(e=this._shape)&&void 0!==e?e:[this.length]}get dimension(){return this.shape.length}constructor(e,t){const s=e instanceof ArrayBuffer?new Float64Array(e):e;if(super((0,A.isNumber)(s)?s:s.length),this[_]=!0,this.dtype="object",!(0,A.isNumber)(s))for(let e=0;e{switch(!0){case e instanceof Uint8Array:return"uint8";case e instanceof Int8Array:return"int8";case e instanceof Uint16Array:return"uint16";case e instanceof Int16Array:return"int16";case e instanceof Uint32Array:return"uint32";case e instanceof Int32Array:return"int32";case e instanceof Float32Array:return"float32";case e instanceof ArrayBuffer:case e instanceof Float64Array:return"float64";default:return"object"}})()),t){case"bool":return new D(e,s);case"uint8":return new q(e,s);case"int8":return new b(e,s);case"uint16":return new U(e,s);case"int16":return new I(e,s);case"uint32":return new x(e,s);case"int32":return new z(e,s);case"float32":return new F(e,s);case"float64":return new j(e,s);case"object":return new B(e,s)}}}, +function _(n,e,t,o,r){o();const i=n(9),c=n(8);function l(n){return(0,c.isObject)(n)&&t.clone in n}t.clone=Symbol("clone"),t.is_Cloneable=l;class s extends Error{}t.CloningError=s,s.__name__="CloningError";class a{constructor(){}clone(n){if(l(n))return n[t.clone](this);if((0,c.isPrimitive)(n))return n;if((0,c.isArray)(n)){const e=n.length,t=new Array(e);for(let o=0;o[this.clone(n),this.clone(e)])));if(n instanceof Set)return new Set([...n].map((n=>this.clone(n))));throw new s(`${Object.prototype.toString.call(n)} is not cloneable`)}}t.Cloner=a,a.__name__="Cloner"}, +function _(r,e,i,a,f){a();const o=r(1);var l=r(32);f("Serializer",l.Serializer),f("SerializationError",l.SerializationError),f("serialize",l.serialize);var t=r(34);f("Buffer",t.Buffer),f("Base64Buffer",t.Base64Buffer),o.__exportStar(r(36),i)}, +function _(e,r,t,n,i){n();const s=e(12),a=e(9),o=e(8),c=e(33),l=e(26),u=e(34);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class y{constructor(e){this.value=e}to_json(){return JSON.stringify(this.value)}}y.__name__="Serialized";class d{constructor(e){var r,t;this._circular=new WeakSet,this.binary=null!==(r=null==e?void 0:e.binary)&&void 0!==r&&r,this.include_defaults=null!==(t=null==e?void 0:e.include_defaults)&&void 0!==t&&t;const n=null==e?void 0:e.references;this._references=null!=n?new Map(n):new Map}get_ref(e){return this._references.get(e)}add_ref(e,r){(0,s.assert)(!this._references.has(e)),this._references.set(e,r)}to_serializable(e){return new y(this.encode(e))}encode(e){const r=this.get_ref(e);if(null!=r)return r;if(!(0,o.isObject)(e))return this._encode(e);this._circular.has(e)&&this.error("circular reference"),this._circular.add(e);try{return this._encode(e)}finally{this._circular.delete(e)}}_encode(e){if(function(e){return(0,o.isObject)(e)&&t.serialize in e}(e))return e[t.serialize](this);if((0,o.isArray)(e)){const r=e.length,t=new Array(r);for(let n=0;n[this.encode(e),this.encode(r)]))]}}if(null===e||(0,o.isBoolean)(e)||(0,o.isString)(e))return e;if((0,o.isNumber)(e))return isNaN(e)?{type:"number",value:"nan"}:isFinite(e)?e:{type:"number",value:(e<0?"-":"+")+"inf"};if(e instanceof Date){return{type:"date",iso:e.toISOString()}}if(e instanceof Set)return 0==e.size?{type:"set"}:{type:"set",entries:[...(0,c.map)(e.values(),(e=>this.encode(e)))]};if(e instanceof Map)return 0==e.size?{type:"map"}:{type:"map",entries:[...(0,c.map)(e.entries(),(([e,r])=>[this.encode(e),this.encode(r)]))]};if((0,o.isSymbol)(e)&&null!=e.description)return{type:"symbol",name:e.description};throw new f(`${Object.prototype.toString.call(e)} is not serializable`)}encode_struct(e){const r={};for(const[t,n]of(0,a.entries)(e))void 0!==n&&(r[t]=this.encode(n));return r}error(e){throw new f(e)}_encode_typed_array(e){const r=this.encode(e.buffer),t=(()=>{switch(e.constructor){case Uint8Array:return"uint8";case Int8Array:return"int8";case Uint16Array:return"uint16";case Int16Array:return"int16";case Uint32Array:return"uint32";case Int32Array:return"int32";case Float32Array:return"float32";case Float64Array:return"float64";default:this.error(`can't serialize typed array of type '${e[Symbol.toStringTag]}'`)}})();return{type:"typed_array",array:r,order:l.BYTE_ORDER,dtype:t}}}t.Serializer=d,d.__name__="Serializer"}, function _(n,o,t,e,f){e();const i=n(10),r=n(12),{abs:l,ceil:c,max:s}=Math;function*u(n){const o=n.length;for(let t=0;t=0);for(const t of n)0==o?yield t:o-=1}function*y(n,o){const t=n.length;if(o>t)return;const e=(0,i.range)(o);for(yield e.map((o=>n[o]));;){let f;for(const n of u((0,i.range)(o)))if(e[n]!=n+t-o){f=n;break}if(null==f)return;e[f]+=1;for(const n of(0,i.range)(f+1,o))e[n]=e[n-1]+1;yield e.map((o=>n[o]))}}t.range=function*(n,o,t=1){(0,r.assert)(t>0),null==o&&(o=n,n=0);const e=n<=o?t:-t,f=s(c(l(o-n)/t),0);for(let o=0;o=0);let t=0;for(const e of n){if(!(t++String.fromCharCode(t)));return btoa(e.join(""))},e.base64_to_buffer=function(t){const n=atob(t),e=n.length,r=new Uint8Array(e);for(let t=0,o=e;t"'`])/g,(e=>{switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"`":return"`";default:return e}}))},r.unescape=function(e){return e.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,((e,t)=>{switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return t}}))},r.use_strict=function(e){return`'use strict';\n${e}`},r.to_fixed=function(e,t){return e.toFixed(t).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")},r.insert_text_on_position=function(e,t,r){const n=[];return n.push(e.slice(0,t)),n.push(r),n.push(e.slice(t)),n.join("")}}, -function _(e,t,s,n,a){n();const i=e(25),r=e(30);class d{constructor(e){this.document=e}get[Symbol.toStringTag](){return this.constructor.__name__}[i.equals](e,t){return t.eq(this.document,e.document)}}s.DocumentEvent=d,d.__name__="DocumentEvent";class o extends d{constructor(e,t){super(e),this.events=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.events,e.events)}}s.DocumentEventBatch=o,o.__name__="DocumentEventBatch";class l extends d{}s.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";class h extends l{constructor(e,t,s){super(e),this.kind="MessageSent",this.msg_type=t,this.msg_data=s}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.msg_type,e.msg_type)&&t.eq(this.msg_data,e.msg_data)}[r.serialize](e){return{kind:this.kind,msg_type:this.msg_type,msg_data:e.encode(this.msg_data)}}}s.MessageSentEvent=h,h.__name__="MessageSentEvent";class u extends l{constructor(e,t,s,n){super(e),this.kind="ModelChanged",this.model=t,this.attr=s,this.value=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.value,e.value)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,new:e.encode(this.value)}}}s.ModelChangedEvent=u,u.__name__="ModelChangedEvent";class m extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnDataChanged",this.model=t,this.attr=s,this.data=n,this.cols=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.cols,e.cols)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),cols:this.cols}}}s.ColumnDataChangedEvent=m,m.__name__="ColumnDataChangedEvent";class c extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnsStreamed",this.model=t,this.attr=s,this.data=n,this.rollover=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.rollover,e.rollover)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),rollover:this.rollover}}}s.ColumnsStreamedEvent=c,c.__name__="ColumnsStreamedEvent";class _ extends l{constructor(e,t,s,n){super(e),this.kind="ColumnsPatched",this.model=t,this.attr=s,this.patches=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.patches,e.patches)}[r.serialize](e){return{kind:this.kind,attr:this.attr,model:this.model.ref(),patches:e.encode(this.patches)}}}s.ColumnsPatchedEvent=_,_.__name__="ColumnsPatchedEvent";class q extends l{constructor(e,t){super(e),this.kind="TitleChanged",this.title=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.title,e.title)}[r.serialize](e){return{kind:this.kind,title:this.title}}}s.TitleChangedEvent=q,q.__name__="TitleChangedEvent";class v extends l{constructor(e,t){super(e),this.kind="RootAdded",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:e.encode(this.model)}}}s.RootAddedEvent=v,v.__name__="RootAddedEvent";class p extends l{constructor(e,t){super(e),this.kind="RootRemoved",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:this.model.ref()}}}s.RootRemovedEvent=p,p.__name__="RootRemovedEvent"}, +function _(e,t,s,n,a){n();const i=e(25),r=e(31);class d{constructor(e){this.document=e}get[Symbol.toStringTag](){return this.constructor.__name__}[i.equals](e,t){return t.eq(this.document,e.document)}}s.DocumentEvent=d,d.__name__="DocumentEvent";class o extends d{constructor(e,t){super(e),this.events=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.events,e.events)}}s.DocumentEventBatch=o,o.__name__="DocumentEventBatch";class l extends d{}s.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";class h extends l{constructor(e,t,s){super(e),this.kind="MessageSent",this.msg_type=t,this.msg_data=s}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.msg_type,e.msg_type)&&t.eq(this.msg_data,e.msg_data)}[r.serialize](e){return{kind:this.kind,msg_type:this.msg_type,msg_data:e.encode(this.msg_data)}}}s.MessageSentEvent=h,h.__name__="MessageSentEvent";class u extends l{constructor(e,t,s,n){super(e),this.kind="ModelChanged",this.model=t,this.attr=s,this.value=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.value,e.value)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,new:e.encode(this.value)}}}s.ModelChangedEvent=u,u.__name__="ModelChangedEvent";class m extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnDataChanged",this.model=t,this.attr=s,this.data=n,this.cols=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.cols,e.cols)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),cols:this.cols}}}s.ColumnDataChangedEvent=m,m.__name__="ColumnDataChangedEvent";class c extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnsStreamed",this.model=t,this.attr=s,this.data=n,this.rollover=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.rollover,e.rollover)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),rollover:this.rollover}}}s.ColumnsStreamedEvent=c,c.__name__="ColumnsStreamedEvent";class _ extends l{constructor(e,t,s,n){super(e),this.kind="ColumnsPatched",this.model=t,this.attr=s,this.patches=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.patches,e.patches)}[r.serialize](e){return{kind:this.kind,attr:this.attr,model:this.model.ref(),patches:e.encode(this.patches)}}}s.ColumnsPatchedEvent=_,_.__name__="ColumnsPatchedEvent";class q extends l{constructor(e,t){super(e),this.kind="TitleChanged",this.title=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.title,e.title)}[r.serialize](e){return{kind:this.kind,title:this.title}}}s.TitleChangedEvent=q,q.__name__="TitleChangedEvent";class v extends l{constructor(e,t){super(e),this.kind="RootAdded",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:e.encode(this.model)}}}s.RootAddedEvent=v,v.__name__="RootAddedEvent";class p extends l{constructor(e,t){super(e),this.kind="RootRemoved",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:this.model.ref()}}}s.RootRemovedEvent=p,p.__name__="RootRemovedEvent"}, function _(t,r,i,n,e){n();const s=t(8),o=t(9);i.pretty=Symbol("pretty");class u{constructor(t){this.visited=new Set,this.precision=null==t?void 0:t.precision}to_string(t){if((0,s.isObject)(t)){if(this.visited.has(t))return"";this.visited.add(t)}return function(t){return(0,s.isObject)(t)&&i.pretty in t}(t)?t[i.pretty](this):(0,s.isBoolean)(t)?this.boolean(t):(0,s.isNumber)(t)?this.number(t):(0,s.isString)(t)?this.string(t):(0,s.isArray)(t)?this.array(t):(0,s.isIterable)(t)?this.iterable(t):(0,s.isPlainObject)(t)?this.object(t):(0,s.isSymbol)(t)?this.symbol(t):t instanceof ArrayBuffer?this.array_buffer(t):`${t}`}token(t){return t}boolean(t){return`${t}`}number(t){return null!=this.precision?t.toFixed(this.precision):`${t}`}string(t){const r=t.includes("'"),i=t.includes('"');return r&&i?`\`${t.replace(/`/g,"\\`")}\``:i?`'${t}'`:`"${t}"`}symbol(t){return t.toString()}array(t){const r=this.token,i=[];for(const r of t)i.push(this.to_string(r));return`${r("[")}${i.join(`${r(",")} `)}${r("]")}`}iterable(t){var r;const i=this.token,n=null!==(r=Object(t)[Symbol.toStringTag])&&void 0!==r?r:"Object",e=this.array(t);return`${n}${i("(")}${e}${i(")")}`}object(t){const r=this.token,i=[];for(const[n,e]of(0,o.entries)(t))i.push(`${n}${r(":")} ${this.to_string(e)}`);return`${r("{")}${i.join(`${r(",")} `)}${r("}")}`}array_buffer(t){return`ArrayBuffer(#${t.byteLength})`}}i.Printer=u,u.__name__="Printer",i.to_string=function(t,r){return new u(r).to_string(t)}}, -function _(n,e,t,o,r){o();const i=n(9),c=n(8);function l(n){return(0,c.isObject)(n)&&t.clone in n}t.clone=Symbol("clone"),t.is_Cloneable=l;class s extends Error{}t.CloningError=s,s.__name__="CloningError";class a{constructor(){}clone(n){if(l(n))return n[t.clone](this);if((0,c.isPrimitive)(n))return n;if((0,c.isArray)(n)){const e=n.length,t=new Array(e);for(let o=0;o[this.clone(n),this.clone(e)])));if(n instanceof Set)return new Set([...n].map((n=>this.clone(n))));throw new s(`${Object.prototype.toString.call(n)} is not cloneable`)}}t.Cloner=a,a.__name__="Cloner"}, function _(t,r,n,e,o){e();const s=t(1),u=t(8),c=t(9),l=t(43),i=s.__importStar(t(44));function a(t,r,n){if((0,u.isArray)(t)&&(0,u.isArray)(r)){const e=t.concat(r);return null!=n&&e.length>n?e.slice(-n):e}const e=t.length+r.length;if(null!=n&&e>n){const o=e-n,s=t.length,c=(()=>{if(t.length{if((0,u.isTypedArray)(t))return t.constructor;if((0,u.isTypedArray)(r))return r.constructor;throw new Error("unsupported array types")})())(n);return e.set(t,0),e}return t})();for(let t=o,r=s;t{if((0,u.isTypedArray)(t))return t;if((0,u.isTypedArray)(r))return new r.constructor(t);throw new Error("unsupported array types")})();return i.concat(n,r)}}function f(t,r){let n,e,o;return(0,u.isNumber)(t)?(n=t,o=t+1,e=1):(n=null!=t.start?t.start:0,o=null!=t.stop?t.stop:r,e=null!=t.step?t.step:1),[n,o,e]}function p(t,r){const n=new Set;let e=!1;for(const[o,s]of r){let r,c,l,i;if((0,u.isArray)(o)){const[e]=o;n.add(e),r=t[e].shape,c=t[e],i=s,2===o.length?(r=[1,r[0]],l=[o[0],0,o[1]]):l=o}else(0,u.isNumber)(o)?(i=[s],n.add(o)):(i=s,e=!0),l=[0,0,o],r=[1,t.length],c=t;let a=0;const[p,y,h]=f(l[1],r[0]),[d,_,m]=f(l[2],r[1]);for(let t=p;t{try{return this._decode(e)}finally{n=new Set(this._finalizable),this._decoding=!1,this._buffers.clear(),this._finalizable.clear()}})();for(const e of n)null===(t=this.finalize)||void 0===t||t.call(this,e),e.finalize(),e.assert_initialized();for(const e of n)e.connect_signals();return s}_decode(e){if((0,l.isArray)(e))return this._decode_plain_array(e);if(!(0,l.isPlainObject)(e))return e;if(!(0,l.isString)(e.type))return(0,l.isString)(e.id)?this._decode_ref(e):this._decode_plain_object(e);{const r=h.get(e.type);if(null!=r)return r(e,this);switch(e.type){case"ref":return this._decode_ref(e);case"symbol":return this._decode_symbol(e);case"number":return this._decode_number(e);case"array":return this._decode_array(e);case"set":return this._decode_set(e);case"map":return this._decode_map(e);case"bytes":return this._decode_bytes(e);case"slice":return this._decode_slice(e);case"date":return this._decode_date(e);case"value":return this._decode_value(e);case"field":return this._decode_field(e);case"expr":return this._decode_expr(e);case"typed_array":return this._decode_typed_array(e);case"ndarray":return this._decode_ndarray(e);case"object":return(0,l.isString)(e.id)?this._decode_object_ref(e):this._decode_object(e);default:this.error(`unable to decode an object of type '${e.type}'`)}}}_decode_symbol(e){this.error(`can't resolve named symbol '${e.name}'`)}_decode_number(e){if("value"in e){const{value:r}=e;if((0,l.isString)(r))switch(r){case"nan":return NaN;case"+inf":return 1/0;case"-inf":return-1/0}else if((0,l.isNumber)(r))return r}this.error(`invalid number representation '${e}'`)}_decode_plain_array(e){return(0,c.map)(e,(e=>this._decode(e)))}_decode_plain_object(e){const r={};for(const[t,n]of(0,a.entries)(e))r[t]=this._decode(n);return r}_decode_array(e){var r;const t=[];for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.push(this._decode(n));return t}_decode_set(e){var r;const t=new Set;for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.add(this._decode(n));return t}_decode_map(e){var r;const t=(0,c.map)(null!==(r=e.entries)&&void 0!==r?r:[],(([e,r])=>[this._decode(e),this._decode(r)]));if((0,c.every)(t,(([e])=>(0,l.isString)(e)))){const e={};for(const[r,n]of t)e[r]=n;return e}return new Map(t)}_decode_bytes(e){const{data:r}=e;if(!(0,d.is_ref)(r))return(0,l.isString)(r)?(0,u.base64_to_buffer)(r):r.buffer;{const e=this._buffers.get(r.id);if(null!=e)return e;this.error(`buffer for id=${r.id} not found`)}}_decode_slice(e){const r=this._decode(e.start),t=this._decode(e.stop),n=this._decode(e.step);return new f.Slice({start:r,stop:t,step:n})}_decode_date(e){const r=this._decode(e.iso);return new Date(r)}_decode_value(e){return{value:this._decode(e.value),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_field(e){return{field:this._decode(e.field),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_expr(e){return{expr:this._decode(e.expr),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_typed_array(e){const{array:r,order:t,dtype:n}=e,s=this._decode(r);switch(t!=_.BYTE_ORDER&&(0,u.swap)(s,n),n){case"uint8":return new Uint8Array(s);case"int8":return new Int8Array(s);case"uint16":return new Uint16Array(s);case"int16":return new Int16Array(s);case"uint32":return new Uint32Array(s);case"int32":return new Int32Array(s);case"float32":return new Float32Array(s);case"float64":return new Float64Array(s);default:this.error(`unsupported dtype '${n}'`)}}_decode_ndarray(e){const{array:r,order:t,dtype:n,shape:s}=e,i=this._decode(r);return i instanceof ArrayBuffer&&t!=_.BYTE_ORDER&&(0,u.swap)(i,n),(0,o.ndarray)(i,{dtype:n,shape:s})}_decode_object(e){const{type:r,attributes:t}=e,n=this._resolve_type(r);return null!=t?new n(this._decode(t)):new n}_decode_ref(e){const r=this.references.get(e.id);if(null!=r)return r;this.error(`reference ${e.id} isn't known`)}_decode_object_ref(e){const r=this.references.get(e.id);if(null!=r)return this.warning(`reference already known '${e.id}'`),r;const{id:t,name:n,attributes:s}=e,i=new(this._resolve_type(n))({id:t});this.references.set(t,i);const d=this._decode(null!=s?s:{});return i.initialize_props(new a.Dict(d)),this._finalizable.add(i),i}error(e){throw new y(e)}warning(e){i.logger.warn(e)}_resolve_type(e){const r=this.resolver.get(e);if(null!=r)return r;this.error(`could not resolve type '${e}', which could be due to a widget or a custom model not being registered before first usage`)}}t.Deserializer=p,p.__name__="Deserializer"}, +function _(e,r,t,n,s){n();const i=e(18),d=e(47),o=e(29),a=e(9),c=e(10),_=e(26),u=e(35),l=e(8),f=e(48),h=new Map;class y extends Error{}t.DeserializationError=y,y.__name__="DeserializationError";class p{static register(e,r){if(h.has(e))throw new Error(`'${e}' already registered for decoding`);h.set(e,r)}constructor(e,r=new Map,t){this._decoding=!1,this._buffers=new Map,this._finalizable=new Set,this.resolver=e,this.references=r,this.finalize=t}decode(e,r){var t;if(null!=r)for(const[e,t]of r)this._buffers.set(e,t);if(this._decoding)return this._decode(e);let n;this._decoding=!0;const s=(()=>{try{return this._decode(e)}finally{n=new Set(this._finalizable),this._decoding=!1,this._buffers.clear(),this._finalizable.clear()}})();for(const e of n)null===(t=this.finalize)||void 0===t||t.call(this,e),e.finalize(),e.assert_initialized();for(const e of n)e.connect_signals();return s}_decode(e){if((0,l.isArray)(e))return this._decode_plain_array(e);if(!(0,l.isPlainObject)(e))return e;if(!(0,l.isString)(e.type))return(0,l.isString)(e.id)?this._decode_ref(e):this._decode_plain_object(e);{const r=h.get(e.type);if(null!=r)return r(e,this);switch(e.type){case"ref":return this._decode_ref(e);case"symbol":return this._decode_symbol(e);case"number":return this._decode_number(e);case"array":return this._decode_array(e);case"set":return this._decode_set(e);case"map":return this._decode_map(e);case"bytes":return this._decode_bytes(e);case"slice":return this._decode_slice(e);case"date":return this._decode_date(e);case"value":return this._decode_value(e);case"field":return this._decode_field(e);case"expr":return this._decode_expr(e);case"typed_array":return this._decode_typed_array(e);case"ndarray":return this._decode_ndarray(e);case"object":return(0,l.isString)(e.id)?this._decode_object_ref(e):this._decode_object(e);default:this.error(`unable to decode an object of type '${e.type}'`)}}}_decode_symbol(e){this.error(`can't resolve named symbol '${e.name}'`)}_decode_number(e){if("value"in e){const{value:r}=e;if((0,l.isString)(r))switch(r){case"nan":return NaN;case"+inf":return 1/0;case"-inf":return-1/0}else if((0,l.isNumber)(r))return r}this.error(`invalid number representation '${e}'`)}_decode_plain_array(e){return(0,c.map)(e,(e=>this._decode(e)))}_decode_plain_object(e){const r={};for(const[t,n]of(0,a.entries)(e))r[t]=this._decode(n);return r}_decode_array(e){var r;const t=[];for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.push(this._decode(n));return t}_decode_set(e){var r;const t=new Set;for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.add(this._decode(n));return t}_decode_map(e){var r;const t=(0,c.map)(null!==(r=e.entries)&&void 0!==r?r:[],(([e,r])=>[this._decode(e),this._decode(r)]));if((0,c.every)(t,(([e])=>(0,l.isString)(e)))){const e={};for(const[r,n]of t)e[r]=n;return e}return new Map(t)}_decode_bytes(e){const{data:r}=e;if(!(0,d.is_ref)(r))return(0,l.isString)(r)?(0,u.base64_to_buffer)(r):r.buffer;{const e=this._buffers.get(r.id);if(null!=e)return e;this.error(`buffer for id=${r.id} not found`)}}_decode_slice(e){const r=this._decode(e.start),t=this._decode(e.stop),n=this._decode(e.step);return new f.Slice({start:r,stop:t,step:n})}_decode_date(e){const r=this._decode(e.iso);return new Date(r)}_decode_value(e){return{value:this._decode(e.value),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_field(e){return{field:this._decode(e.field),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_expr(e){return{expr:this._decode(e.expr),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_typed_array(e){const{array:r,order:t,dtype:n}=e,s=this._decode(r);switch(t!=_.BYTE_ORDER&&(0,u.swap)(s,n),n){case"uint8":return new Uint8Array(s);case"int8":return new Int8Array(s);case"uint16":return new Uint16Array(s);case"int16":return new Int16Array(s);case"uint32":return new Uint32Array(s);case"int32":return new Int32Array(s);case"float32":return new Float32Array(s);case"float64":return new Float64Array(s);default:this.error(`unsupported dtype '${n}'`)}}_decode_ndarray(e){const{array:r,order:t,dtype:n,shape:s}=e,i=this._decode(r);return i instanceof ArrayBuffer&&t!=_.BYTE_ORDER&&(0,u.swap)(i,n),(0,o.ndarray)(i,{dtype:n,shape:s})}_decode_object(e){const{type:r,attributes:t}=e,n=this._resolve_type(r);return null!=t?new n(this._decode(t)):new n}_decode_ref(e){const r=this.references.get(e.id);if(null!=r)return r;this.error(`reference ${e.id} isn't known`)}_decode_object_ref(e){const r=this.references.get(e.id);if(null!=r)return this.warning(`reference already known '${e.id}'`),r;const{id:t,name:n,attributes:s}=e,i=new(this._resolve_type(n))({id:t});this.references.set(t,i);const d=this._decode(null!=s?s:{});return i.initialize_props(new a.Dict(d)),this._finalizable.add(i),i}error(e){throw new y(e)}warning(e){i.logger.warn(e)}_resolve_type(e){const r=this.resolver.get(e);if(null!=r)return r;this.error(`could not resolve type '${e}', which could be due to a widget or a custom model not being registered before first usage`)}}t.Deserializer=p,p.__name__="Deserializer"}, function _(n,i,t,c,e){c();const f=n(8);t.is_ref=function(n){return(0,f.isPlainObject)(n)&&"id"in n&&!("type"in n)}}, -function _(t,s,e,l,n){l();const i=t(30);class c{constructor({start:t,stop:s,step:e}={}){this.start=null!=t?t:null,this.stop=null!=s?s:null,this.step=null!=e?e:null}[i.serialize](t){return{type:"slice",start:t.encode(this.start),stop:t.encode(this.stop),step:t.encode(this.step)}}}e.Slice=c,c.__name__="Slice"}, +function _(t,s,e,l,n){l();const i=t(31);class c{constructor({start:t,stop:s,step:e}={}){this.start=null!=t?t:null,this.stop=null!=s?s:null,this.step=null!=e?e:null}[i.serialize](t){return{type:"slice",start:t.encode(this.start),stop:t.encode(this.stop),step:t.encode(this.step)}}}e.Slice=c,c.__name__="Slice"}, function _(n,e,r,c,i){c(),r.pyify_version=function(n){return n.replace(/-(dev|rc)\./,".$1")}}, function _(e,t,s,n,c){var i;n();const a=e(14),r=e(8),l=e(9),o=e(25),_=e(18);class h extends a.HasProps{get is_syncable(){return this.syncable}[o.equals](e,t){return(!!t.structural||t.eq(this.id,e.id))&&super[o.equals](e,t)}constructor(e){super(e)}initialize(){super.initialize(),this._js_callbacks=new Map}connect_signals(){super.connect_signals(),this._update_property_callbacks(),this.connect(this.properties.js_property_callbacks.change,(()=>this._update_property_callbacks())),this.connect(this.properties.js_event_callbacks.change,(()=>this._update_event_callbacks())),this.connect(this.properties.subscribed_events.change,(()=>this._update_event_callbacks()))}_process_event(e){var t;for(const s of null!==(t=(0,l.dict)(this.js_event_callbacks).get(e.event_name))&&void 0!==t?t:[])s.execute(e);null!=this.document&&this.subscribed_events.has(e.event_name)&&this.document.event_manager.send_event(e)}trigger_event(e){null!=this.document&&(e.origin=this,this.document.event_manager.trigger(e))}_update_event_callbacks(){null!=this.document?this.document.event_manager.subscribed_models.add(this):_.logger.warn("WARNING: Document not defined for updating event callbacks")}_update_property_callbacks(){const e=e=>{const[t,s=null]=e.split(":");return null!=s?this.properties[s][t]:this[t]};for(const[t,s]of this._js_callbacks){const n=e(t);for(const e of s)this.disconnect(n,e)}this._js_callbacks.clear();for(const[t,s]of(0,l.dict)(this.js_property_callbacks)){const n=s.map((e=>()=>e.execute(this)));this._js_callbacks.set(t,n);const c=e(t);for(const e of n)this.connect(c,e)}}_doc_attached(){(0,l.dict)(this.js_event_callbacks).is_empty&&0==this.subscribed_events.size||this._update_event_callbacks()}_doc_detached(){this.document.event_manager.subscribed_models.delete(this)}select(e){if((0,r.isString)(e))return[...this.references()].filter((t=>t instanceof h&&t.name===e));if((0,r.isPlainObject)(e)&&"type"in e)return[...this.references()].filter((t=>t.type==e.type));if(e.prototype instanceof a.HasProps)return[...this.references()].filter((t=>t instanceof e));throw new Error(`invalid selector ${e}`)}select_one(e){const t=this.select(e);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`found more than one object matching given selector ${e}`)}}on_event(e,t){var s;const n=(0,r.isString)(e)?e:e.prototype.event_name;this.js_event_callbacks[n]=[...null!==(s=(0,l.dict)(this.js_event_callbacks).get(n))&&void 0!==s?s:[],(0,r.isFunction)(t)?{execute:t}:t]}}s.Model=h,i=h,h.__name__="Model",i.define((({Any:e,Unknown:t,Boolean:s,String:n,Array:c,Set:i,Dict:a,Nullable:r})=>({tags:[c(t),[]],name:[r(n),null],js_property_callbacks:[a(c(e)),{}],js_event_callbacks:[a(c(e)),{}],subscribed_events:[i(n),new globalThis.Set],syncable:[s,!0]})))}, function _(e,n,r,t,o){t();const s=e(1),c=e(50),u=s.__importStar(e(20)),a=e(8),i=e(9);r.decode_def=function(e,n){var r,t,o;function l(e){if((0,a.isString)(e))switch(e){case"Any":return u.Any;case"Unknown":return u.Unknown;case"Boolean":return u.Boolean;case"Number":return u.Number;case"Int":return u.Int;case"Bytes":return u.Bytes;case"String":return u.String;case"Null":return u.Null}else switch(e[0]){case"Regex":{const[,n,r]=e;return u.Regex(new RegExp(n,r))}case"Nullable":{const[,n]=e;return u.Nullable(l(n))}case"Or":{const[,n,...r]=e;return u.Or(l(n),...r.map(l))}case"Tuple":{const[,n,...r]=e;return u.Tuple(l(n),...r.map(l))}case"Array":{const[,n]=e;return u.Array(l(n))}case"Struct":{const[,...n]=e,r=n.map((([e,n])=>[e,l(n)]));return u.Struct((0,i.to_object)(r))}case"Dict":{const[,n]=e;return u.Dict(l(n))}case"Map":{const[,n,r]=e;return u.Map(l(n),l(r))}case"Enum":{const[,...n]=e;return u.Enum(...n)}case"Ref":{const[,r]=e,t=n.resolver.get(r.id);if(null!=t)return u.Ref(t);throw new Error(`${r.id} wasn't defined before referencing it`)}case"AnyRef":return u.AnyRef()}}const d=(()=>{var r,t;const o=null!==(t=null===(r=e.extends)||void 0===r?void 0:r.id)&&void 0!==t?t:"Model";if("Model"==o)return c.Model;const s=n.resolver.get(o);if(null!=s)return s;throw new Error(`base model ${o} of ${e.name} is not defined`)})(),f=(o=class extends d{},s.__setFunctionName(o,"model"),o.__qualified__=e.name,o);function m(e){return void 0===e?e:n.decode(e)}for(const n of null!==(r=e.properties)&&void 0!==r?r:[]){const e=l(n.kind);f.define({[n.name]:[e,m(n.default)]})}for(const n of null!==(t=e.overrides)&&void 0!==t?t:[])f.override({[n.name]:m(n.default)});return n.resolver.register(f),f}}, -function _(e,t,s,n,a){var _,l,o,r,c,u,i,v,d,m,p,h,x,g,y,b,P,E,O,j,M,R,f,S,D,L,k,C;n();var B=this&&this.__decorate||function(e,t,s,n){var a,_=arguments.length,l=_<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(_<3?a(l):_>3?a(t,s,l):a(t,s))||l);return _>3&&l&&Object.defineProperty(t,s,l),l};const U=e(30),T=e(25),I=e(20);function w(e){return t=>{t.prototype.event_name=e}}s.KeyModifiers=(0,I.PartialStruct)({shift:I.Boolean,ctrl:I.Boolean,alt:I.Boolean});class G{[U.serialize](e){const{event_name:t,event_values:s}=this;return{type:"event",name:t,values:e.encode(s)}}[T.equals](e,t){return this.event_name==e.event_name&&t.eq(this.event_values,e.event_values)}}s.BokehEvent=G,_=G,G.__name__="BokehEvent",_.prototype.publish=!0;class V extends G{constructor(){super(...arguments),this.origin=null}get event_values(){return{model:this.origin}}}s.ModelEvent=V,V.__name__="ModelEvent";class W extends G{}s.DocumentEvent=W,W.__name__="DocumentEvent";let q=((l=class extends W{get event_values(){return{}}}).__name__="DocumentReady",l);s.DocumentReady=q,s.DocumentReady=q=B([w("document_ready")],q);class z extends W{}s.ConnectionEvent=z,z.__name__="ConnectionEvent";class K extends z{constructor(){super(...arguments),this.timestamp=new Date}get event_values(){const{timestamp:e}=this;return{timestamp:e}}}s.ConnectionLost=K,o=K,K.__name__="ConnectionLost",o.prototype.event_name="connection_lost",o.prototype.publish=!1;let A=((r=class extends V{}).__name__="ButtonClick",r);s.ButtonClick=A,s.ButtonClick=A=B([w("button_click")],A);let F=((c=class extends V{constructor(e){super(),this.item=e}get event_values(){const{item:e}=this;return Object.assign(Object.assign({},super.event_values),{item:e})}}).__name__="MenuItemClick",c);s.MenuItemClick=F,s.MenuItemClick=F=B([w("menu_item_click")],F);let H=((u=class extends V{constructor(e){super(),this.value=e}get event_values(){const{value:e}=this;return Object.assign(Object.assign({},super.event_values),{value:e})}}).__name__="ValueSubmit",u);s.ValueSubmit=H,s.ValueSubmit=H=B([w("value_submit")],H);class J extends V{}s.UIEvent=J,J.__name__="UIEvent";let N=((i=class extends J{}).__name__="LODStart",i);s.LODStart=N,s.LODStart=N=B([w("lodstart")],N);let Q=((v=class extends J{}).__name__="LODEnd",v);s.LODEnd=Q,s.LODEnd=Q=B([w("lodend")],Q);let X=((d=class extends J{constructor(e,t,s,n){super(),this.x0=e,this.x1=t,this.y0=s,this.y1=n}get event_values(){const{x0:e,x1:t,y0:s,y1:n}=this;return Object.assign(Object.assign({},super.event_values),{x0:e,x1:t,y0:s,y1:n})}}).__name__="RangesUpdate",d);s.RangesUpdate=X,s.RangesUpdate=X=B([w("rangesupdate")],X);let Y=((m=class extends J{constructor(e,t){super(),this.geometry=e,this.final=t}get event_values(){const{geometry:e,final:t}=this;return Object.assign(Object.assign({},super.event_values),{geometry:e,final:t})}}).__name__="SelectionGeometry",m);s.SelectionGeometry=Y,s.SelectionGeometry=Y=B([w("selectiongeometry")],Y);let Z=((p=class extends J{}).__name__="Reset",p);s.Reset=Z,s.Reset=Z=B([w("reset")],Z);class $ extends J{constructor(e,t,s,n,a){super(),this.sx=e,this.sy=t,this.x=s,this.y=n,this.modifiers=a}get event_values(){const{sx:e,sy:t,x:s,y:n,modifiers:a}=this;return Object.assign(Object.assign({},super.event_values),{sx:e,sy:t,x:s,y:n,modifiers:a})}}s.PointEvent=$,$.__name__="PointEvent";let ee=((h=class extends ${constructor(e,t,s,n,a,_,l){super(e,t,s,n,l),this.delta_x=a,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}).__name__="Pan",h);s.Pan=ee,s.Pan=ee=B([w("pan")],ee);let te=((x=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.scale=a}get event_values(){const{scale:e}=this;return Object.assign(Object.assign({},super.event_values),{scale:e})}}).__name__="Pinch",x);s.Pinch=te,s.Pinch=te=B([w("pinch")],te);let se=((g=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.rotation=a}get event_values(){const{rotation:e}=this;return Object.assign(Object.assign({},super.event_values),{rotation:e})}}).__name__="Rotate",g);s.Rotate=se,s.Rotate=se=B([w("rotate")],se);let ne=((y=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.delta=a}get event_values(){const{delta:e}=this;return Object.assign(Object.assign({},super.event_values),{delta:e})}}).__name__="MouseWheel",y);s.MouseWheel=ne,s.MouseWheel=ne=B([w("wheel")],ne);let ae=((b=class extends ${}).__name__="MouseMove",b);s.MouseMove=ae,s.MouseMove=ae=B([w("mousemove")],ae);let _e=((P=class extends ${}).__name__="MouseEnter",P);s.MouseEnter=_e,s.MouseEnter=_e=B([w("mouseenter")],_e);let le=((E=class extends ${}).__name__="MouseLeave",E);s.MouseLeave=le,s.MouseLeave=le=B([w("mouseleave")],le);let oe=((O=class extends ${}).__name__="Tap",O);s.Tap=oe,s.Tap=oe=B([w("tap")],oe);let re=((j=class extends ${}).__name__="DoubleTap",j);s.DoubleTap=re,s.DoubleTap=re=B([w("doubletap")],re);let ce=((M=class extends ${}).__name__="Press",M);s.Press=ce,s.Press=ce=B([w("press")],ce);let ue=((R=class extends ${}).__name__="PressUp",R);s.PressUp=ue,s.PressUp=ue=B([w("pressup")],ue);let ie=((f=class extends ${}).__name__="PanStart",f);s.PanStart=ie,s.PanStart=ie=B([w("panstart")],ie);let ve=((S=class extends ${}).__name__="PanEnd",S);s.PanEnd=ve,s.PanEnd=ve=B([w("panend")],ve);let de=((D=class extends ${}).__name__="PinchStart",D);s.PinchStart=de,s.PinchStart=de=B([w("pinchstart")],de);let me=((L=class extends ${}).__name__="PinchEnd",L);s.PinchEnd=me,s.PinchEnd=me=B([w("pinchend")],me);let pe=((k=class extends ${}).__name__="RotateStart",k);s.RotateStart=pe,s.RotateStart=pe=B([w("rotatestart")],pe);let he=((C=class extends ${}).__name__="RotateEnd",C);s.RotateEnd=he,s.RotateEnd=he=B([w("rotateend")],he)}, +function _(e,t,s,n,a){var _,l,o,r,c,u,i,v,d,m,p,h,x,g,y,b,P,E,O,j,M,R,f,S,D,L,k,C;n();var B=this&&this.__decorate||function(e,t,s,n){var a,_=arguments.length,l=_<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(_<3?a(l):_>3?a(t,s,l):a(t,s))||l);return _>3&&l&&Object.defineProperty(t,s,l),l};const U=e(31),T=e(25),I=e(20);function w(e){return t=>{t.prototype.event_name=e}}s.KeyModifiers=(0,I.PartialStruct)({shift:I.Boolean,ctrl:I.Boolean,alt:I.Boolean});class G{[U.serialize](e){const{event_name:t,event_values:s}=this;return{type:"event",name:t,values:e.encode(s)}}[T.equals](e,t){return this.event_name==e.event_name&&t.eq(this.event_values,e.event_values)}}s.BokehEvent=G,_=G,G.__name__="BokehEvent",_.prototype.publish=!0;class V extends G{constructor(){super(...arguments),this.origin=null}get event_values(){return{model:this.origin}}}s.ModelEvent=V,V.__name__="ModelEvent";class W extends G{}s.DocumentEvent=W,W.__name__="DocumentEvent";let q=((l=class extends W{get event_values(){return{}}}).__name__="DocumentReady",l);s.DocumentReady=q,s.DocumentReady=q=B([w("document_ready")],q);class z extends W{}s.ConnectionEvent=z,z.__name__="ConnectionEvent";class K extends z{constructor(){super(...arguments),this.timestamp=new Date}get event_values(){const{timestamp:e}=this;return{timestamp:e}}}s.ConnectionLost=K,o=K,K.__name__="ConnectionLost",o.prototype.event_name="connection_lost",o.prototype.publish=!1;let A=((r=class extends V{}).__name__="ButtonClick",r);s.ButtonClick=A,s.ButtonClick=A=B([w("button_click")],A);let F=((c=class extends V{constructor(e){super(),this.item=e}get event_values(){const{item:e}=this;return Object.assign(Object.assign({},super.event_values),{item:e})}}).__name__="MenuItemClick",c);s.MenuItemClick=F,s.MenuItemClick=F=B([w("menu_item_click")],F);let H=((u=class extends V{constructor(e){super(),this.value=e}get event_values(){const{value:e}=this;return Object.assign(Object.assign({},super.event_values),{value:e})}}).__name__="ValueSubmit",u);s.ValueSubmit=H,s.ValueSubmit=H=B([w("value_submit")],H);class J extends V{}s.UIEvent=J,J.__name__="UIEvent";let N=((i=class extends J{}).__name__="LODStart",i);s.LODStart=N,s.LODStart=N=B([w("lodstart")],N);let Q=((v=class extends J{}).__name__="LODEnd",v);s.LODEnd=Q,s.LODEnd=Q=B([w("lodend")],Q);let X=((d=class extends J{constructor(e,t,s,n){super(),this.x0=e,this.x1=t,this.y0=s,this.y1=n}get event_values(){const{x0:e,x1:t,y0:s,y1:n}=this;return Object.assign(Object.assign({},super.event_values),{x0:e,x1:t,y0:s,y1:n})}}).__name__="RangesUpdate",d);s.RangesUpdate=X,s.RangesUpdate=X=B([w("rangesupdate")],X);let Y=((m=class extends J{constructor(e,t){super(),this.geometry=e,this.final=t}get event_values(){const{geometry:e,final:t}=this;return Object.assign(Object.assign({},super.event_values),{geometry:e,final:t})}}).__name__="SelectionGeometry",m);s.SelectionGeometry=Y,s.SelectionGeometry=Y=B([w("selectiongeometry")],Y);let Z=((p=class extends J{}).__name__="Reset",p);s.Reset=Z,s.Reset=Z=B([w("reset")],Z);class $ extends J{constructor(e,t,s,n,a){super(),this.sx=e,this.sy=t,this.x=s,this.y=n,this.modifiers=a}get event_values(){const{sx:e,sy:t,x:s,y:n,modifiers:a}=this;return Object.assign(Object.assign({},super.event_values),{sx:e,sy:t,x:s,y:n,modifiers:a})}}s.PointEvent=$,$.__name__="PointEvent";let ee=((h=class extends ${constructor(e,t,s,n,a,_,l){super(e,t,s,n,l),this.delta_x=a,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}).__name__="Pan",h);s.Pan=ee,s.Pan=ee=B([w("pan")],ee);let te=((x=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.scale=a}get event_values(){const{scale:e}=this;return Object.assign(Object.assign({},super.event_values),{scale:e})}}).__name__="Pinch",x);s.Pinch=te,s.Pinch=te=B([w("pinch")],te);let se=((g=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.rotation=a}get event_values(){const{rotation:e}=this;return Object.assign(Object.assign({},super.event_values),{rotation:e})}}).__name__="Rotate",g);s.Rotate=se,s.Rotate=se=B([w("rotate")],se);let ne=((y=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.delta=a}get event_values(){const{delta:e}=this;return Object.assign(Object.assign({},super.event_values),{delta:e})}}).__name__="MouseWheel",y);s.MouseWheel=ne,s.MouseWheel=ne=B([w("wheel")],ne);let ae=((b=class extends ${}).__name__="MouseMove",b);s.MouseMove=ae,s.MouseMove=ae=B([w("mousemove")],ae);let _e=((P=class extends ${}).__name__="MouseEnter",P);s.MouseEnter=_e,s.MouseEnter=_e=B([w("mouseenter")],_e);let le=((E=class extends ${}).__name__="MouseLeave",E);s.MouseLeave=le,s.MouseLeave=le=B([w("mouseleave")],le);let oe=((O=class extends ${}).__name__="Tap",O);s.Tap=oe,s.Tap=oe=B([w("tap")],oe);let re=((j=class extends ${}).__name__="DoubleTap",j);s.DoubleTap=re,s.DoubleTap=re=B([w("doubletap")],re);let ce=((M=class extends ${}).__name__="Press",M);s.Press=ce,s.Press=ce=B([w("press")],ce);let ue=((R=class extends ${}).__name__="PressUp",R);s.PressUp=ue,s.PressUp=ue=B([w("pressup")],ue);let ie=((f=class extends ${}).__name__="PanStart",f);s.PanStart=ie,s.PanStart=ie=B([w("panstart")],ie);let ve=((S=class extends ${}).__name__="PanEnd",S);s.PanEnd=ve,s.PanEnd=ve=B([w("panend")],ve);let de=((D=class extends ${}).__name__="PinchStart",D);s.PinchStart=de,s.PinchStart=de=B([w("pinchstart")],de);let me=((L=class extends ${}).__name__="PinchEnd",L);s.PinchEnd=me,s.PinchEnd=me=B([w("pinchend")],me);let pe=((k=class extends ${}).__name__="RotateStart",k);s.RotateStart=pe,s.RotateStart=pe=B([w("rotatestart")],pe);let he=((C=class extends ${}).__name__="RotateEnd",C);s.RotateEnd=he,s.RotateEnd=he=B([w("rotateend")],he)}, function _(n,e,t,o,i){o();const d=n(5),a=n(54),c=n(55),l=n(59);t.index={},t.add_document_standalone=async function(n,e,o=[],i=!1){const s=new a.ViewManager;async function f(i){null!=i.default_view?await async function(i){var d;const a=await(0,l.build_view)(i,{parent:null,owner:s});if(a instanceof c.DOMView){const t=n.roots().indexOf(i),c=null!==(d=o[t])&&void 0!==d?d:e;a.render_to(c)}s.add(a),t.index[i.id]=a}(i):n.notify_idle(i)}for(const e of n.roots())await f(e);return i&&(window.document.title=n.title()),n.on_change((n=>{n instanceof d.RootAddedEvent?f(n.model):n instanceof d.RootRemovedEvent?function(n){const e=s.get(n);null!=e&&(e.remove(),s.delete(e),delete t.index[n.id])}(n.model):i&&n instanceof d.TitleChangedEvent&&(window.document.title=n.title)})),s}}, -function _(t,e,i,s,n){s();const o=t(15),r=t(8);class h{get ready(){return this._ready}*children(){}connect(t,e){let i=this._slots.get(e);return null==i&&(i=(t,i)=>{const s=Promise.resolve(e.call(this,t,i));this._ready=this._ready.then((()=>s)),this.root!=this&&(this.root._ready=this.root._ready.then((()=>this._ready)))},this._slots.set(e,i)),t.connect(i,this)}disconnect(t,e){return t.disconnect(e,this)}constructor(t){this.removed=new o.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._removed=!1,this._idle_notified=!1;const{model:e,parent:i,owner:s}=t;this.model=e,this.parent=i,null==i?(this.root=this,this.owner=null!=s?s:new d([this])):(this.root=i.root,this.owner=this.root.owner)}initialize(){this._has_finished=!1}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit(),this._removed=!0}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return null==this.parent}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){o.Signal.disconnect_receiver(this)}on_change(t,e){for(const i of(0,r.isArray)(t)?t:[t])this.connect(i.change,e)}cursor(t,e){return null}notify_finished(){this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):this.root.notify_finished()}}i.View=h,h.__name__="View";class d{constructor(t=[]){this.roots=new Set(t)}get(t){for(const e of this.roots)if(e.model==t)return e;return null}add(t){this.roots.add(t)}delete(t){this.roots.delete(t)}*[Symbol.iterator](){yield*this.roots}*query(t){function*e(i){if(t(i))yield i;else for(const t of i.children())yield*e(t)}for(const t of this.roots)yield*e(t)}*find(t){yield*this.query((e=>e.model==t))}get_one(t){const e=this.find_one(t);if(null!=e)return e;throw new Error(`cannot find a view for ${t}`)}find_one(t){for(const e of this.find(t))return e;return null}find_all(t){return[...this.find(t)]}}i.ViewManager=d,d.__name__="ViewManager"}, +function _(t,e,i,s,n){s();const o=t(15),r=t(8);class h{get ready(){return this._ready}*children(){}mark_finished(){this._has_finished=!0}connect(t,e){let i=this._slots.get(e);return null==i&&(i=(t,i)=>{const s=Promise.resolve(e.call(this,t,i));this._ready=this._ready.then((()=>s)),this.root!=this&&(this.root._ready=this.root._ready.then((()=>this._ready)))},this._slots.set(e,i)),t.connect(i,this)}disconnect(t,e){return t.disconnect(e,this)}constructor(t){this.removed=new o.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._removed=!1,this._idle_notified=!1;const{model:e,parent:i,owner:s}=t;this.model=e,this.parent=i,null==i?(this.root=this,this.owner=null!=s?s:new d([this])):(this.root=i.root,this.owner=this.root.owner)}initialize(){this._has_finished=!1}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit(),this._removed=!0}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return null==this.parent}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){o.Signal.disconnect_receiver(this)}on_change(t,e){for(const i of(0,r.isArray)(t)?t:[t])this.connect(i.change,e)}cursor(t,e){return null}notify_finished(){this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):this.root.notify_finished()}}i.View=h,h.__name__="View";class d{constructor(t=[]){this.roots=new Set(t)}get(t){for(const e of this.roots)if(e.model==t)return e;return null}add(t){this.roots.add(t)}delete(t){this.roots.delete(t)}*[Symbol.iterator](){yield*this.roots}*query(t){function*e(i){if(t(i))yield i;else for(const t of i.children())yield*e(t)}for(const t of this.roots)yield*e(t)}*find(t){yield*this.query((e=>e.model==t))}get_one(t){const e=this.find_one(t);if(null!=e)return e;throw new Error(`cannot find a view for ${t}`)}find_one(t){for(const e of this.find(t))return e;return null}find_all(t){return[...this.find(t)]}}i.ViewManager=d,d.__name__="ViewManager"}, function _(s,e,t,i,l){i();const _=s(1),a=s(54),h=s(56),c=s(8),n=_.__importDefault(s(58));class p extends a.View{get children_el(){var s;return null!==(s=this.shadow_el)&&void 0!==s?s:this.el}initialize(){super.initialize(),this.el=this._createElement()}remove(){(0,h.remove)(this.el),super.remove()}stylesheets(){return[]}css_classes(){return[]}render_to(s){s.appendChild(this.el),this.render()}finish(){this._has_finished=!0,this.notify_finished()}_createElement(){return(0,h.createElement)(this.constructor.tag_name,{class:this.css_classes()})}}t.DOMView=p,p.__name__="DOMView",p.tag_name="div";class r extends p{initialize(){super.initialize(),this.class_list=new h.ClassList(this.el.classList)}}t.DOMElementView=r,r.__name__="DOMElementView";class d extends r{constructor(){super(...arguments),this._applied_stylesheets=[],this._applied_css_classes=[]}initialize(){super.initialize(),this.shadow_el=this.el.attachShadow({mode:"open"})}stylesheets(){return[...super.stylesheets(),n.default]}empty(){(0,h.empty)(this.shadow_el),this.class_list.clear(),this._applied_css_classes=[],this._applied_stylesheets=[]}render(){this.empty(),this._update_stylesheets(),this._update_css_classes()}*_stylesheets(){for(const s of this.stylesheets())yield(0,c.isString)(s)?new h.InlineStyleSheet(s):s}*_css_classes(){yield`bk-${this.model.type.replace(/\./g,"-")}`,yield*this.css_classes()}_apply_stylesheets(s){this._applied_stylesheets.push(...s),s.forEach((s=>s.install(this.shadow_el)))}_apply_css_classes(s){this._applied_css_classes.push(...s),this.class_list.add(...s)}_update_stylesheets(){this._applied_stylesheets.forEach((s=>s.uninstall())),this._applied_stylesheets=[],this._apply_stylesheets([...this._stylesheets()])}_update_css_classes(){this.class_list.remove(this._applied_css_classes),this._applied_css_classes=[],this._apply_css_classes([...this._css_classes()])}}t.DOMComponentView=d,d.__name__="DOMComponentView"}, function _(t,e,n,o,i){o(),n.supports_adopted_stylesheets=n.px=n.dom_ready=void 0;const s=t(8),l=t(9),r=t(57),c=t=>(e={},...n)=>{const o=document.createElement(t);(0,s.isPlainObject)(e)||(n=[e,...n],e={});for(let[t,n]of(0,l.entries)(e))if(null!=n&&(!(0,s.isBoolean)(n)||n))if("class"===t&&((0,s.isString)(n)&&(n=n.split(/\s+/)),(0,s.isArray)(n)))for(const t of n)null!=t&&o.classList.add(t);else if("style"===t&&(0,s.isPlainObject)(n))for(const[t,e]of(0,l.entries)(n))o.style[t]=e;else if("data"===t&&(0,s.isPlainObject)(n))for(const[t,e]of(0,l.entries)(n))o.dataset[t]=e;else o.setAttribute(t,n);function i(t){if((0,s.isString)(t))o.appendChild(document.createTextNode(t));else if(t instanceof Node)o.appendChild(t);else if(t instanceof NodeList||t instanceof HTMLCollection)for(const e of t)o.appendChild(e);else if(null!=t&&!1!==t)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(t)}`)}for(const t of n)if((0,s.isArray)(t))for(const e of t)i(e);else i(t);return o};function a(t){return document.createTextNode(t)}function d(t){const e=t.parentNode;null!=e&&e.removeChild(t)}function h(t){const e=parseFloat(t);return isFinite(e)?e:0}function u(t){const e=getComputedStyle(t);return{border:{top:h(e.borderTopWidth),bottom:h(e.borderBottomWidth),left:h(e.borderLeftWidth),right:h(e.borderRightWidth)},margin:{top:h(e.marginTop),bottom:h(e.marginBottom),left:h(e.marginLeft),right:h(e.marginRight)},padding:{top:h(e.paddingTop),bottom:h(e.paddingBottom),left:h(e.paddingLeft),right:h(e.paddingRight)}}}function f(t){const e=t.getBoundingClientRect();return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}n.createElement=function(t,e,...n){return c(t)(e,...n)},n.div=c("div"),n.span=c("span"),n.canvas=c("canvas"),n.link=c("link"),n.style=c("style"),n.a=c("a"),n.p=c("p"),n.i=c("i"),n.pre=c("pre"),n.button=c("button"),n.label=c("label"),n.legend=c("legend"),n.fieldset=c("fieldset"),n.input=c("input"),n.select=c("select"),n.option=c("option"),n.optgroup=c("optgroup"),n.textarea=c("textarea"),n.createSVGElement=function(t,e=null,...n){const o=document.createElementNS("http://www.w3.org/2000/svg",t);for(const[t,n]of(0,l.entries)(null!=e?e:{}))null!=n&&!1!==n&&o.setAttribute(t,n);function i(t){if((0,s.isString)(t))o.appendChild(document.createTextNode(t));else if(t instanceof Node)o.appendChild(t);else if(t instanceof NodeList||t instanceof HTMLCollection)for(const e of t)o.appendChild(e);else if(null!=t&&!1!==t)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(t)}`)}for(const t of n)if((0,s.isArray)(t))for(const e of t)i(e);else i(t);return o},n.text=a,n.nbsp=function(){return a("\xa0")},n.append=function(t,...e){for(const n of e)t.appendChild(n)},n.remove=d,n.replaceWith=function(t,e){const n=t.parentNode;null!=n&&n.replaceChild(e,t)},n.prepend=function(t,...e){const n=t.firstChild;for(const o of e)t.insertBefore(o,n)},n.empty=function(t,e=!1){let n;for(;null!=(n=t.firstChild);)t.removeChild(n);if(e&&t instanceof Element)for(const e of t.attributes)t.removeAttributeNode(e)},n.contains=function(t,e){let n=e;for(;null!=n.parentNode;){const e=n.parentNode;if(e==t)return!0;n=e instanceof ShadowRoot?e.host:e}return!1},n.display=function(t,e=!0){t.style.display=e?"":"none"},n.undisplay=function(t){t.style.display="none"},n.show=function(t){t.style.visibility=""},n.hide=function(t){t.style.visibility="hidden"},n.offset_bbox=function(t){const{top:e,left:n,width:o,height:i}=t.getBoundingClientRect();return new r.BBox({left:n+scrollX-document.documentElement.clientLeft,top:e+scrollY-document.documentElement.clientTop,width:o,height:i})},n.parent=function(t,e){let n=t;for(;null!=(n=n.parentElement);)if(n.matches(e))return n;return null},n.extents=u,n.size=f,n.scroll_size=function(t){return{width:Math.ceil(t.scrollWidth),height:Math.ceil(t.scrollHeight)}},n.outer_size=function(t){const{margin:{left:e,right:n,top:o,bottom:i}}=u(t),{width:s,height:l}=f(t);return{width:Math.ceil(s+e+n),height:Math.ceil(l+o+i)}},n.content_size=function(t){var e;const{left:n,top:o}=t.getBoundingClientRect(),{padding:i}=u(t);let s=0,l=0;for(const r of(null!==(e=t.shadowRoot)&&void 0!==e?e:t).children){const t=r.getBoundingClientRect();s=Math.max(s,Math.ceil(t.left-n-i.left+t.width)),l=Math.max(l,Math.ceil(t.top-o-i.top+t.height))}return{width:s,height:l}},n.bounding_box=function(t){const{x:e,y:n,width:o,height:i}=t.getBoundingClientRect();return new r.BBox({x:e,y:n,width:o,height:i})},n.position=function(t,e,n){const{style:o}=t;if(o.left=`${e.x}px`,o.top=`${e.y}px`,o.width=`${e.width}px`,o.height=`${e.height}px`,null==n)o.margin="";else{const{top:t,right:e,bottom:i,left:s}=n;o.margin=`${t}px ${e}px ${i}px ${s}px`}};class p{constructor(t){this.class_list=t}get values(){const t=[];for(let e=0;ethis.class_list.remove(t))):this.class_list.remove(e);return this}clear(){for(const t of this.values)this.class_list.remove(t);return this}toggle(t,e){return(null!=e?e:!this.has(t))?this.add(t):this.remove(t),this}}var g;n.ClassList=p,p.__name__="ClassList",n.classes=function(t){return new p(t.classList)},n.toggle_attribute=function(t,e,n){null==n&&(n=!t.hasAttribute(e)),n?t.setAttribute(e,"true"):t.removeAttribute(e)},(g=n.MouseButton||(n.MouseButton={}))[g.None=0]="None",g[g.Primary=1]="Primary",g[g.Secondary=2]="Secondary",g[g.Auxiliary=4]="Auxiliary",g[g.Left=1]="Left",g[g.Right=2]="Right",g[g.Middle=4]="Middle";class m{install(t){t.append(this.el)}uninstall(){this.el.remove()}}n.StyleSheet=m,m.__name__="StyleSheet";class _ extends m{constructor(t){super(),this.el=(0,n.style)({type:"text/css"},t)}clear(){this.replace("")}*_to_rules(t){for(const[e,n]of(0,l.entries)(t))if(null!=n){const t=e.replace(/_/g,"-");yield`${t}: ${n};`}}_to_css(t,e){return null==e?t:`${t}{${[...this._to_rules(e)].join("")}}`}replace(t,e){this.el.textContent=this._to_css(t,e)}prepend(t,e){var n;const o=null!==(n=this.el.textContent)&&void 0!==n?n:"";this.el.textContent=`${this._to_css(t,e)}\n${o}`}append(t,e){var n;const o=null!==(n=this.el.textContent)&&void 0!==n?n:"";this.el.textContent=`${o}\n${this._to_css(t,e)}`}remove(){d(this.el)}}n.InlineStyleSheet=_,_.__name__="InlineStyleSheet";class y extends _{install(){this.el.isConnected||document.head.appendChild(this.el)}}n.GlobalInlineStyleSheet=y,y.__name__="GlobalInlineStyleSheet";class x extends m{constructor(t){super(),this.el=(0,n.link)({rel:"stylesheet",href:t})}replace(t){this.el.href=t}remove(){d(this.el)}}n.ImportedStyleSheet=x,x.__name__="ImportedStyleSheet";class b extends x{install(){this.el.isConnected||document.head.appendChild(this.el)}}n.GlobalImportedStyleSheet=b,b.__name__="GlobalImportedStyleSheet",n.dom_ready=async function(){if("loading"==document.readyState)return new Promise(((t,e)=>{document.addEventListener("DOMContentLoaded",(()=>t()),{once:!0})}))},n.px=function(t){return`${t}px`},n.supports_adopted_stylesheets="adoptedStyleSheets"in ShadowRoot.prototype}, -function _(t,e,i,r,n){r();const h=t(23),s=t(25),o=t(13),{min:x,max:y,round:u}=Math;function g(t,e){return isNaN(t)?e:isNaN(e)?t:x(t,e)}function a(t,e){return isNaN(t)?e:isNaN(e)?t:y(t,e)}i.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},i.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},i.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},i.union=function(t,e){return{x0:g(t.x0,e.x0),x1:a(t.x1,e.x1),y0:g(t.y0,e.y0),y1:a(t.y1,e.y1)}};class c{constructor(t,e=!1){if(null==t)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in t){const{x0:e,y0:i,x1:r,y1:n}=t;if(isFinite(e+i+r+n)){if(!(e<=r&&i<=n))throw new Error(`invalid bbox {x0: ${e}, y0: ${i}, x1: ${r}, y1: ${n}}`);this.x0=e,this.y0=i,this.x1=r,this.y1=n}else this.x0=NaN,this.y0=NaN,this.x1=NaN,this.y1=NaN}else if("x"in t){const{x:e,y:i,width:r,height:n}=t;if(!(r>=0&&n>=0))throw new Error(`invalid bbox {x: ${e}, y: ${i}, width: ${r}, height: ${n}}`);this.x0=e,this.y0=i,this.x1=e+r,this.y1=i+n}else{let i,r,n,h;if("width"in t)if("left"in t)i=t.left,r=i+t.width;else if("right"in t)r=t.right,i=r-t.width;else{const e=t.width/2;i=t.hcenter-e,r=t.hcenter+e}else i=t.left,r=t.right;if("height"in t)if("top"in t)n=t.top,h=n+t.height;else if("bottom"in t)h=t.bottom,n=h-t.height;else{const e=t.height/2;n=t.vcenter-e,h=t.vcenter+e}else n=t.top,h=t.bottom;if(i>r||n>h){if(!e)throw new Error(`invalid bbox {left: ${i}, top: ${n}, right: ${r}, bottom: ${h}}`);i>r&&(i=r),n>h&&(n=h)}this.x0=i,this.y0=n,this.x1=r,this.y1=h}}static from_lrtb({left:t,right:e,top:i,bottom:r}){return new c({x0:Math.min(t,e),y0:Math.min(i,r),x1:Math.max(t,e),y1:Math.max(i,r)})}clone(){return new c(this)}equals(t){return this.x0==t.x0&&this.y0==t.y0&&this.x1==t.x1&&this.y1==t.y1}[s.equals](t,e){return e.eq(this.x0,t.x0)&&e.eq(this.y0,t.y0)&&e.eq(this.x1,t.x1)&&e.eq(this.y1,t.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get is_valid(){const{x0:t,x1:e,y0:i,y1:r}=this;return isFinite(t+e+i+r)}get is_empty(){const{x0:t,x1:e,y0:i,y1:r}=this;return 0==t&&0==e&&0==i&&0==r}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return{x:this.x0,y:this.y0}}get p1(){return{x:this.x1,y:this.y1}}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:t,y0:e,x1:i,y1:r}=this;return{p0:{x:t,y:e},p1:{x:i,y:e},p2:{x:i,y:r},p3:{x:t,y:r}}}get box(){const{x:t,y:e,width:i,height:r}=this;return{x:t,y:e,width:i,height:r}}get lrtb(){const{left:t,right:e,top:i,bottom:r}=this;return{left:t,right:e,top:i,bottom:r}}get x_range(){return{start:this.x0,end:this.x1}}get y_range(){return{start:this.y0,end:this.y1}}get h_range(){return this.x_range}get v_range(){return this.y_range}get ranges(){return[this.x_range,this.y_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}round(){return new c({x0:u(this.x0),x1:u(this.x1),y0:u(this.y0),y1:u(this.y1)})}relative(){const{width:t,height:e}=this;return new c({x:0,y:0,width:t,height:e})}translate(t,e){const{x:i,y:r,width:n,height:h}=this;return new c({x:t+i,y:e+r,width:n,height:h})}relativize(t,e){return[t-this.x,e-this.y]}contains(t,e){return this.x0<=t&&t<=this.x1&&this.y0<=e&&e<=this.y1}clip(t,e){return tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]}grow_by(t){return new c({left:this.left-t,right:this.right+t,top:this.top-t,bottom:this.bottom+t})}shrink_by(t){return new c({left:this.left+t,right:this.right-t,top:this.top+t,bottom:this.bottom-t},!0)}union(t){return new c({x0:x(this.x0,t.x0),y0:x(this.y0,t.y0),x1:y(this.x1,t.x1),y1:y(this.y1,t.y1)})}intersection(t){return this.intersects(t)?new c({x0:y(this.x0,t.x0),y0:y(this.y0,t.y0),x1:x(this.x1,t.x1),y1:x(this.y1,t.y1)}):null}intersects(t){return!(t.x1this.x1||t.y1this.y1)}get x_screen(){var t;const e=this;return null!==(t=this._x_screen)&&void 0!==t?t:this._x_screen={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_screen(){var t;const e=this;return null!==(t=this._y_screen)&&void 0!==t?t:this._y_screen={compute:t=>e.top+t,invert:t=>t-e.top,v_compute(t){const{top:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{top:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.y_range},get target_range(){return e.y_range}}}get x_view(){var t;const e=this;return null!==(t=this._x_view)&&void 0!==t?t:this._x_view={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_view(){var t;const e=this;return null!==(t=this._y_view)&&void 0!==t?t:this._y_view={compute:t=>e.bottom-t,invert:t=>e.bottom-t,v_compute(t){const{bottom:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i-t)))},v_invert(t){const{bottom:i}=e;return(0,o.map)(t,(t=>i-t))},get source_range(){return e.y_range},get target_range(){return{start:e.bottom,end:e.top}}}}get xview(){return this.x_view}get yview(){return this.y_view}}i.BBox=c,c.__name__="BBox"}, +function _(t,e,i,r,n){r();const h=t(23),s=t(25),o=t(13),{min:x,max:y,round:u}=Math;function g(t,e){return isNaN(t)?e:isNaN(e)?t:x(t,e)}function a(t,e){return isNaN(t)?e:isNaN(e)?t:y(t,e)}i.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},i.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},i.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},i.union=function(t,e){return{x0:g(t.x0,e.x0),x1:a(t.x1,e.x1),y0:g(t.y0,e.y0),y1:a(t.y1,e.y1)}};class c{constructor(t,e=!1){if(null==t)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in t){const{x0:e,y0:i,x1:r,y1:n}=t;if(isFinite(e+i+r+n)){if(!(e<=r&&i<=n))throw new Error(`invalid bbox {x0: ${e}, y0: ${i}, x1: ${r}, y1: ${n}}`);this.x0=e,this.y0=i,this.x1=r,this.y1=n}else this.x0=NaN,this.y0=NaN,this.x1=NaN,this.y1=NaN}else if("x"in t){const{x:e,y:i,width:r,height:n}=t;if(!(r>=0&&n>=0))throw new Error(`invalid bbox {x: ${e}, y: ${i}, width: ${r}, height: ${n}}`);this.x0=e,this.y0=i,this.x1=e+r,this.y1=i+n}else{let i,r,n,h;if("width"in t)if("left"in t)i=t.left,r=i+t.width;else if("right"in t)r=t.right,i=r-t.width;else{const e=t.width/2;i=t.hcenter-e,r=t.hcenter+e}else i=t.left,r=t.right;if("height"in t)if("top"in t)n=t.top,h=n+t.height;else if("bottom"in t)h=t.bottom,n=h-t.height;else{const e=t.height/2;n=t.vcenter-e,h=t.vcenter+e}else n=t.top,h=t.bottom;if(i>r||n>h){if(!e)throw new Error(`invalid bbox {left: ${i}, top: ${n}, right: ${r}, bottom: ${h}}`);i>r&&(i=r),n>h&&(n=h)}this.x0=i,this.y0=n,this.x1=r,this.y1=h}}static from_lrtb({left:t,right:e,top:i,bottom:r}){return new c({x0:Math.min(t,e),y0:Math.min(i,r),x1:Math.max(t,e),y1:Math.max(i,r)})}clone(){return new c(this)}equals(t){return this.x0==t.x0&&this.y0==t.y0&&this.x1==t.x1&&this.y1==t.y1}[s.equals](t,e){return e.eq(this.x0,t.x0)&&e.eq(this.y0,t.y0)&&e.eq(this.x1,t.x1)&&e.eq(this.y1,t.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get is_valid(){const{x0:t,x1:e,y0:i,y1:r}=this;return isFinite(t+e+i+r)}get is_empty(){const{x0:t,x1:e,y0:i,y1:r}=this;return 0==t&&0==e&&0==i&&0==r}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return{x:this.x0,y:this.y0}}get p1(){return{x:this.x1,y:this.y1}}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:t,y0:e,x1:i,y1:r}=this;return{p0:{x:t,y:e},p1:{x:i,y:e},p2:{x:i,y:r},p3:{x:t,y:r}}}get box(){const{x:t,y:e,width:i,height:r}=this;return{x:t,y:e,width:i,height:r}}get lrtb(){const{left:t,right:e,top:i,bottom:r}=this;return{left:t,right:e,top:i,bottom:r}}get x_range(){return{start:this.x0,end:this.x1}}get y_range(){return{start:this.y0,end:this.y1}}get h_range(){return this.x_range}get v_range(){return this.y_range}get ranges(){return[this.x_range,this.y_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}round(){return new c({x0:u(this.x0),x1:u(this.x1),y0:u(this.y0),y1:u(this.y1)})}relative(){const{width:t,height:e}=this;return new c({x:0,y:0,width:t,height:e})}translate(t,e){const{x:i,y:r,width:n,height:h}=this;return new c({x:t+i,y:e+r,width:n,height:h})}scale(t){return new c({x0:this.x0*t,x1:this.x1*t,y0:this.y0*t,y1:this.y1*t})}relativize(t,e){return[t-this.x,e-this.y]}contains(t,e){return this.x0<=t&&t<=this.x1&&this.y0<=e&&e<=this.y1}clip(t,e){return tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]}grow_by(t){return new c({left:this.left-t,right:this.right+t,top:this.top-t,bottom:this.bottom+t})}shrink_by(t){return new c({left:this.left+t,right:this.right-t,top:this.top+t,bottom:this.bottom-t},!0)}union(t){return new c({x0:x(this.x0,t.x0),y0:x(this.y0,t.y0),x1:y(this.x1,t.x1),y1:y(this.y1,t.y1)})}intersection(t){return this.intersects(t)?new c({x0:y(this.x0,t.x0),y0:y(this.y0,t.y0),x1:x(this.x1,t.x1),y1:x(this.y1,t.y1)}):null}intersects(t){return!(t.x1this.x1||t.y1this.y1)}get x_screen(){var t;const e=this;return null!==(t=this._x_screen)&&void 0!==t?t:this._x_screen={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_screen(){var t;const e=this;return null!==(t=this._y_screen)&&void 0!==t?t:this._y_screen={compute:t=>e.top+t,invert:t=>t-e.top,v_compute(t){const{top:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{top:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.y_range},get target_range(){return e.y_range}}}get x_view(){var t;const e=this;return null!==(t=this._x_view)&&void 0!==t?t:this._x_view={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_view(){var t;const e=this;return null!==(t=this._y_view)&&void 0!==t?t:this._y_view={compute:t=>e.bottom-t,invert:t=>e.bottom-t,v_compute(t){const{bottom:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i-t)))},v_invert(t){const{bottom:i}=e;return(0,o.map)(t,(t=>i-t))},get source_range(){return e.y_range},get target_range(){return{start:e.bottom,end:e.top}}}}get xview(){return this.x_view}get yview(){return this.y_view}}i.BBox=c,c.__name__="BBox"}, function _(o,e,i,n,t){n(),i.default=":host{--base-font:var(--bokeh-base-font, Helvetica, Arial, sans-serif);--mono-font:var(--bokeh-mono-font, monospace);--font-size:12px;--line-height:calc(20 / 14);--line-height-computed:calc(var(--font-size) * var(--line-height));--border-radius:4px;--padding-vertical:6px;--padding-horizontal:12px;}:host{box-sizing:border-box;font-family:var(--base-font);font-size:13px;line-height:var(--line-height);}*,*:before,*:after{box-sizing:inherit;font-family:inherit;}pre,code{font-family:var(--mono-font);margin:0;}"}, function _(e,n,t,o,s){o();const i=e(10),c=e(12);async function a(e,n,t){(0,c.assert)(null!=e,"model doesn't implement a view");const o=new e(Object.assign(Object.assign({},t),{model:n}));return o.initialize(),await o.lazy_initialize(),o}t.build_view=async function(e,n={parent:null},t=(e=>e.default_view)){const o=await a(t(e),e,n);return o.connect_signals(),o},t.build_views=async function(e,n,t={parent:null},o=(e=>e.default_view)){const s=(0,i.difference)([...e.keys()],n),c=[];for(const n of s){const t=e.get(n);null!=t&&(e.delete(n),c.push(t),t.remove())}const l=[],r=n.filter((n=>!e.has(n)));for(const n of r){const s=await a(o(n),n,t);e.set(n,s),l.push(s)}for(const e of l)e.connect_signals();return{created:l,removed:c}},t.remove_views=function(e){for(const[n,t]of e)t.remove(),e.delete(n)}}, function _(n,t,o,e,s){e();const a=n(61),c=n(18),r=n(53);o._get_ws_url=function(n,t){let o,e="ws:";return"https:"==window.location.protocol&&(e="wss:"),null!=t?(o=document.createElement("a"),o.href=t):o=window.location,null!=n?"/"==n&&(n=""):n=o.pathname.replace(/\/+$/,""),`${e}//${o.host}${n}/ws`};const i=new Map;o.add_document_from_session=async function(n,t,o,e=[],s=!1){const l=window.location.search.substring(1);let d;try{d=await function(n,t,o){const e=(0,a.parse_token)(t).session_id;i.has(n)||i.set(n,new Map);const s=i.get(n);return s.has(e)||s.set(e,(0,a.pull_session)(n,t,o)),s.get(e)}(n,t,l)}catch(n){const o=(0,a.parse_token)(t).session_id;throw c.logger.error(`Failed to load Bokeh session ${o}: ${n}`),n}return(0,r.add_document_standalone)(d.document,o,e,s)}}, function _(e,s,n,t,o){t();const r=e(18),i=e(5),l=e(62),c=e(63),_=e(64);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_TOKEN="eyJzZXNzaW9uX2lkIjogImRlZmF1bHQifQ";let h=0;function a(e){let s=e.split(".")[0];const n=s.length%4;return 0!=n&&(s+="=".repeat(4-n)),JSON.parse(atob(s.replace(/_/g,"/").replace(/-/g,"+")))}n.parse_token=a;class d{constructor(e=n.DEFAULT_SERVER_WEBSOCKET_URL,s=n.DEFAULT_TOKEN,t=null){this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_replies=new Map,this._pending_messages=[],this._receiver=new c.Receiver,this.url=e,this.token=s,this.args_string=t,this.id=a(s).session_id.split(".")[0],r.logger.debug(`Creating websocket ${this._number} to '${this.url}' session '${this.id}'`)}async connect(){if(this.closed_permanently)throw new Error("Cannot connect() a closed ClientConnection");if(null!=this.socket)throw new Error("Already connected");this._current_handler=null,this._pending_replies.clear(),this._pending_messages=[];try{let e=`${this.url}`;return null!=this.args_string&&this.args_string.length>0&&(e+=`?${this.args_string}`),this.socket=new WebSocket(e,["bokeh",this.token]),new Promise(((e,s)=>{this.socket.binaryType="arraybuffer",this.socket.onopen=()=>this._on_open(e,s),this.socket.onmessage=e=>this._on_message(e),this.socket.onclose=e=>this._on_close(e,s),this.socket.onerror=()=>this._on_error(s)}))}catch(e){throw r.logger.error(`websocket creation failed to url: ${this.url}`),r.logger.error(` - ${e}`),e}}close(){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())}_schedule_reconnect(e){setTimeout((()=>{var e;this.closed_permanently||(r.logger.info(`Websocket connection ${this._number} disconnected, will not attempt to reconnect`),null===(e=this.session)||void 0===e||e.notify_connection_lost())}),e)}send(e){null!=this.socket?e.send(this.socket):r.logger.error("not connected so cannot send",e)}async send_with_reply(e){const s=await new Promise(((s,n)=>{this._pending_replies.set(e.msgid(),{resolve:s,reject:n}),this.send(e)}));if("ERROR"==s.msgtype())throw new Error(`Error reply ${s.content.text}`);return s}async _pull_doc_json(){const e=l.Message.create("PULL-DOC-REQ",{},{}),s=await this.send_with_reply(e);if(!("doc"in s.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return s.content.doc}async _repull_session_doc(e,s){r.logger.debug(null!=this.session?"Repulling session":"Pulling session for first time");try{const n=await this._pull_doc_json();if(null==this.session)if(this.closed_permanently)r.logger.debug("Got new document after connection was already closed"),s(new Error("The connection has been closed"));else{const s=[],t=i.Document.from_json(n,s);this.session=new _.ClientSession(this,t);for(const e of s)t._trigger_on_change(e);for(const e of this._pending_messages)this.session.handle(e);this._pending_messages=[],r.logger.debug("Created a new session from new pulled doc"),e(this.session)}else this.session.document.replace_with_json(n),r.logger.debug("Updated existing session with new pulled doc")}catch(e){console.trace(e),r.logger.error(`Failed to repull session ${e}`),s(e instanceof Error?e:`${e}`)}}_on_open(e,s){r.logger.info(`Websocket connection ${this._number} is now open`),this._current_handler=n=>{this._awaiting_ack_handler(n,e,s)}}_on_message(e){null==this._current_handler&&r.logger.error("Got a message with no current handler set");try{this._receiver.consume(e.data)}catch(e){this._close_bad_protocol(`${e}`)}const s=this._receiver.message;if(null!=s){const e=s.problem();null!=e&&this._close_bad_protocol(e),this._current_handler(s)}}_on_close(e,s){r.logger.info(`Lost websocket ${this._number} connection, ${e.code} (${e.reason})`),this.socket=null,this._pending_replies.forEach((e=>e.reject("Disconnected"))),this._pending_replies.clear(),this.closed_permanently||this._schedule_reconnect(2e3),s(new Error(`Lost websocket connection, ${e.code} (${e.reason})`))}_on_error(e){r.logger.debug(`Websocket error on socket ${this._number}`);const s="Could not open websocket";r.logger.error(`Failed to connect to Bokeh server: ${s}`),e(new Error(s))}_close_bad_protocol(e){r.logger.error(`Closing connection: ${e}`),null!=this.socket&&this.socket.close(1002,e)}_awaiting_ack_handler(e,s,n){"ACK"===e.msgtype()?(this._current_handler=e=>this._steady_state_handler(e),this._repull_session_doc(s,n)):this._close_bad_protocol("First message was not an ACK")}_steady_state_handler(e){const s=e.reqid(),n=this._pending_replies.get(s);null!=n?(this._pending_replies.delete(s),n.resolve(e)):null!=this.session?this.session.handle(e):"PATCH-DOC"!=e.msgtype()&&this._pending_messages.push(e)}}n.ClientConnection=d,d.__name__="ClientConnection",n.pull_session=function(e,s,n){return new d(e,s,n).connect()}}, -function _(e,s,t,r,n){r();const i=e(30),a=e(38),h=e(12);class f{get buffers(){return this._buffers}constructor(e,s,t){this._buffers=new Map,this.header=e,this.metadata=s,this.content=t}static assemble(e,s,t){const r=JSON.parse(e),n=JSON.parse(s),i=JSON.parse(t);return new f(r,n,i)}assemble_buffer(e,s){var t;const r=null!==(t=this.header.num_buffers)&&void 0!==t?t:0;if(r<=this._buffers.size)throw new Error(`too many buffers received, expecting ${r}`);const{id:n}=JSON.parse(e);this._buffers.set(n,s)}static create(e,s,t){const r=f.create_header(e);return new f(r,s,t)}static create_header(e){return{msgid:(0,a.unique_id)(),msgtype:e}}complete(){const{num_buffers:e}=this.header;return null==e||this._buffers.size==e}send(e){(0,h.assert)(null==this.header.num_buffers);const s=[],t=JSON.stringify(this.content,((e,t)=>{if(t instanceof i.Buffer){const e={id:`${s.length}`};return s.push([e,t.buffer]),e}return t})),r=s.length;r>0&&(this.header.num_buffers=r);const n=JSON.stringify(this.header),a=JSON.stringify(this.metadata);e.send(n),e.send(a),e.send(t);for(const[t,r]of s)e.send(JSON.stringify(t)),e.send(r)}msgid(){return this.header.msgid}msgtype(){return this.header.msgtype}reqid(){return this.header.reqid}problem(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}t.Message=f,f.__name__="Message"}, +function _(e,s,t,r,n){r();const i=e(31),a=e(39),h=e(12);class f{get buffers(){return this._buffers}constructor(e,s,t){this._buffers=new Map,this.header=e,this.metadata=s,this.content=t}static assemble(e,s,t){const r=JSON.parse(e),n=JSON.parse(s),i=JSON.parse(t);return new f(r,n,i)}assemble_buffer(e,s){var t;const r=null!==(t=this.header.num_buffers)&&void 0!==t?t:0;if(r<=this._buffers.size)throw new Error(`too many buffers received, expecting ${r}`);const{id:n}=JSON.parse(e);this._buffers.set(n,s)}static create(e,s,t){const r=f.create_header(e);return new f(r,s,t)}static create_header(e){return{msgid:(0,a.unique_id)(),msgtype:e}}complete(){const{num_buffers:e}=this.header;return null==e||this._buffers.size==e}send(e){(0,h.assert)(null==this.header.num_buffers);const s=[],t=JSON.stringify(this.content,((e,t)=>{if(t instanceof i.Buffer){const e={id:`${s.length}`};return s.push([e,t.buffer]),e}return t})),r=s.length;r>0&&(this.header.num_buffers=r);const n=JSON.stringify(this.header),a=JSON.stringify(this.metadata);e.send(n),e.send(a),e.send(t);for(const[t,r]of s)e.send(JSON.stringify(t)),e.send(r)}msgid(){return this.header.msgid}msgtype(){return this.header.msgtype}reqid(){return this.header.reqid}problem(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}t.Message=f,f.__name__="Message"}, function _(t,e,s,_,r){_();const i=t(62),h=t(8),a=t(12);class n{constructor(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}consume(t){this._current_consumer(t)}_HEADER(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA}_METADATA(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT}_CONTENT(t){this._assume_text(t),this._fragments.push(t);const[e,s,_]=this._fragments;(0,a.assert)(null!=e&&null!=s&&null!=_),this._partial=i.Message.assemble(e,s,_),this._check_complete()}_BUFFER_HEADER(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD}_BUFFER_PAYLOAD(t){this._assume_binary(t),(0,a.assert)(null!=this._partial&&null!=this._buf_header),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()}_assume_text(t){if(!(0,h.isString)(t))throw new Error("Expected text fragment but received binary fragment")}_assume_binary(t){if(!(t instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")}_check_complete(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER}}s.Receiver=n,n.__name__="Receiver"}, function _(e,n,t,o,s){o();const c=e(5),_=e(52),i=e(62),r=e(18);class a{constructor(e,n){this._document_listener=e=>{this._document_changed(e)},this._connection=e,this.document=n,this.document.on_change(this._document_listener,!0)}get id(){return this._connection.id}handle(e){const n=e.msgtype();switch(n){case"PATCH-DOC":this._handle_patch(e);break;case"OK":this._handle_ok(e);break;case"ERROR":this._handle_error(e);break;default:r.logger.debug(`Doing nothing with message '${n}'`)}}notify_connection_lost(){this.document.event_manager.send_event(new _.ConnectionLost)}close(){this._connection.close()}_connection_closed(){this.document.remove_on_change(this._document_listener)}async request_server_info(){const e=i.Message.create("SERVER-INFO-REQ",{},{});return(await this._connection.send_with_reply(e)).content}async force_roundtrip(){await this.request_server_info()}_document_changed(e){const n=e instanceof c.DocumentEventBatch?e.events:[e],t=this.document.create_json_patch(n),o=i.Message.create("PATCH-DOC",{},t);this._connection.send(o)}_handle_patch(e){this.document.apply_json_patch(e.content,e.buffers)}_handle_ok(e){r.logger.trace(`Unhandled OK reply to ${e.reqid()}`)}_handle_error(e){r.logger.error(`Unhandled ERROR reply to ${e.reqid()}: ${e.content.text}`)}}t.ClientSession=a,a.__name__="ClientSession"}, function _(n,e,o,t,r){t();const i=n(56),l=n(8);function s(n){let e=(0,l.isString)(n)?document.getElementById(n):n;if(null==e)throw new Error(`Error rendering Bokeh model: could not find ${(0,l.isString)(n)?`#${n}`:n} HTML tag`);if(!(0,i.contains)(document.body,e))throw new Error(`Error rendering Bokeh model: element ${(0,l.isString)(n)?`#${n}`:n} must be under `);if(e instanceof HTMLElement&&"SCRIPT"==e.tagName){const n=(0,i.div)();(0,i.replaceWith)(e,n),e=n}return e}o._resolve_element=function(n){const{elementid:e}=n;return null!=e?s(e):document.body},o._resolve_root_elements=function(n){const e=[];if(null!=n.root_ids&&null!=n.roots)for(const o of n.root_ids)e.push(s(n.roots[o]));return e}}, @@ -1034,7 +1034,7 @@

Plots# function _(n,c,o,s,e){s();const t=n(85);class u extends t.Scale{constructor(n){super(n)}}o.ContinuousScale=u,u.__name__="ContinuousScale"}, function _(t,e,s,a,r){a();const o=t(90);class n extends o.ContinuousScale{constructor(t){super(t)}get s_compute(){const[t,e,s,a]=this._compute_state();return r=>{if(0==s)return 0;{const o=(Math.log(r)-a)/s;return isFinite(o)?o*t+e:NaN}}}get s_invert(){const[t,e,s,a]=this._compute_state();return r=>{const o=(r-e)/t;return Math.exp(s*o+a)}}_get_safe_factor(t,e){let s=t<0?0:t,a=e<0?0:e;if(s==a)if(0==s)[s,a]=[1,10];else{const t=Math.log10(s);s=10**Math.floor(t),a=Math.ceil(t)!=Math.floor(t)?10**Math.ceil(t):10**(Math.ceil(t)+1)}return[s,a]}_compute_state(){const t=this.source_range.start,e=this.source_range.end,s=this.target_range.start,a=this.target_range.end-s,[r,o]=this._get_safe_factor(t,e);let n,c;0==r?(n=Math.log(o),c=0):(n=Math.log(o/r),c=Math.log(r));return[a,s,n,c]}}s.LogScale=n,n.__name__="LogScale"}, function _(t,e,c,a,s){a();const n=t(85),r=t(89),{_linear_compute_state:o}=r.LinearScale.prototype;class l extends n.Scale{constructor(t){super(t)}get s_compute(){const[t,e]=o.call(this),c=this.source_range;return a=>t*c.synthetic(a)+e}get s_invert(){const[t,e]=o.call(this);return c=>(c-e)/t}}c.CategoricalScale=l,l.__name__="CategoricalScale"}, -function _(t,i,n,e,a){var s;e();const l=t(1),_=t(94),o=t(19),r=t(32),d=t(18),h=l.__importStar(t(57)),u=t(95);n.auto_ranged=Symbol("auto_ranged"),n.is_auto_ranged=function(t){return n.auto_ranged in t};class g extends _.DataRange{constructor(t){super(t),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=isNaN(this.start)?null:this.start,this._initial_end=isNaN(this.end)?null: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,this._plot_bounds=new Map}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:t}=this,i=(0,r.flat_map)(this.plots,(t=>t.auto_ranged_renderers.map((t=>t.model))));return(0,u.compute_renderers)(0==t.length?"auto":t,[...i])}_compute_plot_bounds(t,i){let n=h.empty();for(const e of t){const t=i.get(e);null==t||!e.visible&&this.only_visible||(n=h.union(n,t))}return n}adjust_bounds_for_aspect(t,i){const n=h.empty();let e=t.x1-t.x0;e<=0&&(e=1);let a=t.y1-t.y0;a<=0&&(a=1);const s=.5*(t.x1+t.x0),l=.5*(t.y1+t.y0);return el&&("start"==this.follow?a=e+s*l:"end"==this.follow&&(e=a-s*l)),[e,a]}update(t,i,n,e){if(this.have_updated_interactively)return;const a=this.computed_renderers();let s=this._compute_plot_bounds(a,t);null!=e&&(s=this.adjust_bounds_for_aspect(s,e)),this._plot_bounds.set(n,s);const[l,_]=this._compute_min_max(this._plot_bounds.entries(),i);let[o,r]=this._compute_range(l,_);null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(o=this._initial_start):o=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(r=this._initial_end):r=this._initial_end);let d=!1;"auto"==this.bounds&&(this.setv({bounds:[o,r]},{silent:!0}),d=!0);const[h,u]=[this.start,this.end];if(o!=h||r!=u){const t={};o!=h&&(t.start=o),r!=u&&(t.end=r),this.setv(t),d=!1}d&&this.change.emit()}reset(){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()}}n.DataRange1d=g,s=g,g.__name__="DataRange1d",s.define((({Boolean:t,Number:i,Nullable:n})=>({start:[i,NaN],end:[i,NaN],range_padding:[i,.1],range_padding_units:[o.PaddingUnits,"percent"],flipped:[t,!1],follow:[n(o.StartEnd),null],follow_interval:[n(i),null],default_span:[i,2],only_visible:[t,!1]}))),s.internal((({Enum:t})=>({scale_hint:[t("log","auto"),"auto"]})))}, +function _(t,i,n,e,a){var s;e();const l=t(1),_=t(94),o=t(19),r=t(33),d=t(18),h=l.__importStar(t(57)),u=t(95);n.auto_ranged=Symbol("auto_ranged"),n.is_auto_ranged=function(t){return n.auto_ranged in t};class g extends _.DataRange{constructor(t){super(t),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=isNaN(this.start)?null:this.start,this._initial_end=isNaN(this.end)?null: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,this._plot_bounds=new Map}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:t}=this,i=(0,r.flat_map)(this.plots,(t=>t.auto_ranged_renderers.map((t=>t.model))));return(0,u.compute_renderers)(0==t.length?"auto":t,[...i])}_compute_plot_bounds(t,i){let n=h.empty();for(const e of t){const t=i.get(e);null==t||!e.visible&&this.only_visible||(n=h.union(n,t))}return n}adjust_bounds_for_aspect(t,i){const n=h.empty();let e=t.x1-t.x0;e<=0&&(e=1);let a=t.y1-t.y0;a<=0&&(a=1);const s=.5*(t.x1+t.x0),l=.5*(t.y1+t.y0);return el&&("start"==this.follow?a=e+s*l:"end"==this.follow&&(e=a-s*l)),[e,a]}update(t,i,n,e){if(this.have_updated_interactively)return;const a=this.computed_renderers();let s=this._compute_plot_bounds(a,t);null!=e&&(s=this.adjust_bounds_for_aspect(s,e)),this._plot_bounds.set(n,s);const[l,_]=this._compute_min_max(this._plot_bounds.entries(),i);let[o,r]=this._compute_range(l,_);null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(o=this._initial_start):o=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(r=this._initial_end):r=this._initial_end);let d=!1;"auto"==this.bounds&&(this.setv({bounds:[o,r]},{silent:!0}),d=!0);const[h,u]=[this.start,this.end];if(o!=h||r!=u){const t={};o!=h&&(t.start=o),r!=u&&(t.end=r),this.setv(t),d=!1}d&&this.change.emit()}reset(){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()}}n.DataRange1d=g,s=g,g.__name__="DataRange1d",s.define((({Boolean:t,Number:i,Nullable:n})=>({start:[i,NaN],end:[i,NaN],range_padding:[i,.1],range_padding_units:[o.PaddingUnits,"percent"],flipped:[t,!1],follow:[n(o.StartEnd),null],follow_interval:[n(i),null],default_span:[i,2],only_visible:[t,!1]}))),s.internal((({Enum:t})=>({scale_hint:[t("log","auto"),"auto"]})))}, function _(e,n,a,r,t){var s;r();const c=e(87);class o extends c.Range{constructor(e){super(e)}}a.DataRange=o,s=o,o.__name__="DataRange",s.define((({Array:e,AnyRef:n,Or:a,Auto:r})=>({renderers:[a(e(n()),r),[]]})))}, function _(n,u,e,r,t){r(),e.compute_renderers=function(n,u){return"auto"==n?u:null!=n?n:[]}}, function _(t,n,e,i,s){var r;i();const a=t(1),o=t(87),g=t(19),p=a.__importStar(t(17)),c=t(20),l=t(23),u=t(10),h=t(8),d=t(12);function _(t,n,e=0){const i=new Map;for(let s=0;sa.get(t).value)));r.set(t,{value:c/s,mapping:a}),o+=s+n+p}return[r,(a.size-1)*n+g]}function m(t,n,e,i,s=0){var r;const a=new Map,o=new Map;for(const[n,e,i]of t){const t=null!==(r=o.get(n))&&void 0!==r?r:[];o.set(n,[...t,[e,i]])}let g=s,p=0;for(const[t,s]of o){const r=s.length,[o,c]=f(s,e,i,g);p+=c;const l=(0,u.sum)(s.map((([t])=>o.get(t).value)));a.set(t,{value:l/r,mapping:o}),g+=r+n+c}return[a,(o.size-1)*n+p]}e.Factor=(0,c.Or)(c.String,(0,c.Tuple)(c.String,c.String),(0,c.Tuple)(c.String,c.String,c.String)),e.FactorSeq=(0,c.Or)((0,c.Array)(c.String),(0,c.Array)((0,c.Tuple)(c.String,c.String)),(0,c.Array)((0,c.Tuple)(c.String,c.String,c.String))),e.map_one_level=_,e.map_two_levels=f,e.map_three_levels=m;class v extends o.Range{constructor(t){super(t)}get min(){return this.start}get max(){return this.end}initialize(){super.initialize(),this._init(!0)}connect_signals(){super.connect_signals(),this.connect(this.properties.factors.change,(()=>this.reset())),this.connect(this.properties.factor_padding.change,(()=>this.reset())),this.connect(this.properties.group_padding.change,(()=>this.reset())),this.connect(this.properties.subgroup_padding.change,(()=>this.reset())),this.connect(this.properties.range_padding.change,(()=>this.reset())),this.connect(this.properties.range_padding_units.change,(()=>this.reset()))}reset(){this._init(!1),this.change.emit()}_lookup(t){switch(t.length){case 1:{const[n]=t,e=this._mapping.get(n);return null!=e?e.value:NaN}case 2:{const[n,e]=t,i=this._mapping.get(n);if(null!=i){const t=i.mapping.get(e);if(null!=t)return t.value}return NaN}case 3:{const[n,e,i]=t,s=this._mapping.get(n);if(null!=s){const t=s.mapping.get(e);if(null!=t){const n=t.mapping.get(i);if(null!=n)return n.value}}return NaN}default:(0,d.unreachable)()}}synthetic(t){if((0,h.isNumber)(t))return t;if((0,h.isString)(t))return this._lookup([t]);let n=0;const e=t[t.length-1];return(0,h.isNumber)(e)&&(n=e,t=t.slice(0,-1)),this._lookup(t)+n}v_synthetic(t){const n=t.length,e=new l.ScreenArray(n);for(let i=0;i{if((0,u.every)(this.factors,h.isString)){const t=this.factors,[n,e]=_(t,this.factor_padding);return{levels:1,mapping:n,tops:null,mids:null,inside_padding:e}}if((0,u.every)(this.factors,(t=>(0,h.isArray)(t)&&2==t.length&&(0,h.isString)(t[0])&&(0,h.isString)(t[1])))){const t=this.factors,[n,e]=f(t,this.group_padding,this.factor_padding),i=[...n.keys()];return{levels:2,mapping:n,tops:i,mids:null,inside_padding:e}}if((0,u.every)(this.factors,(t=>(0,h.isArray)(t)&&3==t.length&&(0,h.isString)(t[0])&&(0,h.isString)(t[1])&&(0,h.isString)(t[2])))){const t=this.factors,[n,e]=m(t,this.group_padding,this.subgroup_padding,this.factor_padding),i=[...n.keys()],s=[];for(const[t,e]of n)for(const n of e.mapping.keys())s.push([t,n]);return{levels:3,mapping:n,tops:i,mids:s,inside_padding:e}}(0,d.unreachable)()})();this._mapping=e,this.tops=i,this.mids=s;let a=0,o=this.factors.length+r;if("percent"==this.range_padding_units){const t=(o-a)*this.range_padding/2;a-=t,o+=t}else a-=this.range_padding,o+=this.range_padding;this.setv({start:a,end:o,levels:n},{silent:t}),"auto"==this.bounds&&this.setv({bounds:[a,o]},{silent:!0})}}e.FactorRange=v,r=v,v.__name__="FactorRange",r.define((({Number:t})=>({factors:[e.FactorSeq,[]],factor_padding:[t,0],subgroup_padding:[t,.8],group_padding:[t,1.4],range_padding:[t,0],range_padding_units:[g.PaddingUnits,"percent"],start:[t,p.unset,{readonly:!0}],end:[t,p.unset,{readonly:!0}]}))),r.internal((({Number:t,String:n,Array:e,Tuple:i,Nullable:s})=>({levels:[t],mids:[s(e(i(n,n))),null],tops:[s(e(n)),null]})))}, @@ -1090,7 +1090,7 @@

Plots# function _(i,t,h,e,s){e();const n=i(145),g=i(57),r=i(8),_=i(12),{abs:l,min:o,max:d,round:a}=Math;class u{constructor(){this.absolute=!1,this.position={left:0,top:0},this._bbox=new g.BBox,this._inner_bbox=new g.BBox,this._sizing=null,this._dirty=!1,this._handlers=[]}*[Symbol.iterator](){}get bbox(){return this._bbox}get inner_bbox(){return this._inner_bbox}get sizing(){return(0,_.assert)(null!=this._sizing),this._sizing}set dirty(i){this._dirty=i}get dirty(){return this._dirty}get visible(){return this.sizing.visible}set visible(i){this.sizing.visible!=i&&(this.sizing.visible=i,this._dirty=!0)}set_sizing(i={}){var t,h,e,s,n,g;const r=null!==(t=i.width_policy)&&void 0!==t?t:"fit",_=i.width,l=i.min_width,o=i.max_width,d=null!==(h=i.height_policy)&&void 0!==h?h:"fit",a=i.height,u=i.min_height,c=i.max_height,w=i.aspect,b=null!==(e=i.margin)&&void 0!==e?e:{top:0,right:0,bottom:0,left:0},x=null===(s=i.visible)||void 0===s||s,m=null!==(n=i.halign)&&void 0!==n?n:"start",z=null!==(g=i.valign)&&void 0!==g?g:"start";this._sizing={width_policy:r,min_width:l,width:_,max_width:o,height_policy:d,min_height:u,height:a,max_height:c,aspect:w,margin:b,visible:x,halign:m,valign:z,size:{width:_,height:a}},this._init()}_init(){}_set_geometry(i,t){this._bbox=i,this._inner_bbox=t}set_geometry(i,t){const{fixup_geometry:h}=this;null!=h&&([i,t]=h(i,t)),this._set_geometry(i,null!=t?t:i);for(const i of this._handlers)i(this._bbox,this._inner_bbox)}on_resize(i){this._handlers.push(i)}is_width_expanding(){return"max"==this.sizing.width_policy}is_height_expanding(){return"max"==this.sizing.height_policy}apply_aspect(i,{width:t,height:h}){const{aspect:e}=this.sizing;if(null!=e){const{width_policy:s,height_policy:n}=this.sizing,g=(i,t)=>{const h={max:4,fit:3,min:2,fixed:1};return h[i]>h[t]};if("fixed"!=s&&"fixed"!=n)if(s==n){const s=t,n=a(t/e),g=a(h*e),r=h;l(i.width-s)+l(i.height-n)<=l(i.width-g)+l(i.height-r)?(t=s,h=n):(t=g,h=r)}else g(s,n)?h=a(t/e):t=a(h*e);else"fixed"==s?h=a(t/e):"fixed"==n&&(t=a(h*e))}return{width:t,height:h}}measure(i){if(null==this._sizing&&this.set_sizing(),!this.sizing.visible)return{width:0,height:0};const t=i=>"fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:i,h=i=>"fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:i,e=new n.Sizeable(i).shrink_by(this.sizing.margin).map(t,h),s=this._measure(e),g=this.clip_size(s,e),r=t(g.width),_=h(g.height),l=this.apply_aspect(e,{width:r,height:_});return Object.assign(Object.assign({},s),l)}compute(i={}){const t=this.measure({width:null!=i.width&&this.is_width_expanding()?i.width:1/0,height:null!=i.height&&this.is_height_expanding()?i.height:1/0}),{width:h,height:e}=t,{left:s,top:n}=this.position,r=new g.BBox({left:s,top:n,width:h,height:e});let _;if(null!=t.inner){const{left:i,top:s,right:n,bottom:r}=t.inner;_=new g.BBox({left:i,top:s,right:h-n,bottom:e-r})}this.set_geometry(r,_)}get xview(){return this.bbox.xview}get yview(){return this.bbox.yview}clip_size(i,t){function h(i,t,h,e){return null==h?h=0:(0,r.isNumber)(h)||(h=a(h.percent*t)),null==e?e=1/0:(0,r.isNumber)(e)||(e=a(e.percent*t)),d(h,o(i,e))}return{width:h(i.width,t.width,this.sizing.min_width,this.sizing.max_width),height:h(i.height,t.height,this.sizing.min_height,this.sizing.max_height)}}has_size_changed(){const{_dirty:i}=this;return this._dirty=!1,i}}h.Layoutable=u,u.__name__="Layoutable";class c extends u{_measure(i){const t=this._content_size(),h=i.bounded_to(this.sizing.size).bounded_to(t);return{width:(()=>{switch(this.sizing.width_policy){case"fixed":return null!=this.sizing.width?this.sizing.width:t.width;case"min":return t.width;case"fit":return h.width;case"max":return d(t.width,h.width)}})(),height:(()=>{switch(this.sizing.height_policy){case"fixed":return null!=this.sizing.height?this.sizing.height:t.height;case"min":return t.height;case"fit":return h.height;case"max":return d(t.height,h.height)}})()}}}h.ContentLayoutable=c,c.__name__="ContentLayoutable"}, function _(e,s,t,n,a){var _;n();const x=e(50),c=e(54);class i extends c.View{}t.BaseTextView=i,i.__name__="BaseTextView";class o extends x.Model{constructor(e){super(e)}}t.BaseText=o,_=o,o.__name__="BaseText",_.define((({String:e})=>({text:[e]})))}, function _(n,e,t,i,r){i();const s=n(149),l=n(156),d=[{start:"$$",end:"$$",inline:!1},{start:"\\[",end:"\\]",inline:!1},{start:"\\(",end:"\\)",inline:!0}];t.parse_delimited_string=function(n){for(const e of d){const t=n.indexOf(e.start),i=t+e.start.length;if(0==t){const t=n.indexOf(e.end,i),r=t;if(t==n.length-e.end.length)return new s.TeX({text:n.slice(i,r),inline:e.inline});break}}return new l.PlainText({text:n})}}, -function _(t,e,i,s,n){var h,o,r;s();const a=t(8),l=t(150),_=t(21),c=t(151),d=t(152),u=t(38),g=t(153),x=t(57),p=t(147),f=t(154);class m extends p.BaseTextView{constructor(){super(...arguments),this._position={sx:0,sy:0},this.align="left",this._x_anchor="left",this._y_anchor="center",this._base_font_size=13,this.font_size_scale=1,this.svg_image=null}graphics(){return this}infer_text_height(){return"ascent_descent"}set base_font_size(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}_rect(){const{width:t,height:e}=this._size(),{x:i,y:s}=this._computed_position();return new x.BBox({x:i,y:s,width:t,height:e}).rect}set position(t){this._position=t}get position(){return this._position}get text(){return this.model.text}get provider(){return f.default_provider}async lazy_initialize(){await super.lazy_initialize(),"not_started"==this.provider.status&&await this.provider.fetch()}connect_signals(){super.connect_signals(),this.on_change(this.model.properties.text,(()=>this.load_image()))}set visuals(t){const e=t.color,i=t.alpha,s=t.font_style;let n=t.font_size;const h=t.font,{font_size_scale:o,_base_font_size:r}=this,a=(0,d.parse_css_font_size)(n);if(null!=a){let{value:t,unit:e}=a;t*=o,"em"==e&&0!=r&&(t*=r,e="px"),n=`${t}${e}`}const l=`${s} ${n} ${h}`;this.font=l,this.color=(0,_.color2css)(e,i);const c=t.align;this._x_anchor=c;const u=t.baseline;this._y_anchor=(()=>{switch(u){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}_computed_position(){const{width:t,height:e}=this._size(),{sx:i,sy:s,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position,o=(0,d.font_metrics)(this.font);return{x:i-(()=>{if((0,a.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:s-(()=>{if((0,a.isNumber)(h))return h*e;switch(h){case"top":return o.height>e?e-(-this.valign-o.descent)-o.height:0;case"center":case"baseline":return.5*e;case"bottom":return o.height>e?e+o.descent+this.valign:e}})()}}size(){const{width:t,height:e}=this._size(),{angle:i}=this;if(null==i||0==i)return{width:t,height:e};{const s=Math.cos(Math.abs(i)),n=Math.sin(Math.abs(i));return{width:Math.abs(t*s+e*n),height:Math.abs(t*n+e*s)}}}get_image_dimensions(){var t;const e=(0,d.font_metrics)(this.font),i=null===(t=this.svg_element.getAttribute("style"))||void 0===t?void 0:t.split(";");if(null!=i){const t=new Map;i.forEach((e=>{const[i,s]=e.split(":");""!=i.trim()&&t.set(i.trim(),s.trim())}));const s=(0,d.parse_css_length)(t.get("vertical-align"));"ex"==(null==s?void 0:s.unit)?this.valign=s.value*e.x_height:"px"==(null==s?void 0:s.unit)&&(this.valign=s.value)}const s=(()=>{const t=this.svg_element.getAttribute("width"),e=this.svg_element.getAttribute("height");return{width:null!=t&&t.endsWith("ex")?parseFloat(t):1,height:null!=e&&e.endsWith("ex")?parseFloat(e):1}})();return{width:e.x_height*s.width,height:e.x_height*s.height}}get truncated_text(){return this.model.text.length>6?`${this.model.text.substring(0,6)}...`:this.model.text}_size(){var t,e;if(null==this.svg_image)return"failed"==this.provider.status||"not_started"==this.provider.status?{width:(0,c.text_width)(this.truncated_text,this.font),height:(0,d.font_metrics)(this.font).height}:{width:this._base_font_size,height:this._base_font_size};const i=(0,d.font_metrics)(this.font);let{width:s,height:n}=this.get_image_dimensions();n=Math.max(n,i.height);return{width:s*("%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1),height:n*("%"==(null===(e=this.height)||void 0===e?void 0:e.unit)?this.height.value:1)}}bbox(){const{p0:t,p1:e,p2:i,p3:s}=this.rect(),n=Math.min(t.x,e.x,i.x,s.x),h=Math.min(t.y,e.y,i.y,s.y),o=Math.max(t.x,e.x,i.x,s.x),r=Math.max(t.y,e.y,i.y,s.y);return new x.BBox({left:n,right:o,top:h,bottom:r})}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:i,sy:s}=this.position,n=new g.AffineTransform;return n.translate(i,s),n.rotate(e),n.translate(-i,-s),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:i,p2:s,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:i,width:s,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(i)),t.lineTo(h(e),h(i+n)),t.lineTo(h(e+s),h(i+n)),t.lineTo(h(e+s),h(i)),t.closePath(),t.stroke(),t.restore()}async load_image(){if(null==this.provider.MathJax)return null;const t=this._process_text();if(null==t)return this._has_finished=!0,null;const e=t.children[0];this.svg_element=e,e.setAttribute("font",this.font),e.setAttribute("stroke",this.color);const i=e.outerHTML,s=`data:image/svg+xml;utf-8,${encodeURIComponent(i)}`;return this.svg_image=await(0,l.load_image)(s),this.parent.request_layout(),this.svg_image}paint(t){null==this.svg_image&&("not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((()=>this.load_image())),"loaded"==this.provider.status&&this.load_image()),t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();if(null!=this.svg_image){const{width:e,height:i}=this.get_image_dimensions();t.drawImage(this.svg_image,n,h,e,i)}else"failed"!=this.provider.status&&"not_started"!=this.provider.status||(t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.truncated_text,n,h+(0,d.font_metrics)(this.font).ascent));t.restore(),this._has_finished||"failed"!=this.provider.status&&null==this.svg_image||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}i.MathTextView=m,m.__name__="MathTextView";class v extends p.BaseText{constructor(t){super(t)}}i.MathText=v,v.__name__="MathText";class y extends m{get styled_text(){return this.text}_process_text(){}_size(){return{width:(0,c.text_width)(this.text,this.font),height:(0,d.font_metrics)(this.font).height}}paint(t){t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.text,n,h+(0,d.font_metrics)(this.font).ascent),t.restore(),this._has_finished=!0,this.parent.notify_finished_after_paint()}}i.AsciiView=y,y.__name__="AsciiView";class b extends v{constructor(t){super(t)}}i.Ascii=b,h=b,b.__name__="Ascii",h.prototype.default_view=y;class w extends m{get styled_text(){let t=this.text.trim(),e=t.match(//s);return null==e?this.text.trim():(t=(0,u.insert_text_on_position)(t,t.indexOf(e[0])+e[0].length,``),e=t.match(/<\/[^>]*?math.*?>/s),null==e?this.text.trim():(0,u.insert_text_on_position)(t,t.indexOf(e[0]),""))}_process_text(){var t;const e=(0,d.font_metrics)(this.font);return null===(t=this.provider.MathJax)||void 0===t?void 0:t.mathml2svg(this.styled_text,{em:this.base_font_size,ex:e.x_height})}}i.MathMLView=w,w.__name__="MathMLView";class M extends v{constructor(t){super(t)}}i.MathML=M,o=M,M.__name__="MathML",o.prototype.default_view=w;class z extends m{get styled_text(){const[t,e,i]=(0,_.color2rgba)(this.color);return`\\color[RGB]{${t}, ${e}, ${i}} ${this.font.includes("bold")?`\\pmb{${this.text}}`:this.text}`}_process_text(){var t;const e=(0,d.font_metrics)(this.font);return null===(t=this.provider.MathJax)||void 0===t?void 0:t.tex2svg(this.styled_text,{display:!this.model.inline,em:this.base_font_size,ex:e.x_height},this.model.macros)}}i.TeXView=z,z.__name__="TeXView";class T extends v{constructor(t){super(t)}}i.TeX=T,r=T,T.__name__="TeX",r.prototype.default_view=z,r.define((({Boolean:t,Number:e,String:i,Dict:s,Tuple:n,Or:h})=>({macros:[s(h(i,n(i,e))),{}],inline:[t,!1]})))}, +function _(t,e,i,s,n){var h,o,r;s();const a=t(8),l=t(150),_=t(21),c=t(151),d=t(152),u=t(39),g=t(153),x=t(57),p=t(147),f=t(154);class m extends p.BaseTextView{constructor(){super(...arguments),this._position={sx:0,sy:0},this.align="left",this._x_anchor="left",this._y_anchor="center",this._base_font_size=13,this.font_size_scale=1,this.svg_image=null}graphics(){return this}infer_text_height(){return"ascent_descent"}set base_font_size(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}_rect(){const{width:t,height:e}=this._size(),{x:i,y:s}=this._computed_position();return new x.BBox({x:i,y:s,width:t,height:e}).rect}set position(t){this._position=t}get position(){return this._position}get text(){return this.model.text}get provider(){return f.default_provider}async lazy_initialize(){await super.lazy_initialize(),"not_started"==this.provider.status&&await this.provider.fetch()}connect_signals(){super.connect_signals(),this.on_change(this.model.properties.text,(()=>this.load_image()))}set visuals(t){const e=t.color,i=t.alpha,s=t.font_style;let n=t.font_size;const h=t.font,{font_size_scale:o,_base_font_size:r}=this,a=(0,d.parse_css_font_size)(n);if(null!=a){let{value:t,unit:e}=a;t*=o,"em"==e&&0!=r&&(t*=r,e="px"),n=`${t}${e}`}const l=`${s} ${n} ${h}`;this.font=l,this.color=(0,_.color2css)(e,i);const c=t.align;this._x_anchor=c;const u=t.baseline;this._y_anchor=(()=>{switch(u){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}_computed_position(){const{width:t,height:e}=this._size(),{sx:i,sy:s,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position,o=(0,d.font_metrics)(this.font);return{x:i-(()=>{if((0,a.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:s-(()=>{if((0,a.isNumber)(h))return h*e;switch(h){case"top":return o.height>e?e-(-this.valign-o.descent)-o.height:0;case"center":case"baseline":return.5*e;case"bottom":return o.height>e?e+o.descent+this.valign:e}})()}}size(){const{width:t,height:e}=this._size(),{angle:i}=this;if(null==i||0==i)return{width:t,height:e};{const s=Math.cos(Math.abs(i)),n=Math.sin(Math.abs(i));return{width:Math.abs(t*s+e*n),height:Math.abs(t*n+e*s)}}}get_image_dimensions(){var t;const e=(0,d.font_metrics)(this.font),i=null===(t=this.svg_element.getAttribute("style"))||void 0===t?void 0:t.split(";");if(null!=i){const t=new Map;i.forEach((e=>{const[i,s]=e.split(":");""!=i.trim()&&t.set(i.trim(),s.trim())}));const s=(0,d.parse_css_length)(t.get("vertical-align"));"ex"==(null==s?void 0:s.unit)?this.valign=s.value*e.x_height:"px"==(null==s?void 0:s.unit)&&(this.valign=s.value)}const s=(()=>{const t=this.svg_element.getAttribute("width"),e=this.svg_element.getAttribute("height");return{width:null!=t&&t.endsWith("ex")?parseFloat(t):1,height:null!=e&&e.endsWith("ex")?parseFloat(e):1}})();return{width:e.x_height*s.width,height:e.x_height*s.height}}get truncated_text(){return this.model.text.length>6?`${this.model.text.substring(0,6)}...`:this.model.text}_size(){var t,e;if(null==this.svg_image)return"failed"==this.provider.status||"not_started"==this.provider.status?{width:(0,c.text_width)(this.truncated_text,this.font),height:(0,d.font_metrics)(this.font).height}:{width:this._base_font_size,height:this._base_font_size};const i=(0,d.font_metrics)(this.font);let{width:s,height:n}=this.get_image_dimensions();n=Math.max(n,i.height);return{width:s*("%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1),height:n*("%"==(null===(e=this.height)||void 0===e?void 0:e.unit)?this.height.value:1)}}bbox(){const{p0:t,p1:e,p2:i,p3:s}=this.rect(),n=Math.min(t.x,e.x,i.x,s.x),h=Math.min(t.y,e.y,i.y,s.y),o=Math.max(t.x,e.x,i.x,s.x),r=Math.max(t.y,e.y,i.y,s.y);return new x.BBox({left:n,right:o,top:h,bottom:r})}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:i,sy:s}=this.position,n=new g.AffineTransform;return n.translate(i,s),n.rotate(e),n.translate(-i,-s),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:i,p2:s,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:i,width:s,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(i)),t.lineTo(h(e),h(i+n)),t.lineTo(h(e+s),h(i+n)),t.lineTo(h(e+s),h(i)),t.closePath(),t.stroke(),t.restore()}async load_image(){if(null==this.provider.MathJax)return null;const t=this._process_text();if(null==t)return this._has_finished=!0,null;const e=t.children[0];this.svg_element=e,e.setAttribute("font",this.font),e.setAttribute("stroke",this.color);const i=e.outerHTML,s=`data:image/svg+xml;utf-8,${encodeURIComponent(i)}`;return this.svg_image=await(0,l.load_image)(s),this.parent.request_layout(),this.svg_image}paint(t){null==this.svg_image&&("not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((()=>this.load_image())),"loaded"==this.provider.status&&this.load_image()),t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();if(null!=this.svg_image){const{width:e,height:i}=this.get_image_dimensions();t.drawImage(this.svg_image,n,h,e,i)}else"failed"!=this.provider.status&&"not_started"!=this.provider.status||(t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.truncated_text,n,h+(0,d.font_metrics)(this.font).ascent));t.restore(),this._has_finished||"failed"!=this.provider.status&&null==this.svg_image||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}i.MathTextView=m,m.__name__="MathTextView";class v extends p.BaseText{constructor(t){super(t)}}i.MathText=v,v.__name__="MathText";class y extends m{get styled_text(){return this.text}_process_text(){}_size(){return{width:(0,c.text_width)(this.text,this.font),height:(0,d.font_metrics)(this.font).height}}paint(t){t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.text,n,h+(0,d.font_metrics)(this.font).ascent),t.restore(),this._has_finished=!0,this.parent.notify_finished_after_paint()}}i.AsciiView=y,y.__name__="AsciiView";class b extends v{constructor(t){super(t)}}i.Ascii=b,h=b,b.__name__="Ascii",h.prototype.default_view=y;class w extends m{get styled_text(){let t=this.text.trim(),e=t.match(//s);return null==e?this.text.trim():(t=(0,u.insert_text_on_position)(t,t.indexOf(e[0])+e[0].length,``),e=t.match(/<\/[^>]*?math.*?>/s),null==e?this.text.trim():(0,u.insert_text_on_position)(t,t.indexOf(e[0]),""))}_process_text(){var t;const e=(0,d.font_metrics)(this.font);return null===(t=this.provider.MathJax)||void 0===t?void 0:t.mathml2svg(this.styled_text,{em:this.base_font_size,ex:e.x_height})}}i.MathMLView=w,w.__name__="MathMLView";class M extends v{constructor(t){super(t)}}i.MathML=M,o=M,M.__name__="MathML",o.prototype.default_view=w;class z extends m{get styled_text(){const[t,e,i]=(0,_.color2rgba)(this.color);return`\\color[RGB]{${t}, ${e}, ${i}} ${this.font.includes("bold")?`\\pmb{${this.text}}`:this.text}`}_process_text(){var t;const e=(0,d.font_metrics)(this.font);return null===(t=this.provider.MathJax)||void 0===t?void 0:t.tex2svg(this.styled_text,{display:!this.model.inline,em:this.base_font_size,ex:e.x_height},this.model.macros)}}i.TeXView=z,z.__name__="TeXView";class T extends v{constructor(t){super(t)}}i.TeX=T,r=T,T.__name__="TeX",r.prototype.default_view=z,r.define((({Boolean:t,Number:e,String:i,Dict:s,Tuple:n,Or:h})=>({macros:[s(h(i,n(i,e))),{}],inline:[t,!1]})))}, function _(i,e,t,s,a){s();const o=i(18);t.load_image=async function(i,e){return new n(i,e).promise};class n{constructor(i,e={}){this.image=new Image,this._finished=!1;const{attempts:t=1,timeout:s=1}=e;this.promise=new Promise(((a,n)=>{this.image.crossOrigin="anonymous";let r=0;this.image.onerror=()=>{if(++r==t){const s=`unable to load ${i} image after ${t} attempts`;if(o.logger.warn(s),null==this.image.crossOrigin)return void(null!=e.failed&&e.failed());o.logger.warn(`attempting to load ${i} without a cross origin policy`),this.image.crossOrigin=null,r=0}setTimeout((()=>this.image.src=i),s)},this.image.onload=()=>{this._finished=!0,null!=e.loaded&&e.loaded(this.image),a(this.image)},this.image.src=i}))}get finished(){return this._finished}}t.ImageLoader=n,n.__name__="ImageLoader"}, function _(t,e,s,i,n){i();const h=t(57),o=t(152),a=t(10),r=t(8),c=t(153),_=t(21);s.text_width=(()=>{const t=document.createElement("canvas").getContext("2d");let e="";return(s,i)=>(i!=e&&(e=i,t.font=i),t.measureText(s).width)})();class l{constructor(){this._position={sx:0,sy:0},this.font_size_scale=1,this.align="left",this._base_font_size=13,this._x_anchor="left",this._y_anchor="center"}set base_font_size(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}set position(t){this._position=t}get position(){return this._position}infer_text_height(){return"ascent_descent"}bbox(){const{p0:t,p1:e,p2:s,p3:i}=this.rect(),n=Math.min(t.x,e.x,s.x,i.x),o=Math.min(t.y,e.y,s.y,i.y),a=Math.max(t.x,e.x,s.x,i.x),r=Math.max(t.y,e.y,s.y,i.y);return new h.BBox({left:n,right:a,top:o,bottom:r})}size(){const{width:t,height:e}=this._size(),{angle:s}=this;if(null==s||0==s)return{width:t,height:e};{const i=Math.cos(Math.abs(s)),n=Math.sin(Math.abs(s));return{width:Math.abs(t*i+e*n),height:Math.abs(t*n+e*i)}}}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:s,sy:i}=this.position,n=new c.AffineTransform;return n.translate(s,i),n.rotate(e),n.translate(-s,-i),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:s,p2:i,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:s,width:i,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(s)),t.lineTo(h(e),h(s+n)),t.lineTo(h(e+i),h(s+n)),t.lineTo(h(e+i),h(s)),t.closePath(),t.stroke(),t.restore()}}s.GraphicsBox=l,l.__name__="GraphicsBox";class u extends l{set visuals(t){const e=t.color,s=t.alpha,i=t.outline_color,n=t.font_style;let h=t.font_size;const a=t.font,{font_size_scale:r,base_font_size:c}=this,l=(0,o.parse_css_font_size)(h);if(null!=l){let{value:t,unit:e}=l;t*=r,"em"==e&&0!=c&&(t*=c,e="px"),h=`${t}${e}`}const u=`${n} ${h} ${a}`;this.font=u,this.color=(0,_.color2css)(e,s),this.outline_color=(0,_.color2css)(i,s),this.line_height=t.line_height;const x=t.align;this._visual_align=x,this._x_anchor=x;const p=t.baseline;this._y_anchor=(()=>{switch(p){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}constructor({text:t}){super(),this._visual_align="left",this.text=t}infer_text_height(){if(this.text.includes("\n"))return"ascent_descent";{function t(t){for(const e of new Set(t))if(!("0"<=e&&e<="9"))switch(e){case",":case".":case"+":case"-":case"\u2212":case"e":continue;default:return!1}return!0}return t(this.text)?"cap":"ascent_descent"}}_text_line(t){var e;const s=null!==(e=this.text_height_metric)&&void 0!==e?e:this.infer_text_height(),i=(()=>{switch(s){case"x":case"x_descent":return t.x_height;case"cap":case"cap_descent":return t.cap_height;case"ascent":case"ascent_descent":return t.ascent}})(),n=(()=>{switch(s){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return t.descent}})();return{height:i+n,ascent:i,descent:n}}get nlines(){return this.text.split("\n").length}_size(){var t,e;const{font:i}=this,n=(0,o.font_metrics)(i),h=(this.line_height-1)*n.height,r=""==this.text,c=this.text.split("\n"),_=c.length,l=c.map((t=>(0,s.text_width)(t,i))),u=this._text_line(n).height*_,x="%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1,p="%"==(null===(e=this.height)||void 0===e?void 0:e.unit)?this.height.value:1;return{width:(0,a.max)(l)*x,height:r?0:(u+h*(_-1))*p,metrics:n}}_computed_position(t,e,s){const{width:i,height:n}=t,{sx:h,sy:o,x_anchor:a=this._x_anchor,y_anchor:c=this._y_anchor}=this.position;return{x:h-(()=>{if((0,r.isNumber)(a))return a*i;switch(a){case"left":return 0;case"center":return.5*i;case"right":return i}})(),y:o-(()=>{var t;if((0,r.isNumber)(c))return c*n;switch(c){case"top":return 0;case"center":return.5*n;case"bottom":return n;case"baseline":if(1!=s)return.5*n;switch(null!==(t=this.text_height_metric)&&void 0!==t?t:this.infer_text_height()){case"x":case"x_descent":return e.x_height;case"cap":case"cap_descent":return e.cap_height;case"ascent":case"ascent_descent":return e.ascent}}})()}}_rect(){const{width:t,height:e,metrics:s}=this._size(),i=this.text.split("\n").length,{x:n,y:o}=this._computed_position({width:t,height:e},s,i);return new h.BBox({x:n,y:o,width:t,height:e}).rect}paint(t){var e,i;const{font:n}=this,h=(0,o.font_metrics)(n),r=(this.line_height-1)*h.height,c=this.text.split("\n"),_=c.length,l=c.map((t=>(0,s.text_width)(t,n))),u=this._text_line(h),x=u.height*_,p="%"==(null===(e=this.width)||void 0===e?void 0:e.unit)?this.width.value:1,f="%"==(null===(i=this.height)||void 0===i?void 0:i.unit)?this.height.value:1,g=(0,a.max)(l)*p,d=(x+r*(_-1))*f;t.save(),t.fillStyle=this.color,t.strokeStyle=this.outline_color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic";const{sx:b,sy:m}=this.position,{align:y}=this,{angle:w}=this;null!=w&&0!=w&&(t.translate(b,m),t.rotate(w),t.translate(-b,-m));let{x:v,y:z}=this._computed_position({width:g,height:d},h,_);if("justify"==y)for(let e=0;e<_;e++){let i=v;const h=c[e].split(" "),o=h.length,_=h.map((t=>(0,s.text_width)(t,n))),l=(g-(0,a.sum)(_))/(o-1);for(let e=0;e{switch("auto"==y?this._visual_align:y){case"left":return 0;case"center":return.5*(g-l[e]);case"right":return g-l[e]}})(),i=c[e],n=z+u.ascent;t.fillText(i,s,n),t.strokeText(i,s,n),z+=u.height+r}t.restore()}}s.TextBox=u,u.__name__="TextBox";class x extends l{constructor(t,e){super(),this.base=t,this.expo=e}get children(){return[this.base,this.expo]}set base_font_size(t){super.base_font_size=t,this.base.base_font_size=t,this.expo.base_font_size=t}set position(t){this._position=t;const e=this.base.size(),s=this.expo.size(),i=this._shift_scale()*e.height,n=Math.max(e.height,i+s.height);this.base.position={sx:0,x_anchor:"left",sy:n,y_anchor:"bottom"},this.expo.position={sx:e.width,x_anchor:"left",sy:i,y_anchor:"bottom"}}get position(){return this._position}set visuals(t){this.expo.font_size_scale=.7,this.base.visuals=t,this.expo.visuals=t}_shift_scale(){if(this.base instanceof u&&1==this.base.nlines){const{x_height:t,cap_height:e}=(0,o.font_metrics)(this.base.font);return t/e}return 2/3}infer_text_height(){return this.base.infer_text_height()}_rect(){const t=this.base.bbox(),e=this.expo.bbox(),s=t.union(e),{x:i,y:n}=this._computed_position();return s.translate(i,n).rect}_size(){const t=this.base.size(),e=this.expo.size();return{width:t.width+e.width,height:Math.max(t.height,this._shift_scale()*t.height+e.height)}}paint(t){t.save();const{angle:e}=this;if(null!=e&&0!=e){const{sx:s,sy:i}=this.position;t.translate(s,i),t.rotate(e),t.translate(-s,-i)}const{x:s,y:i}=this._computed_position();t.translate(s,i),this.base.paint(t),this.expo.paint(t),t.restore()}paint_bbox(t){super.paint_bbox(t);const{x:e,y:s}=this._computed_position();t.save(),t.translate(e,s);for(const e of this.children)e.paint_bbox(t);t.restore()}_computed_position(){const{width:t,height:e}=this._size(),{sx:s,sy:i,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position;return{x:s-(()=>{if((0,r.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:i-(()=>{if((0,r.isNumber)(h))return h*e;switch(h){case"top":return 0;case"center":case"baseline":return.5*e;case"bottom":return e}})()}}}s.BaseExpo=x,x.__name__="BaseExpo";class p{constructor(t){this.items=t}set base_font_size(t){for(const e of this.items)e.base_font_size=t}get length(){return this.items.length}set visuals(t){for(const e of this.items)e.visuals=t;const e={x:0,cap:1,ascent:2,x_descent:3,cap_descent:4,ascent_descent:5},s=(0,a.max_by)(this.items.map((t=>t.infer_text_height())),(t=>e[t]));for(const t of this.items)t.text_height_metric=s}set angle(t){for(const e of this.items)e.angle=t}max_size(){let t=0,e=0;for(const s of this.items){const i=s.size();t=Math.max(t,i.width),e=Math.max(e,i.height)}return{width:t,height:e}}}s.GraphicsBoxes=p,p.__name__="GraphicsBoxes"}, function _(t,e,n,c,s){c();const a=t(12),o=t(8),r=(()=>{try{return"undefined"!=typeof OffscreenCanvas&&null!=new OffscreenCanvas(0,0).getContext("2d")}catch(t){return!1}})()?(t,e)=>new OffscreenCanvas(t,e):(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},i=(()=>{const t=r(0,0).getContext("2d");return(0,a.assert)(null!=t,"can't obtain 2d context"),e=>{t.font=e;const n=t.measureText("M"),c=t.measureText("x"),s=t.measureText("\xc5\u015ag|"),r=s.fontBoundingBoxAscent,i=s.fontBoundingBoxDescent;if((0,o.is_defined)(r)&&(0,o.is_defined)(i))return{height:r+i,ascent:r,descent:i,cap_height:n.actualBoundingBoxAscent,x_height:c.actualBoundingBoxAscent};const u=s.actualBoundingBoxAscent,l=s.actualBoundingBoxDescent;if((0,o.is_defined)(u)&&(0,o.is_defined)(l))return{height:u+l,ascent:u,descent:l,cap_height:n.actualBoundingBoxAscent,x_height:c.actualBoundingBoxAscent};(0,a.unreachable)()}})(),u=(()=>{const t=document.createElement("canvas"),e=t.getContext("2d");let n=-1,c=-1;return(s,a=1)=>{e.font=s;const{width:o}=e.measureText("M"),r=o*a,i=Math.ceil(r),u=Math.ceil(2*r),l=Math.ceil(1.5*r);n{let e=0;for(let n=0;n<=l;n++)for(let c=0;c{let e=t.length-4;for(let n=u;n>=l;n--)for(let c=0;c{try{return i("normal 10px sans-serif"),i}catch(t){return u}})(),f=new Map;n.font_metrics=function(t){let e=f.get(t);if(null==e){const n=document.fonts.check(t);e={font:l(t)},n&&f.set(t,e)}return e.font},n.parse_css_font_size=function(t){const e=t.match(/^\s*(\d+(\.\d+)?)(\w+)\s*$/);if(null!=e){const[,t,,n]=e,c=Number(t);if(isFinite(c))return{value:c,unit:n}}return null},n.parse_css_length=function(t){const e=t.match(/^\s*(-?\d+(\.\d+)?)(\w+)\s*$/);if(null!=e){const[,t,,n]=e,c=Number(t);if(isFinite(c))return{value:c,unit:n}}return null}}, @@ -1104,13 +1104,13 @@

Plots# function _(e,r,d,n,i){var s;n();const _=e(74);class u extends _.RendererView{}d.GuideRendererView=u,u.__name__="GuideRendererView";class c extends _.Renderer{constructor(e){super(e)}}d.GuideRenderer=c,s=c,c.__name__="GuideRenderer",s.override({level:"guide"})}, function _(c,e,n,s,o){s();const r=c(50);class t extends r.Model{constructor(c){super(c)}}n.Ticker=t,t.__name__="Ticker"}, function _(t,o,r,e,c){e();const n=t(50),a=t(151);class m extends n.Model{constructor(t){super(t)}format_graphics(t,o){return this.doFormat(t,o).map((t=>new a.TextBox({text:t})))}compute(t,o){return this.doFormat([t],null!=o?o:{loc:0})[0]}v_compute(t,o){return this.doFormat(t,null!=o?o:{loc:0})}}r.TickFormatter=m,m.__name__="TickFormatter"}, -function _(e,n,s,t,i){var l,r;t();const c=e(50),o=e(9),a=e(38),u=e(8),d=e(23);class _ extends c.Model{constructor(e){super(e)}}s.LabelingPolicy=_,_.__name__="LabelingPolicy";class f extends _{constructor(e){super(e)}filter(e,n,s){return e}}s.AllLabels=f,f.__name__="AllLabels";class v extends _{constructor(e){super(e)}filter(e,n,s){const{min_distance:t}=this;let i=null;for(const n of e)null!=i&&s(i,n)({min_distance:[e,5]})));class m extends _{constructor(e){super(e)}get names(){return(0,o.keys)(this.args)}get values(){return(0,o.values)(this.args)}get func(){const e=(0,a.use_strict)(this.code);return new d.GeneratorFunction("indices","bboxes","distance",...this.names,e)}filter(e,n,s){var t,i;const l=Object.create(null),r=this.func.call(l,e,n,s,...this.values);let c=r.next();if(null!==(t=c.done)&&void 0!==t&&t&&void 0!==c.value){const{value:n}=c;return n instanceof d.Indices?n:void 0===n?e:(0,u.isIterable)(n)?d.Indices.from_indices(e.size,n):d.Indices.all_unset(e.size)}{const n=[];do{n.push(c.value),c=r.next()}while(null===(i=c.done)||void 0===i||!i);return d.Indices.from_indices(e.size,n)}}}s.CustomLabelingPolicy=m,r=m,m.__name__="CustomLabelingPolicy",r.define((({Unknown:e,String:n,Dict:s})=>({args:[s(e),{}],code:[n,""]})))}, +function _(e,n,s,t,i){var l,r;t();const c=e(50),o=e(9),a=e(39),u=e(8),d=e(23);class _ extends c.Model{constructor(e){super(e)}}s.LabelingPolicy=_,_.__name__="LabelingPolicy";class f extends _{constructor(e){super(e)}filter(e,n,s){return e}}s.AllLabels=f,f.__name__="AllLabels";class v extends _{constructor(e){super(e)}filter(e,n,s){const{min_distance:t}=this;let i=null;for(const n of e)null!=i&&s(i,n)({min_distance:[e,5]})));class m extends _{constructor(e){super(e)}get names(){return(0,o.keys)(this.args)}get values(){return(0,o.values)(this.args)}get func(){const e=(0,a.use_strict)(this.code);return new d.GeneratorFunction("indices","bboxes","distance",...this.names,e)}filter(e,n,s){var t,i;const l=Object.create(null),r=this.func.call(l,e,n,s,...this.values);let c=r.next();if(null!==(t=c.done)&&void 0!==t&&t&&void 0!==c.value){const{value:n}=c;return n instanceof d.Indices?n:void 0===n?e:(0,u.isIterable)(n)?d.Indices.from_indices(e.size,n):d.Indices.all_unset(e.size)}{const n=[];do{n.push(c.value),c=r.next()}while(null===(i=c.done)||void 0===i||!i);return d.Indices.from_indices(e.size,n)}}}s.CustomLabelingPolicy=m,r=m,m.__name__="CustomLabelingPolicy",r.define((({Unknown:e,String:n,Dict:s})=>({args:[s(e),{}],code:[n,""]})))}, function _(t,s,e,o,i){var r;o();const a=t(1),l=t(159),_=t(165),n=t(166),p=a.__importStar(t(78)),c=t(19),h=t(151),m=t(8);class u extends l.AxisView{_paint(t,s,e){this._draw_group_separators(t,s,e)}_draw_group_separators(t,s,e){const[o]=this.ranges,[i,r]=this.computed_bounds;if(null==o.tops||o.tops.length<2||!this.visuals.separator_line.doit)return;const a=this.dimension,l=1-a,_=[[],[]];let n=0;for(let t=0;ti&&pnew h.GraphicsBoxes(t.map((t=>(0,m.isString)(t)?new h.TextBox({text:t}):t))),_=t=>l(this.model.formatter.doFormat(t,this));if(1==t.levels){const t=_(i.major);a.push([t,r.major,this.model.major_label_orientation,this.visuals.major_label_text])}else if(2==t.levels){const t=_(i.major.map((t=>t[1])));a.push([t,r.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([l(i.tops),r.tops,this.model.group_label_orientation,this.visuals.group_text])}else if(3==t.levels){const t=_(i.major.map((t=>t[2]))),s=i.mids.map((t=>t[1]));a.push([t,r.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([l(s),r.mids,this.model.subgroup_label_orientation,this.visuals.subgroup_text]),a.push([l(i.tops),r.tops,this.model.group_label_orientation,this.visuals.group_text])}return a}get tick_coords(){const t=this.dimension,s=1-t,[e]=this.ranges,[o,i]=this.computed_bounds,r=this.model.ticker.get_ticks(o,i,e,this.loc),a={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return a.major[t]=r.major,a.major[s]=r.major.map((()=>this.loc)),3==e.levels&&(a.mids[t]=r.mids,a.mids[s]=r.mids.map((()=>this.loc))),e.levels>1&&(a.tops[t]=r.tops,a.tops[s]=r.tops.map((()=>this.loc))),a}}e.CategoricalAxisView=u,u.__name__="CategoricalAxisView";class d extends l.Axis{constructor(t){super(t)}}e.CategoricalAxis=d,r=d,d.__name__="CategoricalAxis",r.prototype.default_view=u,r.mixins([["separator_",p.Line],["group_",p.Text],["subgroup_",p.Text]]),r.define((({Number:t,Or:s})=>({group_label_orientation:[s(c.LabelOrientation,t),"parallel"],subgroup_label_orientation:[s(c.LabelOrientation,t),"parallel"]}))),r.override({ticker:()=>new _.CategoricalTicker,formatter:()=>new n.CategoricalTickFormatter,separator_line_color:"lightgrey",separator_line_width:2,group_text_font_style:"bold",group_text_font_size:"11px",group_text_color:"grey",subgroup_text_font_style:"bold",subgroup_text_font_size:"11px"})}, function _(t,c,o,s,e){s();const r=t(161);class i extends r.Ticker{constructor(t){super(t)}get_ticks(t,c,o,s){var e,r;return{major:this._collect(o.factors,o,t,c),minor:[],tops:this._collect(null!==(e=o.tops)&&void 0!==e?e:[],o,t,c),mids:this._collect(null!==(r=o.mids)&&void 0!==r?r:[],o,t,c)}}_collect(t,c,o,s){const e=[];for(const r of t){const t=c.synthetic(r);t>o&&tnew m.DatetimeTicker,formatter:()=>new r.DatetimeTickFormatter})}, -function _(t,e,o,n,r){var s;n();const i=t(1),c=t(19),_=t(32),u=t(170),l=t(8),m=t(162),a=t(174),d=i.__importDefault(t(173));o.resolution_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],o.tm_index_for_resolution=new Map;for(const t of o.resolution_order)o.tm_index_for_resolution.set(t,0);function h(t,e){const o=1.1*t*1e3,n=1e3*e;return o=a.ONE_MINUTE?"minsec":"seconds":o=a.ONE_HOUR?"hourmin":"minutes":oparseInt(t,10)))}function x(t,e){const o=(0,u.sprintf)("$1%06d",N(t));return-1==(e=e.replace(/((^|[^%])(%%)*)%f/,o)).indexOf("%")?e:(0,d.default)(t,e)}function N(t){return Math.round(t/1e3%1*1e6)}o.tm_index_for_resolution.set("seconds",5),o.tm_index_for_resolution.set("minsec",4),o.tm_index_for_resolution.set("minutes",4),o.tm_index_for_resolution.set("hourmin",3),o.tm_index_for_resolution.set("hours",3),o._get_resolution=h,o._mktime=f,o._strftime=x,o._us=N;class O extends m.TickFormatter{constructor(t){super(t)}doFormat(t,e,o){if(0==t.length)return[];const n=Math.abs(t[t.length-1]-t[0])/1e3,r=n/(t.length-1),s=(0,l.is_undefined)(o)?h(r,n):o,i=[];for(const[e,o]of(0,_.enumerate)(t)){const n=this._compute_label(e,s),r=this._add_context(e,n,o,t.length,s);i.push(r)}return i}_compute_label(t,e){const n=x(t,this[e]),r=f(t),s=o.resolution_order.indexOf(e);let i,c=n,_=!1,u=s;for(;0==r[o.tm_index_for_resolution.get(o.resolution_order[u])]&&(u+=1,u!=o.resolution_order.length);){if(("minsec"==e||"hourmin"==e)&&!_){if("minsec"==e&&0==r[4]&&0!=r[5]||"hourmin"==e&&0==r[3]&&0!=r[4]){i=o.resolution_order[s-1],c=x(t,this[i]);break}_=!0}i=o.resolution_order[u],c=x(t,this[i])}if(this.strip_leading_zeros){const t=c.replace(/^0+/g,"");return t!=c&&isNaN(parseInt(t))?`0${t}`:t}return c}_add_context(t,e,o,n,r){const s=this.context_location,i=this.context_which;if(null==this.context)return e;if("start"==i&&0==o||"end"==i&&o==n-1||"center"==i&&o==Math.floor(n/2)||"all"==i){const o=(0,l.isString)(this.context)?x(t,this.context):this.context.doFormat([t],{loc:0},r)[0];if(""==o)return e;switch(s){case"above":return`${o}\n${e}`;case"below":return`${e}\n${o}`;case"left":return`${o} ${e}`;case"right":return`${e} ${o}`}}return e}}o.DatetimeTickFormatter=O,s=O,O.__name__="DatetimeTickFormatter",s.define((({Boolean:t,Nullable:e,Or:o,Ref:n,String:r})=>({microseconds:[r,"%fus"],milliseconds:[r,"%3Nms"],seconds:[r,"%Ss"],minsec:[r,":%M:%S"],minutes:[r,":%M"],hourmin:[r,"%H:%M"],hours:[r,"%Hh"],days:[r,"%m/%d"],months:[r,"%m/%Y"],years:[r,"%Y"],strip_leading_zeros:[t,!0],context:[e(o(r,n(O))),null],context_which:[c.ContextWhich,"start"],context_location:[c.Location,"below"]})))}, +function _(t,e,o,n,r){var s;n();const i=t(1),c=t(19),_=t(33),u=t(170),l=t(8),m=t(162),a=t(174),d=i.__importDefault(t(173));o.resolution_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],o.tm_index_for_resolution=new Map;for(const t of o.resolution_order)o.tm_index_for_resolution.set(t,0);function h(t,e){const o=1.1*t*1e3,n=1e3*e;return o=a.ONE_MINUTE?"minsec":"seconds":o=a.ONE_HOUR?"hourmin":"minutes":oparseInt(t,10)))}function x(t,e){const o=(0,u.sprintf)("$1%06d",N(t));return-1==(e=e.replace(/((^|[^%])(%%)*)%f/,o)).indexOf("%")?e:(0,d.default)(t,e)}function N(t){return Math.round(t/1e3%1*1e6)}o.tm_index_for_resolution.set("seconds",5),o.tm_index_for_resolution.set("minsec",4),o.tm_index_for_resolution.set("minutes",4),o.tm_index_for_resolution.set("hourmin",3),o.tm_index_for_resolution.set("hours",3),o._get_resolution=h,o._mktime=f,o._strftime=x,o._us=N;class O extends m.TickFormatter{constructor(t){super(t)}doFormat(t,e,o){if(0==t.length)return[];const n=Math.abs(t[t.length-1]-t[0])/1e3,r=n/(t.length-1),s=(0,l.is_undefined)(o)?h(r,n):o,i=[];for(const[e,o]of(0,_.enumerate)(t)){const n=this._compute_label(e,s),r=this._add_context(e,n,o,t.length,s);i.push(r)}return i}_compute_label(t,e){const n=x(t,this[e]),r=f(t),s=o.resolution_order.indexOf(e);let i,c=n,_=!1,u=s;for(;0==r[o.tm_index_for_resolution.get(o.resolution_order[u])]&&(u+=1,u!=o.resolution_order.length);){if(("minsec"==e||"hourmin"==e)&&!_){if("minsec"==e&&0==r[4]&&0!=r[5]||"hourmin"==e&&0==r[3]&&0!=r[4]){i=o.resolution_order[s-1],c=x(t,this[i]);break}_=!0}i=o.resolution_order[u],c=x(t,this[i])}if(this.strip_leading_zeros){const t=c.replace(/^0+/g,"");return t!=c&&isNaN(parseInt(t))?`0${t}`:t}return c}_add_context(t,e,o,n,r){const s=this.context_location,i=this.context_which;if(null==this.context)return e;if("start"==i&&0==o||"end"==i&&o==n-1||"center"==i&&o==Math.floor(n/2)||"all"==i){const o=(0,l.isString)(this.context)?x(t,this.context):this.context.doFormat([t],{loc:0},r)[0];if(""==o)return e;switch(s){case"above":return`${o}\n${e}`;case"below":return`${e}\n${o}`;case"left":return`${o} ${e}`;case"right":return`${e} ${o}`}}return e}}o.DatetimeTickFormatter=O,s=O,O.__name__="DatetimeTickFormatter",s.define((({Boolean:t,Nullable:e,Or:o,Ref:n,String:r})=>({microseconds:[r,"%fus"],milliseconds:[r,"%3Nms"],seconds:[r,"%Ss"],minsec:[r,":%M:%S"],minutes:[r,":%M"],hourmin:[r,"%H:%M"],hours:[r,"%Hh"],days:[r,"%m/%d"],months:[r,"%m/%Y"],years:[r,"%Y"],strip_leading_zeros:[t,!0],context:[e(o(r,n(O))),null],context_which:[c.ContextWhich,"start"],context_location:[c.Location,"below"]})))}, function _(r,n,t,e,u){e();const i=r(1),l=i.__importStar(r(171)),a=r(172),f=i.__importDefault(r(173)),o=r(20),s=r(8);function c(r,...n){return(0,a.sprintf)(r,...n)}function m(r,n,t){if((0,s.isNumber)(r)){return c((()=>{switch(!1){case Math.floor(r)!=r:return"%d";case!(Math.abs(r)>.1&&Math.abs(r)<1e3):return"%0.3f";default:return"%0.3e"}})(),r)}return`${r}`}function _(r,n,e){if(null==n)return m;if(null!=e&&r in e){const n=e[r];if((0,s.isString)(n)){if(n in t.DEFAULT_FORMATTERS)return t.DEFAULT_FORMATTERS[n];throw new Error(`Unknown tooltip field formatter type '${n}'`)}return function(r,t,e){return n.format(r,t,e)}}return t.DEFAULT_FORMATTERS.numeral}function p(r,n,t){const e=n.get_column(r);if(null==e)return null;if(null==t)return null;if((0,s.isNumber)(t))return e[t];const u=e[t.index];if((0,s.isTypedArray)(u)||(0,s.isArray)(u)){if((0,s.isArray)(u[0])){return u[t.j][t.i]}return u[t.flat_index]}return u}function T(r,n,t,e){if("$"==r[0]){return function(r,n){if(r in n)return n[r];throw new Error(`Unknown special variable '$${r}'`)}(r.substring(1),e)}return p(r.substring(1).replace(/[{}]/g,""),n,t)}t.FormatterType=(0,o.Enum)("numeral","printf","datetime"),t.DEFAULT_FORMATTERS={numeral:(r,n,t)=>l.format(r,n),datetime:(r,n,t)=>(0,f.default)(r,n),printf:(r,n,t)=>c(n,r)},t.sprintf=c,t.basic_formatter=m,t.get_formatter=_,t._get_column_value=p,t.get_value=T,t.replace_placeholders=function(r,n,t,e,u={},i){let l,a;if((0,s.isString)(r)?(l=r,a=!1):(l=r.html,a=!0),l=l.replace(/@\$name/g,(r=>`@{${u.name}}`)),l=l.replace(/((?:\$\w+)|(?:@\w+)|(?:@{(?:[^{}]+)}))(?:{([^{}]+)})?/g,((r,l,f)=>{const o=T(l,n,t,u);if(null==o)return null!=i?i("???"):"???";if("safe"==f)return a=!0,`${o}`;const s=`${_(l,f,e)(o,f,u)}`;return null!=i?i(s):s})),a){return[...(new DOMParser).parseFromString(l,"text/html").body.childNodes]}return l}}, function _(e,n,t,r,i){ /*! @@ -1134,7 +1134,7 @@

Plots# function _(e,t,a,r,_){r();const n=e(183),s=e(180),i=e(174);class c extends s.BaseSingleIntervalTicker{constructor(e){super(e),this.interval=i.ONE_YEAR,this.basic_ticker=new n.BasicTicker({num_minor_ticks:0})}get_ticks_no_defaults(e,t,a,r){const _=(0,i.last_year_no_later_than)(new Date(e)).getUTCFullYear(),n=(0,i.last_year_no_later_than)(new Date(t)).getUTCFullYear();return{major:this.basic_ticker.get_ticks_no_defaults(_,n,a,r).major.map((e=>Date.UTC(e,0,1))).filter((a=>e<=a&&a<=t)),minor:[]}}}a.YearsTicker=c,c.__name__="YearsTicker"}, function _(c,e,s,i,n){i();const r=c(176);class t extends r.AdaptiveTicker{constructor(c){super(c)}}s.BasicTicker=t,t.__name__="BasicTicker"}, function _(e,i,s,n,r){var t;n();const a=e(167),o=e(185),c=e(183);class _ extends a.ContinuousAxisView{}s.LinearAxisView=_,_.__name__="LinearAxisView";class u extends a.ContinuousAxis{constructor(e){super(e)}}s.LinearAxis=u,t=u,u.__name__="LinearAxis",t.prototype.default_view=_,t.override({ticker:()=>new c.BasicTicker,formatter:()=>new o.BasicTickFormatter})}, -function _(i,t,e,n,o){var r;n();const s=i(162),c=i(38);function _(i){let t="";for(const e of i)t+="-"==e?"\u2212":e;return t}e.unicode_replace=_;class a extends s.TickFormatter{constructor(i){super(i),this.last_precision=3}get scientific_limit_low(){return 10**this.power_limit_low}get scientific_limit_high(){return 10**this.power_limit_high}_need_sci(i){if(!this.use_scientific)return!1;const{scientific_limit_high:t}=this,{scientific_limit_low:e}=this,n=i.length<2?0:Math.abs(i[1]-i[0])/1e4;for(const o of i){const i=Math.abs(o);if(!(i<=n)&&(i>=t||i<=e))return!0}return!1}_format_with_precision(i,t,e){return t?i.map((i=>_(i.toExponential(e)))):i.map((i=>_((0,c.to_fixed)(i,e))))}_auto_precision(i,t){const e=new Array(i.length),n=this.last_precision<=15;i:for(let o=this.last_precision;n?o<=15:o>=1;n?o++:o--){if(t){e[0]=i[0].toExponential(o);for(let t=1;t({precision:[n(t,e),"auto"],use_scientific:[i,!0],power_limit_high:[t,5],power_limit_low:[t,-3]})))}, +function _(i,t,e,n,o){var r;n();const s=i(162),c=i(39);function _(i){let t="";for(const e of i)t+="-"==e?"\u2212":e;return t}e.unicode_replace=_;class a extends s.TickFormatter{constructor(i){super(i),this.last_precision=3}get scientific_limit_low(){return 10**this.power_limit_low}get scientific_limit_high(){return 10**this.power_limit_high}_need_sci(i){if(!this.use_scientific)return!1;const{scientific_limit_high:t}=this,{scientific_limit_low:e}=this,n=i.length<2?0:Math.abs(i[1]-i[0])/1e4;for(const o of i){const i=Math.abs(o);if(!(i<=n)&&(i>=t||i<=e))return!0}return!1}_format_with_precision(i,t,e){return t?i.map((i=>_(i.toExponential(e)))):i.map((i=>_((0,c.to_fixed)(i,e))))}_auto_precision(i,t){const e=new Array(i.length),n=this.last_precision<=15;i:for(let o=this.last_precision;n?o<=15:o>=1;n?o++:o--){if(t){e[0]=i[0].toExponential(o);for(let t=1;t({precision:[n(t,e),"auto"],use_scientific:[i,!0],power_limit_high:[t,5],power_limit_low:[t,-3]})))}, function _(e,o,i,s,t){var n;s();const r=e(167),_=e(187),c=e(188);class a extends r.ContinuousAxisView{}i.LogAxisView=a,a.__name__="LogAxisView";class u extends r.ContinuousAxis{constructor(e){super(e)}}i.LogAxis=u,n=u,u.__name__="LogAxis",n.prototype.default_view=a,n.override({ticker:()=>new c.LogTicker,formatter:()=>new _.LogTickFormatter})}, function _(e,t,n,o,r){var i;o();const a=e(162),s=e(185),c=e(188),l=e(151),{abs:u,log:x,round:_}=Math;class p extends a.TickFormatter{constructor(e){super(e)}initialize(){super.initialize(),this.basic_formatter=new s.BasicTickFormatter}format_graphics(e,t){var n,o;if(0==e.length)return[];const r=null!==(o=null===(n=this.ticker)||void 0===n?void 0:n.base)&&void 0!==o?o:10,i=this._exponents(e,r);return null==i?this.basic_formatter.format_graphics(e,t):i.map((e=>{if(u(e)u(e)({ticker:[n(t(c.LogTicker)),null],min_exponent:[e,0]})))}, function _(t,o,e,s,n){var r;s();const i=t(176),a=t(10);class c extends i.AdaptiveTicker{constructor(t){super(t)}get_ticks_no_defaults(t,o,e,s){const n=this.num_minor_ticks,r=[],i=this.base,c=Math.log(t)/Math.log(i),f=Math.log(o)/Math.log(i),l=f-c;let h;if(isFinite(l)&&0!=l)if(l<2){const e=this.get_interval(t,o,s),i=Math.floor(t/e),c=Math.ceil(o/e);if(h=(0,a.range)(i,c+1).filter((t=>0!=t)).map((t=>t*e)).filter((e=>t<=e&&e<=o)),n>0&&h.length>0){const t=e/n,o=(0,a.range)(0,n).map((o=>o*t));for(const t of o.slice(1))r.push(h[0]-t);for(const t of h)for(const e of o)r.push(t+e)}}else{const t=Math.ceil(.999999*c),o=Math.floor(1.000001*f),e=Math.ceil((o-t)/9);if(h=(0,a.range)(t-1,o+1,e).map((t=>i**t)),n>0&&h.length>0){const t=i**e/n,o=(0,a.range)(1,n+1).map((o=>o*t));for(const t of o)r.push(h[0]/t);r.push(h[0]);for(const t of h)for(const e of o)r.push(t*e)}}else h=[];return{major:h.filter((e=>t<=e&&e<=o)),minor:r.filter((e=>t<=e&&e<=o))}}}e.LogTicker=c,r=c,c.__name__="LogTicker",r.override({mantissas:[1,5]})}, @@ -1152,7 +1152,7 @@

Plots# function _(e,r,t,n,s){var a,o;n();const _=e(74),i=e(93);class c extends _.RendererView{constructor(){super(...arguments),this[a]=!0}get xscale(){return this.coordinates.x_scale}get yscale(){return this.coordinates.y_scale}bounds(){return this.glyph_view.bounds()}log_bounds(){return this.glyph_view.log_bounds()}}t.DataRendererView=c,a=i.auto_ranged,c.__name__="DataRendererView";class d extends _.Renderer{constructor(e){super(e)}get selection_manager(){return this.get_selection_manager()}}t.DataRenderer=d,o=d,d.__name__="DataRenderer",o.override({level:"glyph"})}, function _(e,t,i,n,s){var l;n();const o=e(1),_=e(202),r=e(209),h=o.__importStar(e(78)),c=o.__importStar(e(210)),a=e(101);class d extends _.XYGlyphView{async load_glglyph(){const{LineGL:t}=await Promise.resolve().then((()=>o.__importStar(e(531))));return t}_render(e,t,i){const{sx:n,sy:s}=null!=i?i:this,l=this.parent.nonselection_glyph==this;let o=null;const _=e=>null!=o&&e-o!=1;let r=!0;e.beginPath();for(const i of t){const t=n[i],h=s[i];l&&!r&&null!=o&&i-o>1&&isFinite(n[o+1]+s[o+1])&&e.lineTo(n[o+1],s[o+1]),isFinite(t+h)?(r||_(i)?(l&&i>0&&isFinite(n[i-1]+s[i-1])?(e.moveTo(n[i-1],s[i-1]),e.lineTo(t,h)):e.moveTo(t,h),r=!1):e.lineTo(t,h),o=i):r=!0}if(l&&!r&&null!=o){const t=n.length;o({x:[c.XCoordinateSpec,{field:"x"}],y:[c.YCoordinateSpec,{field:"y"}]})))}, -function _(e,t,s,i,n){var a;i();const r=e(1),o=r.__importStar(e(17)),l=r.__importStar(e(57)),_=r.__importStar(e(75)),c=e(28),h=e(54),d=e(50),u=e(59),f=e(18),p=e(23),g=e(8),y=e(204),v=e(13),w=e(25),x=e(205),b=e(96),m=e(101),S=e(208),{abs:z,ceil:$}=Math;class k extends h.View{constructor(){super(...arguments),this._index=null,this._data_size=null,this._nohit_warned=new Set,this.decorations=new Map}get renderer(){return this.parent}get has_webgl(){return null!=this.glglyph}get index(){const{_index:e}=this;if(null!=e)return e;throw new Error(`${this}.index_data() wasn't called`)}get data_size(){const{base:e}=this;if(null!=e)return e.data_size;{const{_data_size:e}=this;if(null!=e)return e;throw new Error(`${this}.set_data() wasn't called`)}}initialize(){super.initialize(),this.visuals=new _.Visuals(this)}*children(){yield*super.children(),yield*this.decorations.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,u.build_views)(this.decorations,this.model.decorations,{parent:this.parent});const{webgl:e}=this.canvas;if(null!=e&&null!=this.load_glglyph){const t=await this.load_glglyph();this.glglyph=new t(e.regl_wrapper,this)}}request_render(){this.parent.request_render()}get canvas(){return this.renderer.parent.canvas_view}render(e,t,s){var i;if(null!=this.glglyph)this.glglyph.render(e,t,null!==(i=this.base)&&void 0!==i?i:this);else{if(null!=this.canvas.webgl&&c.settings.force_webgl)throw new Error(`${this} doesn't support webgl rendering`);this._render(e,t,null!=s?s:this.base)}}has_finished(){return!0}notify_finished(){this.renderer.notify_finished()}_bounds(e){return e}bounds(){return this._bounds(this.index.bbox)}log_bounds(){const{x0:e,x1:t}=this.index.bounds(l.positive_x()),{y0:s,y1:i}=this.index.bounds(l.positive_y());return this._bounds({x0:e,y0:s,x1:t,y1:i})}get_anchor_point(e,t,[s,i]){switch(e){case"center":case"center_center":{const[e,n]=this.scenterxy(t,s,i);return{x:e,y:n}}default:return null}}sdist(e,t,s,i="edge",n=!1){const a=t.length,r=new p.ScreenArray(a),o=e.s_compute;if("center"==i)for(let e=0;e$(e))),r}draw_legend_for_index(e,t,s){}hit_test(e){switch(e.type){case"point":if(null!=this._hit_point)return this._hit_point(e);break;case"span":if(null!=this._hit_span)return this._hit_span(e);break;case"rect":if(null!=this._hit_rect)return this._hit_rect(e);break;case"poly":if(null!=this._hit_poly)return this._hit_poly(e)}return this._nohit_warned.has(e.type)||(f.logger.debug(`'${e.type}' selection not available for ${this.model.type}`),this._nohit_warned.add(e.type)),null}_hit_rect_against_index(e){const{sx0:t,sx1:s,sy0:i,sy1:n}=e,[a,r]=this.renderer.coordinates.x_scale.r_invert(t,s),[o,l]=this.renderer.coordinates.y_scale.r_invert(i,n),_=[...this.index.indices({x0:a,x1:r,y0:o,y1:l})];return new m.Selection({indices:_})}_project_data(){}*_iter_visuals(){for(const e of this.visuals)for(const t of e)(t instanceof o.VectorSpec||t instanceof o.ScalarSpec)&&(yield t)}set_base(e){e!=this&&e instanceof this.constructor&&(this.base=e)}_configure(e,t){Object.defineProperty(this,(0,g.isString)(e)?e:e.attr,Object.assign({configurable:!0,enumerable:!0},t))}set_visuals(e,t){var s;for(const s of this._iter_visuals()){const{base:i}=this;if(null!=i){const e=i.model.properties[s.attr];if(null!=e&&(0,w.is_equal)(s.get_value(),e.get_value())){this._configure(s,{get:()=>i[`${s.attr}`]});continue}}const n=s.uniform(e).select(t);this._configure(s,{value:n})}for(const e of this.visuals)e.update();null===(s=this.glglyph)||void 0===s||s.set_visuals_changed()}set_data(e,t,s){var i;const{x_source:n,y_source:a}=this.renderer.coordinates,r=new Set(this._iter_visuals());this._data_size=t.count;for(const s of this.model)if((s instanceof o.VectorSpec||s instanceof o.ScalarSpec)&&!r.has(s))if(s instanceof o.BaseCoordinateSpec){const i=s.array(e);let r=t.select(i);const l="x"==s.dimension?n:a;if(l instanceof b.FactorRange)if(s instanceof o.CoordinateSpec)r=l.v_synthetic(r);else if(s instanceof o.CoordinateSeqSpec)for(let e=0;e({decorations:[e(t(S.Decoration)),[]]})))}, +function _(e,t,s,i,n){var a;i();const r=e(1),o=r.__importStar(e(17)),l=r.__importStar(e(57)),_=r.__importStar(e(75)),c=e(28),h=e(54),d=e(50),u=e(59),f=e(18),p=e(23),g=e(8),y=e(204),v=e(13),w=e(25),x=e(205),m=e(96),b=e(101),S=e(208),{abs:z,ceil:$}=Math;class k extends h.View{constructor(){super(...arguments),this._index=null,this._data_size=null,this._nohit_warned=new Set,this.decorations=new Map}get renderer(){return this.parent}get has_webgl(){return null!=this.glglyph}get index(){const{_index:e}=this;if(null!=e)return e;throw new Error(`${this}.index_data() wasn't called`)}get data_size(){const{base:e}=this;if(null!=e)return e.data_size;{const{_data_size:e}=this;if(null!=e)return e;throw new Error(`${this}.set_data() wasn't called`)}}initialize(){super.initialize(),this.visuals=new _.Visuals(this)}*children(){yield*super.children(),yield*this.decorations.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,u.build_views)(this.decorations,this.model.decorations,{parent:this.parent});const{webgl:e}=this.canvas;if(null!=e&&null!=this.load_glglyph){const t=await this.load_glglyph();this.glglyph=new t(e.regl_wrapper,this)}}request_render(){this.parent.request_render()}get canvas(){return this.renderer.parent.canvas_view}render(e,t,s){var i;if(null!=this.glglyph)this.glglyph.render(e,t,null!==(i=this.base)&&void 0!==i?i:this);else{if(null!=this.canvas.webgl&&c.settings.force_webgl)throw new Error(`${this} doesn't support webgl rendering`);this._render(e,t,null!=s?s:this.base)}}has_finished(){return!0}notify_finished(){this.renderer.notify_finished()}_bounds(e){return e}bounds(){return this._bounds(this.index.bbox)}log_bounds(){const{x0:e,x1:t}=this.index.bounds(l.positive_x()),{y0:s,y1:i}=this.index.bounds(l.positive_y());return this._bounds({x0:e,y0:s,x1:t,y1:i})}get_anchor_point(e,t,[s,i]){switch(e){case"center":case"center_center":{const[e,n]=this.scenterxy(t,s,i);return{x:e,y:n}}default:return null}}sdist(e,t,s,i="edge",n=!1){const a=t.length,r=new p.ScreenArray(a),o=e.s_compute;if("center"==i)for(let e=0;e$(e))),r}draw_legend_for_index(e,t,s){}hit_test(e){switch(e.type){case"point":if(null!=this._hit_point)return this._hit_point(e);break;case"span":if(null!=this._hit_span)return this._hit_span(e);break;case"rect":if(null!=this._hit_rect)return this._hit_rect(e);break;case"poly":if(null!=this._hit_poly)return this._hit_poly(e)}return this._nohit_warned.has(e.type)||(f.logger.debug(`'${e.type}' selection not available for ${this.model.type}`),this._nohit_warned.add(e.type)),null}_hit_rect_against_index(e){const{sx0:t,sx1:s,sy0:i,sy1:n}=e,[a,r]=this.renderer.coordinates.x_scale.r_invert(t,s),[o,l]=this.renderer.coordinates.y_scale.r_invert(i,n),_=[...this.index.indices({x0:a,x1:r,y0:o,y1:l})];return new b.Selection({indices:_})}_project_data(){}*_iter_visuals(){for(const e of this.visuals)for(const t of e)(t instanceof o.VectorSpec||t instanceof o.ScalarSpec)&&(yield t)}set_base(e){e!=this&&e instanceof this.constructor&&(this.base=e)}_configure(e,t){Object.defineProperty(this,(0,g.isString)(e)?e:e.attr,Object.assign({configurable:!0,enumerable:!0},t))}set_visuals(e,t){var s;for(const s of this._iter_visuals()){const{base:i}=this;if(null!=i){const e=i.model.properties[s.attr];if(null!=e&&(0,w.is_equal)(s.get_value(),e.get_value())){this._configure(s,{get:()=>i[`${s.attr}`]});continue}}const n=s.uniform(e).select(t);this._configure(s,{value:n})}for(const e of this.visuals)e.update();null===(s=this.glglyph)||void 0===s||s.set_visuals_changed()}set_data(e,t,s){var i;const{x_source:n,y_source:a}=this.renderer.coordinates,r=new Set(this._iter_visuals());this._data_size=t.count;for(const s of this.model)if((s instanceof o.VectorSpec||s instanceof o.ScalarSpec)&&!r.has(s))if(s instanceof o.BaseCoordinateSpec){const i=s.array(e);let r=t.select(i);const l="x"==s.dimension?n:a;if(l instanceof m.FactorRange)if(s instanceof o.CoordinateSpec)r=l.v_synthetic(r);else if(s instanceof o.CoordinateSeqSpec)for(let e=0;e({decorations:[e(t(S.Decoration)),[]]})))}, function _(t,s,r,e,a){var n;e();const o=t(25),h=t(12);class i{constructor(t,s){this.offsets=t,this.array=s}[(n=Symbol.toStringTag,o.equals)](t,s){return s.arrays(this.offsets,t.offsets)&&s.arrays(this.array,t.array)}get length(){return this.offsets.length}clone(){return new i(this.offsets.slice(),this.array.slice())}static from(t,s){const r=t.length;let e=0;const a=(()=>{const s=new Uint32Array(r);for(let a=0;a>1;t[s]>i?e=s:n=s+1}return t[n]}class r extends d.default{get boxes(){return this._boxes}search_indices(i,t,n,e){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let s=this._boxes.length-4;const d=[],x=new o.Indices(this.numItems);for(;void 0!==s;){const o=Math.min(s+4*this.nodeSize,h(s,this._levelBounds));for(let h=s;h>2],r=this._boxes[h+0],l=this._boxes[h+1],a=this._boxes[h+2],_=this._boxes[h+3];na||t>_||(s<4*this.numItems?x.set(o):d.push(o)))}s=d.pop()}return x}}r.__name__="_FlatBush";class l{constructor(i){this.index=null,i>0&&(this.index=new r(i))}add_rect(i,t,n,e){var s;isFinite(i+t+n+e)?null===(s=this.index)||void 0===s||s.add(i,t,n,e):this.add_empty()}add_point(i,t){var n;isFinite(i+t)?null===(n=this.index)||void 0===n||n.add(i,t,i,t):this.add_empty()}add_empty(){var i;null===(i=this.index)||void 0===i||i.add(1/0,1/0,-1/0,-1/0)}finish(){var i;null===(i=this.index)||void 0===i||i.finish()}_normalize(i){let{x0:t,y0:n,x1:e,y1:s}=i;return t>e&&([t,e]=[e,t]),n>s&&([n,s]=[s,n]),{x0:t,y0:n,x1:e,y1:s}}get bbox(){if(null==this.index)return(0,x.empty)();{const{minX:i,minY:t,maxX:n,maxY:e}=this.index;return{x0:i,y0:t,x1:n,y1:e}}}indices(i){if(null==this.index)return new o.Indices(0);{const{x0:t,y0:n,x1:e,y1:s}=this._normalize(i);return this.index.search_indices(t,n,e,s)}}bounds(i){const t=(0,x.empty)();if(null==this.index)return t;const{boxes:n}=this.index;for(const e of this.indices(i)){const s=n[4*e+0],d=n[4*e+1],o=n[4*e+2],x=n[4*e+3];s>=i.x0&&st.x1&&(t.x1=o),d>=i.y0&&dt.y1&&(t.y1=x)}return t}}n.SpatialIndex=l,l.__name__="SpatialIndex"}, function _(t,s,i,e,h){e();const n=t(1).__importDefault(t(207)),o=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class r{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[s,i]=new Uint8Array(t,0,2);if(251!==s)throw new Error("Data does not appear to be in a Flatbush format.");if(i>>4!=3)throw new Error(`Got v${i>>4} data when expected v3.`);const[e]=new Uint16Array(t,2,1),[h]=new Uint32Array(t,4,1);return new r(h,e,o[15&i],t)}constructor(t,s=16,i=Float64Array,e){if(void 0===t)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+s,2),65535);let h=t,r=h;this._levelBounds=[4*h];do{h=Math.ceil(h/this.nodeSize),r+=h,this._levelBounds.push(4*r)}while(1!==h);this.ArrayType=i||Float64Array,this.IndexArrayType=r<16384?Uint16Array:Uint32Array;const a=o.indexOf(this.ArrayType),_=4*r*this.ArrayType.BYTES_PER_ELEMENT;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);e&&e instanceof ArrayBuffer?(this.data=e,this._boxes=new this.ArrayType(this.data,8,4*r),this._indices=new this.IndexArrayType(this.data,8+_,r),this._pos=4*r,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1]):(this.data=new ArrayBuffer(8+_+r*this.IndexArrayType.BYTES_PER_ELEMENT),this._boxes=new this.ArrayType(this.data,8,4*r),this._indices=new this.IndexArrayType(this.data,8+_,r),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(this.data,0,2).set([251,48+a]),new Uint16Array(this.data,2,1)[0]=s,new Uint32Array(this.data,4,1)[0]=t),this._queue=new n.default}add(t,s,i,e){const h=this._pos>>2;return this._indices[h]=h,this._boxes[this._pos++]=t,this._boxes[this._pos++]=s,this._boxes[this._pos++]=i,this._boxes[this._pos++]=e,tthis.maxX&&(this.maxX=i),e>this.maxY&&(this.maxY=e),h}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);if(this.numItems<=this.nodeSize)return this._boxes[this._pos++]=this.minX,this._boxes[this._pos++]=this.minY,this._boxes[this._pos++]=this.maxX,void(this._boxes[this._pos++]=this.maxY);const t=this.maxX-this.minX||1,s=this.maxY-this.minY||1,i=new Uint32Array(this.numItems);for(let e=0;e>2]=t,this._boxes[this._pos++]=e,this._boxes[this._pos++]=h,this._boxes[this._pos++]=n,this._boxes[this._pos++]=o}}}search(t,s,i,e,h){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let n=this._boxes.length-4;const o=[],r=[];for(;void 0!==n;){const a=Math.min(n+4*this.nodeSize,_(n,this._levelBounds));for(let _=n;_this._boxes[_+2])continue;if(s>this._boxes[_+3])continue;const a=0|this._indices[_>>2];n<4*this.numItems?(void 0===h||h(a))&&r.push(a):o.push(a)}n=o.pop()}return r}neighbors(t,s,i=1/0,e=1/0,h){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let n=this._boxes.length-4;const o=this._queue,r=[],x=e*e;for(;void 0!==n;){const e=Math.min(n+4*this.nodeSize,_(n,this._levelBounds));for(let i=n;i>2],r=a(t,this._boxes[i],this._boxes[i+2]),_=a(s,this._boxes[i+1],this._boxes[i+3]),x=r*r+_*_;n<4*this.numItems?(void 0===h||h(e))&&o.push(1+(e<<1),x):o.push(e<<1,x)}for(;o.length&&1&o.peek();){if(o.peekValue()>x)return o.clear(),r;if(r.push(o.pop()>>1),r.length===i)return o.clear(),r}n=o.pop()>>1}return o.clear(),r}}function a(t,s,i){return t>1;s[h]>t?e=h:i=h+1}return s[i]}function x(t,s,i,e,h,n){if(Math.floor(e/n)>=Math.floor(h/n))return;const o=t[e+h>>1];let r=e-1,a=h+1;for(;;){do{r++}while(t[r]o);if(r>=a)break;d(t,s,i,r,a)}x(t,s,i,e,a,n),x(t,s,i,a+1,h,n)}function d(t,s,i,e,h){const n=t[e];t[e]=t[h],t[h]=n;const o=4*e,r=4*h,a=s[o],_=s[o+1],x=s[o+2],d=s[o+3];s[o]=s[r],s[o+1]=s[r+1],s[o+2]=s[r+2],s[o+3]=s[r+3],s[r]=a,s[r+1]=_,s[r+2]=x,s[r+3]=d;const m=i[e];i[e]=i[h],i[h]=m}function m(t,s){let i=t^s,e=65535^i,h=65535^(t|s),n=t&(65535^s),o=i|e>>1,r=i>>1^i,a=h>>1^e&n>>1^h,_=i&h>>1^n>>1^n;i=o,e=r,h=a,n=_,o=i&i>>2^e&e>>2,r=i&e>>2^e&(i^e)>>2,a^=i&h>>2^e&n>>2,_^=e&h>>2^(i^e)&n>>2,i=o,e=r,h=a,n=_,o=i&i>>4^e&e>>4,r=i&e>>4^e&(i^e)>>4,a^=i&h>>4^e&n>>4,_^=e&h>>4^(i^e)&n>>4,i=o,e=r,h=a,n=_,a^=i&h>>8^e&n>>8,_^=e&h>>8^(i^e)&n>>8,i=a^a>>1,e=_^_>>1;let x=t^s,d=e|65535^(x|i);return x=16711935&(x|x<<8),x=252645135&(x|x<<4),x=858993459&(x|x<<2),x=1431655765&(x|x<<1),d=16711935&(d|d<<8),d=252645135&(d|d<<4),d=858993459&(d|d<<2),d=1431655765&(d|d<<1),(d<<1|x)>>>0}i.default=r}, @@ -1172,7 +1172,7 @@

Plots# function _(e,n,s,t,c){t();const l=e(219),i=e(23);class _ extends l.Filter{constructor(e){super(e)}compute_indices(e){var n;const s=null!==(n=e.get_length())&&void 0!==n?n:1;return i.Indices.all_set(s)}}s.AllIndices=_,_.__name__="AllIndices"}, function _(e,t,n,r,s){var c;r();const i=e(219),o=e(23);class l extends i.Filter{constructor(e){super(e)}compute_indices(e){var t;const{operands:n}=this;if(0==n.length){const n=null!==(t=e.get_length())&&void 0!==t?t:1;return o.Indices.all_set(n)}{const[t,...r]=n.map((t=>t.compute_indices(e)));for(const e of r)t.intersect(e);return t}}}n.IntersectionFilter=l,c=l,l.__name__="IntersectionFilter",c.define((({Array:e,Ref:t})=>({operands:[e(t(i.Filter))]})))}, function _(t,r,a,e,i){e(),i("BasicTickFormatter",t(185).BasicTickFormatter),i("CategoricalTickFormatter",t(166).CategoricalTickFormatter),i("DatetimeTickFormatter",t(169).DatetimeTickFormatter),i("CustomJSTickFormatter",t(223).CustomJSTickFormatter),i("LogTickFormatter",t(187).LogTickFormatter),i("MercatorTickFormatter",t(190).MercatorTickFormatter),i("NumeralTickFormatter",t(224).NumeralTickFormatter),i("PrintfTickFormatter",t(225).PrintfTickFormatter),i("TickFormatter",t(162).TickFormatter)}, -function _(t,e,s,n,r){var c;n();const i=t(162),a=t(9),o=t(38);class u extends i.TickFormatter{constructor(t){super(t)}get names(){return(0,a.keys)(this.args)}get values(){return(0,a.values)(this.args)}_make_func(){const t=(0,o.use_strict)(this.code);return new Function("tick","index","ticks",...this.names,t)}doFormat(t,e){const s=this._make_func().bind({});return t.map(((t,e,n)=>`${s(t,e,n,...this.values)}`))}}s.CustomJSTickFormatter=u,c=u,u.__name__="CustomJSTickFormatter",c.define((({Unknown:t,String:e,Dict:s})=>({args:[s(t),{}],code:[e,""]})))}, +function _(t,e,s,n,r){var c;n();const i=t(162),a=t(9),o=t(39);class u extends i.TickFormatter{constructor(t){super(t)}get names(){return(0,a.keys)(this.args)}get values(){return(0,a.values)(this.args)}_make_func(){const t=(0,o.use_strict)(this.code);return new Function("tick","index","ticks",...this.names,t)}doFormat(t,e){const s=this._make_func().bind({});return t.map(((t,e,n)=>`${s(t,e,n,...this.values)}`))}}s.CustomJSTickFormatter=u,c=u,u.__name__="CustomJSTickFormatter",c.define((({Unknown:t,String:e,Dict:s})=>({args:[s(t),{}],code:[e,""]})))}, function _(r,n,t,o,e){var a;o();const u=r(1).__importStar(r(171)),c=r(162),i=r(19);class s extends c.TickFormatter{constructor(r){super(r)}get _rounding_fn(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}doFormat(r,n){const{format:t,language:o,_rounding_fn:e}=this;return r.map((r=>u.format(r,t,o,e)))}}t.NumeralTickFormatter=s,a=s,s.__name__="NumeralTickFormatter",a.define((({String:r})=>({format:[r,"0,0"],language:[r,"en"],rounding:[i.RoundingFunction,"round"]})))}, function _(t,r,n,o,a){var e;o();const i=t(162),s=t(170);class c extends i.TickFormatter{constructor(t){super(t)}doFormat(t,r){return t.map((t=>(0,s.sprintf)(this.format,t)))}}n.PrintfTickFormatter=c,e=c,c.__name__="PrintfTickFormatter",e.define((({String:t})=>({format:[t,"%s"]})))}, function _(a,e,l,c,n){c(),n("CategoricalScale",a(92).CategoricalScale),n("ContinuousScale",a(90).ContinuousScale),n("LinearScale",a(89).LinearScale),n("LinearInterpolationScale",a(227).LinearInterpolationScale),n("LogScale",a(91).LogScale),n("Scale",a(85).Scale)}, @@ -1202,13 +1202,13 @@

Plots# function _(e,t,r,i,l){var n;i();const o=e(141),s=e(228),a=e(199),_=e(59),h=e(12);class d extends o.BaseColorBarView{*children(){yield*super.children(),yield this._fill_view,yield this._line_view}async lazy_initialize(){await super.lazy_initialize();const{fill_renderer:e,line_renderer:t}=this.model;this._fill_view=await(0,_.build_view)(e,{parent:this.parent}),this._line_view=await(0,_.build_view)(t,{parent:this.parent})}remove(){this._fill_view.remove(),this._line_view.remove(),super.remove()}_create_major_range(){const e=this.model.levels;return e.length>0?new s.Range1d({start:e[0],end:e[e.length-1]}):new s.Range1d({start:0,end:1})}_paint_colors(e,t){const r="vertical"==this.orientation,i=this.model.levels,l=this._major_scale;l.source_range=this._major_range,l.target_range=r?new s.Range1d({start:t.bottom,end:t.top}):new s.Range1d({start:t.left,end:t.right});const n=l.v_compute(i),o=this._fill_view.glyph,a=o.data_size;if(a>0){(0,h.assert)(i.length==a+1,"Inconsistent number of filled contour levels"),e.save();for(let i=0;i0){(0,h.assert)(i.length==d,"Inconsistent number of line contour levels"),e.save();for(let i=0;i({fill_renderer:[r(a.GlyphRenderer)],line_renderer:[r(a.GlyphRenderer)],levels:[e(t),[]]})))}, function _(e,t,s,i,n){var a;i();const o=e(143),l=e(11),h=e(19),u=e(144);class c extends o.TextAnnotationView{update_layout(){const{panel:e}=this;this.layout=null!=e?new u.SideLayout(e,(()=>this.get_size()),!1):void 0}_get_size(){if(!this.displayed)return{width:0,height:0};const e=this._text_view.graphics(),{angle:t,angle_units:s}=this.model;e.angle=(0,l.compute_angle)(t,s),e.visuals=this.visuals.text.values();const{width:i,height:n}=e.size();return{width:i,height:n}}_render(){const{angle:e,angle_units:t}=this.model,s=(0,l.compute_angle)(e,t),i=null!=this.layout?this.layout:this.plot_view.frame,n=this.coordinates.x_scale,a=this.coordinates.y_scale;let o=(()=>{switch(this.model.x_units){case"canvas":return this.model.x;case"screen":return i.bbox.xview.compute(this.model.x);case"data":return n.compute(this.model.x)}})(),h=(()=>{switch(this.model.y_units){case"canvas":return this.model.y;case"screen":return i.bbox.yview.compute(this.model.y);case"data":return a.compute(this.model.y)}})();o+=this.model.x_offset,h-=this.model.y_offset,this._paint(this.layer.ctx,{sx:o,sy:h},s)}}s.LabelView=c,c.__name__="LabelView";class d extends o.TextAnnotation{constructor(e){super(e)}}s.Label=d,a=d,d.__name__="Label",a.prototype.default_view=c,a.define((({Number:e,Angle:t})=>({x:[e],x_units:[h.CoordinateUnits,"data"],y:[e],y_units:[h.CoordinateUnits,"data"],angle:[t,0],angle_units:[h.AngleUnits,"rad"],x_offset:[e,0],y_offset:[e,0]})))}, function _(t,e,i,s,a){var n;s();const o=t(1),l=t(98),r=o.__importStar(t(78)),c=t(19),_=t(151),u=o.__importStar(t(17)),x=t(23);class h extends l.DataAnnotationView{map_data(){const{x_scale:t,y_scale:e}=this.coordinates,i=null!=this.layout?this.layout:this.plot_view.frame;this.sx=(()=>{switch(this.model.x_units){case"canvas":return new x.ScreenArray(this._x);case"screen":return i.bbox.xview.v_compute(this._x);case"data":return t.v_compute(this._x)}})(),this.sy=(()=>{switch(this.model.y_units){case"canvas":return new x.ScreenArray(this._y);case"screen":return i.bbox.yview.v_compute(this._y);case"data":return e.v_compute(this._y)}})()}paint(){const{ctx:t}=this.layer;for(let e=0,i=this.text.length;e({x:[u.XCoordinateSpec,{field:"x"}],y:[u.YCoordinateSpec,{field:"y"}],x_units:[c.CoordinateUnits,"data"],y_units:[c.CoordinateUnits,"data"],text:[u.NullStringSpec,{field:"text"}],angle:[u.AngleSpec,0],x_offset:[u.NumberSpec,{value:0}],y_offset:[u.NumberSpec,{value:0}]}))),n.override({background_fill_color:null,border_line_color:null})}, -function _(t,e,i,n,s){var o;n();const l=t(1),r=t(73),a=t(254),c=t(19),h=l.__importStar(t(78)),_=t(15),d=t(144),u=t(57),b=t(10),g=t(32),p=t(8),m=t(151),f=t(229),{max:x,floor:w}=Math;class y extends f.ContentLayoutable{constructor(t){super(),this.text=t}_content_size(){return new f.Sizeable(this.text.size())}}y.__name__="TextLayout";class v extends f.ContentLayoutable{constructor(t,e,i,n){super(),this.item=t,this.label=e,this.text=i,this.settings=n}get field(){return this.item.get_field_from_label_prop()}_content_size(){const t=this.text.size(),{glyph_width:e,glyph_height:i,label_standoff:n,label_width:s,label_height:o}=this.settings,l=e+n+x(t.width,s),r=x(i,t.height,o);return new f.Sizeable({width:l,height:r})}}v.__name__="LegendEntry";class k extends r.AnnotationView{constructor(){super(...arguments),this.bbox=new u.BBox}_get_size(){const{width:t,height:e}=this.bbox,{margin:i}=this.model;return{width:t+2*i,height:e+2*i}}update_layout(){this.update_geometry();const{panel:t}=this;this.layout=null!=t?new d.SideLayout(t,(()=>this.get_size())):void 0}connect_signals(){super.connect_signals();const t=()=>this.request_render();this.connect(this.model.change,t),this.connect(this.model.item_change,t)}get padding(){return null!=this.model.border_line_color?this.model.padding:0}update_geometry(){super.update_geometry();const{spacing:t,orientation:e}=this.model,i="vertical"==e,{padding:n}=this,s=n,o=n,{title:l}=this.model,r=new m.TextBox({text:null!=l?l:""});r.position={sx:0,sy:0,x_anchor:"left",y_anchor:"top"},r.visuals=this.visuals.title_text.values();const a=new d.Panel(this.model.title_location);r.angle=a.get_label_angle_heuristic("parallel");const c=[];for(const t of this.model.items){t.legend=this.model;const e=t.get_labels_list_from_label_prop();for(const i of e){const e=new m.TextBox({text:`${i}`});e.position={sx:0,sy:0,x_anchor:"left",y_anchor:"center"},e.visuals=this.visuals.label_text.values();const n=new v(t,i,e,this.model);n.set_sizing({visible:t.visible}),c.push({layout:n,row:0,col:0})}}const{ncols:h,nrows:_}=(()=>{let{ncols:t,nrows:e}=this.model;const n=c.length;return i?("auto"!=e||(e="auto"!=t?w(n/t):1/0),t=1/0):("auto"!=t||(t="auto"!=e?w(n/e):1/0),e=1/0),{ncols:t,nrows:e}})();let b=0,g=0;for(const t of c)t.row=b,t.col=g,i?(b+=1,b>=_&&(b=0,g+=1)):(g+=1,g>=h&&(g=0,b+=1));const p=new f.Grid(c);this.grid=p,p.spacing=t,p.set_sizing();const x=new y(r);this.title_panel=x;const k=""!=r.text&&this.visuals.title_text.doit;x.set_sizing({visible:k});const z=(()=>{if(!k)return new f.Column([p]);switch(this.model.title_location){case"above":return new f.Column([x,p]);case"below":return new f.Column([p,x]);case"left":return new f.Row([x,p]);case"right":return new f.Row([p,x])}})();this.border_box=z,z.position={left:s,top:o},z.spacing=this.model.title_standoff,z.set_sizing(),z.compute();const L=n+z.bbox.width+n,B=n+z.bbox.height+n;this.bbox=new u.BBox({left:0,top:0,width:L,height:B})}compute_geometry(){super.compute_geometry();const{margin:t,location:e}=this.model,{width:i,height:n}=this.bbox,s=null!=this.layout?this.layout:this.plot_view.frame,[o,l]=s.bbox.ranges;let r,a;if((0,p.isString)(e))switch(e){case"top_left":r=o.start+t,a=l.start+t;break;case"top":case"top_center":r=(o.end+o.start)/2-i/2,a=l.start+t;break;case"top_right":r=o.end-t-i,a=l.start+t;break;case"bottom_right":r=o.end-t-i,a=l.end-t-n;break;case"bottom":case"bottom_center":r=(o.end+o.start)/2-i/2,a=l.end-t-n;break;case"bottom_left":r=o.start+t,a=l.end-t-n;break;case"left":case"center_left":r=o.start+t,a=(l.end+l.start)/2-n/2;break;case"center":case"center_center":r=(o.end+o.start)/2-i/2,a=(l.end+l.start)/2-n/2;break;case"right":case"center_right":r=o.end-t-i,a=(l.end+l.start)/2-n/2}else{const[t,i]=e;r=s.bbox.xview.compute(t),a=s.bbox.yview.compute(i)-n}this.bbox=new u.BBox({left:r,top:a,width:i,height:n})}interactive_hit(t,e){return this.bbox.contains(t,e)}_hit_test(t,e){const{left:i,top:n}=this.bbox;t-=i+this.grid.bbox.left,e-=n+this.grid.bbox.top;for(const i of this.grid)if(i.bbox.contains(t,e))return{type:"entry",entry:i};return null}cursor(t,e){return"none"==this.model.click_policy?null:null!=this._hit_test(t,e)?"pointer":null}on_hit(t,e){const i=(()=>{switch(this.model.click_policy){case"hide":return t=>t.visible=!t.visible;case"mute":return t=>t.muted=!t.muted;case"none":return t=>{}}})(),n=this._hit_test(t,e);if(null!=n){const{renderers:t}=n.entry.item;for(const e of t)i(e);return!0}return!1}_render(){if(this.update_geometry(),this.compute_geometry(),0==this.model.items.length)return;if(!(0,b.some)(this.model.items,(t=>t.visible)))return;const{ctx:t}=this.layer;t.save(),this._draw_legend_box(t),this._draw_legend_items(t),this._draw_title(t),t.restore()}_draw_legend_box(t){const{x:e,y:i,width:n,height:s}=this.bbox;t.beginPath(),t.rect(e,i,n,s),this.visuals.background_fill.apply(t),this.visuals.border_line.apply(t)}_draw_title(t){const{title:e}=this.model;if(null==e||0==e.length||!this.visuals.title_text.doit)return;const{left:i,top:n}=this.bbox;switch(t.save(),t.translate(i,n),t.translate(this.title_panel.bbox.left,this.title_panel.bbox.top),this.model.title_location){case"left":t.translate(0,this.title_panel.bbox.height);break;case"right":t.translate(this.title_panel.bbox.width,0)}this.title_panel.text.paint(t),t.restore()}_draw_legend_items(t){const e=(()=>{switch(this.model.click_policy){case"none":return t=>!0;case"hide":return t=>(0,b.every)(t.renderers,(t=>t.visible));case"mute":return t=>(0,b.every)(t.renderers,(t=>!t.muted))}})(),i=(t,e,i)=>{if(!this.visuals.item_background_fill.doit)return!1;switch(this.model.item_background_policy){case"every":return!0;case"even":return e%2==0==(i%2==0);case"odd":return e%2==0!=(i%2==0);case"none":return!1}},{left:n,top:s}=this.bbox;t.translate(n,s),t.translate(this.grid.bbox.left,this.grid.bbox.top);for(const[{layout:n,row:s,col:o},l]of(0,g.enumerate)(this.grid.items)){const{bbox:l,text:r,item:a,label:c,field:h,settings:_}=n,{glyph_width:d,glyph_height:u,label_standoff:b}=_,{left:g,top:p,width:m,height:f}=l;t.translate(g,p),i(0,s,o)&&(t.beginPath(),t.rect(0,0,m,f),this.visuals.item_background_fill.apply(t));const x=f/2,w=0,y=x-u/2,v=w+d,k=y+u;for(const e of a.renderers){const i=this.plot_view.renderer_view(e);null==i||i.draw_legend(t,w,v,y,k,h,c,a.index)}t.translate(v+b,x),r.paint(t),t.translate(-v-b,-x),e(a)||(t.beginPath(),t.rect(0,0,m,f),this.visuals.inactive_fill.set_value(t),t.fill()),t.translate(-g,-p)}t.translate(-this.grid.bbox.left,-this.grid.bbox.top),t.translate(-n,-s)}}i.LegendView=k,k.__name__="LegendView";class z extends r.Annotation{constructor(t){super(t)}initialize(){super.initialize(),this.item_change=new _.Signal0(this,"item_change")}}i.Legend=z,o=z,z.__name__="Legend",o.prototype.default_view=k,o.mixins([["label_",h.Text],["title_",h.Text],["inactive_",h.Fill],["border_",h.Line],["background_",h.Fill],["item_background_",h.Fill]]),o.define((({Number:t,Int:e,String:i,Array:n,Tuple:s,Or:o,Ref:l,Nullable:r,Positive:h,Auto:_})=>({orientation:[c.Orientation,"vertical"],ncols:[o(h(e),_),"auto"],nrows:[o(h(e),_),"auto"],location:[o(c.LegendLocation,s(t,t)),"top_right"],title:[r(i),null],title_location:[c.Location,"above"],title_standoff:[t,5],label_standoff:[t,5],glyph_height:[t,20],glyph_width:[t,20],label_height:[t,20],label_width:[t,20],margin:[t,10],padding:[t,10],spacing:[t,3],items:[n(l(a.LegendItem)),[]],click_policy:[c.LegendClickPolicy,"none"],item_background_policy:[c.AlternationPolicy,"none"]}))),o.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,item_background_fill_color:"#f1f1f1",item_background_fill_alpha:.8,inactive_fill_color:"white",inactive_fill_alpha:.7,label_text_font_size:"13px",label_text_baseline:"middle",title_text_font_size:"13px",title_text_font_style:"italic"})}, +function _(t,e,i,n,s){var o;n();const l=t(1),r=t(73),a=t(254),c=t(19),h=l.__importStar(t(78)),_=t(15),d=t(144),u=t(57),b=t(10),g=t(33),p=t(8),m=t(151),f=t(229),{max:x,ceil:w}=Math;class y extends f.ContentLayoutable{constructor(t){super(),this.text=t}_content_size(){return new f.Sizeable(this.text.size())}}y.__name__="TextLayout";class v extends f.ContentLayoutable{constructor(t,e,i,n){super(),this.item=t,this.label=e,this.text=i,this.settings=n}get field(){return this.item.get_field_from_label_prop()}_content_size(){const t=this.text.size(),{glyph_width:e,glyph_height:i,label_standoff:n,label_width:s,label_height:o}=this.settings,l=e+n+x(t.width,s),r=x(i,t.height,o);return new f.Sizeable({width:l,height:r})}}v.__name__="LegendEntry";class k extends r.AnnotationView{constructor(){super(...arguments),this.bbox=new u.BBox}_get_size(){const{width:t,height:e}=this.bbox,{margin:i}=this.model;return{width:t+2*i,height:e+2*i}}update_layout(){this.update_geometry();const{panel:t}=this;this.layout=null!=t?new d.SideLayout(t,(()=>this.get_size())):void 0}connect_signals(){super.connect_signals();const t=()=>this.request_render();this.connect(this.model.change,t),this.connect(this.model.item_change,t)}get padding(){return null!=this.model.border_line_color?this.model.padding:0}update_geometry(){super.update_geometry();const{spacing:t,orientation:e}=this.model,i="vertical"==e,{padding:n}=this,s=n,o=n,{title:l}=this.model,r=new m.TextBox({text:null!=l?l:""});r.position={sx:0,sy:0,x_anchor:"left",y_anchor:"top"},r.visuals=this.visuals.title_text.values();const a=new d.Panel(this.model.title_location);r.angle=a.get_label_angle_heuristic("parallel");const c=[];for(const t of this.model.items){t.legend=this.model;const e=t.get_labels_list_from_label_prop();for(const i of e){const e=new m.TextBox({text:`${i}`});e.position={sx:0,sy:0,x_anchor:"left",y_anchor:"center"},e.visuals=this.visuals.label_text.values();const n=new v(t,i,e,this.model);n.set_sizing({visible:t.visible}),c.push({layout:n,row:0,col:0})}}const{ncols:h,nrows:_}=(()=>{let{ncols:t,nrows:e}=this.model;const n=c.length;return i?("auto"!=e||(e="auto"!=t?w(n/t):1/0),t=1/0):("auto"!=t||(t="auto"!=e?w(n/e):1/0),e=1/0),{ncols:t,nrows:e}})();let b=0,g=0;for(const t of c)t.row=b,t.col=g,i?(b+=1,b>=_&&(b=0,g+=1)):(g+=1,g>=h&&(g=0,b+=1));const p=new f.Grid(c);this.grid=p,p.spacing=t,p.set_sizing();const x=new y(r);this.title_panel=x;const k=""!=r.text&&this.visuals.title_text.doit;x.set_sizing({visible:k});const z=(()=>{if(!k)return new f.Column([p]);switch(this.model.title_location){case"above":return new f.Column([x,p]);case"below":return new f.Column([p,x]);case"left":return new f.Row([x,p]);case"right":return new f.Row([p,x])}})();this.border_box=z,z.position={left:s,top:o},z.spacing=this.model.title_standoff,z.set_sizing(),z.compute();const L=n+z.bbox.width+n,B=n+z.bbox.height+n;this.bbox=new u.BBox({left:0,top:0,width:L,height:B})}compute_geometry(){super.compute_geometry();const{margin:t,location:e}=this.model,{width:i,height:n}=this.bbox,s=null!=this.layout?this.layout:this.plot_view.frame,[o,l]=s.bbox.ranges;let r,a;if((0,p.isString)(e))switch(e){case"top_left":r=o.start+t,a=l.start+t;break;case"top":case"top_center":r=(o.end+o.start)/2-i/2,a=l.start+t;break;case"top_right":r=o.end-t-i,a=l.start+t;break;case"bottom_right":r=o.end-t-i,a=l.end-t-n;break;case"bottom":case"bottom_center":r=(o.end+o.start)/2-i/2,a=l.end-t-n;break;case"bottom_left":r=o.start+t,a=l.end-t-n;break;case"left":case"center_left":r=o.start+t,a=(l.end+l.start)/2-n/2;break;case"center":case"center_center":r=(o.end+o.start)/2-i/2,a=(l.end+l.start)/2-n/2;break;case"right":case"center_right":r=o.end-t-i,a=(l.end+l.start)/2-n/2}else{const[t,i]=e;r=s.bbox.xview.compute(t),a=s.bbox.yview.compute(i)-n}this.bbox=new u.BBox({left:r,top:a,width:i,height:n})}interactive_hit(t,e){return this.bbox.contains(t,e)}_hit_test(t,e){const{left:i,top:n}=this.bbox;t-=i+this.grid.bbox.left,e-=n+this.grid.bbox.top;for(const i of this.grid)if(i.bbox.contains(t,e))return{type:"entry",entry:i};return null}cursor(t,e){return"none"==this.model.click_policy?null:null!=this._hit_test(t,e)?"pointer":null}on_hit(t,e){const i=(()=>{switch(this.model.click_policy){case"hide":return t=>t.visible=!t.visible;case"mute":return t=>t.muted=!t.muted;case"none":return t=>{}}})(),n=this._hit_test(t,e);if(null!=n){const{renderers:t}=n.entry.item;for(const e of t)i(e);return!0}return!1}_render(){if(this.update_geometry(),this.compute_geometry(),0==this.model.items.length)return;if(!(0,b.some)(this.model.items,(t=>t.visible)))return;const{ctx:t}=this.layer;t.save(),this._draw_legend_box(t),this._draw_legend_items(t),this._draw_title(t),t.restore()}_draw_legend_box(t){const{x:e,y:i,width:n,height:s}=this.bbox;t.beginPath(),t.rect(e,i,n,s),this.visuals.background_fill.apply(t),this.visuals.border_line.apply(t)}_draw_title(t){const{title:e}=this.model;if(null==e||0==e.length||!this.visuals.title_text.doit)return;const{left:i,top:n}=this.bbox;switch(t.save(),t.translate(i,n),t.translate(this.title_panel.bbox.left,this.title_panel.bbox.top),this.model.title_location){case"left":t.translate(0,this.title_panel.bbox.height);break;case"right":t.translate(this.title_panel.bbox.width,0)}this.title_panel.text.paint(t),t.restore()}_draw_legend_items(t){const e=(()=>{switch(this.model.click_policy){case"none":return t=>!0;case"hide":return t=>(0,b.every)(t.renderers,(t=>t.visible));case"mute":return t=>(0,b.every)(t.renderers,(t=>!t.muted))}})(),i=(t,e,i)=>{if(!this.visuals.item_background_fill.doit)return!1;switch(this.model.item_background_policy){case"every":return!0;case"even":return e%2==0==(i%2==0);case"odd":return e%2==0!=(i%2==0);case"none":return!1}},{left:n,top:s}=this.bbox;t.translate(n,s),t.translate(this.grid.bbox.left,this.grid.bbox.top);for(const[{layout:n,row:s,col:o},l]of(0,g.enumerate)(this.grid.items)){const{bbox:l,text:r,item:a,label:c,field:h,settings:_}=n,{glyph_width:d,glyph_height:u,label_standoff:b}=_,{left:g,top:p,width:m,height:f}=l;t.translate(g,p),i(0,s,o)&&(t.beginPath(),t.rect(0,0,m,f),this.visuals.item_background_fill.apply(t));const x=f/2,w=0,y=x-u/2,v=w+d,k=y+u;for(const e of a.renderers){const i=this.plot_view.renderer_view(e);null==i||i.draw_legend(t,w,v,y,k,h,c,a.index)}t.translate(v+b,x),r.paint(t),t.translate(-v-b,-x),e(a)||(t.beginPath(),t.rect(0,0,m,f),this.visuals.inactive_fill.set_value(t),t.fill()),t.translate(-g,-p)}t.translate(-this.grid.bbox.left,-this.grid.bbox.top),t.translate(-n,-s)}}i.LegendView=k,k.__name__="LegendView";class z extends r.Annotation{constructor(t){super(t)}initialize(){super.initialize(),this.item_change=new _.Signal0(this,"item_change")}}i.Legend=z,o=z,z.__name__="Legend",o.prototype.default_view=k,o.mixins([["label_",h.Text],["title_",h.Text],["inactive_",h.Fill],["border_",h.Line],["background_",h.Fill],["item_background_",h.Fill]]),o.define((({Number:t,Int:e,String:i,Array:n,Tuple:s,Or:o,Ref:l,Nullable:r,Positive:h,Auto:_})=>({orientation:[c.Orientation,"vertical"],ncols:[o(h(e),_),"auto"],nrows:[o(h(e),_),"auto"],location:[o(c.LegendLocation,s(t,t)),"top_right"],title:[r(i),null],title_location:[c.Location,"above"],title_standoff:[t,5],label_standoff:[t,5],glyph_height:[t,20],glyph_width:[t,20],label_height:[t,20],label_width:[t,20],margin:[t,10],padding:[t,10],spacing:[t,3],items:[n(l(a.LegendItem)),[]],click_policy:[c.LegendClickPolicy,"none"],item_background_policy:[c.AlternationPolicy,"none"]}))),o.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,item_background_fill_color:"#f1f1f1",item_background_fill_alpha:.8,inactive_fill_color:"white",inactive_fill_alpha:.7,label_text_font_size:"13px",label_text_baseline:"middle",title_text_font_size:"13px",title_text_font_style:"italic"})}, function _(e,r,n,l,t){var i;l();const s=e(1),o=e(50),_=e(199),a=e(99),u=e(27),d=s.__importStar(e(17)),c=e(18),h=e(10);class f extends o.Model{constructor(e){super(e)}_check_data_sources_on_renderers(){if(null!=this.get_field_from_label_prop()){if(this.renderers.length<1)return!1;const e=this.renderers[0].data_source;for(const r of this.renderers)if(r.data_source!=e)return!1}return!0}_check_field_label_on_data_source(){const e=this.get_field_from_label_prop();if(null!=e){if(this.renderers.length<1)return!1;const r=this.renderers[0].data_source;if(!(0,h.includes)(r.columns(),e))return!1}return!0}initialize(){super.initialize(),this.legend=null,this.connect(this.change,(()=>{var e;return null===(e=this.legend)||void 0===e?void 0:e.item_change.emit()}));this._check_data_sources_on_renderers()||c.logger.error("Non matching data sources on legend item renderers");this._check_field_label_on_data_source()||c.logger.error(`Bad column name on label: ${this.label}`)}get_field_from_label_prop(){const{label:e}=this;return(0,u.isField)(e)?e.field:null}get_labels_list_from_label_prop(){if(!this.visible)return[];const{index:e}=this;if(null!=e&&this.renderers.every((r=>!(e in r.view.indices_map))))return[];if((0,u.isValue)(this.label)){const{value:e}=this.label;return null!=e?[e]:[]}const r=this.get_field_from_label_prop();if(null!=r){let e;if(0==this.renderers.length)return["No source found"];if(e=this.renderers[0].data_source,e instanceof a.ColumnarDataSource){const n=e.get_column(r);return null!=n?(0,h.uniq)(Array.from(n)):["Invalid field"]}}return[]}}n.LegendItem=f,i=f,f.__name__="LegendItem",i.define((({Boolean:e,Int:r,Array:n,Ref:l,Nullable:t})=>({label:[d.NullStringSpec,null],renderers:[n(l(_.GlyphRenderer)),[]],index:[t(r),null],visible:[e,!0]})))}, function _(t,e,s,n,i){var o,a;n();const r=t(1),l=t(73),h=t(93),_=r.__importStar(t(78)),c=t(19),d=t(210),u=t(15),y=t(57),p=t(13),v=t(12);class x{constructor(t=[],e=[]){this.xs=t,this.ys=e,(0,v.assert)(t.length==e.length)}clone(){return new x(this.xs.slice(),this.ys.slice())}[Symbol.iterator](){return this.nodes()}*nodes(){const{xs:t,ys:e,n:s}=this;for(let n=0;n=3){const n={x:t[s-1],y:e[s-1]},i={x:t[0],y:e[0]};yield[n,i,s-1]}}contains(t,e){return(0,d.point_in_poly)(t,e,this.xs,this.ys)}get bbox(){const[t,e]=(0,p.minmax)(this.xs),[s,n]=(0,p.minmax)(this.ys);return new y.BBox({x0:t,x1:e,y0:s,y1:n})}get n(){return this.xs.length}translate(t,e,...s){const n=this.clone(),{xs:i,ys:o,n:a}=n;if(0!=s.length)for(const n of s){const s=n%a;i[s]+=t,o[s]+=e}else for(let s=0;sthis.request_render()))}bounds(){const{xs_units:t,ys_units:e}=this.model;if("data"==t&&"data"==e){const{xs:t,ys:e}=this.model,[s,n]=(0,p.minmax)(t),[i,o]=(0,p.minmax)(e);return{x0:s,x1:n,y0:i,y1:o}}return(0,y.empty)()}log_bounds(){return(0,y.empty)()}_mappers(){const t=(t,e,s,n)=>{switch(t){case"canvas":return n;case"screen":return s;case"data":return e}},e=this.model,{frame:s,canvas:n}=this.plot_view,{x_scale:i,y_scale:o}=s,{x_view:a,y_view:r}=s.bbox,{x_screen:l,y_screen:h}=n.bbox;return{x:t(e.xs_units,i,a,l),y:t(e.ys_units,o,r,h)}}_render(){const{xs:t,ys:e}=this.model;(0,v.assert)(t.length==e.length),this.poly=(()=>{const{x:s,y:n}=this._mappers();return new x(s.v_compute(t),n.v_compute(e))})();const{ctx:s}=this.layer;s.beginPath();for(const[t,e]of this.poly)s.lineTo(t,e);const{_is_hovered:n,visuals:i}=this,o=n&&i.hover_fill.doit?i.hover_fill:i.fill,a=n&&i.hover_hatch.doit?i.hover_hatch:i.hatch,r=n&&i.hover_line.doit?i.hover_line:i.line;this.poly.n>=3&&(s.closePath(),o.apply(s),a.apply(s)),r.apply(s)}interactive_hit(t,e){return!(!this.model.visible||!this.model.editable)&&this.poly.contains(t,e)}_hit_test(t,e){const{abs:s}=Math,n=Math.max(2.5,this.model.line_width/2);for(const[i,o,a]of this.poly)if(s(i-t){const{poly:e,target:s}=this._pan_state,{dx:n,dy:i}=t;switch(s.type){case"node":{const{i:t}=s;return e.translate(n,i,t)}case"edge":{const{i:t}=s;return e.translate(n,i,t,t+1)}case"area":return e.translate(n,i)}})(),{x:s,y:n}=this._mappers(),i=s.v_invert(e.xs),o=n.v_invert(e.ys);this.model.update({xs:i,ys:o}),this.model.pan.emit(["pan",t.modifiers])}_pan_end(t){this._pan_state=null,this.model.pan.emit(["pan:end",t.modifiers])}get _has_hover(){const{hover_line:t,hover_fill:e,hover_hatch:s}=this.visuals;return t.doit||e.doit||s.doit}_move_start(t){const{_has_hover:e}=this;return e&&(this._is_hovered=!0,this.request_paint()),e}_move(t){}_move_end(t){this._has_hover&&(this._is_hovered=!1,this.request_paint())}cursor(t,e){var s,n;const i=null!==(n=null===(s=this._pan_state)||void 0===s?void 0:s.target)&&void 0!==n?n:this._hit_test(t,e);if(null==i||!this._can_hit(i))return null;switch(i.type){case"node":case"edge":case"area":return"move"}}}s.PolyAnnotationView=m,o=h.auto_ranged,m.__name__="PolyAnnotationView";class f extends l.Annotation{constructor(t){super(t),this.pan=new u.Signal(this,"pan")}update({xs:t,ys:e}){this.setv({xs:t.slice(),ys:e.slice(),visible:!0})}clear(){this.setv({xs:[],ys:[],visible:!1})}}s.PolyAnnotation=f,a=f,f.__name__="PolyAnnotation",a.prototype.default_view=m,a.mixins([_.Line,_.Fill,_.Hatch,["hover_",_.Line],["hover_",_.Fill],["hover_",_.Hatch]]),a.define((({Boolean:t,Number:e,Arrayable:s})=>({xs:[s(e),[]],ys:[s(e),[]],xs_units:[c.CoordinateUnits,"data"],ys_units:[c.CoordinateUnits,"data"],editable:[t,!1]}))),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3,hover_fill_color:null,hover_fill_alpha:.4,hover_line_color:null,hover_line_alpha:.3})}, function _(e,l,o,i,t){var n;i();const s=e(1),a=e(73),_=s.__importStar(e(78));class c extends a.AnnotationView{connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_render(){const{gradient:e,y_intercept:l}=this.model;if(null==e||null==l)return;const{frame:o}=this.plot_view,i=this.coordinates.x_scale,t=this.coordinates.y_scale,[n,s,a,_]=(()=>{if(0==e){const e=t.compute(l),i=e;return[o.bbox.left,o.bbox.right,e,i]}{const n=o.bbox.top,s=o.bbox.bottom,a=t.invert(n),_=t.invert(s),c=(a-l)/e,r=(_-l)/e,h=i.compute(c),b=i.compute(r);return h<=b?[h,b,n,s]:[b,h,s,n]}})(),{ctx:c}=this.layer;if(c.save(),this.visuals.above_fill.doit||this.visuals.above_hatch.doit){const{left:e,right:l,top:i,bottom:t}=o.bbox;c.beginPath(),c.moveTo(n,a),c.lineTo(n,a),c.lineTo(s,_),c.lineTo(s,_),a<=_?(se&&c.lineTo(e,t)),c.closePath(),this.visuals.above_fill.apply(c),this.visuals.above_hatch.apply(c)}if(this.visuals.below_fill.doit||this.visuals.below_hatch.doit){const{left:e,right:l,top:i,bottom:t}=o.bbox;c.beginPath(),c.moveTo(n,a),c.lineTo(n,a),c.lineTo(s,_),a<=_?(c.lineTo(l,t),c.lineTo(e,t),n>e&&c.lineTo(e,i)):(s({gradient:[l(e),null],y_intercept:[l(e),null]}))),n.override({line_color:"black",above_fill_color:null,above_fill_alpha:.4,below_fill_color:null,below_fill_alpha:.4})}, function _(t,e,i,n,s){var o;n();const a=t(1),r=t(73),l=a.__importStar(t(78)),h=t(19),_=t(210),c=t(15),d=t(12);class u{constructor(t,e){this.p0=t,this.p1=e}clone(){return new u(Object.assign({},this.p0),Object.assign({},this.p1))}hit_test(t,e=2.5){return(0,_.dist_to_segment)(t,this.p0,this.p1)this.plot_view.request_paint(this)))}_render(){const{location:t,location_units:e}=this.model;if(null==t)return;function i(t,e,i,n,s){switch(e){case"canvas":return s.compute(t);case"screen":return n.compute(t);case"data":return i.compute(t)}}const{frame:n,canvas:s}=this.plot_view,{x_scale:o,y_scale:a}=this.coordinates;let r,l,h,_;"width"==this.model.dimension?(h=i(t,e,a,n.bbox.yview,s.bbox.y_screen),l=n.bbox.left,_=n.bbox.width,r=this.model.line_width):(h=n.bbox.top,l=i(t,e,o,n.bbox.xview,s.bbox.y_screen),_=this.model.line_width,r=n.bbox.height);const c={x:l,y:h},d={x:l+_,y:h+r};this.line=new u(c,d);const{_is_hovered:p,visuals:m}=this,v=p&&m.hover_line.doit?m.hover_line:m.line,{ctx:b}=this.layer;b.save(),b.beginPath(),this.visuals.line.set_value(b),b.moveTo(l,h),"width"==this.model.dimension?b.lineTo(l+_,h):b.lineTo(l,h+r),v.apply(b),b.restore()}interactive_hit(t,e){return!(!this.model.visible||!this.model.editable)&&null!=this._hit_test(t,e)}_hit_test(t,e){const i=Math.max(2.5,this.model.line_width/2);return this.line.hit_test({x:t,y:e},i)?"edge":null}_can_hit(t){return!0}_pan_start(t){if(this.model.visible&&this.model.editable){const{sx:e,sy:i}=t,n=this._hit_test(e,i);if(null!=n&&this._can_hit(n))return this._pan_state={line:this.line.clone(),target:n},this.model.pan.emit(["pan:start",t.modifiers]),!0}return!1}_pan(t){function e(t,e,i,n,s){switch(e){case"canvas":return s.invert(t);case"screen":return n.invert(t);case"data":return i.invert(t)}}(0,d.assert)(null!=this._pan_state);const i=(()=>{const{dx:e,dy:i}=t,{line:n}=this._pan_state;return"width"==this.model.dimension?n.translate(0,i).p0.y:n.translate(e,0).p0.x})(),n=(()=>{const{location_units:t}=this.model,{frame:n,canvas:s}=this.plot_view,{x_scale:o,y_scale:a}=this.coordinates;return"width"==this.model.dimension?e(i,t,a,n.bbox.yview,s.bbox.y_screen):e(i,t,o,n.bbox.xview,s.bbox.y_screen)})();this.model.location=n,this.model.pan.emit(["pan",t.modifiers])}_pan_end(t){this._pan_state=null,this.model.pan.emit(["pan:end",t.modifiers])}get _has_hover(){const{hover_line:t}=this.visuals;return t.doit}_move_start(t){const{_has_hover:e}=this;return e&&(this._is_hovered=!0,this.request_paint()),e}_move(t){}_move_end(t){this._has_hover&&(this._is_hovered=!1,this.request_paint())}cursor(t,e){var i,n;const s=null!==(n=null===(i=this._pan_state)||void 0===i?void 0:i.target)&&void 0!==n?n:this._hit_test(t,e);return null!=s&&this._can_hit(s)?"width"==this.model.dimension?"ns-resize":"ew-resize":null}}i.SpanView=p,p.__name__="SpanView";class m extends r.Annotation{constructor(t){super(t),this.pan=new c.Signal(this,"pan")}}i.Span=m,o=m,m.__name__="Span",o.prototype.default_view=p,o.mixins([l.Line,["hover_",l.Line]]),o.define((({Boolean:t,Number:e,Nullable:i})=>({location:[i(e),null],location_units:[h.CoordinateUnits,"data"],dimension:[h.Dimension,"width"],editable:[t,!1]}))),o.override({line_color:"black",hover_line_color:null,hover_line_alpha:.3})}, function _(e,i,t,o,s){var l;o();const a=e(73),n=e(259),r=e(59),h=e(56),_=e(144),v=e(57);class b extends a.AnnotationView{constructor(){super(...arguments),this.el=(0,h.div)(),this._previous_bbox=new v.BBox}update_layout(){this.layout=new _.SideLayout(this.panel,(()=>this.get_size()),!0)}has_finished(){return super.has_finished()&&this.toolbar_view.has_finished()}*children(){yield*super.children(),yield this.toolbar_view}async lazy_initialize(){await super.lazy_initialize(),this.toolbar_view=await(0,r.build_view)(this.model.toolbar,{parent:this.canvas})}connect_signals(){super.connect_signals(),this.plot_view.mouseenter.connect((()=>{this.toolbar_view.set_visibility(!0)})),this.plot_view.mouseleave.connect((()=>{this.toolbar_view.set_visibility(!1)}))}remove(){this.toolbar_view.remove(),(0,h.remove)(this.el),super.remove()}_render(){(0,h.display)(this.el);const{bbox:e}=this.layout;if(!this._previous_bbox.equals(e)){(0,h.position)(this.el,e),this._previous_bbox=e,(0,h.empty)(this.el),this.el.style.position="absolute";const{style:i}=this.toolbar_view.el;this.toolbar_view.model.horizontal?(i.width="100%",i.height="unset"):(i.width="unset",i.height="100%"),this.toolbar_view.render(),this.plot_view.canvas_view.add_event(this.el),this.el.appendChild(this.toolbar_view.el),this.toolbar_view.after_render()}this.model.visible||(0,h.undisplay)(this.el)}_get_size(){const{tools:e,logo:i}=this.model.toolbar;return{width:30*e.length+(null!=i?25:0)+15,height:30}}}t.ToolbarPanelView=b,b.__name__="ToolbarPanelView";class d extends a.Annotation{constructor(e){super(e)}}t.ToolbarPanel=d,l=d,d.__name__="ToolbarPanel",l.prototype.default_view=b,l.define((({Ref:e})=>({toolbar:[e(n.Toolbar)]})))}, -function _(t,e,o,s,i){var l;s();const n=t(1),a=t(18),r=t(56),c=t(59),h=t(260),_=t(19),u=t(10),v=t(32),p=t(9),d=t(8),f=t(267),g=t(268),b=t(269),m=t(274),w=t(276),T=t(277),y=t(279),z=t(270),x=n.__importStar(t(280)),C=x,I=n.__importStar(t(281)),A=I,L=n.__importDefault(t(272));class P extends h.UIElementView{constructor(){super(...arguments),this._tool_button_views=new Map,this._items=[],this._visible=null}get tool_buttons(){return this._tool_buttons.flat()}get overflow_el(){return this._overflow_el}get visible(){var t;return!!this.model.visible&&(!this.model.autohide||null!==(t=this._visible)&&void 0!==t&&t)}*children(){yield*super.children(),yield*this._tool_button_views.values()}has_finished(){if(!super.has_finished())return!1;for(const t of this._tool_button_views.values())if(!t.has_finished())return!1;return!0}initialize(){super.initialize();const{location:t}=this.model,e="left"==t||"above"==t,o=this.model.horizontal?"vertical":"horizontal";this._overflow_menu=new z.ContextMenu([],{target:this.root.el,orientation:o,reversed:e,prevent_hide:t=>t.composedPath().includes(this._overflow_el)})}async lazy_initialize(){await super.lazy_initialize(),await this._build_tool_button_views()}connect_signals(){super.connect_signals();const{buttons:t,tools:e}=this.model.properties;this.on_change([t,e],(async()=>{await this._build_tool_button_views(),this.render()})),this.connect(this.model.properties.autohide.change,(()=>{this._on_visible_change()}))}stylesheets(){return[...super.stylesheets(),x.default,I.default,L.default]}remove(){(0,c.remove_views)(this._tool_button_views),super.remove()}async _build_tool_button_views(){this._tool_buttons=(()=>{const{buttons:t}=this.model;if("auto"==t){return[...(0,p.values)(this.model.gestures).map((t=>t.tools)),this.model.actions,this.model.inspectors.filter((t=>t.toggleable)),this.model.auxiliaries].map((t=>t.map((t=>t.tool_button()))))}return(0,u.split)(t,null)})(),await(0,c.build_views)(this._tool_button_views,this._tool_buttons.flat(),{parent:this})}set_visibility(t){t!=this._visible&&(this._visible=t,this._on_visible_change())}_on_visible_change(){this.el.classList.toggle(C.hidden,!this.visible)}_after_resize(){super._after_resize(),this._after_render()}render(){super.render(),this.el.classList.add(C[this.model.location]),this.el.classList.toggle(C.inner,this.model.inner),this._on_visible_change();const{horizontal:t}=this.model;this._overflow_el=(0,r.div)({class:C.tool_overflow,tabIndex:0},t?"\u22ee":"\u22ef");const e=()=>{const t=(()=>{switch(this.model.location){case"right":return{left_of:this._overflow_el};case"left":return{right_of:this._overflow_el};case"above":return{below:this._overflow_el};case"below":return{above:this._overflow_el}}})();this._overflow_menu.toggle(t)};if(this._overflow_el.addEventListener("click",(()=>{e()})),this._overflow_el.addEventListener("keydown",(t=>{"Enter"==t.key&&e()})),this._items=[],null!=this.model.logo){const t="grey"===this.model.logo?A.grey:null,e=(0,r.a)({href:"https://bokeh.org/",target:"_blank",class:[A.logo,A.logo_small,t]});this._items.push(e),this.shadow_el.appendChild(e)}for(const[,t]of this._tool_button_views)t.render(),t.after_render();const o=this._tool_buttons.map((t=>t.map((t=>this._tool_button_views.get(t).el)))).filter((t=>0!=t.length)),s=()=>(0,r.div)({class:C.divider});for(const t of(0,v.join)(o,s))this._items.push(t),this.shadow_el.appendChild(t)}_after_render(){super._after_render(),(0,u.clear)(this._overflow_menu.items),this.shadow_el.contains(this._overflow_el)&&this.shadow_el.removeChild(this._overflow_el);for(const t of this._items)this.shadow_el.contains(t)||this.shadow_el.append(t);const{horizontal:t}=this.model,{bbox:e}=this,o=t?C.right:C.above;let s=0,i=!1;for(const l of this._items)if(i)this.shadow_el.removeChild(l),this._overflow_menu.items.push({content:l,class:o});else{const{width:n,height:a}=l.getBoundingClientRect();s+=t?n:a,i=t?s>e.width-15:s>e.height-15,i&&(this.shadow_el.removeChild(l),this.shadow_el.appendChild(this._overflow_el),this._overflow_menu.items.push({content:l,class:o}))}}}function S(){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},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}o.ToolbarView=P,P.__name__="ToolbarView",o.Drag=f.Tool,o.Inspection=f.Tool,o.Scroll=f.Tool,o.Tap=f.Tool;class k extends h.UIElement{constructor(t){super(t)}get horizontal(){return"above"==this.location||"below"==this.location}get vertical(){return"left"==this.location||"right"==this.location}connect_signals(){super.connect_signals();const{tools:t,active_drag:e,active_inspect:o,active_scroll:s,active_tap:i,active_multi:l}=this.properties;this.on_change([t,e,o,s,i,l],(()=>{this._init_tools(),this._activate_tools()}))}initialize(){super.initialize(),this._init_tools(),this._activate_tools()}_init_tools(){const t=new Set;function e(e,o){const s=(e instanceof g.ToolProxy?e.underlying:e)instanceof o;return s&&t.add(e),s}const o=this.tools.filter((t=>e(t,w.InspectTool)));this.inspectors=o;const s=this.tools.filter((t=>e(t,y.HelpTool)));this.help=s;const i=this.tools.filter((t=>e(t,T.ActionTool)));this.actions=i;const l={pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}};for(const t of this.tools)e(t,m.GestureTool)&&l[t.event_role].tools.push(t);for(const t of(0,p.fields)(l)){const e=this.gestures[t];e.tools=(0,u.sort_by)(l[t].tools,(t=>t.default_order)),null!=e.active&&(0,u.every)(e.tools,(t=>{var o;return t.id!=(null===(o=e.active)||void 0===o?void 0:o.id)}))&&(e.active=null)}const n=this.tools.filter((e=>!t.has(e)));this.auxiliaries=n}_activate_tools(){if("auto"==this.active_inspect);else if(null==this.active_inspect)for(const t of this.inspectors)t.active=!1;else if((0,d.isArray)(this.active_inspect)){const t=(0,u.intersection)(this.active_inspect,this.inspectors);t.length!=this.active_inspect.length&&(this.active_inspect=t);for(const t of this.inspectors)(0,u.includes)(this.active_inspect,t)||(t.active=!1)}else{let t=!1;for(const e of this.inspectors)e!=this.active_inspect?e.active=!1:t=!0;t||(this.active_inspect=null)}const t=t=>{t.active?this._active_change(t):t.active=!0};for(const t of(0,p.values)(this.gestures))for(const e of t.tools)this.connect(e.properties.active.change,(()=>this._active_change(e)));function e(t){switch(t){case"tap":return"active_tap";case"pan":return"active_drag";case"pinch":case"scroll":return"active_scroll";case"multi":return"active_multi";default:return null}}function o(t){return"tap"==t||"pan"==t}for(const[s,i]of(0,p.entries)(this.gestures)){const l=s,n=e(l);if(null!=n){const e=this[n];if("auto"==e)0!=i.tools.length&&o(l)&&t(i.tools[0]);else if(null!=e)(0,u.includes)(this.tools,e)?t(e):this[n]=null;else{this.gestures[l].active=null;for(const t of this.gestures[l].tools)t.active=!1}}}}_active_change(t){const{event_types:e}=t;for(const o of e)if(t.active){const e=this.gestures[o].active;null!=e&&t!=e&&(a.logger.debug(`Toolbar: deactivating tool: ${e} for event type '${o}'`),e.active=!1),this.gestures[o].active=t,a.logger.debug(`Toolbar: activating tool: ${t} for event type '${o}'`)}else this.gestures[o].active=null}}o.Toolbar=k,l=k,k.__name__="Toolbar",l.prototype.default_view=P,l.define((({Boolean:t,Array:e,Or:s,Ref:i,Nullable:l,Auto:n})=>({tools:[e(s(i(f.Tool),i(g.ToolProxy))),[]],logo:[l(_.Logo),"normal"],autohide:[t,!1],active_drag:[l(s(i(o.Drag),n)),"auto"],active_inspect:[l(s(i(o.Inspection),e(i(o.Inspection)),n)),"auto"],active_scroll:[l(s(i(o.Scroll),n)),"auto"],active_tap:[l(s(i(o.Tap),n)),"auto"],active_multi:[l(s(i(m.GestureTool),n)),"auto"]}))),l.internal((({Array:t,Boolean:e,Ref:o,Or:s,Struct:i,Nullable:l,Null:n,Auto:a})=>{const r=i({tools:t(o(m.GestureTool)),active:l(o(m.GestureTool))}),c=i({pan:r,scroll:r,pinch:r,tap:r,doubletap:r,press:r,pressup:r,rotate:r,move:r,multi:r});return{buttons:[s(t(s(o(b.ToolButton),n)),a),"auto"],location:[_.Location,"right"],inner:[e,!1],gestures:[c,S],actions:[t(s(o(T.ActionTool),o(g.ToolProxy))),[]],inspectors:[t(s(o(w.InspectTool),o(g.ToolProxy))),[]],auxiliaries:[t(s(o(f.Tool),o(g.ToolProxy))),[]],help:[t(s(o(y.HelpTool),o(g.ToolProxy))),[]]}}))}, +function _(t,e,o,s,i){var l;s();const n=t(1),a=t(18),r=t(56),c=t(59),h=t(260),_=t(19),u=t(10),v=t(33),p=t(9),d=t(8),f=t(267),g=t(268),b=t(269),m=t(274),w=t(276),T=t(277),y=t(279),z=t(270),x=n.__importStar(t(280)),C=x,I=n.__importStar(t(281)),A=I,L=n.__importDefault(t(272));class P extends h.UIElementView{constructor(){super(...arguments),this._tool_button_views=new Map,this._items=[],this._visible=null}get tool_buttons(){return this._tool_buttons.flat()}get overflow_el(){return this._overflow_el}get visible(){var t;return!!this.model.visible&&(!this.model.autohide||null!==(t=this._visible)&&void 0!==t&&t)}*children(){yield*super.children(),yield*this._tool_button_views.values()}has_finished(){if(!super.has_finished())return!1;for(const t of this._tool_button_views.values())if(!t.has_finished())return!1;return!0}initialize(){super.initialize();const{location:t}=this.model,e="left"==t||"above"==t,o=this.model.horizontal?"vertical":"horizontal";this._overflow_menu=new z.ContextMenu([],{target:this.root.el,orientation:o,reversed:e,prevent_hide:t=>t.composedPath().includes(this._overflow_el)})}async lazy_initialize(){await super.lazy_initialize(),await this._build_tool_button_views()}connect_signals(){super.connect_signals();const{buttons:t,tools:e}=this.model.properties;this.on_change([t,e],(async()=>{await this._build_tool_button_views(),this.render()})),this.connect(this.model.properties.autohide.change,(()=>{this._on_visible_change()}))}stylesheets(){return[...super.stylesheets(),x.default,I.default,L.default]}remove(){(0,c.remove_views)(this._tool_button_views),super.remove()}async _build_tool_button_views(){this._tool_buttons=(()=>{const{buttons:t}=this.model;if("auto"==t){return[...(0,p.values)(this.model.gestures).map((t=>t.tools)),this.model.actions,this.model.inspectors.filter((t=>t.toggleable)),this.model.auxiliaries].map((t=>t.map((t=>t.tool_button()))))}return(0,u.split)(t,null)})(),await(0,c.build_views)(this._tool_button_views,this._tool_buttons.flat(),{parent:this})}set_visibility(t){t!=this._visible&&(this._visible=t,this._on_visible_change())}_on_visible_change(){this.el.classList.toggle(C.hidden,!this.visible)}_after_resize(){super._after_resize(),this._after_render()}render(){super.render(),this.el.classList.add(C[this.model.location]),this.el.classList.toggle(C.inner,this.model.inner),this._on_visible_change();const{horizontal:t}=this.model;this._overflow_el=(0,r.div)({class:C.tool_overflow,tabIndex:0},t?"\u22ee":"\u22ef");const e=()=>{const t=(()=>{switch(this.model.location){case"right":return{left_of:this._overflow_el};case"left":return{right_of:this._overflow_el};case"above":return{below:this._overflow_el};case"below":return{above:this._overflow_el}}})();this._overflow_menu.toggle(t)};if(this._overflow_el.addEventListener("click",(()=>{e()})),this._overflow_el.addEventListener("keydown",(t=>{"Enter"==t.key&&e()})),this._items=[],null!=this.model.logo){const t="grey"===this.model.logo?A.grey:null,e=(0,r.a)({href:"https://bokeh.org/",target:"_blank",class:[A.logo,A.logo_small,t]});this._items.push(e),this.shadow_el.appendChild(e)}for(const[,t]of this._tool_button_views)t.render(),t.after_render();const o=this._tool_buttons.map((t=>t.map((t=>this._tool_button_views.get(t).el)))).filter((t=>0!=t.length)),s=()=>(0,r.div)({class:C.divider});for(const t of(0,v.join)(o,s))this._items.push(t),this.shadow_el.appendChild(t)}_after_render(){super._after_render(),(0,u.clear)(this._overflow_menu.items),this.shadow_el.contains(this._overflow_el)&&this.shadow_el.removeChild(this._overflow_el);for(const t of this._items)this.shadow_el.contains(t)||this.shadow_el.append(t);const{horizontal:t}=this.model,{bbox:e}=this,o=t?C.right:C.above;let s=0,i=!1;for(const l of this._items)if(i)this.shadow_el.removeChild(l),this._overflow_menu.items.push({content:l,class:o});else{const{width:n,height:a}=l.getBoundingClientRect();s+=t?n:a,i=t?s>e.width-15:s>e.height-15,i&&(this.shadow_el.removeChild(l),this.shadow_el.appendChild(this._overflow_el),this._overflow_menu.items.push({content:l,class:o}))}}}function S(){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},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}o.ToolbarView=P,P.__name__="ToolbarView",o.Drag=f.Tool,o.Inspection=f.Tool,o.Scroll=f.Tool,o.Tap=f.Tool;class k extends h.UIElement{constructor(t){super(t)}get horizontal(){return"above"==this.location||"below"==this.location}get vertical(){return"left"==this.location||"right"==this.location}connect_signals(){super.connect_signals();const{tools:t,active_drag:e,active_inspect:o,active_scroll:s,active_tap:i,active_multi:l}=this.properties;this.on_change([t,e,o,s,i,l],(()=>{this._init_tools(),this._activate_tools()}))}initialize(){super.initialize(),this._init_tools(),this._activate_tools()}_init_tools(){const t=new Set;function e(e,o){const s=(e instanceof g.ToolProxy?e.underlying:e)instanceof o;return s&&t.add(e),s}const o=this.tools.filter((t=>e(t,w.InspectTool)));this.inspectors=o;const s=this.tools.filter((t=>e(t,y.HelpTool)));this.help=s;const i=this.tools.filter((t=>e(t,T.ActionTool)));this.actions=i;const l={pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}};for(const t of this.tools)e(t,m.GestureTool)&&l[t.event_role].tools.push(t);for(const t of(0,p.fields)(l)){const e=this.gestures[t];e.tools=(0,u.sort_by)(l[t].tools,(t=>t.default_order)),null!=e.active&&(0,u.every)(e.tools,(t=>{var o;return t.id!=(null===(o=e.active)||void 0===o?void 0:o.id)}))&&(e.active=null)}const n=this.tools.filter((e=>!t.has(e)));this.auxiliaries=n}_activate_tools(){if("auto"==this.active_inspect);else if(null==this.active_inspect)for(const t of this.inspectors)t.active=!1;else if((0,d.isArray)(this.active_inspect)){const t=(0,u.intersection)(this.active_inspect,this.inspectors);t.length!=this.active_inspect.length&&(this.active_inspect=t);for(const t of this.inspectors)(0,u.includes)(this.active_inspect,t)||(t.active=!1)}else{let t=!1;for(const e of this.inspectors)e!=this.active_inspect?e.active=!1:t=!0;t||(this.active_inspect=null)}const t=t=>{t.active?this._active_change(t):t.active=!0};for(const t of(0,p.values)(this.gestures))for(const e of t.tools)this.connect(e.properties.active.change,(()=>this._active_change(e)));function e(t){switch(t){case"tap":return"active_tap";case"pan":return"active_drag";case"pinch":case"scroll":return"active_scroll";case"multi":return"active_multi";default:return null}}function o(t){return"tap"==t||"pan"==t}for(const[s,i]of(0,p.entries)(this.gestures)){const l=s,n=e(l);if(null!=n){const e=this[n];if("auto"==e)0!=i.tools.length&&o(l)&&t(i.tools[0]);else if(null!=e)(0,u.includes)(this.tools,e)?t(e):this[n]=null;else{this.gestures[l].active=null;for(const t of this.gestures[l].tools)t.active=!1}}}}_active_change(t){const{event_types:e}=t;for(const o of e)if(t.active){const e=this.gestures[o].active;null!=e&&t!=e&&(a.logger.debug(`Toolbar: deactivating tool: ${e} for event type '${o}'`),e.active=!1),this.gestures[o].active=t,a.logger.debug(`Toolbar: activating tool: ${t} for event type '${o}'`)}else this.gestures[o].active=null}}o.Toolbar=k,l=k,k.__name__="Toolbar",l.prototype.default_view=P,l.define((({Boolean:t,Array:e,Or:s,Ref:i,Nullable:l,Auto:n})=>({tools:[e(s(i(f.Tool),i(g.ToolProxy))),[]],logo:[l(_.Logo),"normal"],autohide:[t,!1],active_drag:[l(s(i(o.Drag),n)),"auto"],active_inspect:[l(s(i(o.Inspection),e(i(o.Inspection)),n)),"auto"],active_scroll:[l(s(i(o.Scroll),n)),"auto"],active_tap:[l(s(i(o.Tap),n)),"auto"],active_multi:[l(s(i(m.GestureTool),n)),"auto"]}))),l.internal((({Array:t,Boolean:e,Ref:o,Or:s,Struct:i,Nullable:l,Null:n,Auto:a})=>{const r=i({tools:t(o(m.GestureTool)),active:l(o(m.GestureTool))}),c=i({pan:r,scroll:r,pinch:r,tap:r,doubletap:r,press:r,pressup:r,rotate:r,move:r,multi:r});return{buttons:[s(t(s(o(b.ToolButton),n)),a),"auto"],location:[_.Location,"right"],inner:[e,!1],gestures:[c,S],actions:[t(s(o(T.ActionTool),o(g.ToolProxy))),[]],inspectors:[t(s(o(w.InspectTool),o(g.ToolProxy))),[]],auxiliaries:[t(s(o(f.Tool),o(g.ToolProxy))),[]],help:[t(s(o(y.HelpTool),o(g.ToolProxy))),[]]}}))}, function _(e,t,s,i,l){var n;i();const r=e(1),o=e(50),_=e(261),h=e(262),a=e(18),p=e(55),d=e(56),y=e(263),c=e(9),u=e(57),b=e(8),f=r.__importDefault(e(266)),{round:g,floor:x}=Math;function*S(e){if(e instanceof _.Styles){const t=new Set((0,c.keys)(o.Model.prototype._props));for(const s of e)t.has(s.attr)||(yield[s.attr,s.get_value()])}else yield*(0,c.entries)(e)}class m extends p.DOMComponentView{constructor(){super(...arguments),this._display=new d.InlineStyleSheet,this.style=new d.InlineStyleSheet,this._bbox=new u.BBox,this._is_displayed=!1}*_css_classes(){yield*super._css_classes(),yield*this.model.css_classes}*_stylesheets(){yield*super._stylesheets(),yield this.style,yield this._display,yield*this._computed_stylesheets()}*_computed_stylesheets(){for(const e of this.model.stylesheets)if((0,b.isString)(e))yield new d.InlineStyleSheet(e);else if(e instanceof h.StyleSheet)yield e.underlying();else{const t=[];for(const[s,i]of(0,c.entries)(e)){t.push(`${s} {`);for(const[e,s]of S(i)){const i=e.replace(/_/g,"-");(0,b.isString)(s)&&0!=s.length&&t.push(` ${i}: ${s};`)}t.push("}")}const s=t.join("\n");yield new d.InlineStyleSheet(s)}}stylesheets(){return[...super.stylesheets(),f.default]}update_style(){this.style.clear()}box_sizing(){return{width_policy:"auto",height_policy:"auto",width:null,height:null,aspect_ratio:null}}get bbox(){return this._bbox}update_bbox(){return this._update_bbox()}_update_bbox(){const e=(()=>{if(this.el.isConnected){if(null!=this.el.offsetParent)return!0;{const{position:e,display:t}=getComputedStyle(this.el);return"fixed"==e&&"none"!=t}}return!1})(),t=e?(()=>{const e=this.el.getBoundingClientRect(),{left:t,top:s}=(()=>{if(null!=this.parent){const t=this.parent.el.getBoundingClientRect();return{left:e.left-t.left,top:e.top-t.top}}return{left:0,top:0}})();return new u.BBox({left:g(t),top:g(s),width:x(e.width),height:x(e.height)})})():new u.BBox,s=!this._bbox.equals(t);return this._bbox=t,this._is_displayed=e,s}initialize(){super.initialize(),this._resize_observer=new ResizeObserver((e=>this.after_resize())),this._resize_observer.observe(this.el,{box:"border-box"})}connect_signals(){super.connect_signals();const{visible:e,styles:t,css_classes:s,stylesheets:i}=this.model.properties;this.on_change(e,(()=>this._update_visible())),this.on_change(t,(()=>this._update_styles())),this.on_change(s,(()=>this._update_css_classes())),this.on_change(i,(()=>this._update_stylesheets()))}remove(){this._resize_observer.disconnect(),super.remove()}_after_resize(){}after_resize(){this.update_bbox()&&this._after_resize(),this.finish()}render_to(e){super.render_to(e),this.after_render()}render(){super.render(),this._apply_styles(),this._apply_visible()}_after_render(){}after_render(){this.update_style(),this.update_bbox(),this._after_render(),this.is_displayed||this.finish()}get is_displayed(){return this._is_displayed}_apply_visible(){this.model.visible?this._display.clear():this._display.replace(":host { display: none !important; }")}_apply_styles(){const{styles:e}=this.model,t=(e,t)=>{const s=e in this.el.style;return s&&(0,b.isString)(t)&&(this.el.style[e]=t),s};for(const[s,i]of S(e)){const e=s.replace(/_/g,"-");t(e,i)||t(`-webkit-${e}`,i)||t(`-moz-${e}`,i)||a.logger.trace(`unknown CSS property '${e}'`)}}_update_visible(){this._apply_visible()}_update_styles(){this.el.removeAttribute("style"),this._apply_styles()}export(e="auto",t=!0){const s="auto"==e||"png"==e?"canvas":"svg",i=new y.CanvasLayer(s,t),{width:l,height:n}=this.bbox;return i.resize(l,n),i}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.bbox})}}s.UIElementView=m,m.__name__="UIElementView";class v extends o.Model{constructor(e){super(e)}}s.UIElement=v,n=v,v.__name__="UIElement",n.define((({Boolean:e,Array:t,Dict:s,String:i,Ref:l,Or:n,Nullable:r})=>{const o=n(s(r(i)),l(_.Styles));return{visible:[e,!0],css_classes:[t(i),[]],styles:[o,{}],stylesheets:[t(n(l(h.StyleSheet),i,s(o))),[]]}}))}, function _(l,n,u,_,e){var t;_();const o=l(50);class r extends o.Model{constructor(l){super(l)}}u.Styles=r,t=r,r.__name__="Styles",t.define((({String:l,Nullable:n})=>({align_content:[n(l),null],align_items:[n(l),null],align_self:[n(l),null],alignment_baseline:[n(l),null],all:[n(l),null],animation:[n(l),null],animation_delay:[n(l),null],animation_direction:[n(l),null],animation_duration:[n(l),null],animation_fill_mode:[n(l),null],animation_iteration_count:[n(l),null],animation_name:[n(l),null],animation_play_state:[n(l),null],animation_timing_function:[n(l),null],aspect_ratio:[n(l),null],backface_visibility:[n(l),null],background:[n(l),null],background_attachment:[n(l),null],background_clip:[n(l),null],background_color:[n(l),null],background_image:[n(l),null],background_origin:[n(l),null],background_position:[n(l),null],background_position_x:[n(l),null],background_position_y:[n(l),null],background_repeat:[n(l),null],background_size:[n(l),null],baseline_shift:[n(l),null],block_size:[n(l),null],border:[n(l),null],border_block_end:[n(l),null],border_block_end_color:[n(l),null],border_block_end_style:[n(l),null],border_block_end_width:[n(l),null],border_block_start:[n(l),null],border_block_start_color:[n(l),null],border_block_start_style:[n(l),null],border_block_start_width:[n(l),null],border_bottom:[n(l),null],border_bottom_color:[n(l),null],border_bottom_left_radius:[n(l),null],border_bottom_right_radius:[n(l),null],border_bottom_style:[n(l),null],border_bottom_width:[n(l),null],border_collapse:[n(l),null],border_color:[n(l),null],border_image:[n(l),null],border_image_outset:[n(l),null],border_image_repeat:[n(l),null],border_image_slice:[n(l),null],border_image_source:[n(l),null],border_image_width:[n(l),null],border_inline_end:[n(l),null],border_inline_end_color:[n(l),null],border_inline_end_style:[n(l),null],border_inline_end_width:[n(l),null],border_inline_start:[n(l),null],border_inline_start_color:[n(l),null],border_inline_start_style:[n(l),null],border_inline_start_width:[n(l),null],border_left:[n(l),null],border_left_color:[n(l),null],border_left_style:[n(l),null],border_left_width:[n(l),null],border_radius:[n(l),null],border_right:[n(l),null],border_right_color:[n(l),null],border_right_style:[n(l),null],border_right_width:[n(l),null],border_spacing:[n(l),null],border_style:[n(l),null],border_top:[n(l),null],border_top_color:[n(l),null],border_top_left_radius:[n(l),null],border_top_right_radius:[n(l),null],border_top_style:[n(l),null],border_top_width:[n(l),null],border_width:[n(l),null],bottom:[n(l),null],box_shadow:[n(l),null],box_sizing:[n(l),null],break_after:[n(l),null],break_before:[n(l),null],break_inside:[n(l),null],caption_side:[n(l),null],caret_color:[n(l),null],clear:[n(l),null],clip:[n(l),null],clip_path:[n(l),null],clip_rule:[n(l),null],color:[n(l),null],color_interpolation:[n(l),null],color_interpolation_filters:[n(l),null],column_count:[n(l),null],column_fill:[n(l),null],column_gap:[n(l),null],column_rule:[n(l),null],column_rule_color:[n(l),null],column_rule_style:[n(l),null],column_rule_width:[n(l),null],column_span:[n(l),null],column_width:[n(l),null],columns:[n(l),null],content:[n(l),null],counter_increment:[n(l),null],counter_reset:[n(l),null],cursor:[n(l),null],direction:[n(l),null],display:[n(l),null],dominant_baseline:[n(l),null],empty_cells:[n(l),null],fill:[n(l),null],fill_opacity:[n(l),null],fill_rule:[n(l),null],filter:[n(l),null],flex:[n(l),null],flex_basis:[n(l),null],flex_direction:[n(l),null],flex_flow:[n(l),null],flex_grow:[n(l),null],flex_shrink:[n(l),null],flex_wrap:[n(l),null],float:[n(l),null],flood_color:[n(l),null],flood_opacity:[n(l),null],font:[n(l),null],font_family:[n(l),null],font_feature_settings:[n(l),null],font_kerning:[n(l),null],font_size:[n(l),null],font_size_adjust:[n(l),null],font_stretch:[n(l),null],font_style:[n(l),null],font_synthesis:[n(l),null],font_variant:[n(l),null],font_variant_caps:[n(l),null],font_variant_east_asian:[n(l),null],font_variant_ligatures:[n(l),null],font_variant_numeric:[n(l),null],font_variant_position:[n(l),null],font_weight:[n(l),null],gap:[n(l),null],glyph_orientation_vertical:[n(l),null],grid:[n(l),null],grid_area:[n(l),null],grid_auto_columns:[n(l),null],grid_auto_flow:[n(l),null],grid_auto_rows:[n(l),null],grid_column:[n(l),null],grid_column_end:[n(l),null],grid_column_gap:[n(l),null],grid_column_start:[n(l),null],grid_gap:[n(l),null],grid_row:[n(l),null],grid_row_end:[n(l),null],grid_row_gap:[n(l),null],grid_row_start:[n(l),null],grid_template:[n(l),null],grid_template_areas:[n(l),null],grid_template_columns:[n(l),null],grid_template_rows:[n(l),null],height:[n(l),null],hyphens:[n(l),null],image_orientation:[n(l),null],image_rendering:[n(l),null],inline_size:[n(l),null],justify_content:[n(l),null],justify_items:[n(l),null],justify_self:[n(l),null],left:[n(l),null],letter_spacing:[n(l),null],lighting_color:[n(l),null],line_break:[n(l),null],line_height:[n(l),null],list_style:[n(l),null],list_style_image:[n(l),null],list_style_position:[n(l),null],list_style_type:[n(l),null],margin:[n(l),null],margin_block_end:[n(l),null],margin_block_start:[n(l),null],margin_bottom:[n(l),null],margin_inline_end:[n(l),null],margin_inline_start:[n(l),null],margin_left:[n(l),null],margin_right:[n(l),null],margin_top:[n(l),null],marker:[n(l),null],marker_end:[n(l),null],marker_mid:[n(l),null],marker_start:[n(l),null],mask:[n(l),null],mask_composite:[n(l),null],mask_image:[n(l),null],mask_position:[n(l),null],mask_repeat:[n(l),null],mask_size:[n(l),null],mask_type:[n(l),null],max_block_size:[n(l),null],max_height:[n(l),null],max_inline_size:[n(l),null],max_width:[n(l),null],min_block_size:[n(l),null],min_height:[n(l),null],min_inline_size:[n(l),null],min_width:[n(l),null],object_fit:[n(l),null],object_position:[n(l),null],opacity:[n(l),null],order:[n(l),null],orphans:[n(l),null],outline:[n(l),null],outline_color:[n(l),null],outline_offset:[n(l),null],outline_style:[n(l),null],outline_width:[n(l),null],overflow:[n(l),null],overflow_anchor:[n(l),null],overflow_wrap:[n(l),null],overflow_x:[n(l),null],overflow_y:[n(l),null],overscroll_behavior:[n(l),null],overscroll_behavior_block:[n(l),null],overscroll_behavior_inline:[n(l),null],overscroll_behavior_x:[n(l),null],overscroll_behavior_y:[n(l),null],padding:[n(l),null],padding_block_end:[n(l),null],padding_block_start:[n(l),null],padding_bottom:[n(l),null],padding_inline_end:[n(l),null],padding_inline_start:[n(l),null],padding_left:[n(l),null],padding_right:[n(l),null],padding_top:[n(l),null],page_break_after:[n(l),null],page_break_before:[n(l),null],page_break_inside:[n(l),null],paint_order:[n(l),null],perspective:[n(l),null],perspective_origin:[n(l),null],place_content:[n(l),null],place_items:[n(l),null],place_self:[n(l),null],pointer_events:[n(l),null],position:[n(l),null],quotes:[n(l),null],resize:[n(l),null],right:[n(l),null],rotate:[n(l),null],row_gap:[n(l),null],ruby_align:[n(l),null],ruby_position:[n(l),null],scale:[n(l),null],scroll_behavior:[n(l),null],shape_rendering:[n(l),null],stop_color:[n(l),null],stop_opacity:[n(l),null],stroke:[n(l),null],stroke_dasharray:[n(l),null],stroke_dashoffset:[n(l),null],stroke_linecap:[n(l),null],stroke_linejoin:[n(l),null],stroke_miterlimit:[n(l),null],stroke_opacity:[n(l),null],stroke_width:[n(l),null],tab_size:[n(l),null],table_layout:[n(l),null],text_align:[n(l),null],text_align_last:[n(l),null],text_anchor:[n(l),null],text_combine_upright:[n(l),null],text_decoration:[n(l),null],text_decoration_color:[n(l),null],text_decoration_line:[n(l),null],text_decoration_style:[n(l),null],text_emphasis:[n(l),null],text_emphasis_color:[n(l),null],text_emphasis_position:[n(l),null],text_emphasis_style:[n(l),null],text_indent:[n(l),null],text_justify:[n(l),null],text_orientation:[n(l),null],text_overflow:[n(l),null],text_rendering:[n(l),null],text_shadow:[n(l),null],text_transform:[n(l),null],text_underline_position:[n(l),null],top:[n(l),null],touch_action:[n(l),null],transform:[n(l),null],transform_box:[n(l),null],transform_origin:[n(l),null],transform_style:[n(l),null],transition:[n(l),null],transition_delay:[n(l),null],transition_duration:[n(l),null],transition_property:[n(l),null],transition_timing_function:[n(l),null],translate:[n(l),null],unicode_bidi:[n(l),null],user_select:[n(l),null],vertical_align:[n(l),null],visibility:[n(l),null],white_space:[n(l),null],widows:[n(l),null],width:[n(l),null],will_change:[n(l),null],word_break:[n(l),null],word_spacing:[n(l),null],word_wrap:[n(l),null],writing_mode:[n(l),null],z_index:[n(l),null]})))}, function _(e,n,t,l,r){var s,i;l();const u=e(1),S=e(50),_=u.__importStar(e(56));class h extends S.Model{constructor(e){super(e)}}t.StyleSheet=h,h.__name__="StyleSheet";class y extends h{constructor(e){super(e)}underlying(){return new _.InlineStyleSheet(this.css)}}t.InlineStyleSheet=y,s=y,y.__name__="InlineStyleSheet",s.define((({String:e})=>({css:[e]})));class d extends h{constructor(e){super(e)}underlying(){return new _.ImportedStyleSheet(this.url)}}t.ImportedStyleSheet=d,i=d,d.__name__="ImportedStyleSheet",i.define((({String:e})=>({url:[e]})));class o extends y{constructor(e){super(e),this._underlying=null}underlying(){return null==this._underlying&&(this._underlying=new _.GlobalInlineStyleSheet(this.css)),this._underlying}}t.GlobalInlineStyleSheet=o,o.__name__="GlobalInlineStyleSheet";class c extends d{constructor(e){super(e),this._underlying=null}underlying(){return null==this._underlying&&(this._underlying=new _.GlobalInlineStyleSheet(this.url)),this._underlying}}t.GlobalImportedStyleSheet=c,c.__name__="GlobalImportedStyleSheet"}, @@ -1217,7 +1217,7 @@

Plots# function _(t,e,n,s,r){s();const{PI:o,log:a,sin:_,cos:i,sqrt:m,floor:l}=Math;n.MAX_INT32=2147483647;class d{float(){return(this.integer()-1)/(n.MAX_INT32-1)}floats(t,e=0,n=1){const s=new Array(t);for(let r=0;rthis.uniform(t,e)))}normal(t,e){return this.normals(t,e,1)[0]}normals(t,e,n){const[s,r]=[t,e],l=new Float64Array(n);for(let t=0;t{this.model.active?this.activate():this.deactivate()}))}get overlays(){return[]}activate(){}deactivate(){}}n.ToolView=u,u.__name__="ToolView";class d extends _.Model{constructor(t){super(t)}get event_role(){const{event_type:t}=this;return(0,c.isString)(t)?t:"multi"}get event_types(){const{event_type:t}=this;return null==t?[]:(0,c.isString)(t)?[t]:t}get tooltip(){var t;return null!==(t=this.description)&&void 0!==t?t:this.tool_name}get computed_icon(){const{icon:t,tool_icon:e}=this;return null!=t?t:null!=e?`.${e}`:void 0}get menu(){return null}_get_dim_limits([t,e],[n,o],i,s){const a=i.bbox.h_range;let r;"width"==s||"both"==s?(r=[(0,l.min)([t,n]),(0,l.max)([t,n])],r=[(0,l.max)([r[0],a.start]),(0,l.min)([r[1],a.end])]):r=[a.start,a.end];const c=i.bbox.v_range;let _;return"height"==s||"both"==s?(_=[(0,l.min)([e,o]),(0,l.max)([e,o])],_=[(0,l.max)([_[0],c.start]),(0,l.min)([_[1],c.end])]):_=[c.start,c.end],[r,_]}_get_dim_tooltip(t){const{description:e,tool_name:n}=this;return null!=e?e:"both"==t?n:"auto"==t?`${n} (either x, y or both dimensions)`:`${n} (${"width"==t?"x":"y"}-axis)`}static register_alias(t,e){this.prototype._known_aliases.set(t,e)}static from_string(t){const e=this.prototype._known_aliases.get(t);if(null!=e)return e();{const e=[...this.prototype._known_aliases.keys()];throw new Error(`unexpected tool name '${t}', possible tools are ${e.join(", ")}`)}}}n.Tool=d,s=d,d.__name__="Tool",s.prototype._known_aliases=new Map,s.define((({String:t,Regex:e,Nullable:n,Or:o})=>({icon:[n(o(r.ToolIcon,e(/^--/),e(/^\./),e(/^data:image/))),null],description:[n(t),null]}))),s.internal((({Boolean:t})=>({active:[t,!1],disabled:[t,!1]})))}, -function _(t,o,e,s,n){var i;s();const l=t(15),r=t(50),c=t(267),a=t(32);class u extends r.Model{constructor(t){super(t)}get underlying(){return this.tools[0]}tool_button(){const t=this.tools[0].tool_button();return t.tool=this,t}get event_type(){return this.tools[0].event_type}get event_role(){return this.tools[0].event_role}get event_types(){return this.tools[0].event_types}get default_order(){return this.tools[0].default_order}get tooltip(){return this.tools[0].tooltip}get tool_name(){return this.tools[0].tool_name}get computed_icon(){return this.tools[0].computed_icon}get toggleable(){const t=this.tools[0];return"toggleable"in t&&t.toggleable}initialize(){super.initialize(),this.do=new l.Signal0(this,"do")}connect_signals(){super.connect_signals(),this.connect(this.do,(()=>this.doit())),this.connect(this.properties.active.change,(()=>this.set_active()));for(const t of this.tools)this.connect(t.properties.active.change,(()=>{this.active=t.active}))}doit(){for(const t of this.tools)t.do.emit()}set_active(){for(const t of this.tools)t.active=this.active}get menu(){const{menu:t}=this.tools[0];if(null==t)return null;const o=[];for(const[e,s]of(0,a.enumerate)(t))if(null==e)o.push(null);else{const t=()=>{var t,o,e;for(const n of this.tools)null===(e=null===(o=null===(t=n.menu)||void 0===t?void 0:t[s])||void 0===o?void 0:o.handler)||void 0===e||e.call(o)};o.push(Object.assign(Object.assign({},e),{handler:t}))}return o}}e.ToolProxy=u,i=u,u.__name__="ToolProxy",i.define((({Boolean:t,Array:o,Ref:e})=>({tools:[o(e(c.Tool)),[]],active:[t,t=>(0,a.some)(t.tools,(t=>t.active))],disabled:[t,!1]})))}, +function _(t,o,e,s,n){var i;s();const l=t(15),r=t(50),c=t(267),a=t(33);class u extends r.Model{constructor(t){super(t)}get underlying(){return this.tools[0]}tool_button(){const t=this.tools[0].tool_button();return t.tool=this,t}get event_type(){return this.tools[0].event_type}get event_role(){return this.tools[0].event_role}get event_types(){return this.tools[0].event_types}get default_order(){return this.tools[0].default_order}get tooltip(){return this.tools[0].tooltip}get tool_name(){return this.tools[0].tool_name}get computed_icon(){return this.tools[0].computed_icon}get toggleable(){const t=this.tools[0];return"toggleable"in t&&t.toggleable}initialize(){super.initialize(),this.do=new l.Signal0(this,"do")}connect_signals(){super.connect_signals(),this.connect(this.do,(()=>this.doit())),this.connect(this.properties.active.change,(()=>this.set_active()));for(const t of this.tools)this.connect(t.properties.active.change,(()=>{this.active=t.active}))}doit(){for(const t of this.tools)t.do.emit()}set_active(){for(const t of this.tools)t.active=this.active}get menu(){const{menu:t}=this.tools[0];if(null==t)return null;const o=[];for(const[e,s]of(0,a.enumerate)(t))if(null==e)o.push(null);else{const t=()=>{var t,o,e;for(const n of this.tools)null===(e=null===(o=null===(t=n.menu)||void 0===t?void 0:t[s])||void 0===o?void 0:o.handler)||void 0===e||e.call(o)};o.push(Object.assign(Object.assign({},e),{handler:t}))}return o}}e.ToolProxy=u,i=u,u.__name__="ToolProxy",i.define((({Boolean:t,Array:o,Ref:e})=>({tools:[o(e(c.Tool)),[]],active:[t,t=>(0,a.some)(t.tools,(t=>t.active))],disabled:[t,!1]})))}, function _(e,t,s,o,l){var i;o();const n=e(1),a=e(260),r=e(267),d=e(268),c=e(56),h=e(19),u=e(270),m=e(10),_=n.__importStar(e(273)),p=_,v=n.__importDefault(e(272));class f extends a.UIElementView{initialize(){var e;super.initialize();const{location:t}=this.parent.model,s="left"==t||"above"==t,o=this.parent.model.horizontal?"vertical":"horizontal",l=null!==(e=this.model.tool.menu)&&void 0!==e?e:[];this._menu=new u.ContextMenu(s?(0,m.reversed)(l):l,{target:this.root.el,orientation:o,prevent_hide:e=>e.composedPath().includes(this.el)});let i=null,n=null;this.el.addEventListener("pointerdown",(e=>{e.buttons==c.MouseButton.Left&&(i=e.timeStamp,n=setTimeout((()=>{i=null,n=null,this._pressed()}),250))})),this.el.addEventListener("pointerup",(e=>{if(null!=n&&(clearTimeout(n),n=null),null!=i){if(e.timeStamp-i>=250)this._pressed();else{if(this._menu.is_open)return void this._menu.hide();e.composedPath().includes(this.el)&&this._clicked()}i=null}})),this.el.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this._clicked();break;case" ":this._pressed()}}))}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.render())),this.connect(this.model.tool.change,(()=>this.render()))}remove(){this._menu.remove(),super.remove()}stylesheets(){return[...super.stylesheets(),_.default,v.default]}render(){var e,t;super.render(),this.class_list.add(p[this.parent.model.location]),this.model.tool.disabled&&this.class_list.add(p.disabled);const s=(0,c.div)({class:p.tool_icon});this.shadow_el.appendChild(s);const o=null!==(e=this.model.icon)&&void 0!==e?e:this.model.tool.computed_icon;if(null!=o)if(o.startsWith("data:image")){const e=`url("${encodeURI(o)}")`;s.style.backgroundImage=e}else if(o.startsWith("--"))s.style.backgroundImage=`var(${o})`;else if(o.startsWith(".")){const e=o.substring(1);s.classList.add(e)}else if(h.ToolIcon.valid(o)){const e=`bk-tool-icon-${o.replace(/_/g,"-")}`;s.classList.add(e)}if(null!=this.model.tool.menu){const e=(0,c.div)({class:p.tool_chevron});this.shadow_el.appendChild(e)}const l=null!==(t=this.model.tooltip)&&void 0!==t?t:this.model.tool.tooltip;this.el.title=l,this.el.tabIndex=0}_pressed(){const e=(()=>{switch(this.parent.model.location){case"right":return{left_of:this.el};case"left":return{right_of:this.el};case"above":return{below:this.el};case"below":return{above:this.el}}})();this._menu.toggle(e)}}s.ToolButtonView=f,f.__name__="ToolButtonView";class g extends a.UIElement{constructor(e){super(e)}}s.ToolButton=g,i=g,g.__name__="ToolButton",i.define((({String:e,Regex:t,Ref:s,Nullable:o,Or:l})=>({tool:[l(s(r.Tool),s(d.ToolProxy))],icon:[o(l(h.ToolIcon,t(/^--/),t(/^\./),t(/^data:image/))),null],tooltip:[o(e),null]})))}, function _(t,e,i,n,o){n();const s=t(1),l=t(56),h=t(10),r=t(8),d=s.__importStar(t(271)),a=d,u=s.__importDefault(t(272)),_=s.__importDefault(t(58));class c{get is_open(){return this._open}get can_open(){return 0!=this.items.length}constructor(t,e){var i,n,o;this.el=(0,l.div)(),this._open=!1,this._item_click=t=>{var e;null===(e=t.handler)||void 0===e||e.call(t),this.hide()},this._on_mousedown=t=>{var e,i;t.composedPath().includes(this.el)||null!==(i=null===(e=this.prevent_hide)||void 0===e?void 0:e.call(this,t))&&void 0!==i&&i||this.hide()},this._on_keydown=t=>{"Escape"==t.key&&this.hide()},this._on_blur=()=>{this.hide()},this.items=t,this.target=e.target,this.orientation=null!==(i=e.orientation)&&void 0!==i?i:"vertical",this.reversed=null!==(n=e.reversed)&&void 0!==n&&n,this.prevent_hide=e.prevent_hide,this.extra_styles=null!==(o=e.extra_styles)&&void 0!==o?o:[],this.shadow_el=this.el.attachShadow({mode:"open"}),this.class_list=new l.ClassList(this.el.classList)}remove(){this._unlisten(),(0,l.remove)(this.el)}_listen(){document.addEventListener("mousedown",this._on_mousedown),document.addEventListener("keydown",this._on_keydown),window.addEventListener("blur",this._on_blur)}_unlisten(){document.removeEventListener("mousedown",this._on_mousedown),document.removeEventListener("keydown",this._on_keydown),window.removeEventListener("blur",this._on_blur)}_position(t){var e;const i=(()=>{if("left_of"in t){const{left:e,top:i}=t.left_of.getBoundingClientRect();return{right:e,top:i}}if("right_of"in t){const{top:e,right:i}=t.right_of.getBoundingClientRect();return{left:i,top:e}}if("below"in t){const{left:e,bottom:i}=t.below.getBoundingClientRect();return{left:e,top:i}}if("above"in t){const{left:e,top:i}=t.above.getBoundingClientRect();return{left:e,bottom:i}}return t})(),n=null!==(e=this.el.offsetParent)&&void 0!==e?e:document.body,o=(()=>{const t=n.getBoundingClientRect(),e=getComputedStyle(n);return{left:t.left-parseFloat(e.marginLeft),right:t.right+parseFloat(e.marginRight),top:t.top-parseFloat(e.marginTop),bottom:t.bottom+parseFloat(e.marginBottom)}})(),{style:s}=this.el;s.left=null!=i.left?i.left-o.left+"px":"auto",s.top=null!=i.top?i.top-o.top+"px":"auto",s.right=null!=i.right?o.right-i.right+"px":"auto",s.bottom=null!=i.bottom?o.bottom-i.bottom+"px":"auto"}stylesheets(){return[_.default,d.default,u.default,...this.extra_styles]}empty(){(0,l.empty)(this.shadow_el),this.class_list.clear()}render(){var t,e;this.empty();for(const t of this.stylesheets()){((0,r.isString)(t)?new l.InlineStyleSheet(t):t).install(this.shadow_el)}this.class_list.add(a[this.orientation]);const i=this.reversed?(0,h.reversed)(this.items):this.items;for(const n of i){let i;if(null==n)i=(0,l.div)({class:a.divider});else{if(null!=n.if&&!n.if())continue;if(null!=n.content)i=n.content;else{const o=null!=n.icon?(0,l.div)({class:[a.menu_icon,n.icon]}):null,s=[null!==(e=null===(t=n.active)||void 0===t?void 0:t.call(n))&&void 0!==e&&e?a.active:null,n.class];i=(0,l.div)({class:s,title:n.tooltip,tabIndex:0},o,n.label,n.content),i.addEventListener("click",(()=>{this._item_click(n)})),i.addEventListener("keydown",(t=>{"Enter"==t.key&&this._item_click(n)}))}}this.shadow_el.appendChild(i)}}show(t){var e;if(0!=this.items.length&&!this._open){if(this.render(),0==this.shadow_el.children.length)return;(null!==(e=this.target.shadowRoot)&&void 0!==e?e:this.target).appendChild(this.el),this._position(null!=t?t:{left:0,top:0}),this._listen(),this._open=!0}}hide(){this._open&&(this._open=!1,this._unlisten(),(0,l.remove)(this.el))}toggle(t){this._open?this.hide():this.show(t)}}i.ContextMenu=c,c.__name__="ContextMenu"}, function _(r,o,i,e,t){e(),i.menu_icon="bk-menu-icon",i.horizontal="bk-horizontal",i.vertical="bk-vertical",i.divider="bk-divider",i.active="bk-active",i.default=".bk-menu-icon{width:28px;height:28px;mask-size:60% 60%;mask-position:center center;mask-repeat:no-repeat;-webkit-mask-size:60% 60%;-webkit-mask-position:center center;-webkit-mask-repeat:no-repeat;background-size:60%;background-color:transparent;background-repeat:no-repeat;background-position:center center;}:host{position:absolute;display:inline-flex;flex-wrap:nowrap;user-select:none;-webkit-user-select:none;width:auto;height:auto;z-index:100;cursor:pointer;font-size:var(--font-size);background-color:#fff;border:1px solid #ccc;border-radius:var(--border-radius);box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);}:host(.bk-horizontal){flex-direction:row;}:host(.bk-vertical){flex-direction:column;}.bk-divider{cursor:default;overflow:hidden;background-color:#e5e5e5;}:host(.bk-horizontal) > .bk-divider{width:1px;margin:5px 0;}:host(.bk-vertical) > .bk-divider{height:1px;margin:0 5px;}:host > :not(.bk-divider){border:1px solid transparent;--active-tool-highlight:#26aae1;}:host > :not(.bk-divider).bk-active{border-color:var(--active-tool-highlight);}:host > :not(.bk-divider):hover{background-color:#f9f9f9;}:host > :not(.bk-divider):focus,:host > :not(.bk-divider):focus-visible{outline:1px dotted var(--active-tool-highlight);outline-offset:-1px;}:host > :not(.bk-divider)::-moz-focus-inner{border:0;}:host(.bk-horizontal) > :not(.bk-divider):first-child{border-top-left-radius:var(--border-radius);border-bottom-left-radius:var(--border-radius);}:host(.bk-horizontal) > :not(.bk-divider):last-child{border-top-right-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);}:host(.bk-vertical) > :not(.bk-divider):first-child{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);}:host(.bk-vertical) > :not(.bk-divider):last-child{border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);}"}, @@ -1238,12 +1238,12 @@

Plots# function _(t,e,s,i,r){var o;i();const l=t(1),a=t(98),n=l.__importStar(t(78)),c=t(19),h=t(56),_=l.__importStar(t(17)),u=t(23),d=t(12);class y extends a.DataAnnotationView{constructor(){super(...arguments),this.els=[]}set_data(t){super.set_data(t),this.els.forEach((t=>(0,h.remove)(t))),this.els=[];for(const t of this.text){const t=(0,h.div)({style:{display:"none"}});this.plot_view.canvas_view.add_overlay(t),this.els.push(t)}}remove(){this.els.forEach((t=>(0,h.remove)(t))),this.els=[],super.remove()}_rerender(){this.render()}map_data(){const{x_scale:t,y_scale:e}=this.coordinates,s=null!=this.layout?this.layout:this.plot_view.frame;this.sx=(()=>{switch(this.model.x_units){case"canvas":return new u.ScreenArray(this._x);case"screen":return s.bbox.xview.v_compute(this._x);case"data":return t.v_compute(this._x)}})(),this.sy=(()=>{switch(this.model.y_units){case"canvas":return new u.ScreenArray(this._y);case"screen":return s.bbox.yview.v_compute(this._y);case"data":return e.v_compute(this._y)}})()}paint(){const{ctx:t}=this.layer;for(let e=0,s=this.text.length;e{switch(this.visuals.text.text_align.get(e)){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[c,_]=(()=>{switch(this.visuals.text.text_baseline.get(e)){case"top":return["top","0%"];case"middle":default:return["center","-50%"];case"bottom":return["bottom","-100%"]}})();let u=`translate(${n}, ${_})`;0!=o&&(u+=`rotate(${o}rad)`),l.style.transformOrigin=`${a} ${c}`,l.style.transform=u,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),l.style.backgroundColor=t.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),l.style.borderStyle=t.getLineDash().length<2?"solid":"dashed",l.style.borderWidth=`${t.lineWidth}px`,l.style.borderColor=t.strokeStyle),(0,h.display)(l)}}s.HTMLLabelSetView=y,y.__name__="HTMLLabelSetView";class p extends a.DataAnnotation{constructor(t){super(t)}}s.HTMLLabelSet=p,o=p,p.__name__="HTMLLabelSet",o.prototype.default_view=y,o.mixins([n.TextVector,["border_",n.LineVector],["background_",n.FillVector]]),o.define((()=>({x:[_.XCoordinateSpec,{field:"x"}],y:[_.YCoordinateSpec,{field:"y"}],x_units:[c.CoordinateUnits,"data"],y_units:[c.CoordinateUnits,"data"],text:[_.NullStringSpec,{field:"text"}],angle:[_.AngleSpec,0],x_offset:[_.NumberSpec,{value:0}],y_offset:[_.NumberSpec,{value:0}]}))),o.override({background_fill_color:null,border_line_color:null})}, function _(e,t,i,l,s){var o;l();const a=e(1),n=e(285),r=e(19),c=e(151),h=a.__importStar(e(78));class _ extends n.TextAnnotationView{_get_location(){const e=this.model.offset,t=this.model.standoff/2;let i,l;const{bbox:s}=this.layout;switch(this.panel.side){case"above":case"below":switch(this.model.vertical_align){case"top":l=s.top+t;break;case"middle":l=s.vcenter;break;case"bottom":l=s.bottom-t}switch(this.model.align){case"left":i=s.left+e;break;case"center":i=s.hcenter;break;case"right":i=s.right-e}break;case"left":switch(this.model.vertical_align){case"top":i=s.left+t;break;case"middle":i=s.hcenter;break;case"bottom":i=s.right-t}switch(this.model.align){case"left":l=s.bottom-e;break;case"center":l=s.vcenter;break;case"right":l=s.top+e}break;case"right":switch(this.model.vertical_align){case"top":i=s.right-t;break;case"middle":i=s.hcenter;break;case"bottom":i=s.left+t}switch(this.model.align){case"left":l=s.top+e;break;case"center":l=s.vcenter;break;case"right":l=s.bottom-e}}return[i,l]}_render(){const{text:e}=this.model;if(0==e.length)return;this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;const[t,i]=this._get_location(),l=this.panel.get_label_angle_heuristic("parallel");this._paint(this.layer.ctx,e,t,i,l)}_get_size(){const{text:e}=this.model,t=new c.TextBox({text:e});t.visuals=this.visuals.text.values();const{width:i,height:l}=t.size();return{width:i,height:0==l?0:2+l+this.model.standoff}}}i.HTMLTitleView=_,_.__name__="HTMLTitleView";class d extends n.TextAnnotation{constructor(e){super(e)}}i.HTMLTitle=d,o=d,d.__name__="HTMLTitle",o.prototype.default_view=_,o.mixins([h.Text,["border_",h.Line],["background_",h.Fill]]),o.define((({Number:e,String:t})=>({text:[t,""],vertical_align:[r.VerticalAlign,"bottom"],align:[r.TextAlign,"left"],offset:[e,0],standoff:[e,10]}))),o.prototype._props.text_align.options.internal=!0,o.prototype._props.text_baseline.options.internal=!0,o.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1,background_fill_color:null,border_line_color:null})}, function _(e,t,u,n,S){n(),S("CustomJS",e(289).CustomJS),S("OpenURL",e(291).OpenURL),S("SetValue",e(292).SetValue)}, -function _(require,module,exports,__esModule,__esExport){var _a;__esModule();const callback_1=require(290),object_1=require(9),array_1=require(10),string_1=require(38),logging_1=require(18),types_1=require(8);class CustomJS extends callback_1.Callback{constructor(t){super(t),this._state=null}connect_signals(){super.connect_signals();const{args:t,code:e,module:s}=this.properties;this.on_change([t,e,s],(()=>this._state=null))}async _compile_module(){const url=URL.createObjectURL(new Blob([this.code],{type:"text/javascript"}));try{const module=await eval(`import("${url}")`);return(0,types_1.isFunction)(module.default)?module.default:(logging_1.logger.warn("custom ES module didn't export a default function"),()=>{})}finally{URL.revokeObjectURL(url)}}async _compile_function(){const[t=[],e=[]]=(0,array_1.unzip)((0,object_1.entries)(this.args)),s=(0,string_1.use_strict)(this.code),o=new Function(...t,"cb_obj","cb_data",s);return function(...t){return o.call(this,...e,...t)}}_is_es_module(t){return t.split("\n").some((t=>t.trimStart().startsWith("export default")))}async _compile(){const t=(()=>"auto"==this.module?this._is_es_module(this.code):this.module)();return t?{func:await this._compile_module(),module:t}:{func:await this._compile_function(),module:t}}async state(){return null==this._state&&(this._state=await this._compile()),this._state}async execute(t,e={}){const{func:s,module:o}=await this.state();return o?s(this.args,t,e):s.call(t,t,e)}}exports.CustomJS=CustomJS,_a=CustomJS,CustomJS.__name__="CustomJS",_a.define((({Unknown:t,String:e,Dict:s,Auto:o,Or:i,Boolean:n})=>({args:[s(t),{}],code:[e],module:[i(o,n),"auto"]})))}, +function _(require,module,exports,__esModule,__esExport){var _a;__esModule();const callback_1=require(290),object_1=require(9),array_1=require(10),string_1=require(39),logging_1=require(18),types_1=require(8);class CustomJS extends callback_1.Callback{constructor(t){super(t),this._state=null}connect_signals(){super.connect_signals();const{args:t,code:e,module:s}=this.properties;this.on_change([t,e,s],(()=>this._state=null))}async _compile_module(){const url=URL.createObjectURL(new Blob([this.code],{type:"text/javascript"}));try{const module=await eval(`import("${url}")`);return(0,types_1.isFunction)(module.default)?module.default:(logging_1.logger.warn("custom ES module didn't export a default function"),()=>{})}finally{URL.revokeObjectURL(url)}}async _compile_function(){const[t=[],e=[]]=(0,array_1.unzip)((0,object_1.entries)(this.args)),s=(0,string_1.use_strict)(this.code),o=new Function(...t,"cb_obj","cb_data",s);return function(...t){return o.call(this,...e,...t)}}_is_es_module(t){return t.split("\n").some((t=>t.trimStart().startsWith("export default")))}async _compile(){const t=(()=>"auto"==this.module?this._is_es_module(this.code):this.module)();return t?{func:await this._compile_module(),module:t}:{func:await this._compile_function(),module:t}}async state(){return null==this._state&&(this._state=await this._compile()),this._state}async execute(t,e={}){const{func:s,module:o}=await this.state();return o?s(this.args,t,e):s.call(t,t,e)}}exports.CustomJS=CustomJS,_a=CustomJS,CustomJS.__name__="CustomJS",_a.define((({Unknown:t,String:e,Dict:s,Auto:o,Or:i,Boolean:n})=>({args:[s(t),{}],code:[e],module:[i(o,n),"auto"]})))}, function _(c,a,l,n,s){n();const e=c(50);class o extends e.Model{constructor(c){super(c)}}l.Callback=o,o.__name__="Callback"}, function _(e,t,n,o,i){var s;o();const c=e(290),r=e(170),a=e(8);class d extends c.Callback{constructor(e){super(e)}navigate(e){this.same_tab?window.location.href=e:window.open(e)}execute(e,{source:t}){const n=e=>{const n=(0,r.replace_placeholders)(this.url,t,e,void 0,void 0,encodeURI);if(!(0,a.isString)(n))throw new Error("HTML output is not supported in this context");this.navigate(n)},{selected:o}=t;for(const e of o.indices)n(e);for(const e of o.line_indices)n(e)}}n.OpenURL=d,s=d,d.__name__="OpenURL",s.define((({Boolean:e,String:t})=>({url:[t,"http://"],same_tab:[e,!1]})))}, function _(e,t,r,n,o){var a;n();const s=e(290),c=e(14),l=e(18);class u extends s.Callback{constructor(e){super(e)}execute(){const{obj:e,attr:t,value:r}=this;t in e.properties?e.setv({[t]:r}):l.logger.error(`${e.type}.${t} is not a property`)}}r.SetValue=u,a=u,u.__name__="SetValue",a.define((({String:e,Unknown:t,Ref:r})=>({obj:[r(c.HasProps)],attr:[e],value:[t]})))}, function _(a,n,e,r,s){r(),s("Canvas",a(294).Canvas),s("CartesianFrame",a(157).CartesianFrame)}, -function _(e,t,s,i,a){var r;i();const l=e(1),n=e(28),o=e(18),h=e(56),_=e(19),c=e(295),p=e(155),u=e(263),d=e(260),b=e(56),v=l.__importDefault(e(298));const w=(()=>{let t;return async()=>void 0!==t?t:t=await async function(){const t=document.createElement("canvas"),s=t.getContext("webgl",{premultipliedAlpha:!0});if(null!=s){const i=await(0,p.load_module)(Promise.resolve().then((()=>l.__importStar(e(511)))));if(null!=i){const e=i.get_regl(s);if(e.has_webgl)return{canvas:t,regl_wrapper:e};o.logger.trace("WebGL is supported, but not the required extensions")}else o.logger.trace("WebGL is supported, but bokehjs(.min).js bundle is not available")}else o.logger.trace("WebGL is not supported");return null}()})();class g extends d.UIElementView{constructor(){super(...arguments),this.webgl=null,this._size=new b.InlineStyleSheet,this.plot_views=[]}initialize(){super.initialize(),this.underlays_el=(0,h.div)({class:"bk-layer"}),this.primary=this.create_layer(),this.overlays=this.create_layer(),this.overlays_el=(0,h.div)({class:"bk-layer"}),this.events_el=(0,h.div)({class:["bk-layer","bk-events"]}),this.ui_event_bus=new c.UIEventBus(this)}get layers(){return[this.underlays_el,this.primary,this.overlays,this.overlays_el,this.events_el]}async lazy_initialize(){if(await super.lazy_initialize(),"webgl"==this.model.output_backend&&(this.webgl=await w(),n.settings.force_webgl&&null==this.webgl))throw new Error("webgl is not available")}remove(){this.ui_event_bus.destroy(),super.remove()}stylesheets(){return[...super.stylesheets(),v.default,this._size]}render(){super.render();const e=[this.underlays_el,this.primary.el,this.overlays.el,this.overlays_el,this.events_el];(0,h.append)(this.shadow_el,...e)}add_underlay(e){this.underlays_el.appendChild(e)}add_overlay(e){this.overlays_el.appendChild(e)}add_event(e){this.events_el.appendChild(e)}get pixel_ratio(){return this.primary.pixel_ratio}_update_bbox(){const e=super._update_bbox();if(e){const{width:e,height:t}=this.bbox;this._size.replace(`\n .bk-layer {\n width: ${e}px;\n height: ${t}px;\n }\n `),this.primary.resize(e,t),this.overlays.resize(e,t)}return e}after_resize(){0==this.plot_views.length&&super.after_resize()}_after_resize(){super._after_resize();const{width:e,height:t}=this.bbox;this.primary.resize(e,t),this.overlays.resize(e,t)}resize(){this._update_bbox(),this._after_resize()}prepare_webgl(e){const{webgl:t}=this;if(null!=t){const{width:s,height:i}=this.bbox;t.canvas.width=this.pixel_ratio*s,t.canvas.height=this.pixel_ratio*i;const[a,r,l,n]=e,{xview:o,yview:h}=this.bbox,_=o.compute(a),c=h.compute(r+n),p=this.pixel_ratio;t.regl_wrapper.set_scissor(p*_,p*c,p*l,p*n),this._clear_webgl()}}blit_webgl(e){const{webgl:t}=this;if(null!=t&&t.canvas.width*t.canvas.height>0){if(o.logger.debug("Blitting WebGL canvas"),e.restore(),e.drawImage(t.canvas,0,0),e.save(),this.model.hidpi){const t=this.pixel_ratio;e.scale(t,t),e.translate(.5,.5)}this._clear_webgl()}}_clear_webgl(){const{webgl:e}=this;if(null!=e){const{regl_wrapper:t,canvas:s}=e;t.clear(s.width,s.height)}}compose(){const e=this.create_layer(),{width:t,height:s}=this.bbox;return e.resize(t,s),e.ctx.drawImage(this.primary.canvas,0,0),e.ctx.drawImage(this.overlays.canvas,0,0),e}create_layer(){const{output_backend:e,hidpi:t}=this.model;return new u.CanvasLayer(e,t)}to_blob(){return this.compose().to_blob()}}s.CanvasView=g,g.__name__="CanvasView";class y extends d.UIElement{constructor(e){super(e)}}s.Canvas=y,r=y,y.__name__="Canvas",r.prototype.default_view=g,r.define((({Boolean:e})=>({hidpi:[e,!0],output_backend:[_.OutputBackend,"canvas"]})))}, +function _(e,t,s,i,a){var r;i();const l=e(1),n=e(28),h=e(18),o=e(56),_=e(19),p=e(295),c=e(155),u=e(263),d=e(260),b=e(56),v=l.__importDefault(e(298));const w=(()=>{let t;return async()=>void 0!==t?t:t=await async function(){const t=document.createElement("canvas"),s=t.getContext("webgl",{alpha:!0,antialias:!1,depth:!1,premultipliedAlpha:!0});if(null!=s){const i=await(0,c.load_module)(Promise.resolve().then((()=>l.__importStar(e(511)))));if(null!=i){const e=i.get_regl(s);if(e.has_webgl)return{canvas:t,regl_wrapper:e};h.logger.trace("WebGL is supported, but not the required extensions")}else h.logger.trace("WebGL is supported, but bokehjs(.min).js bundle is not available")}else h.logger.trace("WebGL is not supported");return null}()})();class g extends d.UIElementView{constructor(){super(...arguments),this.webgl=null,this._size=new b.InlineStyleSheet,this.plot_views=[]}initialize(){super.initialize(),this.underlays_el=(0,o.div)({class:"bk-layer"}),this.primary=this.create_layer(),this.overlays=this.create_layer(),this.overlays_el=(0,o.div)({class:"bk-layer"}),this.events_el=(0,o.div)({class:["bk-layer","bk-events"]}),this.ui_event_bus=new p.UIEventBus(this)}get layers(){return[this.underlays_el,this.primary,this.overlays,this.overlays_el,this.events_el]}async lazy_initialize(){if(await super.lazy_initialize(),"webgl"==this.model.output_backend&&(this.webgl=await w(),n.settings.force_webgl&&null==this.webgl))throw new Error("webgl is not available")}remove(){this.ui_event_bus.destroy(),super.remove()}stylesheets(){return[...super.stylesheets(),v.default,this._size]}render(){super.render();const e=[this.underlays_el,this.primary.el,this.overlays.el,this.overlays_el,this.events_el];(0,o.append)(this.shadow_el,...e)}add_underlay(e){this.underlays_el.appendChild(e)}add_overlay(e){this.overlays_el.appendChild(e)}add_event(e){this.events_el.appendChild(e)}get pixel_ratio(){return this.primary.pixel_ratio}_update_bbox(){const e=super._update_bbox();if(e){const{width:e,height:t}=this.bbox;this._size.replace(`\n .bk-layer {\n width: ${e}px;\n height: ${t}px;\n }\n `),this.primary.resize(e,t),this.overlays.resize(e,t)}return e}after_resize(){0==this.plot_views.length&&super.after_resize()}_after_resize(){super._after_resize();const{width:e,height:t}=this.bbox;this.primary.resize(e,t),this.overlays.resize(e,t)}resize(){this._update_bbox(),this._after_resize()}prepare_webgl(e){const{webgl:t}=this;if(null!=t){const{width:s,height:i}=this.bbox;t.canvas.width=this.pixel_ratio*s,t.canvas.height=this.pixel_ratio*i;const[a,r,l,n]=e,{xview:h,yview:o}=this.bbox,_=h.compute(a),p=o.compute(r+n),c=this.pixel_ratio;t.regl_wrapper.set_scissor(c*_,c*p,c*l,c*n),this._clear_webgl()}}blit_webgl(e){const{webgl:t}=this;if(null!=t&&t.canvas.width*t.canvas.height>0){if(h.logger.debug("Blitting WebGL canvas"),e.restore(),e.drawImage(t.canvas,0,0),e.save(),this.model.hidpi){const t=this.pixel_ratio;e.scale(t,t),e.translate(.5,.5)}this._clear_webgl()}}_clear_webgl(){const{webgl:e}=this;if(null!=e){const{regl_wrapper:t,canvas:s}=e;t.clear(s.width,s.height)}}compose(){const e=this.create_layer(),{width:t,height:s}=this.bbox;return e.resize(t,s),e.ctx.drawImage(this.primary.canvas,0,0),e.ctx.drawImage(this.overlays.canvas,0,0),e}create_layer(){const{output_backend:e,hidpi:t}=this.model;return new u.CanvasLayer(e,t)}to_blob(){return this.compose().to_blob()}}s.CanvasView=g,g.__name__="CanvasView";class y extends d.UIElement{constructor(e){super(e)}}s.Canvas=y,r=y,y.__name__="Canvas",r.prototype.default_view=g,r.define((({Boolean:e})=>({hidpi:[e,!0],output_backend:[_.OutputBackend,"canvas"]})))}, function _(t,e,n,i,s){i();const r=t(1),_=r.__importDefault(t(296)),a=t(15),h=t(18),o=t(56),l=r.__importStar(t(52)),c=t(297),p=t(10),u=t(8),v=t(26);function d(t){return(0,u.isObject)(t)&&"_move_start"in t&&"_move"in t&&"_move_end"in t}function m(t){return(0,u.isObject)(t)&&"_pan_start"in t&&"_pan"in t&&"_pan_end"in t}function g(t){return(0,u.isObject)(t)&&"_pinch_start"in t&&"_pinch"in t&&"_pinch_end"in t}function y(t){return(0,u.isObject)(t)&&"_rotate_start"in t&&"_rotate"in t&&"_rotate_end"in t}n.is_Moveable=d,n.is_Pannable=m,n.is_Pinchable=g,n.is_Rotatable=y,n.is_Scrollable=function(t){return(0,u.isObject)(t)&&"_scroll"in t},n.is_Keyable=function(t){return(0,u.isObject)(t)&&"_keydown"in t&&"_keyup"in t},n.is_Tapable=function(t){return(0,u.isObject)(t)&&"_tap"in t};class f{get hit_area(){return this.canvas_view.events_el}constructor(t){this.pan_start=new a.Signal(this,"pan:start"),this.pan=new a.Signal(this,"pan"),this.pan_end=new a.Signal(this,"pan:end"),this.pinch_start=new a.Signal(this,"pinch:start"),this.pinch=new a.Signal(this,"pinch"),this.pinch_end=new a.Signal(this,"pinch:end"),this.rotate_start=new a.Signal(this,"rotate:start"),this.rotate=new a.Signal(this,"rotate"),this.rotate_end=new a.Signal(this,"rotate:end"),this.tap=new a.Signal(this,"tap"),this.doubletap=new a.Signal(this,"doubletap"),this.press=new a.Signal(this,"press"),this.pressup=new a.Signal(this,"pressup"),this.move_enter=new a.Signal(this,"move:enter"),this.move=new a.Signal(this,"move"),this.move_exit=new a.Signal(this,"move:exit"),this.scroll=new a.Signal(this,"scroll"),this.keydown=new a.Signal(this,"keydown"),this.keyup=new a.Signal(this,"keyup"),this._prev_move=null,this._curr_pan=null,this._curr_pinch=null,this._curr_rotate=null,this._current_pan_view=null,this._current_pinch_view=null,this._current_rotate_view=null,this._current_move_view=null,this.canvas_view=t,this.hammer=new _.default(this.hit_area,{cssProps:{},touchAction:"auto",inputClass:v.is_mobile?_.default.TouchMouseInput:_.default.PointerEventInput}),this._configure_hammerjs(),this.hit_area.addEventListener("mousemove",(t=>this._mouse_move(t))),this.hit_area.addEventListener("mouseenter",(t=>this._mouse_enter(t))),this.hit_area.addEventListener("mouseleave",(t=>this._mouse_exit(t))),this.hit_area.addEventListener("contextmenu",(t=>this._context_menu(t))),this.hit_area.addEventListener("wheel",(t=>this._mouse_wheel(t))),document.addEventListener("keydown",this),document.addEventListener("keyup",this)}destroy(){this.hammer.destroy(),document.removeEventListener("keydown",this),document.removeEventListener("keyup",this)}handleEvent(t){"keydown"==t.type?this._key_down(t):"keyup"==t.type&&this._key_up(t)}_configure_hammerjs(){this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",(t=>this._doubletap(t))),this.hammer.on("tap",(t=>this._tap(t))),this.hammer.on("press",(t=>this._press(t))),this.hammer.on("pressup",(t=>this._pressup(t))),this.hammer.get("pan").set({direction:_.default.DIRECTION_ALL}),this.hammer.on("panstart",(t=>this._pan_start(t))),this.hammer.on("pan",(t=>this._pan(t))),this.hammer.on("panend",(t=>this._pan_end(t))),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",(t=>this._pinch_start(t))),this.hammer.on("pinch",(t=>this._pinch(t))),this.hammer.on("pinchend",(t=>this._pinch_end(t))),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",(t=>this._rotate_start(t))),this.hammer.on("rotate",(t=>this._rotate(t))),this.hammer.on("rotateend",(t=>this._rotate_end(t)))}register_tool(t){let e=!0;for(const n of t.model.event_types)this._register_tool(t,n,e),e=!1}_register_tool(t,e,n=!0){const i=t,{id:s}=i.model,r=t=>e=>{e.id==s&&t(e.e)},_=t=>e=>{t(e.e)};switch(e){case"pan":null!=i._pan_start&&i.connect(this.pan_start,r(i._pan_start.bind(i))),null!=i._pan&&i.connect(this.pan,r(i._pan.bind(i))),null!=i._pan_end&&i.connect(this.pan_end,r(i._pan_end.bind(i)));break;case"pinch":null!=i._pinch_start&&i.connect(this.pinch_start,r(i._pinch_start.bind(i))),null!=i._pinch&&i.connect(this.pinch,r(i._pinch.bind(i))),null!=i._pinch_end&&i.connect(this.pinch_end,r(i._pinch_end.bind(i)));break;case"rotate":null!=i._rotate_start&&i.connect(this.rotate_start,r(i._rotate_start.bind(i))),null!=i._rotate&&i.connect(this.rotate,r(i._rotate.bind(i))),null!=i._rotate_end&&i.connect(this.rotate_end,r(i._rotate_end.bind(i)));break;case"move":null!=i._move_enter&&i.connect(this.move_enter,r(i._move_enter.bind(i))),null!=i._move&&i.connect(this.move,r(i._move.bind(i))),null!=i._move_exit&&i.connect(this.move_exit,r(i._move_exit.bind(i)));break;case"tap":null!=i._tap&&i.connect(this.tap,r(i._tap.bind(i)));case"doubletap":null!=i._doubletap&&i.connect(this.doubletap,r(i._doubletap.bind(i)));break;case"press":null!=i._press&&i.connect(this.press,r(i._press.bind(i)));break;case"pressup":null!=i._pressup&&i.connect(this.pressup,r(i._pressup.bind(i)));break;case"scroll":null!=i._scroll&&i.connect(this.scroll,r(i._scroll.bind(i)))}n&&(null!=i._keydown&&i.connect(this.keydown,_(i._keydown.bind(i))),null!=i._keyup&&i.connect(this.keyup,_(i._keyup.bind(i))),v.is_mobile&&null!=i._scroll&&"pinch"==e&&(h.logger.debug("Registering scroll on touch screen"),i.connect(this.scroll,r(i._scroll.bind(i)))))}_hit_test_renderers(t,e,n){var i,s;const r=t.get_renderer_views();for(const t of(0,p.reversed)(r))if(null!==(s=null===(i=t.interactive_hit)||void 0===i?void 0:i.call(t,e,n))&&void 0!==s&&s)return t;return null}set_cursor(t="default"){this.hit_area.style.cursor=t}_hit_test_frame(t,e,n){return t.frame.bbox.contains(e,n)}_hit_test_plot(t,e){for(const n of this.canvas_view.plot_views)if(n.bbox.relative().contains(t,e))return n;return null}_trigger(t,e,n){var i;if(!this.hit_area.isConnected)return;const{sx:s,sy:r}=e,_=this._hit_test_plot(s,r),a=t=>{const[n,i]=[s,r];return Object.assign(Object.assign({},e),{sx:n,sy:i})};if("panstart"==e.type||"pan"==e.type||"panend"==e.type){let i;if("panstart"==e.type&&null!=_?(this._curr_pan={plot_view:_},i=_):"pan"==e.type&&null!=this._curr_pan?i=this._curr_pan.plot_view:"panend"==e.type&&null!=this._curr_pan?(i=this._curr_pan.plot_view,this._curr_pan=null):i=null,null!=i){const e=a();this.__trigger(i,t,e,n)}}else if("pinchstart"==e.type||"pinch"==e.type||"pinchend"==e.type){let i;if("pinchstart"==e.type&&null!=_?(this._curr_pinch={plot_view:_},i=_):"pinch"==e.type&&null!=this._curr_pinch?i=this._curr_pinch.plot_view:"pinchend"==e.type&&null!=this._curr_pinch?(i=this._curr_pinch.plot_view,this._curr_pinch=null):i=null,null!=i){const e=a();this.__trigger(i,t,e,n)}}else if("rotatestart"==e.type||"rotate"==e.type||"rotateend"==e.type){let i;if("rotatestart"==e.type&&null!=_?(this._curr_rotate={plot_view:_},i=_):"rotate"==e.type&&null!=this._curr_rotate?i=this._curr_rotate.plot_view:"rotateend"==e.type&&null!=this._curr_rotate?(i=this._curr_rotate.plot_view,this._curr_rotate=null):i=null,null!=i){const e=a();this.__trigger(i,t,e,n)}}else if("mouseenter"==e.type||"mousemove"==e.type||"mouseleave"==e.type){const h=null===(i=this._prev_move)||void 0===i?void 0:i.plot_view;if(null!=h&&("mouseleave"==e.type||h!=_)){const{sx:t,sy:e}=a();this.__trigger(h,this.move_exit,{type:"mouseleave",sx:t,sy:e,modifiers:{shift:!1,ctrl:!1,alt:!1}},n)}if(null!=_&&("mouseenter"==e.type||h!=_)){const{sx:t,sy:e}=a();this.__trigger(_,this.move_enter,{type:"mouseenter",sx:t,sy:e,modifiers:{shift:!1,ctrl:!1,alt:!1}},n)}if(null!=_&&"mousemove"==e.type){const e=a();this.__trigger(_,t,e,n)}this._prev_move={sx:s,sy:r,plot_view:_}}else if(null!=_){const e=a();this.__trigger(_,t,e,n)}}__trigger(t,e,n,i){var s,r,_,a,h,o;const l=t.model.toolbar.gestures,c=e.name,u=c.split(":")[0],f=this._hit_test_renderers(t,n.sx,n.sy);if("pan"==u){if(null!=this._current_pan_view)return"pan"==c?this._current_pan_view._pan(n):"pan:end"==c&&(this._current_pan_view._pan_end(n),this._current_pan_view=null),void i.preventDefault();if(null!=f&&"pan:start"==c&&m(f)&&f._pan_start(n))return this._current_pan_view=f,void i.preventDefault()}else if("pinch"==u){if(null!=this._current_pinch_view)return"pinch"==c?this._current_pinch_view._pinch(n):"pinch:end"==c&&(this._current_pinch_view._pinch_end(n),this._current_pinch_view=null),void i.preventDefault();if(null!=f&&"pinch:start"==c&&g(f)&&f._pinch_start(n))return this._current_pinch_view=f,void i.preventDefault()}else if("rotate"==u){if(null!=this._current_rotate_view)return"rotate"==c?this._current_rotate_view._rotate(n):"rotate:end"==c&&(this._current_rotate_view._rotate_end(n),this._current_rotate_view=null),void i.preventDefault();if(null!=f&&"rotate:start"==c&&y(f)&&f._rotate_start(n))return this._current_rotate_view=f,void i.preventDefault()}else"move"==u&&(this._current_move_view==f?null===(s=this._current_move_view)||void 0===s||s._move(n):(null===(r=this._current_move_view)||void 0===r||r._move_end(n),this._current_move_view=null,null!=f&&d(f)&&f._move_start(n)&&(this._current_move_view=f)));switch(u){case"move":{const i=l.move.active;null!=i&&this.trigger(e,n,i.id);const s=t.model.toolbar.inspectors.filter((t=>t.active));let r="default";null!=f?(r=null!==(_=f.cursor(n.sx,n.sy))&&void 0!==_?_:r,f.model.propagate_hover||(0,p.is_empty)(s)||(e=this.move_exit)):this._hit_test_frame(t,n.sx,n.sy)&&((0,p.is_empty)(s)||(r="crosshair")),this.set_cursor(r),s.map((t=>this.trigger(e,n,t.id)));break}case"tap":{const s=null!==(a=i.path)&&void 0!==a?a:i.composedPath();if(0!=s.length&&s[0]!=this.hit_area)return;if(null===(h=null==f?void 0:f.on_hit)||void 0===h||h.call(f,n.sx,n.sy),this._hit_test_frame(t,n.sx,n.sy)){const t=l.tap.active;null!=t&&this.trigger(e,n,t.id)}break}case"doubletap":if(this._hit_test_frame(t,n.sx,n.sy)){const t=null!==(o=l.doubletap.active)&&void 0!==o?o:l.tap.active;null!=t&&this.trigger(e,n,t.id)}break;case"scroll":{const t=l[v.is_mobile?"pinch":"scroll"].active;null!=t&&(i.preventDefault(),i.stopPropagation(),this.trigger(e,n,t.id));break}case"pan":{const t=l.pan.active;null!=t&&(i.preventDefault(),this.trigger(e,n,t.id));break}default:{const t=l[u].active;null!=t&&this.trigger(e,n,t.id)}}this._trigger_bokeh_event(t,n)}trigger(t,e,n=null){t.emit({id:n,e})}_trigger_bokeh_event(t,e){const n=(()=>{const{sx:n,sy:i,modifiers:s}=e,r=t.frame.x_scale.invert(n),_=t.frame.y_scale.invert(i);switch(e.type){case"wheel":return new l.MouseWheel(n,i,r,_,e.delta,s);case"mousemove":return new l.MouseMove(n,i,r,_,s);case"mouseenter":return new l.MouseEnter(n,i,r,_,s);case"mouseleave":return new l.MouseLeave(n,i,r,_,s);case"tap":return new l.Tap(n,i,r,_,s);case"doubletap":return new l.DoubleTap(n,i,r,_,s);case"press":return new l.Press(n,i,r,_,s);case"pressup":return new l.PressUp(n,i,r,_,s);case"pan":return new l.Pan(n,i,r,_,e.dx,e.dy,s);case"panstart":return new l.PanStart(n,i,r,_,s);case"panend":return new l.PanEnd(n,i,r,_,s);case"pinch":return new l.Pinch(n,i,r,_,e.scale,s);case"pinchstart":return new l.PinchStart(n,i,r,_,s);case"pinchend":return new l.PinchEnd(n,i,r,_,s);case"rotate":return new l.Rotate(n,i,r,_,e.rotation,s);case"rotatestart":return new l.RotateStart(n,i,r,_,s);case"rotateend":return new l.RotateEnd(n,i,r,_,s);default:return}})();null!=n&&t.model.trigger_event(n)}_get_sxy(t){const{pageX:e,pageY:n}=function(t){return"undefined"!=typeof TouchEvent&&t instanceof TouchEvent}(t)?(0!=t.touches.length?t.touches:t.changedTouches)[0]:t,{left:i,top:s}=(0,o.offset_bbox)(this.hit_area);return{sx:e-i,sy:n-s}}_get_modifiers(t){return{shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey}}_pan_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{dx:t.deltaX,dy:t.deltaY,modifiers:this._get_modifiers(t.srcEvent)})}_pinch_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{scale:t.scale,modifiers:this._get_modifiers(t.srcEvent)})}_rotate_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{rotation:t.rotation,modifiers:this._get_modifiers(t.srcEvent)})}_tap_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{modifiers:this._get_modifiers(t.srcEvent)})}_move_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t)),{modifiers:this._get_modifiers(t)})}_scroll_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t)),{delta:(0,c.getDeltaY)(t),modifiers:this._get_modifiers(t)})}_key_event(t){return{type:t.type,key:t.key,modifiers:this._get_modifiers(t)}}_pan_start(t){const e=this._pan_event(t);e.sx-=t.deltaX,e.sy-=t.deltaY,this._trigger(this.pan_start,e,t.srcEvent)}_pan(t){this._trigger(this.pan,this._pan_event(t),t.srcEvent)}_pan_end(t){this._trigger(this.pan_end,this._pan_event(t),t.srcEvent)}_pinch_start(t){this._trigger(this.pinch_start,this._pinch_event(t),t.srcEvent)}_pinch(t){this._trigger(this.pinch,this._pinch_event(t),t.srcEvent)}_pinch_end(t){this._trigger(this.pinch_end,this._pinch_event(t),t.srcEvent)}_rotate_start(t){this._trigger(this.rotate_start,this._rotate_event(t),t.srcEvent)}_rotate(t){this._trigger(this.rotate,this._rotate_event(t),t.srcEvent)}_rotate_end(t){this._trigger(this.rotate_end,this._rotate_event(t),t.srcEvent)}_tap(t){this._trigger(this.tap,this._tap_event(t),t.srcEvent)}_doubletap(t){this._trigger(this.doubletap,this._tap_event(t),t.srcEvent)}_press(t){this._trigger(this.press,this._tap_event(t),t.srcEvent)}_pressup(t){this._trigger(this.pressup,this._tap_event(t),t.srcEvent)}_mouse_enter(t){this._trigger(this.move_enter,this._move_event(t),t)}_mouse_move(t){this._trigger(this.move,this._move_event(t),t)}_mouse_exit(t){this._trigger(this.move_exit,this._move_event(t),t)}_mouse_wheel(t){this._trigger(this.scroll,this._scroll_event(t),t)}_context_menu(t){}_key_down(t){this.trigger(this.keydown,this._key_event(t))}_key_up(t){this.trigger(this.keyup,this._key_event(t))}}n.UIEventBus=f,f.__name__="UIEventBus"}, function _(t,e,i,n,r){ /*! Hammer.JS - v2.0.7 - 2016-04-22 @@ -1265,7 +1265,7 @@

Plots# function _(n,i,o,a,p){a(),p("CoordinateMapping",n(84).CoordinateMapping)}, function _(m,o,n,r,a){r(),a("Expression",m(301).Expression),a("CustomJSExpr",m(302).CustomJSExpr),a("Stack",m(303).Stack),a("CumSum",m(304).CumSum),a("ScalarExpression",m(301).ScalarExpression),a("Minimum",m(305).Minimum),a("Maximum",m(306).Maximum);var s=m(307);a("XComponent",s.XComponent),a("YComponent",s.YComponent),a("PolarTransform",m(308).PolarTransform)}, function _(e,t,s,i,r){i();const n=e(50);class _ extends n.Model{constructor(e){super(e)}initialize(){super.initialize(),this._result=new Map}v_compute(e){let t=this._result.get(e);return(void 0===t||e.changed_for(this))&&(t=this._v_compute(e),this._result.set(e,t)),t}}s.Expression=_,_.__name__="Expression";class o extends n.Model{constructor(e){super(e)}initialize(){super.initialize(),this._result=new Map}compute(e){let t=this._result.get(e);return(void 0===t||e.changed_for(this))&&(t=this._compute(e),this._result.set(e,t)),t}}s.ScalarExpression=o,o.__name__="ScalarExpression"}, -function _(e,s,n,t,r){var o;t();const a=e(14),c=e(301),i=e(23),u=e(10),l=e(9),h=e(38),g=e(8);class v extends c.Expression{constructor(e){super(e)}connect_signals(){super.connect_signals();for(const e of(0,l.values)(this.args))e instanceof a.HasProps&&e.change.connect((()=>{this._result.clear(),this.change.emit()}))}get names(){return(0,l.keys)(this.args)}get values(){return(0,l.values)(this.args)}get func(){const e=(0,h.use_strict)(this.code);return new i.GeneratorFunction(...this.names,e)}_v_compute(e){var s,n;const t=this.func.apply(e,this.values);let r=t.next();if(null!==(s=r.done)&&void 0!==s&&s&&void 0!==r.value){const{value:s}=r;return(0,g.isArray)(s)||(0,g.isTypedArray)(s)?s:(0,g.isIterable)(s)?[...s]:(0,u.repeat)(s,e.length)}{const e=[];do{e.push(r.value),r=t.next()}while(null===(n=r.done)||void 0===n||!n);return e}}}n.CustomJSExpr=v,o=v,v.__name__="CustomJSExpr",o.define((({Unknown:e,String:s,Dict:n})=>({args:[n(e),{}],code:[s,""]})))}, +function _(e,s,n,t,r){var o;t();const a=e(14),c=e(301),i=e(23),u=e(10),l=e(9),h=e(39),g=e(8);class v extends c.Expression{constructor(e){super(e)}connect_signals(){super.connect_signals();for(const e of(0,l.values)(this.args))e instanceof a.HasProps&&e.change.connect((()=>{this._result.clear(),this.change.emit()}))}get names(){return(0,l.keys)(this.args)}get values(){return(0,l.values)(this.args)}get func(){const e=(0,h.use_strict)(this.code);return new i.GeneratorFunction(...this.names,e)}_v_compute(e){var s,n;const t=this.func.apply(e,this.values);let r=t.next();if(null!==(s=r.done)&&void 0!==s&&s&&void 0!==r.value){const{value:s}=r;return(0,g.isArray)(s)||(0,g.isTypedArray)(s)?s:(0,g.isIterable)(s)?[...s]:(0,u.repeat)(s,e.length)}{const e=[];do{e.push(r.value),r=t.next()}while(null===(n=r.done)||void 0===n||!n);return e}}}n.CustomJSExpr=v,o=v,v.__name__="CustomJSExpr",o.define((({Unknown:e,String:s,Dict:n})=>({args:[n(e),{}],code:[s,""]})))}, function _(t,n,e,o,r){var s;o();const c=t(301),a=t(9);class i extends c.Expression{constructor(t){super(t)}_v_compute(t){var n;const e=null!==(n=t.get_length())&&void 0!==n?n:0,o=new Float64Array(e);for(const n of this.fields){const r=(0,a.dict)(t.data).get(n);if(null!=r){const t=Math.min(e,r.length);for(let n=0;n({fields:[n(t),[]]})))}, function _(e,n,t,o,r){var i;o();const l=e(301);class u extends l.Expression{constructor(e){super(e)}_v_compute(e){var n;const t=new Float64Array(null!==(n=e.get_length())&&void 0!==n?n:0),o=e.data[this.field],r=this.include_zero?1:0;t[0]=this.include_zero?0:o[0];for(let e=1;e({field:[n],include_zero:[e,!1]})))}, function _(i,n,t,e,a){var r;e();const s=i(301),c=i(9),m=i(10);class u extends s.ScalarExpression{constructor(i){super(i)}_compute(i){var n;const t=null!==(n=(0,c.dict)(i.data).get(this.field))&&void 0!==n?n:[];return Math.min(this.initial,(0,m.min)(t))}}t.Minimum=u,r=u,u.__name__="Minimum",r.define((({Number:i,String:n})=>({field:[n],initial:[i,1/0]})))}, @@ -1274,7 +1274,7 @@

Plots# function _(r,t,e,n,o){var i;n();const a=r(1),s=r(307),c=r(19),l=a.__importStar(r(17));class d extends s.CoordinateTransform{constructor(r){super(r)}_v_compute(r){const t=this.properties.radius.uniform(r),e=this.properties.angle.uniform(r),n="anticlock"==this.direction?-1:1,o=Math.min(t.length,e.length),i=new Float64Array(o),a=new Float64Array(o);for(let r=0;r({radius:[l.DistanceSpec,{field:"radius"}],angle:[l.AngleSpec,{field:"angle"}],direction:[c.Direction,"anticlock"]})))}, function _(e,i,r,t,l){t(),l("BooleanFilter",e(310).BooleanFilter),l("CustomJSFilter",e(311).CustomJSFilter),l("Filter",e(219).Filter),l("GroupFilter",e(312).GroupFilter),l("IndexFilter",e(313).IndexFilter),l("AllIndices",e(220).AllIndices),l("InversionFilter",e(314).InversionFilter),l("IntersectionFilter",e(221).IntersectionFilter),l("UnionFilter",e(315).UnionFilter),l("DifferenceFilter",e(316).DifferenceFilter),l("SymmetricDifferenceFilter",e(317).SymmetricDifferenceFilter)}, function _(e,l,n,o,s){var t;o();const a=e(219),r=e(23);class i extends a.Filter{constructor(e){super(e)}compute_indices(e){var l;const n=null!==(l=e.get_length())&&void 0!==l?l:1,{booleans:o}=this;return null==o?r.Indices.all_set(n):r.Indices.from_booleans(n,o)}}n.BooleanFilter=i,t=i,i.__name__="BooleanFilter",t.define((({Boolean:e,Array:l,Nullable:n})=>({booleans:[n(l(e)),null]})))}, -function _(e,n,r,s,t){var i;s();const o=e(219),u=e(23),c=e(9),a=e(8),l=e(38);class f extends o.Filter{constructor(e){super(e)}get names(){return(0,c.keys)(this.args)}get values(){return(0,c.values)(this.args)}get func(){const e=(0,l.use_strict)(this.code);return new Function(...this.names,"source",e)}compute_indices(e){var n;const r=null!==(n=e.get_length())&&void 0!==n?n:1,s=this.func(...this.values,e);if(null==s)return u.Indices.all_set(r);if((0,a.isArrayOf)(s,a.isInteger))return u.Indices.from_indices(r,s);if((0,a.isArrayOf)(s,a.isBoolean))return u.Indices.from_booleans(r,s);throw new Error(`expect an array of integers or booleans, or null, got ${s}`)}}r.CustomJSFilter=f,i=f,f.__name__="CustomJSFilter",i.define((({Unknown:e,String:n,Dict:r})=>({args:[r(e),{}],code:[n,""]})))}, +function _(e,n,r,s,t){var i;s();const o=e(219),u=e(23),c=e(9),a=e(8),l=e(39);class f extends o.Filter{constructor(e){super(e)}get names(){return(0,c.keys)(this.args)}get values(){return(0,c.values)(this.args)}get func(){const e=(0,l.use_strict)(this.code);return new Function(...this.names,"source",e)}compute_indices(e){var n;const r=null!==(n=e.get_length())&&void 0!==n?n:1,s=this.func(...this.values,e);if(null==s)return u.Indices.all_set(r);if((0,a.isArrayOf)(s,a.isInteger))return u.Indices.from_indices(r,s);if((0,a.isArrayOf)(s,a.isBoolean))return u.Indices.from_booleans(r,s);throw new Error(`expect an array of integers or booleans, or null, got ${s}`)}}r.CustomJSFilter=f,i=f,f.__name__="CustomJSFilter",i.define((({Unknown:e,String:n,Dict:r})=>({args:[r(e),{}],code:[n,""]})))}, function _(n,e,t,o,r){var u;o();const s=n(219),i=n(23),l=n(18);class c extends s.Filter{constructor(n){super(n)}compute_indices(n){var e;const t=n.get_column(this.column_name),o=null!==(e=n.get_length())&&void 0!==e?e:1;if(null==t)return l.logger.warn(`${this}: groupby column '${this.column_name}' not found in the data source`),i.Indices.all_set(o);{const n=new i.Indices(o,0);for(let e=0;e({column_name:[n],group:[n]})))}, function _(e,n,i,l,t){var s;l();const c=e(219),r=e(23);class d extends c.Filter{constructor(e){super(e)}compute_indices(e){var n;const i=null!==(n=e.get_length())&&void 0!==n?n:1,{indices:l}=this;return null==l?r.Indices.all_set(i):r.Indices.from_indices(i,l)}}i.IndexFilter=d,s=d,d.__name__="IndexFilter",s.define((({Int:e,Arrayable:n,Nullable:i})=>({indices:[i(n(e)),null]})))}, function _(e,n,r,t,i){var s;t();const o=e(219);class c extends o.Filter{constructor(e){super(e)}compute_indices(e){const n=this.operand.compute_indices(e);return n.invert(),n}}r.InversionFilter=c,s=c,c.__name__="InversionFilter",s.define((({Ref:e})=>({operand:[e(o.Filter)]})))}, @@ -1289,13 +1289,13 @@

Plots# function _(n,t,o,c,s){c();const r=n(13),{abs:i,sqrt:u,min:e,max:f}=Math;o.qbb=function(n,t,o,c,s,r){function i(n,t,o){if(t==(n+o)/2)return[n,o];{const c=(n-t)/(n-2*t+o),s=n*(1-c)**2+2*t*(1-c)*c+o*c**2;return[e(n,o,s),f(n,o,s)]}}const[u,a]=i(n,o,s),[x,m]=i(t,c,r);return{x0:u,x1:a,y0:x,y1:m}},o.cbb=function(n,t,o,c,s,e,f,a){const x=f,m=a;f=o,a=c;const y=s,b=e,h=[];for(let o=0;o<=2;o++){let c,s,r;if(0==o?(s=6*n-12*f+6*y,c=-3*n+9*f-9*y+3*x,r=3*f-3*n):(s=6*t-12*a+6*b,c=-3*t+9*a-9*b+3*m,r=3*a-3*t),i(c)<1e-12){if(i(s)<1e-12)continue;const n=-r/s;00;){const o=h[p],c=1-o,s=c**3*n+3*c**2*o*f+3*c*o**2*y+o**3*x,r=c**3*t+3*c**2*o*a+3*c*o**2*b+o**3*m;q[p]=s,A[p]=r}q[l]=n,A[l]=t,q[l+1]=x,A[l+1]=m;const[g,M]=(0,r.minmax)(q),[_,d]=(0,r.minmax)(A);return{x0:g,x1:M,y0:_,y1:d}}}, function _(t,e,s,i,h){var r;i();const n=t(1),o=t(325),a=t(23),c=n.__importStar(t(17));class _ extends o.LRTBView{scenterxy(t){return[this.sleft[t]/2+this.sright[t]/2,this.stop[t]/2+this.sbottom[t]/2]}_lrtb(t){const e=this._x[t],s=this._y[t],i=this.width.get(t),h=this.height.get(t);return[Math.min(e,e+i),Math.max(e,e+i),Math.max(s,s+h),Math.min(s,s+h)]}_map_data(){const t=this.renderer.xscale.v_compute(this._x),e=this.renderer.yscale.v_compute(this._y),s=this.sdist(this.renderer.xscale,this._x,this.width,"edge"),i=this.sdist(this.renderer.yscale,this._y,this.height,"edge"),h=t.length;this.stop=new a.ScreenArray(h),this.sbottom=new a.ScreenArray(h),this.sleft=new a.ScreenArray(h),this.sright=new a.ScreenArray(h);for(let r=0;r({x:[c.XCoordinateSpec,{field:"x"}],y:[c.YCoordinateSpec,{field:"y"}],width:[c.NumberSpec,{value:1}],height:[c.NumberSpec,{value:1}]})))}, function _(t,e,r,s,i){var n;s();const a=t(1),o=t(78),h=t(203),c=t(209),_=t(101),l=t(57),d=t(236),x=a.__importStar(t(238)),m=t(237);class p extends h.GlyphView{async load_glglyph(){const{LRTBGL:e}=await Promise.resolve().then((()=>a.__importStar(t(532))));return e}get_anchor_point(t,e,r){const s=Math.min(this.sleft[e],this.sright[e]),i=Math.max(this.sright[e],this.sleft[e]),n=Math.min(this.stop[e],this.sbottom[e]),a=Math.max(this.sbottom[e],this.stop[e]);switch(t){case"top_left":return{x:s,y:n};case"top":case"top_center":return{x:(s+i)/2,y:n};case"top_right":return{x:i,y:n};case"bottom_left":return{x:s,y:a};case"bottom":case"bottom_center":return{x:(s+i)/2,y:a};case"bottom_right":return{x:i,y:a};case"left":case"center_left":return{x:s,y:(n+a)/2};case"center":case"center_center":return{x:(s+i)/2,y:(n+a)/2};case"right":case"center_right":return{x:i,y:(n+a)/2}}}_set_data(t){super._set_data(t),this.border_radius=x.border_radius(this.model.border_radius)}_index_data(t){const{min:e,max:r}=Math,{data_size:s}=this;for(let i=0;i({border_radius:[d.BorderRadius,0]})))}, -function _(s,i,e,t,r){var a;t();const n=s(1),d=s(202),h=s(78),c=s(23),_=s(19),o=n.__importStar(s(210)),u=n.__importStar(s(17)),l=n.__importStar(s(37)),x=s(13),y=s(101);class m extends d.XYGlyphView{async load_glglyph(){const{CircleGL:i}=await Promise.resolve().then((()=>n.__importStar(s(529))));return i}get use_radius(){return!(this.radius.is_Scalar()&&isNaN(this.radius.value))}_set_data(s){super._set_data(s);const i=this.use_radius?2*this.max_radius:l.max(this.size);this._configure("max_size",{value:i})}_index_data(s){if(this.use_radius){const{_x:i,_y:e,radius:t,data_size:r}=this;for(let a=0;aMath.max(s,i[e])));break}case"min":{const s=this.sdist(this.renderer.xscale,this._x,this.radius),i=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,x.map)(s,((s,e)=>Math.min(s,i[e])));break}}else this.sradius=(0,c.to_screen)(this.radius);else{const s=c.ScreenArray.from(this.size);this.sradius=(0,x.map)(s,(s=>s/2))}}_mask_data(){const{frame:s}=this.renderer.plot_view,i=s.x_target,e=s.y_target;let t,r;return this.use_radius&&"data"==this.model.properties.radius.units?(t=i.map((s=>this.renderer.xscale.invert(s))).widen(this.max_radius),r=e.map((s=>this.renderer.yscale.invert(s))).widen(this.max_radius)):(t=i.widen(this.max_size).map((s=>this.renderer.xscale.invert(s))),r=e.widen(this.max_size).map((s=>this.renderer.yscale.invert(s)))),this.index.indices({x0:t.start,x1:t.end,y0:r.start,y1:r.end})}_render(s,i,e){const{sx:t,sy:r,sradius:a}=null!=e?e:this;for(const e of i){const i=t[e],n=r[e],d=a[e];isFinite(i+n+d)&&(s.beginPath(),s.arc(i,n,d,0,2*Math.PI,!1),this.visuals.fill.apply(s,e),this.visuals.hatch.apply(s,e),this.visuals.line.apply(s,e))}}_hit_point(s){const{sx:i,sy:e}=s,t=this.renderer.xscale.invert(i),r=this.renderer.yscale.invert(e),{hit_dilation:a}=this.model,[n,d,h,c]=(()=>{if(this.use_radius&&"data"==this.model.properties.radius.units){const s=this.max_radius*a;return[t-s,t+s,r-s,r+s]}{const s=this.max_size*a,t=i-s,r=i+s,n=e-s,d=e+s,[h,c]=this.renderer.xscale.r_invert(t,r),[_,o]=this.renderer.yscale.r_invert(n,d);return[h,c,_,o]}})(),_=this.index.indices({x0:n,x1:d,y0:h,y1:c}),o=[];if(this.use_radius&&"data"==this.model.properties.radius.units)for(const s of _){const i=(this.sradius[s]*a)**2,[e,n]=this.renderer.xscale.r_compute(t,this._x[s]),[d,h]=this.renderer.yscale.r_compute(r,this._y[s]);(e-n)**2+(d-h)**2<=i&&o.push(s)}else for(const s of _){const t=(this.sradius[s]*a)**2;(this.sx[s]-i)**2+(this.sy[s]-e)**2<=t&&o.push(s)}return new y.Selection({indices:o})}_hit_span(s){const{sx:i,sy:e}=s,t=this.bounds(),[r,a,n,d]=(()=>{const r=this.use_radius&&"data"==this.model.properties.radius.units?this.max_radius:this.max_size/2;if("h"==s.direction){const s=i-r,e=i+r,[a,n]=this.renderer.xscale.r_invert(s,e),{y0:d,y1:h}=t;return[a,n,d,h]}{const s=e-r,i=e+r,{x0:a,x1:n}=t,[d,h]=this.renderer.yscale.r_invert(s,i);return[a,n,d,h]}})(),h=[...this.index.indices({x0:r,x1:a,y0:n,y1:d})];return new y.Selection({indices:h})}_hit_rect(s){const{sx0:i,sx1:e,sy0:t,sy1:r}=s,[a,n]=this.renderer.xscale.r_invert(i,e),[d,h]=this.renderer.yscale.r_invert(t,r),c=this.index.indices({x0:a,x1:n,y0:d,y1:h}),_=[];for(const s of c){const a=this.sx[s],n=this.sy[s];i<=a&&a<=e&&t<=n&&n<=r&&_.push(s)}return new y.Selection({indices:_})}_hit_poly(s){const{sx:i,sy:e}=s,[t,r]=(0,x.minmax)(i),[a,n]=(0,x.minmax)(e),[d,h]=this.renderer.xscale.r_invert(t,r),[c,_]=this.renderer.yscale.r_invert(a,n),u=this.index.indices({x0:d,x1:h,y0:c,y1:_}),l=[];for(const s of u)o.point_in_poly(this.sx[s],this.sy[s],i,e)&&l.push(s);return new y.Selection({indices:l})}draw_legend_for_index(s,{x0:i,y0:e,x1:t,y1:r},a){const n=a+1,d=new Array(n);d[a]=(i+t)/2;const h=new Array(n);h[a]=(e+r)/2;const c=new Array(n);c[a]=.2*Math.min(Math.abs(t-i),Math.abs(r-e)),this._render(s,[a],{sx:d,sy:h,sradius:c})}}e.CircleView=m,m.__name__="CircleView";class p extends d.XYGlyph{constructor(s){super(s)}}e.Circle=p,a=p,p.__name__="Circle",a.prototype.default_view=m,a.mixins([h.LineVector,h.FillVector,h.HatchVector]),a.define((({Number:s})=>({angle:[u.AngleSpec,0],size:[u.ScreenSizeSpec,{value:4}],radius:[u.NullDistanceSpec,null],radius_dimension:[_.RadiusDimension,"x"],hit_dilation:[s,1]})))}, +function _(s,i,e,t,r){var a;t();const n=s(1),d=s(202),h=s(78),c=s(23),_=s(19),o=n.__importStar(s(210)),u=n.__importStar(s(17)),l=n.__importStar(s(38)),x=s(13),y=s(101);class m extends d.XYGlyphView{async load_glglyph(){const{CircleGL:i}=await Promise.resolve().then((()=>n.__importStar(s(529))));return i}get use_radius(){return!(this.radius.is_Scalar()&&isNaN(this.radius.value))}_set_data(s){super._set_data(s);const i=this.use_radius?2*this.max_radius:l.max(this.size);this._configure("max_size",{value:i})}_index_data(s){if(this.use_radius){const{_x:i,_y:e,radius:t,data_size:r}=this;for(let a=0;aMath.max(s,i[e])));break}case"min":{const s=this.sdist(this.renderer.xscale,this._x,this.radius),i=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,x.map)(s,((s,e)=>Math.min(s,i[e])));break}}else this.sradius=(0,c.to_screen)(this.radius);else{const s=c.ScreenArray.from(this.size);this.sradius=(0,x.map)(s,(s=>s/2))}}_mask_data(){const{frame:s}=this.renderer.plot_view,i=s.x_target,e=s.y_target;let t,r;return this.use_radius&&"data"==this.model.properties.radius.units?(t=i.map((s=>this.renderer.xscale.invert(s))).widen(this.max_radius),r=e.map((s=>this.renderer.yscale.invert(s))).widen(this.max_radius)):(t=i.widen(this.max_size).map((s=>this.renderer.xscale.invert(s))),r=e.widen(this.max_size).map((s=>this.renderer.yscale.invert(s)))),this.index.indices({x0:t.start,x1:t.end,y0:r.start,y1:r.end})}_render(s,i,e){const{sx:t,sy:r,sradius:a}=null!=e?e:this;for(const e of i){const i=t[e],n=r[e],d=a[e];isFinite(i+n+d)&&(s.beginPath(),s.arc(i,n,d,0,2*Math.PI,!1),this.visuals.fill.apply(s,e),this.visuals.hatch.apply(s,e),this.visuals.line.apply(s,e))}}_hit_point(s){const{sx:i,sy:e}=s,t=this.renderer.xscale.invert(i),r=this.renderer.yscale.invert(e),{hit_dilation:a}=this.model,[n,d,h,c]=(()=>{if(this.use_radius&&"data"==this.model.properties.radius.units){const s=this.max_radius*a;return[t-s,t+s,r-s,r+s]}{const s=this.max_size*a,t=i-s,r=i+s,n=e-s,d=e+s,[h,c]=this.renderer.xscale.r_invert(t,r),[_,o]=this.renderer.yscale.r_invert(n,d);return[h,c,_,o]}})(),_=this.index.indices({x0:n,x1:d,y0:h,y1:c}),o=[];if(this.use_radius&&"data"==this.model.properties.radius.units)for(const s of _){const i=(this.sradius[s]*a)**2,[e,n]=this.renderer.xscale.r_compute(t,this._x[s]),[d,h]=this.renderer.yscale.r_compute(r,this._y[s]);(e-n)**2+(d-h)**2<=i&&o.push(s)}else for(const s of _){const t=(this.sradius[s]*a)**2;(this.sx[s]-i)**2+(this.sy[s]-e)**2<=t&&o.push(s)}return new y.Selection({indices:o})}_hit_span(s){const{sx:i,sy:e}=s,t=this.bounds(),[r,a,n,d]=(()=>{const r=this.use_radius&&"data"==this.model.properties.radius.units?this.max_radius:this.max_size/2;if("h"==s.direction){const s=i-r,e=i+r,[a,n]=this.renderer.xscale.r_invert(s,e),{y0:d,y1:h}=t;return[a,n,d,h]}{const s=e-r,i=e+r,{x0:a,x1:n}=t,[d,h]=this.renderer.yscale.r_invert(s,i);return[a,n,d,h]}})(),h=[...this.index.indices({x0:r,x1:a,y0:n,y1:d})];return new y.Selection({indices:h})}_hit_rect(s){const{sx0:i,sx1:e,sy0:t,sy1:r}=s,[a,n]=this.renderer.xscale.r_invert(i,e),[d,h]=this.renderer.yscale.r_invert(t,r),c=this.index.indices({x0:a,x1:n,y0:d,y1:h}),_=[];for(const s of c){const a=this.sx[s],n=this.sy[s];i<=a&&a<=e&&t<=n&&n<=r&&_.push(s)}return new y.Selection({indices:_})}_hit_poly(s){const{sx:i,sy:e}=s,[t,r]=(0,x.minmax)(i),[a,n]=(0,x.minmax)(e),[d,h]=this.renderer.xscale.r_invert(t,r),[c,_]=this.renderer.yscale.r_invert(a,n),u=this.index.indices({x0:d,x1:h,y0:c,y1:_}),l=[];for(const s of u)o.point_in_poly(this.sx[s],this.sy[s],i,e)&&l.push(s);return new y.Selection({indices:l})}draw_legend_for_index(s,{x0:i,y0:e,x1:t,y1:r},a){const n=a+1,d=new Array(n);d[a]=(i+t)/2;const h=new Array(n);h[a]=(e+r)/2;const c=new Array(n);c[a]=.2*Math.min(Math.abs(t-i),Math.abs(r-e)),this._render(s,[a],{sx:d,sy:h,sradius:c})}}e.CircleView=m,m.__name__="CircleView";class p extends d.XYGlyph{constructor(s){super(s)}}e.Circle=p,a=p,p.__name__="Circle",a.prototype.default_view=m,a.mixins([h.LineVector,h.FillVector,h.HatchVector]),a.define((({Number:s})=>({angle:[u.AngleSpec,0],size:[u.ScreenSizeSpec,{value:4}],radius:[u.NullDistanceSpec,null],radius_dimension:[_.RadiusDimension,"x"],hit_dilation:[s,1]})))}, function _(t,s,e,i,h){var r;i();const n=t(1),a=t(328),l=n.__importStar(t(210)),o=t(23),_=t(101),d=n.__importStar(t(17));class c extends a.CenterRotatableView{_map_data(){"data"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.width,"center"):this.sw=(0,o.to_screen)(this.width),"data"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.height,"center"):this.sh=(0,o.to_screen)(this.height)}_render(t,s,e){const{sx:i,sy:h,sw:r,sh:n,angle:a}=null!=e?e:this;for(const e of s){const s=i[e],l=h[e],o=r[e],_=n[e],d=a.get(e);isFinite(s+l+o+_+d)&&(t.beginPath(),t.ellipse(s,l,o/2,_/2,d,0,2*Math.PI),this.visuals.fill.apply(t,e),this.visuals.hatch.apply(t,e),this.visuals.line.apply(t,e))}}_hit_point(t){let s,e,i,h,r,n,a,o,d;const{sx:c,sy:p}=t,w=this.renderer.xscale.invert(c),x=this.renderer.yscale.invert(p);"data"==this.model.properties.width.units?(s=w-this.max_width,e=w+this.max_width):(n=c-this.max_width,a=c+this.max_width,[s,e]=this.renderer.xscale.r_invert(n,a)),"data"==this.model.properties.height.units?(i=x-this.max_height,h=x+this.max_height):(o=p-this.max_height,d=p+this.max_height,[i,h]=this.renderer.yscale.r_invert(o,d));const y=this.index.indices({x0:s,x1:e,y0:i,y1:h}),m=[];for(const t of y)r=l.point_in_ellipse(c,p,this.angle.get(t),this.sh[t]/2,this.sw[t]/2,this.sx[t],this.sy[t]),r&&m.push(t);return new _.Selection({indices:m})}draw_legend_for_index(t,{x0:s,y0:e,x1:i,y1:h},r){const n=r+1,a=new Array(n);a[r]=(s+i)/2;const l=new Array(n);l[r]=(e+h)/2;const o=this.sw[r]/this.sh[r],_=.8*Math.min(Math.abs(i-s),Math.abs(h-e)),c=new Array(n),p=new Array(n);o>1?(c[r]=_,p[r]=_/o):(c[r]=_*o,p[r]=_);const w=new d.UniformScalar(0,n);this._render(t,[r],{sx:a,sy:l,sw:c,sh:p,angle:w})}}e.EllipseView=c,c.__name__="EllipseView";class p extends a.CenterRotatable{constructor(t){super(t)}}e.Ellipse=p,r=p,p.__name__="Ellipse",r.prototype.default_view=c}, function _(e,t,i,a,n){var r;a();const s=e(1),h=e(202),o=e(78),_=s.__importStar(e(17));class c extends h.XYGlyphView{get max_w2(){return"data"==this.model.properties.width.units?this.max_width/2:0}get max_h2(){return"data"==this.model.properties.height.units?this.max_height/2:0}_bounds({x0:e,x1:t,y0:i,y1:a}){const{max_w2:n,max_h2:r}=this;return{x0:e-n,x1:t+n,y0:i-r,y1:a+r}}}i.CenterRotatableView=c,c.__name__="CenterRotatableView";class l extends h.XYGlyph{constructor(e){super(e)}}i.CenterRotatable=l,r=l,l.__name__="CenterRotatable",r.mixins([o.LineVector,o.FillVector,o.HatchVector]),r.define((({})=>({angle:[_.AngleSpec,0],width:[_.DistanceSpec,{field:"width"}],height:[_.DistanceSpec,{field:"height"}]})))}, function _(t,e,s,i,h){var r;i();const a=t(1),n=t(325),_=t(23),o=a.__importStar(t(17));class c extends n.LRTBView{scenterxy(t){return[(this.sleft[t]+this.sright[t])/2,this.sy[t]]}_lrtb(t){const e=this._left[t],s=this._right[t],i=this._y[t],h=this.height.get(t)/2;return[Math.min(e,s),Math.max(e,s),i+h,i-h]}_map_data(){this.sy=this.renderer.yscale.v_compute(this._y),this.sh=this.sdist(this.renderer.yscale,this._y,this.height,"center"),this.sleft=this.renderer.xscale.v_compute(this._left),this.sright=this.renderer.xscale.v_compute(this._right);const t=this.sy.length;this.stop=new _.ScreenArray(t),this.sbottom=new _.ScreenArray(t);for(let e=0;e({left:[o.XCoordinateSpec,{value:0}],y:[o.YCoordinateSpec,{field:"y"}],height:[o.NumberSpec,{value:1}],right:[o.XCoordinateSpec,{field:"right"}]})))}, -function _(t,e,n,i,s){var r;i();const _=t(1),a=t(203),o=t(209),d=t(101),c=t(78),h=_.__importStar(t(37)),l=t(13),p=t(10),u=_.__importStar(t(17)),{abs:y,max:f}=Math;class x extends a.GlyphView{after_visuals(){super.after_visuals(),this.max_line_width=h.max(this.line_width)}_index_data(t){for(const e of this._y)t.add_point(0,e)}_bounds(t){const{y0:e,y1:n}=t;return{x0:NaN,x1:NaN,y0:e,y1:n}}_map_data(){super._map_data();const{round:t}=Math;this.sy=(0,l.map)(this.sy,(e=>t(e)))}scenterxy(t){const{hcenter:e}=this.renderer.plot_view.frame.bbox;return[e,this.sy[t]]}_render(t,e,n){const{sy:i}=null!=n?n:this,{left:s,right:r}=this.renderer.plot_view.frame.bbox;for(const n of e){const e=i[n];isFinite(e)&&(t.beginPath(),t.moveTo(s,e),t.lineTo(r,e),this.visuals.line.apply(t,n))}}_get_candidates(t,e){const{max_line_width:n}=this,[i,s]=this.renderer.yscale.r_invert(t-n,(null!=e?e:t)+n);return this.index.indices({x0:0,x1:0,y0:i,y1:s})}_find_spans(t,e){const{sy:n,line_width:i}=this,s=[];for(const r of t){e(n[r],i.get(r))&&s.push(r)}return s}_hit_point(t){const{sy:e}=t,n=this._get_candidates(e),i=this._find_spans(n,((t,n)=>y(t-e)<=f(n/2,2)));return new d.Selection({indices:i})}_hit_span(t){const e=(()=>{if("v"==t.direction)return(0,p.range)(0,this.data_size);{const{sy:e}=t,n=this._get_candidates(e);return this._find_spans(n,((t,n)=>y(t-e)<=f(n/2,2)))}})();return new d.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sy0:e,sy1:n}=t,i=this._get_candidates(e,n);return this._find_spans(i,((t,i)=>e-i/2<=t&&t<=n+i/2))})();return new d.Selection({indices:e})}draw_legend_for_index(t,e,n){(0,o.generic_line_vector_legend)(this.visuals,t,e,n)}}n.HSpanView=x,x.__name__="HSpanView";class m extends a.Glyph{constructor(t){super(t)}}n.HSpan=m,r=m,m.__name__="HSpan",r.prototype.default_view=x,r.mixins([c.LineVector]),r.define((()=>({y:[u.YCoordinateSpec,{field:"y"}]})))}, -function _(t,e,i,s,r){var n;s();const a=t(1),_=t(203),o=t(209),l=t(101),h=t(78),c=t(23),d=a.__importStar(t(37)),p=t(13),y=t(10),u=a.__importStar(t(17));class f extends _.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:e}=this.renderer.plot_view.canvas_view;if(null!=e&&e.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>a.__importStar(t(532))));this.glglyph=new i(e.regl_wrapper,this)}}get sleft(){const{left:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new c.ScreenArray(e);return i.fill(t),i}get sright(){const{right:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new c.ScreenArray(e);return i.fill(t),i}get stop(){return this.sy0}get sbottom(){return this.sy1}after_visuals(){super.after_visuals(),this.max_line_width=d.max(this.line_width)}_index_data(t){const{_y0:e,_y1:i,data_size:s}=this;for(let r=0;rt(e))),this.sy1=(0,p.map)(this.sy1,(e=>t(e)))}scenterxy(t){const{hcenter:e}=this.renderer.plot_view.frame.bbox;return[e,(this.sy0[t]+this.sy1[t])/2]}_render(t,e,i){const{sy0:s,sy1:r}=null!=i?i:this,{left:n,right:a,width:_}=this.renderer.plot_view.frame.bbox;for(const i of e){const e=s[i],o=r[i];isFinite(e+o)&&(t.beginPath(),t.rect(n,e,_,o-e),this.visuals.fill.apply(t,i),this.visuals.hatch.apply(t,i),t.beginPath(),t.moveTo(n,e),t.lineTo(a,e),t.moveTo(n,o),t.lineTo(a,o),this.visuals.line.apply(t,i))}}_get_candidates(t,e){const{max_line_width:i}=this,[s,r]=this.renderer.yscale.r_invert(t-i,(null!=e?e:t)+i);return this.index.indices({x0:0,x1:0,y0:s,y1:r})}_find_strips(t,e){function i(t,i){return t<=i?e(t,i):e(i,t)}const{sy0:s,sy1:r}=this,n=[];for(const e of t){i(s[e],r[e])&&n.push(e)}return n}_hit_point(t){const{sy:e}=t,i=this._get_candidates(e),s=this._find_strips(i,((t,i)=>t<=e&&e<=i));return new l.Selection({indices:s})}_hit_span(t){const e=(()=>{if("v"==t.direction)return(0,y.range)(0,this.data_size);{const{sy:e}=t,i=this._get_candidates(e);return this._find_strips(i,((t,i)=>t<=e&&e<=i))}})();return new l.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sy0:e,sy1:i}=t,s=this._get_candidates(e,i);return this._find_strips(s,((t,s)=>e<=t&&t<=i&&e<=s&&s<=i))})();return new l.Selection({indices:e})}draw_legend_for_index(t,e,i){(0,o.generic_area_vector_legend)(this.visuals,t,e,i)}}i.HStripView=f,f.__name__="HStripView";class w extends _.Glyph{constructor(t){super(t)}}i.HStrip=w,n=w,w.__name__="HStrip",n.prototype.default_view=f,n.mixins([h.LineVector,h.FillVector,h.HatchVector]),n.define((()=>({y0:[u.YCoordinateSpec,{field:"y0"}],y1:[u.YCoordinateSpec,{field:"y1"}]})))}, -function _(e,t,s,i,r){var n;i();const a=e(1),o=e(203),c=a.__importStar(e(210)),l=a.__importStar(e(17)),h=e(78),_=e(19),d=e(105),p=e(209),x=e(101);class y extends o.GlyphView{async load_glglyph(){const{HexTileGL:t}=await Promise.resolve().then((()=>a.__importStar(e(530))));return t}scenterxy(e){return[this.sx[e],this.sy[e]]}_set_data(){const{orientation:e,size:t,aspect_scale:s}=this.model,{q:i,r}=this,n=this.q.length;this._x=new Float64Array(n),this._y=new Float64Array(n);const{_x:a,_y:o}=this,c=Math.sqrt(3);if("pointytop"==e)for(let e=0;e({r:[l.NumberSpec,{field:"r"}],q:[l.NumberSpec,{field:"q"}],scale:[l.NumberSpec,1],size:[e,1],aspect_scale:[e,1],orientation:[_.HexTileOrientation,"pointytop"]}))),n.override({line_color:null})}, +function _(t,e,n,i,s){var r;i();const _=t(1),a=t(203),o=t(209),d=t(101),c=t(78),h=_.__importStar(t(38)),l=t(13),p=t(10),u=_.__importStar(t(17)),{abs:y,max:f}=Math;class x extends a.GlyphView{after_visuals(){super.after_visuals(),this.max_line_width=h.max(this.line_width)}_index_data(t){for(const e of this._y)t.add_point(0,e)}_bounds(t){const{y0:e,y1:n}=t;return{x0:NaN,x1:NaN,y0:e,y1:n}}_map_data(){super._map_data();const{round:t}=Math;this.sy=(0,l.map)(this.sy,(e=>t(e)))}scenterxy(t){const{hcenter:e}=this.renderer.plot_view.frame.bbox;return[e,this.sy[t]]}_render(t,e,n){const{sy:i}=null!=n?n:this,{left:s,right:r}=this.renderer.plot_view.frame.bbox;for(const n of e){const e=i[n];isFinite(e)&&(t.beginPath(),t.moveTo(s,e),t.lineTo(r,e),this.visuals.line.apply(t,n))}}_get_candidates(t,e){const{max_line_width:n}=this,[i,s]=this.renderer.yscale.r_invert(t-n,(null!=e?e:t)+n);return this.index.indices({x0:0,x1:0,y0:i,y1:s})}_find_spans(t,e){const{sy:n,line_width:i}=this,s=[];for(const r of t){e(n[r],i.get(r))&&s.push(r)}return s}_hit_point(t){const{sy:e}=t,n=this._get_candidates(e),i=this._find_spans(n,((t,n)=>y(t-e)<=f(n/2,2)));return new d.Selection({indices:i})}_hit_span(t){const e=(()=>{if("v"==t.direction)return(0,p.range)(0,this.data_size);{const{sy:e}=t,n=this._get_candidates(e);return this._find_spans(n,((t,n)=>y(t-e)<=f(n/2,2)))}})();return new d.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sy0:e,sy1:n}=t,i=this._get_candidates(e,n);return this._find_spans(i,((t,i)=>e-i/2<=t&&t<=n+i/2))})();return new d.Selection({indices:e})}draw_legend_for_index(t,e,n){(0,o.generic_line_vector_legend)(this.visuals,t,e,n)}}n.HSpanView=x,x.__name__="HSpanView";class m extends a.Glyph{constructor(t){super(t)}}n.HSpan=m,r=m,m.__name__="HSpan",r.prototype.default_view=x,r.mixins([c.LineVector]),r.define((()=>({y:[u.YCoordinateSpec,{field:"y"}]})))}, +function _(t,e,i,s,r){var n;s();const a=t(1),_=t(203),o=t(209),l=t(101),h=t(78),c=t(23),d=a.__importStar(t(38)),p=t(13),y=t(10),u=a.__importStar(t(17));class f extends _.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:e}=this.renderer.plot_view.canvas_view;if(null!=e&&e.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>a.__importStar(t(532))));this.glglyph=new i(e.regl_wrapper,this)}}get sleft(){const{left:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new c.ScreenArray(e);return i.fill(t),i}get sright(){const{right:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new c.ScreenArray(e);return i.fill(t),i}get stop(){return this.sy0}get sbottom(){return this.sy1}after_visuals(){super.after_visuals(),this.max_line_width=d.max(this.line_width)}_index_data(t){const{_y0:e,_y1:i,data_size:s}=this;for(let r=0;rt(e))),this.sy1=(0,p.map)(this.sy1,(e=>t(e)))}scenterxy(t){const{hcenter:e}=this.renderer.plot_view.frame.bbox;return[e,(this.sy0[t]+this.sy1[t])/2]}_render(t,e,i){const{sy0:s,sy1:r}=null!=i?i:this,{left:n,right:a,width:_}=this.renderer.plot_view.frame.bbox;for(const i of e){const e=s[i],o=r[i];isFinite(e+o)&&(t.beginPath(),t.rect(n,e,_,o-e),this.visuals.fill.apply(t,i),this.visuals.hatch.apply(t,i),t.beginPath(),t.moveTo(n,e),t.lineTo(a,e),t.moveTo(n,o),t.lineTo(a,o),this.visuals.line.apply(t,i))}}_get_candidates(t,e){const{max_line_width:i}=this,[s,r]=this.renderer.yscale.r_invert(t-i,(null!=e?e:t)+i);return this.index.indices({x0:0,x1:0,y0:s,y1:r})}_find_strips(t,e){function i(t,i){return t<=i?e(t,i):e(i,t)}const{sy0:s,sy1:r}=this,n=[];for(const e of t){i(s[e],r[e])&&n.push(e)}return n}_hit_point(t){const{sy:e}=t,i=this._get_candidates(e),s=this._find_strips(i,((t,i)=>t<=e&&e<=i));return new l.Selection({indices:s})}_hit_span(t){const e=(()=>{if("v"==t.direction)return(0,y.range)(0,this.data_size);{const{sy:e}=t,i=this._get_candidates(e);return this._find_strips(i,((t,i)=>t<=e&&e<=i))}})();return new l.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sy0:e,sy1:i}=t,s=this._get_candidates(e,i);return this._find_strips(s,((t,s)=>e<=t&&t<=i&&e<=s&&s<=i))})();return new l.Selection({indices:e})}draw_legend_for_index(t,e,i){(0,o.generic_area_vector_legend)(this.visuals,t,e,i)}}i.HStripView=f,f.__name__="HStripView";class w extends _.Glyph{constructor(t){super(t)}}i.HStrip=w,n=w,w.__name__="HStrip",n.prototype.default_view=f,n.mixins([h.LineVector,h.FillVector,h.HatchVector]),n.define((()=>({y0:[u.YCoordinateSpec,{field:"y0"}],y1:[u.YCoordinateSpec,{field:"y1"}]})))}, +function _(e,t,s,i,r){var n;i();const a=e(1),o=e(203),c=a.__importStar(e(210)),l=a.__importStar(e(17)),h=e(78),_=e(19),d=e(105),p=e(209),x=e(101);class y extends o.GlyphView{async load_glglyph(){const{HexTileGL:t}=await Promise.resolve().then((()=>a.__importStar(e(530))));return t}scenterxy(e){return[this.sx[e],this.sy[e]]}_set_data(){const{orientation:e,size:t,aspect_scale:s}=this.model,{q:i,r}=this,n=this.q.length;this._x=new Float64Array(n),this._y=new Float64Array(n);const{_x:a,_y:o}=this,c=Math.sqrt(3);if("pointytop"==e)for(let e=0;e({r:[l.NumberSpec,{field:"r"}],q:[l.NumberSpec,{field:"q"}],scale:[l.NumberSpec,1],size:[e,1],aspect_scale:[e,1],orientation:[_.HexTileOrientation,"pointytop"]}))),n.override({line_color:null})}, function _(e,a,t,_,r){var n;_();const s=e(334),o=e(197),i=e(245);class p extends s.ImageBaseView{connect_signals(){super.connect_signals(),this.connect(this.model.color_mapper.change,(()=>this._update_image()))}_update_image(){null!=this._image_data&&(this._set_data(null),this.renderer.request_render())}_flat_img_to_buf8(e){return this.model.color_mapper.rgba_mapper.v_compute(e)}}t.ImageView=p,p.__name__="ImageView";class m extends s.ImageBase{constructor(e){super(e)}}t.Image=m,n=m,m.__name__="Image",n.prototype.default_view=p,n.define((({Ref:e})=>({color_mapper:[e(o.ColorMapper),()=>new i.LinearColorMapper({palette:["#000000","#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0","#ffffff"]})]})))}, function _(e,t,s,i,a){var r;i();const n=e(1),h=e(202),_=e(23),o=e(19),d=n.__importStar(e(17)),c=n.__importStar(e(78)),l=e(101),g=e(12),m=e(236),u=e(238);class x extends h.XYGlyphView{constructor(){super(...arguments),this._image_data=null}get image_data(){return(0,g.assert)(null!=this._image_data,"data not set"),this._image_data}connect_signals(){super.connect_signals(),this.connect(this.model.properties.global_alpha.change,(()=>this.renderer.request_render()))}get image_dimension(){return 2}get xy_scale(){switch(this.model.origin){case"bottom_left":return{x:1,y:-1};case"top_left":return{x:1,y:1};case"bottom_right":return{x:-1,y:-1};case"top_right":return{x:-1,y:1}}}get xy_offset(){switch(this.model.origin){case"bottom_left":return{x:0,y:1};case"top_left":return{x:0,y:0};case"bottom_right":return{x:1,y:1};case"top_right":return{x:1,y:0}}}get xy_anchor(){return(0,u.anchor)(this.model.anchor)}get xy_sign(){const e=this.renderer.xscale.source_range,t=this.renderer.yscale.source_range;return{x:e.is_reversed?-1:1,y:t.is_reversed?-1:1}}_render(e,t,s){const{image_data:i,sx:a,sy:r,sw:n,sh:h}=null!=s?s:this,{xy_sign:_,xy_scale:o,xy_offset:d,xy_anchor:c}=this;if(e.save(),e.imageSmoothingEnabled=!1,this.visuals.image.doit)for(const s of t){const t=i[s],l=a[s],g=r[s],m=n[s],u=h[s];if(null==t||!isFinite(l+g+m+u))continue;const x=_.x*c.x*m,y=_.y*c.y*u;e.save(),e.translate(l-x,g-y),e.scale(_.x*o.x,_.y*o.y),this.visuals.image.set_vectorize(e,s),e.drawImage(t,-d.x*m,-d.y*u,m,u),e.restore()}e.restore()}_set_data(e){const t=this.data_size;null!=this._image_data&&this._image_data.length==t||(this._image_data=new Array(t).fill(null),this._width=new Uint32Array(t),this._height=new Uint32Array(t));const{image_dimension:s}=this;for(let i=0;i({image:[d.NDArraySpec,{field:"image"}],dw:[d.DistanceSpec,{field:"dw"}],dh:[d.DistanceSpec,{field:"dh"}],dilate:[e,!1],origin:[o.ImageOrigin,"bottom_left"],anchor:[m.Anchor,"bottom_left"]})))}, function _(e,a,t,n,r){var _;n();const s=e(334),m=e(8);class i extends s.ImageBaseView{_flat_img_to_buf8(e){const a=(0,m.isTypedArray)(e)?e:new Uint32Array(e);return new Uint8ClampedArray(a.buffer)}}t.ImageRGBAView=i,i.__name__="ImageRGBAView";class o extends s.ImageBase{constructor(e){super(e)}}t.ImageRGBA=o,_=o,o.__name__="ImageRGBA",_.prototype.default_view=i}, @@ -1309,16 +1309,16 @@

Plots# function _(e,t,s,n,i){var l;n();const a=e(1),r=e(202),h=e(209),o=e(78),_=e(23),c=a.__importStar(e(17));class g extends r.XYGlyphView{_map_data(){"data"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this.length):this.slength=(0,_.to_screen)(this.length);const{width:e,height:t}=this.renderer.plot_view.frame.bbox,s=2*(e+t),{slength:n}=this;for(let e=0,t=n.length;e({length:[c.DistanceSpec,0],angle:[c.AngleSpec,0]})))}, function _(t,s,e,i,r){var a;i();const n=t(1),h=t(328),_=t(209),d=t(23),o=t(13),l=t(101),c=t(57),x=t(153),y=t(236),w=n.__importStar(t(238)),u=t(237),{abs:g,sqrt:m}=Math;class f extends h.CenterRotatableView{async load_glglyph(){const{RectGL:s}=await Promise.resolve().then((()=>n.__importStar(t(534))));return s}_set_data(t){super._set_data(t),this.border_radius=w.border_radius(this.model.border_radius)}_map_data(){const t=this.data_size;if("data"==this.model.properties.width.units)[this.sw,this.sx0]=this._map_dist_corner_for_data_side_length(this._x,this.width,this.renderer.xscale);else{this.sw=(0,d.to_screen)(this.width),this.sx0=new d.ScreenArray(t);for(let s=0;s({border_radius:[y.BorderRadius,0],dilate:[t,!1]})))}, function _(e,t,r,a,n){var s;a();const i=e(1),c=e(346),o=e(347),_=i.__importStar(e(17));class l extends c.MarkerView{async load_glglyph(){const{MultiMarkerGL:t}=await Promise.resolve().then((()=>i.__importStar(e(533))));return t}_render(e,t,r){const{sx:a,sy:n,size:s,angle:i,marker:c}=null!=r?r:this;for(const r of t){const t=a[r],_=n[r],l=s.get(r),g=i.get(r),u=c.get(r);if(!isFinite(t+_+l+g)||null==u)continue;const d=l/2;e.beginPath(),e.translate(t,_),0!=g&&e.rotate(g),o.marker_funcs[u](e,r,d,this.visuals),0!=g&&e.rotate(-g),e.translate(-t,-_)}}draw_legend_for_index(e,{x0:t,x1:r,y0:a,y1:n},s){const i=s+1,c=this.marker.get(s),o=Object.assign(Object.assign({},this._get_legend_args({x0:t,x1:r,y0:a,y1:n},s)),{marker:new _.UniformScalar(c,i)});this._render(e,[s],o)}}r.ScatterView=l,l.__name__="ScatterView";class g extends c.Marker{constructor(e){super(e)}}r.Scatter=g,s=g,g.__name__="Scatter",s.prototype.default_view=l,s.define((()=>({marker:[_.MarkerSpec,{value:"circle"}]})))}, -function _(e,t,s,i,n){var r;i();const a=e(1),_=e(202),c=e(78),o=a.__importStar(e(210)),h=a.__importStar(e(17)),l=a.__importStar(e(37)),x=e(10),d=e(101);class y extends _.XYGlyphView{_render(e,t,s){const{sx:i,sy:n,size:r,angle:a}=null!=s?s:this;for(const s of t){const t=i[s],_=n[s],c=r.get(s),o=a.get(s);if(!isFinite(t+_+c+o))continue;const h=c/2;e.beginPath(),e.translate(t,_),0!=o&&e.rotate(o),this._render_one(e,s,h,this.visuals),0!=o&&e.rotate(-o),e.translate(-t,-_)}}_mask_data(){const{x_target:e,y_target:t}=this.renderer.plot_view.frame,s=e.widen(this.max_size).map((e=>this.renderer.xscale.invert(e))),i=t.widen(this.max_size).map((e=>this.renderer.yscale.invert(e)));return this.index.indices({x0:s.start,x1:s.end,y0:i.start,y1:i.end})}_hit_point(e){const{sx:t,sy:s}=e,{max_size:i}=this,{hit_dilation:n}=this.model,r=t-i*n,a=t+i*n,[_,c]=this.renderer.xscale.r_invert(r,a),o=s-i*n,h=s+i*n,[l,x]=this.renderer.yscale.r_invert(o,h),y=this.index.indices({x0:_,x1:c,y0:l,y1:x}),g=[];for(const e of y){const i=this.size.get(e)/2*n;Math.abs(this.sx[e]-t)<=i&&Math.abs(this.sy[e]-s)<=i&&g.push(e)}return new d.Selection({indices:g})}_hit_span(e){const{sx:t,sy:s}=e,i=this.bounds(),n=this.max_size/2;let r,a,_,c;if("h"==e.direction){_=i.y0,c=i.y1;const e=t-n,s=t+n;[r,a]=this.renderer.xscale.r_invert(e,s)}else{r=i.x0,a=i.x1;const e=s-n,t=s+n;[_,c]=this.renderer.yscale.r_invert(e,t)}const o=[...this.index.indices({x0:r,x1:a,y0:_,y1:c})];return new d.Selection({indices:o})}_hit_rect(e){const{sx0:t,sx1:s,sy0:i,sy1:n}=e,[r,a]=this.renderer.xscale.r_invert(t,s),[_,c]=this.renderer.yscale.r_invert(i,n),o=[...this.index.indices({x0:r,x1:a,y0:_,y1:c})];return new d.Selection({indices:o})}_set_data(e){super._set_data(e);const t=l.max(this.size);this._configure("max_size",{value:t})}_hit_poly(e){const{sx:t,sy:s}=e,i=(0,x.range)(0,this.sx.length),n=[];for(let e=0,r=i.length;e({size:[h.ScreenSizeSpec,{value:4}],angle:[h.AngleSpec,0],hit_dilation:[e,1]})))}, +function _(e,t,s,i,n){var r;i();const a=e(1),_=e(202),c=e(78),o=a.__importStar(e(210)),h=a.__importStar(e(17)),l=a.__importStar(e(38)),x=e(10),d=e(101);class y extends _.XYGlyphView{_render(e,t,s){const{sx:i,sy:n,size:r,angle:a}=null!=s?s:this;for(const s of t){const t=i[s],_=n[s],c=r.get(s),o=a.get(s);if(!isFinite(t+_+c+o))continue;const h=c/2;e.beginPath(),e.translate(t,_),0!=o&&e.rotate(o),this._render_one(e,s,h,this.visuals),0!=o&&e.rotate(-o),e.translate(-t,-_)}}_mask_data(){const{x_target:e,y_target:t}=this.renderer.plot_view.frame,s=e.widen(this.max_size).map((e=>this.renderer.xscale.invert(e))),i=t.widen(this.max_size).map((e=>this.renderer.yscale.invert(e)));return this.index.indices({x0:s.start,x1:s.end,y0:i.start,y1:i.end})}_hit_point(e){const{sx:t,sy:s}=e,{max_size:i}=this,{hit_dilation:n}=this.model,r=t-i*n,a=t+i*n,[_,c]=this.renderer.xscale.r_invert(r,a),o=s-i*n,h=s+i*n,[l,x]=this.renderer.yscale.r_invert(o,h),y=this.index.indices({x0:_,x1:c,y0:l,y1:x}),g=[];for(const e of y){const i=this.size.get(e)/2*n;Math.abs(this.sx[e]-t)<=i&&Math.abs(this.sy[e]-s)<=i&&g.push(e)}return new d.Selection({indices:g})}_hit_span(e){const{sx:t,sy:s}=e,i=this.bounds(),n=this.max_size/2;let r,a,_,c;if("h"==e.direction){_=i.y0,c=i.y1;const e=t-n,s=t+n;[r,a]=this.renderer.xscale.r_invert(e,s)}else{r=i.x0,a=i.x1;const e=s-n,t=s+n;[_,c]=this.renderer.yscale.r_invert(e,t)}const o=[...this.index.indices({x0:r,x1:a,y0:_,y1:c})];return new d.Selection({indices:o})}_hit_rect(e){const{sx0:t,sx1:s,sy0:i,sy1:n}=e,[r,a]=this.renderer.xscale.r_invert(t,s),[_,c]=this.renderer.yscale.r_invert(i,n),o=[...this.index.indices({x0:r,x1:a,y0:_,y1:c})];return new d.Selection({indices:o})}_set_data(e){super._set_data(e);const t=l.max(this.size);this._configure("max_size",{value:t})}_hit_poly(e){const{sx:t,sy:s}=e,i=(0,x.range)(0,this.sx.length),n=[];for(let e=0,r=i.length;e({size:[h.ScreenSizeSpec,{value:4}],angle:[h.AngleSpec,0],hit_dilation:[e,1]})))}, function _(l,n,o,i,a){i();const t=Math.sqrt(3),e=Math.sqrt(5),p=(e+1)/4,c=Math.sqrt((5-e)/8),h=(e-1)/4,u=Math.sqrt((5+e)/8);function f(l,n){l.rotate(Math.PI/4),y(l,n),l.rotate(-Math.PI/4)}function r(l,n){const o=n*t,i=o/3;l.moveTo(-o/2,-i),l.lineTo(0,0),l.lineTo(o/2,-i),l.lineTo(0,0),l.lineTo(0,n)}function y(l,n){l.moveTo(0,n),l.lineTo(0,-n),l.moveTo(-n,0),l.lineTo(n,0)}function T(l,n){l.moveTo(0,n),l.lineTo(n/1.5,0),l.lineTo(0,-n),l.lineTo(-n/1.5,0),l.closePath()}function s(l,n){const o=n*t,i=o/3;l.moveTo(-n,i),l.lineTo(n,i),l.lineTo(0,i-o),l.closePath()}function v(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function d(l,n,o,i){T(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function P(l,n,o,i){!function(l,n){l.beginPath(),l.arc(0,0,n/4,0,2*Math.PI,!1),l.closePath()}(l,o),i.line.set_vectorize(l,n),l.fillStyle=l.strokeStyle,l.fill()}function m(l,n,o,i){!function(l,n){const o=n/2,i=t*o;l.moveTo(n,0),l.lineTo(o,-i),l.lineTo(-o,-i),l.lineTo(-n,0),l.lineTo(-o,i),l.lineTo(o,i),l.closePath()}(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function _(l,n,o,i){const a=2*o;l.rect(-o,-o,a,a),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function q(l,n,o,i){!function(l,n){const o=Math.sqrt(5-2*e)*n;l.moveTo(0,-n),l.lineTo(o*h,o*u-n),l.lineTo(o*(1+h),o*u-n),l.lineTo(o*(1+h-p),o*(u+c)-n),l.lineTo(o*(1+2*h-p),o*(2*u+c)-n),l.lineTo(0,2*o*u-n),l.lineTo(-o*(1+2*h-p),o*(2*u+c)-n),l.lineTo(-o*(1+h-p),o*(u+c)-n),l.lineTo(-o*(1+h),o*u-n),l.lineTo(-o*h,o*u-n),l.closePath()}(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function M(l,n,o,i){s(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}o.marker_funcs={asterisk:function(l,n,o,i){y(l,o),f(l,o),i.line.apply(l,n)},circle:v,circle_cross:function(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),y(l,o),i.line.apply(l,n)},circle_dot:function(l,n,o,i){v(l,n,o,i),P(l,n,o,i)},circle_y:function(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),r(l,o),i.line.apply(l,n)},circle_x:function(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),f(l,o),i.line.apply(l,n)},cross:function(l,n,o,i){y(l,o),i.line.apply(l,n)},diamond:d,diamond_dot:function(l,n,o,i){d(l,n,o,i),P(l,n,o,i)},diamond_cross:function(l,n,o,i){T(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),l.moveTo(0,o),l.lineTo(0,-o),l.moveTo(-o/1.5,0),l.lineTo(o/1.5,0),i.line.apply(l,n)},dot:P,hex:m,hex_dot:function(l,n,o,i){m(l,n,o,i),P(l,n,o,i)},inverted_triangle:function(l,n,o,i){l.rotate(Math.PI),s(l,o),l.rotate(-Math.PI),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},plus:function(l,n,o,i){const a=3*o/8,t=[a,a,o,o,a,a,-a,-a,-o,-o,-a,-a],e=[o,a,a,-a,-a,-o,-o,-a,-a,a,a,o];l.beginPath();for(let n=0;n<12;n++)l.lineTo(t[n],e[n]);l.closePath(),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},square:_,square_cross:function(l,n,o,i){const a=2*o;l.rect(-o,-o,a,a),i.fill.apply(l,n),i.hatch.apply(l,n),y(l,o),i.line.apply(l,n)},square_dot:function(l,n,o,i){_(l,n,o,i),P(l,n,o,i)},square_pin:function(l,n,o,i){const a=3*o/8;l.moveTo(-o,-o),l.quadraticCurveTo(0,-a,o,-o),l.quadraticCurveTo(a,0,o,o),l.quadraticCurveTo(0,a,-o,o),l.quadraticCurveTo(-a,0,-o,-o),l.closePath(),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},square_x:function(l,n,o,i){const a=2*o;l.rect(-o,-o,a,a),i.fill.apply(l,n),i.hatch.apply(l,n),l.moveTo(-o,o),l.lineTo(o,-o),l.moveTo(-o,-o),l.lineTo(o,o),i.line.apply(l,n)},star:q,star_dot:function(l,n,o,i){q(l,n,o,i),P(l,n,o,i)},triangle:M,triangle_dot:function(l,n,o,i){M(l,n,o,i),P(l,n,o,i)},triangle_pin:function(l,n,o,i){const a=o*t,e=a/3,p=3*e/8;l.moveTo(-o,e),l.quadraticCurveTo(0,p,o,e),l.quadraticCurveTo(t*p/2,p/2,0,e-a),l.quadraticCurveTo(-t*p/2,p/2,-o,e),l.closePath(),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},dash:function(l,n,o,i){!function(l,n){l.moveTo(-n,0),l.lineTo(n,0)}(l,o),i.line.apply(l,n)},x:function(l,n,o,i){f(l,o),i.line.apply(l,n)},y:function(l,n,o,i){r(l,o),i.line.apply(l,n)}}}, function _(e,t,s,i,n){var r;i();const o=e(1),a=o.__importStar(e(210)),_=o.__importStar(e(17)),d=e(78),h=e(105),c=e(11),x=e(203),l=e(209),y=e(101);class p extends x.GlyphView{_project_data(){h.inplace.project_xy(this._x0,this._y0),h.inplace.project_xy(this._x1,this._y1)}_index_data(e){const{min:t,max:s}=Math,{_x0:i,_x1:n,_y0:r,_y1:o,data_size:a}=this;for(let _=0;_({x0:[_.XCoordinateSpec,{field:"x0"}],y0:[_.YCoordinateSpec,{field:"y0"}],x1:[_.XCoordinateSpec,{field:"x1"}],y1:[_.YCoordinateSpec,{field:"y1"}]}))),r.mixins(d.LineVector)}, function _(t,e,s,i,n){var o;i();const _=t(1),l=t(202),a=_.__importStar(t(78)),c=t(350);class r extends l.XYGlyphView{_set_data(){const{tension:t,closed:e}=this.model;[this._xt,this._yt]=(0,c.catmullrom_spline)(this._x,this._y,20,t,e)}_map_data(){const{x_scale:t,y_scale:e}=this.renderer.coordinates;this.sxt=t.v_compute(this._xt),this.syt=e.v_compute(this._yt)}_render(t,e,s){const{sxt:i,syt:n}=null!=s?s:this;let o=!0;t.beginPath();const _=i.length;for(let e=0;e<_;e++){const s=i[e],_=n[e];isFinite(s+_)?o?(t.moveTo(s,_),o=!1):t.lineTo(s,_):o=!0}this.visuals.line.set_value(t),t.stroke()}}s.SplineView=r,r.__name__="SplineView";class h extends l.XYGlyph{constructor(t){super(t)}}s.Spline=h,o=h,h.__name__="Spline",o.prototype.default_view=r,o.mixins(a.LineScalar),o.define((({Boolean:t,Number:e})=>({tension:[e,.5],closed:[t,!1]})))}, function _(n,t,e,o,s){o();const c=n(23),l=n(12);e.catmullrom_spline=function(n,t,e=10,o=.5,s=!1){(0,l.assert)(n.length==t.length);const r=n.length,f=s?r+1:r,w=(0,c.infer_type)(n,t),i=new w(f+2),u=new w(f+2);i.set(n,1),u.set(t,1),s?(i[0]=n[r-1],u[0]=t[r-1],i[f]=n[0],u[f]=t[0],i[f+1]=n[1],u[f+1]=t[1]):(i[0]=n[0],u[0]=t[0],i[f+1]=n[r-1],u[f+1]=t[r-1]);const g=new w(4*(e+1));for(let n=0,t=0;n<=e;n++){const o=n/e,s=o**2,c=o*s;g[t++]=2*c-3*s+1,g[t++]=-2*c+3*s,g[t++]=c-2*s+o,g[t++]=c-s}const h=new w((f-1)*(e+1)),_=new w((f-1)*(e+1));for(let n=1,t=0;n_.__importStar(e(535))));return t}_render(e,t,r){const n=t.length;if(n<2)return;const{sx:s,sy:i}=null!=r?r:this,_=this.model.mode;this.visuals.line.set_value(e);let a=!1,o=!1;const l=t[0];let d=isFinite(s[l]+i[l]);"center"==_&&(a=this._render_xy(e,a,d?s[l]:NaN,i[l]));for(const r of t){const t=isFinite(s[r+1]+i[r+1]);switch(_){case"before":a=this._render_xy(e,a,d?s[r]:NaN,i[r]),r({mode:[d.StepMode,"before"]})))}, -function _(t,e,s,i,a){var n;i();const r=t(1),o=t(202),l=r.__importStar(t(78)),c=r.__importStar(t(17)),h=t(37),_=t(101),d=t(57),u=t(32),x=t(153),f=t(151),g=t(236),p=r.__importStar(t(238)),y=t(237);class b extends c.DataSpec{}b.__name__="TextAnchorSpec";class v extends o.XYGlyphView{after_visuals(){var t,e;super.after_visuals();const{text:s}=null!==(t=this.base)&&void 0!==t?t:this;this.labels=Array.from(s,(t=>{if(null==t)return null;{const e=`${t}`;return new f.TextBox({text:e})}}));const i=this.data_size,{anchor:a}=null!==(e=this.base)&&void 0!==e?e:this,{padding:n,border_radius:r}=this.model,{text_align:o,text_baseline:l}=this.visuals.text;if(a.is_Scalar()&&"auto"!=a.value)this.anchor_=new h.UniformScalar(p.anchor(a.value),i);else if(a.is_Scalar()&&o.is_Scalar()&&l.is_Scalar())this.anchor_=new h.UniformScalar(p.text_anchor(a.value,o.value,l.value),i);else{const t=new Array(i);for(let e=0;e({text:[c.NullStringSpec,{field:"text"}],angle:[c.AngleSpec,0],x_offset:[c.NumberSpec,0],y_offset:[c.NumberSpec,0],anchor:[b,{value:"auto"}],padding:[g.Padding,0],border_radius:[g.BorderRadius,0]}))),n.override({border_line_color:null,background_fill_color:null,background_hatch_color:null})}, +function _(t,e,s,i,a){var n;i();const r=t(1),o=t(202),l=r.__importStar(t(78)),c=r.__importStar(t(17)),h=t(38),_=t(101),d=t(57),u=t(33),x=t(153),f=t(151),g=t(236),p=r.__importStar(t(238)),y=t(237);class b extends c.DataSpec{}b.__name__="TextAnchorSpec";class v extends o.XYGlyphView{after_visuals(){var t,e;super.after_visuals();const{text:s}=null!==(t=this.base)&&void 0!==t?t:this;this.labels=Array.from(s,(t=>{if(null==t)return null;{const e=`${t}`;return new f.TextBox({text:e})}}));const i=this.data_size,{anchor:a}=null!==(e=this.base)&&void 0!==e?e:this,{padding:n,border_radius:r}=this.model,{text_align:o,text_baseline:l}=this.visuals.text;if(a.is_Scalar()&&"auto"!=a.value)this.anchor_=new h.UniformScalar(p.anchor(a.value),i);else if(a.is_Scalar()&&o.is_Scalar()&&l.is_Scalar())this.anchor_=new h.UniformScalar(p.text_anchor(a.value,o.value,l.value),i);else{const t=new Array(i);for(let e=0;e({text:[c.NullStringSpec,{field:"text"}],angle:[c.AngleSpec,0],x_offset:[c.NumberSpec,0],y_offset:[c.NumberSpec,0],anchor:[b,{value:"auto"}],padding:[g.Padding,0],border_radius:[g.BorderRadius,0]}))),n.override({border_line_color:null,background_fill_color:null,background_hatch_color:null})}, function _(t,s,e,i,r){var h;i();const o=t(1),a=t(325),n=t(23),_=o.__importStar(t(17));class c extends a.LRTBView{scenterxy(t){return[this.sx[t],(this.stop[t]+this.sbottom[t])/2]}_lrtb(t){const s=this.width.get(t)/2,e=this._x[t],i=this._top[t],r=this._bottom[t];return[e-s,e+s,Math.max(i,r),Math.min(i,r)]}_map_data(){this.sx=this.renderer.xscale.v_compute(this._x),this.sw=this.sdist(this.renderer.xscale,this._x,this.width,"center"),this.stop=this.renderer.yscale.v_compute(this._top),this.sbottom=this.renderer.yscale.v_compute(this._bottom);const t=this.sx.length;this.sleft=new n.ScreenArray(t),this.sright=new n.ScreenArray(t);for(let s=0;s({x:[_.XCoordinateSpec,{field:"x"}],bottom:[_.YCoordinateSpec,{value:0}],width:[_.NumberSpec,{value:1}],top:[_.YCoordinateSpec,{field:"top"}]})))}, -function _(t,e,n,s,i){var _;s();const r=t(1),a=t(203),o=t(209),d=t(101),c=t(78),h=r.__importStar(t(37)),x=t(13),l=t(10),p=r.__importStar(t(17)),{abs:u,max:f}=Math;class m extends a.GlyphView{after_visuals(){super.after_visuals(),this.max_line_width=h.max(this.line_width)}_index_data(t){for(const e of this._x)t.add_point(e,0)}_bounds(t){const{x0:e,x1:n}=t;return{x0:e,x1:n,y0:NaN,y1:NaN}}_map_data(){super._map_data();const{round:t}=Math;this.sx=(0,x.map)(this.sx,(e=>t(e)))}scenterxy(t){const{vcenter:e}=this.renderer.plot_view.frame.bbox;return[this.sx[t],e]}_render(t,e,n){const{sx:s}=null!=n?n:this,{top:i,bottom:_}=this.renderer.plot_view.frame.bbox;for(const n of e){const e=s[n];isFinite(e)&&(t.beginPath(),t.moveTo(e,i),t.lineTo(e,_),this.visuals.line.apply(t,n))}}_get_candidates(t,e){const{max_line_width:n}=this,[s,i]=this.renderer.xscale.r_invert(t-n,(null!=e?e:t)+n);return this.index.indices({x0:s,x1:i,y0:0,y1:0})}_find_spans(t,e){const{sx:n,line_width:s}=this,i=[];for(const _ of t){e(n[_],s.get(_))&&i.push(_)}return i}_hit_point(t){const{sx:e}=t,n=this._get_candidates(e),s=this._find_spans(n,((t,n)=>u(t-e)<=f(n,2)));return new d.Selection({indices:s})}_hit_span(t){const e=(()=>{if("h"==t.direction)return(0,l.range)(0,this.data_size);{const{sx:e}=t,n=this._get_candidates(e);return this._find_spans(n,((t,n)=>u(t-e)<=f(n/2,2)))}})();return new d.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sx0:e,sx1:n}=t,s=this._get_candidates(e,n);return this._find_spans(s,((t,s)=>e-s/2<=t&&t<=n+s/2))})();return new d.Selection({indices:e})}draw_legend_for_index(t,e,n){(0,o.generic_line_vector_legend)(this.visuals,t,e,n)}}n.VSpanView=m,m.__name__="VSpanView";class w extends a.Glyph{constructor(t){super(t)}}n.VSpan=w,_=w,w.__name__="VSpan",_.prototype.default_view=m,_.mixins([c.LineVector]),_.define((()=>({x:[p.XCoordinateSpec,{field:"x"}]})))}, -function _(t,e,i,s,r){var n;s();const a=t(1),_=t(203),o=t(209),l=t(101),c=t(78),h=t(23),d=a.__importStar(t(37)),p=t(13),x=t(10),u=a.__importStar(t(17));class f extends _.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:e}=this.renderer.plot_view.canvas_view;if(null!=e&&e.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>a.__importStar(t(532))));this.glglyph=new i(e.regl_wrapper,this)}}get sleft(){return this.sx0}get sright(){return this.sx1}get stop(){const{top:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new h.ScreenArray(e);return i.fill(t),i}get sbottom(){const{bottom:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new h.ScreenArray(e);return i.fill(t),i}after_visuals(){super.after_visuals(),this.max_line_width=d.max(this.line_width)}_index_data(t){const{_x0:e,_x1:i,data_size:s}=this;for(let r=0;rt(e))),this.sx1=(0,p.map)(this.sx1,(e=>t(e)))}scenterxy(t){const{vcenter:e}=this.renderer.plot_view.frame.bbox;return[(this.sx0[t]+this.sx1[t])/2,e]}_render(t,e,i){const{sx0:s,sx1:r}=null!=i?i:this,{top:n,bottom:a,height:_}=this.renderer.plot_view.frame.bbox;for(const i of e){const e=s[i],o=r[i];isFinite(e+o)&&(t.beginPath(),t.rect(e,n,o-e,_),this.visuals.fill.apply(t,i),this.visuals.hatch.apply(t,i),t.beginPath(),t.moveTo(e,n),t.lineTo(e,a),t.moveTo(o,n),t.lineTo(o,a),this.visuals.line.apply(t,i))}}_get_candidates(t,e){const{max_line_width:i}=this,[s,r]=this.renderer.xscale.r_invert(t-i,(null!=e?e:t)+i);return this.index.indices({x0:s,x1:r,y0:0,y1:0})}_find_strips(t,e){function i(t,i){return t<=i?e(t,i):e(i,t)}const{sx0:s,sx1:r}=this,n=[];for(const e of t){i(s[e],r[e])&&n.push(e)}return n}_hit_point(t){const{sx:e}=t,i=this._get_candidates(e),s=this._find_strips(i,((t,i)=>t<=e&&e<=i));return new l.Selection({indices:s})}_hit_span(t){const e=(()=>{if("h"==t.direction)return(0,x.range)(0,this.data_size);{const{sx:e}=t,i=this._get_candidates(e);return this._find_strips(i,((t,i)=>t<=e&&e<=i))}})();return new l.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sx0:e,sx1:i}=t,s=this._get_candidates(e,i);return this._find_strips(s,((t,s)=>e<=t&&t<=i&&e<=s&&s<=i))})();return new l.Selection({indices:e})}draw_legend_for_index(t,e,i){(0,o.generic_area_vector_legend)(this.visuals,t,e,i)}}i.VStripView=f,f.__name__="VStripView";class w extends _.Glyph{constructor(t){super(t)}}i.VStrip=w,n=w,w.__name__="VStrip",n.prototype.default_view=f,n.mixins([c.LineVector,c.FillVector,c.HatchVector]),n.define((()=>({x0:[u.XCoordinateSpec,{field:"x0"}],x1:[u.XCoordinateSpec,{field:"x1"}]})))}, +function _(t,e,n,s,i){var _;s();const r=t(1),a=t(203),o=t(209),d=t(101),c=t(78),h=r.__importStar(t(38)),x=t(13),l=t(10),p=r.__importStar(t(17)),{abs:u,max:f}=Math;class m extends a.GlyphView{after_visuals(){super.after_visuals(),this.max_line_width=h.max(this.line_width)}_index_data(t){for(const e of this._x)t.add_point(e,0)}_bounds(t){const{x0:e,x1:n}=t;return{x0:e,x1:n,y0:NaN,y1:NaN}}_map_data(){super._map_data();const{round:t}=Math;this.sx=(0,x.map)(this.sx,(e=>t(e)))}scenterxy(t){const{vcenter:e}=this.renderer.plot_view.frame.bbox;return[this.sx[t],e]}_render(t,e,n){const{sx:s}=null!=n?n:this,{top:i,bottom:_}=this.renderer.plot_view.frame.bbox;for(const n of e){const e=s[n];isFinite(e)&&(t.beginPath(),t.moveTo(e,i),t.lineTo(e,_),this.visuals.line.apply(t,n))}}_get_candidates(t,e){const{max_line_width:n}=this,[s,i]=this.renderer.xscale.r_invert(t-n,(null!=e?e:t)+n);return this.index.indices({x0:s,x1:i,y0:0,y1:0})}_find_spans(t,e){const{sx:n,line_width:s}=this,i=[];for(const _ of t){e(n[_],s.get(_))&&i.push(_)}return i}_hit_point(t){const{sx:e}=t,n=this._get_candidates(e),s=this._find_spans(n,((t,n)=>u(t-e)<=f(n,2)));return new d.Selection({indices:s})}_hit_span(t){const e=(()=>{if("h"==t.direction)return(0,l.range)(0,this.data_size);{const{sx:e}=t,n=this._get_candidates(e);return this._find_spans(n,((t,n)=>u(t-e)<=f(n/2,2)))}})();return new d.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sx0:e,sx1:n}=t,s=this._get_candidates(e,n);return this._find_spans(s,((t,s)=>e-s/2<=t&&t<=n+s/2))})();return new d.Selection({indices:e})}draw_legend_for_index(t,e,n){(0,o.generic_line_vector_legend)(this.visuals,t,e,n)}}n.VSpanView=m,m.__name__="VSpanView";class w extends a.Glyph{constructor(t){super(t)}}n.VSpan=w,_=w,w.__name__="VSpan",_.prototype.default_view=m,_.mixins([c.LineVector]),_.define((()=>({x:[p.XCoordinateSpec,{field:"x"}]})))}, +function _(t,e,i,s,r){var n;s();const a=t(1),_=t(203),o=t(209),l=t(101),c=t(78),h=t(23),d=a.__importStar(t(38)),p=t(13),x=t(10),u=a.__importStar(t(17));class f extends _.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:e}=this.renderer.plot_view.canvas_view;if(null!=e&&e.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>a.__importStar(t(532))));this.glglyph=new i(e.regl_wrapper,this)}}get sleft(){return this.sx0}get sright(){return this.sx1}get stop(){const{top:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new h.ScreenArray(e);return i.fill(t),i}get sbottom(){const{bottom:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new h.ScreenArray(e);return i.fill(t),i}after_visuals(){super.after_visuals(),this.max_line_width=d.max(this.line_width)}_index_data(t){const{_x0:e,_x1:i,data_size:s}=this;for(let r=0;rt(e))),this.sx1=(0,p.map)(this.sx1,(e=>t(e)))}scenterxy(t){const{vcenter:e}=this.renderer.plot_view.frame.bbox;return[(this.sx0[t]+this.sx1[t])/2,e]}_render(t,e,i){const{sx0:s,sx1:r}=null!=i?i:this,{top:n,bottom:a,height:_}=this.renderer.plot_view.frame.bbox;for(const i of e){const e=s[i],o=r[i];isFinite(e+o)&&(t.beginPath(),t.rect(e,n,o-e,_),this.visuals.fill.apply(t,i),this.visuals.hatch.apply(t,i),t.beginPath(),t.moveTo(e,n),t.lineTo(e,a),t.moveTo(o,n),t.lineTo(o,a),this.visuals.line.apply(t,i))}}_get_candidates(t,e){const{max_line_width:i}=this,[s,r]=this.renderer.xscale.r_invert(t-i,(null!=e?e:t)+i);return this.index.indices({x0:s,x1:r,y0:0,y1:0})}_find_strips(t,e){function i(t,i){return t<=i?e(t,i):e(i,t)}const{sx0:s,sx1:r}=this,n=[];for(const e of t){i(s[e],r[e])&&n.push(e)}return n}_hit_point(t){const{sx:e}=t,i=this._get_candidates(e),s=this._find_strips(i,((t,i)=>t<=e&&e<=i));return new l.Selection({indices:s})}_hit_span(t){const e=(()=>{if("h"==t.direction)return(0,x.range)(0,this.data_size);{const{sx:e}=t,i=this._get_candidates(e);return this._find_strips(i,((t,i)=>t<=e&&e<=i))}})();return new l.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sx0:e,sx1:i}=t,s=this._get_candidates(e,i);return this._find_strips(s,((t,s)=>e<=t&&t<=i&&e<=s&&s<=i))})();return new l.Selection({indices:e})}draw_legend_for_index(t,e,i){(0,o.generic_area_vector_legend)(this.visuals,t,e,i)}}i.VStripView=f,f.__name__="VStripView";class w extends _.Glyph{constructor(t){super(t)}}i.VStrip=w,n=w,w.__name__="VStrip",n.prototype.default_view=f,n.mixins([c.LineVector,c.FillVector,c.HatchVector]),n.define((()=>({x0:[u.XCoordinateSpec,{field:"x0"}],x1:[u.XCoordinateSpec,{field:"x1"}]})))}, function _(e,s,t,i,a){var n;i();const r=e(1),l=e(202),d=e(209),h=e(78),c=e(23),o=e(19),_=r.__importStar(e(17)),g=e(11),u=e(101),p=e(13);class x extends l.XYGlyphView{async load_glglyph(){const{WedgeGL:s}=await Promise.resolve().then((()=>r.__importStar(e(536))));return s}_map_data(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,c.to_screen)(this.radius),this.max_sradius=(0,p.max)(this.sradius)}_render(e,s,t){const{sx:i,sy:a,sradius:n,start_angle:r,end_angle:l}=null!=t?t:this,d="anticlock"==this.model.direction;for(const t of s){const s=i[t],h=a[t],c=n[t],o=r.get(t),_=l.get(t);isFinite(s+h+c+o+_)&&(e.beginPath(),e.arc(s,h,c,o,_,d),e.lineTo(s,h),e.closePath(),this.visuals.fill.apply(e,t),this.visuals.hatch.apply(e,t),this.visuals.line.apply(e,t))}}_hit_point(e){let s,t,i,a,n;const{sx:r,sy:l}=e,d=this.renderer.xscale.invert(r),h=this.renderer.yscale.invert(l);t=r-this.max_sradius,i=r+this.max_sradius;const[c,o]=this.renderer.xscale.r_invert(t,i);a=l-this.max_sradius,n=l+this.max_sradius;const[_,p]=this.renderer.yscale.r_invert(a,n),x=[];for(const e of this.index.indices({x0:c,x1:o,y0:_,y1:p})){const r=this.sradius[e]**2;[t,i]=this.renderer.xscale.r_compute(d,this._x[e]),[a,n]=this.renderer.yscale.r_compute(h,this._y[e]),s=(t-i)**2+(a-n)**2,s<=r&&x.push(e)}const y="anticlock"==this.model.direction,m=[];for(const e of x){const s=Math.atan2(l-this.sy[e],r-this.sx[e]);(Math.abs(this.start_angle.get(e)-this.end_angle.get(e))>=2*Math.PI||(0,g.angle_between)(-s,-this.start_angle.get(e),-this.end_angle.get(e),y))&&m.push(e)}return new u.Selection({indices:m})}draw_legend_for_index(e,s,t){(0,d.generic_area_vector_legend)(this.visuals,e,s,t)}scenterxy(e){const s=this.sradius[e]/2,t=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+s*Math.cos(t),this.sy[e]+s*Math.sin(t)]}}t.WedgeView=x,x.__name__="WedgeView";class y extends l.XYGlyph{constructor(e){super(e)}}t.Wedge=y,n=y,y.__name__="Wedge",n.prototype.default_view=x,n.mixins([h.LineVector,h.FillVector,h.HatchVector]),n.define((({})=>({direction:[o.Direction,"anticlock"],radius:[_.DistanceSpec,{field:"radius"}],start_angle:[_.AngleSpec,{field:"start_angle"}],end_angle:[_.AngleSpec,{field:"end_angle"}]})))}, function _(n,i,o,a,r){a(),r("Decoration",n(208).Decoration),r("Marking",n(140).Marking)}, function _(t,_,r,o,a){o();const e=t(1);e.__exportStar(t(359),r),e.__exportStar(t(360),r),e.__exportStar(t(361),r)}, @@ -1330,12 +1330,12 @@

Plots# function _(o,x,B,a,l){a(),l("Column",o(365).Column),l("FlexBox",o(366).FlexBox),l("GridBox",o(371).GridBox),l("GroupBox",o(373).GroupBox),l("HBox",o(375).HBox),l("LayoutDOM",o(367).LayoutDOM),l("Row",o(376).Row),l("ScrollBox",o(377).ScrollBox),l("Spacer",o(378).Spacer),l("TabPanel",o(379).TabPanel),l("Tabs",o(380).Tabs),l("VBox",o(382).VBox)}, function _(e,o,n,t,s){var u;t();const _=e(366);class c extends _.FlexBoxView{constructor(){super(...arguments),this._direction="column"}}n.ColumnView=c,c.__name__="ColumnView";class l extends _.FlexBox{constructor(e){super(e)}}n.Column=l,u=l,l.__name__="Column",u.prototype.default_view=c}, function _(e,t,i,n,o){var s;n();const a=e(367),c=e(370),r=e(231),l=e(260),h=e(56);class d extends a.LayoutDOMView{connect_signals(){super.connect_signals();const{children:e}=this.model.properties;this.on_change(e,(()=>this.update_children()))}get child_models(){return this.model.children}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flex"}}_update_layout(){super._update_layout(),this.style.append(":host",{flex_direction:this._direction,gap:(0,h.px)(this.model.spacing)});const e=new r.Container;let t=0,i=0;for(const n of this.child_views){if(!(n instanceof a.LayoutDOMView))continue;const o=n.box_sizing(),s=(()=>{const e="row"==this._direction?o.width_policy:o.height_policy,t="row"==this._direction?o.width:o.height,i=null!=t?(0,h.px)(t):"auto";switch(e){case"auto":case"fixed":return`0 0 ${i}`;case"fit":return"1 1 auto";case"min":return"0 1 auto";case"max":return"1 0 0px"}})(),c=(()=>{switch("row"==this._direction?o.height_policy:o.width_policy){case"auto":case"fixed":case"fit":case"min":return"row"==this._direction?o.valign:o.halign;case"max":return"stretch"}})();n.style.append(":host",{flex:s,align_self:c}),"row"==this._direction?"max"==o.height_policy&&n.style.append(":host",{height:"auto"}):"max"==o.width_policy&&n.style.append(":host",{width:"auto"}),null!=n.layout&&(e.add({r0:t,c0:i,r1:t+1,c1:i+1},n),"row"==this._direction?i+=1:t+=1)}0!=e.size?(this.layout=new c.GridAlignmentLayout(e),this.layout.set_sizing()):delete this.layout}}i.FlexBoxView=d,d.__name__="FlexBoxView";class _ extends a.LayoutDOM{constructor(e){super(e)}}i.FlexBox=_,s=_,_.__name__="FlexBox",s.define((({Number:e,Array:t,Ref:i})=>({children:[t(i(l.UIElement)),[]],spacing:[e,0]})))}, -function _(t,e,i,s,l){var n;s();const a=t(260),o=t(368),r=t(18),h=t(15),u=t(19),_=t(56),d=t(8),c=t(59),f=t(229),m=t(16),p=t(263),w=t(12);class y extends a.UIElementView{constructor(){super(...arguments),this._child_views=new Map,this.mouseenter=new h.Signal(this,"mouseenter"),this.mouseleave=new h.Signal(this,"mouseleave"),this.disabled=new h.Signal(this,"disabled"),this._resized=!1,this._auto_width="fit-content",this._auto_height="fit-content",this._layout_computed=!1,this._was_built=!1}get is_layout_root(){return this.is_root||!(this.parent instanceof y)}_after_resize(){this._resized=!0,super._after_resize(),this.is_layout_root&&!this._was_built?(r.logger.warn(`${this} wasn't built properly`),this.render_to(null)):this.compute_layout()}async lazy_initialize(){await super.lazy_initialize(),await this.build_child_views()}remove(){for(const t of this.child_views)t.remove();this._child_views.clear(),super.remove()}connect_signals(){super.connect_signals(),this.el.addEventListener("mouseenter",(t=>{this.mouseenter.emit(t)})),this.el.addEventListener("mouseleave",(t=>{this.mouseleave.emit(t)})),this.el.addEventListener("contextmenu",(t=>{null!=this.model.context_menu&&(console.log("context menu"),t.preventDefault())})),this.parent instanceof y&&this.connect(this.parent.disabled,(t=>{this.disabled.emit(t||this.model.disabled)}));const t=this.model.properties;this.on_change(t.disabled,(()=>{this.disabled.emit(this.model.disabled)})),this.on_change([t.css_classes,t.stylesheets,t.width,t.height,t.min_width,t.min_height,t.max_width,t.max_height,t.margin,t.width_policy,t.height_policy,t.flow_mode,t.sizing_mode,t.aspect_ratio,t.visible],(()=>this.invalidate_layout()))}*children(){yield*super.children(),yield*this.child_views}get child_views(){return this.child_models.map((t=>this._child_views.get(t))).filter(d.isNotNull)}get layoutable_views(){return this.child_views.filter((t=>t instanceof y))}async build_child_views(){const{created:t,removed:e}=await(0,c.build_views)(this._child_views,this.child_models,{parent:this});for(const t of e)this._resize_observer.unobserve(t.el);for(const e of t)this._resize_observer.observe(e.el,{box:"border-box"});return t}render(){super.render();for(const t of this.child_views)t.render(),this.shadow_el.appendChild(t.el)}_update_children(){}async update_children(){const t=new Set(await this.build_child_views());if(0!=t.size){for(const t of this.child_views)(0,_.remove)(t.el);for(const e of this.child_views)this.shadow_el.append(e.el),t.has(e)&&(e.render(),e.after_render())}this._update_children(),this.invalidate_layout()}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flow"}}_update_layout(){function t(t,e,i,s){switch(t){case"auto":return null!=e?(0,_.px)(e):i;case"fixed":return null!=e?(0,_.px)(e):"fit-content";case"fit":return"fit-content";case"min":return"min-content";case"max":return null==s?"100%":`calc(100% - ${s})`}}function e(t){return(0,d.isNumber)(t)?(0,_.px)(t):`${t.percent}%`}const i={},s=this._intrinsic_display();i.display=function(t){const{inner:e,outer:i}=t;switch(`${e} ${i}`){case"block flow":return"block";case"inline flow":return"inline";case"block flow-root":return"flow-root";case"inline flow-root":return"inline-block";case"block flex":return"flex";case"inline flex":return"inline-flex";case"block grid":return"grid";case"inline grid":return"inline-grid";case"block table":return"table";case"inline table":return"inline-table";default:(0,w.unreachable)()}}(s);const l=this.box_sizing(),{width_policy:n,height_policy:a,width:o,height:r,aspect_ratio:h}=l,u=(()=>{if("auto"==h){if(null!=o&&null!=r)return o/r}else if((0,d.isNumber)(h))return h;return null})();"auto"==h?i.aspect_ratio=null!=o&&null!=r?`${o} / ${r}`:"auto":(0,d.isNumber)(h)&&(i.aspect_ratio=`${h}`);const{margin:c}=this.model,f=(()=>{if(null!=c){if((0,d.isNumber)(c))return i.margin=(0,_.px)(c),{width:(0,_.px)(2*c),height:(0,_.px)(2*c)};if(2==c.length){const[t,e]=c;return i.margin=`${(0,_.px)(t)} ${(0,_.px)(e)}`,{width:(0,_.px)(2*e),height:(0,_.px)(2*t)}}{const[t,e,s,l]=c;return i.margin=`${(0,_.px)(t)} ${(0,_.px)(e)} ${(0,_.px)(s)} ${(0,_.px)(l)}`,{width:(0,_.px)(l+e),height:(0,_.px)(t+s)}}}return{width:null,height:null}})(),[m,p]=(()=>{const e=t(n,o,this._auto_width,f.width),i=t(a,r,this._auto_height,f.height);if(null!=h){if(n!=a)return"fixed"==n?[e,"auto"]:"fixed"==a?["auto",i]:"max"==n?[e,"auto"]:"max"==a?["auto",i]:["auto","auto"];if("fixed"!=n&&"fixed"!=a&&null!=u)return u>=1?[e,"auto"]:["auto",i]}return[e,i]})();i.width=m,i.height=p;const{min_width:y,max_width:g}=this.model,{min_height:b,max_height:x}=this.model;i.min_width=null==y?"0px":e(y),i.min_height=null==b?"0px":e(b),this.is_layout_root?(null!=g&&(i.max_width=e(g)),null!=x&&(i.max_height=e(x))):(null!=g?i.max_width=`min(${e(g)}, 100%)`:"fixed"!=n&&(i.max_width="100%"),null!=x?i.max_height=`min(${e(x)}, 100%)`:"fixed"!=a&&(i.max_height="100%"));const{resizable:v}=this.model;if(!1!==v){const t=(()=>{switch(v){case"width":return"horizontal";case"height":return"vertical";case!0:case"both":return"both"}})();i.resize=t,i.overflow="auto"}this.style.append(":host",i)}update_layout(){this.update_style();for(const t of this.layoutable_views)t.update_layout();this._update_layout()}get is_managed(){return this.parent instanceof y}_measure_layout(){}measure_layout(){for(const t of this.layoutable_views)t.measure_layout();this._measure_layout()}compute_layout(){this.parent instanceof y?this.parent.compute_layout():(this.measure_layout(),this.update_bbox(),this._compute_layout(),this.after_layout()),this._layout_computed=!0}_compute_layout(){if(null!=this.layout){this.layout.compute(this.bbox.size);for(const t of this.layoutable_views)null==t.layout?t._compute_layout():t._propagate_layout()}else for(const t of this.layoutable_views)t._compute_layout()}_propagate_layout(){for(const t of this.layoutable_views)null==t.layout&&t._compute_layout()}update_bbox(){for(const t of this.layoutable_views)t.update_bbox();const t=super.update_bbox();return null!=this.layout&&(this.layout.visible=this.is_displayed),t}_after_layout(){}after_layout(){for(const t of this.layoutable_views)t.after_layout();this._after_layout()}render_to(t){if(!this.is_layout_root)throw new Error(`${this.toString()} is not a root layout`);this.render(),null!=t&&t.appendChild(this.el),this.r_after_render(),this._was_built=!0,this.notify_finished()}r_after_render(){for(const t of this.child_views)t instanceof y?t.r_after_render():t.after_render();this.after_render()}after_render(){this._after_render(),this.is_managed||this.invalidate_layout(),this._has_finished||(this.is_displayed?(0,m.defer)().then((()=>{this._resized||this.finish()})):this.finish())}async rebuild(){await this.build_child_views(),this.invalidate_render()}invalidate_layout(){this.parent instanceof y?this.parent.invalidate_layout():(this.update_layout(),this.compute_layout())}invalidate_render(){this.render(),this.invalidate_layout()}has_finished(){if(!super.has_finished())return!1;if(this.is_layout_root&&!this._layout_computed)return!1;for(const t of this.child_views)if(!t.has_finished())return!1;return!0}box_sizing(){let{width_policy:t,height_policy:e,aspect_ratio:i}=this.model;const{sizing_mode:s}=this.model;if(null!=s)if("inherit"==s){if(this.parent instanceof y){const s=this.parent.box_sizing();t=s.width_policy,e=s.height_policy,null==i&&(i=s.aspect_ratio)}}else if("fixed"==s)t=e="fixed";else if("stretch_both"==s)t=e="max";else if("stretch_width"==s)t="max";else if("stretch_height"==s)e="max";else switch(null==i&&(i="auto"),s){case"scale_width":t="max",e="min";break;case"scale_height":t="min",e="max";break;case"scale_both":t="max",e="max"}const[l,n]=(()=>{const{align:t}=this.model;return"auto"==t?[void 0,void 0]:(0,d.isArray)(t)?t:[t,t]})(),{width:a,height:o}=this.model;return{width_policy:t,height_policy:e,width:a,height:o,aspect_ratio:i,halign:l,valign:n}}export(t="auto",e=!0){const i=(()=>{switch(t){case"auto":case"png":return"canvas";case"svg":return"svg"}})(),s=new p.CanvasLayer(i,e),{x:l,y:n,width:a,height:o}=this.bbox;s.resize(a,o);const r=getComputedStyle(this.el).backgroundColor;s.ctx.fillStyle=r,s.ctx.fillRect(l,n,a,o);for(const i of this.child_views){const l=i.export(t,e),{x:n,y:a}=i.bbox;s.ctx.drawImage(l.canvas,n,a)}return s}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{children:this.child_views.map((t=>t.serializable_state()))})}}i.LayoutDOMView=y,y.__name__="LayoutDOMView";class g extends a.UIElement{constructor(t){super(t)}}i.LayoutDOM=g,n=g,g.__name__="LayoutDOM",n.define((t=>{const{Boolean:e,Number:i,Auto:s,Tuple:l,Or:n,Null:a,Nullable:r,Ref:h}=t,_=l(i,i),d=l(i,i,i,i);return{width:[r(i),null],height:[r(i),null],min_width:[r(i),null],min_height:[r(i),null],max_width:[r(i),null],max_height:[r(i),null],margin:[r(n(i,_,d)),null],width_policy:[n(f.SizingPolicy,s),"auto"],height_policy:[n(f.SizingPolicy,s),"auto"],aspect_ratio:[n(i,s,a),null],flow_mode:[u.FlowMode,"block"],sizing_mode:[r(u.SizingMode),null],disabled:[e,!1],align:[n(u.Align,l(u.Align,u.Align),s),"auto"],context_menu:[r(h(o.Menu)),null],resizable:[n(e,u.Dimensions),!1]}}))}, -function _(e,s,t,i,r){var n;i();const a=e(1),l=e(260),o=e(369),d=e(19),m=e(59),u=e(32),c=a.__importStar(e(271)),h=c;class _ extends l.UIElementView{constructor(){super(...arguments),this.items=new Map}stylesheets(){return[...super.stylesheets(),c.default]}*children(){yield*super.children(),yield*this.items.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,m.build_views)(this.items,this.model.items)}remove(){(0,m.remove_views)(this.items),super.remove()}render(){super.render(),this.el.classList.add(h[this.model.orientation]);const e=(()=>{const{items:e,reversed:s}=this.model,t=s?(0,u.reverse)(e):e;return(0,u.map)(t,(e=>this.items.get(e)))})();for(const s of e)s.render(),this.shadow_el.appendChild(s.el)}}t.MenuView=_,_.__name__="MenuView";class p extends l.UIElement{constructor(e){super(e)}}t.Menu=p,n=p,p.__name__="Menu",n.define((({Boolean:e,Array:s,Ref:t})=>({items:[s(t(o.MenuItem)),[]],reversed:[e,!1],orientation:[d.Orientation,"vertical"]})))}, +function _(t,e,i,s,l){var n;s();const a=t(260),o=t(368),r=t(18),h=t(15),u=t(19),_=t(56),d=t(8),c=t(59),f=t(229),m=t(16),p=t(263),w=t(12);class y extends a.UIElementView{constructor(){super(...arguments),this._child_views=new Map,this.mouseenter=new h.Signal(this,"mouseenter"),this.mouseleave=new h.Signal(this,"mouseleave"),this.disabled=new h.Signal(this,"disabled"),this._resized=!1,this._auto_width="fit-content",this._auto_height="fit-content",this._layout_computed=!1,this._was_built=!1}get is_layout_root(){return this.is_root||!(this.parent instanceof y)}_after_resize(){this._resized=!0,super._after_resize(),this.is_layout_root&&!this._was_built?(r.logger.warn(`${this} wasn't built properly`),this.render_to(null)):this.compute_layout()}async lazy_initialize(){await super.lazy_initialize(),await this.build_child_views()}remove(){for(const t of this.child_views)t.remove();this._child_views.clear(),super.remove()}connect_signals(){super.connect_signals(),this.el.addEventListener("mouseenter",(t=>{this.mouseenter.emit(t)})),this.el.addEventListener("mouseleave",(t=>{this.mouseleave.emit(t)})),this.el.addEventListener("contextmenu",(t=>{null!=this.model.context_menu&&(console.log("context menu"),t.preventDefault())})),this.parent instanceof y&&this.connect(this.parent.disabled,(t=>{this.disabled.emit(t||this.model.disabled)}));const t=this.model.properties;this.on_change(t.disabled,(()=>{this.disabled.emit(this.model.disabled)})),this.on_change([t.css_classes,t.stylesheets,t.width,t.height,t.min_width,t.min_height,t.max_width,t.max_height,t.margin,t.width_policy,t.height_policy,t.flow_mode,t.sizing_mode,t.aspect_ratio,t.visible],(()=>this.invalidate_layout()))}*children(){yield*super.children(),yield*this.child_views}get child_views(){return this.child_models.map((t=>this._child_views.get(t))).filter(d.isNotNull)}get layoutable_views(){return this.child_views.filter((t=>t instanceof y))}async build_child_views(){const{created:t,removed:e}=await(0,c.build_views)(this._child_views,this.child_models,{parent:this});for(const t of e)this._resize_observer.unobserve(t.el);for(const e of t)this._resize_observer.observe(e.el,{box:"border-box"});return t}render(){super.render();for(const t of this.child_views)t.render(),this.shadow_el.appendChild(t.el)}_update_children(){}async update_children(){const t=new Set(await this.build_child_views());if(0!=t.size){for(const t of this.child_views)(0,_.remove)(t.el);for(const e of this.child_views)this.shadow_el.append(e.el),t.has(e)&&(e.render(),e.after_render())}this._update_children(),this.invalidate_layout()}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flow"}}_update_layout(){function t(t,e,i,s){switch(t){case"auto":return null!=e?(0,_.px)(e):i;case"fixed":return null!=e?(0,_.px)(e):"fit-content";case"fit":return"fit-content";case"min":return"min-content";case"max":return null==s?"100%":`calc(100% - ${s})`}}function e(t){return(0,d.isNumber)(t)?(0,_.px)(t):`${t.percent}%`}const i={},s=this._intrinsic_display();i.display=function(t){const{inner:e,outer:i}=t;switch(`${e} ${i}`){case"block flow":return"block";case"inline flow":return"inline";case"block flow-root":return"flow-root";case"inline flow-root":return"inline-block";case"block flex":return"flex";case"inline flex":return"inline-flex";case"block grid":return"grid";case"inline grid":return"inline-grid";case"block table":return"table";case"inline table":return"inline-table";default:(0,w.unreachable)()}}(s);const l=this.box_sizing(),{width_policy:n,height_policy:a,width:o,height:r,aspect_ratio:h}=l,u=(()=>{if("auto"==h){if(null!=o&&null!=r)return o/r}else if((0,d.isNumber)(h))return h;return null})();"auto"==h?i.aspect_ratio=null!=o&&null!=r?`${o} / ${r}`:"auto":(0,d.isNumber)(h)&&(i.aspect_ratio=`${h}`);const{margin:c}=this.model,f=(()=>{if(null!=c){if((0,d.isNumber)(c))return i.margin=(0,_.px)(c),{width:(0,_.px)(2*c),height:(0,_.px)(2*c)};if(2==c.length){const[t,e]=c;return i.margin=`${(0,_.px)(t)} ${(0,_.px)(e)}`,{width:(0,_.px)(2*e),height:(0,_.px)(2*t)}}{const[t,e,s,l]=c;return i.margin=`${(0,_.px)(t)} ${(0,_.px)(e)} ${(0,_.px)(s)} ${(0,_.px)(l)}`,{width:(0,_.px)(l+e),height:(0,_.px)(t+s)}}}return{width:null,height:null}})(),[m,p]=(()=>{const e=t(n,o,this._auto_width,f.width),i=t(a,r,this._auto_height,f.height);if(null!=h){if(n!=a)return"fixed"==n?[e,"auto"]:"fixed"==a?["auto",i]:"max"==n?[e,"auto"]:"max"==a?["auto",i]:["auto","auto"];if("fixed"!=n&&"fixed"!=a&&null!=u)return u>=1?[e,"auto"]:["auto",i]}return[e,i]})();i.width=m,i.height=p;const{min_width:y,max_width:g}=this.model,{min_height:b,max_height:x}=this.model;i.min_width=null==y?"0px":e(y),i.min_height=null==b?"0px":e(b),this.is_layout_root?(null!=g&&(i.max_width=e(g)),null!=x&&(i.max_height=e(x))):(null!=g?i.max_width=`min(${e(g)}, 100%)`:"fixed"!=n&&(i.max_width="100%"),null!=x?i.max_height=`min(${e(x)}, 100%)`:"fixed"!=a&&(i.max_height="100%"));const{resizable:v}=this.model;if(!1!==v){const t=(()=>{switch(v){case"width":return"horizontal";case"height":return"vertical";case!0:case"both":return"both"}})();i.resize=t,i.overflow="auto"}this.style.append(":host",i)}update_layout(){this.update_style();for(const t of this.layoutable_views)t.update_layout();this._update_layout()}get is_managed(){return this.parent instanceof y}_measure_layout(){}measure_layout(){for(const t of this.layoutable_views)t.measure_layout();this._measure_layout()}compute_layout(){this.parent instanceof y?this.parent.compute_layout():(this.measure_layout(),this.update_bbox(),this._compute_layout(),this.after_layout()),this._layout_computed=!0}_compute_layout(){if(null!=this.layout){this.layout.compute(this.bbox.size);for(const t of this.layoutable_views)null==t.layout?t._compute_layout():t._propagate_layout()}else for(const t of this.layoutable_views)t._compute_layout()}_propagate_layout(){for(const t of this.layoutable_views)null==t.layout&&t._compute_layout()}update_bbox(){for(const t of this.layoutable_views)t.update_bbox();const t=super.update_bbox();return null!=this.layout&&(this.layout.visible=this.is_displayed),t}_after_layout(){}after_layout(){for(const t of this.layoutable_views)t.after_layout();this._after_layout()}render_to(t){if(!this.is_layout_root)throw new Error(`${this.toString()} is not a root layout`);this.render(),null!=t&&t.appendChild(this.el),this.r_after_render(),this._was_built=!0,this.notify_finished()}r_after_render(){for(const t of this.child_views)t instanceof y?t.r_after_render():t.after_render();this.after_render()}after_render(){this._after_render(),this.is_managed||this.invalidate_layout(),this._has_finished||(this.is_displayed?(0,m.defer)().then((()=>{this._resized||this.finish()})):this.finish())}async rebuild(){await this.build_child_views(),this.invalidate_render()}invalidate_layout(){this.parent instanceof y?this.parent.invalidate_layout():(this.update_layout(),this.compute_layout())}invalidate_render(){this.render(),this.invalidate_layout()}has_finished(){if(!super.has_finished())return!1;if(this.is_layout_root&&!this._layout_computed)return!1;for(const t of this.child_views)if(!t.has_finished())return!1;return!0}box_sizing(){let{width_policy:t,height_policy:e,aspect_ratio:i}=this.model;const{sizing_mode:s}=this.model;if(null!=s)if("inherit"==s){if(this.parent instanceof y){const s=this.parent.box_sizing();t=s.width_policy,e=s.height_policy,null==i&&(i=s.aspect_ratio)}}else if("fixed"==s)t=e="fixed";else if("stretch_both"==s)t=e="max";else if("stretch_width"==s)t="max";else if("stretch_height"==s)e="max";else switch(null==i&&(i="auto"),s){case"scale_width":t="max",e="min";break;case"scale_height":t="min",e="max";break;case"scale_both":t="max",e="max"}const[l,n]=(()=>{const{align:t}=this.model;return"auto"==t?[void 0,void 0]:(0,d.isArray)(t)?t:[t,t]})(),{width:a,height:o}=this.model;return{width_policy:t,height_policy:e,width:a,height:o,aspect_ratio:i,halign:l,valign:n}}export(t="auto",e=!0){const i=(()=>{switch(t){case"auto":case"png":return"canvas";case"svg":return"svg"}})(),s=new p.CanvasLayer(i,e),{x:l,y:n,width:a,height:o}=this.bbox;s.resize(a,o);const r=getComputedStyle(this.el).backgroundColor;s.ctx.fillStyle=r,s.ctx.fillRect(l,n,a,o);for(const i of this.child_views){const l=i.export(t,e),{x:n,y:a}=i.bbox.scale(s.pixel_ratio);s.ctx.drawImage(l.canvas,n,a)}return s}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{children:this.child_views.map((t=>t.serializable_state()))})}}i.LayoutDOMView=y,y.__name__="LayoutDOMView";class g extends a.UIElement{constructor(t){super(t)}}i.LayoutDOM=g,n=g,g.__name__="LayoutDOM",n.define((t=>{const{Boolean:e,Number:i,Auto:s,Tuple:l,Or:n,Null:a,Nullable:r,Ref:h}=t,_=l(i,i),d=l(i,i,i,i);return{width:[r(i),null],height:[r(i),null],min_width:[r(i),null],min_height:[r(i),null],max_width:[r(i),null],max_height:[r(i),null],margin:[r(n(i,_,d)),null],width_policy:[n(f.SizingPolicy,s),"auto"],height_policy:[n(f.SizingPolicy,s),"auto"],aspect_ratio:[n(i,s,a),null],flow_mode:[u.FlowMode,"block"],sizing_mode:[r(u.SizingMode),null],disabled:[e,!1],align:[n(u.Align,l(u.Align,u.Align),s),"auto"],context_menu:[r(h(o.Menu)),null],resizable:[n(e,u.Dimensions),!1]}}))}, +function _(e,s,t,i,r){var n;i();const a=e(1),l=e(260),o=e(369),d=e(19),m=e(59),u=e(33),c=a.__importStar(e(271)),h=c;class _ extends l.UIElementView{constructor(){super(...arguments),this.items=new Map}stylesheets(){return[...super.stylesheets(),c.default]}*children(){yield*super.children(),yield*this.items.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,m.build_views)(this.items,this.model.items)}remove(){(0,m.remove_views)(this.items),super.remove()}render(){super.render(),this.el.classList.add(h[this.model.orientation]);const e=(()=>{const{items:e,reversed:s}=this.model,t=s?(0,u.reverse)(e):e;return(0,u.map)(t,(e=>this.items.get(e)))})();for(const s of e)s.render(),this.shadow_el.appendChild(s.el)}}t.MenuView=_,_.__name__="MenuView";class p extends l.UIElement{constructor(e){super(e)}}t.Menu=p,n=p,p.__name__="Menu",n.define((({Boolean:e,Array:s,Ref:t})=>({items:[s(t(o.MenuItem)),[]],reversed:[e,!1],orientation:[d.Orientation,"vertical"]})))}, function _(e,t,s,n,u){n();const _=e(1),l=e(260),m=_.__importDefault(e(271)),a=_.__importDefault(e(272));class r extends l.UIElementView{stylesheets(){return[...super.stylesheets(),m.default,a.default]}}s.MenuItemView=r,r.__name__="MenuItemView";class c extends l.UIElement{constructor(e){super(e)}}s.MenuItem=c,c.__name__="MenuItem"}, function _(t,o,e,i,l){i();const n=t(146),r=t(57),h=t(12),{max:u}=Math;class s extends n.Layoutable{constructor(t){super(),this.children=t}_measure(t){return{width:0,height:0}}compute(t={}){const{width:o,height:e}=t;(0,h.assert)(null!=o&&null!=e);const i={width:o,height:e},l=new r.BBox({left:0,top:0,width:o,height:e});let n;if(null!=i.inner){const{left:t,top:l,right:h,bottom:u}=i.inner;n=new r.BBox({left:t,top:l,right:o-h,bottom:e-u})}this.set_geometry(l,n)}_set_geometry(t,o){super._set_geometry(t,o);const e=this.children.map(((t,o)=>{const{layout:e,bbox:i}=o;(0,h.assert)(null!=e);const l=e.measure(i);return{child:o,layout:e,bbox:i,size_hint:l}})),i=Array(e.nrows).fill(null).map((()=>({top:0,bottom:0}))),l=Array(e.ncols).fill(null).map((()=>({left:0,right:0})));e.foreach((({r0:t,c0:o,r1:e,c1:n},{size_hint:r})=>{const{inner:h}=r;null!=h&&(l[o].left=u(l[o].left,h.left),l[n].right=u(l[n].right,h.right),i[t].top=u(i[t].top,h.top),i[e].bottom=u(i[e].bottom,h.bottom))})),e.foreach((({r0:t,c0:o,r1:e,c1:n},{layout:h,size_hint:u,bbox:s})=>{const f=s,g=null==u.inner?void 0:(()=>{var h,s,g,m,c,d;const{inner:b,align:p}=u,a=null===(h=null==p?void 0:p.left)||void 0===h||h,_=null===(s=null==p?void 0:p.right)||void 0===s||s,v=null===(g=null==p?void 0:p.top)||void 0===g||g,w=null===(m=null==p?void 0:p.bottom)||void 0===m||m,y=null!==(c=null==p?void 0:p.fixed_width)&&void 0!==c&&c,x=null!==(d=null==p?void 0:p.fixed_height)&&void 0!==d&&d,{left:B,right:A}=(()=>{if(y){const t=f.width-b.right-b.left;if(a){const e=l[o].left;return{left:e,right:f.width-(e+t)}}if(_){const o=l[n].right;return{left:f.width-(o+t),right:o}}return{left:b.left,right:b.right}}return{left:a?l[o].left:b.left,right:_?l[n].right:b.right}})(),{top:z,bottom:L}=(()=>{if(x){const o=f.height-b.bottom-b.top;if(v){const e=i[t].top;return{top:e,bottom:f.height-(e+o)}}if(w){const t=i[e].bottom;return{top:f.height-(t+o),bottom:t}}return{top:b.top,bottom:b.bottom}}return{top:v?i[t].top:b.top,bottom:w?i[e].bottom:b.bottom}})(),{width:G,height:M}=f;return r.BBox.from_lrtb({left:B,top:z,right:G-A,bottom:M-L})})();h.set_geometry(f,g)}))}}e.GridAlignmentLayout=s,s.__name__="GridAlignmentLayout"}, function _(e,i,n,r,s){var o;r();const t=e(372),l=e(236),c=e(260);class d extends t.CSSGridBoxView{connect_signals(){super.connect_signals();const{children:e,rows:i,cols:n}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.on_change([i,n],(()=>this.invalidate_layout()))}get _children(){return this.model.children}get _rows(){return this.model.rows}get _cols(){return this.model.cols}}n.GridBoxView=d,d.__name__="GridBoxView";class _ extends t.CSSGridBox{constructor(e){super(e)}}n.GridBox=_,o=_,_.__name__="GridBox",o.prototype.default_view=d,o.define((({Array:e,Nullable:i})=>({children:[e((0,l.GridChild)(c.UIElement)),[]],rows:[i(l.TracksSizing),null],cols:[i(l.TracksSizing),null]})))}, -function _(n,i,s,t,e){var o;t();const a=n(367),l=n(370),r=n(236),c=n(56),_=n(231),u=n(32),d=n(8),{max:p}=Math;class g extends a.LayoutDOMView{connect_signals(){super.connect_signals();const{spacing:n}=this.model.properties;this.on_change(n,(()=>this.invalidate_layout()))}get child_models(){return this._children.map((([n])=>n))}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){super._update_layout();const n={},[i,s]=(()=>{const{spacing:n}=this.model;return(0,d.isNumber)(n)?[n,n]:n})();n.row_gap=(0,c.px)(i),n.column_gap=(0,c.px)(s);let t=0,e=0;const o=new _.Container;for(const[[,n,i,s=1,l=1],r]of(0,u.enumerate)(this._children)){const c=this.child_views[r];t=p(t,n+s),e=p(e,i+l);const _={};if(_.grid_row_start=`${n+1}`,_.grid_row_end=`span ${s}`,_.grid_column_start=`${i+1}`,_.grid_column_end=`span ${l}`,c.style.append(":host",_),c instanceof a.LayoutDOMView&&null!=c.layout){const t=n,e=i,a=n+s-1,r=i+l-1;o.add({r0:t,c0:e,r1:a,c1:r},c)}}const{_rows:r,_cols:g}=this;function h(n,i){if(n instanceof Map)for(const[s,t]of n.entries())(0,d.isString)(t)?i[s].size=t:i[s]=t;else if((0,d.isArray)(n))for(const[s,t]of(0,u.enumerate)(n))(0,d.isString)(s)?i[t].size=s:i[t]=s;else if(null!=n)for(const s of i)(0,d.isString)(n)?s.size=n:(s.size=n.size,s.align=n.align)}r instanceof Map?t=p(t,...r.keys()):(0,d.isArray)(r)&&(t=p(t,r.length)),g instanceof Map?e=p(e,...g.keys()):(0,d.isArray)(g)&&(e=p(e,g.length));const f=Array(t).fill(null).map((()=>({}))),m=Array(e).fill(null).map((()=>({})));h(r,f),h(g,m);for(const[[,n,i],s]of(0,u.enumerate)(this._children)){const t=this.child_views[s],{halign:e,valign:o}=t.box_sizing();t.style.append(":host",{justify_self:null!=e?e:m[i].align,align_self:null!=o?o:f[n].align})}const y="auto";n.grid_template_rows=f.map((({size:n})=>null!=n?n:y)).join(" "),n.grid_template_columns=m.map((({size:n})=>null!=n?n:y)).join(" "),this.style.append(":host",n),0!=o.size?(this.layout=new l.GridAlignmentLayout(o),this.layout.set_sizing()):delete this.layout}}s.CSSGridBoxView=g,g.__name__="CSSGridBoxView";class h extends a.LayoutDOM{constructor(n){super(n)}}s.CSSGridBox=h,o=h,h.__name__="CSSGridBox",o.define((()=>({spacing:[r.GridSpacing,0]})))}, +function _(n,i,s,t,e){var o;t();const a=n(367),l=n(370),r=n(236),c=n(56),_=n(231),u=n(33),d=n(8),{max:p}=Math;class g extends a.LayoutDOMView{connect_signals(){super.connect_signals();const{spacing:n}=this.model.properties;this.on_change(n,(()=>this.invalidate_layout()))}get child_models(){return this._children.map((([n])=>n))}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){super._update_layout();const n={},[i,s]=(()=>{const{spacing:n}=this.model;return(0,d.isNumber)(n)?[n,n]:n})();n.row_gap=(0,c.px)(i),n.column_gap=(0,c.px)(s);let t=0,e=0;const o=new _.Container;for(const[[,n,i,s=1,l=1],r]of(0,u.enumerate)(this._children)){const c=this.child_views[r];t=p(t,n+s),e=p(e,i+l);const _={};if(_.grid_row_start=`${n+1}`,_.grid_row_end=`span ${s}`,_.grid_column_start=`${i+1}`,_.grid_column_end=`span ${l}`,c.style.append(":host",_),c instanceof a.LayoutDOMView&&null!=c.layout){const t=n,e=i,a=n+s-1,r=i+l-1;o.add({r0:t,c0:e,r1:a,c1:r},c)}}const{_rows:r,_cols:g}=this;function h(n,i){if(n instanceof Map)for(const[s,t]of n.entries())(0,d.isString)(t)?i[s].size=t:i[s]=t;else if((0,d.isArray)(n))for(const[s,t]of(0,u.enumerate)(n))(0,d.isString)(s)?i[t].size=s:i[t]=s;else if(null!=n)for(const s of i)(0,d.isString)(n)?s.size=n:(s.size=n.size,s.align=n.align)}r instanceof Map?t=p(t,...r.keys()):(0,d.isArray)(r)&&(t=p(t,r.length)),g instanceof Map?e=p(e,...g.keys()):(0,d.isArray)(g)&&(e=p(e,g.length));const f=Array(t).fill(null).map((()=>({}))),m=Array(e).fill(null).map((()=>({})));h(r,f),h(g,m);for(const[[,n,i],s]of(0,u.enumerate)(this._children)){const t=this.child_views[s],{halign:e,valign:o}=t.box_sizing();t.style.append(":host",{justify_self:null!=e?e:m[i].align,align_self:null!=o?o:f[n].align})}const y="auto";n.grid_template_rows=f.map((({size:n})=>null!=n?n:y)).join(" "),n.grid_template_columns=m.map((({size:n})=>null!=n?n:y)).join(" "),this.style.append(":host",n),0!=o.size?(this.layout=new l.GridAlignmentLayout(o),this.layout.set_sizing()):delete this.layout}}s.CSSGridBoxView=g,g.__name__="CSSGridBoxView";class h extends a.LayoutDOM{constructor(n){super(n)}}s.CSSGridBox=h,o=h,h.__name__="CSSGridBox",o.define((()=>({spacing:[r.GridSpacing,0]})))}, function _(e,t,s,l,i){var c;l();const h=e(1),d=e(367),o=e(260),n=e(56),a=h.__importDefault(e(374));class _ extends d.LayoutDOMView{stylesheets(){return[...super.stylesheets(),a.default]}connect_signals(){super.connect_signals();const{child:e}=this.model.properties;this.on_change(e,(()=>this.update_children()));const{checkable:t,disabled:s}=this.model.properties;this.on_change(t,(()=>{(0,n.display)(this.checkbox_el,this.model.checkable)})),this.on_change(s,(()=>{this.checkbox_el.checked=!this.model.disabled}))}get child_models(){return[this.model.child]}render(){super.render();const{checkable:e,disabled:t,title:s}=this.model;this.checkbox_el=(0,n.input)({type:"checkbox",checked:!t}),this.checkbox_el.addEventListener("change",(()=>{this.model.disabled=!this.checkbox_el.checked})),(0,n.display)(this.checkbox_el,e);const l=(0,n.legend)({},this.checkbox_el,s),i=this.child_views.map((e=>e.el));this.fieldset_el=(0,n.fieldset)({},l,...i),this.shadow_el.appendChild(this.fieldset_el)}_update_children(){const e=this.child_views.map((e=>e.el));this.fieldset_el.append(...e)}}s.GroupBoxView=_,_.__name__="GroupBoxView";class r extends d.LayoutDOM{constructor(e){super(e)}}s.GroupBox=r,c=r,r.__name__="GroupBox",c.prototype.default_view=_,c.define((({Boolean:e,String:t,Nullable:s,Ref:l})=>({title:[s(t),null],child:[l(o.UIElement)],checkable:[e,!1]})))}, function _(d,a,e,l,i){l(),e.default="legend{display:flex;gap:0.5em;padding:0 calc(var(--padding-horizontal) / 2);}fieldset{border:1px solid #ccc;}"}, function _(e,n,l,t,s){var i;t();const o=e(372),c=e(236),r=e(260),a=e(20),d=(0,a.Struct)({child:(0,a.Ref)(r.UIElement),col:(0,a.Opt)(c.Index),span:(0,a.Opt)(c.Span)});class _ extends o.CSSGridBoxView{connect_signals(){super.connect_signals();const{children:e,cols:n}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.on_change(n,(()=>this.invalidate_layout()))}get _children(){return this.model.children.map((({child:e,col:n,span:l},t)=>[e,0,null!=n?n:t,1,null!=l?l:1]))}get _rows(){return null}get _cols(){return this.model.cols}}l.HBoxView=_,_.__name__="HBoxView";class h extends o.CSSGridBox{constructor(e){super(e)}}l.HBox=h,i=h,h.__name__="HBox",i.prototype.default_view=_,i.define((({Array:e,Nullable:n})=>({children:[e(d),[]],cols:[n(c.TracksSizing),null]})))}, @@ -1354,7 +1354,7 @@

Plots# function _(e,i,r,t,s){var d;t();const n=e(1),_=e(369),a=n.__importStar(e(271));class c extends _.MenuItemView{render(){super.render(),this.el.classList.add(a.divider)}}r.DividerView=c,c.__name__="DividerView";class o extends _.MenuItem{constructor(e){super(e)}}r.Divider=o,d=o,o.__name__="Divider",d.prototype.default_view=c}, function _(t,a,i,e,M){e();var T=t(149);M("MathText",T.MathText),M("Ascii",T.Ascii),M("MathML",T.MathML),M("TeX",T.TeX),M("PlainText",t(156).PlainText)}, function _(r,o,t,e,n){e(),n("CustomJSTransform",r(391).CustomJSTransform),n("Dodge",r(392).Dodge),n("Interpolator",r(394).Interpolator),n("Jitter",r(395).Jitter),n("LinearInterpolator",r(397).LinearInterpolator),n("StepInterpolator",r(398).StepInterpolator),n("Transform",r(86).Transform)}, -function _(r,t,s,n,e){var a;n();const u=r(86),o=r(9),m=r(38);class _ extends u.Transform{constructor(r){super(r)}get names(){return(0,o.keys)(this.args)}get values(){return(0,o.values)(this.args)}_make_transform(r,t){return new Function(...this.names,r,(0,m.use_strict)(t))}get scalar_transform(){return this._make_transform("x",this.func)}get vector_transform(){return this._make_transform("xs",this.v_func)}compute(r){return this.scalar_transform(...this.values,r)}v_compute(r){return this.vector_transform(...this.values,r)}}s.CustomJSTransform=_,a=_,_.__name__="CustomJSTransform",a.define((({Unknown:r,String:t,Dict:s})=>({args:[s(r),{}],func:[t,""],v_func:[t,""]})))}, +function _(r,t,s,n,e){var a;n();const u=r(86),o=r(9),m=r(39);class _ extends u.Transform{constructor(r){super(r)}get names(){return(0,o.keys)(this.args)}get values(){return(0,o.values)(this.args)}_make_transform(r,t){return new Function(...this.names,r,(0,m.use_strict)(t))}get scalar_transform(){return this._make_transform("x",this.func)}get vector_transform(){return this._make_transform("xs",this.v_func)}compute(r){return this.scalar_transform(...this.values,r)}v_compute(r){return this.vector_transform(...this.values,r)}}s.CustomJSTransform=_,a=_,_.__name__="CustomJSTransform",a.define((({Unknown:r,String:t,Dict:s})=>({args:[s(r),{}],func:[t,""],v_func:[t,""]})))}, function _(e,n,r,o,s){var t;o();const u=e(393);class a extends u.RangeTransform{constructor(e){super(e)}_compute(e){return e+this.value}}r.Dodge=a,t=a,a.__name__="Dodge",t.define((({Number:e})=>({value:[e,0]})))}, function _(e,n,t,r,a){var s;r();const c=e(86),o=e(87),i=e(96),u=e(23),h=e(8),l=e(12);class g extends c.Transform{constructor(e){super(e)}v_compute(e){let n;this.range instanceof i.FactorRange?n=this.range.v_synthetic(e):(0,h.isArrayableOf)(e,h.isNumber)?n=e:(0,l.unreachable)();const t=new((0,u.infer_type)(n))(n.length);for(let e=0;e({range:[n(e(o.Range)),null]})))}, function _(t,e,r,n,s){var o;n();const i=t(86),a=t(99),h=t(23),l=t(10),d=t(8);class c extends i.Transform{constructor(t){super(t),this._sorted_dirty=!0}connect_signals(){super.connect_signals(),this.connect(this.change,(()=>this._sorted_dirty=!0))}v_compute(t){const e=new((0,h.infer_type)(t))(t.length);for(let r=0;ro*(e[t]-e[r]))),this._x_sorted=new((0,h.infer_type)(e))(n),this._y_sorted=new((0,h.infer_type)(r))(n);for(let t=0;t({x:[o(r,s(e))],y:[o(r,s(e))],data:[i(n(a.ColumnarDataSource)),null],clip:[t,!0]})))}, @@ -1365,14 +1365,14 @@

Plots# function _(p,o,t,i,a){i(),a("MapOptions",p(400).MapOptions),a("GMapOptions",p(400).GMapOptions),a("GMapPlot",p(400).GMapPlot),a("GMap",p(408).GMap),a("Plot",p(401).Plot),a("GridPlot",p(409).GridPlot),a("Figure",p(410).Figure)}, function _(e,t,a,n,o){var p,s,l;n();const _=e(401),i=e(19),r=e(50),c=e(88),d=e(407);o("GMapPlotView",d.GMapPlotView);class u extends r.Model{constructor(e){super(e)}}a.MapOptions=u,p=u,u.__name__="MapOptions",p.define((({Int:e,Number:t})=>({lat:[t],lng:[t],zoom:[e,12]})));class M extends u{constructor(e){super(e)}}a.GMapOptions=M,s=M,M.__name__="GMapOptions",s.define((({Boolean:e,Int:t,String:a,Nullable:n})=>({map_type:[i.MapType,"roadmap"],scale_control:[e,!1],styles:[n(a),null],tilt:[t,45]})));class m extends _.Plot{constructor(e){super(e),this.use_map=!0}}a.GMapPlot=m,l=m,m.__name__="GMapPlot",l.prototype.default_view=d.GMapPlotView,l.define((({String:e,Bytes:t,Ref:a})=>({map_options:[a(M)],api_key:[t],api_version:[e,"weekly"]}))),l.override({x_range:()=>new c.Range1d,y_range:()=>new c.Range1d,background_fill_alpha:0})}, function _(e,t,o,r,n){var a;r();const l=e(1),i=l.__importStar(e(78)),s=l.__importStar(e(17)),_=e(15),d=e(19),c=e(10),h=e(43),u=e(8),g=e(367),b=e(159),f=e(363),m=e(73),p=e(142),w=e(89),y=e(259),v=e(87),x=e(85),S=e(104),R=e(74),A=e(200),D=e(199),L=e(267),O=e(93),P=e(402);n("PlotView",P.PlotView);class T extends g.LayoutDOM{constructor(e){super(e),this.use_map=!1,this.reset=new _.Signal0(this,"reset")}add_layout(e,t="center"){const o=this.properties[t].get_value();this.setv({[t]:[...o,e]})}remove_layout(e){const t=t=>{(0,c.remove_by)(t,(t=>t==e))};t(this.left),t(this.right),t(this.above),t(this.below),t(this.center)}get data_renderers(){return this.renderers.filter((e=>e instanceof A.DataRenderer))}add_renderers(...e){this.renderers=[...this.renderers,...e]}add_glyph(e,t=new S.ColumnDataSource,o={}){const r=new D.GlyphRenderer(Object.assign(Object.assign({},o),{data_source:t,glyph:e}));return this.add_renderers(r),r}add_tools(...e){const t=e.map((e=>e instanceof L.Tool?e:L.Tool.from_string(e)));this.toolbar.tools=[...this.toolbar.tools,...t]}remove_tools(...e){this.toolbar.tools=[...(0,h.difference)(new Set(this.toolbar.tools),new Set(e))]}get panels(){return[...this.side_panels,...this.center]}get side_panels(){const{above:e,below:t,left:o,right:r}=this;return(0,c.concat)([e,t,o,r])}}o.Plot=T,a=T,T.__name__="Plot",a.prototype.default_view=P.PlotView,a.mixins([["outline_",i.Line],["background_",i.Fill],["border_",i.Fill]]),a.define((({Boolean:e,Number:t,String:o,Array:r,Dict:n,Or:a,Ref:l,Null:i,Nullable:_,Struct:c,Opt:h})=>({toolbar:[l(y.Toolbar),()=>new y.Toolbar],toolbar_location:[_(d.Location),"right"],toolbar_sticky:[e,!0],toolbar_inner:[e,!1],frame_width:[_(t),null],frame_height:[_(t),null],frame_align:[a(e,c({left:h(e),right:h(e),top:h(e),bottom:h(e)})),!0],title:[a(l(p.Title),o,i),"",{convert:e=>(0,u.isString)(e)?new p.Title({text:e}):e}],title_location:[_(d.Location),"above"],above:[r(a(l(m.Annotation),l(b.Axis))),[]],below:[r(a(l(m.Annotation),l(b.Axis))),[]],left:[r(a(l(m.Annotation),l(b.Axis))),[]],right:[r(a(l(m.Annotation),l(b.Axis))),[]],center:[r(a(l(m.Annotation),l(f.Grid))),[]],renderers:[r(l(R.Renderer)),[]],x_range:[l(v.Range),()=>new O.DataRange1d],y_range:[l(v.Range),()=>new O.DataRange1d],x_scale:[l(x.Scale),()=>new w.LinearScale],y_scale:[l(x.Scale),()=>new w.LinearScale],extra_x_ranges:[n(l(v.Range)),{}],extra_y_ranges:[n(l(v.Range)),{}],extra_x_scales:[n(l(x.Scale)),{}],extra_y_scales:[n(l(x.Scale)),{}],lod_factor:[t,10],lod_interval:[t,300],lod_threshold:[_(t),2e3],lod_timeout:[t,500],hidpi:[e,!0],output_backend:[d.OutputBackend,"canvas"],min_border:[_(t),5],min_border_top:[_(t),null],min_border_left:[_(t),null],min_border_bottom:[_(t),null],min_border_right:[_(t),null],inner_width:[t,s.unset,{readonly:!0}],inner_height:[t,s.unset,{readonly:!0}],outer_width:[t,s.unset,{readonly:!0}],outer_height:[t,s.unset,{readonly:!0}],match_aspect:[e,!1],aspect_scale:[t,1],reset_policy:[d.ResetPolicy,"standard"],hold_render:[e,!1]}))),a.override({width:600,height:600,outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"})}, -function _(e,t,i,s,n){s();const a=e(1),r=e(157),o=e(294),l=e(268),_=e(367),h=e(73),d=e(142),c=e(159),u=e(258),p=e(93),g=e(52),m=e(59),b=e(75),v=e(18),f=e(52),w=e(403),y=e(8),x=e(10),z=e(32),k=e(263),S=e(230),M=e(232),$=e(231),q=e(144),V=e(57),O=e(152),R=e(404),j=e(405),P=e(28),T=e(56),C=a.__importDefault(e(406)),{max:B}=Math;class A extends _.LayoutDOMView{constructor(){super(...arguments),this._computed_style=new T.InlineStyleSheet,this._outer_bbox=new V.BBox,this._inner_bbox=new V.BBox,this._needs_paint=!0,this._invalidated_painters=new Set,this._invalidate_all=!0,this.renderer_views=new Map,this.tool_views=new Map,this._needs_notify=!1}get canvas(){return this.canvas_view}stylesheets(){return[...super.stylesheets(),C.default,this._computed_style]}get toolbar_panel(){return null!=this._toolbar?this.renderer_view(this._toolbar):void 0}get state(){return this._state_manager}set invalidate_dataranges(e){this._range_manager.invalidate_dataranges=e}renderer_view(e){const t=this.renderer_views.get(e);if(null==t)for(const[,t]of this.renderer_views){const i=t.renderer_view(e);if(null!=i)return i}return t}get auto_ranged_renderers(){return this.model.renderers.map((e=>this.renderer_view(e))).filter(p.is_auto_ranged)}get base_font_size(){const e=getComputedStyle(this.el).fontSize,t=(0,O.parse_css_font_size)(e);if(null!=t){const{value:e,unit:i}=t;if("px"==i)return e}return null}*children(){yield*super.children(),yield*this.renderer_views.values(),yield*this.tool_views.values(),yield this.canvas}get is_paused(){return null!=this._is_paused&&0!==this._is_paused}get child_models(){return[]}pause(){null==this._is_paused?this._is_paused=1:this._is_paused+=1}unpause(e=!1){if(null==this._is_paused)throw new Error("wasn't paused");this._is_paused=Math.max(this._is_paused-1,0),0!=this._is_paused||e||this.request_paint("everything")}notify_finished_after_paint(){this._needs_notify=!0}request_render(){this.request_paint("everything")}request_paint(e){this.invalidate_painters(e),this.schedule_paint()}invalidate_painters(e){if("everything"==e)this._invalidate_all=!0;else if((0,y.isArray)(e))for(const t of e)this._invalidated_painters.add(t);else this._invalidated_painters.add(e)}schedule_paint(){if(!this.is_paused){const e=this.throttled_paint();this._ready=this._ready.then((()=>e))}}request_layout(){this.request_paint("everything")}reset(){"standard"==this.model.reset_policy&&(this.state.clear(),this.reset_range(),this.reset_selection()),this.model.trigger_event(new g.Reset)}remove(){for(const e of this.frame.ranges.values())e.plots.delete(this);(0,m.remove_views)(this.renderer_views),(0,m.remove_views)(this.tool_views),this.canvas_view.remove(),super.remove()}render(){super.render(),this.shadow_el.appendChild(this.canvas_view.el),this.canvas_view.render()}initialize(){this.pause(),super.initialize(),this.lod_started=!1,this.visuals=new b.Visuals(this),this._initial_state={selection:new Map},this.frame=new r.CartesianFrame(this.model.x_scale,this.model.y_scale,this.model.x_range,this.model.y_range,this.model.extra_x_ranges,this.model.extra_y_ranges,this.model.extra_x_scales,this.model.extra_y_scales);for(const e of this.frame.ranges.values())e.plots.add(this);this._range_manager=new R.RangeManager(this),this._state_manager=new j.StateManager(this,this._initial_state),this.throttled_paint=(0,w.throttle)((()=>{this._removed||this.repaint()}),1e3/60);const{title_location:e,title:t}=this.model;null!=e&&null!=t&&(this._title=t instanceof d.Title?t:new d.Title({text:t}));const{toolbar_location:i,toolbar_inner:s,toolbar:n}=this.model;null!=i&&(this._toolbar=new u.ToolbarPanel({toolbar:n}),n.location=i,n.inner=s)}async lazy_initialize(){await super.lazy_initialize();const{hidpi:e,output_backend:t}=this.model,i=new o.Canvas({hidpi:e,output_backend:t});this.canvas_view=await(0,m.build_view)(i,{parent:this}),this.canvas_view.plot_views=[this],await this.build_tool_views(),await this.build_renderer_views(),this._range_manager.update_dataranges()}box_sizing(){const e=super.box_sizing(),{width_policy:t,height_policy:i}=e,s=a.__rest(e,["width_policy","height_policy"]),{frame_width:n,frame_height:r}=this.model;return Object.assign(Object.assign({},s),{width_policy:null!=n&&"auto"==t?"fit":t,height_policy:null!=r&&"auto"==i?"fit":i})}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){var e,t,i,s,n;super._update_layout(),this._invalidate_all=!0,this._needs_paint=!0;const a=new M.BorderLayout,{frame_align:r}=this.model;if(a.aligns=(()=>{if((0,y.isBoolean)(r))return{left:r,right:r,top:r,bottom:r};{const{left:e=!0,right:t=!0,top:i=!0,bottom:s=!0}=r;return{left:e,right:t,top:i,bottom:s}}})(),a.set_sizing({width_policy:"max",height_policy:"max"}),this.visuals.outline_line.doit){const e=this.visuals.outline_line.line_width.get_value();a.center_border_width=e}const o=(0,x.copy)(this.model.above),l=(0,x.copy)(this.model.below),_=(0,x.copy)(this.model.left),c=(0,x.copy)(this.model.right),p=[],g=[],m=[],b=[],v=(e,t=!1)=>{switch(e){case"above":return t?p:o;case"below":return t?g:l;case"left":return t?m:_;case"right":return t?b:c}},{title_location:f}=this.model;if(null!=f&&null!=this._title&&v(f).push(this._title),null!=this._toolbar){const{location:e}=this._toolbar.toolbar;if(this.model.toolbar_inner){v(e,!0).push(this._toolbar)}else{const t=v(e);let i=!0;if(this.model.toolbar_sticky)for(let s=0;s{var i;const s=this.renderer_view(t);return s.panel=new q.Panel(e),null===(i=s.update_layout)||void 0===i||i.call(s),s.layout},z=(e,t)=>{const i="above"==e||"below"==e,s=[];for(const n of t)if((0,y.isArray)(n)){const t=n.map((t=>{const s=w(e,t);if(t instanceof u.ToolbarPanel){const e=i?"width_policy":"height_policy";s.set_sizing(Object.assign(Object.assign({},s.sizing),{[e]:"min"}))}return s}));let a;i?(a=new $.Row(t),a.set_sizing({width_policy:"max",height_policy:"min"})):(a=new $.Column(t),a.set_sizing({width_policy:"min",height_policy:"max"})),a.absolute=!0,s.push(a)}else s.push(w(e,n));return s},k=null!==(e=this.model.min_border)&&void 0!==e?e:0;a.min_border={left:null!==(t=this.model.min_border_left)&&void 0!==t?t:k,top:null!==(i=this.model.min_border_top)&&void 0!==i?i:k,right:null!==(s=this.model.min_border_right)&&void 0!==s?s:k,bottom:null!==(n=this.model.min_border_bottom)&&void 0!==n?n:k};const V=new S.NodeLayout,O=new S.VStack,R=new S.VStack,j=new S.HStack,P=new S.HStack,T=new S.VStack,C=new S.VStack,B=new S.HStack,A=new S.HStack;V.absolute=!0,O.absolute=!0,R.absolute=!0,j.absolute=!0,P.absolute=!0,T.absolute=!0,C.absolute=!0,B.absolute=!0,A.absolute=!0,V.children=this.model.center.filter((e=>e instanceof h.Annotation)).map((e=>{var t;const i=this.renderer_view(e);return null===(t=i.update_layout)||void 0===t||t.call(i),i.layout})).filter((e=>null!=e));const{frame_width:H,frame_height:L}=this.model;V.set_sizing(Object.assign(Object.assign({},null!=H?{width_policy:"fixed",width:H}:{width_policy:"fit"}),null!=L?{height_policy:"fixed",height:L}:{height_policy:"fit"})),V.on_resize((e=>this.frame.set_geometry(e))),O.children=(0,x.reversed)(z("above",o)),R.children=z("below",l),j.children=(0,x.reversed)(z("left",_)),P.children=z("right",c),T.children=z("above",p),C.children=z("below",g),B.children=z("left",m),A.children=z("right",b),O.set_sizing({width_policy:"fit",height_policy:"min"}),R.set_sizing({width_policy:"fit",height_policy:"min"}),j.set_sizing({width_policy:"min",height_policy:"fit"}),P.set_sizing({width_policy:"min",height_policy:"fit"}),T.set_sizing({width_policy:"fit",height_policy:"min"}),C.set_sizing({width_policy:"fit",height_policy:"min"}),B.set_sizing({width_policy:"min",height_policy:"fit"}),A.set_sizing({width_policy:"min",height_policy:"fit"}),a.center_panel=V,a.top_panel=O,a.bottom_panel=R,a.left_panel=j,a.right_panel=P,0!=T.children.length&&(a.inner_top_panel=T),0!=C.children.length&&(a.inner_bottom_panel=C),0!=B.children.length&&(a.inner_left_panel=B),0!=A.children.length&&(a.inner_right_panel=A),this.layout=a}_measure_layout(){const{frame_width:e,frame_height:t}=this.model,i=null==e?"1fr":(0,T.px)(e),s=null==t?"1fr":(0,T.px)(t),{layout:n}=this,a=n.top_panel.measure({width:1/0,height:1/0}),r=n.bottom_panel.measure({width:1/0,height:1/0}),o=n.left_panel.measure({width:1/0,height:1/0}),l=n.right_panel.measure({width:1/0,height:1/0}),_=B(a.height,n.min_border.top),h=B(r.height,n.min_border.bottom),d=B(o.width,n.min_border.left),c=B(l.width,n.min_border.right);this._computed_style.replace(`\n :host {\n grid-template-rows: ${_}px ${s} ${h}px;\n grid-template-columns: ${d}px ${i} ${c}px;\n }\n `)}get axis_views(){const e=[];for(const[,t]of this.renderer_views)t instanceof c.AxisView&&e.push(t);return e}update_range(e,t){this.pause(),this._range_manager.update(e,t),this.unpause()}reset_range(){this.pause(),this._range_manager.reset(),this.unpause(),this.trigger_ranges_update_event()}trigger_ranges_update_event(){const{x_range:e,y_range:t}=this.model,i=new Set([...e.plots,...t.plots]);for(const e of i){const{x_range:t,y_range:i}=e.model;e.model.trigger_event(new f.RangesUpdate(t.start,t.end,i.start,i.end))}}get_selection(){const e=new Map;for(const t of this.model.data_renderers){const{selected:i}=t.selection_manager.source;e.set(t,i)}return e}update_selection(e){for(const t of this.model.data_renderers){const i=t.selection_manager.source;if(null!=e){const s=e.get(t);null!=s&&i.selected.update(s,!0)}else i.selection_manager.clear()}}reset_selection(){this.update_selection(null)}_invalidate_layout_if_needed(){(()=>{var e,t;for(const i of this.model.side_panels){const s=this.renderer_views.get(i);if(null!==(t=null===(e=s.layout)||void 0===e?void 0:e.has_size_changed())&&void 0!==t&&t)return this.invalidate_painters(s),!0}return!1})()&&this.compute_layout()}get_renderer_views(){return this.computed_renderers.map((e=>this.renderer_views.get(e)))}*_compute_renderers(){const{above:e,below:t,left:i,right:s,center:n,renderers:a}=this.model;yield*a,yield*e,yield*t,yield*i,yield*s,yield*n,null!=this._title&&(yield this._title),null!=this._toolbar&&(yield this._toolbar);for(const[,e]of this.tool_views)yield*e.overlays}async build_renderer_views(){this.computed_renderers=[...this._compute_renderers()],await(0,m.build_views)(this.renderer_views,this.computed_renderers,{parent:this})}async build_tool_views(){const e=(0,z.flat_map)(this.model.toolbar.tools,(e=>e instanceof l.ToolProxy?e.tools:[e])),{created:t}=await(0,m.build_views)(this.tool_views,[...e],{parent:this});t.map((e=>this.canvas_view.ui_event_bus.register_tool(e)))}connect_signals(){super.connect_signals();const{extra_x_ranges:e,extra_y_ranges:t,extra_x_scales:i,extra_y_scales:s}=this.model.properties;this.on_change([e,t,i,s],(()=>{this.frame.x_range=this.model.x_range,this.frame.y_range=this.model.y_range,this.frame.in_x_scale=this.model.x_scale,this.frame.in_y_scale=this.model.y_scale,this.frame.extra_x_ranges=this.model.extra_x_ranges,this.frame.extra_y_ranges=this.model.extra_y_ranges,this.frame.extra_x_scales=this.model.extra_x_scales,this.frame.extra_y_scales=this.model.extra_y_scales,this.frame.configure_scales()}));const{above:n,below:a,left:r,right:o,center:l,renderers:_}=this.model.properties,h=[n,a,r,o,l];this.on_change(_,(async()=>{await this.build_renderer_views()})),this.on_change(h,(async()=>{await this.build_renderer_views(),this.invalidate_layout()})),this.connect(this.model.toolbar.properties.tools.change,(async()=>{await this.build_tool_views(),await this.build_renderer_views()}));const{x_ranges:d,y_ranges:c}=this.frame;for(const[,e]of d)this.connect(e.change,(()=>{this.request_paint("everything")}));for(const[,e]of c)this.connect(e.change,(()=>{this.request_paint("everything")}));this.connect(this.model.change,(()=>this.request_paint("everything"))),this.connect(this.model.reset,(()=>this.reset()));const{toolbar_location:p}=this.model.properties;this.on_change(p,(async()=>{const{toolbar_location:e}=this.model;if(null!=this._toolbar)null!=e?this._toolbar.toolbar.location=e:(this._toolbar=void 0,await this.build_renderer_views());else if(null!=e){const{toolbar:t,toolbar_inner:i}=this.model;this._toolbar=new u.ToolbarPanel({toolbar:t}),t.location=e,t.inner=i,await this.build_renderer_views()}this.invalidate_layout()}));const{hold_render:g}=this.model.properties;this.on_change(g,(()=>this._hold_render_changed()))}has_finished(){if(!super.has_finished())return!1;if(this.model.visible)for(const[,e]of this.renderer_views)if(!e.has_finished())return!1;return!0}_after_layout(){var e;super._after_layout(),this.unpause(!0);const t=this.layout.left_panel.bbox,i=this.layout.right_panel.bbox,s=this.layout.center_panel.bbox,n=this.layout.top_panel.bbox,a=this.layout.bottom_panel.bbox,{bbox:r}=this,o=n.bottom,l=r.height-a.top,_=t.right,d=r.width-i.left;this.canvas.style.replace(`\n .bk-layer.bk-events {\n display: grid;\n grid-template-areas:\n ". above . "\n "left center right"\n ". below . ";\n grid-template-rows: ${(0,T.px)(o)} ${(0,T.px)(s.height)} ${(0,T.px)(l)};\n grid-template-columns: ${(0,T.px)(_)} ${(0,T.px)(s.width)} ${(0,T.px)(d)};\n }\n `);for(const[,t]of this.renderer_views)t instanceof h.AnnotationView&&(null===(e=t.after_layout)||void 0===e||e.call(t));this.model.setv({inner_width:Math.round(this.frame.bbox.width),inner_height:Math.round(this.frame.bbox.height),outer_width:Math.round(this.bbox.width),outer_height:Math.round(this.bbox.height)},{no_change:!0}),this.model.match_aspect&&(this.pause(),this._range_manager.update_dataranges(),this.unpause(!0)),this._outer_bbox.equals(this.bbox)||(this.canvas_view.resize(),this._outer_bbox=this.bbox,this._invalidate_all=!0,this._needs_paint=!0);const{inner_bbox:c}=this.layout;this._inner_bbox.equals(c)||(this._inner_bbox=c,this._needs_paint=!0),this._needs_paint&&this.paint()}repaint(){this._invalidate_layout_if_needed(),this.paint()}paint(){this.is_paused||(this.model.visible&&(v.logger.trace(`${this.toString()}.paint()`),this._actual_paint()),this._needs_notify&&(this._needs_notify=!1,this.notify_finished()))}_actual_paint(){var e;const{document:t}=this.model;if(null!=t){const e=t.interactive_duration();e>=0&&e{t.interactive_duration()>this.model.lod_timeout&&t.interactive_stop(),this.request_paint("everything")}),this.model.lod_timeout):t.interactive_stop()}this._range_manager.invalidate_dataranges&&(this._range_manager.update_dataranges(),this._invalidate_layout_if_needed());let i=!1,s=!1;if(this._invalidate_all)i=!0,s=!0;else for(const e of this._invalidated_painters){const{level:t}=e.model;if("overlay"!=t?i=!0:s=!0,i&&s)break}this._invalidated_painters.clear(),this._invalidate_all=!1;const n=[this.frame.bbox.left,this.frame.bbox.top,this.frame.bbox.width,this.frame.bbox.height],{primary:a,overlays:r}=this.canvas_view;i&&(a.prepare(),this.canvas_view.prepare_webgl(n),this._paint_empty(a.ctx,n),this._paint_outline(a.ctx,n),this._paint_levels(a.ctx,"image",n,!0),this._paint_levels(a.ctx,"underlay",n,!0),this._paint_levels(a.ctx,"glyph",n,!0),this._paint_levels(a.ctx,"guide",n,!1),this._paint_levels(a.ctx,"annotation",n,!1),a.finish()),(s||P.settings.wireframe)&&(r.prepare(),this._paint_levels(r.ctx,"overlay",n,!1),P.settings.wireframe&&this._paint_layout(r.ctx,this.layout),r.finish()),null==this._initial_state.range&&(this._initial_state.range=null!==(e=this._range_manager.compute_initial())&&void 0!==e?e:void 0),this._needs_paint=!1}_paint_levels(e,t,i,s){for(const n of this.computed_renderers){if(n.level!=t)continue;const a=this.renderer_views.get(n);e.save(),(s||a.needs_clip)&&(e.beginPath(),e.rect(...i),e.clip()),a.render(),e.restore(),a.has_webgl&&this.canvas_view.blit_webgl(e)}}_paint_layout(e,t){const{x:i,y:s,width:n,height:a}=t.bbox;e.strokeStyle="blue",e.strokeRect(i,s,n,a);for(const n of t)e.save(),t.absolute||e.translate(i,s),this._paint_layout(e,n),e.restore()}_paint_empty(e,t){const[i,s,n,a]=[0,0,this.bbox.width,this.bbox.height],[r,o,l,_]=t;this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(e),e.fillRect(i,s,n,a),e.clearRect(r,o,l,_)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(r,o,l,_))}_paint_outline(e,t){if(this.visuals.outline_line.doit){e.save(),this.visuals.outline_line.set_value(e);let[i,s,n,a]=t;i+n==this.bbox.width&&(n-=1),s+a==this.bbox.height&&(a-=1),e.strokeRect(i,s,n,a),e.restore()}}export(e="auto",t=!0){const i=(()=>{switch(e){case"auto":return this.canvas_view.model.output_backend;case"png":return"canvas";case"svg":return"svg"}})(),s=new k.CanvasLayer(i,t),{width:n,height:a}=this.bbox;if(s.resize(n,a),0!=n&&0!=a){const{canvas:e}=this.canvas_view.compose();s.ctx.drawImage(e,0,0)}return s}serializable_state(){const e=super.serializable_state(),{children:t}=e,i=a.__rest(e,["children"]),s=this.get_renderer_views().filter((e=>e.model.syncable)).map((e=>e.serializable_state())).filter((e=>null!=e.bbox)),n={type:"CartesianFrame",bbox:this.frame.bbox};return Object.assign(Object.assign({},i),{children:[...null!=t?t:[],n,...s]})}_hold_render_changed(){this.model.hold_render?this.pause():this.unpause()}}i.PlotView=A,A.__name__="PlotView"}, +function _(e,t,i,s,n){s();const a=e(1),r=e(157),o=e(294),l=e(268),_=e(367),h=e(73),d=e(142),c=e(159),u=e(258),p=e(93),g=e(52),m=e(59),b=e(75),v=e(18),f=e(52),w=e(403),y=e(8),x=e(10),z=e(33),k=e(263),S=e(230),M=e(232),$=e(231),q=e(144),V=e(57),O=e(152),R=e(404),j=e(405),P=e(28),T=e(56),C=a.__importDefault(e(406)),{max:B}=Math;class A extends _.LayoutDOMView{constructor(){super(...arguments),this._computed_style=new T.InlineStyleSheet,this._outer_bbox=new V.BBox,this._inner_bbox=new V.BBox,this._needs_paint=!0,this._invalidated_painters=new Set,this._invalidate_all=!0,this.renderer_views=new Map,this.tool_views=new Map,this._needs_notify=!1}get canvas(){return this.canvas_view}stylesheets(){return[...super.stylesheets(),C.default,this._computed_style]}get toolbar_panel(){return null!=this._toolbar?this.renderer_view(this._toolbar):void 0}get state(){return this._state_manager}set invalidate_dataranges(e){this._range_manager.invalidate_dataranges=e}get computed_renderer_views(){return this.computed_renderers.map((e=>this.renderer_views.get(e)))}renderer_view(e){const t=this.renderer_views.get(e);if(null==t)for(const[,t]of this.renderer_views){const i=t.renderer_view(e);if(null!=i)return i}return t}get auto_ranged_renderers(){return this.model.renderers.map((e=>this.renderer_view(e))).filter(p.is_auto_ranged)}get base_font_size(){const e=getComputedStyle(this.el).fontSize,t=(0,O.parse_css_font_size)(e);if(null!=t){const{value:e,unit:i}=t;if("px"==i)return e}return null}*children(){yield*super.children(),yield*this.renderer_views.values(),yield*this.tool_views.values(),yield this.canvas}get is_paused(){return null!=this._is_paused&&0!==this._is_paused}get child_models(){return[]}pause(){null==this._is_paused?this._is_paused=1:this._is_paused+=1}unpause(e=!1){if(null==this._is_paused)throw new Error("wasn't paused");this._is_paused=Math.max(this._is_paused-1,0),0!=this._is_paused||e||this.request_paint("everything")}notify_finished_after_paint(){this._needs_notify=!0}request_render(){this.request_paint("everything")}request_paint(e){this.invalidate_painters(e),this.schedule_paint()}invalidate_painters(e){if("everything"==e)this._invalidate_all=!0;else if((0,y.isArray)(e))for(const t of e)this._invalidated_painters.add(t);else this._invalidated_painters.add(e)}schedule_paint(){if(!this.is_paused){const e=this.throttled_paint();this._ready=this._ready.then((()=>e))}}request_layout(){this.request_paint("everything")}reset(){"standard"==this.model.reset_policy&&(this.state.clear(),this.reset_range(),this.reset_selection()),this.model.trigger_event(new g.Reset)}remove(){for(const e of this.frame.ranges.values())e.plots.delete(this);(0,m.remove_views)(this.renderer_views),(0,m.remove_views)(this.tool_views),this.canvas_view.remove(),super.remove()}render(){super.render(),this.shadow_el.appendChild(this.canvas_view.el),this.canvas_view.render()}initialize(){this.pause(),super.initialize(),this.lod_started=!1,this.visuals=new b.Visuals(this),this._initial_state={selection:new Map},this.frame=new r.CartesianFrame(this.model.x_scale,this.model.y_scale,this.model.x_range,this.model.y_range,this.model.extra_x_ranges,this.model.extra_y_ranges,this.model.extra_x_scales,this.model.extra_y_scales);for(const e of this.frame.ranges.values())e.plots.add(this);this._range_manager=new R.RangeManager(this),this._state_manager=new j.StateManager(this,this._initial_state),this.throttled_paint=(0,w.throttle)((()=>{this._removed||this.repaint()}),1e3/60);const{title_location:e,title:t}=this.model;null!=e&&null!=t&&(this._title=t instanceof d.Title?t:new d.Title({text:t}));const{toolbar_location:i,toolbar_inner:s,toolbar:n}=this.model;null!=i&&(this._toolbar=new u.ToolbarPanel({toolbar:n}),n.location=i,n.inner=s)}async lazy_initialize(){await super.lazy_initialize();const{hidpi:e,output_backend:t}=this.model,i=new o.Canvas({hidpi:e,output_backend:t});this.canvas_view=await(0,m.build_view)(i,{parent:this}),this.canvas_view.plot_views=[this],await this.build_tool_views(),await this.build_renderer_views(),this._range_manager.update_dataranges()}box_sizing(){const e=super.box_sizing(),{width_policy:t,height_policy:i}=e,s=a.__rest(e,["width_policy","height_policy"]),{frame_width:n,frame_height:r}=this.model;return Object.assign(Object.assign({},s),{width_policy:null!=n&&"auto"==t?"fit":t,height_policy:null!=r&&"auto"==i?"fit":i})}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){var e,t,i,s,n;super._update_layout(),this._invalidate_all=!0,this._needs_paint=!0;const a=new M.BorderLayout,{frame_align:r}=this.model;if(a.aligns=(()=>{if((0,y.isBoolean)(r))return{left:r,right:r,top:r,bottom:r};{const{left:e=!0,right:t=!0,top:i=!0,bottom:s=!0}=r;return{left:e,right:t,top:i,bottom:s}}})(),a.set_sizing({width_policy:"max",height_policy:"max"}),this.visuals.outline_line.doit){const e=this.visuals.outline_line.line_width.get_value();a.center_border_width=e}const o=(0,x.copy)(this.model.above),l=(0,x.copy)(this.model.below),_=(0,x.copy)(this.model.left),c=(0,x.copy)(this.model.right),p=[],g=[],m=[],b=[],v=(e,t=!1)=>{switch(e){case"above":return t?p:o;case"below":return t?g:l;case"left":return t?m:_;case"right":return t?b:c}},{title_location:f}=this.model;if(null!=f&&null!=this._title&&v(f).push(this._title),null!=this._toolbar){const{location:e}=this._toolbar.toolbar;if(this.model.toolbar_inner){v(e,!0).push(this._toolbar)}else{const t=v(e);let i=!0;if(this.model.toolbar_sticky)for(let s=0;s{var i;const s=this.renderer_view(t);return s.panel=new q.Panel(e),null===(i=s.update_layout)||void 0===i||i.call(s),s.layout},z=(e,t)=>{const i="above"==e||"below"==e,s=[];for(const n of t)if((0,y.isArray)(n)){const t=n.map((t=>{const s=w(e,t);if(t instanceof u.ToolbarPanel){const e=i?"width_policy":"height_policy";s.set_sizing(Object.assign(Object.assign({},s.sizing),{[e]:"min"}))}return s}));let a;i?(a=new $.Row(t),a.set_sizing({width_policy:"max",height_policy:"min"})):(a=new $.Column(t),a.set_sizing({width_policy:"min",height_policy:"max"})),a.absolute=!0,s.push(a)}else s.push(w(e,n));return s},k=null!==(e=this.model.min_border)&&void 0!==e?e:0;a.min_border={left:null!==(t=this.model.min_border_left)&&void 0!==t?t:k,top:null!==(i=this.model.min_border_top)&&void 0!==i?i:k,right:null!==(s=this.model.min_border_right)&&void 0!==s?s:k,bottom:null!==(n=this.model.min_border_bottom)&&void 0!==n?n:k};const V=new S.NodeLayout,O=new S.VStack,R=new S.VStack,j=new S.HStack,P=new S.HStack,T=new S.VStack,C=new S.VStack,B=new S.HStack,A=new S.HStack;V.absolute=!0,O.absolute=!0,R.absolute=!0,j.absolute=!0,P.absolute=!0,T.absolute=!0,C.absolute=!0,B.absolute=!0,A.absolute=!0,V.children=this.model.center.filter((e=>e instanceof h.Annotation)).map((e=>{var t;const i=this.renderer_view(e);return null===(t=i.update_layout)||void 0===t||t.call(i),i.layout})).filter((e=>null!=e));const{frame_width:H,frame_height:L}=this.model;V.set_sizing(Object.assign(Object.assign({},null!=H?{width_policy:"fixed",width:H}:{width_policy:"fit"}),null!=L?{height_policy:"fixed",height:L}:{height_policy:"fit"})),V.on_resize((e=>this.frame.set_geometry(e))),O.children=(0,x.reversed)(z("above",o)),R.children=z("below",l),j.children=(0,x.reversed)(z("left",_)),P.children=z("right",c),T.children=z("above",p),C.children=z("below",g),B.children=z("left",m),A.children=z("right",b),O.set_sizing({width_policy:"fit",height_policy:"min"}),R.set_sizing({width_policy:"fit",height_policy:"min"}),j.set_sizing({width_policy:"min",height_policy:"fit"}),P.set_sizing({width_policy:"min",height_policy:"fit"}),T.set_sizing({width_policy:"fit",height_policy:"min"}),C.set_sizing({width_policy:"fit",height_policy:"min"}),B.set_sizing({width_policy:"min",height_policy:"fit"}),A.set_sizing({width_policy:"min",height_policy:"fit"}),a.center_panel=V,a.top_panel=O,a.bottom_panel=R,a.left_panel=j,a.right_panel=P,0!=T.children.length&&(a.inner_top_panel=T),0!=C.children.length&&(a.inner_bottom_panel=C),0!=B.children.length&&(a.inner_left_panel=B),0!=A.children.length&&(a.inner_right_panel=A),this.layout=a}_measure_layout(){const{frame_width:e,frame_height:t}=this.model,i=null==e?"1fr":(0,T.px)(e),s=null==t?"1fr":(0,T.px)(t),{layout:n}=this,a=n.top_panel.measure({width:1/0,height:1/0}),r=n.bottom_panel.measure({width:1/0,height:1/0}),o=n.left_panel.measure({width:1/0,height:1/0}),l=n.right_panel.measure({width:1/0,height:1/0}),_=B(a.height,n.min_border.top),h=B(r.height,n.min_border.bottom),d=B(o.width,n.min_border.left),c=B(l.width,n.min_border.right);this._computed_style.replace(`\n :host {\n grid-template-rows: ${_}px ${s} ${h}px;\n grid-template-columns: ${d}px ${i} ${c}px;\n }\n `)}get axis_views(){const e=[];for(const[,t]of this.renderer_views)t instanceof c.AxisView&&e.push(t);return e}update_range(e,t){this.pause(),this._range_manager.update(e,t),this.unpause()}reset_range(){this.pause(),this._range_manager.reset(),this.unpause(),this.trigger_ranges_update_event()}trigger_ranges_update_event(){const{x_range:e,y_range:t}=this.model,i=new Set([...e.plots,...t.plots]);for(const e of i){const{x_range:t,y_range:i}=e.model;e.model.trigger_event(new f.RangesUpdate(t.start,t.end,i.start,i.end))}}get_selection(){const e=new Map;for(const t of this.model.data_renderers){const{selected:i}=t.selection_manager.source;e.set(t,i)}return e}update_selection(e){for(const t of this.model.data_renderers){const i=t.selection_manager.source;if(null!=e){const s=e.get(t);null!=s&&i.selected.update(s,!0)}else i.selection_manager.clear()}}reset_selection(){this.update_selection(null)}_invalidate_layout_if_needed(){(()=>{var e,t;for(const i of this.model.side_panels){const s=this.renderer_views.get(i);if(null!==(t=null===(e=s.layout)||void 0===e?void 0:e.has_size_changed())&&void 0!==t&&t)return this.invalidate_painters(s),!0}return!1})()&&this.compute_layout()}get_renderer_views(){return this.computed_renderers.map((e=>this.renderer_views.get(e)))}*_compute_renderers(){const{above:e,below:t,left:i,right:s,center:n,renderers:a}=this.model;yield*a,yield*e,yield*t,yield*i,yield*s,yield*n,null!=this._title&&(yield this._title),null!=this._toolbar&&(yield this._toolbar);for(const[,e]of this.tool_views)yield*e.overlays}async build_renderer_views(){this.computed_renderers=[...this._compute_renderers()],await(0,m.build_views)(this.renderer_views,this.computed_renderers,{parent:this})}async build_tool_views(){const e=(0,z.flat_map)(this.model.toolbar.tools,(e=>e instanceof l.ToolProxy?e.tools:[e])),{created:t}=await(0,m.build_views)(this.tool_views,[...e],{parent:this});t.map((e=>this.canvas_view.ui_event_bus.register_tool(e)))}connect_signals(){super.connect_signals();const{extra_x_ranges:e,extra_y_ranges:t,extra_x_scales:i,extra_y_scales:s}=this.model.properties;this.on_change([e,t,i,s],(()=>{this.frame.x_range=this.model.x_range,this.frame.y_range=this.model.y_range,this.frame.in_x_scale=this.model.x_scale,this.frame.in_y_scale=this.model.y_scale,this.frame.extra_x_ranges=this.model.extra_x_ranges,this.frame.extra_y_ranges=this.model.extra_y_ranges,this.frame.extra_x_scales=this.model.extra_x_scales,this.frame.extra_y_scales=this.model.extra_y_scales,this.frame.configure_scales()}));const{above:n,below:a,left:r,right:o,center:l,renderers:_}=this.model.properties,h=[n,a,r,o,l];this.on_change(_,(async()=>{await this.build_renderer_views()})),this.on_change(h,(async()=>{await this.build_renderer_views(),this.invalidate_layout()})),this.connect(this.model.toolbar.properties.tools.change,(async()=>{await this.build_tool_views(),await this.build_renderer_views()}));const{x_ranges:d,y_ranges:c}=this.frame;for(const[,e]of d)this.connect(e.change,(()=>{this.request_paint("everything")}));for(const[,e]of c)this.connect(e.change,(()=>{this.request_paint("everything")}));this.connect(this.model.change,(()=>this.request_paint("everything"))),this.connect(this.model.reset,(()=>this.reset()));const{toolbar_location:p}=this.model.properties;this.on_change(p,(async()=>{const{toolbar_location:e}=this.model;if(null!=this._toolbar)null!=e?this._toolbar.toolbar.location=e:(this._toolbar=void 0,await this.build_renderer_views());else if(null!=e){const{toolbar:t,toolbar_inner:i}=this.model;this._toolbar=new u.ToolbarPanel({toolbar:t}),t.location=e,t.inner=i,await this.build_renderer_views()}this.invalidate_layout()}));const{hold_render:g}=this.model.properties;this.on_change(g,(()=>this._hold_render_changed()))}has_finished(){if(!super.has_finished())return!1;if(this.model.visible)for(const[,e]of this.renderer_views)if(!e.has_finished())return!1;return!0}_after_layout(){var e;super._after_layout(),this.unpause(!0);const t=this.layout.left_panel.bbox,i=this.layout.right_panel.bbox,s=this.layout.center_panel.bbox,n=this.layout.top_panel.bbox,a=this.layout.bottom_panel.bbox,{bbox:r}=this,o=n.bottom,l=r.height-a.top,_=t.right,d=r.width-i.left;this.canvas.style.replace(`\n .bk-layer.bk-events {\n display: grid;\n grid-template-areas:\n ". above . "\n "left center right"\n ". below . ";\n grid-template-rows: ${(0,T.px)(o)} ${(0,T.px)(s.height)} ${(0,T.px)(l)};\n grid-template-columns: ${(0,T.px)(_)} ${(0,T.px)(s.width)} ${(0,T.px)(d)};\n }\n `);for(const[,t]of this.renderer_views)t instanceof h.AnnotationView&&(null===(e=t.after_layout)||void 0===e||e.call(t));this.model.setv({inner_width:Math.round(this.frame.bbox.width),inner_height:Math.round(this.frame.bbox.height),outer_width:Math.round(this.bbox.width),outer_height:Math.round(this.bbox.height)},{no_change:!0}),this.model.match_aspect&&(this.pause(),this._range_manager.update_dataranges(),this.unpause(!0)),this._outer_bbox.equals(this.bbox)||(this.canvas_view.resize(),this._outer_bbox=this.bbox,this._invalidate_all=!0,this._needs_paint=!0);const{inner_bbox:c}=this.layout;this._inner_bbox.equals(c)||(this._inner_bbox=c,this._needs_paint=!0),this._needs_paint&&this.paint()}repaint(){this._invalidate_layout_if_needed(),this.paint()}paint(){if(!this.is_paused){if(this.is_displayed)v.logger.trace(`${this.toString()}.paint()`),this._actual_paint();else for(const e of this.computed_renderer_views)e.mark_finished();this._needs_notify&&(this._needs_notify=!1,this.notify_finished())}}_actual_paint(){var e;const{document:t}=this.model;if(null!=t){const e=t.interactive_duration();e>=0&&e{t.interactive_duration()>this.model.lod_timeout&&t.interactive_stop(),this.request_paint("everything")}),this.model.lod_timeout):t.interactive_stop()}this._range_manager.invalidate_dataranges&&(this._range_manager.update_dataranges(),this._invalidate_layout_if_needed());let i=!1,s=!1;if(this._invalidate_all)i=!0,s=!0;else for(const e of this._invalidated_painters){const{level:t}=e.model;if("overlay"!=t?i=!0:s=!0,i&&s)break}this._invalidated_painters.clear(),this._invalidate_all=!1;const n=[this.frame.bbox.left,this.frame.bbox.top,this.frame.bbox.width,this.frame.bbox.height],{primary:a,overlays:r}=this.canvas_view;i&&(a.prepare(),this.canvas_view.prepare_webgl(n),this._paint_empty(a.ctx,n),this._paint_outline(a.ctx,n),this._paint_levels(a.ctx,"image",n,!0),this._paint_levels(a.ctx,"underlay",n,!0),this._paint_levels(a.ctx,"glyph",n,!0),this._paint_levels(a.ctx,"guide",n,!1),this._paint_levels(a.ctx,"annotation",n,!1),a.finish()),(s||P.settings.wireframe)&&(r.prepare(),this._paint_levels(r.ctx,"overlay",n,!1),P.settings.wireframe&&this._paint_layout(r.ctx,this.layout),r.finish()),null==this._initial_state.range&&(this._initial_state.range=null!==(e=this._range_manager.compute_initial())&&void 0!==e?e:void 0),this._needs_paint=!1}_paint_levels(e,t,i,s){for(const n of this.computed_renderers){if(n.level!=t)continue;const a=this.renderer_views.get(n);e.save(),(s||a.needs_clip)&&(e.beginPath(),e.rect(...i),e.clip()),a.render(),e.restore(),a.has_webgl&&this.canvas_view.blit_webgl(e)}}_paint_layout(e,t){const{x:i,y:s,width:n,height:a}=t.bbox;e.strokeStyle="blue",e.strokeRect(i,s,n,a);for(const n of t)e.save(),t.absolute||e.translate(i,s),this._paint_layout(e,n),e.restore()}_paint_empty(e,t){const[i,s,n,a]=[0,0,this.bbox.width,this.bbox.height],[r,o,l,_]=t;this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(e),e.fillRect(i,s,n,a),e.clearRect(r,o,l,_)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(r,o,l,_))}_paint_outline(e,t){if(this.visuals.outline_line.doit){e.save(),this.visuals.outline_line.set_value(e);let[i,s,n,a]=t;i+n==this.bbox.width&&(n-=1),s+a==this.bbox.height&&(a-=1),e.strokeRect(i,s,n,a),e.restore()}}export(e="auto",t=!0){const i=(()=>{switch(e){case"auto":return this.canvas_view.model.output_backend;case"png":return"canvas";case"svg":return"svg"}})(),s=new k.CanvasLayer(i,t),{width:n,height:a}=this.bbox;if(s.resize(n,a),0!=n&&0!=a){const{canvas:e}=this.canvas_view.compose();s.ctx.drawImage(e,0,0)}return s}serializable_state(){const e=super.serializable_state(),{children:t}=e,i=a.__rest(e,["children"]),s=this.get_renderer_views().filter((e=>e.model.syncable)).map((e=>e.serializable_state())).filter((e=>null!=e.bbox)),n={type:"CartesianFrame",bbox:this.frame.bbox};return Object.assign(Object.assign({},i),{children:[...null!=t?t:[],n,...s]})}_hold_render_changed(){this.model.hold_render?this.pause():this.unpause()}}i.PlotView=A,A.__name__="PlotView"}, function _(n,t,e,l,u){l(),e.throttle=function(n,t){let e,l=null,u=null,o=0,i=!1;const r=function(){return new Promise(((r,c)=>{e=r;const a=function(){o=Date.now(),l=null,u=null,i=!1;try{n(),r()}catch(n){c(n)}},m=Date.now(),s=t-(m-o);s<=0&&!i?(null!=l&&clearTimeout(l),i=!0,u=requestAnimationFrame(a)):null!=l||i?r():l=setTimeout((()=>u=requestAnimationFrame(a)),s)}))};return r.stop=function(){null!=l&&clearTimeout(l),null!=u&&cancelAnimationFrame(u),e()},r}}, function _(t,n,a,e,s){e();const o=t(93),r=t(18);class l{constructor(t){this.invalidate_dataranges=!0,this.parent=t}get frame(){return this.parent.frame}update(t,n={}){var a;const{x_ranges:e,y_ranges:s}=this.frame,o=[];for(const[n,a]of t.xrs)o.push([e.get(n),a]);for(const[n,a]of t.yrs)o.push([s.get(n),a]);null!==(a=n.scrolling)&&void 0!==a&&a&&this._update_ranges_together(o),this._update_ranges_individually(o,n)}reset(){const{x_ranges:t,y_ranges:n}=this.frame;for(const n of t.values())n.reset();for(const t of n.values())t.reset();this.update_dataranges()}_update_dataranges(t){const n=new Map,a=new Map;let e=!1;for(const[,n]of t.x_ranges)n instanceof o.DataRange1d&&"log"==n.scale_hint&&(e=!0);for(const[,n]of t.y_ranges)n instanceof o.DataRange1d&&"log"==n.scale_hint&&(e=!0);for(const t of this.parent.auto_ranged_renderers){const s=t.bounds();if(n.set(t.model,s),e){const n=t.log_bounds();a.set(t.model,n)}}let s=!1,l=!1;const i=t.x_target.span,d=t.y_target.span;let _;!1!==this.parent.model.match_aspect&&0!=i&&0!=d&&(_=1/this.parent.model.aspect_scale*(i/d));for(const[,e]of t.x_ranges){if(e instanceof o.DataRange1d){const t="log"==e.scale_hint?a:n;e.update(t,0,this.parent,_),null!=e.follow&&(s=!0)}null!=e.bounds&&(l=!0)}for(const[,e]of t.y_ranges){if(e instanceof o.DataRange1d){const t="log"==e.scale_hint?a:n;e.update(t,1,this.parent,_),null!=e.follow&&(s=!0)}null!=e.bounds&&(l=!0)}if(s&&l){r.logger.warn("Follow enabled so bounds are unset.");for(const[,n]of t.x_ranges)n.bounds=null;for(const[,n]of t.y_ranges)n.bounds=null}}update_dataranges(){this._update_dataranges(this.frame);for(const t of this.parent.auto_ranged_renderers){const{coordinates:n}=t.model;null!=n&&this._update_dataranges(n)}null!=this.compute_initial()&&(this.invalidate_dataranges=!1)}compute_initial(){let t=!0;const{x_ranges:n,y_ranges:a}=this.frame,e=new Map,s=new Map;for(const[a,s]of n){const{start:n,end:o}=s;if(isNaN(n+o)){t=!1;break}e.set(a,{start:n,end:o})}if(t)for(const[n,e]of a){const{start:a,end:o}=e;if(isNaN(a+o)){t=!1;break}s.set(n,{start:a,end:o})}return t?{xrs:e,yrs:s}:(r.logger.warn("could not set initial ranges"),null)}_update_ranges_together(t){let n=1;for(const[a,e]of t)n=Math.min(n,this._get_weight_to_constrain_interval(a,e));if(n<1)for(const[a,e]of t)e.start=n*e.start+(1-n)*a.start,e.end=n*e.end+(1-n)*a.end}_update_ranges_individually(t,n={}){var a,e,s;const o=null!==(a=n.panning)&&void 0!==a&&a,r=null!==(e=n.scrolling)&&void 0!==e&&e,l=null!==(s=n.maintain_focus)&&void 0!==s&&s;let i=!1;for(const[n,a]of t){if(!r){const t=this._get_weight_to_constrain_interval(n,a);t<1&&(a.start=t*a.start+(1-t)*n.start,a.end=t*a.end+(1-t)*n.end)}if(null!=n.bounds&&"auto"!=n.bounds){const[t,e]=n.bounds,s=Math.abs(a.end-a.start);n.is_reversed?(null!=t&&t>a.end&&(i=!0,a.end=t,(o||r)&&(a.start=t+s)),null!=e&&ea.start&&(i=!0,a.start=t,(o||r)&&(a.end=t+s)),null!=e&&e0&&r0&&r>e&&(s=(e-o)/(r-o)),s=Math.max(0,Math.min(1,s))}return s}}a.RangeManager=l,l.__name__="RangeManager"}, function _(t,i,s,e,n){e();const h=t(15);class a{constructor(t,i){this.history=[],this.index=-1,this.parent=t,this.initial_state=i,this.changed=new h.Signal0(this.parent,"state_changed")}_do_state_change(t){const i=t in this.history?this.history[t].state:this.initial_state;return null!=i.range&&this.parent.update_range(i.range),null!=i.selection&&this.parent.update_selection(i.selection),i}peek(){return this.can_undo?this.history[this.index]:null}push(t,i){const{history:s,index:e}=this,n=e in s?s[e].state:{},h=Object.assign(Object.assign(Object.assign({},this.initial_state),n),i);this.history=this.history.slice(0,this.index+1),this.history.push({type:t,state:h}),this.index=this.history.length-1,this.changed.emit()}clear(){this.history=[],this.index=-1,this.changed.emit()}undo(){if(this.can_undo){this.index-=1;const t=this._do_state_change(this.index);return this.changed.emit(),t}return null}redo(){if(this.can_redo){this.index+=1;const t=this._do_state_change(this.index);return this.changed.emit(),t}return null}get can_undo(){return this.index>=0}get can_redo(){return this.indexh.emit();const s=encodeURIComponent,i=document.createElement("script");i.type="text/javascript",i.src=`https://maps.googleapis.com/maps/api/js?v=${s(e)}&key=${s(t)}&callback=_bokeh_gmaps_callback`,document.body.appendChild(i)}(this._api_key,t)}h.connect((()=>{this._build_map(),this.request_paint("everything")}))}else this._build_map()}remove(){(0,p.remove)(this.map_el),super.remove()}update_range(t,e){var s,i;if(null==t)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),super.reset_range();else if(null!=t.sdx||null!=t.sdy)this.map.panBy(null!==(s=t.sdx)&&void 0!==s?s:0,null!==(i=t.sdy)&&void 0!==i?i:0),super.update_range(t,e);else if(null!=t.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),super.update_range(t,e);const s=t.factor<0?-1:1,i=this.map.getZoom();if(null!=i){const t=i+s;if(t>=2){this.map.setZoom(t);const[e,s]=this._get_projected_bounds();s-e<0&&this.map.setZoom(i)}}this.unpause()}this._set_bokeh_ranges()}_build_map(){const{maps:t}=google;this.map_types={satellite:t.MapTypeId.SATELLITE,terrain:t.MapTypeId.TERRAIN,roadmap:t.MapTypeId.ROADMAP,hybrid:t.MapTypeId.HYBRID};const e=this.model.map_options,s={center:new t.LatLng(e.lat,e.lng),zoom:e.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[e.map_type],scaleControl:e.scale_control,tilt:e.tilt};null!=e.styles&&(s.styles=JSON.parse(e.styles)),this.map=new t.Map(this.map_el,s),t.event.addListener(this.map,"idle",(()=>this._set_bokeh_ranges())),t.event.addListener(this.map,"bounds_changed",(()=>this._set_bokeh_ranges())),t.event.addListenerOnce(this.map,"tilesloaded",(()=>this._render_finished())),this.connect(this.model.properties.map_options.change,(()=>this._update_options())),this.connect(this.model.map_options.properties.styles.change,(()=>this._update_styling())),this.connect(this.model.map_options.properties.lat.change,(()=>this._update_center("lat"))),this.connect(this.model.map_options.properties.lng.change,(()=>this._update_center("lng"))),this.connect(this.model.map_options.properties.zoom.change,(()=>this._update_zoom())),this.connect(this.model.map_options.properties.map_type.change,(()=>this._update_map_type())),this.connect(this.model.map_options.properties.scale_control.change,(()=>this._update_scale_control())),this.connect(this.model.map_options.properties.tilt.change,(()=>this._update_tilt()))}_render_finished(){this._tiles_loaded=!0,this.notify_finished()}has_finished(){return super.has_finished()&&!0===this._tiles_loaded}_get_latlon_bounds(){const t=this.map.getBounds(),e=t.getNorthEast(),s=t.getSouthWest();return[s.lng(),e.lng(),s.lat(),e.lat()]}_get_projected_bounds(){const[t,e,s,i]=this._get_latlon_bounds(),[o,a]=_.wgs84_mercator.compute(t,s),[n,p]=_.wgs84_mercator.compute(e,i);return[o,n,a,p]}_set_bokeh_ranges(){const[t,e,s,i]=this._get_projected_bounds();this.frame.x_range.setv({start:t,end:e}),this.frame.y_range.setv({start:s,end:i})}_update_center(t){var e;const s=null===(e=this.map.getCenter())||void 0===e?void 0:e.toJSON();null!=s&&(s[t]=this.model.map_options[t],this.map.setCenter(s),this._set_bokeh_ranges())}_update_map_type(){this.map.setOptions({mapTypeId:this.map_types[this.model.map_options.map_type]})}_update_scale_control(){this.map.setOptions({scaleControl:this.model.map_options.scale_control})}_update_tilt(){this.map.setOptions({tilt:this.model.map_options.tilt})}_update_options(){this._update_styling(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()}_update_styling(){const{styles:t}=this.model.map_options;this.map.setOptions({styles:null!=t?JSON.parse(t):null})}_update_zoom(){this.map.setOptions({zoom:this.model.map_options.zoom}),this._set_bokeh_ranges()}_after_layout(){super._after_layout();const{left:t,top:e,width:s,height:i}=this.frame.bbox;this.map_el.style.top=`${e}px`,this.map_el.style.left=`${t}px`,this.map_el.style.width=`${s}px`,this.map_el.style.height=`${i}px`}}s.GMapPlotView=m,m.__name__="GMapPlotView"}, function _(e,a,t,s,n){var p;s();const _=e(400);class i extends _.GMapPlotView{serializable_state(){const e=super.serializable_state();return Object.assign(Object.assign({},e),{type:"GMapPlot"})}}t.GMapView=i,i.__name__="GMapView";class l extends _.GMapPlot{constructor(e){super(e)}}t.GMap=l,p=l,l.__name__="GMap",p.prototype.default_view=i}, -function _(i,t,e,o,s){var l;o();const r=i(367),n=i(371),a=i(236),c=i(259),_=i(277),d=i(263),h=i(59),u=i(19);class b extends r.LayoutDOMView{constructor(){super(...arguments),this._tool_views=new Map}get toolbar_view(){return this.child_views.find((i=>i.model==this.model.toolbar))}get grid_box_view(){return this.child_views.find((i=>i.model==this._grid_box))}_update_location(){const i=this.model.toolbar_location;null==i?this.model.toolbar.visible=!1:this.model.toolbar.setv({visible:!0,location:i})}initialize(){super.initialize(),this._update_location();const{children:i,rows:t,cols:e,spacing:o}=this.model;this._grid_box=new n.GridBox({children:i,rows:t,cols:e,spacing:o,sizing_mode:"inherit"})}async lazy_initialize(){await super.lazy_initialize(),await this.build_tool_views()}connect_signals(){super.connect_signals();const{toolbar:i,toolbar_location:t,children:e,rows:o,cols:s,spacing:l}=this.model.properties;this.on_change(t,(()=>{this._update_location(),this.rebuild()})),this.on_change([i,e,o,s,l],(()=>{this.rebuild()})),this.on_change(this.model.toolbar.properties.tools,(async()=>{await this.build_tool_views()})),this.mouseenter.connect((()=>{this.toolbar_view.set_visibility(!0)})),this.mouseleave.connect((()=>{this.toolbar_view.set_visibility(!1)}))}remove(){(0,h.remove_views)(this._tool_views),super.remove()}async build_tool_views(){const i=this.model.toolbar.tools.filter((i=>i instanceof _.ActionTool));await(0,h.build_views)(this._tool_views,i,{parent:this})}*children(){yield*super.children(),yield*this._tool_views.values()}get child_models(){return[this.model.toolbar,this._grid_box]}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flex"}}_update_layout(){super._update_layout();const{location:i}=this.model.toolbar,t=(()=>{switch(i){case"above":return"column";case"below":return"column-reverse";case"left":return"row";case"right":return"row-reverse"}})();this.style.append(":host",{flex_direction:t})}export(i="auto",t=!0){const e=(()=>{switch(i){case"auto":case"png":return"canvas";case"svg":return"svg"}})(),o=new d.CanvasLayer(e,t),{x:s,y:l,width:r,height:n}=this.grid_box_view.bbox.relative();o.resize(r,n),o.ctx.save();const a=getComputedStyle(this.el).backgroundColor;o.ctx.fillStyle=a,o.ctx.fillRect(s,l,r,n);for(const e of this.child_views){const s=e.export(i,t),{x:l,y:r}=e.bbox;o.ctx.drawImage(s.canvas,l,r)}return o.ctx.restore(),o}}e.GridPlotView=b,b.__name__="GridPlotView";class w extends r.LayoutDOM{constructor(i){super(i)}}e.GridPlot=w,l=w,w.__name__="GridPlot",l.prototype.default_view=b,l.define((({Array:i,Ref:t,Nullable:e})=>({toolbar:[t(c.Toolbar),()=>new c.Toolbar],toolbar_location:[e(u.Location),"above"],children:[i((0,a.GridChild)(r.LayoutDOM)),[]],rows:[e(a.TracksSizing),null],cols:[e(a.TracksSizing),null],spacing:[a.GridSpacing,0]})))}, +function _(i,o,e,t,s){var l;t();const r=i(367),n=i(371),a=i(236),c=i(259),_=i(277),d=i(59),h=i(19);class u extends r.LayoutDOMView{constructor(){super(...arguments),this._tool_views=new Map}get toolbar_view(){return this.child_views.find((i=>i.model==this.model.toolbar))}get grid_box_view(){return this.child_views.find((i=>i.model==this._grid_box))}_update_location(){const i=this.model.toolbar_location;null==i?this.model.toolbar.visible=!1:this.model.toolbar.setv({visible:!0,location:i})}initialize(){super.initialize(),this._update_location();const{children:i,rows:o,cols:e,spacing:t}=this.model;this._grid_box=new n.GridBox({children:i,rows:o,cols:e,spacing:t,sizing_mode:"inherit"})}async lazy_initialize(){await super.lazy_initialize(),await this.build_tool_views()}connect_signals(){super.connect_signals();const{toolbar:i,toolbar_location:o,children:e,rows:t,cols:s,spacing:l}=this.model.properties;this.on_change(o,(()=>{this._update_location(),this.rebuild()})),this.on_change([i,e,t,s,l],(()=>{this.rebuild()})),this.on_change(this.model.toolbar.properties.tools,(async()=>{await this.build_tool_views()})),this.mouseenter.connect((()=>{this.toolbar_view.set_visibility(!0)})),this.mouseleave.connect((()=>{this.toolbar_view.set_visibility(!1)}))}remove(){(0,d.remove_views)(this._tool_views),super.remove()}async build_tool_views(){const i=this.model.toolbar.tools.filter((i=>i instanceof _.ActionTool));await(0,d.build_views)(this._tool_views,i,{parent:this})}*children(){yield*super.children(),yield*this._tool_views.values()}get child_models(){return[this.model.toolbar,this._grid_box]}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flex"}}_update_layout(){super._update_layout();const{location:i}=this.model.toolbar,o=(()=>{switch(i){case"above":return"column";case"below":return"column-reverse";case"left":return"row";case"right":return"row-reverse"}})();this.style.append(":host",{flex_direction:o})}}e.GridPlotView=u,u.__name__="GridPlotView";class b extends r.LayoutDOM{constructor(i){super(i)}}e.GridPlot=b,l=b,b.__name__="GridPlot",l.prototype.default_view=u,l.define((({Array:i,Ref:o,Nullable:e})=>({toolbar:[o(c.Toolbar),()=>new c.Toolbar],toolbar_location:[e(h.Location),"above"],children:[i((0,a.GridChild)(r.LayoutDOM)),[]],rows:[e(a.TracksSizing),null],cols:[e(a.TracksSizing),null],spacing:[a.GridSpacing,0]})))}, function _(e,t,s,i,a){var r;i();const n=e(401);class _ extends n.PlotView{serializable_state(){const e=super.serializable_state();return Object.assign(Object.assign({},e),{type:"Plot"})}}s.FigureView=_,_.__name__="FigureView";class l extends n.Plot{constructor(e){super(e)}}s.Figure=l,r=l,l.__name__="Figure",r.prototype.default_view=_}, function _(t,_,n,o,r){o();t(1).__exportStar(t(163),n)}, function _(l,r,i,a,e){a(),e("ParkMillerLCG",l(413).ParkMillerLCG)}, @@ -1398,12 +1398,12 @@

Plots# function _(e,t,r,i,n){var l;i();const a=e(50),s=e(9);class c extends a.Model{constructor(e){super(e)}initialize(){super.initialize(),this.tiles=new Map,this._normalize_case()}connect_signals(){super.connect_signals(),this.connect(this.change,(()=>this._clear_cache()))}string_lookup_replace(e,t){let r=e;for(const[e,i]of(0,s.entries)(t))r=r.replace(`{${e}}`,i);return r}_normalize_case(){const e=this.url.replace("{x}","{X}").replace("{y}","{Y}").replace("{z}","{Z}").replace("{q}","{Q}").replace("{xmin}","{XMIN}").replace("{ymin}","{YMIN}").replace("{xmax}","{XMAX}").replace("{ymax}","{YMAX}");this.url=e}_clear_cache(){this.tiles=new Map}tile_xyz_to_key(e,t,r){return`${e}:${t}:${r}`}key_to_tile_xyz(e){const[t,r,i]=e.split(":").map((e=>parseInt(e)));return[t,r,i]}sort_tiles_from_center(e,t){const[r,i,n,l]=t,a=(n-r)/2+r,s=(l-i)/2+i;e.sort((function(e,t){return Math.sqrt((a-e[0])**2+(s-e[1])**2)-Math.sqrt((a-t[0])**2+(s-t[1])**2)}))}get_image_url(e,t,r){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",t.toString()).replace("{Z}",r.toString())}}r.TileSource=c,l=c,c.__name__="TileSource",l.define((({Number:e,String:t,Dict:r,Nullable:i})=>({url:[t,""],tile_size:[e,256],max_zoom:[e,30],min_zoom:[e,0],extra_url_vars:[r(t),{}],attribution:[t,""],x_origin_offset:[e],y_origin_offset:[e],initial_resolution:[i(e),null]})))}, function _(t,e,r,n,o){n();const c=t(105);function _(t,e){return c.wgs84_mercator.compute(t,e)}function g(t,e){return c.wgs84_mercator.invert(t,e)}r.geographic_to_meters=_,r.meters_to_geographic=g,r.geographic_extent_to_meters=function(t){const[e,r,n,o]=t,[c,g]=_(e,r),[i,u]=_(n,o);return[c,g,i,u]},r.meters_extent_to_geographic=function(t){const[e,r,n,o]=t,[c,_]=g(e,r),[i,u]=g(n,o);return[c,_,i,u]}}, function _(e,t,r,s,_){s();const o=e(431);class c extends o.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,r){const s=this.string_lookup_replace(this.url,this.extra_url_vars),[_,o,c]=this.tms_to_wmts(e,t,r),i=this.tile_xyz_to_quadkey(_,o,c);return s.replace("{Q}",i)}}r.QUADKEYTileSource=c,c.__name__="QUADKEYTileSource"}, -function _(t,e,i,s,_){var n;s();const a=t(1),h=t(432),o=t(436),r=t(74),l=t(88),d=t(56),m=t(150),c=t(10),u=t(8),p=a.__importDefault(t(437));class g extends r.RendererView{initialize(){this._tiles=[],super.initialize()}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render())),this.connect(this.model.tile_source.change,(()=>this.request_render()))}remove(){null!=this.attribution_el&&(0,d.remove)(this.attribution_el),super.remove()}get_extent(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]}get map_plot(){return this.plot_model}get map_canvas(){return this.layer.ctx}get map_frame(){return this.plot_view.frame}get x_range(){return this.map_plot.x_range}get y_range(){return this.map_plot.y_range}_set_data(){this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0}_update_attribution(){null!=this.attribution_el&&(0,d.remove)(this.attribution_el);const{attribution:t}=this.model.tile_source;if((0,u.isString)(t)&&t.length>0){const{layout:e,frame:i}=this.plot_view,s=e.bbox.width-i.bbox.right,_=e.bbox.height-i.bbox.bottom,n=i.bbox.width;this.attribution_el=(0,d.div)({style:{right:`${s}px`,bottom:`${_}px`,"max-width":`${n}px`}});const a=(0,d.div)();a.innerHTML=t;const h=this.attribution_el.attachShadow({mode:"open"});new d.InlineStyleSheet(p.default).install(h),h.appendChild(a),this.attribution_el.title=a.textContent.replace(/\s*\n\s*/g," "),this.plot_view.canvas_view.add_event(this.attribution_el)}}_map_data(){this.initial_extent=this.get_extent();const t=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width),e=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width,t);this.x_range.start=e[0],this.y_range.start=e[1],this.x_range.end=e[2],this.y_range.end=e[3],this.x_range instanceof l.Range1d&&(this.x_range.reset_start=e[0],this.x_range.reset_end=e[2]),this.y_range instanceof l.Range1d&&(this.y_range.reset_start=e[1],this.y_range.reset_end=e[3]),this._update_attribution()}_create_tile(t,e,i,s,_=!1){const n=this.model.tile_source.tile_xyz_to_quadkey(t,e,i),a=this.model.tile_source.tile_xyz_to_key(t,e,i);if(this.model.tile_source.tiles.has(a))return;const[h,o,r]=this.model.tile_source.normalize_xyz(t,e,i),l=this.model.tile_source.get_image_url(h,o,r),d={img:void 0,tile_coords:[t,e,i],normalized_coords:[h,o,r],quadkey:n,cache_key:a,bounds:s,loaded:!1,finished:!1,x_coord:s[0],y_coord:s[3]};this.model.tile_source.tiles.set(a,d),this._tiles.push(d),new m.ImageLoader(l,{loaded:t=>{Object.assign(d,{img:t,loaded:!0}),_?(d.finished=!0,this.notify_finished()):this.request_render()},failed(){d.finished=!0}})}_enforce_aspect_ratio(){if(this._last_height!==this.map_frame.bbox.height||this._last_width!==this.map_frame.bbox.width){const t=this.get_extent(),e=this.model.tile_source.get_level_by_extent(t,this.map_frame.bbox.height,this.map_frame.bbox.width),i=this.model.tile_source.snap_to_zoom_level(t,this.map_frame.bbox.height,this.map_frame.bbox.width,e);this.x_range.setv({start:i[0],end:i[2]}),this.y_range.setv({start:i[1],end:i[3]}),this.extent=i,this._last_height=this.map_frame.bbox.height,this._last_width=this.map_frame.bbox.width}}has_finished(){if(!super.has_finished())return!1;if(0==this._tiles.length)return!1;for(const t of this._tiles)if(!t.finished)return!1;return!0}_render(){null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),this._enforce_aspect_ratio(),this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles.bind(this),500),this.has_finished()&&this.notify_finished()}_draw_tile(t){const e=this.model.tile_source.tiles.get(t);if(null!=e&&e.loaded){const[[t],[i]]=this.coordinates.map_to_screen([e.bounds[0]],[e.bounds[3]]),[[s],[_]]=this.coordinates.map_to_screen([e.bounds[2]],[e.bounds[1]]),n=s-t,a=_-i,h=t,o=i,r=this.map_canvas.imageSmoothingEnabled;this.map_canvas.imageSmoothingEnabled=this.model.smoothing,this.map_canvas.drawImage(e.img,h,o,n,a),this.map_canvas.imageSmoothingEnabled=r,e.finished=!0}}_set_rect(){const t=this.plot_model.outline_line_width,e=this.map_frame.bbox.left+t/2,i=this.map_frame.bbox.top+t/2,s=this.map_frame.bbox.width-t,_=this.map_frame.bbox.height-t;this.map_canvas.rect(e,i,s,_),this.map_canvas.clip()}_render_tiles(t){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(const e of t)this._draw_tile(e);this.map_canvas.restore()}_prefetch_tiles(){const{tile_source:t}=this.model,e=this.get_extent(),i=this.map_frame.bbox.height,s=this.map_frame.bbox.width,_=this.model.tile_source.get_level_by_extent(e,i,s),n=this.model.tile_source.get_tiles_by_extent(e,_);for(let e=0,i=Math.min(10,n.length);ei&&(s=this.extent,h=i,o=!0),o&&(this.x_range.setv({start:s[0],end:s[2]}),this.y_range.setv({start:s[1],end:s[3]})),this.extent=s;const r=t.get_tiles_by_extent(s,h),l=[],d=[],m=[],u=[];for(const e of r){const[i,s,n]=e,a=t.tile_xyz_to_key(i,s,n),h=t.tiles.get(a);if(null!=h&&h.loaded)d.push(a);else if(this.model.render_parents){const[e,a,h]=t.get_closest_parent_by_tile_xyz(i,s,n),o=t.tile_xyz_to_key(e,a,h),r=t.tiles.get(o);if(null!=r&&r.loaded&&!(0,c.includes)(m,o)&&m.push(o),_){const e=t.children_by_tile_xyz(i,s,n);for(const[i,s,_]of e){const e=t.tile_xyz_to_key(i,s,_);t.tiles.has(e)&&u.push(e)}}}null==h&&l.push(e)}this._render_tiles(m),this._render_tiles(u),this._render_tiles(d),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout((()=>this._fetch_tiles(l)),65)}}i.TileRendererView=g,g.__name__="TileRendererView";class b extends r.Renderer{constructor(t){super(t)}}i.TileRenderer=b,n=b,b.__name__="TileRenderer",n.prototype.default_view=g,n.define((({Boolean:t,Number:e,Ref:i})=>({alpha:[e,1],smoothing:[t,!0],tile_source:[i(h.TileSource),()=>new o.WMTSTileSource],render_parents:[t,!0]}))),n.override({level:"image"})}, +function _(t,e,i,s,_){var n;s();const a=t(1),h=t(432),r=t(436),o=t(74),l=t(88),d=t(56),m=t(150),c=t(10),u=t(8),p=t(12),b=a.__importDefault(t(437));class g extends o.RendererView{constructor(){super(...arguments),this._tiles=null}mark_finished(){super.mark_finished(),this._tiles=[]}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render())),this.connect(this.model.tile_source.change,(()=>this.request_render()))}remove(){null!=this.attribution_el&&(0,d.remove)(this.attribution_el),super.remove()}get_extent(){const{x_range:t,y_range:e}=this,i=t.start,s=e.start,_=t.end,n=e.end;return(0,p.assert)(isFinite(i)),(0,p.assert)(isFinite(s)),(0,p.assert)(isFinite(_)),(0,p.assert)(isFinite(n)),[i,s,_,n]}get map_plot(){return this.plot_model}get map_canvas(){return this.layer.ctx}get map_frame(){return this.plot_view.frame}get x_range(){return this.map_plot.x_range}get y_range(){return this.map_plot.y_range}_set_data(){this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0}_update_attribution(){null!=this.attribution_el&&(0,d.remove)(this.attribution_el);const{attribution:t}=this.model.tile_source;if((0,u.isString)(t)&&t.length>0){const{layout:e,frame:i}=this.plot_view,s=e.bbox.width-i.bbox.right,_=e.bbox.height-i.bbox.bottom,n=i.bbox.width;this.attribution_el=(0,d.div)({style:{right:`${s}px`,bottom:`${_}px`,"max-width":`${n}px`}});const a=(0,d.div)();a.innerHTML=t;const h=this.attribution_el.attachShadow({mode:"open"});new d.InlineStyleSheet(b.default).install(h),h.appendChild(a),this.attribution_el.title=a.textContent.replace(/\s*\n\s*/g," "),this.plot_view.canvas_view.add_event(this.attribution_el)}}_map_data(){this.initial_extent=this.get_extent();const t=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width),e=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width,t);this.x_range.start=e[0],this.y_range.start=e[1],this.x_range.end=e[2],this.y_range.end=e[3],this.x_range instanceof l.Range1d&&(this.x_range.reset_start=e[0],this.x_range.reset_end=e[2]),this.y_range instanceof l.Range1d&&(this.y_range.reset_start=e[1],this.y_range.reset_end=e[3]),this._update_attribution()}_create_tile(t,e,i,s,_=!1){const n=this.model.tile_source.tile_xyz_to_quadkey(t,e,i),a=this.model.tile_source.tile_xyz_to_key(t,e,i);if(this.model.tile_source.tiles.has(a))return;const[h,r,o]=this.model.tile_source.normalize_xyz(t,e,i),l=this.model.tile_source.get_image_url(h,r,o),d={img:void 0,tile_coords:[t,e,i],normalized_coords:[h,r,o],quadkey:n,cache_key:a,bounds:s,loaded:!1,finished:!1,x_coord:s[0],y_coord:s[3]};this.model.tile_source.tiles.set(a,d),null==this._tiles&&(this._tiles=[]),this._tiles.push(d),new m.ImageLoader(l,{loaded:t=>{Object.assign(d,{img:t,loaded:!0}),_?(d.finished=!0,this.notify_finished()):this.request_render()},failed(){d.finished=!0}})}_enforce_aspect_ratio(){if(this._last_height!==this.map_frame.bbox.height||this._last_width!==this.map_frame.bbox.width){const t=this.get_extent(),e=this.model.tile_source.get_level_by_extent(t,this.map_frame.bbox.height,this.map_frame.bbox.width),i=this.model.tile_source.snap_to_zoom_level(t,this.map_frame.bbox.height,this.map_frame.bbox.width,e);this.x_range.setv({start:i[0],end:i[2]}),this.y_range.setv({start:i[1],end:i[3]}),this.extent=i,this._last_height=this.map_frame.bbox.height,this._last_width=this.map_frame.bbox.width}}has_finished(){if(!super.has_finished())return!1;if(null==this._tiles)return!1;for(const t of this._tiles)if(!t.finished)return!1;return!0}_render(){null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),this._enforce_aspect_ratio(),this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles.bind(this),500),this.has_finished()&&this.notify_finished()}_draw_tile(t){const e=this.model.tile_source.tiles.get(t);if(null!=e&&e.loaded){const[[t],[i]]=this.coordinates.map_to_screen([e.bounds[0]],[e.bounds[3]]),[[s],[_]]=this.coordinates.map_to_screen([e.bounds[2]],[e.bounds[1]]),n=s-t,a=_-i,h=t,r=i,o=this.map_canvas.imageSmoothingEnabled;this.map_canvas.imageSmoothingEnabled=this.model.smoothing,this.map_canvas.drawImage(e.img,h,r,n,a),this.map_canvas.imageSmoothingEnabled=o,e.finished=!0}}_set_rect(){const t=this.plot_model.outline_line_width,e=this.map_frame.bbox.left+t/2,i=this.map_frame.bbox.top+t/2,s=this.map_frame.bbox.width-t,_=this.map_frame.bbox.height-t;this.map_canvas.rect(e,i,s,_),this.map_canvas.clip()}_render_tiles(t){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(const e of t)this._draw_tile(e);this.map_canvas.restore()}_prefetch_tiles(){const{tile_source:t}=this.model,e=this.get_extent(),i=this.map_frame.bbox.height,s=this.map_frame.bbox.width,_=this.model.tile_source.get_level_by_extent(e,i,s),n=this.model.tile_source.get_tiles_by_extent(e,_);for(let e=0,i=Math.min(10,n.length);ei&&(s=this.extent,h=i,r=!0),r&&(this.x_range.setv({start:s[0],end:s[2]}),this.y_range.setv({start:s[1],end:s[3]})),this.extent=s;const o=t.get_tiles_by_extent(s,h),l=[],d=[],m=[],u=[];for(const e of o){const[i,s,n]=e,a=t.tile_xyz_to_key(i,s,n),h=t.tiles.get(a);if(null!=h&&h.loaded)d.push(a);else if(this.model.render_parents){const[e,a,h]=t.get_closest_parent_by_tile_xyz(i,s,n),r=t.tile_xyz_to_key(e,a,h),o=t.tiles.get(r);if(null!=o&&o.loaded&&!(0,c.includes)(m,r)&&m.push(r),_){const e=t.children_by_tile_xyz(i,s,n);for(const[i,s,_]of e){const e=t.tile_xyz_to_key(i,s,_);t.tiles.has(e)&&u.push(e)}}}null==h&&l.push(e)}this._render_tiles(m),this._render_tiles(u),this._render_tiles(d),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout((()=>this._fetch_tiles(l)),65)}}i.TileRendererView=g,g.__name__="TileRendererView";class f extends o.Renderer{constructor(t){super(t)}}i.TileRenderer=f,n=f,f.__name__="TileRenderer",n.prototype.default_view=g,n.define((({Boolean:t,Number:e,Ref:i})=>({alpha:[e,1],smoothing:[t,!0],tile_source:[i(h.TileSource),()=>new r.WMTSTileSource],render_parents:[t,!0]}))),n.override({level:"image"})}, function _(t,e,r,o,s){o();const c=t(431);class i extends c.MercatorTileSource{constructor(t){super(t)}get_image_url(t,e,r){const o=this.string_lookup_replace(this.url,this.extra_url_vars),[s,c,i]=this.tms_to_wmts(t,e,r);return o.replace("{X}",s.toString()).replace("{Y}",c.toString()).replace("{Z}",i.toString())}}r.WMTSTileSource=i,i.__name__="WMTSTileSource"}, function _(o,e,i,l,t){l(),i.default=":host{position:absolute;padding:2px;background-color:rgba(255, 255, 255, 0.5);font-size:9px;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}a{color:black;}"}, function _(e,r,t,c,o){c();const i=e(431);class l extends i.MercatorTileSource{constructor(e){super(e)}get_image_url(e,r,t){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",r.toString()).replace("{Z}",t.toString())}}t.TMSTileSource=l,l.__name__="TMSTileSource"}, function _(e,t,u,a,r){a(),r("CanvasTexture",e(440).CanvasTexture),r("ImageURLTexture",e(442).ImageURLTexture),r("Texture",e(441).Texture)}, -function _(t,e,n,c,s){var r;c();const o=t(441),a=t(38);class u extends o.Texture{constructor(t){super(t)}get func(){const t=(0,a.use_strict)(this.code);return new Function("ctx","color","scale","weight",t)}get_pattern(t,e,n){const c=document.createElement("canvas");c.width=e,c.height=e;const s=c.getContext("2d");return this.func.call(this,s,t,e,n),c}}n.CanvasTexture=u,r=u,u.__name__="CanvasTexture",r.define((({String:t})=>({code:[t]})))}, +function _(t,e,n,c,s){var r;c();const o=t(441),a=t(39);class u extends o.Texture{constructor(t){super(t)}get func(){const t=(0,a.use_strict)(this.code);return new Function("ctx","color","scale","weight",t)}get_pattern(t,e,n){const c=document.createElement("canvas");c.width=e,c.height=e;const s=c.getContext("2d");return this.func.call(this,s,t,e,n),c}}n.CanvasTexture=u,r=u,u.__name__="CanvasTexture",r.define((({String:t})=>({code:[t]})))}, function _(e,t,n,r,o){var i;r();const s=e(50),u=e(19);class c extends s.Model{constructor(e){super(e)}}n.Texture=c,i=c,c.__name__="Texture",i.define((()=>({repetition:[u.TextureRepetition,"repeat"]})))}, function _(e,t,i,r,n){var a;r();const s=e(441),o=e(150);class u extends s.Texture{constructor(e){super(e)}initialize(){super.initialize(),this._loader=new o.ImageLoader(this.url)}get_pattern(e,t,i){const{_loader:r}=this;return this._loader.finished?r.image:r.promise}}i.ImageURLTexture=u,a=u,u.__name__="ImageURLTexture",a.define((({String:e})=>({url:[e]})))}, function _(e,n,o,a,i){a();e(1).__exportStar(e(444),o),i("Dialog",e(448).Dialog),i("Examiner",e(452).Examiner),i("Pane",e(454).Pane),i("Tooltip",e(455).Tooltip),i("UIElement",e(260).UIElement)}, @@ -1415,7 +1415,7 @@

Plots# function _(e,o,_,d,s){d();const n=e(55),c=e(50);class t extends n.DOMView{}_.DOMNodeView=t,t.__name__="DOMNodeView";class M extends c.Model{constructor(e){super(e)}}_.DOMNode=M,M.__name__="DOMNode",M.__module__="bokeh.models.dom"}, function _(e,t,n,o,r){var c;o();const s=e(449);class _ extends s.DOMNodeView{render(){this.el.textContent=this.model.content}_createElement(){return document.createTextNode("")}}n.TextView=_,_.__name__="TextView";class d extends s.DOMNode{constructor(e){super(e)}}n.Text=d,c=d,d.__name__="Text",c.prototype.default_view=_,c.define((({String:e})=>({content:[e,""]})))}, function _(o,e,t,i,r){i(),t.title="bk-title",t.content="bk-content",t.buttons="bk-buttons",t.close="bk-close",t.default=":host{--bokeh-bg-color:white;--bokeh-border-color:#e5e5e5;--bokeh-shadow-color:#e5e5e5;}:host{position:fixed;z-index:1000;left:0;right:0;top:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;width:80vw;height:60vh;overflow:hidden;display:flex;flex-direction:column;flex-wrap:nowrap;background-color:var(--bokeh-bg-color);border:1px solid var(--bokeh-border-color);box-shadow:5px 5px 10px var(--bokeh-shadow-color);}.bk-title{position:relative;flex:1;min-height:0;}.bk-content{position:relative;flex:1;min-height:100%;display:flex;}.bk-buttons{position:relative;flex:1;min-height:0;}.bk-close{position:absolute;top:0;right:0;width:18px;height:18px;cursor:pointer;background-color:gray;mask-image:var(--bokeh-icon-x);mask-size:contain;mask-repeat:no-repeat;-webkit-mask-image:var(--bokeh-icon-x);-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;}.bk-close:hover{background-color:red;}"}, -function _(t,e,s,n,o){var i;n();const a=t(1),l=t(260),r=a.__importStar(t(17)),c=t(14),d=t(56),p=t(40),h=t(50),u=t(8),f=t(9),_=t(10),v=t(32),g=t(15),m=t(36),b=a.__importDefault(t(453));class y{constructor(t,e,s){this.visited=new WeakSet,this.depth=0,this.click=t,this.max_items=e,this.max_depth=s}to_html(t){if((0,u.isObject)(t)){if(this.visited.has(t))return(0,d.span)("");this.visited.add(t)}return null==t?this.null():(0,u.isBoolean)(t)?this.boolean(t):(0,u.isNumber)(t)?this.number(t):(0,u.isString)(t)?this.string(t):(0,u.isSymbol)(t)?this.symbol(t):t instanceof h.Model?this.model(t):t instanceof r.Property?this.property(t):(0,u.isPlainObject)(t)?this.object(t):(0,u.isArray)(t)?this.array(t):(0,u.isIterable)(t)?this.iterable(t):(0,d.span)((0,p.to_string)(t))}null(){return(0,d.span)({class:"null"},"null")}token(t){return(0,d.span)({class:"token"},t)}boolean(t){return(0,d.span)({class:"boolean"},`${t}`)}number(t){return(0,d.span)({class:"number"},`${t}`)}string(t){const e=t.includes("'"),s=t.includes('"'),n=e&&s?`\`${t.replace(/`/g,"\\`")}\``:s?`'${t}'`:`"${t}"`;return(0,d.span)({class:"string"},n)}symbol(t){return(0,d.span)({class:"symbol"},t.toString())}array(t){const e=this.token,s=[];let n=0;for(const e of t)if(s.push(this.to_html(e)),n++>this.max_items){s.push((0,d.span)("\u2026"));break}return(0,d.span)({class:"array"},e("["),...(0,v.interleave)(s,(()=>e(", "))),e("]"))}iterable(t){var e;const s=this.token,n=null!==(e=Object(t)[Symbol.toStringTag])&&void 0!==e?e:"Object",o=this.array([...t]);return(0,d.span)({class:"iterable"},`${n}`,s("("),o,s(")"))}object(t){const e=this.token,s=[];let n=0;for(const[o,i]of(0,f.entries)(t))if(s.push((0,d.span)(`${o}`,e(": "),this.to_html(i))),n++>this.max_items){s.push((0,d.span)("\u2026"));break}return(0,d.span)({class:"object"},e("{"),...(0,v.interleave)(s,(()=>e(", "))),e("}"))}model(t){const e=this.token,s=(0,d.span)({class:"model"},t.constructor.__qualified__,e("("),this.to_html(t.id),e(")"));return s.addEventListener("click",(()=>this.click(t))),s}property(t){const e=this.model(t.obj),s=(0,d.span)({class:"attr"},t.attr);return(0,d.span)(e,this.token("."),s)}}s.HTMLPrinter=y,y.__name__="HTMLPrinter";class k extends l.UIElementView{constructor(){super(...arguments),this.prev_listener=null,this.watched_props=new Set}stylesheets(){return[...super.stylesheets(),b.default]}render(){super.render(),null!=this.prev_listener&&m.diagnostics.disconnect(this.prev_listener);const t=[],e=[],s=[],n=new WeakMap;m.diagnostics.connect((o=>{if(o instanceof r.Property){for(const[e,s]of t)e==o.obj&&i(s);for(const[t,s]of e)if(t==o){const[,,,e]=s.children;a(t,s,e);break}for(const[t,e]of s)if(t==o){const[,s]=e.children;a(t,e,s);break}}function i(t){const e=n.get(t);null!=e&&e.cancel();const s=t.animate([{backgroundColor:"#def189"},{backgroundColor:"initial"}],{duration:2e3});n.set(t,s)}function a(t,e,s){e.classList.toggle("dirty",t.dirty),(0,d.empty)(s);const n=t.is_unset?(0,d.span)("unset"):C(t.get_value());s.appendChild(n),i(s)}}));const o=(()=>{const e=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"});return e.addEventListener("keyup",(()=>{const s=e.value;for(const[e,n]of t){const t=e.constructor.__qualified__.includes(s);n.classList.toggle("hidden",!t)}})),(0,d.div)({class:"toolbar"},e)})(),i=(0,d.input)({type:"checkbox",checked:!0}),a=(0,d.input)({type:"checkbox",checked:!0}),l=()=>{for(const[t,s]of e){const e=i.checked,n=a.checked,o=!t.dirty&&!e||t.internal&&!n;s.classList.toggle("hidden",o)}};i.addEventListener("change",(()=>l())),a.addEventListener("change",(()=>l()));const p=(()=>{const t=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"}),s=(0,d.span)({class:"checkbox"},(0,d.input)({type:"checkbox",checked:!0}),(0,d.span)("Group")),n=(0,d.span)({class:"checkbox"},i,(0,d.span)("Initial?")),o=(0,d.span)({class:"checkbox"},a,(0,d.span)("Internal?"));return t.addEventListener("keyup",(()=>{const s=t.value;for(const[t,n]of e){const e=t.attr.includes(s);n.classList.toggle("hidden",!e)}})),(0,d.div)({class:"toolbar"},t,s,n,o)})(),u=(()=>{const t=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"});return t.addEventListener("keyup",(()=>{const e=t.value;for(const[t,n]of s){const s=t.attr.includes(e);n.classList.toggle("hidden",!s)}})),(0,d.div)({class:"toolbar"},t)})(),v=(0,d.div)({class:"models-list"}),b=(0,d.div)({class:"props-list"}),k=(0,d.div)({class:"watches-list"}),x=(0,d.div)({class:"models-panel"},o,v),w=(0,d.div)({class:"props-panel"},p,b),L=(0,d.div)({class:"watches-panel"},u,k),E=(0,d.div)({class:"col",style:{width:"100%"}},L,w),j=(0,d.div)({class:"examiner"},x,E);function S(t){t instanceof h.Model&&O(t)}function C(t){return new y(S,5,3).to_html(t)}const P=(e,s)=>{(0,_.clear)(t),(0,d.empty)(v);const n=null!=s?new Set(s.roots()):new Set;for(const s of e){const e=n.has(s)?(0,d.span)({class:"tag"},"root"):null,o=(0,d.span)({class:"model-ref",tabIndex:0},C(s),e);o.addEventListener("keydown",(t=>{"Enter"==t.key&&O(s)})),t.push([s,o]),v.appendChild(o)}},O=s=>{var n;(0,_.clear)(e),(0,d.empty)(b);for(const[e,n]of t)n.classList.toggle("active",s==e);const o=(()=>{const t=[];let e=Object.getPrototypeOf(s);do{t.push([e.constructor,(0,f.keys)(e._props)]),e=Object.getPrototypeOf(e)}while(e.constructor!=c.HasProps);t.reverse();const n=[];for(const[,e]of t)e.splice(0,n.length),n.push(...e);return t})(),l=null!==(n=g.receivers_for_sender.get(s))&&void 0!==n?n:[];for(const[t,n]of o){if(0==n.length)continue;const o=(0,d.span)({class:["expander"]}),r=(0,d.div)({class:"base"},o,"inherited from"," ",(0,d.span)({class:"monospace"},t.__qualified__));b.appendChild(r);const c=[];for(const t of n){const n=s.property(t),o=n.kind.toString(),r=n.is_unset?(0,d.span)("unset"):C(n.get_value()),p=n.internal?(0,d.span)({class:"tag"},"internal"):null,h=l.filter((t=>t.signal==n.change)).length,u=0!=h?(0,d.span)({class:"tag"},`${h}`):null,f=this.watched_props.has(n),_=(0,d.input)({type:"checkbox",checked:f}),v=(0,d.div)({class:"prop-attr",tabIndex:0},_,(0,d.span)({class:"attr"},t),p),g=(0,d.div)({class:"prop-conns"},u),m=(0,d.div)({class:"prop-kind"},o),y=(0,d.div)({class:"prop-value"},r),k=n.dirty?"dirty":null,x=n.internal?"internal":null,w=i.checked,L=a.checked,E=!n.dirty&&!w||n.internal&&!L?"hidden":null,j=(0,d.div)({class:["prop",k,x,E]},v,g,m,y);c.push(j),e.push([n,j]),b.appendChild(j),_.addEventListener("change",(()=>{this.watched_props[_.checked?"add":"delete"](n),$()}))}r.addEventListener("click",(()=>{o.classList.toggle("closed");for(const t of c)t.classList.toggle("closed")}))}},$=()=>{if((0,_.clear)(s),(0,d.empty)(k),0==this.watched_props.size){const t=(0,d.div)({class:"nothing"},"No watched properties");k.appendChild(t)}else for(const t of this.watched_props){const e=(0,d.span)(C(t)),n=(0,d.span)(t.is_unset?(0,d.span)("unset"):C(t.get_value())),o=(0,d.div)({class:["prop",t.dirty?"dirty":null]},e,n);s.push([t,o]),k.appendChild(o)}};this.shadow_el.appendChild(j);const{target:I}=this.model;if(null!=I){const t=I.references(),{document:e}=I;P(t,e),O(I)}else{const{document:t}=this.model;if(null!=t){P(t._all_models.values(),t);const e=t.roots();if(0!=e.length){const[t]=e;O(t)}}}$()}}s.ExaminerView=k,k.__name__="ExaminerView";class x extends l.UIElement{constructor(t){super(t)}}s.Examiner=x,i=x,x.__name__="Examiner",i.prototype.default_view=k,i.define((({Ref:t,Nullable:e})=>({target:[e(t(c.HasProps)),null]})))}, +function _(t,e,s,n,o){var i;n();const a=t(1),l=t(260),r=a.__importStar(t(17)),c=t(14),d=t(56),p=t(41),h=t(50),u=t(8),f=t(9),_=t(10),v=t(33),g=t(15),m=t(37),b=a.__importDefault(t(453));class y{constructor(t,e,s){this.visited=new WeakSet,this.depth=0,this.click=t,this.max_items=e,this.max_depth=s}to_html(t){if((0,u.isObject)(t)){if(this.visited.has(t))return(0,d.span)("");this.visited.add(t)}return null==t?this.null():(0,u.isBoolean)(t)?this.boolean(t):(0,u.isNumber)(t)?this.number(t):(0,u.isString)(t)?this.string(t):(0,u.isSymbol)(t)?this.symbol(t):t instanceof h.Model?this.model(t):t instanceof r.Property?this.property(t):(0,u.isPlainObject)(t)?this.object(t):(0,u.isArray)(t)?this.array(t):(0,u.isIterable)(t)?this.iterable(t):(0,d.span)((0,p.to_string)(t))}null(){return(0,d.span)({class:"null"},"null")}token(t){return(0,d.span)({class:"token"},t)}boolean(t){return(0,d.span)({class:"boolean"},`${t}`)}number(t){return(0,d.span)({class:"number"},`${t}`)}string(t){const e=t.includes("'"),s=t.includes('"'),n=e&&s?`\`${t.replace(/`/g,"\\`")}\``:s?`'${t}'`:`"${t}"`;return(0,d.span)({class:"string"},n)}symbol(t){return(0,d.span)({class:"symbol"},t.toString())}array(t){const e=this.token,s=[];let n=0;for(const e of t)if(s.push(this.to_html(e)),n++>this.max_items){s.push((0,d.span)("\u2026"));break}return(0,d.span)({class:"array"},e("["),...(0,v.interleave)(s,(()=>e(", "))),e("]"))}iterable(t){var e;const s=this.token,n=null!==(e=Object(t)[Symbol.toStringTag])&&void 0!==e?e:"Object",o=this.array([...t]);return(0,d.span)({class:"iterable"},`${n}`,s("("),o,s(")"))}object(t){const e=this.token,s=[];let n=0;for(const[o,i]of(0,f.entries)(t))if(s.push((0,d.span)(`${o}`,e(": "),this.to_html(i))),n++>this.max_items){s.push((0,d.span)("\u2026"));break}return(0,d.span)({class:"object"},e("{"),...(0,v.interleave)(s,(()=>e(", "))),e("}"))}model(t){const e=this.token,s=(0,d.span)({class:"model"},t.constructor.__qualified__,e("("),this.to_html(t.id),e(")"));return s.addEventListener("click",(()=>this.click(t))),s}property(t){const e=this.model(t.obj),s=(0,d.span)({class:"attr"},t.attr);return(0,d.span)(e,this.token("."),s)}}s.HTMLPrinter=y,y.__name__="HTMLPrinter";class k extends l.UIElementView{constructor(){super(...arguments),this.prev_listener=null,this.watched_props=new Set}stylesheets(){return[...super.stylesheets(),b.default]}render(){super.render(),null!=this.prev_listener&&m.diagnostics.disconnect(this.prev_listener);const t=[],e=[],s=[],n=new WeakMap;m.diagnostics.connect((o=>{if(o instanceof r.Property){for(const[e,s]of t)e==o.obj&&i(s);for(const[t,s]of e)if(t==o){const[,,,e]=s.children;a(t,s,e);break}for(const[t,e]of s)if(t==o){const[,s]=e.children;a(t,e,s);break}}function i(t){const e=n.get(t);null!=e&&e.cancel();const s=t.animate([{backgroundColor:"#def189"},{backgroundColor:"initial"}],{duration:2e3});n.set(t,s)}function a(t,e,s){e.classList.toggle("dirty",t.dirty),(0,d.empty)(s);const n=t.is_unset?(0,d.span)("unset"):C(t.get_value());s.appendChild(n),i(s)}}));const o=(()=>{const e=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"});return e.addEventListener("keyup",(()=>{const s=e.value;for(const[e,n]of t){const t=e.constructor.__qualified__.includes(s);n.classList.toggle("hidden",!t)}})),(0,d.div)({class:"toolbar"},e)})(),i=(0,d.input)({type:"checkbox",checked:!0}),a=(0,d.input)({type:"checkbox",checked:!0}),l=()=>{for(const[t,s]of e){const e=i.checked,n=a.checked,o=!t.dirty&&!e||t.internal&&!n;s.classList.toggle("hidden",o)}};i.addEventListener("change",(()=>l())),a.addEventListener("change",(()=>l()));const p=(()=>{const t=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"}),s=(0,d.span)({class:"checkbox"},(0,d.input)({type:"checkbox",checked:!0}),(0,d.span)("Group")),n=(0,d.span)({class:"checkbox"},i,(0,d.span)("Initial?")),o=(0,d.span)({class:"checkbox"},a,(0,d.span)("Internal?"));return t.addEventListener("keyup",(()=>{const s=t.value;for(const[t,n]of e){const e=t.attr.includes(s);n.classList.toggle("hidden",!e)}})),(0,d.div)({class:"toolbar"},t,s,n,o)})(),u=(()=>{const t=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"});return t.addEventListener("keyup",(()=>{const e=t.value;for(const[t,n]of s){const s=t.attr.includes(e);n.classList.toggle("hidden",!s)}})),(0,d.div)({class:"toolbar"},t)})(),v=(0,d.div)({class:"models-list"}),b=(0,d.div)({class:"props-list"}),k=(0,d.div)({class:"watches-list"}),x=(0,d.div)({class:"models-panel"},o,v),w=(0,d.div)({class:"props-panel"},p,b),L=(0,d.div)({class:"watches-panel"},u,k),E=(0,d.div)({class:"col",style:{width:"100%"}},L,w),j=(0,d.div)({class:"examiner"},x,E);function S(t){t instanceof h.Model&&O(t)}function C(t){return new y(S,5,3).to_html(t)}const P=(e,s)=>{(0,_.clear)(t),(0,d.empty)(v);const n=null!=s?new Set(s.roots()):new Set;for(const s of e){const e=n.has(s)?(0,d.span)({class:"tag"},"root"):null,o=(0,d.span)({class:"model-ref",tabIndex:0},C(s),e);o.addEventListener("keydown",(t=>{"Enter"==t.key&&O(s)})),t.push([s,o]),v.appendChild(o)}},O=s=>{var n;(0,_.clear)(e),(0,d.empty)(b);for(const[e,n]of t)n.classList.toggle("active",s==e);const o=(()=>{const t=[];let e=Object.getPrototypeOf(s);do{t.push([e.constructor,(0,f.keys)(e._props)]),e=Object.getPrototypeOf(e)}while(e.constructor!=c.HasProps);t.reverse();const n=[];for(const[,e]of t)e.splice(0,n.length),n.push(...e);return t})(),l=null!==(n=g.receivers_for_sender.get(s))&&void 0!==n?n:[];for(const[t,n]of o){if(0==n.length)continue;const o=(0,d.span)({class:["expander"]}),r=(0,d.div)({class:"base"},o,"inherited from"," ",(0,d.span)({class:"monospace"},t.__qualified__));b.appendChild(r);const c=[];for(const t of n){const n=s.property(t),o=n.kind.toString(),r=n.is_unset?(0,d.span)("unset"):C(n.get_value()),p=n.internal?(0,d.span)({class:"tag"},"internal"):null,h=l.filter((t=>t.signal==n.change)).length,u=0!=h?(0,d.span)({class:"tag"},`${h}`):null,f=this.watched_props.has(n),_=(0,d.input)({type:"checkbox",checked:f}),v=(0,d.div)({class:"prop-attr",tabIndex:0},_,(0,d.span)({class:"attr"},t),p),g=(0,d.div)({class:"prop-conns"},u),m=(0,d.div)({class:"prop-kind"},o),y=(0,d.div)({class:"prop-value"},r),k=n.dirty?"dirty":null,x=n.internal?"internal":null,w=i.checked,L=a.checked,E=!n.dirty&&!w||n.internal&&!L?"hidden":null,j=(0,d.div)({class:["prop",k,x,E]},v,g,m,y);c.push(j),e.push([n,j]),b.appendChild(j),_.addEventListener("change",(()=>{this.watched_props[_.checked?"add":"delete"](n),$()}))}r.addEventListener("click",(()=>{o.classList.toggle("closed");for(const t of c)t.classList.toggle("closed")}))}},$=()=>{if((0,_.clear)(s),(0,d.empty)(k),0==this.watched_props.size){const t=(0,d.div)({class:"nothing"},"No watched properties");k.appendChild(t)}else for(const t of this.watched_props){const e=(0,d.span)(C(t)),n=(0,d.span)(t.is_unset?(0,d.span)("unset"):C(t.get_value())),o=(0,d.div)({class:["prop",t.dirty?"dirty":null]},e,n);s.push([t,o]),k.appendChild(o)}};this.shadow_el.appendChild(j);const{target:I}=this.model;if(null!=I){const t=I.references(),{document:e}=I;P(t,e),O(I)}else{const{document:t}=this.model;if(null!=t){P(t._all_models.values(),t);const e=t.roots();if(0!=e.length){const[t]=e;O(t)}}}$()}}s.ExaminerView=k,k.__name__="ExaminerView";class x extends l.UIElement{constructor(t){super(t)}}s.Examiner=x,i=x,x.__name__="Examiner",i.prototype.default_view=k,i.define((({Ref:t,Nullable:e})=>({target:[e(t(c.HasProps)),null]})))}, function _(o,e,r,i,l){i(),r.default='.null{color:#7724c1;}.token{color:#881280;}.boolean{color:#007500;}.number{color:#1a1aa6;}.string{color:#994500;}.symbol{color:#c80000;}.model{cursor:pointer;}.attr{color:#c80000;}:root{--common-padding:3px;--common-outline:#1a73e8 solid 1px;--panel-bg-color:#f1f3f4;--panel-border-color:#cacdd1;}.monospace{font-family:var(--mono-font);}.hidden{display:none !important;}.col{display:flex;flex-direction:column;}.row{display:flex;flex-direction:row;}.toolbar{display:flex;flex-direction:row;gap:1em;background-color:var(--panel-bg-color);border-bottom:1px solid var(--panel-border-color);padding:var(--common-padding);}.checkbox{display:flex;flex-direction:row;align-items:center;gap:0.25em;}.filter:focus{outline:var(--common-outline);}.examiner{height:100%;display:flex;border:1px solid var(--panel-border-color);}.models-panel{display:flex;flex-direction:column;border-right:1px solid var(--panel-border-color);}.props-panel{display:flex;flex-direction:column;height:100%;overflow:auto;}.watches-panel{display:flex;flex-direction:column;border-bottom:1px solid var(--panel-border-color);}.models-list{display:flex;flex-direction:column;height:min-content;padding:var(--common-padding);overflow-x:hidden;overflow-y:auto;}.props-list{display:grid;grid-template-columns:min-content min-content 1fr 1fr;column-gap:1em;padding:var(--common-padding);}.watches-list{display:grid;grid-template-columns:1fr 1fr;column-gap:1em;padding:var(--common-padding);}.nothing{grid-column:1 / span 2;font-style:italic;text-align:center;}.prop{display:contents;}.prop.closed{display:none;}.prop > *{opacity:0.6;}.prop.dirty > *{opacity:1;}.model-ref{display:flex;align-items:center;flex-direction:row;font-family:var(--mono-font);}.model-ref:focus-visible{outline:var(--common-outline);}.model-ref:hover{background-color:#e2e2e2;}.model-ref.active{background-color:#c8e0ee;}.tag{margin-left:1em;padding:0 4px;font-size:60%;border-width:1px;border-style:solid;border-radius:4px;color:#202124;background-color:#f1f3f4;border-color:#cacdd1;}.expander{margin:0 2px;display:inline-block;vertical-align:middle;background-color:#5f6368;--open-image:url(\'data:image/svg+xml;utf8, \');--closed-image:url(\'data:image/svg+xml;utf8, \');}.expander{width:6px;height:6px;mask-image:var(--open-image);-webkit-mask-image:var(--open-image);}.expander.closed{width:6px;height:6px;mask-image:var(--closed-image);-webkit-mask-image:var(--closed-image);}.base{grid-column:1 / span 4;color:#5f6368;cursor:pointer;}.prop-attr,.prop-conns,.prop-kind,.prop-value{display:flex;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-family:var(--mono-font);}.prop-attr > input[type="checkbox"]{visibility:hidden;margin-right:0.25em;}.prop-attr > input[type="checkbox"]:checked,.prop-attr:hover > input{visibility:visible;}.prop-attr:focus-visible{outline:var(--common-outline);}'}, function _(e,i,s,t,n){var r;t();const l=e(260),_=e(59),a=e(8);class h extends l.UIElementView{constructor(){super(...arguments),this._child_views=new Map}get _ui_elements(){return this.model.children.filter((e=>e instanceof l.UIElement))}get child_views(){return this._ui_elements.map((e=>this._child_views.get(e)))}*children(){yield*super.children(),yield*this._child_views.values()}async lazy_initialize(){await super.lazy_initialize(),await this._rebuild_views()}async _rebuild_views(){await(0,_.build_views)(this._child_views,this._ui_elements,{parent:this})}remove(){(0,_.remove_views)(this._child_views),super.remove()}connect_signals(){super.connect_signals();const{children:e}=this.model.properties;this.on_change(e,(()=>{this._rebuild_views(),this.render()}))}render(){super.render();for(const e of this.model.children)if((0,a.isString)(e)){const i=document.createTextNode(e);this.shadow_el.append(i)}else{const i=this._child_views.get(e);i.render(),this.shadow_el.append(i.el),i.after_render()}}has_finished(){if(!super.has_finished())return!1;for(const e of this.child_views)if(!e.has_finished())return!1;return!0}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{children:this.child_views.map((e=>e.serializable_state()))})}}s.PaneView=h,h.__name__="PaneView";class d extends l.UIElement{constructor(e){super(e)}}s.Pane=d,r=d,d.__name__="Pane",r.prototype.default_view=h,r.define((({String:e,Array:i,Ref:s,Or:t})=>({children:[i(t(e,s(l.UIElement))),[]]})))}, function _(t,e,i,s,r){var n;s();const o=t(1),l=t(260),a=t(420),c=t(456),h=t(19),u=t(56),_=t(55),d=t(8),g=t(12),m=t(18),p=t(59),v=o.__importStar(t(457)),b=v,f=o.__importDefault(t(272));class w extends l.UIElementView{constructor(){super(...arguments),this._html=null}get target(){return this._target}set target(t){this._target=t}_init_target(){const{target:t}=this.model,e=(()=>{var e,i;if(t instanceof l.UIElement)return null!==(i=null===(e=this.owner.find_one(t))||void 0===e?void 0:e.el)&&void 0!==i?i:null;if(t instanceof a.Selector)return t.find_one(document);if(t instanceof Node)return t;{const{parent:t}=this;return t instanceof _.DOMElementView?t.el:null}})();e instanceof Element?this._target=e:(m.logger.warn(`unable to resolve target '${t}' for '${this}'`),this._target=document.body)}initialize(){super.initialize(),this._init_target()}*children(){yield*super.children(),null!=this._html&&(yield this._html)}async lazy_initialize(){await super.lazy_initialize();const{content:t}=this.model;t instanceof c.HTML&&(this._html=await(0,p.build_view)(t,{parent:this})),this.render()}connect_signals(){super.connect_signals(),this._observer=new ResizeObserver((()=>{this._reposition()})),this._observer.observe(this.target);const{target:t,content:e,closable:i,interactive:s,position:r,attachment:n,visible:o}=this.model.properties;this.on_change(t,(()=>{this._init_target(),this._observer.disconnect(),this._observer.observe(this.target),this.render()})),this.on_change([e,i,s],(()=>this.render())),this.on_change([r,n,o],(()=>this._reposition()))}remove(){var t;null===(t=this._html)||void 0===t||t.remove(),this._observer.disconnect(),super.remove()}stylesheets(){return[...super.stylesheets(),v.default,f.default]}get content(){const{content:t}=this.model;return(0,d.isString)(t)?document.createTextNode(t):t instanceof c.HTML?((0,g.assert)(null!=this._html),this._html.el):t}render(){var t;if(super.render(),null===(t=this._html)||void 0===t||t.render(),this.content_el=(0,u.div)({class:b.tooltip_content},this.content),this.shadow_el.appendChild(this.content_el),this.model.closable){const t=(0,u.div)({class:b.close});t.addEventListener("click",(()=>{this.model.visible=!1})),this.shadow_el.appendChild(t)}this.el.classList.toggle(b.tooltip_arrow,this.model.show_arrow),this.el.classList.toggle(b.non_interactive,!this.model.interactive),this._reposition()}_anchor_to_align(t){switch(t){case"top_left":return["top","left"];case"top":case"top_center":return["top","center"];case"top_right":return["top","right"];case"left":case"center_left":return["center","left"];case"center":case"center_center":return["center","center"];case"right":case"center_right":return["center","right"];case"bottom_left":return["bottom","left"];case"bottom":case"bottom_center":return["bottom","center"];case"bottom_right":return["bottom","right"]}}_reposition(){var t;const{position:e,visible:i}=this.model;if(null==e||!i)return void this.el.remove();(null!==(t=this.target.shadowRoot)&&void 0!==t?t:this.target).appendChild(this.el);const s=(0,u.bounding_box)(this.target).relative(),[r,n]=(()=>{if((0,d.isString)(e)){const[t,i]=this._anchor_to_align(e);return[(()=>{switch(i){case"left":return s.left;case"center":return s.hcenter;case"right":return s.right}})(),(()=>{switch(t){case"top":return s.top;case"center":return s.vcenter;case"bottom":return s.bottom}})()]}return e})(),o=(()=>{const t=(()=>{const{attachment:t}=this.model;if("auto"==t){if((0,d.isString)(e)){const[t,i]=this._anchor_to_align(e);if("center"!=i)return"left"==i?"left":"right";if("center"!=t)return"top"==t?"above":"below"}return"horizontal"}return t})();switch(t){case"horizontal":return r({target:[r(n(l.UIElement),n(a.Selector),n(Node),u),"auto"],position:[o(r(h.Anchor,s(e,e))),null],content:[r(i,n(c.HTML),n(Node))],attachment:[r(h.TooltipAttachment,u),"auto"],show_arrow:[t,!0],closable:[t,!1],interactive:[t,!0]}))),n.override({visible:!1})}, @@ -1460,8 +1460,8 @@

Plots# function _(e,s,o,t,n){var i;t();const l=e(274),a=e(471),_=e(19),c=e(26),r=e(272),m=(0,e(20).Enum)("none","cross","all");class h extends l.GestureToolView{_pinch(e){const{sx:s,sy:o,scale:t,modifiers:n}=e;let i;i=t>=1?20*(t-1):-20/t,this._scroll({type:"wheel",sx:s,sy:o,delta:i,modifiers:n})}_scroll(e){var s;const{sx:o,sy:t}=e,n=this.plot_view.axis_views.find((e=>e.layout.bbox.contains(o,t)));if(null!=n&&!this.model.zoom_on_axis)return;const{frame:i}=this.plot_view;if(null==n&&!i.bbox.contains(o,t))return;const l=this.model.dimensions,_="width"==l||"both"==l,c="height"==l||"both"==l,{x_range:r,y_range:m}=i.bbox,{x_scales:h,y_scales:d,center:u}=(()=>{if(null==n){const{x_scales:e,y_scales:s}=i;return{x_scales:e,y_scales:s,center:{x:o,y:t}}}{const e=0==n.dimension?{x:o,y:null}:{x:null,y:t},{zoom_together:s}=this.model;if("all"==s){const{x_scales:s,y_scales:o}=i;return 0==n.dimension?{x_scales:s,y_scales:new Map,center:e}:{x_scales:new Map,y_scales:o,center:e}}{const{x_range_name:o,y_range_name:t}=n.model,{x_scale:i,y_scale:l}=n.coordinates,a=new Map([[o,i]]),_=new Map([[t,l]]);switch(s){case"cross":return{x_scales:a,y_scales:_,center:e};case"none":return 0==n.dimension?{x_scales:a,y_scales:new Map,center:e}:{x_scales:new Map,y_scales:_,center:e}}}}})(),w=this.model.speed*e.delta,x=(0,a.scale_range)(h,d,r,m,w,_,c,u);this.plot_view.state.push("wheel_zoom",{range:x});const{maintain_focus:p}=this.model;this.plot_view.update_range(x,{scrolling:!0,maintain_focus:p}),null===(s=this.model.document)||void 0===s||s.interactive_start(this.plot_view.model,(()=>this.plot_view.trigger_ranges_update_event()))}}o.WheelZoomToolView=h,h.__name__="WheelZoomToolView";class d extends l.GestureTool{constructor(e){super(e),this.tool_name="Wheel Zoom",this.tool_icon=r.tool_icon_wheel_zoom,this.event_type=c.is_mobile?"pinch":"scroll",this.default_order=10}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}o.WheelZoomTool=d,i=d,d.__name__="WheelZoomTool",i.prototype.default_view=h,i.define((({Boolean:e,Number:s})=>({dimensions:[_.Dimensions,"both"],maintain_focus:[e,!0],zoom_on_axis:[e,!0],zoom_together:[m,"all"],speed:[s,1/600]}))),i.register_alias("wheel_zoom",(()=>new d({dimensions:"both"}))),i.register_alias("xwheel_zoom",(()=>new d({dimensions:"width"}))),i.register_alias("ywheel_zoom",(()=>new d({dimensions:"height"})))}, function _(o,r,s,e,l){e(),l("CrosshairTool",o(496).CrosshairTool),l("CustomJSHover",o(497).CustomJSHover),l("HoverTool",o(498).HoverTool),l("InspectTool",o(276).InspectTool)}, function _(s,e,i,t,o){var n;t();const a=s(276),r=s(257),l=s(19),_=s(8),h=s(272);class c extends a.InspectToolView{get overlays(){return[...super.overlays,...this._spans]}initialize(){super.initialize(),this._update_overlays()}connect_signals(){super.connect_signals();const{overlay:s,dimensions:e,line_color:i,line_width:t,line_alpha:o}=this.model.properties;this.on_change([s,e,i,t,o],(()=>{this._update_overlays()}))}_update_overlays(){const{overlay:s}=this.model;if("auto"==s){const{dimensions:e,line_color:i,line_alpha:t,line_width:o}=this.model;function n(s){return new r.Span({dimension:s,location_units:"canvas",level:"overlay",line_color:i,line_width:o,line_alpha:t})}switch(e){case"width":this._spans=[n("width")];break;case"height":this._spans=[n("height")];break;case"both":this._spans=[n("width"),n("height")]}}else(0,_.isArray)(s)?this._spans=[...s]:this._spans=[s]}_move(s){if(!this.model.active)return;const{sx:e,sy:i}=s;this.plot_view.frame.bbox.contains(e,i)?this._update_spans(e,i):this._update_spans(NaN,NaN)}_move_exit(s){this._update_spans(NaN,NaN)}_update_spans(s,e){const{frame:i}=this.plot_view;function t(s,e,t){const{dimension:o}=s;switch(s.location_units){case"canvas":return"width"==o?t:e;case"screen":{const{xview:s,yview:n}=i.bbox;return"width"==o?n.invert(t):s.invert(e)}case"data":{const{x_scale:s,y_scale:n}=i;return"width"==o?n.invert(t):s.invert(e)}}}for(const i of this._spans)i.location=t(i,s,e)}}i.CrosshairToolView=c,c.__name__="CrosshairToolView";class p extends a.InspectTool{constructor(s){super(s),this.tool_name="Crosshair",this.tool_icon=h.tool_icon_crosshair}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.CrosshairTool=p,n=p,p.__name__="CrosshairTool",n.prototype.default_view=c,n.define((({Alpha:s,Number:e,Color:i,Auto:t,Tuple:o,Ref:n,Or:a})=>({overlay:[a(t,n(r.Span),o(n(r.Span),n(r.Span))),"auto"],dimensions:[l.Dimensions,"both"],line_color:[i,"black"],line_width:[e,1],line_alpha:[s,1]}))),n.register_alias("crosshair",(()=>new p))}, -function _(e,s,t,r,n){var o;r();const a=e(50),u=e(9),c=e(38);class i extends a.Model{constructor(e){super(e)}get values(){return(0,u.values)(this.args)}_make_code(e,s,t,r){return new Function(...(0,u.keys)(this.args),e,s,t,(0,c.use_strict)(r))}format(e,s,t){return this._make_code("value","format","special_vars",this.code)(...this.values,e,s,t)}}t.CustomJSHover=i,o=i,i.__name__="CustomJSHover",o.define((({Unknown:e,String:s,Dict:t})=>({args:[t(e),{}],code:[s,""]})))}, -function _(e,t,n,s,i){var o;s();const r=e(1),l=e(59),a=e(56),c=e(19),_=r.__importStar(e(210)),d=e(15),p=e(12),u=e(21),h=e(32),m=e(9),y=e(170),f=e(8),v=e(272),x=r.__importStar(e(457)),w=e(455),g=e(499),b=e(215),S=e(212),C=e(334),T=e(201),V=e(338),$=e(211),A=e(217),k=e(216),H=e(200),M=e(199),R=e(416),z=e(95),G=e(497),P=e(276);function N(e,t,n,s){const i={x:n[e],y:s[e]},o={x:n[e+1],y:s[e+1]},{sx:r,sy:l}=t,[a,c]=function(){if("span"==t.type)return"h"==t.direction?[Math.abs(i.x-r),Math.abs(o.x-r)]:[Math.abs(i.y-l),Math.abs(o.y-l)];const e={x:r,y:l};return[_.dist_2_pts(i,e),_.dist_2_pts(o,e)]}();return adelete this._template_el)),this.on_change([e,t,n],(async()=>await this._update_ttmodels()))}async _update_ttmodels(){const{ttmodels:e}=this;e.clear();const{tooltips:t}=this.model;if(null==t)return;const{computed_renderers:n}=this;for(const t of n){const n=new w.Tooltip({content:document.createElement("div"),attachment:this.model.attachment,show_arrow:this.model.show_arrow,interactive:!1,visible:!0,position:null,target:this.parent.canvas.overlays_el});t instanceof M.GlyphRenderer?e.set(t,n):t instanceof R.GraphRenderer&&(e.set(t.node_renderer,n),e.set(t.edge_renderer,n))}await(0,l.build_views)(this._ttviews,[...e.values()],{parent:this.plot_view});const s=[...function*(){for(const e of n)e instanceof M.GlyphRenderer?yield e:e instanceof R.GraphRenderer&&(yield e.node_renderer,yield e.edge_renderer)}()],i=this._slots.get(this.update);if(null!=i){const e=new Set(s.map((e=>e.data_source)));d.Signal.disconnect_receiver(this,i,e)}for(const e of s)this.connect(e.data_source.inspect,this.update)}get computed_renderers(){const{renderers:e}=this.model,t=this.plot_view.model.data_renderers;return(0,z.compute_renderers)(e,t)}_clear(){this._inspect(1/0,1/0);for(const[,e]of this.ttmodels)e.clear()}_move(e){if(!this.model.active)return;const{sx:t,sy:n}=e;this.plot_view.frame.bbox.contains(t,n)?this._inspect(t,n):this._clear()}_move_exit(){this._clear()}_inspect(e,t){let n;if("mouse"==this.model.mode)n={type:"point",sx:e,sy:t};else{n={type:"span",direction:"vline"==this.model.mode?"h":"v",sx:e,sy:t}}for(const e of this.computed_renderers){const t=e.get_selection_manager(),s=this.plot_view.renderer_view(e);null!=s&&t.inspect(s,n)}this._emit_callback(n)}_update(e,t,n){var s,i;const o=e.get_selection_manager(),r=o.inspectors.get(e),l=e.view.convert_selection_to_subset(r);if(r.is_empty()&&null==r.view)return void n.clear();const c=o.source,_=this.plot_view.renderer_view(e);if(null==_)return;const{sx:d,sy:u}=t,h=_.coordinates.x_scale,y=_.coordinates.y_scale,f=h.invert(d),v=y.invert(u),{glyph:x}=_,w=[];if(x instanceof $.PatchView){const[t,n]=[d,u],[s,i]=[f,v],o={index:null,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:s,snap_y:i,snap_sx:t,snap_sy:n,name:e.name},r=this._render_tooltips(c,o);w.push([t,n,r])}else if(x instanceof S.HAreaStepView||x instanceof b.HAreaView||x instanceof k.VAreaStepView||x instanceof A.VAreaView)for(const t of l.line_indices){const[n,s]=[f,v],[i,o]=[d,u],r={index:t,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:n,snap_y:s,snap_sx:i,snap_sy:o,name:e.name,indices:l.line_indices},a=this._render_tooltips(c,r);w.push([i,o,a])}else if(x instanceof T.LineView){const{line_policy:n}=this.model;for(const s of l.line_indices){const[[i,o],[r,a],p]=(()=>{const[e,i]=[x._x,x._y];switch(n){case"interp":{const[e,n]=x.get_interpolation_hit(s,t);return[[e,n],[h.compute(e),y.compute(n)],s]}case"prev":{const[t,n]=O(x.sx,x.sy,s);return[[e[s+1],i[s+1]],t,n]}case"next":{const[t,n]=O(x.sx,x.sy,s+1);return[[e[s+1],i[s+1]],t,n]}case"nearest":{const[n,o]=N(s,t,x.sx,x.sy);return[[e[o],i[o]],n,o]}case"none":{const e=_.coordinates.x_scale,t=_.coordinates.y_scale;return[[e.invert(d),t.invert(u)],[d,u],s]}}})(),m={index:p,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:i,snap_y:o,snap_sx:r,snap_sy:a,name:e.name,indices:l.line_indices},g=this._render_tooltips(c,m);w.push([r,a,g])}}else if(x instanceof C.ImageBaseView)for(const t of r.image_indices){const[n,s]=[d,u],[i,o]=[f,v],r={index:t.index,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:i,snap_y:o,snap_sx:n,snap_sy:s,name:e.name,image_index:t},l=this._render_tooltips(c,r);w.push([n,s,l])}else for(const n of l.indices)if(x instanceof V.MultiLineView&&!(0,m.is_empty)(l.multiline_indices)){const{line_policy:s}=this.model;for(const i of l.multiline_indices[n.toString()]){const[[o,r],[a,_],p]=function(){if("interp"==s){const[e,s]=x.get_interpolation_hit(n,i,t);return[[e,s],[h.compute(e),y.compute(s)],i]}const[e,o]=[x._xs.get(n),x._ys.get(n)];if("prev"==s){const[t,s]=O(x.sxs.get(n),x.sys.get(n),i);return[[e[i],o[i]],t,s]}if("next"==s){const[t,s]=O(x.sxs.get(n),x.sys.get(n),i+1);return[[e[i],o[i]],t,s]}if("nearest"==s){const[s,r]=N(i,t,x.sxs.get(n),x.sys.get(n));return[[e[r],o[r]],s,r]}throw new Error("shouldn't have happened")}(),m={index:e.view.convert_indices_from_subset([n])[0],glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:o,snap_y:r,snap_sx:a,snap_sy:_,name:e.name,indices:l.multiline_indices,segment_index:p},g=this._render_tooltips(c,m);w.push([a,_,g])}}else{const t=null===(s=x._x)||void 0===s?void 0:s[n],o=null===(i=x._y)||void 0===i?void 0:i[n],{point_policy:r,anchor:a}=this.model,[_,p]=function(){if("snap_to_data"==r){const e=x.get_anchor_point(a,n,[d,u]);if(null!=e)return[e.x,e.y];const t=x.get_anchor_point("center",n,[d,u]);return null!=t?[t.x,t.y]:[d,u]}return[d,u]}(),h={index:e.view.convert_indices_from_subset([n])[0],glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:t,snap_y:o,snap_sx:_,snap_sy:p,name:e.name,indices:l.indices},m=this._render_tooltips(c,h);w.push([_,p,m])}const{bbox:g}=this.plot_view.frame,H=w.filter((([e,t])=>g.contains(e,t)));if(0==H.length)n.clear();else{const{content:e}=n;(0,p.assert)(e instanceof Element),(0,a.empty)(e);for(const[,,t]of H)null!=t&&e.appendChild(t);const[t,s]=H[H.length-1];n.setv({position:[t,s]},{check_eq:!1})}}update([e,{geometry:t}]){if(!this.model.active)return;if("point"!=t.type&&"span"!=t.type)return;if("ignore"==this.model.muted_policy&&e.muted)return;const n=this.ttmodels.get(e);(0,f.is_undefined)(n)||this._update(e,t,n)}_emit_callback(e){const{callback:t}=this.model;if(null!=t)for(const n of this.computed_renderers){if(!(n instanceof M.GlyphRenderer))continue;const s=this.plot_view.renderer_view(n);if(null==s)continue;const{x_scale:i,y_scale:o}=s.coordinates,r=i.invert(e.sx),l=o.invert(e.sy),a=n.data_source.inspected;t.execute(this.model,{geometry:Object.assign({x:r,y:l},e),renderer:n,index:a})}}_create_template(e){const t=(0,a.div)({style:{display:"table",borderSpacing:"2px"}});for(const[n]of e){const e=(0,a.div)({style:{display:"table-row"}});t.appendChild(e);const s=(0,a.div)({style:{display:"table-cell"},class:x.tooltip_row_label},0!=n.length?`${n}: `:"");e.appendChild(s);const i=(0,a.span)();i.dataset.value="";const o=(0,a.span)({class:x.tooltip_color_block}," ");o.dataset.swatch="",(0,a.undisplay)(o);const r=(0,a.div)({style:{display:"table-cell"},class:x.tooltip_row_value},i,o);e.appendChild(r)}return t}_render_template(e,t,n,s){const i=e.cloneNode(!0),o=(0,f.is_undefined)(s.image_index)?s.index:s.image_index,r=i.querySelectorAll("[data-value]"),l=i.querySelectorAll("[data-swatch]"),c=/\$color(\[.*\])?:(\w*)/,_=/\$swatch:(\w*)/;for(const[[,e],i]of(0,h.enumerate)(t)){const t=e.match(_),d=e.match(c);if(null!=t||null!=d){if(null!=t){const[,e]=t,s=n.get_column(e);if(null==s)r[i].textContent=`${e} unknown`;else{const e=(0,f.isNumber)(o)?s[o]:null;null!=e&&(l[i].style.backgroundColor=(0,u.color2css)(e),(0,a.display)(l[i]))}}if(null!=d){const[,e="",t]=d,s=n.get_column(t);if(null==s){r[i].textContent=`${t} unknown`;continue}const c=e.indexOf("hex")>=0,_=e.indexOf("swatch")>=0,p=(0,f.isNumber)(o)?s[o]:null;if(null==p){r[i].textContent="(null)";continue}r[i].textContent=c?(0,u.color2hex)(p):(0,u.color2css)(p),_&&(l[i].style.backgroundColor=(0,u.color2css)(p),(0,a.display)(l[i]))}}else{const t=(0,y.replace_placeholders)(e.replace("$~","$data_"),n,o,this.model.formatters,s);if((0,f.isString)(t))r[i].textContent=t;else for(const e of t)r[i].appendChild(e)}}return i}_render_tooltips(e,t){var n;const{tooltips:s}=this.model,i=t.index;if((0,f.isString)(s)){const n=(0,y.replace_placeholders)({html:s},e,i,this.model.formatters,t);return(0,a.div)(n)}if((0,f.isFunction)(s))return s(e,t);if(s instanceof g.Template)return this._template_view.update(e,i,t),this._template_view.el;if(null!=s){const i=null!==(n=this._template_el)&&void 0!==n?n:this._template_el=this._create_template(s);return this._render_template(i,s,e,t)}return null}}n.HoverToolView=q,q.__name__="HoverToolView";class E extends P.InspectTool{constructor(e){super(e),this.tool_name="Hover",this.tool_icon=v.tool_icon_hover}}n.HoverTool=E,o=E,E.__name__="HoverTool",o.prototype.default_view=q,o.define((({Any:e,Boolean:t,String:n,Array:s,Tuple:i,Dict:o,Or:r,Ref:l,Function:a,Auto:_,Nullable:d})=>({tooltips:[d(r(l(g.Template),n,s(i(n,n)),a())),[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[o(r(l(G.CustomJSHover),y.FormatterType)),{}],renderers:[r(s(l(H.DataRenderer)),_),"auto"],mode:[c.HoverMode,"mouse"],muted_policy:[c.MutedPolicy,"show"],point_policy:[c.PointPolicy,"snap_to_data"],line_policy:[c.LinePolicy,"nearest"],show_arrow:[t,!0],anchor:[c.Anchor,"center"],attachment:[c.TooltipAttachment,"horizontal"],callback:[d(e),null]}))),o.register_alias("hover",(()=>new E))}, +function _(e,s,t,r,n){var o;r();const a=e(50),u=e(9),c=e(39);class i extends a.Model{constructor(e){super(e)}get values(){return(0,u.values)(this.args)}_make_code(e,s,t,r){return new Function(...(0,u.keys)(this.args),e,s,t,(0,c.use_strict)(r))}format(e,s,t){return this._make_code("value","format","special_vars",this.code)(...this.values,e,s,t)}}t.CustomJSHover=i,o=i,i.__name__="CustomJSHover",o.define((({Unknown:e,String:s,Dict:t})=>({args:[t(e),{}],code:[s,""]})))}, +function _(e,t,n,s,i){var o;s();const r=e(1),l=e(59),a=e(56),c=e(19),_=r.__importStar(e(210)),d=e(15),p=e(12),u=e(21),h=e(33),m=e(9),y=e(170),f=e(8),v=e(272),x=r.__importStar(e(457)),w=e(455),g=e(499),b=e(215),S=e(212),C=e(334),T=e(201),V=e(338),$=e(211),A=e(217),k=e(216),H=e(200),M=e(199),R=e(416),z=e(95),G=e(497),P=e(276);function N(e,t,n,s){const i={x:n[e],y:s[e]},o={x:n[e+1],y:s[e+1]},{sx:r,sy:l}=t,[a,c]=function(){if("span"==t.type)return"h"==t.direction?[Math.abs(i.x-r),Math.abs(o.x-r)]:[Math.abs(i.y-l),Math.abs(o.y-l)];const e={x:r,y:l};return[_.dist_2_pts(i,e),_.dist_2_pts(o,e)]}();return adelete this._template_el)),this.on_change([e,t,n],(async()=>await this._update_ttmodels()))}async _update_ttmodels(){const{ttmodels:e}=this;e.clear();const{tooltips:t}=this.model;if(null==t)return;const{computed_renderers:n}=this;for(const t of n){const n=new w.Tooltip({content:document.createElement("div"),attachment:this.model.attachment,show_arrow:this.model.show_arrow,interactive:!1,visible:!0,position:null,target:this.parent.canvas.overlays_el});t instanceof M.GlyphRenderer?e.set(t,n):t instanceof R.GraphRenderer&&(e.set(t.node_renderer,n),e.set(t.edge_renderer,n))}await(0,l.build_views)(this._ttviews,[...e.values()],{parent:this.plot_view});const s=[...function*(){for(const e of n)e instanceof M.GlyphRenderer?yield e:e instanceof R.GraphRenderer&&(yield e.node_renderer,yield e.edge_renderer)}()],i=this._slots.get(this.update);if(null!=i){const e=new Set(s.map((e=>e.data_source)));d.Signal.disconnect_receiver(this,i,e)}for(const e of s)this.connect(e.data_source.inspect,this.update)}get computed_renderers(){const{renderers:e}=this.model,t=this.plot_view.model.data_renderers;return(0,z.compute_renderers)(e,t)}_clear(){this._inspect(1/0,1/0);for(const[,e]of this.ttmodels)e.clear()}_move(e){if(!this.model.active)return;const{sx:t,sy:n}=e;this.plot_view.frame.bbox.contains(t,n)?this._inspect(t,n):this._clear()}_move_exit(){this._clear()}_inspect(e,t){let n;if("mouse"==this.model.mode)n={type:"point",sx:e,sy:t};else{n={type:"span",direction:"vline"==this.model.mode?"h":"v",sx:e,sy:t}}for(const e of this.computed_renderers){const t=e.get_selection_manager(),s=this.plot_view.renderer_view(e);null!=s&&t.inspect(s,n)}this._emit_callback(n)}_update(e,t,n){var s,i;const o=e.get_selection_manager(),r=o.inspectors.get(e),l=e.view.convert_selection_to_subset(r);if(r.is_empty()&&null==r.view)return void n.clear();const c=o.source,_=this.plot_view.renderer_view(e);if(null==_)return;const{sx:d,sy:u}=t,h=_.coordinates.x_scale,y=_.coordinates.y_scale,f=h.invert(d),v=y.invert(u),{glyph:x}=_,w=[];if(x instanceof $.PatchView){const[t,n]=[d,u],[s,i]=[f,v],o={index:null,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:s,snap_y:i,snap_sx:t,snap_sy:n,name:e.name},r=this._render_tooltips(c,o);w.push([t,n,r])}else if(x instanceof S.HAreaStepView||x instanceof b.HAreaView||x instanceof k.VAreaStepView||x instanceof A.VAreaView)for(const t of l.line_indices){const[n,s]=[f,v],[i,o]=[d,u],r={index:t,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:n,snap_y:s,snap_sx:i,snap_sy:o,name:e.name,indices:l.line_indices},a=this._render_tooltips(c,r);w.push([i,o,a])}else if(x instanceof T.LineView){const{line_policy:n}=this.model;for(const s of l.line_indices){const[[i,o],[r,a],p]=(()=>{const[e,i]=[x._x,x._y];switch(n){case"interp":{const[e,n]=x.get_interpolation_hit(s,t);return[[e,n],[h.compute(e),y.compute(n)],s]}case"prev":{const[t,n]=O(x.sx,x.sy,s);return[[e[s+1],i[s+1]],t,n]}case"next":{const[t,n]=O(x.sx,x.sy,s+1);return[[e[s+1],i[s+1]],t,n]}case"nearest":{const[n,o]=N(s,t,x.sx,x.sy);return[[e[o],i[o]],n,o]}case"none":{const e=_.coordinates.x_scale,t=_.coordinates.y_scale;return[[e.invert(d),t.invert(u)],[d,u],s]}}})(),m={index:p,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:i,snap_y:o,snap_sx:r,snap_sy:a,name:e.name,indices:l.line_indices},g=this._render_tooltips(c,m);w.push([r,a,g])}}else if(x instanceof C.ImageBaseView)for(const t of r.image_indices){const[n,s]=[d,u],[i,o]=[f,v],r={index:t.index,glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:i,snap_y:o,snap_sx:n,snap_sy:s,name:e.name,image_index:t},l=this._render_tooltips(c,r);w.push([n,s,l])}else for(const n of l.indices)if(x instanceof V.MultiLineView&&!(0,m.is_empty)(l.multiline_indices)){const{line_policy:s}=this.model;for(const i of l.multiline_indices[n.toString()]){const[[o,r],[a,_],p]=function(){if("interp"==s){const[e,s]=x.get_interpolation_hit(n,i,t);return[[e,s],[h.compute(e),y.compute(s)],i]}const[e,o]=[x._xs.get(n),x._ys.get(n)];if("prev"==s){const[t,s]=O(x.sxs.get(n),x.sys.get(n),i);return[[e[i],o[i]],t,s]}if("next"==s){const[t,s]=O(x.sxs.get(n),x.sys.get(n),i+1);return[[e[i],o[i]],t,s]}if("nearest"==s){const[s,r]=N(i,t,x.sxs.get(n),x.sys.get(n));return[[e[r],o[r]],s,r]}throw new Error("shouldn't have happened")}(),m={index:e.view.convert_indices_from_subset([n])[0],glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:o,snap_y:r,snap_sx:a,snap_sy:_,name:e.name,indices:l.multiline_indices,segment_index:p},g=this._render_tooltips(c,m);w.push([a,_,g])}}else{const t=null===(s=x._x)||void 0===s?void 0:s[n],o=null===(i=x._y)||void 0===i?void 0:i[n],{point_policy:r,anchor:a}=this.model,[_,p]=function(){if("snap_to_data"==r){const e=x.get_anchor_point(a,n,[d,u]);if(null!=e)return[e.x,e.y];const t=x.get_anchor_point("center",n,[d,u]);return null!=t?[t.x,t.y]:[d,u]}return[d,u]}(),h={index:e.view.convert_indices_from_subset([n])[0],glyph_view:x,x:f,y:v,sx:d,sy:u,snap_x:t,snap_y:o,snap_sx:_,snap_sy:p,name:e.name,indices:l.indices},m=this._render_tooltips(c,h);w.push([_,p,m])}const{bbox:g}=this.plot_view.frame,H=w.filter((([e,t])=>g.contains(e,t)));if(0==H.length)n.clear();else{const{content:e}=n;(0,p.assert)(e instanceof Element),(0,a.empty)(e);for(const[,,t]of H)null!=t&&e.appendChild(t);const[t,s]=H[H.length-1];n.setv({position:[t,s]},{check_eq:!1})}}update([e,{geometry:t}]){if(!this.model.active)return;if("point"!=t.type&&"span"!=t.type)return;if("ignore"==this.model.muted_policy&&e.muted)return;const n=this.ttmodels.get(e);(0,f.is_undefined)(n)||this._update(e,t,n)}_emit_callback(e){const{callback:t}=this.model;if(null!=t)for(const n of this.computed_renderers){if(!(n instanceof M.GlyphRenderer))continue;const s=this.plot_view.renderer_view(n);if(null==s)continue;const{x_scale:i,y_scale:o}=s.coordinates,r=i.invert(e.sx),l=o.invert(e.sy),a=n.data_source.inspected;t.execute(this.model,{geometry:Object.assign({x:r,y:l},e),renderer:n,index:a})}}_create_template(e){const t=(0,a.div)({style:{display:"table",borderSpacing:"2px"}});for(const[n]of e){const e=(0,a.div)({style:{display:"table-row"}});t.appendChild(e);const s=(0,a.div)({style:{display:"table-cell"},class:x.tooltip_row_label},0!=n.length?`${n}: `:"");e.appendChild(s);const i=(0,a.span)();i.dataset.value="";const o=(0,a.span)({class:x.tooltip_color_block}," ");o.dataset.swatch="",(0,a.undisplay)(o);const r=(0,a.div)({style:{display:"table-cell"},class:x.tooltip_row_value},i,o);e.appendChild(r)}return t}_render_template(e,t,n,s){const i=e.cloneNode(!0),o=(0,f.is_undefined)(s.image_index)?s.index:s.image_index,r=i.querySelectorAll("[data-value]"),l=i.querySelectorAll("[data-swatch]"),c=/\$color(\[.*\])?:(\w*)/,_=/\$swatch:(\w*)/;for(const[[,e],i]of(0,h.enumerate)(t)){const t=e.match(_),d=e.match(c);if(null!=t||null!=d){if(null!=t){const[,e]=t,s=n.get_column(e);if(null==s)r[i].textContent=`${e} unknown`;else{const e=(0,f.isNumber)(o)?s[o]:null;null!=e&&(l[i].style.backgroundColor=(0,u.color2css)(e),(0,a.display)(l[i]))}}if(null!=d){const[,e="",t]=d,s=n.get_column(t);if(null==s){r[i].textContent=`${t} unknown`;continue}const c=e.indexOf("hex")>=0,_=e.indexOf("swatch")>=0,p=(0,f.isNumber)(o)?s[o]:null;if(null==p){r[i].textContent="(null)";continue}r[i].textContent=c?(0,u.color2hex)(p):(0,u.color2css)(p),_&&(l[i].style.backgroundColor=(0,u.color2css)(p),(0,a.display)(l[i]))}}else{const t=(0,y.replace_placeholders)(e.replace("$~","$data_"),n,o,this.model.formatters,s);if((0,f.isString)(t))r[i].textContent=t;else for(const e of t)r[i].appendChild(e)}}return i}_render_tooltips(e,t){var n;const{tooltips:s}=this.model,i=t.index;if((0,f.isString)(s)){const n=(0,y.replace_placeholders)({html:s},e,i,this.model.formatters,t);return(0,a.div)(n)}if((0,f.isFunction)(s))return s(e,t);if(s instanceof g.Template)return this._template_view.update(e,i,t),this._template_view.el;if(null!=s){const i=null!==(n=this._template_el)&&void 0!==n?n:this._template_el=this._create_template(s);return this._render_template(i,s,e,t)}return null}}n.HoverToolView=q,q.__name__="HoverToolView";class E extends P.InspectTool{constructor(e){super(e),this.tool_name="Hover",this.tool_icon=v.tool_icon_hover}}n.HoverTool=E,o=E,E.__name__="HoverTool",o.prototype.default_view=q,o.define((({Any:e,Boolean:t,String:n,Array:s,Tuple:i,Dict:o,Or:r,Ref:l,Function:a,Auto:_,Nullable:d})=>({tooltips:[d(r(l(g.Template),n,s(i(n,n)),a())),[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[o(r(l(G.CustomJSHover),y.FormatterType)),{}],renderers:[r(s(l(H.DataRenderer)),_),"auto"],mode:[c.HoverMode,"mouse"],muted_policy:[c.MutedPolicy,"show"],point_policy:[c.PointPolicy,"snap_to_data"],line_policy:[c.LinePolicy,"nearest"],show_arrow:[t,!0],anchor:[c.Anchor,"center"],attachment:[c.TooltipAttachment,"horizontal"],callback:[d(e),null]}))),o.register_alias("hover",(()=>new E))}, function _(e,i,t,a,s){var n;a();const o=e(500),l=e(501),c=e(502),_=e(59);class r extends o.DOMElementView{constructor(){super(...arguments),this.action_views=new Map}*children(){yield*super.children(),yield*this.action_views.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,_.build_views)(this.action_views,this.model.actions,{parent:this})}remove(){(0,_.remove_views)(this.action_views),super.remove()}update(e,i,t={}){!function a(s){for(const n of s.child_views.values())n instanceof c.PlaceholderView?n.update(e,i,t):n instanceof o.DOMElementView&&a(n)}(this);for(const a of this.action_views.values())a.update(e,i,t)}}t.TemplateView=r,r.__name__="TemplateView",r.tag_name="div";class v extends o.DOMElement{}t.Template=v,n=v,v.__name__="Template",n.prototype.default_view=r,n.define((({Array:e,Ref:i})=>({actions:[e(i(l.Action)),[]]})))}, function _(e,t,i,s,l){var n;s();const r=e(449),o=e(261),c=e(260),h=e(59),a=e(9),d=e(8);class _ extends r.DOMNodeView{constructor(){super(...arguments),this.child_views=new Map}*children(){yield*super.children(),yield*this.child_views.values()}async lazy_initialize(){await super.lazy_initialize();const e=this.model.children.filter((e=>!(0,d.isString)(e)));await(0,h.build_views)(this.child_views,e,{parent:this})}remove(){(0,h.remove_views)(this.child_views),super.remove()}render(){const{style:e}=this.model;if(null!=e)if(e instanceof o.Styles)for(const t of e){const e=t.get_value();if((0,d.isString)(e)){const i=t.attr.replace(/_/g,"-");this.el.style.hasOwnProperty(i)&&this.el.style.setProperty(i,e)}}else for(const[t,i]of(0,a.entries)(e)){const e=t.replace(/_/g,"-");this.el.style.hasOwnProperty(e)&&this.el.style.setProperty(e,i)}for(const e of this.model.children)if((0,d.isString)(e)){const t=document.createTextNode(e);this.el.appendChild(t)}else{this.child_views.get(e).render_to(this.el)}this.finish()}}i.DOMElementView=_,_.__name__="DOMElementView";class y extends r.DOMNode{constructor(e){super(e)}}i.DOMElement=y,n=y,y.__name__="DOMElement",n.define((({String:e,Array:t,Dict:i,Or:s,Nullable:l,Ref:n})=>({style:[l(s(n(o.Styles),i(e))),null],children:[t(s(e,n(r.DOMNode),n(c.UIElement))),[]]})))}, function _(e,o,_,n,c){n();const s=e(50),t=e(54);class i extends t.View{}_.ActionView=i,i.__name__="ActionView";class d extends s.Model{constructor(e){super(e)}}_.Action=d,d.__name__="Action",d.__module__="bokeh.models.dom"}, @@ -1471,9 +1471,9 @@

Plots# function _(e,l,t,n,a){var _;n();const o=e(502),s=e(170);class u extends o.PlaceholderView{update(e,l,t){const n=(0,s._get_column_value)(this.model.field,e,l),a=null==n?"???":`${n}`;this.el.textContent=a}}t.ValueRefView=u,u.__name__="ValueRefView";class i extends o.Placeholder{constructor(e){super(e)}}t.ValueRef=i,_=i,i.__name__="ValueRef",_.prototype.default_view=u,_.define((({String:e})=>({field:[e]})))}, function _(e,a,_,n,t){var l,s,i,m;n();const w=e(500);class o extends w.DOMElementView{}_.SpanView=o,o.__name__="SpanView",o.tag_name="span";class d extends w.DOMElement{}_.Span=d,l=d,d.__name__="Span",l.prototype.default_view=o;class p extends w.DOMElementView{}_.DivView=p,p.__name__="DivView",p.tag_name="div";class D extends w.DOMElement{}_.Div=D,s=D,D.__name__="Div",s.prototype.default_view=p;class V extends w.DOMElementView{}_.TableView=V,V.__name__="TableView",V.tag_name="table";class c extends w.DOMElement{}_.Table=c,i=c,c.__name__="Table",i.prototype.default_view=V;class v extends w.DOMElementView{}_.TableRowView=v,v.__name__="TableRowView",v.tag_name="tr";class b extends w.DOMElement{}_.TableRow=b,m=b,b.__name__="TableRow",m.prototype.default_view=v}, function _(e,n,t,l,d){var o;l();const s=e(502);class _ extends s.PlaceholderView{update(e,n,t){this.el.textContent=null==n?"(null)":n.toString()}}t.IndexView=_,_.__name__="IndexView";class a extends s.Placeholder{constructor(e){super(e)}}t.Index=a,o=a,a.__name__="Index",o.prototype.default_view=_}, -function _(e,o,r,t,n){var s;t();const u=e(501),i=e(74),p=e(32);class g extends u.ActionView{update(e,o,r){for(const[e,r]of(0,p.enumerate)(this.model.groups))e.visible=o==r}}r.ToggleGroupView=g,g.__name__="ToggleGroupView";class _ extends u.Action{constructor(e){super(e)}}r.ToggleGroup=_,s=_,_.__name__="ToggleGroup",s.prototype.default_view=g,s.define((({Array:e,Ref:o})=>({groups:[e(o(i.RendererGroup)),[]]})))}, -function _(e,t,n,s,o){var r;s();const i=e(449),a=e(14),l=e(56),c=e(40);class p extends i.DOMNodeView{connect_signals(){super.connect_signals();const{obj:e,attr:t}=this.model;t in e.properties&&this.on_change(e.properties[t],(()=>this.render()))}render(){(0,l.empty)(this.el),this.el.style.display="contents";const e=(()=>{const{obj:e,attr:t}=this.model;if(t in e.properties){const n=e.properties[t].get_value();return(0,c.to_string)(n)}return``})();this.el.textContent=e}}n.ValueOfView=p,p.__name__="ValueOfView";class _ extends i.DOMNode{constructor(e){super(e)}}n.ValueOf=_,r=_,_.__name__="ValueOf",r.prototype.default_view=p,r.define((({String:e,Ref:t})=>({obj:[t(a.HasProps)],attr:[e]})))}, -], 0, {"main":0,"tslib":1,"index":2,"version":3,"embed/index":4,"document/index":5,"document/document":6,"base":7,"core/util/types":8,"core/util/object":9,"core/util/array":10,"core/util/math":11,"core/util/assert":12,"core/util/arrayable":13,"core/has_props":14,"core/signaling":15,"core/util/defer":16,"core/properties":17,"core/logging":18,"core/enums":19,"core/kinds":20,"core/util/color":21,"core/util/svg_colors":22,"core/types":23,"core/util/bitset":24,"core/util/eq":25,"core/util/platform":26,"core/vectorization":27,"core/settings":28,"core/util/ndarray":29,"core/serialization/index":30,"core/serialization/serializer":31,"core/util/iterator":32,"core/serialization/buffer":33,"core/util/buffer":34,"core/serialization/reps":35,"core/diagnostics":36,"core/uniforms":37,"core/util/string":38,"document/events":39,"core/util/pretty":40,"core/util/cloneable":41,"core/patching":42,"core/util/set":43,"core/util/typed_array":44,"core/resolvers":45,"core/serialization/deserializer":46,"core/util/refs":47,"core/util/slice":48,"core/util/version":49,"model":50,"document/defs":51,"core/bokeh_events":52,"embed/standalone":53,"core/view":54,"core/dom_view":55,"core/dom":56,"core/util/bbox":57,"styles/base.css":58,"core/build_views":59,"embed/server":60,"client/connection":61,"protocol/message":62,"protocol/receiver":63,"client/session":64,"embed/dom":65,"embed/notebook":66,"protocol/index":67,"testing":68,"safely":69,"models/main":70,"models/index":71,"models/annotations/index":72,"models/annotations/annotation":73,"models/renderers/renderer":74,"core/visuals/index":75,"core/visuals/line":76,"core/visuals/visual":77,"core/property_mixins":78,"core/visuals/fill":79,"core/visuals/text":80,"core/visuals/hatch":81,"core/visuals/patterns":82,"core/visuals/image":83,"models/coordinates/coordinate_mapping":84,"models/scales/scale":85,"models/transforms/transform":86,"models/ranges/range":87,"models/ranges/range1d":88,"models/scales/linear_scale":89,"models/scales/continuous_scale":90,"models/scales/log_scale":91,"models/scales/categorical_scale":92,"models/ranges/data_range1d":93,"models/ranges/data_range":94,"models/util":95,"models/ranges/factor_range":96,"models/annotations/arrow":97,"models/annotations/data_annotation":98,"models/sources/columnar_data_source":99,"core/selection_manager":100,"models/selections/selection":101,"models/selections/interaction_policy":102,"models/sources/data_source":103,"models/sources/column_data_source":104,"core/util/projections":105,"models/annotations/arrow_head":139,"models/graphics/marking":140,"models/annotations/base_color_bar":141,"models/annotations/title":142,"models/annotations/text_annotation":143,"core/layout/side_panel":144,"core/layout/types":145,"core/layout/layoutable":146,"models/text/base_text":147,"models/text/utils":148,"models/text/math_text":149,"core/util/image":150,"core/graphics":151,"core/util/text":152,"core/util/affine":153,"models/text/providers":154,"core/util/modules":155,"models/text/plain_text":156,"models/canvas/cartesian_frame":157,"models/axes/index":158,"models/axes/axis":159,"models/renderers/guide_renderer":160,"models/tickers/ticker":161,"models/formatters/tick_formatter":162,"models/policies/labeling":163,"models/axes/categorical_axis":164,"models/tickers/categorical_ticker":165,"models/formatters/categorical_tick_formatter":166,"models/axes/continuous_axis":167,"models/axes/datetime_axis":168,"models/formatters/datetime_tick_formatter":169,"core/util/templating":170,"models/tickers/util":174,"models/tickers/datetime_ticker":175,"models/tickers/adaptive_ticker":176,"models/tickers/continuous_ticker":177,"models/tickers/composite_ticker":178,"models/tickers/days_ticker":179,"models/tickers/single_interval_ticker":180,"models/tickers/months_ticker":181,"models/tickers/years_ticker":182,"models/tickers/basic_ticker":183,"models/axes/linear_axis":184,"models/formatters/basic_tick_formatter":185,"models/axes/log_axis":186,"models/formatters/log_tick_formatter":187,"models/tickers/log_ticker":188,"models/axes/mercator_axis":189,"models/formatters/mercator_tick_formatter":190,"models/tickers/mercator_ticker":191,"models/tickers/index":192,"models/tickers/fixed_ticker":193,"models/tickers/binned_ticker":194,"models/mappers/scanning_color_mapper":195,"models/mappers/continuous_color_mapper":196,"models/mappers/color_mapper":197,"models/mappers/mapper":198,"models/renderers/glyph_renderer":199,"models/renderers/data_renderer":200,"models/glyphs/line":201,"models/glyphs/xy_glyph":202,"models/glyphs/glyph":203,"core/util/ragged_array":204,"core/util/spatial":205,"models/graphics/decoration":208,"models/glyphs/utils":209,"core/hittest":210,"models/glyphs/patch":211,"models/glyphs/harea_step":212,"models/glyphs/area":213,"core/util/flip_step_mode":214,"models/glyphs/harea":215,"models/glyphs/varea_step":216,"models/glyphs/varea":217,"models/sources/cds_view":218,"models/filters/filter":219,"models/filters/all_indices":220,"models/filters/intersection_filter":221,"models/formatters/index":222,"models/formatters/customjs_tick_formatter":223,"models/formatters/numeral_tick_formatter":224,"models/formatters/printf_tick_formatter":225,"models/scales/index":226,"models/scales/linear_interpolation_scale":227,"models/ranges/index":228,"core/layout/index":229,"core/layout/alignments":230,"core/layout/grid":231,"core/layout/border":232,"models/annotations/band":233,"models/annotations/upper_lower":234,"models/annotations/box_annotation":235,"models/common/kinds":236,"models/common/painting":237,"models/common/resolve":238,"models/annotations/color_bar":239,"models/mappers/index":240,"models/mappers/categorical_color_mapper":241,"models/mappers/categorical_mapper":242,"models/mappers/categorical_marker_mapper":243,"models/mappers/categorical_pattern_mapper":244,"models/mappers/linear_color_mapper":245,"models/mappers/log_color_mapper":246,"models/mappers/eqhist_color_mapper":247,"models/mappers/stack_color_mapper":248,"models/mappers/weighted_stack_color_mapper":249,"models/annotations/contour_color_bar":250,"models/annotations/label":251,"models/annotations/label_set":252,"models/annotations/legend":253,"models/annotations/legend_item":254,"models/annotations/poly_annotation":255,"models/annotations/slope":256,"models/annotations/span":257,"models/annotations/toolbar_panel":258,"models/tools/toolbar":259,"models/ui/ui_element":260,"models/dom/styles":261,"models/dom/stylesheets":262,"core/util/canvas":263,"core/util/svg":264,"core/util/random":265,"styles/ui.css":266,"models/tools/tool":267,"models/tools/tool_proxy":268,"models/tools/tool_button":269,"core/util/menus":270,"styles/menus.css":271,"styles/icons.css":272,"styles/tool_button.css":273,"models/tools/gestures/gesture_tool":274,"models/tools/on_off_button":275,"models/tools/inspectors/inspect_tool":276,"models/tools/actions/action_tool":277,"models/tools/click_button":278,"models/tools/actions/help_tool":279,"styles/toolbar.css":280,"styles/logo.css":281,"models/annotations/whisker":282,"models/annotations/html/index":283,"models/annotations/html/label":284,"models/annotations/html/text_annotation":285,"models/annotations/html/label_set":286,"models/annotations/html/title":287,"models/callbacks/index":288,"models/callbacks/customjs":289,"models/callbacks/callback":290,"models/callbacks/open_url":291,"models/callbacks/set_value":292,"models/canvas/index":293,"models/canvas/canvas":294,"core/ui_events":295,"core/util/wheel":297,"styles/canvas.css":298,"models/coordinates/index":299,"models/expressions/index":300,"models/expressions/expression":301,"models/expressions/customjs_expr":302,"models/expressions/stack":303,"models/expressions/cumsum":304,"models/expressions/minimum":305,"models/expressions/maximum":306,"models/expressions/coordinate_transform":307,"models/expressions/polar":308,"models/filters/index":309,"models/filters/boolean_filter":310,"models/filters/customjs_filter":311,"models/filters/group_filter":312,"models/filters/index_filter":313,"models/filters/inversion_filter":314,"models/filters/union_filter":315,"models/filters/difference_filter":316,"models/filters/symmetric_difference_filter":317,"models/glyphs/index":318,"models/glyphs/annular_wedge":319,"models/glyphs/annulus":320,"models/glyphs/arc":321,"models/glyphs/bezier":322,"core/util/algorithms":323,"models/glyphs/block":324,"models/glyphs/lrtb":325,"models/glyphs/circle":326,"models/glyphs/ellipse":327,"models/glyphs/center_rotatable":328,"models/glyphs/hbar":329,"models/glyphs/hspan":330,"models/glyphs/hstrip":331,"models/glyphs/hex_tile":332,"models/glyphs/image":333,"models/glyphs/image_base":334,"models/glyphs/image_rgba":335,"models/glyphs/image_stack":336,"models/glyphs/image_url":337,"models/glyphs/multi_line":338,"models/glyphs/multi_polygons":339,"models/glyphs/patches":340,"models/glyphs/quad":341,"models/glyphs/quadratic":342,"models/glyphs/ray":343,"models/glyphs/rect":344,"models/glyphs/scatter":345,"models/glyphs/marker":346,"models/glyphs/defs":347,"models/glyphs/segment":348,"models/glyphs/spline":349,"core/util/interpolation":350,"models/glyphs/step":351,"models/glyphs/text":352,"models/glyphs/vbar":353,"models/glyphs/vspan":354,"models/glyphs/vstrip":355,"models/glyphs/wedge":356,"models/graphics/index":357,"models/graphs/index":358,"models/graphs/graph_hit_test_policy":359,"models/graphs/layout_provider":360,"models/graphs/static_layout_provider":361,"models/grids/index":362,"models/grids/grid":363,"models/layouts/index":364,"models/layouts/column":365,"models/layouts/flex_box":366,"models/layouts/layout_dom":367,"models/menus/menu":368,"models/menus/menu_item":369,"models/layouts/alignments":370,"models/layouts/grid_box":371,"models/layouts/css_grid_box":372,"models/layouts/group_box":373,"styles/group_box.css":374,"models/layouts/hbox":375,"models/layouts/row":376,"models/layouts/scroll_box":377,"models/layouts/spacer":378,"models/layouts/tab_panel":379,"models/layouts/tabs":380,"styles/tabs.css":381,"models/layouts/vbox":382,"models/menus/index":383,"models/menus/action":384,"models/ui/icons/icon":385,"models/menus/check_action":386,"models/menus/section":387,"models/menus/divider":388,"models/text/index":389,"models/transforms/index":390,"models/transforms/customjs_transform":391,"models/transforms/dodge":392,"models/transforms/range_transform":393,"models/transforms/interpolator":394,"models/transforms/jitter":395,"models/random/random_generator":396,"models/transforms/linear_interpolator":397,"models/transforms/step_interpolator":398,"models/plots/index":399,"models/plots/gmap_plot":400,"models/plots/plot":401,"models/plots/plot_canvas":402,"core/util/throttle":403,"models/plots/range_manager":404,"models/plots/state_manager":405,"styles/plots.css":406,"models/plots/gmap_plot_canvas":407,"models/plots/gmap":408,"models/plots/grid_plot":409,"models/plots/figure":410,"models/policies/index":411,"models/random/index":412,"models/random/park_miller_lcg":413,"models/renderers/index":414,"models/renderers/contour_renderer":415,"models/renderers/graph_renderer":416,"models/selections/index":417,"models/selectors/index":418,"models/selectors/by_id":419,"models/selectors/selector":420,"models/selectors/by_class":421,"models/selectors/by_css":422,"models/selectors/by_xpath":423,"models/sources/index":424,"models/sources/server_sent_data_source":425,"models/sources/web_data_source":426,"models/sources/ajax_data_source":427,"models/sources/geojson_data_source":428,"models/tiles/index":429,"models/tiles/bbox_tile_source":430,"models/tiles/mercator_tile_source":431,"models/tiles/tile_source":432,"models/tiles/tile_utils":433,"models/tiles/quadkey_tile_source":434,"models/tiles/tile_renderer":435,"models/tiles/wmts_tile_source":436,"styles/attribution.css":437,"models/tiles/tms_tile_source":438,"models/textures/index":439,"models/textures/canvas_texture":440,"models/textures/texture":441,"models/textures/image_url_texture":442,"models/ui/index":443,"models/ui/icons/index":444,"models/ui/icons/builtin_icon":445,"models/ui/icons/svg_icon":446,"models/ui/icons/tabler_icon":447,"models/ui/dialog":448,"models/dom/dom_node":449,"models/dom/text":450,"styles/dialogs.css":451,"models/ui/examiner":452,"styles/examiner.css":453,"models/ui/pane":454,"models/ui/tooltip":455,"models/dom/html":456,"styles/tooltips.css":457,"models/tools/index":458,"models/tools/actions/index":459,"models/tools/actions/copy_tool":460,"models/tools/actions/custom_action":461,"models/tools/actions/fullscreen_tool":462,"models/tools/actions/examine_tool":463,"models/tools/actions/redo_tool":464,"models/tools/actions/plot_action_tool":465,"models/tools/actions/reset_tool":466,"models/tools/actions/save_tool":467,"models/tools/actions/undo_tool":468,"models/tools/actions/zoom_in_tool":469,"models/tools/actions/zoom_base_tool":470,"core/util/zoom":471,"models/tools/actions/zoom_out_tool":472,"models/tools/edit/index":473,"models/tools/edit/edit_tool":474,"models/tools/edit/box_edit_tool":475,"models/tools/edit/freehand_draw_tool":476,"models/tools/edit/line_edit_tool":477,"models/tools/edit/line_tool":478,"models/tools/edit/point_draw_tool":479,"models/tools/edit/poly_draw_tool":480,"models/tools/edit/poly_tool":481,"models/tools/edit/poly_edit_tool":482,"models/tools/gestures/index":483,"models/tools/gestures/box_select_tool":484,"models/tools/gestures/region_select_tool":485,"models/tools/gestures/select_tool":486,"models/tools/gestures/box_zoom_tool":487,"models/tools/gestures/lasso_select_tool":488,"models/tools/gestures/poly_select_tool":489,"models/tools/gestures/pan_tool":490,"models/tools/gestures/range_tool":491,"models/tools/gestures/tap_tool":492,"models/tools/gestures/wheel_pan_tool":493,"models/tools/gestures/wheel_zoom_tool":494,"models/tools/inspectors/index":495,"models/tools/inspectors/crosshair_tool":496,"models/tools/inspectors/customjs_hover":497,"models/tools/inspectors/hover_tool":498,"models/dom/template":499,"models/dom/dom_element":500,"models/dom/action":501,"models/dom/placeholder":502,"models/dom/index":503,"models/dom/color_ref":504,"models/dom/value_ref":505,"models/dom/elements":506,"models/dom/index_":507,"models/dom/toggle_group":508,"models/dom/value_of":509}, {});}); +function _(e,o,r,t,n){var s;t();const u=e(501),i=e(74),p=e(33);class g extends u.ActionView{update(e,o,r){for(const[e,r]of(0,p.enumerate)(this.model.groups))e.visible=o==r}}r.ToggleGroupView=g,g.__name__="ToggleGroupView";class _ extends u.Action{constructor(e){super(e)}}r.ToggleGroup=_,s=_,_.__name__="ToggleGroup",s.prototype.default_view=g,s.define((({Array:e,Ref:o})=>({groups:[e(o(i.RendererGroup)),[]]})))}, +function _(e,t,n,s,o){var r;s();const i=e(449),a=e(14),l=e(56),c=e(41);class p extends i.DOMNodeView{connect_signals(){super.connect_signals();const{obj:e,attr:t}=this.model;t in e.properties&&this.on_change(e.properties[t],(()=>this.render()))}render(){(0,l.empty)(this.el),this.el.style.display="contents";const e=(()=>{const{obj:e,attr:t}=this.model;if(t in e.properties){const n=e.properties[t].get_value();return(0,c.to_string)(n)}return``})();this.el.textContent=e}}n.ValueOfView=p,p.__name__="ValueOfView";class _ extends i.DOMNode{constructor(e){super(e)}}n.ValueOf=_,r=_,_.__name__="ValueOf",r.prototype.default_view=p,r.define((({String:e,Ref:t})=>({obj:[t(a.HasProps)],attr:[e]})))}, +], 0, {"main":0,"tslib":1,"index":2,"version":3,"embed/index":4,"document/index":5,"document/document":6,"base":7,"core/util/types":8,"core/util/object":9,"core/util/array":10,"core/util/math":11,"core/util/assert":12,"core/util/arrayable":13,"core/has_props":14,"core/signaling":15,"core/util/defer":16,"core/properties":17,"core/logging":18,"core/enums":19,"core/kinds":20,"core/util/color":21,"core/util/svg_colors":22,"core/types":23,"core/util/bitset":24,"core/util/eq":25,"core/util/platform":26,"core/vectorization":27,"core/settings":28,"core/util/ndarray":29,"core/util/cloneable":30,"core/serialization/index":31,"core/serialization/serializer":32,"core/util/iterator":33,"core/serialization/buffer":34,"core/util/buffer":35,"core/serialization/reps":36,"core/diagnostics":37,"core/uniforms":38,"core/util/string":39,"document/events":40,"core/util/pretty":41,"core/patching":42,"core/util/set":43,"core/util/typed_array":44,"core/resolvers":45,"core/serialization/deserializer":46,"core/util/refs":47,"core/util/slice":48,"core/util/version":49,"model":50,"document/defs":51,"core/bokeh_events":52,"embed/standalone":53,"core/view":54,"core/dom_view":55,"core/dom":56,"core/util/bbox":57,"styles/base.css":58,"core/build_views":59,"embed/server":60,"client/connection":61,"protocol/message":62,"protocol/receiver":63,"client/session":64,"embed/dom":65,"embed/notebook":66,"protocol/index":67,"testing":68,"safely":69,"models/main":70,"models/index":71,"models/annotations/index":72,"models/annotations/annotation":73,"models/renderers/renderer":74,"core/visuals/index":75,"core/visuals/line":76,"core/visuals/visual":77,"core/property_mixins":78,"core/visuals/fill":79,"core/visuals/text":80,"core/visuals/hatch":81,"core/visuals/patterns":82,"core/visuals/image":83,"models/coordinates/coordinate_mapping":84,"models/scales/scale":85,"models/transforms/transform":86,"models/ranges/range":87,"models/ranges/range1d":88,"models/scales/linear_scale":89,"models/scales/continuous_scale":90,"models/scales/log_scale":91,"models/scales/categorical_scale":92,"models/ranges/data_range1d":93,"models/ranges/data_range":94,"models/util":95,"models/ranges/factor_range":96,"models/annotations/arrow":97,"models/annotations/data_annotation":98,"models/sources/columnar_data_source":99,"core/selection_manager":100,"models/selections/selection":101,"models/selections/interaction_policy":102,"models/sources/data_source":103,"models/sources/column_data_source":104,"core/util/projections":105,"models/annotations/arrow_head":139,"models/graphics/marking":140,"models/annotations/base_color_bar":141,"models/annotations/title":142,"models/annotations/text_annotation":143,"core/layout/side_panel":144,"core/layout/types":145,"core/layout/layoutable":146,"models/text/base_text":147,"models/text/utils":148,"models/text/math_text":149,"core/util/image":150,"core/graphics":151,"core/util/text":152,"core/util/affine":153,"models/text/providers":154,"core/util/modules":155,"models/text/plain_text":156,"models/canvas/cartesian_frame":157,"models/axes/index":158,"models/axes/axis":159,"models/renderers/guide_renderer":160,"models/tickers/ticker":161,"models/formatters/tick_formatter":162,"models/policies/labeling":163,"models/axes/categorical_axis":164,"models/tickers/categorical_ticker":165,"models/formatters/categorical_tick_formatter":166,"models/axes/continuous_axis":167,"models/axes/datetime_axis":168,"models/formatters/datetime_tick_formatter":169,"core/util/templating":170,"models/tickers/util":174,"models/tickers/datetime_ticker":175,"models/tickers/adaptive_ticker":176,"models/tickers/continuous_ticker":177,"models/tickers/composite_ticker":178,"models/tickers/days_ticker":179,"models/tickers/single_interval_ticker":180,"models/tickers/months_ticker":181,"models/tickers/years_ticker":182,"models/tickers/basic_ticker":183,"models/axes/linear_axis":184,"models/formatters/basic_tick_formatter":185,"models/axes/log_axis":186,"models/formatters/log_tick_formatter":187,"models/tickers/log_ticker":188,"models/axes/mercator_axis":189,"models/formatters/mercator_tick_formatter":190,"models/tickers/mercator_ticker":191,"models/tickers/index":192,"models/tickers/fixed_ticker":193,"models/tickers/binned_ticker":194,"models/mappers/scanning_color_mapper":195,"models/mappers/continuous_color_mapper":196,"models/mappers/color_mapper":197,"models/mappers/mapper":198,"models/renderers/glyph_renderer":199,"models/renderers/data_renderer":200,"models/glyphs/line":201,"models/glyphs/xy_glyph":202,"models/glyphs/glyph":203,"core/util/ragged_array":204,"core/util/spatial":205,"models/graphics/decoration":208,"models/glyphs/utils":209,"core/hittest":210,"models/glyphs/patch":211,"models/glyphs/harea_step":212,"models/glyphs/area":213,"core/util/flip_step_mode":214,"models/glyphs/harea":215,"models/glyphs/varea_step":216,"models/glyphs/varea":217,"models/sources/cds_view":218,"models/filters/filter":219,"models/filters/all_indices":220,"models/filters/intersection_filter":221,"models/formatters/index":222,"models/formatters/customjs_tick_formatter":223,"models/formatters/numeral_tick_formatter":224,"models/formatters/printf_tick_formatter":225,"models/scales/index":226,"models/scales/linear_interpolation_scale":227,"models/ranges/index":228,"core/layout/index":229,"core/layout/alignments":230,"core/layout/grid":231,"core/layout/border":232,"models/annotations/band":233,"models/annotations/upper_lower":234,"models/annotations/box_annotation":235,"models/common/kinds":236,"models/common/painting":237,"models/common/resolve":238,"models/annotations/color_bar":239,"models/mappers/index":240,"models/mappers/categorical_color_mapper":241,"models/mappers/categorical_mapper":242,"models/mappers/categorical_marker_mapper":243,"models/mappers/categorical_pattern_mapper":244,"models/mappers/linear_color_mapper":245,"models/mappers/log_color_mapper":246,"models/mappers/eqhist_color_mapper":247,"models/mappers/stack_color_mapper":248,"models/mappers/weighted_stack_color_mapper":249,"models/annotations/contour_color_bar":250,"models/annotations/label":251,"models/annotations/label_set":252,"models/annotations/legend":253,"models/annotations/legend_item":254,"models/annotations/poly_annotation":255,"models/annotations/slope":256,"models/annotations/span":257,"models/annotations/toolbar_panel":258,"models/tools/toolbar":259,"models/ui/ui_element":260,"models/dom/styles":261,"models/dom/stylesheets":262,"core/util/canvas":263,"core/util/svg":264,"core/util/random":265,"styles/ui.css":266,"models/tools/tool":267,"models/tools/tool_proxy":268,"models/tools/tool_button":269,"core/util/menus":270,"styles/menus.css":271,"styles/icons.css":272,"styles/tool_button.css":273,"models/tools/gestures/gesture_tool":274,"models/tools/on_off_button":275,"models/tools/inspectors/inspect_tool":276,"models/tools/actions/action_tool":277,"models/tools/click_button":278,"models/tools/actions/help_tool":279,"styles/toolbar.css":280,"styles/logo.css":281,"models/annotations/whisker":282,"models/annotations/html/index":283,"models/annotations/html/label":284,"models/annotations/html/text_annotation":285,"models/annotations/html/label_set":286,"models/annotations/html/title":287,"models/callbacks/index":288,"models/callbacks/customjs":289,"models/callbacks/callback":290,"models/callbacks/open_url":291,"models/callbacks/set_value":292,"models/canvas/index":293,"models/canvas/canvas":294,"core/ui_events":295,"core/util/wheel":297,"styles/canvas.css":298,"models/coordinates/index":299,"models/expressions/index":300,"models/expressions/expression":301,"models/expressions/customjs_expr":302,"models/expressions/stack":303,"models/expressions/cumsum":304,"models/expressions/minimum":305,"models/expressions/maximum":306,"models/expressions/coordinate_transform":307,"models/expressions/polar":308,"models/filters/index":309,"models/filters/boolean_filter":310,"models/filters/customjs_filter":311,"models/filters/group_filter":312,"models/filters/index_filter":313,"models/filters/inversion_filter":314,"models/filters/union_filter":315,"models/filters/difference_filter":316,"models/filters/symmetric_difference_filter":317,"models/glyphs/index":318,"models/glyphs/annular_wedge":319,"models/glyphs/annulus":320,"models/glyphs/arc":321,"models/glyphs/bezier":322,"core/util/algorithms":323,"models/glyphs/block":324,"models/glyphs/lrtb":325,"models/glyphs/circle":326,"models/glyphs/ellipse":327,"models/glyphs/center_rotatable":328,"models/glyphs/hbar":329,"models/glyphs/hspan":330,"models/glyphs/hstrip":331,"models/glyphs/hex_tile":332,"models/glyphs/image":333,"models/glyphs/image_base":334,"models/glyphs/image_rgba":335,"models/glyphs/image_stack":336,"models/glyphs/image_url":337,"models/glyphs/multi_line":338,"models/glyphs/multi_polygons":339,"models/glyphs/patches":340,"models/glyphs/quad":341,"models/glyphs/quadratic":342,"models/glyphs/ray":343,"models/glyphs/rect":344,"models/glyphs/scatter":345,"models/glyphs/marker":346,"models/glyphs/defs":347,"models/glyphs/segment":348,"models/glyphs/spline":349,"core/util/interpolation":350,"models/glyphs/step":351,"models/glyphs/text":352,"models/glyphs/vbar":353,"models/glyphs/vspan":354,"models/glyphs/vstrip":355,"models/glyphs/wedge":356,"models/graphics/index":357,"models/graphs/index":358,"models/graphs/graph_hit_test_policy":359,"models/graphs/layout_provider":360,"models/graphs/static_layout_provider":361,"models/grids/index":362,"models/grids/grid":363,"models/layouts/index":364,"models/layouts/column":365,"models/layouts/flex_box":366,"models/layouts/layout_dom":367,"models/menus/menu":368,"models/menus/menu_item":369,"models/layouts/alignments":370,"models/layouts/grid_box":371,"models/layouts/css_grid_box":372,"models/layouts/group_box":373,"styles/group_box.css":374,"models/layouts/hbox":375,"models/layouts/row":376,"models/layouts/scroll_box":377,"models/layouts/spacer":378,"models/layouts/tab_panel":379,"models/layouts/tabs":380,"styles/tabs.css":381,"models/layouts/vbox":382,"models/menus/index":383,"models/menus/action":384,"models/ui/icons/icon":385,"models/menus/check_action":386,"models/menus/section":387,"models/menus/divider":388,"models/text/index":389,"models/transforms/index":390,"models/transforms/customjs_transform":391,"models/transforms/dodge":392,"models/transforms/range_transform":393,"models/transforms/interpolator":394,"models/transforms/jitter":395,"models/random/random_generator":396,"models/transforms/linear_interpolator":397,"models/transforms/step_interpolator":398,"models/plots/index":399,"models/plots/gmap_plot":400,"models/plots/plot":401,"models/plots/plot_canvas":402,"core/util/throttle":403,"models/plots/range_manager":404,"models/plots/state_manager":405,"styles/plots.css":406,"models/plots/gmap_plot_canvas":407,"models/plots/gmap":408,"models/plots/grid_plot":409,"models/plots/figure":410,"models/policies/index":411,"models/random/index":412,"models/random/park_miller_lcg":413,"models/renderers/index":414,"models/renderers/contour_renderer":415,"models/renderers/graph_renderer":416,"models/selections/index":417,"models/selectors/index":418,"models/selectors/by_id":419,"models/selectors/selector":420,"models/selectors/by_class":421,"models/selectors/by_css":422,"models/selectors/by_xpath":423,"models/sources/index":424,"models/sources/server_sent_data_source":425,"models/sources/web_data_source":426,"models/sources/ajax_data_source":427,"models/sources/geojson_data_source":428,"models/tiles/index":429,"models/tiles/bbox_tile_source":430,"models/tiles/mercator_tile_source":431,"models/tiles/tile_source":432,"models/tiles/tile_utils":433,"models/tiles/quadkey_tile_source":434,"models/tiles/tile_renderer":435,"models/tiles/wmts_tile_source":436,"styles/attribution.css":437,"models/tiles/tms_tile_source":438,"models/textures/index":439,"models/textures/canvas_texture":440,"models/textures/texture":441,"models/textures/image_url_texture":442,"models/ui/index":443,"models/ui/icons/index":444,"models/ui/icons/builtin_icon":445,"models/ui/icons/svg_icon":446,"models/ui/icons/tabler_icon":447,"models/ui/dialog":448,"models/dom/dom_node":449,"models/dom/text":450,"styles/dialogs.css":451,"models/ui/examiner":452,"styles/examiner.css":453,"models/ui/pane":454,"models/ui/tooltip":455,"models/dom/html":456,"styles/tooltips.css":457,"models/tools/index":458,"models/tools/actions/index":459,"models/tools/actions/copy_tool":460,"models/tools/actions/custom_action":461,"models/tools/actions/fullscreen_tool":462,"models/tools/actions/examine_tool":463,"models/tools/actions/redo_tool":464,"models/tools/actions/plot_action_tool":465,"models/tools/actions/reset_tool":466,"models/tools/actions/save_tool":467,"models/tools/actions/undo_tool":468,"models/tools/actions/zoom_in_tool":469,"models/tools/actions/zoom_base_tool":470,"core/util/zoom":471,"models/tools/actions/zoom_out_tool":472,"models/tools/edit/index":473,"models/tools/edit/edit_tool":474,"models/tools/edit/box_edit_tool":475,"models/tools/edit/freehand_draw_tool":476,"models/tools/edit/line_edit_tool":477,"models/tools/edit/line_tool":478,"models/tools/edit/point_draw_tool":479,"models/tools/edit/poly_draw_tool":480,"models/tools/edit/poly_tool":481,"models/tools/edit/poly_edit_tool":482,"models/tools/gestures/index":483,"models/tools/gestures/box_select_tool":484,"models/tools/gestures/region_select_tool":485,"models/tools/gestures/select_tool":486,"models/tools/gestures/box_zoom_tool":487,"models/tools/gestures/lasso_select_tool":488,"models/tools/gestures/poly_select_tool":489,"models/tools/gestures/pan_tool":490,"models/tools/gestures/range_tool":491,"models/tools/gestures/tap_tool":492,"models/tools/gestures/wheel_pan_tool":493,"models/tools/gestures/wheel_zoom_tool":494,"models/tools/inspectors/index":495,"models/tools/inspectors/crosshair_tool":496,"models/tools/inspectors/customjs_hover":497,"models/tools/inspectors/hover_tool":498,"models/dom/template":499,"models/dom/dom_element":500,"models/dom/action":501,"models/dom/placeholder":502,"models/dom/index":503,"models/dom/color_ref":504,"models/dom/value_ref":505,"models/dom/elements":506,"models/dom/index_":507,"models/dom/toggle_group":508,"models/dom/value_of":509}, {});}); /* END bokeh.min.js */ @@ -1482,10 +1482,10 @@

Plots# -
+